diff --git a/src/gen_stub.php b/src/gen_stub.php index 3565b900..5e82c458 100755 --- a/src/gen_stub.php +++ b/src/gen_stub.php @@ -4930,6 +4930,9 @@ function parseFunctionLike( if ($param->default instanceof Expr\ClassConstFetch && $param->default->class->toLowerString() === "self") { $defaultValue = getTranslator()->getClassConstValue($func, $name->className->name, $param->default->name->name); + if (!is_string($defaultValue)) { + $defaultValue = var_export($defaultValue, true); + } } else { $defaultValue = $param->default ? $prettyPrinter->prettyPrintExpr($param->default) : null; } diff --git a/tests/aot/const/004.phpt b/tests/aot/const/004.phpt new file mode 100644 index 00000000..9686ee43 --- /dev/null +++ b/tests/aot/const/004.phpt @@ -0,0 +1,33 @@ +--TEST-- +class const default value from self::CV +--FILE-- +bbb(); + $t->bbb(888); +} +?> +--EXPECT-- +int(1) +int(999) +int(1) +int(888)