diff --git a/Zend/tests/gh13145.phpt b/Zend/tests/gh13145.phpt new file mode 100644 index 0000000000000..801944d164890 --- /dev/null +++ b/Zend/tests/gh13145.phpt @@ -0,0 +1,16 @@ +--TEST-- +GH-13145: strtok() misoptimization +--FILE-- + +--EXPECT-- +string(4) "This" +string(2) "is" +string(2) "an" +string(7) "example" +string(6) "string" diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 66b458897adb4..be9b024258ee8 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2337,7 +2337,6 @@ function implode(string|array $separator, ?array $array = null): string {} function join(string|array $separator, ?array $array = null): string {} /** - * @compile-time-eval * @refcount 1 */ function strtok(string $string, ?string $token = null): string|false {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 39500b2b582dc..99e08feddf590 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 487cee0751d47b18bf0a8fbdb050313783f1b369 */ + * Stub hash: 7389d094a842a2289cd32cb37386e5e40ea7e031 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -3087,7 +3087,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(explode, arginfo_explode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(implode, arginfo_implode) ZEND_FALIAS(join, implode, arginfo_join) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtok, arginfo_strtok) + ZEND_FE(strtok, arginfo_strtok) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower) ZEND_FE(str_increment, arginfo_str_increment)