From 8537cff4efe1e853e20cf3e8f4dd75a6a2f1fe89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 3 Mar 2023 23:58:26 +0100 Subject: [PATCH 01/28] Fix #7780, some CTE functions were removed by a mistake --- ext/gd/gd.stub.php | 1 + ext/gd/gd_arginfo.h | 4 ++-- ext/standard/basic_functions.stub.php | 16 +++++++++++++--- ext/standard/basic_functions_arginfo.h | 10 +++++----- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index e3b45cb12f8e7..d91694d60b790 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -541,6 +541,7 @@ function imagesetbrush(GdImage $image, GdImage $brush): bool {} /** @refcount 1 */ function imagecreate(int $width, int $height): GdImage|false {} +/** @compile-time-eval */ function imagetypes(): int {} /** @refcount 1 */ diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 9e4ac86455928..2af01e5290594 100644 --- a/ext/gd/gd_arginfo.h +++ b/ext/gd/gd_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 68be83247e5e142879ce1bc4340c1c5b8a8f670a */ + * Stub hash: fb5acd027fb0f41de2315b088d2a1e14677c1355 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -747,7 +747,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(imagesettile, arginfo_imagesettile) ZEND_FE(imagesetbrush, arginfo_imagesetbrush) ZEND_FE(imagecreate, arginfo_imagecreate) - ZEND_FE(imagetypes, arginfo_imagetypes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(imagetypes, arginfo_imagetypes) ZEND_FE(imagecreatefromstring, arginfo_imagecreatefromstring) #if defined(HAVE_GD_AVIF) ZEND_FE(imagecreatefromavif, arginfo_imagecreatefromavif) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 335974b44c609..976df945e3d00 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1185,7 +1185,10 @@ function array_filter(array $array, ?callable $callback = null, int $mode = 0): function array_map(?callable $callback, array $array, array ...$arrays): array {} -/** @param string|int $key */ +/** + * @param string|int $key + * @compile-time-eval + */ function array_key_exists($key, array $array): bool {} /** @@ -1198,6 +1201,7 @@ function array_chunk(array $array, int $length, bool $preserve_keys = false): ar function array_combine(array $keys, array $values): array {} +/** @compile-time-eval */ function array_is_list(array $array): bool {} /* base64.c */ @@ -1650,10 +1654,16 @@ function dirname(string $path, int $levels = 1): string {} */ function pathinfo(string $path, int $flags = PATHINFO_ALL): array|string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function stristr(string $haystack, string $needle, bool $before_needle = false): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function strstr(string $haystack, string $needle, bool $before_needle = false): string|false {} /** @alias strstr */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index a5b7b9a0dcff8..3107e03d481eb 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: e46c8ef36dc0f29d877ae6e4096135414d0a4412 */ + * Stub hash: c1f9eef4b66269e79a4a01307fdcfc7522447211 */ 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) @@ -2920,11 +2920,11 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_reduce, arginfo_array_reduce) ZEND_FE(array_filter, arginfo_array_filter) ZEND_FE(array_map, arginfo_array_map) - ZEND_FE(array_key_exists, arginfo_array_key_exists) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_exists, arginfo_array_key_exists) ZEND_FALIAS(key_exists, array_key_exists, arginfo_key_exists) ZEND_FE(array_chunk, arginfo_array_chunk) ZEND_FE(array_combine, arginfo_array_combine) - ZEND_FE(array_is_list, arginfo_array_is_list) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_is_list, arginfo_array_is_list) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) ZEND_FE(constant, arginfo_constant) @@ -3089,8 +3089,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(basename, arginfo_basename) ZEND_FE(dirname, arginfo_dirname) ZEND_FE(pathinfo, arginfo_pathinfo) - ZEND_FE(stristr, arginfo_stristr) - ZEND_FE(strstr, arginfo_strstr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stristr, arginfo_stristr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strstr, arginfo_strstr) ZEND_FALIAS(strchr, strstr, arginfo_strchr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpos, arginfo_strpos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripos, arginfo_stripos) From feba3e4c2c935cf009ccec24d5d7b632b650363d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:35:34 +0100 Subject: [PATCH 02/28] ctype_* functions --- ext/ctype/ctype.stub.php | 33 +++++++++++++++++++++++++++++++++ ext/ctype/ctype_arginfo.h | 24 ++++++++++++------------ 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/ext/ctype/ctype.stub.php b/ext/ctype/ctype.stub.php index 8bbc744d5a167..00e80c44baa63 100644 --- a/ext/ctype/ctype.stub.php +++ b/ext/ctype/ctype.stub.php @@ -2,24 +2,57 @@ /** @generate-class-entries */ +/** + * @compile-time-eval + */ function ctype_alnum(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_alpha(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_cntrl(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_digit(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_lower(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_graph(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_print(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_punct(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_space(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_upper(mixed $text): bool {} +/** + * @compile-time-eval + */ function ctype_xdigit(mixed $text): bool {} diff --git a/ext/ctype/ctype_arginfo.h b/ext/ctype/ctype_arginfo.h index 94d783fa9a74f..0c77746b94101 100644 --- a/ext/ctype/ctype_arginfo.h +++ b/ext/ctype/ctype_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 155783e1858a7f24dbc1c3e810d5cffee5468bf7 */ + * Stub hash: 33d776e7f2a7f863ef99c4fdf834c029434e741f */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ctype_alnum, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, text, IS_MIXED, 0) @@ -40,16 +40,16 @@ ZEND_FUNCTION(ctype_xdigit); static const zend_function_entry ext_functions[] = { - ZEND_FE(ctype_alnum, arginfo_ctype_alnum) - ZEND_FE(ctype_alpha, arginfo_ctype_alpha) - ZEND_FE(ctype_cntrl, arginfo_ctype_cntrl) - ZEND_FE(ctype_digit, arginfo_ctype_digit) - ZEND_FE(ctype_lower, arginfo_ctype_lower) - ZEND_FE(ctype_graph, arginfo_ctype_graph) - ZEND_FE(ctype_print, arginfo_ctype_print) - ZEND_FE(ctype_punct, arginfo_ctype_punct) - ZEND_FE(ctype_space, arginfo_ctype_space) - ZEND_FE(ctype_upper, arginfo_ctype_upper) - ZEND_FE(ctype_xdigit, arginfo_ctype_xdigit) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_alnum, arginfo_ctype_alnum) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_alpha, arginfo_ctype_alpha) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_cntrl, arginfo_ctype_cntrl) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_digit, arginfo_ctype_digit) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_lower, arginfo_ctype_lower) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_graph, arginfo_ctype_graph) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_print, arginfo_ctype_print) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_punct, arginfo_ctype_punct) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_space, arginfo_ctype_space) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_upper, arginfo_ctype_upper) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_xdigit, arginfo_ctype_xdigit) ZEND_FE_END }; From c6c4f21bec944bfff2e7ed701e3f19141623f0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:36:12 +0100 Subject: [PATCH 03/28] zlib_* string functions --- ext/zlib/zlib.stub.php | 40 ++++++++++++++++++++++++++++++++-------- ext/zlib/zlib_arginfo.h | 18 +++++++++--------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ext/zlib/zlib.stub.php b/ext/zlib/zlib.stub.php index 1083564f76505..d3ce742d0f946 100644 --- a/ext/zlib/zlib.stub.php +++ b/ext/zlib/zlib.stub.php @@ -179,28 +179,52 @@ function gzopen(string $filename, string $mode, int $use_include_path = 0) {} function readgzfile(string $filename, int $use_include_path = 0): int|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function zlib_encode(string $data, int $encoding, int $level = -1): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function zlib_decode(string $data, int $max_length = 0): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzencode(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_GZIP): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzinflate(string $data, int $max_length = 0): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzdecode(string $data, int $max_length = 0): string|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function gzuncompress(string $data, int $max_length = 0): string|false {} /** diff --git a/ext/zlib/zlib_arginfo.h b/ext/zlib/zlib_arginfo.h index 743662fd036bd..2ed0ded8896d2 100644 --- a/ext/zlib/zlib_arginfo.h +++ b/ext/zlib/zlib_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3660ad3239f93c84b6909c36ddfcc92dd0773c70 */ + * Stub hash: 604aecb62556abba0b3d61e0520cc369d7ec9a93 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) @@ -170,14 +170,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(gzfile, arginfo_gzfile) ZEND_FE(gzopen, arginfo_gzopen) ZEND_FE(readgzfile, arginfo_readgzfile) - ZEND_FE(zlib_encode, arginfo_zlib_encode) - ZEND_FE(zlib_decode, arginfo_zlib_decode) - ZEND_FE(gzdeflate, arginfo_gzdeflate) - ZEND_FE(gzencode, arginfo_gzencode) - ZEND_FE(gzcompress, arginfo_gzcompress) - ZEND_FE(gzinflate, arginfo_gzinflate) - ZEND_FE(gzdecode, arginfo_gzdecode) - ZEND_FE(gzuncompress, arginfo_gzuncompress) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(zlib_encode, arginfo_zlib_encode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(zlib_decode, arginfo_zlib_decode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzdeflate, arginfo_gzdeflate) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzencode, arginfo_gzencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzcompress, arginfo_gzcompress) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzinflate, arginfo_gzinflate) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzdecode, arginfo_gzdecode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzuncompress, arginfo_gzuncompress) ZEND_FALIAS(gzwrite, fwrite, arginfo_gzwrite) ZEND_FALIAS(gzputs, fwrite, arginfo_gzputs) ZEND_FALIAS(gzrewind, rewind, arginfo_gzrewind) From 49f9a89df1ac2dccb7a6303774e50b5910d8b927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:36:49 +0100 Subject: [PATCH 04/28] tokenizer functions --- ext/tokenizer/tokenizer.stub.php | 6 ++++++ ext/tokenizer/tokenizer_arginfo.h | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ext/tokenizer/tokenizer.stub.php b/ext/tokenizer/tokenizer.stub.php index 6017e704aa26a..e2439b938d40d 100644 --- a/ext/tokenizer/tokenizer.stub.php +++ b/ext/tokenizer/tokenizer.stub.php @@ -8,8 +8,14 @@ */ const TOKEN_PARSE = UNKNOWN; +/** + * @compile-time-eval + */ function token_get_all(string $code, int $flags = 0): array {} +/** + * @compile-time-eval + */ function token_name(int $id): string {} class PhpToken implements Stringable diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index 1c81923c8fe6e..121cda4e95540 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a89f03303f8a7d254509ae2bc46a36bb79a3c900 */ + * Stub hash: 507dea12d7e457be0a5860bf57903879c7217c36 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_get_all, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) @@ -44,8 +44,8 @@ ZEND_METHOD(PhpToken, __toString); static const zend_function_entry ext_functions[] = { - ZEND_FE(token_get_all, arginfo_token_get_all) - ZEND_FE(token_name, arginfo_token_name) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(token_get_all, arginfo_token_get_all) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(token_name, arginfo_token_name) ZEND_FE_END }; From f16c3e1265df341207974e808cee506b9ca0b2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:37:54 +0100 Subject: [PATCH 05/28] hash function --- ext/hash/hash.stub.php | 11 ++++++++++- ext/hash/hash_arginfo.h | 12 ++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index 9efd72361cde7..afce26e2641fc 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -8,13 +8,17 @@ */ const HASH_HMAC = UNKNOWN; -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function hash(string $algo, string $data, bool $binary = false, array $options = []): string {} /** @refcount 1 */ function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {} /** + * @compile-time-eval * @refcount 1 */ function hash_hmac(string $algo, string $data, #[\SensitiveParameter] string $key, bool $binary = false): string {} @@ -45,12 +49,14 @@ function hash_copy(HashContext $context): HashContext {} /** * @return array + * @compile-time-eval * @refcount 1 */ function hash_algos(): array {} /** * @return array + * @compile-time-eval * @refcount 1 */ function hash_hmac_algos(): array {} @@ -60,6 +66,9 @@ function hash_hmac_algos(): array {} */ function hash_pbkdf2(string $algo, #[\SensitiveParameter] string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {} +/** + * @compile-time-eval + */ function hash_equals(#[\SensitiveParameter] string $known_string, #[\SensitiveParameter] string $user_string): bool {} /** diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index dca428af029b5..cc5430f9850eb 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7168b9b3d1422d4f8ff9270c5de2f42988a55811 */ + * Stub hash: 966dc874ca53f4f71bd19afa685d6106b7d70bc3 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) @@ -169,9 +169,9 @@ ZEND_METHOD(HashContext, __unserialize); static const zend_function_entry ext_functions[] = { - ZEND_FE(hash, arginfo_hash) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash, arginfo_hash) ZEND_FE(hash_file, arginfo_hash_file) - ZEND_FE(hash_hmac, arginfo_hash_hmac) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_hmac, arginfo_hash_hmac) ZEND_FE(hash_hmac_file, arginfo_hash_hmac_file) ZEND_FE(hash_init, arginfo_hash_init) ZEND_FE(hash_update, arginfo_hash_update) @@ -179,10 +179,10 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(hash_update_file, arginfo_hash_update_file) ZEND_FE(hash_final, arginfo_hash_final) ZEND_FE(hash_copy, arginfo_hash_copy) - ZEND_FE(hash_algos, arginfo_hash_algos) - ZEND_FE(hash_hmac_algos, arginfo_hash_hmac_algos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_algos, arginfo_hash_algos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_hmac_algos, arginfo_hash_hmac_algos) ZEND_FE(hash_pbkdf2, arginfo_hash_pbkdf2) - ZEND_FE(hash_equals, arginfo_hash_equals) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_equals, arginfo_hash_equals) ZEND_FE(hash_hkdf, arginfo_hash_hkdf) #if defined(PHP_MHASH_BC) ZEND_DEP_FE(mhash_get_block_size, arginfo_mhash_get_block_size) From 0f56de5986247ef8c87d6ac1279fd706f30a5c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:40:19 +0100 Subject: [PATCH 06/28] CTE safe basic functions --- ext/standard/basic_functions.stub.php | 332 ++++++++++++++++++++++--- ext/standard/basic_functions_arginfo.h | 220 ++++++++-------- 2 files changed, 406 insertions(+), 146 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 2c51fbbb01b13..5d1b7b591ea0b 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1660,6 +1660,9 @@ function array_unshift(array &$array, mixed ...$values): int {} function array_splice(array &$array, int $offset, ?int $length = null, mixed $replacement = []): array {} +/** + * @compile-time-eval + */ function array_slice(array $array, int $offset, ?int $length = null, bool $preserve_keys = false): array {} /** @@ -1708,14 +1711,21 @@ function array_values(array $array): array {} /** * @return array + * @compile-time-eval * @refcount 1 */ function array_count_values(array $array): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function array_column(array $array, int|string|null $column_key, int|string|null $index_key = null): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function array_reverse(array $array, bool $preserve_keys = false): array {} function array_pad(array $array, int $length, mixed $value): array {} @@ -1738,7 +1748,10 @@ function array_change_key_case(array $array, int $case = CASE_LOWER): array {} */ function array_unique(array $array, int $flags = SORT_STRING): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function array_intersect_key(array $array, array ...$arrays): array {} /** @@ -1747,7 +1760,10 @@ function array_intersect_key(array $array, array ...$arrays): array {} */ function array_intersect_ukey(array $array, ...$rest): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function array_intersect(array $array, array ...$arrays): array {} /** @@ -1756,7 +1772,10 @@ function array_intersect(array $array, array ...$arrays): array {} */ function array_uintersect(array $array, ...$rest): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function array_intersect_assoc(array $array, array ...$arrays): array {} /** @@ -1836,8 +1855,14 @@ function array_multisort(&$array, &...$rest): bool {} /** @return int|string|array */ function array_rand(array $array, int $num = 1): int|string|array {} +/** + * @compile-time-eval + */ function array_sum(array $array): int|float {} +/** + * @compile-time-eval + */ function array_product(array $array): int|float {} function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {} @@ -1858,8 +1883,14 @@ function array_key_exists($key, array $array): bool {} */ function key_exists($key, array $array): bool {} +/** + * @compile-time-eval + */ function array_chunk(array $array, int $length, bool $preserve_keys = false): array {} +/** + * @compile-time-eval + */ function array_combine(array $keys, array $values): array {} /** @compile-time-eval */ @@ -1883,9 +1914,15 @@ function base64_decode(string $string, bool $strict = false): string|false {} function constant(string $name): mixed {} +/** + * @compile-time-eval + */ function ip2long(string $ip): int|false {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function long2ip(int $ip): string|false {} /** @@ -2025,6 +2062,7 @@ function parse_ini_file(string $filename, bool $process_sections = false, int $s /** * @return array|false + * @compile-time-eval * @refcount 1 */ function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {} @@ -2049,6 +2087,7 @@ function sys_getloadavg(): array|false {} /** * @return object|array|false + * @compile-time-eval * @refcount 1 */ function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {} @@ -2060,7 +2099,10 @@ function crc32(string $string): int {} /* crypt.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function crypt(#[\SensitiveParameter] string $string, string $salt): string {} /* datetime.c */ @@ -2069,6 +2111,7 @@ function crypt(#[\SensitiveParameter] string $string, string $salt): string {} /** * @return array|false * @deprecated + * @compile-time-eval * @refcount 1 */ function strptime(string $timestamp, string $format): array|false {} @@ -2139,7 +2182,10 @@ function hrtime(bool $as_number = false): array|int|float|false {} /* md5.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function md5(string $string, bool $binary = false): string {} /** @refcount 1 */ @@ -2159,7 +2205,10 @@ function getlastmod(): int|false {} /* sha1.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function sha1(string $string, bool $binary = false): string {} /** @refcount 1 */ @@ -2176,18 +2225,27 @@ function syslog(int $priority, string $message): true {} // TODO make return typ #endif #ifdef HAVE_INET_NTOP -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function inet_ntop(string $ip): string|false {} #endif #ifdef HAVE_INET_PTON -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function inet_pton(string $ip): string|false {} #endif /* metaphone.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function metaphone(string $string, int $max_phonemes = 0): string {} /* {{{ head.c */ @@ -2253,8 +2311,14 @@ function bin2hex(string $string): string {} */ function hex2bin(string $string): string|false {} +/** + * @compile-time-eval + */ function strspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {} +/** + * @compile-time-eval + */ function strcspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {} #ifdef HAVE_NL_LANGINFO @@ -2276,7 +2340,10 @@ function chop(string $string, string $characters = " \n\r\t\v\0"): string {} /** @compile-time-eval */ function ltrim(string $string, string $characters = " \n\r\t\v\0"): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function wordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false): string {} /** @@ -2294,7 +2361,10 @@ function implode(string|array $separator, ?array $array = null): string {} /** @alias implode */ function join(string|array $separator, ?array $array = null): string {} -/** @refcount 1 */ +/** + * @refcount 1 + * @compile-time-eval + */ function strtok(string $string, ?string $token = null): string|false {} /** @compile-time-eval */ @@ -2342,7 +2412,10 @@ function strrpos(string $haystack, string $needle, int $offset = 0): int|false { /** @compile-time-eval */ function strripos(string $haystack, string $needle, int $offset = 0): int|false {} -/** @refcount 1 */ +/** + * @refcount 1 + * @compile-time-eval + */ function strrchr(string $haystack, string $needle): string|false {} /** @compile-time-eval */ @@ -2354,16 +2427,25 @@ function str_starts_with(string $haystack, string $needle): bool {} /** @compile-time-eval */ function str_ends_with(string $haystack, string $needle): bool {} -/** @refcount 1 */ +/** + * @refcount 1 + * @compile-time-eval + */ function chunk_split(string $string, int $length = 76, string $separator = "\r\n"): string {} /** @compile-time-eval */ function substr(string $string, int $offset, ?int $length = null): string {} -/** @return string|array */ +/** + * @return string|array + * @compile-time-eval + */ function substr_replace(array|string $string, array|string $replace, array|int $offset, array|int|null $length = null): string|array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function quotemeta(string $string): string {} /** @compile-time-eval */ @@ -2387,6 +2469,9 @@ function lcfirst(string $string): string {} */ function ucwords(string $string, string $separators = " \t\r\n\f\v"): string {} +/** + * @compile-time-eval + */ function strtr(string $string, string|array $from, ?string $to = null): string {} /** @@ -2398,14 +2483,26 @@ function strrev(string $string): string {} /** @param float $percent */ function similar_text(string $string1, string $string2, &$percent = null): int {} +/** + * @compile-time-eval + */ function addcslashes(string $string, string $characters): string {} +/** + * @compile-time-eval + */ function addslashes(string $string): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function stripcslashes(string $string): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function stripslashes(string $string): string {} /** @@ -2422,12 +2519,21 @@ function str_replace(array|string $search, array|string $replace, string|array $ */ function str_ireplace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function hebrev(string $string, int $max_chars_per_line = 0): string {} +/** + * @compile-time-eval + */ function nl2br(string $string, bool $use_xhtml = true): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function strip_tags(string $string, array|string|null $allowed_tags = null): string {} /** @@ -2441,6 +2547,7 @@ function parse_str(string $string, &$result): void {} /** * @return array + * @compile-time-eval * @refcount 1 */ function str_getcsv(string $string, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array {} @@ -2450,10 +2557,14 @@ function str_repeat(string $string, int $times): string {} /** * @return array|string + * @compile-time-eval * @refcount 1 */ function count_chars(string $string, int $mode = 0): array|string {} +/** + * @compile-time-eval + */ function strnatcmp(string $string1, string $string2): int {} /** @@ -2462,8 +2573,14 @@ function strnatcmp(string $string1, string $string2): int {} */ function localeconv(): array {} +/** + * @compile-time-eval + */ function strnatcasecmp(string $string1, string $string2): int {} +/** + * @compile-time-eval + */ function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length = null): int {} function str_pad(string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT): string {} @@ -2474,7 +2591,10 @@ function str_pad(string $string, int $length, string $pad_string = " ", int $pad */ function sscanf(string $string, string $format, mixed &...$vars): array|int|null {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function str_rot13(string $string): string {} /** @refcount 1 */ @@ -2482,6 +2602,7 @@ function str_shuffle(string $string): string {} /** * @return array|int + * @compile-time-eval * @refcount 1 */ function str_word_count(string $string, int $format = 0, ?string $characters = null): array|int {} @@ -2492,18 +2613,26 @@ function str_word_count(string $string, int $format = 0, ?string $characters = n */ function str_split(string $string, int $length = 1): array {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function strpbrk(string $string, string $characters): string|false {} +/** + * @compile-time-eval + */ function substr_compare(string $haystack, string $needle, int $offset, ?int $length = null, bool $case_insensitive = false): int {} /** + * @compile-time-eval * @refcount 1 * @deprecated */ function utf8_encode(string $string): string {} /** + * @compile-time-eval * @refcount 1 * @deprecated */ @@ -2838,14 +2967,20 @@ function realpath_cache_size(): int {} /* formatted_print.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function sprintf(string $format, mixed ...$values): string {} function printf(string $format, mixed ...$values): int {} function vprintf(string $format, array $values): int {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function vsprintf(string $format, array $values): string {} /** @param resource $stream */ @@ -2878,10 +3013,16 @@ function http_build_query(array|object $data, string $numeric_prefix = "", ?stri /* image.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function image_type_to_mime_type(int $image_type): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function image_type_to_extension(int $image_type, bool $include_dot = true): string|false {} /** @@ -2962,42 +3103,61 @@ function mail(string $to, string $subject, string $message, array|string $additi /* math.c */ +/** @compile-time-eval */ function abs(int|float $num): int|float {} +/** @compile-time-eval */ function ceil(int|float $num): float {} +/** @compile-time-eval */ function floor(int|float $num): float {} +/** @compile-time-eval */ function round(int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float {} +/** @compile-time-eval */ function sin(float $num): float {} +/** @compile-time-eval */ function cos(float $num): float {} +/** @compile-time-eval */ function tan(float $num): float {} +/** @compile-time-eval */ function asin(float $num): float {} +/** @compile-time-eval */ function acos(float $num): float {} +/** @compile-time-eval */ function atan(float $num): float {} +/** @compile-time-eval */ function atanh(float $num): float {} +/** @compile-time-eval */ function atan2(float $y, float $x): float {} +/** @compile-time-eval */ function sinh(float $num): float {} +/** @compile-time-eval */ function cosh(float $num): float {} +/** @compile-time-eval */ function tanh(float $num): float {} +/** @compile-time-eval */ function asinh(float $num): float {} +/** @compile-time-eval */ function acosh(float $num): float {} +/** @compile-time-eval */ function expm1(float $num): float {} +/** @compile-time-eval */ function log1p(float $num): float {} /** @compile-time-eval */ @@ -3018,18 +3178,25 @@ function is_infinite(float $num): bool {} /** @compile-time-eval */ function pow(mixed $num, mixed $exponent): int|float|object {} +/** @compile-time-eval */ function exp(float $num): float {} +/** @compile-time-eval */ function log(float $num, float $base = M_E): float {} +/** @compile-time-eval */ function log10(float $num): float {} +/** @compile-time-eval */ function sqrt(float $num): float {} +/** @compile-time-eval */ function hypot(float $x, float $y): float {} +/** @compile-time-eval */ function deg2rad(float $num): float {} +/** @compile-time-eval */ function rad2deg(float $num): float {} /** @compile-time-eval */ @@ -3059,14 +3226,26 @@ function decoct(int $num): string {} */ function dechex(int $num): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function base_convert(string $num, int $from_base, int $to_base): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function number_format(float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ","): string {} +/** + * @compile-time-eval + */ function fmod(float $num1, float $num2): float {} +/** + * @compile-time-eval + */ function fdiv(float $num1, float $num2): float {} /* microtime.c */ @@ -3092,11 +3271,15 @@ function getrusage(int $mode = 0): array|false {} /* pack.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function pack(string $format, mixed ...$values): string {} /** * @return array|false + * @compile-time-eval * @refcount 1 */ function unpack(string $format, string $string, int $offset = 0): array|false {} @@ -3105,6 +3288,7 @@ function unpack(string $format, string $string, int $offset = 0): array|false {} /** * @return array + * @compile-time-eval * @refcount 1 */ function password_get_info(string $hash): array {} @@ -3114,10 +3298,19 @@ function password_get_info(string $hash): array {} */ function password_hash(#[\SensitiveParameter] string $password, string|int|null $algo, array $options = []): string {} +/** + * @compile-time-eval + */ function password_needs_rehash(string $hash, string|int|null $algo, array $options = []): bool {} +/** + * @compile-time-eval + */ function password_verify(#[\SensitiveParameter] string $password, string $hash): bool {} +/** + * @compile-time-eval + */ function password_algos(): array {} /* proc_open.c */ @@ -3146,15 +3339,24 @@ function proc_get_status($process): array {} /* quot_print.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function quoted_printable_decode(string $string): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function quoted_printable_encode(string $string): string {} /* soundex.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function soundex(string $string): string {} /* streamsfuncs.c */ @@ -3362,29 +3564,56 @@ function socket_set_timeout($stream, int $seconds, int $microseconds = 0): bool /* type.c */ +/** + * @compile-time-eval + */ function gettype(mixed $value): string {} +/** + * @compile-time-eval + */ function get_debug_type(mixed $value): string {} function settype(mixed &$var, string $type): bool {} +/** + * @compile-time-eval + */ function intval(mixed $value, int $base = 10): int {} +/** + * @compile-time-eval + */ function floatval(mixed $value): float {} /** @alias floatval */ function doubleval(mixed $value): float {} +/** + * @compile-time-eval + */ function boolval(mixed $value): bool {} function strval(mixed $value): string {} +/** + * @compile-time-eval + */ function is_null(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_resource(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_bool(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_int(mixed $value): bool {} /** @alias is_int */ @@ -3393,26 +3622,50 @@ function is_integer(mixed $value): bool {} /** @alias is_int */ function is_long(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_float(mixed $value): bool {} /** @alias is_float */ function is_double(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_numeric(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_string(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_array(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_object(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_scalar(mixed $value): bool {} /** @param string $callable_name */ function is_callable(mixed $value, bool $syntax_only = false, &$callable_name = null): bool {} +/** + * @compile-time-eval + */ function is_iterable(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_countable(mixed $value): bool {} /* uniqid.c */ @@ -3426,6 +3679,7 @@ function uniqid(string $prefix = "", bool $more_entropy = false): string {} /** * @return int|string|array|null|false + * @compile-time-eval * @refcount 1 */ function parse_url(string $url, int $component = -1): int|string|array|null|false {} @@ -3491,10 +3745,16 @@ function stream_filter_register(string $filter_name, string $class): bool {} /* uuencode.c */ -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function convert_uuencode(string $string): string {} -/** @refcount 1 */ +/** + * @compile-time-eval + * @refcount 1 + */ function convert_uudecode(string $string): string|false {} /* var.c */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index fdfea8b3a68ab..f0f77c8125d69 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: a987894d600c2d789faff4ca4833f5d15b00ec4e */ + * Stub hash: f62306b34bcf3a8e978ad1ad75d5789087540984 */ 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) @@ -2881,7 +2881,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_shift, arginfo_array_shift) ZEND_FE(array_unshift, arginfo_array_unshift) ZEND_FE(array_splice, arginfo_array_splice) - ZEND_FE(array_slice, arginfo_array_slice) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_slice, arginfo_array_slice) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge, arginfo_array_merge) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge_recursive, arginfo_array_merge_recursive) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_replace, arginfo_array_replace) @@ -2890,18 +2890,18 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_first, arginfo_array_key_first) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_last, arginfo_array_key_last) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_values, arginfo_array_values) - ZEND_FE(array_count_values, arginfo_array_count_values) - ZEND_FE(array_column, arginfo_array_column) - ZEND_FE(array_reverse, arginfo_array_reverse) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_count_values, arginfo_array_count_values) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_column, arginfo_array_column) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_reverse, arginfo_array_reverse) ZEND_FE(array_pad, arginfo_array_pad) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_flip, arginfo_array_flip) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_change_key_case, arginfo_array_change_key_case) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_unique, arginfo_array_unique) - ZEND_FE(array_intersect_key, arginfo_array_intersect_key) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_key, arginfo_array_intersect_key) ZEND_FE(array_intersect_ukey, arginfo_array_intersect_ukey) - ZEND_FE(array_intersect, arginfo_array_intersect) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect, arginfo_array_intersect) ZEND_FE(array_uintersect, arginfo_array_uintersect) - ZEND_FE(array_intersect_assoc, arginfo_array_intersect_assoc) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_assoc, arginfo_array_intersect_assoc) ZEND_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc) ZEND_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc) ZEND_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc) @@ -2915,21 +2915,21 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc) ZEND_FE(array_multisort, arginfo_array_multisort) ZEND_FE(array_rand, arginfo_array_rand) - ZEND_FE(array_sum, arginfo_array_sum) - ZEND_FE(array_product, arginfo_array_product) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_sum, arginfo_array_sum) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_product, arginfo_array_product) ZEND_FE(array_reduce, arginfo_array_reduce) ZEND_FE(array_filter, arginfo_array_filter) ZEND_FE(array_map, arginfo_array_map) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_exists, arginfo_array_key_exists) ZEND_FALIAS(key_exists, array_key_exists, arginfo_key_exists) - ZEND_FE(array_chunk, arginfo_array_chunk) - ZEND_FE(array_combine, arginfo_array_combine) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_chunk, arginfo_array_chunk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_combine, arginfo_array_combine) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_is_list, arginfo_array_is_list) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) ZEND_FE(constant, arginfo_constant) - ZEND_FE(ip2long, arginfo_ip2long) - ZEND_FE(long2ip, arginfo_long2ip) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ip2long, arginfo_ip2long) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(long2ip, arginfo_long2ip) ZEND_FE(getenv, arginfo_getenv) #if defined(HAVE_PUTENV) ZEND_FE(putenv, arginfo_putenv) @@ -2987,16 +2987,16 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(is_uploaded_file, arginfo_is_uploaded_file) ZEND_FE(move_uploaded_file, arginfo_move_uploaded_file) ZEND_FE(parse_ini_file, arginfo_parse_ini_file) - ZEND_FE(parse_ini_string, arginfo_parse_ini_string) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_ini_string, arginfo_parse_ini_string) #if ZEND_DEBUG ZEND_FE(config_get_hash, arginfo_config_get_hash) #endif #if defined(HAVE_GETLOADAVG) ZEND_FE(sys_getloadavg, arginfo_sys_getloadavg) #endif - ZEND_FE(get_browser, arginfo_get_browser) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_browser, arginfo_get_browser) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crc32, arginfo_crc32) - ZEND_FE(crypt, arginfo_crypt) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crypt, arginfo_crypt) #if defined(HAVE_STRPTIME) ZEND_DEP_FE(strptime, arginfo_strptime) #endif @@ -3028,14 +3028,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(ftok, arginfo_ftok) #endif ZEND_FE(hrtime, arginfo_hrtime) - ZEND_FE(md5, arginfo_md5) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(md5, arginfo_md5) ZEND_FE(md5_file, arginfo_md5_file) ZEND_FE(getmyuid, arginfo_getmyuid) ZEND_FE(getmygid, arginfo_getmygid) ZEND_FE(getmypid, arginfo_getmypid) ZEND_FE(getmyinode, arginfo_getmyinode) ZEND_FE(getlastmod, arginfo_getlastmod) - ZEND_FE(sha1, arginfo_sha1) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sha1, arginfo_sha1) ZEND_FE(sha1_file, arginfo_sha1_file) #if defined(HAVE_SYSLOG_H) ZEND_FE(openlog, arginfo_openlog) @@ -3047,12 +3047,12 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(syslog, arginfo_syslog) #endif #if defined(HAVE_INET_NTOP) - ZEND_FE(inet_ntop, arginfo_inet_ntop) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_ntop, arginfo_inet_ntop) #endif #if defined(HAVE_INET_PTON) - ZEND_FE(inet_pton, arginfo_inet_pton) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_pton, arginfo_inet_pton) #endif - ZEND_FE(metaphone, arginfo_metaphone) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(metaphone, arginfo_metaphone) ZEND_FE(header, arginfo_header) ZEND_FE(header_remove, arginfo_header_remove) ZEND_FE(setrawcookie, arginfo_setrawcookie) @@ -3069,8 +3069,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(assert_options, arginfo_assert_options) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bin2hex, arginfo_bin2hex) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hex2bin, arginfo_hex2bin) - ZEND_FE(strspn, arginfo_strspn) - ZEND_FE(strcspn, arginfo_strcspn) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strspn, arginfo_strspn) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcspn, arginfo_strcspn) #if defined(HAVE_NL_LANGINFO) ZEND_FE(nl_langinfo, arginfo_nl_langinfo) #endif @@ -3079,11 +3079,11 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rtrim, arginfo_rtrim) ZEND_FALIAS(chop, rtrim, arginfo_chop) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ltrim, arginfo_ltrim) - ZEND_FE(wordwrap, arginfo_wordwrap) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(wordwrap, arginfo_wordwrap) 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_FE(strtok, arginfo_strtok) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtok, arginfo_strtok) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower) ZEND_FE(basename, arginfo_basename) @@ -3096,48 +3096,48 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripos, arginfo_stripos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrpos, arginfo_strrpos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strripos, arginfo_strripos) - ZEND_FE(strrchr, arginfo_strrchr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrchr, arginfo_strrchr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_contains, arginfo_str_contains) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_starts_with, arginfo_str_starts_with) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ends_with, arginfo_str_ends_with) - ZEND_FE(chunk_split, arginfo_chunk_split) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chunk_split, arginfo_chunk_split) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr, arginfo_substr) - ZEND_FE(substr_replace, arginfo_substr_replace) - ZEND_FE(quotemeta, arginfo_quotemeta) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_replace, arginfo_substr_replace) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quotemeta, arginfo_quotemeta) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ord, arginfo_ord) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chr, arginfo_chr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucfirst, arginfo_ucfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(lcfirst, arginfo_lcfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucwords, arginfo_ucwords) - ZEND_FE(strtr, arginfo_strtr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtr, arginfo_strtr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrev, arginfo_strrev) ZEND_FE(similar_text, arginfo_similar_text) - ZEND_FE(addcslashes, arginfo_addcslashes) - ZEND_FE(addslashes, arginfo_addslashes) - ZEND_FE(stripcslashes, arginfo_stripcslashes) - ZEND_FE(stripslashes, arginfo_stripslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addcslashes, arginfo_addcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addslashes, arginfo_addslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripcslashes, arginfo_stripcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripslashes, arginfo_stripslashes) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_replace, arginfo_str_replace) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ireplace, arginfo_str_ireplace) - ZEND_FE(hebrev, arginfo_hebrev) - ZEND_FE(nl2br, arginfo_nl2br) - ZEND_FE(strip_tags, arginfo_strip_tags) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hebrev, arginfo_hebrev) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(nl2br, arginfo_nl2br) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) ZEND_FE(setlocale, arginfo_setlocale) ZEND_FE(parse_str, arginfo_parse_str) - ZEND_FE(str_getcsv, arginfo_str_getcsv) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_getcsv, arginfo_str_getcsv) ZEND_FE(str_repeat, arginfo_str_repeat) - ZEND_FE(count_chars, arginfo_count_chars) - ZEND_FE(strnatcmp, arginfo_strnatcmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcmp, arginfo_strnatcmp) ZEND_FE(localeconv, arginfo_localeconv) - ZEND_FE(strnatcasecmp, arginfo_strnatcasecmp) - ZEND_FE(substr_count, arginfo_substr_count) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcasecmp, arginfo_strnatcasecmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) ZEND_FE(str_pad, arginfo_str_pad) ZEND_FE(sscanf, arginfo_sscanf) - ZEND_FE(str_rot13, arginfo_str_rot13) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_rot13, arginfo_str_rot13) ZEND_FE(str_shuffle, arginfo_str_shuffle) - ZEND_FE(str_word_count, arginfo_str_word_count) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_word_count, arginfo_str_word_count) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_split, arginfo_str_split) - ZEND_FE(strpbrk, arginfo_strpbrk) - ZEND_FE(substr_compare, arginfo_substr_compare) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpbrk, arginfo_strpbrk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_compare, arginfo_substr_compare) ZEND_DEP_FE(utf8_encode, arginfo_utf8_encode) ZEND_DEP_FE(utf8_decode, arginfo_utf8_decode) ZEND_FE(opendir, arginfo_opendir) @@ -3241,17 +3241,17 @@ static const zend_function_entry ext_functions[] = { ZEND_FALIAS(diskfreespace, disk_free_space, arginfo_diskfreespace) ZEND_FE(realpath_cache_get, arginfo_realpath_cache_get) ZEND_FE(realpath_cache_size, arginfo_realpath_cache_size) - ZEND_FE(sprintf, arginfo_sprintf) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sprintf, arginfo_sprintf) ZEND_FE(printf, arginfo_printf) ZEND_FE(vprintf, arginfo_vprintf) - ZEND_FE(vsprintf, arginfo_vsprintf) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(vsprintf, arginfo_vsprintf) ZEND_FE(fprintf, arginfo_fprintf) ZEND_FE(vfprintf, arginfo_vfprintf) ZEND_FE(fsockopen, arginfo_fsockopen) ZEND_FE(pfsockopen, arginfo_pfsockopen) ZEND_FE(http_build_query, arginfo_http_build_query) - ZEND_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) - ZEND_FE(image_type_to_extension, arginfo_image_type_to_extension) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_extension, arginfo_image_type_to_extension) ZEND_FE(getimagesize, arginfo_getimagesize) ZEND_FE(getimagesizefromstring, arginfo_getimagesizefromstring) ZEND_FE(phpinfo, arginfo_phpinfo) @@ -3277,48 +3277,48 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(link, arginfo_link) #endif ZEND_FE(mail, arginfo_mail) - ZEND_FE(abs, arginfo_abs) - ZEND_FE(ceil, arginfo_ceil) - ZEND_FE(floor, arginfo_floor) - ZEND_FE(round, arginfo_round) - ZEND_FE(sin, arginfo_sin) - ZEND_FE(cos, arginfo_cos) - ZEND_FE(tan, arginfo_tan) - ZEND_FE(asin, arginfo_asin) - ZEND_FE(acos, arginfo_acos) - ZEND_FE(atan, arginfo_atan) - ZEND_FE(atanh, arginfo_atanh) - ZEND_FE(atan2, arginfo_atan2) - ZEND_FE(sinh, arginfo_sinh) - ZEND_FE(cosh, arginfo_cosh) - ZEND_FE(tanh, arginfo_tanh) - ZEND_FE(asinh, arginfo_asinh) - ZEND_FE(acosh, arginfo_acosh) - ZEND_FE(expm1, arginfo_expm1) - ZEND_FE(log1p, arginfo_log1p) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(abs, arginfo_abs) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ceil, arginfo_ceil) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floor, arginfo_floor) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(round, arginfo_round) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sin, arginfo_sin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cos, arginfo_cos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tan, arginfo_tan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asin, arginfo_asin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acos, arginfo_acos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan, arginfo_atan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atanh, arginfo_atanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan2, arginfo_atan2) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sinh, arginfo_sinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cosh, arginfo_cosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tanh, arginfo_tanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asinh, arginfo_asinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acosh, arginfo_acosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(expm1, arginfo_expm1) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log1p, arginfo_log1p) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pi, arginfo_pi) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_finite, arginfo_is_finite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_nan, arginfo_is_nan) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intdiv, arginfo_intdiv) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_infinite, arginfo_is_infinite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pow, arginfo_pow) - ZEND_FE(exp, arginfo_exp) - ZEND_FE(log, arginfo_log) - ZEND_FE(log10, arginfo_log10) - ZEND_FE(sqrt, arginfo_sqrt) - ZEND_FE(hypot, arginfo_hypot) - ZEND_FE(deg2rad, arginfo_deg2rad) - ZEND_FE(rad2deg, arginfo_rad2deg) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(exp, arginfo_exp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log, arginfo_log) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log10, arginfo_log10) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sqrt, arginfo_sqrt) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hypot, arginfo_hypot) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(deg2rad, arginfo_deg2rad) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rad2deg, arginfo_rad2deg) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bindec, arginfo_bindec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hexdec, arginfo_hexdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(octdec, arginfo_octdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decbin, arginfo_decbin) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decoct, arginfo_decoct) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(dechex, arginfo_dechex) - ZEND_FE(base_convert, arginfo_base_convert) - ZEND_FE(number_format, arginfo_number_format) - ZEND_FE(fmod, arginfo_fmod) - ZEND_FE(fdiv, arginfo_fdiv) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base_convert, arginfo_base_convert) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(number_format, arginfo_number_format) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fmod, arginfo_fmod) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fdiv, arginfo_fdiv) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(microtime, arginfo_microtime) #endif @@ -3328,13 +3328,13 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_GETRUSAGE) ZEND_FE(getrusage, arginfo_getrusage) #endif - ZEND_FE(pack, arginfo_pack) - ZEND_FE(unpack, arginfo_unpack) - ZEND_FE(password_get_info, arginfo_password_get_info) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pack, arginfo_pack) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(unpack, arginfo_unpack) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_get_info, arginfo_password_get_info) ZEND_FE(password_hash, arginfo_password_hash) - ZEND_FE(password_needs_rehash, arginfo_password_needs_rehash) - ZEND_FE(password_verify, arginfo_password_verify) - ZEND_FE(password_algos, arginfo_password_algos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_needs_rehash, arginfo_password_needs_rehash) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_verify, arginfo_password_verify) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_algos, arginfo_password_algos) #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_open, arginfo_proc_open) #endif @@ -3347,9 +3347,9 @@ static const zend_function_entry ext_functions[] = { #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_get_status, arginfo_proc_get_status) #endif - ZEND_FE(quoted_printable_decode, arginfo_quoted_printable_decode) - ZEND_FE(quoted_printable_encode, arginfo_quoted_printable_encode) - ZEND_FE(soundex, arginfo_soundex) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_decode, arginfo_quoted_printable_decode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_encode, arginfo_quoted_printable_encode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(soundex, arginfo_soundex) ZEND_FE(stream_select, arginfo_stream_select) ZEND_FE(stream_context_create, arginfo_stream_context_create) ZEND_FE(stream_context_set_params, arginfo_stream_context_set_params) @@ -3400,34 +3400,34 @@ static const zend_function_entry ext_functions[] = { #if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) ZEND_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_socket_set_timeout) #endif - ZEND_FE(gettype, arginfo_gettype) - ZEND_FE(get_debug_type, arginfo_get_debug_type) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gettype, arginfo_gettype) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_debug_type, arginfo_get_debug_type) ZEND_FE(settype, arginfo_settype) - ZEND_FE(intval, arginfo_intval) - ZEND_FE(floatval, arginfo_floatval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intval, arginfo_intval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floatval, arginfo_floatval) ZEND_FALIAS(doubleval, floatval, arginfo_doubleval) - ZEND_FE(boolval, arginfo_boolval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(boolval, arginfo_boolval) ZEND_FE(strval, arginfo_strval) - ZEND_FE(is_null, arginfo_is_null) - ZEND_FE(is_resource, arginfo_is_resource) - ZEND_FE(is_bool, arginfo_is_bool) - ZEND_FE(is_int, arginfo_is_int) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_null, arginfo_is_null) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_resource, arginfo_is_resource) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_bool, arginfo_is_bool) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_int, arginfo_is_int) ZEND_FALIAS(is_integer, is_int, arginfo_is_integer) ZEND_FALIAS(is_long, is_int, arginfo_is_long) - ZEND_FE(is_float, arginfo_is_float) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_float, arginfo_is_float) ZEND_FALIAS(is_double, is_float, arginfo_is_double) - ZEND_FE(is_numeric, arginfo_is_numeric) - ZEND_FE(is_string, arginfo_is_string) - ZEND_FE(is_array, arginfo_is_array) - ZEND_FE(is_object, arginfo_is_object) - ZEND_FE(is_scalar, arginfo_is_scalar) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_numeric, arginfo_is_numeric) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_string, arginfo_is_string) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_array, arginfo_is_array) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_object, arginfo_is_object) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_scalar, arginfo_is_scalar) ZEND_FE(is_callable, arginfo_is_callable) - ZEND_FE(is_iterable, arginfo_is_iterable) - ZEND_FE(is_countable, arginfo_is_countable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_iterable, arginfo_is_iterable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_countable, arginfo_is_countable) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(uniqid, arginfo_uniqid) #endif - ZEND_FE(parse_url, arginfo_parse_url) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_url, arginfo_parse_url) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urlencode, arginfo_urlencode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urldecode, arginfo_urldecode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rawurlencode, arginfo_rawurlencode) @@ -3439,8 +3439,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(stream_bucket_new, arginfo_stream_bucket_new) ZEND_FE(stream_get_filters, arginfo_stream_get_filters) ZEND_FE(stream_filter_register, arginfo_stream_filter_register) - ZEND_FE(convert_uuencode, arginfo_convert_uuencode) - ZEND_FE(convert_uudecode, arginfo_convert_uudecode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uuencode, arginfo_convert_uuencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uudecode, arginfo_convert_uudecode) ZEND_FE(var_dump, arginfo_var_dump) ZEND_FE(var_export, arginfo_var_export) ZEND_FE(debug_zval_dump, arginfo_debug_zval_dump) From 8e31c3eaba52c7bb3bcbead7441d5164a3af1183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 12:27:12 +0100 Subject: [PATCH 07/28] adjust observer tests --- ext/zend_test/tests/observer_basic_01.phpt | 7 ------- ext/zend_test/tests/observer_basic_02.phpt | 7 ------- ext/zend_test/tests/observer_closure_01.phpt | 7 ------- 3 files changed, 21 deletions(-) diff --git a/ext/zend_test/tests/observer_basic_01.phpt b/ext/zend_test/tests/observer_basic_01.phpt index b208ae2341e85..09876af1226ae 100644 --- a/ext/zend_test/tests/observer_basic_01.phpt +++ b/ext/zend_test/tests/observer_basic_01.phpt @@ -34,9 +34,6 @@ Foo Bar - - - int(6) @@ -47,8 +44,6 @@ int(6) Foo Bar - - int(6) @@ -58,8 +53,6 @@ int(6) Foo Bar - - int(6) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index ac61a8b18e723..574b2a82c7fa1 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -38,9 +38,6 @@ Foo Bar - - - int(6) @@ -51,8 +48,6 @@ int(6) Foo Bar - - int(6) @@ -62,8 +57,6 @@ int(6) Foo Bar - - int(6) diff --git a/ext/zend_test/tests/observer_closure_01.phpt b/ext/zend_test/tests/observer_closure_01.phpt index 2778d277225b1..eaa80c8e6f467 100644 --- a/ext/zend_test/tests/observer_closure_01.phpt +++ b/ext/zend_test/tests/observer_closure_01.phpt @@ -30,9 +30,6 @@ echo 'DONE' . PHP_EOL; Answer <{closure}> - - - int(42) @@ -42,8 +39,6 @@ int(42) <{closure}> Answer <{closure}> - - int(42) @@ -52,8 +47,6 @@ int(42) <{closure}> Answer <{closure}> - - int(42) From f357a7b39880a48e38237f6c8c117ce39c1539ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 13:48:26 +0100 Subject: [PATCH 08/28] never evaluate hash_equals at compile time --- ext/hash/hash.stub.php | 3 --- ext/hash/hash_arginfo.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index afce26e2641fc..5abc307c88366 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -66,9 +66,6 @@ function hash_hmac_algos(): array {} */ function hash_pbkdf2(string $algo, #[\SensitiveParameter] string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {} -/** - * @compile-time-eval - */ function hash_equals(#[\SensitiveParameter] string $known_string, #[\SensitiveParameter] string $user_string): bool {} /** diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index cc5430f9850eb..611261abb54eb 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 966dc874ca53f4f71bd19afa685d6106b7d70bc3 */ + * Stub hash: a251e2194bc72e68610321f92eaf12272a16587f */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) @@ -182,7 +182,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_algos, arginfo_hash_algos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_hmac_algos, arginfo_hash_hmac_algos) ZEND_FE(hash_pbkdf2, arginfo_hash_pbkdf2) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_equals, arginfo_hash_equals) + ZEND_FE(hash_equals, arginfo_hash_equals) ZEND_FE(hash_hkdf, arginfo_hash_hkdf) #if defined(PHP_MHASH_BC) ZEND_DEP_FE(mhash_get_block_size, arginfo_mhash_get_block_size) From 5bed8e64fb402b4d184e4cda205a111ab8db84c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 18:20:53 +0100 Subject: [PATCH 09/28] ctype_lower/ctype_upper is locale dependent --- ext/ctype/ctype.stub.php | 6 ------ ext/ctype/ctype_arginfo.h | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ext/ctype/ctype.stub.php b/ext/ctype/ctype.stub.php index 00e80c44baa63..42f29dc1459c0 100644 --- a/ext/ctype/ctype.stub.php +++ b/ext/ctype/ctype.stub.php @@ -22,9 +22,6 @@ function ctype_cntrl(mixed $text): bool {} */ function ctype_digit(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_lower(mixed $text): bool {} /** @@ -47,9 +44,6 @@ function ctype_punct(mixed $text): bool {} */ function ctype_space(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_upper(mixed $text): bool {} /** diff --git a/ext/ctype/ctype_arginfo.h b/ext/ctype/ctype_arginfo.h index 0c77746b94101..ccccb8ed0f289 100644 --- a/ext/ctype/ctype_arginfo.h +++ b/ext/ctype/ctype_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 33d776e7f2a7f863ef99c4fdf834c029434e741f */ + * Stub hash: f2e6a2cf2e88c3d331c9e3a3af655d144a67f0c7 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ctype_alnum, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, text, IS_MIXED, 0) @@ -44,12 +44,12 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_alpha, arginfo_ctype_alpha) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_cntrl, arginfo_ctype_cntrl) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_digit, arginfo_ctype_digit) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_lower, arginfo_ctype_lower) + ZEND_FE(ctype_lower, arginfo_ctype_lower) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_graph, arginfo_ctype_graph) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_print, arginfo_ctype_print) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_punct, arginfo_ctype_punct) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_space, arginfo_ctype_space) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_upper, arginfo_ctype_upper) + ZEND_FE(ctype_upper, arginfo_ctype_upper) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_xdigit, arginfo_ctype_xdigit) ZEND_FE_END }; From 7b26cff32f033b58b729fe640d5b1faf5f20935f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:36:49 +0100 Subject: [PATCH 10/28] tokenizer returns array of objects --- ext/tokenizer/tokenizer.stub.php | 6 ------ ext/tokenizer/tokenizer_arginfo.h | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ext/tokenizer/tokenizer.stub.php b/ext/tokenizer/tokenizer.stub.php index e2439b938d40d..6017e704aa26a 100644 --- a/ext/tokenizer/tokenizer.stub.php +++ b/ext/tokenizer/tokenizer.stub.php @@ -8,14 +8,8 @@ */ const TOKEN_PARSE = UNKNOWN; -/** - * @compile-time-eval - */ function token_get_all(string $code, int $flags = 0): array {} -/** - * @compile-time-eval - */ function token_name(int $id): string {} class PhpToken implements Stringable diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index 121cda4e95540..1c81923c8fe6e 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 507dea12d7e457be0a5860bf57903879c7217c36 */ + * Stub hash: a89f03303f8a7d254509ae2bc46a36bb79a3c900 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_get_all, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) @@ -44,8 +44,8 @@ ZEND_METHOD(PhpToken, __toString); static const zend_function_entry ext_functions[] = { - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(token_get_all, arginfo_token_get_all) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(token_name, arginfo_token_name) + ZEND_FE(token_get_all, arginfo_token_get_all) + ZEND_FE(token_name, arginfo_token_name) ZEND_FE_END }; From d2ef62501dcdb121ebce54a0bca603afdb91878d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:40:19 +0100 Subject: [PATCH 11/28] revert some unsafe --- ext/standard/basic_functions.stub.php | 14 +- ext/standard/basic_functions_arginfo.h | 220 ++++++++++++------------- 2 files changed, 113 insertions(+), 121 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 5d1b7b591ea0b..99b9b5b20e4a2 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2087,7 +2087,6 @@ function sys_getloadavg(): array|false {} /** * @return object|array|false - * @compile-time-eval * @refcount 1 */ function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {} @@ -3288,7 +3287,6 @@ function unpack(string $format, string $string, int $offset = 0): array|false {} /** * @return array - * @compile-time-eval * @refcount 1 */ function password_get_info(string $hash): array {} @@ -3298,14 +3296,8 @@ function password_get_info(string $hash): array {} */ function password_hash(#[\SensitiveParameter] string $password, string|int|null $algo, array $options = []): string {} -/** - * @compile-time-eval - */ function password_needs_rehash(string $hash, string|int|null $algo, array $options = []): bool {} -/** - * @compile-time-eval - */ function password_verify(#[\SensitiveParameter] string $password, string $hash): bool {} /** @@ -3594,16 +3586,16 @@ function doubleval(mixed $value): float {} */ function boolval(mixed $value): bool {} -function strval(mixed $value): string {} - /** * @compile-time-eval */ -function is_null(mixed $value): bool {} +function strval(mixed $value): string {} /** * @compile-time-eval */ +function is_null(mixed $value): bool {} + function is_resource(mixed $value): bool {} /** diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index f0f77c8125d69..fdfea8b3a68ab 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: f62306b34bcf3a8e978ad1ad75d5789087540984 */ + * Stub hash: a987894d600c2d789faff4ca4833f5d15b00ec4e */ 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) @@ -2881,7 +2881,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_shift, arginfo_array_shift) ZEND_FE(array_unshift, arginfo_array_unshift) ZEND_FE(array_splice, arginfo_array_splice) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_slice, arginfo_array_slice) + ZEND_FE(array_slice, arginfo_array_slice) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge, arginfo_array_merge) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge_recursive, arginfo_array_merge_recursive) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_replace, arginfo_array_replace) @@ -2890,18 +2890,18 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_first, arginfo_array_key_first) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_last, arginfo_array_key_last) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_values, arginfo_array_values) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_count_values, arginfo_array_count_values) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_column, arginfo_array_column) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_reverse, arginfo_array_reverse) + ZEND_FE(array_count_values, arginfo_array_count_values) + ZEND_FE(array_column, arginfo_array_column) + ZEND_FE(array_reverse, arginfo_array_reverse) ZEND_FE(array_pad, arginfo_array_pad) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_flip, arginfo_array_flip) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_change_key_case, arginfo_array_change_key_case) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_unique, arginfo_array_unique) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_key, arginfo_array_intersect_key) + ZEND_FE(array_intersect_key, arginfo_array_intersect_key) ZEND_FE(array_intersect_ukey, arginfo_array_intersect_ukey) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect, arginfo_array_intersect) + ZEND_FE(array_intersect, arginfo_array_intersect) ZEND_FE(array_uintersect, arginfo_array_uintersect) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_assoc, arginfo_array_intersect_assoc) + ZEND_FE(array_intersect_assoc, arginfo_array_intersect_assoc) ZEND_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc) ZEND_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc) ZEND_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc) @@ -2915,21 +2915,21 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc) ZEND_FE(array_multisort, arginfo_array_multisort) ZEND_FE(array_rand, arginfo_array_rand) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_sum, arginfo_array_sum) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_product, arginfo_array_product) + ZEND_FE(array_sum, arginfo_array_sum) + ZEND_FE(array_product, arginfo_array_product) ZEND_FE(array_reduce, arginfo_array_reduce) ZEND_FE(array_filter, arginfo_array_filter) ZEND_FE(array_map, arginfo_array_map) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_exists, arginfo_array_key_exists) ZEND_FALIAS(key_exists, array_key_exists, arginfo_key_exists) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_chunk, arginfo_array_chunk) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_combine, arginfo_array_combine) + ZEND_FE(array_chunk, arginfo_array_chunk) + ZEND_FE(array_combine, arginfo_array_combine) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_is_list, arginfo_array_is_list) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) ZEND_FE(constant, arginfo_constant) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ip2long, arginfo_ip2long) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(long2ip, arginfo_long2ip) + ZEND_FE(ip2long, arginfo_ip2long) + ZEND_FE(long2ip, arginfo_long2ip) ZEND_FE(getenv, arginfo_getenv) #if defined(HAVE_PUTENV) ZEND_FE(putenv, arginfo_putenv) @@ -2987,16 +2987,16 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(is_uploaded_file, arginfo_is_uploaded_file) ZEND_FE(move_uploaded_file, arginfo_move_uploaded_file) ZEND_FE(parse_ini_file, arginfo_parse_ini_file) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_ini_string, arginfo_parse_ini_string) + ZEND_FE(parse_ini_string, arginfo_parse_ini_string) #if ZEND_DEBUG ZEND_FE(config_get_hash, arginfo_config_get_hash) #endif #if defined(HAVE_GETLOADAVG) ZEND_FE(sys_getloadavg, arginfo_sys_getloadavg) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_browser, arginfo_get_browser) + ZEND_FE(get_browser, arginfo_get_browser) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crc32, arginfo_crc32) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crypt, arginfo_crypt) + ZEND_FE(crypt, arginfo_crypt) #if defined(HAVE_STRPTIME) ZEND_DEP_FE(strptime, arginfo_strptime) #endif @@ -3028,14 +3028,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(ftok, arginfo_ftok) #endif ZEND_FE(hrtime, arginfo_hrtime) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(md5, arginfo_md5) + ZEND_FE(md5, arginfo_md5) ZEND_FE(md5_file, arginfo_md5_file) ZEND_FE(getmyuid, arginfo_getmyuid) ZEND_FE(getmygid, arginfo_getmygid) ZEND_FE(getmypid, arginfo_getmypid) ZEND_FE(getmyinode, arginfo_getmyinode) ZEND_FE(getlastmod, arginfo_getlastmod) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sha1, arginfo_sha1) + ZEND_FE(sha1, arginfo_sha1) ZEND_FE(sha1_file, arginfo_sha1_file) #if defined(HAVE_SYSLOG_H) ZEND_FE(openlog, arginfo_openlog) @@ -3047,12 +3047,12 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(syslog, arginfo_syslog) #endif #if defined(HAVE_INET_NTOP) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_ntop, arginfo_inet_ntop) + ZEND_FE(inet_ntop, arginfo_inet_ntop) #endif #if defined(HAVE_INET_PTON) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_pton, arginfo_inet_pton) + ZEND_FE(inet_pton, arginfo_inet_pton) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(metaphone, arginfo_metaphone) + ZEND_FE(metaphone, arginfo_metaphone) ZEND_FE(header, arginfo_header) ZEND_FE(header_remove, arginfo_header_remove) ZEND_FE(setrawcookie, arginfo_setrawcookie) @@ -3069,8 +3069,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(assert_options, arginfo_assert_options) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bin2hex, arginfo_bin2hex) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hex2bin, arginfo_hex2bin) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strspn, arginfo_strspn) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcspn, arginfo_strcspn) + ZEND_FE(strspn, arginfo_strspn) + ZEND_FE(strcspn, arginfo_strcspn) #if defined(HAVE_NL_LANGINFO) ZEND_FE(nl_langinfo, arginfo_nl_langinfo) #endif @@ -3079,11 +3079,11 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rtrim, arginfo_rtrim) ZEND_FALIAS(chop, rtrim, arginfo_chop) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ltrim, arginfo_ltrim) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(wordwrap, arginfo_wordwrap) + ZEND_FE(wordwrap, arginfo_wordwrap) 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(basename, arginfo_basename) @@ -3096,48 +3096,48 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripos, arginfo_stripos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrpos, arginfo_strrpos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strripos, arginfo_strripos) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrchr, arginfo_strrchr) + ZEND_FE(strrchr, arginfo_strrchr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_contains, arginfo_str_contains) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_starts_with, arginfo_str_starts_with) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ends_with, arginfo_str_ends_with) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chunk_split, arginfo_chunk_split) + ZEND_FE(chunk_split, arginfo_chunk_split) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr, arginfo_substr) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_replace, arginfo_substr_replace) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quotemeta, arginfo_quotemeta) + ZEND_FE(substr_replace, arginfo_substr_replace) + ZEND_FE(quotemeta, arginfo_quotemeta) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ord, arginfo_ord) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chr, arginfo_chr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucfirst, arginfo_ucfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(lcfirst, arginfo_lcfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucwords, arginfo_ucwords) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtr, arginfo_strtr) + ZEND_FE(strtr, arginfo_strtr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrev, arginfo_strrev) ZEND_FE(similar_text, arginfo_similar_text) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addcslashes, arginfo_addcslashes) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addslashes, arginfo_addslashes) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripcslashes, arginfo_stripcslashes) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripslashes, arginfo_stripslashes) + ZEND_FE(addcslashes, arginfo_addcslashes) + ZEND_FE(addslashes, arginfo_addslashes) + ZEND_FE(stripcslashes, arginfo_stripcslashes) + ZEND_FE(stripslashes, arginfo_stripslashes) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_replace, arginfo_str_replace) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ireplace, arginfo_str_ireplace) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hebrev, arginfo_hebrev) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(nl2br, arginfo_nl2br) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) + ZEND_FE(hebrev, arginfo_hebrev) + ZEND_FE(nl2br, arginfo_nl2br) + ZEND_FE(strip_tags, arginfo_strip_tags) ZEND_FE(setlocale, arginfo_setlocale) ZEND_FE(parse_str, arginfo_parse_str) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_getcsv, arginfo_str_getcsv) + ZEND_FE(str_getcsv, arginfo_str_getcsv) ZEND_FE(str_repeat, arginfo_str_repeat) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcmp, arginfo_strnatcmp) + ZEND_FE(count_chars, arginfo_count_chars) + ZEND_FE(strnatcmp, arginfo_strnatcmp) ZEND_FE(localeconv, arginfo_localeconv) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcasecmp, arginfo_strnatcasecmp) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) + ZEND_FE(strnatcasecmp, arginfo_strnatcasecmp) + ZEND_FE(substr_count, arginfo_substr_count) ZEND_FE(str_pad, arginfo_str_pad) ZEND_FE(sscanf, arginfo_sscanf) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_rot13, arginfo_str_rot13) + ZEND_FE(str_rot13, arginfo_str_rot13) ZEND_FE(str_shuffle, arginfo_str_shuffle) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_word_count, arginfo_str_word_count) + ZEND_FE(str_word_count, arginfo_str_word_count) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_split, arginfo_str_split) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpbrk, arginfo_strpbrk) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_compare, arginfo_substr_compare) + ZEND_FE(strpbrk, arginfo_strpbrk) + ZEND_FE(substr_compare, arginfo_substr_compare) ZEND_DEP_FE(utf8_encode, arginfo_utf8_encode) ZEND_DEP_FE(utf8_decode, arginfo_utf8_decode) ZEND_FE(opendir, arginfo_opendir) @@ -3241,17 +3241,17 @@ static const zend_function_entry ext_functions[] = { ZEND_FALIAS(diskfreespace, disk_free_space, arginfo_diskfreespace) ZEND_FE(realpath_cache_get, arginfo_realpath_cache_get) ZEND_FE(realpath_cache_size, arginfo_realpath_cache_size) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sprintf, arginfo_sprintf) + ZEND_FE(sprintf, arginfo_sprintf) ZEND_FE(printf, arginfo_printf) ZEND_FE(vprintf, arginfo_vprintf) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(vsprintf, arginfo_vsprintf) + ZEND_FE(vsprintf, arginfo_vsprintf) ZEND_FE(fprintf, arginfo_fprintf) ZEND_FE(vfprintf, arginfo_vfprintf) ZEND_FE(fsockopen, arginfo_fsockopen) ZEND_FE(pfsockopen, arginfo_pfsockopen) ZEND_FE(http_build_query, arginfo_http_build_query) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_extension, arginfo_image_type_to_extension) + ZEND_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) + ZEND_FE(image_type_to_extension, arginfo_image_type_to_extension) ZEND_FE(getimagesize, arginfo_getimagesize) ZEND_FE(getimagesizefromstring, arginfo_getimagesizefromstring) ZEND_FE(phpinfo, arginfo_phpinfo) @@ -3277,48 +3277,48 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(link, arginfo_link) #endif ZEND_FE(mail, arginfo_mail) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(abs, arginfo_abs) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ceil, arginfo_ceil) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floor, arginfo_floor) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(round, arginfo_round) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sin, arginfo_sin) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cos, arginfo_cos) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tan, arginfo_tan) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asin, arginfo_asin) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acos, arginfo_acos) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan, arginfo_atan) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atanh, arginfo_atanh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan2, arginfo_atan2) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sinh, arginfo_sinh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cosh, arginfo_cosh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tanh, arginfo_tanh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asinh, arginfo_asinh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acosh, arginfo_acosh) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(expm1, arginfo_expm1) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log1p, arginfo_log1p) + ZEND_FE(abs, arginfo_abs) + ZEND_FE(ceil, arginfo_ceil) + ZEND_FE(floor, arginfo_floor) + ZEND_FE(round, arginfo_round) + ZEND_FE(sin, arginfo_sin) + ZEND_FE(cos, arginfo_cos) + ZEND_FE(tan, arginfo_tan) + ZEND_FE(asin, arginfo_asin) + ZEND_FE(acos, arginfo_acos) + ZEND_FE(atan, arginfo_atan) + ZEND_FE(atanh, arginfo_atanh) + ZEND_FE(atan2, arginfo_atan2) + ZEND_FE(sinh, arginfo_sinh) + ZEND_FE(cosh, arginfo_cosh) + ZEND_FE(tanh, arginfo_tanh) + ZEND_FE(asinh, arginfo_asinh) + ZEND_FE(acosh, arginfo_acosh) + ZEND_FE(expm1, arginfo_expm1) + ZEND_FE(log1p, arginfo_log1p) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pi, arginfo_pi) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_finite, arginfo_is_finite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_nan, arginfo_is_nan) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intdiv, arginfo_intdiv) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_infinite, arginfo_is_infinite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pow, arginfo_pow) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(exp, arginfo_exp) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log, arginfo_log) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log10, arginfo_log10) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sqrt, arginfo_sqrt) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hypot, arginfo_hypot) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(deg2rad, arginfo_deg2rad) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rad2deg, arginfo_rad2deg) + ZEND_FE(exp, arginfo_exp) + ZEND_FE(log, arginfo_log) + ZEND_FE(log10, arginfo_log10) + ZEND_FE(sqrt, arginfo_sqrt) + ZEND_FE(hypot, arginfo_hypot) + ZEND_FE(deg2rad, arginfo_deg2rad) + ZEND_FE(rad2deg, arginfo_rad2deg) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bindec, arginfo_bindec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hexdec, arginfo_hexdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(octdec, arginfo_octdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decbin, arginfo_decbin) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decoct, arginfo_decoct) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(dechex, arginfo_dechex) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base_convert, arginfo_base_convert) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(number_format, arginfo_number_format) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fmod, arginfo_fmod) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fdiv, arginfo_fdiv) + ZEND_FE(base_convert, arginfo_base_convert) + ZEND_FE(number_format, arginfo_number_format) + ZEND_FE(fmod, arginfo_fmod) + ZEND_FE(fdiv, arginfo_fdiv) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(microtime, arginfo_microtime) #endif @@ -3328,13 +3328,13 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_GETRUSAGE) ZEND_FE(getrusage, arginfo_getrusage) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pack, arginfo_pack) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(unpack, arginfo_unpack) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_get_info, arginfo_password_get_info) + ZEND_FE(pack, arginfo_pack) + ZEND_FE(unpack, arginfo_unpack) + ZEND_FE(password_get_info, arginfo_password_get_info) ZEND_FE(password_hash, arginfo_password_hash) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_needs_rehash, arginfo_password_needs_rehash) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_verify, arginfo_password_verify) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_algos, arginfo_password_algos) + ZEND_FE(password_needs_rehash, arginfo_password_needs_rehash) + ZEND_FE(password_verify, arginfo_password_verify) + ZEND_FE(password_algos, arginfo_password_algos) #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_open, arginfo_proc_open) #endif @@ -3347,9 +3347,9 @@ static const zend_function_entry ext_functions[] = { #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_get_status, arginfo_proc_get_status) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_decode, arginfo_quoted_printable_decode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_encode, arginfo_quoted_printable_encode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(soundex, arginfo_soundex) + ZEND_FE(quoted_printable_decode, arginfo_quoted_printable_decode) + ZEND_FE(quoted_printable_encode, arginfo_quoted_printable_encode) + ZEND_FE(soundex, arginfo_soundex) ZEND_FE(stream_select, arginfo_stream_select) ZEND_FE(stream_context_create, arginfo_stream_context_create) ZEND_FE(stream_context_set_params, arginfo_stream_context_set_params) @@ -3400,34 +3400,34 @@ static const zend_function_entry ext_functions[] = { #if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) ZEND_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_socket_set_timeout) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gettype, arginfo_gettype) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_debug_type, arginfo_get_debug_type) + ZEND_FE(gettype, arginfo_gettype) + ZEND_FE(get_debug_type, arginfo_get_debug_type) ZEND_FE(settype, arginfo_settype) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intval, arginfo_intval) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floatval, arginfo_floatval) + ZEND_FE(intval, arginfo_intval) + ZEND_FE(floatval, arginfo_floatval) ZEND_FALIAS(doubleval, floatval, arginfo_doubleval) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(boolval, arginfo_boolval) + ZEND_FE(boolval, arginfo_boolval) ZEND_FE(strval, arginfo_strval) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_null, arginfo_is_null) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_resource, arginfo_is_resource) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_bool, arginfo_is_bool) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_int, arginfo_is_int) + ZEND_FE(is_null, arginfo_is_null) + ZEND_FE(is_resource, arginfo_is_resource) + ZEND_FE(is_bool, arginfo_is_bool) + ZEND_FE(is_int, arginfo_is_int) ZEND_FALIAS(is_integer, is_int, arginfo_is_integer) ZEND_FALIAS(is_long, is_int, arginfo_is_long) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_float, arginfo_is_float) + ZEND_FE(is_float, arginfo_is_float) ZEND_FALIAS(is_double, is_float, arginfo_is_double) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_numeric, arginfo_is_numeric) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_string, arginfo_is_string) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_array, arginfo_is_array) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_object, arginfo_is_object) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_scalar, arginfo_is_scalar) + ZEND_FE(is_numeric, arginfo_is_numeric) + ZEND_FE(is_string, arginfo_is_string) + ZEND_FE(is_array, arginfo_is_array) + ZEND_FE(is_object, arginfo_is_object) + ZEND_FE(is_scalar, arginfo_is_scalar) ZEND_FE(is_callable, arginfo_is_callable) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_iterable, arginfo_is_iterable) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_countable, arginfo_is_countable) + ZEND_FE(is_iterable, arginfo_is_iterable) + ZEND_FE(is_countable, arginfo_is_countable) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(uniqid, arginfo_uniqid) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_url, arginfo_parse_url) + ZEND_FE(parse_url, arginfo_parse_url) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urlencode, arginfo_urlencode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urldecode, arginfo_urldecode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rawurlencode, arginfo_rawurlencode) @@ -3439,8 +3439,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(stream_bucket_new, arginfo_stream_bucket_new) ZEND_FE(stream_get_filters, arginfo_stream_get_filters) ZEND_FE(stream_filter_register, arginfo_stream_filter_register) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uuencode, arginfo_convert_uuencode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uudecode, arginfo_convert_uudecode) + ZEND_FE(convert_uuencode, arginfo_convert_uuencode) + ZEND_FE(convert_uudecode, arginfo_convert_uudecode) ZEND_FE(var_dump, arginfo_var_dump) ZEND_FE(var_export, arginfo_var_export) ZEND_FE(debug_zval_dump, arginfo_debug_zval_dump) From 11ec8282df353b5390f10d41b48728d3e09c40ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 12:27:12 +0100 Subject: [PATCH 12/28] Revert "adjust observer tests" This reverts commit 8e31c3eaba52c7bb3bcbead7441d5164a3af1183. --- ext/zend_test/tests/observer_basic_01.phpt | 7 +++++++ ext/zend_test/tests/observer_basic_02.phpt | 7 +++++++ ext/zend_test/tests/observer_closure_01.phpt | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/ext/zend_test/tests/observer_basic_01.phpt b/ext/zend_test/tests/observer_basic_01.phpt index 09876af1226ae..b208ae2341e85 100644 --- a/ext/zend_test/tests/observer_basic_01.phpt +++ b/ext/zend_test/tests/observer_basic_01.phpt @@ -34,6 +34,9 @@ Foo Bar + + + int(6) @@ -44,6 +47,8 @@ int(6) Foo Bar + + int(6) @@ -53,6 +58,8 @@ int(6) Foo Bar + + int(6) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index 574b2a82c7fa1..ac61a8b18e723 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -38,6 +38,9 @@ Foo Bar + + + int(6) @@ -48,6 +51,8 @@ int(6) Foo Bar + + int(6) @@ -57,6 +62,8 @@ int(6) Foo Bar + + int(6) diff --git a/ext/zend_test/tests/observer_closure_01.phpt b/ext/zend_test/tests/observer_closure_01.phpt index eaa80c8e6f467..2778d277225b1 100644 --- a/ext/zend_test/tests/observer_closure_01.phpt +++ b/ext/zend_test/tests/observer_closure_01.phpt @@ -30,6 +30,9 @@ echo 'DONE' . PHP_EOL; Answer <{closure}> + + + int(42) @@ -39,6 +42,8 @@ int(42) <{closure}> Answer <{closure}> + + int(42) @@ -47,6 +52,8 @@ int(42) <{closure}> Answer <{closure}> + + int(42) From 59cf58522912f3e754bd5aae95541bcd0405300e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 18:47:55 +0100 Subject: [PATCH 13/28] replace array_sum with array_reduce on observer tests --- ext/zend_test/tests/observer_basic_01.phpt | 35 +++++++++++++++----- ext/zend_test/tests/observer_basic_02.phpt | 35 +++++++++++++++----- ext/zend_test/tests/observer_closure_01.phpt | 29 +++++++++++----- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/ext/zend_test/tests/observer_basic_01.phpt b/ext/zend_test/tests/observer_basic_01.phpt index b208ae2341e85..bdbaa1dd10259 100644 --- a/ext/zend_test/tests/observer_basic_01.phpt +++ b/ext/zend_test/tests/observer_basic_01.phpt @@ -10,7 +10,7 @@ zend_test.observer.observe_all=1 function bar() { echo 'Bar' . PHP_EOL; - var_dump(array_sum([1,2,3])); + var_dump(array_reduce([1, 2, 3], fn ($a, $b) => $a + $b)); } function foo() @@ -34,9 +34,16 @@ Foo Bar - - - + + + + <{closure}> + + <{closure}> + + <{closure}> + + int(6) @@ -47,8 +54,14 @@ int(6) Foo Bar - - + + <{closure}> + + <{closure}> + + <{closure}> + + int(6) @@ -58,8 +71,14 @@ int(6) Foo Bar - - + + <{closure}> + + <{closure}> + + <{closure}> + + int(6) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index ac61a8b18e723..91bd905989e56 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -12,7 +12,7 @@ class TestClass private function bar() { echo 'Bar' . PHP_EOL; - var_dump(array_sum([1,2,3])); + var_dump(array_reduce([1, 2, 3], fn ($a, $b) => $a + $b)); } public function foo() @@ -38,9 +38,16 @@ Foo Bar - - - + + + + + + + + + + int(6) @@ -51,8 +58,14 @@ int(6) Foo Bar - - + + + + + + + + int(6) @@ -62,8 +75,14 @@ int(6) Foo Bar - - + + + + + + + + int(6) diff --git a/ext/zend_test/tests/observer_closure_01.phpt b/ext/zend_test/tests/observer_closure_01.phpt index 2778d277225b1..aefed5bd4563a 100644 --- a/ext/zend_test/tests/observer_closure_01.phpt +++ b/ext/zend_test/tests/observer_closure_01.phpt @@ -8,7 +8,7 @@ zend_test.observer.observe_all=1 --FILE-- $a + $b)); }; $foo = function($bar) { @@ -30,9 +30,14 @@ echo 'DONE' . PHP_EOL; Answer <{closure}> - - - + + + + <{closure}> + + <{closure}> + + int(42) @@ -42,8 +47,12 @@ int(42) <{closure}> Answer <{closure}> - - + + <{closure}> + + <{closure}> + + int(42) @@ -52,8 +61,12 @@ int(42) <{closure}> Answer <{closure}> - - + + <{closure}> + + <{closure}> + + int(42) From 745d49103087c84fc6a09f3e1522c8e7d038e6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 6 Mar 2023 17:26:56 +0100 Subject: [PATCH 14/28] fix phpdoc order for consistency --- ext/standard/basic_functions.stub.php | 20 +-- ext/standard/basic_functions_arginfo.h | 212 ++++++++++++------------- 2 files changed, 116 insertions(+), 116 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 99b9b5b20e4a2..d89fa8812a735 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1732,14 +1732,14 @@ function array_pad(array $array, int $length, mixed $value): array {} /** * @return array - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function array_flip(array $array): array {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function array_change_key_case(array $array, int $case = CASE_LOWER): array {} @@ -1797,15 +1797,15 @@ function array_intersect_uassoc(array $array, ...$rest): array {} function array_uintersect_uassoc(array $array, ...$rest): array {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function array_diff_key(array $array, array ...$arrays): array {} /** * @param array|callable $rest - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function array_diff_ukey(array $array, ...$rest): array {} @@ -1821,8 +1821,8 @@ function array_diff(array $array, array ...$arrays): array {} function array_udiff(array $array, ...$rest): array {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function array_diff_assoc(array $array, array ...$arrays): array {} @@ -1899,8 +1899,8 @@ function array_is_list(array $array): bool {} /* base64.c */ /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function base64_encode(string $string): string {} @@ -2347,8 +2347,8 @@ function wordwrap(string $string, int $width = 75, string $break = "\n", bool $c /** * @return array - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function explode(string $separator, string $string, int $limit = PHP_INT_MAX): array {} @@ -2361,8 +2361,8 @@ function implode(string|array $separator, ?array $array = null): string {} function join(string|array $separator, ?array $array = null): string {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function strtok(string $string, ?string $token = null): string|false {} @@ -2412,8 +2412,8 @@ function strrpos(string $haystack, string $needle, int $offset = 0): int|false { function strripos(string $haystack, string $needle, int $offset = 0): int|false {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function strrchr(string $haystack, string $needle): string|false {} @@ -2427,8 +2427,8 @@ function str_starts_with(string $haystack, string $needle): bool {} function str_ends_with(string $haystack, string $needle): bool {} /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function chunk_split(string $string, int $length = 76, string $separator = "\r\n"): string {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index fdfea8b3a68ab..a9ea85ca4d587 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: a987894d600c2d789faff4ca4833f5d15b00ec4e */ + * Stub hash: 9cd92edb6d645c181b88e3864e478bbf64824722 */ 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) @@ -2881,7 +2881,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_shift, arginfo_array_shift) ZEND_FE(array_unshift, arginfo_array_unshift) ZEND_FE(array_splice, arginfo_array_splice) - ZEND_FE(array_slice, arginfo_array_slice) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_slice, arginfo_array_slice) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge, arginfo_array_merge) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge_recursive, arginfo_array_merge_recursive) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_replace, arginfo_array_replace) @@ -2890,18 +2890,18 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_first, arginfo_array_key_first) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_last, arginfo_array_key_last) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_values, arginfo_array_values) - ZEND_FE(array_count_values, arginfo_array_count_values) - ZEND_FE(array_column, arginfo_array_column) - ZEND_FE(array_reverse, arginfo_array_reverse) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_count_values, arginfo_array_count_values) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_column, arginfo_array_column) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_reverse, arginfo_array_reverse) ZEND_FE(array_pad, arginfo_array_pad) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_flip, arginfo_array_flip) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_change_key_case, arginfo_array_change_key_case) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_unique, arginfo_array_unique) - ZEND_FE(array_intersect_key, arginfo_array_intersect_key) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_key, arginfo_array_intersect_key) ZEND_FE(array_intersect_ukey, arginfo_array_intersect_ukey) - ZEND_FE(array_intersect, arginfo_array_intersect) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect, arginfo_array_intersect) ZEND_FE(array_uintersect, arginfo_array_uintersect) - ZEND_FE(array_intersect_assoc, arginfo_array_intersect_assoc) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_assoc, arginfo_array_intersect_assoc) ZEND_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc) ZEND_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc) ZEND_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc) @@ -2915,21 +2915,21 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc) ZEND_FE(array_multisort, arginfo_array_multisort) ZEND_FE(array_rand, arginfo_array_rand) - ZEND_FE(array_sum, arginfo_array_sum) - ZEND_FE(array_product, arginfo_array_product) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_sum, arginfo_array_sum) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_product, arginfo_array_product) ZEND_FE(array_reduce, arginfo_array_reduce) ZEND_FE(array_filter, arginfo_array_filter) ZEND_FE(array_map, arginfo_array_map) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_exists, arginfo_array_key_exists) ZEND_FALIAS(key_exists, array_key_exists, arginfo_key_exists) - ZEND_FE(array_chunk, arginfo_array_chunk) - ZEND_FE(array_combine, arginfo_array_combine) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_chunk, arginfo_array_chunk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_combine, arginfo_array_combine) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_is_list, arginfo_array_is_list) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) ZEND_FE(constant, arginfo_constant) - ZEND_FE(ip2long, arginfo_ip2long) - ZEND_FE(long2ip, arginfo_long2ip) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ip2long, arginfo_ip2long) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(long2ip, arginfo_long2ip) ZEND_FE(getenv, arginfo_getenv) #if defined(HAVE_PUTENV) ZEND_FE(putenv, arginfo_putenv) @@ -2987,7 +2987,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(is_uploaded_file, arginfo_is_uploaded_file) ZEND_FE(move_uploaded_file, arginfo_move_uploaded_file) ZEND_FE(parse_ini_file, arginfo_parse_ini_file) - ZEND_FE(parse_ini_string, arginfo_parse_ini_string) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_ini_string, arginfo_parse_ini_string) #if ZEND_DEBUG ZEND_FE(config_get_hash, arginfo_config_get_hash) #endif @@ -2996,7 +2996,7 @@ static const zend_function_entry ext_functions[] = { #endif ZEND_FE(get_browser, arginfo_get_browser) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crc32, arginfo_crc32) - ZEND_FE(crypt, arginfo_crypt) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crypt, arginfo_crypt) #if defined(HAVE_STRPTIME) ZEND_DEP_FE(strptime, arginfo_strptime) #endif @@ -3028,14 +3028,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(ftok, arginfo_ftok) #endif ZEND_FE(hrtime, arginfo_hrtime) - ZEND_FE(md5, arginfo_md5) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(md5, arginfo_md5) ZEND_FE(md5_file, arginfo_md5_file) ZEND_FE(getmyuid, arginfo_getmyuid) ZEND_FE(getmygid, arginfo_getmygid) ZEND_FE(getmypid, arginfo_getmypid) ZEND_FE(getmyinode, arginfo_getmyinode) ZEND_FE(getlastmod, arginfo_getlastmod) - ZEND_FE(sha1, arginfo_sha1) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sha1, arginfo_sha1) ZEND_FE(sha1_file, arginfo_sha1_file) #if defined(HAVE_SYSLOG_H) ZEND_FE(openlog, arginfo_openlog) @@ -3047,12 +3047,12 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(syslog, arginfo_syslog) #endif #if defined(HAVE_INET_NTOP) - ZEND_FE(inet_ntop, arginfo_inet_ntop) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_ntop, arginfo_inet_ntop) #endif #if defined(HAVE_INET_PTON) - ZEND_FE(inet_pton, arginfo_inet_pton) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_pton, arginfo_inet_pton) #endif - ZEND_FE(metaphone, arginfo_metaphone) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(metaphone, arginfo_metaphone) ZEND_FE(header, arginfo_header) ZEND_FE(header_remove, arginfo_header_remove) ZEND_FE(setrawcookie, arginfo_setrawcookie) @@ -3069,8 +3069,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(assert_options, arginfo_assert_options) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bin2hex, arginfo_bin2hex) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hex2bin, arginfo_hex2bin) - ZEND_FE(strspn, arginfo_strspn) - ZEND_FE(strcspn, arginfo_strcspn) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strspn, arginfo_strspn) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcspn, arginfo_strcspn) #if defined(HAVE_NL_LANGINFO) ZEND_FE(nl_langinfo, arginfo_nl_langinfo) #endif @@ -3079,11 +3079,11 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rtrim, arginfo_rtrim) ZEND_FALIAS(chop, rtrim, arginfo_chop) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ltrim, arginfo_ltrim) - ZEND_FE(wordwrap, arginfo_wordwrap) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(wordwrap, arginfo_wordwrap) 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_FE(strtok, arginfo_strtok) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtok, arginfo_strtok) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower) ZEND_FE(basename, arginfo_basename) @@ -3096,48 +3096,48 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripos, arginfo_stripos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrpos, arginfo_strrpos) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strripos, arginfo_strripos) - ZEND_FE(strrchr, arginfo_strrchr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrchr, arginfo_strrchr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_contains, arginfo_str_contains) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_starts_with, arginfo_str_starts_with) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ends_with, arginfo_str_ends_with) - ZEND_FE(chunk_split, arginfo_chunk_split) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chunk_split, arginfo_chunk_split) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr, arginfo_substr) - ZEND_FE(substr_replace, arginfo_substr_replace) - ZEND_FE(quotemeta, arginfo_quotemeta) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_replace, arginfo_substr_replace) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quotemeta, arginfo_quotemeta) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ord, arginfo_ord) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chr, arginfo_chr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucfirst, arginfo_ucfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(lcfirst, arginfo_lcfirst) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucwords, arginfo_ucwords) - ZEND_FE(strtr, arginfo_strtr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtr, arginfo_strtr) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrev, arginfo_strrev) ZEND_FE(similar_text, arginfo_similar_text) - ZEND_FE(addcslashes, arginfo_addcslashes) - ZEND_FE(addslashes, arginfo_addslashes) - ZEND_FE(stripcslashes, arginfo_stripcslashes) - ZEND_FE(stripslashes, arginfo_stripslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addcslashes, arginfo_addcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addslashes, arginfo_addslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripcslashes, arginfo_stripcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripslashes, arginfo_stripslashes) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_replace, arginfo_str_replace) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ireplace, arginfo_str_ireplace) - ZEND_FE(hebrev, arginfo_hebrev) - ZEND_FE(nl2br, arginfo_nl2br) - ZEND_FE(strip_tags, arginfo_strip_tags) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hebrev, arginfo_hebrev) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(nl2br, arginfo_nl2br) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) ZEND_FE(setlocale, arginfo_setlocale) ZEND_FE(parse_str, arginfo_parse_str) - ZEND_FE(str_getcsv, arginfo_str_getcsv) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_getcsv, arginfo_str_getcsv) ZEND_FE(str_repeat, arginfo_str_repeat) - ZEND_FE(count_chars, arginfo_count_chars) - ZEND_FE(strnatcmp, arginfo_strnatcmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcmp, arginfo_strnatcmp) ZEND_FE(localeconv, arginfo_localeconv) - ZEND_FE(strnatcasecmp, arginfo_strnatcasecmp) - ZEND_FE(substr_count, arginfo_substr_count) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcasecmp, arginfo_strnatcasecmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) ZEND_FE(str_pad, arginfo_str_pad) ZEND_FE(sscanf, arginfo_sscanf) - ZEND_FE(str_rot13, arginfo_str_rot13) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_rot13, arginfo_str_rot13) ZEND_FE(str_shuffle, arginfo_str_shuffle) - ZEND_FE(str_word_count, arginfo_str_word_count) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_word_count, arginfo_str_word_count) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_split, arginfo_str_split) - ZEND_FE(strpbrk, arginfo_strpbrk) - ZEND_FE(substr_compare, arginfo_substr_compare) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpbrk, arginfo_strpbrk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_compare, arginfo_substr_compare) ZEND_DEP_FE(utf8_encode, arginfo_utf8_encode) ZEND_DEP_FE(utf8_decode, arginfo_utf8_decode) ZEND_FE(opendir, arginfo_opendir) @@ -3241,17 +3241,17 @@ static const zend_function_entry ext_functions[] = { ZEND_FALIAS(diskfreespace, disk_free_space, arginfo_diskfreespace) ZEND_FE(realpath_cache_get, arginfo_realpath_cache_get) ZEND_FE(realpath_cache_size, arginfo_realpath_cache_size) - ZEND_FE(sprintf, arginfo_sprintf) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sprintf, arginfo_sprintf) ZEND_FE(printf, arginfo_printf) ZEND_FE(vprintf, arginfo_vprintf) - ZEND_FE(vsprintf, arginfo_vsprintf) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(vsprintf, arginfo_vsprintf) ZEND_FE(fprintf, arginfo_fprintf) ZEND_FE(vfprintf, arginfo_vfprintf) ZEND_FE(fsockopen, arginfo_fsockopen) ZEND_FE(pfsockopen, arginfo_pfsockopen) ZEND_FE(http_build_query, arginfo_http_build_query) - ZEND_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) - ZEND_FE(image_type_to_extension, arginfo_image_type_to_extension) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_extension, arginfo_image_type_to_extension) ZEND_FE(getimagesize, arginfo_getimagesize) ZEND_FE(getimagesizefromstring, arginfo_getimagesizefromstring) ZEND_FE(phpinfo, arginfo_phpinfo) @@ -3277,48 +3277,48 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(link, arginfo_link) #endif ZEND_FE(mail, arginfo_mail) - ZEND_FE(abs, arginfo_abs) - ZEND_FE(ceil, arginfo_ceil) - ZEND_FE(floor, arginfo_floor) - ZEND_FE(round, arginfo_round) - ZEND_FE(sin, arginfo_sin) - ZEND_FE(cos, arginfo_cos) - ZEND_FE(tan, arginfo_tan) - ZEND_FE(asin, arginfo_asin) - ZEND_FE(acos, arginfo_acos) - ZEND_FE(atan, arginfo_atan) - ZEND_FE(atanh, arginfo_atanh) - ZEND_FE(atan2, arginfo_atan2) - ZEND_FE(sinh, arginfo_sinh) - ZEND_FE(cosh, arginfo_cosh) - ZEND_FE(tanh, arginfo_tanh) - ZEND_FE(asinh, arginfo_asinh) - ZEND_FE(acosh, arginfo_acosh) - ZEND_FE(expm1, arginfo_expm1) - ZEND_FE(log1p, arginfo_log1p) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(abs, arginfo_abs) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ceil, arginfo_ceil) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floor, arginfo_floor) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(round, arginfo_round) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sin, arginfo_sin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cos, arginfo_cos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tan, arginfo_tan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asin, arginfo_asin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acos, arginfo_acos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan, arginfo_atan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atanh, arginfo_atanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan2, arginfo_atan2) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sinh, arginfo_sinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cosh, arginfo_cosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tanh, arginfo_tanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asinh, arginfo_asinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acosh, arginfo_acosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(expm1, arginfo_expm1) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log1p, arginfo_log1p) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pi, arginfo_pi) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_finite, arginfo_is_finite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_nan, arginfo_is_nan) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intdiv, arginfo_intdiv) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_infinite, arginfo_is_infinite) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pow, arginfo_pow) - ZEND_FE(exp, arginfo_exp) - ZEND_FE(log, arginfo_log) - ZEND_FE(log10, arginfo_log10) - ZEND_FE(sqrt, arginfo_sqrt) - ZEND_FE(hypot, arginfo_hypot) - ZEND_FE(deg2rad, arginfo_deg2rad) - ZEND_FE(rad2deg, arginfo_rad2deg) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(exp, arginfo_exp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log, arginfo_log) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log10, arginfo_log10) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sqrt, arginfo_sqrt) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hypot, arginfo_hypot) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(deg2rad, arginfo_deg2rad) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rad2deg, arginfo_rad2deg) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bindec, arginfo_bindec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hexdec, arginfo_hexdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(octdec, arginfo_octdec) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decbin, arginfo_decbin) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decoct, arginfo_decoct) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(dechex, arginfo_dechex) - ZEND_FE(base_convert, arginfo_base_convert) - ZEND_FE(number_format, arginfo_number_format) - ZEND_FE(fmod, arginfo_fmod) - ZEND_FE(fdiv, arginfo_fdiv) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base_convert, arginfo_base_convert) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(number_format, arginfo_number_format) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fmod, arginfo_fmod) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fdiv, arginfo_fdiv) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(microtime, arginfo_microtime) #endif @@ -3328,13 +3328,13 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_GETRUSAGE) ZEND_FE(getrusage, arginfo_getrusage) #endif - ZEND_FE(pack, arginfo_pack) - ZEND_FE(unpack, arginfo_unpack) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pack, arginfo_pack) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(unpack, arginfo_unpack) ZEND_FE(password_get_info, arginfo_password_get_info) ZEND_FE(password_hash, arginfo_password_hash) ZEND_FE(password_needs_rehash, arginfo_password_needs_rehash) ZEND_FE(password_verify, arginfo_password_verify) - ZEND_FE(password_algos, arginfo_password_algos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_algos, arginfo_password_algos) #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_open, arginfo_proc_open) #endif @@ -3347,9 +3347,9 @@ static const zend_function_entry ext_functions[] = { #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_FE(proc_get_status, arginfo_proc_get_status) #endif - ZEND_FE(quoted_printable_decode, arginfo_quoted_printable_decode) - ZEND_FE(quoted_printable_encode, arginfo_quoted_printable_encode) - ZEND_FE(soundex, arginfo_soundex) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_decode, arginfo_quoted_printable_decode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_encode, arginfo_quoted_printable_encode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(soundex, arginfo_soundex) ZEND_FE(stream_select, arginfo_stream_select) ZEND_FE(stream_context_create, arginfo_stream_context_create) ZEND_FE(stream_context_set_params, arginfo_stream_context_set_params) @@ -3400,34 +3400,34 @@ static const zend_function_entry ext_functions[] = { #if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) ZEND_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_socket_set_timeout) #endif - ZEND_FE(gettype, arginfo_gettype) - ZEND_FE(get_debug_type, arginfo_get_debug_type) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gettype, arginfo_gettype) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_debug_type, arginfo_get_debug_type) ZEND_FE(settype, arginfo_settype) - ZEND_FE(intval, arginfo_intval) - ZEND_FE(floatval, arginfo_floatval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intval, arginfo_intval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floatval, arginfo_floatval) ZEND_FALIAS(doubleval, floatval, arginfo_doubleval) - ZEND_FE(boolval, arginfo_boolval) - ZEND_FE(strval, arginfo_strval) - ZEND_FE(is_null, arginfo_is_null) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(boolval, arginfo_boolval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strval, arginfo_strval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_null, arginfo_is_null) ZEND_FE(is_resource, arginfo_is_resource) - ZEND_FE(is_bool, arginfo_is_bool) - ZEND_FE(is_int, arginfo_is_int) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_bool, arginfo_is_bool) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_int, arginfo_is_int) ZEND_FALIAS(is_integer, is_int, arginfo_is_integer) ZEND_FALIAS(is_long, is_int, arginfo_is_long) - ZEND_FE(is_float, arginfo_is_float) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_float, arginfo_is_float) ZEND_FALIAS(is_double, is_float, arginfo_is_double) - ZEND_FE(is_numeric, arginfo_is_numeric) - ZEND_FE(is_string, arginfo_is_string) - ZEND_FE(is_array, arginfo_is_array) - ZEND_FE(is_object, arginfo_is_object) - ZEND_FE(is_scalar, arginfo_is_scalar) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_numeric, arginfo_is_numeric) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_string, arginfo_is_string) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_array, arginfo_is_array) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_object, arginfo_is_object) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_scalar, arginfo_is_scalar) ZEND_FE(is_callable, arginfo_is_callable) - ZEND_FE(is_iterable, arginfo_is_iterable) - ZEND_FE(is_countable, arginfo_is_countable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_iterable, arginfo_is_iterable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_countable, arginfo_is_countable) #if defined(HAVE_GETTIMEOFDAY) ZEND_FE(uniqid, arginfo_uniqid) #endif - ZEND_FE(parse_url, arginfo_parse_url) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_url, arginfo_parse_url) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urlencode, arginfo_urlencode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urldecode, arginfo_urldecode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rawurlencode, arginfo_rawurlencode) @@ -3439,8 +3439,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(stream_bucket_new, arginfo_stream_bucket_new) ZEND_FE(stream_get_filters, arginfo_stream_get_filters) ZEND_FE(stream_filter_register, arginfo_stream_filter_register) - ZEND_FE(convert_uuencode, arginfo_convert_uuencode) - ZEND_FE(convert_uudecode, arginfo_convert_uudecode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uuencode, arginfo_convert_uuencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uudecode, arginfo_convert_uudecode) ZEND_FE(var_dump, arginfo_var_dump) ZEND_FE(var_export, arginfo_var_export) ZEND_FE(debug_zval_dump, arginfo_debug_zval_dump) From dca71d9dca29d806d48a6c178edf7cd4ac3989e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 6 Mar 2023 17:29:27 +0100 Subject: [PATCH 15/28] add xfail --- ext/zend_test/tests/observer_basic_02.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index 91bd905989e56..ac0da39a94365 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -2,6 +2,8 @@ Observer: Basic observability of userland methods --EXTENSIONS-- zend_test +--XFAIL-- +Result is not consistent /wo and /w opcache - see GH-10782 --INI-- zend_test.observer.enabled=1 zend_test.observer.observe_all=1 From 6ef8fd1b091a13a9809fe5002a02c3be8730fd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 7 Mar 2023 10:20:27 +0100 Subject: [PATCH 16/28] hash can be slow, do not evaluate it as CTE --- ext/hash/hash.stub.php | 6 +----- ext/hash/hash_arginfo.h | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index 5abc307c88366..e0439c67bf23d 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -8,17 +8,13 @@ */ const HASH_HMAC = UNKNOWN; -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function hash(string $algo, string $data, bool $binary = false, array $options = []): string {} /** @refcount 1 */ function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {} /** - * @compile-time-eval * @refcount 1 */ function hash_hmac(string $algo, string $data, #[\SensitiveParameter] string $key, bool $binary = false): string {} diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index 611261abb54eb..d52a5979cb10e 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a251e2194bc72e68610321f92eaf12272a16587f */ + * Stub hash: 8838801d9789d4b77d57b290d993ee37784bbd1f */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) @@ -169,9 +169,9 @@ ZEND_METHOD(HashContext, __unserialize); static const zend_function_entry ext_functions[] = { - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash, arginfo_hash) + ZEND_FE(hash, arginfo_hash) ZEND_FE(hash_file, arginfo_hash_file) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_hmac, arginfo_hash_hmac) + ZEND_FE(hash_hmac, arginfo_hash_hmac) ZEND_FE(hash_hmac_file, arginfo_hash_hmac_file) ZEND_FE(hash_init, arginfo_hash_init) ZEND_FE(hash_update, arginfo_hash_update) From 16cb1602445ef41df62766ddedd424578ce125ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 7 Mar 2023 13:27:35 +0100 Subject: [PATCH 17/28] sprintf functions are locale dependent --- ext/standard/basic_functions.stub.php | 10 ++-------- ext/standard/basic_functions_arginfo.h | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index d89fa8812a735..6990eb9f37949 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2966,20 +2966,14 @@ function realpath_cache_size(): int {} /* formatted_print.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function sprintf(string $format, mixed ...$values): string {} function printf(string $format, mixed ...$values): int {} function vprintf(string $format, array $values): int {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function vsprintf(string $format, array $values): string {} /** @param resource $stream */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index a9ea85ca4d587..486f201ff8f2c 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: 9cd92edb6d645c181b88e3864e478bbf64824722 */ + * Stub hash: c2ac556c9d2aa455b709bee66520059ae9614538 */ 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) @@ -3241,10 +3241,10 @@ static const zend_function_entry ext_functions[] = { ZEND_FALIAS(diskfreespace, disk_free_space, arginfo_diskfreespace) ZEND_FE(realpath_cache_get, arginfo_realpath_cache_get) ZEND_FE(realpath_cache_size, arginfo_realpath_cache_size) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sprintf, arginfo_sprintf) + ZEND_FE(sprintf, arginfo_sprintf) ZEND_FE(printf, arginfo_printf) ZEND_FE(vprintf, arginfo_vprintf) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(vsprintf, arginfo_vsprintf) + ZEND_FE(vsprintf, arginfo_vsprintf) ZEND_FE(fprintf, arginfo_fprintf) ZEND_FE(vfprintf, arginfo_vfprintf) ZEND_FE(fsockopen, arginfo_fsockopen) From 05555418223848f4425fec3c9fdae402dfca8b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 7 Mar 2023 17:38:25 +0100 Subject: [PATCH 18/28] remove crypt, it can be slow --- ext/standard/basic_functions.stub.php | 5 +---- ext/standard/basic_functions_arginfo.h | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 6990eb9f37949..b354549684af8 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2098,10 +2098,7 @@ function crc32(string $string): int {} /* crypt.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function crypt(#[\SensitiveParameter] string $string, string $salt): string {} /* datetime.c */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 486f201ff8f2c..5aa8f2977dae5 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: c2ac556c9d2aa455b709bee66520059ae9614538 */ + * Stub hash: 0f1e384b9c07c163242de4245e3aec3f6cc7c1b4 */ 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) @@ -2996,7 +2996,7 @@ static const zend_function_entry ext_functions[] = { #endif ZEND_FE(get_browser, arginfo_get_browser) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crc32, arginfo_crc32) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crypt, arginfo_crypt) + ZEND_FE(crypt, arginfo_crypt) #if defined(HAVE_STRPTIME) ZEND_DEP_FE(strptime, arginfo_strptime) #endif From a2a86c80b28585df0c1aefa5976b1116738c5fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 8 Mar 2023 22:57:59 +0100 Subject: [PATCH 19/28] remove strptime as CTEable, it depends on locale --- ext/standard/basic_functions.stub.php | 1 - ext/standard/basic_functions_arginfo.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index b354549684af8..6b9c874ad0f7d 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2107,7 +2107,6 @@ function crypt(#[\SensitiveParameter] string $string, string $salt): string {} /** * @return array|false * @deprecated - * @compile-time-eval * @refcount 1 */ function strptime(string $timestamp, string $format): array|false {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 5aa8f2977dae5..5d246617132fd 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: 0f1e384b9c07c163242de4245e3aec3f6cc7c1b4 */ + * Stub hash: 5597b8801c0b02c77f18d03c3842722a30774f64 */ 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) From d0de618f4259bdf2ebdd64d8f3c3bc84b06533dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 13 Mar 2023 14:03:23 +0100 Subject: [PATCH 20/28] Revert "ctype functions" This reverts commit 069fa1af7b4c3af94893e77aa6281835d2b01a37. --- ext/ctype/ctype.stub.php | 27 --------------------------- ext/ctype/ctype_arginfo.h | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/ext/ctype/ctype.stub.php b/ext/ctype/ctype.stub.php index 42f29dc1459c0..8bbc744d5a167 100644 --- a/ext/ctype/ctype.stub.php +++ b/ext/ctype/ctype.stub.php @@ -2,51 +2,24 @@ /** @generate-class-entries */ -/** - * @compile-time-eval - */ function ctype_alnum(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_alpha(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_cntrl(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_digit(mixed $text): bool {} function ctype_lower(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_graph(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_print(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_punct(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_space(mixed $text): bool {} function ctype_upper(mixed $text): bool {} -/** - * @compile-time-eval - */ function ctype_xdigit(mixed $text): bool {} diff --git a/ext/ctype/ctype_arginfo.h b/ext/ctype/ctype_arginfo.h index ccccb8ed0f289..94d783fa9a74f 100644 --- a/ext/ctype/ctype_arginfo.h +++ b/ext/ctype/ctype_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: f2e6a2cf2e88c3d331c9e3a3af655d144a67f0c7 */ + * Stub hash: 155783e1858a7f24dbc1c3e810d5cffee5468bf7 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ctype_alnum, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, text, IS_MIXED, 0) @@ -40,16 +40,16 @@ ZEND_FUNCTION(ctype_xdigit); static const zend_function_entry ext_functions[] = { - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_alnum, arginfo_ctype_alnum) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_alpha, arginfo_ctype_alpha) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_cntrl, arginfo_ctype_cntrl) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_digit, arginfo_ctype_digit) + ZEND_FE(ctype_alnum, arginfo_ctype_alnum) + ZEND_FE(ctype_alpha, arginfo_ctype_alpha) + ZEND_FE(ctype_cntrl, arginfo_ctype_cntrl) + ZEND_FE(ctype_digit, arginfo_ctype_digit) ZEND_FE(ctype_lower, arginfo_ctype_lower) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_graph, arginfo_ctype_graph) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_print, arginfo_ctype_print) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_punct, arginfo_ctype_punct) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_space, arginfo_ctype_space) + ZEND_FE(ctype_graph, arginfo_ctype_graph) + ZEND_FE(ctype_print, arginfo_ctype_print) + ZEND_FE(ctype_punct, arginfo_ctype_punct) + ZEND_FE(ctype_space, arginfo_ctype_space) ZEND_FE(ctype_upper, arginfo_ctype_upper) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_xdigit, arginfo_ctype_xdigit) + ZEND_FE(ctype_xdigit, arginfo_ctype_xdigit) ZEND_FE_END }; From 1226548db57eceaa9c651df83fa44c92f6800586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 15 Mar 2023 22:11:43 +0100 Subject: [PATCH 21/28] Remove CTE flag from array_diff_ukey(), which was added by mistake This was accidentally added in GH-7780, but since it takes a callable argument, this flag is useless on this function. Closes GH-10859. --- ext/standard/basic_functions.stub.php | 1 - ext/standard/basic_functions_arginfo.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 6b9c874ad0f7d..0297ab0655758 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1804,7 +1804,6 @@ function array_diff_key(array $array, array ...$arrays): array {} /** * @param array|callable $rest - * @compile-time-eval * @refcount 1 */ function array_diff_ukey(array $array, ...$rest): array {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 5d246617132fd..256432021172d 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: 5597b8801c0b02c77f18d03c3842722a30774f64 */ + * Stub hash: 87494cb9126aefff143d4f55db9e282d8a30f4a2 */ 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) @@ -2906,7 +2906,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc) ZEND_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff_key, arginfo_array_diff_key) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff_ukey, arginfo_array_diff_ukey) + ZEND_FE(array_diff_ukey, arginfo_array_diff_ukey) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff, arginfo_array_diff) ZEND_FE(array_udiff, arginfo_array_udiff) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff_assoc, arginfo_array_diff_assoc) From 8d347ed737dfe4a69858d7bb5dec65bc6a91b55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 4 Mar 2023 01:36:12 +0100 Subject: [PATCH 22/28] Revert "zlib_* string functions" - compress can be slow This reverts commit c6c4f21bec944bfff2e7ed701e3f19141623f0ad. --- ext/zlib/zlib.stub.php | 40 ++++++++-------------------------------- ext/zlib/zlib_arginfo.h | 18 +++++++++--------- 2 files changed, 17 insertions(+), 41 deletions(-) diff --git a/ext/zlib/zlib.stub.php b/ext/zlib/zlib.stub.php index d3ce742d0f946..1083564f76505 100644 --- a/ext/zlib/zlib.stub.php +++ b/ext/zlib/zlib.stub.php @@ -179,52 +179,28 @@ function gzopen(string $filename, string $mode, int $use_include_path = 0) {} function readgzfile(string $filename, int $use_include_path = 0): int|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function zlib_encode(string $data, int $encoding, int $level = -1): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function zlib_decode(string $data, int $max_length = 0): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzdeflate(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzencode(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_GZIP): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzcompress(string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzinflate(string $data, int $max_length = 0): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzdecode(string $data, int $max_length = 0): string|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function gzuncompress(string $data, int $max_length = 0): string|false {} /** diff --git a/ext/zlib/zlib_arginfo.h b/ext/zlib/zlib_arginfo.h index 2ed0ded8896d2..743662fd036bd 100644 --- a/ext/zlib/zlib_arginfo.h +++ b/ext/zlib/zlib_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 604aecb62556abba0b3d61e0520cc369d7ec9a93 */ + * Stub hash: 3660ad3239f93c84b6909c36ddfcc92dd0773c70 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) @@ -170,14 +170,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(gzfile, arginfo_gzfile) ZEND_FE(gzopen, arginfo_gzopen) ZEND_FE(readgzfile, arginfo_readgzfile) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(zlib_encode, arginfo_zlib_encode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(zlib_decode, arginfo_zlib_decode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzdeflate, arginfo_gzdeflate) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzencode, arginfo_gzencode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzcompress, arginfo_gzcompress) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzinflate, arginfo_gzinflate) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzdecode, arginfo_gzdecode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gzuncompress, arginfo_gzuncompress) + ZEND_FE(zlib_encode, arginfo_zlib_encode) + ZEND_FE(zlib_decode, arginfo_zlib_decode) + ZEND_FE(gzdeflate, arginfo_gzdeflate) + ZEND_FE(gzencode, arginfo_gzencode) + ZEND_FE(gzcompress, arginfo_gzcompress) + ZEND_FE(gzinflate, arginfo_gzinflate) + ZEND_FE(gzdecode, arginfo_gzdecode) + ZEND_FE(gzuncompress, arginfo_gzuncompress) ZEND_FALIAS(gzwrite, fwrite, arginfo_gzwrite) ZEND_FALIAS(gzputs, fwrite, arginfo_gzputs) ZEND_FALIAS(gzrewind, rewind, arginfo_gzrewind) From ff9b2bac0630bb43285a194c50c00e73a7c2713a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Thu, 11 May 2023 23:33:33 +0200 Subject: [PATCH 23/28] rm long2ip family --- ext/standard/basic_functions.stub.php | 18 +++--------------- ext/standard/basic_functions_arginfo.h | 10 +++++----- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 3cd00402eed7a..922c9e58c218d 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1913,15 +1913,9 @@ function base64_decode(string $string, bool $strict = false): string|false {} function constant(string $name): mixed {} -/** - * @compile-time-eval - */ function ip2long(string $ip): int|false {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function long2ip(int $ip): string|false {} /** @@ -2219,18 +2213,12 @@ function syslog(int $priority, string $message): true {} // TODO make return typ #endif #ifdef HAVE_INET_NTOP -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function inet_ntop(string $ip): string|false {} #endif #ifdef HAVE_INET_PTON -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function inet_pton(string $ip): string|false {} #endif diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 90ba5b66b5be4..9c739f6422b10 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: 0d2bffd95e986b632f5fd1afbf8f6464e6bc8759 */ + * Stub hash: 42ac385ba7fd2013563332627160686acb46d04f */ 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) @@ -2923,8 +2923,8 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) ZEND_FE(constant, arginfo_constant) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ip2long, arginfo_ip2long) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(long2ip, arginfo_long2ip) + ZEND_FE(ip2long, arginfo_ip2long) + ZEND_FE(long2ip, arginfo_long2ip) ZEND_FE(getenv, arginfo_getenv) #if defined(HAVE_PUTENV) ZEND_FE(putenv, arginfo_putenv) @@ -3042,10 +3042,10 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(syslog, arginfo_syslog) #endif #if defined(HAVE_INET_NTOP) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_ntop, arginfo_inet_ntop) + ZEND_FE(inet_ntop, arginfo_inet_ntop) #endif #if defined(HAVE_INET_PTON) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(inet_pton, arginfo_inet_pton) + ZEND_FE(inet_pton, arginfo_inet_pton) #endif ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(metaphone, arginfo_metaphone) ZEND_FE(header, arginfo_header) From 4e764fe18a5b72fbce34bed06a7819ff962d1c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 May 2023 07:47:33 +0200 Subject: [PATCH 24/28] remove all other unwanted --- ext/standard/basic_functions.stub.php | 28 +++++--------------------- ext/standard/basic_functions_arginfo.h | 14 ++++++------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 922c9e58c218d..240ce3b98d1bf 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2170,10 +2170,7 @@ function hrtime(bool $as_number = false): array|int|float|false {} /* md5.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function md5(string $string, bool $binary = false): string {} /** @refcount 1 */ @@ -2193,10 +2190,7 @@ function getlastmod(): int|false {} /* sha1.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function sha1(string $string, bool $binary = false): string {} /** @refcount 1 */ @@ -2224,10 +2218,7 @@ function inet_pton(string $ip): string|false {} /* metaphone.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function metaphone(string $string, int $max_phonemes = 0): string {} /* {{{ head.c */ @@ -2501,10 +2492,7 @@ function str_replace(array|string $search, array|string $replace, string|array $ */ function str_ireplace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {} -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function hebrev(string $string, int $max_chars_per_line = 0): string {} /** @@ -2544,9 +2532,6 @@ function str_repeat(string $string, int $times): string {} */ function count_chars(string $string, int $mode = 0): array|string {} -/** - * @compile-time-eval - */ function strnatcmp(string $string1, string $string2): int {} /** @@ -3322,10 +3307,7 @@ function quoted_printable_encode(string $string): string {} /* soundex.c */ -/** - * @compile-time-eval - * @refcount 1 - */ +/** @refcount 1 */ function soundex(string $string): string {} /* streamsfuncs.c */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 9c739f6422b10..1ead10446ceef 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: 42ac385ba7fd2013563332627160686acb46d04f */ + * Stub hash: 73241fe3664a9191b3a23973538a12fdf4932333 */ 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) @@ -3023,14 +3023,14 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(ftok, arginfo_ftok) #endif ZEND_FE(hrtime, arginfo_hrtime) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(md5, arginfo_md5) + ZEND_FE(md5, arginfo_md5) ZEND_FE(md5_file, arginfo_md5_file) ZEND_FE(getmyuid, arginfo_getmyuid) ZEND_FE(getmygid, arginfo_getmygid) ZEND_FE(getmypid, arginfo_getmypid) ZEND_FE(getmyinode, arginfo_getmyinode) ZEND_FE(getlastmod, arginfo_getlastmod) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sha1, arginfo_sha1) + ZEND_FE(sha1, arginfo_sha1) ZEND_FE(sha1_file, arginfo_sha1_file) #if defined(HAVE_SYSLOG_H) ZEND_FE(openlog, arginfo_openlog) @@ -3047,7 +3047,7 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_INET_PTON) ZEND_FE(inet_pton, arginfo_inet_pton) #endif - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(metaphone, arginfo_metaphone) + ZEND_FE(metaphone, arginfo_metaphone) ZEND_FE(header, arginfo_header) ZEND_FE(header_remove, arginfo_header_remove) ZEND_FE(setrawcookie, arginfo_setrawcookie) @@ -3113,7 +3113,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripslashes, arginfo_stripslashes) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_replace, arginfo_str_replace) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ireplace, arginfo_str_ireplace) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hebrev, arginfo_hebrev) + ZEND_FE(hebrev, arginfo_hebrev) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(nl2br, arginfo_nl2br) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) ZEND_FE(setlocale, arginfo_setlocale) @@ -3121,7 +3121,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_getcsv, arginfo_str_getcsv) ZEND_FE(str_repeat, arginfo_str_repeat) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcmp, arginfo_strnatcmp) + ZEND_FE(strnatcmp, arginfo_strnatcmp) ZEND_FE(localeconv, arginfo_localeconv) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcasecmp, arginfo_strnatcasecmp) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) @@ -3344,7 +3344,7 @@ static const zend_function_entry ext_functions[] = { #endif ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_decode, arginfo_quoted_printable_decode) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_encode, arginfo_quoted_printable_encode) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(soundex, arginfo_soundex) + ZEND_FE(soundex, arginfo_soundex) ZEND_FE(stream_select, arginfo_stream_select) ZEND_FE(stream_context_create, arginfo_stream_context_create) ZEND_FE(stream_context_set_params, arginfo_stream_context_set_params) From aeddb822ae59edf460dd8bcf81ca3f80663a8ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 May 2023 07:57:52 +0200 Subject: [PATCH 25/28] strnatcasecmp is not locale safe too --- ext/standard/basic_functions.stub.php | 3 --- ext/standard/basic_functions_arginfo.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 240ce3b98d1bf..97878153bcccb 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2540,9 +2540,6 @@ function strnatcmp(string $string1, string $string2): int {} */ function localeconv(): array {} -/** - * @compile-time-eval - */ function strnatcasecmp(string $string1, string $string2): int {} /** diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 1ead10446ceef..5c464eac50402 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: 73241fe3664a9191b3a23973538a12fdf4932333 */ + * Stub hash: cfbdb855e191dabc886dd86297d1ae1aef370d7c */ 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) @@ -3123,7 +3123,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) ZEND_FE(strnatcmp, arginfo_strnatcmp) ZEND_FE(localeconv, arginfo_localeconv) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strnatcasecmp, arginfo_strnatcasecmp) + ZEND_FE(strnatcasecmp, arginfo_strnatcasecmp) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) ZEND_FE(str_pad, arginfo_str_pad) ZEND_FE(sscanf, arginfo_sscanf) From 6bb8a2fc92c639d2fda37a380e5194ad4735e95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 May 2023 23:08:06 +0200 Subject: [PATCH 26/28] xfail deoptimized test with opcache only --- ext/zend_test/tests/observer_basic_02.phpt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index ac0da39a94365..52ba05a9ab005 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -2,8 +2,10 @@ Observer: Basic observability of userland methods --EXTENSIONS-- zend_test ---XFAIL-- -Result is not consistent /wo and /w opcache - see GH-10782 +--SKIPIF-- +if (function_exists('opcache_get_status') && opcache_get_status()) { + die ('xfail Result /w opcache is deoptimized/different - tracked in GH-10782'); +} --INI-- zend_test.observer.enabled=1 zend_test.observer.observe_all=1 From 13b0fd65afac52ffd96b637ad05d7ad340c23993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 May 2023 23:09:08 +0200 Subject: [PATCH 27/28] rm more locale dependent functions --- ext/standard/basic_functions.stub.php | 2 -- ext/standard/basic_functions_arginfo.h | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 97878153bcccb..effb05ff9f982 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2517,7 +2517,6 @@ function parse_str(string $string, &$result): void {} /** * @return array - * @compile-time-eval * @refcount 1 */ function str_getcsv(string $string, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array {} @@ -2566,7 +2565,6 @@ function str_shuffle(string $string): string {} /** * @return array|int - * @compile-time-eval * @refcount 1 */ function str_word_count(string $string, int $format = 0, ?string $characters = null): array|int {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 5c464eac50402..5612ee21867e8 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: cfbdb855e191dabc886dd86297d1ae1aef370d7c */ + * Stub hash: 9cc9c0954bd7032d363ce9a531be621274b9a7e2 */ 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) @@ -3118,7 +3118,7 @@ static const zend_function_entry ext_functions[] = { ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) ZEND_FE(setlocale, arginfo_setlocale) ZEND_FE(parse_str, arginfo_parse_str) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_getcsv, arginfo_str_getcsv) + ZEND_FE(str_getcsv, arginfo_str_getcsv) ZEND_FE(str_repeat, arginfo_str_repeat) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) ZEND_FE(strnatcmp, arginfo_strnatcmp) @@ -3129,7 +3129,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(sscanf, arginfo_sscanf) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_rot13, arginfo_str_rot13) ZEND_FE(str_shuffle, arginfo_str_shuffle) - ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_word_count, arginfo_str_word_count) + ZEND_FE(str_word_count, arginfo_str_word_count) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_split, arginfo_str_split) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpbrk, arginfo_strpbrk) ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_compare, arginfo_substr_compare) From 8f4e5af78ce03f2439d03e0c8130b064f6b84fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 12 May 2023 23:51:23 +0200 Subject: [PATCH 28/28] fix xfail --- ext/zend_test/tests/observer_basic_02.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/zend_test/tests/observer_basic_02.phpt b/ext/zend_test/tests/observer_basic_02.phpt index 52ba05a9ab005..3581c7199d653 100644 --- a/ext/zend_test/tests/observer_basic_02.phpt +++ b/ext/zend_test/tests/observer_basic_02.phpt @@ -3,9 +3,11 @@ Observer: Basic observability of userland methods --EXTENSIONS-- zend_test --SKIPIF-- + --INI-- zend_test.observer.enabled=1 zend_test.observer.observe_all=1