From 069fa1af7b4c3af94893e77aa6281835d2b01a37 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 1/7] ctype functions --- ext/ctype/ctype.stub.php | 27 +++++++++++++++++++++++++++ ext/ctype/ctype_arginfo.h | 20 ++++++++++---------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/ext/ctype/ctype.stub.php b/ext/ctype/ctype.stub.php index 8bbc744d5a167..42f29dc1459c0 100644 --- a/ext/ctype/ctype.stub.php +++ b/ext/ctype/ctype.stub.php @@ -2,24 +2,51 @@ /** @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 94d783fa9a74f..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: 155783e1858a7f24dbc1c3e810d5cffee5468bf7 */ + * 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) @@ -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_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_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_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_upper, arginfo_ctype_upper) - ZEND_FE(ctype_xdigit, arginfo_ctype_xdigit) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ctype_xdigit, arginfo_ctype_xdigit) ZEND_FE_END }; From 68cf38bf1ef97a23e32d78791d65a25da5c9867d 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:04:12 +0100 Subject: [PATCH 2/7] array intersect, diff already supported --- ext/standard/basic_functions.stub.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 68d0e69516fd3..d111fad242480 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1738,7 +1738,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 +1750,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 +1762,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 {} /** @@ -1778,15 +1787,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 {} @@ -1802,8 +1811,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 {} From 7a2fd6c0a2c1dd6c7a534e50d313be4ebeed22bc 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:05:34 +0100 Subject: [PATCH 3/7] type functions --- ext/standard/basic_functions.stub.php | 57 +++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index d111fad242480..6f07e83e34d9b 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1722,14 +1722,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 {} @@ -1877,8 +1877,8 @@ function array_is_list(array $array): bool {} /* base64.c */ /** - * @refcount 1 * @compile-time-eval + * @refcount 1 */ function base64_encode(string $string): string {} @@ -3368,29 +3368,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 {} +/** + * @compile-time-eval + */ function strval(mixed $value): string {} +/** + * @compile-time-eval + */ function is_null(mixed $value): bool {} 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 */ @@ -3399,26 +3426,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 */ From f29b1a4b4c4597aa7f08904bf50ff67570a9285f 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:07:21 +0100 Subject: [PATCH 4/7] math functions --- ext/standard/basic_functions.stub.php | 50 ++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 6f07e83e34d9b..7c344f48c3a43 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2290,8 +2290,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 {} @@ -2968,42 +2968,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 */ @@ -3024,18 +3043,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 */ @@ -3065,14 +3091,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 */ @@ -3098,11 +3136,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 {} From e116627455069f16c722db976d6233d5adb1dc9c 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:09:41 +0100 Subject: [PATCH 5/7] regex stub --- ext/standard/basic_functions_arginfo.h | 106 ++++++++++++------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 45daf2d4f769b..ca40a788d0036 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: b0b1fb366a3ba6acfcb460e5b1ac8212c436bf2f */ + * Stub hash: 5ad91bb90dedb7fec90c234acf28ccf218dac494 */ 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) @@ -2897,11 +2897,11 @@ static const zend_function_entry ext_functions[] = { 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) @@ -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,8 +3328,8 @@ 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) @@ -3400,30 +3400,30 @@ 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 From 9ae6515dd32fd4bfa181727d2c790fe661ccab78 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 6/7] 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 702360117cf07c4c04791431f513eb39ca2c3921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 24 Apr 2023 18:08:06 +0200 Subject: [PATCH 7/7] make is_resource() CTE --- ext/standard/basic_functions.stub.php | 3 +++ ext/standard/basic_functions_arginfo.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 1488fb0e01442..9124626b5c5b5 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -3449,6 +3449,9 @@ function strval(mixed $value): string {} */ function is_null(mixed $value): bool {} +/** + * @compile-time-eval + */ function is_resource(mixed $value): bool {} /** diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 1bcbcc6f1b311..bb46fb87090f6 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: ed8e6e79f5fe167500abbfbf91fa7bc0d414a3d3 */ + * Stub hash: 73f82e392f5adf146b9b8dfb39496b3ce8465115 */ 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) @@ -3409,7 +3409,7 @@ static const zend_function_entry ext_functions[] = { 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_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)