From a4c712c37950f09744973beac187197c87a46482 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Tue, 23 Sep 2025 14:59:55 -0400 Subject: [PATCH 001/386] master is now for PHP 8.6.0-dev --- CONTRIBUTING.md | 3 +- NEWS | 764 +----------------------------- UPGRADING | 996 +-------------------------------------- UPGRADING.INTERNALS | 150 +----- Zend/zend.h | 2 +- Zend/zend_extensions.h | 2 +- Zend/zend_modules.h | 2 +- configure.ac | 2 +- main/php.h | 2 +- main/php_version.h | 6 +- win32/build/confutils.js | 4 +- 11 files changed, 15 insertions(+), 1918 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31d893e8d42a8..caaca316575e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -357,7 +357,8 @@ Currently, we have the following branches in use: | Branch | | | --------- | --------- | -| master | Active development branch for PHP 8.5, which is open for backwards incompatible changes and major internal API changes. | +| master | Active development branch for PHP 8.6, which is open for backwards incompatible changes and major internal API changes. | +| PHP-8.5 | Is used to release the PHP 8.5.x series. This is a current stable version and is open for bugfixes only. | | PHP-8.4 | Is used to release the PHP 8.4.x series. This is a current stable version and is open for bugfixes only. | | PHP-8.3 | Is used to release the PHP 8.3.x series. This is a current stable version and is open for bugfixes only. | | PHP-8.2 | Is used to release the PHP 8.2.x series. This is an old stable version and is open for security fixes only. | diff --git a/NEWS b/NEWS index 3d425abf554ea..285c4e78e3318 100644 --- a/NEWS +++ b/NEWS @@ -1,767 +1,5 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.5.0RC1 - -- Core: - . Fixed bug GH-19765 (object_properties_load() bypasses readonly property - checks). (timwolla) - . The __sleep() and __wakeup() magic methods have been deprecated. (Girgias) - . Fixed hard_timeout with --enable-zend-max-execution-timers. (Appla) - . Fixed bug GH-19839 (Incorrect HASH_FLAG_HAS_EMPTY_IND flag on userland - array). (ilutov) - . Fixed bug GH-19823 (register_argc_argv deprecation emitted twice when - using OPcache). (timwolla) - . Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is - configured). (nielsdos) - . Fixed bug GH-19719 (Allow empty statements before declare(strict_types)). - (nielsdos) - . Casting floats that are not representable as ints now emits a warning. - (Girgias) - . Casting NAN to other types now emits a warning. (Girgias) - -- Bz2: - . Fixed bug GH-19810 (Broken bzopen() stream mode validation). (ilutov) - -- Curl: - . Fix cloning of CURLOPT_POSTFIELDS when using the clone operator instead - of the curl_copy_handle() function to clone a CurlHandle. (timwolla) - -- Date: - . Fixed GH-17159: "P" format for ::createFromFormat swallows string literals. - (nielsdos) - . The __wakeup() magic method of DateTimeInterface, DateTime, - DateTimeImmutable, DateTimeZone, DateInterval, and DatePeriod has been - deprecated in favour of the __unserialize() magic method. (Girgias) - -- Exif: - . Fix OSS-Fuzz #442954659 (zero-size box in HEIF file causes infinite loop). - (nielsdos) - . Fix OSS-Fuzz #442954659 (Crash in exif_scan_HEIF_header). (nielsdos) - . Various hardening fixes to HEIF parsing. (nielsdos) - -- FPM: - . Fixed GH-8157 (post_max_size evaluates .user.ini too late in php-fpm). - (Jakub Zelenka) - -- Iconv: - . Extends the ICONV_CONST preprocessor for illumos/solaris. (jMichaelA) - -- Opcache: - . Fixed bug GH-19669 (assertion failure in zend_jit_trace_type_to_info_ex). - (Arnaud) - . Fixed bug GH-19831 (function JIT may not deref property value). (Arnaud) - -- OpenSSL: - . Fixed build when --with-openssl-legacy-provider set. (Jakub Zelenka) - -- MBstring: - . Updated Unicode data tables to Unicode 17.0. (Yuya Hamada) - -- Reflection: - . ReflectionConstant is no longer final. (sasezaki) - -- SAPI: - . Fixed bug GH-18582 and #81451: http_response_code() does not override the - status code generated by header(). (ilutov, Jakub Zelenka) - -- Standard: - . Passing strings which are not one byte long to ord() is now deprecated. - (Girgias) - . Fixed bug GH-19801 (leaks in var_dump() and debug_zval_dump()). - (alexandre-daubois) - . Fixed GH-14402 (SplPriorityQueue, SplMinHeap, and SplMaxHeap lost their - data on serialize()). (alexandre-daubois) - -- URI: - . Fixed bug GH-19780 (InvalidUrlException should check $errors argument). - (nielsdos) - . Prevent modifying Uri\WhatWg\Url and Uri\Rfc3986\Uri objects by manually - calling __construct() or __unserialize(). (timwolla) - . Add new Uri\UriError exception that is thrown for internal error - conditions. (timwolla) - . Further clean up the internal API. (timwolla) - . Fixed bug GH-19892 (Refcounting on zend_empty_array). (ilutov, timwolla) - . Fixed handling of port numbers > 65535 with the internal - `php_uri_parse_to_struct()` API. (timwolla) - . Fix Uri\WhatWg\Url::withHost(). (timwolla) - -- Windows: - . Fix GH-19722 (_get_osfhandle asserts in debug mode when given a socket). - (dktapps) - -11 Sep 2025, PHP 8.5.0beta3 - -- Core: - . Destructing non-array values (other than NULL) using [] or list() now - emits a warning. (Girgias) - . Fixed bug GH-19637 (Incorrect Closure scope for FCC in constant - expression). (timwolla) - . Fixed bug GH-19613 (Stale array iterator pointer). (ilutov) - . Fixed bug GH-19679 (zend_ssa_range_widening may fail to converge). (Arnaud) - . Using null as an array offset or when calling array_key_exists() is now - deprecated. (alexandre-daubois) - . Fixed bug GH-19681 (PHP_EXPAND_PATH broken with bash 5.3.0). (Remi) - . Marks the stack as non-executable on Haiku. (David Carlier) - . Deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string is - now deprecated. (timwolla, nicolasgrekas) - -- CLI: - . Fixed bug GH-19461 (Improve error message on listening error with IPv6 - address). (alexandre-daubois) - -- Date: - . Fixed date_sunrise() and date_sunset() with partial-hour UTC offset. - (ilutov) - -- EXIF: - . Added support to retrieve Exif from HEIF file. (Benstone Zhang) - -- FPM: - . Fixed failed debug assertion when php_admin_value setting fails. (ilutov) - -- Filter: - . Fixed bug GH-16993 (filter_var_array with FILTER_VALIDATE_INT|FILTER_NULL_ON_FAILURE - should emit warning for invalid filter usage). (alexandre-daubois) - -- Intl: - . Added grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(), - grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and - grapheme_levenshtein() functions add $locale parameter (Yuya Hamada). - . Fixed bug GH-11952 (Fix locale strings canonicalization for IntlDateFormatter - and NumberFormatter). (alexandre-daubois) - -- ODBC: - . Removed driver-specific build flags and support. (Calvin Buckley) - -- Opcache: - . Fixed bug GH-19486 (Incorrect opline after deoptimization). (Arnaud) - . Fixed bug GH-19601 (Wrong JIT stack setup on aarch64/clang). (Arnaud) - . Fixed bug GH-19388 (Broken opcache.huge_code_pages). (Arnaud) - . Fixed bug GH-19657 (Build fails on non-glibc/musl/freebsd/macos/win - platforms). (Arnaud) - -- PCRE: - . Upgraded to pcre2lib from 10.45 to 10.46. (nielsdos) - -- PDO: - . Driver specific methods in the PDO class are now deprecated. (Arnaud) - -- PDO_SQLITE: - . Add PDO\Sqlite::ATTR_TRANSACTION_MODE connection attribute. - (Samuel Štancl) - -- Reflection: - . Fix GH-19691 (getModifierNames() not reporting asymmetric visibility). - (DanielEScherzer) - -- Session: - . Fix RC violation of session SID constant deprecation attribute. (ilutov) - -- Standard: - . Fix GH-19610 (Deprecation warnings in functions taking as argument). - (Girgias) - . Fixed bug GH-19577 (Avoid integer overflow when using a small offset - and PHP_INT_MAX with LimitIterator). (alexandre-daubois) - . Implement GH-19188: Add support for new INI mail.cr_lf_mode. - (alexandre-daubois) - -- Streams: - . Fixed bug GH-14506 (Closing a userspace stream inside a userspace handler - causes heap corruption). (nielsdos) - . Avoid double conversion to string in php_userstreamop_readdir(). (nielsdos) - -- URI: - . Added support for Uri\Rfc3986\Uri::with*() methods. (kocsismate) - . Fixed memory management of Uri\WhatWg\Url objects. (timwolla) - . Fixed memory management of the internal "parse_url" URI parser. - (timwolla) - . Fixed double-free when assigning to $errors fails when using - the Uri\WhatWg\Url parser. (timwolla) - . Reject out-of-range ports when using the Uri\Rfc3986\Uri parser. - (timwolla) - . Return null instead of 0 for Uri\Rfc3986\Uri::getPort() when the - URI contains an empty port. (timwolla) - . Fixed creation of the InvalidUrlException when not passing an - errors zval to the internal whatwg parser. (timwolla) - . Clean up naming of internal API. (timwolla) - -28 Aug 2025, PHP 8.5.0beta2 - -- Core: - . Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler() - triggers "Constant already defined" warning). (ilutov) - . Fixed bug GH-19476 (pipe operator fails to correctly handle returning - by reference). (alexandre-daubois) - . The report_memleaks INI directive has been deprecated. (alexandre-daubois) - . Constant redeclaration has been deprecated. (alexandre-daubois) - . Fixed OSS-Fuzz #439125710 (Pipe cannot be used in write context). - (nielsdos) - . Added support for configuring the URI parser for the FTP/FTPS as well as - the SSL/TLS stream wrappers as described in - https://wiki.php.net/rfc/url_parsing_api#plugability. (kocsismate) - . Fixed bug GH-19548 (Shared memory violation on property inheritance). - (alexandre-daubois) - . Fixed bug GH-19544 (GC treats ZEND_WEAKREF_TAG_MAP references as WeakMap - references). (Arnaud, timwolla) - . Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19 - on x86_64 or aarch64. (Arnaud) - . Enacted the follow-up phase of the "Path to Saner Increment/Decrement - operators" RFC, meaning that incrementing non-numeric strings is now - deprecated. (Girgias). - . Various closure binding issues are now deprecated. (alexandre-daubois) - . Fixed bug GH-18373 (Don't substitute self/parent with anonymous class). - (ilutov) - . Prohibit pipe & arrow function combination that leads to confusing parse - trees. (ilutov) - . The disable_classes INI directive has been removed. (Girgias) - . The locally predefined variable $http_response_header is deprecated. - (Girgias) - -- Filter: - . Added support for configuring the URI parser for FILTER_VALIDATE_URL - as described in https://wiki.php.net/rfc/url_parsing_api#plugability. - (kocsismate) - -- ODBC: - . Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley) - -- Opcache: - . Fixed bug GH-19493 (JIT variable not stored before YIELD). (Arnaud) - -- OpenSSL: - . Implement #81724 (openssl_cms_encrypt only allows specific ciphers). - (Jakub Zelenka) - -- PDO: - . Driver specific constants in the PDO class are now deprecated. (Arnaud) - -- Phar: - . Fixed memory leaks when verifying OpenSSL signature. (Girgias) - -- Session: - . Added support for partitioned cookies. (nielsdos) - -- SOAP: - . Added support for configuring the URI parser for SoapClient::_doRequest() - as described in https://wiki.php.net/rfc/url_parsing_api#plugability. - (kocsismate) - -- SPL: - . Deprecate ArrayObject and ArrayIterator with objects. (Girgias) - -- Standard: - . Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois) - . Passing integers outside the interval [0, 255] to chr() is now deprecated. - (Girgias) - . Added support for partitioned cookies. (nielsdos) - -- Tokenizer: - . Fixed bug GH-19507 (Corrupted result after recursive tokenization during - token_get_all()). (kubawerlos, nielsdos, Arnaud) - -- URI: - . Clean up naming of internal API (header names, symbol names). - (Máté Kocsis, timwolla) - -14 Aug 2025, PHP 8.5.0beta1 - -- Core: - . Non-canonical cast names (boolean), (integer), (double), and (binary) have - been deprecated. (Girgias) - . The $exclude_disabled parameter of the get_defined_functions() function has - been deprecated, as it no longer has any effect since PHP 8.0. (Girgias) - . Terminating case statements with a semicolon instead of a colon has - been deprecated. (theodorejb) - . The backtick operator as an alias for shell_exec() has been deprecated. - (timwolla) - . Returning null from __debugInfo() has been deprecated. (DanielEScherzer) - . Support #[\Override] on properties. (Jiří Pudil) - -- Curl: - . The curl_close() function has been deprecated. (DanielEScherzer) - . The curl_share_close() function has been deprecated. (DanielEScherzer) - -- Date: - . The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been - deprecated. (jorgsowa) - -- DOM: - . Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the - first when using ~ and :has). (nielsdos, lexborisov) - -- FileInfo - . The finfo_close() function has been deprecated. (timwolla) - . The $context parameter of the finfo_buffer() function has been deprecated - as it is ignored. (Girgias) - -- GD: - . The imagedestroy() function has been deprecated. (DanielEScherzer) - -- Intl: - . Intl's internal error mechanism has been modernized so that it - indicates more accurately which call site caused what error. - Moreover, some ext/date exceptions have been wrapped inside a - IntlException now. (Girgias) - . The intl.error_level INI setting has been deprecated. (Girgias) - -- MySQLi: - . The mysqli_execute() alias function has been deprecated. (timwolla) - -- OpenSSL: - . Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias - algorithms appears to be broken). (Jakub Zelenka) - . The $key_length parameter for openssl_pkey_derive() has been deprecated. - (Girgias) - . Implement #80495 (Enable to set padding in openssl_(sign|verify). - (Jakub Zelenka) - . Implement #47728 (openssl_pkcs7_sign ignores new openssl flags). - (Jakub Zelenka) - -- PDO: - . The "uri:" DSN scheme has been deprecated due to security concerns with - DSNs coming from remote URIs. (timwolla) - -- Reflection: - . Fixed bug GH-17927 (Reflection: have some indication of property hooks in - `_property_string()`). (DanielEScherzer) - . The setAccessible() methods of various Reflection objects have been - deprecated, as those no longer have an effect. (timwolla) - . ReflectionClass::getConstant() for constants that do not exist has been - deprecated. (DanielEScherzer) - . ReflectionProperty::getDefaultValue() for properties without default values - has been deprecated. (DanielEScherzer) - -- SPL: - . Unregistering all autoloaders by passing the spl_autoload_call() function - as a callback argument to spl_autoload_unregister() has been deprecated. - Instead if this is needed, one should iterate over the return value of - spl_autoload_functions() and call spl_autoload_unregister() on each - value. (Girgias) - . The SplObjectStorage::contains(), SplObjectStorage::attach(), and - SplObjectStorage::detach() methods have been deprecated in favour of - SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and - SplObjectStorage::offsetUnset() respectively. (Girgias) - -- Standard: - . The socket_set_timeout() alias function has been deprecated. (timwolla) - . Passing null to to readdir(), rewinddir(), and closedir() to use the last - opened directory has been deprecated. (Girgias) - . Fixed bug GH-19153 (#[\Attribute] validation should error on - trait/interface/enum/abstract class). (DanielEScherzer) - -- XML: - . The xml_parser_free() function has been deprecated. (DanielEScherzer) - -31 Jul 2025, PHP 8.5.0alpha4 - -- Core: - . Add clone-with support to the clone() function. (timwolla, edorian) - . Fix support for non-userland stream notifiers. (timwolla) - . Added PHP_BUILD_PROVIDER constant. (timwolla) - . Fixed bug GH-19305 (Operands may be being released during comparison). - (Arnaud) - . Fixed bug GH-19306 (Generator can be resumed while fetching next value from - delegated Generator). (Arnaud) - . Fixed bug GH-19326 (Calling Generator::throw() on a running generator with - a non-Generator delegate crashes). (Arnaud) - -- Curl: - . Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan) - . Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (thecaliskan) - . Add support for CURLOPT_SSL_SIGNATURE_ALGORITHMS. (Ayesh Karunaratne) - -- FPM: - . Make FPM access log limit configurable using log_limit. (Jakub Zelenka) - -- GD: - . Fix incorrect comparison with result of php_stream_can_cast(). (Girgias) - -- Intl: - . Fix return value on failure for resourcebundle count handler. (Girgias) - . Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb) - -- OPcache: - . Disallow changing opcache.memory_consumption when SHM is already set up. - (timwolla) - . Fixed bug GH-15074 (Compiling opcache statically into ZTS PHP fails). - (Arnaud) - . Make OPcache non-optional (Arnaud, timwolla) - . Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for - deprecations). (Arnaud, timwolla) - . Fixed bug GH-19301 (opcache build failure). (Remi) - -- OpenSSL: - . Add $digest_algo parameter to openssl_public_encrypt() and - openssl_private_decrypt() functions. (Jakub Zelenka) - -- POSIX: - . posix_kill and posix_setpgid throws a ValueError on invalid process_id. - (David Carlier) - . posix_setpgid throws a ValueError on invalid process_group_id, - posix_setrlimit throws a ValueError on invalid soft_limit and hard_limit - arguments. (David Carlier) - -- Reflection: - . Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when - retrieved from ReflectionProperty::getSettableType()). (ilutov) - -- Session: - . Fixed GH-19197: build broken with ZEND_STRL usage with memcpy - when implemented as macro. (David Carlier) - -- Soap: - . Fixed bug GH-19226 (Segfault when spawning new thread in soap extension). - (Florian Engelhardt) - -- Sockets: - . socket_set_option for multicast context throws a ValueError - when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) - -- Standard: - . Add HEIF/HEIC support to getimagesize. (Benstone Zhang) - . Implement #71517 (Implement SVG support for getimagesize() and friends). - (nielsdos) - . Optimized PHP html_entity_decode function. (Artem Ukrainskiy) - . Minor optimization to array_chunk(). (nielsdos) - -- URI: - . Empty host handling is fixed. (Máté Kocsis) - . Error handling of Uri\WhatWg\Url::withHost() is fixed when the input - contains a port. Now, it triggers an exception; previously, the error - was silently swallowed. (Máté Kocsis) - . Support empty URIs with Uri\Rfc3986\Uri. (timwolla) - -17 Jul 2025, PHP 8.5.0alpha2 - -- Core: - . Fix OSS-Fuzz #427814452 (pipe compilation fails with assert). - (nielsdos, ilutov) - -- DOM: - . Make cloning DOM node lists, maps, and collections fail. (nielsdos) - . Added Dom\Element::getElementsByClassName(). (nielsdos) - -- PDO_ODBC - . Fetch larger block sizes and better handle SQL_NO_TOTAL when calling - SQLGetData. (Calvin Buckley, Saki Takamachi) - -- Standard: - . Optimized pack(). (nielsdos, divinity76) - . Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated). - (nielsdos) - -- URI: - . Return the singleton UrlValidationErrorType instances from Uri\WhatWg\Url - instead of creating new objects that are different from the singleton. - (timwolla) - -03 Jul 2025, PHP 8.5.0alpha1 - -- BCMath: - . Simplify `bc_divide()` code. (SakiTakamachi) - . If the result is 0, n_scale is set to 0. (SakiTakamachi) - . If size of BC_VECTOR array is within 64 bytes, stack area is now used. - (SakiTakamachi) - -- CLI: - . Add --ini=diff to print INI settings changed from the builtin default. - (timwolla) - . Drop support for -z CLI/CGI flag. (nielsdos) - . Fixed GH-17956 - development server 404 page does not adapt to mobiles. - (pascalchevrel) - -- CURL: - . Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY - values for CURLOPT_FOLLOWLOCATION curl_easy_setopt option. (David Carlier) - -- COM: - . Fixed property access of PHP objects wrapped in variant. (cmb) - . Fixed method calls for PHP objects wrapped in variant. (cmb) - -- Core: - . Fixed bug GH-16665 (\array and \callable should not be usable in - class_alias). (nielsdos) - . Added PHP_BUILD_DATE constant. (cmb) - . Added support for Closures and first class callables in constant - expressions. (timwolla, Volker Dusch) - . Use `clock_gettime_nsec_np()` for high resolution timer on macOS - if available. (timwolla) - . Implement GH-15680 (Enhance zend_dump_op_array to properly represent - non-printable characters in string literals). (nielsdos, WangYihang) - . Add support for backtraces for fatal errors. (enorris) - . Fixed bug GH-17442 (Engine UAF with reference assign and dtor). (nielsdos) - . Improved error message of UnhandledMatchError for - zend.exception_string_param_max_len=0. (timwolla) - . Fixed bug GH-17959 (Relax missing trait fatal error to error exception). - (ilutov) - . Fixed bug GH-18033 (NULL-ptr dereference when using register_tick_function - in destructor). (nielsdos) - . Fixed bug GH-18026 (Improve "expecting token" error for ampersand). (ilutov) - . Added the #[\NoDiscard] attribute to indicate that a function's return - value is important and should be consumed. (timwolla, Volker Dusch) - . Added the (void) cast to indicate that not using a value is intentional. - (timwolla, Volker Dusch) - . Added get_error_handler(), get_exception_handler() functions. (Arnaud) - . Fixed bug GH-15753 and GH-16198 (Bind traits before parent class). (ilutov) - . Added support for casts in constant expressions. (nielsdos) - . Fixed bugs GH-17711 and GH-18022 (Infinite recursion on deprecated attribute - evaluation) and GH-18464 (Recursion protection for deprecation constants not - released on bailout). (DanielEScherzer and ilutov) - . Fixed AST printing for immediately invoked Closure. (Dmitrii Derepko) - . Properly handle __debugInfo() returning an array reference. (nielsdos) - . Properly handle reference return value from __toString(). (nielsdos) - . Added the pipe (|>) operator. (crell) - . Added support for `final` with constructor property promotion. - (DanielEScherzer) - . Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili) - . Make `clone()` a function. (timwolla, edorian) - . Fixed bug GH-19081 (Wrong lineno in property error with constructor property - promotion). (ilutov) - -- Curl: - . Added curl_multi_get_handles(). (timwolla) - . Added curl_share_init_persistent(). (enorris) - . Added CURLINFO_USED_PROXY, CURLINFO_HTTPAUTH_USED, and CURLINFO_PROXYAUTH_USED - support to curl_getinfo. (Ayesh Karunaratne) - -- Date: - . Fix undefined behaviour problems regarding integer overflow in extreme edge - cases. (nielsdos, cmb, ilutov) - -- DOM: - . Added Dom\Element::$outerHTML. (nielsdos) - . Added Dom\Element::insertAdjacentHTML(). (nielsdos) - . Added $children property to ParentNode implementations. (nielsdos) - -- Enchant: - . Added enchant_dict_remove_from_session(). (nielsdos) - . Added enchant_dict_remove(). (nielsdos) - . Fix missing empty string checks. (nielsdos) - -- EXIF: - . Add OffsetTime* Exif tags. (acc987) - -- Fileinfo: - . Upgrade to file 5.46. (nielsdos) - . Change return type of finfo_close() to true. (timwolla) - -- FPM: - . Fixed GH-17645 (FPM with httpd ProxyPass does not decode script path). - (Jakub Zelenka) - -- GD: - . Fixed bug #68629 (Transparent artifacts when using imagerotate). (pierre, - cmb) - . Fixed bug #64823 (ZTS GD fails to to find system TrueType font). (cmb) - -- Intl: - . Bumped ICU requirement to ICU >= 57.1. (cmb) - . IntlDateFormatter::setTimeZone()/datefmt_set_timezone() throws an exception - with uninitialised classes or clone failure. (David Carlier) - . Added DECIMAL_COMPACT_SHORT/DECIMAL_COMPACT_LONG for NumberFormatter class. - (BogdanUngureanu) - . Added Locale::isRightToLeft to check if a locale is written right to left. - (David Carlier) - . Added null bytes presence in locale inputs for Locale class. (David Carlier) - . Added grapheme_levenshtein() function. (Yuya Hamada) - . Added Locale::addLikelySubtags/Locale::minimizeSubtags to handle - adding/removing likely subtags to a locale. (David Carlier) - . Added IntlListFormatter class to format a list of items with a locale, - operands types and units. (BogdanUngureanu) - . Fixed bug GH-18566 ([intl] Weird numeric sort in Collator). (nielsdos) - -- LDAP: - . Allow ldap_get_option to retrieve global option by allowing NULL for - connection instance ($ldap). (Remi) - -- MySQLi: - . Fixed bugs GH-17900 and GH-8084 (calling mysqli::__construct twice). - (nielsdos) - -- MySQLnd: - . Added mysqlnd.collect_memory_statistics to ini quick reference. - (hauk92) - -- Opcache: - . Fixed ZTS OPcache build on Cygwin. (cmb) - . Added opcache.file_cache_read_only. (Samuel Melrose) - . Updated default value of opcache.jit_hot_loop. (Arnaud) - . Log a warning when opcache lock file permissions could not be changed. - (Taavi Eomäe) - -- OpenSSL: - . Added openssl.libctx INI that allows to select the OpenSSL library context - type and convert various parts of the extension to use the custom libctx. - (Jakub Zelenka) - -- Output: - . Fixed calculation of aligned buffer size. (cmb) - -- PCNTL: - . Extend pcntl_waitid with rusage parameter. (vrza) - -- PCRE: - . Upgraded to pcre2lib from 10.44 to 10.45. (nielsdos) - . Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options. - (mvorisek) - -- PDO_PGSQL: - . Added Iterable support for PDO::pgsqlCopyFromArray. (KentarouTakeda) - . Implement GH-15387 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) or - Pdo\Pgsql::prepare(…, [ PDO::ATTR_PREFETCH => 0 ]) make fetch() lazy - instead of storing the whole result set in memory (Guillaume Outters) - -- PDO_SQLITE: - . throw on null bytes / resolve GH-13952 (divinity76). - . Implement GH-17321: Add setAuthorizer to Pdo\Sqlite. (nielsdos) - . PDO::sqliteCreateCollation now throws a TypeError if the callback - has a wrong return type. (David Carlier) - . Added Pdo_Sqlite::ATTR_BUSY_STATEMENT constant to check - if a statement is currently executing. (David Carlier) - . Added Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT constant to set a statement - in either EXPLAIN_MODE_PREPARED, EXPLAIN_MODE_EXPLAIN, - EXPLAIN_MODE_EXPLAIN_QUERY_PLAN modes. (David Carlier) - -- PGSQL: - . Added pg_close_stmt to close a prepared statement while allowing - its name to be reused. (David Carlier) - . Added Iterable support for pgsql_copy_from. (David Carlier) - . pg_connect checks if connection_string contains any null byte, - pg_close_stmt check if the statement contains any null byte. - (David Carlier) - . Added pg_service to get the connection current service identifier. - (David Carlier) - -- POSIX: - . Added POSIX_SC_OPEN_MAX constant to get the number of file descriptors - a process can handle. (David Carlier) - . posix_ttyname() sets last_error to EBADF on invalid file descriptors, - posix_isatty() raises E_WARNING on invalid file descriptors, - posix_fpathconf checks invalid file descriptors. (David Carlier) - -- Random: - . Moves from /dev/urandom usage to arc4random_buf on Haiku. (David Carlier) - -- Reflection: - . Added ReflectionConstant::getExtension() and ::getExtensionName(). - (DanielEScherzer) - . Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF - zval for uninitialized typed properties). (nielsdos) - . Fixed bug GH-15766 (ReflectionClass::__toString() should have better output - for enums). (DanielEScherzer) - . Added ReflectionProperty::getMangledName() method. (alexandre-daubois) - -- Session: - . session_start() throws a ValueError on option argument if not a hashmap - or a TypeError if read_and_close value is not compatible with int. - (David Carlier) - -- SimpleXML: - . Fixed bug GH-12231 (SimpleXML xpath should warn when returning other return - types than node lists). (nielsdos) - -- SNMP: - . snmpget, snmpset, snmp_get2, snmp_set2, snmp_get3, snmp_set3 and - SNMP::__construct() throw an exception on invalid hostname, community - timeout and retries arguments. (David Carlier) - -- SOAP: - . Fixed bug #49169 (SoapServer calls wrong function, although "SOAP action" - header is correct). (nielsdos) - . Fix namespace handling of WSDL and XML schema in SOAP, - fixing at least GH-16320 and bug #68576. (nielsdos) - . Fixed bug #70951 (Segmentation fault on invalid WSDL cache). (nielsdos) - . Implement request #55503 (Extend __getTypes to support enumerations). - (nielsdos, datibbaw) - . Implement request #61105 (Support Soap 1.2 SoapFault Reason Text lang - attribute). (nielsdos) - -- Sockets: - . Added IPPROTO_ICMP/IPPROTO_ICMPV6 to create raw socket for ICMP usage. - (David Carlier) - . Added TCP_FUNCTION_BLK to change the TCP stack algorithm on FreeBSD. - (David Carlier) - . socket_set_option() catches possible overflow with SO_RCVTIMEO/SO_SNDTIMEO - with timeout setting on windows. (David Carlier) - . Added TCP_FUNCTION_ALIAS, TCP_REUSPORT_LB_NUMA, TCP_REUSPORT_LB_NUMA_NODOM, - TCP_REUSPORT_LB_CURDOM, TCP_BBR_ALGORITHM constants. - . socket_create_listen() throws an exception on invalid port value. - (David Carlier) - . socket_bind() throws an exception on invalid port value. - (David Carlier) - . socket_sendto() throws an exception on invalid port value. - (David Carlier) - . socket_addrinfo_lookup throws an exception on invalid hints value types. - (David Carlier) - . socket_addrinfo_lookup throws an exception if any of the hints value - overflows. (David Carlier) - . socket_addrinfo_lookup throws an exception if one or more hints entries - has an index as numeric. (David Carlier) - . socket_set_option with the options MCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUP - will throw an exception if its value is not a valid array/object. - (David Carlier) - . socket_getsockname/socket_create/socket_bind handled AF_PACKET family socket. - (David Carlier) - . Added IP_BINDANY for a socket to bind to any address. (David Carlier) - . Added SO_BUSY_POOL to reduce packets poll latency. (David Carlier) - - Added UDP_SEGMENT support to optimise multiple large datagrams over UDP - if the kernel and hardware supports it. (David Carlier) - - Added SHUT_RD, SHUT_WR and SHUT_RDWR constants for socket_shutdown(). - (David Carlier) - -- Sodium: - . Fix overall theoretical overflows on zend_string buffer allocations. - (David Carlier/nielsdos) - -- Sqlite: - . Added Sqlite3Stmt::busy to check if a statement is still being executed. - (David Carlier) - . Added Sqlite3Stmt::explain to produce a explain query plan from - the statement. (David Carlier) - . Added Sqlite3Result::fetchAll to returns all results at once from a query. - (David Carlier) - -- Standard: - . Fixed crypt() tests on musl when using --with-external-libcrypt - (Michael Orlitzky). - . Fixed bug GH-18062 (is_callable(func(...), callable_name: $name) for first - class callables returns wrong name). (timwolla) - . Added array_first() and array_last(). (nielsdos) - . Fixed bug GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types). - (nielsdos) - . Fixed exit code handling of sendmail cmd and added warnings. - (Jesse Hathaway) - . Fixed bug GH-18897 (printf: empty precision is interpreted as precision 6, - not as precision 0). (nielsdos) - -- Streams: - . Fixed bug GH-16889 (stream_select() timeout useless for pipes on Windows). - (cmb) - -- Tests: - . Allow to shuffle tests even in non-parallel mode. (dhuang00) - -- Tidy: - . tidy::__construct/parseFile/parseString methods throw an exception if - the configuration argument is invalid. (David Carlier) - -- Windows: - . Fixed bug GH-10992 (Improper long path support for relative paths). (cmb, - nielsdos) - . Fixed bug GH-16843 (Windows phpize builds ignore source subfolders). (cmb) - -- XMLWriter: - . Improved performance and reduce memory consumption. (nielsdos) - -- XSL: - . Implement request #30622 (make $namespace parameter functional). (nielsdos) - -- Zlib: - . gzfile, gzopen and readgzfile, their "use_include_path" argument - is now a boolean. (David Carlier) - . Fixed bug GH-16883 (gzopen() does not use the default stream context when - opening HTTP URLs). (nielsdos) - . Implemented GH-17668 (zlib streams should support locking). (nielsdos) - +?? ??? ????, PHP 8.6.0alpha1 <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/UPGRADING b/UPGRADING index 80c286cae5a19..2431add112afa 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,4 +1,4 @@ -PHP 8.5 UPGRADE NOTES +PHP 8.6 UPGRADE NOTES 1. Backward Incompatible Changes 2. New Features @@ -19,801 +19,30 @@ PHP 8.5 UPGRADE NOTES 1. Backward Incompatible Changes ======================================== -- Core: - . It is no longer possible to use "array" and "callable" as class alias names - in class_alias(). - . Loosely comparing uncomparable objects (e.g. enums, \CurlHandle and other - internal classes) to booleans was previously inconsistent. If compared to a - boolean literal $object == true, it would behave the same way as (bool) - $object. If compared to a statically unknown value $object == $true, it - would always return false. This behavior was consolidated to always follow - the behavior of (bool) $object. - . The return value of gc_collect_cycles() no longer includes strings and - resources that were indirectly collected through cycles. - . It is now allowed to substitute static with self or the concrete class name - in final subclasses. - . The tick handlers are now deactivated after all shutdown functions, destructors - have run and the output handlers have been cleaned up. - This is a consequence of fixing GH-18033. - . Traits are now bound before the parent class. This is a subtle behavioral - change, but should more closely match user expectations, demonstrated by - GH-15753 and GH-16198. - . Errors emitted during compilation and class linking are now always delayed - and handled after compilation or class linking. Fatal errors emitted during - compilation or class linking cause any delayed errors to be handled - immediately, without calling user-defined error handlers. - . Exceptions thrown by user-defined error handlers when handling class linking - errors are not promoted to fatal errors anymore and do not prevent linking. - . Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers - an error during compilation. Previously, the attribute could be added, but when - ReflectionAttribute::newInstance() was called an error would be thrown. - The error can be delayed from compilation to runtime using the new - #[\DelayedTargetValidation] attribute. - . The disable_classes INI setting has been removed as it causes various - engine assumptions to be broken. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#remove_disable_classes_ini_setting - . Destructing non-array values (other than NULL) using [] or list() now - emits a warning. - RFC: https://wiki.php.net/rfc/warnings-php-8-5#destructuring_non-array_values - . A warning is now emitted when casting floats (or strings that look like - floats) to int if they cannot be represented as one. This affects explicit - int casts and implicit int casts. - RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int - . A warning is now emitted when casting NAN to other types. - RFC: https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types - -- BZ2: - . bzcompress() now throws a ValueError when $block_size is not between - 1 and 9. - . bzcompress() now throws a ValueError when $work_factor is not between - 0 and 250. - -- DOM: - . Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList, - Dom\HTMLCollection, and Dom\DtdNamedNodeMap now fails. - This never actually resulted in a working object, - so the impact should actually be zero. - -- FileInfo: - . finfo_file() and finfo::file() now throws a ValueError instead of a - TypeError when $filename contains nul bytes. - This aligns the type of Error thrown to be consistent with the rest of - the language. - -- Intl: - . The extension now requires at least ICU 57.1. - . The behaviour of Collator::SORT_REGULAR with respect to handling numeric - strings is now aligned with the behaviour of SORT_REGULAR in ext/standard. - This is a consequence of fixing bug GH-18566. - -- LDAP: - . ldap_get_option() and ldap_set_option() now throw a ValueError when - passing an invalid option. - -- MBstring: - . Unicode data tables have been updated to Unicode 17.0 - -- MySQLi: - . Calling the mysqli constructor on an already-constructed object - is now no longer possible and throws an Error. - -- ODBC: - . ODBC now assumes that at least ODBC 3.5 functionality is available. The - ODBCVER definition and build system flags to control it have been removed. - . ODBC no longer has build flags to build against specific drivers (except - for DB2) and removes special cases for those drivers. It is strongly - recommended to use a driver manager like iODBC or unixODBC on non-Windows. - -- Opcache: - . The Opcache extension is now always built into the PHP binary and is always - loaded. The INI directives opcache.enable and opcache.enable_cli are still - honored. - The --enable-opcache/--disable-opcache configure flags have been removed, - and the build does not produce opcache.so or php_opcache.dll objects - anymore. - Using zend_extension=opcache.so or zend_extension=php_opcache.dll INI - directives will emit a warning. - -- PCNTL: - . pcntl_exec() now throws ValueErrors when entries of the $args parameter - contain null bytes. - . pcntl_exec() now throws ValueErrors when entries or keys of the - $env_vars parameter contain null bytes. - -- PCRE: - . The extension is compiled without semi-deprecated - PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK compile option. - https://github.com/PCRE2Project/pcre2/issues/736#issuecomment-2754024651 - -- PDO: - . The constructor arguments set in conjunction with PDO::FETCH_CLASS now - follow the usual CUFA (call_user_func_array) semantics. - This means string keys will act like a named argument. - Moreover, automatic wrapping for by-value arguments passed to a by-ref - parameter has been removed, and the usual E_WARNING about this is now - emitted. - To pass a variable by-ref to a constructor argument use the general - array value reference assignment: $ctor_args = [&$valByRef] - . Attempting to call PDOStatement::setFetchMode during a call to PDO::fetch(), - PDO::fetchObject(), PDO::fetchAll(), - for example using tricks such as passing the statement object as a constructor - argument when fetching into an object, will now throw an Error. - . The value of the constants PDO::FETCH_GROUP, PDO::FETCH_UNIQUE, - PDO::FETCH_CLASSTYPE, PDO::FETCH_PROPS_LATE, and PDO::FETCH_SERIALIZE - have changed. - . A ValueError is now thrown if PDO::FETCH_PROPS_LATE is used with a fetch - mode different than PDO::FETCH_CLASS, consistent with other fetch flags. - . A ValueError is now thrown if PDO::FETCH_INTO is used as a fetch mode in - PDO::fetchAll(), similar to PDO::FETCH_LAZY. - -- PDO_FIREBIRD: - . A ValueError is now thrown when trying to set a cursor name that is too - long on a PDOStatement resulting from the Firebird driver. - -- Session: - . Attempting to write session data where $_SESSION has a key containing - the pipe character will now emit a warning instead of silently failing. - -- SimpleXML: - . Passing an XPath expression that returns something other than a node set - to SimpleXMLElement::xpath() will now emit a warning and return false, - instead of silently failing and returning an empty array. - -- SPL: - . ArrayObject no longer accepts enums, as modifying the $name or $value - properties can break engine assumptions. - . SplFileObject::fwrite's parameter $length is now nullable. The default - value changed from 0 to null. - -- Standard: - . Using a printf-family function with a formatter that did not specify the - precision previously incorrectly reset the precision instead of treating - it as a precision of 0. See GH-18897. - ======================================== 2. New Features ======================================== -- Core: - . Closure is now a proper subtype of callable - . Added support for Closures and first class callables in constant - expressions. - RFC: https://wiki.php.net/rfc/closures_in_const_expr - RFC: https://wiki.php.net/rfc/fcc_in_const_expr - . Fatal Errors (such as an exceeded maximum execution time) now include a - backtrace. - RFC: https://wiki.php.net/rfc/error_backtraces_v2 - . Added the #[\NoDiscard] attribute to indicate that a function's return - value is important and should be consumed. - RFC: https://wiki.php.net/rfc/marking_return_value_as_important - . Added the (void) cast to indicate that not using a value is intentional. - The (void) cast has no effect on the program's execution by itself, but - it can be used to suppress warnings emitted by #[\NoDiscard] and possibly - also diagnostics emitted by external IDEs or static analysis tools. - RFC: https://wiki.php.net/rfc/marking_return_value_as_important - . Added asymmetric visibility support for static properties. - RFC: https://wiki.php.net/rfc/static-aviz - . Added support for casts in constant expressions. - . Added support for attributes on compile-time non-class constants. - RFC: https://wiki.php.net/rfc/attributes-on-constants - . The #[\Deprecated] attribute can now be used on constants. - RFC: https://wiki.php.net/rfc/attributes-on-constants - . Added the pipe (|>) operator. - RFC: https://wiki.php.net/rfc/pipe-operator-v3 - . Constructor property promotion can now be used for final properties. - RFC: https://wiki.php.net/rfc/final_promotion - . #[\Override] can now be applied to properties. - RFC: https://wiki.php.net/rfc/override_properties - . The #[\DelayedTargetValidation] attribute can be used to suppress - compile-time errors from core (or extension) attributes that are used on - invalid targets. These errors are instead reported at runtime if and when - ReflectionAttribute::newInstance() is called. - RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute - -- Curl: - . Added support for share handles that are persisted across multiple PHP - requests, safely allowing for more effective connection reuse. - RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement - . Added support for CURLINFO_USED_PROXY (libcurl >= 8.7.0), - CURLINFO_HTTPAUTH_USED, and CURLINFO_PROXYAUTH_USED - (libcurl >= 8.12.0) to the curl_getinfo() function. - When curl_getinfo() returns an array, the same information - is available as "used_proxy", "httpauth_used", and "proxyauth_used" - keys. - CURLINFO_USED_PROXY gets zero set if no proxy was used in the - previous transfer or a non-zero value if a proxy was used. - CURLINFO_HTTPAUTH_USED and CURLINFO_PROXYAUTH_USED get bitmasks - indicating the HTTP and proxy authentication methods that were - used in the previous request. See CURLAUTH_* constants for - possible values. - . Added CURLOPT_INFILESIZE_LARGE Curl option, which is a safe - replacement for CURLOPT_INFILESIZE. On certain systems, - CURLOPT_INFILESIZE only accepts a 32-bit signed integer as the file - size (2.0 GiB) even on 64-bit systems. CURLOPT_INFILESIZE_LARGE - accepts the largest integer value the system can handle. - . Added CURLFOLLOW_OBEYCODE, CURLFOLLOW_FIRSTONLY and CURLFOLLOW_ALL values for - CURLOPT_FOLLOWLOCATION curl_easy_setopt option. - CURLFOLLOW_OBEYCODE to follow more strictly in regard to redirect - if they are allowed. CURLFOLLOW_FIRSTONLY to follow only the - first redirect thus if there is any follow up redirect, it won't go - any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION - to true. - . Added support for CURLINFO_CONN_ID (libcurl >= 8.2.0) to the curl_getinfo() - function. This constant allows retrieving the unique ID of the connection - used by a cURL transfer. It is primarily useful when connection reuse or - connection pooling logic is needed in PHP-level applications. When - curl_getinfo() returns an array, this value is available as the "conn_id" key. - . Added support for CURLINFO_QUEUE_TIME_T (libcurl >= 8.6.0) to the curl_getinfo() - function. This constant allows retrieving the time (in microseconds) that the - request spent in libcurl’s connection queue before it was sent. - This value can also be retrieved by passing CURLINFO_QUEUE_TIME_T to the - curl_getinfo() $option parameter. - . Added support for CURLOPT_SSL_SIGNATURE_ALGORITHMS to specify the signature - algorithms to use for TLS. - -- DOM: - . Added Dom\Element::$outerHTML. - . Added $children property to Dom\ParentNode implementations. - -- EXIF: - . Add OffsetTime* Exif tags. - . Added support for HEIF/HEIC. - -- Intl: - . Added class constants NumberFormatter::CURRENCY_ISO, - NumberFormatter::CURRENCY_PLURAL, NumberFormatter::CASH_CURRENCY, - and NumberFormatter::CURRENCY_STANDARD for various currency-related - number formats. - . Added Locale::addLikelySubtags and Locale::minimizeSubtags to - handle likely tags on a given locale. - . Added IntlListFormatter class to format, order, and punctuate - a list of items with a given locale, IntlListFormatter::TYPE_AND, - IntlListFormatter::TYPE_OR, IntlListFormatter::TYPE_UNITS operands and - IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT and - IntlListFormatter::WIDTH_NARROW widths. - It is supported from icu 67. - -- PDO_Sqlite: - . Added class constant Pdo_Sqlite::ATTR_BUSY_STATEMENT. - . Added class constants Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT, - Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN, - Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN. - . Added PDO\Sqlite::ATTR_TRANSACTION_MODE connection attribute with - possible values PDO\Sqlite::TRANSACTION_MODE_DEFERRED, - PDO\Sqlite::TRANSACTION_MODE_IMMEDIATE, - and PDO\Sqlite::TRANSACTION_MODE_EXCLUSIVE, allowing to configure - the transaction mode to use when calling beginTransaction(). - -- Session: - . session_set_cookie_params(), session_get_cookie_params(), and session_start() - now support partitioned cookies via the "partitioned" key. - RFC: https://wiki.php.net/rfc/CHIPS - -- SOAP: - . Enumeration cases are now dumped in __getTypes(). - . Implemented request #61105: - support for Soap 1.2 Reason Text xml:lang attribute. - The signature of SoapFault::__construct() and SoapServer::fault() therefore - now have an optional $lang parameter. - This support solves compatibility with .NET SOAP clients. - -- Sqlite: - . Added class constants Sqlite3Stmt::EXPLAIN_MODE_PREPARED, - Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN and - Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN. - -- Standard: - . mail() now returns the actual sendmail error and detects if the sendmail - process was terminated unexpectedly. In such cases, a warning is emitted - and the function returns false. Previously, these errors were silently - ignored. This change affects only the sendmail transport. - . getimagesize() now supports HEIF/HEIC images. - . getimagesize() now supports SVG images when ext-libxml is also loaded. - Similarly, image_type_to_extension() and image_type_to_mime_type() - now also handle IMAGETYPE_SVG. - . The array returned by getimagesize() now has two additional entries: - "width_unit" and "height_unit" to indicate in which units the dimensions - are expressed. These units are px by default. They are not necessarily - the same (just to give one example: one may be cm and the other may be px). - . setcookie() and setrawcookie() now support the "partitioned" key. - RFC: https://wiki.php.net/rfc/CHIPS - -- XSL: - . The $namespace argument of XSLTProcessor::getParameter(), - XSLTProcessor::setParameter() and XSLTProcessor::removeParameter() - now actually works instead of being treated as empty. - This only works if the $name argument does not use Clark notation - and is not a QName because in those cases the namespace is taken - from the namespace href or prefix respectively. - -- Zlib: - . flock() is now supported on zlib streams. Previously, this always - failed to perform any locking action. - ======================================== 3. Changes in SAPI modules ======================================== -- CLI: - . Trying to set a process title that is too long with cli_set_process_title() - will now fail instead of silently truncating the given title. - . Added a new --ini=diff option to print INI settings changed from the builtin - default. - -- FPM: - . FPM with httpd ProxyPass decodes the full script path. Added - fastcgi.script_path_encoded INI setting to prevent this new behavior. - . FPM access log limit now respects log_limit value. - ======================================== 4. Deprecated Functionality ======================================== -- Core: - . Returning a non-string from a user output handler is deprecated. The - deprecation warning will bypass the handler with the bad return to ensure - it is visible; if there are nested output handlers the next one will still - be used. - RFC: https://wiki.php.net/rfc/deprecations_php_8_4 - . Trying to produce output (e.g. with `echo`) within a user output handler - is deprecated. The deprecation warning will bypass the handler producing the - output to ensure it is visible; if there are nested output handlers the next - one will still be used. If a user output handler returns a non-string and - produces output, the warning about producing an output is emitted first. - RFC: https://wiki.php.net/rfc/deprecations_php_8_4 - . Non-canonical cast names (boolean), (integer), (double), and (binary) have - been deprecated, use (bool), (int), (float), and (string) respectively. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names - . The $exclude_disabled parameter of the get_defined_functions() function has - been deprecated, as it no longer has any effect since PHP 8.0. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions - . Terminating case statements with a semicolon instead of a colon has - been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement - . The backtick operator as an alias for shell_exec() has been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec - . Returning null from __debugInfo() has been deprecated. - Return an empty array instead. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null - . The report_memleaks INI directive has been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive - . Constant redeclaration has been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration - . Enacted the follow-up phase of the "Path to Saner Increment/Decrement - operators" RFC, meaning that incrementing non-numeric strings is now - deprecated. Instead the str_increment() function should be used. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#enact_follow-up_phase_of_the_path_to_saner_incrementdecrement_operators_rfc - . The following closure binding issues, which already emit an E_WARNING, are - now deprecated: - - Binding an instance to a static closure - - Binding methods to objects that are not instances of the class - (or subclass) that the method is defined - - Unbinding $this from a method - - Unbinding $this from a closure that uses `$this` - - Binding a closure to the scope of an internal class - - Rebinding the scope of a closure created from a function or method - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_closure_binding_issues - . Using null as an array offset or when calling array_key_exists() is now - deprecated. Instead an empty string should be used. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists - . Deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string for non-CLI - SAPIs has been deprecated. Configure register_argc_argv=0 and switch to either - $_GET or $_SERVER['QUERY_STRING'] to access the information, after verifying - that the usage is safe. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive - . The __sleep() and __wakeup() magic methods have been deprecated. The - __serialize() and __unserialize() magic methods should be used instead, - or at the same time if compatibility with PHP 7 is required. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods - -- Curl: - . The curl_close() function has been deprecated, as CurlHandle objects are - freed automatically. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close - . The curl_share_close() function has been deprecated, as CurlShareHandle - objects are freed automatically. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close - -- Date: - . The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been - deprecated. This is because the associated timezone is ignored and always - uses GMT. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231 - . The __wakeup() magic method of DateTimeInterface, DateTime, - DateTimeImmutable, DateTimeZone, DateInterval, and DatePeriod has been - deprecated in favour of the __unserialize() magic method. - Related to RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods - -- FileInfo: - . The finfo_close() function has been deprecated. - As finfo objects are freed automatically. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close - . The $context parameter of the finfo_buffer() function has been deprecated - as it is ignored. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer - -- GD: - . The imagedestroy() function has been deprecated, as GdImage objects are - freed automatically. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy - -- Hash: - . The MHASH_* constants have been deprecated. These have been overlooked - when the mhash*() function family has been deprecated per - https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family - -- Intl: - . The intl.error_level INI setting has been deprecated. - Errors should either be checked manually or exceptions should be enabled - by using the intl.use_exceptions INI setting. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting - -- LDAP: - - Specific Oracle Instant Client calls and constants have been deprecated. - List of affected calls: - ldap_connect with wallet support() - ldap_connect_wallet() - List of affected constants: - GSLC_SSL_NO_UATH - GSLC_SSL_ONEWAY_UATH - GSLC_SSL_TWOWAY_UATH - https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_building_ext_ldap_against_oracle_ldap - -- MySQLi: - . The mysqli_execute() alias function has been deprecated. - Use mysqli_stmt_execute() instead. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute - -- OpenSSL: - . The $key_length parameter for openssl_pkey_derive() has been deprecated. - This is because it is either ignored, or truncates the key, which can be - a vulnerability. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive - -- PDO: - . The "uri:" DSN scheme has been deprecated due to security concerns with - DSNs coming from remote URIs. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme - . Driver specific constants in the PDO class have been deprecated. - List of affected constants and their replacement: - PDO::DBLIB_ATTR_CONNECTION_TIMEOUT => Pdo\Dblib::ATTR_CONNECTION_TIMEOUT - PDO::DBLIB_ATTR_QUERY_TIMEOUT => Pdo\Dblib::ATTR_QUERY_TIMEOUT - PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER => Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER - PDO::DBLIB_ATTR_VERSION => Pdo\Dblib::ATTR_VERSION - PDO::DBLIB_ATTR_TDS_VERSION => Pdo\Dblib::ATTR_TDS_VERSION - PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS => Pdo\Dblib::ATTR_SKIP_EMPTY_ROWSETS - PDO::DBLIB_ATTR_DATETIME_CONVERT => Pdo\Dblib::ATTR_DATETIME_CONVERT - PDO::FB_ATTR_DATE_FORMAT => Pdo\Firebird::ATTR_DATE_FORMAT - PDO::FB_ATTR_TIME_FORMAT => Pdo\Firebird::ATTR_TIME_FORMAT - PDO::FB_ATTR_TIMESTAMP_FORMAT => Pdo\Firebird::ATTR_TIMESTAMP_FORMAT - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => Pdo\Mysql::ATTR_USE_BUFFERED_QUERY - PDO::MYSQL_ATTR_LOCAL_INFILE => Pdo\Mysql::ATTR_LOCAL_INFILE - PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY => Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY - PDO::MYSQL_ATTR_INIT_COMMAND => Pdo\Mysql::ATTR_INIT_COMMAND - PDO::MYSQL_ATTR_MAX_BUFFER_SIZE => Pdo\Mysql::ATTR_MAX_BUFFER_SIZE - PDO::MYSQL_ATTR_READ_DEFAULT_FILE => Pdo\Mysql::ATTR_READ_DEFAULT_FILE - PDO::MYSQL_ATTR_READ_DEFAULT_GROUP => Pdo\Mysql::ATTR_READ_DEFAULT_GROUP - PDO::MYSQL_ATTR_COMPRESS => Pdo\Mysql::ATTR_COMPRESS - PDO::MYSQL_ATTR_DIRECT_QUERY => Pdo\Mysql::ATTR_DIRECT_QUERY - PDO::MYSQL_ATTR_FOUND_ROWS => Pdo\Mysql::ATTR_FOUND_ROWS - PDO::MYSQL_ATTR_IGNORE_SPACE => Pdo\Mysql::ATTR_IGNORE_SPACE - PDO::MYSQL_ATTR_SSL_KEY => Pdo\Mysql::ATTR_SSL_KEY - PDO::MYSQL_ATTR_SSL_CERT => Pdo\Mysql::ATTR_SSL_CERT - PDO::MYSQL_ATTR_SSL_CA => Pdo\Mysql::ATTR_SSL_CA - PDO::MYSQL_ATTR_SSL_CAPATH => Pdo\Mysql::ATTR_SSL_CAPATH - PDO::MYSQL_ATTR_SSL_CIPHER => Pdo\Mysql::ATTR_SSL_CIPHER - PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT - PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY => Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY - PDO::MYSQL_ATTR_MULTI_STATEMENTS => Pdo\Mysql::ATTR_MULTI_STATEMENTS - PDO::ODBC_ATTR_USE_CURSOR_LIBRARY => Pdo\Odbc::ATTR_USE_CURSOR_LIBRARY - PDO::ODBC_ATTR_ASSUME_UTF8 => Pdo\Odbc::ATTR_ASSUME_UTF8 - PDO::ODBC_SQL_USE_IF_NEEDED => Pdo\Odbc::SQL_USE_IF_NEEDED - PDO::ODBC_SQL_USE_DRIVER => Pdo\Odbc::SQL_USE_DRIVER - PDO::ODBC_SQL_USE_ODBC => Pdo\Odbc::SQL_USE_ODBC - PDO::PGSQL_ATTR_DISABLE_PREPARES => Pdo\Pgsql::ATTR_DISABLE_PREPARES - PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES => Pdo\Sqlite::ATTR_EXTENDED_RESULT_CODES - PDO::SQLITE_ATTR_OPEN_FLAGS => Pdo\Sqlite::OPEN_FLAGS - PDO::SQLITE_ATTR_READONLY_STATEMENT => Pdo\Sqlite::ATTR_READONLY_STATEMENT - PDO::SQLITE_DETERMINISTIC => Pdo\Sqlite::DETERMINISTIC - PDO::SQLITE_OPEN_READONLY => Pdo\Sqlite::OPEN_READONLY - PDO::SQLITE_OPEN_READWRITE => Pdo\Sqlite::OPEN_READWRITE - PDO::SQLITE_OPEN_CREATE => Pdo\Sqlite::OPEN_CREATE - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods - . Driver specific methods in the PDO class have been deprecated. - List of affected methods and their replacement: - PDO::pgsqlCopyFromArray() => Pdo\Pgsql::copyFromArray() - PDO::pgsqlCopyFromFile() => Pdo\Pgsql::copyFromFile() - PDO::pgsqlCopyToArray() => Pdo\Pgsql::copyToArray() - PDO::pgsqlCopyToFile() => Pdo\Pgsql::copyToFile() - PDO::pgsqlGetNotify() => Pdo\Pgsql::getNotify() - PDO::pgsqlGetPid() => Pdo\Pgsql::getPid() - PDO::pgsqlLOBCreate() => Pdo\Pgsql::lobCreate() - PDO::pgsqlLOBOpen() => Pdo\Pgsql::lobOpen() - PDO::pgsqlLOBUnlink() => Pdo\Pgsql::lobUnlink() - PDO::sqliteCreateAggregate() => Pdo\Sqlite::createAggregate() - PDO::sqliteCreateCollation() => Pdo\Sqlite::createCollation() - PDO::sqliteCreateFunction() => Pdo\Sqlite::createFunction() - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods - -- PDO_PGSQL: Constants related to transaction states have been deprecated: - PDO::PGSQL_TRANSACTION_IDLE, PDO::PGSQL_TRANSACTION_ACTIVE, PDO::PGSQL_TRANSACTION_INTRANS, - PDO::PGSQL_TRANSACTION_INERROR, PDO::PGSQL_TRANSACTION_UNKNOWN. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#extpdo_deprecations - -- Reflection: - . The setAccessible() methods of various Reflection objects have been - deprecated, as those no longer have an effect. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible - . Calling ReflectionClass::getConstant() for constants that do not exist has - been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants - . Calling ReflectionProperty::getDefaultValue() for properties without default - values has been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values - -- SPL: - . Unregistering all autoloaders by passing the spl_autoload_call() function - as a callback argument to spl_autoload_unregister() has been deprecated. - Instead if this is needed, one should iterate over the return value of - spl_autoload_functions() and call spl_autoload_unregister() on each value. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister - . The SplObjectStorage::contains(), SplObjectStorage::attach(), and - SplObjectStorage::detach() methods have been deprecated in favour of - SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and - SplObjectStorage::offsetUnset() respectively. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach - . Using ArrayObject and ArrayIterator with objects has been deprecated. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects - -- Standard: - . The socket_set_timeout() alias function has been deprecated. - Use stream_set_timeout() instead. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout - . Passing null to to readdir(), rewinddir(), and closedir() to use the last - opened directory has been deprecated. Provide the last opened directory - explicitly instead. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir - . Passing integers outside the interval [0, 255] to chr() is now deprecated. - This is because a byte can only hold a value within this interval. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr - . Passing a string which is not a single byte to ord() is now deprecated, - this is indicative of a bug. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_string_which_are_not_one_byte_long_to_ord - . Relying locally predefined variable $http_response_header is deprecated. - Instead one should call the http_get_last_response_headers() function. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable - -- XML: - . The xml_parser_free() function has been deprecated, as XMLParser objects - are freed automatically. - RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free - ======================================== 5. Changed Functions ======================================== -- Intl: - . IntlDateFormatter::setTimeZone()/datefmt_set_timezone() - throws an IntlException on uninitialised classes/clone failures. - . grapheme_extract() properly assigns $next value when skipping over - invalid starting bytes. Previously there were cases where it would - point to the start of the grapheme boundary instead of the end. - . Locale:: methods throw a ValueError when locale inputs contain null - bytes. - . transliterator_get_error_code(), transliterator_get_error_message() - TransLiterator::getErrorCode(), and TransLiterator::getErrorMessage() - have dropped the false from the return type union. Returning false - was actually never possible. - . grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(), - grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and - grapheme_levenshtein() functions add $locale parameter. - RFC: https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive - -- LDAP: - . ldap_get_option() now accepts a NULL connection, as ldap_set_option(), - to allow retrieval of global options. - -- libxml: - . libxml_set_external_entity_loader() now has a formal return type of true. - -- OpenSSL: - . openssl_public_encrypt() and openssl_private_decrypt() have new parameter - $digest_algo that allows specifying hash digest algorithm for OEAP padding. - . openssl_sign() and openssl_verify() have new parameter $padding to allow - using more secure RSA PSS padding. - . openssl_cms_encrypt() $cipher_algo parameter can be a string with the - cipher name. That allows to use more algorithms including AES GCM cipher - algorithms for auth enveloped data. - -- PCNTL: - . pcntl_exec() now has a formal return type of false. - . pcntl_waitid() takes an additional resource_usage argument to - gather various platform specific metrics about the child process. - -- PDO_PGSQL: - . PDO::pgsqlCopyFromArray also supports inputs as Iterable. - . Pdo\Pgsql::setAttribute and Pdo\Pgsql::prepare supports - PDO::ATTR_PREFETCH sets to 0 which set to lazy fetch mode. - In this mode, statements cannot be run in parallel. - -- PDO_SQLITE: - . SQLite PDO::quote() will now throw an exception or emit a warning, - depending on the error mode, if the string contains a null byte. - . PDO::sqliteCreateCollation will now throw an exception - if the callback has the wrong return type, making it more - in line with Pdo_Sqlite::createCollation behavior. - -- PGSQL: - . pg_copy_from also supports inputs as Iterable. - . pg_connect checks if the connection_string argument contains - any null byte. - . pg_close_stmt checks if the statement_name argument contains - any null byte. - -- POSIX: - . posix_ttyname sets last_error to EBADF when encountering - an invalid file descriptor. - . posix_isatty raises an E_WARNING message when encountering - an invalid file descriptor. - . posix_fpathconf checks invalid file descriptors and sets - last_error to EBADF and raises an E_WARNING message. - . posix_kill throws a ValueError when the process_id argument is lower - or greater than what supports the platform (signed integer or long - range), posix_setpgid throws a ValueError when the process_id or - the process_group_id is lower than zero or greater than - what supports the platform. - . posix_setrlimit throws a ValueError when the hard_limit of soft_limit - argument are lower than -1 or if soft_limit is greater than hard_limit. - -- Reflection: - . The output of ReflectionClass::__toString() for enums has changed to - better indicate that the class is an enum, and that the enum cases - are enum cases rather than normal class constants. - . The output of ReflectionProperty::__toString() for properties with - hooks has changed to indicate what hooks the property has, whether those - hooks are final, and whether the property is virtual. This also affects - the output of ReflectionClass::__toString() when a class contains hooked - properties. - . ReflectionAttribute::newInstance() can now throw errors for internal - attributes if the attribute was applied on an invalid target and the - error was delayed from compile-time to runtime via the - #[\DelayedTargetValidation] attribute. - RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute - -- Session: - . session_start is stricter in regard to the option argument. - It throws a ValueError if the whole is not a hashmap or - a TypeError if read_and_close value is not a valid type - compatible with int. - -- SNMP: - . snmpget, snmpset, snmp_get2, snmp_set2, snmp_get3, snmp_set3 - and SNMP::__construct() throw a ValueError when the hostname - is too large, contains any null byte or if the port is given - when negative or greater than 65535, timeout and retries values - are lower than -1 or too large. - -- Sockets: - . socket_create_listen, socket_bind and socket_sendto throw a - ValueError if the port is lower than 0 or greater than 65535, - and also if any of the hints array entries are indexed numerically. - . socket_addrinfo_lookup throws a TypeError if any of the hints - values cannot be cast to int and can throw a ValueError if - any of these values overflow. - . socket_set_option with MCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUP - options will throw an exception if the value isn't a valid object - or array. - . socket_create/socket_bind can create AF_PACKET family sockets. - . socket_getsockname gets the interface index and its string - representation with AF_PACKET socket. - . socket_set_option with multicast context throws a ValueError - when the created socket is not of AF_INET/AF_INET6 family. - -- Tidy: - . tidy::__construct/parseFile/parseString now throws a ValueError - if the configuration contains an invalid or set a read-only - internal entry, a TypeError contains, at least, one element - when the key is not a string. - -- Zlib: - . The "use_include_path" argument for the - gzfile, gzopen and readgzfile functions had been changed - from int to boolean. - . gzfile, gzopen and readgzfile functions now respect the default - stream context. - ======================================== 6. New Functions ======================================== -- Core: - . get_error_handler() allows retrieving the current user-defined error handler - function. - RFC: https://wiki.php.net/rfc/get-error-exception-handler - . get_exception_handler() allows retrieving the current user-defined exception - handler function. - RFC: https://wiki.php.net/rfc/get-error-exception-handler - . The clone language construct is now a function and supports reassigning - (readonly) properties during cloning via the new $withProperties parameter. - RFC: https://wiki.php.net/rfc/clone_with_v2 - . Added Closure::getCurrent() to receive currently executing closure. - -- Curl: - . curl_multi_get_handles() allows retrieving all CurlHandles current - attached to a CurlMultiHandle. This includes both handles added using - curl_multi_add_handle() and handles accepted by CURLMOPT_PUSHFUNCTION. - . curl_share_init_persistent() allows creating a share handle that is - persisted across multiple PHP requests. - RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement - -- DOM: - . Added Dom\Element::getElementsByClassName(). - . Added Dom\Element::insertAdjacentHTML(). - -- Enchant: - . Added enchant_dict_remove_from_session() to remove a word added to the - spellcheck session via enchant_dict_add_to_session(). - . Added enchant_dict_remove() to put a word on the exclusion list and - remove it from the session dictionary. - -- Intl: - . Added locale_is_right_to_left/Locale::isRightToLeft, returns true if - the locale is written right to left (after its enrichment with likely subtags). - . Added grapheme_levenshtein() function. - RFC: https://wiki.php.net/rfc/grapheme_levenshtein - -- Opcache: - . Added opcache_is_script_cached_in_file_cache(). - -- Pdo\Sqlite: - . Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of - SQLite3::setAuthorizer(). The only interface difference is that the - pdo version returns void. - -- PGSQL: - . pg_close_stmt offers an alternative way to close a prepared - statement from the DEALLOCATE sql command in that we can reuse - its name afterwards. - . pg_service returns the ongoing service name of the connection. - -- Reflection: - . ReflectionConstant::getFileName() was introduced. - . ReflectionConstant::getExtension() and - ReflectionConstant::getExtensionName() were introduced. - . ReflectionConstant::getAttributes() was introduced. - RFC: https://wiki.php.net/rfc/attributes-on-constants - . ReflectionProperty::getMangledName() was introduced. - -- Sqlite: - . Sqlite3Stmt::busy to check if a statement had been fetched - but not completely. - -- Standard: - . Added array_first() and array_last(). - RFC: https://wiki.php.net/rfc/array_first_last - ======================================== 7. New Classes and Interfaces ======================================== -- Core: - . NoDiscard attribute was added. - RFC: https://wiki.php.net/rfc/marking_return_value_as_important - . DelayedTargetValidation attribute was added. - RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute - -- Curl: - . CurlSharePersistentHandle representing a share handle that is persisted - across multiple PHP requests. - RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement - -- URI: - . Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode, - Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException, - Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError, - and Uri\WhatWg\Url are added. - RFC: https://wiki.php.net/rfc/url_parsing_api - ======================================== 8. Removed Extensions and SAPIs ======================================== @@ -822,245 +51,22 @@ PHP 8.5 UPGRADE NOTES 9. Other Changes to Extensions ======================================== -- Curl: - . curl_easy_setopt with CURLOPT_FOLLOWLOCATION option's value no longer - is treated as boolean but integer to handle CURLFOLLOW_OBEYCODE and - CURLFOLLOW_FIRSTONLY. - -- Fileinfo: - . Upgraded file from 5.45 to 5.46. - . The return type of finfo_close() has been changed to true, rather - than bool. - -- Intl: - . Intl's internal error mechanism has been modernized so that it - indicates more accurately which call site caused what error. - Moreover, some ext/date exceptions have been wrapped inside a - IntlException now. - -- Lexbor: - . An always enabled lexbor extension is added. It contains the lexbor - library that was separated from ext/dom for being reused among other - extensions. The new extension is not directly exposed to userland. - -- Opcache: - . The Opcache extension is now always built into the PHP binary and is always - loaded. The INI directives opcache.enable and opcache.enable_cli are still - honored. - -- URI: - . An always enabled uri extension is added that can be used for handling - URIs and URLs according to RFC 3986 and WHATWG URL. - RFC: https://wiki.php.net/rfc/url_parsing_api - -- PCRE: - . Upgraded pcre2lib from 10.44 to 10.46. - -- PDO_Sqlite: - . Increased minimum release version support from 3.7.7 to 3.7.17. - -- Readline: - . The return types of readline_add_history(), readline_clear_history(), and - readline_callback_handler_install() have been changed to true, rather - than bool. - -- Reflection: - . ReflectionConstant is no longer final. - ======================================== 10. New Global Constants ======================================== -- Core: - . PHP_BUILD_DATE. - . PHP_BUILD_PROVIDER. - -- Curl: - . CURLINFO_USED_PROXY. - . CURLINFO_HTTPAUTH_USED. - . CURLINFO_PROXYAUTH_USED. - . CURLINFO_CONN_ID. - . CURLINFO_QUEUE_TIME_T. - . CURLOPT_INFILESIZE_LARGE. - . CURLFOLLOW_ALL. - . CURLFOLLOW_OBEYCODE. - . CURLFOLLOW_FIRSTONLY. - -- Intl: - . DECIMAL_COMPACT_SHORT. - . DECIMAL_COMPACT_LONG. - -- OpenSSL: - . OPENSSL_PKCS1_PSS_PADDING - . PKCS7_NOSMIMECAP - . PKCS7_CRLFEOL - . PKCS7_NOCRL - . PKCS7_NO_DUAL_CONTENT - -- POSIX: - . POSIX_SC_OPEN_MAX. - -- Sockets: - . IPPROTO_ICMP/IPPROTO_ICMPV6. - . TCP_FUNCTION_BLK (FreeBSD only). - . TCP_FUNCTION_ALIAS (FreeBSD only). - . TCP_REUSPORT_LB_NUMA (FreeBSD only). - . TCP_REUSPORT_LB_NUMA_NODOM (FreeBSD only). - . TCP_REUSPORT_LB_NUMA_CURDOM (FreeBSD only). - . TCP_BBR_ALGORITHM (FreeBSD only). - . AF_PACKET (Linux only). - . IP_BINDANY (FreeBSD/NetBSD/OpenBSD only). - . SO_BUSY_POLL (Linux only). - . UDP_SEGMENT (Linux only). - - SHUT_RD. - - SHUT_WR. - - SHUT_RDWR. - -- Tokenizer: - . T_VOID_CAST. - . T_PIPE. - -- Standard: - . IMAGETYPE_SVG when libxml is loaded. - ======================================== 11. Changes to INI File Handling ======================================== -- Core: - . Added fatal_error_backtraces to control whether fatal errors should include - a backtrace. - RFC: https://wiki.php.net/rfc/error_backtraces_v2 - . Added startup-only max_memory_limit INI setting to control the maximum - memory_limit that may be configured at startup or runtime. Exceeding this - value emits a warning, unless set to -1, and sets memory_limit to the - current max_memory_limit instead. - ML discussion: https://externals.io/message/127108 - -- Opcache: - . Added opcache.file_cache_read_only to support a read-only - opcache.file_cache directory, for use with read-only file systems - (e.g. read-only Docker containers). - Best used with opcache.validate_timestamps=0, - opcache.enable_file_override=1, - and opcache.file_cache_consistency_checks=0. - Note: A cache generated with a different build of PHP, a different file - path, or different settings (including which extensions are loaded), may be - ignored. - . The default value of opcache.jit_hot_loop is now 61 (a prime) to prevent it - from being a multiple of loop iteration counts. - It is recommended that this parameter is set to a prime number. - . Changing opcache.memory_consumption when OPcache SHM is already set up - will now correctly report a failure instead of silently doing nothing and - showing misleading values in PHPInfo. - -- OpenSSL: - . Added openssl.libctx to select the OpenSSL library context type. Either - custom libctx for each thread can be used or a single global (default) - libctx is used. - ======================================== 12. Windows Support ======================================== -* The configuration variables PHP_VERSION, PHP_MINOR_VERSION, and - PHP_RELEASE_VERSION are now always numbers. Previously, they have been - strings for buildconf builds. - -* phpize builds now reflect the source tree in the build dir (like that already - worked for in-tree builds); some extension builds (especially when using - Makefile.frag.w32) may need adjustments. - -* --enable-sanitizer is now supported for MSVC builds. This enables ASan and - debug assertions, and is supported as of MSVC 16.10 and Windows 10. - -* The --with-uncritical-warn-choke configuration option for clang builds is - no longer supported. Select warnings to suppress via CFLAGS instead. - -* COM: - . The extension is now build shared by default; previously it defaulted to a - static extension, although the official Windows binaries built a shared - extension. - -* FFI: - . It is no longer necessary to specify the library when using FFI::cdef() - and FFI::load(). However, this convenience feature should not be used in - production. - -* Streams: - . If only pipe streams are contained in the $read array, and the $write and - $except arrays are empty, stream_select() now behaves similar to POSIX - systems, i.e. the function only returns if at least one pipe is ready to be - read, or after the timeout expires. Previously, stream_select() returned - immediately, reporting all streams as ready to read. - ======================================== 13. Other Changes ======================================== -- Core: - . The high resolution timer (`hrtime()`) on macOS now uses the recommended - `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of - `mach_absolute_time()`. - -- CLI/CGI: - . The `-z` or `--zend-extension` option has been removed as it was - non-functional. Use `-d zend_extension=` instead. - -- PDO_ODBC - . The fetch behaviour for larger columns has been changed. Rather than - fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size; - currently, this is the page size minus string overhead. Drivers that - return SQL_NO_TOTAL in SQLGetData are also better handled as well. - This should improve compatibility and performance. See GH-10809, GH-10733. - ======================================== 14. Performance Improvements ======================================== - -- Core: - . Remove OPcodes for identity comparisons against booleans, particularly - for the match(true) pattern. - . Add OPcode specialization for `=== []` and `!== []` comparisons. - . Creating exception objects is now much faster. - . The parts of the code that used SSE2 have been adapted to use SIMD - with ARM NEON as well. - . Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19 - on x86_64 or aarch64. The TAILCALL VM is as fast as the HYBRID VM used when - compiling with GCC. This makes PHP binaries built with Clang>=19 as fast as - binaries built with GCC. The performance of the CALL VM, used with other - compilers, has also improved considerably. - -- Intl: - . Now avoids creating extra string copies when converting strings - for use in the collator. - -- MBString: - . The parts of the code that used SSE2 have been adapted to use SIMD - with ARM NEON as well. - -- Opcache: - . Improved performance of fetching TLS variables in JIT'ed code in non-Glibc - builds. - -- ReflectionProperty: - . Improved performance of the following methods: getValue(), getRawValue(), - isInitialized(), setValue(), setRawValue(). - -- SPL: - . Improved performance of dimension accessors and methods of SplFixedArray. - -- Standard: - . Improved performance of array functions with callbacks - (array_find, array_filter, array_map, usort, ...). - . Improved performance of urlencode() and rawurlencode(). - . Improved unpack() performance with nameless repetitions by avoiding - creating temporary strings and reparsing them. - . Improved pack() performance. - . Minor improvements in array_chunk() performance. - -- XMLReader: - . Improved property access performance. - -- XMLWriter: - . Improved performance and reduce memory consumption. diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 66f7fea5a724e..70b7e2e7453b0 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -1,4 +1,4 @@ -PHP 8.5 INTERNALS UPGRADE NOTES +PHP 8.6 INTERNALS UPGRADE NOTES 1. Internal API changes @@ -14,166 +14,18 @@ PHP 8.5 INTERNALS UPGRADE NOTES 1. Internal API changes ======================== - . PG(arg_separator).input and PG(arg_separator).output are now `zend_string*` - instead of `char*`. - . DL_LOAD now doesn't use RTLD_DEEPBIND deepbind anymore on platforms - where dlmopen with LM_ID_NEWLM is available: - this means shared library symbol isolation (if needed) must be enabled on - the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM - instead of dlopen. - RTLD_DEEPBIND is still enabled when the Apache SAPI is in use. - . The ptr field of the php_stream_notifier struct is now a void* instead - of a zval. If the zval was used to store IS_PTR values only, the - extra layer of indirection can be removed. In other cases a zval can - be heap-allocated and stored in the pointer as a minimal change to keep - compatibility. - . The validator callbacks for internal attribute now return `zend_string *` - rather than `void`; instead of emitting an error when an attribute is - applied incorrectly, the error message should be returned as a zend_string - pointer. If the error will be delayed until runtime, it is stored in the - new `validation_error` field of the `zend_attribute` struct. - RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute - . Added zend_safe_assign_to_variable_noref() function to safely assign - a value to a non-reference zval. - . Added zval_ptr_safe_dtor() to safely destroy a zval when a destructor - could interfere. - . zend_get_callable_name() now returns the name of the underlying function - for fake closures. - . Added smart_string_append_printf() matching smart_str_append_printf() for - char* instead of zend_string*-based smart strings. - . Added php_build_provider() to retrieve the value of PHP_BUILD_PROVIDER at - runtime. - . Removed the cache_slot argument of zend_check_user_type_slow() because - now it only relies on the CE cache. - . Added ZEND_NONSTRING attribute macro for character arrays that do not - represent strings. This allows to silence the GCC 15.x - `-Wunterminated-string-initialization` warning. - . Added the zend_update_exception_properties() function for instantiating - Exception child classes. It updates the $message, $code, and $previous - properties. - . zend_exception_get_default() was removed, use zend_ce_exception directly. - . zend_get_error_exception() was removed, use zend_ce_error_exception - directly. - . ZEND_IS_XDIGIT() macro was removed because it was unused and its name - did not match its actual behavior. - . The following zend_string-related legacy aliases were removed: - * IS_INTERNED() - use ZSTR_IS_INTERNED() - * STR_EMPTY_ALLOC() - use ZSTR_EMPTY_ALLOC() - * _STR_HEADER_SIZE - use _ZSTR_HEADER_SIZE - * STR_ALLOCA_ALLOC() - use ZSTR_ALLOCA_ALLOC() - * STR_ALLOCA_INIT() - use ZSTR_ALLOCA_INIT() - * STR_ALLOCA_FREE() - use ZSTR_ALLOCA_FREE() - . zend_register_constant() now returns a pointer to the added constant - on success and NULL on failure instead of SUCCESS/FAILURE. - The specialized registration methods that previously had void returns - also return pointers to the added constants: - * zend_register_bool_constant() - * zend_register_null_constant() - * zend_register_long_constant() - * zend_register_double_constant() - * zend_register_string_constant() - * zend_register_stringl_constant() - . EG(fake_scope) now is a _const_ zend_class_entry*. - . zend_begin_record_errors() or EG(record_errors)=true cause errors to be - delayed. Before, errors would be recorded but not delayed. - . zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited - from the parent process after a fork(). - . HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum. - ======================== 2. Build system changes ======================== -- Abstract - . Preprocessor macro SIZEOF_PTRDIFF_T has been removed. - . Preprocessor macro SIZEOF_INTMAX_T has been removed. - -- Windows build system changes - . SAPI() and ADD_SOURCES() now support the optional `duplicate_sources` - parameter. If truthy, no rules to build the object files are generated. - This allows to build additional variants of SAPIs (e.g. a DLL and EXE) - without duplicate build rules. It is up to the SAPI maintainers to ensure - that appropriate build rules are created. - -- Unix build system changes - . libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex: lib64) - configure options are used to ${libdir}/php (ex: /usr/lib64/php) - . PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor - macros defined by ext/odbc are now defined in php_config.h instead of the - build-defs.h header. - . Autoconf macro AX_CHECK_COMPILE_FLAG updated to serial 11. - . Autoconf macro PHP_AP_EXTRACT_VERSION has been removed. - . Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts - manually). - . Autoconf macro PHP_CHECK_SIZEOF is obsolete (use AC_CHECK_SIZEOF). - . Autoconf macro PHP_DEF_HAVE has been removed (use AC_DEFINE). - . Autoconf macro PHP_OUTPUT has been removed (use AC_CONFIG_FILES). - . Autoconf macro PHP_TEST_BUILD has been removed (use AC_* macros). - . Preprocessor macro HAVE_PTRDIFF_T has been removed. - . Preprocessor macro HAVE_INTMAX_T has been removed. - . Preprocessor macro HAVE_SSIZE_T has been removed. - . Preprocessor macro SIZEOF_SSIZE_T has been removed. - ======================== 3. Module changes ======================== -- Gd: - . The gdImageScale*() and gdImageRotate*() helpers are now internal in the - bundled libgd, like they have been in external libgd as of gd-2.1.1. - -- Hash: - . Hash functions now use proper hash_spec_result enum for return values - instead of using SUCCESS and FAILURE. - -- JSON: - . php_json_encode_serializable_object() now assumes `EG(active)`, - if not a bailout is caused. Therefore a minor BC break exists if the - `PHP_JSON_PARTIAL_OUTPUT_ON_ERROR` option is in use. - However, this situation is highly unlikely. - -- Libxml: - . The refcount APIs now return an `unsigned int` instead of an `int`. - . Removed php_libxml_xmlCheckUTF8(). Use xmlCheckUTF8() from libxml instead. - -- PDO: - . Added `php_pdo_stmt_valid_db_obj_handle()` to check if the database object - is still valid. This is useful when a GC cycle is collected and the - database object can be destroyed prior to destroying the statement. - -- Random: - . The handlers parameter of php_random_engine_common_init() has been - removed. Use the default_object_handlers field on the CE instead. - -- Standard: - . Added php_url_decode_ex() and php_raw_url_decode_ex() that unlike their - non-ex counterparts do not work in-place. - . The php_std_date() function has been removed. Use php_format_date() with - the "D, d M Y H:i:s \\G\\M\\T" format instead. - . Added php_url_encode_to_smart_str() to encode a URL to a smart_str buffer. - . The functionality of getimagesize(), image_type_to_mime_type(), - and image_type_to_extension() is now extensible using the internal APIs - php_image_register_handler() and php_image_unregister_handler() in - php_image.h. - . ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h - were removed. Use the corresponding headers in Zend/ instead. - -- URI: - . Internal API for URI handling was added via the php_uri_*() functions. - ======================== 4. OpCode changes ======================== -* New ZEND_DECLARE_ATTRIBUTED_CONST is used when a global constant is declared - with `const` and has attributes; this opcode is used *instead* of the - ZEND_DECLARE_CONST, and in addition to the name of the constant and the - value to use, has a ZEND_OP_DATA with a pointer to the compiled attributes. - ======================== 5. SAPI changes ======================== - -- SAPIs must now call php_child_init() after a fork. If php-src code was - executed in other threads than the one initiating the fork, - refresh_memory_manager() must be called in every such thread. diff --git a/Zend/zend.h b/Zend/zend.h index b103faf5ab59f..53d5602a2c2ea 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.5.0-dev" +#define ZEND_VERSION "4.6.0-dev" #define ZEND_ENGINE_3 diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index becd53d7d08bd..4de8ad5414c2a 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi /* The first number is the engine version and the rest is the date (YYYYMMDD). * This way engine 2/3 API no. is always greater than engine 1 API no.. */ -#define ZEND_EXTENSION_API_NO 420240925 +#define ZEND_EXTENSION_API_NO 420250926 typedef struct _zend_extension_version_info { int zend_extension_api_no; diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index efc04a63bb363..a8076c0fb9058 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -31,7 +31,7 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module -#define ZEND_MODULE_API_NO 20240925 +#define ZEND_MODULE_API_NO 20250926 #ifdef ZTS #define USING_ZTS 1 #else diff --git a/configure.ac b/configure.ac index 5059f55127b06..54f6157d96aa4 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.5.0-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.6.0-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php.h b/main/php.h index 5c0b89c328375..8bb47ed275825 100644 --- a/main/php.h +++ b/main/php.h @@ -22,7 +22,7 @@ #include #endif -#define PHP_API_VERSION 20240925 +#define PHP_API_VERSION 20250926 #define PHP_HAVE_STREAMS #define YYDEBUG 0 #define PHP_DEFAULT_CHARSET "UTF-8" diff --git a/main/php_version.h b/main/php_version.h index 269397ba11e18..fa9484cbe1502 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -1,8 +1,8 @@ /* automatically generated by configure */ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 -#define PHP_MINOR_VERSION 5 +#define PHP_MINOR_VERSION 6 #define PHP_RELEASE_VERSION 0 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.5.0-dev" -#define PHP_VERSION_ID 80500 +#define PHP_VERSION "8.6.0-dev" +#define PHP_VERSION_ID 80600 diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 0930a86b741ca..b6693df2a5c3d 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -95,10 +95,10 @@ if (typeof(CWD) == "undefined") { if (!MODE_PHPIZE) { /* defaults; we pick up the precise versions from configure.ac */ var PHP_VERSION = 8; - var PHP_MINOR_VERSION = 5; + var PHP_MINOR_VERSION = 6; var PHP_RELEASE_VERSION = 0; var PHP_EXTRA_VERSION = ""; - var PHP_VERSION_STRING = "8.5.0"; + var PHP_VERSION_STRING = "8.6.0"; } /* Get version numbers and DEFINE as a string */ From 5b8a5320df0ebccf3574b53aae01027573d5cb07 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 22 Sep 2025 12:42:56 +0200 Subject: [PATCH 002/386] Tweak get/set-only hook error messages Fixes GH-19845 Closes GH-19916 --- Zend/tests/asymmetric_visibility/virtual_get_only.phpt | 2 +- Zend/tests/asymmetric_visibility/virtual_set_only.phpt | 2 +- Zend/tests/property_hooks/bug001.phpt | 2 +- Zend/tests/property_hooks/bug008.phpt | 2 +- Zend/tests/property_hooks/get.phpt | 2 +- Zend/tests/property_hooks/override_add_get.phpt | 2 +- Zend/tests/property_hooks/override_add_set.phpt | 2 +- Zend/tests/property_hooks/set.phpt | 4 ++-- Zend/tests/property_hooks/type_compatibility.phpt | 2 +- Zend/tests/property_hooks/type_compatibility_invalid.phpt | 2 +- Zend/zend_inheritance.c | 2 +- Zend/zend_object_handlers.c | 6 +++--- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Zend/tests/asymmetric_visibility/virtual_get_only.phpt b/Zend/tests/asymmetric_visibility/virtual_get_only.phpt index 3eaada70329d4..a3f6f980bdfe3 100644 --- a/Zend/tests/asymmetric_visibility/virtual_get_only.phpt +++ b/Zend/tests/asymmetric_visibility/virtual_get_only.phpt @@ -11,4 +11,4 @@ class Foo { ?> --EXPECTF-- -Fatal error: Read-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d +Fatal error: get-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d diff --git a/Zend/tests/asymmetric_visibility/virtual_set_only.phpt b/Zend/tests/asymmetric_visibility/virtual_set_only.phpt index 18abb7ac046a4..7d1d2bc7cb99f 100644 --- a/Zend/tests/asymmetric_visibility/virtual_set_only.phpt +++ b/Zend/tests/asymmetric_visibility/virtual_set_only.phpt @@ -11,4 +11,4 @@ class Foo { ?> --EXPECTF-- -Fatal error: Write-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d +Fatal error: set-only virtual property Foo::$bar must not specify asymmetric visibility in %s on line %d diff --git a/Zend/tests/property_hooks/bug001.phpt b/Zend/tests/property_hooks/bug001.phpt index 5328506d476cb..62291019b3338 100644 --- a/Zend/tests/property_hooks/bug001.phpt +++ b/Zend/tests/property_hooks/bug001.phpt @@ -27,4 +27,4 @@ try { ?> --EXPECT-- bool(true) -Property C::$x is read-only +Cannot write to get-only virtual property C::$x diff --git a/Zend/tests/property_hooks/bug008.phpt b/Zend/tests/property_hooks/bug008.phpt index 9c321cfe16e14..38fe709a38a3f 100644 --- a/Zend/tests/property_hooks/bug008.phpt +++ b/Zend/tests/property_hooks/bug008.phpt @@ -18,7 +18,7 @@ $foo->bar = 'bar'; ?> --EXPECTF-- -Fatal error: Uncaught Error: Property Foo::$bar is read-only in %s:%d +Fatal error: Uncaught Error: Cannot write to get-only virtual property Foo::$bar in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/property_hooks/get.phpt b/Zend/tests/property_hooks/get.phpt index 0cb0a6b7c76be..6d4b005843eaf 100644 --- a/Zend/tests/property_hooks/get.phpt +++ b/Zend/tests/property_hooks/get.phpt @@ -21,4 +21,4 @@ try { ?> --EXPECT-- int(42) -Property Test::$prop is read-only +Cannot write to get-only virtual property Test::$prop diff --git a/Zend/tests/property_hooks/override_add_get.phpt b/Zend/tests/property_hooks/override_add_get.phpt index 28dbd047c0718..df2739e6086c3 100644 --- a/Zend/tests/property_hooks/override_add_get.phpt +++ b/Zend/tests/property_hooks/override_add_get.phpt @@ -31,7 +31,7 @@ var_dump($b->prop); ?> --EXPECT-- A::A::$prop::set -Property A::$prop is write-only +Cannot read from set-only virtual property A::$prop B::B::$prop::set B::B::$prop::get int(42) diff --git a/Zend/tests/property_hooks/override_add_set.phpt b/Zend/tests/property_hooks/override_add_set.phpt index 6b490d4d87f94..e13de15f0b822 100644 --- a/Zend/tests/property_hooks/override_add_set.phpt +++ b/Zend/tests/property_hooks/override_add_set.phpt @@ -30,7 +30,7 @@ var_dump($b->prop); ?> --EXPECT-- -Property A::$prop is read-only +Cannot write to get-only virtual property A::$prop A::A::$prop::get int(42) B::B::$prop::set diff --git a/Zend/tests/property_hooks/set.phpt b/Zend/tests/property_hooks/set.phpt index 04e36ae85411f..2928aee6cedee 100644 --- a/Zend/tests/property_hooks/set.phpt +++ b/Zend/tests/property_hooks/set.phpt @@ -28,5 +28,5 @@ try { ?> --EXPECT-- int(42) -Property Test::$prop is write-only -Property Test::$prop is write-only +Cannot read from set-only virtual property Test::$prop +Cannot read from set-only virtual property Test::$prop diff --git a/Zend/tests/property_hooks/type_compatibility.phpt b/Zend/tests/property_hooks/type_compatibility.phpt index 8bfb7b0cadd59..def1fc77dc9ce 100644 --- a/Zend/tests/property_hooks/type_compatibility.phpt +++ b/Zend/tests/property_hooks/type_compatibility.phpt @@ -1,5 +1,5 @@ --TEST-- -Relaxed type compatibility for read-only and write-only properties +Relaxed type compatibility for get-only and set-only properties --FILE-- flags & ZEND_ACC_PPP_SET_MASK) && (!prop_info->hooks[ZEND_PROPERTY_HOOK_GET] || !prop_info->hooks[ZEND_PROPERTY_HOOK_SET])) { const char *prefix = !prop_info->hooks[ZEND_PROPERTY_HOOK_GET] - ? "Write-only" : "Read-only"; + ? "set-only" : "get-only"; zend_error_noreturn(E_COMPILE_ERROR, "%s virtual property %s::$%s must not specify asymmetric visibility", prefix, ZSTR_VAL(ce->name), ZSTR_VAL(prop_name)); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index cca69e5d792c9..22a1d2165774f 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -809,7 +809,7 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int zend_function *get = prop_info->hooks[ZEND_PROPERTY_HOOK_GET]; if (!get) { if (prop_info->flags & ZEND_ACC_VIRTUAL) { - zend_throw_error(NULL, "Property %s::$%s is write-only", + zend_throw_error(NULL, "Cannot read from set-only virtual property %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); return &EG(uninitialized_zval); } @@ -1150,7 +1150,7 @@ found:; if (!set) { if (prop_info->flags & ZEND_ACC_VIRTUAL) { - zend_throw_error(NULL, "Property %s::$%s is read-only", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); + zend_throw_error(NULL, "Cannot write to get-only virtual property %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); variable_ptr = &EG(error_zval); goto exit; } @@ -2343,7 +2343,7 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has if (!get) { if (prop_info->flags & ZEND_ACC_VIRTUAL) { - zend_throw_error(NULL, "Property %s::$%s is write-only", + zend_throw_error(NULL, "Cannot read from set-only virtual property %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); return 0; } else { From 0d4ff662e6d83fd3db0134fc826438307431335a Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 4 Sep 2025 12:04:50 +0200 Subject: [PATCH 003/386] Expose the source of exit points in zend_jit_dump_exit_info() This adds a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC. When the flag is set, zend_jit_dump_exit_info() exposes the source of exit points, in debug builds. Closes GH-19700 --- UPGRADING | 5 +++++ ext/opcache/jit/zend_jit.c | 3 ++- ext/opcache/jit/zend_jit.h | 19 ++++++++++--------- ext/opcache/jit/zend_jit_internal.h | 4 ++++ ext/opcache/jit/zend_jit_trace.c | 24 ++++++++++++++++++++++-- 5 files changed, 43 insertions(+), 12 deletions(-) diff --git a/UPGRADING b/UPGRADING index 2431add112afa..c55d0992602d7 100644 --- a/UPGRADING +++ b/UPGRADING @@ -59,6 +59,11 @@ PHP 8.6 UPGRADE NOTES 11. Changes to INI File Handling ======================================== +- Opcache: + . opcache.jit_debug accepts a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC. + When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit + points is printed in exit info output, in debug builds. + ======================================== 12. Windows Support ======================================== diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 30f49fb73f676..f6a2f415c760d 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -106,7 +106,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z static int zend_jit_trace_op_len(const zend_op *opline); static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op *opline); -static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags); +static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags ZEND_FILE_LINE_DC); +#define zend_jit_trace_get_exit_point(to_opline, flags) _zend_jit_trace_get_exit_point(to_opline, flags ZEND_FILE_LINE_CC) static const void *zend_jit_trace_get_exit_addr(uint32_t n); static void zend_jit_trace_add_code(const void *start, uint32_t size); static zend_string *zend_jit_func_name(const zend_op_array *op_array); diff --git a/ext/opcache/jit/zend_jit.h b/ext/opcache/jit/zend_jit.h index 5e6b225676aa2..9b8e054d2292f 100644 --- a/ext/opcache/jit/zend_jit.h +++ b/ext/opcache/jit/zend_jit.h @@ -64,15 +64,16 @@ #define ZEND_JIT_DEBUG_SIZE (1<<9) #define ZEND_JIT_DEBUG_ASM_ADDR (1<<10) -#define ZEND_JIT_DEBUG_TRACE_START (1<<12) -#define ZEND_JIT_DEBUG_TRACE_STOP (1<<13) -#define ZEND_JIT_DEBUG_TRACE_COMPILED (1<<14) -#define ZEND_JIT_DEBUG_TRACE_EXIT (1<<15) -#define ZEND_JIT_DEBUG_TRACE_ABORT (1<<16) -#define ZEND_JIT_DEBUG_TRACE_BLACKLIST (1<<17) -#define ZEND_JIT_DEBUG_TRACE_BYTECODE (1<<18) -#define ZEND_JIT_DEBUG_TRACE_TSSA (1<<19) -#define ZEND_JIT_DEBUG_TRACE_EXIT_INFO (1<<20) +#define ZEND_JIT_DEBUG_TRACE_START (1<<12) +#define ZEND_JIT_DEBUG_TRACE_STOP (1<<13) +#define ZEND_JIT_DEBUG_TRACE_COMPILED (1<<14) +#define ZEND_JIT_DEBUG_TRACE_EXIT (1<<15) +#define ZEND_JIT_DEBUG_TRACE_ABORT (1<<16) +#define ZEND_JIT_DEBUG_TRACE_BLACKLIST (1<<17) +#define ZEND_JIT_DEBUG_TRACE_BYTECODE (1<<18) +#define ZEND_JIT_DEBUG_TRACE_TSSA (1<<19) +#define ZEND_JIT_DEBUG_TRACE_EXIT_INFO (1<<20) +#define ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC (1<<21) #define ZEND_JIT_DEBUG_IR_SRC (1<<24) #define ZEND_JIT_DEBUG_IR_FINAL (1<<25) diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 57c0dedb2fa2d..1bffc969902a2 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -456,6 +456,10 @@ typedef struct _zend_jit_trace_exit_info { uint32_t stack_offset; zend_jit_ref_snapshot poly_func; zend_jit_ref_snapshot poly_this; +#if ZEND_DEBUG + const char *filename; + int lineno; +#endif } zend_jit_trace_exit_info; typedef struct _zend_jit_trace_stack { diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 66bb380c23d8d..21698f71500c7 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -132,7 +132,7 @@ static uint32_t zend_jit_exit_point_by_addr(const void *addr) return (uint32_t)-1; } -static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags) +static uint32_t _zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t flags ZEND_FILE_LINE_DC) { zend_jit_trace_info *t = &zend_jit_traces[ZEND_JIT_TRACE_NUM]; uint32_t exit_point; @@ -178,7 +178,13 @@ static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t && memcmp(t->stack_map + t->exit_info[i].stack_offset, stack, stack_size * sizeof(zend_jit_trace_stack)) == 0)) { if (t->exit_info[i].opline == to_opline && t->exit_info[i].flags == flags - && t->exit_info[i].stack_size == stack_size) { + && t->exit_info[i].stack_size == stack_size +#if ZEND_DEBUG + && (((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC) == 0) + || (strcmp(t->exit_info[i].filename, __zend_filename) == 0 + && t->exit_info[i].lineno == __zend_lineno)) +#endif + ) { return i; } } @@ -202,6 +208,15 @@ static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t t->exit_info[exit_point].stack_offset = stack_offset; t->exit_info[exit_point].poly_func = (zend_jit_ref_snapshot){.reg = ZREG_NONE}; t->exit_info[exit_point].poly_this = (zend_jit_ref_snapshot){.reg = ZREG_NONE}; +#if ZEND_DEBUG + if ((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC) != 0) { + t->exit_info[exit_point].filename = __zend_filename; + t->exit_info[exit_point].lineno = __zend_lineno; + } else { + t->exit_info[exit_point].filename = NULL; + t->exit_info[exit_point].lineno = 0; + } +#endif } return exit_point; @@ -8096,6 +8111,11 @@ static void zend_jit_dump_exit_info(zend_jit_trace_info *t) fprintf(stderr, ":unknown(zval_copy(%s))", zend_reg_name(STACK_REG(stack, j))); } } +#if ZEND_DEBUG + if ((JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC) != 0) { + fprintf(stderr, " %s:%d", t->exit_info[i].filename, t->exit_info[i].lineno); + } +#endif fprintf(stderr, "\n"); } } From f7e39a91d5a9de53fc4e184f6fce6116ca3388a1 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 24 Sep 2025 21:05:21 +0530 Subject: [PATCH 004/386] Bump php-sdk-binary-tools tag (#19948) --- .github/workflows/nightly.yml | 2 +- .github/workflows/push.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 41c48c9a936d5..0e35721c23a95 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1042,7 +1042,7 @@ jobs: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache PHP_BUILD_OBJ_DIR: C:\obj PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk - PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0 + PHP_BUILD_SDK_BRANCH: php-sdk-2.5.0 PHP_BUILD_CRT: ${{ inputs.vs_crt_version }} PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b3dc70d042eff..b6e9424308222 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -231,7 +231,7 @@ jobs: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache PHP_BUILD_OBJ_DIR: C:\obj PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk - PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0 + PHP_BUILD_SDK_BRANCH: php-sdk-2.5.0 PHP_BUILD_CRT: vs17 PLATFORM: x64 THREAD_SAFE: "1" From 4870baacf08a7329e06a4d53709a1fc1c688786c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:46:40 +0200 Subject: [PATCH 005/386] calendar: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/calendar/cal_unix.c | 2 +- ext/calendar/calendar.c | 2 +- ext/calendar/easter.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index c3fe5557d244e..915da1c326ae1 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -28,7 +28,7 @@ PHP_FUNCTION(unixtojd) { time_t ts; zend_long tl = 0; - bool tl_is_null = 1; + bool tl_is_null = true; struct tm *ta, tmbuf; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &tl, &tl_is_null) == FAILURE) { diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 5e948fa1567a7..b90e461da49ce 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -480,7 +480,7 @@ static char *heb_number_to_chars(int n, int fl, char **ret) PHP_FUNCTION(jdtojewish) { zend_long julday, fl = 0; - bool heb = 0; + bool heb = false; int year, month, day; char *dayp, *yearp; diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index 72c52e0fcff78..7fd8c0b33bb3e 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -34,7 +34,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm) zend_long year, golden, solar, lunar, pfm, dom, tmp, easter, result; zend_long method = CAL_EASTER_DEFAULT; const zend_long max_year = (zend_long)(ZEND_LONG_MAX / 5) * 4; - bool year_is_null = 1; + bool year_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l", &year, &year_is_null, &method) == FAILURE) { From 510fffc464bb9f211bb0170df5965021bc4f290e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:06 +0200 Subject: [PATCH 006/386] com_dotnet: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/com_dotnet/com_com.c | 2 +- ext/com_dotnet/com_misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index cf44858c93b78..cbbaf31277e32 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -281,7 +281,7 @@ PHP_FUNCTION(com_get_active_object) char *module_name; size_t module_name_len; zend_long code_page; - bool code_page_is_null = 1; + bool code_page_is_null = true; IUnknown *unk = NULL; IDispatch *obj = NULL; HRESULT res; diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index a5de6415b9a73..6c80bd2b9e24c 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -73,7 +73,7 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v, VariantInit(&obj->v); VariantCopyInd(&obj->v, v); - obj->modified = 0; + obj->modified = false; if ((V_VT(&obj->v) == VT_DISPATCH) && (V_DISPATCH(&obj->v) != NULL)) { IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); From 88d153f45e8bf785316f75dd4644df4fd66cca12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:22 +0200 Subject: [PATCH 007/386] date: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/date/php_date.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index e69512cedb440..70948c0cbc7ed 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -714,7 +714,7 @@ static zend_string *date_format(const char *format, size_t format_len, const tim } for (i = 0; i < format_len; i++) { - rfc_colon = 0; + rfc_colon = false; switch (format[i]) { /* day */ case 'd': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->d); break; @@ -778,7 +778,7 @@ static zend_string *date_format(const char *format, size_t format_len, const tim break; } ZEND_FALLTHROUGH; - case 'P': rfc_colon = 1; ZEND_FALLTHROUGH; + case 'P': rfc_colon = true; ZEND_FALLTHROUGH; case 'O': length = slprintf(buffer, sizeof(buffer), "%c%02d%s%02d", localtime ? ((offset->offset < 0) ? '-' : '+') : '+', localtime ? abs(offset->offset / 3600) : 0, @@ -1502,7 +1502,7 @@ static void create_date_period_interval(timelib_rel_time *interval, zval *zv) object_init_ex(zv, date_ce_interval); interval_obj = Z_PHPINTERVAL_P(zv); interval_obj->diff = timelib_rel_time_clone(interval); - interval_obj->initialized = 1; + interval_obj->initialized = true; } else { ZVAL_NULL(zv); } @@ -1978,7 +1978,7 @@ static zend_object *date_object_clone_timezone(zend_object *this_ptr) /* {{{ */ } new_obj->type = old_obj->type; - new_obj->initialized = 1; + new_obj->initialized = true; switch (new_obj->type) { case TIMELIB_ZONETYPE_ID: new_obj->tzi.tz = old_obj->tzi.tz; @@ -2856,7 +2856,7 @@ static bool php_date_initialize_from_hash(php_date_obj **dateobj, const HashTabl tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); tzobj->type = TIMELIB_ZONETYPE_ID; tzobj->tzi.tz = tzi; - tzobj->initialized = 1; + tzobj->initialized = true; ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0); zval_ptr_dtor(&tmp_obj); @@ -3504,7 +3504,7 @@ static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, const timeli } /* Set new values */ - tzobj->initialized = 1; + tzobj->initialized = true; tzobj->type = t->zone_type; switch (t->zone_type) { @@ -3947,7 +3947,7 @@ PHP_FUNCTION(date_diff) zval *object1, *object2; php_date_obj *dateobj1, *dateobj2; php_interval_obj *interval; - bool absolute = 0; + bool absolute = false; if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|b", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) { RETURN_THROWS(); @@ -3963,7 +3963,7 @@ PHP_FUNCTION(date_diff) if (absolute) { interval->diff->invert = 0; } - interval->initialized = 1; + interval->initialized = true; interval->civil_or_wall = PHP_DATE_CIVIL; } /* }}} */ @@ -4312,10 +4312,10 @@ PHP_FUNCTION(timezone_transitions_get) if (timestamp_begin == ZEND_LONG_MIN) { add_nominal(); begin = 0; - found = 1; + found = true; } else { begin = 0; - found = 0; + found = false; if (tzobj->tzi.tz->bit64.timecnt > 0) { do { if (tzobj->tzi.tz->trans[begin] > timestamp_begin) { @@ -4324,7 +4324,7 @@ PHP_FUNCTION(timezone_transitions_get) } else { add_nominal(); } - found = 1; + found = true; break; } begin++; @@ -4622,7 +4622,7 @@ static void php_date_interval_initialize_from_hash(zval **return_value, php_inte } (*intobj)->diff = timelib_rel_time_clone(&time->relative); - (*intobj)->initialized = 1; + (*intobj)->initialized = true; (*intobj)->civil_or_wall = PHP_DATE_CIVIL; (*intobj)->from_string = true; (*intobj)->date_string = zend_string_copy(Z_STR_P(date_str)); @@ -4719,7 +4719,7 @@ static void php_date_interval_initialize_from_hash(zval **return_value, php_inte } } - (*intobj)->initialized = 1; + (*intobj)->initialized = true; } /* }}} */ /* {{{ */ @@ -4834,7 +4834,7 @@ static void date_interval_instantiate_from_time(zval *return_value, timelib_time php_date_instantiate(date_ce_interval, return_value); diobj = Z_PHPINTERVAL_P(return_value); diobj->diff = timelib_rel_time_clone(&time->relative); - diobj->initialized = 1; + diobj->initialized = true; diobj->civil_or_wall = PHP_DATE_CIVIL; diobj->from_string = true; diobj->date_string = zend_string_copy(time_str); @@ -5090,7 +5090,7 @@ static bool date_period_init_finish(php_period_obj *dpobj, zend_long options, ze dpobj->recurrences = (int)recurrences; - dpobj->initialized = 1; + dpobj->initialized = true; return true; } @@ -5260,7 +5260,7 @@ PHP_METHOD(DatePeriod, getDateInterval) php_date_instantiate(date_ce_interval, return_value); diobj = Z_PHPINTERVAL_P(return_value); diobj->diff = timelib_rel_time_clone(dpobj->interval); - diobj->initialized = 1; + diobj->initialized = true; } /* }}} */ @@ -5810,7 +5810,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con return 0; } - period_obj->initialized = 1; + period_obj->initialized = true; return 1; } /* }}} */ From 82d546ace50fea1b9d80311db04e5302573d3ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:29 +0200 Subject: [PATCH 008/386] dba: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/dba/dba.c | 8 ++++---- ext/dba/dba_inifile.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 60685474212f5..41a0f8cd5eeb4 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -539,8 +539,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent) int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0; char *lock_name; #ifdef PHP_WIN32 - bool restarted = 0; - bool need_creation = 0; + bool restarted = false; + bool need_creation = false; #endif zend_string *path; @@ -923,7 +923,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent) lock_file_mode = "r+b"; - restarted = 1; + restarted = true; goto restart; #endif } @@ -1277,7 +1277,7 @@ PHP_FUNCTION(dba_sync) /* {{{ List configured database handlers */ PHP_FUNCTION(dba_handlers) { - bool full_info = 0; + bool full_info = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) { RETURN_THROWS(); diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 00b99d55b0056..75a267055d96c 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -127,7 +127,7 @@ DBA_DELETE_FUNC(inifile) { inifile *dba = info->dbf; int res; - bool found = 0; + bool found = false; key_type ini_key; if (!key) { From f57e308e88ecf157fa0bb9c89a535fedf80ff8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:37 +0200 Subject: [PATCH 009/386] dom: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/dom/document.c | 4 ++-- ext/dom/element.c | 2 +- ext/dom/node.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/dom/document.c b/ext/dom/document.c index e281e65ce07c7..6db729535d30a 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -752,7 +752,7 @@ PHP_METHOD(DOMDocument, importNode) xmlDocPtr docp; xmlNodePtr nodep, retnodep; dom_object *intern, *nodeobj; - bool recursive = 0; + bool recursive = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &node, dom_node_class_entry, &recursive) == FAILURE) { RETURN_THROWS(); @@ -802,7 +802,7 @@ static void dom_modern_document_import_node(INTERNAL_FUNCTION_PARAMETERS, zend_c xmlDocPtr docp; xmlNodePtr nodep, retnodep; dom_object *intern, *nodeobj; - bool recursive = 0; + bool recursive = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &node, node_ce, &recursive) != SUCCESS) { RETURN_THROWS(); diff --git a/ext/dom/element.c b/ext/dom/element.c index dbab931301599..9f4e6d357c021 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1019,7 +1019,7 @@ static void dom_set_attribute_ns_legacy(dom_object *intern, xmlNodePtr elemp, ch name_valid = xmlValidateName(BAD_CAST localname, 0); if (name_valid != 0) { errorcode = INVALID_CHARACTER_ERR; - stricterror = 1; + stricterror = true; } else { attr = xmlHasProp(elemp, BAD_CAST localname); if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { diff --git a/ext/dom/node.c b/ext/dom/node.c index dba4bb8db87cd..61e693fa77630 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1463,7 +1463,7 @@ PHP_METHOD(DOMNode, cloneNode) zval *id; xmlNode *n, *node; dom_object *intern; - bool recursive = 0; + bool recursive = false; id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) { From ba3145d781846885674319ca02d27b2e4dccf40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:44 +0200 Subject: [PATCH 010/386] ffi: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/ffi/ffi.c | 40 ++++++++++++++++++++-------------------- ext/ffi/ffi_parser.c | 12 ++++++------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 10fc11f52e70f..86dfcb0c12739 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -1527,7 +1527,7 @@ static bool zend_ffi_ctype_name_append(zend_ffi_ctype_name_buf *buf, const char static bool zend_ffi_ctype_name(zend_ffi_ctype_name_buf *buf, const zend_ffi_type *type) /* {{{ */ { const char *name = NULL; - bool is_ptr = 0; + bool is_ptr = false; while (1) { switch (type->kind) { @@ -1587,12 +1587,12 @@ static bool zend_ffi_ctype_name(zend_ffi_ctype_name_buf *buf, const zend_ffi_typ if (!zend_ffi_ctype_name_prepend(buf, "*", 1)) { return 0; } - is_ptr = 1; + is_ptr = true; type = ZEND_FFI_TYPE(type->pointer.type); break; case ZEND_FFI_TYPE_FUNC: if (is_ptr) { - is_ptr = 0; + is_ptr = false; if (!zend_ffi_ctype_name_prepend(buf, "(", 1) || !zend_ffi_ctype_name_append(buf, ")", 1)) { return 0; @@ -1606,7 +1606,7 @@ static bool zend_ffi_ctype_name(zend_ffi_ctype_name_buf *buf, const zend_ffi_typ break; case ZEND_FFI_TYPE_ARRAY: if (is_ptr) { - is_ptr = 0; + is_ptr = false; if (!zend_ffi_ctype_name_prepend(buf, "(", 1) || !zend_ffi_ctype_name_append(buf, ")", 1)) { return 0; @@ -2307,7 +2307,7 @@ static zend_object *zend_ffi_new(zend_class_entry *class_type) /* {{{ */ ffi->lib = NULL; ffi->symbols = NULL; ffi->tags = NULL; - ffi->persistent = 0; + ffi->persistent = false; return &ffi->std; } @@ -3581,7 +3581,7 @@ static zend_ffi *zend_ffi_load(const char *filename, bool preload) /* {{{ */ } ffi->symbols = scope->symbols; ffi->tags = scope->tags; - ffi->persistent = 1; + ffi->persistent = true; } else { ffi = (zend_ffi*)zend_ffi_new(zend_ffi_ce); ffi->lib = handle; @@ -5387,7 +5387,7 @@ static zend_result zend_ffi_preload(char *preload) /* {{{ */ { zend_ffi *ffi; char *s = NULL, *e, *filename; - bool is_glob = 0; + bool is_glob = false; e = preload; while (*e) { @@ -5410,14 +5410,14 @@ static zend_result zend_ffi_preload(char *preload) /* {{{ */ if (ret == FAILURE) { return FAILURE; } - is_glob = 0; + is_glob = false; } } break; case '*': case '?': case '[': - is_glob = 1; + is_glob = true; break; default: if (!s) { @@ -5998,7 +5998,7 @@ void zend_ffi_add_enum_val(zend_ffi_dcl *enum_dcl, const char *name, size_t name const zend_ffi_type *sym_type; int64_t value; zend_ffi_type *enum_type = ZEND_FFI_TYPE(enum_dcl->type); - bool overflow = 0; + bool overflow = false; bool is_signed = (enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT8 || enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT16 || @@ -6009,36 +6009,36 @@ void zend_ffi_add_enum_val(zend_ffi_dcl *enum_dcl, const char *name, size_t name if (val->kind == ZEND_FFI_VAL_EMPTY) { if (is_signed) { if (*last == 0x7FFFFFFFFFFFFFFFLL) { - overflow = 1; + overflow = true; } } else { if ((*min != 0 || *max != 0) && (uint64_t)*last == 0xFFFFFFFFFFFFFFFFULL) { - overflow = 1; + overflow = true; } } value = *last + 1; } else if (val->kind == ZEND_FFI_VAL_CHAR) { if (!is_signed && val->ch < 0) { if ((uint64_t)*max > 0x7FFFFFFFFFFFFFFFULL) { - overflow = 1; + overflow = true; } else { - is_signed = 1; + is_signed = true; } } value = val->ch; } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { if (!is_signed && val->i64 < 0) { if ((uint64_t)*max > 0x7FFFFFFFFFFFFFFFULL) { - overflow = 1; + overflow = true; } else { - is_signed = 1; + is_signed = true; } } value = val->i64; } else if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { if (is_signed && val->u64 > 0x7FFFFFFFFFFFFFFFULL) { - overflow = 1; + overflow = true; } value = val->u64; } else { @@ -6185,7 +6185,7 @@ void zend_ffi_add_field(zend_ffi_dcl *struct_dcl, const char *name, size_t name_ } field->type = field_dcl->type; field->is_const = (bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST); - field->is_nested = 0; + field->is_nested = false; field->first_bit = 0; field->bits = 0; field_dcl->type = field_type; /* reset "owned" flag */ @@ -6238,7 +6238,7 @@ void zend_ffi_add_anonymous_field(zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_ } new_field->type = field->type; new_field->is_const = field->is_const; - new_field->is_nested = 1; + new_field->is_nested = true; new_field->first_bit = field->first_bit; new_field->bits = field->bits; field->type = ZEND_FFI_TYPE(field->type); /* reset "owned" flag */ @@ -6353,7 +6353,7 @@ void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t n } field->type = field_dcl->type; field->is_const = (bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST); - field->is_nested = 0; + field->is_nested = false; field_dcl->type = field_type; /* reset "owned" flag */ if (name) { diff --git a/ext/ffi/ffi_parser.c b/ext/ffi/ffi_parser.c index 26d623a40290e..1067f80939f39 100644 --- a/ext/ffi/ffi_parser.c +++ b/ext/ffi/ffi_parser.c @@ -2634,7 +2634,7 @@ static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) { zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL}; - bool nested = 0; + bool nested = false; if (sym == YY__STAR) { sym = parse_pointer(sym, dcl); } @@ -2650,7 +2650,7 @@ static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_ yy_error_sym("')' expected, got", sym); } sym = get_sym(); - nested = 1; + nested = true; } else { yy_error_sym("unexpected", sym); } @@ -2663,7 +2663,7 @@ static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_ static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL}; - bool nested = 0; + bool nested = false; if (sym == YY__STAR) { sym = parse_pointer(sym, dcl); } @@ -2677,7 +2677,7 @@ static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { yy_error_sym("')' expected, got", sym); } sym = get_sym(); - nested = 1; + nested = true; } if (sym == YY__LBRACK || sym == YY__LPAREN) { sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); @@ -2688,7 +2688,7 @@ static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) { zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL}; - bool nested = 0; + bool nested = false; if (sym == YY__STAR) { sym = parse_pointer(sym, dcl); } @@ -2702,7 +2702,7 @@ static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **n yy_error_sym("')' expected, got", sym); } sym = get_sym(); - nested = 1; + nested = true; } else if (sym == YY_ID) { sym = parse_ID(sym, name, name_len); } else if (sym == YY__LBRACK || sym == YY__LPAREN || sym == YY__RPAREN || sym == YY__COMMA) { From 9a36e513a647b82517cf57d83439784895e4fae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:52 +0200 Subject: [PATCH 011/386] ftp: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/ftp/ftp.c | 36 ++++++++++++++++++------------------ ext/ftp/php_ftp.c | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index ceb3ee2509035..2c777e777a66e 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -130,7 +130,7 @@ ftpbuf_t* ftp_open(const char *host, short port, zend_long timeout_sec) /* Default Settings */ ftp->timeout_sec = timeout_sec; - ftp->nb = 0; + ftp->nb = false; size = sizeof(ftp->localaddr); memset(&ftp->localaddr, 0, size); @@ -263,8 +263,8 @@ bool ftp_login(ftpbuf_t *ftp, const char *user, const size_t user_len, const cha if (ftp->resp != 334) { return false; } else { - ftp->old_ssl = 1; - ftp->use_ssl_for_data = 1; + ftp->old_ssl = true; + ftp->use_ssl_for_data = true; } } @@ -385,7 +385,7 @@ bool ftp_reinit(ftpbuf_t *ftp) ftp_gc(ftp); - ftp->nb = 0; + ftp->nb = false; if (!ftp_putcmd(ftp, "REIN", sizeof("REIN")-1, NULL, (size_t) 0)) { return false; @@ -1317,7 +1317,7 @@ static ssize_t my_recv_wrapper_with_restart(php_socket_t fd, void *buf, size_t s static int single_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t size) { #ifdef HAVE_FTP_SSL int err; - bool retry = 0; + bool retry = false; SSL *handle = NULL; php_socket_t fd; size_t sent; @@ -1338,11 +1338,11 @@ static int single_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t size) { switch (err) { case SSL_ERROR_NONE: - retry = 0; + retry = false; break; case SSL_ERROR_ZERO_RETURN: - retry = 0; + retry = false; SSL_shutdown(handle); break; @@ -1437,7 +1437,7 @@ static int my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) int n, nr_bytes; #ifdef HAVE_FTP_SSL int err; - bool retry = 0; + bool retry = false; SSL *handle = NULL; php_socket_t fd; #endif @@ -1471,11 +1471,11 @@ static int my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) switch (err) { case SSL_ERROR_NONE: - retry = 0; + retry = false; break; case SSL_ERROR_ZERO_RETURN: - retry = 0; + retry = false; SSL_shutdown(handle); break; @@ -1772,11 +1772,11 @@ static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp) switch (err) { case SSL_ERROR_NONE: - retry = 0; + retry = false; break; case SSL_ERROR_ZERO_RETURN: - retry = 0; + retry = false; SSL_shutdown(data->ssl_handle); break; @@ -2058,7 +2058,7 @@ int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, const siz ftp->data = data; ftp->stream = outstream; ftp->lastch = 0; - ftp->nb = 1; + ftp->nb = true; return (ftp_nb_continue_read(ftp)); @@ -2118,10 +2118,10 @@ int ftp_nb_continue_read(ftpbuf_t *ftp) goto bail; } - ftp->nb = 0; + ftp->nb = false; return PHP_FTP_FINISHED; bail: - ftp->nb = 0; + ftp->nb = false; data_close(ftp); return PHP_FTP_FAILED; } @@ -2166,7 +2166,7 @@ int ftp_nb_put(ftpbuf_t *ftp, const char *path, const size_t path_len, php_strea ftp->data = data; ftp->stream = instream; ftp->lastch = 0; - ftp->nb = 1; + ftp->nb = true; return (ftp_nb_continue_write(ftp)); @@ -2195,10 +2195,10 @@ int ftp_nb_continue_write(ftpbuf_t *ftp) if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { goto bail; } - ftp->nb = 0; + ftp->nb = false; return PHP_FTP_FINISHED; bail: data_close(ftp); - ftp->nb = 0; + ftp->nb = false; return PHP_FTP_FAILED; } diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index fb771a66d73e4..4b9186105819b 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -483,7 +483,7 @@ PHP_FUNCTION(ftp_rawlist) ftpbuf_t *ftp; char **llist, **ptr, *dir; size_t dir_len; - bool recursive = 0; + bool recursive = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|b", &z_ftp, php_ftp_ce, &dir, &dir_len, &recursive) == FAILURE) { RETURN_THROWS(); From ce566f26638f9a3b6ac400e7368fee839a71ee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:04 +0200 Subject: [PATCH 012/386] gmp: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/gmp/gmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 8cf20c90fc7a2..b5451b8035e37 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1535,7 +1535,7 @@ ZEND_FUNCTION(gmp_setbit) { zval *a_arg; zend_long index; - bool set = 1; + bool set = true; mpz_ptr gmpnum_a; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) { From 24d91481ff7b96d76ec7ea4d8afdc68e5ae12f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:15 +0200 Subject: [PATCH 013/386] hash: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/hash/hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index ec5391a623049..ca8efc3ca48ab 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -577,7 +577,7 @@ PHP_FUNCTION(hash_hmac) zend_string *algo; char *data, *key; size_t data_len, key_len; - bool raw_output = 0; + bool raw_output = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sss|b", &algo, &data, &data_len, &key, &key_len, &raw_output) == FAILURE) { RETURN_THROWS(); @@ -594,7 +594,7 @@ PHP_FUNCTION(hash_hmac_file) zend_string *algo; char *data, *key; size_t data_len, key_len; - bool raw_output = 0; + bool raw_output = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sss|b", &algo, &data, &data_len, &key, &key_len, &raw_output) == FAILURE) { RETURN_THROWS(); @@ -778,7 +778,7 @@ PHP_FUNCTION(hash_final) { zval *zhash; php_hashcontext_object *hash; - bool raw_output = 0; + bool raw_output = false; zend_string *digest; size_t digest_len; @@ -989,7 +989,7 @@ PHP_FUNCTION(hash_pbkdf2) unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL; zend_long loops, i, j, iterations, digest_length = 0, length = 0; size_t pass_len, salt_len = 0; - bool raw_output = 0; + bool raw_output = false; const php_hash_ops *ops; void *context; HashTable *args = NULL; From 040985647bb00dbef071956c3b45d0eaa25bd0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:23 +0200 Subject: [PATCH 014/386] iconv: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/iconv/iconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 2b19b1e3c7828..7bf0c6d23401c 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1825,7 +1825,7 @@ PHP_FUNCTION(iconv_substr) size_t charset_len; zend_string *str; zend_long offset, length = 0; - bool len_is_null = 1; + bool len_is_null = true; php_iconv_err_t err; From 82322d1d28a4a87b8f9023e29e5e41bbbec1b6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:29 +0200 Subject: [PATCH 015/386] intl: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/intl/converter/converter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 759db5e18873a..7ac4bdf00867d 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -343,7 +343,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo NULL, NULL, &error); if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); - ret = 0; + ret = false; } error = U_ZERO_ERROR; @@ -351,7 +351,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo NULL, NULL, &error); if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); - ret = 0; + ret = false; } return ret; } From 2ce4806875f8c87185bdbffb18462426e5ddbeb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:36 +0200 Subject: [PATCH 016/386] json: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/json/json_encoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index a73277915405d..e524dd7d94cae 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -164,7 +164,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, if (need_comma) { smart_str_appendc(buf, ','); } else { - need_comma = 1; + need_comma = true; } php_json_pretty_print_char(buf, options, '\n'); @@ -250,7 +250,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, if (need_comma) { smart_str_appendc(buf, ','); } else { - need_comma = 1; + need_comma = true; } php_json_pretty_print_char(buf, options, '\n'); @@ -279,7 +279,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, if (need_comma) { smart_str_appendc(buf, ','); } else { - need_comma = 1; + need_comma = true; } php_json_pretty_print_char(buf, options, '\n'); @@ -296,7 +296,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, if (need_comma) { smart_str_appendc(buf, ','); } else { - need_comma = 1; + need_comma = true; } php_json_pretty_print_char(buf, options, '\n'); From 59cfc83f9a75183fd2805ee1a5de17ef1deedc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:49:42 +0200 Subject: [PATCH 017/386] ldap: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/ldap/ldap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 9878374bbe26a..366903b2c2ab1 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -477,7 +477,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT cookie.bv_len = ZSTR_LEN(tmpstring); } /* ldap_create_page_control_value() allocates memory for control_value.bv_val */ - control_value_alloc = 1; + control_value_alloc = true; rc = ldap_create_page_control_value(ld, pagesize, &cookie, &control_value); if (rc != LDAP_SUCCESS) { php_error_docref(NULL, E_WARNING, "Failed to create paged result control value: %s (%d)", ldap_err2string(rc), rc); @@ -498,7 +498,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT int success = LDAP_SUCCESS; ldap_set_option(ld, LDAP_OPT_RESULT_CODE, &success); /* ldap_create_assertion_control_value() allocates memory for control_value.bv_val */ - control_value_alloc = 1; + control_value_alloc = true; rc = ldap_create_assertion_control_value(ld, ZSTR_VAL(assert), &control_value); if (rc != LDAP_SUCCESS) { php_error_docref(NULL, E_WARNING, "Failed to create assert control value: %s (%d)", ldap_err2string(rc), rc); @@ -631,7 +631,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT } sort_keys[num_keys] = NULL; /* ldap_create_sort_control_value() allocates memory for control_value.bv_val */ - control_value_alloc = 1; + control_value_alloc = true; rc = ldap_create_sort_control_value(ld, sort_keys, &control_value); if (rc != LDAP_SUCCESS) { php_error_docref(NULL, E_WARNING, "Failed to create sort control value: %s (%d)", ldap_err2string(rc), rc); @@ -698,7 +698,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT } /* ldap_create_vlv_control_value() allocates memory for control_value.bv_val */ - control_value_alloc = 1; + control_value_alloc = true; rc = ldap_create_vlv_control_value(ld, &vlvInfo, &control_value); if (rc != LDAP_SUCCESS) { php_error_docref(NULL, E_WARNING, "Failed to create VLV control value: %s (%d)", ldap_err2string(rc), rc); @@ -3932,7 +3932,7 @@ PHP_FUNCTION(ldap_escape) char *value, *ignores; size_t valuelen = 0, ignoreslen = 0; zend_long flags = 0; - bool map[256] = {0}, havecharlist = 0; + bool map[256] = {0}, havecharlist = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) { RETURN_THROWS(); @@ -3943,18 +3943,18 @@ PHP_FUNCTION(ldap_escape) } if (flags & PHP_LDAP_ESCAPE_FILTER) { - havecharlist = 1; + havecharlist = true; php_ldap_escape_map_set_chars(map, "\\*()\0", sizeof("\\*()\0") - 1, true); } if (flags & PHP_LDAP_ESCAPE_DN) { - havecharlist = 1; + havecharlist = true; php_ldap_escape_map_set_chars(map, "\\,=+<>;\"#\r", sizeof("\\,=+<>;\"#\r") - 1, true); } if (!havecharlist) { for (uint16_t i = 0; i < 256; i++) { - map[i] = 1; + map[i] = true; } } From af7340a26582ca5cae6cb147e3c48f2e9bef01b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:50:04 +0200 Subject: [PATCH 018/386] mbstring: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/mbstring/mbstring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4044f4de9ff57..f05a83b97c6ec 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -313,7 +313,7 @@ static zend_result php_mb_parse_encoding_list(const char *value, size_t value_le list = (const mbfl_encoding **)pecalloc(size, sizeof(mbfl_encoding*), persistent); entry = list; n = 0; - included_auto = 0; + included_auto = false; p1 = tmpstr; while (1) { const char *comma = memchr(p1, ',', endp - p1); @@ -333,7 +333,7 @@ static zend_result php_mb_parse_encoding_list(const char *value, size_t value_le const enum mbfl_no_encoding *src = MBSTRG(default_detect_order_list); const size_t identify_list_size = MBSTRG(default_detect_order_list_size); size_t i; - included_auto = 1; + included_auto = true; for (i = 0; i < identify_list_size; i++) { *entry++ = mbfl_no2encoding(*src++); n++; @@ -379,7 +379,7 @@ static zend_result php_mb_parse_encoding_array(HashTable *target_hash, const mbf size_t size = zend_hash_num_elements(target_hash) + MBSTRG(default_detect_order_list_size); const mbfl_encoding **list = ecalloc(size, sizeof(mbfl_encoding*)); const mbfl_encoding **entry = list; - bool included_auto = 0; + bool included_auto = false; size_t n = 0; zval *hash_entry; ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) { @@ -396,7 +396,7 @@ static zend_result php_mb_parse_encoding_array(HashTable *target_hash, const mbf const size_t identify_list_size = MBSTRG(default_detect_order_list_size); size_t j; - included_auto = 1; + included_auto = true; for (j = 0; j < identify_list_size; j++) { *entry++ = mbfl_no2encoding(*src++); n++; From 9fa2e96c90c97ee934ea0be13269f76f6f586adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:50:27 +0200 Subject: [PATCH 019/386] mysqli: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/mysqli/mysqli_nonapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index e0e14eeccbc92..2179d686a479f 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -56,12 +56,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; bool persistent = false, ssl = false; zend_long port = 0, flags = 0; - bool port_is_null = 1; + bool port_is_null = true; zend_string *hash_key = NULL; bool new_connection = false; zend_resource *le; mysqli_plist_entry *plist = NULL; - bool self_alloced = 0; + bool self_alloced = false; #if !defined(MYSQL_USE_MYSQLND) @@ -105,7 +105,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b } if (!mysql) { mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL)); - self_alloced = 1; + self_alloced = true; } flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */ } else { From b12eae465ca4c222e5d2aa28643c2f654162e8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:50:34 +0200 Subject: [PATCH 020/386] mysqlnd: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/mysqlnd/mysqlnd_ps_codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index a2e98cf358bb4..c60e3d327a8d7 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -317,7 +317,7 @@ ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, const unsigned int p const zend_uchar * to = *row; t.time_type = MYSQLND_TIMESTAMP_DATE; - t.neg = 0; + t.neg = false; t.second_part = t.hour = t.minute = t.second = 0; @@ -354,7 +354,7 @@ ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, const unsigned i const zend_uchar * to = *row; t.time_type = MYSQLND_TIMESTAMP_DATETIME; - t.neg = 0; + t.neg = false; t.year = (unsigned int) sint2korr(to); t.month = (unsigned int) to[2]; From 10f78cfd96d0e8578f29d7cc4a3f86cbcb761e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:50:40 +0200 Subject: [PATCH 021/386] odbc: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/odbc/php_odbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 7a6bc28718258..491f59b2bce3f 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2520,7 +2520,7 @@ PHP_FUNCTION(odbc_autocommit) { RETCODE rc; zval *pv_conn; - bool pv_onoff = 0; + bool pv_onoff = false; bool pv_onoff_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b!", &pv_conn, odbc_connection_ce, &pv_onoff, &pv_onoff_is_null) == FAILURE) { From 066b63e7d937beb5cd863ac592e48ed0968f922e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:06 +0200 Subject: [PATCH 022/386] opcache: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/opcache/jit/zend_jit.c | 66 +++---- ext/opcache/jit/zend_jit_internal.h | 2 +- ext/opcache/jit/zend_jit_ir.c | 236 +++++++++++++------------- ext/opcache/jit/zend_jit_trace.c | 6 +- ext/opcache/zend_accelerator_module.c | 4 +- 5 files changed, 157 insertions(+), 157 deletions(-) diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index f6a2f415c760d..26052c4f13bbe 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -210,38 +210,38 @@ static int zend_jit_is_constant_cmp_long_long(const zend_op *opline, case ZEND_CASE: case ZEND_CASE_STRICT: if (op1_min == op1_max && op2_min == op2_max && op1_min == op2_min) { - *result = 1; + *result = true; return 1; } else if (op1_max < op2_min || op1_min > op2_max) { - *result = 0; + *result = false; return 1; } return 0; case ZEND_IS_NOT_EQUAL: case ZEND_IS_NOT_IDENTICAL: if (op1_min == op1_max && op2_min == op2_max && op1_min == op2_min) { - *result = 0; + *result = false; return 1; } else if (op1_max < op2_min || op1_min > op2_max) { - *result = 1; + *result = true; return 1; } return 0; case ZEND_IS_SMALLER: if (op1_max < op2_min) { - *result = 1; + *result = true; return 1; } else if (op1_min >= op2_max) { - *result = 0; + *result = false; return 1; } return 0; case ZEND_IS_SMALLER_OR_EQUAL: if (op1_max <= op2_min) { - *result = 1; + *result = true; return 1; } else if (op1_min > op2_max) { - *result = 0; + *result = false; return 1; } return 0; @@ -1238,13 +1238,13 @@ static void zend_jit_allocate_registers(zend_jit_ctx *ctx, const zend_op_array * ((ra[i].flags & ZREG_LOAD) || ((ra[i].flags & ZREG_STORE) && ssa->vars[i].definition >= 0)) && ssa->vars[i].use_chain < 0) { - bool may_remove = 1; + bool may_remove = true; zend_ssa_phi *phi = ssa->vars[i].phi_use_chain; while (phi) { if (ra[phi->ssa_var].ref && !(ra[phi->ssa_var].flags & ZREG_LOAD)) { - may_remove = 0; + may_remove = false; break; } phi = zend_ssa_next_use_phi(ssa, i, phi); @@ -1299,13 +1299,13 @@ static void zend_jit_allocate_registers(zend_jit_ctx *ctx, const zend_op_array * && (ra[i].flags & ZREG_STORE) && (ssa->vars[i].use_chain < 0 || zend_ssa_next_use(ssa->ops, i, ssa->vars[i].use_chain) < 0)) { - bool may_remove = 1; + bool may_remove = true; zend_ssa_phi *phi = ssa->vars[i].phi_use_chain; while (phi) { if (ra[phi->ssa_var].ref && !(ra[phi->ssa_var].flags & ZREG_LOAD)) { - may_remove = 0; + may_remove = false; break; } phi = zend_ssa_next_use_phi(ssa, i, phi); @@ -1425,7 +1425,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op zend_vm_opcode_handler_t handler; int call_level = 0; void *checkpoint = NULL; - bool recv_emitted = 0; /* emitted at least one RECV opcode */ + bool recv_emitted = false; /* emitted at least one RECV opcode */ uint8_t smart_branch_opcode; uint32_t target_label, target_label2; uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info, op1_mem_info; @@ -1490,7 +1490,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op zend_jit_recv_entry(&ctx, b); } } - recv_emitted = 1; + recv_emitted = true; } else if (opline->opcode == ZEND_RECV) { if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { /* skip */ @@ -1500,7 +1500,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op } else if (recv_emitted) { zend_jit_recv_entry(&ctx, b); } else { - recv_emitted = 1; + recv_emitted = true; } } else { if (recv_emitted) { @@ -1883,8 +1883,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op break; } ce = NULL; - ce_is_instanceof = 0; - on_this = 0; + ce_is_instanceof = false; + on_this = false; if (opline->op1_type == IS_UNUSED) { op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN; ce = op_array->scope; @@ -1893,7 +1893,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL); } op1_addr = 0; - on_this = 1; + on_this = true; } else { op1_info = OP1_INFO(); if (!(op1_info & MAY_BE_OBJECT)) { @@ -1934,8 +1934,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op break; } ce = NULL; - ce_is_instanceof = 0; - on_this = 0; + ce_is_instanceof = false; + on_this = false; if (opline->op1_type == IS_UNUSED) { op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN; ce = op_array->scope; @@ -1944,7 +1944,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL); } op1_addr = 0; - on_this = 1; + on_this = true; } else { op1_info = OP1_INFO(); if (!(op1_info & MAY_BE_OBJECT)) { @@ -1978,8 +1978,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op break; } ce = NULL; - ce_is_instanceof = 0; - on_this = 0; + ce_is_instanceof = false; + on_this = false; if (opline->op1_type == IS_UNUSED) { op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN; ce = op_array->scope; @@ -1988,7 +1988,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL); } op1_addr = 0; - on_this = 1; + on_this = true; } else { op1_info = OP1_INFO(); if (!(op1_info & MAY_BE_OBJECT)) { @@ -2450,8 +2450,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op case ZEND_FETCH_OBJ_IS: case ZEND_FETCH_OBJ_W: ce = NULL; - ce_is_instanceof = 0; - on_this = 0; + ce_is_instanceof = false; + on_this = false; if (opline->op1_type == IS_UNUSED) { op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN; op1_addr = 0; @@ -2460,7 +2460,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op if (ce) { ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL); } - on_this = 1; + on_this = true; } else { op1_info = OP1_INFO(); if (!(op1_info & MAY_BE_OBJECT)) { @@ -2630,8 +2630,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op break; } ce = NULL; - ce_is_instanceof = 0; - on_this = 0; + ce_is_instanceof = false; + on_this = false; if (opline->op1_type == IS_UNUSED) { op1_info = MAY_BE_OBJECT|MAY_BE_RC1|MAY_BE_RCN; op1_addr = 0; @@ -2640,7 +2640,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op if (ce) { ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL); } - on_this = 1; + on_this = true; } else { op1_info = OP1_INFO(); if (!(op1_info & MAY_BE_OBJECT)) { @@ -2907,13 +2907,13 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op if (jit->return_inputs) { zend_jit_common_return(jit); - bool left_frame = 0; + bool left_frame = false; if (op_array->last_var > 100) { /* To many CVs to unroll */ if (!zend_jit_free_cvs(&ctx)) { goto jit_failure; } - left_frame = 1; + left_frame = true; } if (!left_frame) { int j; @@ -2923,7 +2923,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op if (info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) { if (!left_frame) { - left_frame = 1; + left_frame = true; if (!zend_jit_leave_frame(&ctx)) { goto jit_failure; } diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 1bffc969902a2..8efbfee79e938 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -706,7 +706,7 @@ static zend_always_inline const zend_op* zend_jit_trace_get_exit_opline(zend_jit } else { ZEND_UNREACHABLE(); } - *exit_if_true = 0; + *exit_if_true = false; return NULL; } diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index ec55239953aad..7ff9aae0249fb 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -199,7 +199,7 @@ static size_t zend_jit_trace_prologue_size = (size_t)-1; static uint32_t allowed_opt_flags = 0; static uint32_t default_mflags = 0; #endif -static bool delayed_call_chain = 0; // TODO: remove this var (use jit->delayed_call_level) ??? +static bool delayed_call_chain = false; // TODO: remove this var (use jit->delayed_call_level) ??? #ifdef ZTS static size_t tsrm_ls_cache_tcb_offset = 0; @@ -989,15 +989,15 @@ static void jit_LOAD_IP_ADDR(zend_jit_ctx *jit, const zend_op *target) static void zend_jit_track_last_valid_opline(zend_jit_ctx *jit) { - jit->use_last_valid_opline = 0; - jit->track_last_valid_opline = 1; + jit->use_last_valid_opline = false; + jit->track_last_valid_opline = true; } static void zend_jit_use_last_valid_opline(zend_jit_ctx *jit) { if (jit->track_last_valid_opline) { - jit->use_last_valid_opline = 1; - jit->track_last_valid_opline = 0; + jit->use_last_valid_opline = true; + jit->track_last_valid_opline = false; } } @@ -1009,21 +1009,21 @@ static bool zend_jit_trace_uses_initial_ip(zend_jit_ctx *jit) static void zend_jit_set_last_valid_opline(zend_jit_ctx *jit, const zend_op *opline) { if (!jit->reuse_ip) { - jit->track_last_valid_opline = 1; + jit->track_last_valid_opline = true; jit->last_valid_opline = opline; } } static void zend_jit_reset_last_valid_opline(zend_jit_ctx *jit) { - jit->track_last_valid_opline = 0; + jit->track_last_valid_opline = false; jit->last_valid_opline = NULL; } static void zend_jit_start_reuse_ip(zend_jit_ctx *jit) { zend_jit_reset_last_valid_opline(jit); - jit->reuse_ip = 1; + jit->reuse_ip = true; } static int zend_jit_reuse_ip(zend_jit_ctx *jit) @@ -1038,7 +1038,7 @@ static int zend_jit_reuse_ip(zend_jit_ctx *jit) static void zend_jit_stop_reuse_ip(zend_jit_ctx *jit) { - jit->reuse_ip = 0; + jit->reuse_ip = false; } static int zend_jit_save_call_chain(zend_jit_ctx *jit, uint32_t call_level) @@ -1062,7 +1062,7 @@ static int zend_jit_save_call_chain(zend_jit_ctx *jit, uint32_t call_level) ir_STORE(jit_EX(call), rx); jit->delayed_call_level = 0; - delayed_call_chain = 0; + delayed_call_chain = false; return 1; } @@ -1091,7 +1091,7 @@ static int zend_jit_set_ip(zend_jit_ctx *jit, const zend_op *target) } else { jit_STORE_IP(jit, ir_CONST_ADDR(target)); } - jit->reuse_ip = 0; + jit->reuse_ip = false; zend_jit_set_last_valid_opline(jit, target); return 1; } @@ -1485,7 +1485,7 @@ static void zend_jit_gen_phi(zend_jit_ctx *jit, zend_ssa_phi *phi) ir_ref ref; ir_ref old_insns_count = jit->ctx.insns_count; ir_ref same_src_ref = IR_UNUSED; - bool phi_inputs_are_the_same = 1; + bool phi_inputs_are_the_same = true; ZEND_ASSERT(phi->pi < 0); ZEND_ASSERT(!(jit->ra[dst_var].flags & ZREG_LOAD)); @@ -1502,13 +1502,13 @@ static void zend_jit_gen_phi(zend_jit_ctx *jit, zend_ssa_phi *phi) ZEND_ASSERT(jit->ra[src_var].ref); if (jit->ra[src_var].ref == IR_NULL) { jit->ra[src_var].flags |= ZREG_FORWARD; - phi_inputs_are_the_same = 0; + phi_inputs_are_the_same = false; } else { ir_ref src_ref = zend_jit_use_reg(jit, ZEND_ADDR_REG(src_var)); if (i == 0) { same_src_ref = src_ref; } else if (same_src_ref != src_ref) { - phi_inputs_are_the_same = 0; + phi_inputs_are_the_same = false; } ir_set_op(&jit->ctx, ref, i + 2, src_ref); } @@ -2814,11 +2814,11 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags) jit->ssa = NULL; jit->name = NULL; jit->last_valid_opline = NULL; - jit->use_last_valid_opline = 0; - jit->track_last_valid_opline = 0; - jit->reuse_ip = 0; + jit->use_last_valid_opline = false; + jit->track_last_valid_opline = false; + jit->reuse_ip = false; jit->delayed_call_level = 0; - delayed_call_chain = 0; + delayed_call_chain = false; jit->b = -1; #ifdef ZTS jit->tls = IR_UNUSED; @@ -3670,7 +3670,7 @@ static void zend_jit_case_start(zend_jit_ctx *jit, int switch_b, int case_b, ir_ int default_b = jit->ssa->cfg.map[default_opline - jit->op_array->opcodes]; zval *zv; ir_ref list = IR_UNUSED, idx; - bool first = 1; + bool first = true; ZEND_HASH_FOREACH_VAL(jumptable, zv) { const zend_op *target = ZEND_OFFSET_TO_OPLINE(opline, Z_LVAL_P(zv)); @@ -3686,7 +3686,7 @@ static void zend_jit_case_start(zend_jit_ctx *jit, int switch_b, int case_b, ir_ idx = ir_CONST_LONG((Bucket*)zv - jumptable->arData); } ir_CASE_VAL(switch_ref, idx); - first = 0; + first = false; } } ZEND_HASH_FOREACH_END(); if (default_b == case_b) { @@ -4518,7 +4518,7 @@ static int zend_jit_store_var_if_necessary_ex(zend_jit_ctx *jit, int var, zend_j { if (Z_MODE(src) == IS_REG && Z_STORE(src)) { zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, var); - bool set_type = 1; + bool set_type = true; if ((info & (MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)) == (old_info & (MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF))) { @@ -4528,10 +4528,10 @@ static int zend_jit_store_var_if_necessary_ex(zend_jit_ctx *jit, int var, zend_j if (mem_type != IS_UNKNOWN && (info & (MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)) == (1 << mem_type)) { - set_type = 0; + set_type = false; } } else { - set_type = 0; + set_type = false; } } } @@ -6468,7 +6468,7 @@ static int zend_jit_assign_to_variable(zend_jit_ctx *jit, { ir_ref if_refcounted = IR_UNUSED; ir_ref simple_inputs = IR_UNUSED; - bool done = 0; + bool done = false; zend_jit_addr real_res_addr = 0; ir_refs *end_inputs; ir_refs *res_inputs; @@ -6578,7 +6578,7 @@ static int zend_jit_assign_to_variable(zend_jit_ctx *jit, ir_END_list(simple_inputs); ir_IF_TRUE_cold(if_refcounted); } else if (RC_MAY_BE_1(var_info)) { - done = 1; + done = true; } ref = jit_Z_PTR(jit, var_use_addr); if (RC_MAY_BE_1(var_info)) { @@ -7303,7 +7303,7 @@ static int zend_jit_identical(zend_jit_ctx *jit, const void *exit_addr, bool skip_comparison) { - bool always_false = 0, always_true = 0; + bool always_false = false, always_true = false; ir_ref ref = IR_UNUSED; if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { @@ -7320,17 +7320,17 @@ static int zend_jit_identical(zend_jit_ctx *jit, } if ((op1_info & op2_info & MAY_BE_ANY) == 0) { - always_false = 1; + always_false = true; } else if (has_concrete_type(op1_info) && has_concrete_type(op2_info) && concrete_type(op1_info) == concrete_type(op2_info) && concrete_type(op1_info) <= IS_TRUE) { - always_true = 1; + always_true = true; } else if (Z_MODE(op1_addr) == IS_CONST_ZVAL && Z_MODE(op2_addr) == IS_CONST_ZVAL) { if (zend_is_identical(Z_ZV(op1_addr), Z_ZV(op2_addr))) { - always_true = 1; + always_true = true; } else { - always_false = 1; + always_false = true; } } @@ -7532,17 +7532,17 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 { uint32_t true_label = -1; uint32_t false_label = -1; - bool set_bool = 0; - bool set_bool_not = 0; - bool always_true = 0, always_false = 0; + bool set_bool = false; + bool set_bool_not = false; + bool always_true = false, always_false = false; ir_ref ref, end_inputs = IR_UNUSED, true_inputs = IR_UNUSED, false_inputs = IR_UNUSED; ir_type type = IR_UNUSED; if (branch_opcode == ZEND_BOOL) { - set_bool = 1; + set_bool = true; } else if (branch_opcode == ZEND_BOOL_NOT) { - set_bool = 1; - set_bool_not = 1; + set_bool = true; + set_bool_not = true; } else if (branch_opcode == ZEND_JMPZ) { true_label = target_label2; false_label = target_label; @@ -7550,11 +7550,11 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 true_label = target_label; false_label = target_label2; } else if (branch_opcode == ZEND_JMPZ_EX) { - set_bool = 1; + set_bool = true; true_label = target_label2; false_label = target_label; } else if (branch_opcode == ZEND_JMPNZ_EX) { - set_bool = 1; + set_bool = true; true_label = target_label; false_label = target_label2; } else { @@ -7571,19 +7571,19 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 /* NAN Value must cause a warning to be emitted */ && (Z_TYPE_P(Z_ZV(op1_addr)) != IS_DOUBLE || !zend_isnan(Z_DVAL_P(Z_ZV(op1_addr))))) { if (zend_is_true(Z_ZV(op1_addr))) { - always_true = 1; + always_true = true; } else { - always_false = 1; + always_false = true; } } else if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE)) { if (!(op1_info & ((MAY_BE_UNDEF|MAY_BE_ANY)-MAY_BE_TRUE))) { - always_true = 1; + always_true = true; } else if (!(op1_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_FALSE)))) { if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { ref = jit_ZVAL_ADDR(jit, op1_addr); zend_jit_zval_check_undef(jit, ref, opline->op1.var, opline, 0); } - always_false = 1; + always_false = true; } } @@ -8250,7 +8250,7 @@ static int zend_jit_type_check(zend_jit_ctx *jit, const zend_op *opline, uint32_ } } else { ir_ref ref; - bool invert = 0; + bool invert = false; uint8_t type; switch (mask) { @@ -8262,15 +8262,15 @@ static int zend_jit_type_check(zend_jit_ctx *jit, const zend_op *opline, uint32_ case MAY_BE_STRING: type = IS_STRING; break; case MAY_BE_ARRAY: type = IS_ARRAY; break; case MAY_BE_OBJECT: type = IS_OBJECT; break; - case MAY_BE_ANY - MAY_BE_NULL: type = IS_NULL; invert = 1; break; - case MAY_BE_ANY - MAY_BE_FALSE: type = IS_FALSE; invert = 1; break; - case MAY_BE_ANY - MAY_BE_TRUE: type = IS_TRUE; invert = 1; break; - case MAY_BE_ANY - MAY_BE_LONG: type = IS_LONG; invert = 1; break; - case MAY_BE_ANY - MAY_BE_DOUBLE: type = IS_DOUBLE; invert = 1; break; - case MAY_BE_ANY - MAY_BE_STRING: type = IS_STRING; invert = 1; break; - case MAY_BE_ANY - MAY_BE_ARRAY: type = IS_ARRAY; invert = 1; break; - case MAY_BE_ANY - MAY_BE_OBJECT: type = IS_OBJECT; invert = 1; break; - case MAY_BE_ANY - MAY_BE_RESOURCE: type = IS_OBJECT; invert = 1; break; + case MAY_BE_ANY - MAY_BE_NULL: type = IS_NULL; invert = true; break; + case MAY_BE_ANY - MAY_BE_FALSE: type = IS_FALSE; invert = true; break; + case MAY_BE_ANY - MAY_BE_TRUE: type = IS_TRUE; invert = true; break; + case MAY_BE_ANY - MAY_BE_LONG: type = IS_LONG; invert = true; break; + case MAY_BE_ANY - MAY_BE_DOUBLE: type = IS_DOUBLE; invert = true; break; + case MAY_BE_ANY - MAY_BE_STRING: type = IS_STRING; invert = true; break; + case MAY_BE_ANY - MAY_BE_ARRAY: type = IS_ARRAY; invert = true; break; + case MAY_BE_ANY - MAY_BE_OBJECT: type = IS_OBJECT; invert = true; break; + case MAY_BE_ANY - MAY_BE_RESOURCE: type = IS_OBJECT; invert = true; break; default: type = 0; } @@ -8454,14 +8454,14 @@ static int zend_jit_push_call_frame(zend_jit_ctx *jit, const zend_op *opline, co { uint32_t used_stack; ir_ref used_stack_ref = IR_UNUSED; - bool stack_check = 1; + bool stack_check = true; ir_ref rx, ref, top, if_enough_stack, cold_path = IR_UNUSED; ZEND_ASSERT(func_ref != IR_NULL); if (func) { used_stack = zend_vm_calc_used_stack(opline->extended_value, func); if ((int)used_stack <= checked_stack) { - stack_check = 0; + stack_check = false; } used_stack_ref = ir_CONST_ADDR(used_stack); } else { @@ -8901,7 +8901,7 @@ jit_SET_EX_OPLINE(jit, opline); } else { ZEND_ASSERT(call_level > 0); jit->delayed_call_level = call_level; - delayed_call_chain = 1; + delayed_call_chain = true; } if (trace @@ -9165,7 +9165,7 @@ static int zend_jit_init_method_call(zend_jit_ctx *jit, } } else { ZEND_ASSERT(call_level > 0); - delayed_call_chain = 1; + delayed_call_chain = true; jit->delayed_call_level = call_level; } @@ -9344,7 +9344,7 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit, } else { ZEND_ASSERT(call_level > 0); jit->delayed_call_level = call_level; - delayed_call_chain = 1; + delayed_call_chain = true; } if (trace @@ -9435,7 +9435,7 @@ static int zend_jit_init_closure_call(zend_jit_ctx *jit, } } else { ZEND_ASSERT(call_level > 0); - delayed_call_chain = 1; + delayed_call_chain = true; jit->delayed_call_level = call_level; } @@ -10007,7 +10007,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen const zend_function *func = NULL; uint32_t i; uint32_t call_num_args = 0; - bool unknown_num_args = 0; + bool unknown_num_args = false; const void *exit_addr = NULL; const zend_op *prev_opline; ir_ref rx, func_ref = IR_UNUSED, if_user = IR_UNUSED, user_path = IR_UNUSED; @@ -10018,7 +10018,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen } if (prev_opline->opcode == ZEND_SEND_UNPACK || prev_opline->opcode == ZEND_SEND_ARRAY || prev_opline->opcode == ZEND_CHECK_UNDEF_ARGS) { - unknown_num_args = 1; + unknown_num_args = true; } if (info) { @@ -10059,7 +10059,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)->call) >= 0) { call_num_args = TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)->call); } else { - unknown_num_args = 1; + unknown_num_args = true; } #endif } else if (trace->op == ZEND_JIT_TRACE_ENTER) { @@ -10071,7 +10071,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)->call) >= 0) { call_num_args = TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)->call); } else { - unknown_num_args = 1; + unknown_num_args = true; } } } @@ -10116,7 +10116,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen ir_STORE(jit_EX(call), (call_level == 1) ? IR_NULL : ir_LOAD_A(jit_CALL(rx, prev_execute_data))); } - delayed_call_chain = 0; + delayed_call_chain = false; jit->delayed_call_level = 0; // JIT: call->prev_execute_data = execute_data; @@ -10184,7 +10184,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen if ((!func || func->type == ZEND_USER_FUNCTION) && opline->opcode != ZEND_DO_ICALL) { - bool recursive_call_through_jmp = 0; + bool recursive_call_through_jmp = false; uint32_t num_args = 0; // JIT: EX(call) = NULL; @@ -10276,7 +10276,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen if (!trace && op_array == &func->op_array && call_num_args >= op_array->required_num_args) { /* recursive call */ - recursive_call_through_jmp = 1; + recursive_call_through_jmp = true; } } } else { @@ -10946,7 +10946,7 @@ static bool zend_jit_verify_return_type(zend_jit_ctx *jit, const zend_op *opline zend_arg_info *arg_info = &op_array->arg_info[-1]; ZEND_ASSERT(ZEND_TYPE_IS_SET(arg_info->type)); zend_jit_addr op1_addr = OP1_ADDR(); - bool needs_slow_check = 1; + bool needs_slow_check = true; uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY; ir_ref fast_path = IR_UNUSED; @@ -10954,7 +10954,7 @@ static bool zend_jit_verify_return_type(zend_jit_ctx *jit, const zend_op *opline if (((op1_info & MAY_BE_ANY) & type_mask) == 0) { /* pass */ } else if (((op1_info & MAY_BE_ANY) | type_mask) == type_mask) { - needs_slow_check = 0; + needs_slow_check = false; } else if (is_power_of_two(type_mask)) { uint32_t type_code = concrete_type(type_mask); ir_ref if_ok = jit_if_Z_TYPE(jit, op1_addr, type_code); @@ -11065,7 +11065,7 @@ static int zend_jit_leave_func(zend_jit_ctx *jit, if (may_need_call_helper) { if (!left_frame) { - left_frame = 1; + left_frame = true; if (!zend_jit_leave_frame(jit)) { return 0; } @@ -11113,7 +11113,7 @@ static int zend_jit_leave_func(zend_jit_ctx *jit, if ((op_array->fn_flags & (ZEND_ACC_CLOSURE|ZEND_ACC_FAKE_CLOSURE)) == ZEND_ACC_CLOSURE) { if (!left_frame) { - left_frame = 1; + left_frame = true; if (!zend_jit_leave_frame(jit)) { return 0; } @@ -11124,7 +11124,7 @@ static int zend_jit_leave_func(zend_jit_ctx *jit, ir_ref if_release, fast_path = IR_UNUSED; if (!left_frame) { - left_frame = 1; + left_frame = true; if (!zend_jit_leave_frame(jit)) { return 0; } @@ -11950,9 +11950,9 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, } if (op2_info & MAY_BE_LONG) { - bool op2_loaded = 0; - bool packed_loaded = 0; - bool bad_packed_key = 0; + bool op2_loaded = false; + bool packed_loaded = false; + bool bad_packed_key = false; ir_ref if_packed = IS_UNDEF; ir_ref h = IR_UNUSED; ir_ref idx_not_found_inputs = IR_UNUSED; @@ -11981,7 +11981,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, if (type == BP_VAR_W) { // JIT: hval = Z_LVAL_P(dim); h = jit_Z_LVAL(jit, op2_addr); - op2_loaded = 1; + op2_loaded = true; } if (op1_info & MAY_BE_ARRAY_PACKED) { zend_long val = -1; @@ -11989,23 +11989,23 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, if (Z_MODE(op2_addr) == IS_CONST_ZVAL) { val = Z_LVAL_P(Z_ZV(op2_addr)); if (val >= 0 && val < HT_MAX_SIZE) { - packed_loaded = 1; + packed_loaded = true; } else { - bad_packed_key = 1; + bad_packed_key = true; } h = ir_CONST_LONG(val); } else { if (!op2_loaded) { // JIT: hval = Z_LVAL_P(dim); h = jit_Z_LVAL(jit, op2_addr); - op2_loaded = 1; + op2_loaded = true; } - packed_loaded = 1; + packed_loaded = true; } if (dim_type == IS_UNDEF && type == BP_VAR_W && packed_loaded) { /* don't generate "fast" code for packed array */ - packed_loaded = 0; + packed_loaded = false; } if (packed_loaded) { @@ -12076,7 +12076,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, if (!op2_loaded) { // JIT: hval = Z_LVAL_P(dim); h = jit_Z_LVAL(jit, op2_addr); - op2_loaded = 1; + op2_loaded = true; } if (packed_loaded) { ref = ir_CALL_2(IR_ADDR, ir_CONST_FC_FUNC(_zend_hash_index_find), ht_ref, h); @@ -12126,7 +12126,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, if (!op2_loaded) { // JIT: hval = Z_LVAL_P(dim); h = jit_Z_LVAL(jit, op2_addr); - op2_loaded = 1; + op2_loaded = true; } if (packed_loaded) { ref = ir_CALL_2(IR_ADDR, ir_CONST_FC_FUNC(_zend_hash_index_find), ht_ref, h); @@ -12526,8 +12526,8 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit, zend_jit_addr orig_op1_addr; const void *exit_addr = NULL; const void *not_found_exit_addr = NULL; - bool result_type_guard = 0; - bool result_avoid_refcounting = 0; + bool result_type_guard = false; + bool result_avoid_refcounting = false; uint32_t may_be_string = (opline->opcode != ZEND_FETCH_LIST_R) ? MAY_BE_STRING : 0; int may_throw = 0; ir_ref if_type = IR_UNUSED; @@ -12551,7 +12551,7 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit, && (op1_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) { if (!(op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF) - (MAY_BE_STRING|MAY_BE_LONG)))) { - result_type_guard = 1; + result_type_guard = true; res_info &= ~MAY_BE_GUARD; ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; } @@ -12564,7 +12564,7 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit, && (ssa_op+1)->op1_use == ssa_op->result_def && !(op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF) - (MAY_BE_STRING|MAY_BE_LONG))) && zend_jit_may_avoid_refcounting(opline+1, res_info)) { - result_avoid_refcounting = 1; + result_avoid_refcounting = true; ssa->var_info[ssa_op->result_def].avoid_refcounting = 1; } @@ -13544,7 +13544,7 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, uint32_t var_info = MAY_BE_NULL; ir_ref if_type = IS_UNUSED; ir_ref end_inputs = IR_UNUSED, ht_ref; - bool emit_fast_path = 1; + bool emit_fast_path = true; ZEND_ASSERT(opline->result_type == IS_UNUSED); @@ -13660,7 +13660,7 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, var_addr = ZEND_ADDR_REF_ZVAL(ref); } } else { - emit_fast_path = 0; + emit_fast_path = false; } } @@ -14222,7 +14222,7 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit, { zval *member; zend_property_info *prop_info; - bool may_be_dynamic = 1; + bool may_be_dynamic = true; zend_jit_addr prop_addr; uint32_t res_info = RES_INFO(); ir_ref prop_type_ref = IR_UNUSED; @@ -14313,7 +14313,7 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit, prop_info = zend_get_known_property_info(op_array, trace_ce, Z_STR_P(member), on_this, op_array->filename); if (prop_info) { ce = trace_ce; - ce_is_instanceof = 0; + ce_is_instanceof = false; if (!(op1_info & MAY_BE_CLASS_GUARD)) { if (on_this && JIT_G(current_frame) && TRACE_FRAME_IS_THIS_CLASS_CHECKED(JIT_G(current_frame))) { @@ -14638,7 +14638,7 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit, if (end_values) { ir_ref val_ref = ir_PHI_list(end_values); zend_jit_addr val_addr = ZEND_ADDR_REF_ZVAL(val_ref); - bool result_avoid_refcounting = 0; + bool result_avoid_refcounting = false; ZEND_ASSERT(opline->opcode == ZEND_FETCH_OBJ_R || opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG @@ -14659,7 +14659,7 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit, && (res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) && (ssa_op+1)->op1_use == ssa_op->result_def && zend_jit_may_avoid_refcounting(opline+1, res_info)) { - result_avoid_refcounting = 1; + result_avoid_refcounting = true; ssa->var_info[ssa_op->result_def].avoid_refcounting = 1; } @@ -14835,7 +14835,7 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit, prop_info = zend_get_known_property_info(op_array, trace_ce, name, on_this, op_array->filename); if (prop_info) { ce = trace_ce; - ce_is_instanceof = 0; + ce_is_instanceof = false; if (!(op1_info & MAY_BE_CLASS_GUARD)) { if (on_this && JIT_G(current_frame) && TRACE_FRAME_IS_THIS_CLASS_CHECKED(JIT_G(current_frame))) { @@ -15117,8 +15117,8 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, zend_string *name; zend_property_info *prop_info; zend_jit_addr prop_addr; - bool use_prop_guard = 0; - bool may_throw = 0; + bool use_prop_guard = false; + bool may_throw = false; binary_op_type binary_op = get_binary_op(opline->extended_value); ir_ref obj_ref = IR_UNUSED; ir_ref prop_ref = IR_UNUSED; @@ -15167,7 +15167,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, jit_ZVAL_ADDR(jit, op1_addr), ir_CONST_ADDR(ZSTR_VAL(name))); - may_throw = 1; + may_throw = true; ir_END_list(end_inputs); ir_IF_TRUE(if_obj); @@ -15181,7 +15181,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, prop_info = zend_get_known_property_info(op_array, trace_ce, name, on_this, op_array->filename); if (prop_info) { ce = trace_ce; - ce_is_instanceof = 0; + ce_is_instanceof = false; if (!(op1_info & MAY_BE_CLASS_GUARD)) { if (on_this && JIT_G(current_frame) && TRACE_FRAME_IS_THIS_CLASS_CHECKED(JIT_G(current_frame))) { @@ -15279,7 +15279,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, if (ZEND_TYPE_IS_SET(prop_info->type)) { ir_ref if_ref, if_typed, noref_path, ref_path, reference, ref, arg2; - may_throw = 1; + may_throw = true; jit_SET_EX_OPLINE(jit, opline); @@ -15357,7 +15357,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, if (var_info & MAY_BE_REF) { ir_ref if_ref, if_typed, noref_path, ref_path, reference, ref, arg2; - may_throw = 1; + may_throw = true; if_ref = jit_if_Z_TYPE(jit, prop_addr, IS_REFERENCE); ir_IF_FALSE(if_ref); @@ -15411,7 +15411,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, if (opline->extended_value != ZEND_ADD || (var_info & MAY_BE_ANY) != MAY_BE_ARRAY || (val_info & MAY_BE_ANY) == MAY_BE_ARRAY) { - may_throw = 1; + may_throw = true; } } if (!zend_jit_math_helper(jit, opline, opline->extended_value, IS_CV, opline->op1, var_addr, var_info, val_op_type, (opline+1)->op1, val_addr, val_info, 0, var_addr, var_def_info, var_info, @@ -15426,7 +15426,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, (val_info & (MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) { if ((var_info & MAY_BE_ANY) != MAY_BE_STRING || (val_info & MAY_BE_ANY) != MAY_BE_STRING) { - may_throw = 1; + may_throw = true; } } goto long_math; @@ -15434,23 +15434,23 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, case ZEND_SR: if ((var_info & (MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) || (val_info & (MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) { - may_throw = 1; + may_throw = true; } if (val_op_type != IS_CONST || Z_TYPE_P(RT_CONSTANT((opline+1), (opline+1)->op1)) != IS_LONG || Z_LVAL_P(RT_CONSTANT((opline+1), (opline+1)->op1)) < 0) { - may_throw = 1; + may_throw = true; } goto long_math; case ZEND_MOD: if ((var_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) || (val_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) { - may_throw = 1; + may_throw = true; } if (val_op_type != IS_CONST || Z_TYPE_P(RT_CONSTANT((opline+1), (opline+1)->op1)) != IS_LONG || Z_LVAL_P(RT_CONSTANT((opline+1), (opline+1)->op1)) == 0) { - may_throw = 1; + may_throw = true; } long_math: if (!zend_jit_long_math_helper(jit, opline, opline->extended_value, @@ -15462,7 +15462,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, } break; case ZEND_CONCAT: - may_throw = 1; + may_throw = true; if (!zend_jit_concat_helper(jit, opline, IS_CV, opline->op1, var_addr, var_info, val_op_type, (opline+1)->op1, val_addr, val_info, var_addr, 0)) { return 0; @@ -15481,7 +15481,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, ir_MERGE_list(slow_inputs); - may_throw = 1; + may_throw = true; if (Z_MODE(val_addr) == IS_REG) { zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, (opline+1)->op1.var); @@ -15517,7 +15517,7 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit, if (opline->op1_type != IS_UNUSED && !delayed_fetch_this && !op1_indirect) { if ((op1_info & MAY_HAVE_DTOR) && (op1_info & MAY_BE_RC1)) { - may_throw = 1; + may_throw = true; } jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, opline); } @@ -15549,8 +15549,8 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, zend_property_info *prop_info; zend_jit_addr res_addr = 0; zend_jit_addr prop_addr; - bool use_prop_guard = 0; - bool may_throw = 0; + bool use_prop_guard = false; + bool may_throw = false; uint32_t res_info = (opline->result_type != IS_UNDEF) ? RES_INFO() : 0; ir_ref obj_ref = IR_UNUSED; ir_ref prop_ref = IR_UNUSED; @@ -15611,7 +15611,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, prop_info = zend_get_known_property_info(op_array, trace_ce, name, on_this, op_array->filename); if (prop_info) { ce = trace_ce; - ce_is_instanceof = 0; + ce_is_instanceof = false; if (!(op1_info & MAY_BE_CLASS_GUARD)) { if (on_this && JIT_G(current_frame) && TRACE_FRAME_IS_THIS_CLASS_CHECKED(JIT_G(current_frame))) { @@ -15704,7 +15704,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, const void *func; ir_ref ref; - may_throw = 1; + may_throw = true; jit_SET_EX_OPLINE(jit, opline); if (ce && ce->ce_flags & ZEND_ACC_IMMUTABLE) { @@ -15809,7 +15809,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, ZEND_UNREACHABLE(); } - may_throw = 1; + may_throw = true; jit_SET_EX_OPLINE(jit, opline); ir_CALL_2(IR_VOID, ir_CONST_FC_FUNC(func), reference, @@ -15861,7 +15861,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, if (var_info & (MAY_BE_ANY - MAY_BE_LONG)) { if (var_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) { - may_throw = 1; + may_throw = true; } if (if_long) { ir_IF_FALSE_cold(if_long); @@ -15977,7 +15977,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, ZEND_UNREACHABLE(); } - may_throw = 1; + may_throw = true; jit_SET_EX_OPLINE(jit, opline); ir_ref run_time_cache = ir_LOAD_A(jit_EX(run_time_cache)); ir_CALL_4(IR_VOID, ir_CONST_FC_FUNC(func), @@ -15995,7 +15995,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !delayed_fetch_this && !op1_indirect) { if ((op1_info & MAY_HAVE_DTOR) && (op1_info & MAY_BE_RC1)) { - may_throw = 1; + may_throw = true; } jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, opline); } @@ -17161,7 +17161,7 @@ static int zend_jit_trace_handler(zend_jit_ctx *jit, const zend_op_array *op_arr zend_jit_trace_stack *stack = JIT_G(current_frame)->stack; if (zend_is_smart_branch(opline)) { - bool exit_if_true = 0; + bool exit_if_true = false; exit_opline = zend_jit_trace_get_exit_opline(trace, opline + 1, &exit_if_true); } else { switch (opline->opcode) { @@ -17670,7 +17670,7 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, int def_block, use_block, b, use, j; zend_basic_block *bb; zend_ssa_phi *p; - bool ret = 1; + bool ret = true; zend_worklist worklist; ALLOCA_FLAG(use_heap) @@ -17716,7 +17716,7 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, b = zend_worklist_pop(&worklist); bb = &ssa->cfg.blocks[b]; if (bb->flags & (ZEND_BB_ENTRY|ZEND_BB_RECV_ENTRY)) { - ret = 0; + ret = false; break; } for (j = 0; j < bb->predecessors_count; j++) { diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 21698f71500c7..464997cf91582 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2965,7 +2965,7 @@ static zend_jit_reg_var* zend_jit_trace_allocate_registers(zend_jit_trace_rec *t && ssa_op->op1_def >= 0 && ssa->vars[ssa_op->op1_def].alias != NO_ALIAS) { /* avoid register allocation in case of possibility of indirect modification*/ - support_opline = 0; + support_opline = false; } if (ssa_op->op1_use >= 0 @@ -7428,7 +7428,7 @@ static zend_vm_opcode_handler_t zend_jit_trace_exit_to_vm(uint32_t trace_num, ui const zend_op *opline; uint32_t stack_size; zend_jit_trace_stack *stack; - bool original_handler = 0; + bool original_handler = false; if (!zend_jit_trace_exit_needs_deoptimization(trace_num, exit_num)) { return zend_jit_stub_handlers[jit_stub_trace_escape]; @@ -7465,7 +7465,7 @@ static zend_vm_opcode_handler_t zend_jit_trace_exit_to_vm(uint32_t trace_num, ui if (ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->orig_handler != opline->handler) { /* prevent endless loop */ - original_handler = 1; + original_handler = true; } } zend_jit_set_ip(&ctx, opline); diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 6f668af9b714d..32d9354c1e6d5 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -670,7 +670,7 @@ ZEND_FUNCTION(opcache_get_status) { zend_long reqs; zval memory_usage, statistics, scripts; - bool fetch_scripts = 1; + bool fetch_scripts = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &fetch_scripts) == FAILURE) { RETURN_THROWS(); @@ -937,7 +937,7 @@ ZEND_FUNCTION(opcache_reset) ZEND_FUNCTION(opcache_invalidate) { zend_string *script_name; - bool force = 0; + bool force = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &script_name, &force) == FAILURE) { RETURN_THROWS(); From 2ab04924aa27890079b8f56f0d1c5cf0679f8b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:15 +0200 Subject: [PATCH 023/386] openssl: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/openssl/openssl.c | 6 +++--- ext/openssl/openssl_backend_common.c | 20 ++++++++++---------- ext/openssl/xp_ssl.c | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index cb134e9154b52..736bdf315e3e9 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4370,7 +4370,7 @@ PHP_FUNCTION(openssl_open) /* {{{ Return array of available digest algorithms */ PHP_FUNCTION(openssl_get_md_methods) { - bool aliases = 0; + bool aliases = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) { RETURN_THROWS(); @@ -4382,7 +4382,7 @@ PHP_FUNCTION(openssl_get_md_methods) /* {{{ Return array of available cipher algorithms */ PHP_FUNCTION(openssl_get_cipher_methods) { - bool aliases = 0; + bool aliases = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) { RETURN_THROWS(); @@ -4424,7 +4424,7 @@ PHP_FUNCTION(openssl_get_curve_names) /* {{{ Computes digest hash value for given data using given method, returns raw or binhex encoded string */ PHP_FUNCTION(openssl_digest) { - bool raw_output = 0; + bool raw_output = false; char *data, *method; size_t data_len, method_len; const EVP_MD *mdtype; diff --git a/ext/openssl/openssl_backend_common.c b/ext/openssl/openssl_backend_common.c index ea52531bde45b..5671240c044e2 100644 --- a/ext/openssl/openssl_backend_common.c +++ b/ext/openssl/openssl_backend_common.c @@ -570,12 +570,12 @@ X509 *php_openssl_x509_from_zval( zval *val, bool *free_cert, uint32_t arg_num, bool is_from_array, const char *option_name) { if (php_openssl_is_certificate_ce(val)) { - *free_cert = 0; + *free_cert = false; return php_openssl_certificate_from_obj(Z_OBJ_P(val))->x509; } - *free_cert = 1; + *free_cert = true; zend_string *str = zval_try_get_string(val); if (str == NULL) { @@ -1256,7 +1256,7 @@ EVP_PKEY *php_openssl_pkey_from_zval( cert = php_openssl_x509_from_str(val_str, arg_num, false, NULL); if (cert) { - free_cert = 1; + free_cert = true; } else { /* not a X509 certificate, try to retrieve public key */ php_openssl_errors_restore_mark(); @@ -1685,7 +1685,7 @@ zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv /* BC behavior */ *piv_len = iv_required_len; *piv = iv_new; - *free_iv = 1; + *free_iv = true; return SUCCESS; } @@ -1697,7 +1697,7 @@ zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv memcpy(iv_new, *piv, *piv_len); *piv_len = iv_required_len; *piv = iv_new; - *free_iv = 1; + *free_iv = true; return SUCCESS; } @@ -1707,7 +1707,7 @@ zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv memcpy(iv_new, *piv, iv_required_len); *piv_len = iv_required_len; *piv = iv_new; - *free_iv = 1; + *free_iv = true; return SUCCESS; } @@ -1722,7 +1722,7 @@ zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type, int key_len, password_len; size_t max_iv_len; - *free_password = 0; + *free_password = false; max_iv_len = EVP_CIPHER_iv_length(cipher_type); if (enc && *piv_len == 0 && max_iv_len > 0 && !mode->is_aead) { @@ -1765,7 +1765,7 @@ zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type, memcpy(key, *ppassword, password_len); *ppassword = (char *) key; *ppassword_len = key_len; - *free_password = 1; + *free_password = true; } else { if (password_len > key_len && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) { php_openssl_store_errors(); @@ -1837,7 +1837,7 @@ PHP_OPENSSL_API zend_string* php_openssl_encrypt( EVP_CIPHER_CTX *cipher_ctx; struct php_openssl_cipher_mode mode; int i = 0, outlen; - bool free_iv = 0, free_password = 0; + bool free_iv = false, free_password = false; zend_string *outbuf = NULL; PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN(data_len, data); @@ -1931,7 +1931,7 @@ PHP_OPENSSL_API zend_string* php_openssl_decrypt( struct php_openssl_cipher_mode mode; int i = 0, outlen; zend_string *base64_str = NULL; - bool free_iv = 0, free_password = 0; + bool free_iv = false, free_password = false; zend_string *outbuf = NULL; PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN(data_len, data); diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 6a4f8d7575c1a..d1ece1d5e0eec 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -244,7 +244,7 @@ static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool i switch(err) { case SSL_ERROR_ZERO_RETURN: /* SSL terminated (but socket may still be active) */ - retry = 0; + retry = false; break; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: @@ -261,7 +261,7 @@ static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool i } SSL_set_shutdown(sslsock->ssl_handle, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); stream->eof = 1; - retry = 0; + retry = false; } else { char *estr = php_socket_strerror(php_socket_errno(), NULL, 0); @@ -269,7 +269,7 @@ static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool i "SSL: %s", estr); efree(estr); - retry = 0; + retry = false; } break; } @@ -285,7 +285,7 @@ static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool i "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. " "This could be because the server is missing an SSL certificate " "(local_cert context option)"); - retry = 0; + retry = false; break; default: @@ -310,7 +310,7 @@ static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool i } } - retry = 0; + retry = false; errno = 0; } return retry; @@ -532,7 +532,7 @@ static bool php_openssl_matches_common_name(X509 *peer, const char *subject_name { char buf[1024]; X509_NAME *cert_name; - bool is_match = 0; + bool is_match = false; int cert_name_len; cert_name = X509_get_subject_name(peer); @@ -543,7 +543,7 @@ static bool php_openssl_matches_common_name(X509 *peer, const char *subject_name } else if ((size_t)cert_name_len != strlen(buf)) { php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf); } else if (php_openssl_matches_wildcard_name(subject_name, buf)) { - is_match = 1; + is_match = true; } else { php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", @@ -679,7 +679,7 @@ static int php_openssl_win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, php_stream *stream; php_openssl_netstream_data_t *sslsock; zval *val; - bool is_self_signed = 0; + bool is_self_signed = false; stream = (php_stream*)arg; @@ -740,7 +740,7 @@ static int php_openssl_win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, /* check if the cert is self-signed */ if (cert_chain_ctx->cChain > 0 && cert_chain_ctx->rgpChain[0]->cElement > 0 && (cert_chain_ctx->rgpChain[0]->rgpElement[0]->TrustStatus.dwInfoStatus & CERT_TRUST_IS_SELF_SIGNED) != 0) { - is_self_signed = 1; + is_self_signed = true; } /* check the depth */ @@ -2220,7 +2220,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ php_stream_xport_param *xparam STREAMS_DC) /* {{{ */ { int clisock; - bool nodelay = 0; + bool nodelay = false; zval *tmpzval = NULL; xparam->outputs.client = NULL; @@ -2228,7 +2228,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ if (PHP_STREAM_CONTEXT(stream) && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "tcp_nodelay")) != NULL && zend_is_true(tmpzval)) { - nodelay = 1; + nodelay = true; } clisock = php_network_accept_incoming(sock->s.socket, From a1e1fa3ef835f66dea0ee87f0faec0d48c1eab73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:21 +0200 Subject: [PATCH 024/386] pcre: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pcre/php_pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 8e0fb2cce5f9b..8a0a54dd7016c 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1687,10 +1687,10 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su walk = ZSTR_VAL(replace_str); replace_end = walk + ZSTR_LEN(replace_str); walk_last = 0; - simple_string = 1; + simple_string = true; while (walk < replace_end) { if ('\\' == *walk || '$' == *walk) { - simple_string = 0; + simple_string = false; if (walk_last == '\\') { walk++; walk_last = 0; From 16dc4977641fa2ae333a03428007b3d79f1dd513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:27 +0200 Subject: [PATCH 025/386] pdo: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pdo/pdo_dbh.c | 2 +- ext/pdo/pdo_stmt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 1bdfcd935cfd1..c3cc36790c611 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1190,7 +1190,7 @@ PHP_METHOD(PDO, query) pdo_stmt_t *stmt; zend_string *statement; zend_long fetch_mode; - bool fetch_mode_is_null = 1; + bool fetch_mode_is_null = true; zval *args = NULL; uint32_t num_args = 0; pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 697940d94260d..8b7d618676bca 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -92,7 +92,7 @@ static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_p /* trigger callback hook for parameters */ static bool dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type) /* {{{ */ { - bool ret = 1, is_param = 1; + bool ret = true, is_param = true; struct pdo_bound_param_data *param; HashTable *ht; @@ -110,14 +110,14 @@ static bool dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_ty if (ht) { ZEND_HASH_FOREACH_PTR(ht, param) { if (!stmt->methods->param_hook(stmt, param, event_type)) { - ret = 0; + ret = false; break; } } ZEND_HASH_FOREACH_END(); } if (ret && is_param) { ht = stmt->bound_columns; - is_param = 0; + is_param = false; goto iterate; } From 0c985e1eb9866ac564914262042a7dadcd040cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:33 +0200 Subject: [PATCH 026/386] pdo_dblib: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pdo_dblib/dblib_driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index 132e5c2e4dee1..68e251c2b6a9a 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -145,20 +145,20 @@ static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) static zend_string* dblib_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype) { pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - bool use_national_character_set = 0; + bool use_national_character_set = false; size_t i; char *q; size_t quotedlen = 0, extralen = 0; zend_string *quoted_str; if (H->assume_national_character_set_strings) { - use_national_character_set = 1; + use_national_character_set = true; } if ((paramtype & PDO_PARAM_STR_NATL) == PDO_PARAM_STR_NATL) { - use_national_character_set = 1; + use_national_character_set = true; } if ((paramtype & PDO_PARAM_STR_CHAR) == PDO_PARAM_STR_CHAR) { - use_national_character_set = 0; + use_national_character_set = false; } /* Detect quoted length, adding extra char for doubled single quotes */ From 3da898a7d903175d5993cd81b4d782176df2fddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:40 +0200 Subject: [PATCH 027/386] pdo_firebird: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pdo_firebird/firebird_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index f6d5b1144f382..8eea24a65353f 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -297,7 +297,7 @@ static FbTokenType php_firebird_get_token(const char** begin, const char* end) static int php_firebird_preprocess(const zend_string* sql, char* sql_out, HashTable* named_params) { - bool passAsIs = 1, execBlock = 0; + bool passAsIs = true, execBlock = false; zend_long pindex = -1; char pname[254], ident[253], ident2[253]; unsigned int l; @@ -354,7 +354,7 @@ static int php_firebird_preprocess(const zend_string* sql, char* sql_out, HashTa strncpy(ident2, i2, l); ident2[l] = '\0'; execBlock = !strcasecmp(ident2, "BLOCK"); - passAsIs = 0; + passAsIs = false; } else { @@ -592,7 +592,7 @@ static void firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */ php_firebird_rollback_transaction(dbh); } } - H->in_manually_txn = 0; + H->in_manually_txn = false; /* isc_detach_database returns 0 on success, 1 on failure. */ if (H->db && isc_detach_database(H->isc_status, &H->db)) { @@ -904,7 +904,7 @@ static bool firebird_handle_manually_begin(pdo_dbh_t *dbh) /* {{{ */ if (!php_firebird_begin_transaction(dbh, /* auto commit mode */ false)) { return false; } - H->in_manually_txn = 1; + H->in_manually_txn = true; return true; } /* }}} */ @@ -954,7 +954,7 @@ static bool firebird_handle_manually_commit(pdo_dbh_t *dbh) /* {{{ */ return false; } } - H->in_manually_txn = 0; + H->in_manually_txn = false; return true; } /* }}} */ @@ -990,7 +990,7 @@ static bool firebird_handle_manually_rollback(pdo_dbh_t *dbh) /* {{{ */ return false; } } - H->in_manually_txn = 0; + H->in_manually_txn = false; return true; } /* }}} */ @@ -1353,7 +1353,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* dbh->password = pestrdup(vars[5].optval, dbh->is_persistent); } - H->in_manually_txn = 0; + H->in_manually_txn = false; H->is_writable_txn = pdo_attr_lval(driver_options, PDO_FB_WRITABLE_TRANSACTION, 1); zend_long txn_isolation_level = pdo_attr_lval(driver_options, PDO_FB_TRANSACTION_ISOLATION_LEVEL, PDO_FB_REPEATABLE_READ); if (txn_isolation_level == PDO_FB_READ_COMMITTED || From aa08831b0c80e5edab76057be5596a968cbd2102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:48 +0200 Subject: [PATCH 028/386] pdo_mysql: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pdo_mysql/mysql_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 786bd9c606cd1..808f4acbfa37d 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -308,21 +308,21 @@ static zend_string *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const zend_string * static zend_string* mysql_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype ) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - bool use_national_character_set = 0; - bool use_binary = 0; + bool use_national_character_set = false; + bool use_binary = false; size_t quotedlen; if ((paramtype & PDO_PARAM_LOB) == PDO_PARAM_LOB) { - use_binary = 1; + use_binary = true; } else { if (H->assume_national_character_set_strings) { - use_national_character_set = 1; + use_national_character_set = true; } if ((paramtype & PDO_PARAM_STR_NATL) == PDO_PARAM_STR_NATL) { - use_national_character_set = 1; + use_national_character_set = true; } if ((paramtype & PDO_PARAM_STR_CHAR) == PDO_PARAM_STR_CHAR) { - use_national_character_set = 0; + use_national_character_set = false; } } From b965ea3a0552502a3c0f802a77c1a7867628891e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:51:53 +0200 Subject: [PATCH 029/386] pdo_pgsql: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/pdo_pgsql/pgsql_statement.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index f9320fd86ea83..426a878d8eff7 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -219,7 +219,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt) PQclear(S->result); /* the cursor was declared correctly */ - S->is_prepared = 1; + S->is_prepared = true; /* fetch to be able to get the number of tuples later, but don't advance the cursor pointer */ spprintf(&q, 0, "FETCH FORWARD 0 FROM %s", S->cursor_name); @@ -240,7 +240,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt) case PGRES_COMMAND_OK: case PGRES_TUPLES_OK: /* it worked */ - S->is_prepared = 1; + S->is_prepared = true; PQclear(S->result); S->result = NULL; break; From 11d10607bc03a388c4e31b3cb4ff2d1ef2153a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:07 +0200 Subject: [PATCH 030/386] phar: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/phar/func_interceptors.c | 8 ++++---- ext/phar/phar_object.c | 18 +++++++++--------- ext/phar/tar.c | 8 ++++---- ext/phar/zip.c | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index f1b2b0eba1e63..976ce0b5e955c 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -159,10 +159,10 @@ PHP_FUNCTION(phar_file_get_contents) /* {{{ */ { zend_string *filename; zend_string *contents; - bool use_include_path = 0; + bool use_include_path = false; zend_long offset = -1; zend_long maxlen; - bool maxlen_is_null = 1; + bool maxlen_is_null = true; zval *zcontext = NULL; if (!PHAR_G(intercepted)) { @@ -235,7 +235,7 @@ PHP_FUNCTION(phar_file_get_contents) /* {{{ */ PHP_FUNCTION(phar_readfile) /* {{{ */ { zend_string *filename; - bool use_include_path = 0; + bool use_include_path = false; zval *zcontext = NULL; if (!PHAR_G(intercepted)) { @@ -281,7 +281,7 @@ PHP_FUNCTION(phar_fopen) /* {{{ */ zend_string *filename; char *mode; size_t mode_len; - bool use_include_path = 0; + bool use_include_path = false; zval *zcontext = NULL; if (!PHAR_G(intercepted)) { diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index e584338b23e74..c30145d9fb940 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -403,7 +403,7 @@ PHP_METHOD(Phar, running) zend_string *fname; char *arch, *entry; size_t arch_len, entry_len; - bool retphar = 1; + bool retphar = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) { RETURN_THROWS(); @@ -1060,7 +1060,7 @@ PHP_METHOD(Phar, isValidPharFilename) size_t fname_len; size_t ext_len; int is_executable; - bool executable = 1; + bool executable = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &fname, &fname_len, &executable) == FAILURE) { RETURN_THROWS(); @@ -1393,7 +1393,7 @@ struct _phar_t { static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ { zval *value; - bool close_fp = 1; + bool close_fp = true; struct _phar_t *p_obj = (struct _phar_t*) puser; size_t str_key_len, base_len = ZSTR_LEN(p_obj->base); phar_entry_data *data; @@ -1455,7 +1455,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ return ZEND_HASH_APPLY_STOP; } - close_fp = 0; + close_fp = false; opened = ZSTR_INIT_LITERAL("[stream]", 0); goto after_open_fp; case IS_OBJECT: @@ -1714,7 +1714,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ PHP_METHOD(Phar, buildFromDirectory) { char *error; - bool apply_reg = 0; + bool apply_reg = false; zval arg, arg2, iter, iteriter, regexiter; struct _phar_t pass; zend_string *dir, *regex = NULL; @@ -1767,7 +1767,7 @@ PHP_METHOD(Phar, buildFromDirectory) zval_ptr_dtor(&iter); if (regex && ZSTR_LEN(regex) > 0) { - apply_reg = 1; + apply_reg = true; if (SUCCESS != object_init_ex(®exiter, spl_ce_RegexIterator)) { zval_ptr_dtor(&iteriter); @@ -2360,7 +2360,7 @@ PHP_METHOD(Phar, convertToExecutable) uint32_t flags; zend_object *ret; zend_long format, method; - bool format_is_null = 1, method_is_null = 1; + bool format_is_null = true, method_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l!s!", &format, &format_is_null, &method, &method_is_null, &ext, &ext_len) == FAILURE) { RETURN_THROWS(); @@ -2471,7 +2471,7 @@ PHP_METHOD(Phar, convertToData) uint32_t flags; zend_object *ret; zend_long format, method; - bool format_is_null = 1, method_is_null = 1; + bool format_is_null = true, method_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l!s!", &format, &format_is_null, &method, &method_is_null, &ext, &ext_len) == FAILURE) { RETURN_THROWS(); @@ -4574,7 +4574,7 @@ PHP_METHOD(PharFileInfo, getCompressedSize) PHP_METHOD(PharFileInfo, isCompressed) { zend_long method; - bool method_is_null = 1; + bool method_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &method, &method_is_null) == FAILURE) { RETURN_THROWS(); diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 0f90104014c04..d8c412b5a9b1d 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -845,10 +845,10 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* /* open file pointers refer to this fp, do not free the stream */ switch (entry->fp_type) { case PHAR_FP: - fp->free_fp = 0; + fp->free_fp = false; break; case PHAR_UFP: - fp->free_ufp = 0; + fp->free_ufp = false; default: break; } @@ -1118,8 +1118,8 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def pass.old = oldfile; pass.new = newfile; pass.error = error; - pass.free_fp = 1; - pass.free_ufp = 1; + pass.free_fp = true; + pass.free_ufp = true; if (phar_metadata_tracker_has_data(&phar->metadata_tracker, phar->is_persistent)) { phar_entry_info *mentry; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 0ee958bda24fb..a836d52d25daf 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1145,10 +1145,10 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ /* open file pointers refer to this fp, do not free the stream */ switch (entry->fp_type) { case PHAR_FP: - p->free_fp = 0; + p->free_fp = false; break; case PHAR_UFP: - p->free_ufp = 0; + p->free_ufp = false; default: break; } @@ -1422,7 +1422,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def goto fperror; } - pass.free_fp = pass.free_ufp = 1; + pass.free_fp = pass.free_ufp = true; memset(&eocd, 0, sizeof(eocd)); memcpy(eocd.signature, "PK\5\6", 4); From cdb8321e210aed43dc30b993ea95f45d1d51a81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:12 +0200 Subject: [PATCH 031/386] reflection: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/reflection/php_reflection.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 3d025c7eefd7c..17bb280a87b1e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4552,7 +4552,7 @@ ZEND_METHOD(ReflectionClass, getMethods) zend_class_entry *ce; zend_function *mptr; zend_long filter; - bool filter_is_null = 1; + bool filter_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); @@ -4730,7 +4730,7 @@ ZEND_METHOD(ReflectionClass, getProperties) zend_string *key; zend_property_info *prop_info; zend_long filter; - bool filter_is_null = 1; + bool filter_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); @@ -4786,7 +4786,7 @@ ZEND_METHOD(ReflectionClass, getConstants) zend_class_constant *constant; zval val; zend_long filter; - bool filter_is_null = 1; + bool filter_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); @@ -4820,7 +4820,7 @@ ZEND_METHOD(ReflectionClass, getReflectionConstants) zend_string *name; zend_class_constant *constant; zend_long filter; - bool filter_is_null = 1; + bool filter_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); From c84dbef9d951d2ec255e1f741f29d486834f6c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:21 +0200 Subject: [PATCH 032/386] session: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/session/session.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index 489f82d6f142f..b0b8dfad8ca6b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1635,16 +1635,16 @@ PHPAPI zend_result php_session_reset_id(void) } /* Apply trans sid if sid cookie is not set */ - apply_trans_sid = 0; + apply_trans_sid = false; if (APPLY_TRANS_SID) { - apply_trans_sid = 1; + apply_trans_sid = true; if (PS(use_cookies) && (data = zend_hash_str_find(&EG(symbol_table), ZEND_STRL("_COOKIE")))) { ZVAL_DEREF(data); if (Z_TYPE_P(data) == IS_ARRAY && (potential_session_id = zend_hash_find(Z_ARRVAL_P(data), PS(session_name)))) { ZVAL_DEREF(potential_session_id); - apply_trans_sid = 0; + apply_trans_sid = false; } } } @@ -2113,7 +2113,7 @@ PHP_FUNCTION(session_set_save_handler) /* OOP Version */ if (ZEND_NUM_ARGS() <= 2) { zval *obj = NULL; - bool register_shutdown = 1; + bool register_shutdown = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, php_session_iface_entry, ®ister_shutdown) == FAILURE) { RETURN_THROWS(); @@ -2336,7 +2336,7 @@ PHP_FUNCTION(session_id) /* Update the current session id with a newly generated one. If delete_old_session is set to true, remove the old session. */ PHP_FUNCTION(session_regenerate_id) { - bool del_ses = 0; + bool del_ses = false; zend_string *data; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &del_ses) == FAILURE) { @@ -2535,7 +2535,7 @@ PHP_FUNCTION(session_cache_limiter) PHP_FUNCTION(session_cache_expire) { zend_long expires; - bool expires_is_null = 1; + bool expires_is_null = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &expires, &expires_is_null) == FAILURE) { RETURN_THROWS(); @@ -3088,7 +3088,7 @@ static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *pro if (PS(use_cookies)) { sapi_module.treat_data(PARSE_COOKIE, NULL, NULL); if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress)) { - progress->apply_trans_sid = 0; + progress->apply_trans_sid = false; return; } } From 0583c66e2f3fefa022892e4d072616c21462f1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:27 +0200 Subject: [PATCH 033/386] simplexml: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/simplexml/simplexml.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 7abaee78666e7..78653cf7ef624 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1489,7 +1489,7 @@ static inline void sxe_object_free_iterxpath(php_sxe_object *sxe) /* {{{ Return all namespaces in use */ PHP_METHOD(SimpleXMLElement, getNamespaces) { - bool recursive = 0; + bool recursive = false; php_sxe_object *sxe; xmlNodePtr node; @@ -1551,7 +1551,7 @@ static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, /* {{{ Return all namespaces registered with document */ PHP_METHOD(SimpleXMLElement, getDocNamespaces) { - bool recursive = 0, from_root = 1; + bool recursive = false, from_root = true; php_sxe_object *sxe; xmlNodePtr node; @@ -1589,7 +1589,7 @@ PHP_METHOD(SimpleXMLElement, children) php_sxe_object *sxe; zend_string *nsprefix = NULL; xmlNodePtr node; - bool isprefix = 0; + bool isprefix = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S!b", &nsprefix, &isprefix) == FAILURE) { RETURN_THROWS(); @@ -1641,7 +1641,7 @@ PHP_METHOD(SimpleXMLElement, attributes) php_sxe_object *sxe; zend_string *nsprefix = NULL; xmlNodePtr node; - bool isprefix = 0; + bool isprefix = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S!b", &nsprefix, &isprefix) == FAILURE) { RETURN_THROWS(); @@ -2208,7 +2208,7 @@ PHP_FUNCTION(simplexml_load_file) zend_long options = 0; zend_class_entry *ce= ce_SimpleXMLElement; zend_function *fptr_count; - bool isprefix = 0; + bool isprefix = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|C!lSb", &filename, &filename_len, &ce, &options, &ns, &isprefix) == FAILURE) { RETURN_THROWS(); @@ -2254,7 +2254,7 @@ PHP_FUNCTION(simplexml_load_string) zend_long options = 0; zend_class_entry *ce= ce_SimpleXMLElement; zend_function *fptr_count; - bool isprefix = 0; + bool isprefix = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|C!lSb", &data, &data_len, &ce, &options, &ns, &isprefix) == FAILURE) { RETURN_THROWS(); @@ -2306,7 +2306,7 @@ PHP_METHOD(SimpleXMLElement, __construct) size_t data_len; xmlDocPtr docp; zend_long options = 0; - bool is_url = 0, isprefix = 0; + bool is_url = false, isprefix = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lbSb", &data, &data_len, &options, &is_url, &ns, &isprefix) == FAILURE) { RETURN_THROWS(); From 59f2228667eaaaab2e6d1123d5120a356c05aea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:35 +0200 Subject: [PATCH 034/386] soap: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/soap/php_http.c | 10 +++++----- ext/soap/php_sdl.c | 8 ++++---- ext/soap/soap.c | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index ac5f0f0f9d1ed..1d2b3e8c827be 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -363,9 +363,9 @@ int make_http_soap_request( char *http_msg = NULL; bool old_allow_url_fopen; php_stream_context *context = NULL; - bool has_authorization = 0; - bool has_proxy_authorization = 0; - bool has_cookies = 0; + bool has_authorization = false; + bool has_proxy_authorization = false; + bool has_cookies = false; if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) { return FALSE; @@ -680,7 +680,7 @@ int make_http_soap_request( if (Z_TYPE_P(login) == IS_STRING) { zval *digest = Z_CLIENT_DIGEST_P(this_ptr); - has_authorization = 1; + has_authorization = true; if (Z_TYPE_P(digest) == IS_ARRAY) { char HA1[33], HA2[33], response[33], cnonce[33], nc[9]; unsigned char nonce[16]; @@ -858,7 +858,7 @@ int make_http_soap_request( if (zend_hash_num_elements(Z_ARRVAL_P(cookies)) != 0 && !HT_IS_PACKED(Z_ARRVAL_P(cookies))) { zval *data; zend_string *key; - has_cookies = 1; + has_cookies = true; bool first_cookie = true; smart_str_append_const(&soap_headers, "Cookie: "); ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(cookies), key, data) { diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index cc01b598bd9c3..e6871cd6e9b31 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -3157,8 +3157,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl) smart_str headers = {0}; char* key = NULL; time_t t = time(0); - bool has_proxy_authorization = 0; - bool has_authorization = 0; + bool has_proxy_authorization = false; + bool has_authorization = false; ZVAL_UNDEF(&orig_context); ZVAL_UNDEF(&new_context); @@ -3312,7 +3312,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl) sdl = load_wsdl(this_ptr, uri); if (sdl) { - sdl->is_persistent = 0; + sdl->is_persistent = false; } SOAP_GLOBAL(error_code) = old_error_code; @@ -3359,7 +3359,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl) } psdl = make_persistent_sdl(sdl); - psdl->is_persistent = 1; + psdl->is_persistent = true; p.time = t; p.sdl = psdl; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 167dd4bb30af8..1e50c14d81663 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -765,7 +765,7 @@ PHP_METHOD(SoapVar, __construct) { zval *data, *this_ptr; zend_long type; - bool type_is_null = 1; + bool type_is_null = true; zend_string *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!l!|S!S!S!S!", &data, &type, &type_is_null, &stype, &ns, &name, &namens) == FAILURE) { @@ -1969,7 +1969,7 @@ static void soap_error_handler(int error_num, zend_string *error_filename, const /* {{{ */ PHP_FUNCTION(use_soap_error_handler) { - bool handler = 1; + bool handler = true; ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler)); if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &handler) == SUCCESS) { @@ -2551,7 +2551,7 @@ static void soap_client_call_common( if (soap_headers) { if (!free_soap_headers) { soap_headers = zend_array_dup(soap_headers); - free_soap_headers = 1; + free_soap_headers = true; } ZEND_HASH_FOREACH_VAL(default_headers, tmp) { if(Z_TYPE_P(tmp) == IS_OBJECT) { @@ -2561,7 +2561,7 @@ static void soap_client_call_common( } ZEND_HASH_FOREACH_END(); } else { soap_headers = Z_ARRVAL_P(tmp); - free_soap_headers = 0; + free_soap_headers = false; } } @@ -2794,7 +2794,7 @@ PHP_METHOD(SoapClient, __doRequest) char *action; size_t action_size; zend_long version; - bool one_way = 0; + bool one_way = false; zval *this_ptr = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSsl|bS!", @@ -2805,7 +2805,7 @@ PHP_METHOD(SoapClient, __doRequest) RETURN_THROWS(); } if (SOAP_GLOBAL(features) & SOAP_WAIT_ONE_WAY_CALLS) { - one_way = 0; + one_way = false; } if (one_way) { if (make_http_soap_request(this_ptr, buf, location, action, version, uri_parser_class, NULL)) { From 15baf35cf075bdb2ea52dbdfa1cf0561b2b9626b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:40 +0200 Subject: [PATCH 035/386] spl: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/spl/php_spl.c | 6 +++--- ext/spl/spl_array.c | 4 ++-- ext/spl/spl_directory.c | 4 ++-- ext/spl/spl_dllist.c | 2 +- ext/spl/spl_fixedarray.c | 2 +- ext/spl/spl_iterators.c | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index f796b936daeec..6de7a6d6635af 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -66,7 +66,7 @@ PHP_FUNCTION(class_parents) { zval *obj; zend_class_entry *parent_class, *ce; - bool autoload = 1; + bool autoload = true; /* We do not use Z_PARAM_OBJ_OR_STR here to be able to exclude int, float, and bool which are bogus class names */ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) { @@ -99,7 +99,7 @@ PHP_FUNCTION(class_parents) PHP_FUNCTION(class_implements) { zval *obj; - bool autoload = 1; + bool autoload = true; zend_class_entry *ce; /* We do not use Z_PARAM_OBJ_OR_STR here to be able to exclude int, float, and bool which are bogus class names */ @@ -128,7 +128,7 @@ PHP_FUNCTION(class_implements) PHP_FUNCTION(class_uses) { zval *obj; - bool autoload = 1; + bool autoload = true; zend_class_entry *ce; /* We do not use Z_PARAM_OBJ_OR_STR here to be able to exclude int, float, and bool which are bogus class names */ diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index ea21b422229b3..163b937f19433 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -777,11 +777,11 @@ static HashTable *spl_array_get_properties_for(zend_object *object, zend_prop_pu * meantime. */ switch (purpose) { case ZEND_PROP_PURPOSE_ARRAY_CAST: - dup = 1; + dup = true; break; case ZEND_PROP_PURPOSE_VAR_EXPORT: case ZEND_PROP_PURPOSE_JSON: - dup = 0; + dup = false; break; default: return zend_std_get_properties_for(object, purpose); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 049d850d12fc7..a769d627a54cd 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -493,7 +493,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(zend_string *fil static spl_filesystem_object *spl_filesystem_object_create_type(int num_args, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value) /* {{{ */ { spl_filesystem_object *intern; - bool use_include_path = 0; + bool use_include_path = false; zval arg1, arg2; zend_error_handling error_handling; @@ -2014,7 +2014,7 @@ PHP_METHOD(SplFileObject, __construct) zend_string *file_name = NULL; zend_string *open_mode = ZSTR_CHAR('r'); zval *stream_context = NULL; - bool use_include_path = 0; + bool use_include_path = false; size_t path_len; zend_error_handling error_handling; diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 0f525e627d305..9401af3ae00de 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -702,7 +702,7 @@ PHP_METHOD(SplDoublyLinkedList, offsetGet) PHP_METHOD(SplDoublyLinkedList, offsetSet) { zend_long index; - bool index_is_null = 1; + bool index_is_null = true; zval *value; spl_dllist_object *intern; diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index dc32045ba0ff9..3d11d88f4f567 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -706,7 +706,7 @@ PHP_METHOD(SplFixedArray, fromArray) spl_fixedarray array; spl_fixedarray_object *intern; int num; - bool save_indexes = 1; + bool save_indexes = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &data, &save_indexes) == FAILURE) { RETURN_THROWS(); diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 1ae4dae1eaa35..a73e69519db51 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -222,7 +222,7 @@ static zend_result spl_recursive_it_valid_ex(spl_recursive_it_object *object, zv if (object->endIteration && object->in_iteration) { zend_call_method_with_0_params(Z_OBJ_P(zthis), object->ce, &object->endIteration, "endIteration", NULL); } - object->in_iteration = 0; + object->in_iteration = false; return FAILURE; } @@ -460,7 +460,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt if (!EG(exception) && object->beginIteration && !object->in_iteration) { zend_call_method_with_0_params(Z_OBJ_P(zthis), object->ce, &object->beginIteration, "beginIteration", NULL); } - object->in_iteration = 1; + object->in_iteration = true; spl_recursive_it_move_forward_ex(object, zthis); } @@ -614,7 +614,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla intern->mode = mode; intern->flags = (int)flags; intern->max_depth = -1; - intern->in_iteration = 0; + intern->in_iteration = false; intern->ce = Z_OBJCE_P(object); intern->beginIteration = zend_hash_str_find_ptr(&intern->ce->function_table, "beginiteration", sizeof("beginiteration") - 1); @@ -740,7 +740,7 @@ PHP_METHOD(RecursiveIteratorIterator, getSubIterator) { spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS); zend_long level; - bool level_is_null = 1; + bool level_is_null = true; zval *value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &level, &level_is_null) == FAILURE) { From 56c98cb077d6e4a7a33d03f357fb3417f3175e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:47 +0200 Subject: [PATCH 036/386] sqlite3: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/sqlite3/sqlite3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 21b6840a8d1b2..720aef5638caf 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -318,7 +318,7 @@ PHP_METHOD(SQLite3, enableExtendedResultCodes) { php_sqlite3_db_object *db_obj; zval *object = ZEND_THIS; - bool enable = 1; + bool enable = true; db_obj = Z_SQLITE3_DB_P(object); int ret; @@ -666,7 +666,7 @@ PHP_METHOD(SQLite3, querySingle) zend_string *sql; char *errtext = NULL; int return_code; - bool entire_row = 0; + bool entire_row = false; sqlite3_stmt *stmt; db_obj = Z_SQLITE3_DB_P(object); @@ -1285,7 +1285,7 @@ PHP_METHOD(SQLite3, enableExceptions) { php_sqlite3_db_object *db_obj; zval *object = ZEND_THIS; - bool enableExceptions = 0; + bool enableExceptions = false; db_obj = Z_SQLITE3_DB_P(object); From 220d7a84b518f3d8b7e3b40a5aee5bcadb9dcc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:52 +0200 Subject: [PATCH 037/386] standard: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/standard/array.c | 16 ++++++++-------- ext/standard/crypt_sha256.c | 4 ++-- ext/standard/crypt_sha512.c | 4 ++-- ext/standard/dns_win32.c | 2 +- ext/standard/formatted_print.c | 4 ++-- ext/standard/ftp_fopen_wrapper.c | 2 +- ext/standard/http.c | 4 ++-- ext/standard/http_fopen_wrapper.c | 8 ++++---- ext/standard/proc_open.c | 2 +- ext/standard/string.c | 10 +++++----- ext/standard/url.c | 6 +++--- ext/standard/var.c | 2 +- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index be9702c5ef650..68c247e026f96 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -5141,13 +5141,13 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa val = Z_REFVAL_P(val); } if (key == NULL) { - ok = 1; + ok = true; for (i = 1; i < argc; i++) { if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), h)) == NULL || (intersect_data_compare_func && intersect_data_compare_func(val, data) != 0) ) { - ok = 0; + ok = false; break; } } @@ -5156,13 +5156,13 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa zend_hash_index_add_new(Z_ARRVAL_P(return_value), h, val); } } else { - ok = 1; + ok = true; for (i = 1; i < argc; i++) { if ((data = zend_hash_find_known_hash(Z_ARRVAL(args[i]), key)) == NULL || (intersect_data_compare_func && intersect_data_compare_func(val, data) != 0) ) { - ok = 0; + ok = false; break; } } @@ -5537,13 +5537,13 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty val = Z_REFVAL_P(val); } if (key == NULL) { - ok = 1; + ok = true; for (i = 1; i < argc; i++) { if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), h)) != NULL && (!diff_data_compare_func || diff_data_compare_func(val, data) == 0) ) { - ok = 0; + ok = false; break; } } @@ -5552,13 +5552,13 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty zend_hash_index_add_new(Z_ARRVAL_P(return_value), h, val); } } else { - ok = 1; + ok = true; for (i = 1; i < argc; i++) { if ((data = zend_hash_find_known_hash(Z_ARRVAL(args[i]), key)) != NULL && (!diff_data_compare_func || diff_data_compare_func(val, data) == 0) ) { - ok = 0; + ok = false; break; } } diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index 5bc3e93fe15fb..2673dcf2b08e8 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -338,7 +338,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b char *s_bytes; /* Default number of rounds. */ size_t rounds = ROUNDS_DEFAULT; - bool rounds_custom = 0; + bool rounds_custom = false; /* Find beginning of salt string. The prefix should normally always be present. Just in case it is not. */ @@ -358,7 +358,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b } rounds = srounds; - rounds_custom = 1; + rounds_custom = true; } } diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index e6410fb916228..e8cedaa55c205 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -375,7 +375,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) char *s_bytes; /* Default number of rounds. */ size_t rounds = ROUNDS_DEFAULT; - bool rounds_custom = 0; + bool rounds_custom = false; /* Find beginning of salt string. The prefix should normally always be present. Just in case it is not. */ @@ -396,7 +396,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) } rounds = srounds; - rounds_custom = 1; + rounds_custom = true; } } diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 26c6487902e1a..b320b66b6a788 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -341,7 +341,7 @@ PHP_FUNCTION(dns_get_record) zend_long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; int type, type_to_fetch, first_query = 1, store_results = 1; - bool raw = 0; + bool raw = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b2c287c02900c..c0246653dfe3f 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -298,9 +298,9 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos, char exp_char = fmt == 'G' || fmt == 'H' ? 'E' : 'e'; /* We use &num_buf[ 1 ], so that we have room for the sign. */ s = zend_gcvt(number, precision, decimal_point, exp_char, &num_buf[1]); - is_negative = 0; + is_negative = false; if (*s == '-') { - is_negative = 1; + is_negative = true; s = &num_buf[1]; } else if (always_sign) { num_buf[0] = '+'; diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index b36d232de9534..d1bb3aeeccd68 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -421,7 +421,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa php_stream *reuseid=NULL; size_t file_size = 0; zval *tmpzval; - bool allow_overwrite = 0; + bool allow_overwrite = false; int8_t read_write = 0; char *transport; int transport_len; diff --git a/ext/standard/http.c b/ext/standard/http.c index ae6f668e0cb8f..9e070ee74f407 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -109,14 +109,14 @@ PHPAPI void php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } ZEND_HASH_FOREACH_KEY_VAL(ht, idx, key, zdata) { - bool is_dynamic = 1; + bool is_dynamic = true; if (Z_TYPE_P(zdata) == IS_INDIRECT) { zdata = Z_INDIRECT_P(zdata); if (Z_ISUNDEF_P(zdata)) { continue; } - is_dynamic = 0; + is_dynamic = false; } /* handling for private & protected object properties */ diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index e342c77666662..ee8fe0b0d1a83 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -159,7 +159,7 @@ static void php_stream_http_response_header_info_init( php_stream_http_response_header_info *header_info) { memset(header_info, 0, sizeof(php_stream_http_response_header_info)); - header_info->follow_location = 1; + header_info->follow_location = true; } /* Trim white spaces from response header line and update its length */ @@ -283,7 +283,7 @@ static zend_string *php_stream_http_response_headers_parse(php_stream_wrapper *w * response_code not in (300, 301, 302, 303 and 307) * see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1 * RFC 7238 defines 308: http://tools.ietf.org/html/rfc7238 */ - header_info->follow_location = 0; + header_info->follow_location = false; } size_t last_header_value_len = strlen(last_header_value); if (last_header_value_len > HTTP_HEADER_MAX_LOCATION_SIZE) { @@ -603,7 +603,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, redirect_max = (int)zval_get_long(tmpzval); } - custom_request_method = 0; + custom_request_method = false; if (context && (tmpzval = php_stream_context_get_option(context, "http", "method")) != NULL) { if (Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval) > 0) { /* As per the RFC, automatically redirected requests MUST NOT use other methods than @@ -612,7 +612,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, || zend_string_equals_literal(Z_STR_P(tmpzval), "GET") || zend_string_equals_literal(Z_STR_P(tmpzval), "HEAD") ) { - custom_request_method = 1; + custom_request_method = true; smart_str_append(&req_buf, Z_STR_P(tmpzval)); smart_str_appendc(&req_buf, ' '); } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 690e23e0d3538..4dee37ba3cecc 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -643,7 +643,7 @@ static zend_string *create_win_command_from_args(HashTable *args) append_win_escaped_arg(&str, arg_str, !is_prog_name && is_cmd_execution); - is_prog_name = 0; + is_prog_name = false; zend_string_release(arg_str); } ZEND_HASH_FOREACH_END(); smart_str_0(&str); diff --git a/ext/standard/string.c b/ext/standard/string.c index 8b76a179061cc..0d9d4149db0e0 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5036,7 +5036,7 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { char c, *n; const char *t; int state = 0; - bool done = 0; + bool done = false; char *norm; if (len == 0) { @@ -5059,7 +5059,7 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { *(n++) = c; break; case '>': - done =1; + done = true; break; default: if (!isspace((int)c)) { @@ -5071,7 +5071,7 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { } } else { if (state == 1) - done=1; + done = true; } break; } @@ -5080,9 +5080,9 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { *(n++) = '>'; *n = '\0'; if (strstr(set, norm)) { - done=1; + done = true; } else { - done=0; + done = false; } efree(norm); return done; diff --git a/ext/standard/url.c b/ext/standard/url.c index 504805484ef2c..4ddf7f80c64f9 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -93,7 +93,7 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port php_url *ret = ecalloc(1, sizeof(php_url)); char const *s, *e, *p, *pp, *ue; - *has_port = 0; + *has_port = false; s = str; ue = s + length; @@ -183,7 +183,7 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port port_buf[pp - p] = '\0'; port = ZEND_STRTOL(port_buf, &end, 10); if (port >= 0 && port <= 65535 && end != port_buf) { - *has_port = 1; + *has_port = true; ret->port = (unsigned short) port; if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; @@ -249,7 +249,7 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port port_buf[e - p] = '\0'; port = ZEND_STRTOL(port_buf, &end, 10); if (port >= 0 && port <= 65535 && end != port_buf) { - *has_port = 1; + *has_port = true; ret->port = (unsigned short)port; } else { php_url_free(ret); diff --git a/ext/standard/var.c b/ext/standard/var.c index cff865055e7df..9cf59999fd961 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -984,7 +984,7 @@ static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable ZEND_HASH_FOREACH_KEY_VAL_IND(ht, index, key, data) { if (incomplete_class && zend_string_equals_literal(key, MAGIC_MEMBER)) { - incomplete_class = 0; + incomplete_class = false; continue; } From c2edd36402a6b5469c051f4d0645286ab872ba80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:52:59 +0200 Subject: [PATCH 038/386] sysvmsg: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/sysvmsg/sysvmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index 456a6f51735e0..65d29d12c0f9e 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -256,7 +256,7 @@ PHP_FUNCTION(msg_receive) zval *out_message, *queue, *out_msgtype, *zerrcode = NULL; zend_long desiredmsgtype, maxsize, flags = 0; zend_long realflags = 0; - bool do_unserialize = 1; + bool do_unserialize = true; sysvmsg_queue_t *mq = NULL; struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */ int result; @@ -337,7 +337,7 @@ PHP_FUNCTION(msg_send) { zval *message, *queue, *zerror=NULL; zend_long msgtype; - bool do_serialize = 1, blocking = 1; + bool do_serialize = true, blocking = true; sysvmsg_queue_t * mq = NULL; struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */ int result; From e58d6e0f5b05ff614d4b3b3cfb39fe04beb02a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:08 +0200 Subject: [PATCH 039/386] sysvsem: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/sysvsem/sysvsem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index 99ebda92273ef..ce624ab4b2372 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -172,7 +172,7 @@ PHP_MINFO_FUNCTION(sysvsem) PHP_FUNCTION(sem_get) { zend_long key, max_acquire = 1, perm = 0666; - bool auto_release = 1; + bool auto_release = true; int semid; struct sembuf sop[3]; int count; @@ -269,7 +269,7 @@ PHP_FUNCTION(sem_get) static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, bool acquire) { zval *arg_id; - bool nowait = 0; + bool nowait = false; sysvsem_sem *sem_ptr; struct sembuf sop; From 05fcdf20ccc584490a913419e0a2628217991f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:17 +0200 Subject: [PATCH 040/386] sysvshm: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/sysvshm/sysvshm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index c1372368a34b8..55ee6493bfb0a 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -131,7 +131,7 @@ PHP_FUNCTION(shm_attach) char *shm_ptr; sysvshm_chunk_head *chunk_ptr; zend_long shm_key, shm_id, shm_size, shm_flag = 0666; - bool shm_size_is_null = 1; + bool shm_size_is_null = true; if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|l!l", &shm_key, &shm_size, &shm_size_is_null, &shm_flag)) { RETURN_THROWS(); From e455fc9c921e049823f12340bec06b39900f7d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:25 +0200 Subject: [PATCH 041/386] xml: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/xml/xml.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index bf9f747599730..813718bb8a229 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -282,9 +282,9 @@ static int xml_parse_helper(xml_parser *parser, const char *data, size_t data_le ZEND_DIAGNOSTIC_IGNORED_END #endif - parser->isparsing = 1; + parser->isparsing = true; int ret = XML_Parse(parser->parser, (const XML_Char *) data, data_len, is_final); - parser->isparsing = 0; + parser->isparsing = false; return ret; } @@ -682,7 +682,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha /* Because toffset may change, we should use the original tag name */ parser->ltags[parser->level - 1] = zend_string_copy(tag_name); - parser->lastwasopen = 1; + parser->lastwasopen = true; attributes = (const XML_Char **) attrs; @@ -775,7 +775,7 @@ void xml_endElementHandler(void *userData, const XML_Char *name) } } - parser->lastwasopen = 0; + parser->lastwasopen = false; } zend_string_release_ex(tag_name, 0); @@ -815,7 +815,7 @@ void xml_characterDataHandler(void *userData, const XML_Char *s, int len) return; } - bool doprint = 0; + bool doprint = false; zend_string *decoded_value; decoded_value = xml_utf8_decode(s, len, parser->target_encoding); if (parser->skipwhite) { @@ -826,7 +826,7 @@ void xml_characterDataHandler(void *userData, const XML_Char *s, int len) case '\n': continue; default: - doprint = 1; + doprint = true; break; } if (doprint) { @@ -1128,8 +1128,8 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp &php_xml_mem_hdlrs, (XML_Char*)ns_param); parser->target_encoding = encoding; - parser->case_folding = 1; - parser->isparsing = 0; + parser->case_folding = true; + parser->isparsing = false; parser->parsehuge = false; /* It's the default for BC & DoS protection */ XML_SetUserData(parser->parser, parser); @@ -1410,7 +1410,7 @@ PHP_FUNCTION(xml_parse) zval *pind; char *data; size_t data_len; - bool isFinal = 0; + bool isFinal = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|b", &pind, xml_parser_ce, &data, &data_len, &isFinal) == FAILURE) { RETURN_THROWS(); From 87ab46e1c9dda0ea95acc1979c8c89b2836a7874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:31 +0200 Subject: [PATCH 042/386] xmlwriter: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/xmlwriter/php_xmlwriter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index f9dd7f48c86fb..6d711e89b89d4 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -765,7 +765,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_entity) int retval; /* Optional parameters */ char *pubid = NULL, *sysid = NULL, *ndataid = NULL; - bool pe = 0; + bool pe = false; size_t pubid_len, sysid_len, ndataid_len; zval *self; @@ -1006,7 +1006,7 @@ PHP_METHOD(XMLWriter, toStream) /* {{{ php_xmlwriter_flush */ static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string) { xmlTextWriterPtr ptr; - bool empty = 1; + bool empty = true; int output_bytes; zval *self; From eddb0f5e8a65593ed1c4cb7519f54369135df05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:37 +0200 Subject: [PATCH 043/386] zip: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/zip/php_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 4fcb66f8faf31..536357f4b8ec8 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -3085,7 +3085,7 @@ PHP_METHOD(ZipArchive, registerCancelCallback) PHP_METHOD(ZipArchive, isCompressionMethodSupported) { zend_long method; - bool enc = 1; + bool enc = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) { return; @@ -3098,7 +3098,7 @@ PHP_METHOD(ZipArchive, isCompressionMethodSupported) PHP_METHOD(ZipArchive, isEncryptionMethodSupported) { zend_long method; - bool enc = 1; + bool enc = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) { return; From 4934355b6d5b27271f372999fdbb67e66cc3b380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:53:43 +0200 Subject: [PATCH 044/386] zlib: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/zlib/zlib.c | 8 ++++---- ext/zlib/zlib_filter.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index e73e168708ad7..b0f21c45699ec 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -805,7 +805,7 @@ static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_ case IS_ARRAY: { HashTable *dictionary = Z_ARR_P(option_buffer); - bool result = 1; + bool result = true; if (zend_hash_num_elements(dictionary) > 0) { zend_string **strings = safe_emalloc(zend_hash_num_elements(dictionary), sizeof(zend_string *), 0); @@ -815,18 +815,18 @@ static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_ ZEND_HASH_FOREACH_VAL(dictionary, cur) { zend_string *string = zval_try_get_string(cur); if (string == NULL) { - result = 0; + result = false; break; } *dictlen += ZSTR_LEN(string) + 1; strings[total++] = string; if (ZSTR_LEN(string) == 0) { - result = 0; + result = false; zend_argument_value_error(2, "must not contain empty strings"); break; } if (zend_str_has_nul_byte(string)) { - result = 0; + result = false; zend_argument_value_error(2, "must not contain strings with null bytes"); break; } diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 24d418ae04cfa..6da5ff2a5959f 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -238,7 +238,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter( status = Z_OK; while (status == Z_OK) { status = deflate(&(data->strm), (flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FINISH : Z_SYNC_FLUSH)); - data->finished = 1; + data->finished = true; if (data->strm.avail_out < data->outbuf_len) { size_t bucketlen = data->outbuf_len - data->strm.avail_out; @@ -335,7 +335,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f } /* RFC 1951 Inflate */ - data->finished = '\0'; + data->finished = false; status = inflateInit2(&(data->strm), windowBits); fops = &php_zlib_inflate_ops; } else if (strcasecmp(filtername, "zlib.deflate") == 0) { @@ -399,7 +399,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f } } status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0); - data->finished = 1; + data->finished = true; fops = &php_zlib_deflate_ops; } else { status = Z_DATA_ERROR; From d8db34138e907c5df08aee11508e83aba36261fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:54:43 +0200 Subject: [PATCH 045/386] Optimizer: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- Zend/Optimizer/block_pass.c | 8 +-- Zend/Optimizer/dfa_pass.c | 14 ++--- Zend/Optimizer/escape_analysis.c | 12 ++-- Zend/Optimizer/optimize_func_calls.c | 18 +++--- Zend/Optimizer/pass1.c | 14 ++--- Zend/Optimizer/sccp.c | 6 +- Zend/Optimizer/zend_call_graph.c | 14 ++--- Zend/Optimizer/zend_cfg.c | 4 +- Zend/Optimizer/zend_dump.c | 82 ++++++++++++++-------------- Zend/Optimizer/zend_func_info.c | 2 +- Zend/Optimizer/zend_optimizer.c | 2 +- Zend/Optimizer/zend_ssa.c | 14 ++--- 12 files changed, 95 insertions(+), 95 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 77beec2f72a73..4178326df71b4 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -949,14 +949,14 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array src = VAR_SOURCE(opline->op1); if (src && src->opcode == ZEND_QM_ASSIGN) { zend_op *op = src + 1; - bool optimize = 1; + bool optimize = true; while (op < opline) { if ((op->op1_type == opline->op1_type && op->op1.var == opline->op1.var) || (op->op2_type == opline->op1_type && op->op2.var == opline->op1.var)) { - optimize = 0; + optimize = false; break; } op++; @@ -1566,14 +1566,14 @@ static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset use } if (ctx->debug_level & ZEND_DUMP_BLOCK_PASS_VARS) { - bool printed = 0; + bool printed = false; uint32_t i; for (i = op_array->last_var; i< op_array->T; i++) { if (zend_bitset_in(used_ext, i)) { if (!printed) { fprintf(stderr, "NON-LOCAL-VARS: %d", i); - printed = 1; + printed = true; } else { fprintf(stderr, ", %d", i); } diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c index bf85764c93b49..fc3f76c1432ed 100644 --- a/Zend/Optimizer/dfa_pass.c +++ b/Zend/Optimizer/dfa_pass.c @@ -414,19 +414,19 @@ int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa) && call_info->callee_func && zend_string_equals_literal_ci(call_info->callee_func->common.function_name, "in_array")) { - bool strict = 0; + bool strict = false; bool has_opdata = op->opcode == ZEND_FRAMELESS_ICALL_3; ZEND_ASSERT(!call_info->is_prototype); if (has_opdata) { if (zend_is_true(CT_CONSTANT_EX(op_array, (op + 1)->op1.constant))) { - strict = 1; + strict = true; } } if (op->op2_type == IS_CONST && Z_TYPE_P(CT_CONSTANT_EX(op_array, op->op2.constant)) == IS_ARRAY) { - bool ok = 1; + bool ok = true; HashTable *src = Z_ARRVAL_P(CT_CONSTANT_EX(op_array, op->op2.constant)); HashTable *dst; @@ -443,7 +443,7 @@ int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa) zend_hash_index_add(dst, Z_LVAL_P(val), &tmp); } else { zend_array_destroy(dst); - ok = 0; + ok = false; break; } } ZEND_HASH_FOREACH_END(); @@ -451,7 +451,7 @@ int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa) ZEND_HASH_FOREACH_VAL(src, val) { if (Z_TYPE_P(val) != IS_STRING || ZEND_HANDLE_NUMERIC(Z_STR_P(val), idx)) { zend_array_destroy(dst); - ok = 0; + ok = false; break; } zend_hash_add(dst, Z_STR_P(val), &tmp); @@ -711,12 +711,12 @@ static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa) uint32_t op_num; zend_op *opline; zend_ssa_op *ssa_op; - bool can_follow = 1; + bool can_follow = true; while (next_block_num < ssa->cfg.blocks_count && !(ssa->cfg.blocks[next_block_num].flags & ZEND_BB_REACHABLE)) { if (ssa->cfg.blocks[next_block_num].flags & ZEND_BB_UNREACHABLE_FREE) { - can_follow = 0; + can_follow = false; } next_block_num++; } diff --git a/Zend/Optimizer/escape_analysis.c b/Zend/Optimizer/escape_analysis.c index 840a18341a0ff..ecc112ef30ee1 100644 --- a/Zend/Optimizer/escape_analysis.c +++ b/Zend/Optimizer/escape_analysis.c @@ -393,12 +393,12 @@ zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *o return SUCCESS; } - has_allocations = 0; + has_allocations = false; for (i = op_array->last_var; i < ssa_vars_count; i++) { if (ssa_vars[i].definition >= 0 && (ssa->var_info[i].type & (MAY_BE_ARRAY|MAY_BE_OBJECT)) && is_allocation_def(op_array, ssa, ssa_vars[i].definition, i, script)) { - has_allocations = 1; + has_allocations = true; break; } } @@ -470,7 +470,7 @@ zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *o bool changed; do { - changed = 0; + changed = false; for (i = 0; i < ssa_vars_count; i++) { if (ssa_vars[i].use_chain >= 0) { root = ees[i]; @@ -506,13 +506,13 @@ zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *o if (ssa_vars[root].escape_state == ESCAPE_STATE_GLOBAL_ESCAPE) { num_non_escaped--; if (num_non_escaped == 0) { - changed = 0; + changed = false; } else { - changed = 1; + changed = true; } break; } else { - changed = 1; + changed = true; } } } FOREACH_USE_END(); diff --git a/Zend/Optimizer/optimize_func_calls.c b/Zend/Optimizer/optimize_func_calls.c index 8b29f47c94976..819a33d93bb2e 100644 --- a/Zend/Optimizer/optimize_func_calls.c +++ b/Zend/Optimizer/optimize_func_calls.c @@ -237,7 +237,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) } call_stack[call].func = NULL; call_stack[call].opline = NULL; - call_stack[call].try_inline = 0; + call_stack[call].try_inline = false; call_stack[call].func_arg_num = (uint32_t)-1; break; case ZEND_FETCH_FUNC_ARG: @@ -265,7 +265,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) && opline->op2_type == IS_UNUSED) { /* FETCH_DIM_FUNC_ARG supports UNUSED op2, while FETCH_DIM_R does not. * Performing the replacement would create an invalid opcode. */ - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; } @@ -279,7 +279,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) break; case ZEND_SEND_VAL_EX: if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; } @@ -291,7 +291,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) break; case ZEND_CHECK_FUNC_ARG: if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; call_stack[call - 1].func_arg_num = (uint32_t)-1; break; } @@ -305,7 +305,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) /* Don't transform SEND_FUNC_ARG if any FETCH opcodes weren't transformed. */ if (call_stack[call - 1].last_check_func_arg_opline == NULL) { if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; } break; } @@ -314,7 +314,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) ZEND_FALLTHROUGH; case ZEND_SEND_VAR_EX: if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; } @@ -329,7 +329,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) break; case ZEND_SEND_VAR_NO_REF_EX: if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; } @@ -347,14 +347,14 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) case ZEND_SEND_VAR: case ZEND_SEND_REF: if (opline->op2_type == IS_CONST) { - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; } break; case ZEND_SEND_UNPACK: case ZEND_SEND_USER: case ZEND_SEND_ARRAY: - call_stack[call - 1].try_inline = 0; + call_stack[call - 1].try_inline = false; break; default: break; diff --git a/Zend/Optimizer/pass1.c b/Zend/Optimizer/pass1.c index fe92db583fcd9..735910d52b4cd 100644 --- a/Zend/Optimizer/pass1.c +++ b/Zend/Optimizer/pass1.c @@ -193,7 +193,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) if (send1_opline->opcode != ZEND_SEND_VAL || send1_opline->op1_type != IS_CONST) { /* don't collect constants after unknown function call */ - collect_constants = 0; + collect_constants = false; break; } if (send1_opline->op2.num == 2) { @@ -205,7 +205,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) if (send1_opline->opcode != ZEND_SEND_VAL || send1_opline->op1_type != IS_CONST) { /* don't collect constants after unknown function call */ - collect_constants = 0; + collect_constants = false; break; } } @@ -217,7 +217,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) init_opline->op2_type != IS_CONST || Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) { /* don't collect constants after unknown function call */ - collect_constants = 0; + collect_constants = false; break; } @@ -261,7 +261,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) } /* don't collect constants after any other function call */ - collect_constants = 0; + collect_constants = false; break; } case ZEND_STRLEN: @@ -309,7 +309,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) } } } - collect_constants = 0; + collect_constants = false; break; case ZEND_JMPZ: @@ -331,7 +331,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) break; } } - collect_constants = 0; + collect_constants = false; break; case ZEND_RETURN: @@ -354,7 +354,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) case ZEND_VERIFY_NEVER_TYPE: case ZEND_BIND_INIT_STATIC_OR_JMP: case ZEND_JMP_FRAMELESS: - collect_constants = 0; + collect_constants = false; break; } opline++; diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 5bae5cf160324..f3f76067f3797 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -718,7 +718,7 @@ static inline zend_result ct_eval_in_array(zval *result, uint32_t extended_value if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { res = zend_hash_index_exists(ht, Z_LVAL_P(op1)); } else { - res = 0; + res = false; } } else if (Z_TYPE_P(op1) <= IS_FALSE) { res = zend_hash_exists(ht, ZSTR_EMPTY_ALLOC()); @@ -726,11 +726,11 @@ static inline zend_result ct_eval_in_array(zval *result, uint32_t extended_value zend_string *key; zval key_tmp; - res = 0; + res = false; ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { ZVAL_STR(&key_tmp, key); if (zend_compare(op1, &key_tmp) == 0) { - res = 1; + res = true; break; } } ZEND_HASH_FOREACH_END(); diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index 8a2f8ea2a7e1a..d412414abd564 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -146,7 +146,7 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 case ZEND_SEND_USER: if (call_info) { if (opline->op2_type == IS_CONST) { - call_info->named_args = 1; + call_info->named_args = true; break; } @@ -160,7 +160,7 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 case ZEND_SEND_ARRAY: case ZEND_SEND_UNPACK: if (call_info) { - call_info->send_unpack = 1; + call_info->send_unpack = true; } break; } @@ -173,7 +173,7 @@ static bool zend_is_indirectly_recursive(zend_op_array *root, zend_op_array *op_ { zend_func_info *func_info; zend_call_info *call_info; - bool ret = 0; + bool ret = false; if (op_array == root) { return 1; @@ -187,8 +187,8 @@ static bool zend_is_indirectly_recursive(zend_op_array *root, zend_op_array *op_ call_info = func_info->caller_info; while (call_info) { if (zend_is_indirectly_recursive(root, call_info->caller_op_array, visited)) { - call_info->recursive = 1; - ret = 1; + call_info->recursive = true; + ret = true; } call_info = call_info->next_caller; } @@ -216,12 +216,12 @@ static void zend_analyze_recursion(zend_call_graph *call_graph) continue; } if (call_info->caller_op_array == op_array) { - call_info->recursive = 1; + call_info->recursive = true; func_info->flags |= ZEND_FUNC_RECURSIVE | ZEND_FUNC_RECURSIVE_DIRECTLY; } else { memset(visited, 0, sizeof(zend_ulong) * set_len); if (zend_is_indirectly_recursive(op_array, call_info->caller_op_array, visited)) { - call_info->recursive = 1; + call_info->recursive = true; func_info->flags |= ZEND_FUNC_RECURSIVE | ZEND_FUNC_RECURSIVE_INDIRECTLY; } } diff --git a/Zend/Optimizer/zend_cfg.c b/Zend/Optimizer/zend_cfg.c index a0d08b67aa70c..d2c54c9131962 100644 --- a/Zend/Optimizer/zend_cfg.c +++ b/Zend/Optimizer/zend_cfg.c @@ -280,7 +280,7 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, int blocks_count = 0; zend_basic_block *blocks; zval *zv; - bool extra_entry_block = 0; + bool extra_entry_block = false; cfg->flags = build_flags & (ZEND_CFG_STACKLESS|ZEND_CFG_RECV_ENTRY); @@ -445,7 +445,7 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, /* If the entry block has predecessors, we may need to split it */ if ((build_flags & ZEND_CFG_NO_ENTRY_PREDECESSORS) && op_array->last > 0 && block_map[0] > 1) { - extra_entry_block = 1; + extra_entry_block = true; } if (op_array->last_try_catch) { diff --git a/Zend/Optimizer/zend_dump.c b/Zend/Optimizer/zend_dump.c index 64deb7085edf3..4b7ca1615a862 100644 --- a/Zend/Optimizer/zend_dump.c +++ b/Zend/Optimizer/zend_dump.c @@ -30,11 +30,11 @@ void zend_dump_ht(HashTable *ht) zend_ulong index; zend_string *key; zval *val; - bool first = 1; + bool first = true; ZEND_HASH_FOREACH_KEY_VAL(ht, index, key, val) { if (first) { - first = 0; + first = false; } else { fprintf(stderr, ", "); } @@ -188,36 +188,36 @@ static void zend_dump_range(const zend_ssa_range *r) static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_instanceof, uint32_t dump_flags) { - bool first = 1; + bool first = true; fprintf(stderr, " ["); if (info & MAY_BE_GUARD) { fprintf(stderr, "!"); } if (info & MAY_BE_UNDEF) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "undef"); } if (info & MAY_BE_INDIRECT) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "ind"); } if (info & MAY_BE_REF) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "ref"); } if (dump_flags & ZEND_DUMP_RC_INFERENCE) { if (info & MAY_BE_RC1) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "rc1"); } if (info & MAY_BE_RCN) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "rcn"); } } if (info & MAY_BE_CLASS) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "class"); if (ce) { if (is_instanceof) { @@ -227,37 +227,37 @@ static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_inst } } } else if ((info & MAY_BE_ANY) == MAY_BE_ANY) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "any"); } else { if (info & MAY_BE_NULL) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "null"); } if ((info & MAY_BE_FALSE) && (info & MAY_BE_TRUE)) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "bool"); } else if (info & MAY_BE_FALSE) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "false"); } else if (info & MAY_BE_TRUE) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "true"); } if (info & MAY_BE_LONG) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "long"); } if (info & MAY_BE_DOUBLE) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "double"); } if (info & MAY_BE_STRING) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "string"); } if (info & MAY_BE_ARRAY) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); if (info & MAY_BE_PACKED_GUARD) { fprintf(stderr, "!"); } @@ -268,18 +268,18 @@ static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_inst } else if (MAY_BE_HASH_ONLY(info)) { fprintf(stderr, "hash "); } else if ((info & MAY_BE_ARRAY_KEY_ANY) != MAY_BE_ARRAY_KEY_ANY && (info & MAY_BE_ARRAY_KEY_ANY) != 0) { - bool afirst = 1; + bool afirst = true; fprintf(stderr, "["); if (info & MAY_BE_ARRAY_EMPTY) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "empty"); } if (MAY_BE_PACKED(info)) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "packed"); } if (MAY_BE_HASH(info)) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "hash"); } fprintf(stderr, "] "); @@ -288,71 +288,71 @@ static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_inst if ((info & (MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING)) != 0 && ((info & MAY_BE_ARRAY_KEY_LONG) == 0 || (info & MAY_BE_ARRAY_KEY_STRING) == 0)) { - bool afirst = 1; + bool afirst = true; fprintf(stderr, " ["); if (info & MAY_BE_ARRAY_KEY_LONG) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "long"); } if (info & MAY_BE_ARRAY_KEY_STRING) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "string"); } fprintf(stderr, "]"); } if (info & (MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF)) { - bool afirst = 1; + bool afirst = true; fprintf(stderr, " of ["); if ((info & MAY_BE_ARRAY_OF_ANY) == MAY_BE_ARRAY_OF_ANY) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "any"); } else { if (info & MAY_BE_ARRAY_OF_NULL) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "null"); } if (info & MAY_BE_ARRAY_OF_FALSE) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "false"); } if (info & MAY_BE_ARRAY_OF_TRUE) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "true"); } if (info & MAY_BE_ARRAY_OF_LONG) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "long"); } if (info & MAY_BE_ARRAY_OF_DOUBLE) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "double"); } if (info & MAY_BE_ARRAY_OF_STRING) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "string"); } if (info & MAY_BE_ARRAY_OF_ARRAY) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "array"); } if (info & MAY_BE_ARRAY_OF_OBJECT) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "object"); } if (info & MAY_BE_ARRAY_OF_RESOURCE) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "resource"); } } if (info & MAY_BE_ARRAY_OF_REF) { - if (afirst) afirst = 0; else fprintf(stderr, ", "); + if (afirst) afirst = false; else fprintf(stderr, ", "); fprintf(stderr, "ref"); } fprintf(stderr, "]"); } } if (info & MAY_BE_OBJECT) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "object"); if (ce) { if (is_instanceof) { @@ -363,7 +363,7 @@ static void zend_dump_type_info(uint32_t info, zend_class_entry *ce, int is_inst } } if (info & MAY_BE_RESOURCE) { - if (first) first = 0; else fprintf(stderr, ", "); + if (first) first = false; else fprintf(stderr, ", "); fprintf(stderr, "resource"); } } @@ -1216,14 +1216,14 @@ void zend_dump_ssa_variables(const zend_op_array *op_array, const zend_ssa *ssa, static void zend_dump_var_set(const zend_op_array *op_array, const char *name, zend_bitset set) { - bool first = 1; + bool first = true; uint32_t i; fprintf(stderr, " ; %s = {", name); for (i = 0; i < op_array->last_var + op_array->T; i++) { if (zend_bitset_in(set, i)) { if (first) { - first = 0; + first = false; } else { fprintf(stderr, ", "); } diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c index 121d2d2cfe570..41852dd798aa1 100644 --- a/Zend/Optimizer/zend_func_info.c +++ b/Zend/Optimizer/zend_func_info.c @@ -136,7 +136,7 @@ ZEND_API uint32_t zend_get_func_info( uint32_t ret = 0; const zend_function *callee_func = call_info->callee_func; *ce = NULL; - *ce_is_instanceof = 0; + *ce_is_instanceof = false; if (callee_func->type == ZEND_INTERNAL_FUNCTION) { uint32_t internal_ret = zend_get_internal_func_info(callee_func, call_info, ssa); diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 80eabe97c3217..5e074300c4418 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -901,7 +901,7 @@ const zend_class_constant *zend_fetch_class_const_info( zend_function *zend_optimizer_get_called_func( zend_script *script, zend_op_array *op_array, zend_op *opline, bool *is_prototype) { - *is_prototype = 0; + *is_prototype = false; switch (opline->opcode) { case ZEND_INIT_FCALL: { diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index 886bb467b444f..d346492336d23 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -1671,15 +1671,15 @@ void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types /* If the op already uses the new var, don't add the op to the use * list again. Instead move the use_chain to the correct operand. */ - bool add_to_use_chain = 1; + bool add_to_use_chain = true; if (ssa_op->result_use == new) { - add_to_use_chain = 0; + add_to_use_chain = false; } else if (ssa_op->op1_use == new) { if (ssa_op->result_use == old) { ssa_op->res_use_chain = ssa_op->op1_use_chain; ssa_op->op1_use_chain = -1; } - add_to_use_chain = 0; + add_to_use_chain = false; } else if (ssa_op->op2_use == new) { if (ssa_op->result_use == old) { ssa_op->res_use_chain = ssa_op->op2_use_chain; @@ -1688,7 +1688,7 @@ void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types ssa_op->op1_use_chain = ssa_op->op2_use_chain; ssa_op->op2_use_chain = -1; } - add_to_use_chain = 0; + add_to_use_chain = false; } /* Perform the actual renaming */ @@ -1723,7 +1723,7 @@ void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types /* Update phi use chains */ FOREACH_PHI_USE(old_var, phi) { int j; - bool after_first_new_source = 0; + bool after_first_new_source = false; /* If the phi already uses the new var, find its use chain, as we may * need to move it to a different source operand. */ @@ -1737,7 +1737,7 @@ void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types for (j = 0; j < ssa->cfg.blocks[phi->block].predecessors_count; j++) { if (phi->sources[j] == new) { - after_first_new_source = 1; + after_first_new_source = true; } else if (phi->sources[j] == old) { phi->sources[j] = new; @@ -1751,7 +1751,7 @@ void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types phi->use_chains[j] = new_var->phi_use_chain; new_var->phi_use_chain = phi; } - after_first_new_source = 1; + after_first_new_source = true; } else { phi->use_chains[j] = NULL; } From c32fbca8741eec27a163a1d20d82a840006c8647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:58:39 +0200 Subject: [PATCH 046/386] Zend: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- Zend/zend.c | 6 +-- Zend/zend_API.c | 50 ++++++++++---------- Zend/zend_builtin_functions.c | 28 +++++------ Zend/zend_compile.c | 88 +++++++++++++++++------------------ Zend/zend_exceptions.c | 2 +- Zend/zend_execute_API.c | 12 ++--- Zend/zend_gc.c | 16 +++---- Zend/zend_gdb.c | 4 +- Zend/zend_inheritance.c | 12 ++--- Zend/zend_ini.c | 6 +-- Zend/zend_interfaces.c | 6 +-- Zend/zend_object_handlers.c | 4 +- Zend/zend_operators.c | 14 +++--- Zend/zend_strtod.c | 4 +- Zend/zend_virtual_cwd.c | 4 +- 15 files changed, 128 insertions(+), 128 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 045d25134f8c9..c07fabcb36f85 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -641,7 +641,7 @@ static FILE *zend_fopen_wrapper(zend_string *filename, zend_string **opened_path /* }}} */ #ifdef ZTS -static bool short_tags_default = 1; +static bool short_tags_default = true; static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT; #else # define short_tags_default 1 @@ -817,7 +817,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{ executor_globals->saved_fpu_cw = 0; #endif executor_globals->saved_fpu_cw_ptr = NULL; - executor_globals->active = 0; + executor_globals->active = false; executor_globals->bailout = NULL; executor_globals->error_handling = EH_NORMAL; executor_globals->exception_class = NULL; @@ -1026,7 +1026,7 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */ executor_globals = ts_resource(executor_globals_id); compiler_globals_dtor(compiler_globals); - compiler_globals->in_compilation = 0; + compiler_globals->in_compilation = false; compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable)); compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable)); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 865a684e4e240..901a7d2219635 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -818,8 +818,8 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec { const char *spec_walk = *spec; char c = *spec_walk++; - bool check_null = 0; - bool separate = 0; + bool check_null = false; + bool separate = false; zval *real_arg = arg; /* scan through modifiers */ @@ -828,9 +828,9 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec if (*spec_walk == '/') { SEPARATE_ZVAL_NOREF(arg); real_arg = arg; - separate = 1; + separate = true; } else if (*spec_walk == '!') { - check_null = 1; + check_null = true; } else { break; } @@ -1157,8 +1157,8 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec, uint32_t max_num_args = 0; uint32_t post_varargs = 0; zval *arg; - bool have_varargs = 0; - bool have_optional_args = 0; + bool have_varargs = false; + bool have_optional_args = false; zval **varargs = NULL; uint32_t *n_varargs = NULL; @@ -1180,7 +1180,7 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec, case '|': min_num_args = max_num_args; - have_optional_args = 1; + have_optional_args = true; break; case '/': @@ -1195,7 +1195,7 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec, "only one varargs specifier (* or +) is permitted"); return FAILURE; } - have_varargs = 1; + have_varargs = true; /* we expect at least one parameter in varargs */ if (c == '+') { max_num_args++; @@ -3596,7 +3596,7 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_ /* TODO: Move this out of here in 7.4. */ if (persistent && EG(current_module) && EG(current_module)->type == MODULE_TEMPORARY) { - persistent = 0; + persistent = false; } if (name[0] == '\\') { @@ -3719,7 +3719,7 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc ZSTR_ALLOCA_ALLOC(lcname, name_len, use_heap); zend_str_tolower_copy(ZSTR_VAL(lcname), ZSTR_VAL(name), name_len); - *strict_class = 0; + *strict_class = false; if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_SELF))) { if (!scope) { if (error) *error = estrdup("cannot access \"self\" when no class scope is active"); @@ -3754,7 +3754,7 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc if (!fcc->object) { fcc->object = zend_get_this_object(frame); } - *strict_class = 1; + *strict_class = true; ret = true; } } else if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_STATIC))) { @@ -3771,7 +3771,7 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc if (!fcc->object) { fcc->object = zend_get_this_object(frame); } - *strict_class = 1; + *strict_class = true; ret = true; } } else if ((ce = zend_lookup_class(name)) != NULL) { @@ -3791,7 +3791,7 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc } else { fcc->called_scope = fcc->object ? fcc->object->ce : ce; } - *strict_class = 1; + *strict_class = true; ret = true; } else { if (error) zend_spprintf(error, 0, "class \"%.*s\" not found", (int)name_len, ZSTR_VAL(name)); @@ -3815,7 +3815,7 @@ ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc) { static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_execute_data *frame, zend_fcall_info_cache *fcc, bool strict_class, char **error, bool suppress_deprecation) /* {{{ */ { zend_class_entry *ce_org = fcc->calling_scope; - bool retval = 0; + bool retval = false; zend_string *mname, *cname; zend_string *lmname; const char *colon; @@ -3897,7 +3897,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ } else { fcc->called_scope = fcc->object ? fcc->object->ce : fcc->calling_scope; } - strict_class = 1; + strict_class = true; } else if (!zend_is_callable_check_class(cname, scope, frame, fcc, &strict_class, error, suppress_deprecation || ce_org != NULL)) { zend_string_release_ex(cname, 0); return 0; @@ -3935,11 +3935,11 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ zend_string_equals_literal(lmname, ZEND_CONSTRUCTOR_FUNC_NAME)) { fcc->function_handler = fcc->calling_scope->constructor; if (fcc->function_handler) { - retval = 1; + retval = true; } } else if ((zv = zend_hash_find(ftable, lmname)) != NULL) { fcc->function_handler = Z_PTR_P(zv); - retval = 1; + retval = true; if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) && !strict_class) { scope = get_scope(frame); @@ -3964,7 +3964,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ scope = get_scope(frame); ZEND_ASSERT(!(fcc->function_handler->common.fn_flags & ZEND_ACC_PUBLIC)); if (!zend_check_method_accessible(fcc->function_handler, scope)) { - retval = 0; + retval = false; fcc->function_handler = NULL; goto get_function_via_handler; } @@ -3975,7 +3975,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ if (strict_class && ce_org->__call) { fcc->function_handler = zend_get_call_trampoline_func(ce_org, mname, 0); call_via_handler = 1; - retval = 1; + retval = true; } else { fcc->function_handler = fcc->object->handlers->get_method(&fcc->object, mname, NULL); if (fcc->function_handler) { @@ -3984,7 +3984,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ !instanceof_function(ce_org, fcc->function_handler->common.scope))) { zend_release_fcall_info_cache(fcc); } else { - retval = 1; + retval = true; call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0; } } @@ -3996,7 +3996,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, NULL); } if (fcc->function_handler) { - retval = 1; + retval = true; call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0; if (call_via_handler && !fcc->object) { zend_object *object = zend_get_this_object(frame); @@ -4012,12 +4012,12 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ if (retval) { if (fcc->calling_scope && !call_via_handler) { if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) { - retval = 0; + retval = false; if (error) { zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); } } else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { - retval = 0; + retval = false; if (error) { zend_spprintf(error, 0, "non-static method %s::%s() cannot be called statically", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); } @@ -4033,7 +4033,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ } zend_spprintf(error, 0, "cannot access %s method %s::%s()", zend_visibility_string(fcc->function_handler->common.fn_flags), ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); } - retval = 0; + retval = false; } } } @@ -4128,7 +4128,7 @@ ZEND_API bool zend_is_callable_at_frame( { bool ret; zend_fcall_info_cache fcc_local; - bool strict_class = 0; + bool strict_class = false; if (fcc == NULL) { fcc = &fcc_local; diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index fa2859ee4e9f1..12752c0ff6d83 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -503,7 +503,7 @@ ZEND_FUNCTION(error_reporting) static bool validate_constant_array_argument(HashTable *ht, int argument_number) /* {{{ */ { - bool ret = 1; + bool ret = true; zval *val; GC_PROTECT_RECURSION(ht); @@ -512,10 +512,10 @@ static bool validate_constant_array_argument(HashTable *ht, int argument_number) if (Z_TYPE_P(val) == IS_ARRAY && Z_REFCOUNTED_P(val)) { if (Z_IS_RECURSIVE_P(val)) { zend_argument_value_error(argument_number, "cannot be a recursive array"); - ret = 0; + ret = false; break; } else if (!validate_constant_array_argument(Z_ARRVAL_P(val), argument_number)) { - ret = 0; + ret = false; break; } } @@ -1631,7 +1631,7 @@ static void add_zendext_info(zend_extension *ext, void *arg) /* {{{ */ /* {{{ Return an array containing names of loaded extensions */ ZEND_FUNCTION(get_loaded_extensions) { - bool zendext = 0; + bool zendext = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &zendext) == FAILURE) { RETURN_THROWS(); @@ -1654,7 +1654,7 @@ ZEND_FUNCTION(get_loaded_extensions) /* {{{ Return an array containing the names and values of all defined constants */ ZEND_FUNCTION(get_defined_constants) { - bool categorize = 0; + bool categorize = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &categorize) == FAILURE) { RETURN_THROWS(); @@ -1892,7 +1892,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int { zend_execute_data *call, *last_call = NULL; zend_object *object; - bool fake_frame = 0; + bool fake_frame = false; int lineno, frameno = 0; zend_function *func; zend_string *filename; @@ -2128,7 +2128,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int } } else { /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ - bool build_filename_arg = 1; + bool build_filename_arg = true; zend_string *pseudo_function_name; uint32_t include_kind = 0; if (prev && prev->func && ZEND_USER_CODE(prev->func->common.type) && prev->opline->opcode == ZEND_INCLUDE_OR_EVAL) { @@ -2138,7 +2138,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int switch (include_kind) { case ZEND_EVAL: pseudo_function_name = ZSTR_KNOWN(ZEND_STR_EVAL); - build_filename_arg = 0; + build_filename_arg = false; break; case ZEND_INCLUDE: pseudo_function_name = ZSTR_KNOWN(ZEND_STR_INCLUDE); @@ -2160,7 +2160,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int } pseudo_function_name = ZSTR_KNOWN(ZEND_STR_UNKNOWN); - build_filename_arg = 0; + build_filename_arg = false; break; } @@ -2194,9 +2194,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int && prev->func && ZEND_USER_CODE(prev->func->common.type) && prev->opline->opcode == ZEND_INCLUDE_OR_EVAL) { - fake_frame = 1; + fake_frame = true; } else { - fake_frame = 0; + fake_frame = false; include_filename = filename; last_call = call; call = prev; @@ -2266,9 +2266,9 @@ ZEND_FUNCTION(get_extension_funcs) if (module->functions) { /* avoid BC break, if functions list is empty, will return an empty array */ array_init(return_value); - array = 1; + array = true; } else { - array = 0; + array = false; } ZEND_HASH_MAP_FOREACH_PTR(CG(function_table), zif) { @@ -2276,7 +2276,7 @@ ZEND_FUNCTION(get_extension_funcs) && zif->internal_function.module == module) { if (!array) { array_init(return_value); - array = 1; + array = true; } add_next_index_str(return_value, zend_string_copy(zif->common.function_name)); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2eee6a01caf7e..34764d13de540 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1075,21 +1075,21 @@ static zend_string *zend_resolve_non_class_name( bool case_sensitive, HashTable *current_import_sub ) { char *compound; - *is_fully_qualified = 0; + *is_fully_qualified = false; if (ZSTR_VAL(name)[0] == '\\') { /* Remove \ prefix (only relevant if this is a string rather than a label) */ - *is_fully_qualified = 1; + *is_fully_qualified = true; return zend_string_init(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 1, 0); } if (type == ZEND_NAME_FQ) { - *is_fully_qualified = 1; + *is_fully_qualified = true; return zend_string_copy(name); } if (type == ZEND_NAME_RELATIVE) { - *is_fully_qualified = 1; + *is_fully_qualified = true; return zend_prefix_with_ns(name); } @@ -1103,14 +1103,14 @@ static zend_string *zend_resolve_non_class_name( } if (import_name) { - *is_fully_qualified = 1; + *is_fully_qualified = true; return zend_string_copy(import_name); } } compound = memchr(ZSTR_VAL(name), '\\', ZSTR_LEN(name)); if (compound) { - *is_fully_qualified = 1; + *is_fully_qualified = true; } if (compound && FC(imports)) { @@ -1542,7 +1542,7 @@ static void zend_mark_function_as_generator(void) /* {{{ */ ZEND_TYPE_FOREACH(return_type, single_type) { if (ZEND_TYPE_HAS_NAME(*single_type) && is_generator_compatible_class_type(ZEND_TYPE_NAME(*single_type))) { - valid_type = 1; + valid_type = true; break; } } ZEND_TYPE_FOREACH_END(); @@ -3262,7 +3262,7 @@ static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_no /* Propagate refs used on leaf elements to the surrounding list() structures. */ static bool zend_propagate_list_refs(zend_ast *ast) { /* {{{ */ zend_ast_list *list = zend_ast_get_list(ast); - bool has_refs = 0; + bool has_refs = false; uint32_t i; for (i = 0; i < list->children; ++i) { @@ -3297,7 +3297,7 @@ static void zend_compile_list_assign( { zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; - bool has_elems = 0; + bool has_elems = false; bool is_keyed = list_is_keyed(list); if (list->children && expr_node->op_type == IS_CONST && Z_TYPE(expr_node->u.constant) == IS_STRING) { @@ -3326,7 +3326,7 @@ static void zend_compile_list_assign( var_ast = elem_ast->child[0]; key_ast = elem_ast->child[1]; - has_elems = 1; + has_elems = true; if (is_keyed) { if (key_ast == NULL) { @@ -3716,16 +3716,16 @@ static uint32_t zend_compile_args( { zend_ast_list *args = zend_ast_get_list(ast); uint32_t i; - bool uses_arg_unpack = 0; + bool uses_arg_unpack = false; uint32_t arg_count = 0; /* number of arguments not including unpacks */ /* Whether named arguments are used syntactically, to enforce language level limitations. * May not actually use named argument passing. */ - bool uses_named_args = 0; + bool uses_named_args = false; /* Whether there may be any undef arguments due to the use of named arguments. */ - bool may_have_undef = 0; + bool may_have_undef = false; /* Whether there may be any extra named arguments collected into a variadic. */ - *may_have_extra_named_args = 0; + *may_have_extra_named_args = false; for (i = 0; i < args->children; ++i) { zend_ast *arg = args->child[i]; @@ -3743,12 +3743,12 @@ static uint32_t zend_compile_args( } /* Unpack may contain named arguments. */ - may_have_undef = 1; + may_have_undef = true; if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) { - *may_have_extra_named_args = 1; + *may_have_extra_named_args = true; } - uses_arg_unpack = 1; + uses_arg_unpack = true; fbc = NULL; zend_compile_expr(&arg_node, arg->child[0]); @@ -3760,7 +3760,7 @@ static uint32_t zend_compile_args( } if (arg->kind == ZEND_AST_NAMED_ARG) { - uses_named_args = 1; + uses_named_args = true; arg_name = zval_make_interned_string(zend_ast_get_zval(arg->child[0])); arg = arg->child[1]; @@ -3772,15 +3772,15 @@ static uint32_t zend_compile_args( arg_count++; } else { // TODO: We could track which arguments were passed, even if out of order. - may_have_undef = 1; + may_have_undef = true; if (arg_num == (uint32_t) -1 && (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) { - *may_have_extra_named_args = 1; + *may_have_extra_named_args = true; } } } else { arg_num = (uint32_t) -1; - may_have_undef = 1; - *may_have_extra_named_args = 1; + may_have_undef = true; + *may_have_extra_named_args = true; } } else { if (uses_arg_unpack) { @@ -4415,7 +4415,7 @@ static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args) /* {{{ */ { - bool strict = 0; + bool strict = false; znode array, needly; zend_op *opline; @@ -4450,7 +4450,7 @@ static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args } if (zend_hash_num_elements(Z_ARRVAL(array.u.constant)) > 0) { - bool ok = 1; + bool ok = true; zval *val, tmp; HashTable *src = Z_ARRVAL(array.u.constant); HashTable *dst = zend_new_array(zend_hash_num_elements(src)); @@ -4465,7 +4465,7 @@ static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args zend_hash_index_add(dst, Z_LVAL_P(val), &tmp); } else { zend_array_destroy(dst); - ok = 0; + ok = false; break; } } ZEND_HASH_FOREACH_END(); @@ -4474,7 +4474,7 @@ static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args if (Z_TYPE_P(val) != IS_STRING || is_numeric_string(Z_STRVAL_P(val), Z_STRLEN_P(val), NULL, NULL, 0)) { zend_array_destroy(dst); - ok = 0; + ok = false; break; } zend_hash_add(dst, Z_STR_P(val), &tmp); @@ -5699,7 +5699,7 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */ if (is_generator) { /* For generators the by-ref flag refers to yields, not returns */ - by_ref = 0; + by_ref = false; } if (!expr_ast) { @@ -6115,7 +6115,7 @@ static void zend_compile_foreach(zend_ast *ast) /* {{{ */ } if (value_ast->kind == ZEND_AST_ARRAY && zend_propagate_list_refs(value_ast)) { - by_ref = 1; + by_ref = true; } if (by_ref && is_variable) { @@ -6294,7 +6294,7 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ zend_ast_list *cases = zend_ast_get_list(ast->child[1]); uint32_t i; - bool has_default_case = 0; + bool has_default_case = false; znode expr_node, case_node; zend_op *opline; @@ -6339,7 +6339,7 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ zend_error_noreturn(E_COMPILE_ERROR, "Switch statements may only contain one default clause"); } - has_default_case = 1; + has_default_case = true; continue; } @@ -6547,7 +6547,7 @@ static void zend_compile_match(znode *result, zend_ast *ast) { zend_ast *expr_ast = ast->child[0]; zend_ast_list *arms = zend_ast_get_list(ast->child[1]); - bool has_default_arm = 0; + bool has_default_arm = false; uint32_t opnum_match = (uint32_t)-1; znode expr_node; @@ -6572,7 +6572,7 @@ static void zend_compile_match(znode *result, zend_ast *ast) zend_error_noreturn(E_COMPILE_ERROR, "Match expressions may only contain one default arm"); } - has_default_arm = 1; + has_default_arm = true; } } @@ -6625,7 +6625,7 @@ static void zend_compile_match(znode *result, zend_ast *ast) opnum_default_jmp = zend_emit_jump(0); } - bool is_first_case = 1; + bool is_first_case = true; uint32_t cond_count = 0; uint32_t *jmp_end_opnums = safe_emalloc(sizeof(uint32_t), arms->children, 0); @@ -6697,7 +6697,7 @@ static void zend_compile_match(znode *result, zend_ast *ast) if (is_first_case) { zend_emit_op_tmp(result, ZEND_QM_ASSIGN, &body_node, NULL); - is_first_case = 0; + is_first_case = false; } else { zend_op *opline_qm_assign = zend_emit_op(NULL, ZEND_QM_ASSIGN, &body_node, NULL); SET_NODE(opline_qm_assign->result, result); @@ -7553,7 +7553,7 @@ static void zend_compile_attributes( if (args) { ZEND_ASSERT(args->kind == ZEND_AST_ARG_LIST); - bool uses_named_args = 0; + bool uses_named_args = false; for (j = 0; j < args->children; j++) { zend_ast **arg_ast_ptr = &args->child[j]; zend_ast *arg_ast = *arg_ast_ptr; @@ -7566,7 +7566,7 @@ static void zend_compile_attributes( if (arg_ast->kind == ZEND_AST_NAMED_ARG) { attr->args[j].name = zend_string_copy(zend_ast_get_str(arg_ast->child[0])); arg_ast_ptr = &arg_ast->child[1]; - uses_named_args = 1; + uses_named_args = true; for (uint32_t k = 0; k < j; k++) { if (attr->args[k].name && @@ -8103,7 +8103,7 @@ static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { zend_hash_add_empty_element(&info->uses, name); } else { - info->varvars_used = 1; + info->varvars_used = true; find_implicit_binds_recursively(info, name_ast); } } else if (zend_ast_is_list(ast)) { @@ -10088,7 +10088,7 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ zend_ast_list *list = zend_ast_get_list(ast); zend_ast *last_elem_ast = NULL; uint32_t i; - bool is_constant = 1; + bool is_constant = true; if (ast->attr == ZEND_ARRAY_SYNTAX_LIST) { zend_error(E_COMPILE_ERROR, "Cannot use list() as standalone expression"); @@ -10113,13 +10113,13 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ if (elem_ast->attr /* by_ref */ || elem_ast->child[0]->kind != ZEND_AST_ZVAL || (elem_ast->child[1] && elem_ast->child[1]->kind != ZEND_AST_ZVAL) ) { - is_constant = 0; + is_constant = false; } } else { zend_eval_const_expr(&elem_ast->child[0]); if (elem_ast->child[0]->kind != ZEND_AST_ZVAL) { - is_constant = 0; + is_constant = false; } } @@ -10604,7 +10604,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ znode var_node_is, var_node_w, default_node, assign_node, *node; zend_op *opline; uint32_t coalesce_opnum; - bool need_frees = 0; + bool need_frees = false; /* Remember expressions compiled during the initial BP_VAR_IS lookup, * to avoid double-evaluation when we compile again with BP_VAR_W. */ @@ -10673,7 +10673,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ ZEND_HASH_FOREACH_PTR(CG(memoized_exprs), node) { if (node->op_type == IS_TMP_VAR || node->op_type == IS_VAR) { - need_frees = 1; + need_frees = true; break; } } ZEND_HASH_FOREACH_END(); @@ -10939,7 +10939,7 @@ static void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */ zend_ast_list *list = zend_ast_get_list(ast); zend_op *opline; uint32_t i, opnum_init = -1; - bool packed = 1; + bool packed = true; if (zend_try_ct_eval_array(&result->u.constant, ast)) { result->op_type = IS_CONST; @@ -11000,7 +11000,7 @@ static void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */ opline->extended_value |= by_ref; if (key_ast && key_node.op_type == IS_CONST && Z_TYPE(key_node.u.constant) == IS_STRING) { - packed = 0; + packed = false; } } diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 0b0945aac0f44..9f813252cb7fa 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -401,7 +401,7 @@ ZEND_METHOD(ErrorException, __construct) { zend_string *message = NULL, *filename = NULL; zend_long code = 0, severity = E_ERROR, lineno; - bool lineno_is_null = 1; + bool lineno_is_null = true; zval tmp, *object, *previous = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|SllS!l!O!", &message, &code, &severity, &filename, &lineno, &lineno_is_null, &previous, zend_ce_throwable) == FAILURE) { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 91b8c5ab210ef..ef03940a7a41e 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -874,7 +874,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ for (i=0; iparam_count; i++) { zval *param = ZEND_CALL_ARG(call, i+1); zval *arg = &fci->params[i]; - bool must_wrap = 0; + bool must_wrap = false; if (UNEXPECTED(Z_ISUNDEF_P(arg))) { /* Allow forwarding undef slots. This is only used by Closure::__invoke(). */ ZVAL_UNDEF(param); @@ -888,7 +888,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ /* By-value send is not allowed -- emit a warning, * and perform the call with the value wrapped in a reference. */ zend_param_must_be_ref(func, i + 1); - must_wrap = 1; + must_wrap = true; if (UNEXPECTED(EG(exception))) { ZEND_CALL_NUM_ARGS(call) = i; cleanup_args: @@ -922,13 +922,13 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ zend_string *name; zval *arg; uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1; - bool have_named_params = 0; + bool have_named_params = false; ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) { - bool must_wrap = 0; + bool must_wrap = false; zval *target; if (name) { void *cache_slot[2] = {NULL, NULL}; - have_named_params = 1; + have_named_params = true; target = zend_handle_named_arg(&call, name, &arg_num, cache_slot); if (!target) { goto cleanup_args; @@ -950,7 +950,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ /* By-value send is not allowed -- emit a warning, * and perform the call with the value wrapped in a reference. */ zend_param_must_be_ref(func, arg_num); - must_wrap = 1; + must_wrap = true; if (UNEXPECTED(EG(exception))) { goto cleanup_args; } diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index e15f97ecfe802..527ddd4b1931e 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -512,10 +512,10 @@ static void root_buffer_dtor(zend_gc_globals *gc_globals) static void gc_globals_ctor_ex(zend_gc_globals *gc_globals) { - gc_globals->gc_enabled = 0; - gc_globals->gc_active = 0; - gc_globals->gc_protected = 1; - gc_globals->gc_full = 0; + gc_globals->gc_enabled = false; + gc_globals->gc_active = false; + gc_globals->gc_protected = true; + gc_globals->gc_full = false; gc_globals->buf = NULL; gc_globals->unused = GC_INVALID; @@ -1974,8 +1974,8 @@ static zend_never_inline void gc_call_destructors_in_fiber(uint32_t end) ZEND_API int zend_gc_collect_cycles(void) { int total_count = 0; - bool should_rerun_gc = 0; - bool did_rerun_gc = 0; + bool should_rerun_gc = false; + bool did_rerun_gc = false; zend_hrtime_t start_time = zend_hrtime(); if (GC_G(num_roots) && !GC_G(gc_active)) { @@ -2029,7 +2029,7 @@ ZEND_API int zend_gc_collect_cycles(void) * modify any refcounts, so we have no real way to detect this situation * short of rerunning full GC tracing. What we do instead is to only run * destructors at this point and automatically re-run GC afterwards. */ - should_rerun_gc = 1; + should_rerun_gc = true; /* Mark all roots for which a dtor will be invoked as DTOR_GARBAGE. Additionally * color them purple. This serves a double purpose: First, they should be @@ -2155,7 +2155,7 @@ ZEND_API int zend_gc_collect_cycles(void) * up. We do this only once: If we encounter more destructors on the second run, we'll not * run GC another time. */ if (should_rerun_gc && !did_rerun_gc) { - did_rerun_gc = 1; + did_rerun_gc = true; goto rerun_gc; } diff --git a/Zend/zend_gdb.c b/Zend/zend_gdb.c index 102b0b3181999..5975d8c29c099 100644 --- a/Zend/zend_gdb.c +++ b/Zend/zend_gdb.c @@ -109,7 +109,7 @@ ZEND_API void zend_gdb_unregister_all(void) ZEND_API bool zend_gdb_present(void) { - bool ret = 0; + bool ret = false; #if defined(__linux__) /* netbsd while having this procfs part, does not hold the tracer pid */ int fd = open("/proc/self/status", O_RDONLY); @@ -133,7 +133,7 @@ ZEND_API bool zend_gdb_present(void) snprintf(buf, sizeof(buf), "/proc/%d/exe", (int)pid); if (readlink(buf, out, sizeof(out) - 1) > 0) { if (strstr(out, "gdb")) { - ret = 1; + ret = true; } } } diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 5a537552af85a..62b55186d6b60 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -475,7 +475,7 @@ static inheritance_status zend_is_class_subtype_of_type( zend_class_entry *fe_scope, zend_string *fe_class_name, zend_class_entry *proto_scope, const zend_type proto_type) { zend_class_entry *fe_ce = NULL; - bool have_unresolved = 0; + bool have_unresolved = false; /* If the parent has 'object' as a return type, any class satisfies the co-variant check */ if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_OBJECT) { @@ -484,7 +484,7 @@ static inheritance_status zend_is_class_subtype_of_type( * are not classes (such as typedefs). */ if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name); if (!fe_ce) { - have_unresolved = 1; + have_unresolved = true; } else { track_class_dependency(fe_ce, fe_class_name); return INHERITANCE_SUCCESS; @@ -495,7 +495,7 @@ static inheritance_status zend_is_class_subtype_of_type( if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_CALLABLE) { if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name); if (!fe_ce) { - have_unresolved = 1; + have_unresolved = true; } else if (fe_ce == zend_ce_closure) { track_class_dependency(fe_ce, fe_class_name); return INHERITANCE_SUCCESS; @@ -506,7 +506,7 @@ static inheritance_status zend_is_class_subtype_of_type( if ((ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_STATIC) && (fe_scope->ce_flags & ZEND_ACC_FINAL)) { if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name); if (!fe_ce) { - have_unresolved = 1; + have_unresolved = true; } else if (fe_ce == fe_scope) { track_class_dependency(fe_ce, fe_class_name); return INHERITANCE_SUCCESS; @@ -530,7 +530,7 @@ static inheritance_status zend_is_class_subtype_of_type( } continue; case INHERITANCE_UNRESOLVED: - have_unresolved = 1; + have_unresolved = true; continue; case INHERITANCE_SUCCESS: if (!is_intersection) { @@ -562,7 +562,7 @@ static inheritance_status zend_is_class_subtype_of_type( } if (!fe_ce || !proto_ce) { - have_unresolved = 1; + have_unresolved = true; continue; } if (unlinked_instanceof(fe_ce, proto_ce)) { diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 689e76794df34..62379f057d2eb 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -515,7 +515,7 @@ ZEND_API zend_string *zend_ini_str_ex(const char *name, size_t name_length, bool ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length); if (ini_entry) { if (exists) { - *exists = 1; + *exists = true; } if (orig && ini_entry->modified) { @@ -525,7 +525,7 @@ ZEND_API zend_string *zend_ini_str_ex(const char *name, size_t name_length, bool } } else { if (exists) { - *exists = 0; + *exists = false; } return NULL; } @@ -534,7 +534,7 @@ ZEND_API zend_string *zend_ini_str_ex(const char *name, size_t name_length, bool ZEND_API zend_string *zend_ini_str(const char *name, size_t name_length, bool orig) /* {{{ */ { - bool exists = 1; + bool exists = true; zend_string *return_value; return_value = zend_ini_str_ex(name, name_length, orig, &exists); diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index ce9cc00fdfb95..404dd9db893ea 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -496,7 +496,7 @@ static zend_object *zend_internal_iterator_create(zend_class_entry *ce) { zend_internal_iterator *intern = emalloc(sizeof(zend_internal_iterator)); zend_object_std_init(&intern->std, ce); intern->iter = NULL; - intern->rewind_called = 0; + intern->rewind_called = false; return &intern->std; } @@ -537,7 +537,7 @@ static zend_internal_iterator *zend_internal_iterator_fetch(zval *This) { static zend_result zend_internal_iterator_ensure_rewound(zend_internal_iterator *intern) { if (!intern->rewind_called) { zend_object_iterator *iter = intern->iter; - intern->rewind_called = 1; + intern->rewind_called = true; if (iter->funcs->rewind) { iter->funcs->rewind(iter); if (UNEXPECTED(EG(exception))) { @@ -630,7 +630,7 @@ ZEND_METHOD(InternalIterator, rewind) { RETURN_THROWS(); } - intern->rewind_called = 1; + intern->rewind_called = true; if (!intern->iter->funcs->rewind) { /* Allow calling rewind() if no iteration has happened yet, * even if the iterator does not support rewinding. */ diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 22a1d2165774f..7c9753482e510 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2418,7 +2418,7 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has if (!value || (Z_PROP_FLAG_P(value) & IS_PROP_LAZY)) { zobj = zend_lazy_object_init(zobj); if (!zobj) { - result = 0; + result = false; goto exit; } @@ -2436,7 +2436,7 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has } } - result = 0; + result = false; goto exit; } /* }}} */ diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 36df6915db6a7..92e7e5d147474 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -377,7 +377,7 @@ static zend_always_inline zend_result zendi_try_convert_scalar_to_number(zval *o static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval *op, bool *failed) /* {{{ */ { - *failed = 0; + *failed = false; try_again: switch (Z_TYPE_P(op)) { case IS_NULL: @@ -389,7 +389,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * double dval = Z_DVAL_P(op); zend_long lval = zend_dval_to_lval_safe(dval); if (UNEXPECTED(EG(exception))) { - *failed = 1; + *failed = true; } return lval; } @@ -405,7 +405,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * type = is_numeric_string_ex(Z_STRVAL_P(op), Z_STRLEN_P(op), &lval, &dval, /* allow errors */ true, NULL, &trailing_data); if (type == 0) { - *failed = 1; + *failed = true; return 0; } if (UNEXPECTED(trailing_data)) { @@ -414,7 +414,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * } zend_error(E_WARNING, "A non-numeric value encountered"); if (UNEXPECTED(EG(exception))) { - *failed = 1; + *failed = true; zend_tmp_string_release(op_str); return 0; } @@ -435,7 +435,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * if (!zend_is_long_compatible(dval, lval)) { zend_incompatible_string_to_long_error(op_str); if (UNEXPECTED(EG(exception))) { - *failed = 1; + *failed = true; } } zend_string_release(op_str); @@ -447,7 +447,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * zval dst; if (Z_OBJ_HT_P(op)->cast_object(Z_OBJ_P(op), &dst, IS_LONG) == FAILURE || EG(exception)) { - *failed = 1; + *failed = true; return 0; } ZEND_ASSERT(Z_TYPE(dst) == IS_LONG); @@ -455,7 +455,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * } case IS_RESOURCE: case IS_ARRAY: - *failed = 1; + *failed = true; return 0; case IS_REFERENCE: op = Z_REFVAL_P(op); diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 88b905ffeab40..f0a15a2f4f479 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -4535,10 +4535,10 @@ ZEND_API char *zend_gcvt(double value, int ndigit, char dec_point, char exponent if ((decpt >= 0 && decpt > ndigit) || decpt < -3) { /* use E-style */ /* exponential format (e.g. 1.2345e+13) */ if (--decpt < 0) { - sign = 1; + sign = true; decpt = -decpt; } else { - sign = 0; + sign = false; } src = digits; *dst++ = *src++; diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 366e13ce9b6ba..4f3d498a1f1f4 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -524,11 +524,11 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim (i + 1 == len && path[i] == '.')) { /* remove double slashes and '.' */ len = EXPECTED(i > 0) ? i - 1 : 0; - is_dir = 1; + is_dir = true; continue; } else if (i + 2 == len && path[i] == '.' && path[i+1] == '.') { /* remove '..' and previous directory */ - is_dir = 1; + is_dir = true; if (link_is_dir) { *link_is_dir = 1; } From 117060c1d86bbdd28eecf097245ba0c5fb078210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:08:08 +0200 Subject: [PATCH 047/386] date: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/date/php_date.c | 78 ++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 70948c0cbc7ed..f6cd3eb4aecba 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2957,9 +2957,9 @@ static bool date_time_is_internal_property(const zend_string *name) zend_string_equals_literal(name, "timezone_type") || zend_string_equals_literal(name, "timezone") ) { - return 1; + return true; } - return 0; + return false; } static void restore_custom_datetime_properties(zval *object, const HashTable *myht) @@ -3223,7 +3223,7 @@ static bool php_date_modify(zval *object, char *modify, size_t modify_len) /* {{ if (!(dateobj->time)) { date_throw_uninitialized_error(Z_OBJCE_P(object)); - return 0; + return false; } tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); @@ -3238,7 +3238,7 @@ static bool php_date_modify(zval *object, char *modify, size_t modify_len) /* {{ err->error_messages[0].character ? err->error_messages[0].character : ' ', err->error_messages[0].message); timelib_time_dtor(tmp_time); - return 0; + return false; } memcpy(&dateobj->time->relative, &tmp_time->relative, sizeof(timelib_rel_time)); @@ -3291,7 +3291,7 @@ static bool php_date_modify(zval *object, char *modify, size_t modify_len) /* {{ dateobj->time->have_relative = 0; memset(&dateobj->time->relative, 0, sizeof(dateobj->time->relative)); - return 1; + return true; } /* }}} */ /* {{{ Alters the timestamp. */ @@ -4139,9 +4139,9 @@ static bool date_timezone_is_internal_property(const zend_string *name) zend_string_equals_literal(name, "timezone_type") || zend_string_equals_literal(name, "timezone") ) { - return 1; + return true; } - return 0; + return false; } static void restore_custom_datetimezone_properties(zval *object, const HashTable *myht) @@ -4773,9 +4773,9 @@ static bool date_interval_is_internal_property(const zend_string *name) zend_string_equals_literal(name, "invert") || zend_string_equals_literal(name, "days") ) { - return 1; + return true; } - return 0; + return false; } static void restore_custom_dateinterval_properties(zval *object, const HashTable *myht) @@ -5290,18 +5290,18 @@ PHP_METHOD(DatePeriod, getIterator) static bool check_id_allowed(const char *id, zend_long what) /* {{{ */ { - if ((what & PHP_DATE_TIMEZONE_GROUP_AFRICA) && strncasecmp(id, "Africa/", 7) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_AMERICA) && strncasecmp(id, "America/", 8) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA) && strncasecmp(id, "Antarctica/", 11) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_ARCTIC) && strncasecmp(id, "Arctic/", 7) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_ASIA) && strncasecmp(id, "Asia/", 5) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC) && strncasecmp(id, "Atlantic/", 9) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA) && strncasecmp(id, "Australia/", 10) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_EUROPE) && strncasecmp(id, "Europe/", 7) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_INDIAN) && strncasecmp(id, "Indian/", 7) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_PACIFIC) && strncasecmp(id, "Pacific/", 8) == 0) return 1; - if ((what & PHP_DATE_TIMEZONE_GROUP_UTC) && strncasecmp(id, "UTC", 3) == 0) return 1; - return 0; + if ((what & PHP_DATE_TIMEZONE_GROUP_AFRICA) && strncasecmp(id, "Africa/", 7) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_AMERICA) && strncasecmp(id, "America/", 8) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA) && strncasecmp(id, "Antarctica/", 11) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_ARCTIC) && strncasecmp(id, "Arctic/", 7) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_ASIA) && strncasecmp(id, "Asia/", 5) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC) && strncasecmp(id, "Atlantic/", 9) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA) && strncasecmp(id, "Australia/", 10) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_EUROPE) && strncasecmp(id, "Europe/", 7) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_INDIAN) && strncasecmp(id, "Indian/", 7) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_PACIFIC) && strncasecmp(id, "Pacific/", 8) == 0) return true; + if ((what & PHP_DATE_TIMEZONE_GROUP_UTC) && strncasecmp(id, "UTC", 3) == 0) return true; + return false; } /* }}} */ /* {{{ Returns numerically index array with all timezone identifiers. */ @@ -5708,7 +5708,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con date_obj = Z_PHPDATE_P(ht_entry); if (!date_obj->time) { - return 0; + return false; } if (period_obj->start != NULL) { @@ -5717,10 +5717,10 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con period_obj->start = timelib_time_clone(date_obj->time); period_obj->start_ce = Z_OBJCE_P(ht_entry); } else if (Z_TYPE_P(ht_entry) != IS_NULL) { - return 0; + return false; } } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "end", sizeof("end")-1); @@ -5730,7 +5730,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con date_obj = Z_PHPDATE_P(ht_entry); if (!date_obj->time) { - return 0; + return false; } if (period_obj->end != NULL) { @@ -5738,10 +5738,10 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con } period_obj->end = timelib_time_clone(date_obj->time); } else if (Z_TYPE_P(ht_entry) != IS_NULL) { - return 0; + return false; } } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "current", sizeof("current")-1); @@ -5751,7 +5751,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con date_obj = Z_PHPDATE_P(ht_entry); if (!date_obj->time) { - return 0; + return false; } if (period_obj->current != NULL) { @@ -5759,10 +5759,10 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con } period_obj->current = timelib_time_clone(date_obj->time); } else if (Z_TYPE_P(ht_entry) != IS_NULL) { - return 0; + return false; } } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "interval", sizeof("interval")-1); @@ -5772,7 +5772,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con interval_obj = Z_PHPINTERVAL_P(ht_entry); if (!interval_obj->initialized) { - return 0; + return false; } if (period_obj->interval != NULL) { @@ -5780,10 +5780,10 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con } period_obj->interval = timelib_rel_time_clone(interval_obj->diff); } else { /* interval is required */ - return 0; + return false; } } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "recurrences", sizeof("recurrences")-1); @@ -5791,7 +5791,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con Z_TYPE_P(ht_entry) == IS_LONG && Z_LVAL_P(ht_entry) >= 0 && Z_LVAL_P(ht_entry) <= INT_MAX) { period_obj->recurrences = Z_LVAL_P(ht_entry); } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "include_start_date", sizeof("include_start_date")-1); @@ -5799,7 +5799,7 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con (Z_TYPE_P(ht_entry) == IS_FALSE || Z_TYPE_P(ht_entry) == IS_TRUE)) { period_obj->include_start_date = (Z_TYPE_P(ht_entry) == IS_TRUE); } else { - return 0; + return false; } ht_entry = zend_hash_str_find(myht, "include_end_date", sizeof("include_end_date")-1); @@ -5807,12 +5807,12 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, con (Z_TYPE_P(ht_entry) == IS_FALSE || Z_TYPE_P(ht_entry) == IS_TRUE)) { period_obj->include_end_date = (Z_TYPE_P(ht_entry) == IS_TRUE); } else { - return 0; + return false; } period_obj->initialized = true; - return 1; + return true; } /* }}} */ /* {{{ */ @@ -5869,9 +5869,9 @@ static bool date_period_is_internal_property(const zend_string *name) zend_string_equals_literal(name, "include_start_date") || zend_string_equals_literal(name, "include_end_date") ) { - return 1; + return true; } - return 0; + return false; } /* }}} */ From 63cb31825128b1fed4c2a531dd60cd69cc0f4f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:08:24 +0200 Subject: [PATCH 048/386] exif: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/exif/exif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index d0ca7a6819bd9..9dcca2e81e0b8 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2104,7 +2104,7 @@ static inline char *exif_offset_info_try_get( static inline bool exif_offset_info_contains( const exif_offset_info *info, const char *start, size_t length) { if (ptr_offset_overflows(start, length)) { - return 0; + return false; } /* start and valid_start are both inclusive, end and valid_end are both exclusive, From 2727de725d7d3695a38ee4714255812bd1ef9010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:08:46 +0200 Subject: [PATCH 049/386] filter: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/filter/logical_filters.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 2dec236114182..20760e656e763 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -788,7 +788,7 @@ static bool _php_filter_validate_ipv6(const char *str, size_t str_len, int ip[8] const char *s = str; if (!memchr(str, ':', str_len)) { - return 0; + return false; } /* check for bundled IPv4 */ @@ -799,12 +799,12 @@ static bool _php_filter_validate_ipv6(const char *str, size_t str_len, int ip[8] } if (!_php_filter_validate_ipv4(ipv4, (str_len - (ipv4 - str)), ip4elm)) { - return 0; + return false; } str_len = ipv4 - str; /* length excluding ipv4 */ if (str_len < 2) { - return 0; + return false; } if (ipv4[-2] != ':') { From aa90372428fa28e37b43d860966de1eab5a5c695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:08:51 +0200 Subject: [PATCH 050/386] ftp: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/ftp/ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 2c777e777a66e..f9c61748efdda 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1193,7 +1193,7 @@ static bool ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const size_t cmd_len, con return false; } if (strpbrk(args, "\r\n")) { - return 0; + return false; } size = slprintf(data, sizeof(data), "%s %s\r\n", cmd, args); } else { From 017ae20d7054c450a2591d3ed0493c6feb7d436f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:08:57 +0200 Subject: [PATCH 051/386] intl: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/intl/converter/converter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 7ac4bdf00867d..465700e961800 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -141,9 +141,9 @@ PHP_METHOD(UConverter, fromUCallback) { static inline bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) { if (available < needed) { php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun " ZEND_LONG_FMT " bytes needed, " ZEND_LONG_FMT " available", needed, available); - return 0; + return false; } - return 1; + return true; } /* }}} */ @@ -336,7 +336,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo /* Short-circuit having to go through method calls and data marshalling * when we're using default behavior */ - return 1; + return true; } ucnv_setToUCallBack(cnv, (UConverterToUCallback)php_converter_to_u_callback, (const void*)objval, From b7c4331e9ba3abecbed71ff486d46f540dba1ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:02 +0200 Subject: [PATCH 052/386] mysqlnd: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/mysqlnd/mysqlnd_ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 5fad5281947ea..76a2eb640d1de 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -58,7 +58,7 @@ static bool mysqlnd_stmt_check_state(const MYSQLND_STMT_DATA *stmt) { const MYSQLND_CONN_DATA *conn = stmt->conn; if (stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE) { - return 0; + return false; } if (stmt->cursor_exists) { return GET_CONNECTION_STATE(&conn->state) == CONN_READY; From 65bd151bb766a3a13f8a27b89798427ae88b7355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:12 +0200 Subject: [PATCH 053/386] opcache: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/opcache/jit/zend_jit_helpers.c | 2 +- ext/opcache/jit/zend_jit_internal.h | 4 +- ext/opcache/jit/zend_jit_ir.c | 92 ++++++++++++------------ ext/opcache/jit/zend_jit_trace.c | 56 +++++++-------- ext/opcache/jit/zend_jit_vm_helpers.c | 14 ++-- ext/opcache/zend_accelerator_blacklist.c | 2 +- ext/opcache/zend_accelerator_hash.h | 4 +- 7 files changed, 87 insertions(+), 87 deletions(-) diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 787eb4d07a8b6..07f1b61c6b520 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1979,7 +1979,7 @@ static bool ZEND_FASTCALL zend_jit_verify_arg_slow(zval *arg, zend_arg_info *arg &arg_info->type, arg, /* ref */ NULL, /* is_return_type */ false); if (UNEXPECTED(!ret)) { zend_verify_arg_error(EX(func), arg_info, opline->op1.num, arg); - return 0; + return false; } return ret; } diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 8efbfee79e938..22bab1ddd7ffd 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -119,13 +119,13 @@ typedef uintptr_t zend_jit_addr; static zend_always_inline bool zend_jit_same_addr(zend_jit_addr addr1, zend_jit_addr addr2) { if (addr1 == addr2) { - return 1; + return true; } else if (Z_MODE(addr1) == IS_REG && Z_MODE(addr2) == IS_REG) { return Z_SSA_VAR(addr1) == Z_SSA_VAR(addr2); } else if (Z_MODE(addr1) == IS_REF_ZVAL && Z_MODE(addr2) == IS_REF_ZVAL) { return Z_IR_REF(addr1) == Z_IR_REF(addr2); } - return 0; + return false; } typedef struct _zend_jit_op_array_extension { diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 7ff9aae0249fb..ac306d0cd4c79 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -424,7 +424,7 @@ static bool zend_jit_set_veneer(ir_ctx *ctx, const void *addr, const void *venee uint32_t exit_point = zend_jit_exit_point_by_addr(addr); if (exit_point != (uint32_t)-1) { - return 1; + return true; } for (i = 0; i < count; i++) { if (zend_jit_stub_handlers[i] == addr) { @@ -449,11 +449,11 @@ static bool zend_jit_set_veneer(ir_ctx *ctx, const void *addr, const void *venee } } #endif - return 1; + return true; } } - return 0; + return false; } static void zend_jit_commit_veneers(void) @@ -472,7 +472,7 @@ static void zend_jit_commit_veneers(void) static bool zend_jit_prefer_const_addr_load(zend_jit_ctx *jit, uintptr_t addr) { #if defined(IR_TARGET_X86) - return 0; /* always use immediate value */ + return false; /* always use immediate value */ #elif defined(IR_TARGET_X64) return addr > 0xffffffff; /* prefer loading long constant from memery */ #elif defined(IR_TARGET_AARCH64) @@ -1309,7 +1309,7 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_ { if (jit->ctx.ir_base[val].op == IR_RLOAD) { /* Deoptimization */ - return 0; + return false; } // if (jit->ctx.ir_base[val].op == IR_LOAD // && jit->ctx.ir_base[jit->ctx.ir_base[val].op2].op == IR_ADD @@ -1331,7 +1331,7 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_ && jit->ctx.ir_base[jit->ctx.ir_base[jit->ctx.ir_base[val].op2].op2].val.addr != (uintptr_t)EX_NUM_TO_VAR(jit->ssa->vars[var].var) && EX_VAR_TO_NUM(jit->ctx.ir_base[jit->ctx.ir_base[jit->ctx.ir_base[val].op2].op2].val.addr) < jit->current_op_array->last_var) { /* binding between different CVs may cause spill conflict */ - return 1; + return true; } else if (jit->ssa->vars[var].definition >= 0 && jit->ssa->ops[jit->ssa->vars[var].definition].op1_def == var && jit->ssa->ops[jit->ssa->vars[var].definition].op1_use >= 0 @@ -1339,18 +1339,18 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_ && jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi && (jit->ssa->cfg.blocks[jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi->block].flags & ZEND_BB_LOOP_HEADER)) { /* Avoid moving spill store out of loop */ - return 1; + return true; } else if (jit->ssa->vars[var].definition >= 0 && jit->ssa->ops[jit->ssa->vars[var].definition].op1_def == var && jit->ssa->ops[jit->ssa->vars[var].definition].op1_use >= 0 && jit->ssa->ops[jit->ssa->vars[var].definition].op2_use >= 0 && jit->ra[jit->ssa->ops[jit->ssa->vars[var].definition].op2_use].ref == val) { /* Avoid spill conflict between of ASSIGN.op1_def and ASSIGN.op1_use */ - return 1; + return true; } - return 0; + return false; } - return 1; + return true; } static void zend_jit_def_reg(zend_jit_ctx *jit, zend_jit_addr addr, ir_ref val) @@ -10993,7 +10993,7 @@ static bool zend_jit_verify_return_type(zend_jit_ctx *jit, const zend_op *opline } } - return 1; + return true; } static int zend_jit_leave_frame(zend_jit_ctx *jit) @@ -16895,11 +16895,11 @@ static bool zend_jit_noref_guard(zend_jit_ctx *jit, const zend_op *opline, zend_ const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point); if (!exit_addr) { - return 0; + return false; } ir_GUARD(ir_NE(jit_Z_TYPE(jit, var_addr), ir_CONST_U8(IS_REFERENCE)), ir_CONST_ADDR(exit_addr)); - return 1; + return true; } static int zend_jit_trace_opline_guard(zend_jit_ctx *jit, const zend_op *opline) @@ -16932,7 +16932,7 @@ static bool zend_jit_guard_reference(zend_jit_ctx *jit, exit_addr = zend_jit_trace_get_exit_addr(exit_point); if (!exit_addr) { - return 0; + return false; } ref = jit_Z_TYPE(jit, var_addr); @@ -16945,7 +16945,7 @@ static bool zend_jit_guard_reference(zend_jit_ctx *jit, var_addr = ZEND_ADDR_REF_ZVAL(ref); *var_addr_ptr = var_addr; - return 1; + return true; } static bool zend_jit_fetch_reference(zend_jit_ctx *jit, @@ -16966,7 +16966,7 @@ static bool zend_jit_fetch_reference(zend_jit_ctx *jit, exit_addr = zend_jit_trace_get_exit_addr(exit_point); if (!exit_addr) { - return 0; + return false; } } @@ -17011,7 +17011,7 @@ static bool zend_jit_fetch_reference(zend_jit_ctx *jit, } *var_info_ptr |= MAY_BE_GUARD; /* prevent generation of specialized zval dtor */ - return 1; + return true; } static bool zend_jit_fetch_indirect_var(zend_jit_ctx *jit, const zend_op *opline, uint8_t var_type, uint32_t *var_info_ptr, zend_jit_addr *var_addr_ptr, bool add_indirect_guard) @@ -17027,7 +17027,7 @@ static bool zend_jit_fetch_indirect_var(zend_jit_ctx *jit, const zend_op *opline const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point); if (!exit_addr) { - return 0; + return false; } jit_guard_Z_TYPE(jit, var_addr, IS_INDIRECT, exit_addr); ref = jit_Z_PTR(jit, var_addr); @@ -17050,7 +17050,7 @@ static bool zend_jit_fetch_indirect_var(zend_jit_ctx *jit, const zend_op *opline exit_addr = zend_jit_trace_get_exit_addr(exit_point); if (!exit_addr) { - return 0; + return false; } jit_guard_Z_TYPE(jit, var_addr, var_type, exit_addr); @@ -17068,7 +17068,7 @@ static bool zend_jit_fetch_indirect_var(zend_jit_ctx *jit, const zend_op *opline *var_info_ptr = var_info; } - return 1; + return true; } static int zend_jit_trace_handler(zend_jit_ctx *jit, const zend_op_array *op_array, const zend_op *opline, int may_throw, zend_jit_trace_rec *trace) @@ -17445,14 +17445,14 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa case ZEND_IS_IDENTICAL: case ZEND_IS_NOT_IDENTICAL: case ZEND_CASE: - return 1; + return true; case ZEND_RETURN: return (op_array->type != ZEND_EVAL_CODE && op_array->function_name); case ZEND_ASSIGN: return (opline->op1_type == IS_CV); case ZEND_ASSIGN_OP: if (opline->op1_type != IS_CV || opline->result_type != IS_UNUSED) { - return 0; + return false; } op1_info = OP1_INFO(); op2_info = OP2_INFO(); @@ -17463,7 +17463,7 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa op1_info = OP1_INFO(); op2_info = OP2_INFO(); if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) { - return 0; + return false; } if (trace && trace->op1_type != IS_UNKNOWN) { op1_info &= 1U << (trace->op1_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED)); @@ -17511,11 +17511,11 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa case ZEND_JMPNZ: if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE) { if (!ssa->cfg.map) { - return 0; + return false; } if (opline > op_array->opcodes + ssa->cfg.blocks[ssa->cfg.map[opline-op_array->opcodes]].start && ((opline-1)->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { - return 0; + return false; } } ZEND_FALLTHROUGH; @@ -17523,12 +17523,12 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa case ZEND_BOOL_NOT: case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: - return 1; + return true; case ZEND_FETCH_CONSTANT: - return 1; + return true; case ZEND_ISSET_ISEMPTY_DIM_OBJ: if ((opline->extended_value & ZEND_ISEMPTY)) { - return 0; + return false; } ZEND_FALLTHROUGH; case ZEND_FETCH_DIM_R: @@ -17546,10 +17546,10 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa ((op2_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_STRING)); case ZEND_ASSIGN_DIM_OP: if (opline->result_type != IS_UNUSED) { - return 0; + return false; } if (!zend_jit_supported_binary_op(opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { - return 0; + return false; } ZEND_FALLTHROUGH; case ZEND_ASSIGN_DIM: @@ -17565,13 +17565,13 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa && (opline+1)->op1_type == IS_CV && (opline+1)->op1.var == opline->op1.var) { /* skip $a[x] = $a; */ - return 0; + return false; } } else if (opline->op1_type == IS_VAR) { if (trace->op1_type == IS_UNKNOWN || !(trace->op1_type & IS_TRACE_INDIRECT) || opline->result_type != IS_UNUSED) { - return 0; + return false; } } if (trace->op1_type != IS_UNKNOWN @@ -17580,7 +17580,7 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa } } else { if (opline->op1_type != IS_CV) { - return 0; + return false; } } return ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) && @@ -17588,10 +17588,10 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa ((op2_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_STRING)); case ZEND_ASSIGN_OBJ_OP: if (opline->result_type != IS_UNUSED) { - return 0; + return false; } if (!zend_jit_supported_binary_op(opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { - return 0; + return false; } ZEND_FALLTHROUGH; case ZEND_FETCH_OBJ_R: @@ -17599,19 +17599,19 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa if (opline->op2_type != IS_CONST || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { - return 0; + return false; } op1_info = OP1_INFO(); return opline->op1_type == IS_UNUSED || (op1_info & MAY_BE_OBJECT); } - return 0; + return false; } static bool zend_jit_var_supports_reg(zend_ssa *ssa, int var) { if (ssa->vars[var].no_val) { /* we don't need the value */ - return 0; + return false; } if (!(JIT_G(opt_flags) & ZEND_JIT_REG_ALLOC_GLOBAL)) { @@ -17619,13 +17619,13 @@ static bool zend_jit_var_supports_reg(zend_ssa *ssa, int var) * register allocation for SSA variables connected through Phi functions */ if (ssa->vars[var].definition_phi) { - return 0; + return false; } if (ssa->vars[var].phi_use_chain) { zend_ssa_phi *phi = ssa->vars[var].phi_use_chain; do { if (!ssa->vars[phi->ssa_var].no_val) { - return 0; + return false; } phi = zend_ssa_next_use_phi(ssa, var, phi); } while (phi); @@ -17635,22 +17635,22 @@ static bool zend_jit_var_supports_reg(zend_ssa *ssa, int var) if (((ssa->var_info[var].type & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) != MAY_BE_DOUBLE) && ((ssa->var_info[var].type & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) != MAY_BE_LONG)) { /* bad type */ - return 0; + return false; } - return 1; + return true; } static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, int var) { if (!zend_jit_var_supports_reg(ssa, var)) { - return 0; + return false; } if (ssa->vars[var].definition >= 0) { uint32_t def = ssa->vars[var].definition; if (!zend_jit_opline_supports_reg(op_array, ssa, op_array->opcodes + def, ssa->ops + def, NULL)) { - return 0; + return false; } } @@ -17660,7 +17660,7 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, do { if (!zend_ssa_is_no_val_use(op_array->opcodes + use, ssa->ops + use, var) && !zend_jit_opline_supports_reg(op_array, ssa, op_array->opcodes + use, ssa->ops + use, NULL)) { - return 0; + return false; } use = zend_ssa_next_use(ssa->ops, var, use); } while (use >= 0); @@ -17732,7 +17732,7 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, return ret; } - return 1; + return true; } static ir_ref jit_frameless_observer(zend_jit_ctx *jit, const zend_op *opline) { diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 464997cf91582..1abb05d9e4178 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -507,7 +507,7 @@ static bool zend_jit_needs_arg_dtor(const zend_function *func, uint32_t arg_num, if (type != IS_UNKNOWN && type < IS_STRING && ZEND_TYPE_FULL_MASK(arg_info->type) & (1u << type)) { - return 0; + return false; } } if (call_info && arg_num < call_info->num_args && call_info->arg_info[arg_num].opline) { @@ -522,7 +522,7 @@ static bool zend_jit_needs_arg_dtor(const zend_function *func, uint32_t arg_num, // TODO: few functions (e.g. pcntl_exec) modify arrays in-place ??? if (type != IS_ARRAY && (ZEND_TYPE_FULL_MASK(arg_info->type) & (1u << type))) { - return 0; + return false; } } } @@ -530,7 +530,7 @@ static bool zend_jit_needs_arg_dtor(const zend_function *func, uint32_t arg_num, } } - return 1; + return true; } static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_script *script) @@ -817,7 +817,7 @@ static bool zend_jit_trace_is_false_loop(const zend_op_array *op_array, const ze bb = ssa->cfg.blocks + ssa->cfg.map[opline - op_array->opcodes]; return bb->loop_header != b; } else { - return 0; + return false; } } @@ -3440,7 +3440,7 @@ static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ss || ssa->vars[var].phi_use_chain || ssa->ops[use].op1_use != var || ssa->ops[use].op1_use_chain != -1) { - return 0; + return false; } opline = ssa_opcodes[use]; @@ -3452,7 +3452,7 @@ static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ss || !JIT_G(current_frame)->call || !JIT_G(current_frame)->call->func || !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) { - return 0; + return false; } } else if (opline->opcode != ZEND_FETCH_OBJ_R && opline->opcode != ZEND_FETCH_OBJ_IS @@ -3463,13 +3463,13 @@ static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ss && opline->opcode != ZEND_PRE_DEC_OBJ && opline->opcode != ZEND_POST_INC_OBJ && opline->opcode != ZEND_POST_DEC_OBJ) { - return 0; + return false; } if (opline->op2_type != IS_CONST || Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) != IS_STRING || Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') { - return 0; + return false; } if (opline->opcode == ZEND_ASSIGN_OBJ_OP) { @@ -3477,11 +3477,11 @@ static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ss && (opline+1)->op1_type == IS_CV && (opline+1)->op1.var == opline->op1.var) { /* skip $a->prop += $a; */ - return 0; + return false; } if (!zend_jit_supported_binary_op( opline->extended_value, MAY_BE_ANY, OP1_DATA_INFO())) { - return 0; + return false; } } @@ -3490,11 +3490,11 @@ static bool zend_jit_may_delay_fetch_this(const zend_op_array *op_array, zend_ss || ssa_opcodes[i]->opcode == ZEND_DO_FCALL_BY_NAME || ssa_opcodes[i]->opcode == ZEND_DO_FCALL || ssa_opcodes[i]->opcode == ZEND_INCLUDE_OR_EVAL) { - return 0; + return false; } } - return 1; + return true; } static int zend_jit_trace_stack_needs_deoptimization(zend_jit_trace_stack *stack, uint32_t stack_size) @@ -3904,19 +3904,19 @@ static bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_o || prev_opcode == ZEND_CASE_STRICT) { if (ssa_op->op1_use < 0) { if (RT_CONSTANT(opline, opline->op1) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->ops]->op1)) { - return 0; + return false; } } if (ssa_op->op2_use < 0) { if (RT_CONSTANT(opline, opline->op2) != RT_CONSTANT(&ssa_opcodes[prev_ssa_op - ssa->ops], ssa_opcodes[prev_ssa_op - ssa->ops]->op2)) { - return 0; + return false; } } - return 1; + return true; } } } - return 0; + return false; } static bool zend_jit_trace_next_is_send_result(const zend_op *opline, @@ -3943,9 +3943,9 @@ static bool zend_jit_trace_next_is_send_result(const zend_op *oplin zend_jit_trace_send_type(opline+1, frame->call, res_type); } } - return 1; + return true; } - return 0; + return false; } static int zend_jit_find_ssa_var(const zend_op_array *op_array, @@ -4061,11 +4061,11 @@ static bool zend_jit_trace_must_store_type(const zend_op_array *op_array, if (ssa_var >= 0) { if ((ssa->var_info[ssa_var].type & (MAY_BE_ANY|MAY_BE_UNDEF)) != (1U << type)) { - return 0; + return false; } } } - return 1; + return true; } static bool zend_jit_trace_may_throw(const zend_op *opline, @@ -4086,7 +4086,7 @@ static bool zend_jit_trace_may_throw(const zend_op *opline, && !(t1 & MAY_BE_ARRAY_OF_REF) && (t2 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_LONG && (t3 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_LONG) { - return 0; + return false; } break; default: @@ -7774,7 +7774,7 @@ static bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_sto if (cache_opline[i] == opline) { if (cache_count[i] >= JIT_G(blacklist_root_trace) - 1) { cache_opline[i] = NULL; - return 1; + return true; } else { #if 0 if (ZEND_OP_TRACE_INFO(opline, offset)->counter) { @@ -7784,7 +7784,7 @@ static bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_sto #endif cache_count[i]++; cache_stop[i] = stop; - return 0; + return false; } } } @@ -7794,7 +7794,7 @@ static bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_sto cache_stop[i] = stop; cache_slot = (i + 1) % ZEND_JIT_TRACE_BAD_ROOT_SLOTS; JIT_G(bad_root_slot) = cache_slot; - return 0; + return false; } static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa) @@ -8307,10 +8307,10 @@ static bool zend_jit_trace_exit_is_bad(uint32_t trace_num, uint32_t exit_num) zend_jit_traces[trace_num].exit_counters + exit_num; if (*counter + 1 >= JIT_G(hot_side_exit) + JIT_G(blacklist_side_trace)) { - return 1; + return true; } (*counter)++; - return 0; + return false; } static bool zend_jit_trace_exit_is_hot(uint32_t trace_num, uint32_t exit_num) @@ -8319,10 +8319,10 @@ static bool zend_jit_trace_exit_is_hot(uint32_t trace_num, uint32_t exit_num) zend_jit_traces[trace_num].exit_counters + exit_num; if (*counter + 1 >= JIT_G(hot_side_exit)) { - return 1; + return true; } (*counter)++; - return 0; + return false; } static zend_jit_trace_stop zend_jit_compile_side_trace(zend_jit_trace_rec *trace_buffer, uint32_t parent_num, uint32_t exit_num, uint32_t polymorphism) diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index cb896c0cd8c6f..bed5ab59992ed 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -255,9 +255,9 @@ bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D) } zend_vm_stack_free_call_frame(call); - return 0; + return false; } - return 1; + return true; } bool ZEND_FASTCALL zend_jit_nodiscard_helper(OPLINE_D) @@ -283,9 +283,9 @@ bool ZEND_FASTCALL zend_jit_nodiscard_helper(OPLINE_D) } zend_vm_stack_free_call_frame(call); - return 0; + return false; } - return 1; + return true; } bool ZEND_FASTCALL zend_jit_deprecated_nodiscard_helper(OPLINE_D) @@ -295,17 +295,17 @@ bool ZEND_FASTCALL zend_jit_deprecated_nodiscard_helper(OPLINE_D) if (fbc->common.fn_flags & ZEND_ACC_DEPRECATED) { if (zend_jit_deprecated_helper(OPLINE_C) == 0) { - return 0; + return false; } } if (fbc->common.fn_flags & ZEND_ACC_NODISCARD) { if (zend_jit_nodiscard_helper(OPLINE_C) == 0) { - return 0; + return false; } } - return 1; + return true; } void ZEND_FASTCALL zend_jit_undefined_long_key(EXECUTE_DATA_D) diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index b7ffb164cdd2b..4c0e2f6c5a185 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -343,7 +343,7 @@ bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify pcre2_match_context *mctx = php_pcre_mctx(); if (regexp_list_it == NULL) { - return 0; + return false; } while (regexp_list_it != NULL) { pcre2_match_data *match_data = php_pcre_create_match_data(0, regexp_list_it->re); diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 755d3f13ec516..6aa6ba7b80199 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -86,9 +86,9 @@ int zend_accel_hash_unlink( static inline bool zend_accel_hash_is_full(zend_accel_hash *accel_hash) { if (accel_hash->num_entries == accel_hash->max_num_entries) { - return 1; + return true; } else { - return 0; + return false; } } From dbdc68b662cb97b0af94889c112067e5c0e3c658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:18 +0200 Subject: [PATCH 054/386] openssl: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/openssl/openssl_backend_v1.c | 24 ++++++++++++------------ ext/openssl/xp_ssl.c | 26 +++++++++++++------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ext/openssl/openssl_backend_v1.c b/ext/openssl/openssl_backend_v1.c index e95f51905f697..956f07e1a1e03 100644 --- a/ext/openssl/openssl_backend_v1.c +++ b/ext/openssl/openssl_backend_v1.c @@ -88,23 +88,23 @@ static bool php_openssl_pkey_init_rsa_data(RSA *rsa, zval *data) OPENSSL_PKEY_SET_BN(data, e); OPENSSL_PKEY_SET_BN(data, d); if (!n || !d || !RSA_set0_key(rsa, n, e, d)) { - return 0; + return false; } OPENSSL_PKEY_SET_BN(data, p); OPENSSL_PKEY_SET_BN(data, q); if ((p || q) && !RSA_set0_factors(rsa, p, q)) { - return 0; + return false; } OPENSSL_PKEY_SET_BN(data, dmp1); OPENSSL_PKEY_SET_BN(data, dmq1); OPENSSL_PKEY_SET_BN(data, iqmp); if ((dmp1 || dmq1 || iqmp) && !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) { - return 0; + return false; } - return 1; + return true; } EVP_PKEY *php_openssl_pkey_init_rsa(zval *data) @@ -141,7 +141,7 @@ static bool php_openssl_pkey_init_dsa_data(DSA *dsa, zval *data, bool *is_privat OPENSSL_PKEY_SET_BN(data, q); OPENSSL_PKEY_SET_BN(data, g); if (!p || !q || !g || !DSA_set0_pqg(dsa, p, q, g)) { - return 0; + return false; } OPENSSL_PKEY_SET_BN(data, pub_key); @@ -154,18 +154,18 @@ static bool php_openssl_pkey_init_dsa_data(DSA *dsa, zval *data, bool *is_privat /* generate key */ if (!DSA_generate_key(dsa)) { php_openssl_store_errors(); - return 0; + return false; } /* if BN_mod_exp return -1, then DSA_generate_key succeed for failed key * so we need to double check that public key is created */ DSA_get0_key(dsa, &pub_key_const, &priv_key_const); if (!pub_key_const || BN_is_zero(pub_key_const)) { - return 0; + return false; } /* all good */ *is_private = true; - return 1; + return true; } EVP_PKEY *php_openssl_pkey_init_dsa(zval *data, bool *is_private) @@ -202,7 +202,7 @@ static bool php_openssl_pkey_init_dh_data(DH *dh, zval *data, bool *is_private) OPENSSL_PKEY_SET_BN(data, q); OPENSSL_PKEY_SET_BN(data, g); if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { - return 0; + return false; } OPENSSL_PKEY_SET_BN(data, priv_key); @@ -214,7 +214,7 @@ static bool php_openssl_pkey_init_dh_data(DH *dh, zval *data, bool *is_private) if (priv_key) { pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); if (pub_key == NULL) { - return 0; + return false; } return DH_set0_key(dh, pub_key, priv_key); } @@ -222,11 +222,11 @@ static bool php_openssl_pkey_init_dh_data(DH *dh, zval *data, bool *is_private) /* generate key */ if (!DH_generate_key(dh)) { php_openssl_store_errors(); - return 0; + return false; } /* all good */ *is_private = true; - return 1; + return true; } EVP_PKEY *php_openssl_pkey_init_dh(zval *data, bool *is_private) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index d1ece1d5e0eec..927afeb27891c 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -391,26 +391,26 @@ static bool php_openssl_x509_fingerprint_match(X509 *peer, zval *val) if (!zend_hash_num_elements(Z_ARRVAL_P(val))) { php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required"); - return 0; + return false; } ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), key, current) { if (key == NULL || Z_TYPE_P(current) != IS_STRING) { php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required"); - return 0; + return false; } if (php_openssl_x509_fingerprint_cmp(peer, ZSTR_VAL(key), Z_STRVAL_P(current)) != 0) { - return 0; + return false; } } ZEND_HASH_FOREACH_END(); - return 1; + return true; } else { php_error_docref(NULL, E_WARNING, "Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required"); } - return 0; + return false; } static bool php_openssl_matches_wildcard_name(const char *subjectname, const char *certname) /* {{{ */ @@ -420,18 +420,18 @@ static bool php_openssl_matches_wildcard_name(const char *subjectname, const cha size_t suffix_len, subject_len; if (strcasecmp(subjectname, certname) == 0) { - return 1; + return true; } /* wildcard, if present, must only be present in the left-most component */ if (!(wildcard = strchr(certname, '*')) || memchr(certname, '.', wildcard - certname)) { - return 0; + return false; } /* 1) prefix, if not empty, must match subject */ prefix_len = wildcard - certname; if (prefix_len && strncasecmp(subjectname, certname, prefix_len) != 0) { - return 0; + return false; } suffix_len = strlen(wildcard + 1); @@ -444,7 +444,7 @@ static bool php_openssl_matches_wildcard_name(const char *subjectname, const cha memchr(subjectname + prefix_len, '.', subject_len - suffix_len - prefix_len) == NULL; } - return 0; + return false; } /* }}} */ @@ -491,7 +491,7 @@ static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) / OPENSSL_free(cert_name); sk_GENERAL_NAME_pop_free(alt_names, GENERAL_NAME_free); - return 1; + return true; } OPENSSL_free(cert_name); } else if (san->type == GEN_IPADD) { @@ -505,7 +505,7 @@ static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) / if (strcasecmp(subject_name, (const char*)ipbuffer) == 0) { sk_GENERAL_NAME_pop_free(alt_names, GENERAL_NAME_free); - return 1; + return true; } } #ifdef HAVE_IPV6_SAN @@ -515,7 +515,7 @@ static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) / if (strcasecmp((const char*)subject_name_ipv6_expanded, (const char*)ipbuffer) == 0) { sk_GENERAL_NAME_pop_free(alt_names, GENERAL_NAME_free); - return 1; + return true; } } #endif @@ -524,7 +524,7 @@ static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) / sk_GENERAL_NAME_pop_free(alt_names, GENERAL_NAME_free); - return 0; + return false; } /* }}} */ From 09add9a0a3c59b68d3615ce101e2f287a3c5cd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:25 +0200 Subject: [PATCH 055/386] pcre: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/pcre/php_pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 8a0a54dd7016c..b59bd87f92385 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1132,12 +1132,12 @@ static zend_always_inline bool is_known_valid_utf8( zend_string *subject_str, PCRE2_SIZE start_offset) { if (!ZSTR_IS_VALID_UTF8(subject_str)) { /* We don't know whether the string is valid UTF-8 or not. */ - return 0; + return false; } if (start_offset == ZSTR_LEN(subject_str)) { /* Degenerate case: Offset points to end of string. */ - return 1; + return true; } /* Check that the offset does not point to an UTF-8 continuation byte. */ From 2ebfdac162852dbb4575b60e0ad0b3c91f8dde30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:31 +0200 Subject: [PATCH 056/386] pdo: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/pdo/pdo_stmt.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 8b7d618676bca..e2723c703f0ac 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -55,17 +55,17 @@ static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_p if (stmt->named_rewrite_template) { /* this is not an error here */ - return 1; + return true; } if (!param->name) { /* do the reverse; map the parameter number to the name */ if ((name = zend_hash_index_find_ptr(stmt->bound_param_map, param->paramno)) != NULL) { param->name = zend_string_copy(name); - return 1; + return true; } /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); - return 0; + return false; } ZEND_HASH_FOREACH_PTR(stmt->bound_param_map, name) { @@ -79,13 +79,13 @@ static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_p return -1; } param->paramno = position; - return 1; + return true; } ZEND_HASH_FOREACH_END(); /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); - return 0; + return false; } - return 1; + return true; } /* }}} */ @@ -97,11 +97,11 @@ static bool dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_ty HashTable *ht; if (stmt->dbh->skip_param_evt & (1 << event_type)) { - return 1; + return true; } if (!stmt->methods->param_hook) { - return 1; + return true; } ht = stmt->bound_params; @@ -272,7 +272,7 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P(parameter)) { if (!try_convert_to_string(parameter)) { - return 0; + return false; } } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE || Z_TYPE_P(parameter) == IS_TRUE)) { convert_to_long(parameter); @@ -326,7 +326,7 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ zend_string_release_ex(param->name, 0); param->name = NULL; } - return 0; + return false; } /* ask the driver to perform any normalization it needs on the @@ -340,7 +340,7 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ zend_string_release_ex(param->name, 0); param->name = NULL; } - return 0; + return false; } } @@ -371,10 +371,10 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ } /* param->parameter is freed by hash dtor */ ZVAL_UNDEF(¶m->parameter); - return 0; + return false; } } - return 1; + return true; } /* }}} */ @@ -563,24 +563,24 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, enum pdo static bool do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */ { if (!stmt->executed) { - return 0; + return false; } if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE)) { - return 0; + return false; } if (!stmt->methods->fetcher(stmt, ori, offset)) { - return 0; + return false; } /* some drivers might need to describe the columns now */ if (!stmt->columns && !pdo_stmt_describe_columns(stmt)) { - return 0; + return false; } if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST)) { - return 0; + return false; } if (stmt->bound_columns) { @@ -607,7 +607,7 @@ static bool do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, ze } ZEND_HASH_FOREACH_END(); } - return 1; + return true; } /* }}} */ @@ -1506,9 +1506,9 @@ static bool generic_stmt_attr_get(pdo_stmt_t *stmt, zval *return_value, zend_lon switch (attr) { case PDO_ATTR_EMULATE_PREPARES: RETVAL_BOOL(stmt->supports_placeholders == PDO_PLACEHOLDER_NONE); - return 1; + return true; } - return 0; + return false; } PHP_METHOD(PDOStatement, getAttribute) @@ -1788,12 +1788,12 @@ static bool pdo_stmt_do_next_rowset(pdo_stmt_t *stmt) if (!stmt->methods->next_rowset(stmt)) { /* Set the executed flag to 0 to reallocate columns on next execute */ stmt->executed = 0; - return 0; + return false; } pdo_stmt_describe_columns(stmt); - return 1; + return true; } PHP_METHOD(PDOStatement, nextRowset) From 6c4c65999759c8d1514e0a0c771506633eb1f9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:36 +0200 Subject: [PATCH 057/386] phar: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/phar/phar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 76a580988fb62..651bd72256a6b 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -246,7 +246,7 @@ void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */ bool phar_archive_delref(phar_archive_data *phar) /* {{{ */ { if (phar->is_persistent) { - return 0; + return false; } if (--phar->refcount < 0) { @@ -254,7 +254,7 @@ bool phar_archive_delref(phar_archive_data *phar) /* {{{ */ || zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) { phar_destroy_phar_data(phar); } - return 1; + return true; } else if (!phar->refcount) { /* invalidate phar cache */ PHAR_G(last_phar) = NULL; @@ -277,10 +277,10 @@ bool phar_archive_delref(phar_archive_data *phar) /* {{{ */ if (zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) { phar_destroy_phar_data(phar); } - return 1; + return true; } } - return 0; + return false; } /* }}}*/ @@ -2117,10 +2117,10 @@ static bool php_check_dots(const char *element, size_t n) /* {{{ */ { for(n-- ; n != SIZE_MAX; --n) { if (element[n] != '.') { - return 1; + return true; } } - return 0; + return false; } /* }}} */ From d17b63688e4e856295360ce763b1257dcd611e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:41 +0200 Subject: [PATCH 058/386] session: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/session/session.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index b0b8dfad8ca6b..f716688b677e6 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -3069,17 +3069,17 @@ static bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progres zval *potential_session_id; if (Z_ISUNDEF(PG(http_globals)[where])) { - return 0; + return false; } if ((potential_session_id = zend_hash_find(Z_ARRVAL(PG(http_globals)[where]), PS(session_name))) && Z_TYPE_P(potential_session_id) == IS_STRING) { zval_ptr_dtor(dest); ZVAL_COPY_DEREF(dest, potential_session_id); - return 1; + return true; } - return 0; + return false; } static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress) @@ -3104,13 +3104,13 @@ static bool php_check_cancel_upload(php_session_rfc1867_progress *progress) zval *progress_ary, *cancel_upload; if ((progress_ary = zend_symtable_find(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.s)) == NULL) { - return 0; + return false; } if (Z_TYPE_P(progress_ary) != IS_ARRAY) { - return 0; + return false; } if ((cancel_upload = zend_hash_str_find(Z_ARRVAL_P(progress_ary), ZEND_STRL("cancel_upload"))) == NULL) { - return 0; + return false; } return Z_TYPE_P(cancel_upload) == IS_TRUE; } From 45bbe8c36df5aa6ca40ac964b97b1d6d59735034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:48 +0200 Subject: [PATCH 059/386] soap: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/soap/php_encoding.c | 10 +++++----- ext/soap/php_http.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index c37627e53a217..b9a290fa5ae8d 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -284,7 +284,7 @@ static bool soap_check_zval_ref(zval *data, xmlNodePtr node) { smart_str prefix = {0}; if (node_ptr == node) { - return 0; + return false; } if (SOAP_GLOBAL(soap_version) == SOAP_1_1) { attr = get_attribute(attr, "id"); @@ -322,12 +322,12 @@ static bool soap_check_zval_ref(zval *data, xmlNodePtr node) { set_ns_prop(node, SOAP_1_2_ENC_NAMESPACE, "ref", id); } smart_str_free(&prefix); - return 1; + return true; } else { zend_hash_index_update_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)data, node); } } - return 0; + return false; } static bool soap_check_xml_ref(zval *data, xmlNodePtr node) @@ -341,11 +341,11 @@ static bool soap_check_xml_ref(zval *data, xmlNodePtr node) Z_COUNTED_P(data) != Z_COUNTED_P(data_ptr)) { zval_ptr_dtor(data); ZVAL_COPY(data, data_ptr); - return 1; + return true; } } } - return 0; + return false; } static void soap_add_xml_ref(zval *data, xmlNodePtr node) diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 1d2b3e8c827be..93aa295ec3db0 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -329,7 +329,7 @@ static bool in_domain(const zend_string *host, const zend_string *domain) if (ZSTR_LEN(host) > ZSTR_LEN(domain)) { return strcmp(ZSTR_VAL(host)+ZSTR_LEN(host)-ZSTR_LEN(domain), ZSTR_VAL(domain)) == 0; } else { - return 0; + return false; } } else { return zend_string_equals(host,domain); From 70117e53b9da319703fb41fa0eeb64940f717eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:53 +0200 Subject: [PATCH 060/386] sockets: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/sockets/sockets.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 6fb75e2db1db3..f9001dc56164c 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -250,7 +250,7 @@ static bool php_open_listen_sock(php_socket *sock, unsigned short port, int back #else if ((hp = php_network_gethostbyname("localhost")) == NULL) { #endif - return 0; + return false; } memcpy((char *) &la.sin_addr, hp->h_addr, hp->h_length); @@ -262,7 +262,7 @@ static bool php_open_listen_sock(php_socket *sock, unsigned short port, int back if (IS_INVALID_SOCKET(sock)) { PHP_SOCKET_ERROR(sock, "unable to create listening socket", errno); - return 0; + return false; } sock->type = PF_INET; @@ -270,16 +270,16 @@ static bool php_open_listen_sock(php_socket *sock, unsigned short port, int back if (bind(sock->bsd_socket, (struct sockaddr *)&la, sizeof(la)) != 0) { PHP_SOCKET_ERROR(sock, "unable to bind to given address", errno); close(sock->bsd_socket); - return 0; + return false; } if (listen(sock->bsd_socket, backlog) != 0) { PHP_SOCKET_ERROR(sock, "unable to listen on socket", errno); close(sock->bsd_socket); - return 0; + return false; } - return 1; + return true; } /* }}} */ @@ -295,14 +295,14 @@ static bool php_accept_connect(php_socket *in_sock, php_socket *out_sock, struct if (IS_INVALID_SOCKET(out_sock)) { PHP_SOCKET_ERROR(out_sock, "unable to accept incoming connection", errno); - return 0; + return false; } #else out_sock->bsd_socket = accept(in_sock->bsd_socket, la, la_len); if (IS_INVALID_SOCKET(out_sock)) { PHP_SOCKET_ERROR(out_sock, "unable to accept incoming connection", errno); - return 0; + return false; } #if !defined(PHP_WIN32) @@ -314,7 +314,7 @@ static bool php_accept_connect(php_socket *in_sock, php_socket *out_sock, struct if ((mode = fcntl(out_sock->bsd_socket, F_GETFD)) < 0) { PHP_SOCKET_ERROR(out_sock, "unable to get fcntl mode on the socket", errno); - return 0; + return false; } int cloexec = (mode | FD_CLOEXEC); @@ -322,7 +322,7 @@ static bool php_accept_connect(php_socket *in_sock, php_socket *out_sock, struct if (mode != cloexec) { if (fcntl(out_sock->bsd_socket, F_SETFD, cloexec) < 0) { PHP_SOCKET_ERROR(out_sock, "unable to set cloexec mode on the socket", errno); - return 0; + return false; } } #endif @@ -332,7 +332,7 @@ static bool php_accept_connect(php_socket *in_sock, php_socket *out_sock, struct out_sock->blocking = 1; out_sock->type = la->sa_family; - return 1; + return true; } /* }}} */ @@ -2557,7 +2557,7 @@ bool socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock) retsock->type = addr.ss_family; } else { PHP_SOCKET_ERROR(retsock, "Unable to obtain socket family", errno); - return 0; + return false; } /* determine blocking mode */ @@ -2565,13 +2565,13 @@ bool socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock) t = fcntl(socket, F_GETFL); if (t == -1) { PHP_SOCKET_ERROR(retsock, "Unable to obtain blocking state", errno); - return 0; + return false; } else { retsock->blocking = !(t & O_NONBLOCK); } #endif - return 1; + return true; } /* {{{ Imports a stream that encapsulates a socket into a socket extension resource. */ From 5dfa85992a0a6a93d3a1ca4eebc99947bb6ad251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:09:59 +0200 Subject: [PATCH 061/386] sodium: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/sodium/sodium_pwhash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sodium/sodium_pwhash.c b/ext/sodium/sodium_pwhash.c index eea7fe9eb0f1d..32e4f72634c38 100644 --- a/ext/sodium/sodium_pwhash.c +++ b/ext/sodium/sodium_pwhash.c @@ -87,7 +87,7 @@ static zend_string *php_sodium_argon2_hash(const zend_string *password, zend_arr static bool php_sodium_argon2_verify(const zend_string *password, const zend_string *hash) { if ((ZSTR_LEN(password) >= 0xffffffff) || (ZSTR_LEN(hash) >= 0xffffffff)) { - return 0; + return false; } return crypto_pwhash_str_verify(ZSTR_VAL(hash), ZSTR_VAL(password), ZSTR_LEN(password)) == 0; } @@ -96,7 +96,7 @@ static bool php_sodium_argon2_needs_rehash(const zend_string *hash, zend_array * size_t opslimit, memlimit; if (get_options(options, &memlimit, &opslimit) == FAILURE) { - return 1; + return true; } return crypto_pwhash_str_needs_rehash(ZSTR_VAL(hash), opslimit, memlimit); } From 60f8969f7d3d8e447a6241fa506c75351a92d4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:10:06 +0200 Subject: [PATCH 062/386] spl: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/spl/spl_array.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 163b937f19433..2246a68b4035a 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -621,13 +621,13 @@ static bool spl_array_has_dimension_ex(bool check_inherited, zend_object *object if (!zend_is_true(&rv)) { zval_ptr_dtor(&rv); - return 0; + return false; } zval_ptr_dtor(&rv); /* For isset calls we don't need to check the value, so return early */ if (!check_empty) { - return 1; + return true; } else if (intern->fptr_offset_get) { value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv); } @@ -639,7 +639,7 @@ static bool spl_array_has_dimension_ex(bool check_inherited, zend_object *object if (get_hash_key(&key, intern, offset) == FAILURE) { zend_illegal_container_offset(object->ce->name, offset, BP_VAR_IS); - return 0; + return false; } if (key.key) { @@ -650,13 +650,13 @@ static bool spl_array_has_dimension_ex(bool check_inherited, zend_object *object } if (!tmp) { - return 0; + return false; } /* check_empty is only equal to 2 if it is called from offsetExists on this class, * where it needs to report an offset exists even if the value is null */ if (check_empty == 2) { - return 1; + return true; } if (check_empty && check_inherited && intern->fptr_offset_get) { From c743b71b40d295554bf566ec8af36c8268428e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:10:11 +0200 Subject: [PATCH 063/386] standard: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/standard/http_fopen_wrapper.c | 4 ++-- ext/standard/password.c | 6 +++--- ext/standard/string.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index ee8fe0b0d1a83..b7087befcb271 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -111,11 +111,11 @@ static bool check_has_header(const char *headers, const char *header) { const char *s = headers; while ((s = strstr(s, header))) { if (s == headers || (*(s-1) == '\n' && *(s-2) == '\r')) { - return 1; + return true; } s++; } - return 0; + return false; } static zend_result php_stream_handle_proxy_authorization_header(const char *s, smart_str *header) diff --git a/ext/standard/password.c b/ext/standard/password.c index 99dea810806cd..a8aab315657c0 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -140,7 +140,7 @@ static bool php_password_bcrypt_needs_rehash(const zend_string *hash, zend_array if (!php_password_bcrypt_valid(hash)) { /* Should never get called this way. */ - return 1; + return true; } sscanf(ZSTR_VAL(hash), "$2y$" ZEND_LONG_FMT "$", &old_cost); @@ -156,12 +156,12 @@ static bool php_password_bcrypt_verify(const zend_string *password, const zend_s zend_string *ret = php_crypt(ZSTR_VAL(password), (int)ZSTR_LEN(password), ZSTR_VAL(hash), (int)ZSTR_LEN(hash), 1); if (!ret) { - return 0; + return false; } if (ZSTR_LEN(hash) < 13) { zend_string_free(ret); - return 0; + return false; } /* We're using this method instead of == in order to provide diff --git a/ext/standard/string.c b/ext/standard/string.c index 0d9d4149db0e0..bb232ffd5d67f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1348,15 +1348,15 @@ static bool _is_basename_start(const char *start, const char *pos) && *(pos-1) != '/' && *(pos-1) != '\\') { if (pos - start == 1) { - return 1; + return true; } else if (*(pos-2) == '/' || *(pos-2) == '\\') { - return 1; + return true; } else if (*(pos-2) == ':' && _is_basename_start(start, pos - 2)) { - return 1; + return true; } } - return 0; + return false; } #endif @@ -5040,7 +5040,7 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { char *norm; if (len == 0) { - return 0; + return false; } norm = emalloc(len+1); From 9d187498bb9cd96d8678c03c3a256372468e8a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:10:17 +0200 Subject: [PATCH 064/386] tokenizer: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/tokenizer/tokenizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 203a9b9c36323..e594bc62ab389 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -381,7 +381,7 @@ static bool tokenize(zval *return_value, zend_string *source, zend_class_entry * zend_restore_lexical_state(&original_lex_state); zend_hash_destroy(&interned_strings); - return 1; + return true; } struct event_context { From 8bbd59f064faae821e7ad5c2c0562ee5cfa7e9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:10:22 +0200 Subject: [PATCH 065/386] zlib: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- ext/zlib/zlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index b0f21c45699ec..0b08cea7d69ec 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -800,7 +800,7 @@ static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_ memcpy(*dict, ZSTR_VAL(str), ZSTR_LEN(str)); *dictlen = ZSTR_LEN(str); - return 1; + return true; } case IS_ARRAY: { @@ -852,10 +852,10 @@ static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_ default: zend_argument_type_error(2, "must be of type zero-terminated string or array, %s given", zend_zval_value_name(option_buffer)); - return 0; + return false; } } - return 1; + return true; } /* {{{ Initialize an incremental inflate context with the specified encoding */ From 0b4ba560cef6ef2f5baad42fd3de20b77e7e91cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:03:27 +0200 Subject: [PATCH 066/386] Optimizer: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- Zend/Optimizer/block_pass.c | 8 ++-- Zend/Optimizer/dce.c | 82 ++++++++++++++++---------------- Zend/Optimizer/dfa_pass.c | 30 ++++++------ Zend/Optimizer/escape_analysis.c | 52 ++++++++++---------- Zend/Optimizer/pass3.c | 4 +- Zend/Optimizer/sccp.c | 22 ++++----- Zend/Optimizer/ssa_integrity.c | 20 ++++---- Zend/Optimizer/zend_call_graph.c | 4 +- Zend/Optimizer/zend_optimizer.c | 36 +++++++------- Zend/Optimizer/zend_ssa.c | 10 ++-- Zend/Optimizer/zend_worklist.h | 4 +- 11 files changed, 136 insertions(+), 136 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 4178326df71b4..f038c9e8a984a 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -42,9 +42,9 @@ bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int if (copy) { Z_TRY_ADDREF_P(result); } - return 1; + return true; } else { - return 0; + return false; } } @@ -52,9 +52,9 @@ bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int c = zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)); if (c) { ZVAL_COPY_VALUE(result, &c->value); - return 1; + return true; } - return 0; + return false; } /* Data dependencies macros */ diff --git a/Zend/Optimizer/dce.c b/Zend/Optimizer/dce.c index a00fd8bc6ad30..8299a72fb7bd0 100644 --- a/Zend/Optimizer/dce.c +++ b/Zend/Optimizer/dce.c @@ -62,13 +62,13 @@ typedef struct { static inline bool is_bad_mod(const zend_ssa *ssa, int use, int def) { if (def < 0) { /* This modification is not tracked by SSA, assume the worst */ - return 1; + return true; } if (ssa->var_info[use].type & MAY_BE_REF) { /* Modification of reference may have side-effect */ - return 1; + return true; } - return 0; + return false; } static inline bool may_have_side_effects( @@ -125,18 +125,18 @@ static inline bool may_have_side_effects( case ZEND_FUNC_GET_ARGS: case ZEND_ARRAY_KEY_EXISTS: /* No side effects */ - return 0; + return false; case ZEND_FREE: return opline->extended_value == ZEND_FREE_VOID_CAST; case ZEND_ADD_ARRAY_ELEMENT: /* TODO: We can't free two vars. Keep instruction alive. "$b"]; */ if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && (opline->op2_type & (IS_VAR|IS_TMP_VAR))) { - return 1; + return true; } - return 0; + return false; case ZEND_ROPE_END: /* TODO: Rope dce optimization, see #76446 */ - return 1; + return true; case ZEND_JMP: case ZEND_JMPZ: case ZEND_JMPNZ: @@ -149,7 +149,7 @@ static inline bool may_have_side_effects( case ZEND_BIND_INIT_STATIC_OR_JMP: case ZEND_JMP_FRAMELESS: /* For our purposes a jumps and branches are side effects. */ - return 1; + return true; case ZEND_BEGIN_SILENCE: case ZEND_END_SILENCE: case ZEND_ECHO: @@ -164,7 +164,7 @@ static inline bool may_have_side_effects( case ZEND_YIELD_FROM: case ZEND_VERIFY_NEVER_TYPE: /* Intrinsic side effects */ - return 1; + return true; case ZEND_DO_FCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_DO_ICALL: @@ -174,31 +174,31 @@ static inline bool may_have_side_effects( case ZEND_FRAMELESS_ICALL_2: case ZEND_FRAMELESS_ICALL_3: /* For now assume all calls have side effects */ - return 1; + return true; case ZEND_RECV: case ZEND_RECV_INIT: /* Even though RECV_INIT can be side-effect free, these cannot be simply dropped * due to the prologue skipping code. */ - return 1; + return true; case ZEND_ASSIGN_REF: - return 1; + return true; case ZEND_ASSIGN: { if (is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def)) { - return 1; + return true; } if (!reorder_dtor_effects) { if (opline->op2_type != IS_CONST && (OP2_INFO() & MAY_HAVE_DTOR) && ssa->vars[ssa_op->op2_use].escape_state != ESCAPE_STATE_NO_ESCAPE) { /* DCE might shorten lifetime */ - return 1; + return true; } } - return 0; + return false; } case ZEND_UNSET_VAR: - return 1; + return true; case ZEND_UNSET_CV: { uint32_t t1 = OP1_INFO(); @@ -207,9 +207,9 @@ static inline bool may_have_side_effects( * an unset may be considered dead even if there is a later assignment to the * variable. Removing the unset in this case would not be correct if the variable * is a reference, because unset breaks references. */ - return 1; + return true; } - return 0; + return false; } case ZEND_PRE_INC: case ZEND_POST_INC: @@ -223,7 +223,7 @@ static inline bool may_have_side_effects( case ZEND_ASSIGN_OBJ: if (is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def) || ssa->vars[ssa_op->op1_def].escape_state != ESCAPE_STATE_NO_ESCAPE) { - return 1; + return true; } if (!reorder_dtor_effects) { opline++; @@ -231,33 +231,33 @@ static inline bool may_have_side_effects( if (opline->op1_type != IS_CONST && (OP1_INFO() & MAY_HAVE_DTOR)) { /* DCE might shorten lifetime */ - return 1; + return true; } } - return 0; + return false; case ZEND_PRE_INC_OBJ: case ZEND_PRE_DEC_OBJ: case ZEND_POST_INC_OBJ: case ZEND_POST_DEC_OBJ: if (is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def) || ssa->vars[ssa_op->op1_def].escape_state != ESCAPE_STATE_NO_ESCAPE) { - return 1; + return true; } - return 0; + return false; case ZEND_BIND_STATIC: if (op_array->static_variables) { /* Implicit and Explicit bind static is effectively prologue of closure so report it has side effects like RECV, RECV_INIT; This allows us to reflect on the closure and discover used variable at runtime */ if ((opline->extended_value & (ZEND_BIND_IMPLICIT|ZEND_BIND_EXPLICIT))) { - return 1; + return true; } /* Modifies static variables which are observable through reflection */ if ((opline->extended_value & ZEND_BIND_REF) && opline->op2_type != IS_UNUSED) { - return 1; + return true; } } - return 0; + return false; case ZEND_CHECK_VAR: return (OP1_INFO() & MAY_BE_UNDEF) != 0; case ZEND_FE_RESET_R: @@ -267,7 +267,7 @@ static inline bool may_have_side_effects( return (OP1_INFO() & MAY_BE_ANY) != MAY_BE_ARRAY; default: /* For everything we didn't handle, assume a side-effect */ - return 1; + return true; } } @@ -340,7 +340,7 @@ static inline bool is_var_dead(context *ctx, int var_num) { // Sometimes we can mark the var as EXT_UNUSED static bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_op *opline) { if (use_chain >= 0) { - return 0; + return false; } zend_ssa_var *var = &ctx->ssa->vars[free_var]; int def = var->definition; @@ -381,13 +381,13 @@ static bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_o def_opline->result.var = 0; def_op->result_def = -1; var->definition = -1; - return 1; + return true; default: break; } } } - return 0; + return false; } static zend_always_inline bool may_be_refcounted(uint32_t type) { @@ -400,13 +400,13 @@ static inline bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_o /* It is always safe to remove FREEs of non-refcounted values, even if they are live. */ if ((ctx->ssa->var_info[ssa_op->op1_use].type & (MAY_BE_REF|MAY_BE_ANY|MAY_BE_UNDEF)) != 0 && !may_be_refcounted(ctx->ssa->var_info[ssa_op->op1_use].type)) { - return 0; + return false; } ZEND_FALLTHROUGH; case ZEND_FE_FREE: return !is_var_dead(ctx, ssa_op->op1_use); default: - return 0; + return false; } } @@ -417,12 +417,12 @@ static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { uint8_t free_var_type; if (opline->opcode == ZEND_NOP) { - return 0; + return false; } /* We mark FREEs as dead, but they're only really dead if the destroyed var is dead */ if (is_free_of_live_var(ctx, opline, ssa_op)) { - return 0; + return false; } if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) { @@ -440,7 +440,7 @@ static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { if (free_var >= 0) { // TODO: We can't free two vars. Keep instruction alive. zend_bitset_excl(ctx->instr_dead, opline - ctx->op_array->opcodes); - return 0; + return false; } free_var = ssa_op->op2_use; free_var_type = opline->op2_type; @@ -459,9 +459,9 @@ static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { ssa_op->op1_use = free_var; ssa_op->op1_use_chain = ssa->vars[free_var].use_chain; ssa->vars[free_var].use_chain = ssa_op - ssa->ops; - return 0; + return false; } - return 1; + return true; } static inline int get_common_phi_source(zend_ssa *ssa, zend_ssa_phi *phi) { @@ -507,17 +507,17 @@ static void try_remove_trivial_phi(context *ctx, zend_ssa_phi *phi) { static inline bool may_break_varargs(const zend_op_array *op_array, const zend_ssa *ssa, const zend_ssa_op *ssa_op) { if (ssa_op->op1_def >= 0 && ssa->vars[ssa_op->op1_def].var < op_array->num_args) { - return 1; + return true; } if (ssa_op->op2_def >= 0 && ssa->vars[ssa_op->op2_def].var < op_array->num_args) { - return 1; + return true; } if (ssa_op->result_def >= 0 && ssa->vars[ssa_op->result_def].var < op_array->num_args) { - return 1; + return true; } - return 0; + return false; } static inline bool may_throw_dce_exception(const zend_op *opline) { diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c index fc3f76c1432ed..b64f6d8fa817c 100644 --- a/Zend/Optimizer/dfa_pass.c +++ b/Zend/Optimizer/dfa_pass.c @@ -256,11 +256,11 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa, zend_op static bool safe_instanceof(const zend_class_entry *ce1, const zend_class_entry *ce2) { if (ce1 == ce2) { - return 1; + return true; } if (!(ce1->ce_flags & ZEND_ACC_LINKED)) { /* This case could be generalized, similarly to unlinked_instanceof */ - return 0; + return false; } return instanceof_function(ce1, ce2); } @@ -297,7 +297,7 @@ static inline bool can_elide_return_type_check( zend_ssa_var_info *use_info = &ssa->var_info[ssa_op->op1_use]; uint32_t use_type = use_info->type & (MAY_BE_ANY|MAY_BE_UNDEF); if (use_type & MAY_BE_REF) { - return 0; + return false; } if (use_type & MAY_BE_UNDEF) { @@ -322,20 +322,20 @@ static bool opline_supports_assign_contraction( zend_op_array *op_array, zend_ssa *ssa, zend_op *opline, int src_var, uint32_t cv_var) { if (opline->opcode == ZEND_NEW) { /* see Zend/tests/generators/aborted_yield_during_new.phpt */ - return 0; + return false; } /* Frameless calls override the return value, but the return value may overlap with the arguments. */ switch (opline->opcode) { case ZEND_FRAMELESS_ICALL_3: - if ((opline + 1)->op1_type == IS_CV && (opline + 1)->op1.var == cv_var) return 0; + if ((opline + 1)->op1_type == IS_CV && (opline + 1)->op1.var == cv_var) return false; ZEND_FALLTHROUGH; case ZEND_FRAMELESS_ICALL_2: - if (opline->op2_type == IS_CV && opline->op2.var == cv_var) return 0; + if (opline->op2_type == IS_CV && opline->op2.var == cv_var) return false; ZEND_FALLTHROUGH; case ZEND_FRAMELESS_ICALL_1: - if (opline->op1_type == IS_CV && opline->op1.var == cv_var) return 0; - return 1; + if (opline->op1_type == IS_CV && opline->op1.var == cv_var) return false; + return true; } if (opline->opcode == ZEND_DO_ICALL || opline->opcode == ZEND_DO_UCALL @@ -374,10 +374,10 @@ static bool opline_supports_assign_contraction( && opline->op1_type == IS_CV && opline->op1.var == cv_var && zend_may_throw(opline, &ssa->ops[ssa->vars[src_var].definition], op_array, ssa)) { - return 0; + return false; } - return 1; + return true; } static bool variable_defined_or_used_in_range(zend_ssa *ssa, int var, int start, int end) @@ -391,11 +391,11 @@ static bool variable_defined_or_used_in_range(zend_ssa *ssa, int var, int start, (ssa_op->op2_use >= 0 && ssa->vars[ssa_op->op2_use].var == var) || (ssa_op->result_use >= 0 && ssa->vars[ssa_op->result_use].var == var) ) { - return 1; + return true; } start++; } - return 0; + return false; } int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa) @@ -989,7 +989,7 @@ static bool zend_dfa_try_to_replace_result(zend_op_array *op_array, zend_ssa *ss if ((opline->op1_type == IS_CV && opline->op1.var == cv) || (opline->op2_type == IS_CV && opline->op2.var == cv) || (opline->result_type == IS_CV && opline->result.var == cv)) { - return 0; + return false; } opline--; i--; @@ -1026,12 +1026,12 @@ static bool zend_dfa_try_to_replace_result(zend_op_array *op_array, zend_ssa *ss op_array->opcodes[use].result.var = cv; } - return 1; + return true; } } } - return 0; + return false; } void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx, zend_ssa *ssa, zend_call_info **call_map) diff --git a/Zend/Optimizer/escape_analysis.c b/Zend/Optimizer/escape_analysis.c index ecc112ef30ee1..00ee329845026 100644 --- a/Zend/Optimizer/escape_analysis.c +++ b/Zend/Optimizer/escape_analysis.c @@ -155,7 +155,7 @@ static bool is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, i if (ssa_op->result_def == var) { switch (opline->opcode) { case ZEND_INIT_ARRAY: - return 1; + return true; case ZEND_NEW: { /* objects with destructors should escape */ zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( @@ -175,22 +175,22 @@ static bool is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, i && !ce->__set && !(ce->ce_flags & forbidden_flags) && (ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { - return 1; + return true; } break; } case ZEND_QM_ASSIGN: if (opline->op1_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op1)) == IS_ARRAY) { - return 1; + return true; } if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_ARRAY)) { - return 1; + return true; } break; case ZEND_ASSIGN: if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_ARRAY)) { - return 1; + return true; } break; } @@ -199,22 +199,22 @@ static bool is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, i case ZEND_ASSIGN: if (opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_ARRAY) { - return 1; + return true; } if (opline->op2_type == IS_CV && (OP2_INFO() & MAY_BE_ARRAY)) { - return 1; + return true; } break; case ZEND_ASSIGN_DIM: if (OP1_INFO() & (MAY_BE_UNDEF | MAY_BE_NULL | MAY_BE_FALSE)) { /* implicit object/array allocation */ - return 1; + return true; } break; } } - return 0; + return false; } /* }}} */ @@ -229,7 +229,7 @@ static bool is_local_def(zend_op_array *op_array, zend_ssa *ssa, int def, int va case ZEND_ADD_ARRAY_ELEMENT: case ZEND_QM_ASSIGN: case ZEND_ASSIGN: - return 1; + return true; case ZEND_NEW: { /* objects with destructors should escape */ zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( @@ -243,7 +243,7 @@ static bool is_local_def(zend_op_array *op_array, zend_ssa *ssa, int def, int va && !ce->__get && !ce->__set && !ce->parent) { - return 1; + return true; } break; } @@ -260,11 +260,11 @@ static bool is_local_def(zend_op_array *op_array, zend_ssa *ssa, int def, int va case ZEND_PRE_DEC_OBJ: case ZEND_POST_INC_OBJ: case ZEND_POST_DEC_OBJ: - return 1; + return true; } } - return 0; + return false; } /* }}} */ @@ -282,7 +282,7 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v if (opline->op1_type == IS_CV) { if (OP1_INFO() & MAY_BE_OBJECT) { /* object aliasing */ - return 1; + return true; } } break; @@ -294,7 +294,7 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v case ZEND_FETCH_OBJ_IS: break; case ZEND_ASSIGN_OP: - return 1; + return true; case ZEND_ASSIGN_DIM_OP: case ZEND_ASSIGN_OBJ_OP: case ZEND_ASSIGN_STATIC_PROP_OP: @@ -310,22 +310,22 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v case ZEND_INIT_ARRAY: case ZEND_ADD_ARRAY_ELEMENT: if (opline->extended_value & ZEND_ARRAY_ELEMENT_REF) { - return 1; + return true; } if (OP1_INFO() & MAY_BE_OBJECT) { /* object aliasing */ - return 1; + return true; } /* reference dependencies processed separately */ break; case ZEND_OP_DATA: if ((opline-1)->opcode != ZEND_ASSIGN_DIM && (opline-1)->opcode != ZEND_ASSIGN_OBJ) { - return 1; + return true; } if (OP1_INFO() & MAY_BE_OBJECT) { /* object aliasing */ - return 1; + return true; } opline--; ssa_op--; @@ -333,12 +333,12 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v || (OP1_INFO() & MAY_BE_REF) || (ssa_op->op1_def >= 0 && ssa->vars[ssa_op->op1_def].alias)) { /* assignment into escaping structure */ - return 1; + return true; } /* reference dependencies processed separately */ break; default: - return 1; + return true; } } @@ -349,17 +349,17 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v || (OP1_INFO() & MAY_BE_REF) || (ssa_op->op1_def >= 0 && ssa->vars[ssa_op->op1_def].alias)) { /* assignment into escaping variable */ - return 1; + return true; } if (opline->op2_type == IS_CV || opline->result_type != IS_UNUSED) { if (OP2_INFO() & MAY_BE_OBJECT) { /* object aliasing */ - return 1; + return true; } } break; default: - return 1; + return true; } } @@ -371,11 +371,11 @@ static bool is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int v case ZEND_ADD_ARRAY_ELEMENT: break; default: - return 1; + return true; } } - return 0; + return false; } /* }}} */ diff --git a/Zend/Optimizer/pass3.c b/Zend/Optimizer/pass3.c index 2cbd0e3406521..5c31de7bc49c4 100644 --- a/Zend/Optimizer/pass3.c +++ b/Zend/Optimizer/pass3.c @@ -37,10 +37,10 @@ static zend_always_inline bool in_hitlist(zend_op *target, zend_op **jmp_hitlist for (i = 0; i < jmp_hitlist_count; i++) { if (jmp_hitlist[i] == target) { - return 1; + return true; } } - return 0; + return false; } #define CHECK_LOOP(target) \ diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index f3f76067f3797..587559c64bf37 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -244,7 +244,7 @@ static bool can_replace_op1( case ZEND_SEND_ARRAY: case ZEND_SEND_USER: case ZEND_FE_RESET_RW: - return 0; + return false; /* Do not accept CONST */ case ZEND_ROPE_ADD: case ZEND_ROPE_END: @@ -254,7 +254,7 @@ static bool can_replace_op1( case ZEND_MAKE_REF: case ZEND_UNSET_CV: case ZEND_ISSET_ISEMPTY_CV: - return 0; + return false; case ZEND_INIT_ARRAY: case ZEND_ADD_ARRAY_ELEMENT: return !(opline->extended_value & ZEND_ARRAY_ELEMENT_REF); @@ -262,18 +262,18 @@ static bool can_replace_op1( return !(op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE); case ZEND_VERIFY_RETURN_TYPE: // TODO: This would require a non-local change ??? - return 0; + return false; case ZEND_OP_DATA: return (opline - 1)->opcode != ZEND_ASSIGN_OBJ_REF && (opline - 1)->opcode != ZEND_ASSIGN_STATIC_PROP_REF; default: if (ssa_op->op1_def != -1) { ZEND_UNREACHABLE(); - return 0; + return false; } } - return 1; + return true; } static bool can_replace_op2( @@ -284,9 +284,9 @@ static bool can_replace_op2( case ZEND_BIND_LEXICAL: case ZEND_FE_FETCH_R: case ZEND_FE_FETCH_RW: - return 0; + return false; } - return 1; + return true; } static bool try_replace_op1( @@ -295,11 +295,11 @@ static bool try_replace_op1( zval zv; ZVAL_COPY(&zv, value); if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) { - return 1; + return true; } zval_ptr_dtor_nogc(&zv); } - return 0; + return false; } static bool try_replace_op2( @@ -308,11 +308,11 @@ static bool try_replace_op2( zval zv; ZVAL_COPY(&zv, value); if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline, &zv)) { - return 1; + return true; } zval_ptr_dtor_nogc(&zv); } - return 0; + return false; } static inline zend_result ct_eval_binary_op(zval *result, uint8_t binop, zval *op1, zval *op2) { diff --git a/Zend/Optimizer/ssa_integrity.c b/Zend/Optimizer/ssa_integrity.c index b525f8d5ee226..793fb1c06c8b0 100644 --- a/Zend/Optimizer/ssa_integrity.c +++ b/Zend/Optimizer/ssa_integrity.c @@ -25,20 +25,20 @@ static inline bool is_in_use_chain(zend_ssa *ssa, int var, int check) { int use; FOREACH_USE(&ssa->vars[var], use) { if (use == check) { - return 1; + return true; } } FOREACH_USE_END(); - return 0; + return false; } static inline bool is_in_phi_use_chain(zend_ssa *ssa, int var, zend_ssa_phi *check) { zend_ssa_phi *phi; FOREACH_PHI_USE(&ssa->vars[var], phi) { if (phi == check) { - return 1; + return true; } } FOREACH_PHI_USE_END(); - return 0; + return false; } static inline bool is_used_by_op(zend_ssa *ssa, int op, int check) { @@ -59,30 +59,30 @@ static inline bool is_in_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi, int check int source; FOREACH_PHI_SOURCE(phi, source) { if (source == check) { - return 1; + return true; } } FOREACH_PHI_SOURCE_END(); - return 0; + return false; } static inline bool is_in_predecessors(zend_cfg *cfg, zend_basic_block *block, int check) { int i, *predecessors = &cfg->predecessors[block->predecessor_offset]; for (i = 0; i < block->predecessors_count; i++) { if (predecessors[i] == check) { - return 1; + return true; } } - return 0; + return false; } static inline bool is_in_successors(zend_basic_block *block, int check) { int s; for (s = 0; s < block->successors_count; s++) { if (block->successors[s] == check) { - return 1; + return true; } } - return 0; + return false; } static inline bool is_var_type(uint8_t type) { diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index d412414abd564..80e4accb2777b 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -176,12 +176,12 @@ static bool zend_is_indirectly_recursive(zend_op_array *root, zend_op_array *op_ bool ret = false; if (op_array == root) { - return 1; + return true; } func_info = ZEND_FUNC_INFO(op_array); if (zend_bitset_in(visited, func_info->num)) { - return 0; + return false; } zend_bitset_incl(visited, func_info->num); call_info = func_info->caller_info; diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 5e074300c4418..4e5ecca8a0f80 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -186,9 +186,9 @@ bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zva if ((val = zend_hash_find(constants, Z_STR_P(name))) != NULL) { ZVAL_COPY(value, val); - return 1; + return true; } - return 0; + return false; } void zend_optimizer_convert_to_free_op1(zend_op_array *op_array, zend_op *opline) @@ -263,7 +263,7 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, switch ((opline-1)->opcode) { case ZEND_ASSIGN_OBJ_REF: case ZEND_ASSIGN_STATIC_PROP_REF: - return 0; + return false; } opline->op1.constant = zend_optimizer_add_literal(op_array, val); break; @@ -271,7 +271,7 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, case ZEND_CHECK_VAR: MAKE_NOP(opline); zval_ptr_dtor_nogc(val); - return 1; + return true; case ZEND_SEND_VAR_EX: case ZEND_SEND_FUNC_ARG: case ZEND_FETCH_DIM_W: @@ -286,7 +286,7 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, case ZEND_SEPARATE: case ZEND_SEND_VAR_NO_REF: case ZEND_SEND_VAR_NO_REF_EX: - return 0; + return false; case ZEND_CATCH: REQUIRES_STRING(val); drop_leading_backslash(val); @@ -368,10 +368,10 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, case ZEND_VERIFY_RETURN_TYPE: /* This would require a non-local change. * zend_optimizer_replace_by_const() supports this. */ - return 0; + return false; case ZEND_COPY_TMP: case ZEND_FETCH_CLASS_NAME: - return 0; + return false; case ZEND_ECHO: { zval zv; @@ -382,7 +382,7 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, opline->op1.constant = zend_optimizer_add_literal(op_array, val); if (Z_TYPE_P(val) == IS_STRING && Z_STRLEN_P(val) == 0) { MAKE_NOP(opline); - return 1; + return true; } /* TODO: In a subsequent pass, *after* this step and compacting nops, combine consecutive ZEND_ECHOs using the block information from ssa->cfg */ /* (e.g. for ext/opcache/tests/opt/sccp_010.phpt) */ @@ -412,7 +412,7 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array, if (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) { zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline))); } - return 1; + return true; } bool zend_optimizer_update_op2_const(zend_op_array *op_array, @@ -424,7 +424,7 @@ bool zend_optimizer_update_op2_const(zend_op_array *op_array, switch (opline->opcode) { case ZEND_ASSIGN_REF: case ZEND_FAST_CALL: - return 0; + return false; case ZEND_FETCH_CLASS: case ZEND_INSTANCEOF: REQUIRES_STRING(val); @@ -478,13 +478,13 @@ bool zend_optimizer_update_op2_const(zend_op_array *op_array, case ZEND_INIT_DYNAMIC_CALL: if (Z_TYPE_P(val) == IS_STRING) { if (zend_memrchr(Z_STRVAL_P(val), ':', Z_STRLEN_P(val))) { - return 0; + return false; } if (zend_optimizer_classify_function(Z_STR_P(val), opline->extended_value)) { /* Dynamic call to various special functions must stay dynamic, * otherwise would drop a warning */ - return 0; + return false; } opline->opcode = ZEND_INIT_FCALL_BY_NAME; @@ -594,7 +594,7 @@ bool zend_optimizer_update_op2_const(zend_op_array *op_array, if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) { zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline))); } - return 1; + return true; } bool zend_optimizer_replace_by_const(zend_op_array *op_array, @@ -641,7 +641,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, Z_TRY_ADDREF_P(val); if (!zend_optimizer_update_op1_const(op_array, opline, val)) { zval_ptr_dtor(val); - return 0; + return false; } if (is_last) { break; @@ -650,13 +650,13 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, opline++; } zval_ptr_dtor_nogc(val); - return 1; + return true; } case ZEND_VERIFY_RETURN_TYPE: { zend_arg_info *ret_info = op_array->arg_info - 1; if (!ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(val)) || (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE)) { - return 0; + return false; } MAKE_NOP(opline); @@ -681,7 +681,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, opline++; } - return 1; + return true; } /* Update jump offsets after a jump was migrated to another opline */ @@ -1506,7 +1506,7 @@ static bool needs_live_range(zend_op_array *op_array, zend_op *def_opline) { int ssa_var = ssa_op->result_def; if (ssa_var < 0) { /* Be conservative. */ - return 1; + return true; } /* If the variable is used by a PHI, this may be the assignment of the final branch of a diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index d346492336d23..b238d41c2529a 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -52,10 +52,10 @@ static bool will_rejoin( /* The other successor dominates this predecessor, * so we will get the original value from it. */ if (dominates(cfg->blocks, other_successor, predecessor)) { - return 1; + return true; } } - return 0; + return false; } static bool needs_pi(const zend_op_array *op_array, const zend_dfg *dfg, const zend_ssa *ssa, int from, int to, int var) /* {{{ */ @@ -65,7 +65,7 @@ static bool needs_pi(const zend_op_array *op_array, const zend_dfg *dfg, const z if (!DFG_ISSET(dfg->in, dfg->size, to, var)) { /* Variable is not live, certainly won't benefit from pi */ - return 0; + return false; } /* Make sure that both successors of the from block aren't the same. Pi nodes are associated @@ -73,13 +73,13 @@ static bool needs_pi(const zend_op_array *op_array, const zend_dfg *dfg, const z from_block = &ssa->cfg.blocks[from]; ZEND_ASSERT(from_block->successors_count == 2); if (from_block->successors[0] == from_block->successors[1]) { - return 0; + return false; } to_block = &ssa->cfg.blocks[to]; if (to_block->predecessors_count == 1) { /* Always place pi if one predecessor (an if branch) */ - return 1; + return true; } /* Check whether we will rejoin with the original value coming from the other successor, diff --git a/Zend/Optimizer/zend_worklist.h b/Zend/Optimizer/zend_worklist.h index f47d01bd1579b..85e7b111d5c94 100644 --- a/Zend/Optimizer/zend_worklist.h +++ b/Zend/Optimizer/zend_worklist.h @@ -97,12 +97,12 @@ static inline bool zend_worklist_push(zend_worklist *worklist, int i) ZEND_ASSERT(i >= 0 && i < worklist->stack.capacity); if (zend_bitset_in(worklist->visited, i)) { - return 0; + return false; } zend_bitset_incl(worklist->visited, i); zend_worklist_stack_push(&worklist->stack, i); - return 1; + return true; } static inline int zend_worklist_peek(const zend_worklist *worklist) From ef1b5ae61bfd0958132e430f92d56b7a3f8e6f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:03:39 +0200 Subject: [PATCH 067/386] Zend: Use `return true` / `return false` for functions returning `bool` Changes done with Coccinelle: @r1@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { <... return ( - 0 + false | - 1 + true ) ; ...> } Coccinelle patch sourced from torvalds/linux@46b5c9b856e8bcb44d8570cc55c46d19ca2428ff. --- Zend/zend.c | 2 +- Zend/zend_alloc.c | 2 +- Zend/zend_ast.c | 12 ++++++------ Zend/zend_closures.c | 14 +++++++------- Zend/zend_cpuinfo.c | 10 +++++----- Zend/zend_execute.c | 26 +++++++++++++------------- Zend/zend_inheritance.c | 16 ++++++++-------- Zend/zend_multibyte.c | 2 +- Zend/zend_opcode.c | 4 ++-- Zend/zend_weakrefs.c | 6 +++--- 10 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index c07fabcb36f85..30b5a8c134c80 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -910,7 +910,7 @@ static bool php_auto_globals_create_globals(zend_string *name) /* {{{ */ { /* While we keep registering $GLOBALS as an auto-global, we do not create an * actual variable for it. Access to it handled specially by the compiler. */ - return 0; + return false; } /* }}} */ diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index f3dfe0f9df57a..1157dc98fa615 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2627,7 +2627,7 @@ ZEND_API bool is_zend_mm(void) #if ZEND_MM_CUSTOM return !AG(mm_heap)->use_custom_heap; #else - return 1; + return true; #endif } diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 9cb3c7aae4a1f..72202f322e05c 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1575,9 +1575,9 @@ static ZEND_COLD bool zend_ast_valid_var_char(char ch) (c < '0' || c > '9') && (c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) { - return 0; + return false; } - return 1; + return true; } static ZEND_COLD bool zend_ast_valid_var_name(const char *s, size_t len) @@ -1586,13 +1586,13 @@ static ZEND_COLD bool zend_ast_valid_var_name(const char *s, size_t len) size_t i; if (len == 0) { - return 0; + return false; } c = (unsigned char)s[0]; if (c != '_' && c < 127 && (c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) { - return 0; + return false; } for (i = 1; i < len; i++) { c = (unsigned char)s[i]; @@ -1600,10 +1600,10 @@ static ZEND_COLD bool zend_ast_valid_var_name(const char *s, size_t len) (c < '0' || c > '9') && (c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) { - return 0; + return false; } } - return 1; + return true; } static ZEND_COLD bool zend_ast_var_needs_braces(char ch) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 4a6b5a5218849..4c2b85f5d48c3 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -82,7 +82,7 @@ static bool zend_valid_closure_binding( if (newthis) { if (func->common.fn_flags & ZEND_ACC_STATIC) { zend_error(E_WARNING, "Cannot bind an instance to a static closure, this will be an error in PHP 9"); - return 0; + return false; } if (is_fake_closure && func->common.scope && @@ -92,23 +92,23 @@ static bool zend_valid_closure_binding( ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name), ZSTR_VAL(Z_OBJCE_P(newthis)->name)); - return 0; + return false; } } else if (is_fake_closure && func->common.scope && !(func->common.fn_flags & ZEND_ACC_STATIC)) { zend_error(E_WARNING, "Cannot unbind $this of method, this will be an error in PHP 9"); - return 0; + return false; } else if (!is_fake_closure && !Z_ISUNDEF(closure->this_ptr) && (func->common.fn_flags & ZEND_ACC_USES_THIS)) { zend_error(E_WARNING, "Cannot unbind $this of closure using $this, this will be an error in PHP 9"); - return 0; + return false; } if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) { /* rebinding to internal class is not allowed */ zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s, this will be an error in PHP 9", ZSTR_VAL(scope->name)); - return 0; + return false; } if (is_fake_closure && scope != func->common.scope) { @@ -117,10 +117,10 @@ static bool zend_valid_closure_binding( } else { zend_error(E_WARNING, "Cannot rebind scope of closure created from method, this will be an error in PHP 9"); } - return 0; + return false; } - return 1; + return true; } /* }}} */ diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c index 6264031ceba42..9f8f1354be061 100644 --- a/Zend/zend_cpuinfo.c +++ b/Zend/zend_cpuinfo.c @@ -93,21 +93,21 @@ static unsigned get_xcr0_eax(void) { static bool is_avx_supported(void) { if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) { /* No support for AVX */ - return 0; + return false; } if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_OSXSAVE)) { /* The operating system does not support XSAVE. */ - return 0; + return false; } if ((get_xcr0_eax() & 0x6) != 0x6) { /* XCR0 SSE and AVX bits must be set. */ - return 0; + return false; } - return 1; + return true; } #else static bool is_avx_supported(void) { - return 0; + return false; } #endif diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 5665cc0c3f784..8eff03056c934 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -746,36 +746,36 @@ static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg) if (type == IS_LONG) { zend_string_release(Z_STR_P(arg)); ZVAL_LONG(arg, lval); - return 1; + return true; } if (type == IS_DOUBLE) { zend_string_release(Z_STR_P(arg)); ZVAL_DOUBLE(arg, dval); - return 1; + return true; } } else if (zend_parse_arg_long_weak(arg, &lval, 0)) { zval_ptr_dtor(arg); ZVAL_LONG(arg, lval); - return 1; + return true; } else if (UNEXPECTED(EG(exception))) { - return 0; + return false; } } if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval, 0)) { zval_ptr_dtor(arg); ZVAL_DOUBLE(arg, dval); - return 1; + return true; } if ((type_mask & MAY_BE_STRING) && zend_parse_arg_str_weak(arg, &str, 0)) { /* on success "arg" is converted to IS_STRING */ - return 1; + return true; } if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval, 0)) { zval_ptr_dtor(arg); ZVAL_BOOL(arg, bval); - return 1; + return true; } - return 0; + return false; } #if ZEND_DEBUG @@ -800,18 +800,18 @@ static bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, /* Pass (uint32_t)-1 as arg_num to indicate to ZPP not to emit any deprecation notice, * this is needed because the version with side effects also uses 0 (e.g. for typed properties) */ if ((type_mask & MAY_BE_LONG) && zend_parse_arg_long_weak(arg, &lval, (uint32_t)-1)) { - return 1; + return true; } if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval, (uint32_t)-1)) { - return 1; + return true; } if ((type_mask & MAY_BE_STRING) && can_convert_to_string(arg)) { - return 1; + return true; } if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL && zend_parse_arg_bool_weak(arg, &bval, (uint32_t)-1)) { - return 1; + return true; } - return 0; + return false; } #endif diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 62b55186d6b60..aea142a1f5e4b 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -312,7 +312,7 @@ static zend_class_entry *lookup_class(zend_class_entry *scope, zend_string *name /* Instanceof that's safe to use on unlinked classes. */ static bool unlinked_instanceof(const zend_class_entry *ce1, const zend_class_entry *ce2) { if (ce1 == ce2) { - return 1; + return true; } if (ce1->ce_flags & ZEND_ACC_LINKED) { @@ -331,7 +331,7 @@ static bool unlinked_instanceof(const zend_class_entry *ce1, const zend_class_en /* It's not sufficient to only check the parent chain itself, as need to do a full * recursive instanceof in case the parent interfaces haven't been copied yet. */ if (parent_ce && unlinked_instanceof(parent_ce, ce2)) { - return 1; + return true; } } @@ -342,7 +342,7 @@ static bool unlinked_instanceof(const zend_class_entry *ce1, const zend_class_en * check here, as the parent interfaces might not have been fully copied yet. */ for (i = 0; i < ce1->num_interfaces; i++) { if (unlinked_instanceof(ce1->interfaces[i], ce2)) { - return 1; + return true; } } } else { @@ -352,19 +352,19 @@ static bool unlinked_instanceof(const zend_class_entry *ce1, const zend_class_en ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD); /* Avoid recursing if class implements itself. */ if (ce && ce != ce1 && unlinked_instanceof(ce, ce2)) { - return 1; + return true; } } } } - return 0; + return false; } static bool zend_type_permits_self( const zend_type type, const zend_class_entry *scope, zend_class_entry *self) { if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) { - return 1; + return true; } /* Any types that may satisfy self must have already been loaded at this point @@ -376,11 +376,11 @@ static bool zend_type_permits_self( zend_string *name = resolve_class_name(scope, ZEND_TYPE_NAME(*single_type)); const zend_class_entry *ce = lookup_class(self, name); if (ce && unlinked_instanceof(self, ce)) { - return 1; + return true; } } } ZEND_TYPE_FOREACH_END(); - return 0; + return false; } static void track_class_dependency(zend_class_entry *ce, zend_string *class_name) diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index 9459920b6332b..bcecd9790995a 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -35,7 +35,7 @@ static const char *dummy_encoding_name_getter(const zend_encoding *encoding) static bool dummy_encoding_lexer_compatibility_checker(const zend_encoding *encoding) { - return 0; + return false; } static const zend_encoding *dummy_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size) diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index f3631104c62c3..20fca00532147 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -905,14 +905,14 @@ static bool keeps_op1_alive(zend_op *opline) { || opline->opcode == ZEND_FETCH_LIST_W || opline->opcode == ZEND_COPY_TMP || opline->opcode == ZEND_EXT_STMT) { - return 1; + return true; } ZEND_ASSERT(opline->opcode != ZEND_FE_FETCH_R && opline->opcode != ZEND_FE_FETCH_RW && opline->opcode != ZEND_VERIFY_RETURN_TYPE && opline->opcode != ZEND_BIND_LEXICAL && opline->opcode != ZEND_ROPE_ADD); - return 0; + return false; } /* Live ranges must be sorted by increasing start opline */ diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 0c729755ff445..3b698cc02a7a4 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -237,7 +237,7 @@ static zend_object* zend_weakref_new(zend_class_entry *ce) { static zend_always_inline bool zend_weakref_find(zend_object *referent, zval *return_value) { void *tagged_ptr = zend_hash_index_find_ptr(&EG(weakrefs), zend_object_to_weakref_key(referent)); if (!tagged_ptr) { - return 0; + return false; } void *ptr = ZEND_WEAKREF_GET_PTR(tagged_ptr); @@ -247,7 +247,7 @@ static zend_always_inline bool zend_weakref_find(zend_object *referent, zval *re found_weakref: wr = ptr; RETVAL_OBJ_COPY(&wr->std); - return 1; + return true; } if (tag == ZEND_WEAKREF_TAG_HT) { @@ -259,7 +259,7 @@ static zend_always_inline bool zend_weakref_find(zend_object *referent, zval *re } ZEND_HASH_FOREACH_END(); } - return 0; + return false; } static zend_always_inline void zend_weakref_create(zend_object *referent, zval *return_value) { From fb91931d6655989a18bfcaff9557f4a761f490e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:25 +0200 Subject: [PATCH 068/386] com_dotnet: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/com_dotnet/com_com.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index cbbaf31277e32..129db275a72ef 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -538,7 +538,7 @@ zend_result php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_fu } /* this will create an exception if needed */ - hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0); + hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, false, false); /* release variants */ if (vargs) { @@ -649,7 +649,7 @@ zend_result php_com_do_invoke(php_com_dotnet_object *obj, zend_string *name, return FAILURE; } - return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg); + return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, false, allow_noarg); } /* {{{ Generate a globally unique identifier (GUID) */ From 34c71f817616f9b3777af87314b5c95be3393919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:34 +0200 Subject: [PATCH 069/386] date: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/date/php_date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index f6cd3eb4aecba..25b9bf7cbe667 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1898,7 +1898,7 @@ static void date_object_to_hash(php_date_obj *dateobj, HashTable *props) zval zv; /* first we add the date and time in ISO format */ - ZVAL_STR(&zv, date_format("x-m-d H:i:s.u", sizeof("x-m-d H:i:s.u")-1, dateobj->time, 1)); + ZVAL_STR(&zv, date_format("x-m-d H:i:s.u", sizeof("x-m-d H:i:s.u")-1, dateobj->time, true)); zend_hash_str_update(props, "date", sizeof("date")-1, &zv); /* then we add the timezone name (or similar) */ From 3e36598f8ac9a060cf634bb450b91b888404da13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:41 +0200 Subject: [PATCH 070/386] dba: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/dba/dba.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 41a0f8cd5eeb4..8963230353299 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -969,14 +969,14 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent) /* {{{ Opens path using the specified handler in mode persistently */ PHP_FUNCTION(dba_popen) { - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); + php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, true); } /* }}} */ /* {{{ Opens path using the specified handler in mode*/ PHP_FUNCTION(dba_open) { - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, false); } /* }}} */ From 3e30deda09ccc374457e8edc47a642136f5b95be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:48 +0200 Subject: [PATCH 071/386] ffi: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/ffi/ffi.c | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 86dfcb0c12739..8e9f4290e1b2c 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -957,7 +957,8 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v ZEND_HASH_PACKED_FOREACH_PTR(callback_data->type->func.args, arg_type) { arg_type = ZEND_FFI_TYPE(arg_type); - zend_ffi_cdata_to_zval(NULL, args[n], arg_type, BP_VAR_R, &fci.params[n], (zend_ffi_flags)(arg_type->attr & ZEND_FFI_ATTR_CONST), 0, 0); + zend_ffi_cdata_to_zval(NULL, args[n], arg_type, BP_VAR_R, &fci.params[n], (zend_ffi_flags)(arg_type->attr & ZEND_FFI_ATTR_CONST), + false, false); n++; } ZEND_HASH_FOREACH_END(); } @@ -1133,7 +1134,7 @@ static zval *zend_ffi_cdata_get(zend_object *obj, zend_string *member, int read_ return &EG(uninitialized_zval); } - zend_ffi_cdata_to_zval(cdata, cdata->ptr, type, BP_VAR_R, rv, 0, 0, 0); + zend_ffi_cdata_to_zval(cdata, cdata->ptr, type, BP_VAR_R, rv, 0, false, false); return rv; } /* }}} */ @@ -1302,7 +1303,8 @@ static zval *zend_ffi_cdata_read_field(zend_object *obj, zend_string *field_name } } ptr = (void*)(((char*)ptr) + field->offset); - zend_ffi_cdata_to_zval(NULL, ptr, field_type, read_type, rv, (cdata->flags & ZEND_FFI_FLAG_CONST) | (zend_ffi_flags)field->is_const, 0, 0); + zend_ffi_cdata_to_zval(NULL, ptr, field_type, read_type, rv, (cdata->flags & ZEND_FFI_FLAG_CONST) | (zend_ffi_flags)field->is_const, + false, false); } else { zend_ffi_bit_field_to_zval(ptr, field, rv); } @@ -1438,7 +1440,7 @@ static zval *zend_ffi_cdata_read_dim(zend_object *obj, zval *offset, int read_ty return &EG(uninitialized_zval); } - zend_ffi_cdata_to_zval(NULL, ptr, dim_type, read_type, rv, is_const, 0, 0); + zend_ffi_cdata_to_zval(NULL, ptr, dim_type, read_type, rv, is_const, false, false); return rv; } /* }}} */ @@ -1984,7 +1986,8 @@ static zval *zend_ffi_cdata_it_get_current_data(zend_object_iterator *it) /* {{{ ptr = (void*)((char*)cdata->ptr + dim_type->size * iter->it.index); zval_ptr_dtor(&iter->value); - zend_ffi_cdata_to_zval(NULL, ptr, dim_type, iter->by_ref ? BP_VAR_RW : BP_VAR_R, &iter->value, (cdata->flags & ZEND_FFI_FLAG_CONST) | (zend_ffi_flags)(type->attr & ZEND_FFI_ATTR_CONST), 0, 0); + zend_ffi_cdata_to_zval(NULL, ptr, dim_type, iter->by_ref ? BP_VAR_RW : BP_VAR_R, &iter->value, (cdata->flags & ZEND_FFI_FLAG_CONST) | (zend_ffi_flags)(type->attr & ZEND_FFI_ATTR_CONST), + false, false); return &iter->value; } /* }}} */ @@ -2082,7 +2085,7 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) case ZEND_FFI_TYPE_SINT32: case ZEND_FFI_TYPE_UINT64: case ZEND_FFI_TYPE_SINT64: - zend_ffi_cdata_to_zval(cdata, ptr, type, BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, 0, 0); + zend_ffi_cdata_to_zval(cdata, ptr, type, BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, false, false); ht = zend_new_array(1); zend_hash_str_add(ht, "cdata", sizeof("cdata")-1, &tmp); *is_temp = 1; @@ -2102,7 +2105,8 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) *is_temp = 1; return ht; } else { - zend_ffi_cdata_to_zval(NULL, *(void**)ptr, ZEND_FFI_TYPE(type->pointer.type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, 0, 0); + zend_ffi_cdata_to_zval(NULL, *(void**)ptr, ZEND_FFI_TYPE(type->pointer.type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, + false, false); ht = zend_new_array(1); zend_hash_index_add_new(ht, 0, &tmp); *is_temp = 1; @@ -2115,7 +2119,8 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) if (key) { if (!f->bits) { void *f_ptr = (void*)(((char*)ptr) + f->offset); - zend_ffi_cdata_to_zval(NULL, f_ptr, ZEND_FFI_TYPE(f->type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, 0, type->attr & ZEND_FFI_ATTR_UNION); + zend_ffi_cdata_to_zval(NULL, f_ptr, ZEND_FFI_TYPE(f->type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, + false, type->attr & ZEND_FFI_ATTR_UNION); zend_hash_add(ht, key, &tmp); } else { zend_ffi_bit_field_to_zval(ptr, f, &tmp); @@ -2128,7 +2133,8 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) case ZEND_FFI_TYPE_ARRAY: ht = zend_new_array(type->array.length); for (n = 0; n < type->array.length; n++) { - zend_ffi_cdata_to_zval(NULL, ptr, ZEND_FFI_TYPE(type->array.type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, 0, 0); + zend_ffi_cdata_to_zval(NULL, ptr, ZEND_FFI_TYPE(type->array.type), BP_VAR_R, &tmp, ZEND_FFI_FLAG_CONST, + false, false); zend_hash_index_add(ht, n, &tmp); ptr = (void*)(((char*)ptr) + ZEND_FFI_TYPE(type->array.type)->size); } @@ -2509,7 +2515,8 @@ static zval *zend_ffi_read_var(zend_object *obj, zend_string *var_name, int read } if (sym->kind == ZEND_FFI_SYM_VAR) { - zend_ffi_cdata_to_zval(NULL, sym->addr, ZEND_FFI_TYPE(sym->type), read_type, rv, (zend_ffi_flags)sym->is_const, 0, 0); + zend_ffi_cdata_to_zval(NULL, sym->addr, ZEND_FFI_TYPE(sym->type), read_type, rv, (zend_ffi_flags)sym->is_const, + false, false); } else if (sym->kind == ZEND_FFI_SYM_FUNC) { zend_ffi_cdata *cdata; zend_ffi_type *new_type = emalloc(sizeof(zend_ffi_type)); @@ -3764,14 +3771,14 @@ static zend_result zend_ffi_validate_var_type(const zend_ffi_type *type, bool al zend_ffi_throw_parser_error("function type is not allowed at line %d", FFI_G(line)); return FAILURE; } - return zend_ffi_validate_type(type, 0, allow_incomplete_array); + return zend_ffi_validate_type(type, false, allow_incomplete_array); } /* }}} */ void zend_ffi_validate_type_name(zend_ffi_dcl *dcl) /* {{{ */ { zend_ffi_finalize_type(dcl); - if (zend_ffi_validate_var_type(ZEND_FFI_TYPE(dcl->type), 0) == FAILURE) { + if (zend_ffi_validate_var_type(ZEND_FFI_TYPE(dcl->type), false) == FAILURE) { zend_ffi_cleanup_dcl(dcl); LONGJMP(FFI_G(bailout), FAILURE); } @@ -5369,7 +5376,7 @@ static zend_result zend_ffi_preload_glob(const char *filename) /* {{{ */ /* pass */ } else { for(i=0 ; iattr & ZEND_FFI_ATTR_UNION) { if (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY) { @@ -6412,7 +6419,7 @@ static zend_result zend_ffi_validate_array_element_type(const zend_ffi_type *typ zend_ffi_throw_parser_error("Only the leftmost array can be undimensioned at line %d", FFI_G(line)); return FAILURE; } - return zend_ffi_validate_type(type, 0, 1); + return zend_ffi_validate_type(type, false, true); } /* }}} */ @@ -6472,7 +6479,7 @@ static zend_result zend_ffi_validate_func_ret_type(const zend_ffi_type *type) /* zend_ffi_throw_parser_error("Function returning array is not allowed at line %d", FFI_G(line)); return FAILURE; } - return zend_ffi_validate_incomplete_type(type, 1, 0); + return zend_ffi_validate_incomplete_type(type, true, false); } /* }}} */ @@ -6646,7 +6653,7 @@ void zend_ffi_add_arg(HashTable **args, const char *name, size_t name_len, zend_ new_type->pointer.type = arg_dcl->type; arg_dcl->type = ZEND_FFI_TYPE_MAKE_OWNED(new_type); } - if (zend_ffi_validate_incomplete_type(type, 1, 1) == FAILURE) { + if (zend_ffi_validate_incomplete_type(type, true, true) == FAILURE) { zend_ffi_cleanup_dcl(arg_dcl); zend_hash_destroy(*args); pefree(*args, FFI_G(persistent)); @@ -6725,7 +6732,7 @@ void zend_ffi_declare(const char *name, size_t name_len, zend_ffi_dcl *dcl) /* { zend_ffi_type *type; type = ZEND_FFI_TYPE(dcl->type); - if (zend_ffi_validate_type(type, (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) == ZEND_FFI_DCL_EXTERN, 1) == FAILURE) { + if (zend_ffi_validate_type(type, (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) == ZEND_FFI_DCL_EXTERN, true) == FAILURE) { zend_ffi_cleanup_dcl(dcl); LONGJMP(FFI_G(bailout), FAILURE); } From 0768a16a23894e2af8356714b3958e284dabf3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:53 +0200 Subject: [PATCH 072/386] hash: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/hash/hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index ca8efc3ca48ab..98a52536a683a 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -583,7 +583,7 @@ PHP_FUNCTION(hash_hmac) RETURN_THROWS(); } - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 0); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, false); } /* }}} */ @@ -600,7 +600,7 @@ PHP_FUNCTION(hash_hmac_file) RETURN_THROWS(); } - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 1); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, true); } /* }}} */ @@ -1227,9 +1227,9 @@ PHP_FUNCTION(mhash) } if (key) { - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, 1, 0); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, true, false); } else { - php_hash_do_hash(return_value, algo, data, data_len, 1, 0, NULL); + php_hash_do_hash(return_value, algo, data, data_len, true, false, NULL); } if (algo) { From 753f287a37dc968338f10889c7efc5ed1a6f843f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:58 +0200 Subject: [PATCH 073/386] mbstring: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/mbstring/mbstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index f05a83b97c6ec..34d759ae30e4b 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -729,7 +729,7 @@ static zend_result _php_mb_ini_mbstring_http_input_set(const char *new_value, si list = (const mbfl_encoding**)pecalloc(1, sizeof(mbfl_encoding*), 1); *list = &mbfl_encoding_pass; size = 1; - } else if (FAILURE == php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, /* persistent */ 1, /* arg_num */ 0) || size == 0) { + } else if (FAILURE == php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, /* persistent */ true, /* arg_num */ 0) || size == 0) { return FAILURE; } if (MBSTRG(http_input_list)) { From 3ef25050927999abb8609860d50db2f0b6187297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:05 +0200 Subject: [PATCH 074/386] opcache: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/opcache/jit/zend_jit.c | 4 +- ext/opcache/jit/zend_jit_ir.c | 167 +++++++++++----------- ext/opcache/jit/zend_jit_trace.c | 2 +- ext/opcache/zend_accelerator_util_funcs.c | 8 +- 4 files changed, 92 insertions(+), 89 deletions(-) diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 26052c4f13bbe..7e5eb6abbbc95 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3917,12 +3917,12 @@ void zend_jit_deactivate(void) SHM_UNPROTECT(); zend_jit_unprotect(); - zend_jit_check_funcs(EG(function_table), 0); + zend_jit_check_funcs(EG(function_table), false); ZEND_HASH_MAP_REVERSE_FOREACH_PTR(EG(class_table), ce) { if (ce->type == ZEND_INTERNAL_CLASS) { break; } - zend_jit_check_funcs(&ce->function_table, 1); + zend_jit_check_funcs(&ce->function_table, true); } ZEND_HASH_FOREACH_END(); zend_jit_protect(); diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index ac306d0cd4c79..1c5cab899e783 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -1897,7 +1897,7 @@ static void jit_FREE_OP(zend_jit_ctx *jit, if (op_type & (IS_VAR|IS_TMP_VAR)) { jit_ZVAL_PTR_DTOR(jit, ZEND_ADDR_MEM_ZVAL(ZREG_FP, op.var), - op_info, 0, opline); + op_info, false, opline); } } @@ -2030,7 +2030,7 @@ static int zend_jit_exception_handler_free_op1_op2_stub(zend_jit_ctx *jit) } ref = ir_ADD_A(jit_FP(jit), ref); var_addr = ZEND_ADDR_REF_ZVAL(ref); - jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, 0, NULL); + jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, false, NULL); ir_MERGE_WITH_EMPTY_FALSE(if_dtor); ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler_free_op2)); @@ -2053,7 +2053,7 @@ static int zend_jit_exception_handler_free_op2_stub(zend_jit_ctx *jit) } ref = ir_ADD_A(jit_FP(jit), ref); var_addr = ZEND_ADDR_REF_ZVAL(ref); - jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, 0, NULL); + jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, false, NULL); ir_MERGE_WITH_EMPTY_FALSE(if_dtor); ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler_undef)); @@ -2236,7 +2236,7 @@ static int zend_jit_throw_cannot_pass_by_ref_stub(zend_jit_ctx *jit) ref = ir_ADD_A(jit_FP(jit), ref); jit_ZVAL_PTR_DTOR(jit, ZEND_ADDR_REF_ZVAL(ref), - MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, 0, NULL); + MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF, false, NULL); ir_MERGE_WITH_EMPTY_FALSE(if_tmp); ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler)); @@ -2608,7 +2608,7 @@ static int zend_jit_assign_const_stub(zend_jit_ctx *jit) jit, NULL, var_addr, var_addr, -1, -1, IS_CONST, val_addr, val_info, - 0, 0, 0)) { + 0, 0, false)) { return 0; } ir_RETURN(IR_VOID); @@ -2628,7 +2628,7 @@ static int zend_jit_assign_tmp_stub(zend_jit_ctx *jit) jit, NULL, var_addr, var_addr, -1, -1, IS_TMP_VAR, val_addr, val_info, - 0, 0, 0)) { + 0, 0, false)) { return 0; } ir_RETURN(IR_VOID); @@ -2648,7 +2648,7 @@ static int zend_jit_assign_var_stub(zend_jit_ctx *jit) jit, NULL, var_addr, var_addr, -1, -1, IS_VAR, val_addr, val_info, - 0, 0, 0)) { + 0, 0, false)) { return 0; } ir_RETURN(IR_VOID); @@ -2668,7 +2668,7 @@ static int zend_jit_assign_cv_noref_stub(zend_jit_ctx *jit) jit, NULL, var_addr, var_addr, -1, -1, IS_CV, val_addr, val_info, - 0, 0, 0)) { + 0, 0, false)) { return 0; } ir_RETURN(IR_VOID); @@ -2700,7 +2700,7 @@ static int zend_jit_assign_cv_stub(zend_jit_ctx *jit) jit, NULL, var_addr, var_addr, -1, -1, IS_CV, val_addr, val_info, - 0, 0, 0)) { + 0, 0, false)) { return 0; } ir_RETURN(IR_VOID); @@ -4509,7 +4509,7 @@ static int zend_jit_store_var_if_necessary(zend_jit_ctx *jit, int var, zend_jit_ { if (Z_MODE(src) == IS_REG && Z_STORE(src)) { zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, var); - return zend_jit_spill_store(jit, src, dst, info, 1); + return zend_jit_spill_store(jit, src, dst, info, true); } return 1; } @@ -4982,7 +4982,7 @@ static int zend_jit_inc_dec(zend_jit_ctx *jit, const zend_op *opline, uint32_t o jit_ZVAL_COPY(jit, res_addr, res_use_info, - ZEND_ADDR_REF_ZVAL(ref), op1_info, 1); + ZEND_ADDR_REF_ZVAL(ref), op1_info, true); } if (opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_POST_INC) { if (opline->opcode == ZEND_PRE_INC && opline->result_type != IS_UNUSED) { @@ -6273,16 +6273,16 @@ static int zend_jit_simple_assign(zend_jit_ctx *jit, jit_ZVAL_COPY_CONST(jit, var_addr, var_info, var_def_info, - zv, 1); + zv, true); } else { jit_ZVAL_COPY_CONST(jit, var_addr, var_info, var_def_info, - zv, 1); + zv, true); jit_ZVAL_COPY_CONST(jit, res_addr, -1, var_def_info, - zv, 1); + zv, true); } } else { if (val_info & MAY_BE_UNDEF) { @@ -6327,7 +6327,7 @@ static int zend_jit_simple_assign(zend_jit_ctx *jit, jit_ZVAL_COPY(jit, var_addr, var_info, - ZEND_ADDR_REF_ZVAL(ref2), val_info, 1); + ZEND_ADDR_REF_ZVAL(ref2), val_info, true); } else { jit_ZVAL_COPY_2(jit, res_addr, @@ -6582,7 +6582,7 @@ static int zend_jit_assign_to_variable(zend_jit_ctx *jit, } ref = jit_Z_PTR(jit, var_use_addr); if (RC_MAY_BE_1(var_info)) { - if (!zend_jit_simple_assign(jit, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, 0)) { + if (!zend_jit_simple_assign(jit, opline, var_addr, var_info, var_def_info, val_type, val_addr, val_info, res_addr, false)) { return 0; } counter = jit_GC_DELREF(jit, ref); @@ -6700,7 +6700,7 @@ static int zend_jit_qm_assign(zend_jit_ctx *jit, const zend_op *opline, uint32_t } } - if (!zend_jit_simple_assign(jit, opline, res_addr, res_use_info, res_info, opline->op1_type, op1_addr, op1_info, 0, 1)) { + if (!zend_jit_simple_assign(jit, opline, res_addr, res_use_info, res_info, opline->op1_type, op1_addr, op1_info, 0, true)) { return 0; } if (!zend_jit_store_var_if_necessary(jit, opline->result.var, res_addr, res_info)) { @@ -7206,11 +7206,11 @@ static int zend_jit_cmp(zend_jit_ctx *jit, op1 = jit_ZVAL_ADDR(jit, op1_addr); if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { - op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, NULL, 0); + op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, NULL, false); } op2 = jit_ZVAL_ADDR(jit, op2_addr); if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) { - op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, NULL, 0); + op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, NULL, false); } ref = ir_CALL_2(IR_I32, ir_CONST_FC_FUNC(zend_compare), op1, op2); if (opline->opcode != ZEND_CASE) { @@ -7308,13 +7308,13 @@ static int zend_jit_identical(zend_jit_ctx *jit, if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { ir_ref op1 = jit_ZVAL_ADDR(jit, op1_addr); - op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, opline, 0); + op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, opline, false); op1_info |= MAY_BE_NULL; op1_addr = ZEND_ADDR_REF_ZVAL(op1); } if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) { ir_ref op2 = jit_ZVAL_ADDR(jit, op2_addr); - op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, opline, 0); + op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, opline, false); op2_info |= MAY_BE_NULL; op2_addr = ZEND_ADDR_REF_ZVAL(op2); } @@ -7581,7 +7581,7 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 } else if (!(op1_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_FALSE)))) { if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { ref = jit_ZVAL_ADDR(jit, op1_addr); - zend_jit_zval_check_undef(jit, ref, opline->op1.var, opline, 0); + zend_jit_zval_check_undef(jit, ref, opline->op1.var, opline, false); } always_false = true; } @@ -7628,7 +7628,7 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 zend_jit_type_check_undef(jit, type, opline->op1.var, - opline, 1, 0, 1); + opline, true, false, true); } if (set_bool) { jit_set_Z_TYPE_INFO(jit, res_addr, set_bool_not ? IS_TRUE : IS_FALSE); @@ -7985,7 +7985,7 @@ static int zend_jit_restore_zval(zend_jit_ctx *jit, int var, int8_t reg) zend_jit_addr reg_addr = ZEND_ADDR_REF_ZVAL(zend_jit_deopt_rload(jit, IR_ADDR, reg)); // JIT: ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); (no dup) - jit_ZVAL_COPY(jit, var_addr, MAY_BE_ANY, reg_addr, MAY_BE_ANY, 1); + jit_ZVAL_COPY(jit, var_addr, MAY_BE_ANY, reg_addr, MAY_BE_ANY, true); return 1; } @@ -8122,7 +8122,7 @@ static int zend_jit_fetch_constant(zend_jit_ctx *jit, uint8_t type = concrete_type(res_info); zend_jit_addr const_addr = ZEND_ADDR_REF_ZVAL(ref); - const_addr = zend_jit_guard_fetch_result_type(jit, opline, const_addr, type, 0, 0, 0); + const_addr = zend_jit_guard_fetch_result_type(jit, opline, const_addr, type, false, 0, false); if (!const_addr) { return 0; } @@ -8131,7 +8131,7 @@ static int zend_jit_fetch_constant(zend_jit_ctx *jit, ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; // JIT: ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); (no dup) - jit_ZVAL_COPY(jit, res_addr, MAY_BE_ANY, const_addr, res_info, 1); + jit_ZVAL_COPY(jit, res_addr, MAY_BE_ANY, const_addr, res_info, true); if (!zend_jit_store_var_if_necessary(jit, opline->result.var, res_addr, res_info)) { return 0; } @@ -8139,7 +8139,7 @@ static int zend_jit_fetch_constant(zend_jit_ctx *jit, ir_ref const_addr = ZEND_ADDR_REF_ZVAL(ref); // JIT: ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); (no dup) - jit_ZVAL_COPY(jit, res_addr, MAY_BE_ANY, const_addr, MAY_BE_ANY, 1); + jit_ZVAL_COPY(jit, res_addr, MAY_BE_ANY, const_addr, MAY_BE_ANY, true); } @@ -8890,7 +8890,7 @@ jit_SET_EX_OPLINE(jit, opline); func_ref = ir_PHI_2(IR_ADDR, ref, func_ref); } - if (!zend_jit_push_call_frame(jit, opline, op_array, func, 0, 0, checked_stack, func_ref, IR_UNUSED)) { + if (!zend_jit_push_call_frame(jit, opline, op_array, func, false, false, checked_stack, func_ref, IR_UNUSED)) { return 0; } @@ -9149,7 +9149,7 @@ static int zend_jit_init_method_call(zend_jit_ctx *jit, } if (!func || (func->common.fn_flags & ZEND_ACC_STATIC) == 0) { - if (!zend_jit_push_call_frame(jit, opline, NULL, func, 0, delayed_fetch_this, checked_stack, func_ref, this_ref)) { + if (!zend_jit_push_call_frame(jit, opline, NULL, func, false, delayed_fetch_this, checked_stack, func_ref, this_ref)) { return 0; } } @@ -9327,7 +9327,7 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit, scope_ref = ir_LOAD_A(ir_ADD_OFFSET(ir_LOAD_A(jit_EX(This.value.ref)), offsetof(zend_object, ce))); } } - if (!zend_jit_push_call_frame(jit, opline, op_array, func, 0, 0, checked_stack, func_ref, scope_ref)) { + if (!zend_jit_push_call_frame(jit, opline, op_array, func, false, false, checked_stack, func_ref, scope_ref)) { return 0; } @@ -9425,7 +9425,7 @@ static int zend_jit_init_closure_call(zend_jit_ctx *jit, } } - if (!zend_jit_push_call_frame(jit, opline, NULL, func, 1, 0, checked_stack, ref, IR_UNUSED)) { + if (!zend_jit_push_call_frame(jit, opline, NULL, func, true, false, checked_stack, ref, IR_UNUSED)) { return 0; } @@ -9513,12 +9513,12 @@ static int zend_jit_send_val(zend_jit_ctx *jit, const zend_op *opline, uint32_t jit_ZVAL_COPY_CONST(jit, arg_addr, MAY_BE_ANY, MAY_BE_ANY, - zv, 1); + zv, true); } else { jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); } return 1; @@ -9592,7 +9592,7 @@ static int zend_jit_send_ref(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, ref_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); // JIT: ZVAL_REFERENCE(arg, ref) jit_set_Z_PTR(jit, op1_addr, ref); @@ -9666,7 +9666,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); if (!ARG_MAY_BE_SENT_BY_REF(JIT_G(current_frame)->call->func, arg_num)) { if (!(op1_info & MAY_BE_REF)) { @@ -9703,7 +9703,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); if (op1_info & MAY_BE_REF) { ir_ref if_ref = jit_if_Z_TYPE(jit, arg_addr, IS_REFERENCE); @@ -9800,7 +9800,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); if (op1_info & MAY_BE_REF) { // JIT: if (Z_TYPE_P(arg) == IS_REFERENCE) ir_ref if_ref = jit_if_Z_TYPE(jit, arg_addr, IS_REFERENCE); @@ -9835,7 +9835,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 1); + op1_addr, op1_info, true); } else { ir_ref if_ref, ref, ref2, refcount, if_not_zero, if_refcounted; zend_jit_addr ref_addr; @@ -9853,7 +9853,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - ref_addr, op1_info, 0); + ref_addr, op1_info, false); // JIT: if (GC_DELREF(ref) != 0) refcount = jit_GC_DELREF(jit, ref); @@ -9881,7 +9881,7 @@ static int zend_jit_send_var(zend_jit_ctx *jit, const zend_op *opline, const zen jit_ZVAL_COPY(jit, arg_addr, MAY_BE_ANY, - op1_addr, op1_info, 0); + op1_addr, op1_info, false); } } else { if (op1_addr != op1_def_addr) { @@ -10593,7 +10593,8 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen uint32_t offset = EX_NUM_TO_VAR(i); zend_jit_addr var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, offset); - jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, 0, opline); + jit_ZVAL_PTR_DTOR(jit, var_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, false, + opline); } } } else { @@ -10680,7 +10681,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen #endif } res_addr = ZEND_ADDR_REF_ZVAL(sp); - jit_ZVAL_PTR_DTOR(jit, res_addr, func_info, 1, opline); + jit_ZVAL_PTR_DTOR(jit, res_addr, func_info, true, opline); } if (!jit->ctx.fixed_call_stack_size) { // JIT: revert alloca @@ -10863,7 +10864,7 @@ static int zend_jit_recv(zend_jit_ctx *jit, const zend_op *opline, const zend_op } if (arg_info) { - if (!zend_jit_verify_arg_type(jit, opline, arg_info, 1)) { + if (!zend_jit_verify_arg_type(jit, opline, arg_info, true)) { return 0; } } @@ -10885,7 +10886,7 @@ static int zend_jit_recv_init(zend_jit_ctx *jit, const zend_op *opline, const ze jit_ZVAL_COPY_CONST(jit, res_addr, -1, -1, - zv, 1); + zv, true); } } else { if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE || @@ -10898,7 +10899,7 @@ static int zend_jit_recv_init(zend_jit_ctx *jit, const zend_op *opline, const ze jit_ZVAL_COPY_CONST(jit, res_addr, -1, -1, - zv, 1); + zv, true); } if (Z_CONSTANT_P(zv)) { @@ -10909,7 +10910,7 @@ static int zend_jit_recv_init(zend_jit_ctx *jit, const zend_op *opline, const ze if_fail = ir_IF(ref); ir_IF_TRUE_cold(if_fail); - jit_ZVAL_PTR_DTOR(jit, res_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, 1, opline); + jit_ZVAL_PTR_DTOR(jit, res_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, true, opline); ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler)); ir_IF_FALSE(if_fail); } @@ -10978,7 +10979,7 @@ static bool zend_jit_verify_return_type(zend_jit_ctx *jit, const zend_op *opline jit_SET_EX_OPLINE(jit, opline); ref = jit_ZVAL_ADDR(jit, op1_addr); if (op1_info & MAY_BE_UNDEF) { - ref = zend_jit_zval_check_undef(jit, ref, opline->op1.var, NULL, 1); + ref = zend_jit_zval_check_undef(jit, ref, opline->op1.var, NULL, true); } ir_CALL_3(IR_VOID, ir_CONST_FC_FUNC(zend_jit_verify_return_slow), @@ -11018,7 +11019,7 @@ static int zend_jit_free_cv(zend_jit_ctx *jit, uint32_t info, uint32_t var) if (info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) { zend_jit_addr var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, EX_NUM_TO_VAR(var)); - jit_ZVAL_PTR_DTOR(jit, var_addr, info, 1, NULL); + jit_ZVAL_PTR_DTOR(jit, var_addr, info, true, NULL); } return 1; } @@ -11026,7 +11027,7 @@ static int zend_jit_free_cv(zend_jit_ctx *jit, uint32_t info, uint32_t var) static int zend_jit_free_op(zend_jit_ctx *jit, const zend_op *opline, uint32_t info, uint32_t var_offset) { if (info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) { - jit_ZVAL_PTR_DTOR(jit, ZEND_ADDR_MEM_ZVAL(ZREG_FP, var_offset), info, 0, opline); + jit_ZVAL_PTR_DTOR(jit, ZEND_ADDR_MEM_ZVAL(ZREG_FP, var_offset), info, false, opline); } return 1; } @@ -11350,9 +11351,9 @@ static int zend_jit_return(zend_jit_ctx *jit, const zend_op *opline, const zend_ if (opline->op1_type == IS_CONST) { zval *zv = RT_CONSTANT(opline, opline->op1); - jit_ZVAL_COPY_CONST(jit, ret_addr, MAY_BE_ANY, MAY_BE_ANY, zv, 1); + jit_ZVAL_COPY_CONST(jit, ret_addr, MAY_BE_ANY, MAY_BE_ANY, zv, true); } else if (opline->op1_type == IS_TMP_VAR) { - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, false); } else if (opline->op1_type == IS_CV) { if (op1_info & MAY_BE_REF) { ref = jit_ZVAL_ADDR(jit, op1_addr); @@ -11364,16 +11365,16 @@ static int zend_jit_return(zend_jit_ctx *jit, const zend_op *opline, const zend_ if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE || (op1_info & (MAY_BE_REF|MAY_BE_OBJECT)) || !op_array->function_name) { - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 1); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, true); } else if (return_value_used != 1) { - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, false); // JIT: if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) ZVAL_NULL(retval_ptr); jit_set_Z_TYPE_INFO(jit, op1_addr, IS_NULL); } else { - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, false); } } else { - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, false); } } else { if (op1_info & MAY_BE_REF) { @@ -11389,7 +11390,7 @@ static int zend_jit_return(zend_jit_ctx *jit, const zend_op *opline, const zend_ // JIT: ZVAL_COPY_VALUE(return_value, &ref->value) ref2 = ir_ADD_OFFSET(ref, offsetof(zend_reference, val)); ref_addr = ZEND_ADDR_REF_ZVAL(ref2); - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, ref_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, ref_addr, op1_info, false); ref2 = jit_GC_DELREF(jit, ref); if_non_zero = ir_IF(ref2); ir_IF_TRUE(if_non_zero); @@ -11412,7 +11413,7 @@ static int zend_jit_return(zend_jit_ctx *jit, const zend_op *opline, const zend_ ir_IF_FALSE(if_ref); } - jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, 0); + jit_ZVAL_COPY(jit, ret_addr, MAY_BE_ANY, op1_addr, op1_info, false); } if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) { @@ -11568,7 +11569,7 @@ static int zend_jit_free(zend_jit_ctx *jit, const zend_op *opline, uint32_t op1_ ir_MERGE_list(end_inputs); } - jit_ZVAL_PTR_DTOR(jit, op1_addr, op1_info, 0, opline); + jit_ZVAL_PTR_DTOR(jit, op1_addr, op1_info, false, opline); if (may_throw) { zend_jit_check_exception(jit); @@ -11611,7 +11612,7 @@ static int zend_jit_echo(zend_jit_ctx *jit, const zend_op *opline, uint32_t op1_ ir_LOAD_A(ir_ADD_OFFSET(ref, offsetof(zend_string, len)))); if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { - jit_ZVAL_PTR_DTOR(jit, op1_addr, op1_info, 0, opline); + jit_ZVAL_PTR_DTOR(jit, op1_addr, op1_info, false, opline); } zend_jit_check_exception(jit); @@ -12688,7 +12689,7 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit, } } else { // ZVAL_COPY - jit_ZVAL_COPY(jit, res_addr, -1, val_addr, res_info, 1); + jit_ZVAL_COPY(jit, res_addr, -1, val_addr, res_info, true); } ir_END_list(end_inputs); @@ -12795,12 +12796,14 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit, jit_SET_EX_OPLINE(jit, opline); if (opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) { may_throw = 1; - zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op1_addr), opline->op1.var, NULL, 0, 1, 0); + zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op1_addr), opline->op1.var, NULL, + false, true, false); } if (op2_info & MAY_BE_UNDEF) { may_throw = 1; - zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op2_addr), opline->op2.var, NULL, 0, 1, 0); + zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op2_addr), opline->op2.var, NULL, + false, true, false); } } @@ -13050,7 +13053,7 @@ static int zend_jit_fetch_dim(zend_jit_ctx *jit, } if (!zend_jit_fetch_dimension_address_inner(jit, opline, type, op1_info, op2_info, op2_addr, op2_range, dim_type, NULL, NULL, NULL, - 0, ht_ref, found_inputs, found_vals, &end_inputs, NULL)) { + false, ht_ref, found_inputs, found_vals, &end_inputs, NULL)) { return 0; } @@ -13211,7 +13214,7 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit, } if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_JIT_IS, op1_info, op2_info, op2_addr, op2_range, dim_type, found_exit_addr, not_found_exit_addr, NULL, - 0, ht_ref, true_inputs, NULL, &false_inputs, NULL)) { + false, ht_ref, true_inputs, NULL, &false_inputs, NULL)) { return 0; } @@ -13412,7 +13415,7 @@ static int zend_jit_assign_dim(zend_jit_ctx *jit, ir_IF_TRUE(if_ok); var_addr = ZEND_ADDR_REF_ZVAL(ref); - if (!zend_jit_simple_assign(jit, opline, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0)) { + if (!zend_jit_simple_assign(jit, opline, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, false)) { return 0; } } else { @@ -13426,7 +13429,7 @@ static int zend_jit_assign_dim(zend_jit_ctx *jit, if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_W, op1_info, op2_info, op2_addr, op2_range, dim_type, NULL, NULL, NULL, - 0, ht_ref, found_inputs, found_values, &end_inputs, NULL)) { + false, ht_ref, found_inputs, found_values, &end_inputs, NULL)) { return 0; } @@ -13447,11 +13450,11 @@ static int zend_jit_assign_dim(zend_jit_ctx *jit, && Z_MODE(op3_addr) != IS_REG && opline->result_type == IS_UNUSED && (res_addr == 0 || Z_MODE(res_addr) != IS_REG)) { - if (!zend_jit_assign_to_variable_call(jit, opline, var_addr, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0)) { + if (!zend_jit_assign_to_variable_call(jit, opline, var_addr, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, false)) { return 0; } } else { - if (!zend_jit_assign_to_variable(jit, opline, var_addr, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0, 0)) { + if (!zend_jit_assign_to_variable(jit, opline, var_addr, var_addr, var_info, -1, (opline+1)->op1_type, op3_addr, val_info, res_addr, 0, false)) { return 0; } } @@ -13612,7 +13615,7 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_RW, op1_info, op2_info, op2_addr, op2_range, dim_type, NULL, not_found_exit_addr, NULL, - 0, ht_ref, found_inputs, found_values, &end_inputs, NULL)) { + false, ht_ref, found_inputs, found_values, &end_inputs, NULL)) { return 0; } @@ -13760,7 +13763,7 @@ static int zend_jit_fe_reset(zend_jit_ctx *jit, const zend_op *opline, uint32_t if (opline->op1_type == IS_CONST) { zval *zv = RT_CONSTANT(opline, opline->op1); - jit_ZVAL_COPY_CONST(jit, res_addr, MAY_BE_ANY, MAY_BE_ANY, zv, 1); + jit_ZVAL_COPY_CONST(jit, res_addr, MAY_BE_ANY, MAY_BE_ANY, zv, true); } else { zend_jit_addr op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var); @@ -14098,12 +14101,12 @@ static int zend_jit_fe_fetch(zend_jit_ctx *jit, const zend_op *opline, uint32_t val_addr = ZEND_ADDR_REF_ZVAL(p_ref); if (opline->op2_type == IS_CV) { // JIT: zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); - if (!zend_jit_assign_to_variable(jit, opline, var_addr, var_addr, op2_info, -1, IS_CV, val_addr, val_info, 0, 0, 1)) { + if (!zend_jit_assign_to_variable(jit, opline, var_addr, var_addr, op2_info, -1, IS_CV, val_addr, val_info, 0, 0, true)) { return 0; } } else { // JIT: ZVAL_COPY(res, value); - jit_ZVAL_COPY(jit, var_addr, -1, val_addr, val_info, 1); + jit_ZVAL_COPY(jit, var_addr, -1, val_addr, val_info, true); } if (!exit_addr) { @@ -14664,7 +14667,7 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit, } val_addr = zend_jit_guard_fetch_result_type(jit, opline, val_addr, type, - 1, flags, op1_avoid_refcounting); + true, flags, op1_avoid_refcounting); if (!val_addr) { return 0; } @@ -15000,7 +15003,7 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit, if (Z_MODE(val_addr) != IS_REG && (res_addr == 0 || Z_MODE(res_addr) != IS_REG) && opline->result_type == IS_UNUSED) { - if (!zend_jit_assign_to_variable_call(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, res_addr, 0)) { + if (!zend_jit_assign_to_variable_call(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, res_addr, false)) { return 0; } } else { @@ -15011,7 +15014,7 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit, } else { real_res_addr = res_addr; } - if (!zend_jit_assign_to_variable(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, real_res_addr, 0, 0)) { + if (!zend_jit_assign_to_variable(jit, opline, prop_addr, prop_addr, -1, -1, (opline+1)->op1_type, val_addr, val_info, real_res_addr, 0, false)) { return 0; } } @@ -15867,7 +15870,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit, ir_IF_FALSE_cold(if_long); } if (opline->opcode == ZEND_POST_INC_OBJ || opline->opcode == ZEND_POST_DEC_OBJ) { - jit_ZVAL_COPY(jit, res_addr, -1, var_addr, var_info, 1); + jit_ZVAL_COPY(jit, res_addr, -1, var_addr, var_info, true); } if (opline->opcode == ZEND_PRE_INC_OBJ || opline->opcode == ZEND_POST_INC_OBJ) { if (opline->opcode == ZEND_PRE_INC_OBJ && opline->result_type != IS_UNUSED) { @@ -17789,7 +17792,7 @@ static void jit_frameless_icall1(zend_jit_ctx *jit, const zend_op *opline, uint3 ir_ref op1_ref = jit_ZVAL_ADDR(jit, op1_addr); jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL); if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { - op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, 1); + op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, true); op1_info &= ~MAY_BE_UNDEF; op1_info |= MAY_BE_NULL; op1_addr = ZEND_ADDR_REF_ZVAL(op1_ref); @@ -17834,13 +17837,13 @@ static void jit_frameless_icall2(zend_jit_ctx *jit, const zend_op *opline, uint3 ir_ref op2_ref = jit_ZVAL_ADDR(jit, op2_addr); jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL); if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { - op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, 1); + op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, true); op1_info &= ~MAY_BE_UNDEF; op1_info |= MAY_BE_NULL; op1_addr = ZEND_ADDR_REF_ZVAL(op1_ref); } if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) { - op2_ref = zend_jit_zval_check_undef(jit, op2_ref, opline->op2.var, opline, 1); + op2_ref = zend_jit_zval_check_undef(jit, op2_ref, opline->op2.var, opline, true); op2_info &= ~MAY_BE_UNDEF; op2_info |= MAY_BE_NULL; op2_addr = ZEND_ADDR_REF_ZVAL(op2_ref); @@ -17906,19 +17909,19 @@ static void jit_frameless_icall3(zend_jit_ctx *jit, const zend_op *opline, uint3 ir_ref op3_ref = jit_ZVAL_ADDR(jit, op3_addr); jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL); if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) { - op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, 1); + op1_ref = zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, true); op1_info &= ~MAY_BE_UNDEF; op1_info |= MAY_BE_NULL; op1_addr = ZEND_ADDR_REF_ZVAL(op1_ref); } if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) { - op2_ref = zend_jit_zval_check_undef(jit, op2_ref, opline->op2.var, opline, 1); + op2_ref = zend_jit_zval_check_undef(jit, op2_ref, opline->op2.var, opline, true); op2_info &= ~MAY_BE_UNDEF; op2_info |= MAY_BE_NULL; op2_addr = ZEND_ADDR_REF_ZVAL(op2_ref); } if ((opline+1)->op1_type == IS_CV && (op1_data_info & MAY_BE_UNDEF)) { - op3_ref = zend_jit_zval_check_undef(jit, op3_ref, (opline+1)->op1.var, opline, 1); + op3_ref = zend_jit_zval_check_undef(jit, op3_ref, (opline+1)->op1.var, opline, true); op1_data_info &= ~MAY_BE_UNDEF; op1_data_info |= MAY_BE_NULL; op3_addr = ZEND_ADDR_REF_ZVAL(op3_ref); diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 1abb05d9e4178..5e10237d62f18 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -7453,7 +7453,7 @@ static zend_vm_opcode_handler_t zend_jit_trace_exit_to_vm(uint32_t trace_num, ui &zend_jit_traces[trace_num].exit_info[exit_num], stack, stack_size, NULL, NULL, zend_jit_traces[trace_num].constants, - 0)) { + false)) { goto jit_failure; } diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 21f056901fd1b..9f26cab468a1e 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -186,12 +186,12 @@ static zend_always_inline void _zend_accel_function_hash_copy(HashTable *target, static zend_always_inline void zend_accel_function_hash_copy(HashTable *target, HashTable *source) { - _zend_accel_function_hash_copy(target, source, 0); + _zend_accel_function_hash_copy(target, source, false); } static zend_never_inline void zend_accel_function_hash_copy_notify(HashTable *target, HashTable *source) { - _zend_accel_function_hash_copy(target, source, 1); + _zend_accel_function_hash_copy(target, source, true); } static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, HashTable *source, bool call_observers) @@ -247,12 +247,12 @@ static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, Ha static zend_always_inline void zend_accel_class_hash_copy(HashTable *target, HashTable *source) { - _zend_accel_class_hash_copy(target, source, 0); + _zend_accel_class_hash_copy(target, source, false); } static zend_never_inline void zend_accel_class_hash_copy_notify(HashTable *target, HashTable *source) { - _zend_accel_class_hash_copy(target, source, 1); + _zend_accel_class_hash_copy(target, source, true); } void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persistent_script) From c5b344d81126e7def94a539ed43f0877f1be8886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:11 +0200 Subject: [PATCH 075/386] openssl: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/openssl/xp_ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 927afeb27891c..a422d7b0c1bf4 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1701,7 +1701,7 @@ static zend_result php_openssl_setup_crypto(php_stream *stream, } if (!SSL_set_fd(sslsock->ssl_handle, sslsock->s.socket)) { - php_openssl_handle_ssl_error(stream, 0, 1); + php_openssl_handle_ssl_error(stream, 0, true); } #ifdef HAVE_TLS_SNI @@ -2020,7 +2020,7 @@ static ssize_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, si /* Get the error code from SSL, and check to see if it's an error or not. */ int err = SSL_get_error(sslsock->ssl_handle, nr_bytes ); - retry = php_openssl_handle_ssl_error(stream, nr_bytes, 0); + retry = php_openssl_handle_ssl_error(stream, nr_bytes, false); /* If we get this (the above doesn't check) then we'll retry as well. */ if (errno == EAGAIN && err == SSL_ERROR_WANT_READ && read) { From a5afa4a266f988590baaca134f305837dc761ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:17 +0200 Subject: [PATCH 076/386] pdo: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/pdo/pdo_dbh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index c3cc36790c611..b34653e286728 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1594,7 +1594,7 @@ static void pdo_dbh_free_storage(zend_object *std) dbh->methods->persistent_shutdown(dbh); } zend_object_std_dtor(std); - dbh_free(dbh, 0); + dbh_free(dbh, false); } zend_object *pdo_dbh_new(zend_class_entry *ce) @@ -1618,7 +1618,7 @@ ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor) /* {{{ */ { if (res->ptr) { pdo_dbh_t *dbh = (pdo_dbh_t*)res->ptr; - dbh_free(dbh, 1); + dbh_free(dbh, true); res->ptr = NULL; } } From d793de1a8cf3e9ab771602b10621cee54c5fed97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:22 +0200 Subject: [PATCH 077/386] pgsql: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/pgsql/pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d97d0faa1a4b2..feea2ed60e6f4 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4922,7 +4922,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string * array_init(&meta); /* table_name is escaped by php_pgsql_meta_data */ - if (php_pgsql_meta_data(pg_link, table_name, &meta, 0) == FAILURE) { + if (php_pgsql_meta_data(pg_link, table_name, &meta, false) == FAILURE) { zval_ptr_dtor(&meta); return FAILURE; } From 26f88c67e19e76f07b1312b30c6a4f2ccb593c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:28 +0200 Subject: [PATCH 078/386] phar: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/phar/phar.c | 2 +- ext/phar/stream.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 651bd72256a6b..5a5012adbf18e 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2339,7 +2339,7 @@ zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **er return FAILURE; } - if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, 0, REPORT_ERRORS, NULL, 0) == SUCCESS) { + if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, false, REPORT_ERRORS, NULL, 0) == SUCCESS) { return SUCCESS; } diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 2ac8e79c4c0bd..2317c07d6411b 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -546,7 +546,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ return -1; } - phar_dostat(data->phar, data->internal_file, ssb, 0); + phar_dostat(data->phar, data->internal_file, ssb, false); return 0; } /* }}} */ @@ -594,7 +594,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f } if (*internal_file == '\0') { /* root directory requested */ - phar_dostat(phar, NULL, ssb, 1); + phar_dostat(phar, NULL, ssb, true); php_url_free(resource); return SUCCESS; } @@ -605,12 +605,12 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f internal_file_len = strlen(internal_file); /* search through the manifest of files, and if we have an exact match, it's a file */ if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) { - phar_dostat(phar, entry, ssb, 0); + phar_dostat(phar, entry, ssb, false); php_url_free(resource); return SUCCESS; } if (zend_hash_str_exists(&(phar->virtual_dirs), internal_file, internal_file_len)) { - phar_dostat(phar, NULL, ssb, 1); + phar_dostat(phar, NULL, ssb, true); php_url_free(resource); return SUCCESS; } @@ -646,7 +646,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) { goto free_resource; } - phar_dostat(phar, entry, ssb, 0); + phar_dostat(phar, entry, ssb, false); php_url_free(resource); return SUCCESS; } From 8e66b4eaf1887cd7c87db6a0078de8f5c56348da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:34 +0200 Subject: [PATCH 079/386] reflection: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/reflection/php_reflection.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 17bb280a87b1e..a0c1b9f812430 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2832,7 +2832,7 @@ ZEND_METHOD(ReflectionParameter, getType) if (!ZEND_TYPE_IS_SET(param->arg_info->type)) { RETURN_NULL(); } - reflection_type_factory(param->arg_info->type, return_value, 1); + reflection_type_factory(param->arg_info->type, return_value, true); } /* }}} */ @@ -3177,7 +3177,7 @@ static void append_type(zval *return_value, zend_type type) { ZEND_TYPE_FULL_MASK(type) &= ~_ZEND_TYPE_ITERABLE_BIT; } - reflection_type_factory(type, &reflection_type, 0); + reflection_type_factory(type, &reflection_type, false); zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &reflection_type); } @@ -3679,7 +3679,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getReturnType) RETURN_NULL(); } - reflection_type_factory(fptr->common.arg_info[-1].type, return_value, 1); + reflection_type_factory(fptr->common.arg_info[-1].type, return_value, true); } /* }}} */ @@ -3711,7 +3711,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getTentativeReturnType) RETURN_NULL(); } - reflection_type_factory(fptr->common.arg_info[-1].type, return_value, 1); + reflection_type_factory(fptr->common.arg_info[-1].type, return_value, true); } /* }}} */ @@ -3914,7 +3914,7 @@ ZEND_METHOD(ReflectionClassConstant, getType) RETURN_NULL(); } - reflection_type_factory(ref->type, return_value, 1); + reflection_type_factory(ref->type, return_value, true); } /* Returns whether class constant has a type */ @@ -4314,8 +4314,8 @@ ZEND_METHOD(ReflectionClass, getDefaultProperties) if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { RETURN_THROWS(); } - add_class_vars(ce, 1, return_value); - add_class_vars(ce, 0, return_value); + add_class_vars(ce, true, return_value); + add_class_vars(ce, false, return_value); } /* }}} */ @@ -6428,7 +6428,7 @@ ZEND_METHOD(ReflectionProperty, getType) RETURN_NULL(); } - reflection_type_factory(ref->prop->type, return_value, 1); + reflection_type_factory(ref->prop->type, return_value, true); } /* }}} */ @@ -6450,7 +6450,7 @@ ZEND_METHOD(ReflectionProperty, getSettableType) /* Get-only virtual property can never be written to. */ if (prop->hooks && (prop->flags & ZEND_ACC_VIRTUAL) && !prop->hooks[ZEND_PROPERTY_HOOK_SET]) { zend_type never_type = ZEND_TYPE_INIT_CODE(IS_NEVER, 0, 0); - reflection_type_factory(never_type, return_value, 1); + reflection_type_factory(never_type, return_value, true); return; } @@ -6460,7 +6460,7 @@ ZEND_METHOD(ReflectionProperty, getSettableType) if (!ZEND_TYPE_IS_SET(arg_info->type)) { RETURN_NULL(); } - reflection_type_factory(arg_info->type, return_value, 1); + reflection_type_factory(arg_info->type, return_value, true); return; } @@ -6468,7 +6468,7 @@ ZEND_METHOD(ReflectionProperty, getSettableType) if (!ZEND_TYPE_IS_SET(ref->prop->type)) { RETURN_NULL(); } - reflection_type_factory(ref->prop->type, return_value, 1); + reflection_type_factory(ref->prop->type, return_value, true); } /* {{{ Returns whether property has a type */ @@ -6848,7 +6848,7 @@ ZEND_METHOD(ReflectionExtension, getClasses) array_init(return_value); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { - add_extension_class(ce, key, return_value, module, 1); + add_extension_class(ce, key, return_value, module, true); } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -6866,7 +6866,7 @@ ZEND_METHOD(ReflectionExtension, getClassNames) array_init(return_value); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) { - add_extension_class(ce, key, return_value, module, 0); + add_extension_class(ce, key, return_value, module, false); } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -7509,7 +7509,7 @@ ZEND_METHOD(ReflectionEnum, getBackingType) RETURN_NULL(); } else { zend_type type = ZEND_TYPE_INIT_CODE(ce->enum_backing_type, 0, 0); - reflection_type_factory(type, return_value, 0); + reflection_type_factory(type, return_value, false); } } From 9659d7f1ed3869cff3f780306a632b75ee73d69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:42 +0200 Subject: [PATCH 080/386] session: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/session/mod_mm.c | 8 ++++---- ext/session/session.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index b997a2bdcff54..962e19666a2a3 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -207,7 +207,7 @@ static zend_result ps_mm_key_exists(ps_mm *data, const zend_string *key) if (!key) { return FAILURE; } - sd = ps_sd_lookup(data, key, 0); + sd = ps_sd_lookup(data, key, false); if (sd) { return SUCCESS; } @@ -365,7 +365,7 @@ PS_READ_FUNC(mm) PS(session_status) = php_session_active; } - sd = ps_sd_lookup(data, PS(id), 0); + sd = ps_sd_lookup(data, PS(id), false); if (sd) { *val = zend_string_init(sd->data, sd->datalen, 0); ret = SUCCESS; @@ -383,7 +383,7 @@ PS_WRITE_FUNC(mm) mm_lock(data->mm, MM_LOCK_RW); - sd = ps_sd_lookup(data, key, 1); + sd = ps_sd_lookup(data, key, true); if (!sd) { sd = ps_sd_new(data, key); ps_mm_debug(("new entry for %s\n", ZSTR_VAL(key))); @@ -422,7 +422,7 @@ PS_DESTROY_FUNC(mm) mm_lock(data->mm, MM_LOCK_RW); - sd = ps_sd_lookup(data, key, 0); + sd = ps_sd_lookup(data, key, false); if (sd) { ps_sd_destroy(data, sd); } diff --git a/ext/session/session.c b/ext/session/session.c index f716688b677e6..1c01201a55bc5 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -487,7 +487,7 @@ static zend_result php_session_initialize(void) } /* GC must be done after read */ - php_session_gc(0); + php_session_gc(false); if (PS(session_vars)) { zend_string_release_ex(PS(session_vars), 0); @@ -2741,7 +2741,7 @@ PHP_FUNCTION(session_gc) RETURN_FALSE; } - num = php_session_gc(1); + num = php_session_gc(true); if (num < 0) { RETURN_FALSE; } @@ -3247,7 +3247,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_ progress->post_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->data), ZEND_STRL("bytes_processed")); - php_rinit_session(0); + php_rinit_session(false); PS(id) = zend_string_copy(Z_STR(progress->sid)); if (progress->apply_trans_sid) { /* Enable trans sid by modifying flags */ @@ -3274,7 +3274,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_ progress->current_file_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->current_file), ZEND_STRL("bytes_processed")); Z_LVAL_P(progress->current_file_bytes_processed) = data->post_bytes_processed; - php_session_rfc1867_update(progress, 0); + php_session_rfc1867_update(progress, false); } break; case MULTIPART_EVENT_FILE_DATA: { @@ -3287,7 +3287,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_ Z_LVAL_P(progress->current_file_bytes_processed) = data->offset + data->length; Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed; - php_session_rfc1867_update(progress, 0); + php_session_rfc1867_update(progress, false); } break; case MULTIPART_EVENT_FILE_END: { @@ -3306,7 +3306,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_ Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed; - php_session_rfc1867_update(progress, 0); + php_session_rfc1867_update(progress, false); } break; case MULTIPART_EVENT_END: { @@ -3320,7 +3320,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_ SEPARATE_ARRAY(&progress->data); add_assoc_bool_ex(&progress->data, ZEND_STRL("done"), 1); Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed; - php_session_rfc1867_update(progress, 1); + php_session_rfc1867_update(progress, true); } } php_rshutdown_session_globals(); From 7f1cc0ec32287297be21c481c8e388f3641aad60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:47 +0200 Subject: [PATCH 081/386] spl: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/spl/spl_array.c | 8 ++++---- ext/spl/spl_fixedarray.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 2246a68b4035a..d430513ca11fa 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -875,7 +875,7 @@ static zval *spl_array_get_property_ptr_ptr(zend_object *object, zend_string *na return NULL; } ZVAL_STR(&member, name); - return spl_array_get_dimension_ptr(1, intern, object->ce->name, &member, type); + return spl_array_get_dimension_ptr(true, intern, object->ce->name, &member, type); } return zend_std_get_property_ptr_ptr(object, name, type, cache_slot); } /* }}} */ @@ -1140,7 +1140,7 @@ PHP_METHOD(ArrayObject, exchangeArray) } RETVAL_ARR(zend_array_dup(spl_array_get_hash_table(intern))); - spl_array_set_array(object, intern, array, 0L, 1); + spl_array_set_array(object, intern, array, 0L, true); } /* }}} */ @@ -1413,7 +1413,7 @@ PHP_METHOD(ArrayObject, unserialize) ZVAL_NULL(array); SEPARATE_ARRAY(&intern->array); } else { - spl_array_set_array(object, intern, array, 0L, 1); + spl_array_set_array(object, intern, array, 0L, true); } if (*p != ';') { @@ -1526,7 +1526,7 @@ PHP_METHOD(ArrayObject, __unserialize) zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object", 0); RETURN_THROWS(); } - spl_array_set_array(ZEND_THIS, intern, storage_zv, 0L, 1); + spl_array_set_array(ZEND_THIS, intern, storage_zv, 0L, true); } object_properties_load(&intern->std, Z_ARRVAL_P(members_zv)); diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 3d11d88f4f567..61447e2d41bf4 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -303,12 +303,12 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z static zend_object *spl_fixedarray_new(zend_class_entry *class_type) { - return spl_fixedarray_object_new_ex(class_type, NULL, 0); + return spl_fixedarray_object_new_ex(class_type, NULL, false); } static zend_object *spl_fixedarray_object_clone(zend_object *old_object) { - zend_object *new_object = spl_fixedarray_object_new_ex(old_object->ce, old_object, 1); + zend_object *new_object = spl_fixedarray_object_new_ex(old_object->ce, old_object, true); zend_objects_clone_members(new_object, old_object); @@ -815,7 +815,7 @@ PHP_METHOD(SplFixedArray, offsetExists) intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); - RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0)); + RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, false)); } /* Returns the value at the specified $index. */ From 827c24b33f86217d07769fdb3e7ee9717565f5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:27:52 +0200 Subject: [PATCH 082/386] standard: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/standard/array.c | 24 ++++++++++++------------ ext/standard/browscap.c | 8 ++++---- ext/standard/html.c | 4 ++-- ext/standard/string.c | 2 +- ext/standard/var.c | 7 ++++--- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 68c247e026f96..d708a339c6b70 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2049,7 +2049,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s continue; } } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); @@ -2103,7 +2103,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo continue; } } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); @@ -2166,7 +2166,7 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol } } prefix: - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); @@ -2238,7 +2238,7 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab } } prefix: - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); @@ -2292,10 +2292,10 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_ if (ZSTR_LEN(var_name) == 0) { continue; } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); } if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { @@ -2339,10 +2339,10 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl if (ZSTR_LEN(var_name) == 0) { continue; } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); } if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { @@ -2385,7 +2385,7 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym if (var_name) { if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name)) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { zval_ptr_dtor_str(&final_name); continue; @@ -2395,7 +2395,7 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym } } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { zval_ptr_dtor_str(&final_name); @@ -2440,7 +2440,7 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ if (var_name) { if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name)) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { zval_ptr_dtor_str(&final_name); continue; @@ -2450,7 +2450,7 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ } } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), 1); + php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { zval_ptr_dtor_str(&final_name); diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 685fe09357d06..5009c7793688c 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -277,7 +277,7 @@ static HashTable *browscap_entry_to_array(browser_data *bdata, browscap_entry *e zval tmp; HashTable *ht = zend_new_array(2 + (entry->parent ? 1 : 0) + (entry->kv_end - entry->kv_start)); - ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, 0)); + ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, false)); zend_string *key = ZSTR_INIT_LITERAL("browser_name_regex", 0); ZSTR_H(key) = zend_inline_hash_func("browser_name_regex", sizeof("browser_name_regex")-1); zend_hash_add_new(ht, key, &tmp); @@ -485,7 +485,7 @@ PHP_INI_MH(OnChangeBrowscap) } else if (stage == PHP_INI_STAGE_ACTIVATE) { browser_data *bdata = &BROWSCAP_G(activation_bdata); if (bdata->filename[0] != '\0') { - browscap_bdata_dtor(bdata, 0); + browscap_bdata_dtor(bdata, false); } if (VCWD_REALPATH(ZSTR_VAL(new_value), bdata->filename) == NULL) { return FAILURE; @@ -520,7 +520,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ { browser_data *bdata = &BROWSCAP_G(activation_bdata); if (bdata->filename[0] != '\0') { - browscap_bdata_dtor(bdata, 0); + browscap_bdata_dtor(bdata, false); } return SUCCESS; @@ -529,7 +529,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ PHP_MSHUTDOWN_FUNCTION(browscap) /* {{{ */ { - browscap_bdata_dtor(&global_bdata, 1); + browscap_bdata_dtor(&global_bdata, true); return SUCCESS; } diff --git a/ext/standard/html.c b/ext/standard/html.c index af6e6ec94443b..eaba9ddffc1d0 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1017,7 +1017,7 @@ PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int fl } if (all) { - charset = determine_charset(hint_charset, /* quiet */ 0); + charset = determine_charset(hint_charset, /* quiet */ false); } else { charset = cs_8859_1; /* charset shouldn't matter, use ISO-8859-1 for performance */ } @@ -1043,7 +1043,7 @@ PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int fl PHPAPI zend_string *php_escape_html_entities(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset) { - return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1, /* quiet */ 0); + return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, true, /* quiet */ false); } /* {{{ find_entity_for_char */ diff --git a/ext/standard/string.c b/ext/standard/string.c index bb232ffd5d67f..614e169de2a32 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5091,7 +5091,7 @@ static bool php_tag_find(char *tag, size_t len, const char *set) { PHPAPI size_t php_strip_tags(char *rbuf, size_t len, const char *allow, size_t allow_len) /* {{{ */ { - return php_strip_tags_ex(rbuf, len, allow, allow_len, 0); + return php_strip_tags_ex(rbuf, len, allow, allow_len, false); } /* }}} */ diff --git a/ext/standard/var.c b/ext/standard/var.c index 9cf59999fd961..4df86f49434a0 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1023,7 +1023,8 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, HashTable *ht, if (php_var_serialize_get_sleep_props(&props, struc, ht) == SUCCESS) { php_var_serialize_class_name(buf, struc); php_var_serialize_nested_data( - buf, struc, &props, zend_hash_num_elements(&props), /* incomplete_class */ 0, var_hash, GC_REFCOUNT(&props) > 1); + buf, struc, &props, zend_hash_num_elements(&props), /* incomplete_class */ false, var_hash, + GC_REFCOUNT(&props) > 1); } zend_hash_destroy(&props); } @@ -1299,8 +1300,8 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_ smart_str_appendl(buf, "a:", 2); myht = Z_ARRVAL_P(struc); php_var_serialize_nested_data( - buf, struc, myht, zend_array_count(myht), /* incomplete_class */ 0, var_hash, - !is_root && (in_rcn_array || GC_REFCOUNT(myht) > 1)); + buf, struc, myht, zend_array_count(myht), /* incomplete_class */ false, var_hash, + !is_root && (in_rcn_array || GC_REFCOUNT(myht) > 1)); return; case IS_REFERENCE: struc = Z_REFVAL_P(struc); From fb2f7fe70fa94d7e8d4dc70fc506c6af0e68a632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:17:56 +0200 Subject: [PATCH 083/386] Optimizer: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- Zend/Optimizer/zend_inference.c | 12 +++++++----- Zend/Optimizer/zend_ssa.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 435edeef18c36..2d490cea3ae19 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1862,7 +1862,7 @@ static void zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* { } else if (zend_inference_calc_range(op_array, ssa, j, 0, 1, &tmp)) { zend_inference_init_range(op_array, ssa, j, tmp.underflow, tmp.min, tmp.max, tmp.overflow); } else { - zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1); + zend_inference_init_range(op_array, ssa, j, true, ZEND_LONG_MIN, ZEND_LONG_MAX, true); } } else { /* Find SCC entry points */ @@ -1897,7 +1897,8 @@ static void zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* { for (j = scc_var[scc]; j >= 0; j = next_scc_var[j]) { if (!ssa->var_info[j].has_range && !(ssa->var_info[j].type & MAY_BE_REF)) { - zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1); + zend_inference_init_range(op_array, ssa, j, true, ZEND_LONG_MIN, ZEND_LONG_MAX, + true); FOR_EACH_VAR_USAGE(j, ADD_SCC_VAR); } } @@ -4124,7 +4125,8 @@ ZEND_API zend_result zend_update_type_info( const zend_op **ssa_opcodes, zend_long optimization_level) { - return _zend_update_type_info(op_array, ssa, script, NULL, opline, ssa_op, ssa_opcodes, optimization_level, 0); + return _zend_update_type_info(op_array, ssa, script, NULL, opline, ssa_op, ssa_opcodes, optimization_level, + false); } static uint32_t get_class_entry_rank(zend_class_entry *ce) { @@ -4260,7 +4262,7 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend } } else if (ssa_vars[j].definition >= 0) { i = ssa_vars[j].definition; - if (_zend_update_type_info(op_array, ssa, script, worklist, op_array->opcodes + i, ssa->ops + i, NULL, optimization_level, 1) == FAILURE) { + if (_zend_update_type_info(op_array, ssa, script, worklist, op_array->opcodes + i, ssa->ops + i, NULL, optimization_level, true) == FAILURE) { return FAILURE; } } @@ -4547,7 +4549,7 @@ ZEND_API void zend_init_func_return_info( zend_ssa_range tmp_range = {0, 0, 0, 0}; bool is_instanceof = false; ret->type = zend_get_return_info_from_signature_only( - (zend_function *) op_array, script, &ret->ce, &is_instanceof, /* use_tentative_return_info */ 1); + (zend_function *) op_array, script, &ret->ce, &is_instanceof, /* use_tentative_return_info */ true); ret->is_instanceof = is_instanceof; ret->range = tmp_range; ret->has_range = 0; diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index b238d41c2529a..b522a033250c5 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -1540,7 +1540,7 @@ void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to) /* {{{ */ for (phi = next_ssa_block->phis; phi; phi = phi->next) { if (phi->pi >= 0) { if (phi->pi == from) { - zend_ssa_rename_var_uses(ssa, phi->ssa_var, phi->sources[0], /* update_types */ 0); + zend_ssa_rename_var_uses(ssa, phi->ssa_var, phi->sources[0], /* update_types */ false); zend_ssa_remove_phi(ssa, phi); } } else { From c9b175992c5a320e2b614987d68dcd60c2e3c689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:20:04 +0200 Subject: [PATCH 084/386] Zend: Use `true` / `false` instead of `1` / `0` for `bool` parameters Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- Zend/zend.c | 6 +- Zend/zend_API.c | 2 +- Zend/zend_ast.c | 26 +++---- Zend/zend_builtin_functions.c | 4 +- Zend/zend_compile.c | 126 +++++++++++++++++----------------- Zend/zend_execute.c | 10 +-- Zend/zend_execute_API.c | 6 +- Zend/zend_generators.c | 8 +-- Zend/zend_hash.c | 26 +++---- Zend/zend_inheritance.c | 8 +-- Zend/zend_ini.c | 4 +- Zend/zend_multibyte.c | 2 +- Zend/zend_object_handlers.c | 4 +- Zend/zend_opcode.c | 8 +-- Zend/zend_operators.c | 4 +- Zend/zend_ptr_stack.c | 2 +- Zend/zend_string.c | 4 +- Zend/zend_virtual_cwd.c | 7 +- Zend/zend_weakrefs.c | 8 +-- 19 files changed, 133 insertions(+), 132 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 30b5a8c134c80..82b6e189108cd 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -553,7 +553,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /* } GC_PROTECT_RECURSION(Z_ARRVAL_P(expr)); } - print_hash(buf, Z_ARRVAL_P(expr), indent, 0); + print_hash(buf, Z_ARRVAL_P(expr), indent, false); GC_TRY_UNPROTECT_RECURSION(Z_ARRVAL_P(expr)); break; case IS_OBJECT: @@ -583,12 +583,12 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /* } if ((properties = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_DEBUG)) == NULL) { - print_hash(buf, (HashTable*) &zend_empty_array, indent, 1); + print_hash(buf, (HashTable*) &zend_empty_array, indent, true); break; } ZEND_GUARD_OR_GC_PROTECT_RECURSION(guard, DEBUG, zobj); - print_hash(buf, properties, indent, 1); + print_hash(buf, properties, indent, true); ZEND_GUARD_OR_GC_UNPROTECT_RECURSION(guard, DEBUG, zobj); zend_release_properties(properties); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 901a7d2219635..a26142a45727f 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4320,7 +4320,7 @@ ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_co ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params) /* {{{ */ { - zend_fcall_info_args_clear(fci, 1); + zend_fcall_info_args_clear(fci, true); fci->param_count = param_count; fci->params = params; } diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 72202f322e05c..0f87b258425b3 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2139,7 +2139,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_CLASS: decl = (const zend_ast_decl *) ast; if (decl->child[3]) { - zend_ast_export_attributes(str, decl->child[3], indent, 1); + zend_ast_export_attributes(str, decl->child[3], indent, true); } if (decl->flags & ZEND_ACC_INTERFACE) { smart_str_appends(str, "interface "); @@ -2173,11 +2173,11 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_EXPR_LIST: case ZEND_AST_PARAM_LIST: simple_list: - zend_ast_export_list(str, zend_ast_get_list(ast), 1, 20, indent); + zend_ast_export_list(str, zend_ast_get_list(ast), true, 20, indent); break; case ZEND_AST_ARRAY: smart_str_appendc(str, '['); - zend_ast_export_list(str, zend_ast_get_list(ast), 1, 20, indent); + zend_ast_export_list(str, zend_ast_get_list(ast), true, 20, indent); smart_str_appendc(str, ']'); break; case ZEND_AST_ENCAPS_LIST: @@ -2195,7 +2195,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_SWITCH_LIST: case ZEND_AST_CATCH_LIST: case ZEND_AST_MATCH_ARM_LIST: - zend_ast_export_list(str, zend_ast_get_list(ast), 0, 0, indent); + zend_ast_export_list(str, zend_ast_get_list(ast), false, 0, indent); break; case ZEND_AST_CLOSURE_USES: smart_str_appends(str, " use("); @@ -2207,7 +2207,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio zend_ast *prop_ast = ast->child[1]; if (ast->child[2]) { - zend_ast_export_attributes(str, ast->child[2], indent, 1); + zend_ast_export_attributes(str, ast->child[2], indent, true); } zend_ast_export_visibility(str, ast->attr, ZEND_MODIFIER_TARGET_PROPERTY); @@ -2236,13 +2236,13 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio str, ast_list->child[ast_list->children - 1], indent, - 1 + true ); /* So that the list printing doesn't try to print the attributes, * use zend_ast_export_list_ex() to override the number of children * to print. */ smart_str_appends(str, "const "); - zend_ast_export_list_ex(str, ast_list, 1, 20, indent, ast_list->children - 1); + zend_ast_export_list_ex(str, ast_list, true, 20, indent, ast_list->children - 1); break; } smart_str_appends(str, "const "); @@ -2250,7 +2250,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio } case ZEND_AST_CLASS_CONST_GROUP: if (ast->child[1]) { - zend_ast_export_attributes(str, ast->child[1], indent, 1); + zend_ast_export_attributes(str, ast->child[1], indent, true); } zend_ast_export_visibility(str, ast->attr, ZEND_MODIFIER_TARGET_CONSTANT); @@ -2534,7 +2534,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio if (ast->child[0]->kind == ZEND_AST_CLASS) { const zend_ast_decl *decl = (const zend_ast_decl *) ast->child[0]; if (decl->child[3]) { - zend_ast_export_attributes(str, decl->child[3], indent, 0); + zend_ast_export_attributes(str, decl->child[3], indent, false); } smart_str_appends(str, "class"); if (!zend_ast_is_list(ast->child[1]) @@ -2635,7 +2635,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_MATCH_ARM: zend_ast_export_indent(str, indent); if (ast->child[0]) { - zend_ast_export_list(str, zend_ast_get_list(ast->child[0]), 1, 0, indent); + zend_ast_export_list(str, zend_ast_get_list(ast->child[0]), true, 0, indent); smart_str_appends(str, " => "); } else { smart_str_appends(str, "default => "); @@ -2646,7 +2646,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_DECLARE: smart_str_appends(str, "declare("); ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_CONST_DECL); - zend_ast_export_list(str, zend_ast_get_list(ast->child[0]), 1, 0, indent); + zend_ast_export_list(str, zend_ast_get_list(ast->child[0]), true, 0, indent); smart_str_appendc(str, ')'); if (ast->child[1]) { smart_str_appends(str, " {\n"); @@ -2793,7 +2793,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio break; case ZEND_AST_PARAM: if (ast->child[3]) { - zend_ast_export_attributes(str, ast->child[3], indent, 0); + zend_ast_export_attributes(str, ast->child[3], indent, false); } zend_ast_export_visibility(str, ast->attr, ZEND_MODIFIER_TARGET_CPP); if (ast->attr & ZEND_ACC_FINAL) { @@ -2821,7 +2821,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio break; case ZEND_AST_ENUM_CASE: if (ast->child[3]) { - zend_ast_export_attributes(str, ast->child[3], indent, 1); + zend_ast_export_attributes(str, ast->child[3], indent, true); } smart_str_appends(str, "case "); zend_ast_export_name(str, ast->child[0], 0, indent); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 12752c0ff6d83..eab2a03990112 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -824,8 +824,8 @@ ZEND_FUNCTION(get_class_vars) } scope = zend_get_executed_scope(); - add_class_vars(scope, ce, 0, return_value); - add_class_vars(scope, ce, 1, return_value); + add_class_vars(scope, ce, false, return_value); + add_class_vars(scope, ce, true, return_value); } /* }}} */ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 34764d13de540..d0ce85dd3c6fb 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1131,13 +1131,13 @@ static zend_string *zend_resolve_non_class_name( static zend_string *zend_resolve_function_name(zend_string *name, uint32_t type, bool *is_fully_qualified) { return zend_resolve_non_class_name( - name, type, is_fully_qualified, 0, FC(imports_function)); + name, type, is_fully_qualified, false, FC(imports_function)); } static zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, bool *is_fully_qualified) { return zend_resolve_non_class_name( - name, type, is_fully_qualified, 1, FC(imports_const)); + name, type, is_fully_qualified, true, FC(imports_const)); } static zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* {{{ */ @@ -1287,7 +1287,7 @@ ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname) /* {{{ { zend_function *added_func = zend_hash_add_ptr(EG(function_table), Z_STR_P(lcname), func); if (UNEXPECTED(!added_func)) { - do_bind_function_error(Z_STR_P(lcname), &func->op_array, 0); + do_bind_function_error(Z_STR_P(lcname), &func->op_array, false); return FAILURE; } @@ -2697,7 +2697,7 @@ void zend_emit_final_return(bool return_one) /* {{{ */ return; } - zend_emit_return_type_check(NULL, return_info, 1); + zend_emit_return_type_check(NULL, return_info, true); } zn.op_type = IS_CONST; @@ -3069,7 +3069,7 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t return opline; } else { zend_short_circuiting_mark_inner(var_ast); - opline = zend_delayed_compile_var(&var_node, var_ast, type, 0); + opline = zend_delayed_compile_var(&var_node, var_ast, type, false); if (opline) { if (type == BP_VAR_W && (opline->opcode == ZEND_FETCH_STATIC_PROP_W || opline->opcode == ZEND_FETCH_OBJ_W)) { opline->extended_value |= ZEND_FETCH_DIM_WRITE; @@ -3137,7 +3137,7 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t * check for a nullsafe access. */ } else { zend_short_circuiting_mark_inner(obj_ast); - opline = zend_delayed_compile_var(&obj_node, obj_ast, type, 0); + opline = zend_delayed_compile_var(&obj_node, obj_ast, type, false); if (opline && (opline->opcode == ZEND_FETCH_DIM_W || opline->opcode == ZEND_FETCH_DIM_RW || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG @@ -3437,7 +3437,7 @@ static void zend_compile_expr_with_potential_assign_to_self( znode cv_node; if (zend_try_compile_cv(&cv_node, expr_ast, BP_VAR_R) == FAILURE) { - zend_compile_simple_var_no_cv(expr_node, expr_ast, BP_VAR_R, 0); + zend_compile_simple_var_no_cv(expr_node, expr_ast, BP_VAR_R, false); } else { zend_emit_op_tmp(expr_node, ZEND_QM_ASSIGN, &cv_node, NULL); } @@ -3465,7 +3465,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */ switch (kind) { case ZEND_AST_VAR: offset = zend_delayed_compile_begin(); - zend_delayed_compile_var(&var_node, var_ast, BP_VAR_W, 0); + zend_delayed_compile_var(&var_node, var_ast, BP_VAR_W, false); zend_compile_expr(&expr_node, expr_ast); zend_delayed_compile_end(offset); CG(zend_lineno) = zend_ast_get_lineno(var_ast); @@ -3473,7 +3473,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */ return; case ZEND_AST_STATIC_PROP: offset = zend_delayed_compile_begin(); - zend_delayed_compile_var(result, var_ast, BP_VAR_W, 0); + zend_delayed_compile_var(result, var_ast, BP_VAR_W, false); zend_compile_expr(&expr_node, expr_ast); opline = zend_delayed_compile_end(offset); @@ -3517,7 +3517,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */ zend_assert_not_short_circuited(expr_ast); } - zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1); + zend_compile_var(&expr_node, expr_ast, BP_VAR_W, true); /* MAKE_REF is usually not necessary for CVs. However, if there are * self-assignments, this forces the RHS to evaluate first. */ zend_emit_op(&expr_node, ZEND_MAKE_REF, &expr_node, NULL); @@ -3527,7 +3527,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */ znode cv_node; if (zend_try_compile_cv(&cv_node, expr_ast, BP_VAR_R) == FAILURE) { - zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, 0); + zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, false); } else { zend_emit_op_tmp(&expr_node, ZEND_QM_ASSIGN, &cv_node, NULL); } @@ -3562,8 +3562,8 @@ static void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */ } offset = zend_delayed_compile_begin(); - zend_delayed_compile_var(&target_node, target_ast, BP_VAR_W, 1); - zend_compile_var(&source_node, source_ast, BP_VAR_W, 1); + zend_delayed_compile_var(&target_node, target_ast, BP_VAR_W, true); + zend_compile_var(&source_node, source_ast, BP_VAR_W, true); if ((target_ast->kind != ZEND_AST_VAR || target_ast->child[0]->kind != ZEND_AST_ZVAL) @@ -3632,7 +3632,7 @@ static void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */ switch (kind) { case ZEND_AST_VAR: offset = zend_delayed_compile_begin(); - zend_delayed_compile_var(&var_node, var_ast, BP_VAR_RW, 0); + zend_delayed_compile_var(&var_node, var_ast, BP_VAR_RW, false); zend_compile_expr(&expr_node, expr_ast); zend_delayed_compile_end(offset); opline = zend_emit_op_tmp(result, ZEND_ASSIGN_OP, &var_node, &expr_node); @@ -3640,7 +3640,7 @@ static void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */ return; case ZEND_AST_STATIC_PROP: offset = zend_delayed_compile_begin(); - zend_delayed_compile_var(result, var_ast, BP_VAR_RW, 0); + zend_delayed_compile_var(result, var_ast, BP_VAR_RW, false); zend_compile_expr(&expr_node, expr_ast); opline = zend_delayed_compile_end(offset); @@ -3799,7 +3799,7 @@ static uint32_t zend_compile_args( /* Treat passing of $GLOBALS the same as passing a call. * This will error at runtime if the argument is by-ref. */ if (zend_is_call(arg) || is_globals_fetch(arg)) { - zend_compile_var(&arg_node, arg, BP_VAR_R, 0); + zend_compile_var(&arg_node, arg, BP_VAR_R, false); if (arg_node.op_type & (IS_CONST|IS_TMP_VAR)) { /* Function call was converted into builtin instruction */ if (!fbc || ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) { @@ -3826,10 +3826,10 @@ static uint32_t zend_compile_args( } else if (zend_is_variable(arg) && !zend_ast_is_short_circuited(arg)) { if (fbc && arg_num != (uint32_t) -1) { if (ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) { - zend_compile_var(&arg_node, arg, BP_VAR_W, 1); + zend_compile_var(&arg_node, arg, BP_VAR_W, true); opcode = ZEND_SEND_REF; } else { - zend_compile_var(&arg_node, arg, BP_VAR_R, 0); + zend_compile_var(&arg_node, arg, BP_VAR_R, false); opcode = (arg_node.op_type == IS_TMP_VAR) ? ZEND_SEND_VAL : ZEND_SEND_VAR; } } else { @@ -3855,7 +3855,7 @@ static uint32_t zend_compile_args( } else { opline->op2.num = arg_num; } - zend_compile_var(&arg_node, arg, BP_VAR_FUNC_ARG, 1); + zend_compile_var(&arg_node, arg, BP_VAR_FUNC_ARG, true); opcode = ZEND_SEND_FUNC_ARG; } while (0); } @@ -4149,7 +4149,7 @@ static zend_result zend_compile_func_defined(znode *result, zend_ast_list *args) return FAILURE; } - if (zend_try_ct_eval_const(&result->u.constant, name, 0)) { + if (zend_try_ct_eval_const(&result->u.constant, name, false)) { zend_string_release_ex(name, 0); zval_ptr_dtor(&result->u.constant); ZVAL_TRUE(&result->u.constant); @@ -5414,7 +5414,7 @@ static void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */ if (class_ast->kind == ZEND_AST_CLASS) { /* anon class declaration */ - zend_compile_class_decl(&class_node, class_ast, 0); + zend_compile_class_decl(&class_node, class_ast, false); } else { zend_compile_class_ref(&class_node, class_ast, ZEND_FETCH_CLASS_EXCEPTION); } @@ -5579,7 +5579,7 @@ static void zend_compile_unset(zend_ast *ast) /* {{{ */ } else if (zend_try_compile_cv(&var_node, var_ast, BP_VAR_UNSET) == SUCCESS) { opline = zend_emit_op(NULL, ZEND_UNSET_CV, &var_node, NULL); } else { - opline = zend_compile_simple_var_no_cv(NULL, var_ast, BP_VAR_UNSET, 0); + opline = zend_compile_simple_var_no_cv(NULL, var_ast, BP_VAR_UNSET, false); opline->opcode = ZEND_UNSET_VAR; } return; @@ -5589,11 +5589,11 @@ static void zend_compile_unset(zend_ast *ast) /* {{{ */ return; case ZEND_AST_PROP: case ZEND_AST_NULLSAFE_PROP: - opline = zend_compile_prop(NULL, var_ast, BP_VAR_UNSET, 0); + opline = zend_compile_prop(NULL, var_ast, BP_VAR_UNSET, false); opline->opcode = ZEND_UNSET_OBJ; return; case ZEND_AST_STATIC_PROP: - opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_UNSET, 0, 0); + opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_UNSET, false, false); opline->opcode = ZEND_UNSET_STATIC_PROP; return; EMPTY_SWITCH_DEFAULT_CASE() @@ -5707,7 +5707,7 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */ ZVAL_NULL(&expr_node.u.constant); } else if (by_ref && zend_is_variable(expr_ast)) { zend_assert_not_short_circuited(expr_ast); - zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1); + zend_compile_var(&expr_node, expr_ast, BP_VAR_W, true); } else { zend_compile_expr(&expr_node, expr_ast); } @@ -5726,7 +5726,7 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */ /* Generator return types are handled separately */ if (!is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { zend_emit_return_type_check( - expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); + expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, false); } uint32_t opnum_before_finally = get_next_op_number(); @@ -5740,7 +5740,7 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */ && !is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { zend_emit_return_type_check( - expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0); + expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, false); } opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN, @@ -5989,7 +5989,7 @@ static void zend_compile_while(zend_ast *ast) /* {{{ */ opnum_jmp = zend_emit_jump(0); - zend_begin_loop(ZEND_NOP, NULL, 0); + zend_begin_loop(ZEND_NOP, NULL, false); opnum_start = get_next_op_number(); zend_compile_stmt(stmt_ast); @@ -6012,7 +6012,7 @@ static void zend_compile_do_while(zend_ast *ast) /* {{{ */ znode cond_node; uint32_t opnum_start, opnum_cond; - zend_begin_loop(ZEND_NOP, NULL, 0); + zend_begin_loop(ZEND_NOP, NULL, false); opnum_start = get_next_op_number(); zend_compile_stmt(stmt_ast); @@ -6069,7 +6069,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */ opnum_jmp = zend_emit_jump(0); - zend_begin_loop(ZEND_NOP, NULL, 0); + zend_begin_loop(ZEND_NOP, NULL, false); opnum_start = get_next_op_number(); zend_compile_stmt(stmt_ast); @@ -6119,7 +6119,7 @@ static void zend_compile_foreach(zend_ast *ast) /* {{{ */ } if (by_ref && is_variable) { - zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1); + zend_compile_var(&expr_node, expr_ast, BP_VAR_W, true); } else { zend_compile_expr(&expr_node, expr_ast); } @@ -6131,7 +6131,7 @@ static void zend_compile_foreach(zend_ast *ast) /* {{{ */ opnum_reset = get_next_op_number(); opline = zend_emit_op(&reset_node, by_ref ? ZEND_FE_RESET_RW : ZEND_FE_RESET_R, &expr_node, NULL); - zend_begin_loop(ZEND_FE_FREE, &reset_node, 0); + zend_begin_loop(ZEND_FE_FREE, &reset_node, false); opnum_fetch = get_next_op_number(); opline = zend_emit_op(NULL, by_ref ? ZEND_FE_FETCH_RW : ZEND_FE_FETCH_R, &reset_node, NULL); @@ -6304,7 +6304,7 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ zend_compile_expr(&expr_node, expr_ast); - zend_begin_loop(ZEND_FREE, &expr_node, 1); + zend_begin_loop(ZEND_FREE, &expr_node, true); case_node.op_type = IS_TMP_VAR; case_node.u.op.var = get_temporary_variable(); @@ -7001,7 +7001,7 @@ static void zend_compile_declare(zend_ast *ast) /* {{{ */ zval_ptr_dtor_nogc(&value_zv); } else if (zend_string_equals_literal_ci(name, "encoding")) { - if (FAILURE == zend_is_first_statement(ast, /* allow_nop */ 0)) { + if (FAILURE == zend_is_first_statement(ast, /* allow_nop */ false)) { zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be " "the very first statement in the script"); } @@ -8611,7 +8611,7 @@ static zend_op_array *zend_compile_func_decl_ex( CG(zend_lineno) = decl->end_lineno; zend_do_extended_stmt(NULL); - zend_emit_final_return(0); + zend_emit_final_return(false); pass_two(CG(active_op_array)); zend_oparray_context_end(&orig_oparray_context); @@ -9292,7 +9292,7 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel) ce->type = ZEND_USER_CLASS; ce->name = name; - zend_initialize_class_data(ce, 1); + zend_initialize_class_data(ce, true); if (!(decl->flags & ZEND_ACC_ANON_CLASS)) { zend_alloc_ce_cache(ce->name); } @@ -9771,7 +9771,7 @@ static void zend_compile_namespace(zend_ast *ast) /* {{{ */ bool is_first_namespace = (!with_bracket && !FC(current_namespace)) || (with_bracket && !FC(has_bracketed_namespaces)); - if (is_first_namespace && FAILURE == zend_is_first_statement(ast, /* allow_nop */ 1)) { + if (is_first_namespace && FAILURE == zend_is_first_statement(ast, /* allow_nop */ true)) { zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be " "the very first statement or after any declare call in the script"); } @@ -9821,7 +9821,7 @@ static void zend_compile_halt_compiler(zend_ast *ast) /* {{{ */ filename = zend_get_compiled_filename(); name = zend_mangle_property_name(const_name, sizeof(const_name) - 1, - ZSTR_VAL(filename), ZSTR_LEN(filename), 0); + ZSTR_VAL(filename), ZSTR_LEN(filename), false); /* Avoid repeated declaration of the __COMPILER_HALT_OFFSET__ constant in * case this file was already included. */ @@ -10412,16 +10412,16 @@ static void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */ zend_ensure_writable_variable(var_ast); if (var_ast->kind == ZEND_AST_PROP || var_ast->kind == ZEND_AST_NULLSAFE_PROP) { - zend_op *opline = zend_compile_prop(NULL, var_ast, BP_VAR_RW, 0); + zend_op *opline = zend_compile_prop(NULL, var_ast, BP_VAR_RW, false); opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ; zend_make_tmp_result(result, opline); } else if (var_ast->kind == ZEND_AST_STATIC_PROP) { - zend_op *opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_RW, 0, 0); + zend_op *opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_RW, false, false); opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_STATIC_PROP : ZEND_POST_DEC_STATIC_PROP; zend_make_tmp_result(result, opline); } else { znode var_node; - zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, 0); + zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, false); if (opline && opline->opcode == ZEND_FETCH_DIM_RW) { opline->extended_value = ZEND_FETCH_DIM_INCDEC; } @@ -10439,18 +10439,18 @@ static void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */ zend_ensure_writable_variable(var_ast); if (var_ast->kind == ZEND_AST_PROP || var_ast->kind == ZEND_AST_NULLSAFE_PROP) { - zend_op *opline = zend_compile_prop(result, var_ast, BP_VAR_RW, 0); + zend_op *opline = zend_compile_prop(result, var_ast, BP_VAR_RW, false); opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ; opline->result_type = IS_TMP_VAR; result->op_type = IS_TMP_VAR; } else if (var_ast->kind == ZEND_AST_STATIC_PROP) { - zend_op *opline = zend_compile_static_prop(result, var_ast, BP_VAR_RW, 0, 0); + zend_op *opline = zend_compile_static_prop(result, var_ast, BP_VAR_RW, false, false); opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_STATIC_PROP : ZEND_PRE_DEC_STATIC_PROP; opline->result_type = IS_TMP_VAR; result->op_type = IS_TMP_VAR; } else { znode var_node; - zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, 0); + zend_op *opline = zend_compile_var(&var_node, var_ast, BP_VAR_RW, false); if (opline && opline->opcode == ZEND_FETCH_DIM_RW) { opline->extended_value = ZEND_FETCH_DIM_INCDEC; } @@ -10573,7 +10573,7 @@ static void zend_compile_coalesce(znode *result, zend_ast *ast) /* {{{ */ zend_op *opline; uint32_t opnum; - zend_compile_var(&expr_node, expr_ast, BP_VAR_IS, 0); + zend_compile_var(&expr_node, expr_ast, BP_VAR_IS, false); opnum = get_next_op_number(); zend_emit_op_tmp(result, ZEND_COALESCE, &expr_node, NULL); @@ -10620,7 +10620,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ zend_hash_init(CG(memoized_exprs), 0, NULL, znode_dtor, 0); CG(memoize_mode) = ZEND_MEMOIZE_COMPILE; - zend_compile_var(&var_node_is, var_ast, BP_VAR_IS, 0); + zend_compile_var(&var_node_is, var_ast, BP_VAR_IS, false); coalesce_opnum = get_next_op_number(); zend_emit_op_tmp(result, ZEND_COALESCE, &var_node_is, NULL); @@ -10633,7 +10633,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ } CG(memoize_mode) = ZEND_MEMOIZE_FETCH; - zend_compile_var(&var_node_w, var_ast, BP_VAR_W, 0); + zend_compile_var(&var_node_w, var_ast, BP_VAR_W, false); /* Reproduce some of the zend_compile_assign() opcode fixup logic here. */ opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; @@ -10735,7 +10735,7 @@ static void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */ if (value_ast) { if (returns_by_ref && zend_is_variable(value_ast)) { zend_assert_not_short_circuited(value_ast); - zend_compile_var(&value_node, value_ast, BP_VAR_W, 1); + zend_compile_var(&value_node, value_ast, BP_VAR_W, true); } else { zend_compile_expr(&value_node, value_ast); } @@ -10868,7 +10868,7 @@ static void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */ } else if (zend_try_compile_cv(&var_node, var_ast, BP_VAR_IS) == SUCCESS) { opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_CV, &var_node, NULL); } else { - opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS, 0); + opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS, false); opline->opcode = ZEND_ISSET_ISEMPTY_VAR; } break; @@ -10878,11 +10878,11 @@ static void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */ break; case ZEND_AST_PROP: case ZEND_AST_NULLSAFE_PROP: - opline = zend_compile_prop(result, var_ast, BP_VAR_IS, 0); + opline = zend_compile_prop(result, var_ast, BP_VAR_IS, false); opline->opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ; break; case ZEND_AST_STATIC_PROP: - opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, 0, 0); + opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, false, false); opline->opcode = ZEND_ISSET_ISEMPTY_STATIC_PROP; break; EMPTY_SWITCH_DEFAULT_CASE() @@ -10905,7 +10905,7 @@ static void zend_compile_silence(znode *result, zend_ast *ast) /* {{{ */ if (expr_ast->kind == ZEND_AST_VAR) { /* For @$var we need to force a FETCH instruction, otherwise the CV access will * happen outside the silenced section. */ - zend_compile_simple_var_no_cv(result, expr_ast, BP_VAR_R, 0 ); + zend_compile_simple_var_no_cv(result, expr_ast, BP_VAR_R, false ); } else { zend_compile_expr(result, expr_ast); } @@ -10983,7 +10983,7 @@ static void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */ if (by_ref) { zend_ensure_writable_variable(value_ast); - zend_compile_var(&value_node, value_ast, BP_VAR_W, 1); + zend_compile_var(&value_node, value_ast, BP_VAR_W, true); } else { zend_compile_expr(&value_node, value_ast); } @@ -11053,11 +11053,11 @@ static void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */ if (is_fully_qualified || !FC(current_namespace)) { opline->op1.num = 0; opline->op2.constant = zend_add_const_name_literal( - resolved_name, 0); + resolved_name, false); } else { opline->op1.num = IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE; opline->op2.constant = zend_add_const_name_literal( - resolved_name, 1); + resolved_name, true); } opline->extended_value = zend_alloc_cache_slot(); } @@ -11669,7 +11669,7 @@ void zend_compile_top_stmt(zend_ast *ast) /* {{{ */ CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; } else if (ast->kind == ZEND_AST_CLASS) { CG(zend_lineno) = ast->lineno; - zend_compile_class_decl(NULL, ast, 1); + zend_compile_class_decl(NULL, ast, true); CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno; } else { zend_compile_stmt(ast); @@ -11762,7 +11762,7 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */ zend_compile_use_trait(ast); break; case ZEND_AST_CLASS: - zend_compile_class_decl(NULL, ast, 0); + zend_compile_class_decl(NULL, ast, false); break; case ZEND_AST_GROUP_USE: zend_compile_group_use(ast); @@ -11827,7 +11827,7 @@ static void zend_compile_expr_inner(znode *result, zend_ast *ast) /* {{{ */ case ZEND_AST_NULLSAFE_METHOD_CALL: case ZEND_AST_STATIC_CALL: case ZEND_AST_PARENT_PROPERTY_HOOK_CALL: - zend_compile_var(result, ast, BP_VAR_R, 0); + zend_compile_var(result, ast, BP_VAR_R, false); return; case ZEND_AST_ASSIGN: zend_compile_assign(result, ast); @@ -11968,14 +11968,14 @@ static zend_op *zend_compile_var_inner(znode *result, zend_ast *ast, uint32_t ty switch (ast->kind) { case ZEND_AST_VAR: - return zend_compile_simple_var(result, ast, type, 0); + return zend_compile_simple_var(result, ast, type, false); case ZEND_AST_DIM: return zend_compile_dim(result, ast, type, by_ref); case ZEND_AST_PROP: case ZEND_AST_NULLSAFE_PROP: return zend_compile_prop(result, ast, type, by_ref); case ZEND_AST_STATIC_PROP: - return zend_compile_static_prop(result, ast, type, by_ref, 0); + return zend_compile_static_prop(result, ast, type, by_ref, false); case ZEND_AST_CALL: zend_compile_call(result, ast, type); return NULL; @@ -12019,7 +12019,7 @@ static zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t switch (ast->kind) { case ZEND_AST_VAR: - return zend_compile_simple_var(result, ast, type, 1); + return zend_compile_simple_var(result, ast, type, true); case ZEND_AST_DIM: return zend_delayed_compile_dim(result, ast, type, by_ref); case ZEND_AST_PROP: @@ -12032,9 +12032,9 @@ static zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t return opline; } case ZEND_AST_STATIC_PROP: - return zend_compile_static_prop(result, ast, type, by_ref, 1); + return zend_compile_static_prop(result, ast, type, by_ref, true); default: - return zend_compile_var(result, ast, type, 0); + return zend_compile_var(result, ast, type, false); } } /* }}} */ diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 8eff03056c934..331043d3fef9c 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1051,7 +1051,7 @@ static zend_always_inline bool i_zend_check_property_type(const zend_property_in uint32_t type_mask = ZEND_TYPE_FULL_MASK(info->type); ZEND_ASSERT(!(type_mask & (MAY_BE_CALLABLE|MAY_BE_STATIC|MAY_BE_NEVER|MAY_BE_VOID))); - return zend_verify_scalar_type_hint(type_mask, property, strict, 0); + return zend_verify_scalar_type_hint(type_mask, property, strict, false); } static zend_always_inline bool i_zend_verify_property_type(const zend_property_info *info, zval *property, bool strict) @@ -1246,7 +1246,7 @@ static zend_always_inline bool zend_verify_recv_arg_type(const zend_function *zf cur_arg_info = &zf->common.arg_info[arg_num-1]; if (ZEND_TYPE_IS_SET(cur_arg_info->type) - && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, zf->common.scope, 0, 0))) { + && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, zf->common.scope, false, false))) { zend_verify_arg_error(zf, cur_arg_info, arg_num, arg); return 0; } @@ -1258,7 +1258,7 @@ static zend_always_inline bool zend_verify_variadic_arg_type( const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *arg) { ZEND_ASSERT(ZEND_TYPE_IS_SET(arg_info->type)); - if (UNEXPECTED(!zend_check_type(&arg_info->type, arg, zf->common.scope, 0, 0))) { + if (UNEXPECTED(!zend_check_type(&arg_info->type, arg, zf->common.scope, false, false))) { zend_verify_arg_error(zf, arg_info, arg_num, arg); return 0; } @@ -1283,7 +1283,7 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ } if (ZEND_TYPE_IS_SET(cur_arg_info->type) - && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, fbc->common.scope, 0, /* is_internal */ 1))) { + && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, fbc->common.scope, false, /* is_internal */ true))) { return 0; } arg++; @@ -1489,7 +1489,7 @@ ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *re return 1; } - if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, NULL, 1, /* is_internal */ 1))) { + if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, NULL, true, /* is_internal */ true))) { zend_verify_internal_return_error(zf, ret); return 0; } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ef03940a7a41e..35154e8afdc3c 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1430,14 +1430,14 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */ function. */ if (EG(hard_timeout) > 0) { zend_atomic_bool_store_ex(&EG(timed_out), false); - zend_set_timeout_ex(EG(hard_timeout), 1); + zend_set_timeout_ex(EG(hard_timeout), true); /* XXX Abused, introduce an additional flag if the value needs to be kept. */ EG(hard_timeout) = 0; } # endif #else zend_atomic_bool_store_ex(&EG(timed_out), false); - zend_set_timeout_ex(0, 1); + zend_set_timeout_ex(0, true); #endif zend_error_noreturn(E_ERROR, "Maximum execution time of " ZEND_LONG_FMT " second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s"); @@ -1522,7 +1522,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */ #ifndef ZTS if (EG(hard_timeout) > 0) { /* Set hard timeout */ - zend_set_timeout_ex(EG(hard_timeout), 1); + zend_set_timeout_ex(EG(hard_timeout), true); } #endif } diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 22f6048040b30..d5c9b1b1e313d 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -281,7 +281,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ if (EXPECTED(!ex) || EXPECTED(!(ex->func->op_array.fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)) || CG(unclean_shutdown)) { - zend_generator_close(generator, 0); + zend_generator_close(generator, false); return; } @@ -351,7 +351,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ try_catch_offset--; } - zend_generator_close(generator, 0); + zend_generator_close(generator, false); } /* }}} */ @@ -359,7 +359,7 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */ { zend_generator *generator = (zend_generator*) object; - zend_generator_close(generator, 0); + zend_generator_close(generator, false); if (generator->func && (generator->func->common.fn_flags & ZEND_ACC_CLOSURE)) { OBJ_RELEASE(ZEND_CLOSURE_OBJECT(generator->func)); @@ -856,7 +856,7 @@ ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */ * its calling frame (see above in if (check_yield_from). */ if (UNEXPECTED(EG(exception) != NULL)) { if (generator == orig_generator) { - zend_generator_close(generator, 0); + zend_generator_close(generator, false); if (!EG(current_execute_data)) { zend_throw_exception_internal(NULL); } else if (EG(current_execute_data)->func && diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 6978beaa402e3..687450569bf6c 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -281,14 +281,14 @@ ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_ ZEND_API HashTable* ZEND_FASTCALL _zend_new_array_0(void) { HashTable *ht = emalloc(sizeof(HashTable)); - _zend_hash_init_int(ht, HT_MIN_SIZE, ZVAL_PTR_DTOR, 0); + _zend_hash_init_int(ht, HT_MIN_SIZE, ZVAL_PTR_DTOR, false); return ht; } ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t nSize) { HashTable *ht = emalloc(sizeof(HashTable)); - _zend_hash_init_int(ht, nSize, ZVAL_PTR_DTOR, 0); + _zend_hash_init_int(ht, nSize, ZVAL_PTR_DTOR, false); return ht; } @@ -296,7 +296,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_new_pair(const zval *val1, const zval *va { zval *zv; HashTable *ht = emalloc(sizeof(HashTable)); - _zend_hash_init_int(ht, HT_MIN_SIZE, ZVAL_PTR_DTOR, 0); + _zend_hash_init_int(ht, HT_MIN_SIZE, ZVAL_PTR_DTOR, false); ht->nNumUsed = ht->nNumOfElements = ht->nNextFreeElement = 2; zend_hash_real_init_packed_ex(ht); @@ -2375,7 +2375,7 @@ static zend_always_inline void zend_array_dup_packed_elements(const HashTable *s const zval *end = p + source->nNumUsed; do { - if (!zend_array_dup_value(source, p, q, 1, with_holes)) { + if (!zend_array_dup_value(source, p, q, true, with_holes)) { if (with_holes) { ZVAL_UNDEF(q); } @@ -2400,13 +2400,13 @@ static zend_always_inline uint32_t zend_array_dup_elements(const HashTable *sour } do { - if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { + if (!zend_array_dup_element(source, target, idx, p, q, false, static_keys, with_holes)) { uint32_t target_idx = idx; idx++; p++; if (EXPECTED(!HT_HAS_ITERATORS(target))) { while (p != end) { - if (zend_array_dup_element(source, target, target_idx, p, q, 0, static_keys, with_holes)) { + if (zend_array_dup_element(source, target, target_idx, p, q, false, static_keys, with_holes)) { if (source->nInternalPointer == idx) { target->nInternalPointer = target_idx; } @@ -2419,7 +2419,7 @@ static zend_always_inline uint32_t zend_array_dup_elements(const HashTable *sour uint32_t iter_pos = zend_hash_iterators_lower_pos(target, idx); while (p != end) { - if (zend_array_dup_element(source, target, target_idx, p, q, 0, static_keys, with_holes)) { + if (zend_array_dup_element(source, target, target_idx, p, q, false, static_keys, with_holes)) { if (source->nInternalPointer == idx) { target->nInternalPointer = target_idx; } @@ -2496,9 +2496,9 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(const HashTable *source) HT_HASH_RESET_PACKED(target); if (HT_IS_WITHOUT_HOLES(target)) { - zend_array_dup_packed_elements(source, target, 0); + zend_array_dup_packed_elements(source, target, false); } else { - zend_array_dup_packed_elements(source, target, 1); + zend_array_dup_packed_elements(source, target, true); } } else { /* Indirects are removed during duplication, remove HASH_FLAG_HAS_EMPTY_IND accordingly. */ @@ -2515,15 +2515,15 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(const HashTable *source) if (HT_HAS_STATIC_KEYS_ONLY(target)) { if (HT_IS_WITHOUT_HOLES(source)) { - idx = zend_array_dup_elements(source, target, 1, 0); + idx = zend_array_dup_elements(source, target, true, false); } else { - idx = zend_array_dup_elements(source, target, 1, 1); + idx = zend_array_dup_elements(source, target, true, true); } } else { if (HT_IS_WITHOUT_HOLES(source)) { - idx = zend_array_dup_elements(source, target, 0, 0); + idx = zend_array_dup_elements(source, target, false, false); } else { - idx = zend_array_dup_elements(source, target, 0, 1); + idx = zend_array_dup_elements(source, target, false, true); } } target->nNumUsed = idx; diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index aea142a1f5e4b..d691903563fa1 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -942,7 +942,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration( num_args++; } for (uint32_t i = 0; i < num_args;) { - zend_append_type_hint(&str, scope, arg_info, 0); + zend_append_type_hint(&str, scope, arg_info, false); if (ZEND_ARG_SEND_MODE(arg_info)) { smart_str_appendc(&str, '&'); @@ -1039,7 +1039,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration( if (fptr->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { smart_str_appends(&str, ": "); - zend_append_type_hint(&str, scope, fptr->common.arg_info - 1, 1); + zend_append_type_hint(&str, scope, fptr->common.arg_info - 1, true); } smart_str_0(&str); @@ -2036,7 +2036,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par } zend_function *func; ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) { - do_inherit_method(key, func, ce, 0, flags); + do_inherit_method(key, func, ce, false, flags); } ZEND_HASH_FOREACH_END(); } @@ -2189,7 +2189,7 @@ static void do_interface_implementation(zend_class_entry *ce, zend_class_entry * } ZEND_HASH_FOREACH_END(); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) { - do_inherit_method(key, func, ce, 1, flags); + do_inherit_method(key, func, ce, true, flags); } ZEND_HASH_FOREACH_END(); zend_hash_extend(&ce->properties_info, diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 62379f057d2eb..8d26cd65579df 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -332,7 +332,7 @@ ZEND_API void zend_ini_refresh_caches(int stage) /* {{{ */ ZEND_API zend_result zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage) /* {{{ */ { - return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0); + return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, false); } /* }}} */ @@ -342,7 +342,7 @@ ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *v zend_string *new_value; new_value = zend_string_init(value, value_length, !(stage & ZEND_INI_STAGE_IN_REQUEST)); - ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0); + ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, false); zend_string_release(new_value); return ret; } diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index bcecd9790995a..f61ed79fd1f7a 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -195,7 +195,7 @@ ZEND_API zend_result zend_multibyte_set_script_encoding_by_string(const char *ne return SUCCESS; } - if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length, &list, &size, 1)) { + if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length, &list, &size, true)) { return FAILURE; } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 7c9753482e510..361ddde6ebabc 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1821,7 +1821,7 @@ ZEND_API zend_function *zend_get_property_hook_trampoline( static zend_always_inline zend_function *zend_get_user_call_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */ { - return zend_get_call_trampoline_func(ce, method_name, 0); + return zend_get_call_trampoline_func(ce, method_name, false); } /* }}} */ @@ -1915,7 +1915,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * static zend_always_inline zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */ { - return zend_get_call_trampoline_func(ce, method_name, 1); + return zend_get_call_trampoline_func(ce, method_name, true); } /* }}} */ diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 20fca00532147..43c6efb9107a9 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -135,7 +135,7 @@ void zend_free_internal_arg_info(zend_internal_function *function) { num_args++; } for (i = 0 ; i < num_args; i++) { - zend_type_release(arg_info[i].type, /* persistent */ 1); + zend_type_release(arg_info[i].type, /* persistent */ true); } free(arg_info); } @@ -396,7 +396,7 @@ ZEND_API void destroy_zend_class(zval *zv) if (prop_info->attributes) { zend_hash_release(prop_info->attributes); } - zend_type_release(prop_info->type, /* persistent */ 0); + zend_type_release(prop_info->type, /* persistent */ false); if (prop_info->hooks) { for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) { if (prop_info->hooks[i]) { @@ -463,7 +463,7 @@ ZEND_API void destroy_zend_class(zval *zv) ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop_info) { if (prop_info->ce == ce) { zend_string_release(prop_info->name); - zend_type_release(prop_info->type, /* persistent */ 1); + zend_type_release(prop_info->type, /* persistent */ true); if (prop_info->attributes) { zend_hash_release(prop_info->attributes); } @@ -639,7 +639,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array) if (arg_info[i].name) { zend_string_release_ex(arg_info[i].name, 0); } - zend_type_release(arg_info[i].type, /* persistent */ 0); + zend_type_release(arg_info[i].type, /* persistent */ false); } efree(arg_info); } diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 92e7e5d147474..9740de7d081fd 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1106,13 +1106,13 @@ static zend_always_inline zend_string* __zval_get_string_func(zval *op, bool try ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op) /* {{{ */ { - return __zval_get_string_func(op, 0); + return __zval_get_string_func(op, false); } /* }}} */ ZEND_API zend_string* ZEND_FASTCALL zval_try_get_string_func(zval *op) /* {{{ */ { - return __zval_get_string_func(op, 1); + return __zval_get_string_func(op, true); } /* }}} */ diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index 80c77e11d73e6..fdabdeb61cef7 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -30,7 +30,7 @@ ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent) ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) { - zend_ptr_stack_init_ex(stack, 0); + zend_ptr_stack_init_ex(stack, false); } diff --git a/Zend/zend_string.c b/Zend/zend_string.c index c864a847af39f..98534ff03b492 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -94,7 +94,7 @@ ZEND_API void zend_interned_strings_init(void) zend_empty_string = NULL; zend_known_strings = NULL; - zend_init_interned_strings_ht(&interned_strings_permanent, 1); + zend_init_interned_strings_ht(&interned_strings_permanent, true); zend_new_interned_string = zend_new_interned_string_permanent; zend_string_init_interned = zend_string_init_interned_permanent; @@ -345,7 +345,7 @@ static zend_string* ZEND_FASTCALL zend_string_init_existing_interned_request(con ZEND_API void zend_interned_strings_activate(void) { - zend_init_interned_strings_ht(&CG(interned_strings), 0); + zend_init_interned_strings_ht(&CG(interned_strings), false); } ZEND_API void zend_interned_strings_deactivate(void) diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 4f3d498a1f1f4..a9fbd5667cb8d 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -535,7 +535,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim if (i <= start + 1) { return start ? start : len; } - j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL); + j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, true, NULL); if (j > start && j != (size_t)-1) { j--; assert(i < MAXPATHLEN); @@ -948,7 +948,8 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim j = start; } else { /* some leading directories may be inaccessible */ - j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL); + j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, true, + NULL); if (j > start && j != (size_t)-1) { path[j++] = DEFAULT_SLASH; } @@ -1138,7 +1139,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]); t = CWDG(realpath_cache_ttl) ? 0 : -1; - path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL); + path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, false, NULL); if (path_length == (size_t)-1) { #ifdef ZEND_WIN32 diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 3b698cc02a7a4..4830089e50916 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -181,7 +181,7 @@ ZEND_API zval *zend_weakrefs_hash_add(HashTable *ht, zend_object *key, zval *pDa ZEND_API zend_result zend_weakrefs_hash_del(HashTable *ht, zend_object *key) { zval *zv = zend_hash_index_find(ht, zend_object_to_weakref_key(key)); if (zv) { - zend_weakref_unregister(key, ZEND_WEAKREF_ENCODE(ht, ZEND_WEAKREF_TAG_BARE_HT), 1); + zend_weakref_unregister(key, ZEND_WEAKREF_ENCODE(ht, ZEND_WEAKREF_TAG_BARE_HT), true); return SUCCESS; } return FAILURE; @@ -194,7 +194,7 @@ static void zend_weakrefs_hash_clean_ex(HashTable *ht, int type) { * Let freeing the corresponding values for WeakMap entries be done in zend_hash_clean, freeing objects sequentially. * The performance difference is notable for larger WeakMaps with worse cache locality. */ zend_weakref_unregister( - zend_weakref_key_to_object(obj_key), ZEND_WEAKREF_ENCODE(ht, type), 0); + zend_weakref_key_to_object(obj_key), ZEND_WEAKREF_ENCODE(ht, type), false); } ZEND_HASH_FOREACH_END(); zend_hash_clean(ht); } @@ -285,7 +285,7 @@ static void zend_weakref_free(zend_object *zo) { zend_weakref *wr = zend_weakref_from(zo); if (wr->referent) { - zend_weakref_unregister(wr->referent, ZEND_WEAKREF_ENCODE(wr, ZEND_WEAKREF_TAG_REF), 1); + zend_weakref_unregister(wr->referent, ZEND_WEAKREF_ENCODE(wr, ZEND_WEAKREF_TAG_REF), true); } zend_object_std_dtor(&wr->std); @@ -455,7 +455,7 @@ static void zend_weakmap_unset_dimension(zend_object *object, zval *offset) return; } - zend_weakref_unregister(obj_addr, ZEND_WEAKREF_ENCODE(&wm->ht, ZEND_WEAKREF_TAG_MAP), 1); + zend_weakref_unregister(obj_addr, ZEND_WEAKREF_ENCODE(&wm->ht, ZEND_WEAKREF_TAG_MAP), true); } static zend_result zend_weakmap_count_elements(zend_object *object, zend_long *count) From c32db7e8e96bb6dcdda79c802944edc8c36994b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:37:16 +0200 Subject: [PATCH 085/386] openssl: Use `true` / `false` instead of `1` / `0` for `bool` parameters (2) Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; type T; parameter list [n1] PL1; parameter list [n2] PL2; @@ T F(PL1, bool p, PL2); @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/openssl/xp_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index a422d7b0c1bf4..871309f0d4960 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -360,7 +360,7 @@ static int php_openssl_x509_fingerprint_cmp(X509 *peer, const char *method, cons zend_string *fingerprint; int result = -1; - fingerprint = php_openssl_x509_fingerprint(peer, method, 0); + fingerprint = php_openssl_x509_fingerprint(peer, method, false); if (fingerprint) { result = strcasecmp(expected, ZSTR_VAL(fingerprint)); zend_string_release_ex(fingerprint, 0); From ed4537df9f9424d50b008785703809bedde64d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:37:21 +0200 Subject: [PATCH 086/386] standard: Use `true` / `false` instead of `1` / `0` for `bool` parameters (2) Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; type T; parameter list [n1] PL1; parameter list [n2] PL2; @@ T F(PL1, bool p, PL2); @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- ext/standard/php_string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 51c537de6e628..ef62329ba8eda 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -29,9 +29,9 @@ PHP_MINIT_FUNCTION(string_intrin); #endif #define strnatcmp(a, b) \ - strnatcmp_ex(a, strlen(a), b, strlen(b), 0) + strnatcmp_ex(a, strlen(a), b, strlen(b), false) #define strnatcasecmp(a, b) \ - strnatcmp_ex(a, strlen(a), b, strlen(b), 1) + strnatcmp_ex(a, strlen(a), b, strlen(b), true) PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, bool is_case_insensitive); PHPAPI struct lconv *localeconv_r(struct lconv *out); PHPAPI char *php_strtr(char *str, size_t len, const char *str_from, const char *str_to, size_t trlen); From 525cc9a1ca5462db1fa45f26e1618b358d765158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:33:26 +0200 Subject: [PATCH 087/386] Optimizer: Use `true` / `false` instead of `1` / `0` for `bool` parameters (2) Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; type T; parameter list [n1] PL1; parameter list [n2] PL2; @@ T F(PL1, bool p, PL2); @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2) --- Zend/Optimizer/zend_ssa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/zend_ssa.h b/Zend/Optimizer/zend_ssa.h index 5995adcb14986..0f6d5a5685112 100644 --- a/Zend/Optimizer/zend_ssa.h +++ b/Zend/Optimizer/zend_ssa.h @@ -240,21 +240,21 @@ static zend_always_inline void zend_ssa_rename_defs_of_instr(zend_ssa *ssa, zend /* Rename def to use if possible. Mark variable as not defined otherwise. */ if (ssa_op->op1_def >= 0) { if (ssa_op->op1_use >= 0) { - zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, 1); + zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, true); } ssa->vars[ssa_op->op1_def].definition = -1; ssa_op->op1_def = -1; } if (ssa_op->op2_def >= 0) { if (ssa_op->op2_use >= 0) { - zend_ssa_rename_var_uses(ssa, ssa_op->op2_def, ssa_op->op2_use, 1); + zend_ssa_rename_var_uses(ssa, ssa_op->op2_def, ssa_op->op2_use, true); } ssa->vars[ssa_op->op2_def].definition = -1; ssa_op->op2_def = -1; } if (ssa_op->result_def >= 0) { if (ssa_op->result_use >= 0) { - zend_ssa_rename_var_uses(ssa, ssa_op->result_def, ssa_op->result_use, 1); + zend_ssa_rename_var_uses(ssa, ssa_op->result_def, ssa_op->result_use, true); } ssa->vars[ssa_op->result_def].definition = -1; ssa_op->result_def = -1; From ba4a12bc39fcf46bf67899730be0f043df2d345b Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 24 Sep 2025 18:53:50 +0100 Subject: [PATCH 088/386] Zend: add const qualifier for scope in read property functions (#19949) --- Zend/zend_API.c | 4 ++-- Zend/zend_API.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a26142a45727f..1b97974686edb 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -5148,7 +5148,7 @@ ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope } /* }}} */ -ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv) /* {{{ */ +ZEND_API zval *zend_read_property_ex(const zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv) /* {{{ */ { zval *value; const zend_class_entry *old_scope = EG(fake_scope); @@ -5162,7 +5162,7 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *objec } /* }}} */ -ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv) /* {{{ */ +ZEND_API zval *zend_read_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv) /* {{{ */ { zval *value; zend_string *str; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 8cde8317530e4..fa8b52c734c16 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -513,8 +513,8 @@ ZEND_API zend_result zend_update_static_property_double(zend_class_entry *scope, ZEND_API zend_result zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value); ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length); -ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv); -ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv); +ZEND_API zval *zend_read_property_ex(const zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv); +ZEND_API zval *zend_read_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv); ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent); ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent); From d77d44e1f74305a4c3f43f43a313277283a428f5 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 24 Sep 2025 18:54:05 +0100 Subject: [PATCH 089/386] Zend: Mark zend_ast_evaluate_inner as static (#19950) As this function is not exported in a header --- Zend/zend_ast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 0f87b258425b3..9774cce39db2b 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -558,7 +558,7 @@ static zend_class_entry *zend_ast_fetch_class(zend_ast *ast, zend_class_entry *s return zend_fetch_class_with_scope(zend_ast_get_str(ast), (ast->attr >> ZEND_CONST_EXPR_NEW_FETCH_TYPE_SHIFT) | ZEND_FETCH_CLASS_EXCEPTION, scope); } -ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner( +static zend_result ZEND_FASTCALL zend_ast_evaluate_inner( zval *result, zend_ast *ast, zend_class_entry *scope, @@ -589,7 +589,7 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_ex( return r; } -ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner( +static zend_result ZEND_FASTCALL zend_ast_evaluate_inner( zval *result, zend_ast *ast, zend_class_entry *scope, From 39d6bc17162050d5a1ae7c8be7e6a3d18789768d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 25 Sep 2025 10:28:13 +0100 Subject: [PATCH 090/386] Mark zend_visibility_string as returning a const char* (#19951) This is because the char* returned is immutable and should not be modified. --- Zend/zend_compile.h | 2 +- Zend/zend_inheritance.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index c07fa9bfa7d7e..c815248f78071 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -443,7 +443,7 @@ static zend_always_inline uint32_t zend_visibility_to_set_visibility(uint32_t vi // Must not clash with ZEND_SHORT_CIRCUITING_CHAIN_MASK #define ZEND_JMP_NULL_BP_VAR_IS 4 -char *zend_visibility_string(uint32_t fn_flags); +const char *zend_visibility_string(uint32_t fn_flags); #define ZEND_PROPERTY_HOOK_COUNT 2 #define ZEND_PROPERTY_HOOK_STRUCT_SIZE (sizeof(zend_function*) * ZEND_PROPERTY_HOOK_COUNT) diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index d691903563fa1..a2da64b62c0d5 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -200,7 +200,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */ } /* }}} */ -char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ +const char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ { if (fn_flags & ZEND_ACC_PUBLIC) { return "public"; From 5d431d0d74e048cd807df76daa74f6e70833a51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 25 Sep 2025 12:11:22 +0200 Subject: [PATCH 091/386] zend_string: Support NUL bytes in `ZSTR_*_LITERAL()` and `zend_string_*literal*()` (#19582) --- UPGRADING.INTERNALS | 4 ++++ Zend/zend_string.h | 6 +++--- ext/dom/element.c | 2 +- ext/zend_test/test.c | 7 +++++++ ext/zend_test/test.stub.php | 1 + ext/zend_test/test_arginfo.h | 6 +++++- ext/zend_test/tests/zstr_init_literal.phpt | 13 +++++++++++++ 7 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 ext/zend_test/tests/zstr_init_literal.phpt diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 70b7e2e7453b0..a248c0fd7c960 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -14,6 +14,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES 1. Internal API changes ======================== + . ZSTR_INIT_LITERAL(), zend_string_starts_with_literal(), and + zend_string_starts_with_literal_ci() now support strings containing NUL + bytes. Passing non-literal char* is no longer supported. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 87f221125202c..fc7705ff78650 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -123,7 +123,7 @@ END_EXTERN_C() #define ZSTR_ALLOCA_FREE(str, use_heap) free_alloca(str, use_heap) -#define ZSTR_INIT_LITERAL(s, persistent) (zend_string_init((s), strlen(s), (persistent))) +#define ZSTR_INIT_LITERAL(s, persistent) (zend_string_init(("" s), sizeof(s) - 1, (persistent))) /*---*/ @@ -402,7 +402,7 @@ static zend_always_inline bool zend_string_starts_with(const zend_string *str, c } #define zend_string_starts_with_literal(str, prefix) \ - zend_string_starts_with_cstr(str, prefix, strlen(prefix)) + zend_string_starts_with_cstr(str, "" prefix, sizeof(prefix) - 1) static zend_always_inline bool zend_string_starts_with_cstr_ci(const zend_string *str, const char *prefix, size_t prefix_length) { @@ -415,7 +415,7 @@ static zend_always_inline bool zend_string_starts_with_ci(const zend_string *str } #define zend_string_starts_with_literal_ci(str, prefix) \ - zend_string_starts_with_cstr_ci(str, prefix, strlen(prefix)) + zend_string_starts_with_cstr_ci(str, "" prefix, sizeof(prefix) - 1) /* * DJBX33A (Daniel J. Bernstein, Times 33 with Addition) diff --git a/ext/dom/element.c b/ext/dom/element.c index 9f4e6d357c021..f9aee10802fbb 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -180,7 +180,7 @@ zend_result dom_element_class_name_write(dom_object *obj, zval *newval) zval *dom_get_prop_checked_offset(dom_object *obj, uint32_t offset, const char *name) { #if ZEND_DEBUG - zend_string *name_zstr = ZSTR_INIT_LITERAL(name, false); + zend_string *name_zstr = zend_string_init(name, strlen(name), false); const zend_property_info *prop_info = zend_get_property_info(obj->std.ce, name_zstr, 0); zend_string_release_ex(name_zstr, false); ZEND_ASSERT(OBJ_PROP_TO_NUM(prop_info->offset) == offset); diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index bdbd2f52f0f2d..50c0a57ae8ef8 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -594,6 +594,13 @@ static ZEND_FUNCTION(zend_test_zend_ini_str) RETURN_STR(ZT_G(str_test)); } +static ZEND_FUNCTION(zend_test_zstr_init_literal) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + RETURN_STR(ZSTR_INIT_LITERAL("foo\0bar", false)); +} + static ZEND_FUNCTION(zend_test_is_string_marked_as_valid_utf8) { zend_string *str; diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index bf9a1c6b5bc8d..d0c0c64b8b1d0 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -301,6 +301,7 @@ function zend_test_zend_ini_parse_quantity(string $str): int {} function zend_test_zend_ini_parse_uquantity(string $str): int {} function zend_test_zend_ini_str(): string {} + function zend_test_zstr_init_literal(): string {} #ifdef ZEND_CHECK_STACK_LIMIT function zend_test_zend_call_stack_get(): ?array {} diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index bd2240cedd637..d2c7d6bbc2861 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6bccdc2444e6a68ba615fc281235a4551d0b8819 */ + * Stub hash: a8dae89983ccbcd5dd36d1cdee736d40af4fd33c */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) ZEND_END_ARG_INFO() @@ -130,6 +130,8 @@ ZEND_END_ARG_INFO() #define arginfo_zend_test_zend_ini_str arginfo_zend_get_current_func_name +#define arginfo_zend_test_zstr_init_literal arginfo_zend_get_current_func_name + #if defined(ZEND_CHECK_STACK_LIMIT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_zend_call_stack_get, 0, 0, IS_ARRAY, 1) ZEND_END_ARG_INFO() @@ -316,6 +318,7 @@ static ZEND_FUNCTION(zend_call_method_if_exists); static ZEND_FUNCTION(zend_test_zend_ini_parse_quantity); static ZEND_FUNCTION(zend_test_zend_ini_parse_uquantity); static ZEND_FUNCTION(zend_test_zend_ini_str); +static ZEND_FUNCTION(zend_test_zstr_init_literal); #if defined(ZEND_CHECK_STACK_LIMIT) static ZEND_FUNCTION(zend_test_zend_call_stack_get); static ZEND_FUNCTION(zend_test_zend_call_stack_use_all); @@ -447,6 +450,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_test_zend_ini_parse_quantity, arginfo_zend_test_zend_ini_parse_quantity) ZEND_FE(zend_test_zend_ini_parse_uquantity, arginfo_zend_test_zend_ini_parse_uquantity) ZEND_FE(zend_test_zend_ini_str, arginfo_zend_test_zend_ini_str) + ZEND_FE(zend_test_zstr_init_literal, arginfo_zend_test_zstr_init_literal) #if defined(ZEND_CHECK_STACK_LIMIT) ZEND_FE(zend_test_zend_call_stack_get, arginfo_zend_test_zend_call_stack_get) ZEND_FE(zend_test_zend_call_stack_use_all, arginfo_zend_test_zend_call_stack_use_all) diff --git a/ext/zend_test/tests/zstr_init_literal.phpt b/ext/zend_test/tests/zstr_init_literal.phpt new file mode 100644 index 0000000000000..b7f382da8d6e1 --- /dev/null +++ b/ext/zend_test/tests/zstr_init_literal.phpt @@ -0,0 +1,13 @@ +--TEST-- +zstr_init_literal +--EXTENSIONS-- +zend_test +--FILE-- + +--EXPECT-- +int(7) +string(14) "666f6f00626172" From 6ef4a87c180eacc18faafb00c10e30132b4d4e4e Mon Sep 17 00:00:00 2001 From: Bogdan Ungureanu Date: Fri, 25 Jul 2025 01:43:26 +0300 Subject: [PATCH 092/386] ext/intl: Add IntlNumberRangeFormatter class. to format an interval of two numbers with a given skeleton, locale, collapse type and identity fallback close GH-19232 --- NEWS | 5 + UPGRADING | 5 + ext/intl/config.m4 | 2 + ext/intl/config.w32 | 3 + ext/intl/php_intl.c | 4 + .../rangeformatter/rangeformatter.stub.php | 61 +++ .../rangeformatter/rangeformatter_arginfo.h | 148 ++++++ .../rangeformatter/rangeformatter_class.cpp | 239 +++++++++ .../rangeformatter/rangeformatter_class.h | 59 +++ ext/intl/tests/rangeformatter/basic.phpt | 484 ++++++++++++++++++ .../rangeformatter/rangeformatter_clone.phpt | 28 + .../rangeformatter/rangeformatter_errors.phpt | 87 ++++ .../rangeformatter_fraction_skeleton.phpt | 39 ++ .../rangeformatter_icu63_compatibility.phpt | 26 + .../rangeformatter_with_empty_skeleton.phpt | 24 + 15 files changed, 1214 insertions(+) create mode 100644 ext/intl/rangeformatter/rangeformatter.stub.php create mode 100644 ext/intl/rangeformatter/rangeformatter_arginfo.h create mode 100644 ext/intl/rangeformatter/rangeformatter_class.cpp create mode 100644 ext/intl/rangeformatter/rangeformatter_class.h create mode 100644 ext/intl/tests/rangeformatter/basic.phpt create mode 100644 ext/intl/tests/rangeformatter/rangeformatter_clone.phpt create mode 100644 ext/intl/tests/rangeformatter/rangeformatter_errors.phpt create mode 100644 ext/intl/tests/rangeformatter/rangeformatter_fraction_skeleton.phpt create mode 100644 ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt create mode 100644 ext/intl/tests/rangeformatter/rangeformatter_with_empty_skeleton.phpt diff --git a/NEWS b/NEWS index 285c4e78e3318..2213ff10b1db7 100644 --- a/NEWS +++ b/NEWS @@ -2,4 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.6.0alpha1 +- Intl: + . Added IntlNumberRangeFormatter class to format an interval of two numbers + with a given skeleton, locale, collapse type and identity fallback. + (BogdanUngureanu) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/UPGRADING b/UPGRADING index c55d0992602d7..8162d1e05b8ab 100644 --- a/UPGRADING +++ b/UPGRADING @@ -23,6 +23,11 @@ PHP 8.6 UPGRADE NOTES 2. New Features ======================================== +- Intl: + . Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, IntlNumberRangeFormatter::COLLAPSE_ALL collapse and + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and + IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks. + It is supported from icu 63. ======================================== 3. Changes in SAPI modules ======================================== diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index c4c3c9b1d4cea..f54e563af4ee5 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -60,6 +60,7 @@ if test "$PHP_INTL" != "no"; then dateformat/datepatterngenerator_class.cpp \ dateformat/datepatterngenerator_methods.cpp \ msgformat/msgformat_helpers.cpp \ + rangeformatter/rangeformatter_class.cpp \ timezone/timezone_class.cpp \ timezone/timezone_methods.cpp \ calendar/calendar_class.cpp \ @@ -123,6 +124,7 @@ if test "$PHP_INTL" != "no"; then $ext_builddir/listformatter $ext_builddir/msgformat $ext_builddir/normalizer + $ext_builddir/rangeformatter $ext_builddir/resourcebundle $ext_builddir/spoofchecker $ext_builddir/timezone diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index fb3f0212729dd..9d68a7c2d3ef7 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -63,6 +63,9 @@ if (PHP_INTL != "no") { normalizer_class.cpp \ normalizer_normalize.cpp \ ", "intl"); + ADD_SOURCES(configure_module_dirname + "/rangeformatter", "\ + rangeformatter_class.cpp \ + ", "intl"); ADD_SOURCES(configure_module_dirname + "/dateformat", "\ dateformat.c \ dateformat_class.c \ diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 9ede8a92e97a8..cb43e22fc45c4 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -42,6 +42,7 @@ #include "locale/locale_class.h" #include "listformatter/listformatter_class.h" +#include "rangeformatter/rangeformatter_class.h" #include "dateformat/dateformat.h" #include "dateformat/dateformat_class.h" @@ -189,6 +190,9 @@ PHP_MINIT_FUNCTION( intl ) /* Register 'ListFormatter' PHP class */ listformatter_register_class( ); + /* Register 'NumberRangeFormatter' PHP class */ + rangeformatter_register_class( ); + /* Register 'Normalizer' PHP class */ normalizer_register_Normalizer_class( ); diff --git a/ext/intl/rangeformatter/rangeformatter.stub.php b/ext/intl/rangeformatter/rangeformatter.stub.php new file mode 100644 index 0000000000000..eae40b5a56c23 --- /dev/null +++ b/ext/intl/rangeformatter/rangeformatter.stub.php @@ -0,0 +1,61 @@ += 63 + /** @cvalue UNUM_RANGE_COLLAPSE_AUTO */ + public const int COLLAPSE_AUTO = UNKNOWN; + + /** @cvalue UNUM_RANGE_COLLAPSE_NONE */ + public const int COLLAPSE_NONE = UNKNOWN; + + /** @cvalue UNUM_RANGE_COLLAPSE_UNIT */ + public const int COLLAPSE_UNIT = UNKNOWN; + + /** @cvalue UNUM_RANGE_COLLAPSE_ALL */ + public const int COLLAPSE_ALL = UNKNOWN; + + /** @cvalue UNUM_IDENTITY_FALLBACK_SINGLE_VALUE */ + public const int IDENTITY_FALLBACK_SINGLE_VALUE = UNKNOWN; + + /** @cvalue UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE */ + public const int IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE = UNKNOWN; + + /** @cvalue UNUM_IDENTITY_FALLBACK_APPROXIMATELY */ + public const int IDENTITY_FALLBACK_APPROXIMATELY = UNKNOWN; + + /** @cvalue UNUM_IDENTITY_FALLBACK_RANGE */ + public const int IDENTITY_FALLBACK_RANGE = UNKNOWN; +#else + public const int COLLAPSE_AUTO = 0; + + public const int COLLAPSE_NONE = 1; + + public const int COLLAPSE_UNIT = 2; + + public const int COLLAPSE_ALL = 3; + + public const int IDENTITY_FALLBACK_SINGLE_VALUE = 0; + + public const int IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE = 1; + + public const int IDENTITY_FALLBACK_APPROXIMATELY = 2; + + public const int IDENTITY_FALLBACK_RANGE = 3; +#endif + + private function __construct() {} + + public static function createFromSkeleton(string $skeleton, string $locale, int $collapse, int $identityFallback): IntlNumberRangeFormatter {} + + public function format(float|int $start, float|int $end): string {} + + public function getErrorCode(): int {} + + public function getErrorMessage(): string {} +} diff --git a/ext/intl/rangeformatter/rangeformatter_arginfo.h b/ext/intl/rangeformatter/rangeformatter_arginfo.h new file mode 100644 index 0000000000000..00e923702be11 --- /dev/null +++ b/ext/intl/rangeformatter/rangeformatter_arginfo.h @@ -0,0 +1,148 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 7029642524e32984e893e1e050a5e0bbf275c416 */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlNumberRangeFormatter___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_IntlNumberRangeFormatter_createFromSkeleton, 0, 4, IntlNumberRangeFormatter, 0) + ZEND_ARG_TYPE_INFO(0, skeleton, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, collapse, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, identityFallback, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_IntlNumberRangeFormatter_format, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, start, MAY_BE_DOUBLE|MAY_BE_LONG, NULL) + ZEND_ARG_TYPE_MASK(0, end, MAY_BE_DOUBLE|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_IntlNumberRangeFormatter_getErrorCode, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_IntlNumberRangeFormatter_getErrorMessage, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_METHOD(IntlNumberRangeFormatter, __construct); +ZEND_METHOD(IntlNumberRangeFormatter, createFromSkeleton); +ZEND_METHOD(IntlNumberRangeFormatter, format); +ZEND_METHOD(IntlNumberRangeFormatter, getErrorCode); +ZEND_METHOD(IntlNumberRangeFormatter, getErrorMessage); + +static const zend_function_entry class_IntlNumberRangeFormatter_methods[] = { + ZEND_ME(IntlNumberRangeFormatter, __construct, arginfo_class_IntlNumberRangeFormatter___construct, ZEND_ACC_PRIVATE) + ZEND_ME(IntlNumberRangeFormatter, createFromSkeleton, arginfo_class_IntlNumberRangeFormatter_createFromSkeleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(IntlNumberRangeFormatter, format, arginfo_class_IntlNumberRangeFormatter_format, ZEND_ACC_PUBLIC) + ZEND_ME(IntlNumberRangeFormatter, getErrorCode, arginfo_class_IntlNumberRangeFormatter_getErrorCode, ZEND_ACC_PUBLIC) + ZEND_ME(IntlNumberRangeFormatter, getErrorMessage, arginfo_class_IntlNumberRangeFormatter_getErrorMessage, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_IntlNumberRangeFormatter(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "IntlNumberRangeFormatter", class_IntlNumberRangeFormatter_methods); + class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE); +#if U_ICU_VERSION_MAJOR_NUM >= 63 + + zval const_COLLAPSE_AUTO_value; + ZVAL_LONG(&const_COLLAPSE_AUTO_value, UNUM_RANGE_COLLAPSE_AUTO); + zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_AUTO_name, &const_COLLAPSE_AUTO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_AUTO_name); + + zval const_COLLAPSE_NONE_value; + ZVAL_LONG(&const_COLLAPSE_NONE_value, UNUM_RANGE_COLLAPSE_NONE); + zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_NONE_name, &const_COLLAPSE_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_NONE_name); + + zval const_COLLAPSE_UNIT_value; + ZVAL_LONG(&const_COLLAPSE_UNIT_value, UNUM_RANGE_COLLAPSE_UNIT); + zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_UNIT_name, &const_COLLAPSE_UNIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_UNIT_name); + + zval const_COLLAPSE_ALL_value; + ZVAL_LONG(&const_COLLAPSE_ALL_value, UNUM_RANGE_COLLAPSE_ALL); + zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_ALL_name, &const_COLLAPSE_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_ALL_name); + + zval const_IDENTITY_FALLBACK_SINGLE_VALUE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_SINGLE_VALUE_value, UNUM_IDENTITY_FALLBACK_SINGLE_VALUE); + zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_SINGLE_VALUE_name); + + zval const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name); + + zval const_IDENTITY_FALLBACK_APPROXIMATELY_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_value, UNUM_IDENTITY_FALLBACK_APPROXIMATELY); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_name); + + zval const_IDENTITY_FALLBACK_RANGE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_RANGE_value, UNUM_IDENTITY_FALLBACK_RANGE); + zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_RANGE_name, &const_IDENTITY_FALLBACK_RANGE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_RANGE_name); +#endif +#if !(U_ICU_VERSION_MAJOR_NUM >= 63) + + zval const_COLLAPSE_AUTO_value; + ZVAL_LONG(&const_COLLAPSE_AUTO_value, 0); + zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_AUTO_name, &const_COLLAPSE_AUTO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_AUTO_name); + + zval const_COLLAPSE_NONE_value; + ZVAL_LONG(&const_COLLAPSE_NONE_value, 1); + zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_NONE_name, &const_COLLAPSE_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_NONE_name); + + zval const_COLLAPSE_UNIT_value; + ZVAL_LONG(&const_COLLAPSE_UNIT_value, 2); + zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_UNIT_name, &const_COLLAPSE_UNIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_UNIT_name); + + zval const_COLLAPSE_ALL_value; + ZVAL_LONG(&const_COLLAPSE_ALL_value, 3); + zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_COLLAPSE_ALL_name, &const_COLLAPSE_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_COLLAPSE_ALL_name); + + zval const_IDENTITY_FALLBACK_SINGLE_VALUE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_SINGLE_VALUE_value, 0); + zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_SINGLE_VALUE_name); + + zval const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, 1); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name); + + zval const_IDENTITY_FALLBACK_APPROXIMATELY_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_value, 2); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_name); + + zval const_IDENTITY_FALLBACK_RANGE_value; + ZVAL_LONG(&const_IDENTITY_FALLBACK_RANGE_value, 3); + zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_RANGE_name, &const_IDENTITY_FALLBACK_RANGE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IDENTITY_FALLBACK_RANGE_name); +#endif + + return class_entry; +} diff --git a/ext/intl/rangeformatter/rangeformatter_class.cpp b/ext/intl/rangeformatter/rangeformatter_class.cpp new file mode 100644 index 0000000000000..a19bbb451d801 --- /dev/null +++ b/ext/intl/rangeformatter/rangeformatter_class.cpp @@ -0,0 +1,239 @@ +/* + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Bogdan Ungureanu | + +----------------------------------------------------------------------+ +*/ + +extern "C" { + #include "php.h" + #include "zend_API.h" + #include "../intl_common.h" +} + +#if U_ICU_VERSION_MAJOR_NUM >= 63 +#include +#include +#include +#include +#include "../intl_convertcpp.h" +#endif + +extern "C" { + #include "../intl_error.h" + #include "../php_intl.h" + #include "../intl_data.h" + #include "rangeformatter_arginfo.h" + #include "rangeformatter_class.h" + #include "intl_convert.h" +} + +#if U_ICU_VERSION_MAJOR_NUM >= 63 +using icu::number::NumberRangeFormatter; +using icu::number::NumberFormatter; +using icu::number::UnlocalizedNumberFormatter; +using icu::number::LocalizedNumberRangeFormatter; +using icu::UnicodeString; +using icu::MeasureUnit; +#endif + +static zend_object_handlers rangeformatter_handlers; +zend_class_entry *class_entry_IntlNumberRangeFormatter; + +zend_object *IntlNumberRangeFormatter_object_create(zend_class_entry *ce) +{ + IntlNumberRangeFormatter_object* intern; + + intern = reinterpret_cast(zend_object_alloc(sizeof(IntlNumberRangeFormatter_object), ce)); + zend_object_std_init(&intern->zo, ce); + object_properties_init(&intern->zo, ce); + + // Initialize rangeformatter_data structure + intl_error_init(&intern->nrf_data.error); + intern->nrf_data.unumrf = nullptr; + + intern->zo.handlers = &rangeformatter_handlers; + + return &intern->zo; +} + +U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, __construct) +{ + ZEND_PARSE_PARAMETERS_NONE(); + zend_throw_error(NULL, "Cannot directly construct %s, use createFromSkeleton method instead", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name)); +} + +U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, createFromSkeleton) +{ +#if U_ICU_VERSION_MAJOR_NUM < 63 + zend_throw_error(NULL, "IntlNumberRangeFormatter is not available in ICU 62 and earlier"); + RETURN_THROWS(); +#else + char* skeleton; + char* locale; + size_t locale_len; + size_t skeleton_len; + zend_long collapse; + zend_long identityFallback; + + ZEND_PARSE_PARAMETERS_START(4,4) + Z_PARAM_STRING(skeleton, skeleton_len) + Z_PARAM_STRING(locale, locale_len) + Z_PARAM_LONG(collapse) + Z_PARAM_LONG(identityFallback) + ZEND_PARSE_PARAMETERS_END(); + + if (locale_len == 0) { + locale = (char *)intl_locale_get_default(); + } + + if (locale_len > INTL_MAX_LOCALE_LEN) { + zend_argument_value_error(2, "must be no longer than %d characters", INTL_MAX_LOCALE_LEN); + RETURN_THROWS(); + } + + if (strlen(uloc_getISO3Language(locale)) == 0) { + zend_argument_value_error(2, "\"%s\" is invalid", locale); + RETURN_THROWS(); + } + + if (collapse != UNUM_RANGE_COLLAPSE_AUTO && collapse != UNUM_RANGE_COLLAPSE_NONE && collapse != UNUM_RANGE_COLLAPSE_UNIT && collapse != UNUM_RANGE_COLLAPSE_ALL) { + zend_argument_value_error(3, "must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL"); + RETURN_THROWS(); + } + + if (identityFallback != UNUM_IDENTITY_FALLBACK_SINGLE_VALUE && identityFallback != UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE && identityFallback != UNUM_IDENTITY_FALLBACK_APPROXIMATELY && identityFallback != UNUM_IDENTITY_FALLBACK_RANGE) { + zend_argument_value_error(4, "must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE"); + RETURN_THROWS(); + } + + UErrorCode status = U_ZERO_ERROR; + + UnicodeString skeleton_ustr(skeleton, skeleton_len); + + UnlocalizedNumberFormatter nf = NumberFormatter::forSkeleton(skeleton_ustr, status); + + if (U_FAILURE(status)) { + // override error level and use exceptions + const bool old_use_exception = INTL_G(use_exceptions); + const zend_long old_error_level = INTL_G(error_level); + INTL_G(use_exceptions) = true; + INTL_G(error_level) = 0; + + intl_error_set(NULL, status, "Failed to create the number skeleton"); + + INTL_G(use_exceptions) = old_use_exception; + INTL_G(error_level) = old_error_level; + } + + LocalizedNumberRangeFormatter* nrf = new LocalizedNumberRangeFormatter( + NumberRangeFormatter::with() + .locale(locale) + .numberFormatterBoth(nf) + .collapse(static_cast(collapse)) + .identityFallback(static_cast(identityFallback)) + ); + + zend_object* obj = IntlNumberRangeFormatter_object_create(class_entry_IntlNumberRangeFormatter); + + RANGEFORMATTER_OBJECT(php_intl_numberrangeformatter_fetch_object(obj)) = nrf; + + RETURN_OBJ(obj); +#endif +} + +U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, format) +{ +#if U_ICU_VERSION_MAJOR_NUM < 63 + zend_throw_error(NULL, "IntlNumberRangeFormatter is not available in ICU 62 and earlier"); + RETURN_THROWS(); +#else + zval *start; + zval *end; + + IntlNumberRangeFormatter_object* obj = Z_INTL_RANGEFORMATTER_P(ZEND_THIS); + + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_NUMBER(start) + Z_PARAM_NUMBER(end) + ZEND_PARSE_PARAMETERS_END(); + + UErrorCode error = U_ZERO_ERROR; + + icu::Formattable start_formattable(Z_TYPE_P(start) == IS_DOUBLE ? Z_DVAL_P(start) : Z_LVAL_P(start)); + icu::Formattable end_formattable(Z_TYPE_P(end) == IS_DOUBLE ? Z_DVAL_P(end) : Z_LVAL_P(end)); + + UnicodeString result = RANGEFORMATTER_OBJECT(obj)->formatFormattableRange(start_formattable, end_formattable, error).toString(error); + + // override error level and use exceptions + const bool old_use_exception = INTL_G(use_exceptions); + const zend_long old_error_level = INTL_G(error_level); + INTL_G(use_exceptions) = true; + INTL_G(error_level) = 0; + + if (U_FAILURE(error)) { + intl_error_set(NULL, error, "Failed to format number range"); + } + + zend_string *ret = intl_charFromString(result, &error); + + if (U_FAILURE(error)) { + intl_error_set(NULL, error, "Failed to convert result to UTF-8"); + } + + INTL_G(use_exceptions) = old_use_exception; + INTL_G(error_level) = old_error_level; + + RETVAL_NEW_STR(ret); +#endif +} + +U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, getErrorCode) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + IntlNumberRangeFormatter_object* obj = Z_INTL_RANGEFORMATTER_P(ZEND_THIS); + + RETURN_LONG(intl_error_get_code(&obj->nrf_data.error)); +} + +U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, getErrorMessage) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + IntlNumberRangeFormatter_object* obj = Z_INTL_RANGEFORMATTER_P(ZEND_THIS); + + RETURN_STR(intl_error_get_message(&obj->nrf_data.error)); +} + +void IntlNumberRangeFormatter_object_free(zend_object *object) +{ + IntlNumberRangeFormatter_object* nfo = php_intl_numberrangeformatter_fetch_object(object); + + if (nfo->nrf_data.unumrf) { + delete nfo->nrf_data.unumrf; + nfo->nrf_data.unumrf = nullptr; + } + + intl_error_reset(&nfo->nrf_data.error); + + zend_object_std_dtor(&nfo->zo); +} + +void rangeformatter_register_class(void) +{ + class_entry_IntlNumberRangeFormatter = register_class_IntlNumberRangeFormatter(); + class_entry_IntlNumberRangeFormatter->create_object = IntlNumberRangeFormatter_object_create; + + memcpy(&rangeformatter_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + rangeformatter_handlers.offset = XtOffsetOf(IntlNumberRangeFormatter_object, zo); + rangeformatter_handlers.free_obj = IntlNumberRangeFormatter_object_free; + rangeformatter_handlers.clone_obj = NULL; +} diff --git a/ext/intl/rangeformatter/rangeformatter_class.h b/ext/intl/rangeformatter/rangeformatter_class.h new file mode 100644 index 0000000000000..f5018cbaf71fa --- /dev/null +++ b/ext/intl/rangeformatter/rangeformatter_class.h @@ -0,0 +1,59 @@ +/* + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Bogdan Ungureanu | + +----------------------------------------------------------------------+ +*/ + +#ifndef RANGEFORMATTER_CLASS_H +#define RANGEFORMATTER_CLASS_H + +#if U_ICU_VERSION_MAJOR_NUM >= 63 +#include + +#ifdef __cplusplus +using icu::number::LocalizedNumberRangeFormatter; +#else +typedef void LocalizedNumberRangeFormatter; +#endif +#endif // U_ICU_VERSION_MAJOR_NUM >= 63 + +typedef struct { + // error handling + intl_error error; + + // formatter handling +#if U_ICU_VERSION_MAJOR_NUM >= 63 + LocalizedNumberRangeFormatter* unumrf; +#else + void* unumrf; +#endif +} rangeformatter_data; + +typedef struct { + rangeformatter_data nrf_data; + zend_object zo; +} IntlNumberRangeFormatter_object; + +static inline IntlNumberRangeFormatter_object *php_intl_numberrangeformatter_fetch_object(zend_object *obj) { + return (IntlNumberRangeFormatter_object *)((char*)(obj) - XtOffsetOf(IntlNumberRangeFormatter_object, zo)); +} + +#define Z_INTL_RANGEFORMATTER_P(zv) php_intl_numberrangeformatter_fetch_object(Z_OBJ_P(zv)) + +#define RANGEFORMATTER_ERROR(nfo) (nfo)->nrf_data.error +#define RANGEFORMATTER_ERROR_P(nfo) &(RANGEFORMATTER_ERROR(nfo)) + +#define RANGEFORMATTER_OBJECT(nfo) (nfo)->nrf_data.unumrf + + +void rangeformatter_register_class(void); + +#endif diff --git a/ext/intl/tests/rangeformatter/basic.phpt b/ext/intl/tests/rangeformatter/basic.phpt new file mode 100644 index 0000000000000..0e76466bc09b7 --- /dev/null +++ b/ext/intl/tests/rangeformatter/basic.phpt @@ -0,0 +1,484 @@ +--TEST-- +Basic test for IntlNumberRangeFormatter +--EXTENSIONS-- +intl +--SKIPIF-- + +--FILE-- + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, + 'IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE' => IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, + 'IDENTITY_FALLBACK_APPROXIMATELY' => IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, + 'IDENTITY_FALLBACK_RANGE' => IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE +]; + +$collapses = [ + 'COLLAPSE_AUTO' => IntlNumberRangeFormatter::COLLAPSE_AUTO, + 'COLLAPSE_NONE' => IntlNumberRangeFormatter::COLLAPSE_NONE, + 'COLLAPSE_UNIT' => IntlNumberRangeFormatter::COLLAPSE_UNIT, + 'COLLAPSE_ALL' => IntlNumberRangeFormatter::COLLAPSE_ALL +]; + +foreach ($languages as $language) { + foreach ($identityFallbacks as $iName => $identityFallback) { + foreach ($collapses as $cName => $collapse) { + echo PHP_EOL . $language . ' - ' . $cName . ' - ' . $iName . PHP_EOL; + $nrf = IntlNumberRangeFormatter::createFromSkeleton( + 'measure-unit/length-meter', + $language, + $collapse, + $identityFallback + ); + + var_dump($nrf->format(1.1, 2.2)); + var_dump($nrf->format(100, 200)); + var_dump($nrf->format(-5, 5)); + var_dump($nrf->format(5, 5)); + var_dump($nrf->format(5.0001, 5.0001)); + var_dump($nrf->format(5, 5.1)); + var_dump($nrf->format(5.1, 6)); + } + } +} + +?> +--EXPECT-- +en_US - COLLAPSE_AUTO - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_NONE - IDENTITY_FALLBACK_SINGLE_VALUE +string(15) "1.1 m – 2.2 m" +string(15) "100 m – 200 m" +string(12) "-5 m – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(13) "5 m – 5.1 m" +string(13) "5.1 m – 6 m" + +en_US - COLLAPSE_UNIT - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_ALL - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(15) "1.1 m – 2.2 m" +string(15) "100 m – 200 m" +string(12) "-5 m – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(13) "5 m – 5.1 m" +string(13) "5.1 m – 6 m" + +en_US - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(4) "~5 m" +string(9) "~5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY +string(15) "1.1 m – 2.2 m" +string(15) "100 m – 200 m" +string(12) "-5 m – 5 m" +string(4) "~5 m" +string(9) "~5.0001 m" +string(13) "5 m – 5.1 m" +string(13) "5.1 m – 6 m" + +en_US - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(4) "~5 m" +string(9) "~5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(4) "~5 m" +string(9) "~5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_AUTO - IDENTITY_FALLBACK_RANGE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(7) "5–5 m" +string(17) "5.0001–5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_NONE - IDENTITY_FALLBACK_RANGE +string(15) "1.1 m – 2.2 m" +string(15) "100 m – 200 m" +string(12) "-5 m – 5 m" +string(11) "5 m – 5 m" +string(21) "5.0001 m – 5.0001 m" +string(13) "5 m – 5.1 m" +string(13) "5.1 m – 6 m" + +en_US - COLLAPSE_UNIT - IDENTITY_FALLBACK_RANGE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(7) "5–5 m" +string(17) "5.0001–5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +en_US - COLLAPSE_ALL - IDENTITY_FALLBACK_RANGE +string(11) "1.1–2.2 m" +string(11) "100–200 m" +string(10) "-5 – 5 m" +string(7) "5–5 m" +string(17) "5.0001–5.0001 m" +string(9) "5–5.1 m" +string(9) "5.1–6 m" + +RO - COLLAPSE_AUTO - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_NONE - IDENTITY_FALLBACK_SINGLE_VALUE +string(13) "1,1 m - 2,2 m" +string(13) "100 m - 200 m" +string(10) "-5 m - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(11) "5 m - 5,1 m" +string(11) "5,1 m - 6 m" + +RO - COLLAPSE_UNIT - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_ALL - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(13) "1,1 m - 2,2 m" +string(13) "100 m - 200 m" +string(10) "-5 m - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(11) "5 m - 5,1 m" +string(11) "5,1 m - 6 m" + +RO - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(3) "5 m" +string(8) "5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(4) "~5 m" +string(9) "~5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY +string(13) "1,1 m - 2,2 m" +string(13) "100 m - 200 m" +string(10) "-5 m - 5 m" +string(4) "~5 m" +string(9) "~5,0001 m" +string(11) "5 m - 5,1 m" +string(11) "5,1 m - 6 m" + +RO - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(4) "~5 m" +string(9) "~5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(4) "~5 m" +string(9) "~5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_AUTO - IDENTITY_FALLBACK_RANGE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(7) "5 - 5 m" +string(17) "5,0001 - 5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_NONE - IDENTITY_FALLBACK_RANGE +string(13) "1,1 m - 2,2 m" +string(13) "100 m - 200 m" +string(10) "-5 m - 5 m" +string(9) "5 m - 5 m" +string(19) "5,0001 m - 5,0001 m" +string(11) "5 m - 5,1 m" +string(11) "5,1 m - 6 m" + +RO - COLLAPSE_UNIT - IDENTITY_FALLBACK_RANGE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(7) "5 - 5 m" +string(17) "5,0001 - 5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +RO - COLLAPSE_ALL - IDENTITY_FALLBACK_RANGE +string(11) "1,1 - 2,2 m" +string(11) "100 - 200 m" +string(8) "-5 - 5 m" +string(7) "5 - 5 m" +string(17) "5,0001 - 5,0001 m" +string(9) "5 - 5,1 m" +string(9) "5,1 - 6 m" + +JA - COLLAPSE_AUTO - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_NONE - IDENTITY_FALLBACK_SINGLE_VALUE +string(15) "1.1 m ~ 2.2 m" +string(15) "100 m ~ 200 m" +string(12) "-5 m ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(13) "5 m ~ 5.1 m" +string(13) "5.1 m ~ 6 m" + +JA - COLLAPSE_UNIT - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_ALL - IDENTITY_FALLBACK_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(15) "1.1 m ~ 2.2 m" +string(15) "100 m ~ 200 m" +string(12) "-5 m ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(13) "5 m ~ 5.1 m" +string(13) "5.1 m ~ 6 m" + +JA - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(3) "5 m" +string(8) "5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_AUTO - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(6) "約5 m" +string(11) "約5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_NONE - IDENTITY_FALLBACK_APPROXIMATELY +string(15) "1.1 m ~ 2.2 m" +string(15) "100 m ~ 200 m" +string(12) "-5 m ~ 5 m" +string(6) "約5 m" +string(11) "約5.0001 m" +string(13) "5 m ~ 5.1 m" +string(13) "5.1 m ~ 6 m" + +JA - COLLAPSE_UNIT - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(6) "約5 m" +string(11) "約5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_ALL - IDENTITY_FALLBACK_APPROXIMATELY +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(6) "約5 m" +string(11) "約5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_AUTO - IDENTITY_FALLBACK_RANGE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(7) "5~5 m" +string(17) "5.0001~5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_NONE - IDENTITY_FALLBACK_RANGE +string(15) "1.1 m ~ 2.2 m" +string(15) "100 m ~ 200 m" +string(12) "-5 m ~ 5 m" +string(11) "5 m ~ 5 m" +string(21) "5.0001 m ~ 5.0001 m" +string(13) "5 m ~ 5.1 m" +string(13) "5.1 m ~ 6 m" + +JA - COLLAPSE_UNIT - IDENTITY_FALLBACK_RANGE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(7) "5~5 m" +string(17) "5.0001~5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" + +JA - COLLAPSE_ALL - IDENTITY_FALLBACK_RANGE +string(11) "1.1~2.2 m" +string(11) "100~200 m" +string(10) "-5 ~ 5 m" +string(7) "5~5 m" +string(17) "5.0001~5.0001 m" +string(9) "5~5.1 m" +string(9) "5.1~6 m" diff --git a/ext/intl/tests/rangeformatter/rangeformatter_clone.phpt b/ext/intl/tests/rangeformatter/rangeformatter_clone.phpt new file mode 100644 index 0000000000000..31674ba6eea25 --- /dev/null +++ b/ext/intl/tests/rangeformatter/rangeformatter_clone.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test IntlNumberRangeFormatter cannot be cloned +--EXTENSIONS-- +intl +--SKIPIF-- + +--FILE-- +getMessage(); +} +?> +--EXPECT-- +Trying to clone an uncloneable object of class IntlNumberRangeFormatter diff --git a/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt new file mode 100644 index 0000000000000..83c993d7fc98b --- /dev/null +++ b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt @@ -0,0 +1,87 @@ +--TEST-- +errors for IntlNumberRangeFormatter +--EXTENSIONS-- +intl +--SKIPIF-- + +--FILE-- +getMessage() . PHP_EOL; +} + +echo intl_get_error_code() . PHP_EOL; +echo intl_get_error_message() . PHP_EOL; + +try { + new IntlNumberRangeFormatter(); +} catch(Error $error) { + echo $error->getMessage() . PHP_EOL; +} + +try { + $nrf = IntlNumberRangeFormatter::createFromSkeleton( + 'invalid skeleton here', + 'ro', + 34, + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE + ); +} catch (ValueError $exception) { + echo $exception->getMessage() . PHP_EOL; +} + +try { + $nrf = IntlNumberRangeFormatter::createFromSkeleton( + 'invalid skeleton here', + 'ro', + IntlNumberRangeFormatter::COLLAPSE_AUTO, + 343 + ); +} catch (ValueError $exception) { + echo $exception->getMessage() . PHP_EOL; +} + +try { + $nrf = IntlNumberRangeFormatter::createFromSkeleton( + 'invalid skeleton here', + 'invalid-language', + IntlNumberRangeFormatter::COLLAPSE_AUTO, + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE + ); +} catch (ValueError $exception) { + echo $exception->getMessage() . PHP_EOL; +} + +try { + $nrf = IntlNumberRangeFormatter::createFromSkeleton( + 'invalid skeleton here', + 'ro_thisiswaytooooooooooooooooooooooooooooooooooooooooooooolongtobevaliditneedstobeatleast157characterstofailthevalidationinthelistformattercodeimplementation', + IntlNumberRangeFormatter::COLLAPSE_AUTO, + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE + ); +} catch (ValueError $exception) { + echo $exception->getMessage() . PHP_EOL; +} + +?> +--EXPECT-- +IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton +65811 +IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton: U_NUMBER_SKELETON_SYNTAX_ERROR +Call to private IntlNumberRangeFormatter::__construct() from global scope +IntlNumberRangeFormatter::createFromSkeleton(): Argument #3 ($collapse) must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL +IntlNumberRangeFormatter::createFromSkeleton(): Argument #4 ($identityFallback) must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE +IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) "invalid-language" is invalid +IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) must be no longer than 156 characters diff --git a/ext/intl/tests/rangeformatter/rangeformatter_fraction_skeleton.phpt b/ext/intl/tests/rangeformatter/rangeformatter_fraction_skeleton.phpt new file mode 100644 index 0000000000000..f054aea94b5fa --- /dev/null +++ b/ext/intl/tests/rangeformatter/rangeformatter_fraction_skeleton.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test precision skeleton with IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY +--EXTENSIONS-- +intl +--SKIPIF-- + +--FILE-- +format(5.1, 5.2)); + var_dump($nrf->format(5.01, 5.02)); + var_dump($nrf->format(5.001, 5.002)); +} + +?> +--EXPECT-- +Approximate with .## +string(9) "5.1–5.2" +string(11) "5.01–5.02" +string(2) "~5" +Approximate with .# +string(9) "5.1–5.2" +string(2) "~5" +string(2) "~5" diff --git a/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt b/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt new file mode 100644 index 0000000000000..0d829ad538af5 --- /dev/null +++ b/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test IntlNumberRangeFormatter::createFromSkeleton throws error for ICU < 63 +--EXTENSIONS-- +intl +--SKIPIF-- += 0) { + die('skip for ICU > 63.0'); +} +?> +--FILE-- +getMessage(); +} +?> +--EXPECT-- +IntlNumberRangeFormatter is not available in ICU 62 and earlier diff --git a/ext/intl/tests/rangeformatter/rangeformatter_with_empty_skeleton.phpt b/ext/intl/tests/rangeformatter/rangeformatter_with_empty_skeleton.phpt new file mode 100644 index 0000000000000..43afc85f2b5fa --- /dev/null +++ b/ext/intl/tests/rangeformatter/rangeformatter_with_empty_skeleton.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test an empty skeleton with IntlNumberRangeFormatter +--EXTENSIONS-- +intl +--SKIPIF-- + +--FILE-- +format(5.1, 5.2)); + +?> +--EXPECT-- +string(9) "5.1–5.2" From ee2da6d9e9745ec83b02b1e5c5a07e8dbd5f9f98 Mon Sep 17 00:00:00 2001 From: Bogdan Ungureanu Date: Sun, 28 Sep 2025 01:15:23 +0300 Subject: [PATCH 093/386] ext/intl: Remove unneeded unumberrangeformatter.h include (#19980) --- ext/intl/rangeformatter/rangeformatter_class.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/intl/rangeformatter/rangeformatter_class.cpp b/ext/intl/rangeformatter/rangeformatter_class.cpp index a19bbb451d801..31f385a0a9262 100644 --- a/ext/intl/rangeformatter/rangeformatter_class.cpp +++ b/ext/intl/rangeformatter/rangeformatter_class.cpp @@ -20,7 +20,6 @@ extern "C" { #if U_ICU_VERSION_MAJOR_NUM >= 63 #include -#include #include #include #include "../intl_convertcpp.h" From 898235127b362d7103fdae8142c05908b7191f60 Mon Sep 17 00:00:00 2001 From: Guillaume Outters Date: Fri, 4 Oct 2024 23:14:18 +0200 Subject: [PATCH 094/386] Pdo\Pgsql: Fix getColumnMeta() for GH-15287 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As stated in the UPGRADING, using the passthrough ("single-row") mode of libpq (introduced in #15287) forbids passing a new query while the current one's results have not been entirely consumed. … But I didn't notice that ext/pdo_pgsql internally used new queries to fetch metadata (example use case: a call to getColumnMeta() while fetch()ing row by row will interleave the getColumnMeta()-triggered internal query to the database, with the results fetching for the user-called query). This PR makes those internal calls return NULL for non-essential metadata, instead of letting libpq abort the user-called query. It moreover includes a small tweak to table oid-to-name translation, with a 1-slot cache. This may by chance allow the internal call to return something instead of NULL, but it will nonetheless avoid 30 server calls to get the table name of 30 columns of the same table. optimize calls to foreach(columns of the same table) getColumnMeta() - each call queried the DB to know the name associated with the table's OID: cache the result between two calls - make pdo_pgsql_translate_oid_to_table higher-level, with the last parameter being the handle instead of the raw connection; thus the statement is cleaner, letting the handle do all memory handling on the table oid-to-name translation cache (which by the way is a driver feature more than a statement one) close GH-16249 --- NEWS | 4 +++ ext/pdo_pgsql/pgsql_driver.c | 58 ++++++++++++++++++++++++------- ext/pdo_pgsql/pgsql_statement.c | 50 ++++++++++++++++++-------- ext/pdo_pgsql/php_pdo_pgsql_int.h | 8 +++++ ext/pdo_pgsql/tests/gh15287.phpt | 15 ++++++++ 5 files changed, 109 insertions(+), 26 deletions(-) diff --git a/NEWS b/NEWS index 2213ff10b1db7..7e9010e96cef8 100644 --- a/NEWS +++ b/NEWS @@ -7,4 +7,8 @@ PHP NEWS with a given skeleton, locale, collapse type and identity fallback. (BogdanUngureanu) +- PDO_PGSQL: + . Fixed Pdo\Pgsql::getColumnMeta() when Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0). + (outtersg) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index be865c1f86838..c8aea7f0594e2 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -36,6 +36,7 @@ #include "pgsql_driver_arginfo.h" static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh); +void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode); static char * _pdo_pgsql_trim_message(const char *message, int persistent) { @@ -109,6 +110,37 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char * } /* }}} */ +static zend_always_inline void pgsql_finish_running_stmt(pdo_pgsql_db_handle *H) +{ + if (H->running_stmt) { + pgsql_stmt_finish(H->running_stmt, 0); + } +} + +static zend_always_inline void pgsql_discard_running_stmt(pdo_pgsql_db_handle *H) +{ + if (H->running_stmt) { + pgsql_stmt_finish(H->running_stmt, FIN_DISCARD); + } + + PGresult *pgsql_result; + bool first = true; + while ((pgsql_result = PQgetResult(H->server))) { + /* We should not arrive here, where libpq has a result to deliver without us + * having registered a running statement: + * every result discarding should go through the unified pgsql_stmt_finish, + * but maybe there still is an internal query that we omitted to adapt. + * So instead of asserting let's just emit an informational notice, + * and consume anyway (results consumption is handle-wise, so we have no formal + * need for the statement). */ + if (first) { + php_error_docref(NULL, E_NOTICE, "Internal error: unable to link a libpq result to consume, to its origin statement"); + first = false; + } + PQclear(pgsql_result); + } +} + static void _pdo_pgsql_notice(void *context, const char *message) /* {{{ */ { pdo_dbh_t * dbh = (pdo_dbh_t *)context; @@ -258,6 +290,10 @@ static void pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */ PQfinish(H->server); H->server = NULL; } + if (H->cached_table_name) { + efree(H->cached_table_name); + H->cached_table_name = NULL; + } if (H->einfo.errmsg) { pefree(H->einfo.errmsg, dbh->is_persistent); H->einfo.errmsg = NULL; @@ -351,6 +387,7 @@ static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) bool in_trans = pgsql_handle_in_transaction(dbh); + pgsql_finish_running_stmt(H); if (!(res = PQexec(H->server, ZSTR_VAL(sql)))) { /* fatal error */ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); @@ -426,6 +463,7 @@ static zend_string *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const zend_string * PGresult *res; ExecStatusType status; + pgsql_finish_running_stmt(H); if (name == NULL) { res = PQexec(H->server, "SELECT LASTVAL()"); } else { @@ -589,6 +627,7 @@ static bool pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh) PGresult *res; bool ret = true; + pgsql_finish_running_stmt(H); res = PQexec(H->server, cmd); if (PQresultStatus(res) != PGRES_COMMAND_OK) { @@ -696,9 +735,8 @@ void pgsqlCopyFromArray_internal(INTERNAL_FUNCTION_PARAMETERS) /* Obtain db Handle */ H = (pdo_pgsql_db_handle *)dbh->driver_data; - while ((pgsql_result = PQgetResult(H->server))) { - PQclear(pgsql_result); - } + pgsql_discard_running_stmt(H); + pgsql_result = PQexec(H->server, query); efree(query); @@ -820,9 +858,8 @@ void pgsqlCopyFromFile_internal(INTERNAL_FUNCTION_PARAMETERS) H = (pdo_pgsql_db_handle *)dbh->driver_data; - while ((pgsql_result = PQgetResult(H->server))) { - PQclear(pgsql_result); - } + pgsql_discard_running_stmt(H); + pgsql_result = PQexec(H->server, query); efree(query); @@ -916,9 +953,7 @@ void pgsqlCopyToFile_internal(INTERNAL_FUNCTION_PARAMETERS) RETURN_FALSE; } - while ((pgsql_result = PQgetResult(H->server))) { - PQclear(pgsql_result); - } + pgsql_discard_running_stmt(H); /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { @@ -1007,9 +1042,7 @@ void pgsqlCopyToArray_internal(INTERNAL_FUNCTION_PARAMETERS) H = (pdo_pgsql_db_handle *)dbh->driver_data; - while ((pgsql_result = PQgetResult(H->server))) { - PQclear(pgsql_result); - } + pgsql_discard_running_stmt(H); /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { @@ -1461,6 +1494,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ H->attached = 1; H->pgoid = -1; + H->cached_table_oid = InvalidOid; dbh->methods = &pgsql_methods; dbh->alloc_own_columns = 1; diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 426a878d8eff7..4335e374c5ab2 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -56,14 +56,14 @@ #define FLOAT8LABEL "float8" #define FLOAT8OID 701 -#define FIN_DISCARD 0x1 -#define FIN_CLOSE 0x2 -#define FIN_ABORT 0x4 - -static void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) +void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) { + if (!S) { + return; + } + pdo_pgsql_db_handle *H = S->H; if (S->is_running_unbuffered && S->result && (fin_mode & FIN_ABORT)) { @@ -113,9 +113,10 @@ static void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) } S->is_prepared = false; - if (H->running_stmt == S) { - H->running_stmt = NULL; - } + } + + if (H->running_stmt == S && (fin_mode & (FIN_CLOSE|FIN_ABORT))) { + H->running_stmt = NULL; } } @@ -188,9 +189,8 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt) * and returns a PGRES_FATAL_ERROR when PQgetResult gets called for stmt 2 if DEALLOCATE * was called for stmt 1 inbetween * (maybe it will change with pipeline mode in libpq 14?) */ - if (S->is_unbuffered && H->running_stmt) { + if (H->running_stmt && H->running_stmt->is_unbuffered) { pgsql_stmt_finish(H->running_stmt, FIN_CLOSE); - H->running_stmt = NULL; } /* ensure that we free any previous unfetched results */ pgsql_stmt_finish(S, 0); @@ -702,12 +702,29 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, zval *result, enum pd return 1; } -static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, PGconn *conn) +static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, pdo_pgsql_db_handle *H) { + PGconn *conn = H->server; char *table_name = NULL; PGresult *tmp_res; char *querystr = NULL; + if (oid == H->cached_table_oid) { + return H->cached_table_name; + } + + if (H->running_stmt && H->running_stmt->is_unbuffered) { + /* in single-row mode, libpq forbids passing a new query + * while we're still flushing the current one's result */ + return NULL; + } + + if (H->cached_table_name) { + efree(H->cached_table_name); + H->cached_table_name = NULL; + H->cached_table_oid = InvalidOid; + } + spprintf(&querystr, 0, "SELECT RELNAME FROM PG_CLASS WHERE OID=%d", oid); if ((tmp_res = PQexec(conn, querystr)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) { @@ -724,6 +741,8 @@ static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, PGcon return 0; } + H->cached_table_oid = oid; + H->cached_table_name = estrdup(table_name); table_name = estrdup(table_name); PQclear(tmp_res); @@ -752,10 +771,9 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r table_oid = PQftable(S->result, colno); add_assoc_long(return_value, "pgsql:table_oid", table_oid); - table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H->server); + table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H); if (table_name) { - add_assoc_string(return_value, "table", table_name); - efree(table_name); + add_assoc_string(return_value, "table", S->H->cached_table_name); } switch (S->cols[colno].pgsql_type) { @@ -794,6 +812,10 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r break; default: /* Fetch metadata from Postgres system catalogue */ + if (S->H->running_stmt && S->H->running_stmt->is_unbuffered) { + /* libpq forbids calling a query while we're still reading the preceding one's */ + break; + } spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type); res = PQexec(S->H->server, q); efree(q); diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 881b4e7046504..a6718b86a49ca 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -43,6 +43,8 @@ typedef struct { unsigned _reserved:31; pdo_pgsql_error_info einfo; Oid pgoid; + Oid cached_table_oid; + char *cached_table_name; unsigned int stmt_counter; bool emulate_prepares; bool disable_prepares; @@ -90,6 +92,12 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const extern const struct pdo_stmt_methods pgsql_stmt_methods; +#define FIN_DISCARD 0x1 +#define FIN_CLOSE 0x2 +#define FIN_ABORT 0x4 + +extern void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode); + #define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE) enum { diff --git a/ext/pdo_pgsql/tests/gh15287.phpt b/ext/pdo_pgsql/tests/gh15287.phpt index 821c22a8f1c5a..44cf9fea1d402 100644 --- a/ext/pdo_pgsql/tests/gh15287.phpt +++ b/ext/pdo_pgsql/tests/gh15287.phpt @@ -132,6 +132,17 @@ $res = []; while (($re = $stmt->fetch())) $res[] = $re; display($res); $stmt->execute([ 0 ]); $res = []; for ($i = -1; ++$i < 2;) $res[] = $stmt->fetch(); display($res); display($pdo->query("select * from t2")->fetchAll()); + +// Metadata calls the server for some operations (notably table oid-to-name conversion). +// This will break libpq (that forbids a second PQexec before we consumed the first one). +// Instead of either letting libpq return an error, or blindly forbid this call, we expect +// being transparently provided at least attributes which do not require a server roundtrip. +// And good news: column name is one of those "local" attributes. +echo "=== meta ===\n"; +$stmt = $pdo->query("select * from t limit 2"); +echo "Starting with column " . $stmt->getColumnMeta(0)['name'] . ":\n"; +display($stmt->fetchAll()); + ?> --EXPECTF-- === non regression === @@ -181,3 +192,7 @@ multiple calls to the same prepared statement, some interrupted before having re 0 1 678 ok +=== meta === +Starting with column n: +0 original +1 non original From f566312b54df9dc74fb2ed9dfe5a1dcbcb102ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 29 Sep 2025 12:35:22 +0200 Subject: [PATCH 095/386] zend_API: Remove `ZVAL_IS_NULL()` (#19986) The `ZVAL_*()` macros are setters, the `Z_*()` macros are getters. --- UPGRADING.INTERNALS | 1 + Zend/zend_API.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index a248c0fd7c960..0c9aeb0d32f2c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -17,6 +17,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES . ZSTR_INIT_LITERAL(), zend_string_starts_with_literal(), and zend_string_starts_with_literal_ci() now support strings containing NUL bytes. Passing non-literal char* is no longer supported. + . The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead. ======================== 2. Build system changes diff --git a/Zend/zend_API.h b/Zend/zend_API.h index fa8b52c734c16..f3a56eff95079 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1066,7 +1066,6 @@ static zend_always_inline bool zend_char_has_nul_byte(const char *s, size_t know #define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) #define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL))) -#define ZVAL_IS_NULL(z) (Z_TYPE_P(z) == IS_NULL) /* For compatibility */ #define ZEND_MINIT ZEND_MODULE_STARTUP_N From 5668b16ad26d0751648fc185f35329804d12b663 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 29 Sep 2025 14:43:51 +0100 Subject: [PATCH 096/386] Revert "Pdo\Pgsql: Fix getColumnMeta() for GH-15287 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0)" This reverts commit 898235127b362d7103fdae8142c05908b7191f60. --- NEWS | 4 --- ext/pdo_pgsql/pgsql_driver.c | 58 +++++++------------------------ ext/pdo_pgsql/pgsql_statement.c | 50 ++++++++------------------ ext/pdo_pgsql/php_pdo_pgsql_int.h | 8 ----- ext/pdo_pgsql/tests/gh15287.phpt | 15 -------- 5 files changed, 26 insertions(+), 109 deletions(-) diff --git a/NEWS b/NEWS index 7e9010e96cef8..2213ff10b1db7 100644 --- a/NEWS +++ b/NEWS @@ -7,8 +7,4 @@ PHP NEWS with a given skeleton, locale, collapse type and identity fallback. (BogdanUngureanu) -- PDO_PGSQL: - . Fixed Pdo\Pgsql::getColumnMeta() when Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0). - (outtersg) - <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index c8aea7f0594e2..be865c1f86838 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -36,7 +36,6 @@ #include "pgsql_driver_arginfo.h" static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh); -void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode); static char * _pdo_pgsql_trim_message(const char *message, int persistent) { @@ -110,37 +109,6 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char * } /* }}} */ -static zend_always_inline void pgsql_finish_running_stmt(pdo_pgsql_db_handle *H) -{ - if (H->running_stmt) { - pgsql_stmt_finish(H->running_stmt, 0); - } -} - -static zend_always_inline void pgsql_discard_running_stmt(pdo_pgsql_db_handle *H) -{ - if (H->running_stmt) { - pgsql_stmt_finish(H->running_stmt, FIN_DISCARD); - } - - PGresult *pgsql_result; - bool first = true; - while ((pgsql_result = PQgetResult(H->server))) { - /* We should not arrive here, where libpq has a result to deliver without us - * having registered a running statement: - * every result discarding should go through the unified pgsql_stmt_finish, - * but maybe there still is an internal query that we omitted to adapt. - * So instead of asserting let's just emit an informational notice, - * and consume anyway (results consumption is handle-wise, so we have no formal - * need for the statement). */ - if (first) { - php_error_docref(NULL, E_NOTICE, "Internal error: unable to link a libpq result to consume, to its origin statement"); - first = false; - } - PQclear(pgsql_result); - } -} - static void _pdo_pgsql_notice(void *context, const char *message) /* {{{ */ { pdo_dbh_t * dbh = (pdo_dbh_t *)context; @@ -290,10 +258,6 @@ static void pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */ PQfinish(H->server); H->server = NULL; } - if (H->cached_table_name) { - efree(H->cached_table_name); - H->cached_table_name = NULL; - } if (H->einfo.errmsg) { pefree(H->einfo.errmsg, dbh->is_persistent); H->einfo.errmsg = NULL; @@ -387,7 +351,6 @@ static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) bool in_trans = pgsql_handle_in_transaction(dbh); - pgsql_finish_running_stmt(H); if (!(res = PQexec(H->server, ZSTR_VAL(sql)))) { /* fatal error */ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); @@ -463,7 +426,6 @@ static zend_string *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const zend_string * PGresult *res; ExecStatusType status; - pgsql_finish_running_stmt(H); if (name == NULL) { res = PQexec(H->server, "SELECT LASTVAL()"); } else { @@ -627,7 +589,6 @@ static bool pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh) PGresult *res; bool ret = true; - pgsql_finish_running_stmt(H); res = PQexec(H->server, cmd); if (PQresultStatus(res) != PGRES_COMMAND_OK) { @@ -735,8 +696,9 @@ void pgsqlCopyFromArray_internal(INTERNAL_FUNCTION_PARAMETERS) /* Obtain db Handle */ H = (pdo_pgsql_db_handle *)dbh->driver_data; - pgsql_discard_running_stmt(H); - + while ((pgsql_result = PQgetResult(H->server))) { + PQclear(pgsql_result); + } pgsql_result = PQexec(H->server, query); efree(query); @@ -858,8 +820,9 @@ void pgsqlCopyFromFile_internal(INTERNAL_FUNCTION_PARAMETERS) H = (pdo_pgsql_db_handle *)dbh->driver_data; - pgsql_discard_running_stmt(H); - + while ((pgsql_result = PQgetResult(H->server))) { + PQclear(pgsql_result); + } pgsql_result = PQexec(H->server, query); efree(query); @@ -953,7 +916,9 @@ void pgsqlCopyToFile_internal(INTERNAL_FUNCTION_PARAMETERS) RETURN_FALSE; } - pgsql_discard_running_stmt(H); + while ((pgsql_result = PQgetResult(H->server))) { + PQclear(pgsql_result); + } /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { @@ -1042,7 +1007,9 @@ void pgsqlCopyToArray_internal(INTERNAL_FUNCTION_PARAMETERS) H = (pdo_pgsql_db_handle *)dbh->driver_data; - pgsql_discard_running_stmt(H); + while ((pgsql_result = PQgetResult(H->server))) { + PQclear(pgsql_result); + } /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { @@ -1494,7 +1461,6 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ H->attached = 1; H->pgoid = -1; - H->cached_table_oid = InvalidOid; dbh->methods = &pgsql_methods; dbh->alloc_own_columns = 1; diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 4335e374c5ab2..426a878d8eff7 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -56,14 +56,14 @@ #define FLOAT8LABEL "float8" #define FLOAT8OID 701 +#define FIN_DISCARD 0x1 +#define FIN_CLOSE 0x2 +#define FIN_ABORT 0x4 -void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) -{ - if (!S) { - return; - } +static void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) +{ pdo_pgsql_db_handle *H = S->H; if (S->is_running_unbuffered && S->result && (fin_mode & FIN_ABORT)) { @@ -113,10 +113,9 @@ void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode) } S->is_prepared = false; - } - - if (H->running_stmt == S && (fin_mode & (FIN_CLOSE|FIN_ABORT))) { - H->running_stmt = NULL; + if (H->running_stmt == S) { + H->running_stmt = NULL; + } } } @@ -189,8 +188,9 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt) * and returns a PGRES_FATAL_ERROR when PQgetResult gets called for stmt 2 if DEALLOCATE * was called for stmt 1 inbetween * (maybe it will change with pipeline mode in libpq 14?) */ - if (H->running_stmt && H->running_stmt->is_unbuffered) { + if (S->is_unbuffered && H->running_stmt) { pgsql_stmt_finish(H->running_stmt, FIN_CLOSE); + H->running_stmt = NULL; } /* ensure that we free any previous unfetched results */ pgsql_stmt_finish(S, 0); @@ -702,29 +702,12 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, zval *result, enum pd return 1; } -static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, pdo_pgsql_db_handle *H) +static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, PGconn *conn) { - PGconn *conn = H->server; char *table_name = NULL; PGresult *tmp_res; char *querystr = NULL; - if (oid == H->cached_table_oid) { - return H->cached_table_name; - } - - if (H->running_stmt && H->running_stmt->is_unbuffered) { - /* in single-row mode, libpq forbids passing a new query - * while we're still flushing the current one's result */ - return NULL; - } - - if (H->cached_table_name) { - efree(H->cached_table_name); - H->cached_table_name = NULL; - H->cached_table_oid = InvalidOid; - } - spprintf(&querystr, 0, "SELECT RELNAME FROM PG_CLASS WHERE OID=%d", oid); if ((tmp_res = PQexec(conn, querystr)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) { @@ -741,8 +724,6 @@ static zend_always_inline char * pdo_pgsql_translate_oid_to_table(Oid oid, pdo_p return 0; } - H->cached_table_oid = oid; - H->cached_table_name = estrdup(table_name); table_name = estrdup(table_name); PQclear(tmp_res); @@ -771,9 +752,10 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r table_oid = PQftable(S->result, colno); add_assoc_long(return_value, "pgsql:table_oid", table_oid); - table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H); + table_name = pdo_pgsql_translate_oid_to_table(table_oid, S->H->server); if (table_name) { - add_assoc_string(return_value, "table", S->H->cached_table_name); + add_assoc_string(return_value, "table", table_name); + efree(table_name); } switch (S->cols[colno].pgsql_type) { @@ -812,10 +794,6 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r break; default: /* Fetch metadata from Postgres system catalogue */ - if (S->H->running_stmt && S->H->running_stmt->is_unbuffered) { - /* libpq forbids calling a query while we're still reading the preceding one's */ - break; - } spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type); res = PQexec(S->H->server, q); efree(q); diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index a6718b86a49ca..881b4e7046504 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -43,8 +43,6 @@ typedef struct { unsigned _reserved:31; pdo_pgsql_error_info einfo; Oid pgoid; - Oid cached_table_oid; - char *cached_table_name; unsigned int stmt_counter; bool emulate_prepares; bool disable_prepares; @@ -92,12 +90,6 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const extern const struct pdo_stmt_methods pgsql_stmt_methods; -#define FIN_DISCARD 0x1 -#define FIN_CLOSE 0x2 -#define FIN_ABORT 0x4 - -extern void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode); - #define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE) enum { diff --git a/ext/pdo_pgsql/tests/gh15287.phpt b/ext/pdo_pgsql/tests/gh15287.phpt index 44cf9fea1d402..821c22a8f1c5a 100644 --- a/ext/pdo_pgsql/tests/gh15287.phpt +++ b/ext/pdo_pgsql/tests/gh15287.phpt @@ -132,17 +132,6 @@ $res = []; while (($re = $stmt->fetch())) $res[] = $re; display($res); $stmt->execute([ 0 ]); $res = []; for ($i = -1; ++$i < 2;) $res[] = $stmt->fetch(); display($res); display($pdo->query("select * from t2")->fetchAll()); - -// Metadata calls the server for some operations (notably table oid-to-name conversion). -// This will break libpq (that forbids a second PQexec before we consumed the first one). -// Instead of either letting libpq return an error, or blindly forbid this call, we expect -// being transparently provided at least attributes which do not require a server roundtrip. -// And good news: column name is one of those "local" attributes. -echo "=== meta ===\n"; -$stmt = $pdo->query("select * from t limit 2"); -echo "Starting with column " . $stmt->getColumnMeta(0)['name'] . ":\n"; -display($stmt->fetchAll()); - ?> --EXPECTF-- === non regression === @@ -192,7 +181,3 @@ multiple calls to the same prepared statement, some interrupted before having re 0 1 678 ok -=== meta === -Starting with column n: -0 original -1 non original From 584ae5eec2649391b8c3181e79b9d15c25076caa Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 25 Sep 2025 11:57:35 +0100 Subject: [PATCH 097/386] Zend/zend_execute_API.c: add const qualifiers --- Zend/zend_execute.h | 8 +++---- Zend/zend_execute_API.c | 46 ++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index c08adf2a41b90..920c702785ca4 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -48,11 +48,11 @@ ZEND_API void zend_init_code_execute_data(zend_execute_data *execute_data, zend_ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value); ZEND_API void execute_ex(zend_execute_data *execute_data); ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value); -ZEND_API bool zend_is_valid_class_name(zend_string *name); +ZEND_API bool zend_is_valid_class_name(const zend_string *name); ZEND_API zend_class_entry *zend_lookup_class(zend_string *name); ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *lcname, uint32_t flags); -ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex); -ZEND_API zend_object *zend_get_this_object(zend_execute_data *ex); +ZEND_API zend_class_entry *zend_get_called_scope(const zend_execute_data *ex); +ZEND_API zend_object *zend_get_this_object(const zend_execute_data *ex); ZEND_API zend_result zend_eval_string(const char *str, zval *retval_ptr, const char *string_name); ZEND_API zend_result zend_eval_stringl(const char *str, size_t str_len, zval *retval_ptr, const char *string_name); ZEND_API zend_result zend_eval_string_ex(const char *str, zval *retval_ptr, const char *string_name, bool handle_exceptions); @@ -453,7 +453,7 @@ ZEND_API const char *get_active_class_name(const char **space); ZEND_API const char *get_active_function_name(void); ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); -ZEND_API zend_function *zend_active_function_ex(zend_execute_data *execute_data); +ZEND_API zend_function *zend_active_function_ex(const zend_execute_data *execute_data); static zend_always_inline zend_function *zend_active_function(void) { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 35154e8afdc3c..5809e5ad7a5f8 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -88,7 +88,7 @@ static void zend_handle_sigsegv(void) /* {{{ */ /* }}} */ #endif -static void zend_extension_activator(zend_extension *extension) /* {{{ */ +static void zend_extension_activator(const zend_extension *extension) /* {{{ */ { if (extension->activate) { extension->activate(); @@ -96,7 +96,7 @@ static void zend_extension_activator(zend_extension *extension) /* {{{ */ } /* }}} */ -static void zend_extension_deactivator(zend_extension *extension) /* {{{ */ +static void zend_extension_deactivator(const zend_extension *extension) /* {{{ */ { if (extension->deactivate) { extension->deactivate(); @@ -113,14 +113,14 @@ static int clean_non_persistent_constant_full(zval *zv) /* {{{ */ static int clean_non_persistent_function_full(zval *zv) /* {{{ */ { - zend_function *function = Z_PTR_P(zv); + const zend_function *function = Z_PTR_P(zv); return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; } /* }}} */ static int clean_non_persistent_class_full(zval *zv) /* {{{ */ { - zend_class_entry *ce = Z_PTR_P(zv); + const zend_class_entry *ce = Z_PTR_P(zv); return (ce->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; } /* }}} */ @@ -536,7 +536,7 @@ void shutdown_executor(void) /* {{{ */ /* return class name and "::" or "". */ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ { - zend_function *func; + const zend_function *func; if (!zend_is_executing()) { if (space) { @@ -551,7 +551,7 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ case ZEND_USER_FUNCTION: case ZEND_INTERNAL_FUNCTION: { - zend_class_entry *ce = func->common.scope; + const zend_class_entry *ce = func->common.scope; if (space) { *space = ce ? "::" : ""; @@ -569,7 +569,7 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ ZEND_API const char *get_active_function_name(void) /* {{{ */ { - zend_function *func; + const zend_function *func; if (!zend_is_executing()) { return NULL; @@ -579,7 +579,7 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */ switch (func->type) { case ZEND_USER_FUNCTION: { - zend_string *function_name = func->common.function_name; + const zend_string *function_name = func->common.function_name; if (function_name) { return ZSTR_VAL(function_name); @@ -597,7 +597,7 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */ } /* }}} */ -ZEND_API zend_function *zend_active_function_ex(zend_execute_data *execute_data) +ZEND_API zend_function *zend_active_function_ex(const zend_execute_data *execute_data) { zend_function *func = EX(func); @@ -636,7 +636,7 @@ ZEND_API const char *get_active_function_arg_name(uint32_t arg_num) /* {{{ */ return NULL; } - zend_function *func = zend_active_function(); + const zend_function *func = zend_active_function(); return get_function_arg_name(func, arg_num); } @@ -658,7 +658,7 @@ ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t a ZEND_API const char *zend_get_executed_filename(void) /* {{{ */ { - zend_string *filename = zend_get_executed_filename_ex(); + const zend_string *filename = zend_get_executed_filename_ex(); return filename != NULL ? ZSTR_VAL(filename) : "[no active file]"; } /* }}} */ @@ -670,7 +670,7 @@ ZEND_API zend_string *zend_get_executed_filename_ex(void) /* {{{ */ return filename_override; } - zend_execute_data *ex = EG(current_execute_data); + const zend_execute_data *ex = EG(current_execute_data); while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { ex = ex->prev_execute_data; @@ -690,7 +690,7 @@ ZEND_API uint32_t zend_get_executed_lineno(void) /* {{{ */ return lineno_override; } - zend_execute_data *ex = EG(current_execute_data); + const zend_execute_data *ex = EG(current_execute_data); while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { ex = ex->prev_execute_data; @@ -739,7 +739,7 @@ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_with_ctx(zval *p, zend_c if (ast->kind == ZEND_AST_CONSTANT) { zend_string *name = zend_ast_get_constant_name(ast); - zval *zv = zend_get_constant_ex(name, scope, ast->attr); + const zval *zv = zend_get_constant_ex(name, scope, ast->attr); if (UNEXPECTED(zv == NULL)) { return FAILURE; } @@ -1158,7 +1158,7 @@ static const uint32_t valid_chars[8] = { 0xffffffff, }; -ZEND_API bool zend_is_valid_class_name(zend_string *name) { +ZEND_API bool zend_is_valid_class_name(const zend_string *name) { for (size_t i = 0; i < ZSTR_LEN(name); i++) { unsigned char c = ZSTR_VAL(name)[i]; if (!ZEND_BIT_TEST(valid_chars, c)) { @@ -1298,7 +1298,7 @@ ZEND_API zend_class_entry *zend_lookup_class(zend_string *name) /* {{{ */ } /* }}} */ -ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex) /* {{{ */ +ZEND_API zend_class_entry *zend_get_called_scope(const zend_execute_data *ex) /* {{{ */ { while (ex) { if (Z_TYPE(ex->This) == IS_OBJECT) { @@ -1316,7 +1316,7 @@ ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex) /* {{{ * } /* }}} */ -ZEND_API zend_object *zend_get_this_object(zend_execute_data *ex) /* {{{ */ +ZEND_API zend_object *zend_get_this_object(const zend_execute_data *ex) /* {{{ */ { while (ex) { if (Z_TYPE(ex->This) == IS_OBJECT) { @@ -1689,7 +1689,7 @@ void zend_unset_timeout(void) /* {{{ */ } /* }}} */ -static ZEND_COLD void report_class_fetch_error(zend_string *class_name, uint32_t fetch_type) +static ZEND_COLD void report_class_fetch_error(const zend_string *class_name, uint32_t fetch_type) { if (fetch_type & ZEND_FETCH_CLASS_SILENT) { return; @@ -1858,7 +1858,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(void) /* {{{ */ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data) /* {{{ */ { - zend_op_array *op_array = &execute_data->func->op_array; + const zend_op_array *op_array = &execute_data->func->op_array; HashTable *ht = execute_data->symbol_table; /* copy real values from symbol table into CV slots and create @@ -1873,7 +1873,7 @@ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data) /* {{{ * if (zv) { if (Z_TYPE_P(zv) == IS_INDIRECT) { - zval *val = Z_INDIRECT_P(zv); + const zval *val = Z_INDIRECT_P(zv); ZVAL_COPY_VALUE(var, val); } else { @@ -1893,7 +1893,7 @@ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data) /* {{{ * ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data) /* {{{ */ { - zend_op_array *op_array = &execute_data->func->op_array; + const zend_op_array *op_array = &execute_data->func->op_array; HashTable *ht = execute_data->symbol_table; /* copy real values from CV slots into symbol table */ @@ -1927,7 +1927,7 @@ ZEND_API zend_result zend_set_local_var(zend_string *name, zval *value, bool for if (execute_data) { if (!(EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE)) { zend_ulong h = zend_string_hash_val(name); - zend_op_array *op_array = &execute_data->func->op_array; + const zend_op_array *op_array = &execute_data->func->op_array; if (EXPECTED(op_array->last_var)) { zend_string **str = op_array->vars; @@ -1970,7 +1970,7 @@ ZEND_API zend_result zend_set_local_var_str(const char *name, size_t len, zval * if (execute_data) { if (!(EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE)) { zend_ulong h = zend_hash_func(name, len); - zend_op_array *op_array = &execute_data->func->op_array; + const zend_op_array *op_array = &execute_data->func->op_array; if (EXPECTED(op_array->last_var)) { zend_string **str = op_array->vars; zend_string **end = str + op_array->last_var; From 2f6afda40b0f95b38af152f1b339ab02cd07edcd Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 25 Sep 2025 11:57:49 +0100 Subject: [PATCH 098/386] Zend/zend_execute_API.c: reduce variable scope --- Zend/zend_execute_API.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 5809e5ad7a5f8..b51f1546d668d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -270,9 +270,6 @@ void shutdown_destructors(void) /* {{{ */ /* Free values held by the executor. */ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) { - zend_string *key; - zval *zv; - EG(flags) |= EG_FLAGS_IN_RESOURCE_SHUTDOWN; zend_try { zend_close_rsrc_list(&EG(regular_list)); @@ -282,12 +279,15 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) EG(active) = 0; if (!fast_shutdown) { + zval *zv; + zend_hash_graceful_reverse_destroy(&EG(symbol_table)); /* Constants may contain objects, destroy them before the object store. */ if (EG(full_tables_cleanup)) { zend_hash_reverse_apply(EG(zend_constants), clean_non_persistent_constant_full); } else { + zend_string *key; ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL(EG(zend_constants), key, zv) { zend_constant *c = Z_PTR_P(zv); if (_idx == EG(persistent_constants_count)) { @@ -434,8 +434,6 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) void shutdown_executor(void) /* {{{ */ { - zend_string *key; - zval *zv; #if ZEND_DEBUG bool fast_shutdown = 0; #elif defined(__SANITIZE_ADDRESS__) @@ -477,6 +475,8 @@ void shutdown_executor(void) /* {{{ */ zend_hash_reverse_apply(EG(function_table), clean_non_persistent_function_full); zend_hash_reverse_apply(EG(class_table), clean_non_persistent_class_full); } else { + zend_string *key; + zval *zv; ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL(EG(function_table), key, zv) { zend_function *func = Z_PTR_P(zv); if (_idx == EG(persistent_functions_count)) { @@ -808,7 +808,6 @@ zend_result _call_user_function_impl(zval *object, zval *function_name, zval *re zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /* {{{ */ { - uint32_t i; zend_execute_data *call; zend_fcall_info_cache fci_cache_local; zend_function *func; @@ -871,7 +870,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ } } - for (i=0; iparam_count; i++) { + for (uint32_t i = 0; i < fci->param_count; i++) { zval *param = ZEND_CALL_ARG(call, i+1); zval *arg = &fci->params[i]; bool must_wrap = false; From ec314379734ba78842b1dd4d386dd2def707c0fd Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 25 Sep 2025 12:06:12 +0100 Subject: [PATCH 099/386] Zend/zend_execute_API.c: use uint32_t type instead of int --- Zend/zend_execute_API.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index b51f1546d668d..1fd0913076534 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -229,7 +229,7 @@ static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */ } /* }}} */ -static ZEND_COLD void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */ +static ZEND_COLD void zend_throw_or_error(uint32_t fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */ { va_list va; char *message = NULL; From 6b470cf5d8383fdaf1ce71078a6dcfb769840eae Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:51:29 +0100 Subject: [PATCH 100/386] Zend: Convert _zend_oparray_context.var_size field to uint32_t --- Zend/zend_compile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index c815248f78071..df95cdbbfb434 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -197,7 +197,7 @@ typedef struct _zend_oparray_context { struct _zend_oparray_context *prev; zend_op_array *op_array; uint32_t opcodes_size; - int vars_size; + uint32_t vars_size; int literals_size; uint32_t fast_call_var; uint32_t try_catch_offset; From 299bd63177881defd75f4eee0f3214a56f95b9e1 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:51:56 +0100 Subject: [PATCH 101/386] Zend: Change return type of lookup_cv from int to uint32_t --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d0ce85dd3c6fb..a36a4fcc9f868 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -536,7 +536,7 @@ static zend_always_inline uint32_t get_temporary_variable(void) /* {{{ */ } /* }}} */ -static int lookup_cv(zend_string *name) /* {{{ */{ +static uint32_t lookup_cv(zend_string *name) /* {{{ */{ zend_op_array *op_array = CG(active_op_array); int i = 0; zend_ulong hash_value = zend_string_hash_val(name); From 18ce83b2e3d540f4eeca7446b0cd04c1a58c282a Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:53:13 +0100 Subject: [PATCH 102/386] Zend: Convert _zend_op_array.cache_size field to uint32_t --- Zend/zend_compile.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index df95cdbbfb434..7ca992104fe07 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -530,9 +530,9 @@ struct _zend_op_array { const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ /* END of common elements */ - int cache_size; /* number of run_time_cache_slots * sizeof(void*) */ - int last_var; /* number of CV variables */ - uint32_t last; /* number of opcodes */ + uint32_t cache_size; /* number of run_time_cache_slots * sizeof(void*) */ + int last_var; /* number of CV variables */ + uint32_t last; /* number of opcodes */ zend_op *opcodes; ZEND_MAP_PTR_DEF(HashTable *, static_variables_ptr); From a94dc485679afc6e29b0dc2827a814b896c35cdc Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:12:25 +0100 Subject: [PATCH 103/386] Zend: Convert _zend_op_array.last_live_range field to uint32_t --- Zend/Optimizer/zend_dump.c | 4 ++-- Zend/zend_compile.h | 2 +- ext/opcache/jit/zend_jit.c | 3 +-- ext/opcache/jit/zend_jit_trace.c | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Zend/Optimizer/zend_dump.c b/Zend/Optimizer/zend_dump.c index 4b7ca1615a862..8642d4488c241 100644 --- a/Zend/Optimizer/zend_dump.c +++ b/Zend/Optimizer/zend_dump.c @@ -1056,7 +1056,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl } if (op_array->last_live_range && (dump_flags & ZEND_DUMP_LIVE_RANGES)) { fprintf(stderr, "LIVE RANGES:\n"); - for (int i = 0; i < op_array->last_live_range; i++) { + for (uint32_t i = 0; i < op_array->last_live_range; i++) { fprintf(stderr, " %u: %04u - %04u ", EX_VAR_TO_NUM(op_array->live_range[i].var & ~ZEND_LIVE_MASK), @@ -1116,7 +1116,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl } if (op_array->last_live_range && (dump_flags & ZEND_DUMP_LIVE_RANGES)) { fprintf(stderr, "LIVE RANGES:\n"); - for (int i = 0; i < op_array->last_live_range; i++) { + for (uint32_t i = 0; i < op_array->last_live_range; i++) { fprintf(stderr, " %u: %04u - %04u ", EX_VAR_TO_NUM(op_array->live_range[i].var & ~ZEND_LIVE_MASK), diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 7ca992104fe07..a58004638a653 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -541,7 +541,7 @@ struct _zend_op_array { uint32_t *refcount; - int last_live_range; + uint32_t last_live_range; int last_try_catch; zend_live_range *live_range; zend_try_catch_element *try_catch_array; diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 7e5eb6abbbc95..feede18999b91 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -1268,13 +1268,12 @@ static void zend_jit_allocate_registers(zend_jit_ctx *ctx, const zend_op_array * && ssa->vars[i].definition >= 0 && ssa->ops[op_num].result_def == i) { const zend_live_range *range = op_array->live_range; - int j; op_num++; if (op_array->opcodes[op_num].opcode == ZEND_OP_DATA) { op_num++; } - for (j = 0; j < op_array->last_live_range; range++, j++) { + for (uint32_t j = 0; j < op_array->last_live_range; range++, j++) { if (range->start > op_num) { /* further blocks will not be relevant... */ break; diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 5e10237d62f18..9dc6ea1c3b003 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -6583,10 +6583,9 @@ static zend_vm_opcode_handler_t zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t var_num = opline->result.var; uint32_t op_num = opline - op_array->opcodes; const zend_live_range *range = op_array->live_range; - int j; op_num += zend_jit_trace_op_len(opline); - for (j = 0; j < op_array->last_live_range; range++, j++) { + for (uint32_t j = 0; j < op_array->last_live_range; range++, j++) { if (range->start > op_num) { /* further blocks will not be relevant... */ break; From 0a47dd9bb4f33e0d579a7444670d6ba19e3d8f43 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:23:49 +0100 Subject: [PATCH 104/386] Zend: Convert _zend_op_array.last_try_catch field to uint32_t --- Zend/Optimizer/block_pass.c | 4 ++-- Zend/Optimizer/dfa_pass.c | 2 +- Zend/Optimizer/nop_removal.c | 3 +-- Zend/Optimizer/zend_cfg.c | 5 ++--- Zend/Optimizer/zend_dump.c | 4 ++-- Zend/zend_compile.c | 4 ++-- Zend/zend_compile.h | 2 +- Zend/zend_generators.c | 3 +-- Zend/zend_opcode.c | 4 +--- Zend/zend_vm_def.h | 6 +++--- Zend/zend_vm_execute.h | 12 ++++++------ sapi/phpdbg/phpdbg_utils.c | 4 ++-- 12 files changed, 24 insertions(+), 29 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index f038c9e8a984a..9ca8b60f6c457 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -1125,7 +1125,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op /* adjust exception jump targets & remove unused try_catch_array entries */ if (op_array->last_try_catch) { - int i, j; + uint32_t i, j; uint32_t *map; ALLOCA_FLAG(use_heap); @@ -1165,7 +1165,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op while (opline < end) { if (opline->opcode == ZEND_FAST_RET && opline->op2.num != (uint32_t)-1 && - opline->op2.num < (uint32_t)j) { + opline->op2.num < j) { opline->op2.num = map[opline->op2.num]; } opline++; diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c index b64f6d8fa817c..796e998493d76 100644 --- a/Zend/Optimizer/dfa_pass.c +++ b/Zend/Optimizer/dfa_pass.c @@ -226,7 +226,7 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa, zend_op } /* update try/catch array */ - for (j = 0; j < op_array->last_try_catch; j++) { + for (uint32_t j = 0; j < op_array->last_try_catch; j++) { op_array->try_catch_array[j].try_op -= shiftlist[op_array->try_catch_array[j].try_op]; op_array->try_catch_array[j].catch_op -= shiftlist[op_array->try_catch_array[j].catch_op]; if (op_array->try_catch_array[j].finally_op) { diff --git a/Zend/Optimizer/nop_removal.c b/Zend/Optimizer/nop_removal.c index fd5a87cbfb287..c39c4bb1e4ff7 100644 --- a/Zend/Optimizer/nop_removal.c +++ b/Zend/Optimizer/nop_removal.c @@ -34,7 +34,6 @@ void zend_optimizer_nop_removal(zend_op_array *op_array, zend_optimizer_ctx *ctx { zend_op *end, *opline; uint32_t new_count, i, shift; - int j; uint32_t *shiftlist; ALLOCA_FLAG(use_heap); @@ -81,7 +80,7 @@ void zend_optimizer_nop_removal(zend_op_array *op_array, zend_optimizer_ctx *ctx } /* update try/catch array */ - for (j = 0; j < op_array->last_try_catch; j++) { + for (uint32_t j = 0; j < op_array->last_try_catch; j++) { op_array->try_catch_array[j].try_op -= shiftlist[op_array->try_catch_array[j].try_op]; op_array->try_catch_array[j].catch_op -= shiftlist[op_array->try_catch_array[j].catch_op]; if (op_array->try_catch_array[j].finally_op) { diff --git a/Zend/Optimizer/zend_cfg.c b/Zend/Optimizer/zend_cfg.c index d2c54c9131962..32d5f49ef7df4 100644 --- a/Zend/Optimizer/zend_cfg.c +++ b/Zend/Optimizer/zend_cfg.c @@ -274,7 +274,6 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, { uint32_t flags = 0; uint32_t i; - int j; uint32_t *block_map; zend_function *fn; int blocks_count = 0; @@ -449,7 +448,7 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, } if (op_array->last_try_catch) { - for (j = 0; j < op_array->last_try_catch; j++) { + for (uint32_t j = 0; j < op_array->last_try_catch; j++) { BB_START(op_array->try_catch_array[j].try_op); if (op_array->try_catch_array[j].catch_op) { BB_START(op_array->try_catch_array[j].catch_op); @@ -494,7 +493,7 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, blocks_count++; /* Build CFG, Step 3: Calculate successors */ - for (j = 0; j < blocks_count; j++) { + for (int j = 0; j < blocks_count; j++) { zend_basic_block *block = &blocks[j]; zend_op *opline; if (block->len == 0) { diff --git a/Zend/Optimizer/zend_dump.c b/Zend/Optimizer/zend_dump.c index 8642d4488c241..9c51ad223e060 100644 --- a/Zend/Optimizer/zend_dump.c +++ b/Zend/Optimizer/zend_dump.c @@ -1083,7 +1083,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl } if (op_array->last_try_catch) { fprintf(stderr, "EXCEPTION TABLE:\n"); - for (int i = 0; i < op_array->last_try_catch; i++) { + for (uint32_t i = 0; i < op_array->last_try_catch; i++) { fprintf(stderr, " BB%u", cfg->map[op_array->try_catch_array[i].try_op]); if (op_array->try_catch_array[i].catch_op) { @@ -1143,7 +1143,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl } if (op_array->last_try_catch) { fprintf(stderr, "EXCEPTION TABLE:\n"); - for (int i = 0; i < op_array->last_try_catch; i++) { + for (uint32_t i = 0; i < op_array->last_try_catch; i++) { fprintf(stderr, " %04u", op_array->try_catch_array[i].try_op); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a36a4fcc9f868..cff9f62e87ca8 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5886,7 +5886,7 @@ static void zend_compile_break_continue(zend_ast *ast) /* {{{ */ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ { zend_label *dest; - int current, remove_oplines = opline->op1.num; + int remove_oplines = opline->op1.num; zval *label; uint32_t opnum = opline - op_array->opcodes; @@ -5903,7 +5903,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ zval_ptr_dtor_str(label); ZVAL_NULL(label); - current = opline->extended_value; + uint32_t current = opline->extended_value; for (; current != dest->brk_cont; current = CG(context).brk_cont_array[current].parent) { if (current == -1) { CG(in_compilation) = 1; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index a58004638a653..ce660d026aaab 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -542,7 +542,7 @@ struct _zend_op_array { uint32_t *refcount; uint32_t last_live_range; - int last_try_catch; + uint32_t last_try_catch; zend_live_range *live_range; zend_try_catch_element *try_catch_array; diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index d5c9b1b1e313d..13f1887027c8e 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -244,7 +244,6 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ zend_generator *current_generator = zend_generator_get_current(generator); zend_execute_data *ex = generator->execute_data; uint32_t op_num, try_catch_offset; - int i; /* If current_generator is running in a fiber, there are 2 cases to consider: * - If generator is also marked with ZEND_GENERATOR_IN_FIBER, then the @@ -289,7 +288,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ try_catch_offset = -1; /* Find the innermost try/catch that we are inside of. */ - for (i = 0; i < ex->func->op_array.last_try_catch; i++) { + for (uint32_t i = 0; i < ex->func->op_array.last_try_catch; i++) { zend_try_catch_element *try_catch = &ex->func->op_array.try_catch_array[i]; if (op_num < try_catch->try_op) { break; diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 43c6efb9107a9..bf02d6a4164bd 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -686,9 +686,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num) { - int i; - - for (i = 0; i < op_array->last_try_catch; i++) { + for (uint32_t i = 0; i < op_array->last_try_catch; i++) { if ((op_num < op_array->try_catch_array[i].finally_op || op_num >= op_array->try_catch_array[i].finally_end) && (dst_num >= op_array->try_catch_array[i].finally_op && diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 3ebf816cf3817..b90117e70f226 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8164,7 +8164,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) } uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes; - int i, current_try_catch_offset = -1; + uint32_t current_try_catch_offset = -1; if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE) && throw_op->extended_value & ZEND_FREE_ON_RETURN) { @@ -8175,7 +8175,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) const zend_live_range *range = find_live_range( &EX(func)->op_array, throw_op_num, throw_op->op1.var); /* free op1 of the corresponding RETURN */ - for (i = throw_op_num; i < range->end; i++) { + for (uint32_t i = throw_op_num; i < range->end; i++) { if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { /* pass */ @@ -8191,7 +8191,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) } /* Find the innermost try/catch/finally the exception was thrown in */ - for (i = 0; i < EX(func)->op_array.last_try_catch; i++) { + for (uint32_t i = 0; i < EX(func)->op_array.last_try_catch; i++) { zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i]; if (try_catch->try_op > throw_op_num) { /* further blocks will not be relevant... */ diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index b0d6f2bc33d96..9d940cfadbcb1 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3392,7 +3392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_HANDLE_EXCEPT } uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes; - int i, current_try_catch_offset = -1; + uint32_t current_try_catch_offset = -1; if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE) && throw_op->extended_value & ZEND_FREE_ON_RETURN) { @@ -3403,7 +3403,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_HANDLE_EXCEPT const zend_live_range *range = find_live_range( &EX(func)->op_array, throw_op_num, throw_op->op1.var); /* free op1 of the corresponding RETURN */ - for (i = throw_op_num; i < range->end; i++) { + for (uint32_t i = throw_op_num; i < range->end; i++) { if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { /* pass */ @@ -3419,7 +3419,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_HANDLE_EXCEPT } /* Find the innermost try/catch/finally the exception was thrown in */ - for (i = 0; i < EX(func)->op_array.last_try_catch; i++) { + for (uint32_t i = 0; i < EX(func)->op_array.last_try_catch; i++) { zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i]; if (try_catch->try_op > throw_op_num) { /* further blocks will not be relevant... */ @@ -58815,7 +58815,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_HANDLE_EXCEPTION_S } uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes; - int i, current_try_catch_offset = -1; + uint32_t current_try_catch_offset = -1; if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE) && throw_op->extended_value & ZEND_FREE_ON_RETURN) { @@ -58826,7 +58826,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_HANDLE_EXCEPTION_S const zend_live_range *range = find_live_range( &EX(func)->op_array, throw_op_num, throw_op->op1.var); /* free op1 of the corresponding RETURN */ - for (i = throw_op_num; i < range->end; i++) { + for (uint32_t i = throw_op_num; i < range->end; i++) { if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { /* pass */ @@ -58842,7 +58842,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_HANDLE_EXCEPTION_S } /* Find the innermost try/catch/finally the exception was thrown in */ - for (i = 0; i < EX(func)->op_array.last_try_catch; i++) { + for (uint32_t i = 0; i < EX(func)->op_array.last_try_catch; i++) { zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i]; if (try_catch->try_op > throw_op_num) { /* further blocks will not be relevant... */ diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index 329ee9a8830e3..55d97acc38759 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -612,7 +612,7 @@ int phpdbg_is_auto_global(char *name, int len) { PHPDBG_API bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zend_object *exception) { const zend_op *op; zend_op *cur; - uint32_t op_num, i; + uint32_t op_num; zend_op_array *op_array = &execute_data->func->op_array; if (execute_data->opline >= EG(exception_op) && execute_data->opline < EG(exception_op) + 3 && EG(opline_before_exception)) { @@ -623,7 +623,7 @@ PHPDBG_API bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zend_obj op_num = op - op_array->opcodes; - for (i = 0; i < op_array->last_try_catch && op_array->try_catch_array[i].try_op <= op_num; i++) { + for (uint32_t i = 0; i < op_array->last_try_catch && op_array->try_catch_array[i].try_op <= op_num; i++) { uint32_t catch = op_array->try_catch_array[i].catch_op, finally = op_array->try_catch_array[i].finally_op; if (op_num <= catch || op_num <= finally) { if (finally) { From c515c04b0acd51cb0e677cff2a5061d3e17abe14 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 14 Aug 2025 21:42:28 +0100 Subject: [PATCH 105/386] Zend: Convert _zend_op_array literal fields to uint32_t --- Zend/Optimizer/compact_literals.c | 13 +++++++------ Zend/Optimizer/zend_optimizer.c | 6 +++--- Zend/Optimizer/zend_optimizer_internal.h | 2 +- Zend/zend_compile.c | 2 +- Zend/zend_compile.h | 4 ++-- sapi/phpdbg/phpdbg_info.c | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c index d0aaccec7ce2c..a2fa32994feeb 100644 --- a/Zend/Optimizer/compact_literals.c +++ b/Zend/Optimizer/compact_literals.c @@ -110,7 +110,7 @@ static zend_string *create_str_cache_key(zval *literal, uint8_t num_related) void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx) { zend_op *opline, *end; - int i, j, n, *map; + int n, *map; uint32_t cache_size; zval zv, *pos; literal_info *info; @@ -124,6 +124,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx int *const_slot, *class_slot, *func_slot, *bind_var_slot, *property_slot, *method_slot, *jmp_slot; if (op_array->last_literal) { + uint32_t j; info = (literal_info*)zend_arena_calloc(&ctx->arena, op_array->last_literal, sizeof(literal_info)); /* Mark literals of specific types */ @@ -258,9 +259,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx op_array->function_name ? op_array->function_name->val : "main"); fprintf(stderr, "Literals table size %d\n", op_array->last_literal); - for (int i = 0; i < op_array->last_literal; i++) { + for (uint32_t i = 0; i < op_array->last_literal; i++) { zend_string *str = zval_get_string(op_array->literals + i); - fprintf(stderr, "Literal %d, val (%zu):%s\n", i, ZSTR_LEN(str), ZSTR_VAL(str)); + fprintf(stderr, "Literal %" PRIu32 ", val (%zu):%s\n", i, ZSTR_LEN(str), ZSTR_VAL(str)); zend_string_release(str); } fflush(stderr); @@ -272,7 +273,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx zend_hash_init(&hash, op_array->last_literal, NULL, NULL, 0); map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int)); memset(map, 0, op_array->last_literal * sizeof(int)); - for (i = 0; i < op_array->last_literal; i++) { + for (uint32_t i = 0; i < op_array->last_literal; i++) { if (!info[i].num_related) { /* unset literal */ zval_ptr_dtor_nogc(&op_array->literals[i]); @@ -770,9 +771,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx { fprintf(stderr, "Optimized literals table size %d\n", op_array->last_literal); - for (int i = 0; i < op_array->last_literal; i++) { + for (uint32_t i = 0; i < op_array->last_literal; i++) { zend_string *str = zval_get_string(op_array->literals + i); - fprintf(stderr, "Literal %d, val (%zu):%s\n", i, ZSTR_LEN(str), ZSTR_VAL(str)); + fprintf(stderr, "Literal %" PRIu32 ", val (%zu):%s\n", i, ZSTR_LEN(str), ZSTR_VAL(str)); zend_string_release(str); } fflush(stderr); diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 4e5ecca8a0f80..a206238b552b3 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -210,9 +210,9 @@ void zend_optimizer_convert_to_free_op1(zend_op_array *op_array, zend_op *opline } } -int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv) +uint32_t zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv) { - int i = op_array->last_literal; + uint32_t i = op_array->last_literal; op_array->last_literal++; op_array->literals = (zval*)erealloc(op_array->literals, op_array->last_literal * sizeof(zval)); ZVAL_COPY_VALUE(&op_array->literals[i], zv); @@ -220,7 +220,7 @@ int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv) return i; } -static inline int zend_optimizer_add_literal_string(zend_op_array *op_array, zend_string *str) { +static inline uint32_t zend_optimizer_add_literal_string(zend_op_array *op_array, zend_string *str) { zval zv; ZVAL_STR(&zv, str); zend_string_hash_val(str); diff --git a/Zend/Optimizer/zend_optimizer_internal.h b/Zend/Optimizer/zend_optimizer_internal.h index 896fe8fb47289..9c238690932ef 100644 --- a/Zend/Optimizer/zend_optimizer_internal.h +++ b/Zend/Optimizer/zend_optimizer_internal.h @@ -79,7 +79,7 @@ static inline bool zend_optimizer_is_loop_var_free(const zend_op *opline) { } void zend_optimizer_convert_to_free_op1(zend_op_array *op_array, zend_op *opline); -int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv); +uint32_t zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv); bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy); void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value); bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index cff9f62e87ca8..358b6723e0054 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -588,7 +588,7 @@ static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int li static int zend_add_literal(zval *zv) /* {{{ */ { zend_op_array *op_array = CG(active_op_array); - int i = op_array->last_literal; + uint32_t i = op_array->last_literal; op_array->last_literal++; if (i >= CG(context).literals_size) { while (i >= CG(context).literals_size) { diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index ce660d026aaab..ab90b2dcaa836 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -198,7 +198,7 @@ typedef struct _zend_oparray_context { zend_op_array *op_array; uint32_t opcodes_size; uint32_t vars_size; - int literals_size; + uint32_t literals_size; uint32_t fast_call_var; uint32_t try_catch_offset; int current_brk_cont; @@ -550,7 +550,7 @@ struct _zend_op_array { uint32_t line_start; uint32_t line_end; - int last_literal; + uint32_t last_literal; uint32_t num_dynamic_func_defs; zval *literals; diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index b329bdac728bb..9c93cd2b88efb 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -307,7 +307,7 @@ PHPDBG_INFO(literal) /* {{{ */ bool in_executor = PHPDBG_G(in_execution) && EG(current_execute_data) && EG(current_execute_data)->func; if (in_executor || PHPDBG_G(ops)) { zend_op_array *ops = in_executor ? &EG(current_execute_data)->func->op_array : PHPDBG_G(ops); - int literal = 0, count = ops->last_literal - 1; + uint32_t literal = 0, count = ops->last_literal - 1; if (ops->function_name) { if (ops->scope) { From 294a0801a5cf5688ec28235778e8ebb027137169 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 29 Sep 2025 12:45:45 -0300 Subject: [PATCH 106/386] ODBC fetch refactoring (#19848) * Merge odbc_fetch_into into odbc_fetch_hash Now that we can assume fetch_hash exists, there's a lot of redundancy in these functions. Merge their implementations, and smooth over the differences in how they handle returning their result set as an array. * Convert php_odbc_fetch_hash to ZPP * Use SQLFetchScroll instead of SQLExtendedFetch Fixes GH-19522 * Convert result type constants to an enum * Implement odbc_fetch_row in terms of php_odbc_fetch_hash These are also doing extremely similar jobs, but with slightly different behaviours for the return value (in this case, none, as it's tended to be used with odbc_result). Unify this too. The $row value deprecation for 0/-1 is only handled for odbc_fetch_row; it's too late to do so for PHP 8.5. Should probably unify it for PHP 8.6. * Rename php_odbc_fetch_hash to remove _hash Since this is a much more shared fetch function now. --- ext/odbc/php_odbc.c | 283 +++++++++++++------------------------------- 1 file changed, 84 insertions(+), 199 deletions(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 491f59b2bce3f..a6af7469cbac3 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1306,11 +1306,14 @@ PHP_FUNCTION(odbc_exec) } /* }}} */ -#define ODBC_NUM 1 -#define ODBC_OBJECT 2 +typedef enum php_odbc_fetch_result_type_t { + ODBC_NONE = 0, + ODBC_NUM = 1, + ODBC_OBJECT = 2, +} php_odbc_fetch_result_type_t; -/* {{{ php_odbc_fetch_hash */ -static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) +/* {{{ php_odbc_fetch */ +static void php_odbc_fetch(INTERNAL_FUNCTION_PARAMETERS, bool return_array, php_odbc_fetch_result_type_t result_type) { int i; odbc_result *result; @@ -1319,29 +1322,56 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) char *buf = NULL; zend_long pv_row = 0; bool pv_row_is_null = true; - zval *pv_res, tmp; - SQLULEN crow; - SQLUSMALLINT RowStatus[1]; + zval *pv_res, *pv_res_arr, tmp; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l!", &pv_res, odbc_result_ce, &pv_row, &pv_row_is_null) == FAILURE) { - RETURN_THROWS(); + if (return_array || result_type == ODBC_NONE) { + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_OBJECT_OF_CLASS(pv_res, odbc_result_ce) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(pv_row, pv_row_is_null) + ZEND_PARSE_PARAMETERS_END(); + /* So we can use pv_res_arr for both return value and passed */ + pv_res_arr = return_value; + } else { + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_OBJECT_OF_CLASS(pv_res, odbc_result_ce) + Z_PARAM_ZVAL(pv_res_arr) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(pv_row, pv_row_is_null) + ZEND_PARSE_PARAMETERS_END(); } result = Z_ODBC_RESULT_P(pv_res); CHECK_ODBC_RESULT(result); - /* TODO deprecate $row argument values less than 1 after PHP 8.4 */ + /* TODO deprecate $row argument values less than 1 after PHP 8.4 + * for functions other than odbc_fetch_row (see GH-13910) + */ + if (!result_type && !pv_row_is_null && pv_row < 1) { + php_error_docref(NULL, E_WARNING, "Argument #3 ($row) must be greater than or equal to 1"); + RETURN_FALSE; + } if (result->numcols == 0) { php_error_docref(NULL, E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } + /* If we're initializing a passed value into an array, do it before the fetch + * so that an empty result set will still be an array. + */ + if (!return_array && result_type) { + pv_res_arr = zend_try_array_init(pv_res_arr); + if (!pv_res_arr) { + RETURN_THROWS(); + } + } + if (result->fetch_abs) { if (!pv_row_is_null && pv_row > 0) { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,(SQLLEN)pv_row,&crow,RowStatus); + rc = SQLFetchScroll(result->stmt, SQL_FETCH_ABSOLUTE, (SQLLEN)pv_row); } else { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); + rc = SQLFetchScroll(result->stmt, SQL_FETCH_NEXT, 1); } } else { rc = SQLFetch(result->stmt); @@ -1349,18 +1379,28 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch"); + odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetchScroll"); } RETURN_FALSE; } - array_init(return_value); + /* ...but if returning an array, init only if we have a result set */ + if (return_array && result_type) { + array_init(pv_res_arr); + } if (!pv_row_is_null && pv_row > 0 && result->fetch_abs) result->fetched = (SQLLEN)pv_row; else result->fetched++; + /* For fetch_row, we don't return anything other than true, + * odbc_result will be used to fetch values instead. + */ + if (result_type == ODBC_NONE) { + RETURN_TRUE; + } + for(i = 0; i < result->numcols; i++) { sql_c_type = SQL_C_CHAR; @@ -1375,6 +1415,8 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (result->binmode == 1) { sql_c_type = SQL_C_BINARY; } + + /* TODO: Check this is the intended behaviour */ ZEND_FALLTHROUGH; case SQL_LONGVARCHAR: case SQL_WLONGVARCHAR: @@ -1391,7 +1433,9 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (rc == SQL_ERROR) { odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); efree(buf); - zval_ptr_dtor(return_value); + if (return_array) { + zval_ptr_dtor(pv_res_arr); + } RETURN_FALSE; } @@ -1425,18 +1469,23 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) } if (result_type & ODBC_NUM) { - zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp); + zend_hash_index_update(Z_ARRVAL_P(pv_res_arr), i, &tmp); } else { if (!*(result->values[i].name) && Z_TYPE(tmp) == IS_STRING) { - zend_hash_update(Z_ARRVAL_P(return_value), Z_STR(tmp), &tmp); + zend_hash_update(Z_ARRVAL_P(pv_res_arr), Z_STR(tmp), &tmp); } else { - zend_hash_str_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name), &tmp); + zend_hash_str_update(Z_ARRVAL_P(pv_res_arr), result->values[i].name, strlen(result->values[i].name), &tmp); } } } if (buf) { efree(buf); } + + /* return_value was set to an array otherwise */ + if (!return_array) { + RETURN_LONG(result->numcols); + } } /* }}} */ @@ -1444,7 +1493,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) /* {{{ Fetch a result row as an object */ PHP_FUNCTION(odbc_fetch_object) { - php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, ODBC_OBJECT); + php_odbc_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, true, ODBC_OBJECT); if (Z_TYPE_P(return_value) == IS_ARRAY) { object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); } @@ -1454,184 +1503,21 @@ PHP_FUNCTION(odbc_fetch_object) /* {{{ Fetch a result row as an associative array */ PHP_FUNCTION(odbc_fetch_array) { - php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, ODBC_OBJECT); + php_odbc_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, true, ODBC_OBJECT); } /* }}} */ /* {{{ Fetch one result row into an array */ PHP_FUNCTION(odbc_fetch_into) { - int i; - odbc_result *result; - RETCODE rc; - SQLSMALLINT sql_c_type; - char *buf = NULL; - zval *pv_res, *pv_res_arr, tmp; - zend_long pv_row = 0; - bool pv_row_is_null = true; - SQLULEN crow; - SQLUSMALLINT RowStatus[1]; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oz|l!", &pv_res, odbc_result_ce, &pv_res_arr, &pv_row, &pv_row_is_null) == FAILURE) { - RETURN_THROWS(); - } - - result = Z_ODBC_RESULT_P(pv_res); - CHECK_ODBC_RESULT(result); - - /* TODO deprecate $row argument values less than 1 after PHP 8.4 */ - - if (result->numcols == 0) { - php_error_docref(NULL, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - pv_res_arr = zend_try_array_init(pv_res_arr); - if (!pv_res_arr) { - RETURN_THROWS(); - } - - if (result->fetch_abs) { - if (!pv_row_is_null && pv_row > 0) { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,(SQLLEN)pv_row,&crow,RowStatus); - } else { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - } - } else { - rc = SQLFetch(result->stmt); - } - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch"); - } - RETURN_FALSE; - } - - if (!pv_row_is_null && pv_row > 0 && result->fetch_abs) - result->fetched = (SQLLEN)pv_row; - else - result->fetched++; - - for(i = 0; i < result->numcols; i++) { - sql_c_type = SQL_C_CHAR; - - switch(result->values[i].coltype) { - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - if (result->binmode <= 0) { - ZVAL_EMPTY_STRING(&tmp); - break; - } - if (result->binmode == 1) sql_c_type = SQL_C_BINARY; - - /* TODO: Check this is the intended behaviour */ - ZEND_FALLTHROUGH; - case SQL_LONGVARCHAR: - case SQL_WLONGVARCHAR: - if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) { - ZVAL_EMPTY_STRING(&tmp); - break; - } - - if (buf == NULL) { - buf = emalloc(result->longreadlen + 1); - } - rc = SQLGetData(result->stmt, (SQLUSMALLINT)(i + 1),sql_c_type, buf, result->longreadlen + 1, &result->values[i].vallen); - - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData"); - efree(buf); - RETURN_FALSE; - } - if (rc == SQL_SUCCESS_WITH_INFO) { - ZVAL_STRINGL(&tmp, buf, result->longreadlen); - } else if (rc != SQL_SUCCESS) { - php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", i + 1, rc); - ZVAL_FALSE(&tmp); - } else if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(&tmp); - break; - } else if (result->values[i].vallen == SQL_NO_TOTAL) { - php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (driver cannot determine length)", i + 1); - ZVAL_FALSE(&tmp); - } else { - ZVAL_STRINGL(&tmp, buf, result->values[i].vallen); - } - break; - - default: - if (result->values[i].vallen == SQL_NULL_DATA) { - ZVAL_NULL(&tmp); - break; - } else if (result->values[i].vallen == SQL_NO_TOTAL) { - php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (driver cannot determine length)", i + 1); - ZVAL_FALSE(&tmp); - break; - } - ZVAL_STRINGL(&tmp, result->values[i].value, result->values[i].vallen); - break; - } - zend_hash_index_update(Z_ARRVAL_P(pv_res_arr), i, &tmp); - } - if (buf) efree(buf); - RETURN_LONG(result->numcols); + php_odbc_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, false, ODBC_NUM); } /* }}} */ /* {{{ Fetch a row */ PHP_FUNCTION(odbc_fetch_row) { - odbc_result *result; - RETCODE rc; - zval *pv_res; - zend_long pv_row = 0; - bool pv_row_is_null = true; - SQLULEN crow; - SQLUSMALLINT RowStatus[1]; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l!", &pv_res, odbc_result_ce, &pv_row, &pv_row_is_null) == FAILURE) { - RETURN_THROWS(); - } - - result = Z_ODBC_RESULT_P(pv_res); - CHECK_ODBC_RESULT(result); - - if (!pv_row_is_null && pv_row < 1) { - php_error_docref(NULL, E_WARNING, "Argument #3 ($row) must be greater than or equal to 1"); - RETURN_FALSE; - } - - if (result->numcols == 0) { - php_error_docref(NULL, E_WARNING, "No tuples available at this result index"); - RETURN_FALSE; - } - - if (result->fetch_abs) { - if (!pv_row_is_null) { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,(SQLLEN)pv_row,&crow,RowStatus); - } else { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - } - } else { - rc = SQLFetch(result->stmt); - } - - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch"); - } - RETURN_FALSE; - } - - if (!pv_row_is_null) { - result->fetched = (SQLLEN)pv_row; - } else { - result->fetched++; - } - - RETURN_TRUE; + php_odbc_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, false, ODBC_NONE); } /* }}} */ @@ -1648,8 +1534,6 @@ PHP_FUNCTION(odbc_result) RETCODE rc; SQLLEN fieldsize; zval *pv_res; - SQLULEN crow; - SQLUSMALLINT RowStatus[1]; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_OBJECT_OF_CLASS(pv_res, odbc_result_ce) @@ -1700,14 +1584,15 @@ PHP_FUNCTION(odbc_result) if (result->fetched == 0) { /* User forgot to call odbc_fetch_row(), or wants to reload the results, do it now */ - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus); - else + if (result->fetch_abs) { + rc = SQLFetchScroll(result->stmt, SQL_FETCH_NEXT, 1); + } else { rc = SQLFetch(result->stmt); + } if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { if (rc == SQL_ERROR) { - odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch"); + odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetchScroll"); } RETURN_FALSE; } @@ -1850,8 +1735,6 @@ PHP_FUNCTION(odbc_result_all) char *pv_format = NULL; size_t i, pv_format_len = 0; SQLSMALLINT sql_c_type; - SQLULEN crow; - SQLUSMALLINT RowStatus[1]; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s", &pv_res, odbc_result_ce, &pv_format, &pv_format_len) == FAILURE) { RETURN_THROWS(); @@ -1864,10 +1747,11 @@ PHP_FUNCTION(odbc_result_all) php_error_docref(NULL, E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - else + if (result->fetch_abs) { + rc = SQLFetchScroll(result->stmt, SQL_FETCH_NEXT, 1); + } else { rc = SQLFetch(result->stmt); + } if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { php_printf("

No rows found

\n"); @@ -1962,10 +1846,11 @@ PHP_FUNCTION(odbc_result_all) } php_printf("\n"); - if (result->fetch_abs) - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); - else + if (result->fetch_abs) { + rc = SQLFetchScroll(result->stmt, SQL_FETCH_NEXT, 1); + } else { rc = SQLFetch(result->stmt); + } } php_printf("\n"); if (buf) efree(buf); From c7da72857474ae5ac01f809b789cf1189e53c985 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:17:56 +0100 Subject: [PATCH 107/386] ext/filter: Check callback validity once (#19921) The call_user_function() API redoes the zend_is_callable() check, which has been just done. We can check validity and retrieve the FCC to call it directly rather than having a useless double check --- ext/filter/callback_filter.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c index 719b66767980f..dea39c6cc7c30 100644 --- a/ext/filter/callback_filter.c +++ b/ext/filter/callback_filter.c @@ -19,22 +19,21 @@ zend_result php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL) { zval retval; - int status; + zend_fcall_info_cache fcc; - if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_SUPPRESS_DEPRECATIONS, NULL)) { + if (!option_array || !zend_is_callable_ex(option_array, NULL, IS_CALLABLE_SUPPRESS_DEPRECATIONS, NULL, &fcc, NULL)) { zend_type_error("%s(): Option must be a valid callback", get_active_function_name()); zval_ptr_dtor(value); ZVAL_NULL(value); return SUCCESS; } - status = call_user_function(NULL, NULL, option_array, &retval, 1, value); + zend_call_known_fcc(&fcc, &retval, 1, value, NULL); + zval_ptr_dtor(value); - if (status == SUCCESS && !Z_ISUNDEF(retval)) { - zval_ptr_dtor(value); + if (!Z_ISUNDEF(retval)) { ZVAL_COPY_VALUE(value, &retval); } else { - zval_ptr_dtor(value); ZVAL_NULL(value); } return SUCCESS; From f2aaea053c0825885c4a8ab44c4ecce5005d8316 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 30 Sep 2025 18:10:24 +0200 Subject: [PATCH 108/386] Use faster string construction in ext/dom in some places (#20005) Many tag names are single characters, so we can use the fast string construction. In cases where a NULL name is used we can also use the empty string. This avoids some allocations and some work. --- ext/dom/attr.c | 2 +- ext/dom/documenttype.c | 6 +++++- ext/dom/dom_iterators.c | 4 ++-- ext/dom/element.c | 4 ++-- ext/dom/node.c | 11 +++++++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 5a0900d657eea..3107f5a21a2be 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -83,7 +83,7 @@ zend_result dom_attr_name_read(dom_object *obj, zval *retval) if (php_dom_follow_spec_intern(obj)) { zend_string *str = dom_node_get_node_name_attribute_or_element((xmlNodePtr) attrp, false); - ZVAL_NEW_STR(retval, str); + ZVAL_STR(retval, str); } else { ZVAL_STRING(retval, (char *) attrp->name); } diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index 63da0306649a9..266c895effb27 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -34,7 +34,11 @@ URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core- zend_result dom_documenttype_name_read(dom_object *obj, zval *retval) { DOM_PROP_NODE(xmlDtdPtr, dtdptr, obj); - ZVAL_STRING(retval, dtdptr->name ? (char *) (dtdptr->name) : ""); + if (dtdptr->name) { + ZVAL_STRING(retval, (const char *) dtdptr->name); + } else { + ZVAL_EMPTY_STRING(retval); + } return SUCCESS; } diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index 90e973723f6c6..9134b107925a2 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -127,9 +127,9 @@ static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key) if (intern->ptr != NULL) { xmlNodePtr curnode = ((php_libxml_node_ptr *)intern->ptr)->node; if (curnode->type == XML_ATTRIBUTE_NODE && php_dom_follow_spec_intern(intern)) { - ZVAL_NEW_STR(key, dom_node_get_node_name_attribute_or_element(curnode, false)); + ZVAL_STR(key, dom_node_get_node_name_attribute_or_element(curnode, false)); } else { - ZVAL_STRINGL(key, (const char *) curnode->name, xmlStrlen(curnode->name)); + ZVAL_STRINGL_FAST(key, (const char *) curnode->name, xmlStrlen(curnode->name)); } } else { ZVAL_NULL(key); diff --git a/ext/dom/element.c b/ext/dom/element.c index f9aee10802fbb..cf1a762768a87 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -122,7 +122,7 @@ zend_result dom_element_tag_name_read(dom_object *obj, zval *retval) bool uppercase = php_dom_follow_spec_intern(obj) && php_dom_ns_is_html_and_document_is_html(nodep); zend_string *result = dom_node_get_node_name_attribute_or_element((const xmlNode *) nodep, uppercase); - ZVAL_NEW_STR(retval, result); + ZVAL_STR(retval, result); return SUCCESS; } @@ -375,7 +375,7 @@ PHP_METHOD(DOMElement, getAttributeNames) } for (xmlAttrPtr attr = nodep->properties; attr; attr = attr->next) { - ZVAL_NEW_STR(&tmp, dom_node_get_node_name_attribute_or_element((const xmlNode *) attr, false)); + ZVAL_STR(&tmp, dom_node_get_node_name_attribute_or_element((const xmlNode *) attr, false)); zend_hash_next_index_insert(ht, &tmp); } } diff --git a/ext/dom/node.c b/ext/dom/node.c index 61e693fa77630..40aaf27669268 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -52,6 +52,13 @@ zend_string *dom_node_get_node_name_attribute_or_element(const xmlNode *nodep, b if (nodep->ns != NULL && nodep->ns->prefix != NULL) { ret = dom_node_concatenated_name_helper(name_len, (const char *) nodep->name, strlen((const char *) nodep->ns->prefix), (const char *) nodep->ns->prefix); } else { + if (name_len == 1) { + if (uppercase) { + return ZSTR_CHAR(zend_toupper_ascii(*nodep->name)); + } else { + return ZSTR_CHAR((zend_uchar) *nodep->name); + } + } ret = zend_string_init((const char *) nodep->name, name_len, false); } if (uppercase) { @@ -89,7 +96,7 @@ zend_result dom_node_node_name_read(dom_object *obj, zval *retval) uppercase = php_dom_follow_spec_intern(obj) && php_dom_ns_is_html_and_document_is_html(nodep); ZEND_FALLTHROUGH; case XML_ATTRIBUTE_NODE: - ZVAL_NEW_STR(retval, dom_node_get_node_name_attribute_or_element(nodep, uppercase)); + ZVAL_STR(retval, dom_node_get_node_name_attribute_or_element(nodep, uppercase)); break; case XML_NAMESPACE_DECL: { xmlNsPtr ns = nodep->ns; @@ -635,7 +642,7 @@ zend_result dom_node_local_name_read(dom_object *obj, zval *retval) DOM_PROP_NODE(xmlNodePtr, nodep, obj); if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE || nodep->type == XML_NAMESPACE_DECL) { - ZVAL_STRING(retval, (char *) (nodep->name)); + ZVAL_STRING_FAST(retval, (const char *) (nodep->name)); } else { ZVAL_NULL(retval); } From cd9eec79a87b92486c2c594ea07b4c31bf05eb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 30 Sep 2025 22:17:55 +0200 Subject: [PATCH 109/386] Add Tim as a maintainer of ext/uri [skip-ci] --- .github/CODEOWNERS | 2 +- EXTENSIONS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 973c9d470dc58..1720a66933385 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -52,7 +52,7 @@ /ext/sockets @devnexen /ext/spl @Girgias /ext/standard @bukka -/ext/uri @kocsismate +/ext/uri @kocsismate @TimWolla /ext/xml @nielsdos /ext/xmlreader @nielsdos /ext/xmlwriter @nielsdos diff --git a/EXTENSIONS b/EXTENSIONS index 01685748b5e09..5cce4ae7c9232 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -506,6 +506,7 @@ STATUS: Working ------------------------------------------------------------------------------- EXTENSION: uri PRIMARY MAINTAINER Máté Kocsis (2025 - 2025) + Tim Düsterhus (2025 - 2025) MAINTENANCE: Maintained STATUS: Working SINCE: 8.5.0 From 292e0c293717ff305527e6b4eff69bedda33c8f7 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 30 Sep 2025 22:54:59 +0200 Subject: [PATCH 110/386] Add ce_flags2 & fn_flags2 (GH-19991) --- Zend/Optimizer/zend_optimizer.c | 2 ++ Zend/zend.h | 1 + Zend/zend_compile.c | 1 + Zend/zend_compile.h | 13 +++++++++++++ Zend/zend_execute.c | 1 + Zend/zend_object_handlers.c | 2 ++ Zend/zend_opcode.c | 1 + ext/ffi/ffi.c | 2 ++ ext/opcache/ZendAccelerator.c | 2 ++ ext/zend_test/test.c | 2 ++ 10 files changed, 27 insertions(+) diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index a206238b552b3..5d18fc6015854 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -1727,11 +1727,13 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l ZEND_ASSERT(orig_op_array != NULL); if (orig_op_array != op_array) { uint32_t fn_flags = op_array->fn_flags; + uint32_t fn_flags2 = op_array->fn_flags2; zend_function *prototype = op_array->prototype; HashTable *ht = op_array->static_variables; *op_array = *orig_op_array; op_array->fn_flags = fn_flags; + op_array->fn_flags2 = fn_flags2; op_array->prototype = prototype; op_array->static_variables = ht; } diff --git a/Zend/zend.h b/Zend/zend.h index 53d5602a2c2ea..163b48015d9b8 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -154,6 +154,7 @@ struct _zend_class_entry { }; int refcount; uint32_t ce_flags; + uint32_t ce_flags2; int default_properties_count; int default_static_members_count; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ff790137a90fc..57c012ac71a66 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2048,6 +2048,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_hand ce->refcount = 1; ce->ce_flags = ZEND_ACC_CONSTANTS_UPDATED; + ce->ce_flags2 = 0; if (CG(compiler_options) & ZEND_COMPILE_GUARDS) { ce->ce_flags |= ZEND_ACC_USE_GUARDS; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index ab90b2dcaa836..4a10ad99e2428 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -341,6 +341,11 @@ typedef struct _zend_oparray_context { /* Class cannot be serialized or unserialized | | | */ #define ZEND_ACC_NOT_SERIALIZABLE (1 << 29) /* X | | | */ /* | | | */ +/* Class Flags 2 (ce_flags2) (unused: 0-31) | | | */ +/* ========================= | | | */ +/* | | | */ +/* #define ZEND_ACC2_EXAMPLE (1 << 0) X | | | */ +/* | | | */ /* Function Flags (unused: 30) | | | */ /* ============== | | | */ /* | | | */ @@ -407,6 +412,11 @@ typedef struct _zend_oparray_context { /* | | | */ /* op_array uses strict mode types | | | */ #define ZEND_ACC_STRICT_TYPES (1U << 31) /* | X | | */ +/* | | | */ +/* Function Flags 2 (fn_flags2) (unused: 0-31) | | | */ +/* ============================ | | | */ +/* | | | */ +/* #define ZEND_ACC2_EXAMPLE (1 << 0) | X | | */ #define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE) #define ZEND_ACC_PPP_SET_MASK (ZEND_ACC_PUBLIC_SET | ZEND_ACC_PROTECTED_SET | ZEND_ACC_PRIVATE_SET) @@ -527,6 +537,7 @@ struct _zend_op_array { ZEND_MAP_PTR_DEF(void **, run_time_cache); zend_string *doc_comment; uint32_t T; /* number of temporary variables */ + uint32_t fn_flags2; const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ /* END of common elements */ @@ -586,6 +597,7 @@ typedef struct _zend_internal_function { ZEND_MAP_PTR_DEF(void **, run_time_cache); zend_string *doc_comment; uint32_t T; /* number of temporary variables */ + uint32_t fn_flags2; const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ /* END of common elements */ @@ -615,6 +627,7 @@ union _zend_function { ZEND_MAP_PTR_DEF(void **, run_time_cache); zend_string *doc_comment; uint32_t T; /* number of temporary variables */ + uint32_t fn_flags2; const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ } common; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 331043d3fef9c..c8863a4b27ad5 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -153,6 +153,7 @@ ZEND_API const zend_internal_function zend_pass_function = { NULL, /* run_time_cache */ NULL, /* doc_comment */ 0, /* T */ + 0, /* fn_flags2 */ NULL, /* prop_info */ ZEND_FN(pass), /* handler */ NULL, /* module */ diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 361ddde6ebabc..5d1ec65ccda40 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1696,6 +1696,7 @@ ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce | ZEND_ACC_PUBLIC | ZEND_ACC_VARIADIC | (fbc->common.fn_flags & (ZEND_ACC_RETURN_REFERENCE|ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED|ZEND_ACC_NODISCARD)); + func->fn_flags2 = 0; /* Attributes outlive the trampoline because they are created by the compiler. */ func->attributes = fbc->common.attributes; if (is_static) { @@ -1797,6 +1798,7 @@ ZEND_API zend_function *zend_get_property_hook_trampoline( func->common.arg_flags[1] = 0; func->common.arg_flags[2] = 0; func->common.fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE; + func->common.fn_flags2 = 0; func->common.function_name = zend_string_concat3( "$", 1, ZSTR_VAL(prop_name), ZSTR_LEN(prop_name), kind == ZEND_PROPERTY_HOOK_GET ? "::get" : "::set", 5); diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index bf02d6a4164bd..1962c7b5a56d1 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -84,6 +84,7 @@ void init_op_array(zend_op_array *op_array, uint8_t type, int initial_ops_size) op_array->last_try_catch = 0; op_array->fn_flags = 0; + op_array->fn_flags2 = 0; op_array->last_literal = 0; op_array->literals = NULL; diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 8e9f4290e1b2c..86b8d29209f40 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -2190,6 +2190,7 @@ static zend_result zend_ffi_cdata_get_closure(zend_object *obj, zend_class_entry func->common.arg_flags[1] = 0; func->common.arg_flags[2] = 0; func->common.fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE; + func->common.fn_flags2 = 0; func->common.function_name = ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE); /* set to 0 to avoid arg_info[] allocation, because all values are passed by value anyway */ func->common.num_args = 0; @@ -2969,6 +2970,7 @@ static zend_function *zend_ffi_get_func(zend_object **obj, zend_string *name, co func->common.arg_flags[1] = 0; func->common.arg_flags[2] = 0; func->common.fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE; + func->common.fn_flags2 = 0; func->common.function_name = zend_string_copy(name); /* set to 0 to avoid arg_info[] allocation, because all values are passed by value anyway */ func->common.num_args = 0; diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 0456017dae055..9ef74973a4dff 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4367,12 +4367,14 @@ static void preload_fix_trait_op_array(zend_op_array *op_array) zend_string *function_name = op_array->function_name; zend_class_entry *scope = op_array->scope; uint32_t fn_flags = op_array->fn_flags; + uint32_t fn_flags2 = op_array->fn_flags2; zend_function *prototype = op_array->prototype; HashTable *ht = op_array->static_variables; *op_array = *orig_op_array; op_array->function_name = function_name; op_array->scope = scope; op_array->fn_flags = fn_flags; + op_array->fn_flags2 = fn_flags2; op_array->prototype = prototype; op_array->static_variables = ht; } diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 50c0a57ae8ef8..4e06b2106ce59 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -1053,6 +1053,7 @@ static zend_function *zend_test_class_method_get(zend_object **object, zend_stri fptr->num_args = 0; fptr->scope = (*object)->ce; fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER; + fptr->fn_flags2 = 0; fptr->function_name = zend_string_copy(name); fptr->handler = ZEND_FN(zend_test_func); fptr->doc_comment = NULL; @@ -1077,6 +1078,7 @@ static zend_function *zend_test_class_static_method_get(zend_class_entry *ce, ze fptr->num_args = 0; fptr->scope = ce; fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_STATIC; + fptr->fn_flags2 = 0; fptr->function_name = zend_string_copy(name); fptr->handler = ZEND_FN(zend_test_func); fptr->doc_comment = NULL; From a3f0861f2e5c287b200bd5692e00569b10bb9173 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 30 Sep 2025 22:58:30 +0200 Subject: [PATCH 111/386] [skip ci] Mention new ce_flags2 and fn_flags2 fields in UPGRADING.INTERNALS --- UPGRADING.INTERNALS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 0c9aeb0d32f2c..c2ec44e1e0c2a 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -18,6 +18,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES zend_string_starts_with_literal_ci() now support strings containing NUL bytes. Passing non-literal char* is no longer supported. . The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead. + . New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were + added, given the primary flags were running out of bits. ======================== 2. Build system changes From 19fc6ed5fbc3f97807f659dd9ce7b2ae7859fdc3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:45:59 +0200 Subject: [PATCH 112/386] soap: Switch to new XML parser option setting API (#20020) This API does not require the "global" security workaround. We also pass some additional options for hardening. --- ext/soap/php_xml.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index b6b0c09b9d48b..a2536b98f39bb 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -79,12 +79,15 @@ static xmlDocPtr soap_xmlParse_ex(xmlParserCtxtPtr ctxt) { xmlDocPtr ret; if (ctxt) { +#if LIBXML_VERSION >= 21300 + xmlCtxtSetOptions(ctxt, XML_PARSE_HUGE | XML_PARSE_NO_XXE | XML_PARSE_NONET | XML_PARSE_NOBLANKS); +#else php_libxml_sanitize_parse_ctxt_options(ctxt); - /* TODO: In libxml2 2.14.0 change this to the new options API so we don't rely on deprecated APIs. */ ZEND_DIAGNOSTIC_IGNORED_START("-Wdeprecated-declarations") ctxt->keepBlanks = 0; ctxt->options |= XML_PARSE_HUGE; ZEND_DIAGNOSTIC_IGNORED_END +#endif ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; From 39dda7239f989243ec1a4c32cc24326c4a6d8c2b Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 1 Oct 2025 12:50:11 +0100 Subject: [PATCH 113/386] ext/mysqli: internal updates (#19072) * global struct size reduction. * connection port ini value sanity check addition. --- ext/mysqli/mysqli.c | 15 ++++++++++++- ext/mysqli/php_mysqli_structs.h | 16 +++++++------- .../tests/mysqli_default_port_error.phpt | 21 +++++++++++++++++++ 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 ext/mysqli/tests/mysqli_default_port_error.phpt diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a8a75eff70863..dddb53585f14e 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -424,6 +424,19 @@ static const MYSQLND_REVERSE_API mysqli_reverse_api = { mysqli_convert_zv_to_mysqlnd }; +static PHP_INI_MH(OnUpdateDefaultPort) +{ + zend_long value = ZEND_ATOL(ZSTR_VAL(new_value)); + + if (value < 0 || value > USHRT_MAX) { + return FAILURE; + } + + MyG(default_port) = (unsigned short)value; + + return SUCCESS; +} + /* {{{ PHP_INI_BEGIN */ PHP_INI_BEGIN() STD_PHP_INI_ENTRY_EX("mysqli.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_mysqli_globals, mysqli_globals, display_link_numbers) @@ -433,7 +446,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("mysqli.default_host", NULL, PHP_INI_ALL, OnUpdateString, default_host, zend_mysqli_globals, mysqli_globals) STD_PHP_INI_ENTRY("mysqli.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_mysqli_globals, mysqli_globals) STD_PHP_INI_ENTRY("mysqli.default_pw", NULL, PHP_INI_ALL, OnUpdateString, default_pw, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_ENTRY("mysqli.default_port", "3306", PHP_INI_ALL, OnUpdateLong, default_port, zend_mysqli_globals, mysqli_globals) + STD_PHP_INI_ENTRY("mysqli.default_port", "3306", PHP_INI_ALL, OnUpdateDefaultPort, default_port, zend_mysqli_globals, mysqli_globals) #ifdef PHP_MYSQL_UNIX_SOCK_ADDR STD_PHP_INI_ENTRY("mysqli.default_socket", MYSQL_UNIX_ADDR,PHP_INI_ALL,OnUpdateStringUnempty, default_socket, zend_mysqli_globals, mysqli_globals) #else diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index c155281c8e4bc..2daa5af932882 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -236,21 +236,21 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul ZEND_BEGIN_MODULE_GLOBALS(mysqli) - zend_long num_links; - zend_long max_links; - zend_long num_active_persistent; - zend_long num_inactive_persistent; - zend_long max_persistent; + unsigned short default_port; bool allow_persistent; - zend_ulong default_port; + bool allow_local_infile; char *default_host; char *default_user; char *default_pw; char *default_socket; - bool allow_local_infile; char *local_infile_directory; - zend_long error_no; char *error_msg; + zend_long num_links; + zend_long max_links; + zend_long num_active_persistent; + zend_long num_inactive_persistent; + zend_long max_persistent; + zend_long error_no; zend_long report_mode; bool rollback_on_cached_plink; ZEND_END_MODULE_GLOBALS(mysqli) diff --git a/ext/mysqli/tests/mysqli_default_port_error.phpt b/ext/mysqli/tests/mysqli_default_port_error.phpt new file mode 100644 index 0000000000000..7d3658417c96c --- /dev/null +++ b/ext/mysqli/tests/mysqli_default_port_error.phpt @@ -0,0 +1,21 @@ +--TEST-- +default_port ini setting +--EXTENSIONS-- +mysqli +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(false) From 4dc291c7bd8704b194d6ce563815237d664ff843 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 1 Oct 2025 12:54:43 +0100 Subject: [PATCH 114/386] [ci skip] UPGRADING --- UPGRADING | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UPGRADING b/UPGRADING index 8162d1e05b8ab..f6882b45c11b2 100644 --- a/UPGRADING +++ b/UPGRADING @@ -64,6 +64,10 @@ PHP 8.6 UPGRADE NOTES 11. Changes to INI File Handling ======================================== +- Mysqli: + . mysqli.default_port now checks the validity of the value which should be + between 0 and 65545 included. + - Opcache: . opcache.jit_debug accepts a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC. When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit From 9731507b5531b20e66935571d1b54e5e42367d1d Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 1 Oct 2025 14:05:28 +0100 Subject: [PATCH 115/386] [ci skip] UPGRADING typo --- UPGRADING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index f6882b45c11b2..334c0fc6bdac3 100644 --- a/UPGRADING +++ b/UPGRADING @@ -66,7 +66,7 @@ PHP 8.6 UPGRADE NOTES - Mysqli: . mysqli.default_port now checks the validity of the value which should be - between 0 and 65545 included. + between 0 and 65535 included. - Opcache: . opcache.jit_debug accepts a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC. From b32a2a55ef9c2384a2e9d5d46e4d9a639bb5a4f3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:19:37 +0200 Subject: [PATCH 116/386] Fixes to phar stub (#10706) * Fixes to phar stub There were a couple of issues with the phar stub. It seems that in the past people did not realise they had to change shortarc.php and run makestub.php to generate the stubfile and instead they modified stub.h manually. This meant that there were a couple of mistakes in the stub which are fixed in this patch. In particular: * The title tag was not closed * The length of the stub was wrong in stub.h * This PR syncs previous changes to stub.h back to shortarc.php and vice versa. * Adds a note such that hopefully no mistakes against updating the stubs are made in the future (hopefully). * The makestub.php script was actually broken because the expected signature of the stub got changed in b874f1a73d37 * Verify that the phar stub is up-to-date in CI * Update stub again after master changes * size_t changes * Update test after stub changes (canonical casts) --------- Co-authored-by: Joe Watkins --- .../actions/verify-generated-files/action.yml | 1 + ext/phar/makestub.php | 9 +- ext/phar/shortarc.php | 2 +- ext/phar/stub.h | 14 ++-- .../tests/cache_list/copyonwrite11.phar.phpt | 2 +- ext/phar/tests/phar_commitwrite.phpt | 2 +- ext/phar/tests/phar_convert_repeated.phpt | 2 +- ext/phar/tests/phar_create_in_cwd.phpt | 2 +- ext/phar/tests/phar_createdefaultstub.phpt | 82 +++++++++++-------- ext/phar/tests/phar_offset_check.phpt | 4 +- ext/phar/tests/phar_setdefaultstub.phpt | 80 +++++++++++------- ext/phar/tests/tar/phar_convert_phar.phpt | 6 +- ext/phar/tests/tar/phar_convert_phar2.phpt | 6 +- ext/phar/tests/tar/phar_convert_phar3.phpt | 6 +- ext/phar/tests/tar/phar_convert_phar4.phpt | 6 +- ext/phar/tests/zip/phar_convert_phar.phpt | 6 +- 16 files changed, 136 insertions(+), 94 deletions(-) mode change 100644 => 100755 ext/phar/makestub.php diff --git a/.github/actions/verify-generated-files/action.yml b/.github/actions/verify-generated-files/action.yml index 5228105f25908..13f0cf9f128bb 100644 --- a/.github/actions/verify-generated-files/action.yml +++ b/.github/actions/verify-generated-files/action.yml @@ -12,5 +12,6 @@ runs: Zend/zend_vm_gen.php ext/tokenizer/tokenizer_data_gen.php build/gen_stub.php -f --generate-optimizer-info --verify + ext/phar/makestub.php # Use the -a flag for a bug in git 2.46.0, which doesn't consider changed -diff files. git add . -N && git diff -a --exit-code diff --git a/ext/phar/makestub.php b/ext/phar/makestub.php old mode 100644 new mode 100755 index 5808f4c38c9a0..34d270751bfb0 --- a/ext/phar/makestub.php +++ b/ext/phar/makestub.php @@ -1,3 +1,4 @@ +#!/usr/bin/env php $unused) { $stub .= ', newstub1_' . $i; diff --git a/ext/phar/shortarc.php b/ext/phar/shortarc.php index 0e88198a87a4f..c85e08439e761 100644 --- a/ext/phar/shortarc.php +++ b/ext/phar/shortarc.php @@ -74,7 +74,7 @@ $a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt); if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) { header('HTTP/1.0 404 Not Found'); - echo "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; + echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); diff --git a/ext/phar/stub.h b/ext/phar/stub.h index aa70e703b79b7..2c62e05900ace 100644 --- a/ext/phar/stub.h +++ b/ext/phar/stub.h @@ -16,16 +16,18 @@ +----------------------------------------------------------------------+ */ -static inline zend_string* phar_get_stub(const char *index_php, const char *web, const int name_len, const int web_len) +static inline zend_string *phar_get_stub(const char *index_php, const char *web, size_t name_len, size_t web_len) { + /* Do NOT modify this file directly! + * Instead modify shortarc.php to change PHP code or makestub.php to change C code and then use makestub.php to generate this file. */ static const char newstub0[] = " 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen("; - static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"\\n \\n File Not Found<title>\\n </head>\\n <body>\\n <h1>404 - File Not Found</h1>\\n </body>\\n</html>\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '"; + static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found\\n \\n \\n

404 - File Not Found

\\n \\n\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '"; static const char newstub2[] = "';\nconst LEN = "; - static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = fread($fp, 4));\n$m = '';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude self::START;\n}\n}\n\nstatic fun"; - static const char newstub3_1[] = "ction tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n $l = unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n $len = unpack('V', substr($m, $start, 4));\n$start += 4;\n $savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += $ret['m'][$savepath][2];\n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error \" . strlen($data) . \" != \" .\n$stat[7] . \")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32($data) & 0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif (file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}\n}\n}\n\n@rmdir($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__HALT_COMPILER(); ?>"; + static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = (string)fread($fp, 4));\n$m = '';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = (string)fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude self::START;\n}\n"; + static const char newstub3_1[] = "}\n\nstatic function tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n\n$l = unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n\n$len = unpack('V', substr($m, $start, 4));\n$start += 4;\n\n$savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n\n\n\n$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += $ret['m'][$savepath][2];\n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error \" . strlen($data) . \" != \" .\n$entry[0] . \")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32($data) & 0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif (file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}\n}\n}\n\n@rmdir($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__HALT_COMPILER(); ?>"; - static const int newstub_len = 6623; + static const size_t newstub_len = 6641; - return strpprintf(name_len + web_len + newstub_len, "%s%s%s%s%s%s%d%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1); + return strpprintf(name_len + web_len + newstub_len, "%s%s%s%s%s%s%zu%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1); } diff --git a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt index a52b8e5fed3f5..d51135894494f 100644 --- a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt @@ -18,5 +18,5 @@ echo strlen($p2->getStub()),"\n"; echo "ok\n"; __HALT_COMPILER(); ?> " -6643 +6661 ok diff --git a/ext/phar/tests/phar_commitwrite.phpt b/ext/phar/tests/phar_commitwrite.phpt index 80c35cb784364..951506aff0f00 100644 --- a/ext/phar/tests/phar_commitwrite.phpt +++ b/ext/phar/tests/phar_commitwrite.phpt @@ -27,7 +27,7 @@ unlink(__DIR__ . '/phar_commitwrite.phar'); __HALT_COMPILER(); ?> --EXPECTF-- -int(6641) +int(6659) string(%d) " --EXPECTF-- -int(6641) +int(6659) string(%d) "getMessage() . "\n"; } ?> --EXPECT-- -string(6641) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -143,13 +143,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'index.php'; -const LEN = 6643; +const LEN = 6661; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -157,7 +157,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -248,7 +248,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -256,11 +257,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -294,7 +300,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -327,7 +333,7 @@ Extract_Phar::go(); __HALT_COMPILER(); ?>" ============================================================================ ============================================================================ -string(6652) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -437,13 +443,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'my/custom/thingy.php'; -const LEN = 6654; +const LEN = 6672; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -451,7 +457,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -542,7 +548,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -550,11 +557,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -588,7 +600,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -621,7 +633,7 @@ Extract_Phar::go(); __HALT_COMPILER(); ?>" ============================================================================ ============================================================================ -int(7032) +int(7050) ============================================================================ ============================================================================ Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed @@ -629,7 +641,7 @@ Illegal filename passed in for stub creation, was 401 characters long, and only ============================================================================ ============================================================================ ============================================================================ -string(6654) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -739,13 +751,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'my/custom/thingy.php'; -const LEN = 6656; +const LEN = 6674; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -753,7 +765,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -844,7 +856,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -852,11 +865,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -890,7 +908,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -923,5 +941,5 @@ Extract_Phar::go(); __HALT_COMPILER(); ?>" ============================================================================ ============================================================================ -int(7032) +int(7050) Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed diff --git a/ext/phar/tests/phar_offset_check.phpt b/ext/phar/tests/phar_offset_check.phpt index c1a8d201c8bc7..5a039d2d89346 100644 --- a/ext/phar/tests/phar_offset_check.phpt +++ b/ext/phar/tests/phar_offset_check.phpt @@ -68,8 +68,8 @@ var_dump($phar->getAlias()); Entry .phar/stub.php does not exist Entry .phar/alias.txt does not exist Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub -int(6643) -int(6643) +int(6661) +int(6661) Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias string(5) "susan" string(5) "susan" diff --git a/ext/phar/tests/phar_setdefaultstub.phpt b/ext/phar/tests/phar_setdefaultstub.phpt index c5db64a308e6f..ea05a03bc1a7f 100644 --- a/ext/phar/tests/phar_setdefaultstub.phpt +++ b/ext/phar/tests/phar_setdefaultstub.phpt @@ -53,7 +53,7 @@ try { unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> --EXPECT-- -string(6643) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -163,13 +163,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'index.php'; -const LEN = 6643; +const LEN = 6661; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -177,7 +177,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -268,7 +268,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -276,11 +277,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -314,7 +320,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -348,7 +354,7 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -string(6654) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -458,13 +464,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'my/custom/thingy.php'; -const LEN = 6654; +const LEN = 6672; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -472,7 +478,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -563,7 +569,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -571,11 +578,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -609,7 +621,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -643,7 +655,7 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -string(6656) "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>"; +echo "<html>\n <head>\n <title>File Not Found\n \n \n

404 - File Not Found

\n \n"; exit; } $b = pathinfo($a); @@ -753,13 +765,13 @@ const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'my/custom/thingy.php'; -const LEN = 6656; +const LEN = 6674; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); -$L = unpack('V', $a = fread($fp, 4)); +$L = unpack('V', $a = (string)fread($fp, 4)); $m = ''; do { @@ -767,7 +779,7 @@ $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } -$last = fread($fp, $read); +$last = (string)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); @@ -858,7 +870,8 @@ return realpath('/tmp'); static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); + +$l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; @@ -866,11 +879,16 @@ $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); + +$len = unpack('V', substr($m, $start, 4)); $start += 4; - $savepath = substr($m, $start, $len[1]); + +$savepath = substr($m, $start, $len[1]); $start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); + + + +$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; @@ -904,7 +922,7 @@ $data = bzdecompress($data); if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); +$entry[0] . ")"); } if ($entry[3] != sprintf("%u", crc32($data) & 0xffffffff)) { @@ -938,5 +956,5 @@ __HALT_COMPILER(); ?> " ============================================================================ ============================================================================ -int(7034) +int(7052) Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed diff --git a/ext/phar/tests/tar/phar_convert_phar.phpt b/ext/phar/tests/tar/phar_convert_phar.phpt index c25ed7c556bf7..3247550431d44 100644 --- a/ext/phar/tests/tar/phar_convert_phar.phpt +++ b/ext/phar/tests/tar/phar_convert_phar.phpt @@ -45,11 +45,11 @@ __HALT_COMPILER(); ?> --EXPECT-- bool(false) -int(6641) +int(6659) bool(true) string(60) " --EXPECT-- bool(false) -int(6641) +int(6659) bool(true) string(60) " --EXPECT-- bool(false) -int(6641) +int(6659) bool(true) string(60) " --EXPECT-- bool(false) -int(6641) +int(6659) string(2) "hi" bool(true) string(60) " --EXPECT-- bool(false) -int(6641) +int(6659) bool(true) string(60) " Date: Tue, 30 Sep 2025 15:22:41 +0100 Subject: [PATCH 117/386] Zend/Optimizer: Use type uint32_t instead of int for _zend_call_info.num_args --- Zend/Optimizer/sccp.c | 6 ++---- Zend/Optimizer/zend_call_graph.c | 3 +-- Zend/Optimizer/zend_call_graph.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 587559c64bf37..5ac864c38bf3a 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -1650,7 +1650,6 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o { zend_call_info *call; zval *name, *args[3] = {NULL}; - int i; if (!ctx->call_map) { SET_RESULT_BOT(result); @@ -1672,7 +1671,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o break; } - for (i = 0; i < call->num_args; i++) { + for (uint32_t i = 0; i < call->num_args; i++) { zend_op *opline = call->arg_info[i].opline; if (opline->opcode != ZEND_SEND_VAL && opline->opcode != ZEND_SEND_VAR) { SET_RESULT_BOT(result); @@ -2088,7 +2087,6 @@ static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op) zend_ssa *ssa = ctx->scdf.ssa; zend_op_array *op_array = ctx->scdf.op_array; zend_call_info *call; - int i; ZEND_ASSERT(ctx->call_map); call = ctx->call_map[opline - op_array->opcodes]; @@ -2098,7 +2096,7 @@ static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op) zend_ssa_remove_instr(ssa, call->caller_init_opline, &ssa->ops[call->caller_init_opline - op_array->opcodes]); - for (i = 0; i < call->num_args; i++) { + for (uint32_t i = 0; i < call->num_args; i++) { zend_ssa_remove_instr(ssa, call->arg_info[i].opline, &ssa->ops[call->arg_info[i].opline - op_array->opcodes]); } diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index 80e4accb2777b..e76805ca6f6cc 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -272,13 +272,12 @@ ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info map = zend_arena_calloc(arena, sizeof(zend_call_info *), op_array->last); for (call = info->callee_info; call; call = call->next_callee) { - int i; map[call->caller_init_opline - op_array->opcodes] = call; if (call->caller_call_opline) { map[call->caller_call_opline - op_array->opcodes] = call; } if (!call->is_frameless) { - for (i = 0; i < call->num_args; i++) { + for (uint32_t i = 0; i < call->num_args; i++) { if (call->arg_info[i].opline) { map[call->arg_info[i].opline - op_array->opcodes] = call; } diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index b2cbb6822bcf3..f82cd180df233 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -39,7 +39,7 @@ struct _zend_call_info { bool named_args; /* Function has named arguments */ bool is_prototype; /* An overridden child method may be called */ bool is_frameless; /* A frameless function sends arguments through operands */ - int num_args; /* Number of arguments, excluding named and variadic arguments */ + uint32_t num_args; /* Number of arguments, excluding named and variadic arguments */ zend_send_arg_info arg_info[1]; }; From 3fbfc3335eb179d5ea22afa9c12b63c01b99a476 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:26:26 +0100 Subject: [PATCH 118/386] Zend/Optimizer: Propagate uint32_t type instead of int after field change The previous commit allows us to propagate the type change to various functions that return a value derived from _zend_call_info.num_args --- Zend/Optimizer/sccp.c | 12 ++++++------ Zend/Optimizer/zend_optimizer_internal.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 5ac864c38bf3a..f17c17e9bf06b 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -2120,11 +2120,11 @@ static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op) * we need to collect. * d) The ordinary DCE pass cannot collect construction of dead non-escaping arrays and objects. */ -static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var, zval *value) +static uint32_t try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var, zval *value) { zend_ssa *ssa = ctx->scdf.ssa; zend_op_array *op_array = ctx->scdf.op_array; - int removed_ops = 0; + uint32_t removed_ops = 0; if (var->definition >= 0) { zend_op *opline = &op_array->opcodes[var->definition]; @@ -2368,12 +2368,12 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var, /* This will try to replace uses of SSA variables we have determined to be constant. Not all uses * can be replaced, because some instructions don't accept constant operands or only accept them * if they have a certain type. */ -static int replace_constant_operands(sccp_ctx *ctx) { +static uint32_t replace_constant_operands(sccp_ctx *ctx) { zend_ssa *ssa = ctx->scdf.ssa; zend_op_array *op_array = ctx->scdf.op_array; int i; zval tmp; - int removed_ops = 0; + uint32_t removed_ops = 0; /* We iterate the variables backwards, so we can eliminate sequences like INIT_ROPE * and INIT_ARRAY. */ @@ -2466,10 +2466,10 @@ static void sccp_context_free(sccp_ctx *sccp) { } } -int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map) +uint32_t sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map) { sccp_ctx sccp; - int removed_ops = 0; + uint32_t removed_ops = 0; void *checkpoint = zend_arena_checkpoint(ctx->arena); sccp_context_init(ctx, &sccp, ssa, op_array, call_map); diff --git a/Zend/Optimizer/zend_optimizer_internal.h b/Zend/Optimizer/zend_optimizer_internal.h index 9c238690932ef..4bc2543457e29 100644 --- a/Zend/Optimizer/zend_optimizer_internal.h +++ b/Zend/Optimizer/zend_optimizer_internal.h @@ -124,7 +124,7 @@ zend_function *zend_optimizer_get_called_func( uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args); void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline); void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist); -int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map); +uint32_t sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map); int dce_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *optimizer_ctx, zend_ssa *ssa, bool reorder_dtor_effects); zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa); From 1685b9caf453a3d78aad95be1f46f278b3f03b41 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:28:52 +0100 Subject: [PATCH 119/386] Zend/Optimizer: Use type uint32_t instead of int for zend_call_graph.op_arrays_count --- Zend/Optimizer/zend_call_graph.c | 7 ++----- Zend/Optimizer/zend_call_graph.h | 2 +- Zend/Optimizer/zend_optimizer.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index e76805ca6f6cc..c3b800ec56ca9 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -200,13 +200,12 @@ static void zend_analyze_recursion(zend_call_graph *call_graph) zend_op_array *op_array; zend_func_info *func_info; zend_call_info *call_info; - int i; int set_len = zend_bitset_len(call_graph->op_arrays_count); zend_bitset visited; ALLOCA_FLAG(use_heap); visited = ZEND_BITSET_ALLOCA(set_len, use_heap); - for (i = 0; i < call_graph->op_arrays_count; i++) { + for (uint32_t i = 0; i < call_graph->op_arrays_count; i++) { op_array = call_graph->op_arrays[i]; func_info = call_graph->func_infos + i; call_info = func_info->caller_info; @@ -252,9 +251,7 @@ ZEND_API void zend_build_call_graph(zend_arena **arena, zend_script *script, zen ZEND_API void zend_analyze_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph) /* {{{ */ { - int i; - - for (i = 0; i < call_graph->op_arrays_count; i++) { + for (uint32_t i = 0; i < call_graph->op_arrays_count; i++) { zend_analyze_calls(arena, script, 0, call_graph->op_arrays[i], call_graph->func_infos + i); } zend_analyze_recursion(call_graph); diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index f82cd180df233..ae41d8067d08f 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -54,7 +54,7 @@ struct _zend_func_info { }; typedef struct _zend_call_graph { - int op_arrays_count; + uint32_t op_arrays_count; zend_op_array **op_arrays; zend_func_info *func_infos; } zend_call_graph; diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 5d18fc6015854..0a05992544203 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -1609,7 +1609,7 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l zend_call_graph call_graph; zend_build_call_graph(&ctx.arena, script, &call_graph); - int i; + uint32_t i; zend_func_info *func_info; for (i = 0; i < call_graph.op_arrays_count; i++) { From 18c5cd1fcd855b25a85201cb08f3e8e2fb72dd85 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:33:38 +0100 Subject: [PATCH 120/386] Zend/Optimizer: Use type uint32_t instead of int for _zend_func_info.num --- Zend/Optimizer/zend_call_graph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index ae41d8067d08f..4985b84447eb8 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -44,7 +44,7 @@ struct _zend_call_info { }; struct _zend_func_info { - int num; + uint32_t num; uint32_t flags; zend_ssa ssa; /* Static Single Assignment Form */ zend_call_info *caller_info; /* where this function is called from */ From 0d95b57542466c36c9954a1740087131986566e4 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:35:34 +0100 Subject: [PATCH 121/386] Zend/Optimizer/zend_call_graph.c: Use type uint32_t instead of int for variable storing result of zend_bitset_len() --- Zend/Optimizer/zend_call_graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index c3b800ec56ca9..b89ade0a20a81 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -200,7 +200,7 @@ static void zend_analyze_recursion(zend_call_graph *call_graph) zend_op_array *op_array; zend_func_info *func_info; zend_call_info *call_info; - int set_len = zend_bitset_len(call_graph->op_arrays_count); + uint32_t set_len = zend_bitset_len(call_graph->op_arrays_count); zend_bitset visited; ALLOCA_FLAG(use_heap); From 33b2e9566657c10ed6c0f54d28df0823dfa67e4d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 15:48:58 +0100 Subject: [PATCH 122/386] Zend/Optimizer/zend_call_graph: add some const qualifiers --- Zend/Optimizer/zend_call_graph.c | 8 ++++---- Zend/Optimizer/zend_call_graph.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index b89ade0a20a81..645edd2f99914 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -169,9 +169,9 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 free_alloca(call_stack, use_heap); } -static bool zend_is_indirectly_recursive(zend_op_array *root, zend_op_array *op_array, zend_bitset visited) +static bool zend_is_indirectly_recursive(const zend_op_array *root, const zend_op_array *op_array, zend_bitset visited) { - zend_func_info *func_info; + const zend_func_info *func_info; zend_call_info *call_info; bool ret = false; @@ -197,7 +197,7 @@ static bool zend_is_indirectly_recursive(zend_op_array *root, zend_op_array *op_ static void zend_analyze_recursion(zend_call_graph *call_graph) { - zend_op_array *op_array; + const zend_op_array *op_array; zend_func_info *func_info; zend_call_info *call_info; uint32_t set_len = zend_bitset_len(call_graph->op_arrays_count); @@ -259,7 +259,7 @@ ZEND_API void zend_analyze_call_graph(zend_arena **arena, zend_script *script, z } /* }}} */ -ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info *info, const zend_op_array *op_array) /* {{{ */ +ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, const zend_func_info *info, const zend_op_array *op_array) /* {{{ */ { zend_call_info **map, *call; if (!info->callee_info) { diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index 4985b84447eb8..8810dc1a560e7 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -63,7 +63,7 @@ BEGIN_EXTERN_C() ZEND_API void zend_build_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph); ZEND_API void zend_analyze_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph); -ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info *info, const zend_op_array *op_array); +ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, const zend_func_info *info, const zend_op_array *op_array); ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32_t build_flags, zend_op_array *op_array, zend_func_info *func_info); END_EXTERN_C() From 7c917df438e1c9964503a684c0d4ce9af2eb9ea6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 30 Sep 2025 16:09:10 +0100 Subject: [PATCH 123/386] Zend/Optimizer/zend_cfg.h: add some comments about default values --- Zend/Optimizer/zend_cfg.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/Optimizer/zend_cfg.h b/Zend/Optimizer/zend_cfg.h index 93d455060686e..1f3885f511f5d 100644 --- a/Zend/Optimizer/zend_cfg.h +++ b/Zend/Optimizer/zend_cfg.h @@ -46,12 +46,12 @@ typedef struct _zend_basic_block { uint32_t len; /* number of opcodes */ int successors_count; /* number of successors */ int predecessors_count; /* number of predecessors */ - int predecessor_offset; /* offset of 1-st predecessor */ - int idom; /* immediate dominator block */ + int predecessor_offset; /* offset of 1-st predecessor, or -1 */ + int idom; /* immediate dominator block, or -1 */ int loop_header; /* closest loop header, or -1 */ - int level; /* steps away from the entry in the dom. tree */ - int children; /* list of dominated blocks */ - int next_child; /* next dominated block */ + int level; /* steps away from the entry in the dom. tree, or -1 */ + int children; /* list of dominated blocks, or -1 */ + int next_child; /* next dominated block, or -1 */ int successors_storage[2]; /* up to 2 successor blocks */ } zend_basic_block; From e68396cb399df9b785b6cdbaff23dc4e63d3280d Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 2 Oct 2025 19:20:49 +0200 Subject: [PATCH 124/386] Prevent use after stack scope in stream strerr code (#20040) --- main/streams/streams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index 379b93affde29..85d2947c28a6c 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -155,6 +155,7 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const { char *tmp; char *msg; + char errstr[256]; int free_msg = 0; if (EG(exception)) { @@ -204,7 +205,6 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const free_msg = 1; } else { if (wrapper == &php_plain_files_wrapper) { - char errstr[256]; msg = php_socket_strerror_s(errno, errstr, sizeof(errstr)); } else { msg = "operation failed"; From 57ce245e1ec4a375f206370a447b88ecd2fba07e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:00:20 +0200 Subject: [PATCH 125/386] Reduce code bloat in arginfo by using specialised string releases (#20016) * Reduce code bloat in arginfo by using specialised string releases Comparing this patch to master (c7da72857474ae5ac01f809b789cf1189e53c985), with a plain configure command without any options: ``` text data bss dec hex filename 20683738 1592400 137712 22413850 156021a sapi/cli/php 20688522 1592400 137712 22418634 15614ca sapi/cli/php_old ``` We see a minor reduction of 0.023% in code size. * Also use true for the other initialization line * Also use specialized code for consts --- Zend/zend_attributes_arginfo.h | 72 +- Zend/zend_builtin_functions_arginfo.h | 4 +- build/gen_stub.php | 10 +- ext/bcmath/bcmath_arginfo.h | 4 +- ext/curl/curl_arginfo.h | 4 +- ext/curl/curl_file_arginfo.h | 20 +- ext/date/php_date_arginfo.h | 184 +- ext/dl_test/dl_test_arginfo.h | 4 +- ext/dom/php_dom_arginfo.h | 744 ++--- ext/ffi/ffi_arginfo.h | 156 +- .../breakiterator/breakiterator_arginfo.h | 76 +- .../breakiterator_iterators_arginfo.h | 12 +- ext/intl/calendar/calendar_arginfo.h | 156 +- ext/intl/collator/collator_arginfo.h | 96 +- ext/intl/converter/converter_arginfo.h | 164 +- ext/intl/dateformat/dateformat_arginfo.h | 48 +- ext/intl/formatter/formatter_arginfo.h | 332 +- .../listformatter/listformatter_arginfo.h | 32 +- ext/intl/locale/locale_arginfo.h | 40 +- ext/intl/normalizer/normalizer_arginfo.h | 40 +- .../rangeformatter/rangeformatter_arginfo.h | 64 +- ext/intl/spoofchecker/spoofchecker_arginfo.h | 76 +- ext/intl/timezone/timezone_arginfo.h | 44 +- .../transliterator/transliterator_arginfo.h | 12 +- ext/intl/uchar/uchar_arginfo.h | 2664 ++++++++--------- ext/libxml/libxml_arginfo.h | 8 +- ext/mysqli/mysqli_arginfo.h | 156 +- ext/pdo/pdo_arginfo.h | 4 +- ext/pdo/pdo_dbh_arginfo.h | 296 +- ext/pdo/pdo_stmt_arginfo.h | 8 +- ext/pdo_dblib/pdo_dblib_arginfo.h | 28 +- ext/pdo_firebird/pdo_firebird_arginfo.h | 32 +- ext/pdo_mysql/pdo_mysql_arginfo.h | 76 +- ext/pdo_odbc/pdo_odbc_arginfo.h | 20 +- ext/pdo_pgsql/pdo_pgsql_arginfo.h | 28 +- ext/pdo_sqlite/pdo_sqlite_arginfo.h | 76 +- ext/phar/phar_object_arginfo.h | 64 +- ext/random/random_arginfo.h | 4 +- ext/reflection/php_reflection_arginfo.h | 112 +- ext/snmp/snmp_arginfo.h | 80 +- ext/soap/soap_arginfo.h | 224 +- ext/spl/spl_array_arginfo.h | 20 +- ext/spl/spl_directory_arginfo.h | 64 +- ext/spl/spl_dllist_arginfo.h | 16 +- ext/spl/spl_heap_arginfo.h | 12 +- ext/spl/spl_iterators_arginfo.h | 104 +- ext/spl/spl_observer_arginfo.h | 16 +- ext/sqlite3/sqlite3_arginfo.h | 160 +- ext/standard/basic_functions_arginfo.h | 4 +- ext/standard/dir_arginfo.h | 4 +- ext/standard/user_filters_arginfo.h | 28 +- ext/tidy/tidy_arginfo.h | 24 +- ext/tokenizer/tokenizer_arginfo.h | 12 +- ext/uri/php_uri_arginfo.h | 12 +- ext/xmlreader/php_xmlreader_arginfo.h | 136 +- ext/xsl/php_xsl_arginfo.h | 16 +- ext/zend_test/object_handlers_arginfo.h | 48 +- ext/zend_test/test_arginfo.h | 178 +- ext/zip/php_zip_arginfo.h | 464 +-- 59 files changed, 3796 insertions(+), 3796 deletions(-) diff --git a/Zend/zend_attributes_arginfo.h b/Zend/zend_attributes_arginfo.h index 05f7eeb3e5d45..ec8d8de4ee508 100644 --- a/Zend/zend_attributes_arginfo.h +++ b/Zend/zend_attributes_arginfo.h @@ -95,67 +95,67 @@ static zend_class_entry *register_class_Attribute(void) zval const_TARGET_CLASS_value; ZVAL_LONG(&const_TARGET_CLASS_value, ZEND_ATTRIBUTE_TARGET_CLASS); - zend_string *const_TARGET_CLASS_name = zend_string_init_interned("TARGET_CLASS", sizeof("TARGET_CLASS") - 1, 1); + zend_string *const_TARGET_CLASS_name = zend_string_init_interned("TARGET_CLASS", sizeof("TARGET_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_CLASS_name, &const_TARGET_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_CLASS_name); + zend_string_release_ex(const_TARGET_CLASS_name, true); zval const_TARGET_FUNCTION_value; ZVAL_LONG(&const_TARGET_FUNCTION_value, ZEND_ATTRIBUTE_TARGET_FUNCTION); - zend_string *const_TARGET_FUNCTION_name = zend_string_init_interned("TARGET_FUNCTION", sizeof("TARGET_FUNCTION") - 1, 1); + zend_string *const_TARGET_FUNCTION_name = zend_string_init_interned("TARGET_FUNCTION", sizeof("TARGET_FUNCTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_FUNCTION_name, &const_TARGET_FUNCTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_FUNCTION_name); + zend_string_release_ex(const_TARGET_FUNCTION_name, true); zval const_TARGET_METHOD_value; ZVAL_LONG(&const_TARGET_METHOD_value, ZEND_ATTRIBUTE_TARGET_METHOD); - zend_string *const_TARGET_METHOD_name = zend_string_init_interned("TARGET_METHOD", sizeof("TARGET_METHOD") - 1, 1); + zend_string *const_TARGET_METHOD_name = zend_string_init_interned("TARGET_METHOD", sizeof("TARGET_METHOD") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_METHOD_name, &const_TARGET_METHOD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_METHOD_name); + zend_string_release_ex(const_TARGET_METHOD_name, true); zval const_TARGET_PROPERTY_value; ZVAL_LONG(&const_TARGET_PROPERTY_value, ZEND_ATTRIBUTE_TARGET_PROPERTY); - zend_string *const_TARGET_PROPERTY_name = zend_string_init_interned("TARGET_PROPERTY", sizeof("TARGET_PROPERTY") - 1, 1); + zend_string *const_TARGET_PROPERTY_name = zend_string_init_interned("TARGET_PROPERTY", sizeof("TARGET_PROPERTY") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_PROPERTY_name, &const_TARGET_PROPERTY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_PROPERTY_name); + zend_string_release_ex(const_TARGET_PROPERTY_name, true); zval const_TARGET_CLASS_CONSTANT_value; ZVAL_LONG(&const_TARGET_CLASS_CONSTANT_value, ZEND_ATTRIBUTE_TARGET_CLASS_CONST); - zend_string *const_TARGET_CLASS_CONSTANT_name = zend_string_init_interned("TARGET_CLASS_CONSTANT", sizeof("TARGET_CLASS_CONSTANT") - 1, 1); + zend_string *const_TARGET_CLASS_CONSTANT_name = zend_string_init_interned("TARGET_CLASS_CONSTANT", sizeof("TARGET_CLASS_CONSTANT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_CLASS_CONSTANT_name, &const_TARGET_CLASS_CONSTANT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_CLASS_CONSTANT_name); + zend_string_release_ex(const_TARGET_CLASS_CONSTANT_name, true); zval const_TARGET_PARAMETER_value; ZVAL_LONG(&const_TARGET_PARAMETER_value, ZEND_ATTRIBUTE_TARGET_PARAMETER); - zend_string *const_TARGET_PARAMETER_name = zend_string_init_interned("TARGET_PARAMETER", sizeof("TARGET_PARAMETER") - 1, 1); + zend_string *const_TARGET_PARAMETER_name = zend_string_init_interned("TARGET_PARAMETER", sizeof("TARGET_PARAMETER") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_PARAMETER_name, &const_TARGET_PARAMETER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_PARAMETER_name); + zend_string_release_ex(const_TARGET_PARAMETER_name, true); zval const_TARGET_CONSTANT_value; ZVAL_LONG(&const_TARGET_CONSTANT_value, ZEND_ATTRIBUTE_TARGET_CONST); - zend_string *const_TARGET_CONSTANT_name = zend_string_init_interned("TARGET_CONSTANT", sizeof("TARGET_CONSTANT") - 1, 1); + zend_string *const_TARGET_CONSTANT_name = zend_string_init_interned("TARGET_CONSTANT", sizeof("TARGET_CONSTANT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_CONSTANT_name, &const_TARGET_CONSTANT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_CONSTANT_name); + zend_string_release_ex(const_TARGET_CONSTANT_name, true); zval const_TARGET_ALL_value; ZVAL_LONG(&const_TARGET_ALL_value, ZEND_ATTRIBUTE_TARGET_ALL); - zend_string *const_TARGET_ALL_name = zend_string_init_interned("TARGET_ALL", sizeof("TARGET_ALL") - 1, 1); + zend_string *const_TARGET_ALL_name = zend_string_init_interned("TARGET_ALL", sizeof("TARGET_ALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_TARGET_ALL_name, &const_TARGET_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TARGET_ALL_name); + zend_string_release_ex(const_TARGET_ALL_name, true); zval const_IS_REPEATABLE_value; ZVAL_LONG(&const_IS_REPEATABLE_value, ZEND_ATTRIBUTE_IS_REPEATABLE); - zend_string *const_IS_REPEATABLE_name = zend_string_init_interned("IS_REPEATABLE", sizeof("IS_REPEATABLE") - 1, 1); + zend_string *const_IS_REPEATABLE_name = zend_string_init_interned("IS_REPEATABLE", sizeof("IS_REPEATABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_REPEATABLE_name, &const_IS_REPEATABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_REPEATABLE_name); + zend_string_release_ex(const_IS_REPEATABLE_name, true); zval property_flags_default_value; ZVAL_UNDEF(&property_flags_default_value); - zend_string *property_flags_name = zend_string_init("flags", sizeof("flags") - 1, 1); + zend_string *property_flags_name = zend_string_init("flags", sizeof("flags") - 1, true); zend_declare_typed_property(class_entry, property_flags_name, &property_flags_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_flags_name); + zend_string_release_ex(property_flags_name, true); - zend_string *attribute_name_Attribute_class_Attribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_Attribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_Attribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_Attribute_0, 1); - zend_string_release(attribute_name_Attribute_class_Attribute_0); + zend_string_release_ex(attribute_name_Attribute_class_Attribute_0, true); ZVAL_LONG(&attribute_Attribute_class_Attribute_0->args[0].value, ZEND_ATTRIBUTE_TARGET_CLASS); return class_entry; @@ -168,9 +168,9 @@ static zend_class_entry *register_class_ReturnTypeWillChange(void) INIT_CLASS_ENTRY(ce, "ReturnTypeWillChange", class_ReturnTypeWillChange_methods); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL); - zend_string *attribute_name_Attribute_class_ReturnTypeWillChange_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ReturnTypeWillChange_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ReturnTypeWillChange_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ReturnTypeWillChange_0, 1); - zend_string_release(attribute_name_Attribute_class_ReturnTypeWillChange_0); + zend_string_release_ex(attribute_name_Attribute_class_ReturnTypeWillChange_0, true); ZVAL_LONG(&attribute_Attribute_class_ReturnTypeWillChange_0->args[0].value, ZEND_ATTRIBUTE_TARGET_METHOD); return class_entry; @@ -183,9 +183,9 @@ static zend_class_entry *register_class_AllowDynamicProperties(void) INIT_CLASS_ENTRY(ce, "AllowDynamicProperties", class_AllowDynamicProperties_methods); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL); - zend_string *attribute_name_Attribute_class_AllowDynamicProperties_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_AllowDynamicProperties_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_AllowDynamicProperties_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_AllowDynamicProperties_0, 1); - zend_string_release(attribute_name_Attribute_class_AllowDynamicProperties_0); + zend_string_release_ex(attribute_name_Attribute_class_AllowDynamicProperties_0, true); ZVAL_LONG(&attribute_Attribute_class_AllowDynamicProperties_0->args[0].value, ZEND_ATTRIBUTE_TARGET_CLASS); return class_entry; @@ -198,9 +198,9 @@ static zend_class_entry *register_class_SensitiveParameter(void) INIT_CLASS_ENTRY(ce, "SensitiveParameter", class_SensitiveParameter_methods); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES); - zend_string *attribute_name_Attribute_class_SensitiveParameter_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_SensitiveParameter_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_SensitiveParameter_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_SensitiveParameter_0, 1); - zend_string_release(attribute_name_Attribute_class_SensitiveParameter_0); + zend_string_release_ex(attribute_name_Attribute_class_SensitiveParameter_0, true); ZVAL_LONG(&attribute_Attribute_class_SensitiveParameter_0->args[0].value, ZEND_ATTRIBUTE_TARGET_PARAMETER); return class_entry; @@ -227,9 +227,9 @@ static zend_class_entry *register_class_Override(void) INIT_CLASS_ENTRY(ce, "Override", class_Override_methods); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES); - zend_string *attribute_name_Attribute_class_Override_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_Override_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_Override_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_Override_0, 1); - zend_string_release(attribute_name_Attribute_class_Override_0); + zend_string_release_ex(attribute_name_Attribute_class_Override_0, true); ZVAL_LONG(&attribute_Attribute_class_Override_0->args[0].value, ZEND_ATTRIBUTE_TARGET_METHOD | ZEND_ATTRIBUTE_TARGET_PROPERTY); return class_entry; @@ -250,9 +250,9 @@ static zend_class_entry *register_class_Deprecated(void) ZVAL_UNDEF(&property_since_default_value); zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_SINCE), &property_since_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string *attribute_name_Attribute_class_Deprecated_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_Deprecated_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_Deprecated_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_Deprecated_0, 1); - zend_string_release(attribute_name_Attribute_class_Deprecated_0); + zend_string_release_ex(attribute_name_Attribute_class_Deprecated_0, true); ZVAL_LONG(&attribute_Attribute_class_Deprecated_0->args[0].value, ZEND_ATTRIBUTE_TARGET_METHOD | ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_CLASS_CONST | ZEND_ATTRIBUTE_TARGET_CONST | ZEND_ATTRIBUTE_TARGET_CLASS); return class_entry; @@ -269,9 +269,9 @@ static zend_class_entry *register_class_NoDiscard(void) ZVAL_UNDEF(&property_message_default_value); zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_MESSAGE), &property_message_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string *attribute_name_Attribute_class_NoDiscard_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_NoDiscard_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_NoDiscard_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_NoDiscard_0, 1); - zend_string_release(attribute_name_Attribute_class_NoDiscard_0); + zend_string_release_ex(attribute_name_Attribute_class_NoDiscard_0, true); ZVAL_LONG(&attribute_Attribute_class_NoDiscard_0->args[0].value, ZEND_ATTRIBUTE_TARGET_METHOD | ZEND_ATTRIBUTE_TARGET_FUNCTION); return class_entry; @@ -284,9 +284,9 @@ static zend_class_entry *register_class_DelayedTargetValidation(void) INIT_CLASS_ENTRY(ce, "DelayedTargetValidation", NULL); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES); - zend_string *attribute_name_Attribute_class_DelayedTargetValidation_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_DelayedTargetValidation_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_DelayedTargetValidation_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_DelayedTargetValidation_0, 1); - zend_string_release(attribute_name_Attribute_class_DelayedTargetValidation_0); + zend_string_release_ex(attribute_name_Attribute_class_DelayedTargetValidation_0, true); ZVAL_LONG(&attribute_Attribute_class_DelayedTargetValidation_0->args[0].value, ZEND_ATTRIBUTE_TARGET_ALL); return class_entry; diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index cf349b551ac21..17484eb03f253 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -387,9 +387,9 @@ static zend_class_entry *register_class_stdClass(void) INIT_CLASS_ENTRY(ce, "stdClass", NULL); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES); - zend_string *attribute_name_AllowDynamicProperties_class_stdClass_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); + zend_string *attribute_name_AllowDynamicProperties_class_stdClass_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, true); zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class_stdClass_0, 0); - zend_string_release(attribute_name_AllowDynamicProperties_class_stdClass_0); + zend_string_release_ex(attribute_name_AllowDynamicProperties_class_stdClass_0, true); return class_entry; } diff --git a/build/gen_stub.php b/build/gen_stub.php index 8495f3612ce54..acee1e6ca0981 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2801,7 +2801,7 @@ private function getClassConstDeclaration(EvaluatedValue $value, array $allConst $code = "\n" . $zvalCode; - $code .= "\tzend_string *const_{$constName}_name = zend_string_init_interned(\"$constName\", sizeof(\"$constName\") - 1, 1);\n"; + $code .= "\tzend_string *const_{$constName}_name = zend_string_init_interned(\"$constName\", sizeof(\"$constName\") - 1, true);\n"; $nameCode = "const_{$constName}_name"; if ($this->exposedDocComment) { @@ -2855,7 +2855,7 @@ private function getClassConstDeclaration(EvaluatedValue $value, array $allConst $code .= "#endif\n"; } - $code .= "\tzend_string_release(const_{$constName}_name);\n"; + $code .= "\tzend_string_release_ex(const_{$constName}_name, true);\n"; return $code; } @@ -3058,13 +3058,13 @@ public static function getString( // Generally strings will not be known $initFn = $interned ? 'zend_string_init_interned' : 'zend_string_init'; $result = [ - "\tzend_string *$varName = $initFn(\"$content\", sizeof(\"$content\") - 1, 1);\n", + "\tzend_string *$varName = $initFn(\"$content\", sizeof(\"$content\") - 1, true);\n", $varName, - "\tzend_string_release($varName);\n" + "\tzend_string_release_ex($varName, true);\n" ]; // For attribute values that are not freed if ($varName === '') { - $result[0] = "$initFn(\"$content\", sizeof(\"$content\") - 1, 1);\n"; + $result[0] = "$initFn(\"$content\", sizeof(\"$content\") - 1, true);\n"; } // If not set, use the current latest version $allVersions = ALL_PHP_VERSION_IDS; diff --git a/ext/bcmath/bcmath_arginfo.h b/ext/bcmath/bcmath_arginfo.h index 9edfd5cd65760..15325603f211e 100644 --- a/ext/bcmath/bcmath_arginfo.h +++ b/ext/bcmath/bcmath_arginfo.h @@ -208,9 +208,9 @@ static zend_class_entry *register_class_BcMath_Number(zend_class_entry *class_en zval property_scale_default_value; ZVAL_UNDEF(&property_scale_default_value); - zend_string *property_scale_name = zend_string_init("scale", sizeof("scale") - 1, 1); + zend_string *property_scale_name = zend_string_init("scale", sizeof("scale") - 1, true); zend_declare_typed_property(class_entry, property_scale_name, &property_scale_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_scale_name); + zend_string_release_ex(property_scale_name, true); return class_entry; } diff --git a/ext/curl/curl_arginfo.h b/ext/curl/curl_arginfo.h index b511ff077de9d..7e4a5789d599a 100644 --- a/ext/curl/curl_arginfo.h +++ b/ext/curl/curl_arginfo.h @@ -1046,9 +1046,9 @@ static zend_class_entry *register_class_CurlSharePersistentHandle(void) zval property_options_default_value; ZVAL_UNDEF(&property_options_default_value); - zend_string *property_options_name = zend_string_init("options", sizeof("options") - 1, 1); + zend_string *property_options_name = zend_string_init("options", sizeof("options") - 1, true); zend_declare_typed_property(class_entry, property_options_name, &property_options_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property_options_name); + zend_string_release_ex(property_options_name, true); return class_entry; } diff --git a/ext/curl/curl_file_arginfo.h b/ext/curl/curl_file_arginfo.h index e409c6e772513..9ddd1f39d8986 100644 --- a/ext/curl/curl_file_arginfo.h +++ b/ext/curl/curl_file_arginfo.h @@ -64,15 +64,15 @@ static zend_class_entry *register_class_CURLFile(void) zval property_mime_default_value; ZVAL_EMPTY_STRING(&property_mime_default_value); - zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, 1); + zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, true); zend_declare_typed_property(class_entry, property_mime_name, &property_mime_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_mime_name); + zend_string_release_ex(property_mime_name, true); zval property_postname_default_value; ZVAL_EMPTY_STRING(&property_postname_default_value); - zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, 1); + zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, true); zend_declare_typed_property(class_entry, property_postname_name, &property_postname_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_postname_name); + zend_string_release_ex(property_postname_name, true); return class_entry; } @@ -86,21 +86,21 @@ static zend_class_entry *register_class_CURLStringFile(void) zval property_data_default_value; ZVAL_UNDEF(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); zval property_postname_default_value; ZVAL_UNDEF(&property_postname_default_value); - zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, 1); + zend_string *property_postname_name = zend_string_init("postname", sizeof("postname") - 1, true); zend_declare_typed_property(class_entry, property_postname_name, &property_postname_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_postname_name); + zend_string_release_ex(property_postname_name, true); zval property_mime_default_value; ZVAL_UNDEF(&property_mime_default_value); - zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, 1); + zend_string *property_mime_name = zend_string_init("mime", sizeof("mime") - 1, true); zend_declare_typed_property(class_entry, property_mime_name, &property_mime_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_mime_name); + zend_string_release_ex(property_mime_name, true); return class_entry; } diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h index 873103d8ff90b..74541e13a5c19 100644 --- a/ext/date/php_date_arginfo.h +++ b/ext/date/php_date_arginfo.h @@ -876,100 +876,100 @@ static zend_class_entry *register_class_DateTimeInterface(void) zval const_ATOM_value; zend_string *const_ATOM_value_str = zend_string_init(DATE_FORMAT_RFC3339, strlen(DATE_FORMAT_RFC3339), 1); ZVAL_STR(&const_ATOM_value, const_ATOM_value_str); - zend_string *const_ATOM_name = zend_string_init_interned("ATOM", sizeof("ATOM") - 1, 1); + zend_string *const_ATOM_name = zend_string_init_interned("ATOM", sizeof("ATOM") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATOM_name, &const_ATOM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_ATOM_name); + zend_string_release_ex(const_ATOM_name, true); zval const_COOKIE_value; zend_string *const_COOKIE_value_str = zend_string_init(DATE_FORMAT_COOKIE, strlen(DATE_FORMAT_COOKIE), 1); ZVAL_STR(&const_COOKIE_value, const_COOKIE_value_str); - zend_string *const_COOKIE_name = zend_string_init_interned("COOKIE", sizeof("COOKIE") - 1, 1); + zend_string *const_COOKIE_name = zend_string_init_interned("COOKIE", sizeof("COOKIE") - 1, true); zend_declare_typed_class_constant(class_entry, const_COOKIE_name, &const_COOKIE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_COOKIE_name); + zend_string_release_ex(const_COOKIE_name, true); zval const_ISO8601_value; zend_string *const_ISO8601_value_str = zend_string_init(DATE_FORMAT_ISO8601, strlen(DATE_FORMAT_ISO8601), 1); ZVAL_STR(&const_ISO8601_value, const_ISO8601_value_str); - zend_string *const_ISO8601_name = zend_string_init_interned("ISO8601", sizeof("ISO8601") - 1, 1); + zend_string *const_ISO8601_name = zend_string_init_interned("ISO8601", sizeof("ISO8601") - 1, true); zend_declare_typed_class_constant(class_entry, const_ISO8601_name, &const_ISO8601_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_ISO8601_name); + zend_string_release_ex(const_ISO8601_name, true); zval const_ISO8601_EXPANDED_value; zend_string *const_ISO8601_EXPANDED_value_str = zend_string_init(DATE_FORMAT_ISO8601_EXPANDED, strlen(DATE_FORMAT_ISO8601_EXPANDED), 1); ZVAL_STR(&const_ISO8601_EXPANDED_value, const_ISO8601_EXPANDED_value_str); - zend_string *const_ISO8601_EXPANDED_name = zend_string_init_interned("ISO8601_EXPANDED", sizeof("ISO8601_EXPANDED") - 1, 1); + zend_string *const_ISO8601_EXPANDED_name = zend_string_init_interned("ISO8601_EXPANDED", sizeof("ISO8601_EXPANDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ISO8601_EXPANDED_name, &const_ISO8601_EXPANDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_ISO8601_EXPANDED_name); + zend_string_release_ex(const_ISO8601_EXPANDED_name, true); zval const_RFC822_value; zend_string *const_RFC822_value_str = zend_string_init(DATE_FORMAT_RFC822, strlen(DATE_FORMAT_RFC822), 1); ZVAL_STR(&const_RFC822_value, const_RFC822_value_str); - zend_string *const_RFC822_name = zend_string_init_interned("RFC822", sizeof("RFC822") - 1, 1); + zend_string *const_RFC822_name = zend_string_init_interned("RFC822", sizeof("RFC822") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC822_name, &const_RFC822_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC822_name); + zend_string_release_ex(const_RFC822_name, true); zval const_RFC850_value; zend_string *const_RFC850_value_str = zend_string_init(DATE_FORMAT_RFC850, strlen(DATE_FORMAT_RFC850), 1); ZVAL_STR(&const_RFC850_value, const_RFC850_value_str); - zend_string *const_RFC850_name = zend_string_init_interned("RFC850", sizeof("RFC850") - 1, 1); + zend_string *const_RFC850_name = zend_string_init_interned("RFC850", sizeof("RFC850") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC850_name, &const_RFC850_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC850_name); + zend_string_release_ex(const_RFC850_name, true); zval const_RFC1036_value; zend_string *const_RFC1036_value_str = zend_string_init(DATE_FORMAT_RFC1036, strlen(DATE_FORMAT_RFC1036), 1); ZVAL_STR(&const_RFC1036_value, const_RFC1036_value_str); - zend_string *const_RFC1036_name = zend_string_init_interned("RFC1036", sizeof("RFC1036") - 1, 1); + zend_string *const_RFC1036_name = zend_string_init_interned("RFC1036", sizeof("RFC1036") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC1036_name, &const_RFC1036_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC1036_name); + zend_string_release_ex(const_RFC1036_name, true); zval const_RFC1123_value; zend_string *const_RFC1123_value_str = zend_string_init(DATE_FORMAT_RFC1123, strlen(DATE_FORMAT_RFC1123), 1); ZVAL_STR(&const_RFC1123_value, const_RFC1123_value_str); - zend_string *const_RFC1123_name = zend_string_init_interned("RFC1123", sizeof("RFC1123") - 1, 1); + zend_string *const_RFC1123_name = zend_string_init_interned("RFC1123", sizeof("RFC1123") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC1123_name, &const_RFC1123_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC1123_name); + zend_string_release_ex(const_RFC1123_name, true); zval const_RFC7231_value; zend_string *const_RFC7231_value_str = zend_string_init(DATE_FORMAT_RFC7231, strlen(DATE_FORMAT_RFC7231), 1); ZVAL_STR(&const_RFC7231_value, const_RFC7231_value_str); - zend_string *const_RFC7231_name = zend_string_init_interned("RFC7231", sizeof("RFC7231") - 1, 1); + zend_string *const_RFC7231_name = zend_string_init_interned("RFC7231", sizeof("RFC7231") - 1, true); zend_class_constant *const_RFC7231 = zend_declare_typed_class_constant(class_entry, const_RFC7231_name, &const_RFC7231_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC7231_name); + zend_string_release_ex(const_RFC7231_name, true); zval const_RFC2822_value; zend_string *const_RFC2822_value_str = zend_string_init(DATE_FORMAT_RFC2822, strlen(DATE_FORMAT_RFC2822), 1); ZVAL_STR(&const_RFC2822_value, const_RFC2822_value_str); - zend_string *const_RFC2822_name = zend_string_init_interned("RFC2822", sizeof("RFC2822") - 1, 1); + zend_string *const_RFC2822_name = zend_string_init_interned("RFC2822", sizeof("RFC2822") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC2822_name, &const_RFC2822_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC2822_name); + zend_string_release_ex(const_RFC2822_name, true); zval const_RFC3339_value; zend_string *const_RFC3339_value_str = zend_string_init(DATE_FORMAT_RFC3339, strlen(DATE_FORMAT_RFC3339), 1); ZVAL_STR(&const_RFC3339_value, const_RFC3339_value_str); - zend_string *const_RFC3339_name = zend_string_init_interned("RFC3339", sizeof("RFC3339") - 1, 1); + zend_string *const_RFC3339_name = zend_string_init_interned("RFC3339", sizeof("RFC3339") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC3339_name, &const_RFC3339_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC3339_name); + zend_string_release_ex(const_RFC3339_name, true); zval const_RFC3339_EXTENDED_value; zend_string *const_RFC3339_EXTENDED_value_str = zend_string_init(DATE_FORMAT_RFC3339_EXTENDED, strlen(DATE_FORMAT_RFC3339_EXTENDED), 1); ZVAL_STR(&const_RFC3339_EXTENDED_value, const_RFC3339_EXTENDED_value_str); - zend_string *const_RFC3339_EXTENDED_name = zend_string_init_interned("RFC3339_EXTENDED", sizeof("RFC3339_EXTENDED") - 1, 1); + zend_string *const_RFC3339_EXTENDED_name = zend_string_init_interned("RFC3339_EXTENDED", sizeof("RFC3339_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_RFC3339_EXTENDED_name, &const_RFC3339_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RFC3339_EXTENDED_name); + zend_string_release_ex(const_RFC3339_EXTENDED_name, true); zval const_RSS_value; zend_string *const_RSS_value_str = zend_string_init(DATE_FORMAT_RFC1123, strlen(DATE_FORMAT_RFC1123), 1); ZVAL_STR(&const_RSS_value, const_RSS_value_str); - zend_string *const_RSS_name = zend_string_init_interned("RSS", sizeof("RSS") - 1, 1); + zend_string *const_RSS_name = zend_string_init_interned("RSS", sizeof("RSS") - 1, true); zend_declare_typed_class_constant(class_entry, const_RSS_name, &const_RSS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_RSS_name); + zend_string_release_ex(const_RSS_name, true); zval const_W3C_value; zend_string *const_W3C_value_str = zend_string_init(DATE_FORMAT_RFC3339, strlen(DATE_FORMAT_RFC3339), 1); ZVAL_STR(&const_W3C_value, const_W3C_value_str); - zend_string *const_W3C_name = zend_string_init_interned("W3C", sizeof("W3C") - 1, 1); + zend_string *const_W3C_name = zend_string_init_interned("W3C", sizeof("W3C") - 1, true); zend_declare_typed_class_constant(class_entry, const_W3C_name, &const_W3C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_W3C_name); + zend_string_release_ex(const_W3C_name, true); zend_attribute *attribute_Deprecated_const_RFC7231_0 = zend_add_class_constant_attribute(class_entry, const_RFC7231, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2); @@ -1025,65 +1025,65 @@ static zend_class_entry *register_class_DateTimeImmutable(zend_class_entry *clas ZVAL_STR(&attribute_Deprecated_func___wakeup_0->args[1].value, attribute_Deprecated_func___wakeup_0_arg1_str); attribute_Deprecated_func___wakeup_0->args[1].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_modify_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_modify_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_modify_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "modify", sizeof("modify") - 1), attribute_name_NoDiscard_func_modify_0, 1); - zend_string_release(attribute_name_NoDiscard_func_modify_0); + zend_string_release_ex(attribute_name_NoDiscard_func_modify_0, true); zend_string *attribute_NoDiscard_func_modify_0_arg0_str = zend_string_init("as DateTimeImmutable::modify() does not modify the object itself", strlen("as DateTimeImmutable::modify() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_modify_0->args[0].value, attribute_NoDiscard_func_modify_0_arg0_str); attribute_NoDiscard_func_modify_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_add_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_add_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_add_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "add", sizeof("add") - 1), attribute_name_NoDiscard_func_add_0, 1); - zend_string_release(attribute_name_NoDiscard_func_add_0); + zend_string_release_ex(attribute_name_NoDiscard_func_add_0, true); zend_string *attribute_NoDiscard_func_add_0_arg0_str = zend_string_init("as DateTimeImmutable::add() does not modify the object itself", strlen("as DateTimeImmutable::add() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_add_0->args[0].value, attribute_NoDiscard_func_add_0_arg0_str); attribute_NoDiscard_func_add_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_sub_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_sub_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_sub_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "sub", sizeof("sub") - 1), attribute_name_NoDiscard_func_sub_0, 1); - zend_string_release(attribute_name_NoDiscard_func_sub_0); + zend_string_release_ex(attribute_name_NoDiscard_func_sub_0, true); zend_string *attribute_NoDiscard_func_sub_0_arg0_str = zend_string_init("as DateTimeImmutable::sub() does not modify the object itself", strlen("as DateTimeImmutable::sub() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_sub_0->args[0].value, attribute_NoDiscard_func_sub_0_arg0_str); attribute_NoDiscard_func_sub_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_settimezone_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_settimezone_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_settimezone_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "settimezone", sizeof("settimezone") - 1), attribute_name_NoDiscard_func_settimezone_0, 1); - zend_string_release(attribute_name_NoDiscard_func_settimezone_0); + zend_string_release_ex(attribute_name_NoDiscard_func_settimezone_0, true); zend_string *attribute_NoDiscard_func_settimezone_0_arg0_str = zend_string_init("as DateTimeImmutable::setTimezone() does not modify the object itself", strlen("as DateTimeImmutable::setTimezone() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_settimezone_0->args[0].value, attribute_NoDiscard_func_settimezone_0_arg0_str); attribute_NoDiscard_func_settimezone_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_settime_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_settime_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_settime_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "settime", sizeof("settime") - 1), attribute_name_NoDiscard_func_settime_0, 1); - zend_string_release(attribute_name_NoDiscard_func_settime_0); + zend_string_release_ex(attribute_name_NoDiscard_func_settime_0, true); zend_string *attribute_NoDiscard_func_settime_0_arg0_str = zend_string_init("as DateTimeImmutable::setTime() does not modify the object itself", strlen("as DateTimeImmutable::setTime() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_settime_0->args[0].value, attribute_NoDiscard_func_settime_0_arg0_str); attribute_NoDiscard_func_settime_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_setdate_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_setdate_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_setdate_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setdate", sizeof("setdate") - 1), attribute_name_NoDiscard_func_setdate_0, 1); - zend_string_release(attribute_name_NoDiscard_func_setdate_0); + zend_string_release_ex(attribute_name_NoDiscard_func_setdate_0, true); zend_string *attribute_NoDiscard_func_setdate_0_arg0_str = zend_string_init("as DateTimeImmutable::setDate() does not modify the object itself", strlen("as DateTimeImmutable::setDate() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_setdate_0->args[0].value, attribute_NoDiscard_func_setdate_0_arg0_str); attribute_NoDiscard_func_setdate_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_setisodate_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_setisodate_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_setisodate_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setisodate", sizeof("setisodate") - 1), attribute_name_NoDiscard_func_setisodate_0, 1); - zend_string_release(attribute_name_NoDiscard_func_setisodate_0); + zend_string_release_ex(attribute_name_NoDiscard_func_setisodate_0, true); zend_string *attribute_NoDiscard_func_setisodate_0_arg0_str = zend_string_init("as DateTimeImmutable::setISODate() does not modify the object itself", strlen("as DateTimeImmutable::setISODate() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_setisodate_0->args[0].value, attribute_NoDiscard_func_setisodate_0_arg0_str); attribute_NoDiscard_func_setisodate_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_settimestamp_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_settimestamp_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_settimestamp_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "settimestamp", sizeof("settimestamp") - 1), attribute_name_NoDiscard_func_settimestamp_0, 1); - zend_string_release(attribute_name_NoDiscard_func_settimestamp_0); + zend_string_release_ex(attribute_name_NoDiscard_func_settimestamp_0, true); zend_string *attribute_NoDiscard_func_settimestamp_0_arg0_str = zend_string_init("as DateTimeImmutable::setTimestamp() does not modify the object itself", strlen("as DateTimeImmutable::setTimestamp() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_settimestamp_0->args[0].value, attribute_NoDiscard_func_settimestamp_0_arg0_str); attribute_NoDiscard_func_settimestamp_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_setmicrosecond_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_setmicrosecond_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_setmicrosecond_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "setmicrosecond", sizeof("setmicrosecond") - 1), attribute_name_NoDiscard_func_setmicrosecond_0, 1); - zend_string_release(attribute_name_NoDiscard_func_setmicrosecond_0); + zend_string_release_ex(attribute_name_NoDiscard_func_setmicrosecond_0, true); zend_string *attribute_NoDiscard_func_setmicrosecond_0_arg0_str = zend_string_init("as DateTimeImmutable::setMicrosecond() does not modify the object itself", strlen("as DateTimeImmutable::setMicrosecond() does not modify the object itself"), 1); ZVAL_STR(&attribute_NoDiscard_func_setmicrosecond_0->args[0].value, attribute_NoDiscard_func_setmicrosecond_0_arg0_str); attribute_NoDiscard_func_setmicrosecond_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); @@ -1100,87 +1100,87 @@ static zend_class_entry *register_class_DateTimeZone(void) zval const_AFRICA_value; ZVAL_LONG(&const_AFRICA_value, PHP_DATE_TIMEZONE_GROUP_AFRICA); - zend_string *const_AFRICA_name = zend_string_init_interned("AFRICA", sizeof("AFRICA") - 1, 1); + zend_string *const_AFRICA_name = zend_string_init_interned("AFRICA", sizeof("AFRICA") - 1, true); zend_declare_typed_class_constant(class_entry, const_AFRICA_name, &const_AFRICA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AFRICA_name); + zend_string_release_ex(const_AFRICA_name, true); zval const_AMERICA_value; ZVAL_LONG(&const_AMERICA_value, PHP_DATE_TIMEZONE_GROUP_AMERICA); - zend_string *const_AMERICA_name = zend_string_init_interned("AMERICA", sizeof("AMERICA") - 1, 1); + zend_string *const_AMERICA_name = zend_string_init_interned("AMERICA", sizeof("AMERICA") - 1, true); zend_declare_typed_class_constant(class_entry, const_AMERICA_name, &const_AMERICA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AMERICA_name); + zend_string_release_ex(const_AMERICA_name, true); zval const_ANTARCTICA_value; ZVAL_LONG(&const_ANTARCTICA_value, PHP_DATE_TIMEZONE_GROUP_ANTARCTICA); - zend_string *const_ANTARCTICA_name = zend_string_init_interned("ANTARCTICA", sizeof("ANTARCTICA") - 1, 1); + zend_string *const_ANTARCTICA_name = zend_string_init_interned("ANTARCTICA", sizeof("ANTARCTICA") - 1, true); zend_declare_typed_class_constant(class_entry, const_ANTARCTICA_name, &const_ANTARCTICA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ANTARCTICA_name); + zend_string_release_ex(const_ANTARCTICA_name, true); zval const_ARCTIC_value; ZVAL_LONG(&const_ARCTIC_value, PHP_DATE_TIMEZONE_GROUP_ARCTIC); - zend_string *const_ARCTIC_name = zend_string_init_interned("ARCTIC", sizeof("ARCTIC") - 1, 1); + zend_string *const_ARCTIC_name = zend_string_init_interned("ARCTIC", sizeof("ARCTIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ARCTIC_name, &const_ARCTIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ARCTIC_name); + zend_string_release_ex(const_ARCTIC_name, true); zval const_ASIA_value; ZVAL_LONG(&const_ASIA_value, PHP_DATE_TIMEZONE_GROUP_ASIA); - zend_string *const_ASIA_name = zend_string_init_interned("ASIA", sizeof("ASIA") - 1, 1); + zend_string *const_ASIA_name = zend_string_init_interned("ASIA", sizeof("ASIA") - 1, true); zend_declare_typed_class_constant(class_entry, const_ASIA_name, &const_ASIA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ASIA_name); + zend_string_release_ex(const_ASIA_name, true); zval const_ATLANTIC_value; ZVAL_LONG(&const_ATLANTIC_value, PHP_DATE_TIMEZONE_GROUP_ATLANTIC); - zend_string *const_ATLANTIC_name = zend_string_init_interned("ATLANTIC", sizeof("ATLANTIC") - 1, 1); + zend_string *const_ATLANTIC_name = zend_string_init_interned("ATLANTIC", sizeof("ATLANTIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATLANTIC_name, &const_ATLANTIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATLANTIC_name); + zend_string_release_ex(const_ATLANTIC_name, true); zval const_AUSTRALIA_value; ZVAL_LONG(&const_AUSTRALIA_value, PHP_DATE_TIMEZONE_GROUP_AUSTRALIA); - zend_string *const_AUSTRALIA_name = zend_string_init_interned("AUSTRALIA", sizeof("AUSTRALIA") - 1, 1); + zend_string *const_AUSTRALIA_name = zend_string_init_interned("AUSTRALIA", sizeof("AUSTRALIA") - 1, true); zend_declare_typed_class_constant(class_entry, const_AUSTRALIA_name, &const_AUSTRALIA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AUSTRALIA_name); + zend_string_release_ex(const_AUSTRALIA_name, true); zval const_EUROPE_value; ZVAL_LONG(&const_EUROPE_value, PHP_DATE_TIMEZONE_GROUP_EUROPE); - zend_string *const_EUROPE_name = zend_string_init_interned("EUROPE", sizeof("EUROPE") - 1, 1); + zend_string *const_EUROPE_name = zend_string_init_interned("EUROPE", sizeof("EUROPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_EUROPE_name, &const_EUROPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EUROPE_name); + zend_string_release_ex(const_EUROPE_name, true); zval const_INDIAN_value; ZVAL_LONG(&const_INDIAN_value, PHP_DATE_TIMEZONE_GROUP_INDIAN); - zend_string *const_INDIAN_name = zend_string_init_interned("INDIAN", sizeof("INDIAN") - 1, 1); + zend_string *const_INDIAN_name = zend_string_init_interned("INDIAN", sizeof("INDIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_INDIAN_name, &const_INDIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INDIAN_name); + zend_string_release_ex(const_INDIAN_name, true); zval const_PACIFIC_value; ZVAL_LONG(&const_PACIFIC_value, PHP_DATE_TIMEZONE_GROUP_PACIFIC); - zend_string *const_PACIFIC_name = zend_string_init_interned("PACIFIC", sizeof("PACIFIC") - 1, 1); + zend_string *const_PACIFIC_name = zend_string_init_interned("PACIFIC", sizeof("PACIFIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_PACIFIC_name, &const_PACIFIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PACIFIC_name); + zend_string_release_ex(const_PACIFIC_name, true); zval const_UTC_value; ZVAL_LONG(&const_UTC_value, PHP_DATE_TIMEZONE_GROUP_UTC); - zend_string *const_UTC_name = zend_string_init_interned("UTC", sizeof("UTC") - 1, 1); + zend_string *const_UTC_name = zend_string_init_interned("UTC", sizeof("UTC") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTC_name, &const_UTC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTC_name); + zend_string_release_ex(const_UTC_name, true); zval const_ALL_value; ZVAL_LONG(&const_ALL_value, PHP_DATE_TIMEZONE_GROUP_ALL); - zend_string *const_ALL_name = zend_string_init_interned("ALL", sizeof("ALL") - 1, 1); + zend_string *const_ALL_name = zend_string_init_interned("ALL", sizeof("ALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ALL_name, &const_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ALL_name); + zend_string_release_ex(const_ALL_name, true); zval const_ALL_WITH_BC_value; ZVAL_LONG(&const_ALL_WITH_BC_value, PHP_DATE_TIMEZONE_GROUP_ALL_W_BC); - zend_string *const_ALL_WITH_BC_name = zend_string_init_interned("ALL_WITH_BC", sizeof("ALL_WITH_BC") - 1, 1); + zend_string *const_ALL_WITH_BC_name = zend_string_init_interned("ALL_WITH_BC", sizeof("ALL_WITH_BC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ALL_WITH_BC_name, &const_ALL_WITH_BC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ALL_WITH_BC_name); + zend_string_release_ex(const_ALL_WITH_BC_name, true); zval const_PER_COUNTRY_value; ZVAL_LONG(&const_PER_COUNTRY_value, PHP_DATE_TIMEZONE_PER_COUNTRY); - zend_string *const_PER_COUNTRY_name = zend_string_init_interned("PER_COUNTRY", sizeof("PER_COUNTRY") - 1, 1); + zend_string *const_PER_COUNTRY_name = zend_string_init_interned("PER_COUNTRY", sizeof("PER_COUNTRY") - 1, true); zend_declare_typed_class_constant(class_entry, const_PER_COUNTRY_name, &const_PER_COUNTRY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PER_COUNTRY_name); + zend_string_release_ex(const_PER_COUNTRY_name, true); zend_attribute *attribute_Deprecated_func___wakeup_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "__wakeup", sizeof("__wakeup") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2); @@ -1221,61 +1221,61 @@ static zend_class_entry *register_class_DatePeriod(zend_class_entry *class_entry zval const_EXCLUDE_START_DATE_value; ZVAL_LONG(&const_EXCLUDE_START_DATE_value, PHP_DATE_PERIOD_EXCLUDE_START_DATE); - zend_string *const_EXCLUDE_START_DATE_name = zend_string_init_interned("EXCLUDE_START_DATE", sizeof("EXCLUDE_START_DATE") - 1, 1); + zend_string *const_EXCLUDE_START_DATE_name = zend_string_init_interned("EXCLUDE_START_DATE", sizeof("EXCLUDE_START_DATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXCLUDE_START_DATE_name, &const_EXCLUDE_START_DATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXCLUDE_START_DATE_name); + zend_string_release_ex(const_EXCLUDE_START_DATE_name, true); zval const_INCLUDE_END_DATE_value; ZVAL_LONG(&const_INCLUDE_END_DATE_value, PHP_DATE_PERIOD_INCLUDE_END_DATE); - zend_string *const_INCLUDE_END_DATE_name = zend_string_init_interned("INCLUDE_END_DATE", sizeof("INCLUDE_END_DATE") - 1, 1); + zend_string *const_INCLUDE_END_DATE_name = zend_string_init_interned("INCLUDE_END_DATE", sizeof("INCLUDE_END_DATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_INCLUDE_END_DATE_name, &const_INCLUDE_END_DATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INCLUDE_END_DATE_name); + zend_string_release_ex(const_INCLUDE_END_DATE_name, true); zval property_start_default_value; ZVAL_UNDEF(&property_start_default_value); - zend_string *property_start_name = zend_string_init("start", sizeof("start") - 1, 1); + zend_string *property_start_name = zend_string_init("start", sizeof("start") - 1, true); zend_string *property_start_class_DateTimeInterface = zend_string_init("DateTimeInterface", sizeof("DateTimeInterface")-1, 1); zend_declare_typed_property(class_entry, property_start_name, &property_start_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_start_class_DateTimeInterface, 0, MAY_BE_NULL)); - zend_string_release(property_start_name); + zend_string_release_ex(property_start_name, true); zval property_current_default_value; ZVAL_UNDEF(&property_current_default_value); - zend_string *property_current_name = zend_string_init("current", sizeof("current") - 1, 1); + zend_string *property_current_name = zend_string_init("current", sizeof("current") - 1, true); zend_string *property_current_class_DateTimeInterface = zend_string_init("DateTimeInterface", sizeof("DateTimeInterface")-1, 1); zend_declare_typed_property(class_entry, property_current_name, &property_current_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_current_class_DateTimeInterface, 0, MAY_BE_NULL)); - zend_string_release(property_current_name); + zend_string_release_ex(property_current_name, true); zval property_end_default_value; ZVAL_UNDEF(&property_end_default_value); - zend_string *property_end_name = zend_string_init("end", sizeof("end") - 1, 1); + zend_string *property_end_name = zend_string_init("end", sizeof("end") - 1, true); zend_string *property_end_class_DateTimeInterface = zend_string_init("DateTimeInterface", sizeof("DateTimeInterface")-1, 1); zend_declare_typed_property(class_entry, property_end_name, &property_end_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_end_class_DateTimeInterface, 0, MAY_BE_NULL)); - zend_string_release(property_end_name); + zend_string_release_ex(property_end_name, true); zval property_interval_default_value; ZVAL_UNDEF(&property_interval_default_value); - zend_string *property_interval_name = zend_string_init("interval", sizeof("interval") - 1, 1); + zend_string *property_interval_name = zend_string_init("interval", sizeof("interval") - 1, true); zend_string *property_interval_class_DateInterval = zend_string_init("DateInterval", sizeof("DateInterval")-1, 1); zend_declare_typed_property(class_entry, property_interval_name, &property_interval_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_interval_class_DateInterval, 0, MAY_BE_NULL)); - zend_string_release(property_interval_name); + zend_string_release_ex(property_interval_name, true); zval property_recurrences_default_value; ZVAL_UNDEF(&property_recurrences_default_value); - zend_string *property_recurrences_name = zend_string_init("recurrences", sizeof("recurrences") - 1, 1); + zend_string *property_recurrences_name = zend_string_init("recurrences", sizeof("recurrences") - 1, true); zend_declare_typed_property(class_entry, property_recurrences_name, &property_recurrences_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_recurrences_name); + zend_string_release_ex(property_recurrences_name, true); zval property_include_start_date_default_value; ZVAL_UNDEF(&property_include_start_date_default_value); - zend_string *property_include_start_date_name = zend_string_init("include_start_date", sizeof("include_start_date") - 1, 1); + zend_string *property_include_start_date_name = zend_string_init("include_start_date", sizeof("include_start_date") - 1, true); zend_declare_typed_property(class_entry, property_include_start_date_name, &property_include_start_date_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_include_start_date_name); + zend_string_release_ex(property_include_start_date_name, true); zval property_include_end_date_default_value; ZVAL_UNDEF(&property_include_end_date_default_value); - zend_string *property_include_end_date_name = zend_string_init("include_end_date", sizeof("include_end_date") - 1, 1); + zend_string *property_include_end_date_name = zend_string_init("include_end_date", sizeof("include_end_date") - 1, true); zend_declare_typed_property(class_entry, property_include_end_date_name, &property_include_end_date_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_include_end_date_name); + zend_string_release_ex(property_include_end_date_name, true); zend_attribute *attribute_Deprecated_func___wakeup_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "__wakeup", sizeof("__wakeup") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2); diff --git a/ext/dl_test/dl_test_arginfo.h b/ext/dl_test/dl_test_arginfo.h index 588d0b1b6e6e1..0b246bd0df1ee 100644 --- a/ext/dl_test/dl_test_arginfo.h +++ b/ext/dl_test/dl_test_arginfo.h @@ -57,9 +57,9 @@ static zend_class_entry *register_class_DlTestSuperClass(void) zval property_a_default_value; ZVAL_UNDEF(&property_a_default_value); - zend_string *property_a_name = zend_string_init("a", sizeof("a") - 1, 1); + zend_string *property_a_name = zend_string_init("a", sizeof("a") - 1, true); zend_declare_typed_property(class_entry, property_a_name, &property_a_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_a_name); + zend_string_release_ex(property_a_name, true); return class_entry; } diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 0eddfd96469fe..9b2e467d1c6a9 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1902,35 +1902,35 @@ static zend_class_entry *register_class_DOMDocumentType(zend_class_entry *class_ zval property_entities_default_value; ZVAL_UNDEF(&property_entities_default_value); - zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, 1); + zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, true); zend_string *property_entities_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_DOMNamedNodeMap, 0, 0)); - zend_string_release(property_entities_name); + zend_string_release_ex(property_entities_name, true); zval property_notations_default_value; ZVAL_UNDEF(&property_notations_default_value); - zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, 1); + zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, true); zend_string *property_notations_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_DOMNamedNodeMap, 0, 0)); - zend_string_release(property_notations_name); + zend_string_release_ex(property_notations_name, true); zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); zval property_internalSubset_default_value; ZVAL_UNDEF(&property_internalSubset_default_value); - zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, 1); + zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, true); zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_internalSubset_name); + zend_string_release_ex(property_internalSubset_name, true); return class_entry; } @@ -1984,156 +1984,156 @@ static zend_class_entry *register_class_DOMNode(void) zval const_DOCUMENT_POSITION_DISCONNECTED_value; ZVAL_LONG(&const_DOCUMENT_POSITION_DISCONNECTED_value, 0x1); - zend_string *const_DOCUMENT_POSITION_DISCONNECTED_name = zend_string_init_interned("DOCUMENT_POSITION_DISCONNECTED", sizeof("DOCUMENT_POSITION_DISCONNECTED") - 1, 1); + zend_string *const_DOCUMENT_POSITION_DISCONNECTED_name = zend_string_init_interned("DOCUMENT_POSITION_DISCONNECTED", sizeof("DOCUMENT_POSITION_DISCONNECTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_DISCONNECTED_name, &const_DOCUMENT_POSITION_DISCONNECTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_DISCONNECTED_name); + zend_string_release_ex(const_DOCUMENT_POSITION_DISCONNECTED_name, true); zval const_DOCUMENT_POSITION_PRECEDING_value; ZVAL_LONG(&const_DOCUMENT_POSITION_PRECEDING_value, 0x2); - zend_string *const_DOCUMENT_POSITION_PRECEDING_name = zend_string_init_interned("DOCUMENT_POSITION_PRECEDING", sizeof("DOCUMENT_POSITION_PRECEDING") - 1, 1); + zend_string *const_DOCUMENT_POSITION_PRECEDING_name = zend_string_init_interned("DOCUMENT_POSITION_PRECEDING", sizeof("DOCUMENT_POSITION_PRECEDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_PRECEDING_name, &const_DOCUMENT_POSITION_PRECEDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_PRECEDING_name); + zend_string_release_ex(const_DOCUMENT_POSITION_PRECEDING_name, true); zval const_DOCUMENT_POSITION_FOLLOWING_value; ZVAL_LONG(&const_DOCUMENT_POSITION_FOLLOWING_value, 0x4); - zend_string *const_DOCUMENT_POSITION_FOLLOWING_name = zend_string_init_interned("DOCUMENT_POSITION_FOLLOWING", sizeof("DOCUMENT_POSITION_FOLLOWING") - 1, 1); + zend_string *const_DOCUMENT_POSITION_FOLLOWING_name = zend_string_init_interned("DOCUMENT_POSITION_FOLLOWING", sizeof("DOCUMENT_POSITION_FOLLOWING") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_FOLLOWING_name, &const_DOCUMENT_POSITION_FOLLOWING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_FOLLOWING_name); + zend_string_release_ex(const_DOCUMENT_POSITION_FOLLOWING_name, true); zval const_DOCUMENT_POSITION_CONTAINS_value; ZVAL_LONG(&const_DOCUMENT_POSITION_CONTAINS_value, 0x8); - zend_string *const_DOCUMENT_POSITION_CONTAINS_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINS", sizeof("DOCUMENT_POSITION_CONTAINS") - 1, 1); + zend_string *const_DOCUMENT_POSITION_CONTAINS_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINS", sizeof("DOCUMENT_POSITION_CONTAINS") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_CONTAINS_name, &const_DOCUMENT_POSITION_CONTAINS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_CONTAINS_name); + zend_string_release_ex(const_DOCUMENT_POSITION_CONTAINS_name, true); zval const_DOCUMENT_POSITION_CONTAINED_BY_value; ZVAL_LONG(&const_DOCUMENT_POSITION_CONTAINED_BY_value, 0x10); - zend_string *const_DOCUMENT_POSITION_CONTAINED_BY_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINED_BY", sizeof("DOCUMENT_POSITION_CONTAINED_BY") - 1, 1); + zend_string *const_DOCUMENT_POSITION_CONTAINED_BY_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINED_BY", sizeof("DOCUMENT_POSITION_CONTAINED_BY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_CONTAINED_BY_name, &const_DOCUMENT_POSITION_CONTAINED_BY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_CONTAINED_BY_name); + zend_string_release_ex(const_DOCUMENT_POSITION_CONTAINED_BY_name, true); zval const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value; ZVAL_LONG(&const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value, 0x20); - zend_string *const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name = zend_string_init_interned("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", sizeof("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC") - 1, 1); + zend_string *const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name = zend_string_init_interned("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", sizeof("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name, &const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name); + zend_string_release_ex(const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name, true); zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); - zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, 1); + zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_nodeName_name); + zend_string_release_ex(property_nodeName_name, true); zval property_nodeValue_default_value; ZVAL_UNDEF(&property_nodeValue_default_value); - zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, 1); + zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, true); zend_declare_typed_property(class_entry, property_nodeValue_name, &property_nodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_nodeValue_name); + zend_string_release_ex(property_nodeValue_name, true); zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); - zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, 1); + zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_nodeType_name); + zend_string_release_ex(property_nodeType_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); - zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, 1); + zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_parentNode_name); + zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); - zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, 1); + zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_parentElement_name); + zend_string_release_ex(property_parentElement_name, true); zval property_childNodes_default_value; ZVAL_UNDEF(&property_childNodes_default_value); - zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, 1); + zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, true); zend_string *property_childNodes_class_DOMNodeList = zend_string_init("DOMNodeList", sizeof("DOMNodeList")-1, 1); zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_DOMNodeList, 0, 0)); - zend_string_release(property_childNodes_name); + zend_string_release_ex(property_childNodes_name, true); zval property_firstChild_default_value; ZVAL_UNDEF(&property_firstChild_default_value); - zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, 1); + zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, true); zend_string *property_firstChild_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_firstChild_name); + zend_string_release_ex(property_firstChild_name, true); zval property_lastChild_default_value; ZVAL_UNDEF(&property_lastChild_default_value); - zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, 1); + zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, true); zend_string *property_lastChild_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_lastChild_name); + zend_string_release_ex(property_lastChild_name, true); zval property_previousSibling_default_value; ZVAL_UNDEF(&property_previousSibling_default_value); - zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, 1); + zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, true); zend_string *property_previousSibling_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_previousSibling_name); + zend_string_release_ex(property_previousSibling_name, true); zval property_nextSibling_default_value; ZVAL_UNDEF(&property_nextSibling_default_value); - zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, 1); + zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, true); zend_string *property_nextSibling_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_nextSibling_name); + zend_string_release_ex(property_nextSibling_name, true); zval property_attributes_default_value; ZVAL_UNDEF(&property_attributes_default_value); - zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, 1); + zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, true); zend_string *property_attributes_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_DOMNamedNodeMap, 0, MAY_BE_NULL)); - zend_string_release(property_attributes_name); + zend_string_release_ex(property_attributes_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); - zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, 1); + zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_isConnected_name); + zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); - zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, 1); + zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); - zend_string_release(property_ownerDocument_name); + zend_string_release_ex(property_ownerDocument_name, true); zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); - zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, 1); + zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_localName_name); + zend_string_release_ex(property_localName_name, true); zval property_baseURI_default_value; ZVAL_UNDEF(&property_baseURI_default_value); - zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, 1); + zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, true); zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_baseURI_name); + zend_string_release_ex(property_baseURI_name, true); zval property_textContent_default_value; ZVAL_UNDEF(&property_textContent_default_value); - zend_string *property_textContent_name = zend_string_init("textContent", sizeof("textContent") - 1, 1); + zend_string *property_textContent_name = zend_string_init("textContent", sizeof("textContent") - 1, true); zend_declare_typed_property(class_entry, property_textContent_name, &property_textContent_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_textContent_name); + zend_string_release_ex(property_textContent_name, true); return class_entry; } @@ -2147,66 +2147,66 @@ static zend_class_entry *register_class_DOMNameSpaceNode(void) zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); - zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, 1); + zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_nodeName_name); + zend_string_release_ex(property_nodeName_name, true); zval property_nodeValue_default_value; ZVAL_UNDEF(&property_nodeValue_default_value); - zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, 1); + zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, true); zend_declare_typed_property(class_entry, property_nodeValue_name, &property_nodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_nodeValue_name); + zend_string_release_ex(property_nodeValue_name, true); zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); - zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, 1); + zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_nodeType_name); + zend_string_release_ex(property_nodeType_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); - zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, 1); + zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_localName_name); + zend_string_release_ex(property_localName_name, true); zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); - zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, 1); + zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_isConnected_name); + zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); - zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, 1); + zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); - zend_string_release(property_ownerDocument_name); + zend_string_release_ex(property_ownerDocument_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); - zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, 1); + zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); - zend_string_release(property_parentNode_name); + zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); - zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, 1); + zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_parentElement_name); + zend_string_release_ex(property_parentElement_name, true); return class_entry; } @@ -2231,23 +2231,23 @@ static zend_class_entry *register_class_DOMDocumentFragment(zend_class_entry *cl zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); return class_entry; } @@ -2262,9 +2262,9 @@ static zend_class_entry *register_class_DOMNodeList(zend_class_entry *class_entr zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -2279,29 +2279,29 @@ static zend_class_entry *register_class_DOMCharacterData(zend_class_entry *class zval property_data_default_value; ZVAL_UNDEF(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); - zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, 1); + zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_previousElementSibling_name); + zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); - zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, 1); + zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_nextElementSibling_name); + zend_string_release_ex(property_nextElementSibling_name, true); return class_entry; } @@ -2319,9 +2319,9 @@ static zend_class_entry *register_class_DOMAttr(zend_class_entry *class_entry_DO zval property_specified_default_value; ZVAL_UNDEF(&property_specified_default_value); - zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, 1); + zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, true); zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_specified_name); + zend_string_release_ex(property_specified_name, true); zval property_value_default_value; ZVAL_UNDEF(&property_value_default_value); @@ -2329,16 +2329,16 @@ static zend_class_entry *register_class_DOMAttr(zend_class_entry *class_entry_DO zval property_ownerElement_default_value; ZVAL_UNDEF(&property_ownerElement_default_value); - zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, 1); + zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, true); zend_string *property_ownerElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_ownerElement_name); + zend_string_release_ex(property_ownerElement_name, true); zval property_schemaTypeInfo_default_value; ZVAL_UNDEF(&property_schemaTypeInfo_default_value); - zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, 1); + zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, true); zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_schemaTypeInfo_name); + zend_string_release_ex(property_schemaTypeInfo_name, true); return class_entry; } @@ -2353,61 +2353,61 @@ static zend_class_entry *register_class_DOMElement(zend_class_entry *class_entry zval property_tagName_default_value; ZVAL_UNDEF(&property_tagName_default_value); - zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, 1); + zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, true); zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_tagName_name); + zend_string_release_ex(property_tagName_name, true); zval property_className_default_value; ZVAL_UNDEF(&property_className_default_value); - zend_string *property_className_name = zend_string_init("className", sizeof("className") - 1, 1); + zend_string *property_className_name = zend_string_init("className", sizeof("className") - 1, true); zend_declare_typed_property(class_entry, property_className_name, &property_className_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_className_name); + zend_string_release_ex(property_className_name, true); zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); zval property_schemaTypeInfo_default_value; ZVAL_UNDEF(&property_schemaTypeInfo_default_value); - zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, 1); + zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, true); zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_schemaTypeInfo_name); + zend_string_release_ex(property_schemaTypeInfo_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); - zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, 1); + zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_previousElementSibling_name); + zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); - zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, 1); + zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_nextElementSibling_name); + zend_string_release_ex(property_nextElementSibling_name, true); return class_entry; } @@ -2422,140 +2422,140 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr zval property_doctype_default_value; ZVAL_UNDEF(&property_doctype_default_value); - zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, 1); + zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, true); zend_string *property_doctype_class_DOMDocumentType = zend_string_init("DOMDocumentType", sizeof("DOMDocumentType")-1, 1); zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_DOMDocumentType, 0, MAY_BE_NULL)); - zend_string_release(property_doctype_name); + zend_string_release_ex(property_doctype_name, true); zval property_implementation_default_value; ZVAL_UNDEF(&property_implementation_default_value); - zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, 1); + zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, true); zend_string *property_implementation_class_DOMImplementation = zend_string_init("DOMImplementation", sizeof("DOMImplementation")-1, 1); zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_DOMImplementation, 0, 0)); - zend_string_release(property_implementation_name); + zend_string_release_ex(property_implementation_name, true); zval property_documentElement_default_value; ZVAL_UNDEF(&property_documentElement_default_value); - zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, 1); + zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, true); zend_string *property_documentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_documentElement_name); + zend_string_release_ex(property_documentElement_name, true); zval property_actualEncoding_default_value; ZVAL_UNDEF(&property_actualEncoding_default_value); - zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, 1); + zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, true); zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_actualEncoding_name); + zend_string_release_ex(property_actualEncoding_name, true); zval property_encoding_default_value; ZVAL_UNDEF(&property_encoding_default_value); - zend_string *property_encoding_name = zend_string_init("encoding", sizeof("encoding") - 1, 1); + zend_string *property_encoding_name = zend_string_init("encoding", sizeof("encoding") - 1, true); zend_declare_typed_property(class_entry, property_encoding_name, &property_encoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_encoding_name); + zend_string_release_ex(property_encoding_name, true); zval property_xmlEncoding_default_value; ZVAL_UNDEF(&property_xmlEncoding_default_value); - zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, 1); + zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, true); zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_xmlEncoding_name); + zend_string_release_ex(property_xmlEncoding_name, true); zval property_standalone_default_value; ZVAL_UNDEF(&property_standalone_default_value); - zend_string *property_standalone_name = zend_string_init("standalone", sizeof("standalone") - 1, 1); + zend_string *property_standalone_name = zend_string_init("standalone", sizeof("standalone") - 1, true); zend_declare_typed_property(class_entry, property_standalone_name, &property_standalone_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_standalone_name); + zend_string_release_ex(property_standalone_name, true); zval property_xmlStandalone_default_value; ZVAL_UNDEF(&property_xmlStandalone_default_value); - zend_string *property_xmlStandalone_name = zend_string_init("xmlStandalone", sizeof("xmlStandalone") - 1, 1); + zend_string *property_xmlStandalone_name = zend_string_init("xmlStandalone", sizeof("xmlStandalone") - 1, true); zend_declare_typed_property(class_entry, property_xmlStandalone_name, &property_xmlStandalone_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_xmlStandalone_name); + zend_string_release_ex(property_xmlStandalone_name, true); zval property_version_default_value; ZVAL_UNDEF(&property_version_default_value); - zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, 1); + zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, true); zend_declare_typed_property(class_entry, property_version_name, &property_version_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_version_name); + zend_string_release_ex(property_version_name, true); zval property_xmlVersion_default_value; ZVAL_UNDEF(&property_xmlVersion_default_value); - zend_string *property_xmlVersion_name = zend_string_init("xmlVersion", sizeof("xmlVersion") - 1, 1); + zend_string *property_xmlVersion_name = zend_string_init("xmlVersion", sizeof("xmlVersion") - 1, true); zend_declare_typed_property(class_entry, property_xmlVersion_name, &property_xmlVersion_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_xmlVersion_name); + zend_string_release_ex(property_xmlVersion_name, true); zval property_strictErrorChecking_default_value; ZVAL_UNDEF(&property_strictErrorChecking_default_value); - zend_string *property_strictErrorChecking_name = zend_string_init("strictErrorChecking", sizeof("strictErrorChecking") - 1, 1); + zend_string *property_strictErrorChecking_name = zend_string_init("strictErrorChecking", sizeof("strictErrorChecking") - 1, true); zend_declare_typed_property(class_entry, property_strictErrorChecking_name, &property_strictErrorChecking_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_strictErrorChecking_name); + zend_string_release_ex(property_strictErrorChecking_name, true); zval property_documentURI_default_value; ZVAL_UNDEF(&property_documentURI_default_value); - zend_string *property_documentURI_name = zend_string_init("documentURI", sizeof("documentURI") - 1, 1); + zend_string *property_documentURI_name = zend_string_init("documentURI", sizeof("documentURI") - 1, true); zend_declare_typed_property(class_entry, property_documentURI_name, &property_documentURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_documentURI_name); + zend_string_release_ex(property_documentURI_name, true); zval property_config_default_value; ZVAL_UNDEF(&property_config_default_value); - zend_string *property_config_name = zend_string_init("config", sizeof("config") - 1, 1); + zend_string *property_config_name = zend_string_init("config", sizeof("config") - 1, true); zend_declare_typed_property(class_entry, property_config_name, &property_config_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_config_name); + zend_string_release_ex(property_config_name, true); zval property_formatOutput_default_value; ZVAL_UNDEF(&property_formatOutput_default_value); - zend_string *property_formatOutput_name = zend_string_init("formatOutput", sizeof("formatOutput") - 1, 1); + zend_string *property_formatOutput_name = zend_string_init("formatOutput", sizeof("formatOutput") - 1, true); zend_declare_typed_property(class_entry, property_formatOutput_name, &property_formatOutput_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_formatOutput_name); + zend_string_release_ex(property_formatOutput_name, true); zval property_validateOnParse_default_value; ZVAL_UNDEF(&property_validateOnParse_default_value); - zend_string *property_validateOnParse_name = zend_string_init("validateOnParse", sizeof("validateOnParse") - 1, 1); + zend_string *property_validateOnParse_name = zend_string_init("validateOnParse", sizeof("validateOnParse") - 1, true); zend_declare_typed_property(class_entry, property_validateOnParse_name, &property_validateOnParse_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_validateOnParse_name); + zend_string_release_ex(property_validateOnParse_name, true); zval property_resolveExternals_default_value; ZVAL_UNDEF(&property_resolveExternals_default_value); - zend_string *property_resolveExternals_name = zend_string_init("resolveExternals", sizeof("resolveExternals") - 1, 1); + zend_string *property_resolveExternals_name = zend_string_init("resolveExternals", sizeof("resolveExternals") - 1, true); zend_declare_typed_property(class_entry, property_resolveExternals_name, &property_resolveExternals_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_resolveExternals_name); + zend_string_release_ex(property_resolveExternals_name, true); zval property_preserveWhiteSpace_default_value; ZVAL_UNDEF(&property_preserveWhiteSpace_default_value); - zend_string *property_preserveWhiteSpace_name = zend_string_init("preserveWhiteSpace", sizeof("preserveWhiteSpace") - 1, 1); + zend_string *property_preserveWhiteSpace_name = zend_string_init("preserveWhiteSpace", sizeof("preserveWhiteSpace") - 1, true); zend_declare_typed_property(class_entry, property_preserveWhiteSpace_name, &property_preserveWhiteSpace_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_preserveWhiteSpace_name); + zend_string_release_ex(property_preserveWhiteSpace_name, true); zval property_recover_default_value; ZVAL_UNDEF(&property_recover_default_value); - zend_string *property_recover_name = zend_string_init("recover", sizeof("recover") - 1, 1); + zend_string *property_recover_name = zend_string_init("recover", sizeof("recover") - 1, true); zend_declare_typed_property(class_entry, property_recover_name, &property_recover_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_recover_name); + zend_string_release_ex(property_recover_name, true); zval property_substituteEntities_default_value; ZVAL_UNDEF(&property_substituteEntities_default_value); - zend_string *property_substituteEntities_name = zend_string_init("substituteEntities", sizeof("substituteEntities") - 1, 1); + zend_string *property_substituteEntities_name = zend_string_init("substituteEntities", sizeof("substituteEntities") - 1, true); zend_declare_typed_property(class_entry, property_substituteEntities_name, &property_substituteEntities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_substituteEntities_name); + zend_string_release_ex(property_substituteEntities_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); return class_entry; } @@ -2584,9 +2584,9 @@ static zend_class_entry *register_class_DOMText(zend_class_entry *class_entry_DO zval property_wholeText_default_value; ZVAL_UNDEF(&property_wholeText_default_value); - zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, 1); + zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, true); zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_wholeText_name); + zend_string_release_ex(property_wholeText_name, true); return class_entry; } @@ -2601,9 +2601,9 @@ static zend_class_entry *register_class_DOMNamedNodeMap(zend_class_entry *class_ zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -2617,39 +2617,39 @@ static zend_class_entry *register_class_DOMEntity(zend_class_entry *class_entry_ zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); zval property_notationName_default_value; ZVAL_UNDEF(&property_notationName_default_value); - zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, 1); + zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, true); zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_notationName_name); + zend_string_release_ex(property_notationName_name, true); zval property_actualEncoding_default_value; ZVAL_UNDEF(&property_actualEncoding_default_value); - zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, 1); + zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, true); zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_actualEncoding_name); + zend_string_release_ex(property_actualEncoding_name, true); zval property_encoding_default_value; ZVAL_UNDEF(&property_encoding_default_value); - zend_string *property_encoding_name = zend_string_init("encoding", sizeof("encoding") - 1, 1); + zend_string *property_encoding_name = zend_string_init("encoding", sizeof("encoding") - 1, true); zend_declare_typed_property(class_entry, property_encoding_name, &property_encoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_encoding_name); + zend_string_release_ex(property_encoding_name, true); zval property_version_default_value; ZVAL_UNDEF(&property_version_default_value); - zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, 1); + zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, true); zend_declare_typed_property(class_entry, property_version_name, &property_version_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_version_name); + zend_string_release_ex(property_version_name, true); return class_entry; } @@ -2673,15 +2673,15 @@ static zend_class_entry *register_class_DOMNotation(zend_class_entry *class_entr zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); return class_entry; } @@ -2695,15 +2695,15 @@ static zend_class_entry *register_class_DOMProcessingInstruction(zend_class_entr zval property_target_default_value; ZVAL_UNDEF(&property_target_default_value); - zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, 1); + zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, true); zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_target_name); + zend_string_release_ex(property_target_name, true); zval property_data_default_value; ZVAL_UNDEF(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); return class_entry; } @@ -2718,16 +2718,16 @@ static zend_class_entry *register_class_DOMXPath(void) zval property_document_default_value; ZVAL_UNDEF(&property_document_default_value); - zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, 1); + zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, true); zend_string *property_document_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_DOMDocument, 0, 0)); - zend_string_release(property_document_name); + zend_string_release_ex(property_document_name, true); zval property_registerNodeNamespaces_default_value; ZVAL_UNDEF(&property_registerNodeNamespaces_default_value); - zend_string *property_registerNodeNamespaces_name = zend_string_init("registerNodeNamespaces", sizeof("registerNodeNamespaces") - 1, 1); + zend_string *property_registerNodeNamespaces_name = zend_string_init("registerNodeNamespaces", sizeof("registerNodeNamespaces") - 1, true); zend_declare_typed_property(class_entry, property_registerNodeNamespaces_name, &property_registerNodeNamespaces_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_registerNodeNamespaces_name); + zend_string_release_ex(property_registerNodeNamespaces_name, true); return class_entry; } @@ -2772,131 +2772,131 @@ static zend_class_entry *register_class_Dom_Node(void) zval const_DOCUMENT_POSITION_DISCONNECTED_value; ZVAL_LONG(&const_DOCUMENT_POSITION_DISCONNECTED_value, 0x1); - zend_string *const_DOCUMENT_POSITION_DISCONNECTED_name = zend_string_init_interned("DOCUMENT_POSITION_DISCONNECTED", sizeof("DOCUMENT_POSITION_DISCONNECTED") - 1, 1); + zend_string *const_DOCUMENT_POSITION_DISCONNECTED_name = zend_string_init_interned("DOCUMENT_POSITION_DISCONNECTED", sizeof("DOCUMENT_POSITION_DISCONNECTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_DISCONNECTED_name, &const_DOCUMENT_POSITION_DISCONNECTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_DISCONNECTED_name); + zend_string_release_ex(const_DOCUMENT_POSITION_DISCONNECTED_name, true); zval const_DOCUMENT_POSITION_PRECEDING_value; ZVAL_LONG(&const_DOCUMENT_POSITION_PRECEDING_value, 0x2); - zend_string *const_DOCUMENT_POSITION_PRECEDING_name = zend_string_init_interned("DOCUMENT_POSITION_PRECEDING", sizeof("DOCUMENT_POSITION_PRECEDING") - 1, 1); + zend_string *const_DOCUMENT_POSITION_PRECEDING_name = zend_string_init_interned("DOCUMENT_POSITION_PRECEDING", sizeof("DOCUMENT_POSITION_PRECEDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_PRECEDING_name, &const_DOCUMENT_POSITION_PRECEDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_PRECEDING_name); + zend_string_release_ex(const_DOCUMENT_POSITION_PRECEDING_name, true); zval const_DOCUMENT_POSITION_FOLLOWING_value; ZVAL_LONG(&const_DOCUMENT_POSITION_FOLLOWING_value, 0x4); - zend_string *const_DOCUMENT_POSITION_FOLLOWING_name = zend_string_init_interned("DOCUMENT_POSITION_FOLLOWING", sizeof("DOCUMENT_POSITION_FOLLOWING") - 1, 1); + zend_string *const_DOCUMENT_POSITION_FOLLOWING_name = zend_string_init_interned("DOCUMENT_POSITION_FOLLOWING", sizeof("DOCUMENT_POSITION_FOLLOWING") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_FOLLOWING_name, &const_DOCUMENT_POSITION_FOLLOWING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_FOLLOWING_name); + zend_string_release_ex(const_DOCUMENT_POSITION_FOLLOWING_name, true); zval const_DOCUMENT_POSITION_CONTAINS_value; ZVAL_LONG(&const_DOCUMENT_POSITION_CONTAINS_value, 0x8); - zend_string *const_DOCUMENT_POSITION_CONTAINS_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINS", sizeof("DOCUMENT_POSITION_CONTAINS") - 1, 1); + zend_string *const_DOCUMENT_POSITION_CONTAINS_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINS", sizeof("DOCUMENT_POSITION_CONTAINS") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_CONTAINS_name, &const_DOCUMENT_POSITION_CONTAINS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_CONTAINS_name); + zend_string_release_ex(const_DOCUMENT_POSITION_CONTAINS_name, true); zval const_DOCUMENT_POSITION_CONTAINED_BY_value; ZVAL_LONG(&const_DOCUMENT_POSITION_CONTAINED_BY_value, 0x10); - zend_string *const_DOCUMENT_POSITION_CONTAINED_BY_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINED_BY", sizeof("DOCUMENT_POSITION_CONTAINED_BY") - 1, 1); + zend_string *const_DOCUMENT_POSITION_CONTAINED_BY_name = zend_string_init_interned("DOCUMENT_POSITION_CONTAINED_BY", sizeof("DOCUMENT_POSITION_CONTAINED_BY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_CONTAINED_BY_name, &const_DOCUMENT_POSITION_CONTAINED_BY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_CONTAINED_BY_name); + zend_string_release_ex(const_DOCUMENT_POSITION_CONTAINED_BY_name, true); zval const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value; ZVAL_LONG(&const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value, 0x20); - zend_string *const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name = zend_string_init_interned("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", sizeof("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC") - 1, 1); + zend_string *const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name = zend_string_init_interned("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", sizeof("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name, &const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name); + zend_string_release_ex(const_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC_name, true); zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); - zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, 1); + zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_nodeType_name); + zend_string_release_ex(property_nodeType_name, true); zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); - zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, 1); + zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_nodeName_name); + zend_string_release_ex(property_nodeName_name, true); zval property_baseURI_default_value; ZVAL_UNDEF(&property_baseURI_default_value); - zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, 1); + zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, true); zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_baseURI_name); + zend_string_release_ex(property_baseURI_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); - zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, 1); + zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_isConnected_name); + zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); - zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, 1); + zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_Dom_Document = zend_string_init("Dom\\Document", sizeof("Dom\\Document")-1, 1); zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_Dom_Document, 0, MAY_BE_NULL)); - zend_string_release(property_ownerDocument_name); + zend_string_release_ex(property_ownerDocument_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); - zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, 1); + zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_Dom_Node, 0, MAY_BE_NULL)); - zend_string_release(property_parentNode_name); + zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); - zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, 1); + zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_parentElement_name); + zend_string_release_ex(property_parentElement_name, true); zval property_childNodes_default_value; ZVAL_UNDEF(&property_childNodes_default_value); - zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, 1); + zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, true); zend_string *property_childNodes_class_Dom_NodeList = zend_string_init("Dom\\\116odeList", sizeof("Dom\\\116odeList")-1, 1); zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_Dom_NodeList, 0, 0)); - zend_string_release(property_childNodes_name); + zend_string_release_ex(property_childNodes_name, true); zval property_firstChild_default_value; ZVAL_UNDEF(&property_firstChild_default_value); - zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, 1); + zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, true); zend_string *property_firstChild_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_Dom_Node, 0, MAY_BE_NULL)); - zend_string_release(property_firstChild_name); + zend_string_release_ex(property_firstChild_name, true); zval property_lastChild_default_value; ZVAL_UNDEF(&property_lastChild_default_value); - zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, 1); + zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, true); zend_string *property_lastChild_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_Dom_Node, 0, MAY_BE_NULL)); - zend_string_release(property_lastChild_name); + zend_string_release_ex(property_lastChild_name, true); zval property_previousSibling_default_value; ZVAL_UNDEF(&property_previousSibling_default_value); - zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, 1); + zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, true); zend_string *property_previousSibling_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_Dom_Node, 0, MAY_BE_NULL)); - zend_string_release(property_previousSibling_name); + zend_string_release_ex(property_previousSibling_name, true); zval property_nextSibling_default_value; ZVAL_UNDEF(&property_nextSibling_default_value); - zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, 1); + zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, true); zend_string *property_nextSibling_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_Dom_Node, 0, MAY_BE_NULL)); - zend_string_release(property_nextSibling_name); + zend_string_release_ex(property_nextSibling_name, true); zval property_nodeValue_default_value; ZVAL_UNDEF(&property_nodeValue_default_value); - zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, 1); + zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, true); zend_declare_typed_property(class_entry, property_nodeValue_name, &property_nodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_nodeValue_name); + zend_string_release_ex(property_nodeValue_name, true); zval property_textContent_default_value; ZVAL_UNDEF(&property_textContent_default_value); - zend_string *property_textContent_name = zend_string_init("textContent", sizeof("textContent") - 1, 1); + zend_string *property_textContent_name = zend_string_init("textContent", sizeof("textContent") - 1, true); zend_declare_typed_property(class_entry, property_textContent_name, &property_textContent_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_textContent_name); + zend_string_release_ex(property_textContent_name, true); return class_entry; } @@ -2911,9 +2911,9 @@ static zend_class_entry *register_class_Dom_NodeList(zend_class_entry *class_ent zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -2928,9 +2928,9 @@ static zend_class_entry *register_class_Dom_NamedNodeMap(zend_class_entry *class zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -2945,9 +2945,9 @@ static zend_class_entry *register_class_Dom_DtdNamedNodeMap(zend_class_entry *cl zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -2962,9 +2962,9 @@ static zend_class_entry *register_class_Dom_HTMLCollection(zend_class_entry *cla zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -3006,112 +3006,112 @@ static zend_class_entry *register_class_Dom_Element(zend_class_entry *class_entr zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); - zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, 1); + zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_localName_name); + zend_string_release_ex(property_localName_name, true); zval property_tagName_default_value; ZVAL_UNDEF(&property_tagName_default_value); - zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, 1); + zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, true); zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_tagName_name); + zend_string_release_ex(property_tagName_name, true); zval property_children_default_value; ZVAL_UNDEF(&property_children_default_value); - zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, 1); + zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); - zend_string_release(property_children_name); + zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); - zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, 1); + zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_previousElementSibling_name); + zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); - zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, 1); + zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_nextElementSibling_name); + zend_string_release_ex(property_nextElementSibling_name, true); zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); zval property_className_default_value; ZVAL_UNDEF(&property_className_default_value); - zend_string *property_className_name = zend_string_init("className", sizeof("className") - 1, 1); + zend_string *property_className_name = zend_string_init("className", sizeof("className") - 1, true); zend_declare_typed_property(class_entry, property_className_name, &property_className_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_className_name); + zend_string_release_ex(property_className_name, true); zval property_classList_default_value; ZVAL_UNDEF(&property_classList_default_value); - zend_string *property_classList_name = zend_string_init("classList", sizeof("classList") - 1, 1); + zend_string *property_classList_name = zend_string_init("classList", sizeof("classList") - 1, true); zend_string *property_classList_class_Dom_TokenList = zend_string_init("Dom\\TokenList", sizeof("Dom\\TokenList")-1, 1); zend_declare_typed_property(class_entry, property_classList_name, &property_classList_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classList_class_Dom_TokenList, 0, 0)); - zend_string_release(property_classList_name); + zend_string_release_ex(property_classList_name, true); zval property_attributes_default_value; ZVAL_UNDEF(&property_attributes_default_value); - zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, 1); + zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, true); zend_string *property_attributes_class_Dom_NamedNodeMap = zend_string_init("Dom\\\116amedNodeMap", sizeof("Dom\\\116amedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_Dom_NamedNodeMap, 0, 0)); - zend_string_release(property_attributes_name); + zend_string_release_ex(property_attributes_name, true); zval property_innerHTML_default_value; ZVAL_UNDEF(&property_innerHTML_default_value); - zend_string *property_innerHTML_name = zend_string_init("innerHTML", sizeof("innerHTML") - 1, 1); + zend_string *property_innerHTML_name = zend_string_init("innerHTML", sizeof("innerHTML") - 1, true); zend_declare_typed_property(class_entry, property_innerHTML_name, &property_innerHTML_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_innerHTML_name); + zend_string_release_ex(property_innerHTML_name, true); zval property_outerHTML_default_value; ZVAL_UNDEF(&property_outerHTML_default_value); - zend_string *property_outerHTML_name = zend_string_init("outerHTML", sizeof("outerHTML") - 1, 1); + zend_string *property_outerHTML_name = zend_string_init("outerHTML", sizeof("outerHTML") - 1, true); zend_declare_typed_property(class_entry, property_outerHTML_name, &property_outerHTML_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_outerHTML_name); + zend_string_release_ex(property_outerHTML_name, true); zval property_substitutedNodeValue_default_value; ZVAL_UNDEF(&property_substitutedNodeValue_default_value); - zend_string *property_substitutedNodeValue_name = zend_string_init("substitutedNodeValue", sizeof("substitutedNodeValue") - 1, 1); + zend_string *property_substitutedNodeValue_name = zend_string_init("substitutedNodeValue", sizeof("substitutedNodeValue") - 1, true); zend_declare_typed_property(class_entry, property_substitutedNodeValue_name, &property_substitutedNodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_substitutedNodeValue_name); + zend_string_release_ex(property_substitutedNodeValue_name, true); return class_entry; } @@ -3135,21 +3135,21 @@ static zend_class_entry *register_class_Dom_Attr(zend_class_entry *class_entry_D zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); - zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, 1); + zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_localName_name); + zend_string_release_ex(property_localName_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -3161,16 +3161,16 @@ static zend_class_entry *register_class_Dom_Attr(zend_class_entry *class_entry_D zval property_ownerElement_default_value; ZVAL_UNDEF(&property_ownerElement_default_value); - zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, 1); + zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, true); zend_string *property_ownerElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_ownerElement_name); + zend_string_release_ex(property_ownerElement_name, true); zval property_specified_default_value; ZVAL_UNDEF(&property_specified_default_value); - zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, 1); + zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, true); zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_specified_name); + zend_string_release_ex(property_specified_name, true); return class_entry; } @@ -3185,29 +3185,29 @@ static zend_class_entry *register_class_Dom_CharacterData(zend_class_entry *clas zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); - zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, 1); + zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_previousElementSibling_name); + zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); - zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, 1); + zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_nextElementSibling_name); + zend_string_release_ex(property_nextElementSibling_name, true); zval property_data_default_value; ZVAL_UNDEF(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); return class_entry; } @@ -3221,9 +3221,9 @@ static zend_class_entry *register_class_Dom_Text(zend_class_entry *class_entry_D zval property_wholeText_default_value; ZVAL_UNDEF(&property_wholeText_default_value); - zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, 1); + zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, true); zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_wholeText_name); + zend_string_release_ex(property_wholeText_name, true); return class_entry; } @@ -3247,9 +3247,9 @@ static zend_class_entry *register_class_Dom_ProcessingInstruction(zend_class_ent zval property_target_default_value; ZVAL_UNDEF(&property_target_default_value); - zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, 1); + zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, true); zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_target_name); + zend_string_release_ex(property_target_name, true); return class_entry; } @@ -3278,35 +3278,35 @@ static zend_class_entry *register_class_Dom_DocumentType(zend_class_entry *class zval property_entities_default_value; ZVAL_UNDEF(&property_entities_default_value); - zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, 1); + zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, true); zend_string *property_entities_class_Dom_DtdNamedNodeMap = zend_string_init("Dom\\DtdNamedNodeMap", sizeof("Dom\\DtdNamedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_Dom_DtdNamedNodeMap, 0, 0)); - zend_string_release(property_entities_name); + zend_string_release_ex(property_entities_name, true); zval property_notations_default_value; ZVAL_UNDEF(&property_notations_default_value); - zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, 1); + zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, true); zend_string *property_notations_class_Dom_DtdNamedNodeMap = zend_string_init("Dom\\DtdNamedNodeMap", sizeof("Dom\\DtdNamedNodeMap")-1, 1); zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_Dom_DtdNamedNodeMap, 0, 0)); - zend_string_release(property_notations_name); + zend_string_release_ex(property_notations_name, true); zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); zval property_internalSubset_default_value; ZVAL_UNDEF(&property_internalSubset_default_value); - zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, 1); + zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, true); zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_internalSubset_name); + zend_string_release_ex(property_internalSubset_name, true); return class_entry; } @@ -3321,30 +3321,30 @@ static zend_class_entry *register_class_Dom_DocumentFragment(zend_class_entry *c zval property_children_default_value; ZVAL_UNDEF(&property_children_default_value); - zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, 1); + zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); - zend_string_release(property_children_name); + zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); return class_entry; } @@ -3358,21 +3358,21 @@ static zend_class_entry *register_class_Dom_Entity(zend_class_entry *class_entry zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); zval property_notationName_default_value; ZVAL_UNDEF(&property_notationName_default_value); - zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, 1); + zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, true); zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_notationName_name); + zend_string_release_ex(property_notationName_name, true); return class_entry; } @@ -3396,15 +3396,15 @@ static zend_class_entry *register_class_Dom_Notation(zend_class_entry *class_ent zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); - zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, 1); + zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_publicId_name); + zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); - zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, 1); + zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_systemId_name); + zend_string_release_ex(property_systemId_name, true); return class_entry; } @@ -3419,101 +3419,101 @@ static zend_class_entry *register_class_Dom_Document(zend_class_entry *class_ent zval property_children_default_value; ZVAL_UNDEF(&property_children_default_value); - zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, 1); + zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); - zend_string_release(property_children_name); + zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); - zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, 1); + zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_firstElementChild_name); + zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); - zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, 1); + zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_lastElementChild_name); + zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); - zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, 1); + zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_childElementCount_name); + zend_string_release_ex(property_childElementCount_name, true); zval property_implementation_default_value; ZVAL_UNDEF(&property_implementation_default_value); - zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, 1); + zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, true); zend_string *property_implementation_class_Dom_Implementation = zend_string_init("Dom\\Implementation", sizeof("Dom\\Implementation")-1, 1); zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_Dom_Implementation, 0, 0)); - zend_string_release(property_implementation_name); + zend_string_release_ex(property_implementation_name, true); zval property_URL_default_value; ZVAL_UNDEF(&property_URL_default_value); - zend_string *property_URL_name = zend_string_init("URL", sizeof("URL") - 1, 1); + zend_string *property_URL_name = zend_string_init("URL", sizeof("URL") - 1, true); zend_declare_typed_property(class_entry, property_URL_name, &property_URL_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_URL_name); + zend_string_release_ex(property_URL_name, true); zval property_documentURI_default_value; ZVAL_UNDEF(&property_documentURI_default_value); - zend_string *property_documentURI_name = zend_string_init("documentURI", sizeof("documentURI") - 1, 1); + zend_string *property_documentURI_name = zend_string_init("documentURI", sizeof("documentURI") - 1, true); zend_declare_typed_property(class_entry, property_documentURI_name, &property_documentURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_documentURI_name); + zend_string_release_ex(property_documentURI_name, true); zval property_characterSet_default_value; ZVAL_UNDEF(&property_characterSet_default_value); - zend_string *property_characterSet_name = zend_string_init("characterSet", sizeof("characterSet") - 1, 1); + zend_string *property_characterSet_name = zend_string_init("characterSet", sizeof("characterSet") - 1, true); zend_declare_typed_property(class_entry, property_characterSet_name, &property_characterSet_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_characterSet_name); + zend_string_release_ex(property_characterSet_name, true); zval property_charset_default_value; ZVAL_UNDEF(&property_charset_default_value); - zend_string *property_charset_name = zend_string_init("charset", sizeof("charset") - 1, 1); + zend_string *property_charset_name = zend_string_init("charset", sizeof("charset") - 1, true); zend_declare_typed_property(class_entry, property_charset_name, &property_charset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_charset_name); + zend_string_release_ex(property_charset_name, true); zval property_inputEncoding_default_value; ZVAL_UNDEF(&property_inputEncoding_default_value); - zend_string *property_inputEncoding_name = zend_string_init("inputEncoding", sizeof("inputEncoding") - 1, 1); + zend_string *property_inputEncoding_name = zend_string_init("inputEncoding", sizeof("inputEncoding") - 1, true); zend_declare_typed_property(class_entry, property_inputEncoding_name, &property_inputEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_inputEncoding_name); + zend_string_release_ex(property_inputEncoding_name, true); zval property_doctype_default_value; ZVAL_UNDEF(&property_doctype_default_value); - zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, 1); + zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, true); zend_string *property_doctype_class_Dom_DocumentType = zend_string_init("Dom\\DocumentType", sizeof("Dom\\DocumentType")-1, 1); zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_Dom_DocumentType, 0, MAY_BE_NULL)); - zend_string_release(property_doctype_name); + zend_string_release_ex(property_doctype_name, true); zval property_documentElement_default_value; ZVAL_UNDEF(&property_documentElement_default_value); - zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, 1); + zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, true); zend_string *property_documentElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_Dom_Element, 0, MAY_BE_NULL)); - zend_string_release(property_documentElement_name); + zend_string_release_ex(property_documentElement_name, true); zval property_body_default_value; ZVAL_UNDEF(&property_body_default_value); - zend_string *property_body_name = zend_string_init("body", sizeof("body") - 1, 1); + zend_string *property_body_name = zend_string_init("body", sizeof("body") - 1, true); zend_string *property_body_class_Dom_HTMLElement = zend_string_init("Dom\\HTMLElement", sizeof("Dom\\HTMLElement")-1, 1); zend_declare_typed_property(class_entry, property_body_name, &property_body_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_body_class_Dom_HTMLElement, 0, MAY_BE_NULL)); - zend_string_release(property_body_name); + zend_string_release_ex(property_body_name, true); zval property_head_default_value; ZVAL_UNDEF(&property_head_default_value); - zend_string *property_head_name = zend_string_init("head", sizeof("head") - 1, 1); + zend_string *property_head_name = zend_string_init("head", sizeof("head") - 1, true); zend_string *property_head_class_Dom_HTMLElement = zend_string_init("Dom\\HTMLElement", sizeof("Dom\\HTMLElement")-1, 1); zend_declare_typed_property(class_entry, property_head_name, &property_head_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_head_class_Dom_HTMLElement, 0, MAY_BE_NULL)); - zend_string_release(property_head_name); + zend_string_release_ex(property_head_name, true); zval property_title_default_value; ZVAL_UNDEF(&property_title_default_value); - zend_string *property_title_name = zend_string_init("title", sizeof("title") - 1, 1); + zend_string *property_title_name = zend_string_init("title", sizeof("title") - 1, true); zend_declare_typed_property(class_entry, property_title_name, &property_title_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_title_name); + zend_string_release_ex(property_title_name, true); return class_entry; } @@ -3537,27 +3537,27 @@ static zend_class_entry *register_class_Dom_XMLDocument(zend_class_entry *class_ zval property_xmlEncoding_default_value; ZVAL_UNDEF(&property_xmlEncoding_default_value); - zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, 1); + zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, true); zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_xmlEncoding_name); + zend_string_release_ex(property_xmlEncoding_name, true); zval property_xmlStandalone_default_value; ZVAL_UNDEF(&property_xmlStandalone_default_value); - zend_string *property_xmlStandalone_name = zend_string_init("xmlStandalone", sizeof("xmlStandalone") - 1, 1); + zend_string *property_xmlStandalone_name = zend_string_init("xmlStandalone", sizeof("xmlStandalone") - 1, true); zend_declare_typed_property(class_entry, property_xmlStandalone_name, &property_xmlStandalone_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_xmlStandalone_name); + zend_string_release_ex(property_xmlStandalone_name, true); zval property_xmlVersion_default_value; ZVAL_UNDEF(&property_xmlVersion_default_value); - zend_string *property_xmlVersion_name = zend_string_init("xmlVersion", sizeof("xmlVersion") - 1, 1); + zend_string *property_xmlVersion_name = zend_string_init("xmlVersion", sizeof("xmlVersion") - 1, true); zend_declare_typed_property(class_entry, property_xmlVersion_name, &property_xmlVersion_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_xmlVersion_name); + zend_string_release_ex(property_xmlVersion_name, true); zval property_formatOutput_default_value; ZVAL_UNDEF(&property_formatOutput_default_value); - zend_string *property_formatOutput_name = zend_string_init("formatOutput", sizeof("formatOutput") - 1, 1); + zend_string *property_formatOutput_name = zend_string_init("formatOutput", sizeof("formatOutput") - 1, true); zend_declare_typed_property(class_entry, property_formatOutput_name, &property_formatOutput_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_formatOutput_name); + zend_string_release_ex(property_formatOutput_name, true); return class_entry; } @@ -3572,9 +3572,9 @@ static zend_class_entry *register_class_Dom_TokenList(zend_class_entry *class_en zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); - zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, 1); + zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_length_name); + zend_string_release_ex(property_length_name, true); zval property_value_default_value; ZVAL_UNDEF(&property_value_default_value); @@ -3592,22 +3592,22 @@ static zend_class_entry *register_class_Dom_NamespaceInfo(void) zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_element_default_value; ZVAL_UNDEF(&property_element_default_value); - zend_string *property_element_name = zend_string_init("element", sizeof("element") - 1, 1); + zend_string *property_element_name = zend_string_init("element", sizeof("element") - 1, true); zend_string *property_element_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); zend_declare_typed_property(class_entry, property_element_name, &property_element_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_element_class_Dom_Element, 0, 0)); - zend_string_release(property_element_name); + zend_string_release_ex(property_element_name, true); return class_entry; } @@ -3622,16 +3622,16 @@ static zend_class_entry *register_class_Dom_XPath(void) zval property_document_default_value; ZVAL_UNDEF(&property_document_default_value); - zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, 1); + zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, true); zend_string *property_document_class_Dom_Document = zend_string_init("Dom\\Document", sizeof("Dom\\Document")-1, 1); zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_Dom_Document, 0, 0)); - zend_string_release(property_document_name); + zend_string_release_ex(property_document_name, true); zval property_registerNodeNamespaces_default_value; ZVAL_UNDEF(&property_registerNodeNamespaces_default_value); - zend_string *property_registerNodeNamespaces_name = zend_string_init("registerNodeNamespaces", sizeof("registerNodeNamespaces") - 1, 1); + zend_string *property_registerNodeNamespaces_name = zend_string_init("registerNodeNamespaces", sizeof("registerNodeNamespaces") - 1, true); zend_declare_typed_property(class_entry, property_registerNodeNamespaces_name, &property_registerNodeNamespaces_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_registerNodeNamespaces_name); + zend_string_release_ex(property_registerNodeNamespaces_name, true); return class_entry; } diff --git a/ext/ffi/ffi_arginfo.h b/ext/ffi/ffi_arginfo.h index 563c9f8b8e8b1..1485c973d9a11 100644 --- a/ext/ffi/ffi_arginfo.h +++ b/ext/ffi/ffi_arginfo.h @@ -205,9 +205,9 @@ static zend_class_entry *register_class_FFI(void) zval const___BIGGEST_ALIGNMENT___value; ZVAL_LONG(&const___BIGGEST_ALIGNMENT___value, __BIGGEST_ALIGNMENT__); - zend_string *const___BIGGEST_ALIGNMENT___name = zend_string_init_interned("__BIGGEST_ALIGNMENT__", sizeof("__BIGGEST_ALIGNMENT__") - 1, 1); + zend_string *const___BIGGEST_ALIGNMENT___name = zend_string_init_interned("__BIGGEST_ALIGNMENT__", sizeof("__BIGGEST_ALIGNMENT__") - 1, true); zend_declare_typed_class_constant(class_entry, const___BIGGEST_ALIGNMENT___name, &const___BIGGEST_ALIGNMENT___value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const___BIGGEST_ALIGNMENT___name); + zend_string_release_ex(const___BIGGEST_ALIGNMENT___name, true); return class_entry; } @@ -231,233 +231,233 @@ static zend_class_entry *register_class_FFI_CType(void) zval const_TYPE_VOID_value; ZVAL_LONG(&const_TYPE_VOID_value, ZEND_FFI_TYPE_VOID); - zend_string *const_TYPE_VOID_name = zend_string_init_interned("TYPE_VOID", sizeof("TYPE_VOID") - 1, 1); + zend_string *const_TYPE_VOID_name = zend_string_init_interned("TYPE_VOID", sizeof("TYPE_VOID") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_VOID_name, &const_TYPE_VOID_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_VOID_name); + zend_string_release_ex(const_TYPE_VOID_name, true); zval const_TYPE_FLOAT_value; ZVAL_LONG(&const_TYPE_FLOAT_value, ZEND_FFI_TYPE_FLOAT); - zend_string *const_TYPE_FLOAT_name = zend_string_init_interned("TYPE_FLOAT", sizeof("TYPE_FLOAT") - 1, 1); + zend_string *const_TYPE_FLOAT_name = zend_string_init_interned("TYPE_FLOAT", sizeof("TYPE_FLOAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_FLOAT_name, &const_TYPE_FLOAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_FLOAT_name); + zend_string_release_ex(const_TYPE_FLOAT_name, true); zval const_TYPE_DOUBLE_value; ZVAL_LONG(&const_TYPE_DOUBLE_value, ZEND_FFI_TYPE_DOUBLE); - zend_string *const_TYPE_DOUBLE_name = zend_string_init_interned("TYPE_DOUBLE", sizeof("TYPE_DOUBLE") - 1, 1); + zend_string *const_TYPE_DOUBLE_name = zend_string_init_interned("TYPE_DOUBLE", sizeof("TYPE_DOUBLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_DOUBLE_name, &const_TYPE_DOUBLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_DOUBLE_name); + zend_string_release_ex(const_TYPE_DOUBLE_name, true); #if defined(HAVE_LONG_DOUBLE) zval const_TYPE_LONGDOUBLE_value; ZVAL_LONG(&const_TYPE_LONGDOUBLE_value, ZEND_FFI_TYPE_LONGDOUBLE); - zend_string *const_TYPE_LONGDOUBLE_name = zend_string_init_interned("TYPE_LONGDOUBLE", sizeof("TYPE_LONGDOUBLE") - 1, 1); + zend_string *const_TYPE_LONGDOUBLE_name = zend_string_init_interned("TYPE_LONGDOUBLE", sizeof("TYPE_LONGDOUBLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_LONGDOUBLE_name, &const_TYPE_LONGDOUBLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_LONGDOUBLE_name); + zend_string_release_ex(const_TYPE_LONGDOUBLE_name, true); #endif zval const_TYPE_UINT8_value; ZVAL_LONG(&const_TYPE_UINT8_value, ZEND_FFI_TYPE_UINT8); - zend_string *const_TYPE_UINT8_name = zend_string_init_interned("TYPE_UINT8", sizeof("TYPE_UINT8") - 1, 1); + zend_string *const_TYPE_UINT8_name = zend_string_init_interned("TYPE_UINT8", sizeof("TYPE_UINT8") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_UINT8_name, &const_TYPE_UINT8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_UINT8_name); + zend_string_release_ex(const_TYPE_UINT8_name, true); zval const_TYPE_SINT8_value; ZVAL_LONG(&const_TYPE_SINT8_value, ZEND_FFI_TYPE_SINT8); - zend_string *const_TYPE_SINT8_name = zend_string_init_interned("TYPE_SINT8", sizeof("TYPE_SINT8") - 1, 1); + zend_string *const_TYPE_SINT8_name = zend_string_init_interned("TYPE_SINT8", sizeof("TYPE_SINT8") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_SINT8_name, &const_TYPE_SINT8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_SINT8_name); + zend_string_release_ex(const_TYPE_SINT8_name, true); zval const_TYPE_UINT16_value; ZVAL_LONG(&const_TYPE_UINT16_value, ZEND_FFI_TYPE_UINT16); - zend_string *const_TYPE_UINT16_name = zend_string_init_interned("TYPE_UINT16", sizeof("TYPE_UINT16") - 1, 1); + zend_string *const_TYPE_UINT16_name = zend_string_init_interned("TYPE_UINT16", sizeof("TYPE_UINT16") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_UINT16_name, &const_TYPE_UINT16_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_UINT16_name); + zend_string_release_ex(const_TYPE_UINT16_name, true); zval const_TYPE_SINT16_value; ZVAL_LONG(&const_TYPE_SINT16_value, ZEND_FFI_TYPE_SINT16); - zend_string *const_TYPE_SINT16_name = zend_string_init_interned("TYPE_SINT16", sizeof("TYPE_SINT16") - 1, 1); + zend_string *const_TYPE_SINT16_name = zend_string_init_interned("TYPE_SINT16", sizeof("TYPE_SINT16") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_SINT16_name, &const_TYPE_SINT16_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_SINT16_name); + zend_string_release_ex(const_TYPE_SINT16_name, true); zval const_TYPE_UINT32_value; ZVAL_LONG(&const_TYPE_UINT32_value, ZEND_FFI_TYPE_UINT32); - zend_string *const_TYPE_UINT32_name = zend_string_init_interned("TYPE_UINT32", sizeof("TYPE_UINT32") - 1, 1); + zend_string *const_TYPE_UINT32_name = zend_string_init_interned("TYPE_UINT32", sizeof("TYPE_UINT32") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_UINT32_name, &const_TYPE_UINT32_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_UINT32_name); + zend_string_release_ex(const_TYPE_UINT32_name, true); zval const_TYPE_SINT32_value; ZVAL_LONG(&const_TYPE_SINT32_value, ZEND_FFI_TYPE_SINT32); - zend_string *const_TYPE_SINT32_name = zend_string_init_interned("TYPE_SINT32", sizeof("TYPE_SINT32") - 1, 1); + zend_string *const_TYPE_SINT32_name = zend_string_init_interned("TYPE_SINT32", sizeof("TYPE_SINT32") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_SINT32_name, &const_TYPE_SINT32_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_SINT32_name); + zend_string_release_ex(const_TYPE_SINT32_name, true); zval const_TYPE_UINT64_value; ZVAL_LONG(&const_TYPE_UINT64_value, ZEND_FFI_TYPE_UINT64); - zend_string *const_TYPE_UINT64_name = zend_string_init_interned("TYPE_UINT64", sizeof("TYPE_UINT64") - 1, 1); + zend_string *const_TYPE_UINT64_name = zend_string_init_interned("TYPE_UINT64", sizeof("TYPE_UINT64") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_UINT64_name, &const_TYPE_UINT64_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_UINT64_name); + zend_string_release_ex(const_TYPE_UINT64_name, true); zval const_TYPE_SINT64_value; ZVAL_LONG(&const_TYPE_SINT64_value, ZEND_FFI_TYPE_SINT64); - zend_string *const_TYPE_SINT64_name = zend_string_init_interned("TYPE_SINT64", sizeof("TYPE_SINT64") - 1, 1); + zend_string *const_TYPE_SINT64_name = zend_string_init_interned("TYPE_SINT64", sizeof("TYPE_SINT64") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_SINT64_name, &const_TYPE_SINT64_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_SINT64_name); + zend_string_release_ex(const_TYPE_SINT64_name, true); zval const_TYPE_ENUM_value; ZVAL_LONG(&const_TYPE_ENUM_value, ZEND_FFI_TYPE_ENUM); - zend_string *const_TYPE_ENUM_name = zend_string_init_interned("TYPE_ENUM", sizeof("TYPE_ENUM") - 1, 1); + zend_string *const_TYPE_ENUM_name = zend_string_init_interned("TYPE_ENUM", sizeof("TYPE_ENUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_ENUM_name, &const_TYPE_ENUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_ENUM_name); + zend_string_release_ex(const_TYPE_ENUM_name, true); zval const_TYPE_BOOL_value; ZVAL_LONG(&const_TYPE_BOOL_value, ZEND_FFI_TYPE_BOOL); - zend_string *const_TYPE_BOOL_name = zend_string_init_interned("TYPE_BOOL", sizeof("TYPE_BOOL") - 1, 1); + zend_string *const_TYPE_BOOL_name = zend_string_init_interned("TYPE_BOOL", sizeof("TYPE_BOOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_BOOL_name, &const_TYPE_BOOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_BOOL_name); + zend_string_release_ex(const_TYPE_BOOL_name, true); zval const_TYPE_CHAR_value; ZVAL_LONG(&const_TYPE_CHAR_value, ZEND_FFI_TYPE_CHAR); - zend_string *const_TYPE_CHAR_name = zend_string_init_interned("TYPE_CHAR", sizeof("TYPE_CHAR") - 1, 1); + zend_string *const_TYPE_CHAR_name = zend_string_init_interned("TYPE_CHAR", sizeof("TYPE_CHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_CHAR_name, &const_TYPE_CHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_CHAR_name); + zend_string_release_ex(const_TYPE_CHAR_name, true); zval const_TYPE_POINTER_value; ZVAL_LONG(&const_TYPE_POINTER_value, ZEND_FFI_TYPE_POINTER); - zend_string *const_TYPE_POINTER_name = zend_string_init_interned("TYPE_POINTER", sizeof("TYPE_POINTER") - 1, 1); + zend_string *const_TYPE_POINTER_name = zend_string_init_interned("TYPE_POINTER", sizeof("TYPE_POINTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_POINTER_name, &const_TYPE_POINTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_POINTER_name); + zend_string_release_ex(const_TYPE_POINTER_name, true); zval const_TYPE_FUNC_value; ZVAL_LONG(&const_TYPE_FUNC_value, ZEND_FFI_TYPE_FUNC); - zend_string *const_TYPE_FUNC_name = zend_string_init_interned("TYPE_FUNC", sizeof("TYPE_FUNC") - 1, 1); + zend_string *const_TYPE_FUNC_name = zend_string_init_interned("TYPE_FUNC", sizeof("TYPE_FUNC") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_FUNC_name, &const_TYPE_FUNC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_FUNC_name); + zend_string_release_ex(const_TYPE_FUNC_name, true); zval const_TYPE_ARRAY_value; ZVAL_LONG(&const_TYPE_ARRAY_value, ZEND_FFI_TYPE_ARRAY); - zend_string *const_TYPE_ARRAY_name = zend_string_init_interned("TYPE_ARRAY", sizeof("TYPE_ARRAY") - 1, 1); + zend_string *const_TYPE_ARRAY_name = zend_string_init_interned("TYPE_ARRAY", sizeof("TYPE_ARRAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_ARRAY_name, &const_TYPE_ARRAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_ARRAY_name); + zend_string_release_ex(const_TYPE_ARRAY_name, true); zval const_TYPE_STRUCT_value; ZVAL_LONG(&const_TYPE_STRUCT_value, ZEND_FFI_TYPE_STRUCT); - zend_string *const_TYPE_STRUCT_name = zend_string_init_interned("TYPE_STRUCT", sizeof("TYPE_STRUCT") - 1, 1); + zend_string *const_TYPE_STRUCT_name = zend_string_init_interned("TYPE_STRUCT", sizeof("TYPE_STRUCT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_STRUCT_name, &const_TYPE_STRUCT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_STRUCT_name); + zend_string_release_ex(const_TYPE_STRUCT_name, true); zval const_ATTR_CONST_value; ZVAL_LONG(&const_ATTR_CONST_value, ZEND_FFI_ATTR_CONST); - zend_string *const_ATTR_CONST_name = zend_string_init_interned("ATTR_CONST", sizeof("ATTR_CONST") - 1, 1); + zend_string *const_ATTR_CONST_name = zend_string_init_interned("ATTR_CONST", sizeof("ATTR_CONST") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CONST_name, &const_ATTR_CONST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CONST_name); + zend_string_release_ex(const_ATTR_CONST_name, true); zval const_ATTR_INCOMPLETE_TAG_value; ZVAL_LONG(&const_ATTR_INCOMPLETE_TAG_value, ZEND_FFI_ATTR_INCOMPLETE_TAG); - zend_string *const_ATTR_INCOMPLETE_TAG_name = zend_string_init_interned("ATTR_INCOMPLETE_TAG", sizeof("ATTR_INCOMPLETE_TAG") - 1, 1); + zend_string *const_ATTR_INCOMPLETE_TAG_name = zend_string_init_interned("ATTR_INCOMPLETE_TAG", sizeof("ATTR_INCOMPLETE_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_INCOMPLETE_TAG_name, &const_ATTR_INCOMPLETE_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_INCOMPLETE_TAG_name); + zend_string_release_ex(const_ATTR_INCOMPLETE_TAG_name, true); zval const_ATTR_VARIADIC_value; ZVAL_LONG(&const_ATTR_VARIADIC_value, ZEND_FFI_ATTR_VARIADIC); - zend_string *const_ATTR_VARIADIC_name = zend_string_init_interned("ATTR_VARIADIC", sizeof("ATTR_VARIADIC") - 1, 1); + zend_string *const_ATTR_VARIADIC_name = zend_string_init_interned("ATTR_VARIADIC", sizeof("ATTR_VARIADIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_VARIADIC_name, &const_ATTR_VARIADIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_VARIADIC_name); + zend_string_release_ex(const_ATTR_VARIADIC_name, true); zval const_ATTR_INCOMPLETE_ARRAY_value; ZVAL_LONG(&const_ATTR_INCOMPLETE_ARRAY_value, ZEND_FFI_ATTR_INCOMPLETE_ARRAY); - zend_string *const_ATTR_INCOMPLETE_ARRAY_name = zend_string_init_interned("ATTR_INCOMPLETE_ARRAY", sizeof("ATTR_INCOMPLETE_ARRAY") - 1, 1); + zend_string *const_ATTR_INCOMPLETE_ARRAY_name = zend_string_init_interned("ATTR_INCOMPLETE_ARRAY", sizeof("ATTR_INCOMPLETE_ARRAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_INCOMPLETE_ARRAY_name, &const_ATTR_INCOMPLETE_ARRAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_INCOMPLETE_ARRAY_name); + zend_string_release_ex(const_ATTR_INCOMPLETE_ARRAY_name, true); zval const_ATTR_VLA_value; ZVAL_LONG(&const_ATTR_VLA_value, ZEND_FFI_ATTR_VLA); - zend_string *const_ATTR_VLA_name = zend_string_init_interned("ATTR_VLA", sizeof("ATTR_VLA") - 1, 1); + zend_string *const_ATTR_VLA_name = zend_string_init_interned("ATTR_VLA", sizeof("ATTR_VLA") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_VLA_name, &const_ATTR_VLA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_VLA_name); + zend_string_release_ex(const_ATTR_VLA_name, true); zval const_ATTR_UNION_value; ZVAL_LONG(&const_ATTR_UNION_value, ZEND_FFI_ATTR_UNION); - zend_string *const_ATTR_UNION_name = zend_string_init_interned("ATTR_UNION", sizeof("ATTR_UNION") - 1, 1); + zend_string *const_ATTR_UNION_name = zend_string_init_interned("ATTR_UNION", sizeof("ATTR_UNION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_UNION_name, &const_ATTR_UNION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_UNION_name); + zend_string_release_ex(const_ATTR_UNION_name, true); zval const_ATTR_PACKED_value; ZVAL_LONG(&const_ATTR_PACKED_value, ZEND_FFI_ATTR_PACKED); - zend_string *const_ATTR_PACKED_name = zend_string_init_interned("ATTR_PACKED", sizeof("ATTR_PACKED") - 1, 1); + zend_string *const_ATTR_PACKED_name = zend_string_init_interned("ATTR_PACKED", sizeof("ATTR_PACKED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_PACKED_name, &const_ATTR_PACKED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_PACKED_name); + zend_string_release_ex(const_ATTR_PACKED_name, true); zval const_ATTR_MS_STRUCT_value; ZVAL_LONG(&const_ATTR_MS_STRUCT_value, ZEND_FFI_ATTR_MS_STRUCT); - zend_string *const_ATTR_MS_STRUCT_name = zend_string_init_interned("ATTR_MS_STRUCT", sizeof("ATTR_MS_STRUCT") - 1, 1); + zend_string *const_ATTR_MS_STRUCT_name = zend_string_init_interned("ATTR_MS_STRUCT", sizeof("ATTR_MS_STRUCT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_MS_STRUCT_name, &const_ATTR_MS_STRUCT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_MS_STRUCT_name); + zend_string_release_ex(const_ATTR_MS_STRUCT_name, true); zval const_ATTR_GCC_STRUCT_value; ZVAL_LONG(&const_ATTR_GCC_STRUCT_value, ZEND_FFI_ATTR_GCC_STRUCT); - zend_string *const_ATTR_GCC_STRUCT_name = zend_string_init_interned("ATTR_GCC_STRUCT", sizeof("ATTR_GCC_STRUCT") - 1, 1); + zend_string *const_ATTR_GCC_STRUCT_name = zend_string_init_interned("ATTR_GCC_STRUCT", sizeof("ATTR_GCC_STRUCT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_GCC_STRUCT_name, &const_ATTR_GCC_STRUCT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_GCC_STRUCT_name); + zend_string_release_ex(const_ATTR_GCC_STRUCT_name, true); zval const_ABI_DEFAULT_value; ZVAL_LONG(&const_ABI_DEFAULT_value, ZEND_FFI_ABI_DEFAULT); - zend_string *const_ABI_DEFAULT_name = zend_string_init_interned("ABI_DEFAULT", sizeof("ABI_DEFAULT") - 1, 1); + zend_string *const_ABI_DEFAULT_name = zend_string_init_interned("ABI_DEFAULT", sizeof("ABI_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_DEFAULT_name, &const_ABI_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_DEFAULT_name); + zend_string_release_ex(const_ABI_DEFAULT_name, true); zval const_ABI_CDECL_value; ZVAL_LONG(&const_ABI_CDECL_value, ZEND_FFI_ABI_CDECL); - zend_string *const_ABI_CDECL_name = zend_string_init_interned("ABI_CDECL", sizeof("ABI_CDECL") - 1, 1); + zend_string *const_ABI_CDECL_name = zend_string_init_interned("ABI_CDECL", sizeof("ABI_CDECL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_CDECL_name, &const_ABI_CDECL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_CDECL_name); + zend_string_release_ex(const_ABI_CDECL_name, true); zval const_ABI_FASTCALL_value; ZVAL_LONG(&const_ABI_FASTCALL_value, ZEND_FFI_ABI_FASTCALL); - zend_string *const_ABI_FASTCALL_name = zend_string_init_interned("ABI_FASTCALL", sizeof("ABI_FASTCALL") - 1, 1); + zend_string *const_ABI_FASTCALL_name = zend_string_init_interned("ABI_FASTCALL", sizeof("ABI_FASTCALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_FASTCALL_name, &const_ABI_FASTCALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_FASTCALL_name); + zend_string_release_ex(const_ABI_FASTCALL_name, true); zval const_ABI_THISCALL_value; ZVAL_LONG(&const_ABI_THISCALL_value, ZEND_FFI_ABI_THISCALL); - zend_string *const_ABI_THISCALL_name = zend_string_init_interned("ABI_THISCALL", sizeof("ABI_THISCALL") - 1, 1); + zend_string *const_ABI_THISCALL_name = zend_string_init_interned("ABI_THISCALL", sizeof("ABI_THISCALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_THISCALL_name, &const_ABI_THISCALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_THISCALL_name); + zend_string_release_ex(const_ABI_THISCALL_name, true); zval const_ABI_STDCALL_value; ZVAL_LONG(&const_ABI_STDCALL_value, ZEND_FFI_ABI_STDCALL); - zend_string *const_ABI_STDCALL_name = zend_string_init_interned("ABI_STDCALL", sizeof("ABI_STDCALL") - 1, 1); + zend_string *const_ABI_STDCALL_name = zend_string_init_interned("ABI_STDCALL", sizeof("ABI_STDCALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_STDCALL_name, &const_ABI_STDCALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_STDCALL_name); + zend_string_release_ex(const_ABI_STDCALL_name, true); zval const_ABI_PASCAL_value; ZVAL_LONG(&const_ABI_PASCAL_value, ZEND_FFI_ABI_PASCAL); - zend_string *const_ABI_PASCAL_name = zend_string_init_interned("ABI_PASCAL", sizeof("ABI_PASCAL") - 1, 1); + zend_string *const_ABI_PASCAL_name = zend_string_init_interned("ABI_PASCAL", sizeof("ABI_PASCAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_PASCAL_name, &const_ABI_PASCAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_PASCAL_name); + zend_string_release_ex(const_ABI_PASCAL_name, true); zval const_ABI_REGISTER_value; ZVAL_LONG(&const_ABI_REGISTER_value, ZEND_FFI_ABI_REGISTER); - zend_string *const_ABI_REGISTER_name = zend_string_init_interned("ABI_REGISTER", sizeof("ABI_REGISTER") - 1, 1); + zend_string *const_ABI_REGISTER_name = zend_string_init_interned("ABI_REGISTER", sizeof("ABI_REGISTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_REGISTER_name, &const_ABI_REGISTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_REGISTER_name); + zend_string_release_ex(const_ABI_REGISTER_name, true); zval const_ABI_MS_value; ZVAL_LONG(&const_ABI_MS_value, ZEND_FFI_ABI_MS); - zend_string *const_ABI_MS_name = zend_string_init_interned("ABI_MS", sizeof("ABI_MS") - 1, 1); + zend_string *const_ABI_MS_name = zend_string_init_interned("ABI_MS", sizeof("ABI_MS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_MS_name, &const_ABI_MS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_MS_name); + zend_string_release_ex(const_ABI_MS_name, true); zval const_ABI_SYSV_value; ZVAL_LONG(&const_ABI_SYSV_value, ZEND_FFI_ABI_SYSV); - zend_string *const_ABI_SYSV_name = zend_string_init_interned("ABI_SYSV", sizeof("ABI_SYSV") - 1, 1); + zend_string *const_ABI_SYSV_name = zend_string_init_interned("ABI_SYSV", sizeof("ABI_SYSV") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_SYSV_name, &const_ABI_SYSV_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_SYSV_name); + zend_string_release_ex(const_ABI_SYSV_name, true); zval const_ABI_VECTORCALL_value; ZVAL_LONG(&const_ABI_VECTORCALL_value, ZEND_FFI_ABI_VECTORCALL); - zend_string *const_ABI_VECTORCALL_name = zend_string_init_interned("ABI_VECTORCALL", sizeof("ABI_VECTORCALL") - 1, 1); + zend_string *const_ABI_VECTORCALL_name = zend_string_init_interned("ABI_VECTORCALL", sizeof("ABI_VECTORCALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ABI_VECTORCALL_name, &const_ABI_VECTORCALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ABI_VECTORCALL_name); + zend_string_release_ex(const_ABI_VECTORCALL_name, true); return class_entry; } diff --git a/ext/intl/breakiterator/breakiterator_arginfo.h b/ext/intl/breakiterator/breakiterator_arginfo.h index 9475f5e987fc6..afaad17f03dbf 100644 --- a/ext/intl/breakiterator/breakiterator_arginfo.h +++ b/ext/intl/breakiterator/breakiterator_arginfo.h @@ -161,117 +161,117 @@ static zend_class_entry *register_class_IntlBreakIterator(zend_class_entry *clas zval const_DONE_value; ZVAL_LONG(&const_DONE_value, BreakIterator::DONE); - zend_string *const_DONE_name = zend_string_init_interned("DONE", sizeof("DONE") - 1, 1); + zend_string *const_DONE_name = zend_string_init_interned("DONE", sizeof("DONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DONE_name, &const_DONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DONE_name); + zend_string_release_ex(const_DONE_name, true); zval const_WORD_NONE_value; ZVAL_LONG(&const_WORD_NONE_value, UBRK_WORD_NONE); - zend_string *const_WORD_NONE_name = zend_string_init_interned("WORD_NONE", sizeof("WORD_NONE") - 1, 1); + zend_string *const_WORD_NONE_name = zend_string_init_interned("WORD_NONE", sizeof("WORD_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_NONE_name, &const_WORD_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_NONE_name); + zend_string_release_ex(const_WORD_NONE_name, true); zval const_WORD_NONE_LIMIT_value; ZVAL_LONG(&const_WORD_NONE_LIMIT_value, UBRK_WORD_NONE_LIMIT); - zend_string *const_WORD_NONE_LIMIT_name = zend_string_init_interned("WORD_NONE_LIMIT", sizeof("WORD_NONE_LIMIT") - 1, 1); + zend_string *const_WORD_NONE_LIMIT_name = zend_string_init_interned("WORD_NONE_LIMIT", sizeof("WORD_NONE_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_NONE_LIMIT_name, &const_WORD_NONE_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_NONE_LIMIT_name); + zend_string_release_ex(const_WORD_NONE_LIMIT_name, true); zval const_WORD_NUMBER_value; ZVAL_LONG(&const_WORD_NUMBER_value, UBRK_WORD_NUMBER); - zend_string *const_WORD_NUMBER_name = zend_string_init_interned("WORD_NUMBER", sizeof("WORD_NUMBER") - 1, 1); + zend_string *const_WORD_NUMBER_name = zend_string_init_interned("WORD_NUMBER", sizeof("WORD_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_NUMBER_name, &const_WORD_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_NUMBER_name); + zend_string_release_ex(const_WORD_NUMBER_name, true); zval const_WORD_NUMBER_LIMIT_value; ZVAL_LONG(&const_WORD_NUMBER_LIMIT_value, UBRK_WORD_NUMBER_LIMIT); - zend_string *const_WORD_NUMBER_LIMIT_name = zend_string_init_interned("WORD_NUMBER_LIMIT", sizeof("WORD_NUMBER_LIMIT") - 1, 1); + zend_string *const_WORD_NUMBER_LIMIT_name = zend_string_init_interned("WORD_NUMBER_LIMIT", sizeof("WORD_NUMBER_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_NUMBER_LIMIT_name, &const_WORD_NUMBER_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_NUMBER_LIMIT_name); + zend_string_release_ex(const_WORD_NUMBER_LIMIT_name, true); zval const_WORD_LETTER_value; ZVAL_LONG(&const_WORD_LETTER_value, UBRK_WORD_LETTER); - zend_string *const_WORD_LETTER_name = zend_string_init_interned("WORD_LETTER", sizeof("WORD_LETTER") - 1, 1); + zend_string *const_WORD_LETTER_name = zend_string_init_interned("WORD_LETTER", sizeof("WORD_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_LETTER_name, &const_WORD_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_LETTER_name); + zend_string_release_ex(const_WORD_LETTER_name, true); zval const_WORD_LETTER_LIMIT_value; ZVAL_LONG(&const_WORD_LETTER_LIMIT_value, UBRK_WORD_LETTER_LIMIT); - zend_string *const_WORD_LETTER_LIMIT_name = zend_string_init_interned("WORD_LETTER_LIMIT", sizeof("WORD_LETTER_LIMIT") - 1, 1); + zend_string *const_WORD_LETTER_LIMIT_name = zend_string_init_interned("WORD_LETTER_LIMIT", sizeof("WORD_LETTER_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_LETTER_LIMIT_name, &const_WORD_LETTER_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_LETTER_LIMIT_name); + zend_string_release_ex(const_WORD_LETTER_LIMIT_name, true); zval const_WORD_KANA_value; ZVAL_LONG(&const_WORD_KANA_value, UBRK_WORD_KANA); - zend_string *const_WORD_KANA_name = zend_string_init_interned("WORD_KANA", sizeof("WORD_KANA") - 1, 1); + zend_string *const_WORD_KANA_name = zend_string_init_interned("WORD_KANA", sizeof("WORD_KANA") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_KANA_name, &const_WORD_KANA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_KANA_name); + zend_string_release_ex(const_WORD_KANA_name, true); zval const_WORD_KANA_LIMIT_value; ZVAL_LONG(&const_WORD_KANA_LIMIT_value, UBRK_WORD_KANA_LIMIT); - zend_string *const_WORD_KANA_LIMIT_name = zend_string_init_interned("WORD_KANA_LIMIT", sizeof("WORD_KANA_LIMIT") - 1, 1); + zend_string *const_WORD_KANA_LIMIT_name = zend_string_init_interned("WORD_KANA_LIMIT", sizeof("WORD_KANA_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_KANA_LIMIT_name, &const_WORD_KANA_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_KANA_LIMIT_name); + zend_string_release_ex(const_WORD_KANA_LIMIT_name, true); zval const_WORD_IDEO_value; ZVAL_LONG(&const_WORD_IDEO_value, UBRK_WORD_IDEO); - zend_string *const_WORD_IDEO_name = zend_string_init_interned("WORD_IDEO", sizeof("WORD_IDEO") - 1, 1); + zend_string *const_WORD_IDEO_name = zend_string_init_interned("WORD_IDEO", sizeof("WORD_IDEO") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_IDEO_name, &const_WORD_IDEO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_IDEO_name); + zend_string_release_ex(const_WORD_IDEO_name, true); zval const_WORD_IDEO_LIMIT_value; ZVAL_LONG(&const_WORD_IDEO_LIMIT_value, UBRK_WORD_IDEO_LIMIT); - zend_string *const_WORD_IDEO_LIMIT_name = zend_string_init_interned("WORD_IDEO_LIMIT", sizeof("WORD_IDEO_LIMIT") - 1, 1); + zend_string *const_WORD_IDEO_LIMIT_name = zend_string_init_interned("WORD_IDEO_LIMIT", sizeof("WORD_IDEO_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WORD_IDEO_LIMIT_name, &const_WORD_IDEO_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WORD_IDEO_LIMIT_name); + zend_string_release_ex(const_WORD_IDEO_LIMIT_name, true); zval const_LINE_SOFT_value; ZVAL_LONG(&const_LINE_SOFT_value, UBRK_LINE_SOFT); - zend_string *const_LINE_SOFT_name = zend_string_init_interned("LINE_SOFT", sizeof("LINE_SOFT") - 1, 1); + zend_string *const_LINE_SOFT_name = zend_string_init_interned("LINE_SOFT", sizeof("LINE_SOFT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LINE_SOFT_name, &const_LINE_SOFT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LINE_SOFT_name); + zend_string_release_ex(const_LINE_SOFT_name, true); zval const_LINE_SOFT_LIMIT_value; ZVAL_LONG(&const_LINE_SOFT_LIMIT_value, UBRK_LINE_SOFT_LIMIT); - zend_string *const_LINE_SOFT_LIMIT_name = zend_string_init_interned("LINE_SOFT_LIMIT", sizeof("LINE_SOFT_LIMIT") - 1, 1); + zend_string *const_LINE_SOFT_LIMIT_name = zend_string_init_interned("LINE_SOFT_LIMIT", sizeof("LINE_SOFT_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LINE_SOFT_LIMIT_name, &const_LINE_SOFT_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LINE_SOFT_LIMIT_name); + zend_string_release_ex(const_LINE_SOFT_LIMIT_name, true); zval const_LINE_HARD_value; ZVAL_LONG(&const_LINE_HARD_value, UBRK_LINE_HARD); - zend_string *const_LINE_HARD_name = zend_string_init_interned("LINE_HARD", sizeof("LINE_HARD") - 1, 1); + zend_string *const_LINE_HARD_name = zend_string_init_interned("LINE_HARD", sizeof("LINE_HARD") - 1, true); zend_declare_typed_class_constant(class_entry, const_LINE_HARD_name, &const_LINE_HARD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LINE_HARD_name); + zend_string_release_ex(const_LINE_HARD_name, true); zval const_LINE_HARD_LIMIT_value; ZVAL_LONG(&const_LINE_HARD_LIMIT_value, UBRK_LINE_HARD_LIMIT); - zend_string *const_LINE_HARD_LIMIT_name = zend_string_init_interned("LINE_HARD_LIMIT", sizeof("LINE_HARD_LIMIT") - 1, 1); + zend_string *const_LINE_HARD_LIMIT_name = zend_string_init_interned("LINE_HARD_LIMIT", sizeof("LINE_HARD_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LINE_HARD_LIMIT_name, &const_LINE_HARD_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LINE_HARD_LIMIT_name); + zend_string_release_ex(const_LINE_HARD_LIMIT_name, true); zval const_SENTENCE_TERM_value; ZVAL_LONG(&const_SENTENCE_TERM_value, UBRK_SENTENCE_TERM); - zend_string *const_SENTENCE_TERM_name = zend_string_init_interned("SENTENCE_TERM", sizeof("SENTENCE_TERM") - 1, 1); + zend_string *const_SENTENCE_TERM_name = zend_string_init_interned("SENTENCE_TERM", sizeof("SENTENCE_TERM") - 1, true); zend_declare_typed_class_constant(class_entry, const_SENTENCE_TERM_name, &const_SENTENCE_TERM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SENTENCE_TERM_name); + zend_string_release_ex(const_SENTENCE_TERM_name, true); zval const_SENTENCE_TERM_LIMIT_value; ZVAL_LONG(&const_SENTENCE_TERM_LIMIT_value, UBRK_SENTENCE_TERM_LIMIT); - zend_string *const_SENTENCE_TERM_LIMIT_name = zend_string_init_interned("SENTENCE_TERM_LIMIT", sizeof("SENTENCE_TERM_LIMIT") - 1, 1); + zend_string *const_SENTENCE_TERM_LIMIT_name = zend_string_init_interned("SENTENCE_TERM_LIMIT", sizeof("SENTENCE_TERM_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SENTENCE_TERM_LIMIT_name, &const_SENTENCE_TERM_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SENTENCE_TERM_LIMIT_name); + zend_string_release_ex(const_SENTENCE_TERM_LIMIT_name, true); zval const_SENTENCE_SEP_value; ZVAL_LONG(&const_SENTENCE_SEP_value, UBRK_SENTENCE_SEP); - zend_string *const_SENTENCE_SEP_name = zend_string_init_interned("SENTENCE_SEP", sizeof("SENTENCE_SEP") - 1, 1); + zend_string *const_SENTENCE_SEP_name = zend_string_init_interned("SENTENCE_SEP", sizeof("SENTENCE_SEP") - 1, true); zend_declare_typed_class_constant(class_entry, const_SENTENCE_SEP_name, &const_SENTENCE_SEP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SENTENCE_SEP_name); + zend_string_release_ex(const_SENTENCE_SEP_name, true); zval const_SENTENCE_SEP_LIMIT_value; ZVAL_LONG(&const_SENTENCE_SEP_LIMIT_value, UBRK_SENTENCE_SEP_LIMIT); - zend_string *const_SENTENCE_SEP_LIMIT_name = zend_string_init_interned("SENTENCE_SEP_LIMIT", sizeof("SENTENCE_SEP_LIMIT") - 1, 1); + zend_string *const_SENTENCE_SEP_LIMIT_name = zend_string_init_interned("SENTENCE_SEP_LIMIT", sizeof("SENTENCE_SEP_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SENTENCE_SEP_LIMIT_name, &const_SENTENCE_SEP_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SENTENCE_SEP_LIMIT_name); + zend_string_release_ex(const_SENTENCE_SEP_LIMIT_name, true); return class_entry; } diff --git a/ext/intl/breakiterator/breakiterator_iterators_arginfo.h b/ext/intl/breakiterator/breakiterator_iterators_arginfo.h index f83c0accf6bf4..f4d0975a897f8 100644 --- a/ext/intl/breakiterator/breakiterator_iterators_arginfo.h +++ b/ext/intl/breakiterator/breakiterator_iterators_arginfo.h @@ -25,21 +25,21 @@ static zend_class_entry *register_class_IntlPartsIterator(zend_class_entry *clas zval const_KEY_SEQUENTIAL_value; ZVAL_LONG(&const_KEY_SEQUENTIAL_value, PARTS_ITERATOR_KEY_SEQUENTIAL); - zend_string *const_KEY_SEQUENTIAL_name = zend_string_init_interned("KEY_SEQUENTIAL", sizeof("KEY_SEQUENTIAL") - 1, 1); + zend_string *const_KEY_SEQUENTIAL_name = zend_string_init_interned("KEY_SEQUENTIAL", sizeof("KEY_SEQUENTIAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_SEQUENTIAL_name, &const_KEY_SEQUENTIAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_SEQUENTIAL_name); + zend_string_release_ex(const_KEY_SEQUENTIAL_name, true); zval const_KEY_LEFT_value; ZVAL_LONG(&const_KEY_LEFT_value, PARTS_ITERATOR_KEY_LEFT); - zend_string *const_KEY_LEFT_name = zend_string_init_interned("KEY_LEFT", sizeof("KEY_LEFT") - 1, 1); + zend_string *const_KEY_LEFT_name = zend_string_init_interned("KEY_LEFT", sizeof("KEY_LEFT") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_LEFT_name, &const_KEY_LEFT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_LEFT_name); + zend_string_release_ex(const_KEY_LEFT_name, true); zval const_KEY_RIGHT_value; ZVAL_LONG(&const_KEY_RIGHT_value, PARTS_ITERATOR_KEY_RIGHT); - zend_string *const_KEY_RIGHT_name = zend_string_init_interned("KEY_RIGHT", sizeof("KEY_RIGHT") - 1, 1); + zend_string *const_KEY_RIGHT_name = zend_string_init_interned("KEY_RIGHT", sizeof("KEY_RIGHT") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_RIGHT_name, &const_KEY_RIGHT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_RIGHT_name); + zend_string_release_ex(const_KEY_RIGHT_name, true); return class_entry; } diff --git a/ext/intl/calendar/calendar_arginfo.h b/ext/intl/calendar/calendar_arginfo.h index 415113b613a2e..f9c5a018d9a8c 100644 --- a/ext/intl/calendar/calendar_arginfo.h +++ b/ext/intl/calendar/calendar_arginfo.h @@ -329,237 +329,237 @@ static zend_class_entry *register_class_IntlCalendar(void) zval const_FIELD_ERA_value; ZVAL_LONG(&const_FIELD_ERA_value, UCAL_ERA); - zend_string *const_FIELD_ERA_name = zend_string_init_interned("FIELD_ERA", sizeof("FIELD_ERA") - 1, 1); + zend_string *const_FIELD_ERA_name = zend_string_init_interned("FIELD_ERA", sizeof("FIELD_ERA") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_ERA_name, &const_FIELD_ERA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_ERA_name); + zend_string_release_ex(const_FIELD_ERA_name, true); zval const_FIELD_YEAR_value; ZVAL_LONG(&const_FIELD_YEAR_value, UCAL_YEAR); - zend_string *const_FIELD_YEAR_name = zend_string_init_interned("FIELD_YEAR", sizeof("FIELD_YEAR") - 1, 1); + zend_string *const_FIELD_YEAR_name = zend_string_init_interned("FIELD_YEAR", sizeof("FIELD_YEAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_YEAR_name, &const_FIELD_YEAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_YEAR_name); + zend_string_release_ex(const_FIELD_YEAR_name, true); zval const_FIELD_MONTH_value; ZVAL_LONG(&const_FIELD_MONTH_value, UCAL_MONTH); - zend_string *const_FIELD_MONTH_name = zend_string_init_interned("FIELD_MONTH", sizeof("FIELD_MONTH") - 1, 1); + zend_string *const_FIELD_MONTH_name = zend_string_init_interned("FIELD_MONTH", sizeof("FIELD_MONTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_MONTH_name, &const_FIELD_MONTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_MONTH_name); + zend_string_release_ex(const_FIELD_MONTH_name, true); zval const_FIELD_WEEK_OF_YEAR_value; ZVAL_LONG(&const_FIELD_WEEK_OF_YEAR_value, UCAL_WEEK_OF_YEAR); - zend_string *const_FIELD_WEEK_OF_YEAR_name = zend_string_init_interned("FIELD_WEEK_OF_YEAR", sizeof("FIELD_WEEK_OF_YEAR") - 1, 1); + zend_string *const_FIELD_WEEK_OF_YEAR_name = zend_string_init_interned("FIELD_WEEK_OF_YEAR", sizeof("FIELD_WEEK_OF_YEAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_WEEK_OF_YEAR_name, &const_FIELD_WEEK_OF_YEAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_WEEK_OF_YEAR_name); + zend_string_release_ex(const_FIELD_WEEK_OF_YEAR_name, true); zval const_FIELD_WEEK_OF_MONTH_value; ZVAL_LONG(&const_FIELD_WEEK_OF_MONTH_value, UCAL_WEEK_OF_MONTH); - zend_string *const_FIELD_WEEK_OF_MONTH_name = zend_string_init_interned("FIELD_WEEK_OF_MONTH", sizeof("FIELD_WEEK_OF_MONTH") - 1, 1); + zend_string *const_FIELD_WEEK_OF_MONTH_name = zend_string_init_interned("FIELD_WEEK_OF_MONTH", sizeof("FIELD_WEEK_OF_MONTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_WEEK_OF_MONTH_name, &const_FIELD_WEEK_OF_MONTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_WEEK_OF_MONTH_name); + zend_string_release_ex(const_FIELD_WEEK_OF_MONTH_name, true); zval const_FIELD_DATE_value; ZVAL_LONG(&const_FIELD_DATE_value, UCAL_DATE); - zend_string *const_FIELD_DATE_name = zend_string_init_interned("FIELD_DATE", sizeof("FIELD_DATE") - 1, 1); + zend_string *const_FIELD_DATE_name = zend_string_init_interned("FIELD_DATE", sizeof("FIELD_DATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DATE_name, &const_FIELD_DATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DATE_name); + zend_string_release_ex(const_FIELD_DATE_name, true); zval const_FIELD_DAY_OF_YEAR_value; ZVAL_LONG(&const_FIELD_DAY_OF_YEAR_value, UCAL_DAY_OF_YEAR); - zend_string *const_FIELD_DAY_OF_YEAR_name = zend_string_init_interned("FIELD_DAY_OF_YEAR", sizeof("FIELD_DAY_OF_YEAR") - 1, 1); + zend_string *const_FIELD_DAY_OF_YEAR_name = zend_string_init_interned("FIELD_DAY_OF_YEAR", sizeof("FIELD_DAY_OF_YEAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DAY_OF_YEAR_name, &const_FIELD_DAY_OF_YEAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DAY_OF_YEAR_name); + zend_string_release_ex(const_FIELD_DAY_OF_YEAR_name, true); zval const_FIELD_DAY_OF_WEEK_value; ZVAL_LONG(&const_FIELD_DAY_OF_WEEK_value, UCAL_DAY_OF_WEEK); - zend_string *const_FIELD_DAY_OF_WEEK_name = zend_string_init_interned("FIELD_DAY_OF_WEEK", sizeof("FIELD_DAY_OF_WEEK") - 1, 1); + zend_string *const_FIELD_DAY_OF_WEEK_name = zend_string_init_interned("FIELD_DAY_OF_WEEK", sizeof("FIELD_DAY_OF_WEEK") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DAY_OF_WEEK_name, &const_FIELD_DAY_OF_WEEK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DAY_OF_WEEK_name); + zend_string_release_ex(const_FIELD_DAY_OF_WEEK_name, true); zval const_FIELD_DAY_OF_WEEK_IN_MONTH_value; ZVAL_LONG(&const_FIELD_DAY_OF_WEEK_IN_MONTH_value, UCAL_DAY_OF_WEEK_IN_MONTH); - zend_string *const_FIELD_DAY_OF_WEEK_IN_MONTH_name = zend_string_init_interned("FIELD_DAY_OF_WEEK_IN_MONTH", sizeof("FIELD_DAY_OF_WEEK_IN_MONTH") - 1, 1); + zend_string *const_FIELD_DAY_OF_WEEK_IN_MONTH_name = zend_string_init_interned("FIELD_DAY_OF_WEEK_IN_MONTH", sizeof("FIELD_DAY_OF_WEEK_IN_MONTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DAY_OF_WEEK_IN_MONTH_name, &const_FIELD_DAY_OF_WEEK_IN_MONTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DAY_OF_WEEK_IN_MONTH_name); + zend_string_release_ex(const_FIELD_DAY_OF_WEEK_IN_MONTH_name, true); zval const_FIELD_AM_PM_value; ZVAL_LONG(&const_FIELD_AM_PM_value, UCAL_AM_PM); - zend_string *const_FIELD_AM_PM_name = zend_string_init_interned("FIELD_AM_PM", sizeof("FIELD_AM_PM") - 1, 1); + zend_string *const_FIELD_AM_PM_name = zend_string_init_interned("FIELD_AM_PM", sizeof("FIELD_AM_PM") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_AM_PM_name, &const_FIELD_AM_PM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_AM_PM_name); + zend_string_release_ex(const_FIELD_AM_PM_name, true); zval const_FIELD_HOUR_value; ZVAL_LONG(&const_FIELD_HOUR_value, UCAL_HOUR); - zend_string *const_FIELD_HOUR_name = zend_string_init_interned("FIELD_HOUR", sizeof("FIELD_HOUR") - 1, 1); + zend_string *const_FIELD_HOUR_name = zend_string_init_interned("FIELD_HOUR", sizeof("FIELD_HOUR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_HOUR_name, &const_FIELD_HOUR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_HOUR_name); + zend_string_release_ex(const_FIELD_HOUR_name, true); zval const_FIELD_HOUR_OF_DAY_value; ZVAL_LONG(&const_FIELD_HOUR_OF_DAY_value, UCAL_HOUR_OF_DAY); - zend_string *const_FIELD_HOUR_OF_DAY_name = zend_string_init_interned("FIELD_HOUR_OF_DAY", sizeof("FIELD_HOUR_OF_DAY") - 1, 1); + zend_string *const_FIELD_HOUR_OF_DAY_name = zend_string_init_interned("FIELD_HOUR_OF_DAY", sizeof("FIELD_HOUR_OF_DAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_HOUR_OF_DAY_name, &const_FIELD_HOUR_OF_DAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_HOUR_OF_DAY_name); + zend_string_release_ex(const_FIELD_HOUR_OF_DAY_name, true); zval const_FIELD_MINUTE_value; ZVAL_LONG(&const_FIELD_MINUTE_value, UCAL_MINUTE); - zend_string *const_FIELD_MINUTE_name = zend_string_init_interned("FIELD_MINUTE", sizeof("FIELD_MINUTE") - 1, 1); + zend_string *const_FIELD_MINUTE_name = zend_string_init_interned("FIELD_MINUTE", sizeof("FIELD_MINUTE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_MINUTE_name, &const_FIELD_MINUTE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_MINUTE_name); + zend_string_release_ex(const_FIELD_MINUTE_name, true); zval const_FIELD_SECOND_value; ZVAL_LONG(&const_FIELD_SECOND_value, UCAL_SECOND); - zend_string *const_FIELD_SECOND_name = zend_string_init_interned("FIELD_SECOND", sizeof("FIELD_SECOND") - 1, 1); + zend_string *const_FIELD_SECOND_name = zend_string_init_interned("FIELD_SECOND", sizeof("FIELD_SECOND") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_SECOND_name, &const_FIELD_SECOND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_SECOND_name); + zend_string_release_ex(const_FIELD_SECOND_name, true); zval const_FIELD_MILLISECOND_value; ZVAL_LONG(&const_FIELD_MILLISECOND_value, UCAL_MILLISECOND); - zend_string *const_FIELD_MILLISECOND_name = zend_string_init_interned("FIELD_MILLISECOND", sizeof("FIELD_MILLISECOND") - 1, 1); + zend_string *const_FIELD_MILLISECOND_name = zend_string_init_interned("FIELD_MILLISECOND", sizeof("FIELD_MILLISECOND") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_MILLISECOND_name, &const_FIELD_MILLISECOND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_MILLISECOND_name); + zend_string_release_ex(const_FIELD_MILLISECOND_name, true); zval const_FIELD_ZONE_OFFSET_value; ZVAL_LONG(&const_FIELD_ZONE_OFFSET_value, UCAL_ZONE_OFFSET); - zend_string *const_FIELD_ZONE_OFFSET_name = zend_string_init_interned("FIELD_ZONE_OFFSET", sizeof("FIELD_ZONE_OFFSET") - 1, 1); + zend_string *const_FIELD_ZONE_OFFSET_name = zend_string_init_interned("FIELD_ZONE_OFFSET", sizeof("FIELD_ZONE_OFFSET") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_ZONE_OFFSET_name, &const_FIELD_ZONE_OFFSET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_ZONE_OFFSET_name); + zend_string_release_ex(const_FIELD_ZONE_OFFSET_name, true); zval const_FIELD_DST_OFFSET_value; ZVAL_LONG(&const_FIELD_DST_OFFSET_value, UCAL_DST_OFFSET); - zend_string *const_FIELD_DST_OFFSET_name = zend_string_init_interned("FIELD_DST_OFFSET", sizeof("FIELD_DST_OFFSET") - 1, 1); + zend_string *const_FIELD_DST_OFFSET_name = zend_string_init_interned("FIELD_DST_OFFSET", sizeof("FIELD_DST_OFFSET") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DST_OFFSET_name, &const_FIELD_DST_OFFSET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DST_OFFSET_name); + zend_string_release_ex(const_FIELD_DST_OFFSET_name, true); zval const_FIELD_YEAR_WOY_value; ZVAL_LONG(&const_FIELD_YEAR_WOY_value, UCAL_YEAR_WOY); - zend_string *const_FIELD_YEAR_WOY_name = zend_string_init_interned("FIELD_YEAR_WOY", sizeof("FIELD_YEAR_WOY") - 1, 1); + zend_string *const_FIELD_YEAR_WOY_name = zend_string_init_interned("FIELD_YEAR_WOY", sizeof("FIELD_YEAR_WOY") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_YEAR_WOY_name, &const_FIELD_YEAR_WOY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_YEAR_WOY_name); + zend_string_release_ex(const_FIELD_YEAR_WOY_name, true); zval const_FIELD_DOW_LOCAL_value; ZVAL_LONG(&const_FIELD_DOW_LOCAL_value, UCAL_DOW_LOCAL); - zend_string *const_FIELD_DOW_LOCAL_name = zend_string_init_interned("FIELD_DOW_LOCAL", sizeof("FIELD_DOW_LOCAL") - 1, 1); + zend_string *const_FIELD_DOW_LOCAL_name = zend_string_init_interned("FIELD_DOW_LOCAL", sizeof("FIELD_DOW_LOCAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DOW_LOCAL_name, &const_FIELD_DOW_LOCAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DOW_LOCAL_name); + zend_string_release_ex(const_FIELD_DOW_LOCAL_name, true); zval const_FIELD_EXTENDED_YEAR_value; ZVAL_LONG(&const_FIELD_EXTENDED_YEAR_value, UCAL_EXTENDED_YEAR); - zend_string *const_FIELD_EXTENDED_YEAR_name = zend_string_init_interned("FIELD_EXTENDED_YEAR", sizeof("FIELD_EXTENDED_YEAR") - 1, 1); + zend_string *const_FIELD_EXTENDED_YEAR_name = zend_string_init_interned("FIELD_EXTENDED_YEAR", sizeof("FIELD_EXTENDED_YEAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_EXTENDED_YEAR_name, &const_FIELD_EXTENDED_YEAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_EXTENDED_YEAR_name); + zend_string_release_ex(const_FIELD_EXTENDED_YEAR_name, true); zval const_FIELD_JULIAN_DAY_value; ZVAL_LONG(&const_FIELD_JULIAN_DAY_value, UCAL_JULIAN_DAY); - zend_string *const_FIELD_JULIAN_DAY_name = zend_string_init_interned("FIELD_JULIAN_DAY", sizeof("FIELD_JULIAN_DAY") - 1, 1); + zend_string *const_FIELD_JULIAN_DAY_name = zend_string_init_interned("FIELD_JULIAN_DAY", sizeof("FIELD_JULIAN_DAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_JULIAN_DAY_name, &const_FIELD_JULIAN_DAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_JULIAN_DAY_name); + zend_string_release_ex(const_FIELD_JULIAN_DAY_name, true); zval const_FIELD_MILLISECONDS_IN_DAY_value; ZVAL_LONG(&const_FIELD_MILLISECONDS_IN_DAY_value, UCAL_MILLISECONDS_IN_DAY); - zend_string *const_FIELD_MILLISECONDS_IN_DAY_name = zend_string_init_interned("FIELD_MILLISECONDS_IN_DAY", sizeof("FIELD_MILLISECONDS_IN_DAY") - 1, 1); + zend_string *const_FIELD_MILLISECONDS_IN_DAY_name = zend_string_init_interned("FIELD_MILLISECONDS_IN_DAY", sizeof("FIELD_MILLISECONDS_IN_DAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_MILLISECONDS_IN_DAY_name, &const_FIELD_MILLISECONDS_IN_DAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_MILLISECONDS_IN_DAY_name); + zend_string_release_ex(const_FIELD_MILLISECONDS_IN_DAY_name, true); zval const_FIELD_IS_LEAP_MONTH_value; ZVAL_LONG(&const_FIELD_IS_LEAP_MONTH_value, UCAL_IS_LEAP_MONTH); - zend_string *const_FIELD_IS_LEAP_MONTH_name = zend_string_init_interned("FIELD_IS_LEAP_MONTH", sizeof("FIELD_IS_LEAP_MONTH") - 1, 1); + zend_string *const_FIELD_IS_LEAP_MONTH_name = zend_string_init_interned("FIELD_IS_LEAP_MONTH", sizeof("FIELD_IS_LEAP_MONTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_IS_LEAP_MONTH_name, &const_FIELD_IS_LEAP_MONTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_IS_LEAP_MONTH_name); + zend_string_release_ex(const_FIELD_IS_LEAP_MONTH_name, true); zval const_FIELD_FIELD_COUNT_value; ZVAL_LONG(&const_FIELD_FIELD_COUNT_value, UCAL_FIELD_COUNT); - zend_string *const_FIELD_FIELD_COUNT_name = zend_string_init_interned("FIELD_FIELD_COUNT", sizeof("FIELD_FIELD_COUNT") - 1, 1); + zend_string *const_FIELD_FIELD_COUNT_name = zend_string_init_interned("FIELD_FIELD_COUNT", sizeof("FIELD_FIELD_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_FIELD_COUNT_name, &const_FIELD_FIELD_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_FIELD_COUNT_name); + zend_string_release_ex(const_FIELD_FIELD_COUNT_name, true); zval const_FIELD_DAY_OF_MONTH_value; ZVAL_LONG(&const_FIELD_DAY_OF_MONTH_value, UCAL_DAY_OF_MONTH); - zend_string *const_FIELD_DAY_OF_MONTH_name = zend_string_init_interned("FIELD_DAY_OF_MONTH", sizeof("FIELD_DAY_OF_MONTH") - 1, 1); + zend_string *const_FIELD_DAY_OF_MONTH_name = zend_string_init_interned("FIELD_DAY_OF_MONTH", sizeof("FIELD_DAY_OF_MONTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FIELD_DAY_OF_MONTH_name, &const_FIELD_DAY_OF_MONTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FIELD_DAY_OF_MONTH_name); + zend_string_release_ex(const_FIELD_DAY_OF_MONTH_name, true); zval const_DOW_SUNDAY_value; ZVAL_LONG(&const_DOW_SUNDAY_value, UCAL_SUNDAY); - zend_string *const_DOW_SUNDAY_name = zend_string_init_interned("DOW_SUNDAY", sizeof("DOW_SUNDAY") - 1, 1); + zend_string *const_DOW_SUNDAY_name = zend_string_init_interned("DOW_SUNDAY", sizeof("DOW_SUNDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_SUNDAY_name, &const_DOW_SUNDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_SUNDAY_name); + zend_string_release_ex(const_DOW_SUNDAY_name, true); zval const_DOW_MONDAY_value; ZVAL_LONG(&const_DOW_MONDAY_value, UCAL_MONDAY); - zend_string *const_DOW_MONDAY_name = zend_string_init_interned("DOW_MONDAY", sizeof("DOW_MONDAY") - 1, 1); + zend_string *const_DOW_MONDAY_name = zend_string_init_interned("DOW_MONDAY", sizeof("DOW_MONDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_MONDAY_name, &const_DOW_MONDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_MONDAY_name); + zend_string_release_ex(const_DOW_MONDAY_name, true); zval const_DOW_TUESDAY_value; ZVAL_LONG(&const_DOW_TUESDAY_value, UCAL_TUESDAY); - zend_string *const_DOW_TUESDAY_name = zend_string_init_interned("DOW_TUESDAY", sizeof("DOW_TUESDAY") - 1, 1); + zend_string *const_DOW_TUESDAY_name = zend_string_init_interned("DOW_TUESDAY", sizeof("DOW_TUESDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_TUESDAY_name, &const_DOW_TUESDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_TUESDAY_name); + zend_string_release_ex(const_DOW_TUESDAY_name, true); zval const_DOW_WEDNESDAY_value; ZVAL_LONG(&const_DOW_WEDNESDAY_value, UCAL_WEDNESDAY); - zend_string *const_DOW_WEDNESDAY_name = zend_string_init_interned("DOW_WEDNESDAY", sizeof("DOW_WEDNESDAY") - 1, 1); + zend_string *const_DOW_WEDNESDAY_name = zend_string_init_interned("DOW_WEDNESDAY", sizeof("DOW_WEDNESDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_WEDNESDAY_name, &const_DOW_WEDNESDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_WEDNESDAY_name); + zend_string_release_ex(const_DOW_WEDNESDAY_name, true); zval const_DOW_THURSDAY_value; ZVAL_LONG(&const_DOW_THURSDAY_value, UCAL_THURSDAY); - zend_string *const_DOW_THURSDAY_name = zend_string_init_interned("DOW_THURSDAY", sizeof("DOW_THURSDAY") - 1, 1); + zend_string *const_DOW_THURSDAY_name = zend_string_init_interned("DOW_THURSDAY", sizeof("DOW_THURSDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_THURSDAY_name, &const_DOW_THURSDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_THURSDAY_name); + zend_string_release_ex(const_DOW_THURSDAY_name, true); zval const_DOW_FRIDAY_value; ZVAL_LONG(&const_DOW_FRIDAY_value, UCAL_FRIDAY); - zend_string *const_DOW_FRIDAY_name = zend_string_init_interned("DOW_FRIDAY", sizeof("DOW_FRIDAY") - 1, 1); + zend_string *const_DOW_FRIDAY_name = zend_string_init_interned("DOW_FRIDAY", sizeof("DOW_FRIDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_FRIDAY_name, &const_DOW_FRIDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_FRIDAY_name); + zend_string_release_ex(const_DOW_FRIDAY_name, true); zval const_DOW_SATURDAY_value; ZVAL_LONG(&const_DOW_SATURDAY_value, UCAL_SATURDAY); - zend_string *const_DOW_SATURDAY_name = zend_string_init_interned("DOW_SATURDAY", sizeof("DOW_SATURDAY") - 1, 1); + zend_string *const_DOW_SATURDAY_name = zend_string_init_interned("DOW_SATURDAY", sizeof("DOW_SATURDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_SATURDAY_name, &const_DOW_SATURDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_SATURDAY_name); + zend_string_release_ex(const_DOW_SATURDAY_name, true); zval const_DOW_TYPE_WEEKDAY_value; ZVAL_LONG(&const_DOW_TYPE_WEEKDAY_value, UCAL_WEEKDAY); - zend_string *const_DOW_TYPE_WEEKDAY_name = zend_string_init_interned("DOW_TYPE_WEEKDAY", sizeof("DOW_TYPE_WEEKDAY") - 1, 1); + zend_string *const_DOW_TYPE_WEEKDAY_name = zend_string_init_interned("DOW_TYPE_WEEKDAY", sizeof("DOW_TYPE_WEEKDAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_TYPE_WEEKDAY_name, &const_DOW_TYPE_WEEKDAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_TYPE_WEEKDAY_name); + zend_string_release_ex(const_DOW_TYPE_WEEKDAY_name, true); zval const_DOW_TYPE_WEEKEND_value; ZVAL_LONG(&const_DOW_TYPE_WEEKEND_value, UCAL_WEEKEND); - zend_string *const_DOW_TYPE_WEEKEND_name = zend_string_init_interned("DOW_TYPE_WEEKEND", sizeof("DOW_TYPE_WEEKEND") - 1, 1); + zend_string *const_DOW_TYPE_WEEKEND_name = zend_string_init_interned("DOW_TYPE_WEEKEND", sizeof("DOW_TYPE_WEEKEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_TYPE_WEEKEND_name, &const_DOW_TYPE_WEEKEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_TYPE_WEEKEND_name); + zend_string_release_ex(const_DOW_TYPE_WEEKEND_name, true); zval const_DOW_TYPE_WEEKEND_OFFSET_value; ZVAL_LONG(&const_DOW_TYPE_WEEKEND_OFFSET_value, UCAL_WEEKEND_ONSET); - zend_string *const_DOW_TYPE_WEEKEND_OFFSET_name = zend_string_init_interned("DOW_TYPE_WEEKEND_OFFSET", sizeof("DOW_TYPE_WEEKEND_OFFSET") - 1, 1); + zend_string *const_DOW_TYPE_WEEKEND_OFFSET_name = zend_string_init_interned("DOW_TYPE_WEEKEND_OFFSET", sizeof("DOW_TYPE_WEEKEND_OFFSET") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_TYPE_WEEKEND_OFFSET_name, &const_DOW_TYPE_WEEKEND_OFFSET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_TYPE_WEEKEND_OFFSET_name); + zend_string_release_ex(const_DOW_TYPE_WEEKEND_OFFSET_name, true); zval const_DOW_TYPE_WEEKEND_CEASE_value; ZVAL_LONG(&const_DOW_TYPE_WEEKEND_CEASE_value, UCAL_WEEKEND_CEASE); - zend_string *const_DOW_TYPE_WEEKEND_CEASE_name = zend_string_init_interned("DOW_TYPE_WEEKEND_CEASE", sizeof("DOW_TYPE_WEEKEND_CEASE") - 1, 1); + zend_string *const_DOW_TYPE_WEEKEND_CEASE_name = zend_string_init_interned("DOW_TYPE_WEEKEND_CEASE", sizeof("DOW_TYPE_WEEKEND_CEASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOW_TYPE_WEEKEND_CEASE_name, &const_DOW_TYPE_WEEKEND_CEASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOW_TYPE_WEEKEND_CEASE_name); + zend_string_release_ex(const_DOW_TYPE_WEEKEND_CEASE_name, true); zval const_WALLTIME_FIRST_value; ZVAL_LONG(&const_WALLTIME_FIRST_value, UCAL_WALLTIME_FIRST); - zend_string *const_WALLTIME_FIRST_name = zend_string_init_interned("WALLTIME_FIRST", sizeof("WALLTIME_FIRST") - 1, 1); + zend_string *const_WALLTIME_FIRST_name = zend_string_init_interned("WALLTIME_FIRST", sizeof("WALLTIME_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_WALLTIME_FIRST_name, &const_WALLTIME_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WALLTIME_FIRST_name); + zend_string_release_ex(const_WALLTIME_FIRST_name, true); zval const_WALLTIME_LAST_value; ZVAL_LONG(&const_WALLTIME_LAST_value, UCAL_WALLTIME_LAST); - zend_string *const_WALLTIME_LAST_name = zend_string_init_interned("WALLTIME_LAST", sizeof("WALLTIME_LAST") - 1, 1); + zend_string *const_WALLTIME_LAST_name = zend_string_init_interned("WALLTIME_LAST", sizeof("WALLTIME_LAST") - 1, true); zend_declare_typed_class_constant(class_entry, const_WALLTIME_LAST_name, &const_WALLTIME_LAST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WALLTIME_LAST_name); + zend_string_release_ex(const_WALLTIME_LAST_name, true); zval const_WALLTIME_NEXT_VALID_value; ZVAL_LONG(&const_WALLTIME_NEXT_VALID_value, UCAL_WALLTIME_NEXT_VALID); - zend_string *const_WALLTIME_NEXT_VALID_name = zend_string_init_interned("WALLTIME_NEXT_VALID", sizeof("WALLTIME_NEXT_VALID") - 1, 1); + zend_string *const_WALLTIME_NEXT_VALID_name = zend_string_init_interned("WALLTIME_NEXT_VALID", sizeof("WALLTIME_NEXT_VALID") - 1, true); zend_declare_typed_class_constant(class_entry, const_WALLTIME_NEXT_VALID_name, &const_WALLTIME_NEXT_VALID_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WALLTIME_NEXT_VALID_name); + zend_string_release_ex(const_WALLTIME_NEXT_VALID_name, true); return class_entry; } diff --git a/ext/intl/collator/collator_arginfo.h b/ext/intl/collator/collator_arginfo.h index 3f469b02facd4..a35adbd3d1e05 100644 --- a/ext/intl/collator/collator_arginfo.h +++ b/ext/intl/collator/collator_arginfo.h @@ -103,147 +103,147 @@ static zend_class_entry *register_class_Collator(void) zval const_DEFAULT_VALUE_value; ZVAL_LONG(&const_DEFAULT_VALUE_value, UCOL_DEFAULT); - zend_string *const_DEFAULT_VALUE_name = zend_string_init_interned("DEFAULT_VALUE", sizeof("DEFAULT_VALUE") - 1, 1); + zend_string *const_DEFAULT_VALUE_name = zend_string_init_interned("DEFAULT_VALUE", sizeof("DEFAULT_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULT_VALUE_name, &const_DEFAULT_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DEFAULT_VALUE_name); + zend_string_release_ex(const_DEFAULT_VALUE_name, true); zval const_PRIMARY_value; ZVAL_LONG(&const_PRIMARY_value, UCOL_PRIMARY); - zend_string *const_PRIMARY_name = zend_string_init_interned("PRIMARY", sizeof("PRIMARY") - 1, 1); + zend_string *const_PRIMARY_name = zend_string_init_interned("PRIMARY", sizeof("PRIMARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_PRIMARY_name, &const_PRIMARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PRIMARY_name); + zend_string_release_ex(const_PRIMARY_name, true); zval const_SECONDARY_value; ZVAL_LONG(&const_SECONDARY_value, UCOL_SECONDARY); - zend_string *const_SECONDARY_name = zend_string_init_interned("SECONDARY", sizeof("SECONDARY") - 1, 1); + zend_string *const_SECONDARY_name = zend_string_init_interned("SECONDARY", sizeof("SECONDARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_SECONDARY_name, &const_SECONDARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SECONDARY_name); + zend_string_release_ex(const_SECONDARY_name, true); zval const_TERTIARY_value; ZVAL_LONG(&const_TERTIARY_value, UCOL_TERTIARY); - zend_string *const_TERTIARY_name = zend_string_init_interned("TERTIARY", sizeof("TERTIARY") - 1, 1); + zend_string *const_TERTIARY_name = zend_string_init_interned("TERTIARY", sizeof("TERTIARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_TERTIARY_name, &const_TERTIARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TERTIARY_name); + zend_string_release_ex(const_TERTIARY_name, true); zval const_DEFAULT_STRENGTH_value; ZVAL_LONG(&const_DEFAULT_STRENGTH_value, UCOL_DEFAULT_STRENGTH); - zend_string *const_DEFAULT_STRENGTH_name = zend_string_init_interned("DEFAULT_STRENGTH", sizeof("DEFAULT_STRENGTH") - 1, 1); + zend_string *const_DEFAULT_STRENGTH_name = zend_string_init_interned("DEFAULT_STRENGTH", sizeof("DEFAULT_STRENGTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULT_STRENGTH_name, &const_DEFAULT_STRENGTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DEFAULT_STRENGTH_name); + zend_string_release_ex(const_DEFAULT_STRENGTH_name, true); zval const_QUATERNARY_value; ZVAL_LONG(&const_QUATERNARY_value, UCOL_QUATERNARY); - zend_string *const_QUATERNARY_name = zend_string_init_interned("QUATERNARY", sizeof("QUATERNARY") - 1, 1); + zend_string *const_QUATERNARY_name = zend_string_init_interned("QUATERNARY", sizeof("QUATERNARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_QUATERNARY_name, &const_QUATERNARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_QUATERNARY_name); + zend_string_release_ex(const_QUATERNARY_name, true); zval const_IDENTICAL_value; ZVAL_LONG(&const_IDENTICAL_value, UCOL_IDENTICAL); - zend_string *const_IDENTICAL_name = zend_string_init_interned("IDENTICAL", sizeof("IDENTICAL") - 1, 1); + zend_string *const_IDENTICAL_name = zend_string_init_interned("IDENTICAL", sizeof("IDENTICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTICAL_name, &const_IDENTICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTICAL_name); + zend_string_release_ex(const_IDENTICAL_name, true); zval const_OFF_value; ZVAL_LONG(&const_OFF_value, UCOL_OFF); - zend_string *const_OFF_name = zend_string_init_interned("OFF", sizeof("OFF") - 1, 1); + zend_string *const_OFF_name = zend_string_init_interned("OFF", sizeof("OFF") - 1, true); zend_declare_typed_class_constant(class_entry, const_OFF_name, &const_OFF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OFF_name); + zend_string_release_ex(const_OFF_name, true); zval const_ON_value; ZVAL_LONG(&const_ON_value, UCOL_ON); - zend_string *const_ON_name = zend_string_init_interned("ON", sizeof("ON") - 1, 1); + zend_string *const_ON_name = zend_string_init_interned("ON", sizeof("ON") - 1, true); zend_declare_typed_class_constant(class_entry, const_ON_name, &const_ON_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ON_name); + zend_string_release_ex(const_ON_name, true); zval const_SHIFTED_value; ZVAL_LONG(&const_SHIFTED_value, UCOL_SHIFTED); - zend_string *const_SHIFTED_name = zend_string_init_interned("SHIFTED", sizeof("SHIFTED") - 1, 1); + zend_string *const_SHIFTED_name = zend_string_init_interned("SHIFTED", sizeof("SHIFTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHIFTED_name, &const_SHIFTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHIFTED_name); + zend_string_release_ex(const_SHIFTED_name, true); zval const_NON_IGNORABLE_value; ZVAL_LONG(&const_NON_IGNORABLE_value, UCOL_NON_IGNORABLE); - zend_string *const_NON_IGNORABLE_name = zend_string_init_interned("NON_IGNORABLE", sizeof("NON_IGNORABLE") - 1, 1); + zend_string *const_NON_IGNORABLE_name = zend_string_init_interned("NON_IGNORABLE", sizeof("NON_IGNORABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NON_IGNORABLE_name, &const_NON_IGNORABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NON_IGNORABLE_name); + zend_string_release_ex(const_NON_IGNORABLE_name, true); zval const_LOWER_FIRST_value; ZVAL_LONG(&const_LOWER_FIRST_value, UCOL_LOWER_FIRST); - zend_string *const_LOWER_FIRST_name = zend_string_init_interned("LOWER_FIRST", sizeof("LOWER_FIRST") - 1, 1); + zend_string *const_LOWER_FIRST_name = zend_string_init_interned("LOWER_FIRST", sizeof("LOWER_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_LOWER_FIRST_name, &const_LOWER_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LOWER_FIRST_name); + zend_string_release_ex(const_LOWER_FIRST_name, true); zval const_UPPER_FIRST_value; ZVAL_LONG(&const_UPPER_FIRST_value, UCOL_UPPER_FIRST); - zend_string *const_UPPER_FIRST_name = zend_string_init_interned("UPPER_FIRST", sizeof("UPPER_FIRST") - 1, 1); + zend_string *const_UPPER_FIRST_name = zend_string_init_interned("UPPER_FIRST", sizeof("UPPER_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_UPPER_FIRST_name, &const_UPPER_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UPPER_FIRST_name); + zend_string_release_ex(const_UPPER_FIRST_name, true); zval const_FRENCH_COLLATION_value; ZVAL_LONG(&const_FRENCH_COLLATION_value, UCOL_FRENCH_COLLATION); - zend_string *const_FRENCH_COLLATION_name = zend_string_init_interned("FRENCH_COLLATION", sizeof("FRENCH_COLLATION") - 1, 1); + zend_string *const_FRENCH_COLLATION_name = zend_string_init_interned("FRENCH_COLLATION", sizeof("FRENCH_COLLATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_FRENCH_COLLATION_name, &const_FRENCH_COLLATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FRENCH_COLLATION_name); + zend_string_release_ex(const_FRENCH_COLLATION_name, true); zval const_ALTERNATE_HANDLING_value; ZVAL_LONG(&const_ALTERNATE_HANDLING_value, UCOL_ALTERNATE_HANDLING); - zend_string *const_ALTERNATE_HANDLING_name = zend_string_init_interned("ALTERNATE_HANDLING", sizeof("ALTERNATE_HANDLING") - 1, 1); + zend_string *const_ALTERNATE_HANDLING_name = zend_string_init_interned("ALTERNATE_HANDLING", sizeof("ALTERNATE_HANDLING") - 1, true); zend_declare_typed_class_constant(class_entry, const_ALTERNATE_HANDLING_name, &const_ALTERNATE_HANDLING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ALTERNATE_HANDLING_name); + zend_string_release_ex(const_ALTERNATE_HANDLING_name, true); zval const_CASE_FIRST_value; ZVAL_LONG(&const_CASE_FIRST_value, UCOL_CASE_FIRST); - zend_string *const_CASE_FIRST_name = zend_string_init_interned("CASE_FIRST", sizeof("CASE_FIRST") - 1, 1); + zend_string *const_CASE_FIRST_name = zend_string_init_interned("CASE_FIRST", sizeof("CASE_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_FIRST_name, &const_CASE_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_FIRST_name); + zend_string_release_ex(const_CASE_FIRST_name, true); zval const_CASE_LEVEL_value; ZVAL_LONG(&const_CASE_LEVEL_value, UCOL_CASE_LEVEL); - zend_string *const_CASE_LEVEL_name = zend_string_init_interned("CASE_LEVEL", sizeof("CASE_LEVEL") - 1, 1); + zend_string *const_CASE_LEVEL_name = zend_string_init_interned("CASE_LEVEL", sizeof("CASE_LEVEL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_LEVEL_name, &const_CASE_LEVEL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_LEVEL_name); + zend_string_release_ex(const_CASE_LEVEL_name, true); zval const_NORMALIZATION_MODE_value; ZVAL_LONG(&const_NORMALIZATION_MODE_value, UCOL_NORMALIZATION_MODE); - zend_string *const_NORMALIZATION_MODE_name = zend_string_init_interned("NORMALIZATION_MODE", sizeof("NORMALIZATION_MODE") - 1, 1); + zend_string *const_NORMALIZATION_MODE_name = zend_string_init_interned("NORMALIZATION_MODE", sizeof("NORMALIZATION_MODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NORMALIZATION_MODE_name, &const_NORMALIZATION_MODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NORMALIZATION_MODE_name); + zend_string_release_ex(const_NORMALIZATION_MODE_name, true); zval const_STRENGTH_value; ZVAL_LONG(&const_STRENGTH_value, UCOL_STRENGTH); - zend_string *const_STRENGTH_name = zend_string_init_interned("STRENGTH", sizeof("STRENGTH") - 1, 1); + zend_string *const_STRENGTH_name = zend_string_init_interned("STRENGTH", sizeof("STRENGTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_STRENGTH_name, &const_STRENGTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_STRENGTH_name); + zend_string_release_ex(const_STRENGTH_name, true); zval const_HIRAGANA_QUATERNARY_MODE_value; ZVAL_LONG(&const_HIRAGANA_QUATERNARY_MODE_value, UCOL_HIRAGANA_QUATERNARY_MODE); - zend_string *const_HIRAGANA_QUATERNARY_MODE_name = zend_string_init_interned("HIRAGANA_QUATERNARY_MODE", sizeof("HIRAGANA_QUATERNARY_MODE") - 1, 1); + zend_string *const_HIRAGANA_QUATERNARY_MODE_name = zend_string_init_interned("HIRAGANA_QUATERNARY_MODE", sizeof("HIRAGANA_QUATERNARY_MODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_HIRAGANA_QUATERNARY_MODE_name, &const_HIRAGANA_QUATERNARY_MODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HIRAGANA_QUATERNARY_MODE_name); + zend_string_release_ex(const_HIRAGANA_QUATERNARY_MODE_name, true); zval const_NUMERIC_COLLATION_value; ZVAL_LONG(&const_NUMERIC_COLLATION_value, UCOL_NUMERIC_COLLATION); - zend_string *const_NUMERIC_COLLATION_name = zend_string_init_interned("NUMERIC_COLLATION", sizeof("NUMERIC_COLLATION") - 1, 1); + zend_string *const_NUMERIC_COLLATION_name = zend_string_init_interned("NUMERIC_COLLATION", sizeof("NUMERIC_COLLATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_NUMERIC_COLLATION_name, &const_NUMERIC_COLLATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NUMERIC_COLLATION_name); + zend_string_release_ex(const_NUMERIC_COLLATION_name, true); zval const_SORT_REGULAR_value; ZVAL_LONG(&const_SORT_REGULAR_value, COLLATOR_SORT_REGULAR); - zend_string *const_SORT_REGULAR_name = zend_string_init_interned("SORT_REGULAR", sizeof("SORT_REGULAR") - 1, 1); + zend_string *const_SORT_REGULAR_name = zend_string_init_interned("SORT_REGULAR", sizeof("SORT_REGULAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_SORT_REGULAR_name, &const_SORT_REGULAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SORT_REGULAR_name); + zend_string_release_ex(const_SORT_REGULAR_name, true); zval const_SORT_STRING_value; ZVAL_LONG(&const_SORT_STRING_value, COLLATOR_SORT_STRING); - zend_string *const_SORT_STRING_name = zend_string_init_interned("SORT_STRING", sizeof("SORT_STRING") - 1, 1); + zend_string *const_SORT_STRING_name = zend_string_init_interned("SORT_STRING", sizeof("SORT_STRING") - 1, true); zend_declare_typed_class_constant(class_entry, const_SORT_STRING_name, &const_SORT_STRING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SORT_STRING_name); + zend_string_release_ex(const_SORT_STRING_name, true); zval const_SORT_NUMERIC_value; ZVAL_LONG(&const_SORT_NUMERIC_value, COLLATOR_SORT_NUMERIC); - zend_string *const_SORT_NUMERIC_name = zend_string_init_interned("SORT_NUMERIC", sizeof("SORT_NUMERIC") - 1, 1); + zend_string *const_SORT_NUMERIC_name = zend_string_init_interned("SORT_NUMERIC", sizeof("SORT_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_SORT_NUMERIC_name, &const_SORT_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SORT_NUMERIC_name); + zend_string_release_ex(const_SORT_NUMERIC_name, true); return class_entry; } diff --git a/ext/intl/converter/converter_arginfo.h b/ext/intl/converter/converter_arginfo.h index 4e02daf9478ad..9808e50b39dc8 100644 --- a/ext/intl/converter/converter_arginfo.h +++ b/ext/intl/converter/converter_arginfo.h @@ -126,249 +126,249 @@ static zend_class_entry *register_class_UConverter(void) zval const_REASON_UNASSIGNED_value; ZVAL_LONG(&const_REASON_UNASSIGNED_value, UCNV_UNASSIGNED); - zend_string *const_REASON_UNASSIGNED_name = zend_string_init_interned("REASON_UNASSIGNED", sizeof("REASON_UNASSIGNED") - 1, 1); + zend_string *const_REASON_UNASSIGNED_name = zend_string_init_interned("REASON_UNASSIGNED", sizeof("REASON_UNASSIGNED") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_UNASSIGNED_name, &const_REASON_UNASSIGNED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_UNASSIGNED_name); + zend_string_release_ex(const_REASON_UNASSIGNED_name, true); zval const_REASON_ILLEGAL_value; ZVAL_LONG(&const_REASON_ILLEGAL_value, UCNV_ILLEGAL); - zend_string *const_REASON_ILLEGAL_name = zend_string_init_interned("REASON_ILLEGAL", sizeof("REASON_ILLEGAL") - 1, 1); + zend_string *const_REASON_ILLEGAL_name = zend_string_init_interned("REASON_ILLEGAL", sizeof("REASON_ILLEGAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_ILLEGAL_name, &const_REASON_ILLEGAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_ILLEGAL_name); + zend_string_release_ex(const_REASON_ILLEGAL_name, true); zval const_REASON_IRREGULAR_value; ZVAL_LONG(&const_REASON_IRREGULAR_value, UCNV_IRREGULAR); - zend_string *const_REASON_IRREGULAR_name = zend_string_init_interned("REASON_IRREGULAR", sizeof("REASON_IRREGULAR") - 1, 1); + zend_string *const_REASON_IRREGULAR_name = zend_string_init_interned("REASON_IRREGULAR", sizeof("REASON_IRREGULAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_IRREGULAR_name, &const_REASON_IRREGULAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_IRREGULAR_name); + zend_string_release_ex(const_REASON_IRREGULAR_name, true); zval const_REASON_RESET_value; ZVAL_LONG(&const_REASON_RESET_value, UCNV_RESET); - zend_string *const_REASON_RESET_name = zend_string_init_interned("REASON_RESET", sizeof("REASON_RESET") - 1, 1); + zend_string *const_REASON_RESET_name = zend_string_init_interned("REASON_RESET", sizeof("REASON_RESET") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_RESET_name, &const_REASON_RESET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_RESET_name); + zend_string_release_ex(const_REASON_RESET_name, true); zval const_REASON_CLOSE_value; ZVAL_LONG(&const_REASON_CLOSE_value, UCNV_CLOSE); - zend_string *const_REASON_CLOSE_name = zend_string_init_interned("REASON_CLOSE", sizeof("REASON_CLOSE") - 1, 1); + zend_string *const_REASON_CLOSE_name = zend_string_init_interned("REASON_CLOSE", sizeof("REASON_CLOSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_CLOSE_name, &const_REASON_CLOSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_CLOSE_name); + zend_string_release_ex(const_REASON_CLOSE_name, true); zval const_REASON_CLONE_value; ZVAL_LONG(&const_REASON_CLONE_value, UCNV_CLONE); - zend_string *const_REASON_CLONE_name = zend_string_init_interned("REASON_CLONE", sizeof("REASON_CLONE") - 1, 1); + zend_string *const_REASON_CLONE_name = zend_string_init_interned("REASON_CLONE", sizeof("REASON_CLONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_REASON_CLONE_name, &const_REASON_CLONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REASON_CLONE_name); + zend_string_release_ex(const_REASON_CLONE_name, true); zval const_UNSUPPORTED_CONVERTER_value; ZVAL_LONG(&const_UNSUPPORTED_CONVERTER_value, UCNV_UNSUPPORTED_CONVERTER); - zend_string *const_UNSUPPORTED_CONVERTER_name = zend_string_init_interned("UNSUPPORTED_CONVERTER", sizeof("UNSUPPORTED_CONVERTER") - 1, 1); + zend_string *const_UNSUPPORTED_CONVERTER_name = zend_string_init_interned("UNSUPPORTED_CONVERTER", sizeof("UNSUPPORTED_CONVERTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNSUPPORTED_CONVERTER_name, &const_UNSUPPORTED_CONVERTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UNSUPPORTED_CONVERTER_name); + zend_string_release_ex(const_UNSUPPORTED_CONVERTER_name, true); zval const_SBCS_value; ZVAL_LONG(&const_SBCS_value, UCNV_SBCS); - zend_string *const_SBCS_name = zend_string_init_interned("SBCS", sizeof("SBCS") - 1, 1); + zend_string *const_SBCS_name = zend_string_init_interned("SBCS", sizeof("SBCS") - 1, true); zend_declare_typed_class_constant(class_entry, const_SBCS_name, &const_SBCS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SBCS_name); + zend_string_release_ex(const_SBCS_name, true); zval const_DBCS_value; ZVAL_LONG(&const_DBCS_value, UCNV_DBCS); - zend_string *const_DBCS_name = zend_string_init_interned("DBCS", sizeof("DBCS") - 1, 1); + zend_string *const_DBCS_name = zend_string_init_interned("DBCS", sizeof("DBCS") - 1, true); zend_declare_typed_class_constant(class_entry, const_DBCS_name, &const_DBCS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DBCS_name); + zend_string_release_ex(const_DBCS_name, true); zval const_MBCS_value; ZVAL_LONG(&const_MBCS_value, UCNV_MBCS); - zend_string *const_MBCS_name = zend_string_init_interned("MBCS", sizeof("MBCS") - 1, 1); + zend_string *const_MBCS_name = zend_string_init_interned("MBCS", sizeof("MBCS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MBCS_name, &const_MBCS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MBCS_name); + zend_string_release_ex(const_MBCS_name, true); zval const_LATIN_1_value; ZVAL_LONG(&const_LATIN_1_value, UCNV_LATIN_1); - zend_string *const_LATIN_1_name = zend_string_init_interned("LATIN_1", sizeof("LATIN_1") - 1, 1); + zend_string *const_LATIN_1_name = zend_string_init_interned("LATIN_1", sizeof("LATIN_1") - 1, true); zend_declare_typed_class_constant(class_entry, const_LATIN_1_name, &const_LATIN_1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LATIN_1_name); + zend_string_release_ex(const_LATIN_1_name, true); zval const_UTF8_value; ZVAL_LONG(&const_UTF8_value, UCNV_UTF8); - zend_string *const_UTF8_name = zend_string_init_interned("UTF8", sizeof("UTF8") - 1, 1); + zend_string *const_UTF8_name = zend_string_init_interned("UTF8", sizeof("UTF8") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF8_name, &const_UTF8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF8_name); + zend_string_release_ex(const_UTF8_name, true); zval const_UTF16_BigEndian_value; ZVAL_LONG(&const_UTF16_BigEndian_value, UCNV_UTF16_BigEndian); - zend_string *const_UTF16_BigEndian_name = zend_string_init_interned("UTF16_BigEndian", sizeof("UTF16_BigEndian") - 1, 1); + zend_string *const_UTF16_BigEndian_name = zend_string_init_interned("UTF16_BigEndian", sizeof("UTF16_BigEndian") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF16_BigEndian_name, &const_UTF16_BigEndian_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF16_BigEndian_name); + zend_string_release_ex(const_UTF16_BigEndian_name, true); zval const_UTF16_LittleEndian_value; ZVAL_LONG(&const_UTF16_LittleEndian_value, UCNV_UTF16_LittleEndian); - zend_string *const_UTF16_LittleEndian_name = zend_string_init_interned("UTF16_LittleEndian", sizeof("UTF16_LittleEndian") - 1, 1); + zend_string *const_UTF16_LittleEndian_name = zend_string_init_interned("UTF16_LittleEndian", sizeof("UTF16_LittleEndian") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF16_LittleEndian_name, &const_UTF16_LittleEndian_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF16_LittleEndian_name); + zend_string_release_ex(const_UTF16_LittleEndian_name, true); zval const_UTF32_BigEndian_value; ZVAL_LONG(&const_UTF32_BigEndian_value, UCNV_UTF32_BigEndian); - zend_string *const_UTF32_BigEndian_name = zend_string_init_interned("UTF32_BigEndian", sizeof("UTF32_BigEndian") - 1, 1); + zend_string *const_UTF32_BigEndian_name = zend_string_init_interned("UTF32_BigEndian", sizeof("UTF32_BigEndian") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF32_BigEndian_name, &const_UTF32_BigEndian_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF32_BigEndian_name); + zend_string_release_ex(const_UTF32_BigEndian_name, true); zval const_UTF32_LittleEndian_value; ZVAL_LONG(&const_UTF32_LittleEndian_value, UCNV_UTF32_LittleEndian); - zend_string *const_UTF32_LittleEndian_name = zend_string_init_interned("UTF32_LittleEndian", sizeof("UTF32_LittleEndian") - 1, 1); + zend_string *const_UTF32_LittleEndian_name = zend_string_init_interned("UTF32_LittleEndian", sizeof("UTF32_LittleEndian") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF32_LittleEndian_name, &const_UTF32_LittleEndian_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF32_LittleEndian_name); + zend_string_release_ex(const_UTF32_LittleEndian_name, true); zval const_EBCDIC_STATEFUL_value; ZVAL_LONG(&const_EBCDIC_STATEFUL_value, UCNV_EBCDIC_STATEFUL); - zend_string *const_EBCDIC_STATEFUL_name = zend_string_init_interned("EBCDIC_STATEFUL", sizeof("EBCDIC_STATEFUL") - 1, 1); + zend_string *const_EBCDIC_STATEFUL_name = zend_string_init_interned("EBCDIC_STATEFUL", sizeof("EBCDIC_STATEFUL") - 1, true); zend_declare_typed_class_constant(class_entry, const_EBCDIC_STATEFUL_name, &const_EBCDIC_STATEFUL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EBCDIC_STATEFUL_name); + zend_string_release_ex(const_EBCDIC_STATEFUL_name, true); zval const_ISO_2022_value; ZVAL_LONG(&const_ISO_2022_value, UCNV_ISO_2022); - zend_string *const_ISO_2022_name = zend_string_init_interned("ISO_2022", sizeof("ISO_2022") - 1, 1); + zend_string *const_ISO_2022_name = zend_string_init_interned("ISO_2022", sizeof("ISO_2022") - 1, true); zend_declare_typed_class_constant(class_entry, const_ISO_2022_name, &const_ISO_2022_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ISO_2022_name); + zend_string_release_ex(const_ISO_2022_name, true); zval const_LMBCS_1_value; ZVAL_LONG(&const_LMBCS_1_value, UCNV_LMBCS_1); - zend_string *const_LMBCS_1_name = zend_string_init_interned("LMBCS_1", sizeof("LMBCS_1") - 1, 1); + zend_string *const_LMBCS_1_name = zend_string_init_interned("LMBCS_1", sizeof("LMBCS_1") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_1_name, &const_LMBCS_1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_1_name); + zend_string_release_ex(const_LMBCS_1_name, true); zval const_LMBCS_2_value; ZVAL_LONG(&const_LMBCS_2_value, UCNV_LMBCS_2); - zend_string *const_LMBCS_2_name = zend_string_init_interned("LMBCS_2", sizeof("LMBCS_2") - 1, 1); + zend_string *const_LMBCS_2_name = zend_string_init_interned("LMBCS_2", sizeof("LMBCS_2") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_2_name, &const_LMBCS_2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_2_name); + zend_string_release_ex(const_LMBCS_2_name, true); zval const_LMBCS_3_value; ZVAL_LONG(&const_LMBCS_3_value, UCNV_LMBCS_3); - zend_string *const_LMBCS_3_name = zend_string_init_interned("LMBCS_3", sizeof("LMBCS_3") - 1, 1); + zend_string *const_LMBCS_3_name = zend_string_init_interned("LMBCS_3", sizeof("LMBCS_3") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_3_name, &const_LMBCS_3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_3_name); + zend_string_release_ex(const_LMBCS_3_name, true); zval const_LMBCS_4_value; ZVAL_LONG(&const_LMBCS_4_value, UCNV_LMBCS_4); - zend_string *const_LMBCS_4_name = zend_string_init_interned("LMBCS_4", sizeof("LMBCS_4") - 1, 1); + zend_string *const_LMBCS_4_name = zend_string_init_interned("LMBCS_4", sizeof("LMBCS_4") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_4_name, &const_LMBCS_4_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_4_name); + zend_string_release_ex(const_LMBCS_4_name, true); zval const_LMBCS_5_value; ZVAL_LONG(&const_LMBCS_5_value, UCNV_LMBCS_5); - zend_string *const_LMBCS_5_name = zend_string_init_interned("LMBCS_5", sizeof("LMBCS_5") - 1, 1); + zend_string *const_LMBCS_5_name = zend_string_init_interned("LMBCS_5", sizeof("LMBCS_5") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_5_name, &const_LMBCS_5_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_5_name); + zend_string_release_ex(const_LMBCS_5_name, true); zval const_LMBCS_6_value; ZVAL_LONG(&const_LMBCS_6_value, UCNV_LMBCS_6); - zend_string *const_LMBCS_6_name = zend_string_init_interned("LMBCS_6", sizeof("LMBCS_6") - 1, 1); + zend_string *const_LMBCS_6_name = zend_string_init_interned("LMBCS_6", sizeof("LMBCS_6") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_6_name, &const_LMBCS_6_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_6_name); + zend_string_release_ex(const_LMBCS_6_name, true); zval const_LMBCS_8_value; ZVAL_LONG(&const_LMBCS_8_value, UCNV_LMBCS_8); - zend_string *const_LMBCS_8_name = zend_string_init_interned("LMBCS_8", sizeof("LMBCS_8") - 1, 1); + zend_string *const_LMBCS_8_name = zend_string_init_interned("LMBCS_8", sizeof("LMBCS_8") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_8_name, &const_LMBCS_8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_8_name); + zend_string_release_ex(const_LMBCS_8_name, true); zval const_LMBCS_11_value; ZVAL_LONG(&const_LMBCS_11_value, UCNV_LMBCS_11); - zend_string *const_LMBCS_11_name = zend_string_init_interned("LMBCS_11", sizeof("LMBCS_11") - 1, 1); + zend_string *const_LMBCS_11_name = zend_string_init_interned("LMBCS_11", sizeof("LMBCS_11") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_11_name, &const_LMBCS_11_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_11_name); + zend_string_release_ex(const_LMBCS_11_name, true); zval const_LMBCS_16_value; ZVAL_LONG(&const_LMBCS_16_value, UCNV_LMBCS_16); - zend_string *const_LMBCS_16_name = zend_string_init_interned("LMBCS_16", sizeof("LMBCS_16") - 1, 1); + zend_string *const_LMBCS_16_name = zend_string_init_interned("LMBCS_16", sizeof("LMBCS_16") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_16_name, &const_LMBCS_16_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_16_name); + zend_string_release_ex(const_LMBCS_16_name, true); zval const_LMBCS_17_value; ZVAL_LONG(&const_LMBCS_17_value, UCNV_LMBCS_17); - zend_string *const_LMBCS_17_name = zend_string_init_interned("LMBCS_17", sizeof("LMBCS_17") - 1, 1); + zend_string *const_LMBCS_17_name = zend_string_init_interned("LMBCS_17", sizeof("LMBCS_17") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_17_name, &const_LMBCS_17_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_17_name); + zend_string_release_ex(const_LMBCS_17_name, true); zval const_LMBCS_18_value; ZVAL_LONG(&const_LMBCS_18_value, UCNV_LMBCS_18); - zend_string *const_LMBCS_18_name = zend_string_init_interned("LMBCS_18", sizeof("LMBCS_18") - 1, 1); + zend_string *const_LMBCS_18_name = zend_string_init_interned("LMBCS_18", sizeof("LMBCS_18") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_18_name, &const_LMBCS_18_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_18_name); + zend_string_release_ex(const_LMBCS_18_name, true); zval const_LMBCS_19_value; ZVAL_LONG(&const_LMBCS_19_value, UCNV_LMBCS_19); - zend_string *const_LMBCS_19_name = zend_string_init_interned("LMBCS_19", sizeof("LMBCS_19") - 1, 1); + zend_string *const_LMBCS_19_name = zend_string_init_interned("LMBCS_19", sizeof("LMBCS_19") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_19_name, &const_LMBCS_19_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_19_name); + zend_string_release_ex(const_LMBCS_19_name, true); zval const_LMBCS_LAST_value; ZVAL_LONG(&const_LMBCS_LAST_value, UCNV_LMBCS_LAST); - zend_string *const_LMBCS_LAST_name = zend_string_init_interned("LMBCS_LAST", sizeof("LMBCS_LAST") - 1, 1); + zend_string *const_LMBCS_LAST_name = zend_string_init_interned("LMBCS_LAST", sizeof("LMBCS_LAST") - 1, true); zend_declare_typed_class_constant(class_entry, const_LMBCS_LAST_name, &const_LMBCS_LAST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LMBCS_LAST_name); + zend_string_release_ex(const_LMBCS_LAST_name, true); zval const_HZ_value; ZVAL_LONG(&const_HZ_value, UCNV_HZ); - zend_string *const_HZ_name = zend_string_init_interned("HZ", sizeof("HZ") - 1, 1); + zend_string *const_HZ_name = zend_string_init_interned("HZ", sizeof("HZ") - 1, true); zend_declare_typed_class_constant(class_entry, const_HZ_name, &const_HZ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HZ_name); + zend_string_release_ex(const_HZ_name, true); zval const_SCSU_value; ZVAL_LONG(&const_SCSU_value, UCNV_SCSU); - zend_string *const_SCSU_name = zend_string_init_interned("SCSU", sizeof("SCSU") - 1, 1); + zend_string *const_SCSU_name = zend_string_init_interned("SCSU", sizeof("SCSU") - 1, true); zend_declare_typed_class_constant(class_entry, const_SCSU_name, &const_SCSU_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SCSU_name); + zend_string_release_ex(const_SCSU_name, true); zval const_ISCII_value; ZVAL_LONG(&const_ISCII_value, UCNV_ISCII); - zend_string *const_ISCII_name = zend_string_init_interned("ISCII", sizeof("ISCII") - 1, 1); + zend_string *const_ISCII_name = zend_string_init_interned("ISCII", sizeof("ISCII") - 1, true); zend_declare_typed_class_constant(class_entry, const_ISCII_name, &const_ISCII_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ISCII_name); + zend_string_release_ex(const_ISCII_name, true); zval const_US_ASCII_value; ZVAL_LONG(&const_US_ASCII_value, UCNV_US_ASCII); - zend_string *const_US_ASCII_name = zend_string_init_interned("US_ASCII", sizeof("US_ASCII") - 1, 1); + zend_string *const_US_ASCII_name = zend_string_init_interned("US_ASCII", sizeof("US_ASCII") - 1, true); zend_declare_typed_class_constant(class_entry, const_US_ASCII_name, &const_US_ASCII_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_US_ASCII_name); + zend_string_release_ex(const_US_ASCII_name, true); zval const_UTF7_value; ZVAL_LONG(&const_UTF7_value, UCNV_UTF7); - zend_string *const_UTF7_name = zend_string_init_interned("UTF7", sizeof("UTF7") - 1, 1); + zend_string *const_UTF7_name = zend_string_init_interned("UTF7", sizeof("UTF7") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF7_name, &const_UTF7_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF7_name); + zend_string_release_ex(const_UTF7_name, true); zval const_BOCU1_value; ZVAL_LONG(&const_BOCU1_value, UCNV_BOCU1); - zend_string *const_BOCU1_name = zend_string_init_interned("BOCU1", sizeof("BOCU1") - 1, 1); + zend_string *const_BOCU1_name = zend_string_init_interned("BOCU1", sizeof("BOCU1") - 1, true); zend_declare_typed_class_constant(class_entry, const_BOCU1_name, &const_BOCU1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BOCU1_name); + zend_string_release_ex(const_BOCU1_name, true); zval const_UTF16_value; ZVAL_LONG(&const_UTF16_value, UCNV_UTF16); - zend_string *const_UTF16_name = zend_string_init_interned("UTF16", sizeof("UTF16") - 1, 1); + zend_string *const_UTF16_name = zend_string_init_interned("UTF16", sizeof("UTF16") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF16_name, &const_UTF16_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF16_name); + zend_string_release_ex(const_UTF16_name, true); zval const_UTF32_value; ZVAL_LONG(&const_UTF32_value, UCNV_UTF32); - zend_string *const_UTF32_name = zend_string_init_interned("UTF32", sizeof("UTF32") - 1, 1); + zend_string *const_UTF32_name = zend_string_init_interned("UTF32", sizeof("UTF32") - 1, true); zend_declare_typed_class_constant(class_entry, const_UTF32_name, &const_UTF32_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UTF32_name); + zend_string_release_ex(const_UTF32_name, true); zval const_CESU8_value; ZVAL_LONG(&const_CESU8_value, UCNV_CESU8); - zend_string *const_CESU8_name = zend_string_init_interned("CESU8", sizeof("CESU8") - 1, 1); + zend_string *const_CESU8_name = zend_string_init_interned("CESU8", sizeof("CESU8") - 1, true); zend_declare_typed_class_constant(class_entry, const_CESU8_name, &const_CESU8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CESU8_name); + zend_string_release_ex(const_CESU8_name, true); zval const_IMAP_MAILBOX_value; ZVAL_LONG(&const_IMAP_MAILBOX_value, UCNV_IMAP_MAILBOX); - zend_string *const_IMAP_MAILBOX_name = zend_string_init_interned("IMAP_MAILBOX", sizeof("IMAP_MAILBOX") - 1, 1); + zend_string *const_IMAP_MAILBOX_name = zend_string_init_interned("IMAP_MAILBOX", sizeof("IMAP_MAILBOX") - 1, true); zend_declare_typed_class_constant(class_entry, const_IMAP_MAILBOX_name, &const_IMAP_MAILBOX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IMAP_MAILBOX_name); + zend_string_release_ex(const_IMAP_MAILBOX_name, true); return class_entry; } diff --git a/ext/intl/dateformat/dateformat_arginfo.h b/ext/intl/dateformat/dateformat_arginfo.h index d6d0306506f81..5a5c6a9f34c29 100644 --- a/ext/intl/dateformat/dateformat_arginfo.h +++ b/ext/intl/dateformat/dateformat_arginfo.h @@ -149,75 +149,75 @@ static zend_class_entry *register_class_IntlDateFormatter(void) zval const_FULL_value; ZVAL_LONG(&const_FULL_value, UDAT_FULL); - zend_string *const_FULL_name = zend_string_init_interned("FULL", sizeof("FULL") - 1, 1); + zend_string *const_FULL_name = zend_string_init_interned("FULL", sizeof("FULL") - 1, true); zend_declare_typed_class_constant(class_entry, const_FULL_name, &const_FULL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FULL_name); + zend_string_release_ex(const_FULL_name, true); zval const_LONG_value; ZVAL_LONG(&const_LONG_value, UDAT_LONG); - zend_string *const_LONG_name = zend_string_init_interned("LONG", sizeof("LONG") - 1, 1); + zend_string *const_LONG_name = zend_string_init_interned("LONG", sizeof("LONG") - 1, true); zend_declare_typed_class_constant(class_entry, const_LONG_name, &const_LONG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LONG_name); + zend_string_release_ex(const_LONG_name, true); zval const_MEDIUM_value; ZVAL_LONG(&const_MEDIUM_value, UDAT_MEDIUM); - zend_string *const_MEDIUM_name = zend_string_init_interned("MEDIUM", sizeof("MEDIUM") - 1, 1); + zend_string *const_MEDIUM_name = zend_string_init_interned("MEDIUM", sizeof("MEDIUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_MEDIUM_name, &const_MEDIUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MEDIUM_name); + zend_string_release_ex(const_MEDIUM_name, true); zval const_SHORT_value; ZVAL_LONG(&const_SHORT_value, UDAT_SHORT); - zend_string *const_SHORT_name = zend_string_init_interned("SHORT", sizeof("SHORT") - 1, 1); + zend_string *const_SHORT_name = zend_string_init_interned("SHORT", sizeof("SHORT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHORT_name, &const_SHORT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHORT_name); + zend_string_release_ex(const_SHORT_name, true); zval const_NONE_value; ZVAL_LONG(&const_NONE_value, UDAT_NONE); - zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, 1); + zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NONE_name, &const_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NONE_name); + zend_string_release_ex(const_NONE_name, true); zval const_RELATIVE_FULL_value; ZVAL_LONG(&const_RELATIVE_FULL_value, UDAT_FULL_RELATIVE); - zend_string *const_RELATIVE_FULL_name = zend_string_init_interned("RELATIVE_FULL", sizeof("RELATIVE_FULL") - 1, 1); + zend_string *const_RELATIVE_FULL_name = zend_string_init_interned("RELATIVE_FULL", sizeof("RELATIVE_FULL") - 1, true); zend_declare_typed_class_constant(class_entry, const_RELATIVE_FULL_name, &const_RELATIVE_FULL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RELATIVE_FULL_name); + zend_string_release_ex(const_RELATIVE_FULL_name, true); zval const_RELATIVE_LONG_value; ZVAL_LONG(&const_RELATIVE_LONG_value, UDAT_LONG_RELATIVE); - zend_string *const_RELATIVE_LONG_name = zend_string_init_interned("RELATIVE_LONG", sizeof("RELATIVE_LONG") - 1, 1); + zend_string *const_RELATIVE_LONG_name = zend_string_init_interned("RELATIVE_LONG", sizeof("RELATIVE_LONG") - 1, true); zend_declare_typed_class_constant(class_entry, const_RELATIVE_LONG_name, &const_RELATIVE_LONG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RELATIVE_LONG_name); + zend_string_release_ex(const_RELATIVE_LONG_name, true); zval const_RELATIVE_MEDIUM_value; ZVAL_LONG(&const_RELATIVE_MEDIUM_value, UDAT_MEDIUM_RELATIVE); - zend_string *const_RELATIVE_MEDIUM_name = zend_string_init_interned("RELATIVE_MEDIUM", sizeof("RELATIVE_MEDIUM") - 1, 1); + zend_string *const_RELATIVE_MEDIUM_name = zend_string_init_interned("RELATIVE_MEDIUM", sizeof("RELATIVE_MEDIUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_RELATIVE_MEDIUM_name, &const_RELATIVE_MEDIUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RELATIVE_MEDIUM_name); + zend_string_release_ex(const_RELATIVE_MEDIUM_name, true); zval const_RELATIVE_SHORT_value; ZVAL_LONG(&const_RELATIVE_SHORT_value, UDAT_SHORT_RELATIVE); - zend_string *const_RELATIVE_SHORT_name = zend_string_init_interned("RELATIVE_SHORT", sizeof("RELATIVE_SHORT") - 1, 1); + zend_string *const_RELATIVE_SHORT_name = zend_string_init_interned("RELATIVE_SHORT", sizeof("RELATIVE_SHORT") - 1, true); zend_declare_typed_class_constant(class_entry, const_RELATIVE_SHORT_name, &const_RELATIVE_SHORT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RELATIVE_SHORT_name); + zend_string_release_ex(const_RELATIVE_SHORT_name, true); zval const_PATTERN_value; ZVAL_LONG(&const_PATTERN_value, UDAT_PATTERN); - zend_string *const_PATTERN_name = zend_string_init_interned("PATTERN", sizeof("PATTERN") - 1, 1); + zend_string *const_PATTERN_name = zend_string_init_interned("PATTERN", sizeof("PATTERN") - 1, true); zend_declare_typed_class_constant(class_entry, const_PATTERN_name, &const_PATTERN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PATTERN_name); + zend_string_release_ex(const_PATTERN_name, true); zval const_GREGORIAN_value; ZVAL_LONG(&const_GREGORIAN_value, UCAL_GREGORIAN); - zend_string *const_GREGORIAN_name = zend_string_init_interned("GREGORIAN", sizeof("GREGORIAN") - 1, 1); + zend_string *const_GREGORIAN_name = zend_string_init_interned("GREGORIAN", sizeof("GREGORIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_GREGORIAN_name, &const_GREGORIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GREGORIAN_name); + zend_string_release_ex(const_GREGORIAN_name, true); zval const_TRADITIONAL_value; ZVAL_LONG(&const_TRADITIONAL_value, UCAL_TRADITIONAL); - zend_string *const_TRADITIONAL_name = zend_string_init_interned("TRADITIONAL", sizeof("TRADITIONAL") - 1, 1); + zend_string *const_TRADITIONAL_name = zend_string_init_interned("TRADITIONAL", sizeof("TRADITIONAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRADITIONAL_name, &const_TRADITIONAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRADITIONAL_name); + zend_string_release_ex(const_TRADITIONAL_name, true); return class_entry; } diff --git a/ext/intl/formatter/formatter_arginfo.h b/ext/intl/formatter/formatter_arginfo.h index ce9de964e77b1..df111763f8b96 100644 --- a/ext/intl/formatter/formatter_arginfo.h +++ b/ext/intl/formatter/formatter_arginfo.h @@ -127,503 +127,503 @@ static zend_class_entry *register_class_NumberFormatter(void) zval const_PATTERN_DECIMAL_value; ZVAL_LONG(&const_PATTERN_DECIMAL_value, UNUM_PATTERN_DECIMAL); - zend_string *const_PATTERN_DECIMAL_name = zend_string_init_interned("PATTERN_DECIMAL", sizeof("PATTERN_DECIMAL") - 1, 1); + zend_string *const_PATTERN_DECIMAL_name = zend_string_init_interned("PATTERN_DECIMAL", sizeof("PATTERN_DECIMAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PATTERN_DECIMAL_name, &const_PATTERN_DECIMAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PATTERN_DECIMAL_name); + zend_string_release_ex(const_PATTERN_DECIMAL_name, true); zval const_DECIMAL_value; ZVAL_LONG(&const_DECIMAL_value, UNUM_DECIMAL); - zend_string *const_DECIMAL_name = zend_string_init_interned("DECIMAL", sizeof("DECIMAL") - 1, 1); + zend_string *const_DECIMAL_name = zend_string_init_interned("DECIMAL", sizeof("DECIMAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DECIMAL_name, &const_DECIMAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DECIMAL_name); + zend_string_release_ex(const_DECIMAL_name, true); zval const_DECIMAL_COMPACT_SHORT_value; ZVAL_LONG(&const_DECIMAL_COMPACT_SHORT_value, UNUM_DECIMAL_COMPACT_SHORT); - zend_string *const_DECIMAL_COMPACT_SHORT_name = zend_string_init_interned("DECIMAL_COMPACT_SHORT", sizeof("DECIMAL_COMPACT_SHORT") - 1, 1); + zend_string *const_DECIMAL_COMPACT_SHORT_name = zend_string_init_interned("DECIMAL_COMPACT_SHORT", sizeof("DECIMAL_COMPACT_SHORT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DECIMAL_COMPACT_SHORT_name, &const_DECIMAL_COMPACT_SHORT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DECIMAL_COMPACT_SHORT_name); + zend_string_release_ex(const_DECIMAL_COMPACT_SHORT_name, true); zval const_DECIMAL_COMPACT_LONG_value; ZVAL_LONG(&const_DECIMAL_COMPACT_LONG_value, UNUM_DECIMAL_COMPACT_LONG); - zend_string *const_DECIMAL_COMPACT_LONG_name = zend_string_init_interned("DECIMAL_COMPACT_LONG", sizeof("DECIMAL_COMPACT_LONG") - 1, 1); + zend_string *const_DECIMAL_COMPACT_LONG_name = zend_string_init_interned("DECIMAL_COMPACT_LONG", sizeof("DECIMAL_COMPACT_LONG") - 1, true); zend_declare_typed_class_constant(class_entry, const_DECIMAL_COMPACT_LONG_name, &const_DECIMAL_COMPACT_LONG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DECIMAL_COMPACT_LONG_name); + zend_string_release_ex(const_DECIMAL_COMPACT_LONG_name, true); zval const_CURRENCY_value; ZVAL_LONG(&const_CURRENCY_value, UNUM_CURRENCY); - zend_string *const_CURRENCY_name = zend_string_init_interned("CURRENCY", sizeof("CURRENCY") - 1, 1); + zend_string *const_CURRENCY_name = zend_string_init_interned("CURRENCY", sizeof("CURRENCY") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_name, &const_CURRENCY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_name); + zend_string_release_ex(const_CURRENCY_name, true); zval const_PERCENT_value; ZVAL_LONG(&const_PERCENT_value, UNUM_PERCENT); - zend_string *const_PERCENT_name = zend_string_init_interned("PERCENT", sizeof("PERCENT") - 1, 1); + zend_string *const_PERCENT_name = zend_string_init_interned("PERCENT", sizeof("PERCENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PERCENT_name, &const_PERCENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PERCENT_name); + zend_string_release_ex(const_PERCENT_name, true); zval const_SCIENTIFIC_value; ZVAL_LONG(&const_SCIENTIFIC_value, UNUM_SCIENTIFIC); - zend_string *const_SCIENTIFIC_name = zend_string_init_interned("SCIENTIFIC", sizeof("SCIENTIFIC") - 1, 1); + zend_string *const_SCIENTIFIC_name = zend_string_init_interned("SCIENTIFIC", sizeof("SCIENTIFIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_SCIENTIFIC_name, &const_SCIENTIFIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SCIENTIFIC_name); + zend_string_release_ex(const_SCIENTIFIC_name, true); zval const_SPELLOUT_value; ZVAL_LONG(&const_SPELLOUT_value, UNUM_SPELLOUT); - zend_string *const_SPELLOUT_name = zend_string_init_interned("SPELLOUT", sizeof("SPELLOUT") - 1, 1); + zend_string *const_SPELLOUT_name = zend_string_init_interned("SPELLOUT", sizeof("SPELLOUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SPELLOUT_name, &const_SPELLOUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SPELLOUT_name); + zend_string_release_ex(const_SPELLOUT_name, true); zval const_ORDINAL_value; ZVAL_LONG(&const_ORDINAL_value, UNUM_ORDINAL); - zend_string *const_ORDINAL_name = zend_string_init_interned("ORDINAL", sizeof("ORDINAL") - 1, 1); + zend_string *const_ORDINAL_name = zend_string_init_interned("ORDINAL", sizeof("ORDINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ORDINAL_name, &const_ORDINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ORDINAL_name); + zend_string_release_ex(const_ORDINAL_name, true); zval const_DURATION_value; ZVAL_LONG(&const_DURATION_value, UNUM_DURATION); - zend_string *const_DURATION_name = zend_string_init_interned("DURATION", sizeof("DURATION") - 1, 1); + zend_string *const_DURATION_name = zend_string_init_interned("DURATION", sizeof("DURATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_DURATION_name, &const_DURATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DURATION_name); + zend_string_release_ex(const_DURATION_name, true); zval const_PATTERN_RULEBASED_value; ZVAL_LONG(&const_PATTERN_RULEBASED_value, UNUM_PATTERN_RULEBASED); - zend_string *const_PATTERN_RULEBASED_name = zend_string_init_interned("PATTERN_RULEBASED", sizeof("PATTERN_RULEBASED") - 1, 1); + zend_string *const_PATTERN_RULEBASED_name = zend_string_init_interned("PATTERN_RULEBASED", sizeof("PATTERN_RULEBASED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PATTERN_RULEBASED_name, &const_PATTERN_RULEBASED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PATTERN_RULEBASED_name); + zend_string_release_ex(const_PATTERN_RULEBASED_name, true); zval const_IGNORE_value; ZVAL_LONG(&const_IGNORE_value, UNUM_IGNORE); - zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, 1); + zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IGNORE_name, &const_IGNORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IGNORE_name); + zend_string_release_ex(const_IGNORE_name, true); zval const_CURRENCY_ISO_value; ZVAL_LONG(&const_CURRENCY_ISO_value, UNUM_CURRENCY_ISO); - zend_string *const_CURRENCY_ISO_name = zend_string_init_interned("CURRENCY_ISO", sizeof("CURRENCY_ISO") - 1, 1); + zend_string *const_CURRENCY_ISO_name = zend_string_init_interned("CURRENCY_ISO", sizeof("CURRENCY_ISO") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_ISO_name, &const_CURRENCY_ISO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_ISO_name); + zend_string_release_ex(const_CURRENCY_ISO_name, true); zval const_CURRENCY_PLURAL_value; ZVAL_LONG(&const_CURRENCY_PLURAL_value, UNUM_CURRENCY_PLURAL); - zend_string *const_CURRENCY_PLURAL_name = zend_string_init_interned("CURRENCY_PLURAL", sizeof("CURRENCY_PLURAL") - 1, 1); + zend_string *const_CURRENCY_PLURAL_name = zend_string_init_interned("CURRENCY_PLURAL", sizeof("CURRENCY_PLURAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_PLURAL_name, &const_CURRENCY_PLURAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_PLURAL_name); + zend_string_release_ex(const_CURRENCY_PLURAL_name, true); zval const_CURRENCY_ACCOUNTING_value; ZVAL_LONG(&const_CURRENCY_ACCOUNTING_value, UNUM_CURRENCY_ACCOUNTING); - zend_string *const_CURRENCY_ACCOUNTING_name = zend_string_init_interned("CURRENCY_ACCOUNTING", sizeof("CURRENCY_ACCOUNTING") - 1, 1); + zend_string *const_CURRENCY_ACCOUNTING_name = zend_string_init_interned("CURRENCY_ACCOUNTING", sizeof("CURRENCY_ACCOUNTING") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_ACCOUNTING_name, &const_CURRENCY_ACCOUNTING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_ACCOUNTING_name); + zend_string_release_ex(const_CURRENCY_ACCOUNTING_name, true); zval const_CASH_CURRENCY_value; ZVAL_LONG(&const_CASH_CURRENCY_value, UNUM_CASH_CURRENCY); - zend_string *const_CASH_CURRENCY_name = zend_string_init_interned("CASH_CURRENCY", sizeof("CASH_CURRENCY") - 1, 1); + zend_string *const_CASH_CURRENCY_name = zend_string_init_interned("CASH_CURRENCY", sizeof("CASH_CURRENCY") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASH_CURRENCY_name, &const_CASH_CURRENCY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASH_CURRENCY_name); + zend_string_release_ex(const_CASH_CURRENCY_name, true); zval const_CURRENCY_STANDARD_value; ZVAL_LONG(&const_CURRENCY_STANDARD_value, UNUM_CURRENCY_STANDARD); - zend_string *const_CURRENCY_STANDARD_name = zend_string_init_interned("CURRENCY_STANDARD", sizeof("CURRENCY_STANDARD") - 1, 1); + zend_string *const_CURRENCY_STANDARD_name = zend_string_init_interned("CURRENCY_STANDARD", sizeof("CURRENCY_STANDARD") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_STANDARD_name, &const_CURRENCY_STANDARD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_STANDARD_name); + zend_string_release_ex(const_CURRENCY_STANDARD_name, true); zval const_DEFAULT_STYLE_value; ZVAL_LONG(&const_DEFAULT_STYLE_value, UNUM_DEFAULT); - zend_string *const_DEFAULT_STYLE_name = zend_string_init_interned("DEFAULT_STYLE", sizeof("DEFAULT_STYLE") - 1, 1); + zend_string *const_DEFAULT_STYLE_name = zend_string_init_interned("DEFAULT_STYLE", sizeof("DEFAULT_STYLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULT_STYLE_name, &const_DEFAULT_STYLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DEFAULT_STYLE_name); + zend_string_release_ex(const_DEFAULT_STYLE_name, true); zval const_ROUND_CEILING_value; ZVAL_LONG(&const_ROUND_CEILING_value, UNUM_ROUND_CEILING); - zend_string *const_ROUND_CEILING_name = zend_string_init_interned("ROUND_CEILING", sizeof("ROUND_CEILING") - 1, 1); + zend_string *const_ROUND_CEILING_name = zend_string_init_interned("ROUND_CEILING", sizeof("ROUND_CEILING") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_CEILING_name, &const_ROUND_CEILING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_CEILING_name); + zend_string_release_ex(const_ROUND_CEILING_name, true); zval const_ROUND_FLOOR_value; ZVAL_LONG(&const_ROUND_FLOOR_value, UNUM_ROUND_FLOOR); - zend_string *const_ROUND_FLOOR_name = zend_string_init_interned("ROUND_FLOOR", sizeof("ROUND_FLOOR") - 1, 1); + zend_string *const_ROUND_FLOOR_name = zend_string_init_interned("ROUND_FLOOR", sizeof("ROUND_FLOOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_FLOOR_name, &const_ROUND_FLOOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_FLOOR_name); + zend_string_release_ex(const_ROUND_FLOOR_name, true); zval const_ROUND_DOWN_value; ZVAL_LONG(&const_ROUND_DOWN_value, UNUM_ROUND_DOWN); - zend_string *const_ROUND_DOWN_name = zend_string_init_interned("ROUND_DOWN", sizeof("ROUND_DOWN") - 1, 1); + zend_string *const_ROUND_DOWN_name = zend_string_init_interned("ROUND_DOWN", sizeof("ROUND_DOWN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_DOWN_name, &const_ROUND_DOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_DOWN_name); + zend_string_release_ex(const_ROUND_DOWN_name, true); zval const_ROUND_UP_value; ZVAL_LONG(&const_ROUND_UP_value, UNUM_ROUND_UP); - zend_string *const_ROUND_UP_name = zend_string_init_interned("ROUND_UP", sizeof("ROUND_UP") - 1, 1); + zend_string *const_ROUND_UP_name = zend_string_init_interned("ROUND_UP", sizeof("ROUND_UP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_UP_name, &const_ROUND_UP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_UP_name); + zend_string_release_ex(const_ROUND_UP_name, true); zval const_ROUND_TOWARD_ZERO_value; ZVAL_LONG(&const_ROUND_TOWARD_ZERO_value, UNUM_ROUND_DOWN); - zend_string *const_ROUND_TOWARD_ZERO_name = zend_string_init_interned("ROUND_TOWARD_ZERO", sizeof("ROUND_TOWARD_ZERO") - 1, 1); + zend_string *const_ROUND_TOWARD_ZERO_name = zend_string_init_interned("ROUND_TOWARD_ZERO", sizeof("ROUND_TOWARD_ZERO") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_TOWARD_ZERO_name, &const_ROUND_TOWARD_ZERO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_TOWARD_ZERO_name); + zend_string_release_ex(const_ROUND_TOWARD_ZERO_name, true); zval const_ROUND_AWAY_FROM_ZERO_value; ZVAL_LONG(&const_ROUND_AWAY_FROM_ZERO_value, UNUM_ROUND_UP); - zend_string *const_ROUND_AWAY_FROM_ZERO_name = zend_string_init_interned("ROUND_AWAY_FROM_ZERO", sizeof("ROUND_AWAY_FROM_ZERO") - 1, 1); + zend_string *const_ROUND_AWAY_FROM_ZERO_name = zend_string_init_interned("ROUND_AWAY_FROM_ZERO", sizeof("ROUND_AWAY_FROM_ZERO") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_AWAY_FROM_ZERO_name, &const_ROUND_AWAY_FROM_ZERO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_AWAY_FROM_ZERO_name); + zend_string_release_ex(const_ROUND_AWAY_FROM_ZERO_name, true); zval const_ROUND_HALFEVEN_value; ZVAL_LONG(&const_ROUND_HALFEVEN_value, UNUM_ROUND_HALFEVEN); - zend_string *const_ROUND_HALFEVEN_name = zend_string_init_interned("ROUND_HALFEVEN", sizeof("ROUND_HALFEVEN") - 1, 1); + zend_string *const_ROUND_HALFEVEN_name = zend_string_init_interned("ROUND_HALFEVEN", sizeof("ROUND_HALFEVEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_HALFEVEN_name, &const_ROUND_HALFEVEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_HALFEVEN_name); + zend_string_release_ex(const_ROUND_HALFEVEN_name, true); #if U_ICU_VERSION_MAJOR_NUM >= 69 zval const_ROUND_HALFODD_value; ZVAL_LONG(&const_ROUND_HALFODD_value, UNUM_ROUND_HALF_ODD); - zend_string *const_ROUND_HALFODD_name = zend_string_init_interned("ROUND_HALFODD", sizeof("ROUND_HALFODD") - 1, 1); + zend_string *const_ROUND_HALFODD_name = zend_string_init_interned("ROUND_HALFODD", sizeof("ROUND_HALFODD") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_HALFODD_name, &const_ROUND_HALFODD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_HALFODD_name); + zend_string_release_ex(const_ROUND_HALFODD_name, true); #endif zval const_ROUND_HALFDOWN_value; ZVAL_LONG(&const_ROUND_HALFDOWN_value, UNUM_ROUND_HALFDOWN); - zend_string *const_ROUND_HALFDOWN_name = zend_string_init_interned("ROUND_HALFDOWN", sizeof("ROUND_HALFDOWN") - 1, 1); + zend_string *const_ROUND_HALFDOWN_name = zend_string_init_interned("ROUND_HALFDOWN", sizeof("ROUND_HALFDOWN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_HALFDOWN_name, &const_ROUND_HALFDOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_HALFDOWN_name); + zend_string_release_ex(const_ROUND_HALFDOWN_name, true); zval const_ROUND_HALFUP_value; ZVAL_LONG(&const_ROUND_HALFUP_value, UNUM_ROUND_HALFUP); - zend_string *const_ROUND_HALFUP_name = zend_string_init_interned("ROUND_HALFUP", sizeof("ROUND_HALFUP") - 1, 1); + zend_string *const_ROUND_HALFUP_name = zend_string_init_interned("ROUND_HALFUP", sizeof("ROUND_HALFUP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUND_HALFUP_name, &const_ROUND_HALFUP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUND_HALFUP_name); + zend_string_release_ex(const_ROUND_HALFUP_name, true); zval const_PAD_BEFORE_PREFIX_value; ZVAL_LONG(&const_PAD_BEFORE_PREFIX_value, UNUM_PAD_BEFORE_PREFIX); - zend_string *const_PAD_BEFORE_PREFIX_name = zend_string_init_interned("PAD_BEFORE_PREFIX", sizeof("PAD_BEFORE_PREFIX") - 1, 1); + zend_string *const_PAD_BEFORE_PREFIX_name = zend_string_init_interned("PAD_BEFORE_PREFIX", sizeof("PAD_BEFORE_PREFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_PAD_BEFORE_PREFIX_name, &const_PAD_BEFORE_PREFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PAD_BEFORE_PREFIX_name); + zend_string_release_ex(const_PAD_BEFORE_PREFIX_name, true); zval const_PAD_AFTER_PREFIX_value; ZVAL_LONG(&const_PAD_AFTER_PREFIX_value, UNUM_PAD_AFTER_PREFIX); - zend_string *const_PAD_AFTER_PREFIX_name = zend_string_init_interned("PAD_AFTER_PREFIX", sizeof("PAD_AFTER_PREFIX") - 1, 1); + zend_string *const_PAD_AFTER_PREFIX_name = zend_string_init_interned("PAD_AFTER_PREFIX", sizeof("PAD_AFTER_PREFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_PAD_AFTER_PREFIX_name, &const_PAD_AFTER_PREFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PAD_AFTER_PREFIX_name); + zend_string_release_ex(const_PAD_AFTER_PREFIX_name, true); zval const_PAD_BEFORE_SUFFIX_value; ZVAL_LONG(&const_PAD_BEFORE_SUFFIX_value, UNUM_PAD_BEFORE_SUFFIX); - zend_string *const_PAD_BEFORE_SUFFIX_name = zend_string_init_interned("PAD_BEFORE_SUFFIX", sizeof("PAD_BEFORE_SUFFIX") - 1, 1); + zend_string *const_PAD_BEFORE_SUFFIX_name = zend_string_init_interned("PAD_BEFORE_SUFFIX", sizeof("PAD_BEFORE_SUFFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_PAD_BEFORE_SUFFIX_name, &const_PAD_BEFORE_SUFFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PAD_BEFORE_SUFFIX_name); + zend_string_release_ex(const_PAD_BEFORE_SUFFIX_name, true); zval const_PAD_AFTER_SUFFIX_value; ZVAL_LONG(&const_PAD_AFTER_SUFFIX_value, UNUM_PAD_AFTER_SUFFIX); - zend_string *const_PAD_AFTER_SUFFIX_name = zend_string_init_interned("PAD_AFTER_SUFFIX", sizeof("PAD_AFTER_SUFFIX") - 1, 1); + zend_string *const_PAD_AFTER_SUFFIX_name = zend_string_init_interned("PAD_AFTER_SUFFIX", sizeof("PAD_AFTER_SUFFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_PAD_AFTER_SUFFIX_name, &const_PAD_AFTER_SUFFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PAD_AFTER_SUFFIX_name); + zend_string_release_ex(const_PAD_AFTER_SUFFIX_name, true); zval const_PARSE_INT_ONLY_value; ZVAL_LONG(&const_PARSE_INT_ONLY_value, UNUM_PARSE_INT_ONLY); - zend_string *const_PARSE_INT_ONLY_name = zend_string_init_interned("PARSE_INT_ONLY", sizeof("PARSE_INT_ONLY") - 1, 1); + zend_string *const_PARSE_INT_ONLY_name = zend_string_init_interned("PARSE_INT_ONLY", sizeof("PARSE_INT_ONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARSE_INT_ONLY_name, &const_PARSE_INT_ONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARSE_INT_ONLY_name); + zend_string_release_ex(const_PARSE_INT_ONLY_name, true); zval const_GROUPING_USED_value; ZVAL_LONG(&const_GROUPING_USED_value, UNUM_GROUPING_USED); - zend_string *const_GROUPING_USED_name = zend_string_init_interned("GROUPING_USED", sizeof("GROUPING_USED") - 1, 1); + zend_string *const_GROUPING_USED_name = zend_string_init_interned("GROUPING_USED", sizeof("GROUPING_USED") - 1, true); zend_declare_typed_class_constant(class_entry, const_GROUPING_USED_name, &const_GROUPING_USED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GROUPING_USED_name); + zend_string_release_ex(const_GROUPING_USED_name, true); zval const_DECIMAL_ALWAYS_SHOWN_value; ZVAL_LONG(&const_DECIMAL_ALWAYS_SHOWN_value, UNUM_DECIMAL_ALWAYS_SHOWN); - zend_string *const_DECIMAL_ALWAYS_SHOWN_name = zend_string_init_interned("DECIMAL_ALWAYS_SHOWN", sizeof("DECIMAL_ALWAYS_SHOWN") - 1, 1); + zend_string *const_DECIMAL_ALWAYS_SHOWN_name = zend_string_init_interned("DECIMAL_ALWAYS_SHOWN", sizeof("DECIMAL_ALWAYS_SHOWN") - 1, true); zend_declare_typed_class_constant(class_entry, const_DECIMAL_ALWAYS_SHOWN_name, &const_DECIMAL_ALWAYS_SHOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DECIMAL_ALWAYS_SHOWN_name); + zend_string_release_ex(const_DECIMAL_ALWAYS_SHOWN_name, true); zval const_MAX_INTEGER_DIGITS_value; ZVAL_LONG(&const_MAX_INTEGER_DIGITS_value, UNUM_MAX_INTEGER_DIGITS); - zend_string *const_MAX_INTEGER_DIGITS_name = zend_string_init_interned("MAX_INTEGER_DIGITS", sizeof("MAX_INTEGER_DIGITS") - 1, 1); + zend_string *const_MAX_INTEGER_DIGITS_name = zend_string_init_interned("MAX_INTEGER_DIGITS", sizeof("MAX_INTEGER_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MAX_INTEGER_DIGITS_name, &const_MAX_INTEGER_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MAX_INTEGER_DIGITS_name); + zend_string_release_ex(const_MAX_INTEGER_DIGITS_name, true); zval const_MIN_INTEGER_DIGITS_value; ZVAL_LONG(&const_MIN_INTEGER_DIGITS_value, UNUM_MIN_INTEGER_DIGITS); - zend_string *const_MIN_INTEGER_DIGITS_name = zend_string_init_interned("MIN_INTEGER_DIGITS", sizeof("MIN_INTEGER_DIGITS") - 1, 1); + zend_string *const_MIN_INTEGER_DIGITS_name = zend_string_init_interned("MIN_INTEGER_DIGITS", sizeof("MIN_INTEGER_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIN_INTEGER_DIGITS_name, &const_MIN_INTEGER_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIN_INTEGER_DIGITS_name); + zend_string_release_ex(const_MIN_INTEGER_DIGITS_name, true); zval const_INTEGER_DIGITS_value; ZVAL_LONG(&const_INTEGER_DIGITS_value, UNUM_INTEGER_DIGITS); - zend_string *const_INTEGER_DIGITS_name = zend_string_init_interned("INTEGER_DIGITS", sizeof("INTEGER_DIGITS") - 1, 1); + zend_string *const_INTEGER_DIGITS_name = zend_string_init_interned("INTEGER_DIGITS", sizeof("INTEGER_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_INTEGER_DIGITS_name, &const_INTEGER_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INTEGER_DIGITS_name); + zend_string_release_ex(const_INTEGER_DIGITS_name, true); zval const_MAX_FRACTION_DIGITS_value; ZVAL_LONG(&const_MAX_FRACTION_DIGITS_value, UNUM_MAX_FRACTION_DIGITS); - zend_string *const_MAX_FRACTION_DIGITS_name = zend_string_init_interned("MAX_FRACTION_DIGITS", sizeof("MAX_FRACTION_DIGITS") - 1, 1); + zend_string *const_MAX_FRACTION_DIGITS_name = zend_string_init_interned("MAX_FRACTION_DIGITS", sizeof("MAX_FRACTION_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MAX_FRACTION_DIGITS_name, &const_MAX_FRACTION_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MAX_FRACTION_DIGITS_name); + zend_string_release_ex(const_MAX_FRACTION_DIGITS_name, true); zval const_MIN_FRACTION_DIGITS_value; ZVAL_LONG(&const_MIN_FRACTION_DIGITS_value, UNUM_MIN_FRACTION_DIGITS); - zend_string *const_MIN_FRACTION_DIGITS_name = zend_string_init_interned("MIN_FRACTION_DIGITS", sizeof("MIN_FRACTION_DIGITS") - 1, 1); + zend_string *const_MIN_FRACTION_DIGITS_name = zend_string_init_interned("MIN_FRACTION_DIGITS", sizeof("MIN_FRACTION_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIN_FRACTION_DIGITS_name, &const_MIN_FRACTION_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIN_FRACTION_DIGITS_name); + zend_string_release_ex(const_MIN_FRACTION_DIGITS_name, true); zval const_FRACTION_DIGITS_value; ZVAL_LONG(&const_FRACTION_DIGITS_value, UNUM_FRACTION_DIGITS); - zend_string *const_FRACTION_DIGITS_name = zend_string_init_interned("FRACTION_DIGITS", sizeof("FRACTION_DIGITS") - 1, 1); + zend_string *const_FRACTION_DIGITS_name = zend_string_init_interned("FRACTION_DIGITS", sizeof("FRACTION_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_FRACTION_DIGITS_name, &const_FRACTION_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FRACTION_DIGITS_name); + zend_string_release_ex(const_FRACTION_DIGITS_name, true); zval const_MULTIPLIER_value; ZVAL_LONG(&const_MULTIPLIER_value, UNUM_MULTIPLIER); - zend_string *const_MULTIPLIER_name = zend_string_init_interned("MULTIPLIER", sizeof("MULTIPLIER") - 1, 1); + zend_string *const_MULTIPLIER_name = zend_string_init_interned("MULTIPLIER", sizeof("MULTIPLIER") - 1, true); zend_declare_typed_class_constant(class_entry, const_MULTIPLIER_name, &const_MULTIPLIER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MULTIPLIER_name); + zend_string_release_ex(const_MULTIPLIER_name, true); zval const_GROUPING_SIZE_value; ZVAL_LONG(&const_GROUPING_SIZE_value, UNUM_GROUPING_SIZE); - zend_string *const_GROUPING_SIZE_name = zend_string_init_interned("GROUPING_SIZE", sizeof("GROUPING_SIZE") - 1, 1); + zend_string *const_GROUPING_SIZE_name = zend_string_init_interned("GROUPING_SIZE", sizeof("GROUPING_SIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_GROUPING_SIZE_name, &const_GROUPING_SIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GROUPING_SIZE_name); + zend_string_release_ex(const_GROUPING_SIZE_name, true); zval const_ROUNDING_MODE_value; ZVAL_LONG(&const_ROUNDING_MODE_value, UNUM_ROUNDING_MODE); - zend_string *const_ROUNDING_MODE_name = zend_string_init_interned("ROUNDING_MODE", sizeof("ROUNDING_MODE") - 1, 1); + zend_string *const_ROUNDING_MODE_name = zend_string_init_interned("ROUNDING_MODE", sizeof("ROUNDING_MODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUNDING_MODE_name, &const_ROUNDING_MODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUNDING_MODE_name); + zend_string_release_ex(const_ROUNDING_MODE_name, true); zval const_ROUNDING_INCREMENT_value; ZVAL_LONG(&const_ROUNDING_INCREMENT_value, UNUM_ROUNDING_INCREMENT); - zend_string *const_ROUNDING_INCREMENT_name = zend_string_init_interned("ROUNDING_INCREMENT", sizeof("ROUNDING_INCREMENT") - 1, 1); + zend_string *const_ROUNDING_INCREMENT_name = zend_string_init_interned("ROUNDING_INCREMENT", sizeof("ROUNDING_INCREMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ROUNDING_INCREMENT_name, &const_ROUNDING_INCREMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ROUNDING_INCREMENT_name); + zend_string_release_ex(const_ROUNDING_INCREMENT_name, true); zval const_FORMAT_WIDTH_value; ZVAL_LONG(&const_FORMAT_WIDTH_value, UNUM_FORMAT_WIDTH); - zend_string *const_FORMAT_WIDTH_name = zend_string_init_interned("FORMAT_WIDTH", sizeof("FORMAT_WIDTH") - 1, 1); + zend_string *const_FORMAT_WIDTH_name = zend_string_init_interned("FORMAT_WIDTH", sizeof("FORMAT_WIDTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORMAT_WIDTH_name, &const_FORMAT_WIDTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORMAT_WIDTH_name); + zend_string_release_ex(const_FORMAT_WIDTH_name, true); zval const_PADDING_POSITION_value; ZVAL_LONG(&const_PADDING_POSITION_value, UNUM_PADDING_POSITION); - zend_string *const_PADDING_POSITION_name = zend_string_init_interned("PADDING_POSITION", sizeof("PADDING_POSITION") - 1, 1); + zend_string *const_PADDING_POSITION_name = zend_string_init_interned("PADDING_POSITION", sizeof("PADDING_POSITION") - 1, true); zend_declare_typed_class_constant(class_entry, const_PADDING_POSITION_name, &const_PADDING_POSITION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PADDING_POSITION_name); + zend_string_release_ex(const_PADDING_POSITION_name, true); zval const_SECONDARY_GROUPING_SIZE_value; ZVAL_LONG(&const_SECONDARY_GROUPING_SIZE_value, UNUM_SECONDARY_GROUPING_SIZE); - zend_string *const_SECONDARY_GROUPING_SIZE_name = zend_string_init_interned("SECONDARY_GROUPING_SIZE", sizeof("SECONDARY_GROUPING_SIZE") - 1, 1); + zend_string *const_SECONDARY_GROUPING_SIZE_name = zend_string_init_interned("SECONDARY_GROUPING_SIZE", sizeof("SECONDARY_GROUPING_SIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SECONDARY_GROUPING_SIZE_name, &const_SECONDARY_GROUPING_SIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SECONDARY_GROUPING_SIZE_name); + zend_string_release_ex(const_SECONDARY_GROUPING_SIZE_name, true); zval const_SIGNIFICANT_DIGITS_USED_value; ZVAL_LONG(&const_SIGNIFICANT_DIGITS_USED_value, UNUM_SIGNIFICANT_DIGITS_USED); - zend_string *const_SIGNIFICANT_DIGITS_USED_name = zend_string_init_interned("SIGNIFICANT_DIGITS_USED", sizeof("SIGNIFICANT_DIGITS_USED") - 1, 1); + zend_string *const_SIGNIFICANT_DIGITS_USED_name = zend_string_init_interned("SIGNIFICANT_DIGITS_USED", sizeof("SIGNIFICANT_DIGITS_USED") - 1, true); zend_declare_typed_class_constant(class_entry, const_SIGNIFICANT_DIGITS_USED_name, &const_SIGNIFICANT_DIGITS_USED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SIGNIFICANT_DIGITS_USED_name); + zend_string_release_ex(const_SIGNIFICANT_DIGITS_USED_name, true); zval const_MIN_SIGNIFICANT_DIGITS_value; ZVAL_LONG(&const_MIN_SIGNIFICANT_DIGITS_value, UNUM_MIN_SIGNIFICANT_DIGITS); - zend_string *const_MIN_SIGNIFICANT_DIGITS_name = zend_string_init_interned("MIN_SIGNIFICANT_DIGITS", sizeof("MIN_SIGNIFICANT_DIGITS") - 1, 1); + zend_string *const_MIN_SIGNIFICANT_DIGITS_name = zend_string_init_interned("MIN_SIGNIFICANT_DIGITS", sizeof("MIN_SIGNIFICANT_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIN_SIGNIFICANT_DIGITS_name, &const_MIN_SIGNIFICANT_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIN_SIGNIFICANT_DIGITS_name); + zend_string_release_ex(const_MIN_SIGNIFICANT_DIGITS_name, true); zval const_MAX_SIGNIFICANT_DIGITS_value; ZVAL_LONG(&const_MAX_SIGNIFICANT_DIGITS_value, UNUM_MAX_SIGNIFICANT_DIGITS); - zend_string *const_MAX_SIGNIFICANT_DIGITS_name = zend_string_init_interned("MAX_SIGNIFICANT_DIGITS", sizeof("MAX_SIGNIFICANT_DIGITS") - 1, 1); + zend_string *const_MAX_SIGNIFICANT_DIGITS_name = zend_string_init_interned("MAX_SIGNIFICANT_DIGITS", sizeof("MAX_SIGNIFICANT_DIGITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MAX_SIGNIFICANT_DIGITS_name, &const_MAX_SIGNIFICANT_DIGITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MAX_SIGNIFICANT_DIGITS_name); + zend_string_release_ex(const_MAX_SIGNIFICANT_DIGITS_name, true); zval const_LENIENT_PARSE_value; ZVAL_LONG(&const_LENIENT_PARSE_value, UNUM_LENIENT_PARSE); - zend_string *const_LENIENT_PARSE_name = zend_string_init_interned("LENIENT_PARSE", sizeof("LENIENT_PARSE") - 1, 1); + zend_string *const_LENIENT_PARSE_name = zend_string_init_interned("LENIENT_PARSE", sizeof("LENIENT_PARSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LENIENT_PARSE_name, &const_LENIENT_PARSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LENIENT_PARSE_name); + zend_string_release_ex(const_LENIENT_PARSE_name, true); zval const_POSITIVE_PREFIX_value; ZVAL_LONG(&const_POSITIVE_PREFIX_value, UNUM_POSITIVE_PREFIX); - zend_string *const_POSITIVE_PREFIX_name = zend_string_init_interned("POSITIVE_PREFIX", sizeof("POSITIVE_PREFIX") - 1, 1); + zend_string *const_POSITIVE_PREFIX_name = zend_string_init_interned("POSITIVE_PREFIX", sizeof("POSITIVE_PREFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_POSITIVE_PREFIX_name, &const_POSITIVE_PREFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_POSITIVE_PREFIX_name); + zend_string_release_ex(const_POSITIVE_PREFIX_name, true); zval const_POSITIVE_SUFFIX_value; ZVAL_LONG(&const_POSITIVE_SUFFIX_value, UNUM_POSITIVE_SUFFIX); - zend_string *const_POSITIVE_SUFFIX_name = zend_string_init_interned("POSITIVE_SUFFIX", sizeof("POSITIVE_SUFFIX") - 1, 1); + zend_string *const_POSITIVE_SUFFIX_name = zend_string_init_interned("POSITIVE_SUFFIX", sizeof("POSITIVE_SUFFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_POSITIVE_SUFFIX_name, &const_POSITIVE_SUFFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_POSITIVE_SUFFIX_name); + zend_string_release_ex(const_POSITIVE_SUFFIX_name, true); zval const_NEGATIVE_PREFIX_value; ZVAL_LONG(&const_NEGATIVE_PREFIX_value, UNUM_NEGATIVE_PREFIX); - zend_string *const_NEGATIVE_PREFIX_name = zend_string_init_interned("NEGATIVE_PREFIX", sizeof("NEGATIVE_PREFIX") - 1, 1); + zend_string *const_NEGATIVE_PREFIX_name = zend_string_init_interned("NEGATIVE_PREFIX", sizeof("NEGATIVE_PREFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_NEGATIVE_PREFIX_name, &const_NEGATIVE_PREFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NEGATIVE_PREFIX_name); + zend_string_release_ex(const_NEGATIVE_PREFIX_name, true); zval const_NEGATIVE_SUFFIX_value; ZVAL_LONG(&const_NEGATIVE_SUFFIX_value, UNUM_NEGATIVE_SUFFIX); - zend_string *const_NEGATIVE_SUFFIX_name = zend_string_init_interned("NEGATIVE_SUFFIX", sizeof("NEGATIVE_SUFFIX") - 1, 1); + zend_string *const_NEGATIVE_SUFFIX_name = zend_string_init_interned("NEGATIVE_SUFFIX", sizeof("NEGATIVE_SUFFIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_NEGATIVE_SUFFIX_name, &const_NEGATIVE_SUFFIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NEGATIVE_SUFFIX_name); + zend_string_release_ex(const_NEGATIVE_SUFFIX_name, true); zval const_PADDING_CHARACTER_value; ZVAL_LONG(&const_PADDING_CHARACTER_value, UNUM_PADDING_CHARACTER); - zend_string *const_PADDING_CHARACTER_name = zend_string_init_interned("PADDING_CHARACTER", sizeof("PADDING_CHARACTER") - 1, 1); + zend_string *const_PADDING_CHARACTER_name = zend_string_init_interned("PADDING_CHARACTER", sizeof("PADDING_CHARACTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_PADDING_CHARACTER_name, &const_PADDING_CHARACTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PADDING_CHARACTER_name); + zend_string_release_ex(const_PADDING_CHARACTER_name, true); zval const_CURRENCY_CODE_value; ZVAL_LONG(&const_CURRENCY_CODE_value, UNUM_CURRENCY_CODE); - zend_string *const_CURRENCY_CODE_name = zend_string_init_interned("CURRENCY_CODE", sizeof("CURRENCY_CODE") - 1, 1); + zend_string *const_CURRENCY_CODE_name = zend_string_init_interned("CURRENCY_CODE", sizeof("CURRENCY_CODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_CODE_name, &const_CURRENCY_CODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_CODE_name); + zend_string_release_ex(const_CURRENCY_CODE_name, true); zval const_DEFAULT_RULESET_value; ZVAL_LONG(&const_DEFAULT_RULESET_value, UNUM_DEFAULT_RULESET); - zend_string *const_DEFAULT_RULESET_name = zend_string_init_interned("DEFAULT_RULESET", sizeof("DEFAULT_RULESET") - 1, 1); + zend_string *const_DEFAULT_RULESET_name = zend_string_init_interned("DEFAULT_RULESET", sizeof("DEFAULT_RULESET") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULT_RULESET_name, &const_DEFAULT_RULESET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DEFAULT_RULESET_name); + zend_string_release_ex(const_DEFAULT_RULESET_name, true); zval const_PUBLIC_RULESETS_value; ZVAL_LONG(&const_PUBLIC_RULESETS_value, UNUM_PUBLIC_RULESETS); - zend_string *const_PUBLIC_RULESETS_name = zend_string_init_interned("PUBLIC_RULESETS", sizeof("PUBLIC_RULESETS") - 1, 1); + zend_string *const_PUBLIC_RULESETS_name = zend_string_init_interned("PUBLIC_RULESETS", sizeof("PUBLIC_RULESETS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PUBLIC_RULESETS_name, &const_PUBLIC_RULESETS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PUBLIC_RULESETS_name); + zend_string_release_ex(const_PUBLIC_RULESETS_name, true); zval const_DECIMAL_SEPARATOR_SYMBOL_value; ZVAL_LONG(&const_DECIMAL_SEPARATOR_SYMBOL_value, UNUM_DECIMAL_SEPARATOR_SYMBOL); - zend_string *const_DECIMAL_SEPARATOR_SYMBOL_name = zend_string_init_interned("DECIMAL_SEPARATOR_SYMBOL", sizeof("DECIMAL_SEPARATOR_SYMBOL") - 1, 1); + zend_string *const_DECIMAL_SEPARATOR_SYMBOL_name = zend_string_init_interned("DECIMAL_SEPARATOR_SYMBOL", sizeof("DECIMAL_SEPARATOR_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DECIMAL_SEPARATOR_SYMBOL_name, &const_DECIMAL_SEPARATOR_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DECIMAL_SEPARATOR_SYMBOL_name); + zend_string_release_ex(const_DECIMAL_SEPARATOR_SYMBOL_name, true); zval const_GROUPING_SEPARATOR_SYMBOL_value; ZVAL_LONG(&const_GROUPING_SEPARATOR_SYMBOL_value, UNUM_GROUPING_SEPARATOR_SYMBOL); - zend_string *const_GROUPING_SEPARATOR_SYMBOL_name = zend_string_init_interned("GROUPING_SEPARATOR_SYMBOL", sizeof("GROUPING_SEPARATOR_SYMBOL") - 1, 1); + zend_string *const_GROUPING_SEPARATOR_SYMBOL_name = zend_string_init_interned("GROUPING_SEPARATOR_SYMBOL", sizeof("GROUPING_SEPARATOR_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_GROUPING_SEPARATOR_SYMBOL_name, &const_GROUPING_SEPARATOR_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GROUPING_SEPARATOR_SYMBOL_name); + zend_string_release_ex(const_GROUPING_SEPARATOR_SYMBOL_name, true); zval const_PATTERN_SEPARATOR_SYMBOL_value; ZVAL_LONG(&const_PATTERN_SEPARATOR_SYMBOL_value, UNUM_PATTERN_SEPARATOR_SYMBOL); - zend_string *const_PATTERN_SEPARATOR_SYMBOL_name = zend_string_init_interned("PATTERN_SEPARATOR_SYMBOL", sizeof("PATTERN_SEPARATOR_SYMBOL") - 1, 1); + zend_string *const_PATTERN_SEPARATOR_SYMBOL_name = zend_string_init_interned("PATTERN_SEPARATOR_SYMBOL", sizeof("PATTERN_SEPARATOR_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PATTERN_SEPARATOR_SYMBOL_name, &const_PATTERN_SEPARATOR_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PATTERN_SEPARATOR_SYMBOL_name); + zend_string_release_ex(const_PATTERN_SEPARATOR_SYMBOL_name, true); zval const_PERCENT_SYMBOL_value; ZVAL_LONG(&const_PERCENT_SYMBOL_value, UNUM_PERCENT_SYMBOL); - zend_string *const_PERCENT_SYMBOL_name = zend_string_init_interned("PERCENT_SYMBOL", sizeof("PERCENT_SYMBOL") - 1, 1); + zend_string *const_PERCENT_SYMBOL_name = zend_string_init_interned("PERCENT_SYMBOL", sizeof("PERCENT_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PERCENT_SYMBOL_name, &const_PERCENT_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PERCENT_SYMBOL_name); + zend_string_release_ex(const_PERCENT_SYMBOL_name, true); zval const_ZERO_DIGIT_SYMBOL_value; ZVAL_LONG(&const_ZERO_DIGIT_SYMBOL_value, UNUM_ZERO_DIGIT_SYMBOL); - zend_string *const_ZERO_DIGIT_SYMBOL_name = zend_string_init_interned("ZERO_DIGIT_SYMBOL", sizeof("ZERO_DIGIT_SYMBOL") - 1, 1); + zend_string *const_ZERO_DIGIT_SYMBOL_name = zend_string_init_interned("ZERO_DIGIT_SYMBOL", sizeof("ZERO_DIGIT_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ZERO_DIGIT_SYMBOL_name, &const_ZERO_DIGIT_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ZERO_DIGIT_SYMBOL_name); + zend_string_release_ex(const_ZERO_DIGIT_SYMBOL_name, true); zval const_DIGIT_SYMBOL_value; ZVAL_LONG(&const_DIGIT_SYMBOL_value, UNUM_DIGIT_SYMBOL); - zend_string *const_DIGIT_SYMBOL_name = zend_string_init_interned("DIGIT_SYMBOL", sizeof("DIGIT_SYMBOL") - 1, 1); + zend_string *const_DIGIT_SYMBOL_name = zend_string_init_interned("DIGIT_SYMBOL", sizeof("DIGIT_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DIGIT_SYMBOL_name, &const_DIGIT_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DIGIT_SYMBOL_name); + zend_string_release_ex(const_DIGIT_SYMBOL_name, true); zval const_MINUS_SIGN_SYMBOL_value; ZVAL_LONG(&const_MINUS_SIGN_SYMBOL_value, UNUM_MINUS_SIGN_SYMBOL); - zend_string *const_MINUS_SIGN_SYMBOL_name = zend_string_init_interned("MINUS_SIGN_SYMBOL", sizeof("MINUS_SIGN_SYMBOL") - 1, 1); + zend_string *const_MINUS_SIGN_SYMBOL_name = zend_string_init_interned("MINUS_SIGN_SYMBOL", sizeof("MINUS_SIGN_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_MINUS_SIGN_SYMBOL_name, &const_MINUS_SIGN_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MINUS_SIGN_SYMBOL_name); + zend_string_release_ex(const_MINUS_SIGN_SYMBOL_name, true); zval const_PLUS_SIGN_SYMBOL_value; ZVAL_LONG(&const_PLUS_SIGN_SYMBOL_value, UNUM_PLUS_SIGN_SYMBOL); - zend_string *const_PLUS_SIGN_SYMBOL_name = zend_string_init_interned("PLUS_SIGN_SYMBOL", sizeof("PLUS_SIGN_SYMBOL") - 1, 1); + zend_string *const_PLUS_SIGN_SYMBOL_name = zend_string_init_interned("PLUS_SIGN_SYMBOL", sizeof("PLUS_SIGN_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PLUS_SIGN_SYMBOL_name, &const_PLUS_SIGN_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PLUS_SIGN_SYMBOL_name); + zend_string_release_ex(const_PLUS_SIGN_SYMBOL_name, true); zval const_CURRENCY_SYMBOL_value; ZVAL_LONG(&const_CURRENCY_SYMBOL_value, UNUM_CURRENCY_SYMBOL); - zend_string *const_CURRENCY_SYMBOL_name = zend_string_init_interned("CURRENCY_SYMBOL", sizeof("CURRENCY_SYMBOL") - 1, 1); + zend_string *const_CURRENCY_SYMBOL_name = zend_string_init_interned("CURRENCY_SYMBOL", sizeof("CURRENCY_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENCY_SYMBOL_name, &const_CURRENCY_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENCY_SYMBOL_name); + zend_string_release_ex(const_CURRENCY_SYMBOL_name, true); zval const_INTL_CURRENCY_SYMBOL_value; ZVAL_LONG(&const_INTL_CURRENCY_SYMBOL_value, UNUM_INTL_CURRENCY_SYMBOL); - zend_string *const_INTL_CURRENCY_SYMBOL_name = zend_string_init_interned("INTL_CURRENCY_SYMBOL", sizeof("INTL_CURRENCY_SYMBOL") - 1, 1); + zend_string *const_INTL_CURRENCY_SYMBOL_name = zend_string_init_interned("INTL_CURRENCY_SYMBOL", sizeof("INTL_CURRENCY_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_INTL_CURRENCY_SYMBOL_name, &const_INTL_CURRENCY_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INTL_CURRENCY_SYMBOL_name); + zend_string_release_ex(const_INTL_CURRENCY_SYMBOL_name, true); zval const_MONETARY_SEPARATOR_SYMBOL_value; ZVAL_LONG(&const_MONETARY_SEPARATOR_SYMBOL_value, UNUM_MONETARY_SEPARATOR_SYMBOL); - zend_string *const_MONETARY_SEPARATOR_SYMBOL_name = zend_string_init_interned("MONETARY_SEPARATOR_SYMBOL", sizeof("MONETARY_SEPARATOR_SYMBOL") - 1, 1); + zend_string *const_MONETARY_SEPARATOR_SYMBOL_name = zend_string_init_interned("MONETARY_SEPARATOR_SYMBOL", sizeof("MONETARY_SEPARATOR_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_MONETARY_SEPARATOR_SYMBOL_name, &const_MONETARY_SEPARATOR_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MONETARY_SEPARATOR_SYMBOL_name); + zend_string_release_ex(const_MONETARY_SEPARATOR_SYMBOL_name, true); zval const_EXPONENTIAL_SYMBOL_value; ZVAL_LONG(&const_EXPONENTIAL_SYMBOL_value, UNUM_EXPONENTIAL_SYMBOL); - zend_string *const_EXPONENTIAL_SYMBOL_name = zend_string_init_interned("EXPONENTIAL_SYMBOL", sizeof("EXPONENTIAL_SYMBOL") - 1, 1); + zend_string *const_EXPONENTIAL_SYMBOL_name = zend_string_init_interned("EXPONENTIAL_SYMBOL", sizeof("EXPONENTIAL_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPONENTIAL_SYMBOL_name, &const_EXPONENTIAL_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPONENTIAL_SYMBOL_name); + zend_string_release_ex(const_EXPONENTIAL_SYMBOL_name, true); zval const_PERMILL_SYMBOL_value; ZVAL_LONG(&const_PERMILL_SYMBOL_value, UNUM_PERMILL_SYMBOL); - zend_string *const_PERMILL_SYMBOL_name = zend_string_init_interned("PERMILL_SYMBOL", sizeof("PERMILL_SYMBOL") - 1, 1); + zend_string *const_PERMILL_SYMBOL_name = zend_string_init_interned("PERMILL_SYMBOL", sizeof("PERMILL_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PERMILL_SYMBOL_name, &const_PERMILL_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PERMILL_SYMBOL_name); + zend_string_release_ex(const_PERMILL_SYMBOL_name, true); zval const_PAD_ESCAPE_SYMBOL_value; ZVAL_LONG(&const_PAD_ESCAPE_SYMBOL_value, UNUM_PAD_ESCAPE_SYMBOL); - zend_string *const_PAD_ESCAPE_SYMBOL_name = zend_string_init_interned("PAD_ESCAPE_SYMBOL", sizeof("PAD_ESCAPE_SYMBOL") - 1, 1); + zend_string *const_PAD_ESCAPE_SYMBOL_name = zend_string_init_interned("PAD_ESCAPE_SYMBOL", sizeof("PAD_ESCAPE_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PAD_ESCAPE_SYMBOL_name, &const_PAD_ESCAPE_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PAD_ESCAPE_SYMBOL_name); + zend_string_release_ex(const_PAD_ESCAPE_SYMBOL_name, true); zval const_INFINITY_SYMBOL_value; ZVAL_LONG(&const_INFINITY_SYMBOL_value, UNUM_INFINITY_SYMBOL); - zend_string *const_INFINITY_SYMBOL_name = zend_string_init_interned("INFINITY_SYMBOL", sizeof("INFINITY_SYMBOL") - 1, 1); + zend_string *const_INFINITY_SYMBOL_name = zend_string_init_interned("INFINITY_SYMBOL", sizeof("INFINITY_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_INFINITY_SYMBOL_name, &const_INFINITY_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INFINITY_SYMBOL_name); + zend_string_release_ex(const_INFINITY_SYMBOL_name, true); zval const_NAN_SYMBOL_value; ZVAL_LONG(&const_NAN_SYMBOL_value, UNUM_NAN_SYMBOL); - zend_string *const_NAN_SYMBOL_name = zend_string_init_interned("NAN_SYMBOL", sizeof("NAN_SYMBOL") - 1, 1); + zend_string *const_NAN_SYMBOL_name = zend_string_init_interned("NAN_SYMBOL", sizeof("NAN_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_NAN_SYMBOL_name, &const_NAN_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NAN_SYMBOL_name); + zend_string_release_ex(const_NAN_SYMBOL_name, true); zval const_SIGNIFICANT_DIGIT_SYMBOL_value; ZVAL_LONG(&const_SIGNIFICANT_DIGIT_SYMBOL_value, UNUM_SIGNIFICANT_DIGIT_SYMBOL); - zend_string *const_SIGNIFICANT_DIGIT_SYMBOL_name = zend_string_init_interned("SIGNIFICANT_DIGIT_SYMBOL", sizeof("SIGNIFICANT_DIGIT_SYMBOL") - 1, 1); + zend_string *const_SIGNIFICANT_DIGIT_SYMBOL_name = zend_string_init_interned("SIGNIFICANT_DIGIT_SYMBOL", sizeof("SIGNIFICANT_DIGIT_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_SIGNIFICANT_DIGIT_SYMBOL_name, &const_SIGNIFICANT_DIGIT_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SIGNIFICANT_DIGIT_SYMBOL_name); + zend_string_release_ex(const_SIGNIFICANT_DIGIT_SYMBOL_name, true); zval const_MONETARY_GROUPING_SEPARATOR_SYMBOL_value; ZVAL_LONG(&const_MONETARY_GROUPING_SEPARATOR_SYMBOL_value, UNUM_MONETARY_GROUPING_SEPARATOR_SYMBOL); - zend_string *const_MONETARY_GROUPING_SEPARATOR_SYMBOL_name = zend_string_init_interned("MONETARY_GROUPING_SEPARATOR_SYMBOL", sizeof("MONETARY_GROUPING_SEPARATOR_SYMBOL") - 1, 1); + zend_string *const_MONETARY_GROUPING_SEPARATOR_SYMBOL_name = zend_string_init_interned("MONETARY_GROUPING_SEPARATOR_SYMBOL", sizeof("MONETARY_GROUPING_SEPARATOR_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_MONETARY_GROUPING_SEPARATOR_SYMBOL_name, &const_MONETARY_GROUPING_SEPARATOR_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MONETARY_GROUPING_SEPARATOR_SYMBOL_name); + zend_string_release_ex(const_MONETARY_GROUPING_SEPARATOR_SYMBOL_name, true); zval const_TYPE_DEFAULT_value; ZVAL_LONG(&const_TYPE_DEFAULT_value, FORMAT_TYPE_DEFAULT); - zend_string *const_TYPE_DEFAULT_name = zend_string_init_interned("TYPE_DEFAULT", sizeof("TYPE_DEFAULT") - 1, 1); + zend_string *const_TYPE_DEFAULT_name = zend_string_init_interned("TYPE_DEFAULT", sizeof("TYPE_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_DEFAULT_name, &const_TYPE_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_DEFAULT_name); + zend_string_release_ex(const_TYPE_DEFAULT_name, true); zval const_TYPE_INT32_value; ZVAL_LONG(&const_TYPE_INT32_value, FORMAT_TYPE_INT32); - zend_string *const_TYPE_INT32_name = zend_string_init_interned("TYPE_INT32", sizeof("TYPE_INT32") - 1, 1); + zend_string *const_TYPE_INT32_name = zend_string_init_interned("TYPE_INT32", sizeof("TYPE_INT32") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_INT32_name, &const_TYPE_INT32_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_INT32_name); + zend_string_release_ex(const_TYPE_INT32_name, true); zval const_TYPE_INT64_value; ZVAL_LONG(&const_TYPE_INT64_value, FORMAT_TYPE_INT64); - zend_string *const_TYPE_INT64_name = zend_string_init_interned("TYPE_INT64", sizeof("TYPE_INT64") - 1, 1); + zend_string *const_TYPE_INT64_name = zend_string_init_interned("TYPE_INT64", sizeof("TYPE_INT64") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_INT64_name, &const_TYPE_INT64_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_INT64_name); + zend_string_release_ex(const_TYPE_INT64_name, true); zval const_TYPE_DOUBLE_value; ZVAL_LONG(&const_TYPE_DOUBLE_value, FORMAT_TYPE_DOUBLE); - zend_string *const_TYPE_DOUBLE_name = zend_string_init_interned("TYPE_DOUBLE", sizeof("TYPE_DOUBLE") - 1, 1); + zend_string *const_TYPE_DOUBLE_name = zend_string_init_interned("TYPE_DOUBLE", sizeof("TYPE_DOUBLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_DOUBLE_name, &const_TYPE_DOUBLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_DOUBLE_name); + zend_string_release_ex(const_TYPE_DOUBLE_name, true); zval const_TYPE_CURRENCY_value; ZVAL_LONG(&const_TYPE_CURRENCY_value, FORMAT_TYPE_CURRENCY); - zend_string *const_TYPE_CURRENCY_name = zend_string_init_interned("TYPE_CURRENCY", sizeof("TYPE_CURRENCY") - 1, 1); + zend_string *const_TYPE_CURRENCY_name = zend_string_init_interned("TYPE_CURRENCY", sizeof("TYPE_CURRENCY") - 1, true); zend_class_constant *const_TYPE_CURRENCY = zend_declare_typed_class_constant(class_entry, const_TYPE_CURRENCY_name, &const_TYPE_CURRENCY_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_CURRENCY_name); + zend_string_release_ex(const_TYPE_CURRENCY_name, true); zend_attribute *attribute_Deprecated_const_TYPE_CURRENCY_0 = zend_add_class_constant_attribute(class_entry, const_TYPE_CURRENCY, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 1); diff --git a/ext/intl/listformatter/listformatter_arginfo.h b/ext/intl/listformatter/listformatter_arginfo.h index 3a2afa2d1c2d9..fda62aac9691d 100644 --- a/ext/intl/listformatter/listformatter_arginfo.h +++ b/ext/intl/listformatter/listformatter_arginfo.h @@ -40,59 +40,59 @@ static zend_class_entry *register_class_IntlListFormatter(void) zval const_TYPE_AND_value; ZVAL_LONG(&const_TYPE_AND_value, ULISTFMT_TYPE_AND); - zend_string *const_TYPE_AND_name = zend_string_init_interned("TYPE_AND", sizeof("TYPE_AND") - 1, 1); + zend_string *const_TYPE_AND_name = zend_string_init_interned("TYPE_AND", sizeof("TYPE_AND") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_AND_name, &const_TYPE_AND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_AND_name); + zend_string_release_ex(const_TYPE_AND_name, true); #endif #if !(U_ICU_VERSION_MAJOR_NUM >= 67) zval const_TYPE_AND_value; ZVAL_LONG(&const_TYPE_AND_value, INTL_LISTFORMATTER_FALLBACK_TYPE_AND); - zend_string *const_TYPE_AND_name = zend_string_init_interned("TYPE_AND", sizeof("TYPE_AND") - 1, 1); + zend_string *const_TYPE_AND_name = zend_string_init_interned("TYPE_AND", sizeof("TYPE_AND") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_AND_name, &const_TYPE_AND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_AND_name); + zend_string_release_ex(const_TYPE_AND_name, true); #endif #if U_ICU_VERSION_MAJOR_NUM >= 67 zval const_TYPE_OR_value; ZVAL_LONG(&const_TYPE_OR_value, ULISTFMT_TYPE_OR); - zend_string *const_TYPE_OR_name = zend_string_init_interned("TYPE_OR", sizeof("TYPE_OR") - 1, 1); + zend_string *const_TYPE_OR_name = zend_string_init_interned("TYPE_OR", sizeof("TYPE_OR") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_OR_name, &const_TYPE_OR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_OR_name); + zend_string_release_ex(const_TYPE_OR_name, true); zval const_TYPE_UNITS_value; ZVAL_LONG(&const_TYPE_UNITS_value, ULISTFMT_TYPE_UNITS); - zend_string *const_TYPE_UNITS_name = zend_string_init_interned("TYPE_UNITS", sizeof("TYPE_UNITS") - 1, 1); + zend_string *const_TYPE_UNITS_name = zend_string_init_interned("TYPE_UNITS", sizeof("TYPE_UNITS") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_UNITS_name, &const_TYPE_UNITS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_UNITS_name); + zend_string_release_ex(const_TYPE_UNITS_name, true); zval const_WIDTH_WIDE_value; ZVAL_LONG(&const_WIDTH_WIDE_value, ULISTFMT_WIDTH_WIDE); - zend_string *const_WIDTH_WIDE_name = zend_string_init_interned("WIDTH_WIDE", sizeof("WIDTH_WIDE") - 1, 1); + zend_string *const_WIDTH_WIDE_name = zend_string_init_interned("WIDTH_WIDE", sizeof("WIDTH_WIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WIDTH_WIDE_name, &const_WIDTH_WIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WIDTH_WIDE_name); + zend_string_release_ex(const_WIDTH_WIDE_name, true); #endif #if !(U_ICU_VERSION_MAJOR_NUM >= 67) zval const_WIDTH_WIDE_value; ZVAL_LONG(&const_WIDTH_WIDE_value, INTL_LISTFORMATTER_FALLBACK_WIDTH_WIDE); - zend_string *const_WIDTH_WIDE_name = zend_string_init_interned("WIDTH_WIDE", sizeof("WIDTH_WIDE") - 1, 1); + zend_string *const_WIDTH_WIDE_name = zend_string_init_interned("WIDTH_WIDE", sizeof("WIDTH_WIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WIDTH_WIDE_name, &const_WIDTH_WIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WIDTH_WIDE_name); + zend_string_release_ex(const_WIDTH_WIDE_name, true); #endif #if U_ICU_VERSION_MAJOR_NUM >= 67 zval const_WIDTH_SHORT_value; ZVAL_LONG(&const_WIDTH_SHORT_value, ULISTFMT_WIDTH_SHORT); - zend_string *const_WIDTH_SHORT_name = zend_string_init_interned("WIDTH_SHORT", sizeof("WIDTH_SHORT") - 1, 1); + zend_string *const_WIDTH_SHORT_name = zend_string_init_interned("WIDTH_SHORT", sizeof("WIDTH_SHORT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WIDTH_SHORT_name, &const_WIDTH_SHORT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WIDTH_SHORT_name); + zend_string_release_ex(const_WIDTH_SHORT_name, true); zval const_WIDTH_NARROW_value; ZVAL_LONG(&const_WIDTH_NARROW_value, ULISTFMT_WIDTH_NARROW); - zend_string *const_WIDTH_NARROW_name = zend_string_init_interned("WIDTH_NARROW", sizeof("WIDTH_NARROW") - 1, 1); + zend_string *const_WIDTH_NARROW_name = zend_string_init_interned("WIDTH_NARROW", sizeof("WIDTH_NARROW") - 1, true); zend_declare_typed_class_constant(class_entry, const_WIDTH_NARROW_name, &const_WIDTH_NARROW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WIDTH_NARROW_name); + zend_string_release_ex(const_WIDTH_NARROW_name, true); #endif return class_entry; diff --git a/ext/intl/locale/locale_arginfo.h b/ext/intl/locale/locale_arginfo.h index 79a16452e2975..e6fde7981a98c 100644 --- a/ext/intl/locale/locale_arginfo.h +++ b/ext/intl/locale/locale_arginfo.h @@ -128,70 +128,70 @@ static zend_class_entry *register_class_Locale(void) zval const_ACTUAL_LOCALE_value; ZVAL_LONG(&const_ACTUAL_LOCALE_value, ULOC_ACTUAL_LOCALE); - zend_string *const_ACTUAL_LOCALE_name = zend_string_init_interned("ACTUAL_LOCALE", sizeof("ACTUAL_LOCALE") - 1, 1); + zend_string *const_ACTUAL_LOCALE_name = zend_string_init_interned("ACTUAL_LOCALE", sizeof("ACTUAL_LOCALE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ACTUAL_LOCALE_name, &const_ACTUAL_LOCALE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ACTUAL_LOCALE_name); + zend_string_release_ex(const_ACTUAL_LOCALE_name, true); zval const_VALID_LOCALE_value; ZVAL_LONG(&const_VALID_LOCALE_value, ULOC_VALID_LOCALE); - zend_string *const_VALID_LOCALE_name = zend_string_init_interned("VALID_LOCALE", sizeof("VALID_LOCALE") - 1, 1); + zend_string *const_VALID_LOCALE_name = zend_string_init_interned("VALID_LOCALE", sizeof("VALID_LOCALE") - 1, true); zend_declare_typed_class_constant(class_entry, const_VALID_LOCALE_name, &const_VALID_LOCALE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VALID_LOCALE_name); + zend_string_release_ex(const_VALID_LOCALE_name, true); zval const_DEFAULT_LOCALE_value; ZVAL_NULL(&const_DEFAULT_LOCALE_value); - zend_string *const_DEFAULT_LOCALE_name = zend_string_init_interned("DEFAULT_LOCALE", sizeof("DEFAULT_LOCALE") - 1, 1); + zend_string *const_DEFAULT_LOCALE_name = zend_string_init_interned("DEFAULT_LOCALE", sizeof("DEFAULT_LOCALE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULT_LOCALE_name, &const_DEFAULT_LOCALE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_NULL)); - zend_string_release(const_DEFAULT_LOCALE_name); + zend_string_release_ex(const_DEFAULT_LOCALE_name, true); zval const_LANG_TAG_value; zend_string *const_LANG_TAG_value_str = zend_string_init(LOC_LANG_TAG, strlen(LOC_LANG_TAG), 1); ZVAL_STR(&const_LANG_TAG_value, const_LANG_TAG_value_str); - zend_string *const_LANG_TAG_name = zend_string_init_interned("LANG_TAG", sizeof("LANG_TAG") - 1, 1); + zend_string *const_LANG_TAG_name = zend_string_init_interned("LANG_TAG", sizeof("LANG_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_LANG_TAG_name, &const_LANG_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_LANG_TAG_name); + zend_string_release_ex(const_LANG_TAG_name, true); zval const_EXTLANG_TAG_value; zend_string *const_EXTLANG_TAG_value_str = zend_string_init(LOC_EXTLANG_TAG, strlen(LOC_EXTLANG_TAG), 1); ZVAL_STR(&const_EXTLANG_TAG_value, const_EXTLANG_TAG_value_str); - zend_string *const_EXTLANG_TAG_name = zend_string_init_interned("EXTLANG_TAG", sizeof("EXTLANG_TAG") - 1, 1); + zend_string *const_EXTLANG_TAG_name = zend_string_init_interned("EXTLANG_TAG", sizeof("EXTLANG_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXTLANG_TAG_name, &const_EXTLANG_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_EXTLANG_TAG_name); + zend_string_release_ex(const_EXTLANG_TAG_name, true); zval const_SCRIPT_TAG_value; zend_string *const_SCRIPT_TAG_value_str = zend_string_init(LOC_SCRIPT_TAG, strlen(LOC_SCRIPT_TAG), 1); ZVAL_STR(&const_SCRIPT_TAG_value, const_SCRIPT_TAG_value_str); - zend_string *const_SCRIPT_TAG_name = zend_string_init_interned("SCRIPT_TAG", sizeof("SCRIPT_TAG") - 1, 1); + zend_string *const_SCRIPT_TAG_name = zend_string_init_interned("SCRIPT_TAG", sizeof("SCRIPT_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_SCRIPT_TAG_name, &const_SCRIPT_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_SCRIPT_TAG_name); + zend_string_release_ex(const_SCRIPT_TAG_name, true); zval const_REGION_TAG_value; zend_string *const_REGION_TAG_value_str = zend_string_init(LOC_REGION_TAG, strlen(LOC_REGION_TAG), 1); ZVAL_STR(&const_REGION_TAG_value, const_REGION_TAG_value_str); - zend_string *const_REGION_TAG_name = zend_string_init_interned("REGION_TAG", sizeof("REGION_TAG") - 1, 1); + zend_string *const_REGION_TAG_name = zend_string_init_interned("REGION_TAG", sizeof("REGION_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_REGION_TAG_name, &const_REGION_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_REGION_TAG_name); + zend_string_release_ex(const_REGION_TAG_name, true); zval const_VARIANT_TAG_value; zend_string *const_VARIANT_TAG_value_str = zend_string_init(LOC_VARIANT_TAG, strlen(LOC_VARIANT_TAG), 1); ZVAL_STR(&const_VARIANT_TAG_value, const_VARIANT_TAG_value_str); - zend_string *const_VARIANT_TAG_name = zend_string_init_interned("VARIANT_TAG", sizeof("VARIANT_TAG") - 1, 1); + zend_string *const_VARIANT_TAG_name = zend_string_init_interned("VARIANT_TAG", sizeof("VARIANT_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_VARIANT_TAG_name, &const_VARIANT_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_VARIANT_TAG_name); + zend_string_release_ex(const_VARIANT_TAG_name, true); zval const_GRANDFATHERED_LANG_TAG_value; zend_string *const_GRANDFATHERED_LANG_TAG_value_str = zend_string_init(LOC_GRANDFATHERED_LANG_TAG, strlen(LOC_GRANDFATHERED_LANG_TAG), 1); ZVAL_STR(&const_GRANDFATHERED_LANG_TAG_value, const_GRANDFATHERED_LANG_TAG_value_str); - zend_string *const_GRANDFATHERED_LANG_TAG_name = zend_string_init_interned("GRANDFATHERED_LANG_TAG", sizeof("GRANDFATHERED_LANG_TAG") - 1, 1); + zend_string *const_GRANDFATHERED_LANG_TAG_name = zend_string_init_interned("GRANDFATHERED_LANG_TAG", sizeof("GRANDFATHERED_LANG_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_GRANDFATHERED_LANG_TAG_name, &const_GRANDFATHERED_LANG_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_GRANDFATHERED_LANG_TAG_name); + zend_string_release_ex(const_GRANDFATHERED_LANG_TAG_name, true); zval const_PRIVATE_TAG_value; zend_string *const_PRIVATE_TAG_value_str = zend_string_init(LOC_PRIVATE_TAG, strlen(LOC_PRIVATE_TAG), 1); ZVAL_STR(&const_PRIVATE_TAG_value, const_PRIVATE_TAG_value_str); - zend_string *const_PRIVATE_TAG_name = zend_string_init_interned("PRIVATE_TAG", sizeof("PRIVATE_TAG") - 1, 1); + zend_string *const_PRIVATE_TAG_name = zend_string_init_interned("PRIVATE_TAG", sizeof("PRIVATE_TAG") - 1, true); zend_declare_typed_class_constant(class_entry, const_PRIVATE_TAG_name, &const_PRIVATE_TAG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_PRIVATE_TAG_name); + zend_string_release_ex(const_PRIVATE_TAG_name, true); return class_entry; } diff --git a/ext/intl/normalizer/normalizer_arginfo.h b/ext/intl/normalizer/normalizer_arginfo.h index e5ef152c0423a..23ce84b1c76e1 100644 --- a/ext/intl/normalizer/normalizer_arginfo.h +++ b/ext/intl/normalizer/normalizer_arginfo.h @@ -36,63 +36,63 @@ static zend_class_entry *register_class_Normalizer(void) zval const_FORM_D_value; ZVAL_LONG(&const_FORM_D_value, NORMALIZER_FORM_D); - zend_string *const_FORM_D_name = zend_string_init_interned("FORM_D", sizeof("FORM_D") - 1, 1); + zend_string *const_FORM_D_name = zend_string_init_interned("FORM_D", sizeof("FORM_D") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORM_D_name, &const_FORM_D_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORM_D_name); + zend_string_release_ex(const_FORM_D_name, true); zval const_NFD_value; ZVAL_LONG(&const_NFD_value, NORMALIZER_NFD); - zend_string *const_NFD_name = zend_string_init_interned("NFD", sizeof("NFD") - 1, 1); + zend_string *const_NFD_name = zend_string_init_interned("NFD", sizeof("NFD") - 1, true); zend_declare_typed_class_constant(class_entry, const_NFD_name, &const_NFD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NFD_name); + zend_string_release_ex(const_NFD_name, true); zval const_FORM_KD_value; ZVAL_LONG(&const_FORM_KD_value, NORMALIZER_FORM_KD); - zend_string *const_FORM_KD_name = zend_string_init_interned("FORM_KD", sizeof("FORM_KD") - 1, 1); + zend_string *const_FORM_KD_name = zend_string_init_interned("FORM_KD", sizeof("FORM_KD") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORM_KD_name, &const_FORM_KD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORM_KD_name); + zend_string_release_ex(const_FORM_KD_name, true); zval const_NFKD_value; ZVAL_LONG(&const_NFKD_value, NORMALIZER_NFKD); - zend_string *const_NFKD_name = zend_string_init_interned("NFKD", sizeof("NFKD") - 1, 1); + zend_string *const_NFKD_name = zend_string_init_interned("NFKD", sizeof("NFKD") - 1, true); zend_declare_typed_class_constant(class_entry, const_NFKD_name, &const_NFKD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NFKD_name); + zend_string_release_ex(const_NFKD_name, true); zval const_FORM_C_value; ZVAL_LONG(&const_FORM_C_value, NORMALIZER_FORM_C); - zend_string *const_FORM_C_name = zend_string_init_interned("FORM_C", sizeof("FORM_C") - 1, 1); + zend_string *const_FORM_C_name = zend_string_init_interned("FORM_C", sizeof("FORM_C") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORM_C_name, &const_FORM_C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORM_C_name); + zend_string_release_ex(const_FORM_C_name, true); zval const_NFC_value; ZVAL_LONG(&const_NFC_value, NORMALIZER_NFC); - zend_string *const_NFC_name = zend_string_init_interned("NFC", sizeof("NFC") - 1, 1); + zend_string *const_NFC_name = zend_string_init_interned("NFC", sizeof("NFC") - 1, true); zend_declare_typed_class_constant(class_entry, const_NFC_name, &const_NFC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NFC_name); + zend_string_release_ex(const_NFC_name, true); zval const_FORM_KC_value; ZVAL_LONG(&const_FORM_KC_value, NORMALIZER_FORM_KC); - zend_string *const_FORM_KC_name = zend_string_init_interned("FORM_KC", sizeof("FORM_KC") - 1, 1); + zend_string *const_FORM_KC_name = zend_string_init_interned("FORM_KC", sizeof("FORM_KC") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORM_KC_name, &const_FORM_KC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORM_KC_name); + zend_string_release_ex(const_FORM_KC_name, true); zval const_NFKC_value; ZVAL_LONG(&const_NFKC_value, NORMALIZER_NFKC); - zend_string *const_NFKC_name = zend_string_init_interned("NFKC", sizeof("NFKC") - 1, 1); + zend_string *const_NFKC_name = zend_string_init_interned("NFKC", sizeof("NFKC") - 1, true); zend_declare_typed_class_constant(class_entry, const_NFKC_name, &const_NFKC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NFKC_name); + zend_string_release_ex(const_NFKC_name, true); zval const_FORM_KC_CF_value; ZVAL_LONG(&const_FORM_KC_CF_value, NORMALIZER_FORM_KC_CF); - zend_string *const_FORM_KC_CF_name = zend_string_init_interned("FORM_KC_CF", sizeof("FORM_KC_CF") - 1, 1); + zend_string *const_FORM_KC_CF_name = zend_string_init_interned("FORM_KC_CF", sizeof("FORM_KC_CF") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORM_KC_CF_name, &const_FORM_KC_CF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORM_KC_CF_name); + zend_string_release_ex(const_FORM_KC_CF_name, true); zval const_NFKC_CF_value; ZVAL_LONG(&const_NFKC_CF_value, NORMALIZER_NFKC_CF); - zend_string *const_NFKC_CF_name = zend_string_init_interned("NFKC_CF", sizeof("NFKC_CF") - 1, 1); + zend_string *const_NFKC_CF_name = zend_string_init_interned("NFKC_CF", sizeof("NFKC_CF") - 1, true); zend_declare_typed_class_constant(class_entry, const_NFKC_CF_name, &const_NFKC_CF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NFKC_CF_name); + zend_string_release_ex(const_NFKC_CF_name, true); return class_entry; } diff --git a/ext/intl/rangeformatter/rangeformatter_arginfo.h b/ext/intl/rangeformatter/rangeformatter_arginfo.h index 00e923702be11..ef3255415d16a 100644 --- a/ext/intl/rangeformatter/rangeformatter_arginfo.h +++ b/ext/intl/rangeformatter/rangeformatter_arginfo.h @@ -47,101 +47,101 @@ static zend_class_entry *register_class_IntlNumberRangeFormatter(void) zval const_COLLAPSE_AUTO_value; ZVAL_LONG(&const_COLLAPSE_AUTO_value, UNUM_RANGE_COLLAPSE_AUTO); - zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, 1); + zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_AUTO_name, &const_COLLAPSE_AUTO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_AUTO_name); + zend_string_release_ex(const_COLLAPSE_AUTO_name, true); zval const_COLLAPSE_NONE_value; ZVAL_LONG(&const_COLLAPSE_NONE_value, UNUM_RANGE_COLLAPSE_NONE); - zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, 1); + zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_NONE_name, &const_COLLAPSE_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_NONE_name); + zend_string_release_ex(const_COLLAPSE_NONE_name, true); zval const_COLLAPSE_UNIT_value; ZVAL_LONG(&const_COLLAPSE_UNIT_value, UNUM_RANGE_COLLAPSE_UNIT); - zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, 1); + zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_UNIT_name, &const_COLLAPSE_UNIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_UNIT_name); + zend_string_release_ex(const_COLLAPSE_UNIT_name, true); zval const_COLLAPSE_ALL_value; ZVAL_LONG(&const_COLLAPSE_ALL_value, UNUM_RANGE_COLLAPSE_ALL); - zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, 1); + zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_ALL_name, &const_COLLAPSE_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_ALL_name); + zend_string_release_ex(const_COLLAPSE_ALL_name, true); zval const_IDENTITY_FALLBACK_SINGLE_VALUE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_SINGLE_VALUE_value, UNUM_IDENTITY_FALLBACK_SINGLE_VALUE); - zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_SINGLE_VALUE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_SINGLE_VALUE_name, true); zval const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE); - zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, true); zval const_IDENTITY_FALLBACK_APPROXIMATELY_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_value, UNUM_IDENTITY_FALLBACK_APPROXIMATELY); - zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_APPROXIMATELY_name, true); zval const_IDENTITY_FALLBACK_RANGE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_RANGE_value, UNUM_IDENTITY_FALLBACK_RANGE); - zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_RANGE_name, &const_IDENTITY_FALLBACK_RANGE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_RANGE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_RANGE_name, true); #endif #if !(U_ICU_VERSION_MAJOR_NUM >= 63) zval const_COLLAPSE_AUTO_value; ZVAL_LONG(&const_COLLAPSE_AUTO_value, 0); - zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, 1); + zend_string *const_COLLAPSE_AUTO_name = zend_string_init_interned("COLLAPSE_AUTO", sizeof("COLLAPSE_AUTO") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_AUTO_name, &const_COLLAPSE_AUTO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_AUTO_name); + zend_string_release_ex(const_COLLAPSE_AUTO_name, true); zval const_COLLAPSE_NONE_value; ZVAL_LONG(&const_COLLAPSE_NONE_value, 1); - zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, 1); + zend_string *const_COLLAPSE_NONE_name = zend_string_init_interned("COLLAPSE_NONE", sizeof("COLLAPSE_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_NONE_name, &const_COLLAPSE_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_NONE_name); + zend_string_release_ex(const_COLLAPSE_NONE_name, true); zval const_COLLAPSE_UNIT_value; ZVAL_LONG(&const_COLLAPSE_UNIT_value, 2); - zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, 1); + zend_string *const_COLLAPSE_UNIT_name = zend_string_init_interned("COLLAPSE_UNIT", sizeof("COLLAPSE_UNIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_UNIT_name, &const_COLLAPSE_UNIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_UNIT_name); + zend_string_release_ex(const_COLLAPSE_UNIT_name, true); zval const_COLLAPSE_ALL_value; ZVAL_LONG(&const_COLLAPSE_ALL_value, 3); - zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, 1); + zend_string *const_COLLAPSE_ALL_name = zend_string_init_interned("COLLAPSE_ALL", sizeof("COLLAPSE_ALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_COLLAPSE_ALL_name, &const_COLLAPSE_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COLLAPSE_ALL_name); + zend_string_release_ex(const_COLLAPSE_ALL_name, true); zval const_IDENTITY_FALLBACK_SINGLE_VALUE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_SINGLE_VALUE_value, 0); - zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_SINGLE_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_SINGLE_VALUE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_SINGLE_VALUE_name, true); zval const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, 1); - zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE", sizeof("IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE_name, true); zval const_IDENTITY_FALLBACK_APPROXIMATELY_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_APPROXIMATELY_value, 2); - zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_APPROXIMATELY_name = zend_string_init_interned("IDENTITY_FALLBACK_APPROXIMATELY", sizeof("IDENTITY_FALLBACK_APPROXIMATELY") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_APPROXIMATELY_name, &const_IDENTITY_FALLBACK_APPROXIMATELY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_APPROXIMATELY_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_APPROXIMATELY_name, true); zval const_IDENTITY_FALLBACK_RANGE_value; ZVAL_LONG(&const_IDENTITY_FALLBACK_RANGE_value, 3); - zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, 1); + zend_string *const_IDENTITY_FALLBACK_RANGE_name = zend_string_init_interned("IDENTITY_FALLBACK_RANGE", sizeof("IDENTITY_FALLBACK_RANGE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IDENTITY_FALLBACK_RANGE_name, &const_IDENTITY_FALLBACK_RANGE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IDENTITY_FALLBACK_RANGE_name); + zend_string_release_ex(const_IDENTITY_FALLBACK_RANGE_name, true); #endif return class_entry; diff --git a/ext/intl/spoofchecker/spoofchecker_arginfo.h b/ext/intl/spoofchecker/spoofchecker_arginfo.h index 6a3c0e55aa27d..fa8996b8f24eb 100644 --- a/ext/intl/spoofchecker/spoofchecker_arginfo.h +++ b/ext/intl/spoofchecker/spoofchecker_arginfo.h @@ -66,122 +66,122 @@ static zend_class_entry *register_class_Spoofchecker(void) zval const_SINGLE_SCRIPT_CONFUSABLE_value; ZVAL_LONG(&const_SINGLE_SCRIPT_CONFUSABLE_value, USPOOF_SINGLE_SCRIPT_CONFUSABLE); - zend_string *const_SINGLE_SCRIPT_CONFUSABLE_name = zend_string_init_interned("SINGLE_SCRIPT_CONFUSABLE", sizeof("SINGLE_SCRIPT_CONFUSABLE") - 1, 1); + zend_string *const_SINGLE_SCRIPT_CONFUSABLE_name = zend_string_init_interned("SINGLE_SCRIPT_CONFUSABLE", sizeof("SINGLE_SCRIPT_CONFUSABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SINGLE_SCRIPT_CONFUSABLE_name, &const_SINGLE_SCRIPT_CONFUSABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SINGLE_SCRIPT_CONFUSABLE_name); + zend_string_release_ex(const_SINGLE_SCRIPT_CONFUSABLE_name, true); zval const_MIXED_SCRIPT_CONFUSABLE_value; ZVAL_LONG(&const_MIXED_SCRIPT_CONFUSABLE_value, USPOOF_MIXED_SCRIPT_CONFUSABLE); - zend_string *const_MIXED_SCRIPT_CONFUSABLE_name = zend_string_init_interned("MIXED_SCRIPT_CONFUSABLE", sizeof("MIXED_SCRIPT_CONFUSABLE") - 1, 1); + zend_string *const_MIXED_SCRIPT_CONFUSABLE_name = zend_string_init_interned("MIXED_SCRIPT_CONFUSABLE", sizeof("MIXED_SCRIPT_CONFUSABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIXED_SCRIPT_CONFUSABLE_name, &const_MIXED_SCRIPT_CONFUSABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIXED_SCRIPT_CONFUSABLE_name); + zend_string_release_ex(const_MIXED_SCRIPT_CONFUSABLE_name, true); zval const_WHOLE_SCRIPT_CONFUSABLE_value; ZVAL_LONG(&const_WHOLE_SCRIPT_CONFUSABLE_value, USPOOF_WHOLE_SCRIPT_CONFUSABLE); - zend_string *const_WHOLE_SCRIPT_CONFUSABLE_name = zend_string_init_interned("WHOLE_SCRIPT_CONFUSABLE", sizeof("WHOLE_SCRIPT_CONFUSABLE") - 1, 1); + zend_string *const_WHOLE_SCRIPT_CONFUSABLE_name = zend_string_init_interned("WHOLE_SCRIPT_CONFUSABLE", sizeof("WHOLE_SCRIPT_CONFUSABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WHOLE_SCRIPT_CONFUSABLE_name, &const_WHOLE_SCRIPT_CONFUSABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WHOLE_SCRIPT_CONFUSABLE_name); + zend_string_release_ex(const_WHOLE_SCRIPT_CONFUSABLE_name, true); zval const_ANY_CASE_value; ZVAL_LONG(&const_ANY_CASE_value, USPOOF_ANY_CASE); - zend_string *const_ANY_CASE_name = zend_string_init_interned("ANY_CASE", sizeof("ANY_CASE") - 1, 1); + zend_string *const_ANY_CASE_name = zend_string_init_interned("ANY_CASE", sizeof("ANY_CASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ANY_CASE_name, &const_ANY_CASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ANY_CASE_name); + zend_string_release_ex(const_ANY_CASE_name, true); zval const_SINGLE_SCRIPT_value; ZVAL_LONG(&const_SINGLE_SCRIPT_value, USPOOF_SINGLE_SCRIPT); - zend_string *const_SINGLE_SCRIPT_name = zend_string_init_interned("SINGLE_SCRIPT", sizeof("SINGLE_SCRIPT") - 1, 1); + zend_string *const_SINGLE_SCRIPT_name = zend_string_init_interned("SINGLE_SCRIPT", sizeof("SINGLE_SCRIPT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SINGLE_SCRIPT_name, &const_SINGLE_SCRIPT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SINGLE_SCRIPT_name); + zend_string_release_ex(const_SINGLE_SCRIPT_name, true); zval const_INVISIBLE_value; ZVAL_LONG(&const_INVISIBLE_value, USPOOF_INVISIBLE); - zend_string *const_INVISIBLE_name = zend_string_init_interned("INVISIBLE", sizeof("INVISIBLE") - 1, 1); + zend_string *const_INVISIBLE_name = zend_string_init_interned("INVISIBLE", sizeof("INVISIBLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_INVISIBLE_name, &const_INVISIBLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INVISIBLE_name); + zend_string_release_ex(const_INVISIBLE_name, true); zval const_CHAR_LIMIT_value; ZVAL_LONG(&const_CHAR_LIMIT_value, USPOOF_CHAR_LIMIT); - zend_string *const_CHAR_LIMIT_name = zend_string_init_interned("CHAR_LIMIT", sizeof("CHAR_LIMIT") - 1, 1); + zend_string *const_CHAR_LIMIT_name = zend_string_init_interned("CHAR_LIMIT", sizeof("CHAR_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_LIMIT_name, &const_CHAR_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_LIMIT_name); + zend_string_release_ex(const_CHAR_LIMIT_name, true); #if U_ICU_VERSION_MAJOR_NUM >= 58 zval const_ASCII_value; ZVAL_LONG(&const_ASCII_value, USPOOF_ASCII); - zend_string *const_ASCII_name = zend_string_init_interned("ASCII", sizeof("ASCII") - 1, 1); + zend_string *const_ASCII_name = zend_string_init_interned("ASCII", sizeof("ASCII") - 1, true); zend_declare_typed_class_constant(class_entry, const_ASCII_name, &const_ASCII_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ASCII_name); + zend_string_release_ex(const_ASCII_name, true); zval const_HIGHLY_RESTRICTIVE_value; ZVAL_LONG(&const_HIGHLY_RESTRICTIVE_value, USPOOF_HIGHLY_RESTRICTIVE); - zend_string *const_HIGHLY_RESTRICTIVE_name = zend_string_init_interned("HIGHLY_RESTRICTIVE", sizeof("HIGHLY_RESTRICTIVE") - 1, 1); + zend_string *const_HIGHLY_RESTRICTIVE_name = zend_string_init_interned("HIGHLY_RESTRICTIVE", sizeof("HIGHLY_RESTRICTIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_HIGHLY_RESTRICTIVE_name, &const_HIGHLY_RESTRICTIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HIGHLY_RESTRICTIVE_name); + zend_string_release_ex(const_HIGHLY_RESTRICTIVE_name, true); zval const_MODERATELY_RESTRICTIVE_value; ZVAL_LONG(&const_MODERATELY_RESTRICTIVE_value, USPOOF_MODERATELY_RESTRICTIVE); - zend_string *const_MODERATELY_RESTRICTIVE_name = zend_string_init_interned("MODERATELY_RESTRICTIVE", sizeof("MODERATELY_RESTRICTIVE") - 1, 1); + zend_string *const_MODERATELY_RESTRICTIVE_name = zend_string_init_interned("MODERATELY_RESTRICTIVE", sizeof("MODERATELY_RESTRICTIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_MODERATELY_RESTRICTIVE_name, &const_MODERATELY_RESTRICTIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MODERATELY_RESTRICTIVE_name); + zend_string_release_ex(const_MODERATELY_RESTRICTIVE_name, true); zval const_MINIMALLY_RESTRICTIVE_value; ZVAL_LONG(&const_MINIMALLY_RESTRICTIVE_value, USPOOF_MINIMALLY_RESTRICTIVE); - zend_string *const_MINIMALLY_RESTRICTIVE_name = zend_string_init_interned("MINIMALLY_RESTRICTIVE", sizeof("MINIMALLY_RESTRICTIVE") - 1, 1); + zend_string *const_MINIMALLY_RESTRICTIVE_name = zend_string_init_interned("MINIMALLY_RESTRICTIVE", sizeof("MINIMALLY_RESTRICTIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_MINIMALLY_RESTRICTIVE_name, &const_MINIMALLY_RESTRICTIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MINIMALLY_RESTRICTIVE_name); + zend_string_release_ex(const_MINIMALLY_RESTRICTIVE_name, true); zval const_UNRESTRICTIVE_value; ZVAL_LONG(&const_UNRESTRICTIVE_value, USPOOF_UNRESTRICTIVE); - zend_string *const_UNRESTRICTIVE_name = zend_string_init_interned("UNRESTRICTIVE", sizeof("UNRESTRICTIVE") - 1, 1); + zend_string *const_UNRESTRICTIVE_name = zend_string_init_interned("UNRESTRICTIVE", sizeof("UNRESTRICTIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNRESTRICTIVE_name, &const_UNRESTRICTIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UNRESTRICTIVE_name); + zend_string_release_ex(const_UNRESTRICTIVE_name, true); zval const_SINGLE_SCRIPT_RESTRICTIVE_value; ZVAL_LONG(&const_SINGLE_SCRIPT_RESTRICTIVE_value, USPOOF_SINGLE_SCRIPT_RESTRICTIVE); - zend_string *const_SINGLE_SCRIPT_RESTRICTIVE_name = zend_string_init_interned("SINGLE_SCRIPT_RESTRICTIVE", sizeof("SINGLE_SCRIPT_RESTRICTIVE") - 1, 1); + zend_string *const_SINGLE_SCRIPT_RESTRICTIVE_name = zend_string_init_interned("SINGLE_SCRIPT_RESTRICTIVE", sizeof("SINGLE_SCRIPT_RESTRICTIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SINGLE_SCRIPT_RESTRICTIVE_name, &const_SINGLE_SCRIPT_RESTRICTIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SINGLE_SCRIPT_RESTRICTIVE_name); + zend_string_release_ex(const_SINGLE_SCRIPT_RESTRICTIVE_name, true); zval const_MIXED_NUMBERS_value; ZVAL_LONG(&const_MIXED_NUMBERS_value, USPOOF_MIXED_NUMBERS); - zend_string *const_MIXED_NUMBERS_name = zend_string_init_interned("MIXED_NUMBERS", sizeof("MIXED_NUMBERS") - 1, 1); + zend_string *const_MIXED_NUMBERS_name = zend_string_init_interned("MIXED_NUMBERS", sizeof("MIXED_NUMBERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIXED_NUMBERS_name, &const_MIXED_NUMBERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIXED_NUMBERS_name); + zend_string_release_ex(const_MIXED_NUMBERS_name, true); #endif #if U_ICU_VERSION_MAJOR_NUM >= 62 zval const_HIDDEN_OVERLAY_value; ZVAL_LONG(&const_HIDDEN_OVERLAY_value, USPOOF_HIDDEN_OVERLAY); - zend_string *const_HIDDEN_OVERLAY_name = zend_string_init_interned("HIDDEN_OVERLAY", sizeof("HIDDEN_OVERLAY") - 1, 1); + zend_string *const_HIDDEN_OVERLAY_name = zend_string_init_interned("HIDDEN_OVERLAY", sizeof("HIDDEN_OVERLAY") - 1, true); zend_declare_typed_class_constant(class_entry, const_HIDDEN_OVERLAY_name, &const_HIDDEN_OVERLAY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HIDDEN_OVERLAY_name); + zend_string_release_ex(const_HIDDEN_OVERLAY_name, true); #endif zval const_IGNORE_SPACE_value; ZVAL_LONG(&const_IGNORE_SPACE_value, USET_IGNORE_SPACE); - zend_string *const_IGNORE_SPACE_name = zend_string_init_interned("IGNORE_SPACE", sizeof("IGNORE_SPACE") - 1, 1); + zend_string *const_IGNORE_SPACE_name = zend_string_init_interned("IGNORE_SPACE", sizeof("IGNORE_SPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IGNORE_SPACE_name, &const_IGNORE_SPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IGNORE_SPACE_name); + zend_string_release_ex(const_IGNORE_SPACE_name, true); zval const_CASE_INSENSITIVE_value; ZVAL_LONG(&const_CASE_INSENSITIVE_value, USET_CASE_INSENSITIVE); - zend_string *const_CASE_INSENSITIVE_name = zend_string_init_interned("CASE_INSENSITIVE", sizeof("CASE_INSENSITIVE") - 1, 1); + zend_string *const_CASE_INSENSITIVE_name = zend_string_init_interned("CASE_INSENSITIVE", sizeof("CASE_INSENSITIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_INSENSITIVE_name, &const_CASE_INSENSITIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_INSENSITIVE_name); + zend_string_release_ex(const_CASE_INSENSITIVE_name, true); zval const_ADD_CASE_MAPPINGS_value; ZVAL_LONG(&const_ADD_CASE_MAPPINGS_value, USET_ADD_CASE_MAPPINGS); - zend_string *const_ADD_CASE_MAPPINGS_name = zend_string_init_interned("ADD_CASE_MAPPINGS", sizeof("ADD_CASE_MAPPINGS") - 1, 1); + zend_string *const_ADD_CASE_MAPPINGS_name = zend_string_init_interned("ADD_CASE_MAPPINGS", sizeof("ADD_CASE_MAPPINGS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ADD_CASE_MAPPINGS_name, &const_ADD_CASE_MAPPINGS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ADD_CASE_MAPPINGS_name); + zend_string_release_ex(const_ADD_CASE_MAPPINGS_name, true); #if U_ICU_VERSION_MAJOR_NUM >= 73 zval const_SIMPLE_CASE_INSENSITIVE_value; ZVAL_LONG(&const_SIMPLE_CASE_INSENSITIVE_value, USET_SIMPLE_CASE_INSENSITIVE); - zend_string *const_SIMPLE_CASE_INSENSITIVE_name = zend_string_init_interned("SIMPLE_CASE_INSENSITIVE", sizeof("SIMPLE_CASE_INSENSITIVE") - 1, 1); + zend_string *const_SIMPLE_CASE_INSENSITIVE_name = zend_string_init_interned("SIMPLE_CASE_INSENSITIVE", sizeof("SIMPLE_CASE_INSENSITIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SIMPLE_CASE_INSENSITIVE_name, &const_SIMPLE_CASE_INSENSITIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SIMPLE_CASE_INSENSITIVE_name); + zend_string_release_ex(const_SIMPLE_CASE_INSENSITIVE_name, true); #endif return class_entry; diff --git a/ext/intl/timezone/timezone_arginfo.h b/ext/intl/timezone/timezone_arginfo.h index e30e9806d9d53..418d2901fe935 100644 --- a/ext/intl/timezone/timezone_arginfo.h +++ b/ext/intl/timezone/timezone_arginfo.h @@ -168,69 +168,69 @@ static zend_class_entry *register_class_IntlTimeZone(void) zval const_DISPLAY_SHORT_value; ZVAL_LONG(&const_DISPLAY_SHORT_value, TimeZone::SHORT); - zend_string *const_DISPLAY_SHORT_name = zend_string_init_interned("DISPLAY_SHORT", sizeof("DISPLAY_SHORT") - 1, 1); + zend_string *const_DISPLAY_SHORT_name = zend_string_init_interned("DISPLAY_SHORT", sizeof("DISPLAY_SHORT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_SHORT_name, &const_DISPLAY_SHORT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_SHORT_name); + zend_string_release_ex(const_DISPLAY_SHORT_name, true); zval const_DISPLAY_LONG_value; ZVAL_LONG(&const_DISPLAY_LONG_value, TimeZone::LONG); - zend_string *const_DISPLAY_LONG_name = zend_string_init_interned("DISPLAY_LONG", sizeof("DISPLAY_LONG") - 1, 1); + zend_string *const_DISPLAY_LONG_name = zend_string_init_interned("DISPLAY_LONG", sizeof("DISPLAY_LONG") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_LONG_name, &const_DISPLAY_LONG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_LONG_name); + zend_string_release_ex(const_DISPLAY_LONG_name, true); zval const_DISPLAY_SHORT_GENERIC_value; ZVAL_LONG(&const_DISPLAY_SHORT_GENERIC_value, TimeZone::SHORT_GENERIC); - zend_string *const_DISPLAY_SHORT_GENERIC_name = zend_string_init_interned("DISPLAY_SHORT_GENERIC", sizeof("DISPLAY_SHORT_GENERIC") - 1, 1); + zend_string *const_DISPLAY_SHORT_GENERIC_name = zend_string_init_interned("DISPLAY_SHORT_GENERIC", sizeof("DISPLAY_SHORT_GENERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_SHORT_GENERIC_name, &const_DISPLAY_SHORT_GENERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_SHORT_GENERIC_name); + zend_string_release_ex(const_DISPLAY_SHORT_GENERIC_name, true); zval const_DISPLAY_LONG_GENERIC_value; ZVAL_LONG(&const_DISPLAY_LONG_GENERIC_value, TimeZone::LONG_GENERIC); - zend_string *const_DISPLAY_LONG_GENERIC_name = zend_string_init_interned("DISPLAY_LONG_GENERIC", sizeof("DISPLAY_LONG_GENERIC") - 1, 1); + zend_string *const_DISPLAY_LONG_GENERIC_name = zend_string_init_interned("DISPLAY_LONG_GENERIC", sizeof("DISPLAY_LONG_GENERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_LONG_GENERIC_name, &const_DISPLAY_LONG_GENERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_LONG_GENERIC_name); + zend_string_release_ex(const_DISPLAY_LONG_GENERIC_name, true); zval const_DISPLAY_SHORT_GMT_value; ZVAL_LONG(&const_DISPLAY_SHORT_GMT_value, TimeZone::SHORT_GMT); - zend_string *const_DISPLAY_SHORT_GMT_name = zend_string_init_interned("DISPLAY_SHORT_GMT", sizeof("DISPLAY_SHORT_GMT") - 1, 1); + zend_string *const_DISPLAY_SHORT_GMT_name = zend_string_init_interned("DISPLAY_SHORT_GMT", sizeof("DISPLAY_SHORT_GMT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_SHORT_GMT_name, &const_DISPLAY_SHORT_GMT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_SHORT_GMT_name); + zend_string_release_ex(const_DISPLAY_SHORT_GMT_name, true); zval const_DISPLAY_LONG_GMT_value; ZVAL_LONG(&const_DISPLAY_LONG_GMT_value, TimeZone::LONG_GMT); - zend_string *const_DISPLAY_LONG_GMT_name = zend_string_init_interned("DISPLAY_LONG_GMT", sizeof("DISPLAY_LONG_GMT") - 1, 1); + zend_string *const_DISPLAY_LONG_GMT_name = zend_string_init_interned("DISPLAY_LONG_GMT", sizeof("DISPLAY_LONG_GMT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_LONG_GMT_name, &const_DISPLAY_LONG_GMT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_LONG_GMT_name); + zend_string_release_ex(const_DISPLAY_LONG_GMT_name, true); zval const_DISPLAY_SHORT_COMMONLY_USED_value; ZVAL_LONG(&const_DISPLAY_SHORT_COMMONLY_USED_value, TimeZone::SHORT_COMMONLY_USED); - zend_string *const_DISPLAY_SHORT_COMMONLY_USED_name = zend_string_init_interned("DISPLAY_SHORT_COMMONLY_USED", sizeof("DISPLAY_SHORT_COMMONLY_USED") - 1, 1); + zend_string *const_DISPLAY_SHORT_COMMONLY_USED_name = zend_string_init_interned("DISPLAY_SHORT_COMMONLY_USED", sizeof("DISPLAY_SHORT_COMMONLY_USED") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_SHORT_COMMONLY_USED_name, &const_DISPLAY_SHORT_COMMONLY_USED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_SHORT_COMMONLY_USED_name); + zend_string_release_ex(const_DISPLAY_SHORT_COMMONLY_USED_name, true); zval const_DISPLAY_GENERIC_LOCATION_value; ZVAL_LONG(&const_DISPLAY_GENERIC_LOCATION_value, TimeZone::GENERIC_LOCATION); - zend_string *const_DISPLAY_GENERIC_LOCATION_name = zend_string_init_interned("DISPLAY_GENERIC_LOCATION", sizeof("DISPLAY_GENERIC_LOCATION") - 1, 1); + zend_string *const_DISPLAY_GENERIC_LOCATION_name = zend_string_init_interned("DISPLAY_GENERIC_LOCATION", sizeof("DISPLAY_GENERIC_LOCATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_DISPLAY_GENERIC_LOCATION_name, &const_DISPLAY_GENERIC_LOCATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DISPLAY_GENERIC_LOCATION_name); + zend_string_release_ex(const_DISPLAY_GENERIC_LOCATION_name, true); zval const_TYPE_ANY_value; ZVAL_LONG(&const_TYPE_ANY_value, UCAL_ZONE_TYPE_ANY); - zend_string *const_TYPE_ANY_name = zend_string_init_interned("TYPE_ANY", sizeof("TYPE_ANY") - 1, 1); + zend_string *const_TYPE_ANY_name = zend_string_init_interned("TYPE_ANY", sizeof("TYPE_ANY") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_ANY_name, &const_TYPE_ANY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_ANY_name); + zend_string_release_ex(const_TYPE_ANY_name, true); zval const_TYPE_CANONICAL_value; ZVAL_LONG(&const_TYPE_CANONICAL_value, UCAL_ZONE_TYPE_CANONICAL); - zend_string *const_TYPE_CANONICAL_name = zend_string_init_interned("TYPE_CANONICAL", sizeof("TYPE_CANONICAL") - 1, 1); + zend_string *const_TYPE_CANONICAL_name = zend_string_init_interned("TYPE_CANONICAL", sizeof("TYPE_CANONICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_CANONICAL_name, &const_TYPE_CANONICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_CANONICAL_name); + zend_string_release_ex(const_TYPE_CANONICAL_name, true); zval const_TYPE_CANONICAL_LOCATION_value; ZVAL_LONG(&const_TYPE_CANONICAL_LOCATION_value, UCAL_ZONE_TYPE_CANONICAL_LOCATION); - zend_string *const_TYPE_CANONICAL_LOCATION_name = zend_string_init_interned("TYPE_CANONICAL_LOCATION", sizeof("TYPE_CANONICAL_LOCATION") - 1, 1); + zend_string *const_TYPE_CANONICAL_LOCATION_name = zend_string_init_interned("TYPE_CANONICAL_LOCATION", sizeof("TYPE_CANONICAL_LOCATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_TYPE_CANONICAL_LOCATION_name, &const_TYPE_CANONICAL_LOCATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TYPE_CANONICAL_LOCATION_name); + zend_string_release_ex(const_TYPE_CANONICAL_LOCATION_name, true); return class_entry; } diff --git a/ext/intl/transliterator/transliterator_arginfo.h b/ext/intl/transliterator/transliterator_arginfo.h index 6f74b55521df3..c5a5bcc6090dd 100644 --- a/ext/intl/transliterator/transliterator_arginfo.h +++ b/ext/intl/transliterator/transliterator_arginfo.h @@ -62,21 +62,21 @@ static zend_class_entry *register_class_Transliterator(void) zval const_FORWARD_value; ZVAL_LONG(&const_FORWARD_value, TRANSLITERATOR_FORWARD); - zend_string *const_FORWARD_name = zend_string_init_interned("FORWARD", sizeof("FORWARD") - 1, 1); + zend_string *const_FORWARD_name = zend_string_init_interned("FORWARD", sizeof("FORWARD") - 1, true); zend_declare_typed_class_constant(class_entry, const_FORWARD_name, &const_FORWARD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FORWARD_name); + zend_string_release_ex(const_FORWARD_name, true); zval const_REVERSE_value; ZVAL_LONG(&const_REVERSE_value, TRANSLITERATOR_REVERSE); - zend_string *const_REVERSE_name = zend_string_init_interned("REVERSE", sizeof("REVERSE") - 1, 1); + zend_string *const_REVERSE_name = zend_string_init_interned("REVERSE", sizeof("REVERSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_REVERSE_name, &const_REVERSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REVERSE_name); + zend_string_release_ex(const_REVERSE_name, true); zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); return class_entry; } diff --git a/ext/intl/uchar/uchar_arginfo.h b/ext/intl/uchar/uchar_arginfo.h index f290fb2b958ec..9f69dc597c219 100644 --- a/ext/intl/uchar/uchar_arginfo.h +++ b/ext/intl/uchar/uchar_arginfo.h @@ -311,4001 +311,4001 @@ static zend_class_entry *register_class_IntlChar(void) zval const_UNICODE_VERSION_value; zend_string *const_UNICODE_VERSION_value_str = zend_string_init(U_UNICODE_VERSION, strlen(U_UNICODE_VERSION), 1); ZVAL_STR(&const_UNICODE_VERSION_value, const_UNICODE_VERSION_value_str); - zend_string *const_UNICODE_VERSION_name = zend_string_init_interned("UNICODE_VERSION", sizeof("UNICODE_VERSION") - 1, 1); + zend_string *const_UNICODE_VERSION_name = zend_string_init_interned("UNICODE_VERSION", sizeof("UNICODE_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNICODE_VERSION_name, &const_UNICODE_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_UNICODE_VERSION_name); + zend_string_release_ex(const_UNICODE_VERSION_name, true); zval const_CODEPOINT_MIN_value; ZVAL_LONG(&const_CODEPOINT_MIN_value, UCHAR_MIN_VALUE); - zend_string *const_CODEPOINT_MIN_name = zend_string_init_interned("CODEPOINT_MIN", sizeof("CODEPOINT_MIN") - 1, 1); + zend_string *const_CODEPOINT_MIN_name = zend_string_init_interned("CODEPOINT_MIN", sizeof("CODEPOINT_MIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_CODEPOINT_MIN_name, &const_CODEPOINT_MIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CODEPOINT_MIN_name); + zend_string_release_ex(const_CODEPOINT_MIN_name, true); zval const_CODEPOINT_MAX_value; ZVAL_LONG(&const_CODEPOINT_MAX_value, UCHAR_MAX_VALUE); - zend_string *const_CODEPOINT_MAX_name = zend_string_init_interned("CODEPOINT_MAX", sizeof("CODEPOINT_MAX") - 1, 1); + zend_string *const_CODEPOINT_MAX_name = zend_string_init_interned("CODEPOINT_MAX", sizeof("CODEPOINT_MAX") - 1, true); zend_declare_typed_class_constant(class_entry, const_CODEPOINT_MAX_name, &const_CODEPOINT_MAX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CODEPOINT_MAX_name); + zend_string_release_ex(const_CODEPOINT_MAX_name, true); zval const_NO_NUMERIC_VALUE_value; ZVAL_DOUBLE(&const_NO_NUMERIC_VALUE_value, U_NO_NUMERIC_VALUE); - zend_string *const_NO_NUMERIC_VALUE_name = zend_string_init_interned("NO_NUMERIC_VALUE", sizeof("NO_NUMERIC_VALUE") - 1, 1); + zend_string *const_NO_NUMERIC_VALUE_name = zend_string_init_interned("NO_NUMERIC_VALUE", sizeof("NO_NUMERIC_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NO_NUMERIC_VALUE_name, &const_NO_NUMERIC_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_DOUBLE)); - zend_string_release(const_NO_NUMERIC_VALUE_name); + zend_string_release_ex(const_NO_NUMERIC_VALUE_name, true); zval const_PROPERTY_ALPHABETIC_value; ZVAL_LONG(&const_PROPERTY_ALPHABETIC_value, UCHAR_ALPHABETIC); - zend_string *const_PROPERTY_ALPHABETIC_name = zend_string_init_interned("PROPERTY_ALPHABETIC", sizeof("PROPERTY_ALPHABETIC") - 1, 1); + zend_string *const_PROPERTY_ALPHABETIC_name = zend_string_init_interned("PROPERTY_ALPHABETIC", sizeof("PROPERTY_ALPHABETIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ALPHABETIC_name, &const_PROPERTY_ALPHABETIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ALPHABETIC_name); + zend_string_release_ex(const_PROPERTY_ALPHABETIC_name, true); zval const_PROPERTY_BINARY_START_value; ZVAL_LONG(&const_PROPERTY_BINARY_START_value, UCHAR_BINARY_START); - zend_string *const_PROPERTY_BINARY_START_name = zend_string_init_interned("PROPERTY_BINARY_START", sizeof("PROPERTY_BINARY_START") - 1, 1); + zend_string *const_PROPERTY_BINARY_START_name = zend_string_init_interned("PROPERTY_BINARY_START", sizeof("PROPERTY_BINARY_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BINARY_START_name, &const_PROPERTY_BINARY_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BINARY_START_name); + zend_string_release_ex(const_PROPERTY_BINARY_START_name, true); zval const_PROPERTY_ASCII_HEX_DIGIT_value; ZVAL_LONG(&const_PROPERTY_ASCII_HEX_DIGIT_value, UCHAR_ASCII_HEX_DIGIT); - zend_string *const_PROPERTY_ASCII_HEX_DIGIT_name = zend_string_init_interned("PROPERTY_ASCII_HEX_DIGIT", sizeof("PROPERTY_ASCII_HEX_DIGIT") - 1, 1); + zend_string *const_PROPERTY_ASCII_HEX_DIGIT_name = zend_string_init_interned("PROPERTY_ASCII_HEX_DIGIT", sizeof("PROPERTY_ASCII_HEX_DIGIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ASCII_HEX_DIGIT_name, &const_PROPERTY_ASCII_HEX_DIGIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ASCII_HEX_DIGIT_name); + zend_string_release_ex(const_PROPERTY_ASCII_HEX_DIGIT_name, true); zval const_PROPERTY_BIDI_CONTROL_value; ZVAL_LONG(&const_PROPERTY_BIDI_CONTROL_value, UCHAR_BIDI_CONTROL); - zend_string *const_PROPERTY_BIDI_CONTROL_name = zend_string_init_interned("PROPERTY_BIDI_CONTROL", sizeof("PROPERTY_BIDI_CONTROL") - 1, 1); + zend_string *const_PROPERTY_BIDI_CONTROL_name = zend_string_init_interned("PROPERTY_BIDI_CONTROL", sizeof("PROPERTY_BIDI_CONTROL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_CONTROL_name, &const_PROPERTY_BIDI_CONTROL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_CONTROL_name); + zend_string_release_ex(const_PROPERTY_BIDI_CONTROL_name, true); zval const_PROPERTY_BIDI_MIRRORED_value; ZVAL_LONG(&const_PROPERTY_BIDI_MIRRORED_value, UCHAR_BIDI_MIRRORED); - zend_string *const_PROPERTY_BIDI_MIRRORED_name = zend_string_init_interned("PROPERTY_BIDI_MIRRORED", sizeof("PROPERTY_BIDI_MIRRORED") - 1, 1); + zend_string *const_PROPERTY_BIDI_MIRRORED_name = zend_string_init_interned("PROPERTY_BIDI_MIRRORED", sizeof("PROPERTY_BIDI_MIRRORED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_MIRRORED_name, &const_PROPERTY_BIDI_MIRRORED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_MIRRORED_name); + zend_string_release_ex(const_PROPERTY_BIDI_MIRRORED_name, true); zval const_PROPERTY_DASH_value; ZVAL_LONG(&const_PROPERTY_DASH_value, UCHAR_DASH); - zend_string *const_PROPERTY_DASH_name = zend_string_init_interned("PROPERTY_DASH", sizeof("PROPERTY_DASH") - 1, 1); + zend_string *const_PROPERTY_DASH_name = zend_string_init_interned("PROPERTY_DASH", sizeof("PROPERTY_DASH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DASH_name, &const_PROPERTY_DASH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DASH_name); + zend_string_release_ex(const_PROPERTY_DASH_name, true); zval const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_value; ZVAL_LONG(&const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_value, UCHAR_DEFAULT_IGNORABLE_CODE_POINT); - zend_string *const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_name = zend_string_init_interned("PROPERTY_DEFAULT_IGNORABLE_CODE_POINT", sizeof("PROPERTY_DEFAULT_IGNORABLE_CODE_POINT") - 1, 1); + zend_string *const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_name = zend_string_init_interned("PROPERTY_DEFAULT_IGNORABLE_CODE_POINT", sizeof("PROPERTY_DEFAULT_IGNORABLE_CODE_POINT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_name, &const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_name); + zend_string_release_ex(const_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_name, true); zval const_PROPERTY_DEPRECATED_value; ZVAL_LONG(&const_PROPERTY_DEPRECATED_value, UCHAR_DEPRECATED); - zend_string *const_PROPERTY_DEPRECATED_name = zend_string_init_interned("PROPERTY_DEPRECATED", sizeof("PROPERTY_DEPRECATED") - 1, 1); + zend_string *const_PROPERTY_DEPRECATED_name = zend_string_init_interned("PROPERTY_DEPRECATED", sizeof("PROPERTY_DEPRECATED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DEPRECATED_name, &const_PROPERTY_DEPRECATED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DEPRECATED_name); + zend_string_release_ex(const_PROPERTY_DEPRECATED_name, true); zval const_PROPERTY_DIACRITIC_value; ZVAL_LONG(&const_PROPERTY_DIACRITIC_value, UCHAR_DIACRITIC); - zend_string *const_PROPERTY_DIACRITIC_name = zend_string_init_interned("PROPERTY_DIACRITIC", sizeof("PROPERTY_DIACRITIC") - 1, 1); + zend_string *const_PROPERTY_DIACRITIC_name = zend_string_init_interned("PROPERTY_DIACRITIC", sizeof("PROPERTY_DIACRITIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DIACRITIC_name, &const_PROPERTY_DIACRITIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DIACRITIC_name); + zend_string_release_ex(const_PROPERTY_DIACRITIC_name, true); zval const_PROPERTY_EXTENDER_value; ZVAL_LONG(&const_PROPERTY_EXTENDER_value, UCHAR_EXTENDER); - zend_string *const_PROPERTY_EXTENDER_name = zend_string_init_interned("PROPERTY_EXTENDER", sizeof("PROPERTY_EXTENDER") - 1, 1); + zend_string *const_PROPERTY_EXTENDER_name = zend_string_init_interned("PROPERTY_EXTENDER", sizeof("PROPERTY_EXTENDER") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_EXTENDER_name, &const_PROPERTY_EXTENDER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_EXTENDER_name); + zend_string_release_ex(const_PROPERTY_EXTENDER_name, true); zval const_PROPERTY_FULL_COMPOSITION_EXCLUSION_value; ZVAL_LONG(&const_PROPERTY_FULL_COMPOSITION_EXCLUSION_value, UCHAR_FULL_COMPOSITION_EXCLUSION); - zend_string *const_PROPERTY_FULL_COMPOSITION_EXCLUSION_name = zend_string_init_interned("PROPERTY_FULL_COMPOSITION_EXCLUSION", sizeof("PROPERTY_FULL_COMPOSITION_EXCLUSION") - 1, 1); + zend_string *const_PROPERTY_FULL_COMPOSITION_EXCLUSION_name = zend_string_init_interned("PROPERTY_FULL_COMPOSITION_EXCLUSION", sizeof("PROPERTY_FULL_COMPOSITION_EXCLUSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_FULL_COMPOSITION_EXCLUSION_name, &const_PROPERTY_FULL_COMPOSITION_EXCLUSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_FULL_COMPOSITION_EXCLUSION_name); + zend_string_release_ex(const_PROPERTY_FULL_COMPOSITION_EXCLUSION_name, true); zval const_PROPERTY_GRAPHEME_BASE_value; ZVAL_LONG(&const_PROPERTY_GRAPHEME_BASE_value, UCHAR_GRAPHEME_BASE); - zend_string *const_PROPERTY_GRAPHEME_BASE_name = zend_string_init_interned("PROPERTY_GRAPHEME_BASE", sizeof("PROPERTY_GRAPHEME_BASE") - 1, 1); + zend_string *const_PROPERTY_GRAPHEME_BASE_name = zend_string_init_interned("PROPERTY_GRAPHEME_BASE", sizeof("PROPERTY_GRAPHEME_BASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GRAPHEME_BASE_name, &const_PROPERTY_GRAPHEME_BASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GRAPHEME_BASE_name); + zend_string_release_ex(const_PROPERTY_GRAPHEME_BASE_name, true); zval const_PROPERTY_GRAPHEME_EXTEND_value; ZVAL_LONG(&const_PROPERTY_GRAPHEME_EXTEND_value, UCHAR_GRAPHEME_EXTEND); - zend_string *const_PROPERTY_GRAPHEME_EXTEND_name = zend_string_init_interned("PROPERTY_GRAPHEME_EXTEND", sizeof("PROPERTY_GRAPHEME_EXTEND") - 1, 1); + zend_string *const_PROPERTY_GRAPHEME_EXTEND_name = zend_string_init_interned("PROPERTY_GRAPHEME_EXTEND", sizeof("PROPERTY_GRAPHEME_EXTEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GRAPHEME_EXTEND_name, &const_PROPERTY_GRAPHEME_EXTEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GRAPHEME_EXTEND_name); + zend_string_release_ex(const_PROPERTY_GRAPHEME_EXTEND_name, true); zval const_PROPERTY_GRAPHEME_LINK_value; ZVAL_LONG(&const_PROPERTY_GRAPHEME_LINK_value, UCHAR_GRAPHEME_LINK); - zend_string *const_PROPERTY_GRAPHEME_LINK_name = zend_string_init_interned("PROPERTY_GRAPHEME_LINK", sizeof("PROPERTY_GRAPHEME_LINK") - 1, 1); + zend_string *const_PROPERTY_GRAPHEME_LINK_name = zend_string_init_interned("PROPERTY_GRAPHEME_LINK", sizeof("PROPERTY_GRAPHEME_LINK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GRAPHEME_LINK_name, &const_PROPERTY_GRAPHEME_LINK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GRAPHEME_LINK_name); + zend_string_release_ex(const_PROPERTY_GRAPHEME_LINK_name, true); zval const_PROPERTY_HEX_DIGIT_value; ZVAL_LONG(&const_PROPERTY_HEX_DIGIT_value, UCHAR_HEX_DIGIT); - zend_string *const_PROPERTY_HEX_DIGIT_name = zend_string_init_interned("PROPERTY_HEX_DIGIT", sizeof("PROPERTY_HEX_DIGIT") - 1, 1); + zend_string *const_PROPERTY_HEX_DIGIT_name = zend_string_init_interned("PROPERTY_HEX_DIGIT", sizeof("PROPERTY_HEX_DIGIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_HEX_DIGIT_name, &const_PROPERTY_HEX_DIGIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_HEX_DIGIT_name); + zend_string_release_ex(const_PROPERTY_HEX_DIGIT_name, true); zval const_PROPERTY_HYPHEN_value; ZVAL_LONG(&const_PROPERTY_HYPHEN_value, UCHAR_HYPHEN); - zend_string *const_PROPERTY_HYPHEN_name = zend_string_init_interned("PROPERTY_HYPHEN", sizeof("PROPERTY_HYPHEN") - 1, 1); + zend_string *const_PROPERTY_HYPHEN_name = zend_string_init_interned("PROPERTY_HYPHEN", sizeof("PROPERTY_HYPHEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_HYPHEN_name, &const_PROPERTY_HYPHEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_HYPHEN_name); + zend_string_release_ex(const_PROPERTY_HYPHEN_name, true); zval const_PROPERTY_ID_CONTINUE_value; ZVAL_LONG(&const_PROPERTY_ID_CONTINUE_value, UCHAR_ID_CONTINUE); - zend_string *const_PROPERTY_ID_CONTINUE_name = zend_string_init_interned("PROPERTY_ID_CONTINUE", sizeof("PROPERTY_ID_CONTINUE") - 1, 1); + zend_string *const_PROPERTY_ID_CONTINUE_name = zend_string_init_interned("PROPERTY_ID_CONTINUE", sizeof("PROPERTY_ID_CONTINUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ID_CONTINUE_name, &const_PROPERTY_ID_CONTINUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ID_CONTINUE_name); + zend_string_release_ex(const_PROPERTY_ID_CONTINUE_name, true); zval const_PROPERTY_ID_START_value; ZVAL_LONG(&const_PROPERTY_ID_START_value, UCHAR_ID_START); - zend_string *const_PROPERTY_ID_START_name = zend_string_init_interned("PROPERTY_ID_START", sizeof("PROPERTY_ID_START") - 1, 1); + zend_string *const_PROPERTY_ID_START_name = zend_string_init_interned("PROPERTY_ID_START", sizeof("PROPERTY_ID_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ID_START_name, &const_PROPERTY_ID_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ID_START_name); + zend_string_release_ex(const_PROPERTY_ID_START_name, true); zval const_PROPERTY_IDEOGRAPHIC_value; ZVAL_LONG(&const_PROPERTY_IDEOGRAPHIC_value, UCHAR_IDEOGRAPHIC); - zend_string *const_PROPERTY_IDEOGRAPHIC_name = zend_string_init_interned("PROPERTY_IDEOGRAPHIC", sizeof("PROPERTY_IDEOGRAPHIC") - 1, 1); + zend_string *const_PROPERTY_IDEOGRAPHIC_name = zend_string_init_interned("PROPERTY_IDEOGRAPHIC", sizeof("PROPERTY_IDEOGRAPHIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_IDEOGRAPHIC_name, &const_PROPERTY_IDEOGRAPHIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_IDEOGRAPHIC_name); + zend_string_release_ex(const_PROPERTY_IDEOGRAPHIC_name, true); zval const_PROPERTY_IDS_BINARY_OPERATOR_value; ZVAL_LONG(&const_PROPERTY_IDS_BINARY_OPERATOR_value, UCHAR_IDS_BINARY_OPERATOR); - zend_string *const_PROPERTY_IDS_BINARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_BINARY_OPERATOR", sizeof("PROPERTY_IDS_BINARY_OPERATOR") - 1, 1); + zend_string *const_PROPERTY_IDS_BINARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_BINARY_OPERATOR", sizeof("PROPERTY_IDS_BINARY_OPERATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_IDS_BINARY_OPERATOR_name, &const_PROPERTY_IDS_BINARY_OPERATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_IDS_BINARY_OPERATOR_name); + zend_string_release_ex(const_PROPERTY_IDS_BINARY_OPERATOR_name, true); zval const_PROPERTY_IDS_TRINARY_OPERATOR_value; ZVAL_LONG(&const_PROPERTY_IDS_TRINARY_OPERATOR_value, UCHAR_IDS_TRINARY_OPERATOR); - zend_string *const_PROPERTY_IDS_TRINARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_TRINARY_OPERATOR", sizeof("PROPERTY_IDS_TRINARY_OPERATOR") - 1, 1); + zend_string *const_PROPERTY_IDS_TRINARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_TRINARY_OPERATOR", sizeof("PROPERTY_IDS_TRINARY_OPERATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_IDS_TRINARY_OPERATOR_name, &const_PROPERTY_IDS_TRINARY_OPERATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_IDS_TRINARY_OPERATOR_name); + zend_string_release_ex(const_PROPERTY_IDS_TRINARY_OPERATOR_name, true); #if U_ICU_VERSION_MAJOR_NUM >= 74 zval const_PROPERTY_IDS_UNARY_OPERATOR_value; ZVAL_LONG(&const_PROPERTY_IDS_UNARY_OPERATOR_value, UCHAR_IDS_UNARY_OPERATOR); - zend_string *const_PROPERTY_IDS_UNARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_UNARY_OPERATOR", sizeof("PROPERTY_IDS_UNARY_OPERATOR") - 1, 1); + zend_string *const_PROPERTY_IDS_UNARY_OPERATOR_name = zend_string_init_interned("PROPERTY_IDS_UNARY_OPERATOR", sizeof("PROPERTY_IDS_UNARY_OPERATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_IDS_UNARY_OPERATOR_name, &const_PROPERTY_IDS_UNARY_OPERATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_IDS_UNARY_OPERATOR_name); + zend_string_release_ex(const_PROPERTY_IDS_UNARY_OPERATOR_name, true); zval const_PROPERTY_ID_COMPAT_MATH_START_value; ZVAL_LONG(&const_PROPERTY_ID_COMPAT_MATH_START_value, UCHAR_ID_COMPAT_MATH_START); - zend_string *const_PROPERTY_ID_COMPAT_MATH_START_name = zend_string_init_interned("PROPERTY_ID_COMPAT_MATH_START", sizeof("PROPERTY_ID_COMPAT_MATH_START") - 1, 1); + zend_string *const_PROPERTY_ID_COMPAT_MATH_START_name = zend_string_init_interned("PROPERTY_ID_COMPAT_MATH_START", sizeof("PROPERTY_ID_COMPAT_MATH_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ID_COMPAT_MATH_START_name, &const_PROPERTY_ID_COMPAT_MATH_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ID_COMPAT_MATH_START_name); + zend_string_release_ex(const_PROPERTY_ID_COMPAT_MATH_START_name, true); zval const_PROPERTY_ID_COMPAT_MATH_CONTINUE_value; ZVAL_LONG(&const_PROPERTY_ID_COMPAT_MATH_CONTINUE_value, UCHAR_ID_COMPAT_MATH_CONTINUE); - zend_string *const_PROPERTY_ID_COMPAT_MATH_CONTINUE_name = zend_string_init_interned("PROPERTY_ID_COMPAT_MATH_CONTINUE", sizeof("PROPERTY_ID_COMPAT_MATH_CONTINUE") - 1, 1); + zend_string *const_PROPERTY_ID_COMPAT_MATH_CONTINUE_name = zend_string_init_interned("PROPERTY_ID_COMPAT_MATH_CONTINUE", sizeof("PROPERTY_ID_COMPAT_MATH_CONTINUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ID_COMPAT_MATH_CONTINUE_name, &const_PROPERTY_ID_COMPAT_MATH_CONTINUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ID_COMPAT_MATH_CONTINUE_name); + zend_string_release_ex(const_PROPERTY_ID_COMPAT_MATH_CONTINUE_name, true); #endif zval const_PROPERTY_JOIN_CONTROL_value; ZVAL_LONG(&const_PROPERTY_JOIN_CONTROL_value, UCHAR_JOIN_CONTROL); - zend_string *const_PROPERTY_JOIN_CONTROL_name = zend_string_init_interned("PROPERTY_JOIN_CONTROL", sizeof("PROPERTY_JOIN_CONTROL") - 1, 1); + zend_string *const_PROPERTY_JOIN_CONTROL_name = zend_string_init_interned("PROPERTY_JOIN_CONTROL", sizeof("PROPERTY_JOIN_CONTROL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_JOIN_CONTROL_name, &const_PROPERTY_JOIN_CONTROL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_JOIN_CONTROL_name); + zend_string_release_ex(const_PROPERTY_JOIN_CONTROL_name, true); zval const_PROPERTY_LOGICAL_ORDER_EXCEPTION_value; ZVAL_LONG(&const_PROPERTY_LOGICAL_ORDER_EXCEPTION_value, UCHAR_LOGICAL_ORDER_EXCEPTION); - zend_string *const_PROPERTY_LOGICAL_ORDER_EXCEPTION_name = zend_string_init_interned("PROPERTY_LOGICAL_ORDER_EXCEPTION", sizeof("PROPERTY_LOGICAL_ORDER_EXCEPTION") - 1, 1); + zend_string *const_PROPERTY_LOGICAL_ORDER_EXCEPTION_name = zend_string_init_interned("PROPERTY_LOGICAL_ORDER_EXCEPTION", sizeof("PROPERTY_LOGICAL_ORDER_EXCEPTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_LOGICAL_ORDER_EXCEPTION_name, &const_PROPERTY_LOGICAL_ORDER_EXCEPTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_LOGICAL_ORDER_EXCEPTION_name); + zend_string_release_ex(const_PROPERTY_LOGICAL_ORDER_EXCEPTION_name, true); zval const_PROPERTY_LOWERCASE_value; ZVAL_LONG(&const_PROPERTY_LOWERCASE_value, UCHAR_LOWERCASE); - zend_string *const_PROPERTY_LOWERCASE_name = zend_string_init_interned("PROPERTY_LOWERCASE", sizeof("PROPERTY_LOWERCASE") - 1, 1); + zend_string *const_PROPERTY_LOWERCASE_name = zend_string_init_interned("PROPERTY_LOWERCASE", sizeof("PROPERTY_LOWERCASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_LOWERCASE_name, &const_PROPERTY_LOWERCASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_LOWERCASE_name); + zend_string_release_ex(const_PROPERTY_LOWERCASE_name, true); zval const_PROPERTY_MATH_value; ZVAL_LONG(&const_PROPERTY_MATH_value, UCHAR_MATH); - zend_string *const_PROPERTY_MATH_name = zend_string_init_interned("PROPERTY_MATH", sizeof("PROPERTY_MATH") - 1, 1); + zend_string *const_PROPERTY_MATH_name = zend_string_init_interned("PROPERTY_MATH", sizeof("PROPERTY_MATH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_MATH_name, &const_PROPERTY_MATH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_MATH_name); + zend_string_release_ex(const_PROPERTY_MATH_name, true); zval const_PROPERTY_NONCHARACTER_CODE_POINT_value; ZVAL_LONG(&const_PROPERTY_NONCHARACTER_CODE_POINT_value, UCHAR_NONCHARACTER_CODE_POINT); - zend_string *const_PROPERTY_NONCHARACTER_CODE_POINT_name = zend_string_init_interned("PROPERTY_NONCHARACTER_CODE_POINT", sizeof("PROPERTY_NONCHARACTER_CODE_POINT") - 1, 1); + zend_string *const_PROPERTY_NONCHARACTER_CODE_POINT_name = zend_string_init_interned("PROPERTY_NONCHARACTER_CODE_POINT", sizeof("PROPERTY_NONCHARACTER_CODE_POINT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NONCHARACTER_CODE_POINT_name, &const_PROPERTY_NONCHARACTER_CODE_POINT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NONCHARACTER_CODE_POINT_name); + zend_string_release_ex(const_PROPERTY_NONCHARACTER_CODE_POINT_name, true); zval const_PROPERTY_QUOTATION_MARK_value; ZVAL_LONG(&const_PROPERTY_QUOTATION_MARK_value, UCHAR_QUOTATION_MARK); - zend_string *const_PROPERTY_QUOTATION_MARK_name = zend_string_init_interned("PROPERTY_QUOTATION_MARK", sizeof("PROPERTY_QUOTATION_MARK") - 1, 1); + zend_string *const_PROPERTY_QUOTATION_MARK_name = zend_string_init_interned("PROPERTY_QUOTATION_MARK", sizeof("PROPERTY_QUOTATION_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_QUOTATION_MARK_name, &const_PROPERTY_QUOTATION_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_QUOTATION_MARK_name); + zend_string_release_ex(const_PROPERTY_QUOTATION_MARK_name, true); zval const_PROPERTY_RADICAL_value; ZVAL_LONG(&const_PROPERTY_RADICAL_value, UCHAR_RADICAL); - zend_string *const_PROPERTY_RADICAL_name = zend_string_init_interned("PROPERTY_RADICAL", sizeof("PROPERTY_RADICAL") - 1, 1); + zend_string *const_PROPERTY_RADICAL_name = zend_string_init_interned("PROPERTY_RADICAL", sizeof("PROPERTY_RADICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_RADICAL_name, &const_PROPERTY_RADICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_RADICAL_name); + zend_string_release_ex(const_PROPERTY_RADICAL_name, true); zval const_PROPERTY_SOFT_DOTTED_value; ZVAL_LONG(&const_PROPERTY_SOFT_DOTTED_value, UCHAR_SOFT_DOTTED); - zend_string *const_PROPERTY_SOFT_DOTTED_name = zend_string_init_interned("PROPERTY_SOFT_DOTTED", sizeof("PROPERTY_SOFT_DOTTED") - 1, 1); + zend_string *const_PROPERTY_SOFT_DOTTED_name = zend_string_init_interned("PROPERTY_SOFT_DOTTED", sizeof("PROPERTY_SOFT_DOTTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SOFT_DOTTED_name, &const_PROPERTY_SOFT_DOTTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SOFT_DOTTED_name); + zend_string_release_ex(const_PROPERTY_SOFT_DOTTED_name, true); zval const_PROPERTY_TERMINAL_PUNCTUATION_value; ZVAL_LONG(&const_PROPERTY_TERMINAL_PUNCTUATION_value, UCHAR_TERMINAL_PUNCTUATION); - zend_string *const_PROPERTY_TERMINAL_PUNCTUATION_name = zend_string_init_interned("PROPERTY_TERMINAL_PUNCTUATION", sizeof("PROPERTY_TERMINAL_PUNCTUATION") - 1, 1); + zend_string *const_PROPERTY_TERMINAL_PUNCTUATION_name = zend_string_init_interned("PROPERTY_TERMINAL_PUNCTUATION", sizeof("PROPERTY_TERMINAL_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_TERMINAL_PUNCTUATION_name, &const_PROPERTY_TERMINAL_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_TERMINAL_PUNCTUATION_name); + zend_string_release_ex(const_PROPERTY_TERMINAL_PUNCTUATION_name, true); zval const_PROPERTY_UNIFIED_IDEOGRAPH_value; ZVAL_LONG(&const_PROPERTY_UNIFIED_IDEOGRAPH_value, UCHAR_UNIFIED_IDEOGRAPH); - zend_string *const_PROPERTY_UNIFIED_IDEOGRAPH_name = zend_string_init_interned("PROPERTY_UNIFIED_IDEOGRAPH", sizeof("PROPERTY_UNIFIED_IDEOGRAPH") - 1, 1); + zend_string *const_PROPERTY_UNIFIED_IDEOGRAPH_name = zend_string_init_interned("PROPERTY_UNIFIED_IDEOGRAPH", sizeof("PROPERTY_UNIFIED_IDEOGRAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_UNIFIED_IDEOGRAPH_name, &const_PROPERTY_UNIFIED_IDEOGRAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_UNIFIED_IDEOGRAPH_name); + zend_string_release_ex(const_PROPERTY_UNIFIED_IDEOGRAPH_name, true); zval const_PROPERTY_UPPERCASE_value; ZVAL_LONG(&const_PROPERTY_UPPERCASE_value, UCHAR_UPPERCASE); - zend_string *const_PROPERTY_UPPERCASE_name = zend_string_init_interned("PROPERTY_UPPERCASE", sizeof("PROPERTY_UPPERCASE") - 1, 1); + zend_string *const_PROPERTY_UPPERCASE_name = zend_string_init_interned("PROPERTY_UPPERCASE", sizeof("PROPERTY_UPPERCASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_UPPERCASE_name, &const_PROPERTY_UPPERCASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_UPPERCASE_name); + zend_string_release_ex(const_PROPERTY_UPPERCASE_name, true); zval const_PROPERTY_WHITE_SPACE_value; ZVAL_LONG(&const_PROPERTY_WHITE_SPACE_value, UCHAR_WHITE_SPACE); - zend_string *const_PROPERTY_WHITE_SPACE_name = zend_string_init_interned("PROPERTY_WHITE_SPACE", sizeof("PROPERTY_WHITE_SPACE") - 1, 1); + zend_string *const_PROPERTY_WHITE_SPACE_name = zend_string_init_interned("PROPERTY_WHITE_SPACE", sizeof("PROPERTY_WHITE_SPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_WHITE_SPACE_name, &const_PROPERTY_WHITE_SPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_WHITE_SPACE_name); + zend_string_release_ex(const_PROPERTY_WHITE_SPACE_name, true); zval const_PROPERTY_XID_CONTINUE_value; ZVAL_LONG(&const_PROPERTY_XID_CONTINUE_value, UCHAR_XID_CONTINUE); - zend_string *const_PROPERTY_XID_CONTINUE_name = zend_string_init_interned("PROPERTY_XID_CONTINUE", sizeof("PROPERTY_XID_CONTINUE") - 1, 1); + zend_string *const_PROPERTY_XID_CONTINUE_name = zend_string_init_interned("PROPERTY_XID_CONTINUE", sizeof("PROPERTY_XID_CONTINUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_XID_CONTINUE_name, &const_PROPERTY_XID_CONTINUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_XID_CONTINUE_name); + zend_string_release_ex(const_PROPERTY_XID_CONTINUE_name, true); zval const_PROPERTY_XID_START_value; ZVAL_LONG(&const_PROPERTY_XID_START_value, UCHAR_XID_START); - zend_string *const_PROPERTY_XID_START_name = zend_string_init_interned("PROPERTY_XID_START", sizeof("PROPERTY_XID_START") - 1, 1); + zend_string *const_PROPERTY_XID_START_name = zend_string_init_interned("PROPERTY_XID_START", sizeof("PROPERTY_XID_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_XID_START_name, &const_PROPERTY_XID_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_XID_START_name); + zend_string_release_ex(const_PROPERTY_XID_START_name, true); zval const_PROPERTY_CASE_SENSITIVE_value; ZVAL_LONG(&const_PROPERTY_CASE_SENSITIVE_value, UCHAR_CASE_SENSITIVE); - zend_string *const_PROPERTY_CASE_SENSITIVE_name = zend_string_init_interned("PROPERTY_CASE_SENSITIVE", sizeof("PROPERTY_CASE_SENSITIVE") - 1, 1); + zend_string *const_PROPERTY_CASE_SENSITIVE_name = zend_string_init_interned("PROPERTY_CASE_SENSITIVE", sizeof("PROPERTY_CASE_SENSITIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CASE_SENSITIVE_name, &const_PROPERTY_CASE_SENSITIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CASE_SENSITIVE_name); + zend_string_release_ex(const_PROPERTY_CASE_SENSITIVE_name, true); zval const_PROPERTY_S_TERM_value; ZVAL_LONG(&const_PROPERTY_S_TERM_value, UCHAR_S_TERM); - zend_string *const_PROPERTY_S_TERM_name = zend_string_init_interned("PROPERTY_S_TERM", sizeof("PROPERTY_S_TERM") - 1, 1); + zend_string *const_PROPERTY_S_TERM_name = zend_string_init_interned("PROPERTY_S_TERM", sizeof("PROPERTY_S_TERM") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_S_TERM_name, &const_PROPERTY_S_TERM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_S_TERM_name); + zend_string_release_ex(const_PROPERTY_S_TERM_name, true); zval const_PROPERTY_VARIATION_SELECTOR_value; ZVAL_LONG(&const_PROPERTY_VARIATION_SELECTOR_value, UCHAR_VARIATION_SELECTOR); - zend_string *const_PROPERTY_VARIATION_SELECTOR_name = zend_string_init_interned("PROPERTY_VARIATION_SELECTOR", sizeof("PROPERTY_VARIATION_SELECTOR") - 1, 1); + zend_string *const_PROPERTY_VARIATION_SELECTOR_name = zend_string_init_interned("PROPERTY_VARIATION_SELECTOR", sizeof("PROPERTY_VARIATION_SELECTOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_VARIATION_SELECTOR_name, &const_PROPERTY_VARIATION_SELECTOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_VARIATION_SELECTOR_name); + zend_string_release_ex(const_PROPERTY_VARIATION_SELECTOR_name, true); zval const_PROPERTY_NFD_INERT_value; ZVAL_LONG(&const_PROPERTY_NFD_INERT_value, UCHAR_NFD_INERT); - zend_string *const_PROPERTY_NFD_INERT_name = zend_string_init_interned("PROPERTY_NFD_INERT", sizeof("PROPERTY_NFD_INERT") - 1, 1); + zend_string *const_PROPERTY_NFD_INERT_name = zend_string_init_interned("PROPERTY_NFD_INERT", sizeof("PROPERTY_NFD_INERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFD_INERT_name, &const_PROPERTY_NFD_INERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFD_INERT_name); + zend_string_release_ex(const_PROPERTY_NFD_INERT_name, true); zval const_PROPERTY_NFKD_INERT_value; ZVAL_LONG(&const_PROPERTY_NFKD_INERT_value, UCHAR_NFKD_INERT); - zend_string *const_PROPERTY_NFKD_INERT_name = zend_string_init_interned("PROPERTY_NFKD_INERT", sizeof("PROPERTY_NFKD_INERT") - 1, 1); + zend_string *const_PROPERTY_NFKD_INERT_name = zend_string_init_interned("PROPERTY_NFKD_INERT", sizeof("PROPERTY_NFKD_INERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFKD_INERT_name, &const_PROPERTY_NFKD_INERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFKD_INERT_name); + zend_string_release_ex(const_PROPERTY_NFKD_INERT_name, true); zval const_PROPERTY_NFC_INERT_value; ZVAL_LONG(&const_PROPERTY_NFC_INERT_value, UCHAR_NFC_INERT); - zend_string *const_PROPERTY_NFC_INERT_name = zend_string_init_interned("PROPERTY_NFC_INERT", sizeof("PROPERTY_NFC_INERT") - 1, 1); + zend_string *const_PROPERTY_NFC_INERT_name = zend_string_init_interned("PROPERTY_NFC_INERT", sizeof("PROPERTY_NFC_INERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFC_INERT_name, &const_PROPERTY_NFC_INERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFC_INERT_name); + zend_string_release_ex(const_PROPERTY_NFC_INERT_name, true); zval const_PROPERTY_NFKC_INERT_value; ZVAL_LONG(&const_PROPERTY_NFKC_INERT_value, UCHAR_NFKC_INERT); - zend_string *const_PROPERTY_NFKC_INERT_name = zend_string_init_interned("PROPERTY_NFKC_INERT", sizeof("PROPERTY_NFKC_INERT") - 1, 1); + zend_string *const_PROPERTY_NFKC_INERT_name = zend_string_init_interned("PROPERTY_NFKC_INERT", sizeof("PROPERTY_NFKC_INERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFKC_INERT_name, &const_PROPERTY_NFKC_INERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFKC_INERT_name); + zend_string_release_ex(const_PROPERTY_NFKC_INERT_name, true); zval const_PROPERTY_SEGMENT_STARTER_value; ZVAL_LONG(&const_PROPERTY_SEGMENT_STARTER_value, UCHAR_SEGMENT_STARTER); - zend_string *const_PROPERTY_SEGMENT_STARTER_name = zend_string_init_interned("PROPERTY_SEGMENT_STARTER", sizeof("PROPERTY_SEGMENT_STARTER") - 1, 1); + zend_string *const_PROPERTY_SEGMENT_STARTER_name = zend_string_init_interned("PROPERTY_SEGMENT_STARTER", sizeof("PROPERTY_SEGMENT_STARTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SEGMENT_STARTER_name, &const_PROPERTY_SEGMENT_STARTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SEGMENT_STARTER_name); + zend_string_release_ex(const_PROPERTY_SEGMENT_STARTER_name, true); zval const_PROPERTY_PATTERN_SYNTAX_value; ZVAL_LONG(&const_PROPERTY_PATTERN_SYNTAX_value, UCHAR_PATTERN_SYNTAX); - zend_string *const_PROPERTY_PATTERN_SYNTAX_name = zend_string_init_interned("PROPERTY_PATTERN_SYNTAX", sizeof("PROPERTY_PATTERN_SYNTAX") - 1, 1); + zend_string *const_PROPERTY_PATTERN_SYNTAX_name = zend_string_init_interned("PROPERTY_PATTERN_SYNTAX", sizeof("PROPERTY_PATTERN_SYNTAX") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_PATTERN_SYNTAX_name, &const_PROPERTY_PATTERN_SYNTAX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_PATTERN_SYNTAX_name); + zend_string_release_ex(const_PROPERTY_PATTERN_SYNTAX_name, true); zval const_PROPERTY_PATTERN_WHITE_SPACE_value; ZVAL_LONG(&const_PROPERTY_PATTERN_WHITE_SPACE_value, UCHAR_PATTERN_WHITE_SPACE); - zend_string *const_PROPERTY_PATTERN_WHITE_SPACE_name = zend_string_init_interned("PROPERTY_PATTERN_WHITE_SPACE", sizeof("PROPERTY_PATTERN_WHITE_SPACE") - 1, 1); + zend_string *const_PROPERTY_PATTERN_WHITE_SPACE_name = zend_string_init_interned("PROPERTY_PATTERN_WHITE_SPACE", sizeof("PROPERTY_PATTERN_WHITE_SPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_PATTERN_WHITE_SPACE_name, &const_PROPERTY_PATTERN_WHITE_SPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_PATTERN_WHITE_SPACE_name); + zend_string_release_ex(const_PROPERTY_PATTERN_WHITE_SPACE_name, true); zval const_PROPERTY_POSIX_ALNUM_value; ZVAL_LONG(&const_PROPERTY_POSIX_ALNUM_value, UCHAR_POSIX_ALNUM); - zend_string *const_PROPERTY_POSIX_ALNUM_name = zend_string_init_interned("PROPERTY_POSIX_ALNUM", sizeof("PROPERTY_POSIX_ALNUM") - 1, 1); + zend_string *const_PROPERTY_POSIX_ALNUM_name = zend_string_init_interned("PROPERTY_POSIX_ALNUM", sizeof("PROPERTY_POSIX_ALNUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_POSIX_ALNUM_name, &const_PROPERTY_POSIX_ALNUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_POSIX_ALNUM_name); + zend_string_release_ex(const_PROPERTY_POSIX_ALNUM_name, true); zval const_PROPERTY_POSIX_BLANK_value; ZVAL_LONG(&const_PROPERTY_POSIX_BLANK_value, UCHAR_POSIX_BLANK); - zend_string *const_PROPERTY_POSIX_BLANK_name = zend_string_init_interned("PROPERTY_POSIX_BLANK", sizeof("PROPERTY_POSIX_BLANK") - 1, 1); + zend_string *const_PROPERTY_POSIX_BLANK_name = zend_string_init_interned("PROPERTY_POSIX_BLANK", sizeof("PROPERTY_POSIX_BLANK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_POSIX_BLANK_name, &const_PROPERTY_POSIX_BLANK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_POSIX_BLANK_name); + zend_string_release_ex(const_PROPERTY_POSIX_BLANK_name, true); zval const_PROPERTY_POSIX_GRAPH_value; ZVAL_LONG(&const_PROPERTY_POSIX_GRAPH_value, UCHAR_POSIX_GRAPH); - zend_string *const_PROPERTY_POSIX_GRAPH_name = zend_string_init_interned("PROPERTY_POSIX_GRAPH", sizeof("PROPERTY_POSIX_GRAPH") - 1, 1); + zend_string *const_PROPERTY_POSIX_GRAPH_name = zend_string_init_interned("PROPERTY_POSIX_GRAPH", sizeof("PROPERTY_POSIX_GRAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_POSIX_GRAPH_name, &const_PROPERTY_POSIX_GRAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_POSIX_GRAPH_name); + zend_string_release_ex(const_PROPERTY_POSIX_GRAPH_name, true); zval const_PROPERTY_POSIX_PRINT_value; ZVAL_LONG(&const_PROPERTY_POSIX_PRINT_value, UCHAR_POSIX_PRINT); - zend_string *const_PROPERTY_POSIX_PRINT_name = zend_string_init_interned("PROPERTY_POSIX_PRINT", sizeof("PROPERTY_POSIX_PRINT") - 1, 1); + zend_string *const_PROPERTY_POSIX_PRINT_name = zend_string_init_interned("PROPERTY_POSIX_PRINT", sizeof("PROPERTY_POSIX_PRINT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_POSIX_PRINT_name, &const_PROPERTY_POSIX_PRINT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_POSIX_PRINT_name); + zend_string_release_ex(const_PROPERTY_POSIX_PRINT_name, true); zval const_PROPERTY_POSIX_XDIGIT_value; ZVAL_LONG(&const_PROPERTY_POSIX_XDIGIT_value, UCHAR_POSIX_XDIGIT); - zend_string *const_PROPERTY_POSIX_XDIGIT_name = zend_string_init_interned("PROPERTY_POSIX_XDIGIT", sizeof("PROPERTY_POSIX_XDIGIT") - 1, 1); + zend_string *const_PROPERTY_POSIX_XDIGIT_name = zend_string_init_interned("PROPERTY_POSIX_XDIGIT", sizeof("PROPERTY_POSIX_XDIGIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_POSIX_XDIGIT_name, &const_PROPERTY_POSIX_XDIGIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_POSIX_XDIGIT_name); + zend_string_release_ex(const_PROPERTY_POSIX_XDIGIT_name, true); zval const_PROPERTY_CASED_value; ZVAL_LONG(&const_PROPERTY_CASED_value, UCHAR_CASED); - zend_string *const_PROPERTY_CASED_name = zend_string_init_interned("PROPERTY_CASED", sizeof("PROPERTY_CASED") - 1, 1); + zend_string *const_PROPERTY_CASED_name = zend_string_init_interned("PROPERTY_CASED", sizeof("PROPERTY_CASED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CASED_name, &const_PROPERTY_CASED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CASED_name); + zend_string_release_ex(const_PROPERTY_CASED_name, true); zval const_PROPERTY_CASE_IGNORABLE_value; ZVAL_LONG(&const_PROPERTY_CASE_IGNORABLE_value, UCHAR_CASE_IGNORABLE); - zend_string *const_PROPERTY_CASE_IGNORABLE_name = zend_string_init_interned("PROPERTY_CASE_IGNORABLE", sizeof("PROPERTY_CASE_IGNORABLE") - 1, 1); + zend_string *const_PROPERTY_CASE_IGNORABLE_name = zend_string_init_interned("PROPERTY_CASE_IGNORABLE", sizeof("PROPERTY_CASE_IGNORABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CASE_IGNORABLE_name, &const_PROPERTY_CASE_IGNORABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CASE_IGNORABLE_name); + zend_string_release_ex(const_PROPERTY_CASE_IGNORABLE_name, true); zval const_PROPERTY_CHANGES_WHEN_LOWERCASED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_LOWERCASED_value, UCHAR_CHANGES_WHEN_LOWERCASED); - zend_string *const_PROPERTY_CHANGES_WHEN_LOWERCASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_LOWERCASED", sizeof("PROPERTY_CHANGES_WHEN_LOWERCASED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_LOWERCASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_LOWERCASED", sizeof("PROPERTY_CHANGES_WHEN_LOWERCASED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_LOWERCASED_name, &const_PROPERTY_CHANGES_WHEN_LOWERCASED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_LOWERCASED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_LOWERCASED_name, true); zval const_PROPERTY_CHANGES_WHEN_UPPERCASED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_UPPERCASED_value, UCHAR_CHANGES_WHEN_UPPERCASED); - zend_string *const_PROPERTY_CHANGES_WHEN_UPPERCASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_UPPERCASED", sizeof("PROPERTY_CHANGES_WHEN_UPPERCASED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_UPPERCASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_UPPERCASED", sizeof("PROPERTY_CHANGES_WHEN_UPPERCASED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_UPPERCASED_name, &const_PROPERTY_CHANGES_WHEN_UPPERCASED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_UPPERCASED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_UPPERCASED_name, true); zval const_PROPERTY_CHANGES_WHEN_TITLECASED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_TITLECASED_value, UCHAR_CHANGES_WHEN_TITLECASED); - zend_string *const_PROPERTY_CHANGES_WHEN_TITLECASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_TITLECASED", sizeof("PROPERTY_CHANGES_WHEN_TITLECASED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_TITLECASED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_TITLECASED", sizeof("PROPERTY_CHANGES_WHEN_TITLECASED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_TITLECASED_name, &const_PROPERTY_CHANGES_WHEN_TITLECASED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_TITLECASED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_TITLECASED_name, true); zval const_PROPERTY_CHANGES_WHEN_CASEFOLDED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_CASEFOLDED_value, UCHAR_CHANGES_WHEN_CASEFOLDED); - zend_string *const_PROPERTY_CHANGES_WHEN_CASEFOLDED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_CASEFOLDED", sizeof("PROPERTY_CHANGES_WHEN_CASEFOLDED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_CASEFOLDED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_CASEFOLDED", sizeof("PROPERTY_CHANGES_WHEN_CASEFOLDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_CASEFOLDED_name, &const_PROPERTY_CHANGES_WHEN_CASEFOLDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_CASEFOLDED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_CASEFOLDED_name, true); zval const_PROPERTY_CHANGES_WHEN_CASEMAPPED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_CASEMAPPED_value, UCHAR_CHANGES_WHEN_CASEMAPPED); - zend_string *const_PROPERTY_CHANGES_WHEN_CASEMAPPED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_CASEMAPPED", sizeof("PROPERTY_CHANGES_WHEN_CASEMAPPED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_CASEMAPPED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_CASEMAPPED", sizeof("PROPERTY_CHANGES_WHEN_CASEMAPPED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_CASEMAPPED_name, &const_PROPERTY_CHANGES_WHEN_CASEMAPPED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_CASEMAPPED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_CASEMAPPED_name, true); zval const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_value; ZVAL_LONG(&const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_value, UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED); - zend_string *const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED", sizeof("PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED") - 1, 1); + zend_string *const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_name = zend_string_init_interned("PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED", sizeof("PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_name, &const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_name); + zend_string_release_ex(const_PROPERTY_CHANGES_WHEN_NFKC_CASEFOLDED_name, true); zval const_PROPERTY_BINARY_LIMIT_value; ZVAL_LONG(&const_PROPERTY_BINARY_LIMIT_value, UCHAR_BINARY_LIMIT); - zend_string *const_PROPERTY_BINARY_LIMIT_name = zend_string_init_interned("PROPERTY_BINARY_LIMIT", sizeof("PROPERTY_BINARY_LIMIT") - 1, 1); + zend_string *const_PROPERTY_BINARY_LIMIT_name = zend_string_init_interned("PROPERTY_BINARY_LIMIT", sizeof("PROPERTY_BINARY_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BINARY_LIMIT_name, &const_PROPERTY_BINARY_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BINARY_LIMIT_name); + zend_string_release_ex(const_PROPERTY_BINARY_LIMIT_name, true); zval const_PROPERTY_BIDI_CLASS_value; ZVAL_LONG(&const_PROPERTY_BIDI_CLASS_value, UCHAR_BIDI_CLASS); - zend_string *const_PROPERTY_BIDI_CLASS_name = zend_string_init_interned("PROPERTY_BIDI_CLASS", sizeof("PROPERTY_BIDI_CLASS") - 1, 1); + zend_string *const_PROPERTY_BIDI_CLASS_name = zend_string_init_interned("PROPERTY_BIDI_CLASS", sizeof("PROPERTY_BIDI_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_CLASS_name, &const_PROPERTY_BIDI_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_CLASS_name); + zend_string_release_ex(const_PROPERTY_BIDI_CLASS_name, true); zval const_PROPERTY_INT_START_value; ZVAL_LONG(&const_PROPERTY_INT_START_value, UCHAR_INT_START); - zend_string *const_PROPERTY_INT_START_name = zend_string_init_interned("PROPERTY_INT_START", sizeof("PROPERTY_INT_START") - 1, 1); + zend_string *const_PROPERTY_INT_START_name = zend_string_init_interned("PROPERTY_INT_START", sizeof("PROPERTY_INT_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_INT_START_name, &const_PROPERTY_INT_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_INT_START_name); + zend_string_release_ex(const_PROPERTY_INT_START_name, true); zval const_PROPERTY_BLOCK_value; ZVAL_LONG(&const_PROPERTY_BLOCK_value, UCHAR_BLOCK); - zend_string *const_PROPERTY_BLOCK_name = zend_string_init_interned("PROPERTY_BLOCK", sizeof("PROPERTY_BLOCK") - 1, 1); + zend_string *const_PROPERTY_BLOCK_name = zend_string_init_interned("PROPERTY_BLOCK", sizeof("PROPERTY_BLOCK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BLOCK_name, &const_PROPERTY_BLOCK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BLOCK_name); + zend_string_release_ex(const_PROPERTY_BLOCK_name, true); zval const_PROPERTY_CANONICAL_COMBINING_CLASS_value; ZVAL_LONG(&const_PROPERTY_CANONICAL_COMBINING_CLASS_value, UCHAR_CANONICAL_COMBINING_CLASS); - zend_string *const_PROPERTY_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_CANONICAL_COMBINING_CLASS") - 1, 1); + zend_string *const_PROPERTY_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_CANONICAL_COMBINING_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CANONICAL_COMBINING_CLASS_name, &const_PROPERTY_CANONICAL_COMBINING_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CANONICAL_COMBINING_CLASS_name); + zend_string_release_ex(const_PROPERTY_CANONICAL_COMBINING_CLASS_name, true); zval const_PROPERTY_DECOMPOSITION_TYPE_value; ZVAL_LONG(&const_PROPERTY_DECOMPOSITION_TYPE_value, UCHAR_DECOMPOSITION_TYPE); - zend_string *const_PROPERTY_DECOMPOSITION_TYPE_name = zend_string_init_interned("PROPERTY_DECOMPOSITION_TYPE", sizeof("PROPERTY_DECOMPOSITION_TYPE") - 1, 1); + zend_string *const_PROPERTY_DECOMPOSITION_TYPE_name = zend_string_init_interned("PROPERTY_DECOMPOSITION_TYPE", sizeof("PROPERTY_DECOMPOSITION_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DECOMPOSITION_TYPE_name, &const_PROPERTY_DECOMPOSITION_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DECOMPOSITION_TYPE_name); + zend_string_release_ex(const_PROPERTY_DECOMPOSITION_TYPE_name, true); zval const_PROPERTY_EAST_ASIAN_WIDTH_value; ZVAL_LONG(&const_PROPERTY_EAST_ASIAN_WIDTH_value, UCHAR_EAST_ASIAN_WIDTH); - zend_string *const_PROPERTY_EAST_ASIAN_WIDTH_name = zend_string_init_interned("PROPERTY_EAST_ASIAN_WIDTH", sizeof("PROPERTY_EAST_ASIAN_WIDTH") - 1, 1); + zend_string *const_PROPERTY_EAST_ASIAN_WIDTH_name = zend_string_init_interned("PROPERTY_EAST_ASIAN_WIDTH", sizeof("PROPERTY_EAST_ASIAN_WIDTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_EAST_ASIAN_WIDTH_name, &const_PROPERTY_EAST_ASIAN_WIDTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_EAST_ASIAN_WIDTH_name); + zend_string_release_ex(const_PROPERTY_EAST_ASIAN_WIDTH_name, true); zval const_PROPERTY_GENERAL_CATEGORY_value; ZVAL_LONG(&const_PROPERTY_GENERAL_CATEGORY_value, UCHAR_GENERAL_CATEGORY); - zend_string *const_PROPERTY_GENERAL_CATEGORY_name = zend_string_init_interned("PROPERTY_GENERAL_CATEGORY", sizeof("PROPERTY_GENERAL_CATEGORY") - 1, 1); + zend_string *const_PROPERTY_GENERAL_CATEGORY_name = zend_string_init_interned("PROPERTY_GENERAL_CATEGORY", sizeof("PROPERTY_GENERAL_CATEGORY") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GENERAL_CATEGORY_name, &const_PROPERTY_GENERAL_CATEGORY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GENERAL_CATEGORY_name); + zend_string_release_ex(const_PROPERTY_GENERAL_CATEGORY_name, true); zval const_PROPERTY_JOINING_GROUP_value; ZVAL_LONG(&const_PROPERTY_JOINING_GROUP_value, UCHAR_JOINING_GROUP); - zend_string *const_PROPERTY_JOINING_GROUP_name = zend_string_init_interned("PROPERTY_JOINING_GROUP", sizeof("PROPERTY_JOINING_GROUP") - 1, 1); + zend_string *const_PROPERTY_JOINING_GROUP_name = zend_string_init_interned("PROPERTY_JOINING_GROUP", sizeof("PROPERTY_JOINING_GROUP") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_JOINING_GROUP_name, &const_PROPERTY_JOINING_GROUP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_JOINING_GROUP_name); + zend_string_release_ex(const_PROPERTY_JOINING_GROUP_name, true); zval const_PROPERTY_JOINING_TYPE_value; ZVAL_LONG(&const_PROPERTY_JOINING_TYPE_value, UCHAR_JOINING_TYPE); - zend_string *const_PROPERTY_JOINING_TYPE_name = zend_string_init_interned("PROPERTY_JOINING_TYPE", sizeof("PROPERTY_JOINING_TYPE") - 1, 1); + zend_string *const_PROPERTY_JOINING_TYPE_name = zend_string_init_interned("PROPERTY_JOINING_TYPE", sizeof("PROPERTY_JOINING_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_JOINING_TYPE_name, &const_PROPERTY_JOINING_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_JOINING_TYPE_name); + zend_string_release_ex(const_PROPERTY_JOINING_TYPE_name, true); zval const_PROPERTY_LINE_BREAK_value; ZVAL_LONG(&const_PROPERTY_LINE_BREAK_value, UCHAR_LINE_BREAK); - zend_string *const_PROPERTY_LINE_BREAK_name = zend_string_init_interned("PROPERTY_LINE_BREAK", sizeof("PROPERTY_LINE_BREAK") - 1, 1); + zend_string *const_PROPERTY_LINE_BREAK_name = zend_string_init_interned("PROPERTY_LINE_BREAK", sizeof("PROPERTY_LINE_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_LINE_BREAK_name, &const_PROPERTY_LINE_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_LINE_BREAK_name); + zend_string_release_ex(const_PROPERTY_LINE_BREAK_name, true); zval const_PROPERTY_NUMERIC_TYPE_value; ZVAL_LONG(&const_PROPERTY_NUMERIC_TYPE_value, UCHAR_NUMERIC_TYPE); - zend_string *const_PROPERTY_NUMERIC_TYPE_name = zend_string_init_interned("PROPERTY_NUMERIC_TYPE", sizeof("PROPERTY_NUMERIC_TYPE") - 1, 1); + zend_string *const_PROPERTY_NUMERIC_TYPE_name = zend_string_init_interned("PROPERTY_NUMERIC_TYPE", sizeof("PROPERTY_NUMERIC_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NUMERIC_TYPE_name, &const_PROPERTY_NUMERIC_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NUMERIC_TYPE_name); + zend_string_release_ex(const_PROPERTY_NUMERIC_TYPE_name, true); zval const_PROPERTY_SCRIPT_value; ZVAL_LONG(&const_PROPERTY_SCRIPT_value, UCHAR_SCRIPT); - zend_string *const_PROPERTY_SCRIPT_name = zend_string_init_interned("PROPERTY_SCRIPT", sizeof("PROPERTY_SCRIPT") - 1, 1); + zend_string *const_PROPERTY_SCRIPT_name = zend_string_init_interned("PROPERTY_SCRIPT", sizeof("PROPERTY_SCRIPT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SCRIPT_name, &const_PROPERTY_SCRIPT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SCRIPT_name); + zend_string_release_ex(const_PROPERTY_SCRIPT_name, true); zval const_PROPERTY_HANGUL_SYLLABLE_TYPE_value; ZVAL_LONG(&const_PROPERTY_HANGUL_SYLLABLE_TYPE_value, UCHAR_HANGUL_SYLLABLE_TYPE); - zend_string *const_PROPERTY_HANGUL_SYLLABLE_TYPE_name = zend_string_init_interned("PROPERTY_HANGUL_SYLLABLE_TYPE", sizeof("PROPERTY_HANGUL_SYLLABLE_TYPE") - 1, 1); + zend_string *const_PROPERTY_HANGUL_SYLLABLE_TYPE_name = zend_string_init_interned("PROPERTY_HANGUL_SYLLABLE_TYPE", sizeof("PROPERTY_HANGUL_SYLLABLE_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_HANGUL_SYLLABLE_TYPE_name, &const_PROPERTY_HANGUL_SYLLABLE_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_HANGUL_SYLLABLE_TYPE_name); + zend_string_release_ex(const_PROPERTY_HANGUL_SYLLABLE_TYPE_name, true); zval const_PROPERTY_NFD_QUICK_CHECK_value; ZVAL_LONG(&const_PROPERTY_NFD_QUICK_CHECK_value, UCHAR_NFD_QUICK_CHECK); - zend_string *const_PROPERTY_NFD_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFD_QUICK_CHECK", sizeof("PROPERTY_NFD_QUICK_CHECK") - 1, 1); + zend_string *const_PROPERTY_NFD_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFD_QUICK_CHECK", sizeof("PROPERTY_NFD_QUICK_CHECK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFD_QUICK_CHECK_name, &const_PROPERTY_NFD_QUICK_CHECK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFD_QUICK_CHECK_name); + zend_string_release_ex(const_PROPERTY_NFD_QUICK_CHECK_name, true); zval const_PROPERTY_NFKD_QUICK_CHECK_value; ZVAL_LONG(&const_PROPERTY_NFKD_QUICK_CHECK_value, UCHAR_NFKD_QUICK_CHECK); - zend_string *const_PROPERTY_NFKD_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFKD_QUICK_CHECK", sizeof("PROPERTY_NFKD_QUICK_CHECK") - 1, 1); + zend_string *const_PROPERTY_NFKD_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFKD_QUICK_CHECK", sizeof("PROPERTY_NFKD_QUICK_CHECK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFKD_QUICK_CHECK_name, &const_PROPERTY_NFKD_QUICK_CHECK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFKD_QUICK_CHECK_name); + zend_string_release_ex(const_PROPERTY_NFKD_QUICK_CHECK_name, true); zval const_PROPERTY_NFC_QUICK_CHECK_value; ZVAL_LONG(&const_PROPERTY_NFC_QUICK_CHECK_value, UCHAR_NFC_QUICK_CHECK); - zend_string *const_PROPERTY_NFC_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFC_QUICK_CHECK", sizeof("PROPERTY_NFC_QUICK_CHECK") - 1, 1); + zend_string *const_PROPERTY_NFC_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFC_QUICK_CHECK", sizeof("PROPERTY_NFC_QUICK_CHECK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFC_QUICK_CHECK_name, &const_PROPERTY_NFC_QUICK_CHECK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFC_QUICK_CHECK_name); + zend_string_release_ex(const_PROPERTY_NFC_QUICK_CHECK_name, true); zval const_PROPERTY_NFKC_QUICK_CHECK_value; ZVAL_LONG(&const_PROPERTY_NFKC_QUICK_CHECK_value, UCHAR_NFKC_QUICK_CHECK); - zend_string *const_PROPERTY_NFKC_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFKC_QUICK_CHECK", sizeof("PROPERTY_NFKC_QUICK_CHECK") - 1, 1); + zend_string *const_PROPERTY_NFKC_QUICK_CHECK_name = zend_string_init_interned("PROPERTY_NFKC_QUICK_CHECK", sizeof("PROPERTY_NFKC_QUICK_CHECK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NFKC_QUICK_CHECK_name, &const_PROPERTY_NFKC_QUICK_CHECK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NFKC_QUICK_CHECK_name); + zend_string_release_ex(const_PROPERTY_NFKC_QUICK_CHECK_name, true); zval const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_value; ZVAL_LONG(&const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_value, UCHAR_LEAD_CANONICAL_COMBINING_CLASS); - zend_string *const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_LEAD_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_LEAD_CANONICAL_COMBINING_CLASS") - 1, 1); + zend_string *const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_LEAD_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_LEAD_CANONICAL_COMBINING_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_name, &const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_name); + zend_string_release_ex(const_PROPERTY_LEAD_CANONICAL_COMBINING_CLASS_name, true); zval const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_value; ZVAL_LONG(&const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_value, UCHAR_TRAIL_CANONICAL_COMBINING_CLASS); - zend_string *const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS") - 1, 1); + zend_string *const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_name = zend_string_init_interned("PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS", sizeof("PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_name, &const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_name); + zend_string_release_ex(const_PROPERTY_TRAIL_CANONICAL_COMBINING_CLASS_name, true); zval const_PROPERTY_GRAPHEME_CLUSTER_BREAK_value; ZVAL_LONG(&const_PROPERTY_GRAPHEME_CLUSTER_BREAK_value, UCHAR_GRAPHEME_CLUSTER_BREAK); - zend_string *const_PROPERTY_GRAPHEME_CLUSTER_BREAK_name = zend_string_init_interned("PROPERTY_GRAPHEME_CLUSTER_BREAK", sizeof("PROPERTY_GRAPHEME_CLUSTER_BREAK") - 1, 1); + zend_string *const_PROPERTY_GRAPHEME_CLUSTER_BREAK_name = zend_string_init_interned("PROPERTY_GRAPHEME_CLUSTER_BREAK", sizeof("PROPERTY_GRAPHEME_CLUSTER_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GRAPHEME_CLUSTER_BREAK_name, &const_PROPERTY_GRAPHEME_CLUSTER_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GRAPHEME_CLUSTER_BREAK_name); + zend_string_release_ex(const_PROPERTY_GRAPHEME_CLUSTER_BREAK_name, true); zval const_PROPERTY_SENTENCE_BREAK_value; ZVAL_LONG(&const_PROPERTY_SENTENCE_BREAK_value, UCHAR_SENTENCE_BREAK); - zend_string *const_PROPERTY_SENTENCE_BREAK_name = zend_string_init_interned("PROPERTY_SENTENCE_BREAK", sizeof("PROPERTY_SENTENCE_BREAK") - 1, 1); + zend_string *const_PROPERTY_SENTENCE_BREAK_name = zend_string_init_interned("PROPERTY_SENTENCE_BREAK", sizeof("PROPERTY_SENTENCE_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SENTENCE_BREAK_name, &const_PROPERTY_SENTENCE_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SENTENCE_BREAK_name); + zend_string_release_ex(const_PROPERTY_SENTENCE_BREAK_name, true); zval const_PROPERTY_WORD_BREAK_value; ZVAL_LONG(&const_PROPERTY_WORD_BREAK_value, UCHAR_WORD_BREAK); - zend_string *const_PROPERTY_WORD_BREAK_name = zend_string_init_interned("PROPERTY_WORD_BREAK", sizeof("PROPERTY_WORD_BREAK") - 1, 1); + zend_string *const_PROPERTY_WORD_BREAK_name = zend_string_init_interned("PROPERTY_WORD_BREAK", sizeof("PROPERTY_WORD_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_WORD_BREAK_name, &const_PROPERTY_WORD_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_WORD_BREAK_name); + zend_string_release_ex(const_PROPERTY_WORD_BREAK_name, true); zval const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_value; ZVAL_LONG(&const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_value, UCHAR_BIDI_PAIRED_BRACKET_TYPE); - zend_string *const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_name = zend_string_init_interned("PROPERTY_BIDI_PAIRED_BRACKET_TYPE", sizeof("PROPERTY_BIDI_PAIRED_BRACKET_TYPE") - 1, 1); + zend_string *const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_name = zend_string_init_interned("PROPERTY_BIDI_PAIRED_BRACKET_TYPE", sizeof("PROPERTY_BIDI_PAIRED_BRACKET_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_name, &const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_name); + zend_string_release_ex(const_PROPERTY_BIDI_PAIRED_BRACKET_TYPE_name, true); zval const_PROPERTY_INT_LIMIT_value; ZVAL_LONG(&const_PROPERTY_INT_LIMIT_value, UCHAR_INT_LIMIT); - zend_string *const_PROPERTY_INT_LIMIT_name = zend_string_init_interned("PROPERTY_INT_LIMIT", sizeof("PROPERTY_INT_LIMIT") - 1, 1); + zend_string *const_PROPERTY_INT_LIMIT_name = zend_string_init_interned("PROPERTY_INT_LIMIT", sizeof("PROPERTY_INT_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_INT_LIMIT_name, &const_PROPERTY_INT_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_INT_LIMIT_name); + zend_string_release_ex(const_PROPERTY_INT_LIMIT_name, true); zval const_PROPERTY_GENERAL_CATEGORY_MASK_value; ZVAL_LONG(&const_PROPERTY_GENERAL_CATEGORY_MASK_value, UCHAR_GENERAL_CATEGORY_MASK); - zend_string *const_PROPERTY_GENERAL_CATEGORY_MASK_name = zend_string_init_interned("PROPERTY_GENERAL_CATEGORY_MASK", sizeof("PROPERTY_GENERAL_CATEGORY_MASK") - 1, 1); + zend_string *const_PROPERTY_GENERAL_CATEGORY_MASK_name = zend_string_init_interned("PROPERTY_GENERAL_CATEGORY_MASK", sizeof("PROPERTY_GENERAL_CATEGORY_MASK") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_GENERAL_CATEGORY_MASK_name, &const_PROPERTY_GENERAL_CATEGORY_MASK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_GENERAL_CATEGORY_MASK_name); + zend_string_release_ex(const_PROPERTY_GENERAL_CATEGORY_MASK_name, true); zval const_PROPERTY_MASK_START_value; ZVAL_LONG(&const_PROPERTY_MASK_START_value, UCHAR_MASK_START); - zend_string *const_PROPERTY_MASK_START_name = zend_string_init_interned("PROPERTY_MASK_START", sizeof("PROPERTY_MASK_START") - 1, 1); + zend_string *const_PROPERTY_MASK_START_name = zend_string_init_interned("PROPERTY_MASK_START", sizeof("PROPERTY_MASK_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_MASK_START_name, &const_PROPERTY_MASK_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_MASK_START_name); + zend_string_release_ex(const_PROPERTY_MASK_START_name, true); zval const_PROPERTY_MASK_LIMIT_value; ZVAL_LONG(&const_PROPERTY_MASK_LIMIT_value, UCHAR_MASK_LIMIT); - zend_string *const_PROPERTY_MASK_LIMIT_name = zend_string_init_interned("PROPERTY_MASK_LIMIT", sizeof("PROPERTY_MASK_LIMIT") - 1, 1); + zend_string *const_PROPERTY_MASK_LIMIT_name = zend_string_init_interned("PROPERTY_MASK_LIMIT", sizeof("PROPERTY_MASK_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_MASK_LIMIT_name, &const_PROPERTY_MASK_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_MASK_LIMIT_name); + zend_string_release_ex(const_PROPERTY_MASK_LIMIT_name, true); zval const_PROPERTY_NUMERIC_VALUE_value; ZVAL_LONG(&const_PROPERTY_NUMERIC_VALUE_value, UCHAR_NUMERIC_VALUE); - zend_string *const_PROPERTY_NUMERIC_VALUE_name = zend_string_init_interned("PROPERTY_NUMERIC_VALUE", sizeof("PROPERTY_NUMERIC_VALUE") - 1, 1); + zend_string *const_PROPERTY_NUMERIC_VALUE_name = zend_string_init_interned("PROPERTY_NUMERIC_VALUE", sizeof("PROPERTY_NUMERIC_VALUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NUMERIC_VALUE_name, &const_PROPERTY_NUMERIC_VALUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NUMERIC_VALUE_name); + zend_string_release_ex(const_PROPERTY_NUMERIC_VALUE_name, true); zval const_PROPERTY_DOUBLE_START_value; ZVAL_LONG(&const_PROPERTY_DOUBLE_START_value, UCHAR_DOUBLE_START); - zend_string *const_PROPERTY_DOUBLE_START_name = zend_string_init_interned("PROPERTY_DOUBLE_START", sizeof("PROPERTY_DOUBLE_START") - 1, 1); + zend_string *const_PROPERTY_DOUBLE_START_name = zend_string_init_interned("PROPERTY_DOUBLE_START", sizeof("PROPERTY_DOUBLE_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DOUBLE_START_name, &const_PROPERTY_DOUBLE_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DOUBLE_START_name); + zend_string_release_ex(const_PROPERTY_DOUBLE_START_name, true); zval const_PROPERTY_DOUBLE_LIMIT_value; ZVAL_LONG(&const_PROPERTY_DOUBLE_LIMIT_value, UCHAR_DOUBLE_LIMIT); - zend_string *const_PROPERTY_DOUBLE_LIMIT_name = zend_string_init_interned("PROPERTY_DOUBLE_LIMIT", sizeof("PROPERTY_DOUBLE_LIMIT") - 1, 1); + zend_string *const_PROPERTY_DOUBLE_LIMIT_name = zend_string_init_interned("PROPERTY_DOUBLE_LIMIT", sizeof("PROPERTY_DOUBLE_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_DOUBLE_LIMIT_name, &const_PROPERTY_DOUBLE_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_DOUBLE_LIMIT_name); + zend_string_release_ex(const_PROPERTY_DOUBLE_LIMIT_name, true); zval const_PROPERTY_AGE_value; ZVAL_LONG(&const_PROPERTY_AGE_value, UCHAR_AGE); - zend_string *const_PROPERTY_AGE_name = zend_string_init_interned("PROPERTY_AGE", sizeof("PROPERTY_AGE") - 1, 1); + zend_string *const_PROPERTY_AGE_name = zend_string_init_interned("PROPERTY_AGE", sizeof("PROPERTY_AGE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_AGE_name, &const_PROPERTY_AGE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_AGE_name); + zend_string_release_ex(const_PROPERTY_AGE_name, true); zval const_PROPERTY_STRING_START_value; ZVAL_LONG(&const_PROPERTY_STRING_START_value, UCHAR_STRING_START); - zend_string *const_PROPERTY_STRING_START_name = zend_string_init_interned("PROPERTY_STRING_START", sizeof("PROPERTY_STRING_START") - 1, 1); + zend_string *const_PROPERTY_STRING_START_name = zend_string_init_interned("PROPERTY_STRING_START", sizeof("PROPERTY_STRING_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_STRING_START_name, &const_PROPERTY_STRING_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_STRING_START_name); + zend_string_release_ex(const_PROPERTY_STRING_START_name, true); zval const_PROPERTY_BIDI_MIRRORING_GLYPH_value; ZVAL_LONG(&const_PROPERTY_BIDI_MIRRORING_GLYPH_value, UCHAR_BIDI_MIRRORING_GLYPH); - zend_string *const_PROPERTY_BIDI_MIRRORING_GLYPH_name = zend_string_init_interned("PROPERTY_BIDI_MIRRORING_GLYPH", sizeof("PROPERTY_BIDI_MIRRORING_GLYPH") - 1, 1); + zend_string *const_PROPERTY_BIDI_MIRRORING_GLYPH_name = zend_string_init_interned("PROPERTY_BIDI_MIRRORING_GLYPH", sizeof("PROPERTY_BIDI_MIRRORING_GLYPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_MIRRORING_GLYPH_name, &const_PROPERTY_BIDI_MIRRORING_GLYPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_MIRRORING_GLYPH_name); + zend_string_release_ex(const_PROPERTY_BIDI_MIRRORING_GLYPH_name, true); zval const_PROPERTY_CASE_FOLDING_value; ZVAL_LONG(&const_PROPERTY_CASE_FOLDING_value, UCHAR_CASE_FOLDING); - zend_string *const_PROPERTY_CASE_FOLDING_name = zend_string_init_interned("PROPERTY_CASE_FOLDING", sizeof("PROPERTY_CASE_FOLDING") - 1, 1); + zend_string *const_PROPERTY_CASE_FOLDING_name = zend_string_init_interned("PROPERTY_CASE_FOLDING", sizeof("PROPERTY_CASE_FOLDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_CASE_FOLDING_name, &const_PROPERTY_CASE_FOLDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_CASE_FOLDING_name); + zend_string_release_ex(const_PROPERTY_CASE_FOLDING_name, true); zval const_PROPERTY_ISO_COMMENT_value; ZVAL_LONG(&const_PROPERTY_ISO_COMMENT_value, UCHAR_ISO_COMMENT); - zend_string *const_PROPERTY_ISO_COMMENT_name = zend_string_init_interned("PROPERTY_ISO_COMMENT", sizeof("PROPERTY_ISO_COMMENT") - 1, 1); + zend_string *const_PROPERTY_ISO_COMMENT_name = zend_string_init_interned("PROPERTY_ISO_COMMENT", sizeof("PROPERTY_ISO_COMMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_ISO_COMMENT_name, &const_PROPERTY_ISO_COMMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_ISO_COMMENT_name); + zend_string_release_ex(const_PROPERTY_ISO_COMMENT_name, true); zval const_PROPERTY_LOWERCASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_LOWERCASE_MAPPING_value, UCHAR_LOWERCASE_MAPPING); - zend_string *const_PROPERTY_LOWERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_LOWERCASE_MAPPING", sizeof("PROPERTY_LOWERCASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_LOWERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_LOWERCASE_MAPPING", sizeof("PROPERTY_LOWERCASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_LOWERCASE_MAPPING_name, &const_PROPERTY_LOWERCASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_LOWERCASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_LOWERCASE_MAPPING_name, true); zval const_PROPERTY_NAME_value; ZVAL_LONG(&const_PROPERTY_NAME_value, UCHAR_NAME); - zend_string *const_PROPERTY_NAME_name = zend_string_init_interned("PROPERTY_NAME", sizeof("PROPERTY_NAME") - 1, 1); + zend_string *const_PROPERTY_NAME_name = zend_string_init_interned("PROPERTY_NAME", sizeof("PROPERTY_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NAME_name, &const_PROPERTY_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NAME_name); + zend_string_release_ex(const_PROPERTY_NAME_name, true); zval const_PROPERTY_SIMPLE_CASE_FOLDING_value; ZVAL_LONG(&const_PROPERTY_SIMPLE_CASE_FOLDING_value, UCHAR_SIMPLE_CASE_FOLDING); - zend_string *const_PROPERTY_SIMPLE_CASE_FOLDING_name = zend_string_init_interned("PROPERTY_SIMPLE_CASE_FOLDING", sizeof("PROPERTY_SIMPLE_CASE_FOLDING") - 1, 1); + zend_string *const_PROPERTY_SIMPLE_CASE_FOLDING_name = zend_string_init_interned("PROPERTY_SIMPLE_CASE_FOLDING", sizeof("PROPERTY_SIMPLE_CASE_FOLDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SIMPLE_CASE_FOLDING_name, &const_PROPERTY_SIMPLE_CASE_FOLDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SIMPLE_CASE_FOLDING_name); + zend_string_release_ex(const_PROPERTY_SIMPLE_CASE_FOLDING_name, true); zval const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_value, UCHAR_SIMPLE_LOWERCASE_MAPPING); - zend_string *const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_LOWERCASE_MAPPING", sizeof("PROPERTY_SIMPLE_LOWERCASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_LOWERCASE_MAPPING", sizeof("PROPERTY_SIMPLE_LOWERCASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_name, &const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_SIMPLE_LOWERCASE_MAPPING_name, true); zval const_PROPERTY_SIMPLE_TITLECASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_SIMPLE_TITLECASE_MAPPING_value, UCHAR_SIMPLE_TITLECASE_MAPPING); - zend_string *const_PROPERTY_SIMPLE_TITLECASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_TITLECASE_MAPPING", sizeof("PROPERTY_SIMPLE_TITLECASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_SIMPLE_TITLECASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_TITLECASE_MAPPING", sizeof("PROPERTY_SIMPLE_TITLECASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SIMPLE_TITLECASE_MAPPING_name, &const_PROPERTY_SIMPLE_TITLECASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SIMPLE_TITLECASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_SIMPLE_TITLECASE_MAPPING_name, true); zval const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_value, UCHAR_SIMPLE_UPPERCASE_MAPPING); - zend_string *const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_UPPERCASE_MAPPING", sizeof("PROPERTY_SIMPLE_UPPERCASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_SIMPLE_UPPERCASE_MAPPING", sizeof("PROPERTY_SIMPLE_UPPERCASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_name, &const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_SIMPLE_UPPERCASE_MAPPING_name, true); zval const_PROPERTY_TITLECASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_TITLECASE_MAPPING_value, UCHAR_TITLECASE_MAPPING); - zend_string *const_PROPERTY_TITLECASE_MAPPING_name = zend_string_init_interned("PROPERTY_TITLECASE_MAPPING", sizeof("PROPERTY_TITLECASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_TITLECASE_MAPPING_name = zend_string_init_interned("PROPERTY_TITLECASE_MAPPING", sizeof("PROPERTY_TITLECASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_TITLECASE_MAPPING_name, &const_PROPERTY_TITLECASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_TITLECASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_TITLECASE_MAPPING_name, true); zval const_PROPERTY_UNICODE_1_NAME_value; ZVAL_LONG(&const_PROPERTY_UNICODE_1_NAME_value, UCHAR_UNICODE_1_NAME); - zend_string *const_PROPERTY_UNICODE_1_NAME_name = zend_string_init_interned("PROPERTY_UNICODE_1_NAME", sizeof("PROPERTY_UNICODE_1_NAME") - 1, 1); + zend_string *const_PROPERTY_UNICODE_1_NAME_name = zend_string_init_interned("PROPERTY_UNICODE_1_NAME", sizeof("PROPERTY_UNICODE_1_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_UNICODE_1_NAME_name, &const_PROPERTY_UNICODE_1_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_UNICODE_1_NAME_name); + zend_string_release_ex(const_PROPERTY_UNICODE_1_NAME_name, true); zval const_PROPERTY_UPPERCASE_MAPPING_value; ZVAL_LONG(&const_PROPERTY_UPPERCASE_MAPPING_value, UCHAR_UPPERCASE_MAPPING); - zend_string *const_PROPERTY_UPPERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_UPPERCASE_MAPPING", sizeof("PROPERTY_UPPERCASE_MAPPING") - 1, 1); + zend_string *const_PROPERTY_UPPERCASE_MAPPING_name = zend_string_init_interned("PROPERTY_UPPERCASE_MAPPING", sizeof("PROPERTY_UPPERCASE_MAPPING") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_UPPERCASE_MAPPING_name, &const_PROPERTY_UPPERCASE_MAPPING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_UPPERCASE_MAPPING_name); + zend_string_release_ex(const_PROPERTY_UPPERCASE_MAPPING_name, true); zval const_PROPERTY_BIDI_PAIRED_BRACKET_value; ZVAL_LONG(&const_PROPERTY_BIDI_PAIRED_BRACKET_value, UCHAR_BIDI_PAIRED_BRACKET); - zend_string *const_PROPERTY_BIDI_PAIRED_BRACKET_name = zend_string_init_interned("PROPERTY_BIDI_PAIRED_BRACKET", sizeof("PROPERTY_BIDI_PAIRED_BRACKET") - 1, 1); + zend_string *const_PROPERTY_BIDI_PAIRED_BRACKET_name = zend_string_init_interned("PROPERTY_BIDI_PAIRED_BRACKET", sizeof("PROPERTY_BIDI_PAIRED_BRACKET") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_BIDI_PAIRED_BRACKET_name, &const_PROPERTY_BIDI_PAIRED_BRACKET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_BIDI_PAIRED_BRACKET_name); + zend_string_release_ex(const_PROPERTY_BIDI_PAIRED_BRACKET_name, true); zval const_PROPERTY_STRING_LIMIT_value; ZVAL_LONG(&const_PROPERTY_STRING_LIMIT_value, UCHAR_STRING_LIMIT); - zend_string *const_PROPERTY_STRING_LIMIT_name = zend_string_init_interned("PROPERTY_STRING_LIMIT", sizeof("PROPERTY_STRING_LIMIT") - 1, 1); + zend_string *const_PROPERTY_STRING_LIMIT_name = zend_string_init_interned("PROPERTY_STRING_LIMIT", sizeof("PROPERTY_STRING_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_STRING_LIMIT_name, &const_PROPERTY_STRING_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_STRING_LIMIT_name); + zend_string_release_ex(const_PROPERTY_STRING_LIMIT_name, true); zval const_PROPERTY_SCRIPT_EXTENSIONS_value; ZVAL_LONG(&const_PROPERTY_SCRIPT_EXTENSIONS_value, UCHAR_SCRIPT_EXTENSIONS); - zend_string *const_PROPERTY_SCRIPT_EXTENSIONS_name = zend_string_init_interned("PROPERTY_SCRIPT_EXTENSIONS", sizeof("PROPERTY_SCRIPT_EXTENSIONS") - 1, 1); + zend_string *const_PROPERTY_SCRIPT_EXTENSIONS_name = zend_string_init_interned("PROPERTY_SCRIPT_EXTENSIONS", sizeof("PROPERTY_SCRIPT_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_SCRIPT_EXTENSIONS_name, &const_PROPERTY_SCRIPT_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_SCRIPT_EXTENSIONS_name); + zend_string_release_ex(const_PROPERTY_SCRIPT_EXTENSIONS_name, true); zval const_PROPERTY_OTHER_PROPERTY_START_value; ZVAL_LONG(&const_PROPERTY_OTHER_PROPERTY_START_value, UCHAR_OTHER_PROPERTY_START); - zend_string *const_PROPERTY_OTHER_PROPERTY_START_name = zend_string_init_interned("PROPERTY_OTHER_PROPERTY_START", sizeof("PROPERTY_OTHER_PROPERTY_START") - 1, 1); + zend_string *const_PROPERTY_OTHER_PROPERTY_START_name = zend_string_init_interned("PROPERTY_OTHER_PROPERTY_START", sizeof("PROPERTY_OTHER_PROPERTY_START") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_OTHER_PROPERTY_START_name, &const_PROPERTY_OTHER_PROPERTY_START_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_OTHER_PROPERTY_START_name); + zend_string_release_ex(const_PROPERTY_OTHER_PROPERTY_START_name, true); zval const_PROPERTY_OTHER_PROPERTY_LIMIT_value; ZVAL_LONG(&const_PROPERTY_OTHER_PROPERTY_LIMIT_value, UCHAR_OTHER_PROPERTY_LIMIT); - zend_string *const_PROPERTY_OTHER_PROPERTY_LIMIT_name = zend_string_init_interned("PROPERTY_OTHER_PROPERTY_LIMIT", sizeof("PROPERTY_OTHER_PROPERTY_LIMIT") - 1, 1); + zend_string *const_PROPERTY_OTHER_PROPERTY_LIMIT_name = zend_string_init_interned("PROPERTY_OTHER_PROPERTY_LIMIT", sizeof("PROPERTY_OTHER_PROPERTY_LIMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_OTHER_PROPERTY_LIMIT_name, &const_PROPERTY_OTHER_PROPERTY_LIMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_OTHER_PROPERTY_LIMIT_name); + zend_string_release_ex(const_PROPERTY_OTHER_PROPERTY_LIMIT_name, true); zval const_PROPERTY_INVALID_CODE_value; ZVAL_LONG(&const_PROPERTY_INVALID_CODE_value, UCHAR_INVALID_CODE); - zend_string *const_PROPERTY_INVALID_CODE_name = zend_string_init_interned("PROPERTY_INVALID_CODE", sizeof("PROPERTY_INVALID_CODE") - 1, 1); + zend_string *const_PROPERTY_INVALID_CODE_name = zend_string_init_interned("PROPERTY_INVALID_CODE", sizeof("PROPERTY_INVALID_CODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_INVALID_CODE_name, &const_PROPERTY_INVALID_CODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_INVALID_CODE_name); + zend_string_release_ex(const_PROPERTY_INVALID_CODE_name, true); zval const_CHAR_CATEGORY_UNASSIGNED_value; ZVAL_LONG(&const_CHAR_CATEGORY_UNASSIGNED_value, U_UNASSIGNED); - zend_string *const_CHAR_CATEGORY_UNASSIGNED_name = zend_string_init_interned("CHAR_CATEGORY_UNASSIGNED", sizeof("CHAR_CATEGORY_UNASSIGNED") - 1, 1); + zend_string *const_CHAR_CATEGORY_UNASSIGNED_name = zend_string_init_interned("CHAR_CATEGORY_UNASSIGNED", sizeof("CHAR_CATEGORY_UNASSIGNED") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_UNASSIGNED_name, &const_CHAR_CATEGORY_UNASSIGNED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_UNASSIGNED_name); + zend_string_release_ex(const_CHAR_CATEGORY_UNASSIGNED_name, true); zval const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_value; ZVAL_LONG(&const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_value, U_GENERAL_OTHER_TYPES); - zend_string *const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_name = zend_string_init_interned("CHAR_CATEGORY_GENERAL_OTHER_TYPES", sizeof("CHAR_CATEGORY_GENERAL_OTHER_TYPES") - 1, 1); + zend_string *const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_name = zend_string_init_interned("CHAR_CATEGORY_GENERAL_OTHER_TYPES", sizeof("CHAR_CATEGORY_GENERAL_OTHER_TYPES") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_name, &const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_name); + zend_string_release_ex(const_CHAR_CATEGORY_GENERAL_OTHER_TYPES_name, true); zval const_CHAR_CATEGORY_UPPERCASE_LETTER_value; ZVAL_LONG(&const_CHAR_CATEGORY_UPPERCASE_LETTER_value, U_UPPERCASE_LETTER); - zend_string *const_CHAR_CATEGORY_UPPERCASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_UPPERCASE_LETTER", sizeof("CHAR_CATEGORY_UPPERCASE_LETTER") - 1, 1); + zend_string *const_CHAR_CATEGORY_UPPERCASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_UPPERCASE_LETTER", sizeof("CHAR_CATEGORY_UPPERCASE_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_UPPERCASE_LETTER_name, &const_CHAR_CATEGORY_UPPERCASE_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_UPPERCASE_LETTER_name); + zend_string_release_ex(const_CHAR_CATEGORY_UPPERCASE_LETTER_name, true); zval const_CHAR_CATEGORY_LOWERCASE_LETTER_value; ZVAL_LONG(&const_CHAR_CATEGORY_LOWERCASE_LETTER_value, U_LOWERCASE_LETTER); - zend_string *const_CHAR_CATEGORY_LOWERCASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_LOWERCASE_LETTER", sizeof("CHAR_CATEGORY_LOWERCASE_LETTER") - 1, 1); + zend_string *const_CHAR_CATEGORY_LOWERCASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_LOWERCASE_LETTER", sizeof("CHAR_CATEGORY_LOWERCASE_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_LOWERCASE_LETTER_name, &const_CHAR_CATEGORY_LOWERCASE_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_LOWERCASE_LETTER_name); + zend_string_release_ex(const_CHAR_CATEGORY_LOWERCASE_LETTER_name, true); zval const_CHAR_CATEGORY_TITLECASE_LETTER_value; ZVAL_LONG(&const_CHAR_CATEGORY_TITLECASE_LETTER_value, U_TITLECASE_LETTER); - zend_string *const_CHAR_CATEGORY_TITLECASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_TITLECASE_LETTER", sizeof("CHAR_CATEGORY_TITLECASE_LETTER") - 1, 1); + zend_string *const_CHAR_CATEGORY_TITLECASE_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_TITLECASE_LETTER", sizeof("CHAR_CATEGORY_TITLECASE_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_TITLECASE_LETTER_name, &const_CHAR_CATEGORY_TITLECASE_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_TITLECASE_LETTER_name); + zend_string_release_ex(const_CHAR_CATEGORY_TITLECASE_LETTER_name, true); zval const_CHAR_CATEGORY_MODIFIER_LETTER_value; ZVAL_LONG(&const_CHAR_CATEGORY_MODIFIER_LETTER_value, U_MODIFIER_LETTER); - zend_string *const_CHAR_CATEGORY_MODIFIER_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_MODIFIER_LETTER", sizeof("CHAR_CATEGORY_MODIFIER_LETTER") - 1, 1); + zend_string *const_CHAR_CATEGORY_MODIFIER_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_MODIFIER_LETTER", sizeof("CHAR_CATEGORY_MODIFIER_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_MODIFIER_LETTER_name, &const_CHAR_CATEGORY_MODIFIER_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_MODIFIER_LETTER_name); + zend_string_release_ex(const_CHAR_CATEGORY_MODIFIER_LETTER_name, true); zval const_CHAR_CATEGORY_OTHER_LETTER_value; ZVAL_LONG(&const_CHAR_CATEGORY_OTHER_LETTER_value, U_OTHER_LETTER); - zend_string *const_CHAR_CATEGORY_OTHER_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_LETTER", sizeof("CHAR_CATEGORY_OTHER_LETTER") - 1, 1); + zend_string *const_CHAR_CATEGORY_OTHER_LETTER_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_LETTER", sizeof("CHAR_CATEGORY_OTHER_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_OTHER_LETTER_name, &const_CHAR_CATEGORY_OTHER_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_OTHER_LETTER_name); + zend_string_release_ex(const_CHAR_CATEGORY_OTHER_LETTER_name, true); zval const_CHAR_CATEGORY_NON_SPACING_MARK_value; ZVAL_LONG(&const_CHAR_CATEGORY_NON_SPACING_MARK_value, U_NON_SPACING_MARK); - zend_string *const_CHAR_CATEGORY_NON_SPACING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_NON_SPACING_MARK", sizeof("CHAR_CATEGORY_NON_SPACING_MARK") - 1, 1); + zend_string *const_CHAR_CATEGORY_NON_SPACING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_NON_SPACING_MARK", sizeof("CHAR_CATEGORY_NON_SPACING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_NON_SPACING_MARK_name, &const_CHAR_CATEGORY_NON_SPACING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_NON_SPACING_MARK_name); + zend_string_release_ex(const_CHAR_CATEGORY_NON_SPACING_MARK_name, true); zval const_CHAR_CATEGORY_ENCLOSING_MARK_value; ZVAL_LONG(&const_CHAR_CATEGORY_ENCLOSING_MARK_value, U_ENCLOSING_MARK); - zend_string *const_CHAR_CATEGORY_ENCLOSING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_ENCLOSING_MARK", sizeof("CHAR_CATEGORY_ENCLOSING_MARK") - 1, 1); + zend_string *const_CHAR_CATEGORY_ENCLOSING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_ENCLOSING_MARK", sizeof("CHAR_CATEGORY_ENCLOSING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_ENCLOSING_MARK_name, &const_CHAR_CATEGORY_ENCLOSING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_ENCLOSING_MARK_name); + zend_string_release_ex(const_CHAR_CATEGORY_ENCLOSING_MARK_name, true); zval const_CHAR_CATEGORY_COMBINING_SPACING_MARK_value; ZVAL_LONG(&const_CHAR_CATEGORY_COMBINING_SPACING_MARK_value, U_COMBINING_SPACING_MARK); - zend_string *const_CHAR_CATEGORY_COMBINING_SPACING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_COMBINING_SPACING_MARK", sizeof("CHAR_CATEGORY_COMBINING_SPACING_MARK") - 1, 1); + zend_string *const_CHAR_CATEGORY_COMBINING_SPACING_MARK_name = zend_string_init_interned("CHAR_CATEGORY_COMBINING_SPACING_MARK", sizeof("CHAR_CATEGORY_COMBINING_SPACING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_COMBINING_SPACING_MARK_name, &const_CHAR_CATEGORY_COMBINING_SPACING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_COMBINING_SPACING_MARK_name); + zend_string_release_ex(const_CHAR_CATEGORY_COMBINING_SPACING_MARK_name, true); zval const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_value; ZVAL_LONG(&const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_value, U_DECIMAL_DIGIT_NUMBER); - zend_string *const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER", sizeof("CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER") - 1, 1); + zend_string *const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER", sizeof("CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_name, &const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_name); + zend_string_release_ex(const_CHAR_CATEGORY_DECIMAL_DIGIT_NUMBER_name, true); zval const_CHAR_CATEGORY_LETTER_NUMBER_value; ZVAL_LONG(&const_CHAR_CATEGORY_LETTER_NUMBER_value, U_LETTER_NUMBER); - zend_string *const_CHAR_CATEGORY_LETTER_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_LETTER_NUMBER", sizeof("CHAR_CATEGORY_LETTER_NUMBER") - 1, 1); + zend_string *const_CHAR_CATEGORY_LETTER_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_LETTER_NUMBER", sizeof("CHAR_CATEGORY_LETTER_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_LETTER_NUMBER_name, &const_CHAR_CATEGORY_LETTER_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_LETTER_NUMBER_name); + zend_string_release_ex(const_CHAR_CATEGORY_LETTER_NUMBER_name, true); zval const_CHAR_CATEGORY_OTHER_NUMBER_value; ZVAL_LONG(&const_CHAR_CATEGORY_OTHER_NUMBER_value, U_OTHER_NUMBER); - zend_string *const_CHAR_CATEGORY_OTHER_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_NUMBER", sizeof("CHAR_CATEGORY_OTHER_NUMBER") - 1, 1); + zend_string *const_CHAR_CATEGORY_OTHER_NUMBER_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_NUMBER", sizeof("CHAR_CATEGORY_OTHER_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_OTHER_NUMBER_name, &const_CHAR_CATEGORY_OTHER_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_OTHER_NUMBER_name); + zend_string_release_ex(const_CHAR_CATEGORY_OTHER_NUMBER_name, true); zval const_CHAR_CATEGORY_SPACE_SEPARATOR_value; ZVAL_LONG(&const_CHAR_CATEGORY_SPACE_SEPARATOR_value, U_SPACE_SEPARATOR); - zend_string *const_CHAR_CATEGORY_SPACE_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_SPACE_SEPARATOR", sizeof("CHAR_CATEGORY_SPACE_SEPARATOR") - 1, 1); + zend_string *const_CHAR_CATEGORY_SPACE_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_SPACE_SEPARATOR", sizeof("CHAR_CATEGORY_SPACE_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_SPACE_SEPARATOR_name, &const_CHAR_CATEGORY_SPACE_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_SPACE_SEPARATOR_name); + zend_string_release_ex(const_CHAR_CATEGORY_SPACE_SEPARATOR_name, true); zval const_CHAR_CATEGORY_LINE_SEPARATOR_value; ZVAL_LONG(&const_CHAR_CATEGORY_LINE_SEPARATOR_value, U_LINE_SEPARATOR); - zend_string *const_CHAR_CATEGORY_LINE_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_LINE_SEPARATOR", sizeof("CHAR_CATEGORY_LINE_SEPARATOR") - 1, 1); + zend_string *const_CHAR_CATEGORY_LINE_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_LINE_SEPARATOR", sizeof("CHAR_CATEGORY_LINE_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_LINE_SEPARATOR_name, &const_CHAR_CATEGORY_LINE_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_LINE_SEPARATOR_name); + zend_string_release_ex(const_CHAR_CATEGORY_LINE_SEPARATOR_name, true); zval const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_value; ZVAL_LONG(&const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_value, U_PARAGRAPH_SEPARATOR); - zend_string *const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_PARAGRAPH_SEPARATOR", sizeof("CHAR_CATEGORY_PARAGRAPH_SEPARATOR") - 1, 1); + zend_string *const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_name = zend_string_init_interned("CHAR_CATEGORY_PARAGRAPH_SEPARATOR", sizeof("CHAR_CATEGORY_PARAGRAPH_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_name, &const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_name); + zend_string_release_ex(const_CHAR_CATEGORY_PARAGRAPH_SEPARATOR_name, true); zval const_CHAR_CATEGORY_CONTROL_CHAR_value; ZVAL_LONG(&const_CHAR_CATEGORY_CONTROL_CHAR_value, U_CONTROL_CHAR); - zend_string *const_CHAR_CATEGORY_CONTROL_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_CONTROL_CHAR", sizeof("CHAR_CATEGORY_CONTROL_CHAR") - 1, 1); + zend_string *const_CHAR_CATEGORY_CONTROL_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_CONTROL_CHAR", sizeof("CHAR_CATEGORY_CONTROL_CHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_CONTROL_CHAR_name, &const_CHAR_CATEGORY_CONTROL_CHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_CONTROL_CHAR_name); + zend_string_release_ex(const_CHAR_CATEGORY_CONTROL_CHAR_name, true); zval const_CHAR_CATEGORY_FORMAT_CHAR_value; ZVAL_LONG(&const_CHAR_CATEGORY_FORMAT_CHAR_value, U_FORMAT_CHAR); - zend_string *const_CHAR_CATEGORY_FORMAT_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_FORMAT_CHAR", sizeof("CHAR_CATEGORY_FORMAT_CHAR") - 1, 1); + zend_string *const_CHAR_CATEGORY_FORMAT_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_FORMAT_CHAR", sizeof("CHAR_CATEGORY_FORMAT_CHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_FORMAT_CHAR_name, &const_CHAR_CATEGORY_FORMAT_CHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_FORMAT_CHAR_name); + zend_string_release_ex(const_CHAR_CATEGORY_FORMAT_CHAR_name, true); zval const_CHAR_CATEGORY_PRIVATE_USE_CHAR_value; ZVAL_LONG(&const_CHAR_CATEGORY_PRIVATE_USE_CHAR_value, U_PRIVATE_USE_CHAR); - zend_string *const_CHAR_CATEGORY_PRIVATE_USE_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_PRIVATE_USE_CHAR", sizeof("CHAR_CATEGORY_PRIVATE_USE_CHAR") - 1, 1); + zend_string *const_CHAR_CATEGORY_PRIVATE_USE_CHAR_name = zend_string_init_interned("CHAR_CATEGORY_PRIVATE_USE_CHAR", sizeof("CHAR_CATEGORY_PRIVATE_USE_CHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_PRIVATE_USE_CHAR_name, &const_CHAR_CATEGORY_PRIVATE_USE_CHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_PRIVATE_USE_CHAR_name); + zend_string_release_ex(const_CHAR_CATEGORY_PRIVATE_USE_CHAR_name, true); zval const_CHAR_CATEGORY_SURROGATE_value; ZVAL_LONG(&const_CHAR_CATEGORY_SURROGATE_value, U_SURROGATE); - zend_string *const_CHAR_CATEGORY_SURROGATE_name = zend_string_init_interned("CHAR_CATEGORY_SURROGATE", sizeof("CHAR_CATEGORY_SURROGATE") - 1, 1); + zend_string *const_CHAR_CATEGORY_SURROGATE_name = zend_string_init_interned("CHAR_CATEGORY_SURROGATE", sizeof("CHAR_CATEGORY_SURROGATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_SURROGATE_name, &const_CHAR_CATEGORY_SURROGATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_SURROGATE_name); + zend_string_release_ex(const_CHAR_CATEGORY_SURROGATE_name, true); zval const_CHAR_CATEGORY_DASH_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_DASH_PUNCTUATION_value, U_DASH_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_DASH_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_DASH_PUNCTUATION", sizeof("CHAR_CATEGORY_DASH_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_DASH_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_DASH_PUNCTUATION", sizeof("CHAR_CATEGORY_DASH_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_DASH_PUNCTUATION_name, &const_CHAR_CATEGORY_DASH_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_DASH_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_DASH_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_START_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_START_PUNCTUATION_value, U_START_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_START_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_START_PUNCTUATION", sizeof("CHAR_CATEGORY_START_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_START_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_START_PUNCTUATION", sizeof("CHAR_CATEGORY_START_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_START_PUNCTUATION_name, &const_CHAR_CATEGORY_START_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_START_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_START_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_END_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_END_PUNCTUATION_value, U_END_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_END_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_END_PUNCTUATION", sizeof("CHAR_CATEGORY_END_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_END_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_END_PUNCTUATION", sizeof("CHAR_CATEGORY_END_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_END_PUNCTUATION_name, &const_CHAR_CATEGORY_END_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_END_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_END_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_value, U_CONNECTOR_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_CONNECTOR_PUNCTUATION", sizeof("CHAR_CATEGORY_CONNECTOR_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_CONNECTOR_PUNCTUATION", sizeof("CHAR_CATEGORY_CONNECTOR_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_name, &const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_CONNECTOR_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_OTHER_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_OTHER_PUNCTUATION_value, U_OTHER_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_OTHER_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_PUNCTUATION", sizeof("CHAR_CATEGORY_OTHER_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_OTHER_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_PUNCTUATION", sizeof("CHAR_CATEGORY_OTHER_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_OTHER_PUNCTUATION_name, &const_CHAR_CATEGORY_OTHER_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_OTHER_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_OTHER_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_MATH_SYMBOL_value; ZVAL_LONG(&const_CHAR_CATEGORY_MATH_SYMBOL_value, U_MATH_SYMBOL); - zend_string *const_CHAR_CATEGORY_MATH_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_MATH_SYMBOL", sizeof("CHAR_CATEGORY_MATH_SYMBOL") - 1, 1); + zend_string *const_CHAR_CATEGORY_MATH_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_MATH_SYMBOL", sizeof("CHAR_CATEGORY_MATH_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_MATH_SYMBOL_name, &const_CHAR_CATEGORY_MATH_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_MATH_SYMBOL_name); + zend_string_release_ex(const_CHAR_CATEGORY_MATH_SYMBOL_name, true); zval const_CHAR_CATEGORY_CURRENCY_SYMBOL_value; ZVAL_LONG(&const_CHAR_CATEGORY_CURRENCY_SYMBOL_value, U_CURRENCY_SYMBOL); - zend_string *const_CHAR_CATEGORY_CURRENCY_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_CURRENCY_SYMBOL", sizeof("CHAR_CATEGORY_CURRENCY_SYMBOL") - 1, 1); + zend_string *const_CHAR_CATEGORY_CURRENCY_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_CURRENCY_SYMBOL", sizeof("CHAR_CATEGORY_CURRENCY_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_CURRENCY_SYMBOL_name, &const_CHAR_CATEGORY_CURRENCY_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_CURRENCY_SYMBOL_name); + zend_string_release_ex(const_CHAR_CATEGORY_CURRENCY_SYMBOL_name, true); zval const_CHAR_CATEGORY_MODIFIER_SYMBOL_value; ZVAL_LONG(&const_CHAR_CATEGORY_MODIFIER_SYMBOL_value, U_MODIFIER_SYMBOL); - zend_string *const_CHAR_CATEGORY_MODIFIER_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_MODIFIER_SYMBOL", sizeof("CHAR_CATEGORY_MODIFIER_SYMBOL") - 1, 1); + zend_string *const_CHAR_CATEGORY_MODIFIER_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_MODIFIER_SYMBOL", sizeof("CHAR_CATEGORY_MODIFIER_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_MODIFIER_SYMBOL_name, &const_CHAR_CATEGORY_MODIFIER_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_MODIFIER_SYMBOL_name); + zend_string_release_ex(const_CHAR_CATEGORY_MODIFIER_SYMBOL_name, true); zval const_CHAR_CATEGORY_OTHER_SYMBOL_value; ZVAL_LONG(&const_CHAR_CATEGORY_OTHER_SYMBOL_value, U_OTHER_SYMBOL); - zend_string *const_CHAR_CATEGORY_OTHER_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_SYMBOL", sizeof("CHAR_CATEGORY_OTHER_SYMBOL") - 1, 1); + zend_string *const_CHAR_CATEGORY_OTHER_SYMBOL_name = zend_string_init_interned("CHAR_CATEGORY_OTHER_SYMBOL", sizeof("CHAR_CATEGORY_OTHER_SYMBOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_OTHER_SYMBOL_name, &const_CHAR_CATEGORY_OTHER_SYMBOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_OTHER_SYMBOL_name); + zend_string_release_ex(const_CHAR_CATEGORY_OTHER_SYMBOL_name, true); zval const_CHAR_CATEGORY_INITIAL_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_INITIAL_PUNCTUATION_value, U_INITIAL_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_INITIAL_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_INITIAL_PUNCTUATION", sizeof("CHAR_CATEGORY_INITIAL_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_INITIAL_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_INITIAL_PUNCTUATION", sizeof("CHAR_CATEGORY_INITIAL_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_INITIAL_PUNCTUATION_name, &const_CHAR_CATEGORY_INITIAL_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_INITIAL_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_INITIAL_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_FINAL_PUNCTUATION_value; ZVAL_LONG(&const_CHAR_CATEGORY_FINAL_PUNCTUATION_value, U_FINAL_PUNCTUATION); - zend_string *const_CHAR_CATEGORY_FINAL_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_FINAL_PUNCTUATION", sizeof("CHAR_CATEGORY_FINAL_PUNCTUATION") - 1, 1); + zend_string *const_CHAR_CATEGORY_FINAL_PUNCTUATION_name = zend_string_init_interned("CHAR_CATEGORY_FINAL_PUNCTUATION", sizeof("CHAR_CATEGORY_FINAL_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_FINAL_PUNCTUATION_name, &const_CHAR_CATEGORY_FINAL_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_FINAL_PUNCTUATION_name); + zend_string_release_ex(const_CHAR_CATEGORY_FINAL_PUNCTUATION_name, true); zval const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_value; ZVAL_LONG(&const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_value, U_CHAR_CATEGORY_COUNT); - zend_string *const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_name = zend_string_init_interned("CHAR_CATEGORY_CHAR_CATEGORY_COUNT", sizeof("CHAR_CATEGORY_CHAR_CATEGORY_COUNT") - 1, 1); + zend_string *const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_name = zend_string_init_interned("CHAR_CATEGORY_CHAR_CATEGORY_COUNT", sizeof("CHAR_CATEGORY_CHAR_CATEGORY_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_name, &const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_name); + zend_string_release_ex(const_CHAR_CATEGORY_CHAR_CATEGORY_COUNT_name, true); zval const_CHAR_DIRECTION_LEFT_TO_RIGHT_value; ZVAL_LONG(&const_CHAR_DIRECTION_LEFT_TO_RIGHT_value, U_LEFT_TO_RIGHT); - zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT") - 1, 1); + zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_LEFT_TO_RIGHT_name, &const_CHAR_DIRECTION_LEFT_TO_RIGHT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_LEFT_TO_RIGHT_name); + zend_string_release_ex(const_CHAR_DIRECTION_LEFT_TO_RIGHT_name, true); zval const_CHAR_DIRECTION_RIGHT_TO_LEFT_value; ZVAL_LONG(&const_CHAR_DIRECTION_RIGHT_TO_LEFT_value, U_RIGHT_TO_LEFT); - zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT") - 1, 1); + zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_RIGHT_TO_LEFT_name, &const_CHAR_DIRECTION_RIGHT_TO_LEFT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_RIGHT_TO_LEFT_name); + zend_string_release_ex(const_CHAR_DIRECTION_RIGHT_TO_LEFT_name, true); zval const_CHAR_DIRECTION_EUROPEAN_NUMBER_value; ZVAL_LONG(&const_CHAR_DIRECTION_EUROPEAN_NUMBER_value, U_EUROPEAN_NUMBER); - zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER") - 1, 1); + zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_EUROPEAN_NUMBER_name, &const_CHAR_DIRECTION_EUROPEAN_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_EUROPEAN_NUMBER_name); + zend_string_release_ex(const_CHAR_DIRECTION_EUROPEAN_NUMBER_name, true); zval const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_value; ZVAL_LONG(&const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_value, U_EUROPEAN_NUMBER_SEPARATOR); - zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR") - 1, 1); + zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_name, &const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_name); + zend_string_release_ex(const_CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR_name, true); zval const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_value; ZVAL_LONG(&const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_value, U_EUROPEAN_NUMBER_TERMINATOR); - zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR") - 1, 1); + zend_string *const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_name = zend_string_init_interned("CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR", sizeof("CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_name, &const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_name); + zend_string_release_ex(const_CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR_name, true); zval const_CHAR_DIRECTION_ARABIC_NUMBER_value; ZVAL_LONG(&const_CHAR_DIRECTION_ARABIC_NUMBER_value, U_ARABIC_NUMBER); - zend_string *const_CHAR_DIRECTION_ARABIC_NUMBER_name = zend_string_init_interned("CHAR_DIRECTION_ARABIC_NUMBER", sizeof("CHAR_DIRECTION_ARABIC_NUMBER") - 1, 1); + zend_string *const_CHAR_DIRECTION_ARABIC_NUMBER_name = zend_string_init_interned("CHAR_DIRECTION_ARABIC_NUMBER", sizeof("CHAR_DIRECTION_ARABIC_NUMBER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_ARABIC_NUMBER_name, &const_CHAR_DIRECTION_ARABIC_NUMBER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_ARABIC_NUMBER_name); + zend_string_release_ex(const_CHAR_DIRECTION_ARABIC_NUMBER_name, true); zval const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_value; ZVAL_LONG(&const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_value, U_COMMON_NUMBER_SEPARATOR); - zend_string *const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR", sizeof("CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR") - 1, 1); + zend_string *const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR", sizeof("CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_name, &const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_name); + zend_string_release_ex(const_CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR_name, true); zval const_CHAR_DIRECTION_BLOCK_SEPARATOR_value; ZVAL_LONG(&const_CHAR_DIRECTION_BLOCK_SEPARATOR_value, U_BLOCK_SEPARATOR); - zend_string *const_CHAR_DIRECTION_BLOCK_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_BLOCK_SEPARATOR", sizeof("CHAR_DIRECTION_BLOCK_SEPARATOR") - 1, 1); + zend_string *const_CHAR_DIRECTION_BLOCK_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_BLOCK_SEPARATOR", sizeof("CHAR_DIRECTION_BLOCK_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_BLOCK_SEPARATOR_name, &const_CHAR_DIRECTION_BLOCK_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_BLOCK_SEPARATOR_name); + zend_string_release_ex(const_CHAR_DIRECTION_BLOCK_SEPARATOR_name, true); zval const_CHAR_DIRECTION_SEGMENT_SEPARATOR_value; ZVAL_LONG(&const_CHAR_DIRECTION_SEGMENT_SEPARATOR_value, U_SEGMENT_SEPARATOR); - zend_string *const_CHAR_DIRECTION_SEGMENT_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_SEGMENT_SEPARATOR", sizeof("CHAR_DIRECTION_SEGMENT_SEPARATOR") - 1, 1); + zend_string *const_CHAR_DIRECTION_SEGMENT_SEPARATOR_name = zend_string_init_interned("CHAR_DIRECTION_SEGMENT_SEPARATOR", sizeof("CHAR_DIRECTION_SEGMENT_SEPARATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_SEGMENT_SEPARATOR_name, &const_CHAR_DIRECTION_SEGMENT_SEPARATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_SEGMENT_SEPARATOR_name); + zend_string_release_ex(const_CHAR_DIRECTION_SEGMENT_SEPARATOR_name, true); zval const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_value; ZVAL_LONG(&const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_value, U_WHITE_SPACE_NEUTRAL); - zend_string *const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_WHITE_SPACE_NEUTRAL", sizeof("CHAR_DIRECTION_WHITE_SPACE_NEUTRAL") - 1, 1); + zend_string *const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_WHITE_SPACE_NEUTRAL", sizeof("CHAR_DIRECTION_WHITE_SPACE_NEUTRAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_name, &const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_name); + zend_string_release_ex(const_CHAR_DIRECTION_WHITE_SPACE_NEUTRAL_name, true); zval const_CHAR_DIRECTION_OTHER_NEUTRAL_value; ZVAL_LONG(&const_CHAR_DIRECTION_OTHER_NEUTRAL_value, U_OTHER_NEUTRAL); - zend_string *const_CHAR_DIRECTION_OTHER_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_OTHER_NEUTRAL", sizeof("CHAR_DIRECTION_OTHER_NEUTRAL") - 1, 1); + zend_string *const_CHAR_DIRECTION_OTHER_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_OTHER_NEUTRAL", sizeof("CHAR_DIRECTION_OTHER_NEUTRAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_OTHER_NEUTRAL_name, &const_CHAR_DIRECTION_OTHER_NEUTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_OTHER_NEUTRAL_name); + zend_string_release_ex(const_CHAR_DIRECTION_OTHER_NEUTRAL_name, true); zval const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_value; ZVAL_LONG(&const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_value, U_LEFT_TO_RIGHT_EMBEDDING); - zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING") - 1, 1); + zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_name, &const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_name); + zend_string_release_ex(const_CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING_name, true); zval const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_value; ZVAL_LONG(&const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_value, U_LEFT_TO_RIGHT_OVERRIDE); - zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE") - 1, 1); + zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_name, &const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_name); + zend_string_release_ex(const_CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE_name, true); zval const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_value; ZVAL_LONG(&const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_value, U_RIGHT_TO_LEFT_ARABIC); - zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC") - 1, 1); + zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_name, &const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_name); + zend_string_release_ex(const_CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC_name, true); zval const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_value; ZVAL_LONG(&const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_value, U_RIGHT_TO_LEFT_EMBEDDING); - zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING") - 1, 1); + zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_name, &const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_name); + zend_string_release_ex(const_CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING_name, true); zval const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_value; ZVAL_LONG(&const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_value, U_RIGHT_TO_LEFT_OVERRIDE); - zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE") - 1, 1); + zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_name, &const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_name); + zend_string_release_ex(const_CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE_name, true); zval const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_value; ZVAL_LONG(&const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_value, U_POP_DIRECTIONAL_FORMAT); - zend_string *const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_name = zend_string_init_interned("CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT", sizeof("CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT") - 1, 1); + zend_string *const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_name = zend_string_init_interned("CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT", sizeof("CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_name, &const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_name); + zend_string_release_ex(const_CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT_name, true); zval const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_value; ZVAL_LONG(&const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_value, U_DIR_NON_SPACING_MARK); - zend_string *const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_name = zend_string_init_interned("CHAR_DIRECTION_DIR_NON_SPACING_MARK", sizeof("CHAR_DIRECTION_DIR_NON_SPACING_MARK") - 1, 1); + zend_string *const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_name = zend_string_init_interned("CHAR_DIRECTION_DIR_NON_SPACING_MARK", sizeof("CHAR_DIRECTION_DIR_NON_SPACING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_name, &const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_name); + zend_string_release_ex(const_CHAR_DIRECTION_DIR_NON_SPACING_MARK_name, true); zval const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_value; ZVAL_LONG(&const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_value, U_BOUNDARY_NEUTRAL); - zend_string *const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_BOUNDARY_NEUTRAL", sizeof("CHAR_DIRECTION_BOUNDARY_NEUTRAL") - 1, 1); + zend_string *const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_name = zend_string_init_interned("CHAR_DIRECTION_BOUNDARY_NEUTRAL", sizeof("CHAR_DIRECTION_BOUNDARY_NEUTRAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_name, &const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_name); + zend_string_release_ex(const_CHAR_DIRECTION_BOUNDARY_NEUTRAL_name, true); zval const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_value; ZVAL_LONG(&const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_value, U_FIRST_STRONG_ISOLATE); - zend_string *const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_FIRST_STRONG_ISOLATE", sizeof("CHAR_DIRECTION_FIRST_STRONG_ISOLATE") - 1, 1); + zend_string *const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_FIRST_STRONG_ISOLATE", sizeof("CHAR_DIRECTION_FIRST_STRONG_ISOLATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_name, &const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_name); + zend_string_release_ex(const_CHAR_DIRECTION_FIRST_STRONG_ISOLATE_name, true); zval const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_value; ZVAL_LONG(&const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_value, U_LEFT_TO_RIGHT_ISOLATE); - zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE") - 1, 1); + zend_string *const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE", sizeof("CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_name, &const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_name); + zend_string_release_ex(const_CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE_name, true); zval const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_value; ZVAL_LONG(&const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_value, U_RIGHT_TO_LEFT_ISOLATE); - zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE") - 1, 1); + zend_string *const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE", sizeof("CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_name, &const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_name); + zend_string_release_ex(const_CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE_name, true); zval const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_value; ZVAL_LONG(&const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_value, U_POP_DIRECTIONAL_ISOLATE); - zend_string *const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE", sizeof("CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE") - 1, 1); + zend_string *const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_name = zend_string_init_interned("CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE", sizeof("CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_name, &const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_name); + zend_string_release_ex(const_CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE_name, true); zval const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_value; ZVAL_LONG(&const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_value, U_CHAR_DIRECTION_COUNT); - zend_string *const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_name = zend_string_init_interned("CHAR_DIRECTION_CHAR_DIRECTION_COUNT", sizeof("CHAR_DIRECTION_CHAR_DIRECTION_COUNT") - 1, 1); + zend_string *const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_name = zend_string_init_interned("CHAR_DIRECTION_CHAR_DIRECTION_COUNT", sizeof("CHAR_DIRECTION_CHAR_DIRECTION_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_name, &const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_name); + zend_string_release_ex(const_CHAR_DIRECTION_CHAR_DIRECTION_COUNT_name, true); zval const_BLOCK_CODE_NO_BLOCK_value; ZVAL_LONG(&const_BLOCK_CODE_NO_BLOCK_value, UBLOCK_NO_BLOCK); - zend_string *const_BLOCK_CODE_NO_BLOCK_name = zend_string_init_interned("BLOCK_CODE_NO_BLOCK", sizeof("BLOCK_CODE_NO_BLOCK") - 1, 1); + zend_string *const_BLOCK_CODE_NO_BLOCK_name = zend_string_init_interned("BLOCK_CODE_NO_BLOCK", sizeof("BLOCK_CODE_NO_BLOCK") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_NO_BLOCK_name, &const_BLOCK_CODE_NO_BLOCK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_NO_BLOCK_name); + zend_string_release_ex(const_BLOCK_CODE_NO_BLOCK_name, true); zval const_BLOCK_CODE_BASIC_LATIN_value; ZVAL_LONG(&const_BLOCK_CODE_BASIC_LATIN_value, UBLOCK_BASIC_LATIN); - zend_string *const_BLOCK_CODE_BASIC_LATIN_name = zend_string_init_interned("BLOCK_CODE_BASIC_LATIN", sizeof("BLOCK_CODE_BASIC_LATIN") - 1, 1); + zend_string *const_BLOCK_CODE_BASIC_LATIN_name = zend_string_init_interned("BLOCK_CODE_BASIC_LATIN", sizeof("BLOCK_CODE_BASIC_LATIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BASIC_LATIN_name, &const_BLOCK_CODE_BASIC_LATIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BASIC_LATIN_name); + zend_string_release_ex(const_BLOCK_CODE_BASIC_LATIN_name, true); zval const_BLOCK_CODE_LATIN_1_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_1_SUPPLEMENT_value, UBLOCK_LATIN_1_SUPPLEMENT); - zend_string *const_BLOCK_CODE_LATIN_1_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_LATIN_1_SUPPLEMENT", sizeof("BLOCK_CODE_LATIN_1_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_1_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_LATIN_1_SUPPLEMENT", sizeof("BLOCK_CODE_LATIN_1_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_1_SUPPLEMENT_name, &const_BLOCK_CODE_LATIN_1_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_1_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_1_SUPPLEMENT_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_A_value, UBLOCK_LATIN_EXTENDED_A); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_A", sizeof("BLOCK_CODE_LATIN_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_A", sizeof("BLOCK_CODE_LATIN_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_A_name, &const_BLOCK_CODE_LATIN_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_A_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_B_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_B_value, UBLOCK_LATIN_EXTENDED_B); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_B", sizeof("BLOCK_CODE_LATIN_EXTENDED_B") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_B", sizeof("BLOCK_CODE_LATIN_EXTENDED_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_B_name, &const_BLOCK_CODE_LATIN_EXTENDED_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_B_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_B_name, true); zval const_BLOCK_CODE_IPA_EXTENSIONS_value; ZVAL_LONG(&const_BLOCK_CODE_IPA_EXTENSIONS_value, UBLOCK_IPA_EXTENSIONS); - zend_string *const_BLOCK_CODE_IPA_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_IPA_EXTENSIONS", sizeof("BLOCK_CODE_IPA_EXTENSIONS") - 1, 1); + zend_string *const_BLOCK_CODE_IPA_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_IPA_EXTENSIONS", sizeof("BLOCK_CODE_IPA_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_IPA_EXTENSIONS_name, &const_BLOCK_CODE_IPA_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_IPA_EXTENSIONS_name); + zend_string_release_ex(const_BLOCK_CODE_IPA_EXTENSIONS_name, true); zval const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_value; ZVAL_LONG(&const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_value, UBLOCK_SPACING_MODIFIER_LETTERS); - zend_string *const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_name = zend_string_init_interned("BLOCK_CODE_SPACING_MODIFIER_LETTERS", sizeof("BLOCK_CODE_SPACING_MODIFIER_LETTERS") - 1, 1); + zend_string *const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_name = zend_string_init_interned("BLOCK_CODE_SPACING_MODIFIER_LETTERS", sizeof("BLOCK_CODE_SPACING_MODIFIER_LETTERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_name, &const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_name); + zend_string_release_ex(const_BLOCK_CODE_SPACING_MODIFIER_LETTERS_name, true); zval const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_value; ZVAL_LONG(&const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_value, UBLOCK_COMBINING_DIACRITICAL_MARKS); - zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS") - 1, 1); + zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_name, &const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_name); + zend_string_release_ex(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_name, true); zval const_BLOCK_CODE_GREEK_value; ZVAL_LONG(&const_BLOCK_CODE_GREEK_value, UBLOCK_GREEK); - zend_string *const_BLOCK_CODE_GREEK_name = zend_string_init_interned("BLOCK_CODE_GREEK", sizeof("BLOCK_CODE_GREEK") - 1, 1); + zend_string *const_BLOCK_CODE_GREEK_name = zend_string_init_interned("BLOCK_CODE_GREEK", sizeof("BLOCK_CODE_GREEK") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GREEK_name, &const_BLOCK_CODE_GREEK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GREEK_name); + zend_string_release_ex(const_BLOCK_CODE_GREEK_name, true); zval const_BLOCK_CODE_CYRILLIC_value; ZVAL_LONG(&const_BLOCK_CODE_CYRILLIC_value, UBLOCK_CYRILLIC); - zend_string *const_BLOCK_CODE_CYRILLIC_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC", sizeof("BLOCK_CODE_CYRILLIC") - 1, 1); + zend_string *const_BLOCK_CODE_CYRILLIC_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC", sizeof("BLOCK_CODE_CYRILLIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYRILLIC_name, &const_BLOCK_CODE_CYRILLIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYRILLIC_name); + zend_string_release_ex(const_BLOCK_CODE_CYRILLIC_name, true); zval const_BLOCK_CODE_ARMENIAN_value; ZVAL_LONG(&const_BLOCK_CODE_ARMENIAN_value, UBLOCK_ARMENIAN); - zend_string *const_BLOCK_CODE_ARMENIAN_name = zend_string_init_interned("BLOCK_CODE_ARMENIAN", sizeof("BLOCK_CODE_ARMENIAN") - 1, 1); + zend_string *const_BLOCK_CODE_ARMENIAN_name = zend_string_init_interned("BLOCK_CODE_ARMENIAN", sizeof("BLOCK_CODE_ARMENIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARMENIAN_name, &const_BLOCK_CODE_ARMENIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARMENIAN_name); + zend_string_release_ex(const_BLOCK_CODE_ARMENIAN_name, true); zval const_BLOCK_CODE_HEBREW_value; ZVAL_LONG(&const_BLOCK_CODE_HEBREW_value, UBLOCK_HEBREW); - zend_string *const_BLOCK_CODE_HEBREW_name = zend_string_init_interned("BLOCK_CODE_HEBREW", sizeof("BLOCK_CODE_HEBREW") - 1, 1); + zend_string *const_BLOCK_CODE_HEBREW_name = zend_string_init_interned("BLOCK_CODE_HEBREW", sizeof("BLOCK_CODE_HEBREW") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HEBREW_name, &const_BLOCK_CODE_HEBREW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HEBREW_name); + zend_string_release_ex(const_BLOCK_CODE_HEBREW_name, true); zval const_BLOCK_CODE_ARABIC_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_value, UBLOCK_ARABIC); - zend_string *const_BLOCK_CODE_ARABIC_name = zend_string_init_interned("BLOCK_CODE_ARABIC", sizeof("BLOCK_CODE_ARABIC") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_name = zend_string_init_interned("BLOCK_CODE_ARABIC", sizeof("BLOCK_CODE_ARABIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_name, &const_BLOCK_CODE_ARABIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_name, true); zval const_BLOCK_CODE_SYRIAC_value; ZVAL_LONG(&const_BLOCK_CODE_SYRIAC_value, UBLOCK_SYRIAC); - zend_string *const_BLOCK_CODE_SYRIAC_name = zend_string_init_interned("BLOCK_CODE_SYRIAC", sizeof("BLOCK_CODE_SYRIAC") - 1, 1); + zend_string *const_BLOCK_CODE_SYRIAC_name = zend_string_init_interned("BLOCK_CODE_SYRIAC", sizeof("BLOCK_CODE_SYRIAC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SYRIAC_name, &const_BLOCK_CODE_SYRIAC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SYRIAC_name); + zend_string_release_ex(const_BLOCK_CODE_SYRIAC_name, true); zval const_BLOCK_CODE_THAANA_value; ZVAL_LONG(&const_BLOCK_CODE_THAANA_value, UBLOCK_THAANA); - zend_string *const_BLOCK_CODE_THAANA_name = zend_string_init_interned("BLOCK_CODE_THAANA", sizeof("BLOCK_CODE_THAANA") - 1, 1); + zend_string *const_BLOCK_CODE_THAANA_name = zend_string_init_interned("BLOCK_CODE_THAANA", sizeof("BLOCK_CODE_THAANA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_THAANA_name, &const_BLOCK_CODE_THAANA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_THAANA_name); + zend_string_release_ex(const_BLOCK_CODE_THAANA_name, true); zval const_BLOCK_CODE_DEVANAGARI_value; ZVAL_LONG(&const_BLOCK_CODE_DEVANAGARI_value, UBLOCK_DEVANAGARI); - zend_string *const_BLOCK_CODE_DEVANAGARI_name = zend_string_init_interned("BLOCK_CODE_DEVANAGARI", sizeof("BLOCK_CODE_DEVANAGARI") - 1, 1); + zend_string *const_BLOCK_CODE_DEVANAGARI_name = zend_string_init_interned("BLOCK_CODE_DEVANAGARI", sizeof("BLOCK_CODE_DEVANAGARI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DEVANAGARI_name, &const_BLOCK_CODE_DEVANAGARI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DEVANAGARI_name); + zend_string_release_ex(const_BLOCK_CODE_DEVANAGARI_name, true); zval const_BLOCK_CODE_BENGALI_value; ZVAL_LONG(&const_BLOCK_CODE_BENGALI_value, UBLOCK_BENGALI); - zend_string *const_BLOCK_CODE_BENGALI_name = zend_string_init_interned("BLOCK_CODE_BENGALI", sizeof("BLOCK_CODE_BENGALI") - 1, 1); + zend_string *const_BLOCK_CODE_BENGALI_name = zend_string_init_interned("BLOCK_CODE_BENGALI", sizeof("BLOCK_CODE_BENGALI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BENGALI_name, &const_BLOCK_CODE_BENGALI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BENGALI_name); + zend_string_release_ex(const_BLOCK_CODE_BENGALI_name, true); zval const_BLOCK_CODE_GURMUKHI_value; ZVAL_LONG(&const_BLOCK_CODE_GURMUKHI_value, UBLOCK_GURMUKHI); - zend_string *const_BLOCK_CODE_GURMUKHI_name = zend_string_init_interned("BLOCK_CODE_GURMUKHI", sizeof("BLOCK_CODE_GURMUKHI") - 1, 1); + zend_string *const_BLOCK_CODE_GURMUKHI_name = zend_string_init_interned("BLOCK_CODE_GURMUKHI", sizeof("BLOCK_CODE_GURMUKHI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GURMUKHI_name, &const_BLOCK_CODE_GURMUKHI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GURMUKHI_name); + zend_string_release_ex(const_BLOCK_CODE_GURMUKHI_name, true); zval const_BLOCK_CODE_GUJARATI_value; ZVAL_LONG(&const_BLOCK_CODE_GUJARATI_value, UBLOCK_GUJARATI); - zend_string *const_BLOCK_CODE_GUJARATI_name = zend_string_init_interned("BLOCK_CODE_GUJARATI", sizeof("BLOCK_CODE_GUJARATI") - 1, 1); + zend_string *const_BLOCK_CODE_GUJARATI_name = zend_string_init_interned("BLOCK_CODE_GUJARATI", sizeof("BLOCK_CODE_GUJARATI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GUJARATI_name, &const_BLOCK_CODE_GUJARATI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GUJARATI_name); + zend_string_release_ex(const_BLOCK_CODE_GUJARATI_name, true); zval const_BLOCK_CODE_ORIYA_value; ZVAL_LONG(&const_BLOCK_CODE_ORIYA_value, UBLOCK_ORIYA); - zend_string *const_BLOCK_CODE_ORIYA_name = zend_string_init_interned("BLOCK_CODE_ORIYA", sizeof("BLOCK_CODE_ORIYA") - 1, 1); + zend_string *const_BLOCK_CODE_ORIYA_name = zend_string_init_interned("BLOCK_CODE_ORIYA", sizeof("BLOCK_CODE_ORIYA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ORIYA_name, &const_BLOCK_CODE_ORIYA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ORIYA_name); + zend_string_release_ex(const_BLOCK_CODE_ORIYA_name, true); zval const_BLOCK_CODE_TAMIL_value; ZVAL_LONG(&const_BLOCK_CODE_TAMIL_value, UBLOCK_TAMIL); - zend_string *const_BLOCK_CODE_TAMIL_name = zend_string_init_interned("BLOCK_CODE_TAMIL", sizeof("BLOCK_CODE_TAMIL") - 1, 1); + zend_string *const_BLOCK_CODE_TAMIL_name = zend_string_init_interned("BLOCK_CODE_TAMIL", sizeof("BLOCK_CODE_TAMIL") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAMIL_name, &const_BLOCK_CODE_TAMIL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAMIL_name); + zend_string_release_ex(const_BLOCK_CODE_TAMIL_name, true); zval const_BLOCK_CODE_TELUGU_value; ZVAL_LONG(&const_BLOCK_CODE_TELUGU_value, UBLOCK_TELUGU); - zend_string *const_BLOCK_CODE_TELUGU_name = zend_string_init_interned("BLOCK_CODE_TELUGU", sizeof("BLOCK_CODE_TELUGU") - 1, 1); + zend_string *const_BLOCK_CODE_TELUGU_name = zend_string_init_interned("BLOCK_CODE_TELUGU", sizeof("BLOCK_CODE_TELUGU") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TELUGU_name, &const_BLOCK_CODE_TELUGU_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TELUGU_name); + zend_string_release_ex(const_BLOCK_CODE_TELUGU_name, true); zval const_BLOCK_CODE_KANNADA_value; ZVAL_LONG(&const_BLOCK_CODE_KANNADA_value, UBLOCK_KANNADA); - zend_string *const_BLOCK_CODE_KANNADA_name = zend_string_init_interned("BLOCK_CODE_KANNADA", sizeof("BLOCK_CODE_KANNADA") - 1, 1); + zend_string *const_BLOCK_CODE_KANNADA_name = zend_string_init_interned("BLOCK_CODE_KANNADA", sizeof("BLOCK_CODE_KANNADA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KANNADA_name, &const_BLOCK_CODE_KANNADA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KANNADA_name); + zend_string_release_ex(const_BLOCK_CODE_KANNADA_name, true); zval const_BLOCK_CODE_MALAYALAM_value; ZVAL_LONG(&const_BLOCK_CODE_MALAYALAM_value, UBLOCK_MALAYALAM); - zend_string *const_BLOCK_CODE_MALAYALAM_name = zend_string_init_interned("BLOCK_CODE_MALAYALAM", sizeof("BLOCK_CODE_MALAYALAM") - 1, 1); + zend_string *const_BLOCK_CODE_MALAYALAM_name = zend_string_init_interned("BLOCK_CODE_MALAYALAM", sizeof("BLOCK_CODE_MALAYALAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MALAYALAM_name, &const_BLOCK_CODE_MALAYALAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MALAYALAM_name); + zend_string_release_ex(const_BLOCK_CODE_MALAYALAM_name, true); zval const_BLOCK_CODE_SINHALA_value; ZVAL_LONG(&const_BLOCK_CODE_SINHALA_value, UBLOCK_SINHALA); - zend_string *const_BLOCK_CODE_SINHALA_name = zend_string_init_interned("BLOCK_CODE_SINHALA", sizeof("BLOCK_CODE_SINHALA") - 1, 1); + zend_string *const_BLOCK_CODE_SINHALA_name = zend_string_init_interned("BLOCK_CODE_SINHALA", sizeof("BLOCK_CODE_SINHALA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SINHALA_name, &const_BLOCK_CODE_SINHALA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SINHALA_name); + zend_string_release_ex(const_BLOCK_CODE_SINHALA_name, true); zval const_BLOCK_CODE_THAI_value; ZVAL_LONG(&const_BLOCK_CODE_THAI_value, UBLOCK_THAI); - zend_string *const_BLOCK_CODE_THAI_name = zend_string_init_interned("BLOCK_CODE_THAI", sizeof("BLOCK_CODE_THAI") - 1, 1); + zend_string *const_BLOCK_CODE_THAI_name = zend_string_init_interned("BLOCK_CODE_THAI", sizeof("BLOCK_CODE_THAI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_THAI_name, &const_BLOCK_CODE_THAI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_THAI_name); + zend_string_release_ex(const_BLOCK_CODE_THAI_name, true); zval const_BLOCK_CODE_LAO_value; ZVAL_LONG(&const_BLOCK_CODE_LAO_value, UBLOCK_LAO); - zend_string *const_BLOCK_CODE_LAO_name = zend_string_init_interned("BLOCK_CODE_LAO", sizeof("BLOCK_CODE_LAO") - 1, 1); + zend_string *const_BLOCK_CODE_LAO_name = zend_string_init_interned("BLOCK_CODE_LAO", sizeof("BLOCK_CODE_LAO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LAO_name, &const_BLOCK_CODE_LAO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LAO_name); + zend_string_release_ex(const_BLOCK_CODE_LAO_name, true); zval const_BLOCK_CODE_TIBETAN_value; ZVAL_LONG(&const_BLOCK_CODE_TIBETAN_value, UBLOCK_TIBETAN); - zend_string *const_BLOCK_CODE_TIBETAN_name = zend_string_init_interned("BLOCK_CODE_TIBETAN", sizeof("BLOCK_CODE_TIBETAN") - 1, 1); + zend_string *const_BLOCK_CODE_TIBETAN_name = zend_string_init_interned("BLOCK_CODE_TIBETAN", sizeof("BLOCK_CODE_TIBETAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TIBETAN_name, &const_BLOCK_CODE_TIBETAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TIBETAN_name); + zend_string_release_ex(const_BLOCK_CODE_TIBETAN_name, true); zval const_BLOCK_CODE_MYANMAR_value; ZVAL_LONG(&const_BLOCK_CODE_MYANMAR_value, UBLOCK_MYANMAR); - zend_string *const_BLOCK_CODE_MYANMAR_name = zend_string_init_interned("BLOCK_CODE_MYANMAR", sizeof("BLOCK_CODE_MYANMAR") - 1, 1); + zend_string *const_BLOCK_CODE_MYANMAR_name = zend_string_init_interned("BLOCK_CODE_MYANMAR", sizeof("BLOCK_CODE_MYANMAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MYANMAR_name, &const_BLOCK_CODE_MYANMAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MYANMAR_name); + zend_string_release_ex(const_BLOCK_CODE_MYANMAR_name, true); zval const_BLOCK_CODE_GEORGIAN_value; ZVAL_LONG(&const_BLOCK_CODE_GEORGIAN_value, UBLOCK_GEORGIAN); - zend_string *const_BLOCK_CODE_GEORGIAN_name = zend_string_init_interned("BLOCK_CODE_GEORGIAN", sizeof("BLOCK_CODE_GEORGIAN") - 1, 1); + zend_string *const_BLOCK_CODE_GEORGIAN_name = zend_string_init_interned("BLOCK_CODE_GEORGIAN", sizeof("BLOCK_CODE_GEORGIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GEORGIAN_name, &const_BLOCK_CODE_GEORGIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GEORGIAN_name); + zend_string_release_ex(const_BLOCK_CODE_GEORGIAN_name, true); zval const_BLOCK_CODE_HANGUL_JAMO_value; ZVAL_LONG(&const_BLOCK_CODE_HANGUL_JAMO_value, UBLOCK_HANGUL_JAMO); - zend_string *const_BLOCK_CODE_HANGUL_JAMO_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO", sizeof("BLOCK_CODE_HANGUL_JAMO") - 1, 1); + zend_string *const_BLOCK_CODE_HANGUL_JAMO_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO", sizeof("BLOCK_CODE_HANGUL_JAMO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANGUL_JAMO_name, &const_BLOCK_CODE_HANGUL_JAMO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANGUL_JAMO_name); + zend_string_release_ex(const_BLOCK_CODE_HANGUL_JAMO_name, true); zval const_BLOCK_CODE_ETHIOPIC_value; ZVAL_LONG(&const_BLOCK_CODE_ETHIOPIC_value, UBLOCK_ETHIOPIC); - zend_string *const_BLOCK_CODE_ETHIOPIC_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC", sizeof("BLOCK_CODE_ETHIOPIC") - 1, 1); + zend_string *const_BLOCK_CODE_ETHIOPIC_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC", sizeof("BLOCK_CODE_ETHIOPIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ETHIOPIC_name, &const_BLOCK_CODE_ETHIOPIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ETHIOPIC_name); + zend_string_release_ex(const_BLOCK_CODE_ETHIOPIC_name, true); zval const_BLOCK_CODE_CHEROKEE_value; ZVAL_LONG(&const_BLOCK_CODE_CHEROKEE_value, UBLOCK_CHEROKEE); - zend_string *const_BLOCK_CODE_CHEROKEE_name = zend_string_init_interned("BLOCK_CODE_CHEROKEE", sizeof("BLOCK_CODE_CHEROKEE") - 1, 1); + zend_string *const_BLOCK_CODE_CHEROKEE_name = zend_string_init_interned("BLOCK_CODE_CHEROKEE", sizeof("BLOCK_CODE_CHEROKEE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CHEROKEE_name, &const_BLOCK_CODE_CHEROKEE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CHEROKEE_name); + zend_string_release_ex(const_BLOCK_CODE_CHEROKEE_name, true); zval const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_value; ZVAL_LONG(&const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_value, UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS); - zend_string *const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_name = zend_string_init_interned("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS", sizeof("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS") - 1, 1); + zend_string *const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_name = zend_string_init_interned("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS", sizeof("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_name, &const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_name); + zend_string_release_ex(const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_name, true); zval const_BLOCK_CODE_OGHAM_value; ZVAL_LONG(&const_BLOCK_CODE_OGHAM_value, UBLOCK_OGHAM); - zend_string *const_BLOCK_CODE_OGHAM_name = zend_string_init_interned("BLOCK_CODE_OGHAM", sizeof("BLOCK_CODE_OGHAM") - 1, 1); + zend_string *const_BLOCK_CODE_OGHAM_name = zend_string_init_interned("BLOCK_CODE_OGHAM", sizeof("BLOCK_CODE_OGHAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OGHAM_name, &const_BLOCK_CODE_OGHAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OGHAM_name); + zend_string_release_ex(const_BLOCK_CODE_OGHAM_name, true); zval const_BLOCK_CODE_RUNIC_value; ZVAL_LONG(&const_BLOCK_CODE_RUNIC_value, UBLOCK_RUNIC); - zend_string *const_BLOCK_CODE_RUNIC_name = zend_string_init_interned("BLOCK_CODE_RUNIC", sizeof("BLOCK_CODE_RUNIC") - 1, 1); + zend_string *const_BLOCK_CODE_RUNIC_name = zend_string_init_interned("BLOCK_CODE_RUNIC", sizeof("BLOCK_CODE_RUNIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_RUNIC_name, &const_BLOCK_CODE_RUNIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_RUNIC_name); + zend_string_release_ex(const_BLOCK_CODE_RUNIC_name, true); zval const_BLOCK_CODE_KHMER_value; ZVAL_LONG(&const_BLOCK_CODE_KHMER_value, UBLOCK_KHMER); - zend_string *const_BLOCK_CODE_KHMER_name = zend_string_init_interned("BLOCK_CODE_KHMER", sizeof("BLOCK_CODE_KHMER") - 1, 1); + zend_string *const_BLOCK_CODE_KHMER_name = zend_string_init_interned("BLOCK_CODE_KHMER", sizeof("BLOCK_CODE_KHMER") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KHMER_name, &const_BLOCK_CODE_KHMER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KHMER_name); + zend_string_release_ex(const_BLOCK_CODE_KHMER_name, true); zval const_BLOCK_CODE_MONGOLIAN_value; ZVAL_LONG(&const_BLOCK_CODE_MONGOLIAN_value, UBLOCK_MONGOLIAN); - zend_string *const_BLOCK_CODE_MONGOLIAN_name = zend_string_init_interned("BLOCK_CODE_MONGOLIAN", sizeof("BLOCK_CODE_MONGOLIAN") - 1, 1); + zend_string *const_BLOCK_CODE_MONGOLIAN_name = zend_string_init_interned("BLOCK_CODE_MONGOLIAN", sizeof("BLOCK_CODE_MONGOLIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MONGOLIAN_name, &const_BLOCK_CODE_MONGOLIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MONGOLIAN_name); + zend_string_release_ex(const_BLOCK_CODE_MONGOLIAN_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_value, UBLOCK_LATIN_EXTENDED_ADDITIONAL); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL", sizeof("BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL", sizeof("BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_name, &const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_ADDITIONAL_name, true); zval const_BLOCK_CODE_GREEK_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_GREEK_EXTENDED_value, UBLOCK_GREEK_EXTENDED); - zend_string *const_BLOCK_CODE_GREEK_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_GREEK_EXTENDED", sizeof("BLOCK_CODE_GREEK_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_GREEK_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_GREEK_EXTENDED", sizeof("BLOCK_CODE_GREEK_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GREEK_EXTENDED_name, &const_BLOCK_CODE_GREEK_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GREEK_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_GREEK_EXTENDED_name, true); zval const_BLOCK_CODE_GENERAL_PUNCTUATION_value; ZVAL_LONG(&const_BLOCK_CODE_GENERAL_PUNCTUATION_value, UBLOCK_GENERAL_PUNCTUATION); - zend_string *const_BLOCK_CODE_GENERAL_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_GENERAL_PUNCTUATION", sizeof("BLOCK_CODE_GENERAL_PUNCTUATION") - 1, 1); + zend_string *const_BLOCK_CODE_GENERAL_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_GENERAL_PUNCTUATION", sizeof("BLOCK_CODE_GENERAL_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GENERAL_PUNCTUATION_name, &const_BLOCK_CODE_GENERAL_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GENERAL_PUNCTUATION_name); + zend_string_release_ex(const_BLOCK_CODE_GENERAL_PUNCTUATION_name, true); zval const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_value; ZVAL_LONG(&const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_value, UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS); - zend_string *const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_name = zend_string_init_interned("BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS", sizeof("BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS") - 1, 1); + zend_string *const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_name = zend_string_init_interned("BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS", sizeof("BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_name, &const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_name); + zend_string_release_ex(const_BLOCK_CODE_SUPERSCRIPTS_AND_SUBSCRIPTS_name, true); zval const_BLOCK_CODE_CURRENCY_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_CURRENCY_SYMBOLS_value, UBLOCK_CURRENCY_SYMBOLS); - zend_string *const_BLOCK_CODE_CURRENCY_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_CURRENCY_SYMBOLS", sizeof("BLOCK_CODE_CURRENCY_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_CURRENCY_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_CURRENCY_SYMBOLS", sizeof("BLOCK_CODE_CURRENCY_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CURRENCY_SYMBOLS_name, &const_BLOCK_CODE_CURRENCY_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CURRENCY_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_CURRENCY_SYMBOLS_name, true); zval const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_value, UBLOCK_COMBINING_MARKS_FOR_SYMBOLS); - zend_string *const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS", sizeof("BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS", sizeof("BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_name, &const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_COMBINING_MARKS_FOR_SYMBOLS_name, true); zval const_BLOCK_CODE_LETTERLIKE_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_LETTERLIKE_SYMBOLS_value, UBLOCK_LETTERLIKE_SYMBOLS); - zend_string *const_BLOCK_CODE_LETTERLIKE_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_LETTERLIKE_SYMBOLS", sizeof("BLOCK_CODE_LETTERLIKE_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_LETTERLIKE_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_LETTERLIKE_SYMBOLS", sizeof("BLOCK_CODE_LETTERLIKE_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LETTERLIKE_SYMBOLS_name, &const_BLOCK_CODE_LETTERLIKE_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LETTERLIKE_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_LETTERLIKE_SYMBOLS_name, true); zval const_BLOCK_CODE_NUMBER_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_NUMBER_FORMS_value, UBLOCK_NUMBER_FORMS); - zend_string *const_BLOCK_CODE_NUMBER_FORMS_name = zend_string_init_interned("BLOCK_CODE_NUMBER_FORMS", sizeof("BLOCK_CODE_NUMBER_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_NUMBER_FORMS_name = zend_string_init_interned("BLOCK_CODE_NUMBER_FORMS", sizeof("BLOCK_CODE_NUMBER_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_NUMBER_FORMS_name, &const_BLOCK_CODE_NUMBER_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_NUMBER_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_NUMBER_FORMS_name, true); zval const_BLOCK_CODE_ARROWS_value; ZVAL_LONG(&const_BLOCK_CODE_ARROWS_value, UBLOCK_ARROWS); - zend_string *const_BLOCK_CODE_ARROWS_name = zend_string_init_interned("BLOCK_CODE_ARROWS", sizeof("BLOCK_CODE_ARROWS") - 1, 1); + zend_string *const_BLOCK_CODE_ARROWS_name = zend_string_init_interned("BLOCK_CODE_ARROWS", sizeof("BLOCK_CODE_ARROWS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARROWS_name, &const_BLOCK_CODE_ARROWS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARROWS_name); + zend_string_release_ex(const_BLOCK_CODE_ARROWS_name, true); zval const_BLOCK_CODE_MATHEMATICAL_OPERATORS_value; ZVAL_LONG(&const_BLOCK_CODE_MATHEMATICAL_OPERATORS_value, UBLOCK_MATHEMATICAL_OPERATORS); - zend_string *const_BLOCK_CODE_MATHEMATICAL_OPERATORS_name = zend_string_init_interned("BLOCK_CODE_MATHEMATICAL_OPERATORS", sizeof("BLOCK_CODE_MATHEMATICAL_OPERATORS") - 1, 1); + zend_string *const_BLOCK_CODE_MATHEMATICAL_OPERATORS_name = zend_string_init_interned("BLOCK_CODE_MATHEMATICAL_OPERATORS", sizeof("BLOCK_CODE_MATHEMATICAL_OPERATORS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MATHEMATICAL_OPERATORS_name, &const_BLOCK_CODE_MATHEMATICAL_OPERATORS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MATHEMATICAL_OPERATORS_name); + zend_string_release_ex(const_BLOCK_CODE_MATHEMATICAL_OPERATORS_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_value, UBLOCK_MISCELLANEOUS_TECHNICAL); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_TECHNICAL", sizeof("BLOCK_CODE_MISCELLANEOUS_TECHNICAL") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_TECHNICAL", sizeof("BLOCK_CODE_MISCELLANEOUS_TECHNICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_name, &const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_TECHNICAL_name, true); zval const_BLOCK_CODE_CONTROL_PICTURES_value; ZVAL_LONG(&const_BLOCK_CODE_CONTROL_PICTURES_value, UBLOCK_CONTROL_PICTURES); - zend_string *const_BLOCK_CODE_CONTROL_PICTURES_name = zend_string_init_interned("BLOCK_CODE_CONTROL_PICTURES", sizeof("BLOCK_CODE_CONTROL_PICTURES") - 1, 1); + zend_string *const_BLOCK_CODE_CONTROL_PICTURES_name = zend_string_init_interned("BLOCK_CODE_CONTROL_PICTURES", sizeof("BLOCK_CODE_CONTROL_PICTURES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CONTROL_PICTURES_name, &const_BLOCK_CODE_CONTROL_PICTURES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CONTROL_PICTURES_name); + zend_string_release_ex(const_BLOCK_CODE_CONTROL_PICTURES_name, true); zval const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_value; ZVAL_LONG(&const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_value, UBLOCK_OPTICAL_CHARACTER_RECOGNITION); - zend_string *const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_name = zend_string_init_interned("BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION", sizeof("BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION") - 1, 1); + zend_string *const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_name = zend_string_init_interned("BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION", sizeof("BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_name, &const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_name); + zend_string_release_ex(const_BLOCK_CODE_OPTICAL_CHARACTER_RECOGNITION_name, true); zval const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_value; ZVAL_LONG(&const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_value, UBLOCK_ENCLOSED_ALPHANUMERICS); - zend_string *const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_ALPHANUMERICS", sizeof("BLOCK_CODE_ENCLOSED_ALPHANUMERICS") - 1, 1); + zend_string *const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_ALPHANUMERICS", sizeof("BLOCK_CODE_ENCLOSED_ALPHANUMERICS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_name, &const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_name); + zend_string_release_ex(const_BLOCK_CODE_ENCLOSED_ALPHANUMERICS_name, true); zval const_BLOCK_CODE_BOX_DRAWING_value; ZVAL_LONG(&const_BLOCK_CODE_BOX_DRAWING_value, UBLOCK_BOX_DRAWING); - zend_string *const_BLOCK_CODE_BOX_DRAWING_name = zend_string_init_interned("BLOCK_CODE_BOX_DRAWING", sizeof("BLOCK_CODE_BOX_DRAWING") - 1, 1); + zend_string *const_BLOCK_CODE_BOX_DRAWING_name = zend_string_init_interned("BLOCK_CODE_BOX_DRAWING", sizeof("BLOCK_CODE_BOX_DRAWING") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BOX_DRAWING_name, &const_BLOCK_CODE_BOX_DRAWING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BOX_DRAWING_name); + zend_string_release_ex(const_BLOCK_CODE_BOX_DRAWING_name, true); zval const_BLOCK_CODE_BLOCK_ELEMENTS_value; ZVAL_LONG(&const_BLOCK_CODE_BLOCK_ELEMENTS_value, UBLOCK_BLOCK_ELEMENTS); - zend_string *const_BLOCK_CODE_BLOCK_ELEMENTS_name = zend_string_init_interned("BLOCK_CODE_BLOCK_ELEMENTS", sizeof("BLOCK_CODE_BLOCK_ELEMENTS") - 1, 1); + zend_string *const_BLOCK_CODE_BLOCK_ELEMENTS_name = zend_string_init_interned("BLOCK_CODE_BLOCK_ELEMENTS", sizeof("BLOCK_CODE_BLOCK_ELEMENTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BLOCK_ELEMENTS_name, &const_BLOCK_CODE_BLOCK_ELEMENTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BLOCK_ELEMENTS_name); + zend_string_release_ex(const_BLOCK_CODE_BLOCK_ELEMENTS_name, true); zval const_BLOCK_CODE_GEOMETRIC_SHAPES_value; ZVAL_LONG(&const_BLOCK_CODE_GEOMETRIC_SHAPES_value, UBLOCK_GEOMETRIC_SHAPES); - zend_string *const_BLOCK_CODE_GEOMETRIC_SHAPES_name = zend_string_init_interned("BLOCK_CODE_GEOMETRIC_SHAPES", sizeof("BLOCK_CODE_GEOMETRIC_SHAPES") - 1, 1); + zend_string *const_BLOCK_CODE_GEOMETRIC_SHAPES_name = zend_string_init_interned("BLOCK_CODE_GEOMETRIC_SHAPES", sizeof("BLOCK_CODE_GEOMETRIC_SHAPES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GEOMETRIC_SHAPES_name, &const_BLOCK_CODE_GEOMETRIC_SHAPES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GEOMETRIC_SHAPES_name); + zend_string_release_ex(const_BLOCK_CODE_GEOMETRIC_SHAPES_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_value, UBLOCK_MISCELLANEOUS_SYMBOLS); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_name, &const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_name, true); zval const_BLOCK_CODE_DINGBATS_value; ZVAL_LONG(&const_BLOCK_CODE_DINGBATS_value, UBLOCK_DINGBATS); - zend_string *const_BLOCK_CODE_DINGBATS_name = zend_string_init_interned("BLOCK_CODE_DINGBATS", sizeof("BLOCK_CODE_DINGBATS") - 1, 1); + zend_string *const_BLOCK_CODE_DINGBATS_name = zend_string_init_interned("BLOCK_CODE_DINGBATS", sizeof("BLOCK_CODE_DINGBATS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DINGBATS_name, &const_BLOCK_CODE_DINGBATS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DINGBATS_name); + zend_string_release_ex(const_BLOCK_CODE_DINGBATS_name, true); zval const_BLOCK_CODE_BRAILLE_PATTERNS_value; ZVAL_LONG(&const_BLOCK_CODE_BRAILLE_PATTERNS_value, UBLOCK_BRAILLE_PATTERNS); - zend_string *const_BLOCK_CODE_BRAILLE_PATTERNS_name = zend_string_init_interned("BLOCK_CODE_BRAILLE_PATTERNS", sizeof("BLOCK_CODE_BRAILLE_PATTERNS") - 1, 1); + zend_string *const_BLOCK_CODE_BRAILLE_PATTERNS_name = zend_string_init_interned("BLOCK_CODE_BRAILLE_PATTERNS", sizeof("BLOCK_CODE_BRAILLE_PATTERNS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BRAILLE_PATTERNS_name, &const_BLOCK_CODE_BRAILLE_PATTERNS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BRAILLE_PATTERNS_name); + zend_string_release_ex(const_BLOCK_CODE_BRAILLE_PATTERNS_name, true); zval const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_value, UBLOCK_CJK_RADICALS_SUPPLEMENT); - zend_string *const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CJK_RADICALS_SUPPLEMENT", sizeof("BLOCK_CODE_CJK_RADICALS_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CJK_RADICALS_SUPPLEMENT", sizeof("BLOCK_CODE_CJK_RADICALS_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_name, &const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_RADICALS_SUPPLEMENT_name, true); zval const_BLOCK_CODE_KANGXI_RADICALS_value; ZVAL_LONG(&const_BLOCK_CODE_KANGXI_RADICALS_value, UBLOCK_KANGXI_RADICALS); - zend_string *const_BLOCK_CODE_KANGXI_RADICALS_name = zend_string_init_interned("BLOCK_CODE_KANGXI_RADICALS", sizeof("BLOCK_CODE_KANGXI_RADICALS") - 1, 1); + zend_string *const_BLOCK_CODE_KANGXI_RADICALS_name = zend_string_init_interned("BLOCK_CODE_KANGXI_RADICALS", sizeof("BLOCK_CODE_KANGXI_RADICALS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KANGXI_RADICALS_name, &const_BLOCK_CODE_KANGXI_RADICALS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KANGXI_RADICALS_name); + zend_string_release_ex(const_BLOCK_CODE_KANGXI_RADICALS_name, true); zval const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_value; ZVAL_LONG(&const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_value, UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS); - zend_string *const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_name = zend_string_init_interned("BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS", sizeof("BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS") - 1, 1); + zend_string *const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_name = zend_string_init_interned("BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS", sizeof("BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_name, &const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_name); + zend_string_release_ex(const_BLOCK_CODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS_name, true); zval const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_value, UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION); - zend_string *const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION", sizeof("BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION", sizeof("BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_name, &const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_SYMBOLS_AND_PUNCTUATION_name, true); zval const_BLOCK_CODE_HIRAGANA_value; ZVAL_LONG(&const_BLOCK_CODE_HIRAGANA_value, UBLOCK_HIRAGANA); - zend_string *const_BLOCK_CODE_HIRAGANA_name = zend_string_init_interned("BLOCK_CODE_HIRAGANA", sizeof("BLOCK_CODE_HIRAGANA") - 1, 1); + zend_string *const_BLOCK_CODE_HIRAGANA_name = zend_string_init_interned("BLOCK_CODE_HIRAGANA", sizeof("BLOCK_CODE_HIRAGANA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HIRAGANA_name, &const_BLOCK_CODE_HIRAGANA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HIRAGANA_name); + zend_string_release_ex(const_BLOCK_CODE_HIRAGANA_name, true); zval const_BLOCK_CODE_KATAKANA_value; ZVAL_LONG(&const_BLOCK_CODE_KATAKANA_value, UBLOCK_KATAKANA); - zend_string *const_BLOCK_CODE_KATAKANA_name = zend_string_init_interned("BLOCK_CODE_KATAKANA", sizeof("BLOCK_CODE_KATAKANA") - 1, 1); + zend_string *const_BLOCK_CODE_KATAKANA_name = zend_string_init_interned("BLOCK_CODE_KATAKANA", sizeof("BLOCK_CODE_KATAKANA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KATAKANA_name, &const_BLOCK_CODE_KATAKANA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KATAKANA_name); + zend_string_release_ex(const_BLOCK_CODE_KATAKANA_name, true); zval const_BLOCK_CODE_BOPOMOFO_value; ZVAL_LONG(&const_BLOCK_CODE_BOPOMOFO_value, UBLOCK_BOPOMOFO); - zend_string *const_BLOCK_CODE_BOPOMOFO_name = zend_string_init_interned("BLOCK_CODE_BOPOMOFO", sizeof("BLOCK_CODE_BOPOMOFO") - 1, 1); + zend_string *const_BLOCK_CODE_BOPOMOFO_name = zend_string_init_interned("BLOCK_CODE_BOPOMOFO", sizeof("BLOCK_CODE_BOPOMOFO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BOPOMOFO_name, &const_BLOCK_CODE_BOPOMOFO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BOPOMOFO_name); + zend_string_release_ex(const_BLOCK_CODE_BOPOMOFO_name, true); zval const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_value; ZVAL_LONG(&const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_value, UBLOCK_HANGUL_COMPATIBILITY_JAMO); - zend_string *const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_name = zend_string_init_interned("BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO", sizeof("BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO") - 1, 1); + zend_string *const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_name = zend_string_init_interned("BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO", sizeof("BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_name, &const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_name); + zend_string_release_ex(const_BLOCK_CODE_HANGUL_COMPATIBILITY_JAMO_name, true); zval const_BLOCK_CODE_KANBUN_value; ZVAL_LONG(&const_BLOCK_CODE_KANBUN_value, UBLOCK_KANBUN); - zend_string *const_BLOCK_CODE_KANBUN_name = zend_string_init_interned("BLOCK_CODE_KANBUN", sizeof("BLOCK_CODE_KANBUN") - 1, 1); + zend_string *const_BLOCK_CODE_KANBUN_name = zend_string_init_interned("BLOCK_CODE_KANBUN", sizeof("BLOCK_CODE_KANBUN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KANBUN_name, &const_BLOCK_CODE_KANBUN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KANBUN_name); + zend_string_release_ex(const_BLOCK_CODE_KANBUN_name, true); zval const_BLOCK_CODE_BOPOMOFO_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_BOPOMOFO_EXTENDED_value, UBLOCK_BOPOMOFO_EXTENDED); - zend_string *const_BLOCK_CODE_BOPOMOFO_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_BOPOMOFO_EXTENDED", sizeof("BLOCK_CODE_BOPOMOFO_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_BOPOMOFO_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_BOPOMOFO_EXTENDED", sizeof("BLOCK_CODE_BOPOMOFO_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BOPOMOFO_EXTENDED_name, &const_BLOCK_CODE_BOPOMOFO_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BOPOMOFO_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_BOPOMOFO_EXTENDED_name, true); zval const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_value; ZVAL_LONG(&const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_value, UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS); - zend_string *const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS", sizeof("BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS") - 1, 1); + zend_string *const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS", sizeof("BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_name, &const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_name); + zend_string_release_ex(const_BLOCK_CODE_ENCLOSED_CJK_LETTERS_AND_MONTHS_name, true); zval const_BLOCK_CODE_CJK_COMPATIBILITY_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_COMPATIBILITY_value, UBLOCK_CJK_COMPATIBILITY); - zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY", sizeof("BLOCK_CODE_CJK_COMPATIBILITY") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY", sizeof("BLOCK_CODE_CJK_COMPATIBILITY") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_COMPATIBILITY_name, &const_BLOCK_CODE_CJK_COMPATIBILITY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_COMPATIBILITY_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_COMPATIBILITY_name, true); zval const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_value, UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A); - zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_name, &const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_name, true); zval const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_value, UBLOCK_CJK_UNIFIED_IDEOGRAPHS); - zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_name, &const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_name, true); zval const_BLOCK_CODE_YI_SYLLABLES_value; ZVAL_LONG(&const_BLOCK_CODE_YI_SYLLABLES_value, UBLOCK_YI_SYLLABLES); - zend_string *const_BLOCK_CODE_YI_SYLLABLES_name = zend_string_init_interned("BLOCK_CODE_YI_SYLLABLES", sizeof("BLOCK_CODE_YI_SYLLABLES") - 1, 1); + zend_string *const_BLOCK_CODE_YI_SYLLABLES_name = zend_string_init_interned("BLOCK_CODE_YI_SYLLABLES", sizeof("BLOCK_CODE_YI_SYLLABLES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_YI_SYLLABLES_name, &const_BLOCK_CODE_YI_SYLLABLES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_YI_SYLLABLES_name); + zend_string_release_ex(const_BLOCK_CODE_YI_SYLLABLES_name, true); zval const_BLOCK_CODE_YI_RADICALS_value; ZVAL_LONG(&const_BLOCK_CODE_YI_RADICALS_value, UBLOCK_YI_RADICALS); - zend_string *const_BLOCK_CODE_YI_RADICALS_name = zend_string_init_interned("BLOCK_CODE_YI_RADICALS", sizeof("BLOCK_CODE_YI_RADICALS") - 1, 1); + zend_string *const_BLOCK_CODE_YI_RADICALS_name = zend_string_init_interned("BLOCK_CODE_YI_RADICALS", sizeof("BLOCK_CODE_YI_RADICALS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_YI_RADICALS_name, &const_BLOCK_CODE_YI_RADICALS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_YI_RADICALS_name); + zend_string_release_ex(const_BLOCK_CODE_YI_RADICALS_name, true); zval const_BLOCK_CODE_HANGUL_SYLLABLES_value; ZVAL_LONG(&const_BLOCK_CODE_HANGUL_SYLLABLES_value, UBLOCK_HANGUL_SYLLABLES); - zend_string *const_BLOCK_CODE_HANGUL_SYLLABLES_name = zend_string_init_interned("BLOCK_CODE_HANGUL_SYLLABLES", sizeof("BLOCK_CODE_HANGUL_SYLLABLES") - 1, 1); + zend_string *const_BLOCK_CODE_HANGUL_SYLLABLES_name = zend_string_init_interned("BLOCK_CODE_HANGUL_SYLLABLES", sizeof("BLOCK_CODE_HANGUL_SYLLABLES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANGUL_SYLLABLES_name, &const_BLOCK_CODE_HANGUL_SYLLABLES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANGUL_SYLLABLES_name); + zend_string_release_ex(const_BLOCK_CODE_HANGUL_SYLLABLES_name, true); zval const_BLOCK_CODE_HIGH_SURROGATES_value; ZVAL_LONG(&const_BLOCK_CODE_HIGH_SURROGATES_value, UBLOCK_HIGH_SURROGATES); - zend_string *const_BLOCK_CODE_HIGH_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_HIGH_SURROGATES", sizeof("BLOCK_CODE_HIGH_SURROGATES") - 1, 1); + zend_string *const_BLOCK_CODE_HIGH_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_HIGH_SURROGATES", sizeof("BLOCK_CODE_HIGH_SURROGATES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HIGH_SURROGATES_name, &const_BLOCK_CODE_HIGH_SURROGATES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HIGH_SURROGATES_name); + zend_string_release_ex(const_BLOCK_CODE_HIGH_SURROGATES_name, true); zval const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_value; ZVAL_LONG(&const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_value, UBLOCK_HIGH_PRIVATE_USE_SURROGATES); - zend_string *const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES", sizeof("BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES") - 1, 1); + zend_string *const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES", sizeof("BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_name, &const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_name); + zend_string_release_ex(const_BLOCK_CODE_HIGH_PRIVATE_USE_SURROGATES_name, true); zval const_BLOCK_CODE_LOW_SURROGATES_value; ZVAL_LONG(&const_BLOCK_CODE_LOW_SURROGATES_value, UBLOCK_LOW_SURROGATES); - zend_string *const_BLOCK_CODE_LOW_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_LOW_SURROGATES", sizeof("BLOCK_CODE_LOW_SURROGATES") - 1, 1); + zend_string *const_BLOCK_CODE_LOW_SURROGATES_name = zend_string_init_interned("BLOCK_CODE_LOW_SURROGATES", sizeof("BLOCK_CODE_LOW_SURROGATES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LOW_SURROGATES_name, &const_BLOCK_CODE_LOW_SURROGATES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LOW_SURROGATES_name); + zend_string_release_ex(const_BLOCK_CODE_LOW_SURROGATES_name, true); zval const_BLOCK_CODE_PRIVATE_USE_AREA_value; ZVAL_LONG(&const_BLOCK_CODE_PRIVATE_USE_AREA_value, UBLOCK_PRIVATE_USE_AREA); - zend_string *const_BLOCK_CODE_PRIVATE_USE_AREA_name = zend_string_init_interned("BLOCK_CODE_PRIVATE_USE_AREA", sizeof("BLOCK_CODE_PRIVATE_USE_AREA") - 1, 1); + zend_string *const_BLOCK_CODE_PRIVATE_USE_AREA_name = zend_string_init_interned("BLOCK_CODE_PRIVATE_USE_AREA", sizeof("BLOCK_CODE_PRIVATE_USE_AREA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PRIVATE_USE_AREA_name, &const_BLOCK_CODE_PRIVATE_USE_AREA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PRIVATE_USE_AREA_name); + zend_string_release_ex(const_BLOCK_CODE_PRIVATE_USE_AREA_name, true); zval const_BLOCK_CODE_PRIVATE_USE_value; ZVAL_LONG(&const_BLOCK_CODE_PRIVATE_USE_value, UBLOCK_PRIVATE_USE); - zend_string *const_BLOCK_CODE_PRIVATE_USE_name = zend_string_init_interned("BLOCK_CODE_PRIVATE_USE", sizeof("BLOCK_CODE_PRIVATE_USE") - 1, 1); + zend_string *const_BLOCK_CODE_PRIVATE_USE_name = zend_string_init_interned("BLOCK_CODE_PRIVATE_USE", sizeof("BLOCK_CODE_PRIVATE_USE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PRIVATE_USE_name, &const_BLOCK_CODE_PRIVATE_USE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PRIVATE_USE_name); + zend_string_release_ex(const_BLOCK_CODE_PRIVATE_USE_name, true); zval const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_value, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS); - zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_name, &const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_name, true); zval const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_value, UBLOCK_ALPHABETIC_PRESENTATION_FORMS); - zend_string *const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_name = zend_string_init_interned("BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS", sizeof("BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_name = zend_string_init_interned("BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS", sizeof("BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_name, &const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_ALPHABETIC_PRESENTATION_FORMS_name, true); zval const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_value, UBLOCK_ARABIC_PRESENTATION_FORMS_A); - zend_string *const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_name = zend_string_init_interned("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A", sizeof("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_name = zend_string_init_interned("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A", sizeof("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_name, &const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_A_name, true); zval const_BLOCK_CODE_COMBINING_HALF_MARKS_value; ZVAL_LONG(&const_BLOCK_CODE_COMBINING_HALF_MARKS_value, UBLOCK_COMBINING_HALF_MARKS); - zend_string *const_BLOCK_CODE_COMBINING_HALF_MARKS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_HALF_MARKS", sizeof("BLOCK_CODE_COMBINING_HALF_MARKS") - 1, 1); + zend_string *const_BLOCK_CODE_COMBINING_HALF_MARKS_name = zend_string_init_interned("BLOCK_CODE_COMBINING_HALF_MARKS", sizeof("BLOCK_CODE_COMBINING_HALF_MARKS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMBINING_HALF_MARKS_name, &const_BLOCK_CODE_COMBINING_HALF_MARKS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMBINING_HALF_MARKS_name); + zend_string_release_ex(const_BLOCK_CODE_COMBINING_HALF_MARKS_name, true); zval const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_value, UBLOCK_CJK_COMPATIBILITY_FORMS); - zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_FORMS", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_FORMS", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_name, &const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_COMPATIBILITY_FORMS_name, true); zval const_BLOCK_CODE_SMALL_FORM_VARIANTS_value; ZVAL_LONG(&const_BLOCK_CODE_SMALL_FORM_VARIANTS_value, UBLOCK_SMALL_FORM_VARIANTS); - zend_string *const_BLOCK_CODE_SMALL_FORM_VARIANTS_name = zend_string_init_interned("BLOCK_CODE_SMALL_FORM_VARIANTS", sizeof("BLOCK_CODE_SMALL_FORM_VARIANTS") - 1, 1); + zend_string *const_BLOCK_CODE_SMALL_FORM_VARIANTS_name = zend_string_init_interned("BLOCK_CODE_SMALL_FORM_VARIANTS", sizeof("BLOCK_CODE_SMALL_FORM_VARIANTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SMALL_FORM_VARIANTS_name, &const_BLOCK_CODE_SMALL_FORM_VARIANTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SMALL_FORM_VARIANTS_name); + zend_string_release_ex(const_BLOCK_CODE_SMALL_FORM_VARIANTS_name, true); zval const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_value, UBLOCK_ARABIC_PRESENTATION_FORMS_B); - zend_string *const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_name = zend_string_init_interned("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B", sizeof("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_name = zend_string_init_interned("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B", sizeof("BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_name, &const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_PRESENTATION_FORMS_B_name, true); zval const_BLOCK_CODE_SPECIALS_value; ZVAL_LONG(&const_BLOCK_CODE_SPECIALS_value, UBLOCK_SPECIALS); - zend_string *const_BLOCK_CODE_SPECIALS_name = zend_string_init_interned("BLOCK_CODE_SPECIALS", sizeof("BLOCK_CODE_SPECIALS") - 1, 1); + zend_string *const_BLOCK_CODE_SPECIALS_name = zend_string_init_interned("BLOCK_CODE_SPECIALS", sizeof("BLOCK_CODE_SPECIALS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SPECIALS_name, &const_BLOCK_CODE_SPECIALS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SPECIALS_name); + zend_string_release_ex(const_BLOCK_CODE_SPECIALS_name, true); zval const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_value, UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS); - zend_string *const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_name = zend_string_init_interned("BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS", sizeof("BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_name = zend_string_init_interned("BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS", sizeof("BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_name, &const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_HALFWIDTH_AND_FULLWIDTH_FORMS_name, true); zval const_BLOCK_CODE_OLD_ITALIC_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_ITALIC_value, UBLOCK_OLD_ITALIC); - zend_string *const_BLOCK_CODE_OLD_ITALIC_name = zend_string_init_interned("BLOCK_CODE_OLD_ITALIC", sizeof("BLOCK_CODE_OLD_ITALIC") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_ITALIC_name = zend_string_init_interned("BLOCK_CODE_OLD_ITALIC", sizeof("BLOCK_CODE_OLD_ITALIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_ITALIC_name, &const_BLOCK_CODE_OLD_ITALIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_ITALIC_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_ITALIC_name, true); zval const_BLOCK_CODE_GOTHIC_value; ZVAL_LONG(&const_BLOCK_CODE_GOTHIC_value, UBLOCK_GOTHIC); - zend_string *const_BLOCK_CODE_GOTHIC_name = zend_string_init_interned("BLOCK_CODE_GOTHIC", sizeof("BLOCK_CODE_GOTHIC") - 1, 1); + zend_string *const_BLOCK_CODE_GOTHIC_name = zend_string_init_interned("BLOCK_CODE_GOTHIC", sizeof("BLOCK_CODE_GOTHIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GOTHIC_name, &const_BLOCK_CODE_GOTHIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GOTHIC_name); + zend_string_release_ex(const_BLOCK_CODE_GOTHIC_name, true); zval const_BLOCK_CODE_DESERET_value; ZVAL_LONG(&const_BLOCK_CODE_DESERET_value, UBLOCK_DESERET); - zend_string *const_BLOCK_CODE_DESERET_name = zend_string_init_interned("BLOCK_CODE_DESERET", sizeof("BLOCK_CODE_DESERET") - 1, 1); + zend_string *const_BLOCK_CODE_DESERET_name = zend_string_init_interned("BLOCK_CODE_DESERET", sizeof("BLOCK_CODE_DESERET") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DESERET_name, &const_BLOCK_CODE_DESERET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DESERET_name); + zend_string_release_ex(const_BLOCK_CODE_DESERET_name, true); zval const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_value, UBLOCK_BYZANTINE_MUSICAL_SYMBOLS); - zend_string *const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS", sizeof("BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS", sizeof("BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_name, &const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_BYZANTINE_MUSICAL_SYMBOLS_name, true); zval const_BLOCK_CODE_MUSICAL_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_MUSICAL_SYMBOLS_value, UBLOCK_MUSICAL_SYMBOLS); - zend_string *const_BLOCK_CODE_MUSICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MUSICAL_SYMBOLS", sizeof("BLOCK_CODE_MUSICAL_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_MUSICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MUSICAL_SYMBOLS", sizeof("BLOCK_CODE_MUSICAL_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MUSICAL_SYMBOLS_name, &const_BLOCK_CODE_MUSICAL_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MUSICAL_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_MUSICAL_SYMBOLS_name, true); zval const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_value, UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS); - zend_string *const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS", sizeof("BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS", sizeof("BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_name, &const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS_name, true); zval const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_value, UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B); - zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_name, &const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_name, true); zval const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_value, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT); - zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT", sizeof("BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_name, &const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_name, true); zval const_BLOCK_CODE_TAGS_value; ZVAL_LONG(&const_BLOCK_CODE_TAGS_value, UBLOCK_TAGS); - zend_string *const_BLOCK_CODE_TAGS_name = zend_string_init_interned("BLOCK_CODE_TAGS", sizeof("BLOCK_CODE_TAGS") - 1, 1); + zend_string *const_BLOCK_CODE_TAGS_name = zend_string_init_interned("BLOCK_CODE_TAGS", sizeof("BLOCK_CODE_TAGS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAGS_name, &const_BLOCK_CODE_TAGS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAGS_name); + zend_string_release_ex(const_BLOCK_CODE_TAGS_name, true); zval const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_value, UBLOCK_CYRILLIC_SUPPLEMENT); - zend_string *const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_SUPPLEMENT", sizeof("BLOCK_CODE_CYRILLIC_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_SUPPLEMENT", sizeof("BLOCK_CODE_CYRILLIC_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_name, &const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_CYRILLIC_SUPPLEMENT_name, true); zval const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_value; ZVAL_LONG(&const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_value, UBLOCK_CYRILLIC_SUPPLEMENTARY); - zend_string *const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_SUPPLEMENTARY", sizeof("BLOCK_CODE_CYRILLIC_SUPPLEMENTARY") - 1, 1); + zend_string *const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_SUPPLEMENTARY", sizeof("BLOCK_CODE_CYRILLIC_SUPPLEMENTARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_name, &const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_name); + zend_string_release_ex(const_BLOCK_CODE_CYRILLIC_SUPPLEMENTARY_name, true); zval const_BLOCK_CODE_TAGALOG_value; ZVAL_LONG(&const_BLOCK_CODE_TAGALOG_value, UBLOCK_TAGALOG); - zend_string *const_BLOCK_CODE_TAGALOG_name = zend_string_init_interned("BLOCK_CODE_TAGALOG", sizeof("BLOCK_CODE_TAGALOG") - 1, 1); + zend_string *const_BLOCK_CODE_TAGALOG_name = zend_string_init_interned("BLOCK_CODE_TAGALOG", sizeof("BLOCK_CODE_TAGALOG") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAGALOG_name, &const_BLOCK_CODE_TAGALOG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAGALOG_name); + zend_string_release_ex(const_BLOCK_CODE_TAGALOG_name, true); zval const_BLOCK_CODE_HANUNOO_value; ZVAL_LONG(&const_BLOCK_CODE_HANUNOO_value, UBLOCK_HANUNOO); - zend_string *const_BLOCK_CODE_HANUNOO_name = zend_string_init_interned("BLOCK_CODE_HANUNOO", sizeof("BLOCK_CODE_HANUNOO") - 1, 1); + zend_string *const_BLOCK_CODE_HANUNOO_name = zend_string_init_interned("BLOCK_CODE_HANUNOO", sizeof("BLOCK_CODE_HANUNOO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANUNOO_name, &const_BLOCK_CODE_HANUNOO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANUNOO_name); + zend_string_release_ex(const_BLOCK_CODE_HANUNOO_name, true); zval const_BLOCK_CODE_BUHID_value; ZVAL_LONG(&const_BLOCK_CODE_BUHID_value, UBLOCK_BUHID); - zend_string *const_BLOCK_CODE_BUHID_name = zend_string_init_interned("BLOCK_CODE_BUHID", sizeof("BLOCK_CODE_BUHID") - 1, 1); + zend_string *const_BLOCK_CODE_BUHID_name = zend_string_init_interned("BLOCK_CODE_BUHID", sizeof("BLOCK_CODE_BUHID") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BUHID_name, &const_BLOCK_CODE_BUHID_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BUHID_name); + zend_string_release_ex(const_BLOCK_CODE_BUHID_name, true); zval const_BLOCK_CODE_TAGBANWA_value; ZVAL_LONG(&const_BLOCK_CODE_TAGBANWA_value, UBLOCK_TAGBANWA); - zend_string *const_BLOCK_CODE_TAGBANWA_name = zend_string_init_interned("BLOCK_CODE_TAGBANWA", sizeof("BLOCK_CODE_TAGBANWA") - 1, 1); + zend_string *const_BLOCK_CODE_TAGBANWA_name = zend_string_init_interned("BLOCK_CODE_TAGBANWA", sizeof("BLOCK_CODE_TAGBANWA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAGBANWA_name, &const_BLOCK_CODE_TAGBANWA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAGBANWA_name); + zend_string_release_ex(const_BLOCK_CODE_TAGBANWA_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_value, UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A", sizeof("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A", sizeof("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_name, &const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_name, true); zval const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_value, UBLOCK_SUPPLEMENTAL_ARROWS_A); - zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_A", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_A") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_A", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_name, &const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_A_name, true); zval const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_value, UBLOCK_SUPPLEMENTAL_ARROWS_B); - zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_B", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_B") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_B", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_name, &const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_B_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_value, UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B", sizeof("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B", sizeof("BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_name, &const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_name, true); zval const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_value, UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS); - zend_string *const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS", sizeof("BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS", sizeof("BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_name, &const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS_name, true); zval const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_value; ZVAL_LONG(&const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_value, UBLOCK_KATAKANA_PHONETIC_EXTENSIONS); - zend_string *const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS", sizeof("BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS") - 1, 1); + zend_string *const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS", sizeof("BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_name, &const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_name); + zend_string_release_ex(const_BLOCK_CODE_KATAKANA_PHONETIC_EXTENSIONS_name, true); zval const_BLOCK_CODE_VARIATION_SELECTORS_value; ZVAL_LONG(&const_BLOCK_CODE_VARIATION_SELECTORS_value, UBLOCK_VARIATION_SELECTORS); - zend_string *const_BLOCK_CODE_VARIATION_SELECTORS_name = zend_string_init_interned("BLOCK_CODE_VARIATION_SELECTORS", sizeof("BLOCK_CODE_VARIATION_SELECTORS") - 1, 1); + zend_string *const_BLOCK_CODE_VARIATION_SELECTORS_name = zend_string_init_interned("BLOCK_CODE_VARIATION_SELECTORS", sizeof("BLOCK_CODE_VARIATION_SELECTORS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_VARIATION_SELECTORS_name, &const_BLOCK_CODE_VARIATION_SELECTORS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_VARIATION_SELECTORS_name); + zend_string_release_ex(const_BLOCK_CODE_VARIATION_SELECTORS_name, true); zval const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_value, UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A); - zend_string *const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A", sizeof("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A", sizeof("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_name, &const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A_name, true); zval const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_value, UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B); - zend_string *const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B", sizeof("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B", sizeof("BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_name, &const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B_name, true); zval const_BLOCK_CODE_LIMBU_value; ZVAL_LONG(&const_BLOCK_CODE_LIMBU_value, UBLOCK_LIMBU); - zend_string *const_BLOCK_CODE_LIMBU_name = zend_string_init_interned("BLOCK_CODE_LIMBU", sizeof("BLOCK_CODE_LIMBU") - 1, 1); + zend_string *const_BLOCK_CODE_LIMBU_name = zend_string_init_interned("BLOCK_CODE_LIMBU", sizeof("BLOCK_CODE_LIMBU") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LIMBU_name, &const_BLOCK_CODE_LIMBU_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LIMBU_name); + zend_string_release_ex(const_BLOCK_CODE_LIMBU_name, true); zval const_BLOCK_CODE_TAI_LE_value; ZVAL_LONG(&const_BLOCK_CODE_TAI_LE_value, UBLOCK_TAI_LE); - zend_string *const_BLOCK_CODE_TAI_LE_name = zend_string_init_interned("BLOCK_CODE_TAI_LE", sizeof("BLOCK_CODE_TAI_LE") - 1, 1); + zend_string *const_BLOCK_CODE_TAI_LE_name = zend_string_init_interned("BLOCK_CODE_TAI_LE", sizeof("BLOCK_CODE_TAI_LE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAI_LE_name, &const_BLOCK_CODE_TAI_LE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAI_LE_name); + zend_string_release_ex(const_BLOCK_CODE_TAI_LE_name, true); zval const_BLOCK_CODE_KHMER_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_KHMER_SYMBOLS_value, UBLOCK_KHMER_SYMBOLS); - zend_string *const_BLOCK_CODE_KHMER_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_KHMER_SYMBOLS", sizeof("BLOCK_CODE_KHMER_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_KHMER_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_KHMER_SYMBOLS", sizeof("BLOCK_CODE_KHMER_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KHMER_SYMBOLS_name, &const_BLOCK_CODE_KHMER_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KHMER_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_KHMER_SYMBOLS_name, true); zval const_BLOCK_CODE_PHONETIC_EXTENSIONS_value; ZVAL_LONG(&const_BLOCK_CODE_PHONETIC_EXTENSIONS_value, UBLOCK_PHONETIC_EXTENSIONS); - zend_string *const_BLOCK_CODE_PHONETIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_PHONETIC_EXTENSIONS", sizeof("BLOCK_CODE_PHONETIC_EXTENSIONS") - 1, 1); + zend_string *const_BLOCK_CODE_PHONETIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_PHONETIC_EXTENSIONS", sizeof("BLOCK_CODE_PHONETIC_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PHONETIC_EXTENSIONS_name, &const_BLOCK_CODE_PHONETIC_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PHONETIC_EXTENSIONS_name); + zend_string_release_ex(const_BLOCK_CODE_PHONETIC_EXTENSIONS_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_value, UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_name, &const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS_name, true); zval const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_value, UBLOCK_YIJING_HEXAGRAM_SYMBOLS); - zend_string *const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS", sizeof("BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS", sizeof("BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_name, &const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_YIJING_HEXAGRAM_SYMBOLS_name, true); zval const_BLOCK_CODE_LINEAR_B_SYLLABARY_value; ZVAL_LONG(&const_BLOCK_CODE_LINEAR_B_SYLLABARY_value, UBLOCK_LINEAR_B_SYLLABARY); - zend_string *const_BLOCK_CODE_LINEAR_B_SYLLABARY_name = zend_string_init_interned("BLOCK_CODE_LINEAR_B_SYLLABARY", sizeof("BLOCK_CODE_LINEAR_B_SYLLABARY") - 1, 1); + zend_string *const_BLOCK_CODE_LINEAR_B_SYLLABARY_name = zend_string_init_interned("BLOCK_CODE_LINEAR_B_SYLLABARY", sizeof("BLOCK_CODE_LINEAR_B_SYLLABARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LINEAR_B_SYLLABARY_name, &const_BLOCK_CODE_LINEAR_B_SYLLABARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LINEAR_B_SYLLABARY_name); + zend_string_release_ex(const_BLOCK_CODE_LINEAR_B_SYLLABARY_name, true); zval const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_value; ZVAL_LONG(&const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_value, UBLOCK_LINEAR_B_IDEOGRAMS); - zend_string *const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_name = zend_string_init_interned("BLOCK_CODE_LINEAR_B_IDEOGRAMS", sizeof("BLOCK_CODE_LINEAR_B_IDEOGRAMS") - 1, 1); + zend_string *const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_name = zend_string_init_interned("BLOCK_CODE_LINEAR_B_IDEOGRAMS", sizeof("BLOCK_CODE_LINEAR_B_IDEOGRAMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_name, &const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_name); + zend_string_release_ex(const_BLOCK_CODE_LINEAR_B_IDEOGRAMS_name, true); zval const_BLOCK_CODE_AEGEAN_NUMBERS_value; ZVAL_LONG(&const_BLOCK_CODE_AEGEAN_NUMBERS_value, UBLOCK_AEGEAN_NUMBERS); - zend_string *const_BLOCK_CODE_AEGEAN_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_AEGEAN_NUMBERS", sizeof("BLOCK_CODE_AEGEAN_NUMBERS") - 1, 1); + zend_string *const_BLOCK_CODE_AEGEAN_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_AEGEAN_NUMBERS", sizeof("BLOCK_CODE_AEGEAN_NUMBERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_AEGEAN_NUMBERS_name, &const_BLOCK_CODE_AEGEAN_NUMBERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_AEGEAN_NUMBERS_name); + zend_string_release_ex(const_BLOCK_CODE_AEGEAN_NUMBERS_name, true); zval const_BLOCK_CODE_UGARITIC_value; ZVAL_LONG(&const_BLOCK_CODE_UGARITIC_value, UBLOCK_UGARITIC); - zend_string *const_BLOCK_CODE_UGARITIC_name = zend_string_init_interned("BLOCK_CODE_UGARITIC", sizeof("BLOCK_CODE_UGARITIC") - 1, 1); + zend_string *const_BLOCK_CODE_UGARITIC_name = zend_string_init_interned("BLOCK_CODE_UGARITIC", sizeof("BLOCK_CODE_UGARITIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_UGARITIC_name, &const_BLOCK_CODE_UGARITIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_UGARITIC_name); + zend_string_release_ex(const_BLOCK_CODE_UGARITIC_name, true); zval const_BLOCK_CODE_SHAVIAN_value; ZVAL_LONG(&const_BLOCK_CODE_SHAVIAN_value, UBLOCK_SHAVIAN); - zend_string *const_BLOCK_CODE_SHAVIAN_name = zend_string_init_interned("BLOCK_CODE_SHAVIAN", sizeof("BLOCK_CODE_SHAVIAN") - 1, 1); + zend_string *const_BLOCK_CODE_SHAVIAN_name = zend_string_init_interned("BLOCK_CODE_SHAVIAN", sizeof("BLOCK_CODE_SHAVIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SHAVIAN_name, &const_BLOCK_CODE_SHAVIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SHAVIAN_name); + zend_string_release_ex(const_BLOCK_CODE_SHAVIAN_name, true); zval const_BLOCK_CODE_OSMANYA_value; ZVAL_LONG(&const_BLOCK_CODE_OSMANYA_value, UBLOCK_OSMANYA); - zend_string *const_BLOCK_CODE_OSMANYA_name = zend_string_init_interned("BLOCK_CODE_OSMANYA", sizeof("BLOCK_CODE_OSMANYA") - 1, 1); + zend_string *const_BLOCK_CODE_OSMANYA_name = zend_string_init_interned("BLOCK_CODE_OSMANYA", sizeof("BLOCK_CODE_OSMANYA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OSMANYA_name, &const_BLOCK_CODE_OSMANYA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OSMANYA_name); + zend_string_release_ex(const_BLOCK_CODE_OSMANYA_name, true); zval const_BLOCK_CODE_CYPRIOT_SYLLABARY_value; ZVAL_LONG(&const_BLOCK_CODE_CYPRIOT_SYLLABARY_value, UBLOCK_CYPRIOT_SYLLABARY); - zend_string *const_BLOCK_CODE_CYPRIOT_SYLLABARY_name = zend_string_init_interned("BLOCK_CODE_CYPRIOT_SYLLABARY", sizeof("BLOCK_CODE_CYPRIOT_SYLLABARY") - 1, 1); + zend_string *const_BLOCK_CODE_CYPRIOT_SYLLABARY_name = zend_string_init_interned("BLOCK_CODE_CYPRIOT_SYLLABARY", sizeof("BLOCK_CODE_CYPRIOT_SYLLABARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYPRIOT_SYLLABARY_name, &const_BLOCK_CODE_CYPRIOT_SYLLABARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYPRIOT_SYLLABARY_name); + zend_string_release_ex(const_BLOCK_CODE_CYPRIOT_SYLLABARY_name, true); zval const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_value, UBLOCK_TAI_XUAN_JING_SYMBOLS); - zend_string *const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_TAI_XUAN_JING_SYMBOLS", sizeof("BLOCK_CODE_TAI_XUAN_JING_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_TAI_XUAN_JING_SYMBOLS", sizeof("BLOCK_CODE_TAI_XUAN_JING_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_name, &const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_TAI_XUAN_JING_SYMBOLS_name, true); zval const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_value, UBLOCK_VARIATION_SELECTORS_SUPPLEMENT); - zend_string *const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT", sizeof("BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT", sizeof("BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_name, &const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_VARIATION_SELECTORS_SUPPLEMENT_name, true); zval const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_value; ZVAL_LONG(&const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_value, UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION); - zend_string *const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION", sizeof("BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION") - 1, 1); + zend_string *const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION", sizeof("BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_name, &const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_name); + zend_string_release_ex(const_BLOCK_CODE_ANCIENT_GREEK_MUSICAL_NOTATION_name, true); zval const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_value; ZVAL_LONG(&const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_value, UBLOCK_ANCIENT_GREEK_NUMBERS); - zend_string *const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_GREEK_NUMBERS", sizeof("BLOCK_CODE_ANCIENT_GREEK_NUMBERS") - 1, 1); + zend_string *const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_GREEK_NUMBERS", sizeof("BLOCK_CODE_ANCIENT_GREEK_NUMBERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_name, &const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_name); + zend_string_release_ex(const_BLOCK_CODE_ANCIENT_GREEK_NUMBERS_name, true); zval const_BLOCK_CODE_ARABIC_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_SUPPLEMENT_value, UBLOCK_ARABIC_SUPPLEMENT); - zend_string *const_BLOCK_CODE_ARABIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ARABIC_SUPPLEMENT", sizeof("BLOCK_CODE_ARABIC_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ARABIC_SUPPLEMENT", sizeof("BLOCK_CODE_ARABIC_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_SUPPLEMENT_name, &const_BLOCK_CODE_ARABIC_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_SUPPLEMENT_name, true); zval const_BLOCK_CODE_BUGINESE_value; ZVAL_LONG(&const_BLOCK_CODE_BUGINESE_value, UBLOCK_BUGINESE); - zend_string *const_BLOCK_CODE_BUGINESE_name = zend_string_init_interned("BLOCK_CODE_BUGINESE", sizeof("BLOCK_CODE_BUGINESE") - 1, 1); + zend_string *const_BLOCK_CODE_BUGINESE_name = zend_string_init_interned("BLOCK_CODE_BUGINESE", sizeof("BLOCK_CODE_BUGINESE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BUGINESE_name, &const_BLOCK_CODE_BUGINESE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BUGINESE_name); + zend_string_release_ex(const_BLOCK_CODE_BUGINESE_name, true); zval const_BLOCK_CODE_CJK_STROKES_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_STROKES_value, UBLOCK_CJK_STROKES); - zend_string *const_BLOCK_CODE_CJK_STROKES_name = zend_string_init_interned("BLOCK_CODE_CJK_STROKES", sizeof("BLOCK_CODE_CJK_STROKES") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_STROKES_name = zend_string_init_interned("BLOCK_CODE_CJK_STROKES", sizeof("BLOCK_CODE_CJK_STROKES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_STROKES_name, &const_BLOCK_CODE_CJK_STROKES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_STROKES_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_STROKES_name, true); zval const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_value, UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT); - zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_name, &const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_name, true); zval const_BLOCK_CODE_COPTIC_value; ZVAL_LONG(&const_BLOCK_CODE_COPTIC_value, UBLOCK_COPTIC); - zend_string *const_BLOCK_CODE_COPTIC_name = zend_string_init_interned("BLOCK_CODE_COPTIC", sizeof("BLOCK_CODE_COPTIC") - 1, 1); + zend_string *const_BLOCK_CODE_COPTIC_name = zend_string_init_interned("BLOCK_CODE_COPTIC", sizeof("BLOCK_CODE_COPTIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COPTIC_name, &const_BLOCK_CODE_COPTIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COPTIC_name); + zend_string_release_ex(const_BLOCK_CODE_COPTIC_name, true); zval const_BLOCK_CODE_ETHIOPIC_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_ETHIOPIC_EXTENDED_value, UBLOCK_ETHIOPIC_EXTENDED); - zend_string *const_BLOCK_CODE_ETHIOPIC_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_EXTENDED", sizeof("BLOCK_CODE_ETHIOPIC_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_ETHIOPIC_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_EXTENDED", sizeof("BLOCK_CODE_ETHIOPIC_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ETHIOPIC_EXTENDED_name, &const_BLOCK_CODE_ETHIOPIC_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ETHIOPIC_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_ETHIOPIC_EXTENDED_name, true); zval const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_value, UBLOCK_ETHIOPIC_SUPPLEMENT); - zend_string *const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_SUPPLEMENT", sizeof("BLOCK_CODE_ETHIOPIC_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_SUPPLEMENT", sizeof("BLOCK_CODE_ETHIOPIC_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_name, &const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_ETHIOPIC_SUPPLEMENT_name, true); zval const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_value, UBLOCK_GEORGIAN_SUPPLEMENT); - zend_string *const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_GEORGIAN_SUPPLEMENT", sizeof("BLOCK_CODE_GEORGIAN_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_GEORGIAN_SUPPLEMENT", sizeof("BLOCK_CODE_GEORGIAN_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_name, &const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_GEORGIAN_SUPPLEMENT_name, true); zval const_BLOCK_CODE_GLAGOLITIC_value; ZVAL_LONG(&const_BLOCK_CODE_GLAGOLITIC_value, UBLOCK_GLAGOLITIC); - zend_string *const_BLOCK_CODE_GLAGOLITIC_name = zend_string_init_interned("BLOCK_CODE_GLAGOLITIC", sizeof("BLOCK_CODE_GLAGOLITIC") - 1, 1); + zend_string *const_BLOCK_CODE_GLAGOLITIC_name = zend_string_init_interned("BLOCK_CODE_GLAGOLITIC", sizeof("BLOCK_CODE_GLAGOLITIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GLAGOLITIC_name, &const_BLOCK_CODE_GLAGOLITIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GLAGOLITIC_name); + zend_string_release_ex(const_BLOCK_CODE_GLAGOLITIC_name, true); zval const_BLOCK_CODE_KHAROSHTHI_value; ZVAL_LONG(&const_BLOCK_CODE_KHAROSHTHI_value, UBLOCK_KHAROSHTHI); - zend_string *const_BLOCK_CODE_KHAROSHTHI_name = zend_string_init_interned("BLOCK_CODE_KHAROSHTHI", sizeof("BLOCK_CODE_KHAROSHTHI") - 1, 1); + zend_string *const_BLOCK_CODE_KHAROSHTHI_name = zend_string_init_interned("BLOCK_CODE_KHAROSHTHI", sizeof("BLOCK_CODE_KHAROSHTHI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KHAROSHTHI_name, &const_BLOCK_CODE_KHAROSHTHI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KHAROSHTHI_name); + zend_string_release_ex(const_BLOCK_CODE_KHAROSHTHI_name, true); zval const_BLOCK_CODE_MODIFIER_TONE_LETTERS_value; ZVAL_LONG(&const_BLOCK_CODE_MODIFIER_TONE_LETTERS_value, UBLOCK_MODIFIER_TONE_LETTERS); - zend_string *const_BLOCK_CODE_MODIFIER_TONE_LETTERS_name = zend_string_init_interned("BLOCK_CODE_MODIFIER_TONE_LETTERS", sizeof("BLOCK_CODE_MODIFIER_TONE_LETTERS") - 1, 1); + zend_string *const_BLOCK_CODE_MODIFIER_TONE_LETTERS_name = zend_string_init_interned("BLOCK_CODE_MODIFIER_TONE_LETTERS", sizeof("BLOCK_CODE_MODIFIER_TONE_LETTERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MODIFIER_TONE_LETTERS_name, &const_BLOCK_CODE_MODIFIER_TONE_LETTERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MODIFIER_TONE_LETTERS_name); + zend_string_release_ex(const_BLOCK_CODE_MODIFIER_TONE_LETTERS_name, true); zval const_BLOCK_CODE_NEW_TAI_LUE_value; ZVAL_LONG(&const_BLOCK_CODE_NEW_TAI_LUE_value, UBLOCK_NEW_TAI_LUE); - zend_string *const_BLOCK_CODE_NEW_TAI_LUE_name = zend_string_init_interned("BLOCK_CODE_NEW_TAI_LUE", sizeof("BLOCK_CODE_NEW_TAI_LUE") - 1, 1); + zend_string *const_BLOCK_CODE_NEW_TAI_LUE_name = zend_string_init_interned("BLOCK_CODE_NEW_TAI_LUE", sizeof("BLOCK_CODE_NEW_TAI_LUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_NEW_TAI_LUE_name, &const_BLOCK_CODE_NEW_TAI_LUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_NEW_TAI_LUE_name); + zend_string_release_ex(const_BLOCK_CODE_NEW_TAI_LUE_name, true); zval const_BLOCK_CODE_OLD_PERSIAN_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_PERSIAN_value, UBLOCK_OLD_PERSIAN); - zend_string *const_BLOCK_CODE_OLD_PERSIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_PERSIAN", sizeof("BLOCK_CODE_OLD_PERSIAN") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_PERSIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_PERSIAN", sizeof("BLOCK_CODE_OLD_PERSIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_PERSIAN_name, &const_BLOCK_CODE_OLD_PERSIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_PERSIAN_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_PERSIAN_name, true); zval const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_value, UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT); - zend_string *const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT", sizeof("BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT", sizeof("BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_name, &const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_PHONETIC_EXTENSIONS_SUPPLEMENT_name, true); zval const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_value, UBLOCK_SUPPLEMENTAL_PUNCTUATION); - zend_string *const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION", sizeof("BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION", sizeof("BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_name, &const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTAL_PUNCTUATION_name, true); zval const_BLOCK_CODE_SYLOTI_NAGRI_value; ZVAL_LONG(&const_BLOCK_CODE_SYLOTI_NAGRI_value, UBLOCK_SYLOTI_NAGRI); - zend_string *const_BLOCK_CODE_SYLOTI_NAGRI_name = zend_string_init_interned("BLOCK_CODE_SYLOTI_NAGRI", sizeof("BLOCK_CODE_SYLOTI_NAGRI") - 1, 1); + zend_string *const_BLOCK_CODE_SYLOTI_NAGRI_name = zend_string_init_interned("BLOCK_CODE_SYLOTI_NAGRI", sizeof("BLOCK_CODE_SYLOTI_NAGRI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SYLOTI_NAGRI_name, &const_BLOCK_CODE_SYLOTI_NAGRI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SYLOTI_NAGRI_name); + zend_string_release_ex(const_BLOCK_CODE_SYLOTI_NAGRI_name, true); zval const_BLOCK_CODE_TIFINAGH_value; ZVAL_LONG(&const_BLOCK_CODE_TIFINAGH_value, UBLOCK_TIFINAGH); - zend_string *const_BLOCK_CODE_TIFINAGH_name = zend_string_init_interned("BLOCK_CODE_TIFINAGH", sizeof("BLOCK_CODE_TIFINAGH") - 1, 1); + zend_string *const_BLOCK_CODE_TIFINAGH_name = zend_string_init_interned("BLOCK_CODE_TIFINAGH", sizeof("BLOCK_CODE_TIFINAGH") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TIFINAGH_name, &const_BLOCK_CODE_TIFINAGH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TIFINAGH_name); + zend_string_release_ex(const_BLOCK_CODE_TIFINAGH_name, true); zval const_BLOCK_CODE_VERTICAL_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_VERTICAL_FORMS_value, UBLOCK_VERTICAL_FORMS); - zend_string *const_BLOCK_CODE_VERTICAL_FORMS_name = zend_string_init_interned("BLOCK_CODE_VERTICAL_FORMS", sizeof("BLOCK_CODE_VERTICAL_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_VERTICAL_FORMS_name = zend_string_init_interned("BLOCK_CODE_VERTICAL_FORMS", sizeof("BLOCK_CODE_VERTICAL_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_VERTICAL_FORMS_name, &const_BLOCK_CODE_VERTICAL_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_VERTICAL_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_VERTICAL_FORMS_name, true); zval const_BLOCK_CODE_NKO_value; ZVAL_LONG(&const_BLOCK_CODE_NKO_value, UBLOCK_NKO); - zend_string *const_BLOCK_CODE_NKO_name = zend_string_init_interned("BLOCK_CODE_NKO", sizeof("BLOCK_CODE_NKO") - 1, 1); + zend_string *const_BLOCK_CODE_NKO_name = zend_string_init_interned("BLOCK_CODE_NKO", sizeof("BLOCK_CODE_NKO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_NKO_name, &const_BLOCK_CODE_NKO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_NKO_name); + zend_string_release_ex(const_BLOCK_CODE_NKO_name, true); zval const_BLOCK_CODE_BALINESE_value; ZVAL_LONG(&const_BLOCK_CODE_BALINESE_value, UBLOCK_BALINESE); - zend_string *const_BLOCK_CODE_BALINESE_name = zend_string_init_interned("BLOCK_CODE_BALINESE", sizeof("BLOCK_CODE_BALINESE") - 1, 1); + zend_string *const_BLOCK_CODE_BALINESE_name = zend_string_init_interned("BLOCK_CODE_BALINESE", sizeof("BLOCK_CODE_BALINESE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BALINESE_name, &const_BLOCK_CODE_BALINESE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BALINESE_name); + zend_string_release_ex(const_BLOCK_CODE_BALINESE_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_C_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_C_value, UBLOCK_LATIN_EXTENDED_C); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_C_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_C", sizeof("BLOCK_CODE_LATIN_EXTENDED_C") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_C_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_C", sizeof("BLOCK_CODE_LATIN_EXTENDED_C") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_C_name, &const_BLOCK_CODE_LATIN_EXTENDED_C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_C_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_C_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_D_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_D_value, UBLOCK_LATIN_EXTENDED_D); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_D_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_D", sizeof("BLOCK_CODE_LATIN_EXTENDED_D") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_D_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_D", sizeof("BLOCK_CODE_LATIN_EXTENDED_D") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_D_name, &const_BLOCK_CODE_LATIN_EXTENDED_D_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_D_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_D_name, true); zval const_BLOCK_CODE_PHAGS_PA_value; ZVAL_LONG(&const_BLOCK_CODE_PHAGS_PA_value, UBLOCK_PHAGS_PA); - zend_string *const_BLOCK_CODE_PHAGS_PA_name = zend_string_init_interned("BLOCK_CODE_PHAGS_PA", sizeof("BLOCK_CODE_PHAGS_PA") - 1, 1); + zend_string *const_BLOCK_CODE_PHAGS_PA_name = zend_string_init_interned("BLOCK_CODE_PHAGS_PA", sizeof("BLOCK_CODE_PHAGS_PA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PHAGS_PA_name, &const_BLOCK_CODE_PHAGS_PA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PHAGS_PA_name); + zend_string_release_ex(const_BLOCK_CODE_PHAGS_PA_name, true); zval const_BLOCK_CODE_PHOENICIAN_value; ZVAL_LONG(&const_BLOCK_CODE_PHOENICIAN_value, UBLOCK_PHOENICIAN); - zend_string *const_BLOCK_CODE_PHOENICIAN_name = zend_string_init_interned("BLOCK_CODE_PHOENICIAN", sizeof("BLOCK_CODE_PHOENICIAN") - 1, 1); + zend_string *const_BLOCK_CODE_PHOENICIAN_name = zend_string_init_interned("BLOCK_CODE_PHOENICIAN", sizeof("BLOCK_CODE_PHOENICIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PHOENICIAN_name, &const_BLOCK_CODE_PHOENICIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PHOENICIAN_name); + zend_string_release_ex(const_BLOCK_CODE_PHOENICIAN_name, true); zval const_BLOCK_CODE_CUNEIFORM_value; ZVAL_LONG(&const_BLOCK_CODE_CUNEIFORM_value, UBLOCK_CUNEIFORM); - zend_string *const_BLOCK_CODE_CUNEIFORM_name = zend_string_init_interned("BLOCK_CODE_CUNEIFORM", sizeof("BLOCK_CODE_CUNEIFORM") - 1, 1); + zend_string *const_BLOCK_CODE_CUNEIFORM_name = zend_string_init_interned("BLOCK_CODE_CUNEIFORM", sizeof("BLOCK_CODE_CUNEIFORM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CUNEIFORM_name, &const_BLOCK_CODE_CUNEIFORM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CUNEIFORM_name); + zend_string_release_ex(const_BLOCK_CODE_CUNEIFORM_name, true); zval const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_value; ZVAL_LONG(&const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_value, UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION); - zend_string *const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION", sizeof("BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION") - 1, 1); + zend_string *const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_name = zend_string_init_interned("BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION", sizeof("BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_name, &const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_name); + zend_string_release_ex(const_BLOCK_CODE_CUNEIFORM_NUMBERS_AND_PUNCTUATION_name, true); zval const_BLOCK_CODE_COUNTING_ROD_NUMERALS_value; ZVAL_LONG(&const_BLOCK_CODE_COUNTING_ROD_NUMERALS_value, UBLOCK_COUNTING_ROD_NUMERALS); - zend_string *const_BLOCK_CODE_COUNTING_ROD_NUMERALS_name = zend_string_init_interned("BLOCK_CODE_COUNTING_ROD_NUMERALS", sizeof("BLOCK_CODE_COUNTING_ROD_NUMERALS") - 1, 1); + zend_string *const_BLOCK_CODE_COUNTING_ROD_NUMERALS_name = zend_string_init_interned("BLOCK_CODE_COUNTING_ROD_NUMERALS", sizeof("BLOCK_CODE_COUNTING_ROD_NUMERALS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COUNTING_ROD_NUMERALS_name, &const_BLOCK_CODE_COUNTING_ROD_NUMERALS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COUNTING_ROD_NUMERALS_name); + zend_string_release_ex(const_BLOCK_CODE_COUNTING_ROD_NUMERALS_name, true); zval const_BLOCK_CODE_SUNDANESE_value; ZVAL_LONG(&const_BLOCK_CODE_SUNDANESE_value, UBLOCK_SUNDANESE); - zend_string *const_BLOCK_CODE_SUNDANESE_name = zend_string_init_interned("BLOCK_CODE_SUNDANESE", sizeof("BLOCK_CODE_SUNDANESE") - 1, 1); + zend_string *const_BLOCK_CODE_SUNDANESE_name = zend_string_init_interned("BLOCK_CODE_SUNDANESE", sizeof("BLOCK_CODE_SUNDANESE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUNDANESE_name, &const_BLOCK_CODE_SUNDANESE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUNDANESE_name); + zend_string_release_ex(const_BLOCK_CODE_SUNDANESE_name, true); zval const_BLOCK_CODE_LEPCHA_value; ZVAL_LONG(&const_BLOCK_CODE_LEPCHA_value, UBLOCK_LEPCHA); - zend_string *const_BLOCK_CODE_LEPCHA_name = zend_string_init_interned("BLOCK_CODE_LEPCHA", sizeof("BLOCK_CODE_LEPCHA") - 1, 1); + zend_string *const_BLOCK_CODE_LEPCHA_name = zend_string_init_interned("BLOCK_CODE_LEPCHA", sizeof("BLOCK_CODE_LEPCHA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LEPCHA_name, &const_BLOCK_CODE_LEPCHA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LEPCHA_name); + zend_string_release_ex(const_BLOCK_CODE_LEPCHA_name, true); zval const_BLOCK_CODE_OL_CHIKI_value; ZVAL_LONG(&const_BLOCK_CODE_OL_CHIKI_value, UBLOCK_OL_CHIKI); - zend_string *const_BLOCK_CODE_OL_CHIKI_name = zend_string_init_interned("BLOCK_CODE_OL_CHIKI", sizeof("BLOCK_CODE_OL_CHIKI") - 1, 1); + zend_string *const_BLOCK_CODE_OL_CHIKI_name = zend_string_init_interned("BLOCK_CODE_OL_CHIKI", sizeof("BLOCK_CODE_OL_CHIKI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OL_CHIKI_name, &const_BLOCK_CODE_OL_CHIKI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OL_CHIKI_name); + zend_string_release_ex(const_BLOCK_CODE_OL_CHIKI_name, true); zval const_BLOCK_CODE_CYRILLIC_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_CYRILLIC_EXTENDED_A_value, UBLOCK_CYRILLIC_EXTENDED_A); - zend_string *const_BLOCK_CODE_CYRILLIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_EXTENDED_A", sizeof("BLOCK_CODE_CYRILLIC_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_CYRILLIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_EXTENDED_A", sizeof("BLOCK_CODE_CYRILLIC_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYRILLIC_EXTENDED_A_name, &const_BLOCK_CODE_CYRILLIC_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYRILLIC_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_CYRILLIC_EXTENDED_A_name, true); zval const_BLOCK_CODE_VAI_value; ZVAL_LONG(&const_BLOCK_CODE_VAI_value, UBLOCK_VAI); - zend_string *const_BLOCK_CODE_VAI_name = zend_string_init_interned("BLOCK_CODE_VAI", sizeof("BLOCK_CODE_VAI") - 1, 1); + zend_string *const_BLOCK_CODE_VAI_name = zend_string_init_interned("BLOCK_CODE_VAI", sizeof("BLOCK_CODE_VAI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_VAI_name, &const_BLOCK_CODE_VAI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_VAI_name); + zend_string_release_ex(const_BLOCK_CODE_VAI_name, true); zval const_BLOCK_CODE_CYRILLIC_EXTENDED_B_value; ZVAL_LONG(&const_BLOCK_CODE_CYRILLIC_EXTENDED_B_value, UBLOCK_CYRILLIC_EXTENDED_B); - zend_string *const_BLOCK_CODE_CYRILLIC_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_EXTENDED_B", sizeof("BLOCK_CODE_CYRILLIC_EXTENDED_B") - 1, 1); + zend_string *const_BLOCK_CODE_CYRILLIC_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_CYRILLIC_EXTENDED_B", sizeof("BLOCK_CODE_CYRILLIC_EXTENDED_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CYRILLIC_EXTENDED_B_name, &const_BLOCK_CODE_CYRILLIC_EXTENDED_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CYRILLIC_EXTENDED_B_name); + zend_string_release_ex(const_BLOCK_CODE_CYRILLIC_EXTENDED_B_name, true); zval const_BLOCK_CODE_SAURASHTRA_value; ZVAL_LONG(&const_BLOCK_CODE_SAURASHTRA_value, UBLOCK_SAURASHTRA); - zend_string *const_BLOCK_CODE_SAURASHTRA_name = zend_string_init_interned("BLOCK_CODE_SAURASHTRA", sizeof("BLOCK_CODE_SAURASHTRA") - 1, 1); + zend_string *const_BLOCK_CODE_SAURASHTRA_name = zend_string_init_interned("BLOCK_CODE_SAURASHTRA", sizeof("BLOCK_CODE_SAURASHTRA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SAURASHTRA_name, &const_BLOCK_CODE_SAURASHTRA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SAURASHTRA_name); + zend_string_release_ex(const_BLOCK_CODE_SAURASHTRA_name, true); zval const_BLOCK_CODE_KAYAH_LI_value; ZVAL_LONG(&const_BLOCK_CODE_KAYAH_LI_value, UBLOCK_KAYAH_LI); - zend_string *const_BLOCK_CODE_KAYAH_LI_name = zend_string_init_interned("BLOCK_CODE_KAYAH_LI", sizeof("BLOCK_CODE_KAYAH_LI") - 1, 1); + zend_string *const_BLOCK_CODE_KAYAH_LI_name = zend_string_init_interned("BLOCK_CODE_KAYAH_LI", sizeof("BLOCK_CODE_KAYAH_LI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KAYAH_LI_name, &const_BLOCK_CODE_KAYAH_LI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KAYAH_LI_name); + zend_string_release_ex(const_BLOCK_CODE_KAYAH_LI_name, true); zval const_BLOCK_CODE_REJANG_value; ZVAL_LONG(&const_BLOCK_CODE_REJANG_value, UBLOCK_REJANG); - zend_string *const_BLOCK_CODE_REJANG_name = zend_string_init_interned("BLOCK_CODE_REJANG", sizeof("BLOCK_CODE_REJANG") - 1, 1); + zend_string *const_BLOCK_CODE_REJANG_name = zend_string_init_interned("BLOCK_CODE_REJANG", sizeof("BLOCK_CODE_REJANG") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_REJANG_name, &const_BLOCK_CODE_REJANG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_REJANG_name); + zend_string_release_ex(const_BLOCK_CODE_REJANG_name, true); zval const_BLOCK_CODE_CHAM_value; ZVAL_LONG(&const_BLOCK_CODE_CHAM_value, UBLOCK_CHAM); - zend_string *const_BLOCK_CODE_CHAM_name = zend_string_init_interned("BLOCK_CODE_CHAM", sizeof("BLOCK_CODE_CHAM") - 1, 1); + zend_string *const_BLOCK_CODE_CHAM_name = zend_string_init_interned("BLOCK_CODE_CHAM", sizeof("BLOCK_CODE_CHAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CHAM_name, &const_BLOCK_CODE_CHAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CHAM_name); + zend_string_release_ex(const_BLOCK_CODE_CHAM_name, true); zval const_BLOCK_CODE_ANCIENT_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_ANCIENT_SYMBOLS_value, UBLOCK_ANCIENT_SYMBOLS); - zend_string *const_BLOCK_CODE_ANCIENT_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_SYMBOLS", sizeof("BLOCK_CODE_ANCIENT_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_ANCIENT_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ANCIENT_SYMBOLS", sizeof("BLOCK_CODE_ANCIENT_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ANCIENT_SYMBOLS_name, &const_BLOCK_CODE_ANCIENT_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ANCIENT_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_ANCIENT_SYMBOLS_name, true); zval const_BLOCK_CODE_PHAISTOS_DISC_value; ZVAL_LONG(&const_BLOCK_CODE_PHAISTOS_DISC_value, UBLOCK_PHAISTOS_DISC); - zend_string *const_BLOCK_CODE_PHAISTOS_DISC_name = zend_string_init_interned("BLOCK_CODE_PHAISTOS_DISC", sizeof("BLOCK_CODE_PHAISTOS_DISC") - 1, 1); + zend_string *const_BLOCK_CODE_PHAISTOS_DISC_name = zend_string_init_interned("BLOCK_CODE_PHAISTOS_DISC", sizeof("BLOCK_CODE_PHAISTOS_DISC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PHAISTOS_DISC_name, &const_BLOCK_CODE_PHAISTOS_DISC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PHAISTOS_DISC_name); + zend_string_release_ex(const_BLOCK_CODE_PHAISTOS_DISC_name, true); zval const_BLOCK_CODE_LYCIAN_value; ZVAL_LONG(&const_BLOCK_CODE_LYCIAN_value, UBLOCK_LYCIAN); - zend_string *const_BLOCK_CODE_LYCIAN_name = zend_string_init_interned("BLOCK_CODE_LYCIAN", sizeof("BLOCK_CODE_LYCIAN") - 1, 1); + zend_string *const_BLOCK_CODE_LYCIAN_name = zend_string_init_interned("BLOCK_CODE_LYCIAN", sizeof("BLOCK_CODE_LYCIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LYCIAN_name, &const_BLOCK_CODE_LYCIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LYCIAN_name); + zend_string_release_ex(const_BLOCK_CODE_LYCIAN_name, true); zval const_BLOCK_CODE_CARIAN_value; ZVAL_LONG(&const_BLOCK_CODE_CARIAN_value, UBLOCK_CARIAN); - zend_string *const_BLOCK_CODE_CARIAN_name = zend_string_init_interned("BLOCK_CODE_CARIAN", sizeof("BLOCK_CODE_CARIAN") - 1, 1); + zend_string *const_BLOCK_CODE_CARIAN_name = zend_string_init_interned("BLOCK_CODE_CARIAN", sizeof("BLOCK_CODE_CARIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CARIAN_name, &const_BLOCK_CODE_CARIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CARIAN_name); + zend_string_release_ex(const_BLOCK_CODE_CARIAN_name, true); zval const_BLOCK_CODE_LYDIAN_value; ZVAL_LONG(&const_BLOCK_CODE_LYDIAN_value, UBLOCK_LYDIAN); - zend_string *const_BLOCK_CODE_LYDIAN_name = zend_string_init_interned("BLOCK_CODE_LYDIAN", sizeof("BLOCK_CODE_LYDIAN") - 1, 1); + zend_string *const_BLOCK_CODE_LYDIAN_name = zend_string_init_interned("BLOCK_CODE_LYDIAN", sizeof("BLOCK_CODE_LYDIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LYDIAN_name, &const_BLOCK_CODE_LYDIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LYDIAN_name); + zend_string_release_ex(const_BLOCK_CODE_LYDIAN_name, true); zval const_BLOCK_CODE_MAHJONG_TILES_value; ZVAL_LONG(&const_BLOCK_CODE_MAHJONG_TILES_value, UBLOCK_MAHJONG_TILES); - zend_string *const_BLOCK_CODE_MAHJONG_TILES_name = zend_string_init_interned("BLOCK_CODE_MAHJONG_TILES", sizeof("BLOCK_CODE_MAHJONG_TILES") - 1, 1); + zend_string *const_BLOCK_CODE_MAHJONG_TILES_name = zend_string_init_interned("BLOCK_CODE_MAHJONG_TILES", sizeof("BLOCK_CODE_MAHJONG_TILES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MAHJONG_TILES_name, &const_BLOCK_CODE_MAHJONG_TILES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MAHJONG_TILES_name); + zend_string_release_ex(const_BLOCK_CODE_MAHJONG_TILES_name, true); zval const_BLOCK_CODE_DOMINO_TILES_value; ZVAL_LONG(&const_BLOCK_CODE_DOMINO_TILES_value, UBLOCK_DOMINO_TILES); - zend_string *const_BLOCK_CODE_DOMINO_TILES_name = zend_string_init_interned("BLOCK_CODE_DOMINO_TILES", sizeof("BLOCK_CODE_DOMINO_TILES") - 1, 1); + zend_string *const_BLOCK_CODE_DOMINO_TILES_name = zend_string_init_interned("BLOCK_CODE_DOMINO_TILES", sizeof("BLOCK_CODE_DOMINO_TILES") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DOMINO_TILES_name, &const_BLOCK_CODE_DOMINO_TILES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DOMINO_TILES_name); + zend_string_release_ex(const_BLOCK_CODE_DOMINO_TILES_name, true); zval const_BLOCK_CODE_SAMARITAN_value; ZVAL_LONG(&const_BLOCK_CODE_SAMARITAN_value, UBLOCK_SAMARITAN); - zend_string *const_BLOCK_CODE_SAMARITAN_name = zend_string_init_interned("BLOCK_CODE_SAMARITAN", sizeof("BLOCK_CODE_SAMARITAN") - 1, 1); + zend_string *const_BLOCK_CODE_SAMARITAN_name = zend_string_init_interned("BLOCK_CODE_SAMARITAN", sizeof("BLOCK_CODE_SAMARITAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SAMARITAN_name, &const_BLOCK_CODE_SAMARITAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SAMARITAN_name); + zend_string_release_ex(const_BLOCK_CODE_SAMARITAN_name, true); zval const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_value, UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED); - zend_string *const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED", sizeof("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED", sizeof("BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_name, &const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_name, true); zval const_BLOCK_CODE_TAI_THAM_value; ZVAL_LONG(&const_BLOCK_CODE_TAI_THAM_value, UBLOCK_TAI_THAM); - zend_string *const_BLOCK_CODE_TAI_THAM_name = zend_string_init_interned("BLOCK_CODE_TAI_THAM", sizeof("BLOCK_CODE_TAI_THAM") - 1, 1); + zend_string *const_BLOCK_CODE_TAI_THAM_name = zend_string_init_interned("BLOCK_CODE_TAI_THAM", sizeof("BLOCK_CODE_TAI_THAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAI_THAM_name, &const_BLOCK_CODE_TAI_THAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAI_THAM_name); + zend_string_release_ex(const_BLOCK_CODE_TAI_THAM_name, true); zval const_BLOCK_CODE_VEDIC_EXTENSIONS_value; ZVAL_LONG(&const_BLOCK_CODE_VEDIC_EXTENSIONS_value, UBLOCK_VEDIC_EXTENSIONS); - zend_string *const_BLOCK_CODE_VEDIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_VEDIC_EXTENSIONS", sizeof("BLOCK_CODE_VEDIC_EXTENSIONS") - 1, 1); + zend_string *const_BLOCK_CODE_VEDIC_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_VEDIC_EXTENSIONS", sizeof("BLOCK_CODE_VEDIC_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_VEDIC_EXTENSIONS_name, &const_BLOCK_CODE_VEDIC_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_VEDIC_EXTENSIONS_name); + zend_string_release_ex(const_BLOCK_CODE_VEDIC_EXTENSIONS_name, true); zval const_BLOCK_CODE_LISU_value; ZVAL_LONG(&const_BLOCK_CODE_LISU_value, UBLOCK_LISU); - zend_string *const_BLOCK_CODE_LISU_name = zend_string_init_interned("BLOCK_CODE_LISU", sizeof("BLOCK_CODE_LISU") - 1, 1); + zend_string *const_BLOCK_CODE_LISU_name = zend_string_init_interned("BLOCK_CODE_LISU", sizeof("BLOCK_CODE_LISU") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LISU_name, &const_BLOCK_CODE_LISU_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LISU_name); + zend_string_release_ex(const_BLOCK_CODE_LISU_name, true); zval const_BLOCK_CODE_BAMUM_value; ZVAL_LONG(&const_BLOCK_CODE_BAMUM_value, UBLOCK_BAMUM); - zend_string *const_BLOCK_CODE_BAMUM_name = zend_string_init_interned("BLOCK_CODE_BAMUM", sizeof("BLOCK_CODE_BAMUM") - 1, 1); + zend_string *const_BLOCK_CODE_BAMUM_name = zend_string_init_interned("BLOCK_CODE_BAMUM", sizeof("BLOCK_CODE_BAMUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BAMUM_name, &const_BLOCK_CODE_BAMUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BAMUM_name); + zend_string_release_ex(const_BLOCK_CODE_BAMUM_name, true); zval const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_value; ZVAL_LONG(&const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_value, UBLOCK_COMMON_INDIC_NUMBER_FORMS); - zend_string *const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_name = zend_string_init_interned("BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS", sizeof("BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS") - 1, 1); + zend_string *const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_name = zend_string_init_interned("BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS", sizeof("BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_name, &const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_name); + zend_string_release_ex(const_BLOCK_CODE_COMMON_INDIC_NUMBER_FORMS_name, true); zval const_BLOCK_CODE_DEVANAGARI_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_DEVANAGARI_EXTENDED_value, UBLOCK_DEVANAGARI_EXTENDED); - zend_string *const_BLOCK_CODE_DEVANAGARI_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_DEVANAGARI_EXTENDED", sizeof("BLOCK_CODE_DEVANAGARI_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_DEVANAGARI_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_DEVANAGARI_EXTENDED", sizeof("BLOCK_CODE_DEVANAGARI_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DEVANAGARI_EXTENDED_name, &const_BLOCK_CODE_DEVANAGARI_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DEVANAGARI_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_DEVANAGARI_EXTENDED_name, true); zval const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_value, UBLOCK_HANGUL_JAMO_EXTENDED_A); - zend_string *const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO_EXTENDED_A", sizeof("BLOCK_CODE_HANGUL_JAMO_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO_EXTENDED_A", sizeof("BLOCK_CODE_HANGUL_JAMO_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_name, &const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_A_name, true); zval const_BLOCK_CODE_JAVANESE_value; ZVAL_LONG(&const_BLOCK_CODE_JAVANESE_value, UBLOCK_JAVANESE); - zend_string *const_BLOCK_CODE_JAVANESE_name = zend_string_init_interned("BLOCK_CODE_JAVANESE", sizeof("BLOCK_CODE_JAVANESE") - 1, 1); + zend_string *const_BLOCK_CODE_JAVANESE_name = zend_string_init_interned("BLOCK_CODE_JAVANESE", sizeof("BLOCK_CODE_JAVANESE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_JAVANESE_name, &const_BLOCK_CODE_JAVANESE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_JAVANESE_name); + zend_string_release_ex(const_BLOCK_CODE_JAVANESE_name, true); zval const_BLOCK_CODE_MYANMAR_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_MYANMAR_EXTENDED_A_value, UBLOCK_MYANMAR_EXTENDED_A); - zend_string *const_BLOCK_CODE_MYANMAR_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_MYANMAR_EXTENDED_A", sizeof("BLOCK_CODE_MYANMAR_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_MYANMAR_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_MYANMAR_EXTENDED_A", sizeof("BLOCK_CODE_MYANMAR_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MYANMAR_EXTENDED_A_name, &const_BLOCK_CODE_MYANMAR_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MYANMAR_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_MYANMAR_EXTENDED_A_name, true); zval const_BLOCK_CODE_TAI_VIET_value; ZVAL_LONG(&const_BLOCK_CODE_TAI_VIET_value, UBLOCK_TAI_VIET); - zend_string *const_BLOCK_CODE_TAI_VIET_name = zend_string_init_interned("BLOCK_CODE_TAI_VIET", sizeof("BLOCK_CODE_TAI_VIET") - 1, 1); + zend_string *const_BLOCK_CODE_TAI_VIET_name = zend_string_init_interned("BLOCK_CODE_TAI_VIET", sizeof("BLOCK_CODE_TAI_VIET") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAI_VIET_name, &const_BLOCK_CODE_TAI_VIET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAI_VIET_name); + zend_string_release_ex(const_BLOCK_CODE_TAI_VIET_name, true); zval const_BLOCK_CODE_MEETEI_MAYEK_value; ZVAL_LONG(&const_BLOCK_CODE_MEETEI_MAYEK_value, UBLOCK_MEETEI_MAYEK); - zend_string *const_BLOCK_CODE_MEETEI_MAYEK_name = zend_string_init_interned("BLOCK_CODE_MEETEI_MAYEK", sizeof("BLOCK_CODE_MEETEI_MAYEK") - 1, 1); + zend_string *const_BLOCK_CODE_MEETEI_MAYEK_name = zend_string_init_interned("BLOCK_CODE_MEETEI_MAYEK", sizeof("BLOCK_CODE_MEETEI_MAYEK") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MEETEI_MAYEK_name, &const_BLOCK_CODE_MEETEI_MAYEK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MEETEI_MAYEK_name); + zend_string_release_ex(const_BLOCK_CODE_MEETEI_MAYEK_name, true); zval const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_value; ZVAL_LONG(&const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_value, UBLOCK_HANGUL_JAMO_EXTENDED_B); - zend_string *const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO_EXTENDED_B", sizeof("BLOCK_CODE_HANGUL_JAMO_EXTENDED_B") - 1, 1); + zend_string *const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_HANGUL_JAMO_EXTENDED_B", sizeof("BLOCK_CODE_HANGUL_JAMO_EXTENDED_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_name, &const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_name); + zend_string_release_ex(const_BLOCK_CODE_HANGUL_JAMO_EXTENDED_B_name, true); zval const_BLOCK_CODE_IMPERIAL_ARAMAIC_value; ZVAL_LONG(&const_BLOCK_CODE_IMPERIAL_ARAMAIC_value, UBLOCK_IMPERIAL_ARAMAIC); - zend_string *const_BLOCK_CODE_IMPERIAL_ARAMAIC_name = zend_string_init_interned("BLOCK_CODE_IMPERIAL_ARAMAIC", sizeof("BLOCK_CODE_IMPERIAL_ARAMAIC") - 1, 1); + zend_string *const_BLOCK_CODE_IMPERIAL_ARAMAIC_name = zend_string_init_interned("BLOCK_CODE_IMPERIAL_ARAMAIC", sizeof("BLOCK_CODE_IMPERIAL_ARAMAIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_IMPERIAL_ARAMAIC_name, &const_BLOCK_CODE_IMPERIAL_ARAMAIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_IMPERIAL_ARAMAIC_name); + zend_string_release_ex(const_BLOCK_CODE_IMPERIAL_ARAMAIC_name, true); zval const_BLOCK_CODE_OLD_SOUTH_ARABIAN_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_SOUTH_ARABIAN_value, UBLOCK_OLD_SOUTH_ARABIAN); - zend_string *const_BLOCK_CODE_OLD_SOUTH_ARABIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_SOUTH_ARABIAN", sizeof("BLOCK_CODE_OLD_SOUTH_ARABIAN") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_SOUTH_ARABIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_SOUTH_ARABIAN", sizeof("BLOCK_CODE_OLD_SOUTH_ARABIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_SOUTH_ARABIAN_name, &const_BLOCK_CODE_OLD_SOUTH_ARABIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_SOUTH_ARABIAN_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_SOUTH_ARABIAN_name, true); zval const_BLOCK_CODE_AVESTAN_value; ZVAL_LONG(&const_BLOCK_CODE_AVESTAN_value, UBLOCK_AVESTAN); - zend_string *const_BLOCK_CODE_AVESTAN_name = zend_string_init_interned("BLOCK_CODE_AVESTAN", sizeof("BLOCK_CODE_AVESTAN") - 1, 1); + zend_string *const_BLOCK_CODE_AVESTAN_name = zend_string_init_interned("BLOCK_CODE_AVESTAN", sizeof("BLOCK_CODE_AVESTAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_AVESTAN_name, &const_BLOCK_CODE_AVESTAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_AVESTAN_name); + zend_string_release_ex(const_BLOCK_CODE_AVESTAN_name, true); zval const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_value; ZVAL_LONG(&const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_value, UBLOCK_INSCRIPTIONAL_PARTHIAN); - zend_string *const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_name = zend_string_init_interned("BLOCK_CODE_INSCRIPTIONAL_PARTHIAN", sizeof("BLOCK_CODE_INSCRIPTIONAL_PARTHIAN") - 1, 1); + zend_string *const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_name = zend_string_init_interned("BLOCK_CODE_INSCRIPTIONAL_PARTHIAN", sizeof("BLOCK_CODE_INSCRIPTIONAL_PARTHIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_name, &const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_name); + zend_string_release_ex(const_BLOCK_CODE_INSCRIPTIONAL_PARTHIAN_name, true); zval const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_value; ZVAL_LONG(&const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_value, UBLOCK_INSCRIPTIONAL_PAHLAVI); - zend_string *const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_name = zend_string_init_interned("BLOCK_CODE_INSCRIPTIONAL_PAHLAVI", sizeof("BLOCK_CODE_INSCRIPTIONAL_PAHLAVI") - 1, 1); + zend_string *const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_name = zend_string_init_interned("BLOCK_CODE_INSCRIPTIONAL_PAHLAVI", sizeof("BLOCK_CODE_INSCRIPTIONAL_PAHLAVI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_name, &const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_name); + zend_string_release_ex(const_BLOCK_CODE_INSCRIPTIONAL_PAHLAVI_name, true); zval const_BLOCK_CODE_OLD_TURKIC_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_TURKIC_value, UBLOCK_OLD_TURKIC); - zend_string *const_BLOCK_CODE_OLD_TURKIC_name = zend_string_init_interned("BLOCK_CODE_OLD_TURKIC", sizeof("BLOCK_CODE_OLD_TURKIC") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_TURKIC_name = zend_string_init_interned("BLOCK_CODE_OLD_TURKIC", sizeof("BLOCK_CODE_OLD_TURKIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_TURKIC_name, &const_BLOCK_CODE_OLD_TURKIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_TURKIC_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_TURKIC_name, true); zval const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_value, UBLOCK_RUMI_NUMERAL_SYMBOLS); - zend_string *const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_RUMI_NUMERAL_SYMBOLS", sizeof("BLOCK_CODE_RUMI_NUMERAL_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_RUMI_NUMERAL_SYMBOLS", sizeof("BLOCK_CODE_RUMI_NUMERAL_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_name, &const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_RUMI_NUMERAL_SYMBOLS_name, true); zval const_BLOCK_CODE_KAITHI_value; ZVAL_LONG(&const_BLOCK_CODE_KAITHI_value, UBLOCK_KAITHI); - zend_string *const_BLOCK_CODE_KAITHI_name = zend_string_init_interned("BLOCK_CODE_KAITHI", sizeof("BLOCK_CODE_KAITHI") - 1, 1); + zend_string *const_BLOCK_CODE_KAITHI_name = zend_string_init_interned("BLOCK_CODE_KAITHI", sizeof("BLOCK_CODE_KAITHI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KAITHI_name, &const_BLOCK_CODE_KAITHI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KAITHI_name); + zend_string_release_ex(const_BLOCK_CODE_KAITHI_name, true); zval const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_value; ZVAL_LONG(&const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_value, UBLOCK_EGYPTIAN_HIEROGLYPHS); - zend_string *const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_name = zend_string_init_interned("BLOCK_CODE_EGYPTIAN_HIEROGLYPHS", sizeof("BLOCK_CODE_EGYPTIAN_HIEROGLYPHS") - 1, 1); + zend_string *const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_name = zend_string_init_interned("BLOCK_CODE_EGYPTIAN_HIEROGLYPHS", sizeof("BLOCK_CODE_EGYPTIAN_HIEROGLYPHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_name, &const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_name); + zend_string_release_ex(const_BLOCK_CODE_EGYPTIAN_HIEROGLYPHS_name, true); zval const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_value, UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT); - zend_string *const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT", sizeof("BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT", sizeof("BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_name, &const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_ENCLOSED_ALPHANUMERIC_SUPPLEMENT_name, true); zval const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_value, UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT); - zend_string *const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT", sizeof("BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT", sizeof("BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_name, &const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_name, true); zval const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_value, UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C); - zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_name, &const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_name, true); zval const_BLOCK_CODE_MANDAIC_value; ZVAL_LONG(&const_BLOCK_CODE_MANDAIC_value, UBLOCK_MANDAIC); - zend_string *const_BLOCK_CODE_MANDAIC_name = zend_string_init_interned("BLOCK_CODE_MANDAIC", sizeof("BLOCK_CODE_MANDAIC") - 1, 1); + zend_string *const_BLOCK_CODE_MANDAIC_name = zend_string_init_interned("BLOCK_CODE_MANDAIC", sizeof("BLOCK_CODE_MANDAIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MANDAIC_name, &const_BLOCK_CODE_MANDAIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MANDAIC_name); + zend_string_release_ex(const_BLOCK_CODE_MANDAIC_name, true); zval const_BLOCK_CODE_BATAK_value; ZVAL_LONG(&const_BLOCK_CODE_BATAK_value, UBLOCK_BATAK); - zend_string *const_BLOCK_CODE_BATAK_name = zend_string_init_interned("BLOCK_CODE_BATAK", sizeof("BLOCK_CODE_BATAK") - 1, 1); + zend_string *const_BLOCK_CODE_BATAK_name = zend_string_init_interned("BLOCK_CODE_BATAK", sizeof("BLOCK_CODE_BATAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BATAK_name, &const_BLOCK_CODE_BATAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BATAK_name); + zend_string_release_ex(const_BLOCK_CODE_BATAK_name, true); zval const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_value, UBLOCK_ETHIOPIC_EXTENDED_A); - zend_string *const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_EXTENDED_A", sizeof("BLOCK_CODE_ETHIOPIC_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_ETHIOPIC_EXTENDED_A", sizeof("BLOCK_CODE_ETHIOPIC_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_name, &const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_ETHIOPIC_EXTENDED_A_name, true); zval const_BLOCK_CODE_BRAHMI_value; ZVAL_LONG(&const_BLOCK_CODE_BRAHMI_value, UBLOCK_BRAHMI); - zend_string *const_BLOCK_CODE_BRAHMI_name = zend_string_init_interned("BLOCK_CODE_BRAHMI", sizeof("BLOCK_CODE_BRAHMI") - 1, 1); + zend_string *const_BLOCK_CODE_BRAHMI_name = zend_string_init_interned("BLOCK_CODE_BRAHMI", sizeof("BLOCK_CODE_BRAHMI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BRAHMI_name, &const_BLOCK_CODE_BRAHMI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BRAHMI_name); + zend_string_release_ex(const_BLOCK_CODE_BRAHMI_name, true); zval const_BLOCK_CODE_BAMUM_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_BAMUM_SUPPLEMENT_value, UBLOCK_BAMUM_SUPPLEMENT); - zend_string *const_BLOCK_CODE_BAMUM_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_BAMUM_SUPPLEMENT", sizeof("BLOCK_CODE_BAMUM_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_BAMUM_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_BAMUM_SUPPLEMENT", sizeof("BLOCK_CODE_BAMUM_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BAMUM_SUPPLEMENT_name, &const_BLOCK_CODE_BAMUM_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BAMUM_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_BAMUM_SUPPLEMENT_name, true); zval const_BLOCK_CODE_KANA_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_KANA_SUPPLEMENT_value, UBLOCK_KANA_SUPPLEMENT); - zend_string *const_BLOCK_CODE_KANA_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_KANA_SUPPLEMENT", sizeof("BLOCK_CODE_KANA_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_KANA_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_KANA_SUPPLEMENT", sizeof("BLOCK_CODE_KANA_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KANA_SUPPLEMENT_name, &const_BLOCK_CODE_KANA_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KANA_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_KANA_SUPPLEMENT_name, true); zval const_BLOCK_CODE_PLAYING_CARDS_value; ZVAL_LONG(&const_BLOCK_CODE_PLAYING_CARDS_value, UBLOCK_PLAYING_CARDS); - zend_string *const_BLOCK_CODE_PLAYING_CARDS_name = zend_string_init_interned("BLOCK_CODE_PLAYING_CARDS", sizeof("BLOCK_CODE_PLAYING_CARDS") - 1, 1); + zend_string *const_BLOCK_CODE_PLAYING_CARDS_name = zend_string_init_interned("BLOCK_CODE_PLAYING_CARDS", sizeof("BLOCK_CODE_PLAYING_CARDS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PLAYING_CARDS_name, &const_BLOCK_CODE_PLAYING_CARDS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PLAYING_CARDS_name); + zend_string_release_ex(const_BLOCK_CODE_PLAYING_CARDS_name, true); zval const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_value; ZVAL_LONG(&const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_value, UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS); - zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS") - 1, 1); + zend_string *const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_name = zend_string_init_interned("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS", sizeof("BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_name, &const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_name); + zend_string_release_ex(const_BLOCK_CODE_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_name, true); zval const_BLOCK_CODE_EMOTICONS_value; ZVAL_LONG(&const_BLOCK_CODE_EMOTICONS_value, UBLOCK_EMOTICONS); - zend_string *const_BLOCK_CODE_EMOTICONS_name = zend_string_init_interned("BLOCK_CODE_EMOTICONS", sizeof("BLOCK_CODE_EMOTICONS") - 1, 1); + zend_string *const_BLOCK_CODE_EMOTICONS_name = zend_string_init_interned("BLOCK_CODE_EMOTICONS", sizeof("BLOCK_CODE_EMOTICONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_EMOTICONS_name, &const_BLOCK_CODE_EMOTICONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_EMOTICONS_name); + zend_string_release_ex(const_BLOCK_CODE_EMOTICONS_name, true); zval const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_value, UBLOCK_TRANSPORT_AND_MAP_SYMBOLS); - zend_string *const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS", sizeof("BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS", sizeof("BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_name, &const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_TRANSPORT_AND_MAP_SYMBOLS_name, true); zval const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_value, UBLOCK_ALCHEMICAL_SYMBOLS); - zend_string *const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ALCHEMICAL_SYMBOLS", sizeof("BLOCK_CODE_ALCHEMICAL_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ALCHEMICAL_SYMBOLS", sizeof("BLOCK_CODE_ALCHEMICAL_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_name, &const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_ALCHEMICAL_SYMBOLS_name, true); zval const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_value; ZVAL_LONG(&const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_value, UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D); - zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D") - 1, 1); + zend_string *const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_name = zend_string_init_interned("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D", sizeof("BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_name, &const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_name); + zend_string_release_ex(const_BLOCK_CODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_name, true); zval const_BLOCK_CODE_ARABIC_EXTENDED_A_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_EXTENDED_A_value, UBLOCK_ARABIC_EXTENDED_A); - zend_string *const_BLOCK_CODE_ARABIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_ARABIC_EXTENDED_A", sizeof("BLOCK_CODE_ARABIC_EXTENDED_A") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_EXTENDED_A_name = zend_string_init_interned("BLOCK_CODE_ARABIC_EXTENDED_A", sizeof("BLOCK_CODE_ARABIC_EXTENDED_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_EXTENDED_A_name, &const_BLOCK_CODE_ARABIC_EXTENDED_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_EXTENDED_A_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_EXTENDED_A_name, true); zval const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_value; ZVAL_LONG(&const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_value, UBLOCK_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS); - zend_string *const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS", sizeof("BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS") - 1, 1); + zend_string *const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_name = zend_string_init_interned("BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS", sizeof("BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_name, &const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_name); + zend_string_release_ex(const_BLOCK_CODE_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_name, true); zval const_BLOCK_CODE_CHAKMA_value; ZVAL_LONG(&const_BLOCK_CODE_CHAKMA_value, UBLOCK_CHAKMA); - zend_string *const_BLOCK_CODE_CHAKMA_name = zend_string_init_interned("BLOCK_CODE_CHAKMA", sizeof("BLOCK_CODE_CHAKMA") - 1, 1); + zend_string *const_BLOCK_CODE_CHAKMA_name = zend_string_init_interned("BLOCK_CODE_CHAKMA", sizeof("BLOCK_CODE_CHAKMA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CHAKMA_name, &const_BLOCK_CODE_CHAKMA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CHAKMA_name); + zend_string_release_ex(const_BLOCK_CODE_CHAKMA_name, true); zval const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_value; ZVAL_LONG(&const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_value, UBLOCK_MEETEI_MAYEK_EXTENSIONS); - zend_string *const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS", sizeof("BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS") - 1, 1); + zend_string *const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_name = zend_string_init_interned("BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS", sizeof("BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_name, &const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_name); + zend_string_release_ex(const_BLOCK_CODE_MEETEI_MAYEK_EXTENSIONS_name, true); zval const_BLOCK_CODE_MEROITIC_CURSIVE_value; ZVAL_LONG(&const_BLOCK_CODE_MEROITIC_CURSIVE_value, UBLOCK_MEROITIC_CURSIVE); - zend_string *const_BLOCK_CODE_MEROITIC_CURSIVE_name = zend_string_init_interned("BLOCK_CODE_MEROITIC_CURSIVE", sizeof("BLOCK_CODE_MEROITIC_CURSIVE") - 1, 1); + zend_string *const_BLOCK_CODE_MEROITIC_CURSIVE_name = zend_string_init_interned("BLOCK_CODE_MEROITIC_CURSIVE", sizeof("BLOCK_CODE_MEROITIC_CURSIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MEROITIC_CURSIVE_name, &const_BLOCK_CODE_MEROITIC_CURSIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MEROITIC_CURSIVE_name); + zend_string_release_ex(const_BLOCK_CODE_MEROITIC_CURSIVE_name, true); zval const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_value; ZVAL_LONG(&const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_value, UBLOCK_MEROITIC_HIEROGLYPHS); - zend_string *const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_name = zend_string_init_interned("BLOCK_CODE_MEROITIC_HIEROGLYPHS", sizeof("BLOCK_CODE_MEROITIC_HIEROGLYPHS") - 1, 1); + zend_string *const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_name = zend_string_init_interned("BLOCK_CODE_MEROITIC_HIEROGLYPHS", sizeof("BLOCK_CODE_MEROITIC_HIEROGLYPHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_name, &const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_name); + zend_string_release_ex(const_BLOCK_CODE_MEROITIC_HIEROGLYPHS_name, true); zval const_BLOCK_CODE_MIAO_value; ZVAL_LONG(&const_BLOCK_CODE_MIAO_value, UBLOCK_MIAO); - zend_string *const_BLOCK_CODE_MIAO_name = zend_string_init_interned("BLOCK_CODE_MIAO", sizeof("BLOCK_CODE_MIAO") - 1, 1); + zend_string *const_BLOCK_CODE_MIAO_name = zend_string_init_interned("BLOCK_CODE_MIAO", sizeof("BLOCK_CODE_MIAO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MIAO_name, &const_BLOCK_CODE_MIAO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MIAO_name); + zend_string_release_ex(const_BLOCK_CODE_MIAO_name, true); zval const_BLOCK_CODE_SHARADA_value; ZVAL_LONG(&const_BLOCK_CODE_SHARADA_value, UBLOCK_SHARADA); - zend_string *const_BLOCK_CODE_SHARADA_name = zend_string_init_interned("BLOCK_CODE_SHARADA", sizeof("BLOCK_CODE_SHARADA") - 1, 1); + zend_string *const_BLOCK_CODE_SHARADA_name = zend_string_init_interned("BLOCK_CODE_SHARADA", sizeof("BLOCK_CODE_SHARADA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SHARADA_name, &const_BLOCK_CODE_SHARADA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SHARADA_name); + zend_string_release_ex(const_BLOCK_CODE_SHARADA_name, true); zval const_BLOCK_CODE_SORA_SOMPENG_value; ZVAL_LONG(&const_BLOCK_CODE_SORA_SOMPENG_value, UBLOCK_SORA_SOMPENG); - zend_string *const_BLOCK_CODE_SORA_SOMPENG_name = zend_string_init_interned("BLOCK_CODE_SORA_SOMPENG", sizeof("BLOCK_CODE_SORA_SOMPENG") - 1, 1); + zend_string *const_BLOCK_CODE_SORA_SOMPENG_name = zend_string_init_interned("BLOCK_CODE_SORA_SOMPENG", sizeof("BLOCK_CODE_SORA_SOMPENG") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SORA_SOMPENG_name, &const_BLOCK_CODE_SORA_SOMPENG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SORA_SOMPENG_name); + zend_string_release_ex(const_BLOCK_CODE_SORA_SOMPENG_name, true); zval const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_value; ZVAL_LONG(&const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_value, UBLOCK_SUNDANESE_SUPPLEMENT); - zend_string *const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_SUNDANESE_SUPPLEMENT", sizeof("BLOCK_CODE_SUNDANESE_SUPPLEMENT") - 1, 1); + zend_string *const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_name = zend_string_init_interned("BLOCK_CODE_SUNDANESE_SUPPLEMENT", sizeof("BLOCK_CODE_SUNDANESE_SUPPLEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_name, &const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_name); + zend_string_release_ex(const_BLOCK_CODE_SUNDANESE_SUPPLEMENT_name, true); zval const_BLOCK_CODE_TAKRI_value; ZVAL_LONG(&const_BLOCK_CODE_TAKRI_value, UBLOCK_TAKRI); - zend_string *const_BLOCK_CODE_TAKRI_name = zend_string_init_interned("BLOCK_CODE_TAKRI", sizeof("BLOCK_CODE_TAKRI") - 1, 1); + zend_string *const_BLOCK_CODE_TAKRI_name = zend_string_init_interned("BLOCK_CODE_TAKRI", sizeof("BLOCK_CODE_TAKRI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TAKRI_name, &const_BLOCK_CODE_TAKRI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TAKRI_name); + zend_string_release_ex(const_BLOCK_CODE_TAKRI_name, true); zval const_BLOCK_CODE_BASSA_VAH_value; ZVAL_LONG(&const_BLOCK_CODE_BASSA_VAH_value, UBLOCK_BASSA_VAH); - zend_string *const_BLOCK_CODE_BASSA_VAH_name = zend_string_init_interned("BLOCK_CODE_BASSA_VAH", sizeof("BLOCK_CODE_BASSA_VAH") - 1, 1); + zend_string *const_BLOCK_CODE_BASSA_VAH_name = zend_string_init_interned("BLOCK_CODE_BASSA_VAH", sizeof("BLOCK_CODE_BASSA_VAH") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_BASSA_VAH_name, &const_BLOCK_CODE_BASSA_VAH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_BASSA_VAH_name); + zend_string_release_ex(const_BLOCK_CODE_BASSA_VAH_name, true); zval const_BLOCK_CODE_CAUCASIAN_ALBANIAN_value; ZVAL_LONG(&const_BLOCK_CODE_CAUCASIAN_ALBANIAN_value, UBLOCK_CAUCASIAN_ALBANIAN); - zend_string *const_BLOCK_CODE_CAUCASIAN_ALBANIAN_name = zend_string_init_interned("BLOCK_CODE_CAUCASIAN_ALBANIAN", sizeof("BLOCK_CODE_CAUCASIAN_ALBANIAN") - 1, 1); + zend_string *const_BLOCK_CODE_CAUCASIAN_ALBANIAN_name = zend_string_init_interned("BLOCK_CODE_CAUCASIAN_ALBANIAN", sizeof("BLOCK_CODE_CAUCASIAN_ALBANIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_CAUCASIAN_ALBANIAN_name, &const_BLOCK_CODE_CAUCASIAN_ALBANIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_CAUCASIAN_ALBANIAN_name); + zend_string_release_ex(const_BLOCK_CODE_CAUCASIAN_ALBANIAN_name, true); zval const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_value; ZVAL_LONG(&const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_value, UBLOCK_COPTIC_EPACT_NUMBERS); - zend_string *const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_COPTIC_EPACT_NUMBERS", sizeof("BLOCK_CODE_COPTIC_EPACT_NUMBERS") - 1, 1); + zend_string *const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_COPTIC_EPACT_NUMBERS", sizeof("BLOCK_CODE_COPTIC_EPACT_NUMBERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_name, &const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_name); + zend_string_release_ex(const_BLOCK_CODE_COPTIC_EPACT_NUMBERS_name, true); zval const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_value, UBLOCK_COMBINING_DIACRITICAL_MARKS_EXTENDED); - zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED", sizeof("BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_name, &const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_COMBINING_DIACRITICAL_MARKS_EXTENDED_name, true); zval const_BLOCK_CODE_DUPLOYAN_value; ZVAL_LONG(&const_BLOCK_CODE_DUPLOYAN_value, UBLOCK_DUPLOYAN); - zend_string *const_BLOCK_CODE_DUPLOYAN_name = zend_string_init_interned("BLOCK_CODE_DUPLOYAN", sizeof("BLOCK_CODE_DUPLOYAN") - 1, 1); + zend_string *const_BLOCK_CODE_DUPLOYAN_name = zend_string_init_interned("BLOCK_CODE_DUPLOYAN", sizeof("BLOCK_CODE_DUPLOYAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_DUPLOYAN_name, &const_BLOCK_CODE_DUPLOYAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_DUPLOYAN_name); + zend_string_release_ex(const_BLOCK_CODE_DUPLOYAN_name, true); zval const_BLOCK_CODE_ELBASAN_value; ZVAL_LONG(&const_BLOCK_CODE_ELBASAN_value, UBLOCK_ELBASAN); - zend_string *const_BLOCK_CODE_ELBASAN_name = zend_string_init_interned("BLOCK_CODE_ELBASAN", sizeof("BLOCK_CODE_ELBASAN") - 1, 1); + zend_string *const_BLOCK_CODE_ELBASAN_name = zend_string_init_interned("BLOCK_CODE_ELBASAN", sizeof("BLOCK_CODE_ELBASAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ELBASAN_name, &const_BLOCK_CODE_ELBASAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ELBASAN_name); + zend_string_release_ex(const_BLOCK_CODE_ELBASAN_name, true); zval const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_value; ZVAL_LONG(&const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_value, UBLOCK_GEOMETRIC_SHAPES_EXTENDED); - zend_string *const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED", sizeof("BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED") - 1, 1); + zend_string *const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_name = zend_string_init_interned("BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED", sizeof("BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_name, &const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_name); + zend_string_release_ex(const_BLOCK_CODE_GEOMETRIC_SHAPES_EXTENDED_name, true); zval const_BLOCK_CODE_GRANTHA_value; ZVAL_LONG(&const_BLOCK_CODE_GRANTHA_value, UBLOCK_GRANTHA); - zend_string *const_BLOCK_CODE_GRANTHA_name = zend_string_init_interned("BLOCK_CODE_GRANTHA", sizeof("BLOCK_CODE_GRANTHA") - 1, 1); + zend_string *const_BLOCK_CODE_GRANTHA_name = zend_string_init_interned("BLOCK_CODE_GRANTHA", sizeof("BLOCK_CODE_GRANTHA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_GRANTHA_name, &const_BLOCK_CODE_GRANTHA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_GRANTHA_name); + zend_string_release_ex(const_BLOCK_CODE_GRANTHA_name, true); zval const_BLOCK_CODE_KHOJKI_value; ZVAL_LONG(&const_BLOCK_CODE_KHOJKI_value, UBLOCK_KHOJKI); - zend_string *const_BLOCK_CODE_KHOJKI_name = zend_string_init_interned("BLOCK_CODE_KHOJKI", sizeof("BLOCK_CODE_KHOJKI") - 1, 1); + zend_string *const_BLOCK_CODE_KHOJKI_name = zend_string_init_interned("BLOCK_CODE_KHOJKI", sizeof("BLOCK_CODE_KHOJKI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KHOJKI_name, &const_BLOCK_CODE_KHOJKI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KHOJKI_name); + zend_string_release_ex(const_BLOCK_CODE_KHOJKI_name, true); zval const_BLOCK_CODE_KHUDAWADI_value; ZVAL_LONG(&const_BLOCK_CODE_KHUDAWADI_value, UBLOCK_KHUDAWADI); - zend_string *const_BLOCK_CODE_KHUDAWADI_name = zend_string_init_interned("BLOCK_CODE_KHUDAWADI", sizeof("BLOCK_CODE_KHUDAWADI") - 1, 1); + zend_string *const_BLOCK_CODE_KHUDAWADI_name = zend_string_init_interned("BLOCK_CODE_KHUDAWADI", sizeof("BLOCK_CODE_KHUDAWADI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_KHUDAWADI_name, &const_BLOCK_CODE_KHUDAWADI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_KHUDAWADI_name); + zend_string_release_ex(const_BLOCK_CODE_KHUDAWADI_name, true); zval const_BLOCK_CODE_LATIN_EXTENDED_E_value; ZVAL_LONG(&const_BLOCK_CODE_LATIN_EXTENDED_E_value, UBLOCK_LATIN_EXTENDED_E); - zend_string *const_BLOCK_CODE_LATIN_EXTENDED_E_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_E", sizeof("BLOCK_CODE_LATIN_EXTENDED_E") - 1, 1); + zend_string *const_BLOCK_CODE_LATIN_EXTENDED_E_name = zend_string_init_interned("BLOCK_CODE_LATIN_EXTENDED_E", sizeof("BLOCK_CODE_LATIN_EXTENDED_E") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LATIN_EXTENDED_E_name, &const_BLOCK_CODE_LATIN_EXTENDED_E_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LATIN_EXTENDED_E_name); + zend_string_release_ex(const_BLOCK_CODE_LATIN_EXTENDED_E_name, true); zval const_BLOCK_CODE_LINEAR_A_value; ZVAL_LONG(&const_BLOCK_CODE_LINEAR_A_value, UBLOCK_LINEAR_A); - zend_string *const_BLOCK_CODE_LINEAR_A_name = zend_string_init_interned("BLOCK_CODE_LINEAR_A", sizeof("BLOCK_CODE_LINEAR_A") - 1, 1); + zend_string *const_BLOCK_CODE_LINEAR_A_name = zend_string_init_interned("BLOCK_CODE_LINEAR_A", sizeof("BLOCK_CODE_LINEAR_A") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_LINEAR_A_name, &const_BLOCK_CODE_LINEAR_A_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_LINEAR_A_name); + zend_string_release_ex(const_BLOCK_CODE_LINEAR_A_name, true); zval const_BLOCK_CODE_MAHAJANI_value; ZVAL_LONG(&const_BLOCK_CODE_MAHAJANI_value, UBLOCK_MAHAJANI); - zend_string *const_BLOCK_CODE_MAHAJANI_name = zend_string_init_interned("BLOCK_CODE_MAHAJANI", sizeof("BLOCK_CODE_MAHAJANI") - 1, 1); + zend_string *const_BLOCK_CODE_MAHAJANI_name = zend_string_init_interned("BLOCK_CODE_MAHAJANI", sizeof("BLOCK_CODE_MAHAJANI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MAHAJANI_name, &const_BLOCK_CODE_MAHAJANI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MAHAJANI_name); + zend_string_release_ex(const_BLOCK_CODE_MAHAJANI_name, true); zval const_BLOCK_CODE_MANICHAEAN_value; ZVAL_LONG(&const_BLOCK_CODE_MANICHAEAN_value, UBLOCK_MANICHAEAN); - zend_string *const_BLOCK_CODE_MANICHAEAN_name = zend_string_init_interned("BLOCK_CODE_MANICHAEAN", sizeof("BLOCK_CODE_MANICHAEAN") - 1, 1); + zend_string *const_BLOCK_CODE_MANICHAEAN_name = zend_string_init_interned("BLOCK_CODE_MANICHAEAN", sizeof("BLOCK_CODE_MANICHAEAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MANICHAEAN_name, &const_BLOCK_CODE_MANICHAEAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MANICHAEAN_name); + zend_string_release_ex(const_BLOCK_CODE_MANICHAEAN_name, true); zval const_BLOCK_CODE_MENDE_KIKAKUI_value; ZVAL_LONG(&const_BLOCK_CODE_MENDE_KIKAKUI_value, UBLOCK_MENDE_KIKAKUI); - zend_string *const_BLOCK_CODE_MENDE_KIKAKUI_name = zend_string_init_interned("BLOCK_CODE_MENDE_KIKAKUI", sizeof("BLOCK_CODE_MENDE_KIKAKUI") - 1, 1); + zend_string *const_BLOCK_CODE_MENDE_KIKAKUI_name = zend_string_init_interned("BLOCK_CODE_MENDE_KIKAKUI", sizeof("BLOCK_CODE_MENDE_KIKAKUI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MENDE_KIKAKUI_name, &const_BLOCK_CODE_MENDE_KIKAKUI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MENDE_KIKAKUI_name); + zend_string_release_ex(const_BLOCK_CODE_MENDE_KIKAKUI_name, true); zval const_BLOCK_CODE_MODI_value; ZVAL_LONG(&const_BLOCK_CODE_MODI_value, UBLOCK_MODI); - zend_string *const_BLOCK_CODE_MODI_name = zend_string_init_interned("BLOCK_CODE_MODI", sizeof("BLOCK_CODE_MODI") - 1, 1); + zend_string *const_BLOCK_CODE_MODI_name = zend_string_init_interned("BLOCK_CODE_MODI", sizeof("BLOCK_CODE_MODI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MODI_name, &const_BLOCK_CODE_MODI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MODI_name); + zend_string_release_ex(const_BLOCK_CODE_MODI_name, true); zval const_BLOCK_CODE_MRO_value; ZVAL_LONG(&const_BLOCK_CODE_MRO_value, UBLOCK_MRO); - zend_string *const_BLOCK_CODE_MRO_name = zend_string_init_interned("BLOCK_CODE_MRO", sizeof("BLOCK_CODE_MRO") - 1, 1); + zend_string *const_BLOCK_CODE_MRO_name = zend_string_init_interned("BLOCK_CODE_MRO", sizeof("BLOCK_CODE_MRO") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MRO_name, &const_BLOCK_CODE_MRO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MRO_name); + zend_string_release_ex(const_BLOCK_CODE_MRO_name, true); zval const_BLOCK_CODE_MYANMAR_EXTENDED_B_value; ZVAL_LONG(&const_BLOCK_CODE_MYANMAR_EXTENDED_B_value, UBLOCK_MYANMAR_EXTENDED_B); - zend_string *const_BLOCK_CODE_MYANMAR_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_MYANMAR_EXTENDED_B", sizeof("BLOCK_CODE_MYANMAR_EXTENDED_B") - 1, 1); + zend_string *const_BLOCK_CODE_MYANMAR_EXTENDED_B_name = zend_string_init_interned("BLOCK_CODE_MYANMAR_EXTENDED_B", sizeof("BLOCK_CODE_MYANMAR_EXTENDED_B") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_MYANMAR_EXTENDED_B_name, &const_BLOCK_CODE_MYANMAR_EXTENDED_B_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_MYANMAR_EXTENDED_B_name); + zend_string_release_ex(const_BLOCK_CODE_MYANMAR_EXTENDED_B_name, true); zval const_BLOCK_CODE_NABATAEAN_value; ZVAL_LONG(&const_BLOCK_CODE_NABATAEAN_value, UBLOCK_NABATAEAN); - zend_string *const_BLOCK_CODE_NABATAEAN_name = zend_string_init_interned("BLOCK_CODE_NABATAEAN", sizeof("BLOCK_CODE_NABATAEAN") - 1, 1); + zend_string *const_BLOCK_CODE_NABATAEAN_name = zend_string_init_interned("BLOCK_CODE_NABATAEAN", sizeof("BLOCK_CODE_NABATAEAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_NABATAEAN_name, &const_BLOCK_CODE_NABATAEAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_NABATAEAN_name); + zend_string_release_ex(const_BLOCK_CODE_NABATAEAN_name, true); zval const_BLOCK_CODE_OLD_NORTH_ARABIAN_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_NORTH_ARABIAN_value, UBLOCK_OLD_NORTH_ARABIAN); - zend_string *const_BLOCK_CODE_OLD_NORTH_ARABIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_NORTH_ARABIAN", sizeof("BLOCK_CODE_OLD_NORTH_ARABIAN") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_NORTH_ARABIAN_name = zend_string_init_interned("BLOCK_CODE_OLD_NORTH_ARABIAN", sizeof("BLOCK_CODE_OLD_NORTH_ARABIAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_NORTH_ARABIAN_name, &const_BLOCK_CODE_OLD_NORTH_ARABIAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_NORTH_ARABIAN_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_NORTH_ARABIAN_name, true); zval const_BLOCK_CODE_OLD_PERMIC_value; ZVAL_LONG(&const_BLOCK_CODE_OLD_PERMIC_value, UBLOCK_OLD_PERMIC); - zend_string *const_BLOCK_CODE_OLD_PERMIC_name = zend_string_init_interned("BLOCK_CODE_OLD_PERMIC", sizeof("BLOCK_CODE_OLD_PERMIC") - 1, 1); + zend_string *const_BLOCK_CODE_OLD_PERMIC_name = zend_string_init_interned("BLOCK_CODE_OLD_PERMIC", sizeof("BLOCK_CODE_OLD_PERMIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_OLD_PERMIC_name, &const_BLOCK_CODE_OLD_PERMIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_OLD_PERMIC_name); + zend_string_release_ex(const_BLOCK_CODE_OLD_PERMIC_name, true); zval const_BLOCK_CODE_ORNAMENTAL_DINGBATS_value; ZVAL_LONG(&const_BLOCK_CODE_ORNAMENTAL_DINGBATS_value, UBLOCK_ORNAMENTAL_DINGBATS); - zend_string *const_BLOCK_CODE_ORNAMENTAL_DINGBATS_name = zend_string_init_interned("BLOCK_CODE_ORNAMENTAL_DINGBATS", sizeof("BLOCK_CODE_ORNAMENTAL_DINGBATS") - 1, 1); + zend_string *const_BLOCK_CODE_ORNAMENTAL_DINGBATS_name = zend_string_init_interned("BLOCK_CODE_ORNAMENTAL_DINGBATS", sizeof("BLOCK_CODE_ORNAMENTAL_DINGBATS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_ORNAMENTAL_DINGBATS_name, &const_BLOCK_CODE_ORNAMENTAL_DINGBATS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_ORNAMENTAL_DINGBATS_name); + zend_string_release_ex(const_BLOCK_CODE_ORNAMENTAL_DINGBATS_name, true); zval const_BLOCK_CODE_PAHAWH_HMONG_value; ZVAL_LONG(&const_BLOCK_CODE_PAHAWH_HMONG_value, UBLOCK_PAHAWH_HMONG); - zend_string *const_BLOCK_CODE_PAHAWH_HMONG_name = zend_string_init_interned("BLOCK_CODE_PAHAWH_HMONG", sizeof("BLOCK_CODE_PAHAWH_HMONG") - 1, 1); + zend_string *const_BLOCK_CODE_PAHAWH_HMONG_name = zend_string_init_interned("BLOCK_CODE_PAHAWH_HMONG", sizeof("BLOCK_CODE_PAHAWH_HMONG") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PAHAWH_HMONG_name, &const_BLOCK_CODE_PAHAWH_HMONG_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PAHAWH_HMONG_name); + zend_string_release_ex(const_BLOCK_CODE_PAHAWH_HMONG_name, true); zval const_BLOCK_CODE_PALMYRENE_value; ZVAL_LONG(&const_BLOCK_CODE_PALMYRENE_value, UBLOCK_PALMYRENE); - zend_string *const_BLOCK_CODE_PALMYRENE_name = zend_string_init_interned("BLOCK_CODE_PALMYRENE", sizeof("BLOCK_CODE_PALMYRENE") - 1, 1); + zend_string *const_BLOCK_CODE_PALMYRENE_name = zend_string_init_interned("BLOCK_CODE_PALMYRENE", sizeof("BLOCK_CODE_PALMYRENE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PALMYRENE_name, &const_BLOCK_CODE_PALMYRENE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PALMYRENE_name); + zend_string_release_ex(const_BLOCK_CODE_PALMYRENE_name, true); zval const_BLOCK_CODE_PAU_CIN_HAU_value; ZVAL_LONG(&const_BLOCK_CODE_PAU_CIN_HAU_value, UBLOCK_PAU_CIN_HAU); - zend_string *const_BLOCK_CODE_PAU_CIN_HAU_name = zend_string_init_interned("BLOCK_CODE_PAU_CIN_HAU", sizeof("BLOCK_CODE_PAU_CIN_HAU") - 1, 1); + zend_string *const_BLOCK_CODE_PAU_CIN_HAU_name = zend_string_init_interned("BLOCK_CODE_PAU_CIN_HAU", sizeof("BLOCK_CODE_PAU_CIN_HAU") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PAU_CIN_HAU_name, &const_BLOCK_CODE_PAU_CIN_HAU_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PAU_CIN_HAU_name); + zend_string_release_ex(const_BLOCK_CODE_PAU_CIN_HAU_name, true); zval const_BLOCK_CODE_PSALTER_PAHLAVI_value; ZVAL_LONG(&const_BLOCK_CODE_PSALTER_PAHLAVI_value, UBLOCK_PSALTER_PAHLAVI); - zend_string *const_BLOCK_CODE_PSALTER_PAHLAVI_name = zend_string_init_interned("BLOCK_CODE_PSALTER_PAHLAVI", sizeof("BLOCK_CODE_PSALTER_PAHLAVI") - 1, 1); + zend_string *const_BLOCK_CODE_PSALTER_PAHLAVI_name = zend_string_init_interned("BLOCK_CODE_PSALTER_PAHLAVI", sizeof("BLOCK_CODE_PSALTER_PAHLAVI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_PSALTER_PAHLAVI_name, &const_BLOCK_CODE_PSALTER_PAHLAVI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_PSALTER_PAHLAVI_name); + zend_string_release_ex(const_BLOCK_CODE_PSALTER_PAHLAVI_name, true); zval const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_value; ZVAL_LONG(&const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_value, UBLOCK_SHORTHAND_FORMAT_CONTROLS); - zend_string *const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_name = zend_string_init_interned("BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS", sizeof("BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS") - 1, 1); + zend_string *const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_name = zend_string_init_interned("BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS", sizeof("BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_name, &const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_name); + zend_string_release_ex(const_BLOCK_CODE_SHORTHAND_FORMAT_CONTROLS_name, true); zval const_BLOCK_CODE_SIDDHAM_value; ZVAL_LONG(&const_BLOCK_CODE_SIDDHAM_value, UBLOCK_SIDDHAM); - zend_string *const_BLOCK_CODE_SIDDHAM_name = zend_string_init_interned("BLOCK_CODE_SIDDHAM", sizeof("BLOCK_CODE_SIDDHAM") - 1, 1); + zend_string *const_BLOCK_CODE_SIDDHAM_name = zend_string_init_interned("BLOCK_CODE_SIDDHAM", sizeof("BLOCK_CODE_SIDDHAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SIDDHAM_name, &const_BLOCK_CODE_SIDDHAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SIDDHAM_name); + zend_string_release_ex(const_BLOCK_CODE_SIDDHAM_name, true); zval const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_value; ZVAL_LONG(&const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_value, UBLOCK_SINHALA_ARCHAIC_NUMBERS); - zend_string *const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS", sizeof("BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS") - 1, 1); + zend_string *const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_name = zend_string_init_interned("BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS", sizeof("BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_name, &const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_name); + zend_string_release_ex(const_BLOCK_CODE_SINHALA_ARCHAIC_NUMBERS_name, true); zval const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_value; ZVAL_LONG(&const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_value, UBLOCK_SUPPLEMENTAL_ARROWS_C); - zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_C", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_C") - 1, 1); + zend_string *const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_name = zend_string_init_interned("BLOCK_CODE_SUPPLEMENTAL_ARROWS_C", sizeof("BLOCK_CODE_SUPPLEMENTAL_ARROWS_C") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_name, &const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_name); + zend_string_release_ex(const_BLOCK_CODE_SUPPLEMENTAL_ARROWS_C_name, true); zval const_BLOCK_CODE_TIRHUTA_value; ZVAL_LONG(&const_BLOCK_CODE_TIRHUTA_value, UBLOCK_TIRHUTA); - zend_string *const_BLOCK_CODE_TIRHUTA_name = zend_string_init_interned("BLOCK_CODE_TIRHUTA", sizeof("BLOCK_CODE_TIRHUTA") - 1, 1); + zend_string *const_BLOCK_CODE_TIRHUTA_name = zend_string_init_interned("BLOCK_CODE_TIRHUTA", sizeof("BLOCK_CODE_TIRHUTA") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_TIRHUTA_name, &const_BLOCK_CODE_TIRHUTA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_TIRHUTA_name); + zend_string_release_ex(const_BLOCK_CODE_TIRHUTA_name, true); zval const_BLOCK_CODE_WARANG_CITI_value; ZVAL_LONG(&const_BLOCK_CODE_WARANG_CITI_value, UBLOCK_WARANG_CITI); - zend_string *const_BLOCK_CODE_WARANG_CITI_name = zend_string_init_interned("BLOCK_CODE_WARANG_CITI", sizeof("BLOCK_CODE_WARANG_CITI") - 1, 1); + zend_string *const_BLOCK_CODE_WARANG_CITI_name = zend_string_init_interned("BLOCK_CODE_WARANG_CITI", sizeof("BLOCK_CODE_WARANG_CITI") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_WARANG_CITI_name, &const_BLOCK_CODE_WARANG_CITI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_WARANG_CITI_name); + zend_string_release_ex(const_BLOCK_CODE_WARANG_CITI_name, true); zval const_BLOCK_CODE_COUNT_value; ZVAL_LONG(&const_BLOCK_CODE_COUNT_value, UBLOCK_COUNT); - zend_string *const_BLOCK_CODE_COUNT_name = zend_string_init_interned("BLOCK_CODE_COUNT", sizeof("BLOCK_CODE_COUNT") - 1, 1); + zend_string *const_BLOCK_CODE_COUNT_name = zend_string_init_interned("BLOCK_CODE_COUNT", sizeof("BLOCK_CODE_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_COUNT_name, &const_BLOCK_CODE_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_COUNT_name); + zend_string_release_ex(const_BLOCK_CODE_COUNT_name, true); zval const_BLOCK_CODE_INVALID_CODE_value; ZVAL_LONG(&const_BLOCK_CODE_INVALID_CODE_value, UBLOCK_INVALID_CODE); - zend_string *const_BLOCK_CODE_INVALID_CODE_name = zend_string_init_interned("BLOCK_CODE_INVALID_CODE", sizeof("BLOCK_CODE_INVALID_CODE") - 1, 1); + zend_string *const_BLOCK_CODE_INVALID_CODE_name = zend_string_init_interned("BLOCK_CODE_INVALID_CODE", sizeof("BLOCK_CODE_INVALID_CODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BLOCK_CODE_INVALID_CODE_name, &const_BLOCK_CODE_INVALID_CODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BLOCK_CODE_INVALID_CODE_name); + zend_string_release_ex(const_BLOCK_CODE_INVALID_CODE_name, true); zval const_BPT_NONE_value; ZVAL_LONG(&const_BPT_NONE_value, U_BPT_NONE); - zend_string *const_BPT_NONE_name = zend_string_init_interned("BPT_NONE", sizeof("BPT_NONE") - 1, 1); + zend_string *const_BPT_NONE_name = zend_string_init_interned("BPT_NONE", sizeof("BPT_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BPT_NONE_name, &const_BPT_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BPT_NONE_name); + zend_string_release_ex(const_BPT_NONE_name, true); zval const_BPT_OPEN_value; ZVAL_LONG(&const_BPT_OPEN_value, U_BPT_OPEN); - zend_string *const_BPT_OPEN_name = zend_string_init_interned("BPT_OPEN", sizeof("BPT_OPEN") - 1, 1); + zend_string *const_BPT_OPEN_name = zend_string_init_interned("BPT_OPEN", sizeof("BPT_OPEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_BPT_OPEN_name, &const_BPT_OPEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BPT_OPEN_name); + zend_string_release_ex(const_BPT_OPEN_name, true); zval const_BPT_CLOSE_value; ZVAL_LONG(&const_BPT_CLOSE_value, U_BPT_CLOSE); - zend_string *const_BPT_CLOSE_name = zend_string_init_interned("BPT_CLOSE", sizeof("BPT_CLOSE") - 1, 1); + zend_string *const_BPT_CLOSE_name = zend_string_init_interned("BPT_CLOSE", sizeof("BPT_CLOSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_BPT_CLOSE_name, &const_BPT_CLOSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BPT_CLOSE_name); + zend_string_release_ex(const_BPT_CLOSE_name, true); zval const_BPT_COUNT_value; ZVAL_LONG(&const_BPT_COUNT_value, U_BPT_COUNT); - zend_string *const_BPT_COUNT_name = zend_string_init_interned("BPT_COUNT", sizeof("BPT_COUNT") - 1, 1); + zend_string *const_BPT_COUNT_name = zend_string_init_interned("BPT_COUNT", sizeof("BPT_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BPT_COUNT_name, &const_BPT_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BPT_COUNT_name); + zend_string_release_ex(const_BPT_COUNT_name, true); zval const_EA_NEUTRAL_value; ZVAL_LONG(&const_EA_NEUTRAL_value, U_EA_NEUTRAL); - zend_string *const_EA_NEUTRAL_name = zend_string_init_interned("EA_NEUTRAL", sizeof("EA_NEUTRAL") - 1, 1); + zend_string *const_EA_NEUTRAL_name = zend_string_init_interned("EA_NEUTRAL", sizeof("EA_NEUTRAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_NEUTRAL_name, &const_EA_NEUTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_NEUTRAL_name); + zend_string_release_ex(const_EA_NEUTRAL_name, true); zval const_EA_AMBIGUOUS_value; ZVAL_LONG(&const_EA_AMBIGUOUS_value, U_EA_AMBIGUOUS); - zend_string *const_EA_AMBIGUOUS_name = zend_string_init_interned("EA_AMBIGUOUS", sizeof("EA_AMBIGUOUS") - 1, 1); + zend_string *const_EA_AMBIGUOUS_name = zend_string_init_interned("EA_AMBIGUOUS", sizeof("EA_AMBIGUOUS") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_AMBIGUOUS_name, &const_EA_AMBIGUOUS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_AMBIGUOUS_name); + zend_string_release_ex(const_EA_AMBIGUOUS_name, true); zval const_EA_HALFWIDTH_value; ZVAL_LONG(&const_EA_HALFWIDTH_value, U_EA_HALFWIDTH); - zend_string *const_EA_HALFWIDTH_name = zend_string_init_interned("EA_HALFWIDTH", sizeof("EA_HALFWIDTH") - 1, 1); + zend_string *const_EA_HALFWIDTH_name = zend_string_init_interned("EA_HALFWIDTH", sizeof("EA_HALFWIDTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_HALFWIDTH_name, &const_EA_HALFWIDTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_HALFWIDTH_name); + zend_string_release_ex(const_EA_HALFWIDTH_name, true); zval const_EA_FULLWIDTH_value; ZVAL_LONG(&const_EA_FULLWIDTH_value, U_EA_FULLWIDTH); - zend_string *const_EA_FULLWIDTH_name = zend_string_init_interned("EA_FULLWIDTH", sizeof("EA_FULLWIDTH") - 1, 1); + zend_string *const_EA_FULLWIDTH_name = zend_string_init_interned("EA_FULLWIDTH", sizeof("EA_FULLWIDTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_FULLWIDTH_name, &const_EA_FULLWIDTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_FULLWIDTH_name); + zend_string_release_ex(const_EA_FULLWIDTH_name, true); zval const_EA_NARROW_value; ZVAL_LONG(&const_EA_NARROW_value, U_EA_NARROW); - zend_string *const_EA_NARROW_name = zend_string_init_interned("EA_NARROW", sizeof("EA_NARROW") - 1, 1); + zend_string *const_EA_NARROW_name = zend_string_init_interned("EA_NARROW", sizeof("EA_NARROW") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_NARROW_name, &const_EA_NARROW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_NARROW_name); + zend_string_release_ex(const_EA_NARROW_name, true); zval const_EA_WIDE_value; ZVAL_LONG(&const_EA_WIDE_value, U_EA_WIDE); - zend_string *const_EA_WIDE_name = zend_string_init_interned("EA_WIDE", sizeof("EA_WIDE") - 1, 1); + zend_string *const_EA_WIDE_name = zend_string_init_interned("EA_WIDE", sizeof("EA_WIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_WIDE_name, &const_EA_WIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_WIDE_name); + zend_string_release_ex(const_EA_WIDE_name, true); zval const_EA_COUNT_value; ZVAL_LONG(&const_EA_COUNT_value, U_EA_COUNT); - zend_string *const_EA_COUNT_name = zend_string_init_interned("EA_COUNT", sizeof("EA_COUNT") - 1, 1); + zend_string *const_EA_COUNT_name = zend_string_init_interned("EA_COUNT", sizeof("EA_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_EA_COUNT_name, &const_EA_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EA_COUNT_name); + zend_string_release_ex(const_EA_COUNT_name, true); zval const_UNICODE_CHAR_NAME_value; ZVAL_LONG(&const_UNICODE_CHAR_NAME_value, U_UNICODE_CHAR_NAME); - zend_string *const_UNICODE_CHAR_NAME_name = zend_string_init_interned("UNICODE_CHAR_NAME", sizeof("UNICODE_CHAR_NAME") - 1, 1); + zend_string *const_UNICODE_CHAR_NAME_name = zend_string_init_interned("UNICODE_CHAR_NAME", sizeof("UNICODE_CHAR_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNICODE_CHAR_NAME_name, &const_UNICODE_CHAR_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UNICODE_CHAR_NAME_name); + zend_string_release_ex(const_UNICODE_CHAR_NAME_name, true); zval const_UNICODE_10_CHAR_NAME_value; ZVAL_LONG(&const_UNICODE_10_CHAR_NAME_value, U_UNICODE_10_CHAR_NAME); - zend_string *const_UNICODE_10_CHAR_NAME_name = zend_string_init_interned("UNICODE_10_CHAR_NAME", sizeof("UNICODE_10_CHAR_NAME") - 1, 1); + zend_string *const_UNICODE_10_CHAR_NAME_name = zend_string_init_interned("UNICODE_10_CHAR_NAME", sizeof("UNICODE_10_CHAR_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNICODE_10_CHAR_NAME_name, &const_UNICODE_10_CHAR_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UNICODE_10_CHAR_NAME_name); + zend_string_release_ex(const_UNICODE_10_CHAR_NAME_name, true); zval const_EXTENDED_CHAR_NAME_value; ZVAL_LONG(&const_EXTENDED_CHAR_NAME_value, U_EXTENDED_CHAR_NAME); - zend_string *const_EXTENDED_CHAR_NAME_name = zend_string_init_interned("EXTENDED_CHAR_NAME", sizeof("EXTENDED_CHAR_NAME") - 1, 1); + zend_string *const_EXTENDED_CHAR_NAME_name = zend_string_init_interned("EXTENDED_CHAR_NAME", sizeof("EXTENDED_CHAR_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXTENDED_CHAR_NAME_name, &const_EXTENDED_CHAR_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXTENDED_CHAR_NAME_name); + zend_string_release_ex(const_EXTENDED_CHAR_NAME_name, true); zval const_CHAR_NAME_ALIAS_value; ZVAL_LONG(&const_CHAR_NAME_ALIAS_value, U_CHAR_NAME_ALIAS); - zend_string *const_CHAR_NAME_ALIAS_name = zend_string_init_interned("CHAR_NAME_ALIAS", sizeof("CHAR_NAME_ALIAS") - 1, 1); + zend_string *const_CHAR_NAME_ALIAS_name = zend_string_init_interned("CHAR_NAME_ALIAS", sizeof("CHAR_NAME_ALIAS") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_NAME_ALIAS_name, &const_CHAR_NAME_ALIAS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_NAME_ALIAS_name); + zend_string_release_ex(const_CHAR_NAME_ALIAS_name, true); zval const_CHAR_NAME_CHOICE_COUNT_value; ZVAL_LONG(&const_CHAR_NAME_CHOICE_COUNT_value, U_CHAR_NAME_CHOICE_COUNT); - zend_string *const_CHAR_NAME_CHOICE_COUNT_name = zend_string_init_interned("CHAR_NAME_CHOICE_COUNT", sizeof("CHAR_NAME_CHOICE_COUNT") - 1, 1); + zend_string *const_CHAR_NAME_CHOICE_COUNT_name = zend_string_init_interned("CHAR_NAME_CHOICE_COUNT", sizeof("CHAR_NAME_CHOICE_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHAR_NAME_CHOICE_COUNT_name, &const_CHAR_NAME_CHOICE_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHAR_NAME_CHOICE_COUNT_name); + zend_string_release_ex(const_CHAR_NAME_CHOICE_COUNT_name, true); zval const_SHORT_PROPERTY_NAME_value; ZVAL_LONG(&const_SHORT_PROPERTY_NAME_value, U_SHORT_PROPERTY_NAME); - zend_string *const_SHORT_PROPERTY_NAME_name = zend_string_init_interned("SHORT_PROPERTY_NAME", sizeof("SHORT_PROPERTY_NAME") - 1, 1); + zend_string *const_SHORT_PROPERTY_NAME_name = zend_string_init_interned("SHORT_PROPERTY_NAME", sizeof("SHORT_PROPERTY_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHORT_PROPERTY_NAME_name, &const_SHORT_PROPERTY_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHORT_PROPERTY_NAME_name); + zend_string_release_ex(const_SHORT_PROPERTY_NAME_name, true); zval const_LONG_PROPERTY_NAME_value; ZVAL_LONG(&const_LONG_PROPERTY_NAME_value, U_LONG_PROPERTY_NAME); - zend_string *const_LONG_PROPERTY_NAME_name = zend_string_init_interned("LONG_PROPERTY_NAME", sizeof("LONG_PROPERTY_NAME") - 1, 1); + zend_string *const_LONG_PROPERTY_NAME_name = zend_string_init_interned("LONG_PROPERTY_NAME", sizeof("LONG_PROPERTY_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_LONG_PROPERTY_NAME_name, &const_LONG_PROPERTY_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LONG_PROPERTY_NAME_name); + zend_string_release_ex(const_LONG_PROPERTY_NAME_name, true); zval const_PROPERTY_NAME_CHOICE_COUNT_value; ZVAL_LONG(&const_PROPERTY_NAME_CHOICE_COUNT_value, U_PROPERTY_NAME_CHOICE_COUNT); - zend_string *const_PROPERTY_NAME_CHOICE_COUNT_name = zend_string_init_interned("PROPERTY_NAME_CHOICE_COUNT", sizeof("PROPERTY_NAME_CHOICE_COUNT") - 1, 1); + zend_string *const_PROPERTY_NAME_CHOICE_COUNT_name = zend_string_init_interned("PROPERTY_NAME_CHOICE_COUNT", sizeof("PROPERTY_NAME_CHOICE_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PROPERTY_NAME_CHOICE_COUNT_name, &const_PROPERTY_NAME_CHOICE_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PROPERTY_NAME_CHOICE_COUNT_name); + zend_string_release_ex(const_PROPERTY_NAME_CHOICE_COUNT_name, true); zval const_DT_NONE_value; ZVAL_LONG(&const_DT_NONE_value, U_DT_NONE); - zend_string *const_DT_NONE_name = zend_string_init_interned("DT_NONE", sizeof("DT_NONE") - 1, 1); + zend_string *const_DT_NONE_name = zend_string_init_interned("DT_NONE", sizeof("DT_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_NONE_name, &const_DT_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_NONE_name); + zend_string_release_ex(const_DT_NONE_name, true); zval const_DT_CANONICAL_value; ZVAL_LONG(&const_DT_CANONICAL_value, U_DT_CANONICAL); - zend_string *const_DT_CANONICAL_name = zend_string_init_interned("DT_CANONICAL", sizeof("DT_CANONICAL") - 1, 1); + zend_string *const_DT_CANONICAL_name = zend_string_init_interned("DT_CANONICAL", sizeof("DT_CANONICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_CANONICAL_name, &const_DT_CANONICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_CANONICAL_name); + zend_string_release_ex(const_DT_CANONICAL_name, true); zval const_DT_COMPAT_value; ZVAL_LONG(&const_DT_COMPAT_value, U_DT_COMPAT); - zend_string *const_DT_COMPAT_name = zend_string_init_interned("DT_COMPAT", sizeof("DT_COMPAT") - 1, 1); + zend_string *const_DT_COMPAT_name = zend_string_init_interned("DT_COMPAT", sizeof("DT_COMPAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_COMPAT_name, &const_DT_COMPAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_COMPAT_name); + zend_string_release_ex(const_DT_COMPAT_name, true); zval const_DT_CIRCLE_value; ZVAL_LONG(&const_DT_CIRCLE_value, U_DT_CIRCLE); - zend_string *const_DT_CIRCLE_name = zend_string_init_interned("DT_CIRCLE", sizeof("DT_CIRCLE") - 1, 1); + zend_string *const_DT_CIRCLE_name = zend_string_init_interned("DT_CIRCLE", sizeof("DT_CIRCLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_CIRCLE_name, &const_DT_CIRCLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_CIRCLE_name); + zend_string_release_ex(const_DT_CIRCLE_name, true); zval const_DT_FINAL_value; ZVAL_LONG(&const_DT_FINAL_value, U_DT_FINAL); - zend_string *const_DT_FINAL_name = zend_string_init_interned("DT_FINAL", sizeof("DT_FINAL") - 1, 1); + zend_string *const_DT_FINAL_name = zend_string_init_interned("DT_FINAL", sizeof("DT_FINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_FINAL_name, &const_DT_FINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_FINAL_name); + zend_string_release_ex(const_DT_FINAL_name, true); zval const_DT_FONT_value; ZVAL_LONG(&const_DT_FONT_value, U_DT_FONT); - zend_string *const_DT_FONT_name = zend_string_init_interned("DT_FONT", sizeof("DT_FONT") - 1, 1); + zend_string *const_DT_FONT_name = zend_string_init_interned("DT_FONT", sizeof("DT_FONT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_FONT_name, &const_DT_FONT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_FONT_name); + zend_string_release_ex(const_DT_FONT_name, true); zval const_DT_FRACTION_value; ZVAL_LONG(&const_DT_FRACTION_value, U_DT_FRACTION); - zend_string *const_DT_FRACTION_name = zend_string_init_interned("DT_FRACTION", sizeof("DT_FRACTION") - 1, 1); + zend_string *const_DT_FRACTION_name = zend_string_init_interned("DT_FRACTION", sizeof("DT_FRACTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_FRACTION_name, &const_DT_FRACTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_FRACTION_name); + zend_string_release_ex(const_DT_FRACTION_name, true); zval const_DT_INITIAL_value; ZVAL_LONG(&const_DT_INITIAL_value, U_DT_INITIAL); - zend_string *const_DT_INITIAL_name = zend_string_init_interned("DT_INITIAL", sizeof("DT_INITIAL") - 1, 1); + zend_string *const_DT_INITIAL_name = zend_string_init_interned("DT_INITIAL", sizeof("DT_INITIAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_INITIAL_name, &const_DT_INITIAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_INITIAL_name); + zend_string_release_ex(const_DT_INITIAL_name, true); zval const_DT_ISOLATED_value; ZVAL_LONG(&const_DT_ISOLATED_value, U_DT_ISOLATED); - zend_string *const_DT_ISOLATED_name = zend_string_init_interned("DT_ISOLATED", sizeof("DT_ISOLATED") - 1, 1); + zend_string *const_DT_ISOLATED_name = zend_string_init_interned("DT_ISOLATED", sizeof("DT_ISOLATED") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_ISOLATED_name, &const_DT_ISOLATED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_ISOLATED_name); + zend_string_release_ex(const_DT_ISOLATED_name, true); zval const_DT_MEDIAL_value; ZVAL_LONG(&const_DT_MEDIAL_value, U_DT_MEDIAL); - zend_string *const_DT_MEDIAL_name = zend_string_init_interned("DT_MEDIAL", sizeof("DT_MEDIAL") - 1, 1); + zend_string *const_DT_MEDIAL_name = zend_string_init_interned("DT_MEDIAL", sizeof("DT_MEDIAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_MEDIAL_name, &const_DT_MEDIAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_MEDIAL_name); + zend_string_release_ex(const_DT_MEDIAL_name, true); zval const_DT_NARROW_value; ZVAL_LONG(&const_DT_NARROW_value, U_DT_NARROW); - zend_string *const_DT_NARROW_name = zend_string_init_interned("DT_NARROW", sizeof("DT_NARROW") - 1, 1); + zend_string *const_DT_NARROW_name = zend_string_init_interned("DT_NARROW", sizeof("DT_NARROW") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_NARROW_name, &const_DT_NARROW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_NARROW_name); + zend_string_release_ex(const_DT_NARROW_name, true); zval const_DT_NOBREAK_value; ZVAL_LONG(&const_DT_NOBREAK_value, U_DT_NOBREAK); - zend_string *const_DT_NOBREAK_name = zend_string_init_interned("DT_NOBREAK", sizeof("DT_NOBREAK") - 1, 1); + zend_string *const_DT_NOBREAK_name = zend_string_init_interned("DT_NOBREAK", sizeof("DT_NOBREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_NOBREAK_name, &const_DT_NOBREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_NOBREAK_name); + zend_string_release_ex(const_DT_NOBREAK_name, true); zval const_DT_SMALL_value; ZVAL_LONG(&const_DT_SMALL_value, U_DT_SMALL); - zend_string *const_DT_SMALL_name = zend_string_init_interned("DT_SMALL", sizeof("DT_SMALL") - 1, 1); + zend_string *const_DT_SMALL_name = zend_string_init_interned("DT_SMALL", sizeof("DT_SMALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_SMALL_name, &const_DT_SMALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_SMALL_name); + zend_string_release_ex(const_DT_SMALL_name, true); zval const_DT_SQUARE_value; ZVAL_LONG(&const_DT_SQUARE_value, U_DT_SQUARE); - zend_string *const_DT_SQUARE_name = zend_string_init_interned("DT_SQUARE", sizeof("DT_SQUARE") - 1, 1); + zend_string *const_DT_SQUARE_name = zend_string_init_interned("DT_SQUARE", sizeof("DT_SQUARE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_SQUARE_name, &const_DT_SQUARE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_SQUARE_name); + zend_string_release_ex(const_DT_SQUARE_name, true); zval const_DT_SUB_value; ZVAL_LONG(&const_DT_SUB_value, U_DT_SUB); - zend_string *const_DT_SUB_name = zend_string_init_interned("DT_SUB", sizeof("DT_SUB") - 1, 1); + zend_string *const_DT_SUB_name = zend_string_init_interned("DT_SUB", sizeof("DT_SUB") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_SUB_name, &const_DT_SUB_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_SUB_name); + zend_string_release_ex(const_DT_SUB_name, true); zval const_DT_SUPER_value; ZVAL_LONG(&const_DT_SUPER_value, U_DT_SUPER); - zend_string *const_DT_SUPER_name = zend_string_init_interned("DT_SUPER", sizeof("DT_SUPER") - 1, 1); + zend_string *const_DT_SUPER_name = zend_string_init_interned("DT_SUPER", sizeof("DT_SUPER") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_SUPER_name, &const_DT_SUPER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_SUPER_name); + zend_string_release_ex(const_DT_SUPER_name, true); zval const_DT_VERTICAL_value; ZVAL_LONG(&const_DT_VERTICAL_value, U_DT_VERTICAL); - zend_string *const_DT_VERTICAL_name = zend_string_init_interned("DT_VERTICAL", sizeof("DT_VERTICAL") - 1, 1); + zend_string *const_DT_VERTICAL_name = zend_string_init_interned("DT_VERTICAL", sizeof("DT_VERTICAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_VERTICAL_name, &const_DT_VERTICAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_VERTICAL_name); + zend_string_release_ex(const_DT_VERTICAL_name, true); zval const_DT_WIDE_value; ZVAL_LONG(&const_DT_WIDE_value, U_DT_WIDE); - zend_string *const_DT_WIDE_name = zend_string_init_interned("DT_WIDE", sizeof("DT_WIDE") - 1, 1); + zend_string *const_DT_WIDE_name = zend_string_init_interned("DT_WIDE", sizeof("DT_WIDE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_WIDE_name, &const_DT_WIDE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_WIDE_name); + zend_string_release_ex(const_DT_WIDE_name, true); zval const_DT_COUNT_value; ZVAL_LONG(&const_DT_COUNT_value, U_DT_COUNT); - zend_string *const_DT_COUNT_name = zend_string_init_interned("DT_COUNT", sizeof("DT_COUNT") - 1, 1); + zend_string *const_DT_COUNT_name = zend_string_init_interned("DT_COUNT", sizeof("DT_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DT_COUNT_name, &const_DT_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DT_COUNT_name); + zend_string_release_ex(const_DT_COUNT_name, true); zval const_JT_NON_JOINING_value; ZVAL_LONG(&const_JT_NON_JOINING_value, U_JT_NON_JOINING); - zend_string *const_JT_NON_JOINING_name = zend_string_init_interned("JT_NON_JOINING", sizeof("JT_NON_JOINING") - 1, 1); + zend_string *const_JT_NON_JOINING_name = zend_string_init_interned("JT_NON_JOINING", sizeof("JT_NON_JOINING") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_NON_JOINING_name, &const_JT_NON_JOINING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_NON_JOINING_name); + zend_string_release_ex(const_JT_NON_JOINING_name, true); zval const_JT_JOIN_CAUSING_value; ZVAL_LONG(&const_JT_JOIN_CAUSING_value, U_JT_JOIN_CAUSING); - zend_string *const_JT_JOIN_CAUSING_name = zend_string_init_interned("JT_JOIN_CAUSING", sizeof("JT_JOIN_CAUSING") - 1, 1); + zend_string *const_JT_JOIN_CAUSING_name = zend_string_init_interned("JT_JOIN_CAUSING", sizeof("JT_JOIN_CAUSING") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_JOIN_CAUSING_name, &const_JT_JOIN_CAUSING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_JOIN_CAUSING_name); + zend_string_release_ex(const_JT_JOIN_CAUSING_name, true); zval const_JT_DUAL_JOINING_value; ZVAL_LONG(&const_JT_DUAL_JOINING_value, U_JT_DUAL_JOINING); - zend_string *const_JT_DUAL_JOINING_name = zend_string_init_interned("JT_DUAL_JOINING", sizeof("JT_DUAL_JOINING") - 1, 1); + zend_string *const_JT_DUAL_JOINING_name = zend_string_init_interned("JT_DUAL_JOINING", sizeof("JT_DUAL_JOINING") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_DUAL_JOINING_name, &const_JT_DUAL_JOINING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_DUAL_JOINING_name); + zend_string_release_ex(const_JT_DUAL_JOINING_name, true); zval const_JT_LEFT_JOINING_value; ZVAL_LONG(&const_JT_LEFT_JOINING_value, U_JT_LEFT_JOINING); - zend_string *const_JT_LEFT_JOINING_name = zend_string_init_interned("JT_LEFT_JOINING", sizeof("JT_LEFT_JOINING") - 1, 1); + zend_string *const_JT_LEFT_JOINING_name = zend_string_init_interned("JT_LEFT_JOINING", sizeof("JT_LEFT_JOINING") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_LEFT_JOINING_name, &const_JT_LEFT_JOINING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_LEFT_JOINING_name); + zend_string_release_ex(const_JT_LEFT_JOINING_name, true); zval const_JT_RIGHT_JOINING_value; ZVAL_LONG(&const_JT_RIGHT_JOINING_value, U_JT_RIGHT_JOINING); - zend_string *const_JT_RIGHT_JOINING_name = zend_string_init_interned("JT_RIGHT_JOINING", sizeof("JT_RIGHT_JOINING") - 1, 1); + zend_string *const_JT_RIGHT_JOINING_name = zend_string_init_interned("JT_RIGHT_JOINING", sizeof("JT_RIGHT_JOINING") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_RIGHT_JOINING_name, &const_JT_RIGHT_JOINING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_RIGHT_JOINING_name); + zend_string_release_ex(const_JT_RIGHT_JOINING_name, true); zval const_JT_TRANSPARENT_value; ZVAL_LONG(&const_JT_TRANSPARENT_value, U_JT_TRANSPARENT); - zend_string *const_JT_TRANSPARENT_name = zend_string_init_interned("JT_TRANSPARENT", sizeof("JT_TRANSPARENT") - 1, 1); + zend_string *const_JT_TRANSPARENT_name = zend_string_init_interned("JT_TRANSPARENT", sizeof("JT_TRANSPARENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_TRANSPARENT_name, &const_JT_TRANSPARENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_TRANSPARENT_name); + zend_string_release_ex(const_JT_TRANSPARENT_name, true); zval const_JT_COUNT_value; ZVAL_LONG(&const_JT_COUNT_value, U_JT_COUNT); - zend_string *const_JT_COUNT_name = zend_string_init_interned("JT_COUNT", sizeof("JT_COUNT") - 1, 1); + zend_string *const_JT_COUNT_name = zend_string_init_interned("JT_COUNT", sizeof("JT_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_JT_COUNT_name, &const_JT_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JT_COUNT_name); + zend_string_release_ex(const_JT_COUNT_name, true); zval const_JG_NO_JOINING_GROUP_value; ZVAL_LONG(&const_JG_NO_JOINING_GROUP_value, U_JG_NO_JOINING_GROUP); - zend_string *const_JG_NO_JOINING_GROUP_name = zend_string_init_interned("JG_NO_JOINING_GROUP", sizeof("JG_NO_JOINING_GROUP") - 1, 1); + zend_string *const_JG_NO_JOINING_GROUP_name = zend_string_init_interned("JG_NO_JOINING_GROUP", sizeof("JG_NO_JOINING_GROUP") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_NO_JOINING_GROUP_name, &const_JG_NO_JOINING_GROUP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_NO_JOINING_GROUP_name); + zend_string_release_ex(const_JG_NO_JOINING_GROUP_name, true); zval const_JG_AIN_value; ZVAL_LONG(&const_JG_AIN_value, U_JG_AIN); - zend_string *const_JG_AIN_name = zend_string_init_interned("JG_AIN", sizeof("JG_AIN") - 1, 1); + zend_string *const_JG_AIN_name = zend_string_init_interned("JG_AIN", sizeof("JG_AIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_AIN_name, &const_JG_AIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_AIN_name); + zend_string_release_ex(const_JG_AIN_name, true); zval const_JG_ALAPH_value; ZVAL_LONG(&const_JG_ALAPH_value, U_JG_ALAPH); - zend_string *const_JG_ALAPH_name = zend_string_init_interned("JG_ALAPH", sizeof("JG_ALAPH") - 1, 1); + zend_string *const_JG_ALAPH_name = zend_string_init_interned("JG_ALAPH", sizeof("JG_ALAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_ALAPH_name, &const_JG_ALAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_ALAPH_name); + zend_string_release_ex(const_JG_ALAPH_name, true); zval const_JG_ALEF_value; ZVAL_LONG(&const_JG_ALEF_value, U_JG_ALEF); - zend_string *const_JG_ALEF_name = zend_string_init_interned("JG_ALEF", sizeof("JG_ALEF") - 1, 1); + zend_string *const_JG_ALEF_name = zend_string_init_interned("JG_ALEF", sizeof("JG_ALEF") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_ALEF_name, &const_JG_ALEF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_ALEF_name); + zend_string_release_ex(const_JG_ALEF_name, true); zval const_JG_BEH_value; ZVAL_LONG(&const_JG_BEH_value, U_JG_BEH); - zend_string *const_JG_BEH_name = zend_string_init_interned("JG_BEH", sizeof("JG_BEH") - 1, 1); + zend_string *const_JG_BEH_name = zend_string_init_interned("JG_BEH", sizeof("JG_BEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_BEH_name, &const_JG_BEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_BEH_name); + zend_string_release_ex(const_JG_BEH_name, true); zval const_JG_BETH_value; ZVAL_LONG(&const_JG_BETH_value, U_JG_BETH); - zend_string *const_JG_BETH_name = zend_string_init_interned("JG_BETH", sizeof("JG_BETH") - 1, 1); + zend_string *const_JG_BETH_name = zend_string_init_interned("JG_BETH", sizeof("JG_BETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_BETH_name, &const_JG_BETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_BETH_name); + zend_string_release_ex(const_JG_BETH_name, true); zval const_JG_DAL_value; ZVAL_LONG(&const_JG_DAL_value, U_JG_DAL); - zend_string *const_JG_DAL_name = zend_string_init_interned("JG_DAL", sizeof("JG_DAL") - 1, 1); + zend_string *const_JG_DAL_name = zend_string_init_interned("JG_DAL", sizeof("JG_DAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_DAL_name, &const_JG_DAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_DAL_name); + zend_string_release_ex(const_JG_DAL_name, true); zval const_JG_DALATH_RISH_value; ZVAL_LONG(&const_JG_DALATH_RISH_value, U_JG_DALATH_RISH); - zend_string *const_JG_DALATH_RISH_name = zend_string_init_interned("JG_DALATH_RISH", sizeof("JG_DALATH_RISH") - 1, 1); + zend_string *const_JG_DALATH_RISH_name = zend_string_init_interned("JG_DALATH_RISH", sizeof("JG_DALATH_RISH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_DALATH_RISH_name, &const_JG_DALATH_RISH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_DALATH_RISH_name); + zend_string_release_ex(const_JG_DALATH_RISH_name, true); zval const_JG_E_value; ZVAL_LONG(&const_JG_E_value, U_JG_E); - zend_string *const_JG_E_name = zend_string_init_interned("JG_E", sizeof("JG_E") - 1, 1); + zend_string *const_JG_E_name = zend_string_init_interned("JG_E", sizeof("JG_E") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_E_name, &const_JG_E_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_E_name); + zend_string_release_ex(const_JG_E_name, true); zval const_JG_FEH_value; ZVAL_LONG(&const_JG_FEH_value, U_JG_FEH); - zend_string *const_JG_FEH_name = zend_string_init_interned("JG_FEH", sizeof("JG_FEH") - 1, 1); + zend_string *const_JG_FEH_name = zend_string_init_interned("JG_FEH", sizeof("JG_FEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_FEH_name, &const_JG_FEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_FEH_name); + zend_string_release_ex(const_JG_FEH_name, true); zval const_JG_FINAL_SEMKATH_value; ZVAL_LONG(&const_JG_FINAL_SEMKATH_value, U_JG_FINAL_SEMKATH); - zend_string *const_JG_FINAL_SEMKATH_name = zend_string_init_interned("JG_FINAL_SEMKATH", sizeof("JG_FINAL_SEMKATH") - 1, 1); + zend_string *const_JG_FINAL_SEMKATH_name = zend_string_init_interned("JG_FINAL_SEMKATH", sizeof("JG_FINAL_SEMKATH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_FINAL_SEMKATH_name, &const_JG_FINAL_SEMKATH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_FINAL_SEMKATH_name); + zend_string_release_ex(const_JG_FINAL_SEMKATH_name, true); zval const_JG_GAF_value; ZVAL_LONG(&const_JG_GAF_value, U_JG_GAF); - zend_string *const_JG_GAF_name = zend_string_init_interned("JG_GAF", sizeof("JG_GAF") - 1, 1); + zend_string *const_JG_GAF_name = zend_string_init_interned("JG_GAF", sizeof("JG_GAF") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_GAF_name, &const_JG_GAF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_GAF_name); + zend_string_release_ex(const_JG_GAF_name, true); zval const_JG_GAMAL_value; ZVAL_LONG(&const_JG_GAMAL_value, U_JG_GAMAL); - zend_string *const_JG_GAMAL_name = zend_string_init_interned("JG_GAMAL", sizeof("JG_GAMAL") - 1, 1); + zend_string *const_JG_GAMAL_name = zend_string_init_interned("JG_GAMAL", sizeof("JG_GAMAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_GAMAL_name, &const_JG_GAMAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_GAMAL_name); + zend_string_release_ex(const_JG_GAMAL_name, true); zval const_JG_HAH_value; ZVAL_LONG(&const_JG_HAH_value, U_JG_HAH); - zend_string *const_JG_HAH_name = zend_string_init_interned("JG_HAH", sizeof("JG_HAH") - 1, 1); + zend_string *const_JG_HAH_name = zend_string_init_interned("JG_HAH", sizeof("JG_HAH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HAH_name, &const_JG_HAH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HAH_name); + zend_string_release_ex(const_JG_HAH_name, true); zval const_JG_TEH_MARBUTA_GOAL_value; ZVAL_LONG(&const_JG_TEH_MARBUTA_GOAL_value, U_JG_TEH_MARBUTA_GOAL); - zend_string *const_JG_TEH_MARBUTA_GOAL_name = zend_string_init_interned("JG_TEH_MARBUTA_GOAL", sizeof("JG_TEH_MARBUTA_GOAL") - 1, 1); + zend_string *const_JG_TEH_MARBUTA_GOAL_name = zend_string_init_interned("JG_TEH_MARBUTA_GOAL", sizeof("JG_TEH_MARBUTA_GOAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_TEH_MARBUTA_GOAL_name, &const_JG_TEH_MARBUTA_GOAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_TEH_MARBUTA_GOAL_name); + zend_string_release_ex(const_JG_TEH_MARBUTA_GOAL_name, true); zval const_JG_HAMZA_ON_HEH_GOAL_value; ZVAL_LONG(&const_JG_HAMZA_ON_HEH_GOAL_value, U_JG_HAMZA_ON_HEH_GOAL); - zend_string *const_JG_HAMZA_ON_HEH_GOAL_name = zend_string_init_interned("JG_HAMZA_ON_HEH_GOAL", sizeof("JG_HAMZA_ON_HEH_GOAL") - 1, 1); + zend_string *const_JG_HAMZA_ON_HEH_GOAL_name = zend_string_init_interned("JG_HAMZA_ON_HEH_GOAL", sizeof("JG_HAMZA_ON_HEH_GOAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HAMZA_ON_HEH_GOAL_name, &const_JG_HAMZA_ON_HEH_GOAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HAMZA_ON_HEH_GOAL_name); + zend_string_release_ex(const_JG_HAMZA_ON_HEH_GOAL_name, true); zval const_JG_HE_value; ZVAL_LONG(&const_JG_HE_value, U_JG_HE); - zend_string *const_JG_HE_name = zend_string_init_interned("JG_HE", sizeof("JG_HE") - 1, 1); + zend_string *const_JG_HE_name = zend_string_init_interned("JG_HE", sizeof("JG_HE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HE_name, &const_JG_HE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HE_name); + zend_string_release_ex(const_JG_HE_name, true); zval const_JG_HEH_value; ZVAL_LONG(&const_JG_HEH_value, U_JG_HEH); - zend_string *const_JG_HEH_name = zend_string_init_interned("JG_HEH", sizeof("JG_HEH") - 1, 1); + zend_string *const_JG_HEH_name = zend_string_init_interned("JG_HEH", sizeof("JG_HEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HEH_name, &const_JG_HEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HEH_name); + zend_string_release_ex(const_JG_HEH_name, true); zval const_JG_HEH_GOAL_value; ZVAL_LONG(&const_JG_HEH_GOAL_value, U_JG_HEH_GOAL); - zend_string *const_JG_HEH_GOAL_name = zend_string_init_interned("JG_HEH_GOAL", sizeof("JG_HEH_GOAL") - 1, 1); + zend_string *const_JG_HEH_GOAL_name = zend_string_init_interned("JG_HEH_GOAL", sizeof("JG_HEH_GOAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HEH_GOAL_name, &const_JG_HEH_GOAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HEH_GOAL_name); + zend_string_release_ex(const_JG_HEH_GOAL_name, true); zval const_JG_HETH_value; ZVAL_LONG(&const_JG_HETH_value, U_JG_HETH); - zend_string *const_JG_HETH_name = zend_string_init_interned("JG_HETH", sizeof("JG_HETH") - 1, 1); + zend_string *const_JG_HETH_name = zend_string_init_interned("JG_HETH", sizeof("JG_HETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_HETH_name, &const_JG_HETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_HETH_name); + zend_string_release_ex(const_JG_HETH_name, true); zval const_JG_KAF_value; ZVAL_LONG(&const_JG_KAF_value, U_JG_KAF); - zend_string *const_JG_KAF_name = zend_string_init_interned("JG_KAF", sizeof("JG_KAF") - 1, 1); + zend_string *const_JG_KAF_name = zend_string_init_interned("JG_KAF", sizeof("JG_KAF") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_KAF_name, &const_JG_KAF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_KAF_name); + zend_string_release_ex(const_JG_KAF_name, true); zval const_JG_KAPH_value; ZVAL_LONG(&const_JG_KAPH_value, U_JG_KAPH); - zend_string *const_JG_KAPH_name = zend_string_init_interned("JG_KAPH", sizeof("JG_KAPH") - 1, 1); + zend_string *const_JG_KAPH_name = zend_string_init_interned("JG_KAPH", sizeof("JG_KAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_KAPH_name, &const_JG_KAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_KAPH_name); + zend_string_release_ex(const_JG_KAPH_name, true); zval const_JG_KNOTTED_HEH_value; ZVAL_LONG(&const_JG_KNOTTED_HEH_value, U_JG_KNOTTED_HEH); - zend_string *const_JG_KNOTTED_HEH_name = zend_string_init_interned("JG_KNOTTED_HEH", sizeof("JG_KNOTTED_HEH") - 1, 1); + zend_string *const_JG_KNOTTED_HEH_name = zend_string_init_interned("JG_KNOTTED_HEH", sizeof("JG_KNOTTED_HEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_KNOTTED_HEH_name, &const_JG_KNOTTED_HEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_KNOTTED_HEH_name); + zend_string_release_ex(const_JG_KNOTTED_HEH_name, true); zval const_JG_LAM_value; ZVAL_LONG(&const_JG_LAM_value, U_JG_LAM); - zend_string *const_JG_LAM_name = zend_string_init_interned("JG_LAM", sizeof("JG_LAM") - 1, 1); + zend_string *const_JG_LAM_name = zend_string_init_interned("JG_LAM", sizeof("JG_LAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_LAM_name, &const_JG_LAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_LAM_name); + zend_string_release_ex(const_JG_LAM_name, true); zval const_JG_LAMADH_value; ZVAL_LONG(&const_JG_LAMADH_value, U_JG_LAMADH); - zend_string *const_JG_LAMADH_name = zend_string_init_interned("JG_LAMADH", sizeof("JG_LAMADH") - 1, 1); + zend_string *const_JG_LAMADH_name = zend_string_init_interned("JG_LAMADH", sizeof("JG_LAMADH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_LAMADH_name, &const_JG_LAMADH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_LAMADH_name); + zend_string_release_ex(const_JG_LAMADH_name, true); zval const_JG_MEEM_value; ZVAL_LONG(&const_JG_MEEM_value, U_JG_MEEM); - zend_string *const_JG_MEEM_name = zend_string_init_interned("JG_MEEM", sizeof("JG_MEEM") - 1, 1); + zend_string *const_JG_MEEM_name = zend_string_init_interned("JG_MEEM", sizeof("JG_MEEM") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MEEM_name, &const_JG_MEEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MEEM_name); + zend_string_release_ex(const_JG_MEEM_name, true); zval const_JG_MIM_value; ZVAL_LONG(&const_JG_MIM_value, U_JG_MIM); - zend_string *const_JG_MIM_name = zend_string_init_interned("JG_MIM", sizeof("JG_MIM") - 1, 1); + zend_string *const_JG_MIM_name = zend_string_init_interned("JG_MIM", sizeof("JG_MIM") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MIM_name, &const_JG_MIM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MIM_name); + zend_string_release_ex(const_JG_MIM_name, true); zval const_JG_NOON_value; ZVAL_LONG(&const_JG_NOON_value, U_JG_NOON); - zend_string *const_JG_NOON_name = zend_string_init_interned("JG_NOON", sizeof("JG_NOON") - 1, 1); + zend_string *const_JG_NOON_name = zend_string_init_interned("JG_NOON", sizeof("JG_NOON") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_NOON_name, &const_JG_NOON_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_NOON_name); + zend_string_release_ex(const_JG_NOON_name, true); zval const_JG_NUN_value; ZVAL_LONG(&const_JG_NUN_value, U_JG_NUN); - zend_string *const_JG_NUN_name = zend_string_init_interned("JG_NUN", sizeof("JG_NUN") - 1, 1); + zend_string *const_JG_NUN_name = zend_string_init_interned("JG_NUN", sizeof("JG_NUN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_NUN_name, &const_JG_NUN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_NUN_name); + zend_string_release_ex(const_JG_NUN_name, true); zval const_JG_PE_value; ZVAL_LONG(&const_JG_PE_value, U_JG_PE); - zend_string *const_JG_PE_name = zend_string_init_interned("JG_PE", sizeof("JG_PE") - 1, 1); + zend_string *const_JG_PE_name = zend_string_init_interned("JG_PE", sizeof("JG_PE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_PE_name, &const_JG_PE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_PE_name); + zend_string_release_ex(const_JG_PE_name, true); zval const_JG_QAF_value; ZVAL_LONG(&const_JG_QAF_value, U_JG_QAF); - zend_string *const_JG_QAF_name = zend_string_init_interned("JG_QAF", sizeof("JG_QAF") - 1, 1); + zend_string *const_JG_QAF_name = zend_string_init_interned("JG_QAF", sizeof("JG_QAF") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_QAF_name, &const_JG_QAF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_QAF_name); + zend_string_release_ex(const_JG_QAF_name, true); zval const_JG_QAPH_value; ZVAL_LONG(&const_JG_QAPH_value, U_JG_QAPH); - zend_string *const_JG_QAPH_name = zend_string_init_interned("JG_QAPH", sizeof("JG_QAPH") - 1, 1); + zend_string *const_JG_QAPH_name = zend_string_init_interned("JG_QAPH", sizeof("JG_QAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_QAPH_name, &const_JG_QAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_QAPH_name); + zend_string_release_ex(const_JG_QAPH_name, true); zval const_JG_REH_value; ZVAL_LONG(&const_JG_REH_value, U_JG_REH); - zend_string *const_JG_REH_name = zend_string_init_interned("JG_REH", sizeof("JG_REH") - 1, 1); + zend_string *const_JG_REH_name = zend_string_init_interned("JG_REH", sizeof("JG_REH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_REH_name, &const_JG_REH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_REH_name); + zend_string_release_ex(const_JG_REH_name, true); zval const_JG_REVERSED_PE_value; ZVAL_LONG(&const_JG_REVERSED_PE_value, U_JG_REVERSED_PE); - zend_string *const_JG_REVERSED_PE_name = zend_string_init_interned("JG_REVERSED_PE", sizeof("JG_REVERSED_PE") - 1, 1); + zend_string *const_JG_REVERSED_PE_name = zend_string_init_interned("JG_REVERSED_PE", sizeof("JG_REVERSED_PE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_REVERSED_PE_name, &const_JG_REVERSED_PE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_REVERSED_PE_name); + zend_string_release_ex(const_JG_REVERSED_PE_name, true); zval const_JG_SAD_value; ZVAL_LONG(&const_JG_SAD_value, U_JG_SAD); - zend_string *const_JG_SAD_name = zend_string_init_interned("JG_SAD", sizeof("JG_SAD") - 1, 1); + zend_string *const_JG_SAD_name = zend_string_init_interned("JG_SAD", sizeof("JG_SAD") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SAD_name, &const_JG_SAD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SAD_name); + zend_string_release_ex(const_JG_SAD_name, true); zval const_JG_SADHE_value; ZVAL_LONG(&const_JG_SADHE_value, U_JG_SADHE); - zend_string *const_JG_SADHE_name = zend_string_init_interned("JG_SADHE", sizeof("JG_SADHE") - 1, 1); + zend_string *const_JG_SADHE_name = zend_string_init_interned("JG_SADHE", sizeof("JG_SADHE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SADHE_name, &const_JG_SADHE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SADHE_name); + zend_string_release_ex(const_JG_SADHE_name, true); zval const_JG_SEEN_value; ZVAL_LONG(&const_JG_SEEN_value, U_JG_SEEN); - zend_string *const_JG_SEEN_name = zend_string_init_interned("JG_SEEN", sizeof("JG_SEEN") - 1, 1); + zend_string *const_JG_SEEN_name = zend_string_init_interned("JG_SEEN", sizeof("JG_SEEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SEEN_name, &const_JG_SEEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SEEN_name); + zend_string_release_ex(const_JG_SEEN_name, true); zval const_JG_SEMKATH_value; ZVAL_LONG(&const_JG_SEMKATH_value, U_JG_SEMKATH); - zend_string *const_JG_SEMKATH_name = zend_string_init_interned("JG_SEMKATH", sizeof("JG_SEMKATH") - 1, 1); + zend_string *const_JG_SEMKATH_name = zend_string_init_interned("JG_SEMKATH", sizeof("JG_SEMKATH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SEMKATH_name, &const_JG_SEMKATH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SEMKATH_name); + zend_string_release_ex(const_JG_SEMKATH_name, true); zval const_JG_SHIN_value; ZVAL_LONG(&const_JG_SHIN_value, U_JG_SHIN); - zend_string *const_JG_SHIN_name = zend_string_init_interned("JG_SHIN", sizeof("JG_SHIN") - 1, 1); + zend_string *const_JG_SHIN_name = zend_string_init_interned("JG_SHIN", sizeof("JG_SHIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SHIN_name, &const_JG_SHIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SHIN_name); + zend_string_release_ex(const_JG_SHIN_name, true); zval const_JG_SWASH_KAF_value; ZVAL_LONG(&const_JG_SWASH_KAF_value, U_JG_SWASH_KAF); - zend_string *const_JG_SWASH_KAF_name = zend_string_init_interned("JG_SWASH_KAF", sizeof("JG_SWASH_KAF") - 1, 1); + zend_string *const_JG_SWASH_KAF_name = zend_string_init_interned("JG_SWASH_KAF", sizeof("JG_SWASH_KAF") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SWASH_KAF_name, &const_JG_SWASH_KAF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SWASH_KAF_name); + zend_string_release_ex(const_JG_SWASH_KAF_name, true); zval const_JG_SYRIAC_WAW_value; ZVAL_LONG(&const_JG_SYRIAC_WAW_value, U_JG_SYRIAC_WAW); - zend_string *const_JG_SYRIAC_WAW_name = zend_string_init_interned("JG_SYRIAC_WAW", sizeof("JG_SYRIAC_WAW") - 1, 1); + zend_string *const_JG_SYRIAC_WAW_name = zend_string_init_interned("JG_SYRIAC_WAW", sizeof("JG_SYRIAC_WAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_SYRIAC_WAW_name, &const_JG_SYRIAC_WAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_SYRIAC_WAW_name); + zend_string_release_ex(const_JG_SYRIAC_WAW_name, true); zval const_JG_TAH_value; ZVAL_LONG(&const_JG_TAH_value, U_JG_TAH); - zend_string *const_JG_TAH_name = zend_string_init_interned("JG_TAH", sizeof("JG_TAH") - 1, 1); + zend_string *const_JG_TAH_name = zend_string_init_interned("JG_TAH", sizeof("JG_TAH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_TAH_name, &const_JG_TAH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_TAH_name); + zend_string_release_ex(const_JG_TAH_name, true); zval const_JG_TAW_value; ZVAL_LONG(&const_JG_TAW_value, U_JG_TAW); - zend_string *const_JG_TAW_name = zend_string_init_interned("JG_TAW", sizeof("JG_TAW") - 1, 1); + zend_string *const_JG_TAW_name = zend_string_init_interned("JG_TAW", sizeof("JG_TAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_TAW_name, &const_JG_TAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_TAW_name); + zend_string_release_ex(const_JG_TAW_name, true); zval const_JG_TEH_MARBUTA_value; ZVAL_LONG(&const_JG_TEH_MARBUTA_value, U_JG_TEH_MARBUTA); - zend_string *const_JG_TEH_MARBUTA_name = zend_string_init_interned("JG_TEH_MARBUTA", sizeof("JG_TEH_MARBUTA") - 1, 1); + zend_string *const_JG_TEH_MARBUTA_name = zend_string_init_interned("JG_TEH_MARBUTA", sizeof("JG_TEH_MARBUTA") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_TEH_MARBUTA_name, &const_JG_TEH_MARBUTA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_TEH_MARBUTA_name); + zend_string_release_ex(const_JG_TEH_MARBUTA_name, true); zval const_JG_TETH_value; ZVAL_LONG(&const_JG_TETH_value, U_JG_TETH); - zend_string *const_JG_TETH_name = zend_string_init_interned("JG_TETH", sizeof("JG_TETH") - 1, 1); + zend_string *const_JG_TETH_name = zend_string_init_interned("JG_TETH", sizeof("JG_TETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_TETH_name, &const_JG_TETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_TETH_name); + zend_string_release_ex(const_JG_TETH_name, true); zval const_JG_WAW_value; ZVAL_LONG(&const_JG_WAW_value, U_JG_WAW); - zend_string *const_JG_WAW_name = zend_string_init_interned("JG_WAW", sizeof("JG_WAW") - 1, 1); + zend_string *const_JG_WAW_name = zend_string_init_interned("JG_WAW", sizeof("JG_WAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_WAW_name, &const_JG_WAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_WAW_name); + zend_string_release_ex(const_JG_WAW_name, true); zval const_JG_YEH_value; ZVAL_LONG(&const_JG_YEH_value, U_JG_YEH); - zend_string *const_JG_YEH_name = zend_string_init_interned("JG_YEH", sizeof("JG_YEH") - 1, 1); + zend_string *const_JG_YEH_name = zend_string_init_interned("JG_YEH", sizeof("JG_YEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_YEH_name, &const_JG_YEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_YEH_name); + zend_string_release_ex(const_JG_YEH_name, true); zval const_JG_YEH_BARREE_value; ZVAL_LONG(&const_JG_YEH_BARREE_value, U_JG_YEH_BARREE); - zend_string *const_JG_YEH_BARREE_name = zend_string_init_interned("JG_YEH_BARREE", sizeof("JG_YEH_BARREE") - 1, 1); + zend_string *const_JG_YEH_BARREE_name = zend_string_init_interned("JG_YEH_BARREE", sizeof("JG_YEH_BARREE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_YEH_BARREE_name, &const_JG_YEH_BARREE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_YEH_BARREE_name); + zend_string_release_ex(const_JG_YEH_BARREE_name, true); zval const_JG_YEH_WITH_TAIL_value; ZVAL_LONG(&const_JG_YEH_WITH_TAIL_value, U_JG_YEH_WITH_TAIL); - zend_string *const_JG_YEH_WITH_TAIL_name = zend_string_init_interned("JG_YEH_WITH_TAIL", sizeof("JG_YEH_WITH_TAIL") - 1, 1); + zend_string *const_JG_YEH_WITH_TAIL_name = zend_string_init_interned("JG_YEH_WITH_TAIL", sizeof("JG_YEH_WITH_TAIL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_YEH_WITH_TAIL_name, &const_JG_YEH_WITH_TAIL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_YEH_WITH_TAIL_name); + zend_string_release_ex(const_JG_YEH_WITH_TAIL_name, true); zval const_JG_YUDH_value; ZVAL_LONG(&const_JG_YUDH_value, U_JG_YUDH); - zend_string *const_JG_YUDH_name = zend_string_init_interned("JG_YUDH", sizeof("JG_YUDH") - 1, 1); + zend_string *const_JG_YUDH_name = zend_string_init_interned("JG_YUDH", sizeof("JG_YUDH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_YUDH_name, &const_JG_YUDH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_YUDH_name); + zend_string_release_ex(const_JG_YUDH_name, true); zval const_JG_YUDH_HE_value; ZVAL_LONG(&const_JG_YUDH_HE_value, U_JG_YUDH_HE); - zend_string *const_JG_YUDH_HE_name = zend_string_init_interned("JG_YUDH_HE", sizeof("JG_YUDH_HE") - 1, 1); + zend_string *const_JG_YUDH_HE_name = zend_string_init_interned("JG_YUDH_HE", sizeof("JG_YUDH_HE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_YUDH_HE_name, &const_JG_YUDH_HE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_YUDH_HE_name); + zend_string_release_ex(const_JG_YUDH_HE_name, true); zval const_JG_ZAIN_value; ZVAL_LONG(&const_JG_ZAIN_value, U_JG_ZAIN); - zend_string *const_JG_ZAIN_name = zend_string_init_interned("JG_ZAIN", sizeof("JG_ZAIN") - 1, 1); + zend_string *const_JG_ZAIN_name = zend_string_init_interned("JG_ZAIN", sizeof("JG_ZAIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_ZAIN_name, &const_JG_ZAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_ZAIN_name); + zend_string_release_ex(const_JG_ZAIN_name, true); zval const_JG_FE_value; ZVAL_LONG(&const_JG_FE_value, U_JG_FE); - zend_string *const_JG_FE_name = zend_string_init_interned("JG_FE", sizeof("JG_FE") - 1, 1); + zend_string *const_JG_FE_name = zend_string_init_interned("JG_FE", sizeof("JG_FE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_FE_name, &const_JG_FE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_FE_name); + zend_string_release_ex(const_JG_FE_name, true); zval const_JG_KHAPH_value; ZVAL_LONG(&const_JG_KHAPH_value, U_JG_KHAPH); - zend_string *const_JG_KHAPH_name = zend_string_init_interned("JG_KHAPH", sizeof("JG_KHAPH") - 1, 1); + zend_string *const_JG_KHAPH_name = zend_string_init_interned("JG_KHAPH", sizeof("JG_KHAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_KHAPH_name, &const_JG_KHAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_KHAPH_name); + zend_string_release_ex(const_JG_KHAPH_name, true); zval const_JG_ZHAIN_value; ZVAL_LONG(&const_JG_ZHAIN_value, U_JG_ZHAIN); - zend_string *const_JG_ZHAIN_name = zend_string_init_interned("JG_ZHAIN", sizeof("JG_ZHAIN") - 1, 1); + zend_string *const_JG_ZHAIN_name = zend_string_init_interned("JG_ZHAIN", sizeof("JG_ZHAIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_ZHAIN_name, &const_JG_ZHAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_ZHAIN_name); + zend_string_release_ex(const_JG_ZHAIN_name, true); zval const_JG_BURUSHASKI_YEH_BARREE_value; ZVAL_LONG(&const_JG_BURUSHASKI_YEH_BARREE_value, U_JG_BURUSHASKI_YEH_BARREE); - zend_string *const_JG_BURUSHASKI_YEH_BARREE_name = zend_string_init_interned("JG_BURUSHASKI_YEH_BARREE", sizeof("JG_BURUSHASKI_YEH_BARREE") - 1, 1); + zend_string *const_JG_BURUSHASKI_YEH_BARREE_name = zend_string_init_interned("JG_BURUSHASKI_YEH_BARREE", sizeof("JG_BURUSHASKI_YEH_BARREE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_BURUSHASKI_YEH_BARREE_name, &const_JG_BURUSHASKI_YEH_BARREE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_BURUSHASKI_YEH_BARREE_name); + zend_string_release_ex(const_JG_BURUSHASKI_YEH_BARREE_name, true); zval const_JG_FARSI_YEH_value; ZVAL_LONG(&const_JG_FARSI_YEH_value, U_JG_FARSI_YEH); - zend_string *const_JG_FARSI_YEH_name = zend_string_init_interned("JG_FARSI_YEH", sizeof("JG_FARSI_YEH") - 1, 1); + zend_string *const_JG_FARSI_YEH_name = zend_string_init_interned("JG_FARSI_YEH", sizeof("JG_FARSI_YEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_FARSI_YEH_name, &const_JG_FARSI_YEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_FARSI_YEH_name); + zend_string_release_ex(const_JG_FARSI_YEH_name, true); zval const_JG_NYA_value; ZVAL_LONG(&const_JG_NYA_value, U_JG_NYA); - zend_string *const_JG_NYA_name = zend_string_init_interned("JG_NYA", sizeof("JG_NYA") - 1, 1); + zend_string *const_JG_NYA_name = zend_string_init_interned("JG_NYA", sizeof("JG_NYA") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_NYA_name, &const_JG_NYA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_NYA_name); + zend_string_release_ex(const_JG_NYA_name, true); zval const_JG_ROHINGYA_YEH_value; ZVAL_LONG(&const_JG_ROHINGYA_YEH_value, U_JG_ROHINGYA_YEH); - zend_string *const_JG_ROHINGYA_YEH_name = zend_string_init_interned("JG_ROHINGYA_YEH", sizeof("JG_ROHINGYA_YEH") - 1, 1); + zend_string *const_JG_ROHINGYA_YEH_name = zend_string_init_interned("JG_ROHINGYA_YEH", sizeof("JG_ROHINGYA_YEH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_ROHINGYA_YEH_name, &const_JG_ROHINGYA_YEH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_ROHINGYA_YEH_name); + zend_string_release_ex(const_JG_ROHINGYA_YEH_name, true); zval const_JG_MANICHAEAN_ALEPH_value; ZVAL_LONG(&const_JG_MANICHAEAN_ALEPH_value, U_JG_MANICHAEAN_ALEPH); - zend_string *const_JG_MANICHAEAN_ALEPH_name = zend_string_init_interned("JG_MANICHAEAN_ALEPH", sizeof("JG_MANICHAEAN_ALEPH") - 1, 1); + zend_string *const_JG_MANICHAEAN_ALEPH_name = zend_string_init_interned("JG_MANICHAEAN_ALEPH", sizeof("JG_MANICHAEAN_ALEPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_ALEPH_name, &const_JG_MANICHAEAN_ALEPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_ALEPH_name); + zend_string_release_ex(const_JG_MANICHAEAN_ALEPH_name, true); zval const_JG_MANICHAEAN_AYIN_value; ZVAL_LONG(&const_JG_MANICHAEAN_AYIN_value, U_JG_MANICHAEAN_AYIN); - zend_string *const_JG_MANICHAEAN_AYIN_name = zend_string_init_interned("JG_MANICHAEAN_AYIN", sizeof("JG_MANICHAEAN_AYIN") - 1, 1); + zend_string *const_JG_MANICHAEAN_AYIN_name = zend_string_init_interned("JG_MANICHAEAN_AYIN", sizeof("JG_MANICHAEAN_AYIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_AYIN_name, &const_JG_MANICHAEAN_AYIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_AYIN_name); + zend_string_release_ex(const_JG_MANICHAEAN_AYIN_name, true); zval const_JG_MANICHAEAN_BETH_value; ZVAL_LONG(&const_JG_MANICHAEAN_BETH_value, U_JG_MANICHAEAN_BETH); - zend_string *const_JG_MANICHAEAN_BETH_name = zend_string_init_interned("JG_MANICHAEAN_BETH", sizeof("JG_MANICHAEAN_BETH") - 1, 1); + zend_string *const_JG_MANICHAEAN_BETH_name = zend_string_init_interned("JG_MANICHAEAN_BETH", sizeof("JG_MANICHAEAN_BETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_BETH_name, &const_JG_MANICHAEAN_BETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_BETH_name); + zend_string_release_ex(const_JG_MANICHAEAN_BETH_name, true); zval const_JG_MANICHAEAN_DALETH_value; ZVAL_LONG(&const_JG_MANICHAEAN_DALETH_value, U_JG_MANICHAEAN_DALETH); - zend_string *const_JG_MANICHAEAN_DALETH_name = zend_string_init_interned("JG_MANICHAEAN_DALETH", sizeof("JG_MANICHAEAN_DALETH") - 1, 1); + zend_string *const_JG_MANICHAEAN_DALETH_name = zend_string_init_interned("JG_MANICHAEAN_DALETH", sizeof("JG_MANICHAEAN_DALETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_DALETH_name, &const_JG_MANICHAEAN_DALETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_DALETH_name); + zend_string_release_ex(const_JG_MANICHAEAN_DALETH_name, true); zval const_JG_MANICHAEAN_DHAMEDH_value; ZVAL_LONG(&const_JG_MANICHAEAN_DHAMEDH_value, U_JG_MANICHAEAN_DHAMEDH); - zend_string *const_JG_MANICHAEAN_DHAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_DHAMEDH", sizeof("JG_MANICHAEAN_DHAMEDH") - 1, 1); + zend_string *const_JG_MANICHAEAN_DHAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_DHAMEDH", sizeof("JG_MANICHAEAN_DHAMEDH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_DHAMEDH_name, &const_JG_MANICHAEAN_DHAMEDH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_DHAMEDH_name); + zend_string_release_ex(const_JG_MANICHAEAN_DHAMEDH_name, true); zval const_JG_MANICHAEAN_FIVE_value; ZVAL_LONG(&const_JG_MANICHAEAN_FIVE_value, U_JG_MANICHAEAN_FIVE); - zend_string *const_JG_MANICHAEAN_FIVE_name = zend_string_init_interned("JG_MANICHAEAN_FIVE", sizeof("JG_MANICHAEAN_FIVE") - 1, 1); + zend_string *const_JG_MANICHAEAN_FIVE_name = zend_string_init_interned("JG_MANICHAEAN_FIVE", sizeof("JG_MANICHAEAN_FIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_FIVE_name, &const_JG_MANICHAEAN_FIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_FIVE_name); + zend_string_release_ex(const_JG_MANICHAEAN_FIVE_name, true); zval const_JG_MANICHAEAN_GIMEL_value; ZVAL_LONG(&const_JG_MANICHAEAN_GIMEL_value, U_JG_MANICHAEAN_GIMEL); - zend_string *const_JG_MANICHAEAN_GIMEL_name = zend_string_init_interned("JG_MANICHAEAN_GIMEL", sizeof("JG_MANICHAEAN_GIMEL") - 1, 1); + zend_string *const_JG_MANICHAEAN_GIMEL_name = zend_string_init_interned("JG_MANICHAEAN_GIMEL", sizeof("JG_MANICHAEAN_GIMEL") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_GIMEL_name, &const_JG_MANICHAEAN_GIMEL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_GIMEL_name); + zend_string_release_ex(const_JG_MANICHAEAN_GIMEL_name, true); zval const_JG_MANICHAEAN_HETH_value; ZVAL_LONG(&const_JG_MANICHAEAN_HETH_value, U_JG_MANICHAEAN_HETH); - zend_string *const_JG_MANICHAEAN_HETH_name = zend_string_init_interned("JG_MANICHAEAN_HETH", sizeof("JG_MANICHAEAN_HETH") - 1, 1); + zend_string *const_JG_MANICHAEAN_HETH_name = zend_string_init_interned("JG_MANICHAEAN_HETH", sizeof("JG_MANICHAEAN_HETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_HETH_name, &const_JG_MANICHAEAN_HETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_HETH_name); + zend_string_release_ex(const_JG_MANICHAEAN_HETH_name, true); zval const_JG_MANICHAEAN_HUNDRED_value; ZVAL_LONG(&const_JG_MANICHAEAN_HUNDRED_value, U_JG_MANICHAEAN_HUNDRED); - zend_string *const_JG_MANICHAEAN_HUNDRED_name = zend_string_init_interned("JG_MANICHAEAN_HUNDRED", sizeof("JG_MANICHAEAN_HUNDRED") - 1, 1); + zend_string *const_JG_MANICHAEAN_HUNDRED_name = zend_string_init_interned("JG_MANICHAEAN_HUNDRED", sizeof("JG_MANICHAEAN_HUNDRED") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_HUNDRED_name, &const_JG_MANICHAEAN_HUNDRED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_HUNDRED_name); + zend_string_release_ex(const_JG_MANICHAEAN_HUNDRED_name, true); zval const_JG_MANICHAEAN_KAPH_value; ZVAL_LONG(&const_JG_MANICHAEAN_KAPH_value, U_JG_MANICHAEAN_KAPH); - zend_string *const_JG_MANICHAEAN_KAPH_name = zend_string_init_interned("JG_MANICHAEAN_KAPH", sizeof("JG_MANICHAEAN_KAPH") - 1, 1); + zend_string *const_JG_MANICHAEAN_KAPH_name = zend_string_init_interned("JG_MANICHAEAN_KAPH", sizeof("JG_MANICHAEAN_KAPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_KAPH_name, &const_JG_MANICHAEAN_KAPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_KAPH_name); + zend_string_release_ex(const_JG_MANICHAEAN_KAPH_name, true); zval const_JG_MANICHAEAN_LAMEDH_value; ZVAL_LONG(&const_JG_MANICHAEAN_LAMEDH_value, U_JG_MANICHAEAN_LAMEDH); - zend_string *const_JG_MANICHAEAN_LAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_LAMEDH", sizeof("JG_MANICHAEAN_LAMEDH") - 1, 1); + zend_string *const_JG_MANICHAEAN_LAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_LAMEDH", sizeof("JG_MANICHAEAN_LAMEDH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_LAMEDH_name, &const_JG_MANICHAEAN_LAMEDH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_LAMEDH_name); + zend_string_release_ex(const_JG_MANICHAEAN_LAMEDH_name, true); zval const_JG_MANICHAEAN_MEM_value; ZVAL_LONG(&const_JG_MANICHAEAN_MEM_value, U_JG_MANICHAEAN_MEM); - zend_string *const_JG_MANICHAEAN_MEM_name = zend_string_init_interned("JG_MANICHAEAN_MEM", sizeof("JG_MANICHAEAN_MEM") - 1, 1); + zend_string *const_JG_MANICHAEAN_MEM_name = zend_string_init_interned("JG_MANICHAEAN_MEM", sizeof("JG_MANICHAEAN_MEM") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_MEM_name, &const_JG_MANICHAEAN_MEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_MEM_name); + zend_string_release_ex(const_JG_MANICHAEAN_MEM_name, true); zval const_JG_MANICHAEAN_NUN_value; ZVAL_LONG(&const_JG_MANICHAEAN_NUN_value, U_JG_MANICHAEAN_NUN); - zend_string *const_JG_MANICHAEAN_NUN_name = zend_string_init_interned("JG_MANICHAEAN_NUN", sizeof("JG_MANICHAEAN_NUN") - 1, 1); + zend_string *const_JG_MANICHAEAN_NUN_name = zend_string_init_interned("JG_MANICHAEAN_NUN", sizeof("JG_MANICHAEAN_NUN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_NUN_name, &const_JG_MANICHAEAN_NUN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_NUN_name); + zend_string_release_ex(const_JG_MANICHAEAN_NUN_name, true); zval const_JG_MANICHAEAN_ONE_value; ZVAL_LONG(&const_JG_MANICHAEAN_ONE_value, U_JG_MANICHAEAN_ONE); - zend_string *const_JG_MANICHAEAN_ONE_name = zend_string_init_interned("JG_MANICHAEAN_ONE", sizeof("JG_MANICHAEAN_ONE") - 1, 1); + zend_string *const_JG_MANICHAEAN_ONE_name = zend_string_init_interned("JG_MANICHAEAN_ONE", sizeof("JG_MANICHAEAN_ONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_ONE_name, &const_JG_MANICHAEAN_ONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_ONE_name); + zend_string_release_ex(const_JG_MANICHAEAN_ONE_name, true); zval const_JG_MANICHAEAN_PE_value; ZVAL_LONG(&const_JG_MANICHAEAN_PE_value, U_JG_MANICHAEAN_PE); - zend_string *const_JG_MANICHAEAN_PE_name = zend_string_init_interned("JG_MANICHAEAN_PE", sizeof("JG_MANICHAEAN_PE") - 1, 1); + zend_string *const_JG_MANICHAEAN_PE_name = zend_string_init_interned("JG_MANICHAEAN_PE", sizeof("JG_MANICHAEAN_PE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_PE_name, &const_JG_MANICHAEAN_PE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_PE_name); + zend_string_release_ex(const_JG_MANICHAEAN_PE_name, true); zval const_JG_MANICHAEAN_QOPH_value; ZVAL_LONG(&const_JG_MANICHAEAN_QOPH_value, U_JG_MANICHAEAN_QOPH); - zend_string *const_JG_MANICHAEAN_QOPH_name = zend_string_init_interned("JG_MANICHAEAN_QOPH", sizeof("JG_MANICHAEAN_QOPH") - 1, 1); + zend_string *const_JG_MANICHAEAN_QOPH_name = zend_string_init_interned("JG_MANICHAEAN_QOPH", sizeof("JG_MANICHAEAN_QOPH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_QOPH_name, &const_JG_MANICHAEAN_QOPH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_QOPH_name); + zend_string_release_ex(const_JG_MANICHAEAN_QOPH_name, true); zval const_JG_MANICHAEAN_RESH_value; ZVAL_LONG(&const_JG_MANICHAEAN_RESH_value, U_JG_MANICHAEAN_RESH); - zend_string *const_JG_MANICHAEAN_RESH_name = zend_string_init_interned("JG_MANICHAEAN_RESH", sizeof("JG_MANICHAEAN_RESH") - 1, 1); + zend_string *const_JG_MANICHAEAN_RESH_name = zend_string_init_interned("JG_MANICHAEAN_RESH", sizeof("JG_MANICHAEAN_RESH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_RESH_name, &const_JG_MANICHAEAN_RESH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_RESH_name); + zend_string_release_ex(const_JG_MANICHAEAN_RESH_name, true); zval const_JG_MANICHAEAN_SADHE_value; ZVAL_LONG(&const_JG_MANICHAEAN_SADHE_value, U_JG_MANICHAEAN_SADHE); - zend_string *const_JG_MANICHAEAN_SADHE_name = zend_string_init_interned("JG_MANICHAEAN_SADHE", sizeof("JG_MANICHAEAN_SADHE") - 1, 1); + zend_string *const_JG_MANICHAEAN_SADHE_name = zend_string_init_interned("JG_MANICHAEAN_SADHE", sizeof("JG_MANICHAEAN_SADHE") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_SADHE_name, &const_JG_MANICHAEAN_SADHE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_SADHE_name); + zend_string_release_ex(const_JG_MANICHAEAN_SADHE_name, true); zval const_JG_MANICHAEAN_SAMEKH_value; ZVAL_LONG(&const_JG_MANICHAEAN_SAMEKH_value, U_JG_MANICHAEAN_SAMEKH); - zend_string *const_JG_MANICHAEAN_SAMEKH_name = zend_string_init_interned("JG_MANICHAEAN_SAMEKH", sizeof("JG_MANICHAEAN_SAMEKH") - 1, 1); + zend_string *const_JG_MANICHAEAN_SAMEKH_name = zend_string_init_interned("JG_MANICHAEAN_SAMEKH", sizeof("JG_MANICHAEAN_SAMEKH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_SAMEKH_name, &const_JG_MANICHAEAN_SAMEKH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_SAMEKH_name); + zend_string_release_ex(const_JG_MANICHAEAN_SAMEKH_name, true); zval const_JG_MANICHAEAN_TAW_value; ZVAL_LONG(&const_JG_MANICHAEAN_TAW_value, U_JG_MANICHAEAN_TAW); - zend_string *const_JG_MANICHAEAN_TAW_name = zend_string_init_interned("JG_MANICHAEAN_TAW", sizeof("JG_MANICHAEAN_TAW") - 1, 1); + zend_string *const_JG_MANICHAEAN_TAW_name = zend_string_init_interned("JG_MANICHAEAN_TAW", sizeof("JG_MANICHAEAN_TAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_TAW_name, &const_JG_MANICHAEAN_TAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_TAW_name); + zend_string_release_ex(const_JG_MANICHAEAN_TAW_name, true); zval const_JG_MANICHAEAN_TEN_value; ZVAL_LONG(&const_JG_MANICHAEAN_TEN_value, U_JG_MANICHAEAN_TEN); - zend_string *const_JG_MANICHAEAN_TEN_name = zend_string_init_interned("JG_MANICHAEAN_TEN", sizeof("JG_MANICHAEAN_TEN") - 1, 1); + zend_string *const_JG_MANICHAEAN_TEN_name = zend_string_init_interned("JG_MANICHAEAN_TEN", sizeof("JG_MANICHAEAN_TEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_TEN_name, &const_JG_MANICHAEAN_TEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_TEN_name); + zend_string_release_ex(const_JG_MANICHAEAN_TEN_name, true); zval const_JG_MANICHAEAN_TETH_value; ZVAL_LONG(&const_JG_MANICHAEAN_TETH_value, U_JG_MANICHAEAN_TETH); - zend_string *const_JG_MANICHAEAN_TETH_name = zend_string_init_interned("JG_MANICHAEAN_TETH", sizeof("JG_MANICHAEAN_TETH") - 1, 1); + zend_string *const_JG_MANICHAEAN_TETH_name = zend_string_init_interned("JG_MANICHAEAN_TETH", sizeof("JG_MANICHAEAN_TETH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_TETH_name, &const_JG_MANICHAEAN_TETH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_TETH_name); + zend_string_release_ex(const_JG_MANICHAEAN_TETH_name, true); zval const_JG_MANICHAEAN_THAMEDH_value; ZVAL_LONG(&const_JG_MANICHAEAN_THAMEDH_value, U_JG_MANICHAEAN_THAMEDH); - zend_string *const_JG_MANICHAEAN_THAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_THAMEDH", sizeof("JG_MANICHAEAN_THAMEDH") - 1, 1); + zend_string *const_JG_MANICHAEAN_THAMEDH_name = zend_string_init_interned("JG_MANICHAEAN_THAMEDH", sizeof("JG_MANICHAEAN_THAMEDH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_THAMEDH_name, &const_JG_MANICHAEAN_THAMEDH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_THAMEDH_name); + zend_string_release_ex(const_JG_MANICHAEAN_THAMEDH_name, true); zval const_JG_MANICHAEAN_TWENTY_value; ZVAL_LONG(&const_JG_MANICHAEAN_TWENTY_value, U_JG_MANICHAEAN_TWENTY); - zend_string *const_JG_MANICHAEAN_TWENTY_name = zend_string_init_interned("JG_MANICHAEAN_TWENTY", sizeof("JG_MANICHAEAN_TWENTY") - 1, 1); + zend_string *const_JG_MANICHAEAN_TWENTY_name = zend_string_init_interned("JG_MANICHAEAN_TWENTY", sizeof("JG_MANICHAEAN_TWENTY") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_TWENTY_name, &const_JG_MANICHAEAN_TWENTY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_TWENTY_name); + zend_string_release_ex(const_JG_MANICHAEAN_TWENTY_name, true); zval const_JG_MANICHAEAN_WAW_value; ZVAL_LONG(&const_JG_MANICHAEAN_WAW_value, U_JG_MANICHAEAN_WAW); - zend_string *const_JG_MANICHAEAN_WAW_name = zend_string_init_interned("JG_MANICHAEAN_WAW", sizeof("JG_MANICHAEAN_WAW") - 1, 1); + zend_string *const_JG_MANICHAEAN_WAW_name = zend_string_init_interned("JG_MANICHAEAN_WAW", sizeof("JG_MANICHAEAN_WAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_WAW_name, &const_JG_MANICHAEAN_WAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_WAW_name); + zend_string_release_ex(const_JG_MANICHAEAN_WAW_name, true); zval const_JG_MANICHAEAN_YODH_value; ZVAL_LONG(&const_JG_MANICHAEAN_YODH_value, U_JG_MANICHAEAN_YODH); - zend_string *const_JG_MANICHAEAN_YODH_name = zend_string_init_interned("JG_MANICHAEAN_YODH", sizeof("JG_MANICHAEAN_YODH") - 1, 1); + zend_string *const_JG_MANICHAEAN_YODH_name = zend_string_init_interned("JG_MANICHAEAN_YODH", sizeof("JG_MANICHAEAN_YODH") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_YODH_name, &const_JG_MANICHAEAN_YODH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_YODH_name); + zend_string_release_ex(const_JG_MANICHAEAN_YODH_name, true); zval const_JG_MANICHAEAN_ZAYIN_value; ZVAL_LONG(&const_JG_MANICHAEAN_ZAYIN_value, U_JG_MANICHAEAN_ZAYIN); - zend_string *const_JG_MANICHAEAN_ZAYIN_name = zend_string_init_interned("JG_MANICHAEAN_ZAYIN", sizeof("JG_MANICHAEAN_ZAYIN") - 1, 1); + zend_string *const_JG_MANICHAEAN_ZAYIN_name = zend_string_init_interned("JG_MANICHAEAN_ZAYIN", sizeof("JG_MANICHAEAN_ZAYIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_MANICHAEAN_ZAYIN_name, &const_JG_MANICHAEAN_ZAYIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_MANICHAEAN_ZAYIN_name); + zend_string_release_ex(const_JG_MANICHAEAN_ZAYIN_name, true); zval const_JG_STRAIGHT_WAW_value; ZVAL_LONG(&const_JG_STRAIGHT_WAW_value, U_JG_STRAIGHT_WAW); - zend_string *const_JG_STRAIGHT_WAW_name = zend_string_init_interned("JG_STRAIGHT_WAW", sizeof("JG_STRAIGHT_WAW") - 1, 1); + zend_string *const_JG_STRAIGHT_WAW_name = zend_string_init_interned("JG_STRAIGHT_WAW", sizeof("JG_STRAIGHT_WAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_STRAIGHT_WAW_name, &const_JG_STRAIGHT_WAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_STRAIGHT_WAW_name); + zend_string_release_ex(const_JG_STRAIGHT_WAW_name, true); zval const_JG_COUNT_value; ZVAL_LONG(&const_JG_COUNT_value, U_JG_COUNT); - zend_string *const_JG_COUNT_name = zend_string_init_interned("JG_COUNT", sizeof("JG_COUNT") - 1, 1); + zend_string *const_JG_COUNT_name = zend_string_init_interned("JG_COUNT", sizeof("JG_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_JG_COUNT_name, &const_JG_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_JG_COUNT_name); + zend_string_release_ex(const_JG_COUNT_name, true); zval const_GCB_OTHER_value; ZVAL_LONG(&const_GCB_OTHER_value, U_GCB_OTHER); - zend_string *const_GCB_OTHER_name = zend_string_init_interned("GCB_OTHER", sizeof("GCB_OTHER") - 1, 1); + zend_string *const_GCB_OTHER_name = zend_string_init_interned("GCB_OTHER", sizeof("GCB_OTHER") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_OTHER_name, &const_GCB_OTHER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_OTHER_name); + zend_string_release_ex(const_GCB_OTHER_name, true); zval const_GCB_CONTROL_value; ZVAL_LONG(&const_GCB_CONTROL_value, U_GCB_CONTROL); - zend_string *const_GCB_CONTROL_name = zend_string_init_interned("GCB_CONTROL", sizeof("GCB_CONTROL") - 1, 1); + zend_string *const_GCB_CONTROL_name = zend_string_init_interned("GCB_CONTROL", sizeof("GCB_CONTROL") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_CONTROL_name, &const_GCB_CONTROL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_CONTROL_name); + zend_string_release_ex(const_GCB_CONTROL_name, true); zval const_GCB_CR_value; ZVAL_LONG(&const_GCB_CR_value, U_GCB_CR); - zend_string *const_GCB_CR_name = zend_string_init_interned("GCB_CR", sizeof("GCB_CR") - 1, 1); + zend_string *const_GCB_CR_name = zend_string_init_interned("GCB_CR", sizeof("GCB_CR") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_CR_name, &const_GCB_CR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_CR_name); + zend_string_release_ex(const_GCB_CR_name, true); zval const_GCB_EXTEND_value; ZVAL_LONG(&const_GCB_EXTEND_value, U_GCB_EXTEND); - zend_string *const_GCB_EXTEND_name = zend_string_init_interned("GCB_EXTEND", sizeof("GCB_EXTEND") - 1, 1); + zend_string *const_GCB_EXTEND_name = zend_string_init_interned("GCB_EXTEND", sizeof("GCB_EXTEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_EXTEND_name, &const_GCB_EXTEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_EXTEND_name); + zend_string_release_ex(const_GCB_EXTEND_name, true); zval const_GCB_L_value; ZVAL_LONG(&const_GCB_L_value, U_GCB_L); - zend_string *const_GCB_L_name = zend_string_init_interned("GCB_L", sizeof("GCB_L") - 1, 1); + zend_string *const_GCB_L_name = zend_string_init_interned("GCB_L", sizeof("GCB_L") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_L_name, &const_GCB_L_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_L_name); + zend_string_release_ex(const_GCB_L_name, true); zval const_GCB_LF_value; ZVAL_LONG(&const_GCB_LF_value, U_GCB_LF); - zend_string *const_GCB_LF_name = zend_string_init_interned("GCB_LF", sizeof("GCB_LF") - 1, 1); + zend_string *const_GCB_LF_name = zend_string_init_interned("GCB_LF", sizeof("GCB_LF") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_LF_name, &const_GCB_LF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_LF_name); + zend_string_release_ex(const_GCB_LF_name, true); zval const_GCB_LV_value; ZVAL_LONG(&const_GCB_LV_value, U_GCB_LV); - zend_string *const_GCB_LV_name = zend_string_init_interned("GCB_LV", sizeof("GCB_LV") - 1, 1); + zend_string *const_GCB_LV_name = zend_string_init_interned("GCB_LV", sizeof("GCB_LV") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_LV_name, &const_GCB_LV_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_LV_name); + zend_string_release_ex(const_GCB_LV_name, true); zval const_GCB_LVT_value; ZVAL_LONG(&const_GCB_LVT_value, U_GCB_LVT); - zend_string *const_GCB_LVT_name = zend_string_init_interned("GCB_LVT", sizeof("GCB_LVT") - 1, 1); + zend_string *const_GCB_LVT_name = zend_string_init_interned("GCB_LVT", sizeof("GCB_LVT") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_LVT_name, &const_GCB_LVT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_LVT_name); + zend_string_release_ex(const_GCB_LVT_name, true); zval const_GCB_T_value; ZVAL_LONG(&const_GCB_T_value, U_GCB_T); - zend_string *const_GCB_T_name = zend_string_init_interned("GCB_T", sizeof("GCB_T") - 1, 1); + zend_string *const_GCB_T_name = zend_string_init_interned("GCB_T", sizeof("GCB_T") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_T_name, &const_GCB_T_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_T_name); + zend_string_release_ex(const_GCB_T_name, true); zval const_GCB_V_value; ZVAL_LONG(&const_GCB_V_value, U_GCB_V); - zend_string *const_GCB_V_name = zend_string_init_interned("GCB_V", sizeof("GCB_V") - 1, 1); + zend_string *const_GCB_V_name = zend_string_init_interned("GCB_V", sizeof("GCB_V") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_V_name, &const_GCB_V_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_V_name); + zend_string_release_ex(const_GCB_V_name, true); zval const_GCB_SPACING_MARK_value; ZVAL_LONG(&const_GCB_SPACING_MARK_value, U_GCB_SPACING_MARK); - zend_string *const_GCB_SPACING_MARK_name = zend_string_init_interned("GCB_SPACING_MARK", sizeof("GCB_SPACING_MARK") - 1, 1); + zend_string *const_GCB_SPACING_MARK_name = zend_string_init_interned("GCB_SPACING_MARK", sizeof("GCB_SPACING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_SPACING_MARK_name, &const_GCB_SPACING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_SPACING_MARK_name); + zend_string_release_ex(const_GCB_SPACING_MARK_name, true); zval const_GCB_PREPEND_value; ZVAL_LONG(&const_GCB_PREPEND_value, U_GCB_PREPEND); - zend_string *const_GCB_PREPEND_name = zend_string_init_interned("GCB_PREPEND", sizeof("GCB_PREPEND") - 1, 1); + zend_string *const_GCB_PREPEND_name = zend_string_init_interned("GCB_PREPEND", sizeof("GCB_PREPEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_PREPEND_name, &const_GCB_PREPEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_PREPEND_name); + zend_string_release_ex(const_GCB_PREPEND_name, true); zval const_GCB_REGIONAL_INDICATOR_value; ZVAL_LONG(&const_GCB_REGIONAL_INDICATOR_value, U_GCB_REGIONAL_INDICATOR); - zend_string *const_GCB_REGIONAL_INDICATOR_name = zend_string_init_interned("GCB_REGIONAL_INDICATOR", sizeof("GCB_REGIONAL_INDICATOR") - 1, 1); + zend_string *const_GCB_REGIONAL_INDICATOR_name = zend_string_init_interned("GCB_REGIONAL_INDICATOR", sizeof("GCB_REGIONAL_INDICATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_REGIONAL_INDICATOR_name, &const_GCB_REGIONAL_INDICATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_REGIONAL_INDICATOR_name); + zend_string_release_ex(const_GCB_REGIONAL_INDICATOR_name, true); zval const_GCB_COUNT_value; ZVAL_LONG(&const_GCB_COUNT_value, U_GCB_COUNT); - zend_string *const_GCB_COUNT_name = zend_string_init_interned("GCB_COUNT", sizeof("GCB_COUNT") - 1, 1); + zend_string *const_GCB_COUNT_name = zend_string_init_interned("GCB_COUNT", sizeof("GCB_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_GCB_COUNT_name, &const_GCB_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GCB_COUNT_name); + zend_string_release_ex(const_GCB_COUNT_name, true); zval const_WB_OTHER_value; ZVAL_LONG(&const_WB_OTHER_value, U_WB_OTHER); - zend_string *const_WB_OTHER_name = zend_string_init_interned("WB_OTHER", sizeof("WB_OTHER") - 1, 1); + zend_string *const_WB_OTHER_name = zend_string_init_interned("WB_OTHER", sizeof("WB_OTHER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_OTHER_name, &const_WB_OTHER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_OTHER_name); + zend_string_release_ex(const_WB_OTHER_name, true); zval const_WB_ALETTER_value; ZVAL_LONG(&const_WB_ALETTER_value, U_WB_ALETTER); - zend_string *const_WB_ALETTER_name = zend_string_init_interned("WB_ALETTER", sizeof("WB_ALETTER") - 1, 1); + zend_string *const_WB_ALETTER_name = zend_string_init_interned("WB_ALETTER", sizeof("WB_ALETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_ALETTER_name, &const_WB_ALETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_ALETTER_name); + zend_string_release_ex(const_WB_ALETTER_name, true); zval const_WB_FORMAT_value; ZVAL_LONG(&const_WB_FORMAT_value, U_WB_FORMAT); - zend_string *const_WB_FORMAT_name = zend_string_init_interned("WB_FORMAT", sizeof("WB_FORMAT") - 1, 1); + zend_string *const_WB_FORMAT_name = zend_string_init_interned("WB_FORMAT", sizeof("WB_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_FORMAT_name, &const_WB_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_FORMAT_name); + zend_string_release_ex(const_WB_FORMAT_name, true); zval const_WB_KATAKANA_value; ZVAL_LONG(&const_WB_KATAKANA_value, U_WB_KATAKANA); - zend_string *const_WB_KATAKANA_name = zend_string_init_interned("WB_KATAKANA", sizeof("WB_KATAKANA") - 1, 1); + zend_string *const_WB_KATAKANA_name = zend_string_init_interned("WB_KATAKANA", sizeof("WB_KATAKANA") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_KATAKANA_name, &const_WB_KATAKANA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_KATAKANA_name); + zend_string_release_ex(const_WB_KATAKANA_name, true); zval const_WB_MIDLETTER_value; ZVAL_LONG(&const_WB_MIDLETTER_value, U_WB_MIDLETTER); - zend_string *const_WB_MIDLETTER_name = zend_string_init_interned("WB_MIDLETTER", sizeof("WB_MIDLETTER") - 1, 1); + zend_string *const_WB_MIDLETTER_name = zend_string_init_interned("WB_MIDLETTER", sizeof("WB_MIDLETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_MIDLETTER_name, &const_WB_MIDLETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_MIDLETTER_name); + zend_string_release_ex(const_WB_MIDLETTER_name, true); zval const_WB_MIDNUM_value; ZVAL_LONG(&const_WB_MIDNUM_value, U_WB_MIDNUM); - zend_string *const_WB_MIDNUM_name = zend_string_init_interned("WB_MIDNUM", sizeof("WB_MIDNUM") - 1, 1); + zend_string *const_WB_MIDNUM_name = zend_string_init_interned("WB_MIDNUM", sizeof("WB_MIDNUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_MIDNUM_name, &const_WB_MIDNUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_MIDNUM_name); + zend_string_release_ex(const_WB_MIDNUM_name, true); zval const_WB_NUMERIC_value; ZVAL_LONG(&const_WB_NUMERIC_value, U_WB_NUMERIC); - zend_string *const_WB_NUMERIC_name = zend_string_init_interned("WB_NUMERIC", sizeof("WB_NUMERIC") - 1, 1); + zend_string *const_WB_NUMERIC_name = zend_string_init_interned("WB_NUMERIC", sizeof("WB_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_NUMERIC_name, &const_WB_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_NUMERIC_name); + zend_string_release_ex(const_WB_NUMERIC_name, true); zval const_WB_EXTENDNUMLET_value; ZVAL_LONG(&const_WB_EXTENDNUMLET_value, U_WB_EXTENDNUMLET); - zend_string *const_WB_EXTENDNUMLET_name = zend_string_init_interned("WB_EXTENDNUMLET", sizeof("WB_EXTENDNUMLET") - 1, 1); + zend_string *const_WB_EXTENDNUMLET_name = zend_string_init_interned("WB_EXTENDNUMLET", sizeof("WB_EXTENDNUMLET") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_EXTENDNUMLET_name, &const_WB_EXTENDNUMLET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_EXTENDNUMLET_name); + zend_string_release_ex(const_WB_EXTENDNUMLET_name, true); zval const_WB_CR_value; ZVAL_LONG(&const_WB_CR_value, U_WB_CR); - zend_string *const_WB_CR_name = zend_string_init_interned("WB_CR", sizeof("WB_CR") - 1, 1); + zend_string *const_WB_CR_name = zend_string_init_interned("WB_CR", sizeof("WB_CR") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_CR_name, &const_WB_CR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_CR_name); + zend_string_release_ex(const_WB_CR_name, true); zval const_WB_EXTEND_value; ZVAL_LONG(&const_WB_EXTEND_value, U_WB_EXTEND); - zend_string *const_WB_EXTEND_name = zend_string_init_interned("WB_EXTEND", sizeof("WB_EXTEND") - 1, 1); + zend_string *const_WB_EXTEND_name = zend_string_init_interned("WB_EXTEND", sizeof("WB_EXTEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_EXTEND_name, &const_WB_EXTEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_EXTEND_name); + zend_string_release_ex(const_WB_EXTEND_name, true); zval const_WB_LF_value; ZVAL_LONG(&const_WB_LF_value, U_WB_LF); - zend_string *const_WB_LF_name = zend_string_init_interned("WB_LF", sizeof("WB_LF") - 1, 1); + zend_string *const_WB_LF_name = zend_string_init_interned("WB_LF", sizeof("WB_LF") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_LF_name, &const_WB_LF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_LF_name); + zend_string_release_ex(const_WB_LF_name, true); zval const_WB_MIDNUMLET_value; ZVAL_LONG(&const_WB_MIDNUMLET_value, U_WB_MIDNUMLET); - zend_string *const_WB_MIDNUMLET_name = zend_string_init_interned("WB_MIDNUMLET", sizeof("WB_MIDNUMLET") - 1, 1); + zend_string *const_WB_MIDNUMLET_name = zend_string_init_interned("WB_MIDNUMLET", sizeof("WB_MIDNUMLET") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_MIDNUMLET_name, &const_WB_MIDNUMLET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_MIDNUMLET_name); + zend_string_release_ex(const_WB_MIDNUMLET_name, true); zval const_WB_NEWLINE_value; ZVAL_LONG(&const_WB_NEWLINE_value, U_WB_NEWLINE); - zend_string *const_WB_NEWLINE_name = zend_string_init_interned("WB_NEWLINE", sizeof("WB_NEWLINE") - 1, 1); + zend_string *const_WB_NEWLINE_name = zend_string_init_interned("WB_NEWLINE", sizeof("WB_NEWLINE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_NEWLINE_name, &const_WB_NEWLINE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_NEWLINE_name); + zend_string_release_ex(const_WB_NEWLINE_name, true); zval const_WB_REGIONAL_INDICATOR_value; ZVAL_LONG(&const_WB_REGIONAL_INDICATOR_value, U_WB_REGIONAL_INDICATOR); - zend_string *const_WB_REGIONAL_INDICATOR_name = zend_string_init_interned("WB_REGIONAL_INDICATOR", sizeof("WB_REGIONAL_INDICATOR") - 1, 1); + zend_string *const_WB_REGIONAL_INDICATOR_name = zend_string_init_interned("WB_REGIONAL_INDICATOR", sizeof("WB_REGIONAL_INDICATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_REGIONAL_INDICATOR_name, &const_WB_REGIONAL_INDICATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_REGIONAL_INDICATOR_name); + zend_string_release_ex(const_WB_REGIONAL_INDICATOR_name, true); zval const_WB_HEBREW_LETTER_value; ZVAL_LONG(&const_WB_HEBREW_LETTER_value, U_WB_HEBREW_LETTER); - zend_string *const_WB_HEBREW_LETTER_name = zend_string_init_interned("WB_HEBREW_LETTER", sizeof("WB_HEBREW_LETTER") - 1, 1); + zend_string *const_WB_HEBREW_LETTER_name = zend_string_init_interned("WB_HEBREW_LETTER", sizeof("WB_HEBREW_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_HEBREW_LETTER_name, &const_WB_HEBREW_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_HEBREW_LETTER_name); + zend_string_release_ex(const_WB_HEBREW_LETTER_name, true); zval const_WB_SINGLE_QUOTE_value; ZVAL_LONG(&const_WB_SINGLE_QUOTE_value, U_WB_SINGLE_QUOTE); - zend_string *const_WB_SINGLE_QUOTE_name = zend_string_init_interned("WB_SINGLE_QUOTE", sizeof("WB_SINGLE_QUOTE") - 1, 1); + zend_string *const_WB_SINGLE_QUOTE_name = zend_string_init_interned("WB_SINGLE_QUOTE", sizeof("WB_SINGLE_QUOTE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_SINGLE_QUOTE_name, &const_WB_SINGLE_QUOTE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_SINGLE_QUOTE_name); + zend_string_release_ex(const_WB_SINGLE_QUOTE_name, true); zval const_WB_DOUBLE_QUOTE_value; ZVAL_LONG(&const_WB_DOUBLE_QUOTE_value, U_WB_DOUBLE_QUOTE); - zend_string *const_WB_DOUBLE_QUOTE_name = zend_string_init_interned("WB_DOUBLE_QUOTE", sizeof("WB_DOUBLE_QUOTE") - 1, 1); + zend_string *const_WB_DOUBLE_QUOTE_name = zend_string_init_interned("WB_DOUBLE_QUOTE", sizeof("WB_DOUBLE_QUOTE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_DOUBLE_QUOTE_name, &const_WB_DOUBLE_QUOTE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_DOUBLE_QUOTE_name); + zend_string_release_ex(const_WB_DOUBLE_QUOTE_name, true); zval const_WB_COUNT_value; ZVAL_LONG(&const_WB_COUNT_value, U_WB_COUNT); - zend_string *const_WB_COUNT_name = zend_string_init_interned("WB_COUNT", sizeof("WB_COUNT") - 1, 1); + zend_string *const_WB_COUNT_name = zend_string_init_interned("WB_COUNT", sizeof("WB_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_WB_COUNT_name, &const_WB_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WB_COUNT_name); + zend_string_release_ex(const_WB_COUNT_name, true); zval const_SB_OTHER_value; ZVAL_LONG(&const_SB_OTHER_value, U_SB_OTHER); - zend_string *const_SB_OTHER_name = zend_string_init_interned("SB_OTHER", sizeof("SB_OTHER") - 1, 1); + zend_string *const_SB_OTHER_name = zend_string_init_interned("SB_OTHER", sizeof("SB_OTHER") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_OTHER_name, &const_SB_OTHER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_OTHER_name); + zend_string_release_ex(const_SB_OTHER_name, true); zval const_SB_ATERM_value; ZVAL_LONG(&const_SB_ATERM_value, U_SB_ATERM); - zend_string *const_SB_ATERM_name = zend_string_init_interned("SB_ATERM", sizeof("SB_ATERM") - 1, 1); + zend_string *const_SB_ATERM_name = zend_string_init_interned("SB_ATERM", sizeof("SB_ATERM") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_ATERM_name, &const_SB_ATERM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_ATERM_name); + zend_string_release_ex(const_SB_ATERM_name, true); zval const_SB_CLOSE_value; ZVAL_LONG(&const_SB_CLOSE_value, U_SB_CLOSE); - zend_string *const_SB_CLOSE_name = zend_string_init_interned("SB_CLOSE", sizeof("SB_CLOSE") - 1, 1); + zend_string *const_SB_CLOSE_name = zend_string_init_interned("SB_CLOSE", sizeof("SB_CLOSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_CLOSE_name, &const_SB_CLOSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_CLOSE_name); + zend_string_release_ex(const_SB_CLOSE_name, true); zval const_SB_FORMAT_value; ZVAL_LONG(&const_SB_FORMAT_value, U_SB_FORMAT); - zend_string *const_SB_FORMAT_name = zend_string_init_interned("SB_FORMAT", sizeof("SB_FORMAT") - 1, 1); + zend_string *const_SB_FORMAT_name = zend_string_init_interned("SB_FORMAT", sizeof("SB_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_FORMAT_name, &const_SB_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_FORMAT_name); + zend_string_release_ex(const_SB_FORMAT_name, true); zval const_SB_LOWER_value; ZVAL_LONG(&const_SB_LOWER_value, U_SB_LOWER); - zend_string *const_SB_LOWER_name = zend_string_init_interned("SB_LOWER", sizeof("SB_LOWER") - 1, 1); + zend_string *const_SB_LOWER_name = zend_string_init_interned("SB_LOWER", sizeof("SB_LOWER") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_LOWER_name, &const_SB_LOWER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_LOWER_name); + zend_string_release_ex(const_SB_LOWER_name, true); zval const_SB_NUMERIC_value; ZVAL_LONG(&const_SB_NUMERIC_value, U_SB_NUMERIC); - zend_string *const_SB_NUMERIC_name = zend_string_init_interned("SB_NUMERIC", sizeof("SB_NUMERIC") - 1, 1); + zend_string *const_SB_NUMERIC_name = zend_string_init_interned("SB_NUMERIC", sizeof("SB_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_NUMERIC_name, &const_SB_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_NUMERIC_name); + zend_string_release_ex(const_SB_NUMERIC_name, true); zval const_SB_OLETTER_value; ZVAL_LONG(&const_SB_OLETTER_value, U_SB_OLETTER); - zend_string *const_SB_OLETTER_name = zend_string_init_interned("SB_OLETTER", sizeof("SB_OLETTER") - 1, 1); + zend_string *const_SB_OLETTER_name = zend_string_init_interned("SB_OLETTER", sizeof("SB_OLETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_OLETTER_name, &const_SB_OLETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_OLETTER_name); + zend_string_release_ex(const_SB_OLETTER_name, true); zval const_SB_SEP_value; ZVAL_LONG(&const_SB_SEP_value, U_SB_SEP); - zend_string *const_SB_SEP_name = zend_string_init_interned("SB_SEP", sizeof("SB_SEP") - 1, 1); + zend_string *const_SB_SEP_name = zend_string_init_interned("SB_SEP", sizeof("SB_SEP") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_SEP_name, &const_SB_SEP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_SEP_name); + zend_string_release_ex(const_SB_SEP_name, true); zval const_SB_SP_value; ZVAL_LONG(&const_SB_SP_value, U_SB_SP); - zend_string *const_SB_SP_name = zend_string_init_interned("SB_SP", sizeof("SB_SP") - 1, 1); + zend_string *const_SB_SP_name = zend_string_init_interned("SB_SP", sizeof("SB_SP") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_SP_name, &const_SB_SP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_SP_name); + zend_string_release_ex(const_SB_SP_name, true); zval const_SB_STERM_value; ZVAL_LONG(&const_SB_STERM_value, U_SB_STERM); - zend_string *const_SB_STERM_name = zend_string_init_interned("SB_STERM", sizeof("SB_STERM") - 1, 1); + zend_string *const_SB_STERM_name = zend_string_init_interned("SB_STERM", sizeof("SB_STERM") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_STERM_name, &const_SB_STERM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_STERM_name); + zend_string_release_ex(const_SB_STERM_name, true); zval const_SB_UPPER_value; ZVAL_LONG(&const_SB_UPPER_value, U_SB_UPPER); - zend_string *const_SB_UPPER_name = zend_string_init_interned("SB_UPPER", sizeof("SB_UPPER") - 1, 1); + zend_string *const_SB_UPPER_name = zend_string_init_interned("SB_UPPER", sizeof("SB_UPPER") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_UPPER_name, &const_SB_UPPER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_UPPER_name); + zend_string_release_ex(const_SB_UPPER_name, true); zval const_SB_CR_value; ZVAL_LONG(&const_SB_CR_value, U_SB_CR); - zend_string *const_SB_CR_name = zend_string_init_interned("SB_CR", sizeof("SB_CR") - 1, 1); + zend_string *const_SB_CR_name = zend_string_init_interned("SB_CR", sizeof("SB_CR") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_CR_name, &const_SB_CR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_CR_name); + zend_string_release_ex(const_SB_CR_name, true); zval const_SB_EXTEND_value; ZVAL_LONG(&const_SB_EXTEND_value, U_SB_EXTEND); - zend_string *const_SB_EXTEND_name = zend_string_init_interned("SB_EXTEND", sizeof("SB_EXTEND") - 1, 1); + zend_string *const_SB_EXTEND_name = zend_string_init_interned("SB_EXTEND", sizeof("SB_EXTEND") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_EXTEND_name, &const_SB_EXTEND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_EXTEND_name); + zend_string_release_ex(const_SB_EXTEND_name, true); zval const_SB_LF_value; ZVAL_LONG(&const_SB_LF_value, U_SB_LF); - zend_string *const_SB_LF_name = zend_string_init_interned("SB_LF", sizeof("SB_LF") - 1, 1); + zend_string *const_SB_LF_name = zend_string_init_interned("SB_LF", sizeof("SB_LF") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_LF_name, &const_SB_LF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_LF_name); + zend_string_release_ex(const_SB_LF_name, true); zval const_SB_SCONTINUE_value; ZVAL_LONG(&const_SB_SCONTINUE_value, U_SB_SCONTINUE); - zend_string *const_SB_SCONTINUE_name = zend_string_init_interned("SB_SCONTINUE", sizeof("SB_SCONTINUE") - 1, 1); + zend_string *const_SB_SCONTINUE_name = zend_string_init_interned("SB_SCONTINUE", sizeof("SB_SCONTINUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_SCONTINUE_name, &const_SB_SCONTINUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_SCONTINUE_name); + zend_string_release_ex(const_SB_SCONTINUE_name, true); zval const_SB_COUNT_value; ZVAL_LONG(&const_SB_COUNT_value, U_SB_COUNT); - zend_string *const_SB_COUNT_name = zend_string_init_interned("SB_COUNT", sizeof("SB_COUNT") - 1, 1); + zend_string *const_SB_COUNT_name = zend_string_init_interned("SB_COUNT", sizeof("SB_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SB_COUNT_name, &const_SB_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SB_COUNT_name); + zend_string_release_ex(const_SB_COUNT_name, true); zval const_LB_UNKNOWN_value; ZVAL_LONG(&const_LB_UNKNOWN_value, U_LB_UNKNOWN); - zend_string *const_LB_UNKNOWN_name = zend_string_init_interned("LB_UNKNOWN", sizeof("LB_UNKNOWN") - 1, 1); + zend_string *const_LB_UNKNOWN_name = zend_string_init_interned("LB_UNKNOWN", sizeof("LB_UNKNOWN") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_UNKNOWN_name, &const_LB_UNKNOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_UNKNOWN_name); + zend_string_release_ex(const_LB_UNKNOWN_name, true); zval const_LB_AMBIGUOUS_value; ZVAL_LONG(&const_LB_AMBIGUOUS_value, U_LB_AMBIGUOUS); - zend_string *const_LB_AMBIGUOUS_name = zend_string_init_interned("LB_AMBIGUOUS", sizeof("LB_AMBIGUOUS") - 1, 1); + zend_string *const_LB_AMBIGUOUS_name = zend_string_init_interned("LB_AMBIGUOUS", sizeof("LB_AMBIGUOUS") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_AMBIGUOUS_name, &const_LB_AMBIGUOUS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_AMBIGUOUS_name); + zend_string_release_ex(const_LB_AMBIGUOUS_name, true); zval const_LB_ALPHABETIC_value; ZVAL_LONG(&const_LB_ALPHABETIC_value, U_LB_ALPHABETIC); - zend_string *const_LB_ALPHABETIC_name = zend_string_init_interned("LB_ALPHABETIC", sizeof("LB_ALPHABETIC") - 1, 1); + zend_string *const_LB_ALPHABETIC_name = zend_string_init_interned("LB_ALPHABETIC", sizeof("LB_ALPHABETIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_ALPHABETIC_name, &const_LB_ALPHABETIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_ALPHABETIC_name); + zend_string_release_ex(const_LB_ALPHABETIC_name, true); zval const_LB_BREAK_BOTH_value; ZVAL_LONG(&const_LB_BREAK_BOTH_value, U_LB_BREAK_BOTH); - zend_string *const_LB_BREAK_BOTH_name = zend_string_init_interned("LB_BREAK_BOTH", sizeof("LB_BREAK_BOTH") - 1, 1); + zend_string *const_LB_BREAK_BOTH_name = zend_string_init_interned("LB_BREAK_BOTH", sizeof("LB_BREAK_BOTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_BREAK_BOTH_name, &const_LB_BREAK_BOTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_BREAK_BOTH_name); + zend_string_release_ex(const_LB_BREAK_BOTH_name, true); zval const_LB_BREAK_AFTER_value; ZVAL_LONG(&const_LB_BREAK_AFTER_value, U_LB_BREAK_AFTER); - zend_string *const_LB_BREAK_AFTER_name = zend_string_init_interned("LB_BREAK_AFTER", sizeof("LB_BREAK_AFTER") - 1, 1); + zend_string *const_LB_BREAK_AFTER_name = zend_string_init_interned("LB_BREAK_AFTER", sizeof("LB_BREAK_AFTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_BREAK_AFTER_name, &const_LB_BREAK_AFTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_BREAK_AFTER_name); + zend_string_release_ex(const_LB_BREAK_AFTER_name, true); zval const_LB_BREAK_BEFORE_value; ZVAL_LONG(&const_LB_BREAK_BEFORE_value, U_LB_BREAK_BEFORE); - zend_string *const_LB_BREAK_BEFORE_name = zend_string_init_interned("LB_BREAK_BEFORE", sizeof("LB_BREAK_BEFORE") - 1, 1); + zend_string *const_LB_BREAK_BEFORE_name = zend_string_init_interned("LB_BREAK_BEFORE", sizeof("LB_BREAK_BEFORE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_BREAK_BEFORE_name, &const_LB_BREAK_BEFORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_BREAK_BEFORE_name); + zend_string_release_ex(const_LB_BREAK_BEFORE_name, true); zval const_LB_MANDATORY_BREAK_value; ZVAL_LONG(&const_LB_MANDATORY_BREAK_value, U_LB_MANDATORY_BREAK); - zend_string *const_LB_MANDATORY_BREAK_name = zend_string_init_interned("LB_MANDATORY_BREAK", sizeof("LB_MANDATORY_BREAK") - 1, 1); + zend_string *const_LB_MANDATORY_BREAK_name = zend_string_init_interned("LB_MANDATORY_BREAK", sizeof("LB_MANDATORY_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_MANDATORY_BREAK_name, &const_LB_MANDATORY_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_MANDATORY_BREAK_name); + zend_string_release_ex(const_LB_MANDATORY_BREAK_name, true); zval const_LB_CONTINGENT_BREAK_value; ZVAL_LONG(&const_LB_CONTINGENT_BREAK_value, U_LB_CONTINGENT_BREAK); - zend_string *const_LB_CONTINGENT_BREAK_name = zend_string_init_interned("LB_CONTINGENT_BREAK", sizeof("LB_CONTINGENT_BREAK") - 1, 1); + zend_string *const_LB_CONTINGENT_BREAK_name = zend_string_init_interned("LB_CONTINGENT_BREAK", sizeof("LB_CONTINGENT_BREAK") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_CONTINGENT_BREAK_name, &const_LB_CONTINGENT_BREAK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_CONTINGENT_BREAK_name); + zend_string_release_ex(const_LB_CONTINGENT_BREAK_name, true); zval const_LB_CLOSE_PUNCTUATION_value; ZVAL_LONG(&const_LB_CLOSE_PUNCTUATION_value, U_LB_CLOSE_PUNCTUATION); - zend_string *const_LB_CLOSE_PUNCTUATION_name = zend_string_init_interned("LB_CLOSE_PUNCTUATION", sizeof("LB_CLOSE_PUNCTUATION") - 1, 1); + zend_string *const_LB_CLOSE_PUNCTUATION_name = zend_string_init_interned("LB_CLOSE_PUNCTUATION", sizeof("LB_CLOSE_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_CLOSE_PUNCTUATION_name, &const_LB_CLOSE_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_CLOSE_PUNCTUATION_name); + zend_string_release_ex(const_LB_CLOSE_PUNCTUATION_name, true); zval const_LB_COMBINING_MARK_value; ZVAL_LONG(&const_LB_COMBINING_MARK_value, U_LB_COMBINING_MARK); - zend_string *const_LB_COMBINING_MARK_name = zend_string_init_interned("LB_COMBINING_MARK", sizeof("LB_COMBINING_MARK") - 1, 1); + zend_string *const_LB_COMBINING_MARK_name = zend_string_init_interned("LB_COMBINING_MARK", sizeof("LB_COMBINING_MARK") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_COMBINING_MARK_name, &const_LB_COMBINING_MARK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_COMBINING_MARK_name); + zend_string_release_ex(const_LB_COMBINING_MARK_name, true); zval const_LB_CARRIAGE_RETURN_value; ZVAL_LONG(&const_LB_CARRIAGE_RETURN_value, U_LB_CARRIAGE_RETURN); - zend_string *const_LB_CARRIAGE_RETURN_name = zend_string_init_interned("LB_CARRIAGE_RETURN", sizeof("LB_CARRIAGE_RETURN") - 1, 1); + zend_string *const_LB_CARRIAGE_RETURN_name = zend_string_init_interned("LB_CARRIAGE_RETURN", sizeof("LB_CARRIAGE_RETURN") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_CARRIAGE_RETURN_name, &const_LB_CARRIAGE_RETURN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_CARRIAGE_RETURN_name); + zend_string_release_ex(const_LB_CARRIAGE_RETURN_name, true); zval const_LB_EXCLAMATION_value; ZVAL_LONG(&const_LB_EXCLAMATION_value, U_LB_EXCLAMATION); - zend_string *const_LB_EXCLAMATION_name = zend_string_init_interned("LB_EXCLAMATION", sizeof("LB_EXCLAMATION") - 1, 1); + zend_string *const_LB_EXCLAMATION_name = zend_string_init_interned("LB_EXCLAMATION", sizeof("LB_EXCLAMATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_EXCLAMATION_name, &const_LB_EXCLAMATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_EXCLAMATION_name); + zend_string_release_ex(const_LB_EXCLAMATION_name, true); zval const_LB_GLUE_value; ZVAL_LONG(&const_LB_GLUE_value, U_LB_GLUE); - zend_string *const_LB_GLUE_name = zend_string_init_interned("LB_GLUE", sizeof("LB_GLUE") - 1, 1); + zend_string *const_LB_GLUE_name = zend_string_init_interned("LB_GLUE", sizeof("LB_GLUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_GLUE_name, &const_LB_GLUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_GLUE_name); + zend_string_release_ex(const_LB_GLUE_name, true); zval const_LB_HYPHEN_value; ZVAL_LONG(&const_LB_HYPHEN_value, U_LB_HYPHEN); - zend_string *const_LB_HYPHEN_name = zend_string_init_interned("LB_HYPHEN", sizeof("LB_HYPHEN") - 1, 1); + zend_string *const_LB_HYPHEN_name = zend_string_init_interned("LB_HYPHEN", sizeof("LB_HYPHEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_HYPHEN_name, &const_LB_HYPHEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_HYPHEN_name); + zend_string_release_ex(const_LB_HYPHEN_name, true); zval const_LB_IDEOGRAPHIC_value; ZVAL_LONG(&const_LB_IDEOGRAPHIC_value, U_LB_IDEOGRAPHIC); - zend_string *const_LB_IDEOGRAPHIC_name = zend_string_init_interned("LB_IDEOGRAPHIC", sizeof("LB_IDEOGRAPHIC") - 1, 1); + zend_string *const_LB_IDEOGRAPHIC_name = zend_string_init_interned("LB_IDEOGRAPHIC", sizeof("LB_IDEOGRAPHIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_IDEOGRAPHIC_name, &const_LB_IDEOGRAPHIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_IDEOGRAPHIC_name); + zend_string_release_ex(const_LB_IDEOGRAPHIC_name, true); zval const_LB_INSEPARABLE_value; ZVAL_LONG(&const_LB_INSEPARABLE_value, U_LB_INSEPARABLE); - zend_string *const_LB_INSEPARABLE_name = zend_string_init_interned("LB_INSEPARABLE", sizeof("LB_INSEPARABLE") - 1, 1); + zend_string *const_LB_INSEPARABLE_name = zend_string_init_interned("LB_INSEPARABLE", sizeof("LB_INSEPARABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_INSEPARABLE_name, &const_LB_INSEPARABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_INSEPARABLE_name); + zend_string_release_ex(const_LB_INSEPARABLE_name, true); zval const_LB_INSEPERABLE_value; ZVAL_LONG(&const_LB_INSEPERABLE_value, U_LB_INSEPERABLE); - zend_string *const_LB_INSEPERABLE_name = zend_string_init_interned("LB_INSEPERABLE", sizeof("LB_INSEPERABLE") - 1, 1); + zend_string *const_LB_INSEPERABLE_name = zend_string_init_interned("LB_INSEPERABLE", sizeof("LB_INSEPERABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_INSEPERABLE_name, &const_LB_INSEPERABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_INSEPERABLE_name); + zend_string_release_ex(const_LB_INSEPERABLE_name, true); zval const_LB_INFIX_NUMERIC_value; ZVAL_LONG(&const_LB_INFIX_NUMERIC_value, U_LB_INFIX_NUMERIC); - zend_string *const_LB_INFIX_NUMERIC_name = zend_string_init_interned("LB_INFIX_NUMERIC", sizeof("LB_INFIX_NUMERIC") - 1, 1); + zend_string *const_LB_INFIX_NUMERIC_name = zend_string_init_interned("LB_INFIX_NUMERIC", sizeof("LB_INFIX_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_INFIX_NUMERIC_name, &const_LB_INFIX_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_INFIX_NUMERIC_name); + zend_string_release_ex(const_LB_INFIX_NUMERIC_name, true); zval const_LB_LINE_FEED_value; ZVAL_LONG(&const_LB_LINE_FEED_value, U_LB_LINE_FEED); - zend_string *const_LB_LINE_FEED_name = zend_string_init_interned("LB_LINE_FEED", sizeof("LB_LINE_FEED") - 1, 1); + zend_string *const_LB_LINE_FEED_name = zend_string_init_interned("LB_LINE_FEED", sizeof("LB_LINE_FEED") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_LINE_FEED_name, &const_LB_LINE_FEED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_LINE_FEED_name); + zend_string_release_ex(const_LB_LINE_FEED_name, true); zval const_LB_NONSTARTER_value; ZVAL_LONG(&const_LB_NONSTARTER_value, U_LB_NONSTARTER); - zend_string *const_LB_NONSTARTER_name = zend_string_init_interned("LB_NONSTARTER", sizeof("LB_NONSTARTER") - 1, 1); + zend_string *const_LB_NONSTARTER_name = zend_string_init_interned("LB_NONSTARTER", sizeof("LB_NONSTARTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_NONSTARTER_name, &const_LB_NONSTARTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_NONSTARTER_name); + zend_string_release_ex(const_LB_NONSTARTER_name, true); zval const_LB_NUMERIC_value; ZVAL_LONG(&const_LB_NUMERIC_value, U_LB_NUMERIC); - zend_string *const_LB_NUMERIC_name = zend_string_init_interned("LB_NUMERIC", sizeof("LB_NUMERIC") - 1, 1); + zend_string *const_LB_NUMERIC_name = zend_string_init_interned("LB_NUMERIC", sizeof("LB_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_NUMERIC_name, &const_LB_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_NUMERIC_name); + zend_string_release_ex(const_LB_NUMERIC_name, true); zval const_LB_OPEN_PUNCTUATION_value; ZVAL_LONG(&const_LB_OPEN_PUNCTUATION_value, U_LB_OPEN_PUNCTUATION); - zend_string *const_LB_OPEN_PUNCTUATION_name = zend_string_init_interned("LB_OPEN_PUNCTUATION", sizeof("LB_OPEN_PUNCTUATION") - 1, 1); + zend_string *const_LB_OPEN_PUNCTUATION_name = zend_string_init_interned("LB_OPEN_PUNCTUATION", sizeof("LB_OPEN_PUNCTUATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_OPEN_PUNCTUATION_name, &const_LB_OPEN_PUNCTUATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_OPEN_PUNCTUATION_name); + zend_string_release_ex(const_LB_OPEN_PUNCTUATION_name, true); zval const_LB_POSTFIX_NUMERIC_value; ZVAL_LONG(&const_LB_POSTFIX_NUMERIC_value, U_LB_POSTFIX_NUMERIC); - zend_string *const_LB_POSTFIX_NUMERIC_name = zend_string_init_interned("LB_POSTFIX_NUMERIC", sizeof("LB_POSTFIX_NUMERIC") - 1, 1); + zend_string *const_LB_POSTFIX_NUMERIC_name = zend_string_init_interned("LB_POSTFIX_NUMERIC", sizeof("LB_POSTFIX_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_POSTFIX_NUMERIC_name, &const_LB_POSTFIX_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_POSTFIX_NUMERIC_name); + zend_string_release_ex(const_LB_POSTFIX_NUMERIC_name, true); zval const_LB_PREFIX_NUMERIC_value; ZVAL_LONG(&const_LB_PREFIX_NUMERIC_value, U_LB_PREFIX_NUMERIC); - zend_string *const_LB_PREFIX_NUMERIC_name = zend_string_init_interned("LB_PREFIX_NUMERIC", sizeof("LB_PREFIX_NUMERIC") - 1, 1); + zend_string *const_LB_PREFIX_NUMERIC_name = zend_string_init_interned("LB_PREFIX_NUMERIC", sizeof("LB_PREFIX_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_PREFIX_NUMERIC_name, &const_LB_PREFIX_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_PREFIX_NUMERIC_name); + zend_string_release_ex(const_LB_PREFIX_NUMERIC_name, true); zval const_LB_QUOTATION_value; ZVAL_LONG(&const_LB_QUOTATION_value, U_LB_QUOTATION); - zend_string *const_LB_QUOTATION_name = zend_string_init_interned("LB_QUOTATION", sizeof("LB_QUOTATION") - 1, 1); + zend_string *const_LB_QUOTATION_name = zend_string_init_interned("LB_QUOTATION", sizeof("LB_QUOTATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_QUOTATION_name, &const_LB_QUOTATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_QUOTATION_name); + zend_string_release_ex(const_LB_QUOTATION_name, true); zval const_LB_COMPLEX_CONTEXT_value; ZVAL_LONG(&const_LB_COMPLEX_CONTEXT_value, U_LB_COMPLEX_CONTEXT); - zend_string *const_LB_COMPLEX_CONTEXT_name = zend_string_init_interned("LB_COMPLEX_CONTEXT", sizeof("LB_COMPLEX_CONTEXT") - 1, 1); + zend_string *const_LB_COMPLEX_CONTEXT_name = zend_string_init_interned("LB_COMPLEX_CONTEXT", sizeof("LB_COMPLEX_CONTEXT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_COMPLEX_CONTEXT_name, &const_LB_COMPLEX_CONTEXT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_COMPLEX_CONTEXT_name); + zend_string_release_ex(const_LB_COMPLEX_CONTEXT_name, true); zval const_LB_SURROGATE_value; ZVAL_LONG(&const_LB_SURROGATE_value, U_LB_SURROGATE); - zend_string *const_LB_SURROGATE_name = zend_string_init_interned("LB_SURROGATE", sizeof("LB_SURROGATE") - 1, 1); + zend_string *const_LB_SURROGATE_name = zend_string_init_interned("LB_SURROGATE", sizeof("LB_SURROGATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_SURROGATE_name, &const_LB_SURROGATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_SURROGATE_name); + zend_string_release_ex(const_LB_SURROGATE_name, true); zval const_LB_SPACE_value; ZVAL_LONG(&const_LB_SPACE_value, U_LB_SPACE); - zend_string *const_LB_SPACE_name = zend_string_init_interned("LB_SPACE", sizeof("LB_SPACE") - 1, 1); + zend_string *const_LB_SPACE_name = zend_string_init_interned("LB_SPACE", sizeof("LB_SPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_SPACE_name, &const_LB_SPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_SPACE_name); + zend_string_release_ex(const_LB_SPACE_name, true); zval const_LB_BREAK_SYMBOLS_value; ZVAL_LONG(&const_LB_BREAK_SYMBOLS_value, U_LB_BREAK_SYMBOLS); - zend_string *const_LB_BREAK_SYMBOLS_name = zend_string_init_interned("LB_BREAK_SYMBOLS", sizeof("LB_BREAK_SYMBOLS") - 1, 1); + zend_string *const_LB_BREAK_SYMBOLS_name = zend_string_init_interned("LB_BREAK_SYMBOLS", sizeof("LB_BREAK_SYMBOLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_BREAK_SYMBOLS_name, &const_LB_BREAK_SYMBOLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_BREAK_SYMBOLS_name); + zend_string_release_ex(const_LB_BREAK_SYMBOLS_name, true); zval const_LB_ZWSPACE_value; ZVAL_LONG(&const_LB_ZWSPACE_value, U_LB_ZWSPACE); - zend_string *const_LB_ZWSPACE_name = zend_string_init_interned("LB_ZWSPACE", sizeof("LB_ZWSPACE") - 1, 1); + zend_string *const_LB_ZWSPACE_name = zend_string_init_interned("LB_ZWSPACE", sizeof("LB_ZWSPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_ZWSPACE_name, &const_LB_ZWSPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_ZWSPACE_name); + zend_string_release_ex(const_LB_ZWSPACE_name, true); zval const_LB_NEXT_LINE_value; ZVAL_LONG(&const_LB_NEXT_LINE_value, U_LB_NEXT_LINE); - zend_string *const_LB_NEXT_LINE_name = zend_string_init_interned("LB_NEXT_LINE", sizeof("LB_NEXT_LINE") - 1, 1); + zend_string *const_LB_NEXT_LINE_name = zend_string_init_interned("LB_NEXT_LINE", sizeof("LB_NEXT_LINE") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_NEXT_LINE_name, &const_LB_NEXT_LINE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_NEXT_LINE_name); + zend_string_release_ex(const_LB_NEXT_LINE_name, true); zval const_LB_WORD_JOINER_value; ZVAL_LONG(&const_LB_WORD_JOINER_value, U_LB_WORD_JOINER); - zend_string *const_LB_WORD_JOINER_name = zend_string_init_interned("LB_WORD_JOINER", sizeof("LB_WORD_JOINER") - 1, 1); + zend_string *const_LB_WORD_JOINER_name = zend_string_init_interned("LB_WORD_JOINER", sizeof("LB_WORD_JOINER") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_WORD_JOINER_name, &const_LB_WORD_JOINER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_WORD_JOINER_name); + zend_string_release_ex(const_LB_WORD_JOINER_name, true); zval const_LB_H2_value; ZVAL_LONG(&const_LB_H2_value, U_LB_H2); - zend_string *const_LB_H2_name = zend_string_init_interned("LB_H2", sizeof("LB_H2") - 1, 1); + zend_string *const_LB_H2_name = zend_string_init_interned("LB_H2", sizeof("LB_H2") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_H2_name, &const_LB_H2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_H2_name); + zend_string_release_ex(const_LB_H2_name, true); zval const_LB_H3_value; ZVAL_LONG(&const_LB_H3_value, U_LB_H3); - zend_string *const_LB_H3_name = zend_string_init_interned("LB_H3", sizeof("LB_H3") - 1, 1); + zend_string *const_LB_H3_name = zend_string_init_interned("LB_H3", sizeof("LB_H3") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_H3_name, &const_LB_H3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_H3_name); + zend_string_release_ex(const_LB_H3_name, true); zval const_LB_JL_value; ZVAL_LONG(&const_LB_JL_value, U_LB_JL); - zend_string *const_LB_JL_name = zend_string_init_interned("LB_JL", sizeof("LB_JL") - 1, 1); + zend_string *const_LB_JL_name = zend_string_init_interned("LB_JL", sizeof("LB_JL") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_JL_name, &const_LB_JL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_JL_name); + zend_string_release_ex(const_LB_JL_name, true); zval const_LB_JT_value; ZVAL_LONG(&const_LB_JT_value, U_LB_JT); - zend_string *const_LB_JT_name = zend_string_init_interned("LB_JT", sizeof("LB_JT") - 1, 1); + zend_string *const_LB_JT_name = zend_string_init_interned("LB_JT", sizeof("LB_JT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_JT_name, &const_LB_JT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_JT_name); + zend_string_release_ex(const_LB_JT_name, true); zval const_LB_JV_value; ZVAL_LONG(&const_LB_JV_value, U_LB_JV); - zend_string *const_LB_JV_name = zend_string_init_interned("LB_JV", sizeof("LB_JV") - 1, 1); + zend_string *const_LB_JV_name = zend_string_init_interned("LB_JV", sizeof("LB_JV") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_JV_name, &const_LB_JV_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_JV_name); + zend_string_release_ex(const_LB_JV_name, true); zval const_LB_CLOSE_PARENTHESIS_value; ZVAL_LONG(&const_LB_CLOSE_PARENTHESIS_value, U_LB_CLOSE_PARENTHESIS); - zend_string *const_LB_CLOSE_PARENTHESIS_name = zend_string_init_interned("LB_CLOSE_PARENTHESIS", sizeof("LB_CLOSE_PARENTHESIS") - 1, 1); + zend_string *const_LB_CLOSE_PARENTHESIS_name = zend_string_init_interned("LB_CLOSE_PARENTHESIS", sizeof("LB_CLOSE_PARENTHESIS") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_CLOSE_PARENTHESIS_name, &const_LB_CLOSE_PARENTHESIS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_CLOSE_PARENTHESIS_name); + zend_string_release_ex(const_LB_CLOSE_PARENTHESIS_name, true); zval const_LB_CONDITIONAL_JAPANESE_STARTER_value; ZVAL_LONG(&const_LB_CONDITIONAL_JAPANESE_STARTER_value, U_LB_CONDITIONAL_JAPANESE_STARTER); - zend_string *const_LB_CONDITIONAL_JAPANESE_STARTER_name = zend_string_init_interned("LB_CONDITIONAL_JAPANESE_STARTER", sizeof("LB_CONDITIONAL_JAPANESE_STARTER") - 1, 1); + zend_string *const_LB_CONDITIONAL_JAPANESE_STARTER_name = zend_string_init_interned("LB_CONDITIONAL_JAPANESE_STARTER", sizeof("LB_CONDITIONAL_JAPANESE_STARTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_CONDITIONAL_JAPANESE_STARTER_name, &const_LB_CONDITIONAL_JAPANESE_STARTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_CONDITIONAL_JAPANESE_STARTER_name); + zend_string_release_ex(const_LB_CONDITIONAL_JAPANESE_STARTER_name, true); zval const_LB_HEBREW_LETTER_value; ZVAL_LONG(&const_LB_HEBREW_LETTER_value, U_LB_HEBREW_LETTER); - zend_string *const_LB_HEBREW_LETTER_name = zend_string_init_interned("LB_HEBREW_LETTER", sizeof("LB_HEBREW_LETTER") - 1, 1); + zend_string *const_LB_HEBREW_LETTER_name = zend_string_init_interned("LB_HEBREW_LETTER", sizeof("LB_HEBREW_LETTER") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_HEBREW_LETTER_name, &const_LB_HEBREW_LETTER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_HEBREW_LETTER_name); + zend_string_release_ex(const_LB_HEBREW_LETTER_name, true); zval const_LB_REGIONAL_INDICATOR_value; ZVAL_LONG(&const_LB_REGIONAL_INDICATOR_value, U_LB_REGIONAL_INDICATOR); - zend_string *const_LB_REGIONAL_INDICATOR_name = zend_string_init_interned("LB_REGIONAL_INDICATOR", sizeof("LB_REGIONAL_INDICATOR") - 1, 1); + zend_string *const_LB_REGIONAL_INDICATOR_name = zend_string_init_interned("LB_REGIONAL_INDICATOR", sizeof("LB_REGIONAL_INDICATOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_REGIONAL_INDICATOR_name, &const_LB_REGIONAL_INDICATOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_REGIONAL_INDICATOR_name); + zend_string_release_ex(const_LB_REGIONAL_INDICATOR_name, true); zval const_LB_COUNT_value; ZVAL_LONG(&const_LB_COUNT_value, U_LB_COUNT); - zend_string *const_LB_COUNT_name = zend_string_init_interned("LB_COUNT", sizeof("LB_COUNT") - 1, 1); + zend_string *const_LB_COUNT_name = zend_string_init_interned("LB_COUNT", sizeof("LB_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_LB_COUNT_name, &const_LB_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LB_COUNT_name); + zend_string_release_ex(const_LB_COUNT_name, true); zval const_NT_NONE_value; ZVAL_LONG(&const_NT_NONE_value, U_NT_NONE); - zend_string *const_NT_NONE_name = zend_string_init_interned("NT_NONE", sizeof("NT_NONE") - 1, 1); + zend_string *const_NT_NONE_name = zend_string_init_interned("NT_NONE", sizeof("NT_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NT_NONE_name, &const_NT_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NT_NONE_name); + zend_string_release_ex(const_NT_NONE_name, true); zval const_NT_DECIMAL_value; ZVAL_LONG(&const_NT_DECIMAL_value, U_NT_DECIMAL); - zend_string *const_NT_DECIMAL_name = zend_string_init_interned("NT_DECIMAL", sizeof("NT_DECIMAL") - 1, 1); + zend_string *const_NT_DECIMAL_name = zend_string_init_interned("NT_DECIMAL", sizeof("NT_DECIMAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_NT_DECIMAL_name, &const_NT_DECIMAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NT_DECIMAL_name); + zend_string_release_ex(const_NT_DECIMAL_name, true); zval const_NT_DIGIT_value; ZVAL_LONG(&const_NT_DIGIT_value, U_NT_DIGIT); - zend_string *const_NT_DIGIT_name = zend_string_init_interned("NT_DIGIT", sizeof("NT_DIGIT") - 1, 1); + zend_string *const_NT_DIGIT_name = zend_string_init_interned("NT_DIGIT", sizeof("NT_DIGIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_NT_DIGIT_name, &const_NT_DIGIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NT_DIGIT_name); + zend_string_release_ex(const_NT_DIGIT_name, true); zval const_NT_NUMERIC_value; ZVAL_LONG(&const_NT_NUMERIC_value, U_NT_NUMERIC); - zend_string *const_NT_NUMERIC_name = zend_string_init_interned("NT_NUMERIC", sizeof("NT_NUMERIC") - 1, 1); + zend_string *const_NT_NUMERIC_name = zend_string_init_interned("NT_NUMERIC", sizeof("NT_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_NT_NUMERIC_name, &const_NT_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NT_NUMERIC_name); + zend_string_release_ex(const_NT_NUMERIC_name, true); zval const_NT_COUNT_value; ZVAL_LONG(&const_NT_COUNT_value, U_NT_COUNT); - zend_string *const_NT_COUNT_name = zend_string_init_interned("NT_COUNT", sizeof("NT_COUNT") - 1, 1); + zend_string *const_NT_COUNT_name = zend_string_init_interned("NT_COUNT", sizeof("NT_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_NT_COUNT_name, &const_NT_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NT_COUNT_name); + zend_string_release_ex(const_NT_COUNT_name, true); zval const_HST_NOT_APPLICABLE_value; ZVAL_LONG(&const_HST_NOT_APPLICABLE_value, U_HST_NOT_APPLICABLE); - zend_string *const_HST_NOT_APPLICABLE_name = zend_string_init_interned("HST_NOT_APPLICABLE", sizeof("HST_NOT_APPLICABLE") - 1, 1); + zend_string *const_HST_NOT_APPLICABLE_name = zend_string_init_interned("HST_NOT_APPLICABLE", sizeof("HST_NOT_APPLICABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_NOT_APPLICABLE_name, &const_HST_NOT_APPLICABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_NOT_APPLICABLE_name); + zend_string_release_ex(const_HST_NOT_APPLICABLE_name, true); zval const_HST_LEADING_JAMO_value; ZVAL_LONG(&const_HST_LEADING_JAMO_value, U_HST_LEADING_JAMO); - zend_string *const_HST_LEADING_JAMO_name = zend_string_init_interned("HST_LEADING_JAMO", sizeof("HST_LEADING_JAMO") - 1, 1); + zend_string *const_HST_LEADING_JAMO_name = zend_string_init_interned("HST_LEADING_JAMO", sizeof("HST_LEADING_JAMO") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_LEADING_JAMO_name, &const_HST_LEADING_JAMO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_LEADING_JAMO_name); + zend_string_release_ex(const_HST_LEADING_JAMO_name, true); zval const_HST_VOWEL_JAMO_value; ZVAL_LONG(&const_HST_VOWEL_JAMO_value, U_HST_VOWEL_JAMO); - zend_string *const_HST_VOWEL_JAMO_name = zend_string_init_interned("HST_VOWEL_JAMO", sizeof("HST_VOWEL_JAMO") - 1, 1); + zend_string *const_HST_VOWEL_JAMO_name = zend_string_init_interned("HST_VOWEL_JAMO", sizeof("HST_VOWEL_JAMO") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_VOWEL_JAMO_name, &const_HST_VOWEL_JAMO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_VOWEL_JAMO_name); + zend_string_release_ex(const_HST_VOWEL_JAMO_name, true); zval const_HST_TRAILING_JAMO_value; ZVAL_LONG(&const_HST_TRAILING_JAMO_value, U_HST_TRAILING_JAMO); - zend_string *const_HST_TRAILING_JAMO_name = zend_string_init_interned("HST_TRAILING_JAMO", sizeof("HST_TRAILING_JAMO") - 1, 1); + zend_string *const_HST_TRAILING_JAMO_name = zend_string_init_interned("HST_TRAILING_JAMO", sizeof("HST_TRAILING_JAMO") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_TRAILING_JAMO_name, &const_HST_TRAILING_JAMO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_TRAILING_JAMO_name); + zend_string_release_ex(const_HST_TRAILING_JAMO_name, true); zval const_HST_LV_SYLLABLE_value; ZVAL_LONG(&const_HST_LV_SYLLABLE_value, U_HST_LV_SYLLABLE); - zend_string *const_HST_LV_SYLLABLE_name = zend_string_init_interned("HST_LV_SYLLABLE", sizeof("HST_LV_SYLLABLE") - 1, 1); + zend_string *const_HST_LV_SYLLABLE_name = zend_string_init_interned("HST_LV_SYLLABLE", sizeof("HST_LV_SYLLABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_LV_SYLLABLE_name, &const_HST_LV_SYLLABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_LV_SYLLABLE_name); + zend_string_release_ex(const_HST_LV_SYLLABLE_name, true); zval const_HST_LVT_SYLLABLE_value; ZVAL_LONG(&const_HST_LVT_SYLLABLE_value, U_HST_LVT_SYLLABLE); - zend_string *const_HST_LVT_SYLLABLE_name = zend_string_init_interned("HST_LVT_SYLLABLE", sizeof("HST_LVT_SYLLABLE") - 1, 1); + zend_string *const_HST_LVT_SYLLABLE_name = zend_string_init_interned("HST_LVT_SYLLABLE", sizeof("HST_LVT_SYLLABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_LVT_SYLLABLE_name, &const_HST_LVT_SYLLABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_LVT_SYLLABLE_name); + zend_string_release_ex(const_HST_LVT_SYLLABLE_name, true); zval const_HST_COUNT_value; ZVAL_LONG(&const_HST_COUNT_value, U_HST_COUNT); - zend_string *const_HST_COUNT_name = zend_string_init_interned("HST_COUNT", sizeof("HST_COUNT") - 1, 1); + zend_string *const_HST_COUNT_name = zend_string_init_interned("HST_COUNT", sizeof("HST_COUNT") - 1, true); zend_declare_typed_class_constant(class_entry, const_HST_COUNT_name, &const_HST_COUNT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_HST_COUNT_name); + zend_string_release_ex(const_HST_COUNT_name, true); zval const_FOLD_CASE_DEFAULT_value; ZVAL_LONG(&const_FOLD_CASE_DEFAULT_value, U_FOLD_CASE_DEFAULT); - zend_string *const_FOLD_CASE_DEFAULT_name = zend_string_init_interned("FOLD_CASE_DEFAULT", sizeof("FOLD_CASE_DEFAULT") - 1, 1); + zend_string *const_FOLD_CASE_DEFAULT_name = zend_string_init_interned("FOLD_CASE_DEFAULT", sizeof("FOLD_CASE_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_FOLD_CASE_DEFAULT_name, &const_FOLD_CASE_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FOLD_CASE_DEFAULT_name); + zend_string_release_ex(const_FOLD_CASE_DEFAULT_name, true); zval const_FOLD_CASE_EXCLUDE_SPECIAL_I_value; ZVAL_LONG(&const_FOLD_CASE_EXCLUDE_SPECIAL_I_value, U_FOLD_CASE_EXCLUDE_SPECIAL_I); - zend_string *const_FOLD_CASE_EXCLUDE_SPECIAL_I_name = zend_string_init_interned("FOLD_CASE_EXCLUDE_SPECIAL_I", sizeof("FOLD_CASE_EXCLUDE_SPECIAL_I") - 1, 1); + zend_string *const_FOLD_CASE_EXCLUDE_SPECIAL_I_name = zend_string_init_interned("FOLD_CASE_EXCLUDE_SPECIAL_I", sizeof("FOLD_CASE_EXCLUDE_SPECIAL_I") - 1, true); zend_declare_typed_class_constant(class_entry, const_FOLD_CASE_EXCLUDE_SPECIAL_I_name, &const_FOLD_CASE_EXCLUDE_SPECIAL_I_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FOLD_CASE_EXCLUDE_SPECIAL_I_name); + zend_string_release_ex(const_FOLD_CASE_EXCLUDE_SPECIAL_I_name, true); return class_entry; } diff --git a/ext/libxml/libxml_arginfo.h b/ext/libxml/libxml_arginfo.h index 1741b7fa98604..9e3e07c83e503 100644 --- a/ext/libxml/libxml_arginfo.h +++ b/ext/libxml/libxml_arginfo.h @@ -104,9 +104,9 @@ static zend_class_entry *register_class_LibXMLError(void) zval property_level_default_value; ZVAL_UNDEF(&property_level_default_value); - zend_string *property_level_name = zend_string_init("level", sizeof("level") - 1, 1); + zend_string *property_level_name = zend_string_init("level", sizeof("level") - 1, true); zend_declare_typed_property(class_entry, property_level_name, &property_level_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_level_name); + zend_string_release_ex(property_level_name, true); zval property_code_default_value; ZVAL_UNDEF(&property_code_default_value); @@ -114,9 +114,9 @@ static zend_class_entry *register_class_LibXMLError(void) zval property_column_default_value; ZVAL_UNDEF(&property_column_default_value); - zend_string *property_column_name = zend_string_init("column", sizeof("column") - 1, 1); + zend_string *property_column_name = zend_string_init("column", sizeof("column") - 1, true); zend_declare_typed_property(class_entry, property_column_name, &property_column_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_column_name); + zend_string_release_ex(property_column_name, true); zval property_message_default_value; ZVAL_UNDEF(&property_message_default_value); diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index de7cfa53e0f4f..789464a762538 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1302,27 +1302,27 @@ static zend_class_entry *register_class_mysqli_driver(void) zval property_client_info_default_value; ZVAL_UNDEF(&property_client_info_default_value); - zend_string *property_client_info_name = zend_string_init("client_info", sizeof("client_info") - 1, 1); + zend_string *property_client_info_name = zend_string_init("client_info", sizeof("client_info") - 1, true); zend_declare_typed_property(class_entry, property_client_info_name, &property_client_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_client_info_name); + zend_string_release_ex(property_client_info_name, true); zval property_client_version_default_value; ZVAL_UNDEF(&property_client_version_default_value); - zend_string *property_client_version_name = zend_string_init("client_version", sizeof("client_version") - 1, 1); + zend_string *property_client_version_name = zend_string_init("client_version", sizeof("client_version") - 1, true); zend_declare_typed_property(class_entry, property_client_version_name, &property_client_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_client_version_name); + zend_string_release_ex(property_client_version_name, true); zval property_driver_version_default_value; ZVAL_UNDEF(&property_driver_version_default_value); - zend_string *property_driver_version_name = zend_string_init("driver_version", sizeof("driver_version") - 1, 1); + zend_string *property_driver_version_name = zend_string_init("driver_version", sizeof("driver_version") - 1, true); zend_declare_typed_property(class_entry, property_driver_version_name, &property_driver_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_driver_version_name); + zend_string_release_ex(property_driver_version_name, true); zval property_report_mode_default_value; ZVAL_LONG(&property_report_mode_default_value, 0); - zend_string *property_report_mode_name = zend_string_init("report_mode", sizeof("report_mode") - 1, 1); + zend_string *property_report_mode_name = zend_string_init("report_mode", sizeof("report_mode") - 1, true); zend_declare_typed_property(class_entry, property_report_mode_name, &property_report_mode_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_report_mode_name); + zend_string_release_ex(property_report_mode_name, true); return class_entry; } @@ -1336,111 +1336,111 @@ static zend_class_entry *register_class_mysqli(void) zval property_affected_rows_default_value; ZVAL_UNDEF(&property_affected_rows_default_value); - zend_string *property_affected_rows_name = zend_string_init("affected_rows", sizeof("affected_rows") - 1, 1); + zend_string *property_affected_rows_name = zend_string_init("affected_rows", sizeof("affected_rows") - 1, true); zend_declare_typed_property(class_entry, property_affected_rows_name, &property_affected_rows_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_affected_rows_name); + zend_string_release_ex(property_affected_rows_name, true); zval property_client_info_default_value; ZVAL_UNDEF(&property_client_info_default_value); - zend_string *property_client_info_name = zend_string_init("client_info", sizeof("client_info") - 1, 1); + zend_string *property_client_info_name = zend_string_init("client_info", sizeof("client_info") - 1, true); zend_declare_typed_property(class_entry, property_client_info_name, &property_client_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_client_info_name); + zend_string_release_ex(property_client_info_name, true); zval property_client_version_default_value; ZVAL_UNDEF(&property_client_version_default_value); - zend_string *property_client_version_name = zend_string_init("client_version", sizeof("client_version") - 1, 1); + zend_string *property_client_version_name = zend_string_init("client_version", sizeof("client_version") - 1, true); zend_declare_typed_property(class_entry, property_client_version_name, &property_client_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_client_version_name); + zend_string_release_ex(property_client_version_name, true); zval property_connect_errno_default_value; ZVAL_UNDEF(&property_connect_errno_default_value); - zend_string *property_connect_errno_name = zend_string_init("connect_errno", sizeof("connect_errno") - 1, 1); + zend_string *property_connect_errno_name = zend_string_init("connect_errno", sizeof("connect_errno") - 1, true); zend_declare_typed_property(class_entry, property_connect_errno_name, &property_connect_errno_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_connect_errno_name); + zend_string_release_ex(property_connect_errno_name, true); zval property_connect_error_default_value; ZVAL_UNDEF(&property_connect_error_default_value); - zend_string *property_connect_error_name = zend_string_init("connect_error", sizeof("connect_error") - 1, 1); + zend_string *property_connect_error_name = zend_string_init("connect_error", sizeof("connect_error") - 1, true); zend_declare_typed_property(class_entry, property_connect_error_name, &property_connect_error_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_connect_error_name); + zend_string_release_ex(property_connect_error_name, true); zval property_errno_default_value; ZVAL_UNDEF(&property_errno_default_value); - zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, 1); + zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, true); zend_declare_typed_property(class_entry, property_errno_name, &property_errno_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_errno_name); + zend_string_release_ex(property_errno_name, true); zval property_error_default_value; ZVAL_UNDEF(&property_error_default_value); - zend_string *property_error_name = zend_string_init("error", sizeof("error") - 1, 1); + zend_string *property_error_name = zend_string_init("error", sizeof("error") - 1, true); zend_declare_typed_property(class_entry, property_error_name, &property_error_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_error_name); + zend_string_release_ex(property_error_name, true); zval property_error_list_default_value; ZVAL_UNDEF(&property_error_list_default_value); - zend_string *property_error_list_name = zend_string_init("error_list", sizeof("error_list") - 1, 1); + zend_string *property_error_list_name = zend_string_init("error_list", sizeof("error_list") - 1, true); zend_declare_typed_property(class_entry, property_error_list_name, &property_error_list_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property_error_list_name); + zend_string_release_ex(property_error_list_name, true); zval property_field_count_default_value; ZVAL_UNDEF(&property_field_count_default_value); - zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, 1); + zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, true); zend_declare_typed_property(class_entry, property_field_count_name, &property_field_count_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_field_count_name); + zend_string_release_ex(property_field_count_name, true); zval property_host_info_default_value; ZVAL_UNDEF(&property_host_info_default_value); - zend_string *property_host_info_name = zend_string_init("host_info", sizeof("host_info") - 1, 1); + zend_string *property_host_info_name = zend_string_init("host_info", sizeof("host_info") - 1, true); zend_declare_typed_property(class_entry, property_host_info_name, &property_host_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_host_info_name); + zend_string_release_ex(property_host_info_name, true); zval property_info_default_value; ZVAL_UNDEF(&property_info_default_value); - zend_string *property_info_name = zend_string_init("info", sizeof("info") - 1, 1); + zend_string *property_info_name = zend_string_init("info", sizeof("info") - 1, true); zend_declare_typed_property(class_entry, property_info_name, &property_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_info_name); + zend_string_release_ex(property_info_name, true); zval property_insert_id_default_value; ZVAL_UNDEF(&property_insert_id_default_value); - zend_string *property_insert_id_name = zend_string_init("insert_id", sizeof("insert_id") - 1, 1); + zend_string *property_insert_id_name = zend_string_init("insert_id", sizeof("insert_id") - 1, true); zend_declare_typed_property(class_entry, property_insert_id_name, &property_insert_id_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_insert_id_name); + zend_string_release_ex(property_insert_id_name, true); zval property_server_info_default_value; ZVAL_UNDEF(&property_server_info_default_value); - zend_string *property_server_info_name = zend_string_init("server_info", sizeof("server_info") - 1, 1); + zend_string *property_server_info_name = zend_string_init("server_info", sizeof("server_info") - 1, true); zend_declare_typed_property(class_entry, property_server_info_name, &property_server_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_server_info_name); + zend_string_release_ex(property_server_info_name, true); zval property_server_version_default_value; ZVAL_UNDEF(&property_server_version_default_value); - zend_string *property_server_version_name = zend_string_init("server_version", sizeof("server_version") - 1, 1); + zend_string *property_server_version_name = zend_string_init("server_version", sizeof("server_version") - 1, true); zend_declare_typed_property(class_entry, property_server_version_name, &property_server_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_server_version_name); + zend_string_release_ex(property_server_version_name, true); zval property_sqlstate_default_value; ZVAL_UNDEF(&property_sqlstate_default_value); - zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, 1); + zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, true); zend_declare_typed_property(class_entry, property_sqlstate_name, &property_sqlstate_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_sqlstate_name); + zend_string_release_ex(property_sqlstate_name, true); zval property_protocol_version_default_value; ZVAL_UNDEF(&property_protocol_version_default_value); - zend_string *property_protocol_version_name = zend_string_init("protocol_version", sizeof("protocol_version") - 1, 1); + zend_string *property_protocol_version_name = zend_string_init("protocol_version", sizeof("protocol_version") - 1, true); zend_declare_typed_property(class_entry, property_protocol_version_name, &property_protocol_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_protocol_version_name); + zend_string_release_ex(property_protocol_version_name, true); zval property_thread_id_default_value; ZVAL_UNDEF(&property_thread_id_default_value); - zend_string *property_thread_id_name = zend_string_init("thread_id", sizeof("thread_id") - 1, 1); + zend_string *property_thread_id_name = zend_string_init("thread_id", sizeof("thread_id") - 1, true); zend_declare_typed_property(class_entry, property_thread_id_name, &property_thread_id_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_thread_id_name); + zend_string_release_ex(property_thread_id_name, true); zval property_warning_count_default_value; ZVAL_UNDEF(&property_warning_count_default_value); - zend_string *property_warning_count_name = zend_string_init("warning_count", sizeof("warning_count") - 1, 1); + zend_string *property_warning_count_name = zend_string_init("warning_count", sizeof("warning_count") - 1, true); zend_declare_typed_property(class_entry, property_warning_count_name, &property_warning_count_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_warning_count_name); + zend_string_release_ex(property_warning_count_name, true); zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "__construct", sizeof("__construct") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); @@ -1499,27 +1499,27 @@ static zend_class_entry *register_class_mysqli_result(zend_class_entry *class_en zval property_current_field_default_value; ZVAL_UNDEF(&property_current_field_default_value); - zend_string *property_current_field_name = zend_string_init("current_field", sizeof("current_field") - 1, 1); + zend_string *property_current_field_name = zend_string_init("current_field", sizeof("current_field") - 1, true); zend_declare_typed_property(class_entry, property_current_field_name, &property_current_field_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_current_field_name); + zend_string_release_ex(property_current_field_name, true); zval property_field_count_default_value; ZVAL_UNDEF(&property_field_count_default_value); - zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, 1); + zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, true); zend_declare_typed_property(class_entry, property_field_count_name, &property_field_count_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_field_count_name); + zend_string_release_ex(property_field_count_name, true); zval property_lengths_default_value; ZVAL_UNDEF(&property_lengths_default_value); - zend_string *property_lengths_name = zend_string_init("lengths", sizeof("lengths") - 1, 1); + zend_string *property_lengths_name = zend_string_init("lengths", sizeof("lengths") - 1, true); zend_declare_typed_property(class_entry, property_lengths_name, &property_lengths_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property_lengths_name); + zend_string_release_ex(property_lengths_name, true); zval property_num_rows_default_value; ZVAL_UNDEF(&property_num_rows_default_value); - zend_string *property_num_rows_name = zend_string_init("num_rows", sizeof("num_rows") - 1, 1); + zend_string *property_num_rows_name = zend_string_init("num_rows", sizeof("num_rows") - 1, true); zend_declare_typed_property(class_entry, property_num_rows_name, &property_num_rows_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_num_rows_name); + zend_string_release_ex(property_num_rows_name, true); zval property_type_default_value; ZVAL_UNDEF(&property_type_default_value); @@ -1537,63 +1537,63 @@ static zend_class_entry *register_class_mysqli_stmt(void) zval property_affected_rows_default_value; ZVAL_UNDEF(&property_affected_rows_default_value); - zend_string *property_affected_rows_name = zend_string_init("affected_rows", sizeof("affected_rows") - 1, 1); + zend_string *property_affected_rows_name = zend_string_init("affected_rows", sizeof("affected_rows") - 1, true); zend_declare_typed_property(class_entry, property_affected_rows_name, &property_affected_rows_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_affected_rows_name); + zend_string_release_ex(property_affected_rows_name, true); zval property_insert_id_default_value; ZVAL_UNDEF(&property_insert_id_default_value); - zend_string *property_insert_id_name = zend_string_init("insert_id", sizeof("insert_id") - 1, 1); + zend_string *property_insert_id_name = zend_string_init("insert_id", sizeof("insert_id") - 1, true); zend_declare_typed_property(class_entry, property_insert_id_name, &property_insert_id_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_insert_id_name); + zend_string_release_ex(property_insert_id_name, true); zval property_num_rows_default_value; ZVAL_UNDEF(&property_num_rows_default_value); - zend_string *property_num_rows_name = zend_string_init("num_rows", sizeof("num_rows") - 1, 1); + zend_string *property_num_rows_name = zend_string_init("num_rows", sizeof("num_rows") - 1, true); zend_declare_typed_property(class_entry, property_num_rows_name, &property_num_rows_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); - zend_string_release(property_num_rows_name); + zend_string_release_ex(property_num_rows_name, true); zval property_param_count_default_value; ZVAL_UNDEF(&property_param_count_default_value); - zend_string *property_param_count_name = zend_string_init("param_count", sizeof("param_count") - 1, 1); + zend_string *property_param_count_name = zend_string_init("param_count", sizeof("param_count") - 1, true); zend_declare_typed_property(class_entry, property_param_count_name, &property_param_count_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_param_count_name); + zend_string_release_ex(property_param_count_name, true); zval property_field_count_default_value; ZVAL_UNDEF(&property_field_count_default_value); - zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, 1); + zend_string *property_field_count_name = zend_string_init("field_count", sizeof("field_count") - 1, true); zend_declare_typed_property(class_entry, property_field_count_name, &property_field_count_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_field_count_name); + zend_string_release_ex(property_field_count_name, true); zval property_errno_default_value; ZVAL_UNDEF(&property_errno_default_value); - zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, 1); + zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, true); zend_declare_typed_property(class_entry, property_errno_name, &property_errno_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_errno_name); + zend_string_release_ex(property_errno_name, true); zval property_error_default_value; ZVAL_UNDEF(&property_error_default_value); - zend_string *property_error_name = zend_string_init("error", sizeof("error") - 1, 1); + zend_string *property_error_name = zend_string_init("error", sizeof("error") - 1, true); zend_declare_typed_property(class_entry, property_error_name, &property_error_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_error_name); + zend_string_release_ex(property_error_name, true); zval property_error_list_default_value; ZVAL_UNDEF(&property_error_list_default_value); - zend_string *property_error_list_name = zend_string_init("error_list", sizeof("error_list") - 1, 1); + zend_string *property_error_list_name = zend_string_init("error_list", sizeof("error_list") - 1, true); zend_declare_typed_property(class_entry, property_error_list_name, &property_error_list_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property_error_list_name); + zend_string_release_ex(property_error_list_name, true); zval property_sqlstate_default_value; ZVAL_UNDEF(&property_sqlstate_default_value); - zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, 1); + zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, true); zend_declare_typed_property(class_entry, property_sqlstate_name, &property_sqlstate_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_sqlstate_name); + zend_string_release_ex(property_sqlstate_name, true); zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); return class_entry; } @@ -1611,15 +1611,15 @@ static zend_class_entry *register_class_mysqli_warning(void) zval property_sqlstate_default_value; ZVAL_UNDEF(&property_sqlstate_default_value); - zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, 1); + zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, true); zend_declare_typed_property(class_entry, property_sqlstate_name, &property_sqlstate_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_sqlstate_name); + zend_string_release_ex(property_sqlstate_name, true); zval property_errno_default_value; ZVAL_UNDEF(&property_errno_default_value); - zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, 1); + zend_string *property_errno_name = zend_string_init("errno", sizeof("errno") - 1, true); zend_declare_typed_property(class_entry, property_errno_name, &property_errno_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_errno_name); + zend_string_release_ex(property_errno_name, true); return class_entry; } @@ -1634,9 +1634,9 @@ static zend_class_entry *register_class_mysqli_sql_exception(zend_class_entry *c zval property_sqlstate_default_value; zend_string *property_sqlstate_default_value_str = zend_string_init("00000", strlen("00000"), 1); ZVAL_STR(&property_sqlstate_default_value, property_sqlstate_default_value_str); - zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, 1); + zend_string *property_sqlstate_name = zend_string_init("sqlstate", sizeof("sqlstate") - 1, true); zend_declare_typed_property(class_entry, property_sqlstate_name, &property_sqlstate_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_sqlstate_name); + zend_string_release_ex(property_sqlstate_name, true); return class_entry; } diff --git a/ext/pdo/pdo_arginfo.h b/ext/pdo/pdo_arginfo.h index d2df2f0b0eb23..8f452cf4b032c 100644 --- a/ext/pdo/pdo_arginfo.h +++ b/ext/pdo/pdo_arginfo.h @@ -24,9 +24,9 @@ static zend_class_entry *register_class_PDOException(zend_class_entry *class_ent zval property_errorInfo_default_value; ZVAL_NULL(&property_errorInfo_default_value); - zend_string *property_errorInfo_name = zend_string_init("errorInfo", sizeof("errorInfo") - 1, 1); + zend_string *property_errorInfo_name = zend_string_init("errorInfo", sizeof("errorInfo") - 1, true); zend_declare_typed_property(class_entry, property_errorInfo_name, &property_errorInfo_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property_errorInfo_name); + zend_string_release_ex(property_errorInfo_name, true); return class_entry; } diff --git a/ext/pdo/pdo_dbh_arginfo.h b/ext/pdo/pdo_dbh_arginfo.h index 71df4c519e1a7..cc622a52e2688 100644 --- a/ext/pdo/pdo_dbh_arginfo.h +++ b/ext/pdo/pdo_dbh_arginfo.h @@ -111,454 +111,454 @@ static zend_class_entry *register_class_PDO(void) zval const_PARAM_NULL_value; ZVAL_LONG(&const_PARAM_NULL_value, LONG_CONST(PDO_PARAM_NULL)); - zend_string *const_PARAM_NULL_name = zend_string_init_interned("PARAM_NULL", sizeof("PARAM_NULL") - 1, 1); + zend_string *const_PARAM_NULL_name = zend_string_init_interned("PARAM_NULL", sizeof("PARAM_NULL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_NULL_name, &const_PARAM_NULL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_NULL_name); + zend_string_release_ex(const_PARAM_NULL_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_NULL) == 0); zval const_PARAM_BOOL_value; ZVAL_LONG(&const_PARAM_BOOL_value, LONG_CONST(PDO_PARAM_BOOL)); - zend_string *const_PARAM_BOOL_name = zend_string_init_interned("PARAM_BOOL", sizeof("PARAM_BOOL") - 1, 1); + zend_string *const_PARAM_BOOL_name = zend_string_init_interned("PARAM_BOOL", sizeof("PARAM_BOOL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_BOOL_name, &const_PARAM_BOOL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_BOOL_name); + zend_string_release_ex(const_PARAM_BOOL_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_BOOL) == 5); zval const_PARAM_INT_value; ZVAL_LONG(&const_PARAM_INT_value, LONG_CONST(PDO_PARAM_INT)); - zend_string *const_PARAM_INT_name = zend_string_init_interned("PARAM_INT", sizeof("PARAM_INT") - 1, 1); + zend_string *const_PARAM_INT_name = zend_string_init_interned("PARAM_INT", sizeof("PARAM_INT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_INT_name, &const_PARAM_INT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_INT_name); + zend_string_release_ex(const_PARAM_INT_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_INT) == 1); zval const_PARAM_STR_value; ZVAL_LONG(&const_PARAM_STR_value, LONG_CONST(PDO_PARAM_STR)); - zend_string *const_PARAM_STR_name = zend_string_init_interned("PARAM_STR", sizeof("PARAM_STR") - 1, 1); + zend_string *const_PARAM_STR_name = zend_string_init_interned("PARAM_STR", sizeof("PARAM_STR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_STR_name, &const_PARAM_STR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_STR_name); + zend_string_release_ex(const_PARAM_STR_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_STR) == 2); zval const_PARAM_LOB_value; ZVAL_LONG(&const_PARAM_LOB_value, LONG_CONST(PDO_PARAM_LOB)); - zend_string *const_PARAM_LOB_name = zend_string_init_interned("PARAM_LOB", sizeof("PARAM_LOB") - 1, 1); + zend_string *const_PARAM_LOB_name = zend_string_init_interned("PARAM_LOB", sizeof("PARAM_LOB") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_LOB_name, &const_PARAM_LOB_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_LOB_name); + zend_string_release_ex(const_PARAM_LOB_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_LOB) == 3); zval const_PARAM_STMT_value; ZVAL_LONG(&const_PARAM_STMT_value, LONG_CONST(PDO_PARAM_STMT)); - zend_string *const_PARAM_STMT_name = zend_string_init_interned("PARAM_STMT", sizeof("PARAM_STMT") - 1, 1); + zend_string *const_PARAM_STMT_name = zend_string_init_interned("PARAM_STMT", sizeof("PARAM_STMT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_STMT_name, &const_PARAM_STMT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_STMT_name); + zend_string_release_ex(const_PARAM_STMT_name, true); ZEND_ASSERT(LONG_CONST(PDO_PARAM_STMT) == 4); zval const_PARAM_INPUT_OUTPUT_value; ZVAL_LONG(&const_PARAM_INPUT_OUTPUT_value, LONG_CONST(PDO_PARAM_INPUT_OUTPUT)); - zend_string *const_PARAM_INPUT_OUTPUT_name = zend_string_init_interned("PARAM_INPUT_OUTPUT", sizeof("PARAM_INPUT_OUTPUT") - 1, 1); + zend_string *const_PARAM_INPUT_OUTPUT_name = zend_string_init_interned("PARAM_INPUT_OUTPUT", sizeof("PARAM_INPUT_OUTPUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_INPUT_OUTPUT_name, &const_PARAM_INPUT_OUTPUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_INPUT_OUTPUT_name); + zend_string_release_ex(const_PARAM_INPUT_OUTPUT_name, true); zval const_PARAM_STR_NATL_value; ZVAL_LONG(&const_PARAM_STR_NATL_value, LONG_CONST(PDO_PARAM_STR_NATL)); - zend_string *const_PARAM_STR_NATL_name = zend_string_init_interned("PARAM_STR_NATL", sizeof("PARAM_STR_NATL") - 1, 1); + zend_string *const_PARAM_STR_NATL_name = zend_string_init_interned("PARAM_STR_NATL", sizeof("PARAM_STR_NATL") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_STR_NATL_name, &const_PARAM_STR_NATL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_STR_NATL_name); + zend_string_release_ex(const_PARAM_STR_NATL_name, true); zval const_PARAM_STR_CHAR_value; ZVAL_LONG(&const_PARAM_STR_CHAR_value, LONG_CONST(PDO_PARAM_STR_CHAR)); - zend_string *const_PARAM_STR_CHAR_name = zend_string_init_interned("PARAM_STR_CHAR", sizeof("PARAM_STR_CHAR") - 1, 1); + zend_string *const_PARAM_STR_CHAR_name = zend_string_init_interned("PARAM_STR_CHAR", sizeof("PARAM_STR_CHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_STR_CHAR_name, &const_PARAM_STR_CHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_STR_CHAR_name); + zend_string_release_ex(const_PARAM_STR_CHAR_name, true); zval const_PARAM_EVT_ALLOC_value; ZVAL_LONG(&const_PARAM_EVT_ALLOC_value, LONG_CONST(PDO_PARAM_EVT_ALLOC)); - zend_string *const_PARAM_EVT_ALLOC_name = zend_string_init_interned("PARAM_EVT_ALLOC", sizeof("PARAM_EVT_ALLOC") - 1, 1); + zend_string *const_PARAM_EVT_ALLOC_name = zend_string_init_interned("PARAM_EVT_ALLOC", sizeof("PARAM_EVT_ALLOC") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_ALLOC_name, &const_PARAM_EVT_ALLOC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_ALLOC_name); + zend_string_release_ex(const_PARAM_EVT_ALLOC_name, true); zval const_PARAM_EVT_FREE_value; ZVAL_LONG(&const_PARAM_EVT_FREE_value, LONG_CONST(PDO_PARAM_EVT_FREE)); - zend_string *const_PARAM_EVT_FREE_name = zend_string_init_interned("PARAM_EVT_FREE", sizeof("PARAM_EVT_FREE") - 1, 1); + zend_string *const_PARAM_EVT_FREE_name = zend_string_init_interned("PARAM_EVT_FREE", sizeof("PARAM_EVT_FREE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_FREE_name, &const_PARAM_EVT_FREE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_FREE_name); + zend_string_release_ex(const_PARAM_EVT_FREE_name, true); zval const_PARAM_EVT_EXEC_PRE_value; ZVAL_LONG(&const_PARAM_EVT_EXEC_PRE_value, LONG_CONST(PDO_PARAM_EVT_EXEC_PRE)); - zend_string *const_PARAM_EVT_EXEC_PRE_name = zend_string_init_interned("PARAM_EVT_EXEC_PRE", sizeof("PARAM_EVT_EXEC_PRE") - 1, 1); + zend_string *const_PARAM_EVT_EXEC_PRE_name = zend_string_init_interned("PARAM_EVT_EXEC_PRE", sizeof("PARAM_EVT_EXEC_PRE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_EXEC_PRE_name, &const_PARAM_EVT_EXEC_PRE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_EXEC_PRE_name); + zend_string_release_ex(const_PARAM_EVT_EXEC_PRE_name, true); zval const_PARAM_EVT_EXEC_POST_value; ZVAL_LONG(&const_PARAM_EVT_EXEC_POST_value, LONG_CONST(PDO_PARAM_EVT_EXEC_POST)); - zend_string *const_PARAM_EVT_EXEC_POST_name = zend_string_init_interned("PARAM_EVT_EXEC_POST", sizeof("PARAM_EVT_EXEC_POST") - 1, 1); + zend_string *const_PARAM_EVT_EXEC_POST_name = zend_string_init_interned("PARAM_EVT_EXEC_POST", sizeof("PARAM_EVT_EXEC_POST") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_EXEC_POST_name, &const_PARAM_EVT_EXEC_POST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_EXEC_POST_name); + zend_string_release_ex(const_PARAM_EVT_EXEC_POST_name, true); zval const_PARAM_EVT_FETCH_PRE_value; ZVAL_LONG(&const_PARAM_EVT_FETCH_PRE_value, LONG_CONST(PDO_PARAM_EVT_FETCH_PRE)); - zend_string *const_PARAM_EVT_FETCH_PRE_name = zend_string_init_interned("PARAM_EVT_FETCH_PRE", sizeof("PARAM_EVT_FETCH_PRE") - 1, 1); + zend_string *const_PARAM_EVT_FETCH_PRE_name = zend_string_init_interned("PARAM_EVT_FETCH_PRE", sizeof("PARAM_EVT_FETCH_PRE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_FETCH_PRE_name, &const_PARAM_EVT_FETCH_PRE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_FETCH_PRE_name); + zend_string_release_ex(const_PARAM_EVT_FETCH_PRE_name, true); zval const_PARAM_EVT_FETCH_POST_value; ZVAL_LONG(&const_PARAM_EVT_FETCH_POST_value, LONG_CONST(PDO_PARAM_EVT_FETCH_POST)); - zend_string *const_PARAM_EVT_FETCH_POST_name = zend_string_init_interned("PARAM_EVT_FETCH_POST", sizeof("PARAM_EVT_FETCH_POST") - 1, 1); + zend_string *const_PARAM_EVT_FETCH_POST_name = zend_string_init_interned("PARAM_EVT_FETCH_POST", sizeof("PARAM_EVT_FETCH_POST") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_FETCH_POST_name, &const_PARAM_EVT_FETCH_POST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_FETCH_POST_name); + zend_string_release_ex(const_PARAM_EVT_FETCH_POST_name, true); zval const_PARAM_EVT_NORMALIZE_value; ZVAL_LONG(&const_PARAM_EVT_NORMALIZE_value, LONG_CONST(PDO_PARAM_EVT_NORMALIZE)); - zend_string *const_PARAM_EVT_NORMALIZE_name = zend_string_init_interned("PARAM_EVT_NORMALIZE", sizeof("PARAM_EVT_NORMALIZE") - 1, 1); + zend_string *const_PARAM_EVT_NORMALIZE_name = zend_string_init_interned("PARAM_EVT_NORMALIZE", sizeof("PARAM_EVT_NORMALIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_PARAM_EVT_NORMALIZE_name, &const_PARAM_EVT_NORMALIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PARAM_EVT_NORMALIZE_name); + zend_string_release_ex(const_PARAM_EVT_NORMALIZE_name, true); zval const_FETCH_DEFAULT_value; ZVAL_LONG(&const_FETCH_DEFAULT_value, LONG_CONST(PDO_FETCH_USE_DEFAULT)); - zend_string *const_FETCH_DEFAULT_name = zend_string_init_interned("FETCH_DEFAULT", sizeof("FETCH_DEFAULT") - 1, 1); + zend_string *const_FETCH_DEFAULT_name = zend_string_init_interned("FETCH_DEFAULT", sizeof("FETCH_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_DEFAULT_name, &const_FETCH_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_DEFAULT_name); + zend_string_release_ex(const_FETCH_DEFAULT_name, true); zval const_FETCH_LAZY_value; ZVAL_LONG(&const_FETCH_LAZY_value, LONG_CONST(PDO_FETCH_LAZY)); - zend_string *const_FETCH_LAZY_name = zend_string_init_interned("FETCH_LAZY", sizeof("FETCH_LAZY") - 1, 1); + zend_string *const_FETCH_LAZY_name = zend_string_init_interned("FETCH_LAZY", sizeof("FETCH_LAZY") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_LAZY_name, &const_FETCH_LAZY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_LAZY_name); + zend_string_release_ex(const_FETCH_LAZY_name, true); zval const_FETCH_ASSOC_value; ZVAL_LONG(&const_FETCH_ASSOC_value, LONG_CONST(PDO_FETCH_ASSOC)); - zend_string *const_FETCH_ASSOC_name = zend_string_init_interned("FETCH_ASSOC", sizeof("FETCH_ASSOC") - 1, 1); + zend_string *const_FETCH_ASSOC_name = zend_string_init_interned("FETCH_ASSOC", sizeof("FETCH_ASSOC") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ASSOC_name, &const_FETCH_ASSOC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ASSOC_name); + zend_string_release_ex(const_FETCH_ASSOC_name, true); zval const_FETCH_NUM_value; ZVAL_LONG(&const_FETCH_NUM_value, LONG_CONST(PDO_FETCH_NUM)); - zend_string *const_FETCH_NUM_name = zend_string_init_interned("FETCH_NUM", sizeof("FETCH_NUM") - 1, 1); + zend_string *const_FETCH_NUM_name = zend_string_init_interned("FETCH_NUM", sizeof("FETCH_NUM") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_NUM_name, &const_FETCH_NUM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_NUM_name); + zend_string_release_ex(const_FETCH_NUM_name, true); zval const_FETCH_BOTH_value; ZVAL_LONG(&const_FETCH_BOTH_value, LONG_CONST(PDO_FETCH_BOTH)); - zend_string *const_FETCH_BOTH_name = zend_string_init_interned("FETCH_BOTH", sizeof("FETCH_BOTH") - 1, 1); + zend_string *const_FETCH_BOTH_name = zend_string_init_interned("FETCH_BOTH", sizeof("FETCH_BOTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_BOTH_name, &const_FETCH_BOTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_BOTH_name); + zend_string_release_ex(const_FETCH_BOTH_name, true); zval const_FETCH_OBJ_value; ZVAL_LONG(&const_FETCH_OBJ_value, LONG_CONST(PDO_FETCH_OBJ)); - zend_string *const_FETCH_OBJ_name = zend_string_init_interned("FETCH_OBJ", sizeof("FETCH_OBJ") - 1, 1); + zend_string *const_FETCH_OBJ_name = zend_string_init_interned("FETCH_OBJ", sizeof("FETCH_OBJ") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_OBJ_name, &const_FETCH_OBJ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_OBJ_name); + zend_string_release_ex(const_FETCH_OBJ_name, true); zval const_FETCH_BOUND_value; ZVAL_LONG(&const_FETCH_BOUND_value, LONG_CONST(PDO_FETCH_BOUND)); - zend_string *const_FETCH_BOUND_name = zend_string_init_interned("FETCH_BOUND", sizeof("FETCH_BOUND") - 1, 1); + zend_string *const_FETCH_BOUND_name = zend_string_init_interned("FETCH_BOUND", sizeof("FETCH_BOUND") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_BOUND_name, &const_FETCH_BOUND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_BOUND_name); + zend_string_release_ex(const_FETCH_BOUND_name, true); zval const_FETCH_COLUMN_value; ZVAL_LONG(&const_FETCH_COLUMN_value, LONG_CONST(PDO_FETCH_COLUMN)); - zend_string *const_FETCH_COLUMN_name = zend_string_init_interned("FETCH_COLUMN", sizeof("FETCH_COLUMN") - 1, 1); + zend_string *const_FETCH_COLUMN_name = zend_string_init_interned("FETCH_COLUMN", sizeof("FETCH_COLUMN") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_COLUMN_name, &const_FETCH_COLUMN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_COLUMN_name); + zend_string_release_ex(const_FETCH_COLUMN_name, true); zval const_FETCH_CLASS_value; ZVAL_LONG(&const_FETCH_CLASS_value, LONG_CONST(PDO_FETCH_CLASS)); - zend_string *const_FETCH_CLASS_name = zend_string_init_interned("FETCH_CLASS", sizeof("FETCH_CLASS") - 1, 1); + zend_string *const_FETCH_CLASS_name = zend_string_init_interned("FETCH_CLASS", sizeof("FETCH_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_CLASS_name, &const_FETCH_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_CLASS_name); + zend_string_release_ex(const_FETCH_CLASS_name, true); zval const_FETCH_INTO_value; ZVAL_LONG(&const_FETCH_INTO_value, LONG_CONST(PDO_FETCH_INTO)); - zend_string *const_FETCH_INTO_name = zend_string_init_interned("FETCH_INTO", sizeof("FETCH_INTO") - 1, 1); + zend_string *const_FETCH_INTO_name = zend_string_init_interned("FETCH_INTO", sizeof("FETCH_INTO") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_INTO_name, &const_FETCH_INTO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_INTO_name); + zend_string_release_ex(const_FETCH_INTO_name, true); zval const_FETCH_FUNC_value; ZVAL_LONG(&const_FETCH_FUNC_value, LONG_CONST(PDO_FETCH_FUNC)); - zend_string *const_FETCH_FUNC_name = zend_string_init_interned("FETCH_FUNC", sizeof("FETCH_FUNC") - 1, 1); + zend_string *const_FETCH_FUNC_name = zend_string_init_interned("FETCH_FUNC", sizeof("FETCH_FUNC") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_FUNC_name, &const_FETCH_FUNC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_FUNC_name); + zend_string_release_ex(const_FETCH_FUNC_name, true); zval const_FETCH_GROUP_value; ZVAL_LONG(&const_FETCH_GROUP_value, LONG_CONST(PDO_FETCH_GROUP)); - zend_string *const_FETCH_GROUP_name = zend_string_init_interned("FETCH_GROUP", sizeof("FETCH_GROUP") - 1, 1); + zend_string *const_FETCH_GROUP_name = zend_string_init_interned("FETCH_GROUP", sizeof("FETCH_GROUP") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_GROUP_name, &const_FETCH_GROUP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_GROUP_name); + zend_string_release_ex(const_FETCH_GROUP_name, true); zval const_FETCH_UNIQUE_value; ZVAL_LONG(&const_FETCH_UNIQUE_value, LONG_CONST(PDO_FETCH_UNIQUE)); - zend_string *const_FETCH_UNIQUE_name = zend_string_init_interned("FETCH_UNIQUE", sizeof("FETCH_UNIQUE") - 1, 1); + zend_string *const_FETCH_UNIQUE_name = zend_string_init_interned("FETCH_UNIQUE", sizeof("FETCH_UNIQUE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_UNIQUE_name, &const_FETCH_UNIQUE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_UNIQUE_name); + zend_string_release_ex(const_FETCH_UNIQUE_name, true); zval const_FETCH_KEY_PAIR_value; ZVAL_LONG(&const_FETCH_KEY_PAIR_value, LONG_CONST(PDO_FETCH_KEY_PAIR)); - zend_string *const_FETCH_KEY_PAIR_name = zend_string_init_interned("FETCH_KEY_PAIR", sizeof("FETCH_KEY_PAIR") - 1, 1); + zend_string *const_FETCH_KEY_PAIR_name = zend_string_init_interned("FETCH_KEY_PAIR", sizeof("FETCH_KEY_PAIR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_KEY_PAIR_name, &const_FETCH_KEY_PAIR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_KEY_PAIR_name); + zend_string_release_ex(const_FETCH_KEY_PAIR_name, true); zval const_FETCH_CLASSTYPE_value; ZVAL_LONG(&const_FETCH_CLASSTYPE_value, LONG_CONST(PDO_FETCH_CLASSTYPE)); - zend_string *const_FETCH_CLASSTYPE_name = zend_string_init_interned("FETCH_CLASSTYPE", sizeof("FETCH_CLASSTYPE") - 1, 1); + zend_string *const_FETCH_CLASSTYPE_name = zend_string_init_interned("FETCH_CLASSTYPE", sizeof("FETCH_CLASSTYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_CLASSTYPE_name, &const_FETCH_CLASSTYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_CLASSTYPE_name); + zend_string_release_ex(const_FETCH_CLASSTYPE_name, true); zval const_FETCH_SERIALIZE_value; ZVAL_LONG(&const_FETCH_SERIALIZE_value, LONG_CONST(PDO_FETCH_SERIALIZE)); - zend_string *const_FETCH_SERIALIZE_name = zend_string_init_interned("FETCH_SERIALIZE", sizeof("FETCH_SERIALIZE") - 1, 1); + zend_string *const_FETCH_SERIALIZE_name = zend_string_init_interned("FETCH_SERIALIZE", sizeof("FETCH_SERIALIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_SERIALIZE_name, &const_FETCH_SERIALIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_SERIALIZE_name); + zend_string_release_ex(const_FETCH_SERIALIZE_name, true); zval const_FETCH_PROPS_LATE_value; ZVAL_LONG(&const_FETCH_PROPS_LATE_value, LONG_CONST(PDO_FETCH_PROPS_LATE)); - zend_string *const_FETCH_PROPS_LATE_name = zend_string_init_interned("FETCH_PROPS_LATE", sizeof("FETCH_PROPS_LATE") - 1, 1); + zend_string *const_FETCH_PROPS_LATE_name = zend_string_init_interned("FETCH_PROPS_LATE", sizeof("FETCH_PROPS_LATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_PROPS_LATE_name, &const_FETCH_PROPS_LATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_PROPS_LATE_name); + zend_string_release_ex(const_FETCH_PROPS_LATE_name, true); zval const_FETCH_NAMED_value; ZVAL_LONG(&const_FETCH_NAMED_value, LONG_CONST(PDO_FETCH_NAMED)); - zend_string *const_FETCH_NAMED_name = zend_string_init_interned("FETCH_NAMED", sizeof("FETCH_NAMED") - 1, 1); + zend_string *const_FETCH_NAMED_name = zend_string_init_interned("FETCH_NAMED", sizeof("FETCH_NAMED") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_NAMED_name, &const_FETCH_NAMED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_NAMED_name); + zend_string_release_ex(const_FETCH_NAMED_name, true); zval const_ATTR_AUTOCOMMIT_value; ZVAL_LONG(&const_ATTR_AUTOCOMMIT_value, LONG_CONST(PDO_ATTR_AUTOCOMMIT)); - zend_string *const_ATTR_AUTOCOMMIT_name = zend_string_init_interned("ATTR_AUTOCOMMIT", sizeof("ATTR_AUTOCOMMIT") - 1, 1); + zend_string *const_ATTR_AUTOCOMMIT_name = zend_string_init_interned("ATTR_AUTOCOMMIT", sizeof("ATTR_AUTOCOMMIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_AUTOCOMMIT_name, &const_ATTR_AUTOCOMMIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_AUTOCOMMIT_name); + zend_string_release_ex(const_ATTR_AUTOCOMMIT_name, true); zval const_ATTR_PREFETCH_value; ZVAL_LONG(&const_ATTR_PREFETCH_value, LONG_CONST(PDO_ATTR_PREFETCH)); - zend_string *const_ATTR_PREFETCH_name = zend_string_init_interned("ATTR_PREFETCH", sizeof("ATTR_PREFETCH") - 1, 1); + zend_string *const_ATTR_PREFETCH_name = zend_string_init_interned("ATTR_PREFETCH", sizeof("ATTR_PREFETCH") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_PREFETCH_name, &const_ATTR_PREFETCH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_PREFETCH_name); + zend_string_release_ex(const_ATTR_PREFETCH_name, true); zval const_ATTR_TIMEOUT_value; ZVAL_LONG(&const_ATTR_TIMEOUT_value, LONG_CONST(PDO_ATTR_TIMEOUT)); - zend_string *const_ATTR_TIMEOUT_name = zend_string_init_interned("ATTR_TIMEOUT", sizeof("ATTR_TIMEOUT") - 1, 1); + zend_string *const_ATTR_TIMEOUT_name = zend_string_init_interned("ATTR_TIMEOUT", sizeof("ATTR_TIMEOUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_TIMEOUT_name, &const_ATTR_TIMEOUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_TIMEOUT_name); + zend_string_release_ex(const_ATTR_TIMEOUT_name, true); zval const_ATTR_ERRMODE_value; ZVAL_LONG(&const_ATTR_ERRMODE_value, LONG_CONST(PDO_ATTR_ERRMODE)); - zend_string *const_ATTR_ERRMODE_name = zend_string_init_interned("ATTR_ERRMODE", sizeof("ATTR_ERRMODE") - 1, 1); + zend_string *const_ATTR_ERRMODE_name = zend_string_init_interned("ATTR_ERRMODE", sizeof("ATTR_ERRMODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_ERRMODE_name, &const_ATTR_ERRMODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_ERRMODE_name); + zend_string_release_ex(const_ATTR_ERRMODE_name, true); zval const_ATTR_SERVER_VERSION_value; ZVAL_LONG(&const_ATTR_SERVER_VERSION_value, LONG_CONST(PDO_ATTR_SERVER_VERSION)); - zend_string *const_ATTR_SERVER_VERSION_name = zend_string_init_interned("ATTR_SERVER_VERSION", sizeof("ATTR_SERVER_VERSION") - 1, 1); + zend_string *const_ATTR_SERVER_VERSION_name = zend_string_init_interned("ATTR_SERVER_VERSION", sizeof("ATTR_SERVER_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SERVER_VERSION_name, &const_ATTR_SERVER_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SERVER_VERSION_name); + zend_string_release_ex(const_ATTR_SERVER_VERSION_name, true); zval const_ATTR_CLIENT_VERSION_value; ZVAL_LONG(&const_ATTR_CLIENT_VERSION_value, LONG_CONST(PDO_ATTR_CLIENT_VERSION)); - zend_string *const_ATTR_CLIENT_VERSION_name = zend_string_init_interned("ATTR_CLIENT_VERSION", sizeof("ATTR_CLIENT_VERSION") - 1, 1); + zend_string *const_ATTR_CLIENT_VERSION_name = zend_string_init_interned("ATTR_CLIENT_VERSION", sizeof("ATTR_CLIENT_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CLIENT_VERSION_name, &const_ATTR_CLIENT_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CLIENT_VERSION_name); + zend_string_release_ex(const_ATTR_CLIENT_VERSION_name, true); zval const_ATTR_SERVER_INFO_value; ZVAL_LONG(&const_ATTR_SERVER_INFO_value, LONG_CONST(PDO_ATTR_SERVER_INFO)); - zend_string *const_ATTR_SERVER_INFO_name = zend_string_init_interned("ATTR_SERVER_INFO", sizeof("ATTR_SERVER_INFO") - 1, 1); + zend_string *const_ATTR_SERVER_INFO_name = zend_string_init_interned("ATTR_SERVER_INFO", sizeof("ATTR_SERVER_INFO") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SERVER_INFO_name, &const_ATTR_SERVER_INFO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SERVER_INFO_name); + zend_string_release_ex(const_ATTR_SERVER_INFO_name, true); zval const_ATTR_CONNECTION_STATUS_value; ZVAL_LONG(&const_ATTR_CONNECTION_STATUS_value, LONG_CONST(PDO_ATTR_CONNECTION_STATUS)); - zend_string *const_ATTR_CONNECTION_STATUS_name = zend_string_init_interned("ATTR_CONNECTION_STATUS", sizeof("ATTR_CONNECTION_STATUS") - 1, 1); + zend_string *const_ATTR_CONNECTION_STATUS_name = zend_string_init_interned("ATTR_CONNECTION_STATUS", sizeof("ATTR_CONNECTION_STATUS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CONNECTION_STATUS_name, &const_ATTR_CONNECTION_STATUS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CONNECTION_STATUS_name); + zend_string_release_ex(const_ATTR_CONNECTION_STATUS_name, true); zval const_ATTR_CASE_value; ZVAL_LONG(&const_ATTR_CASE_value, LONG_CONST(PDO_ATTR_CASE)); - zend_string *const_ATTR_CASE_name = zend_string_init_interned("ATTR_CASE", sizeof("ATTR_CASE") - 1, 1); + zend_string *const_ATTR_CASE_name = zend_string_init_interned("ATTR_CASE", sizeof("ATTR_CASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CASE_name, &const_ATTR_CASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CASE_name); + zend_string_release_ex(const_ATTR_CASE_name, true); zval const_ATTR_CURSOR_NAME_value; ZVAL_LONG(&const_ATTR_CURSOR_NAME_value, LONG_CONST(PDO_ATTR_CURSOR_NAME)); - zend_string *const_ATTR_CURSOR_NAME_name = zend_string_init_interned("ATTR_CURSOR_NAME", sizeof("ATTR_CURSOR_NAME") - 1, 1); + zend_string *const_ATTR_CURSOR_NAME_name = zend_string_init_interned("ATTR_CURSOR_NAME", sizeof("ATTR_CURSOR_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CURSOR_NAME_name, &const_ATTR_CURSOR_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CURSOR_NAME_name); + zend_string_release_ex(const_ATTR_CURSOR_NAME_name, true); zval const_ATTR_CURSOR_value; ZVAL_LONG(&const_ATTR_CURSOR_value, LONG_CONST(PDO_ATTR_CURSOR)); - zend_string *const_ATTR_CURSOR_name = zend_string_init_interned("ATTR_CURSOR", sizeof("ATTR_CURSOR") - 1, 1); + zend_string *const_ATTR_CURSOR_name = zend_string_init_interned("ATTR_CURSOR", sizeof("ATTR_CURSOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CURSOR_name, &const_ATTR_CURSOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CURSOR_name); + zend_string_release_ex(const_ATTR_CURSOR_name, true); zval const_ATTR_ORACLE_NULLS_value; ZVAL_LONG(&const_ATTR_ORACLE_NULLS_value, LONG_CONST(PDO_ATTR_ORACLE_NULLS)); - zend_string *const_ATTR_ORACLE_NULLS_name = zend_string_init_interned("ATTR_ORACLE_NULLS", sizeof("ATTR_ORACLE_NULLS") - 1, 1); + zend_string *const_ATTR_ORACLE_NULLS_name = zend_string_init_interned("ATTR_ORACLE_NULLS", sizeof("ATTR_ORACLE_NULLS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_ORACLE_NULLS_name, &const_ATTR_ORACLE_NULLS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_ORACLE_NULLS_name); + zend_string_release_ex(const_ATTR_ORACLE_NULLS_name, true); zval const_ATTR_PERSISTENT_value; ZVAL_LONG(&const_ATTR_PERSISTENT_value, LONG_CONST(PDO_ATTR_PERSISTENT)); - zend_string *const_ATTR_PERSISTENT_name = zend_string_init_interned("ATTR_PERSISTENT", sizeof("ATTR_PERSISTENT") - 1, 1); + zend_string *const_ATTR_PERSISTENT_name = zend_string_init_interned("ATTR_PERSISTENT", sizeof("ATTR_PERSISTENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_PERSISTENT_name, &const_ATTR_PERSISTENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_PERSISTENT_name); + zend_string_release_ex(const_ATTR_PERSISTENT_name, true); zval const_ATTR_STATEMENT_CLASS_value; ZVAL_LONG(&const_ATTR_STATEMENT_CLASS_value, LONG_CONST(PDO_ATTR_STATEMENT_CLASS)); - zend_string *const_ATTR_STATEMENT_CLASS_name = zend_string_init_interned("ATTR_STATEMENT_CLASS", sizeof("ATTR_STATEMENT_CLASS") - 1, 1); + zend_string *const_ATTR_STATEMENT_CLASS_name = zend_string_init_interned("ATTR_STATEMENT_CLASS", sizeof("ATTR_STATEMENT_CLASS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_STATEMENT_CLASS_name, &const_ATTR_STATEMENT_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_STATEMENT_CLASS_name); + zend_string_release_ex(const_ATTR_STATEMENT_CLASS_name, true); zval const_ATTR_FETCH_TABLE_NAMES_value; ZVAL_LONG(&const_ATTR_FETCH_TABLE_NAMES_value, LONG_CONST(PDO_ATTR_FETCH_TABLE_NAMES)); - zend_string *const_ATTR_FETCH_TABLE_NAMES_name = zend_string_init_interned("ATTR_FETCH_TABLE_NAMES", sizeof("ATTR_FETCH_TABLE_NAMES") - 1, 1); + zend_string *const_ATTR_FETCH_TABLE_NAMES_name = zend_string_init_interned("ATTR_FETCH_TABLE_NAMES", sizeof("ATTR_FETCH_TABLE_NAMES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_FETCH_TABLE_NAMES_name, &const_ATTR_FETCH_TABLE_NAMES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_FETCH_TABLE_NAMES_name); + zend_string_release_ex(const_ATTR_FETCH_TABLE_NAMES_name, true); zval const_ATTR_FETCH_CATALOG_NAMES_value; ZVAL_LONG(&const_ATTR_FETCH_CATALOG_NAMES_value, LONG_CONST(PDO_ATTR_FETCH_CATALOG_NAMES)); - zend_string *const_ATTR_FETCH_CATALOG_NAMES_name = zend_string_init_interned("ATTR_FETCH_CATALOG_NAMES", sizeof("ATTR_FETCH_CATALOG_NAMES") - 1, 1); + zend_string *const_ATTR_FETCH_CATALOG_NAMES_name = zend_string_init_interned("ATTR_FETCH_CATALOG_NAMES", sizeof("ATTR_FETCH_CATALOG_NAMES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_FETCH_CATALOG_NAMES_name, &const_ATTR_FETCH_CATALOG_NAMES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_FETCH_CATALOG_NAMES_name); + zend_string_release_ex(const_ATTR_FETCH_CATALOG_NAMES_name, true); zval const_ATTR_DRIVER_NAME_value; ZVAL_LONG(&const_ATTR_DRIVER_NAME_value, LONG_CONST(PDO_ATTR_DRIVER_NAME)); - zend_string *const_ATTR_DRIVER_NAME_name = zend_string_init_interned("ATTR_DRIVER_NAME", sizeof("ATTR_DRIVER_NAME") - 1, 1); + zend_string *const_ATTR_DRIVER_NAME_name = zend_string_init_interned("ATTR_DRIVER_NAME", sizeof("ATTR_DRIVER_NAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DRIVER_NAME_name, &const_ATTR_DRIVER_NAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DRIVER_NAME_name); + zend_string_release_ex(const_ATTR_DRIVER_NAME_name, true); zval const_ATTR_STRINGIFY_FETCHES_value; ZVAL_LONG(&const_ATTR_STRINGIFY_FETCHES_value, LONG_CONST(PDO_ATTR_STRINGIFY_FETCHES)); - zend_string *const_ATTR_STRINGIFY_FETCHES_name = zend_string_init_interned("ATTR_STRINGIFY_FETCHES", sizeof("ATTR_STRINGIFY_FETCHES") - 1, 1); + zend_string *const_ATTR_STRINGIFY_FETCHES_name = zend_string_init_interned("ATTR_STRINGIFY_FETCHES", sizeof("ATTR_STRINGIFY_FETCHES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_STRINGIFY_FETCHES_name, &const_ATTR_STRINGIFY_FETCHES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_STRINGIFY_FETCHES_name); + zend_string_release_ex(const_ATTR_STRINGIFY_FETCHES_name, true); zval const_ATTR_MAX_COLUMN_LEN_value; ZVAL_LONG(&const_ATTR_MAX_COLUMN_LEN_value, LONG_CONST(PDO_ATTR_MAX_COLUMN_LEN)); - zend_string *const_ATTR_MAX_COLUMN_LEN_name = zend_string_init_interned("ATTR_MAX_COLUMN_LEN", sizeof("ATTR_MAX_COLUMN_LEN") - 1, 1); + zend_string *const_ATTR_MAX_COLUMN_LEN_name = zend_string_init_interned("ATTR_MAX_COLUMN_LEN", sizeof("ATTR_MAX_COLUMN_LEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_MAX_COLUMN_LEN_name, &const_ATTR_MAX_COLUMN_LEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_MAX_COLUMN_LEN_name); + zend_string_release_ex(const_ATTR_MAX_COLUMN_LEN_name, true); zval const_ATTR_EMULATE_PREPARES_value; ZVAL_LONG(&const_ATTR_EMULATE_PREPARES_value, LONG_CONST(PDO_ATTR_EMULATE_PREPARES)); - zend_string *const_ATTR_EMULATE_PREPARES_name = zend_string_init_interned("ATTR_EMULATE_PREPARES", sizeof("ATTR_EMULATE_PREPARES") - 1, 1); + zend_string *const_ATTR_EMULATE_PREPARES_name = zend_string_init_interned("ATTR_EMULATE_PREPARES", sizeof("ATTR_EMULATE_PREPARES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_EMULATE_PREPARES_name, &const_ATTR_EMULATE_PREPARES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_EMULATE_PREPARES_name); + zend_string_release_ex(const_ATTR_EMULATE_PREPARES_name, true); zval const_ATTR_DEFAULT_FETCH_MODE_value; ZVAL_LONG(&const_ATTR_DEFAULT_FETCH_MODE_value, LONG_CONST(PDO_ATTR_DEFAULT_FETCH_MODE)); - zend_string *const_ATTR_DEFAULT_FETCH_MODE_name = zend_string_init_interned("ATTR_DEFAULT_FETCH_MODE", sizeof("ATTR_DEFAULT_FETCH_MODE") - 1, 1); + zend_string *const_ATTR_DEFAULT_FETCH_MODE_name = zend_string_init_interned("ATTR_DEFAULT_FETCH_MODE", sizeof("ATTR_DEFAULT_FETCH_MODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DEFAULT_FETCH_MODE_name, &const_ATTR_DEFAULT_FETCH_MODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DEFAULT_FETCH_MODE_name); + zend_string_release_ex(const_ATTR_DEFAULT_FETCH_MODE_name, true); zval const_ATTR_DEFAULT_STR_PARAM_value; ZVAL_LONG(&const_ATTR_DEFAULT_STR_PARAM_value, LONG_CONST(PDO_ATTR_DEFAULT_STR_PARAM)); - zend_string *const_ATTR_DEFAULT_STR_PARAM_name = zend_string_init_interned("ATTR_DEFAULT_STR_PARAM", sizeof("ATTR_DEFAULT_STR_PARAM") - 1, 1); + zend_string *const_ATTR_DEFAULT_STR_PARAM_name = zend_string_init_interned("ATTR_DEFAULT_STR_PARAM", sizeof("ATTR_DEFAULT_STR_PARAM") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DEFAULT_STR_PARAM_name, &const_ATTR_DEFAULT_STR_PARAM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DEFAULT_STR_PARAM_name); + zend_string_release_ex(const_ATTR_DEFAULT_STR_PARAM_name, true); zval const_ERRMODE_SILENT_value; ZVAL_LONG(&const_ERRMODE_SILENT_value, LONG_CONST(PDO_ERRMODE_SILENT)); - zend_string *const_ERRMODE_SILENT_name = zend_string_init_interned("ERRMODE_SILENT", sizeof("ERRMODE_SILENT") - 1, 1); + zend_string *const_ERRMODE_SILENT_name = zend_string_init_interned("ERRMODE_SILENT", sizeof("ERRMODE_SILENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRMODE_SILENT_name, &const_ERRMODE_SILENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRMODE_SILENT_name); + zend_string_release_ex(const_ERRMODE_SILENT_name, true); zval const_ERRMODE_WARNING_value; ZVAL_LONG(&const_ERRMODE_WARNING_value, LONG_CONST(PDO_ERRMODE_WARNING)); - zend_string *const_ERRMODE_WARNING_name = zend_string_init_interned("ERRMODE_WARNING", sizeof("ERRMODE_WARNING") - 1, 1); + zend_string *const_ERRMODE_WARNING_name = zend_string_init_interned("ERRMODE_WARNING", sizeof("ERRMODE_WARNING") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRMODE_WARNING_name, &const_ERRMODE_WARNING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRMODE_WARNING_name); + zend_string_release_ex(const_ERRMODE_WARNING_name, true); zval const_ERRMODE_EXCEPTION_value; ZVAL_LONG(&const_ERRMODE_EXCEPTION_value, LONG_CONST(PDO_ERRMODE_EXCEPTION)); - zend_string *const_ERRMODE_EXCEPTION_name = zend_string_init_interned("ERRMODE_EXCEPTION", sizeof("ERRMODE_EXCEPTION") - 1, 1); + zend_string *const_ERRMODE_EXCEPTION_name = zend_string_init_interned("ERRMODE_EXCEPTION", sizeof("ERRMODE_EXCEPTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRMODE_EXCEPTION_name, &const_ERRMODE_EXCEPTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRMODE_EXCEPTION_name); + zend_string_release_ex(const_ERRMODE_EXCEPTION_name, true); zval const_CASE_NATURAL_value; ZVAL_LONG(&const_CASE_NATURAL_value, LONG_CONST(PDO_CASE_NATURAL)); - zend_string *const_CASE_NATURAL_name = zend_string_init_interned("CASE_NATURAL", sizeof("CASE_NATURAL") - 1, 1); + zend_string *const_CASE_NATURAL_name = zend_string_init_interned("CASE_NATURAL", sizeof("CASE_NATURAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_NATURAL_name, &const_CASE_NATURAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_NATURAL_name); + zend_string_release_ex(const_CASE_NATURAL_name, true); zval const_CASE_LOWER_value; ZVAL_LONG(&const_CASE_LOWER_value, LONG_CONST(PDO_CASE_LOWER)); - zend_string *const_CASE_LOWER_name = zend_string_init_interned("CASE_LOWER", sizeof("CASE_LOWER") - 1, 1); + zend_string *const_CASE_LOWER_name = zend_string_init_interned("CASE_LOWER", sizeof("CASE_LOWER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_LOWER_name, &const_CASE_LOWER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_LOWER_name); + zend_string_release_ex(const_CASE_LOWER_name, true); zval const_CASE_UPPER_value; ZVAL_LONG(&const_CASE_UPPER_value, LONG_CONST(PDO_CASE_UPPER)); - zend_string *const_CASE_UPPER_name = zend_string_init_interned("CASE_UPPER", sizeof("CASE_UPPER") - 1, 1); + zend_string *const_CASE_UPPER_name = zend_string_init_interned("CASE_UPPER", sizeof("CASE_UPPER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CASE_UPPER_name, &const_CASE_UPPER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CASE_UPPER_name); + zend_string_release_ex(const_CASE_UPPER_name, true); zval const_NULL_NATURAL_value; ZVAL_LONG(&const_NULL_NATURAL_value, LONG_CONST(PDO_NULL_NATURAL)); - zend_string *const_NULL_NATURAL_name = zend_string_init_interned("NULL_NATURAL", sizeof("NULL_NATURAL") - 1, 1); + zend_string *const_NULL_NATURAL_name = zend_string_init_interned("NULL_NATURAL", sizeof("NULL_NATURAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_NULL_NATURAL_name, &const_NULL_NATURAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NULL_NATURAL_name); + zend_string_release_ex(const_NULL_NATURAL_name, true); zval const_NULL_EMPTY_STRING_value; ZVAL_LONG(&const_NULL_EMPTY_STRING_value, LONG_CONST(PDO_NULL_EMPTY_STRING)); - zend_string *const_NULL_EMPTY_STRING_name = zend_string_init_interned("NULL_EMPTY_STRING", sizeof("NULL_EMPTY_STRING") - 1, 1); + zend_string *const_NULL_EMPTY_STRING_name = zend_string_init_interned("NULL_EMPTY_STRING", sizeof("NULL_EMPTY_STRING") - 1, true); zend_declare_typed_class_constant(class_entry, const_NULL_EMPTY_STRING_name, &const_NULL_EMPTY_STRING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NULL_EMPTY_STRING_name); + zend_string_release_ex(const_NULL_EMPTY_STRING_name, true); zval const_NULL_TO_STRING_value; ZVAL_LONG(&const_NULL_TO_STRING_value, LONG_CONST(PDO_NULL_TO_STRING)); - zend_string *const_NULL_TO_STRING_name = zend_string_init_interned("NULL_TO_STRING", sizeof("NULL_TO_STRING") - 1, 1); + zend_string *const_NULL_TO_STRING_name = zend_string_init_interned("NULL_TO_STRING", sizeof("NULL_TO_STRING") - 1, true); zend_declare_typed_class_constant(class_entry, const_NULL_TO_STRING_name, &const_NULL_TO_STRING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NULL_TO_STRING_name); + zend_string_release_ex(const_NULL_TO_STRING_name, true); zval const_ERR_NONE_value; zend_string *const_ERR_NONE_value_str = zend_string_init(PDO_ERR_NONE, strlen(PDO_ERR_NONE), 1); ZVAL_STR(&const_ERR_NONE_value, const_ERR_NONE_value_str); - zend_string *const_ERR_NONE_name = zend_string_init_interned("ERR_NONE", sizeof("ERR_NONE") - 1, 1); + zend_string *const_ERR_NONE_name = zend_string_init_interned("ERR_NONE", sizeof("ERR_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERR_NONE_name, &const_ERR_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_ERR_NONE_name); + zend_string_release_ex(const_ERR_NONE_name, true); zval const_FETCH_ORI_NEXT_value; ZVAL_LONG(&const_FETCH_ORI_NEXT_value, LONG_CONST(PDO_FETCH_ORI_NEXT)); - zend_string *const_FETCH_ORI_NEXT_name = zend_string_init_interned("FETCH_ORI_NEXT", sizeof("FETCH_ORI_NEXT") - 1, 1); + zend_string *const_FETCH_ORI_NEXT_name = zend_string_init_interned("FETCH_ORI_NEXT", sizeof("FETCH_ORI_NEXT") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_NEXT_name, &const_FETCH_ORI_NEXT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_NEXT_name); + zend_string_release_ex(const_FETCH_ORI_NEXT_name, true); zval const_FETCH_ORI_PRIOR_value; ZVAL_LONG(&const_FETCH_ORI_PRIOR_value, LONG_CONST(PDO_FETCH_ORI_PRIOR)); - zend_string *const_FETCH_ORI_PRIOR_name = zend_string_init_interned("FETCH_ORI_PRIOR", sizeof("FETCH_ORI_PRIOR") - 1, 1); + zend_string *const_FETCH_ORI_PRIOR_name = zend_string_init_interned("FETCH_ORI_PRIOR", sizeof("FETCH_ORI_PRIOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_PRIOR_name, &const_FETCH_ORI_PRIOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_PRIOR_name); + zend_string_release_ex(const_FETCH_ORI_PRIOR_name, true); zval const_FETCH_ORI_FIRST_value; ZVAL_LONG(&const_FETCH_ORI_FIRST_value, LONG_CONST(PDO_FETCH_ORI_FIRST)); - zend_string *const_FETCH_ORI_FIRST_name = zend_string_init_interned("FETCH_ORI_FIRST", sizeof("FETCH_ORI_FIRST") - 1, 1); + zend_string *const_FETCH_ORI_FIRST_name = zend_string_init_interned("FETCH_ORI_FIRST", sizeof("FETCH_ORI_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_FIRST_name, &const_FETCH_ORI_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_FIRST_name); + zend_string_release_ex(const_FETCH_ORI_FIRST_name, true); zval const_FETCH_ORI_LAST_value; ZVAL_LONG(&const_FETCH_ORI_LAST_value, LONG_CONST(PDO_FETCH_ORI_LAST)); - zend_string *const_FETCH_ORI_LAST_name = zend_string_init_interned("FETCH_ORI_LAST", sizeof("FETCH_ORI_LAST") - 1, 1); + zend_string *const_FETCH_ORI_LAST_name = zend_string_init_interned("FETCH_ORI_LAST", sizeof("FETCH_ORI_LAST") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_LAST_name, &const_FETCH_ORI_LAST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_LAST_name); + zend_string_release_ex(const_FETCH_ORI_LAST_name, true); zval const_FETCH_ORI_ABS_value; ZVAL_LONG(&const_FETCH_ORI_ABS_value, LONG_CONST(PDO_FETCH_ORI_ABS)); - zend_string *const_FETCH_ORI_ABS_name = zend_string_init_interned("FETCH_ORI_ABS", sizeof("FETCH_ORI_ABS") - 1, 1); + zend_string *const_FETCH_ORI_ABS_name = zend_string_init_interned("FETCH_ORI_ABS", sizeof("FETCH_ORI_ABS") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_ABS_name, &const_FETCH_ORI_ABS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_ABS_name); + zend_string_release_ex(const_FETCH_ORI_ABS_name, true); zval const_FETCH_ORI_REL_value; ZVAL_LONG(&const_FETCH_ORI_REL_value, LONG_CONST(PDO_FETCH_ORI_REL)); - zend_string *const_FETCH_ORI_REL_name = zend_string_init_interned("FETCH_ORI_REL", sizeof("FETCH_ORI_REL") - 1, 1); + zend_string *const_FETCH_ORI_REL_name = zend_string_init_interned("FETCH_ORI_REL", sizeof("FETCH_ORI_REL") - 1, true); zend_declare_typed_class_constant(class_entry, const_FETCH_ORI_REL_name, &const_FETCH_ORI_REL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FETCH_ORI_REL_name); + zend_string_release_ex(const_FETCH_ORI_REL_name, true); zval const_CURSOR_FWDONLY_value; ZVAL_LONG(&const_CURSOR_FWDONLY_value, LONG_CONST(PDO_CURSOR_FWDONLY)); - zend_string *const_CURSOR_FWDONLY_name = zend_string_init_interned("CURSOR_FWDONLY", sizeof("CURSOR_FWDONLY") - 1, 1); + zend_string *const_CURSOR_FWDONLY_name = zend_string_init_interned("CURSOR_FWDONLY", sizeof("CURSOR_FWDONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURSOR_FWDONLY_name, &const_CURSOR_FWDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURSOR_FWDONLY_name); + zend_string_release_ex(const_CURSOR_FWDONLY_name, true); zval const_CURSOR_SCROLL_value; ZVAL_LONG(&const_CURSOR_SCROLL_value, LONG_CONST(PDO_CURSOR_SCROLL)); - zend_string *const_CURSOR_SCROLL_name = zend_string_init_interned("CURSOR_SCROLL", sizeof("CURSOR_SCROLL") - 1, 1); + zend_string *const_CURSOR_SCROLL_name = zend_string_init_interned("CURSOR_SCROLL", sizeof("CURSOR_SCROLL") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURSOR_SCROLL_name, &const_CURSOR_SCROLL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURSOR_SCROLL_name); + zend_string_release_ex(const_CURSOR_SCROLL_name, true); zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "__construct", sizeof("__construct") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index 0d4131d5be493..0be8ee82d84d6 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -142,9 +142,9 @@ static zend_class_entry *register_class_PDOStatement(zend_class_entry *class_ent zval property_queryString_default_value; ZVAL_UNDEF(&property_queryString_default_value); - zend_string *property_queryString_name = zend_string_init("queryString", sizeof("queryString") - 1, 1); + zend_string *property_queryString_name = zend_string_init("queryString", sizeof("queryString") - 1, true); zend_declare_typed_property(class_entry, property_queryString_name, &property_queryString_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_queryString_name); + zend_string_release_ex(property_queryString_name, true); return class_entry; } @@ -158,9 +158,9 @@ static zend_class_entry *register_class_PDORow(void) zval property_queryString_default_value; ZVAL_UNDEF(&property_queryString_default_value); - zend_string *property_queryString_name = zend_string_init("queryString", sizeof("queryString") - 1, 1); + zend_string *property_queryString_name = zend_string_init("queryString", sizeof("queryString") - 1, true); zend_declare_typed_property(class_entry, property_queryString_name, &property_queryString_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_queryString_name); + zend_string_release_ex(property_queryString_name, true); return class_entry; } diff --git a/ext/pdo_dblib/pdo_dblib_arginfo.h b/ext/pdo_dblib/pdo_dblib_arginfo.h index 1cf6c60d7a3b0..2452255265a33 100644 --- a/ext/pdo_dblib/pdo_dblib_arginfo.h +++ b/ext/pdo_dblib/pdo_dblib_arginfo.h @@ -10,45 +10,45 @@ static zend_class_entry *register_class_Pdo_Dblib(zend_class_entry *class_entry_ zval const_ATTR_CONNECTION_TIMEOUT_value; ZVAL_LONG(&const_ATTR_CONNECTION_TIMEOUT_value, PDO_DBLIB_ATTR_CONNECTION_TIMEOUT); - zend_string *const_ATTR_CONNECTION_TIMEOUT_name = zend_string_init_interned("ATTR_CONNECTION_TIMEOUT", sizeof("ATTR_CONNECTION_TIMEOUT") - 1, 1); + zend_string *const_ATTR_CONNECTION_TIMEOUT_name = zend_string_init_interned("ATTR_CONNECTION_TIMEOUT", sizeof("ATTR_CONNECTION_TIMEOUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_CONNECTION_TIMEOUT_name, &const_ATTR_CONNECTION_TIMEOUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_CONNECTION_TIMEOUT_name); + zend_string_release_ex(const_ATTR_CONNECTION_TIMEOUT_name, true); zval const_ATTR_QUERY_TIMEOUT_value; ZVAL_LONG(&const_ATTR_QUERY_TIMEOUT_value, PDO_DBLIB_ATTR_QUERY_TIMEOUT); - zend_string *const_ATTR_QUERY_TIMEOUT_name = zend_string_init_interned("ATTR_QUERY_TIMEOUT", sizeof("ATTR_QUERY_TIMEOUT") - 1, 1); + zend_string *const_ATTR_QUERY_TIMEOUT_name = zend_string_init_interned("ATTR_QUERY_TIMEOUT", sizeof("ATTR_QUERY_TIMEOUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_QUERY_TIMEOUT_name, &const_ATTR_QUERY_TIMEOUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_QUERY_TIMEOUT_name); + zend_string_release_ex(const_ATTR_QUERY_TIMEOUT_name, true); zval const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_value; ZVAL_LONG(&const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_value, PDO_DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER); - zend_string *const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_name = zend_string_init_interned("ATTR_STRINGIFY_UNIQUEIDENTIFIER", sizeof("ATTR_STRINGIFY_UNIQUEIDENTIFIER") - 1, 1); + zend_string *const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_name = zend_string_init_interned("ATTR_STRINGIFY_UNIQUEIDENTIFIER", sizeof("ATTR_STRINGIFY_UNIQUEIDENTIFIER") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_name, &const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_name); + zend_string_release_ex(const_ATTR_STRINGIFY_UNIQUEIDENTIFIER_name, true); zval const_ATTR_VERSION_value; ZVAL_LONG(&const_ATTR_VERSION_value, PDO_DBLIB_ATTR_VERSION); - zend_string *const_ATTR_VERSION_name = zend_string_init_interned("ATTR_VERSION", sizeof("ATTR_VERSION") - 1, 1); + zend_string *const_ATTR_VERSION_name = zend_string_init_interned("ATTR_VERSION", sizeof("ATTR_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_VERSION_name, &const_ATTR_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_VERSION_name); + zend_string_release_ex(const_ATTR_VERSION_name, true); zval const_ATTR_TDS_VERSION_value; ZVAL_LONG(&const_ATTR_TDS_VERSION_value, PDO_DBLIB_ATTR_TDS_VERSION); - zend_string *const_ATTR_TDS_VERSION_name = zend_string_init_interned("ATTR_TDS_VERSION", sizeof("ATTR_TDS_VERSION") - 1, 1); + zend_string *const_ATTR_TDS_VERSION_name = zend_string_init_interned("ATTR_TDS_VERSION", sizeof("ATTR_TDS_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_TDS_VERSION_name, &const_ATTR_TDS_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_TDS_VERSION_name); + zend_string_release_ex(const_ATTR_TDS_VERSION_name, true); zval const_ATTR_SKIP_EMPTY_ROWSETS_value; ZVAL_LONG(&const_ATTR_SKIP_EMPTY_ROWSETS_value, PDO_DBLIB_ATTR_SKIP_EMPTY_ROWSETS); - zend_string *const_ATTR_SKIP_EMPTY_ROWSETS_name = zend_string_init_interned("ATTR_SKIP_EMPTY_ROWSETS", sizeof("ATTR_SKIP_EMPTY_ROWSETS") - 1, 1); + zend_string *const_ATTR_SKIP_EMPTY_ROWSETS_name = zend_string_init_interned("ATTR_SKIP_EMPTY_ROWSETS", sizeof("ATTR_SKIP_EMPTY_ROWSETS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SKIP_EMPTY_ROWSETS_name, &const_ATTR_SKIP_EMPTY_ROWSETS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SKIP_EMPTY_ROWSETS_name); + zend_string_release_ex(const_ATTR_SKIP_EMPTY_ROWSETS_name, true); zval const_ATTR_DATETIME_CONVERT_value; ZVAL_LONG(&const_ATTR_DATETIME_CONVERT_value, PDO_DBLIB_ATTR_DATETIME_CONVERT); - zend_string *const_ATTR_DATETIME_CONVERT_name = zend_string_init_interned("ATTR_DATETIME_CONVERT", sizeof("ATTR_DATETIME_CONVERT") - 1, 1); + zend_string *const_ATTR_DATETIME_CONVERT_name = zend_string_init_interned("ATTR_DATETIME_CONVERT", sizeof("ATTR_DATETIME_CONVERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DATETIME_CONVERT_name, &const_ATTR_DATETIME_CONVERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DATETIME_CONVERT_name); + zend_string_release_ex(const_ATTR_DATETIME_CONVERT_name, true); return class_entry; } diff --git a/ext/pdo_firebird/pdo_firebird_arginfo.h b/ext/pdo_firebird/pdo_firebird_arginfo.h index a5a9c562c9c12..fd500a6130c0a 100644 --- a/ext/pdo_firebird/pdo_firebird_arginfo.h +++ b/ext/pdo_firebird/pdo_firebird_arginfo.h @@ -20,51 +20,51 @@ static zend_class_entry *register_class_Pdo_Firebird(zend_class_entry *class_ent zval const_ATTR_DATE_FORMAT_value; ZVAL_LONG(&const_ATTR_DATE_FORMAT_value, PDO_FB_ATTR_DATE_FORMAT); - zend_string *const_ATTR_DATE_FORMAT_name = zend_string_init_interned("ATTR_DATE_FORMAT", sizeof("ATTR_DATE_FORMAT") - 1, 1); + zend_string *const_ATTR_DATE_FORMAT_name = zend_string_init_interned("ATTR_DATE_FORMAT", sizeof("ATTR_DATE_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DATE_FORMAT_name, &const_ATTR_DATE_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DATE_FORMAT_name); + zend_string_release_ex(const_ATTR_DATE_FORMAT_name, true); zval const_ATTR_TIME_FORMAT_value; ZVAL_LONG(&const_ATTR_TIME_FORMAT_value, PDO_FB_ATTR_TIME_FORMAT); - zend_string *const_ATTR_TIME_FORMAT_name = zend_string_init_interned("ATTR_TIME_FORMAT", sizeof("ATTR_TIME_FORMAT") - 1, 1); + zend_string *const_ATTR_TIME_FORMAT_name = zend_string_init_interned("ATTR_TIME_FORMAT", sizeof("ATTR_TIME_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_TIME_FORMAT_name, &const_ATTR_TIME_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_TIME_FORMAT_name); + zend_string_release_ex(const_ATTR_TIME_FORMAT_name, true); zval const_ATTR_TIMESTAMP_FORMAT_value; ZVAL_LONG(&const_ATTR_TIMESTAMP_FORMAT_value, PDO_FB_ATTR_TIMESTAMP_FORMAT); - zend_string *const_ATTR_TIMESTAMP_FORMAT_name = zend_string_init_interned("ATTR_TIMESTAMP_FORMAT", sizeof("ATTR_TIMESTAMP_FORMAT") - 1, 1); + zend_string *const_ATTR_TIMESTAMP_FORMAT_name = zend_string_init_interned("ATTR_TIMESTAMP_FORMAT", sizeof("ATTR_TIMESTAMP_FORMAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_TIMESTAMP_FORMAT_name, &const_ATTR_TIMESTAMP_FORMAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_TIMESTAMP_FORMAT_name); + zend_string_release_ex(const_ATTR_TIMESTAMP_FORMAT_name, true); zval const_TRANSACTION_ISOLATION_LEVEL_value; ZVAL_LONG(&const_TRANSACTION_ISOLATION_LEVEL_value, PDO_FB_TRANSACTION_ISOLATION_LEVEL); - zend_string *const_TRANSACTION_ISOLATION_LEVEL_name = zend_string_init_interned("TRANSACTION_ISOLATION_LEVEL", sizeof("TRANSACTION_ISOLATION_LEVEL") - 1, 1); + zend_string *const_TRANSACTION_ISOLATION_LEVEL_name = zend_string_init_interned("TRANSACTION_ISOLATION_LEVEL", sizeof("TRANSACTION_ISOLATION_LEVEL") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRANSACTION_ISOLATION_LEVEL_name, &const_TRANSACTION_ISOLATION_LEVEL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_ISOLATION_LEVEL_name); + zend_string_release_ex(const_TRANSACTION_ISOLATION_LEVEL_name, true); zval const_READ_COMMITTED_value; ZVAL_LONG(&const_READ_COMMITTED_value, PDO_FB_READ_COMMITTED); - zend_string *const_READ_COMMITTED_name = zend_string_init_interned("READ_COMMITTED", sizeof("READ_COMMITTED") - 1, 1); + zend_string *const_READ_COMMITTED_name = zend_string_init_interned("READ_COMMITTED", sizeof("READ_COMMITTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_READ_COMMITTED_name, &const_READ_COMMITTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_READ_COMMITTED_name); + zend_string_release_ex(const_READ_COMMITTED_name, true); zval const_REPEATABLE_READ_value; ZVAL_LONG(&const_REPEATABLE_READ_value, PDO_FB_REPEATABLE_READ); - zend_string *const_REPEATABLE_READ_name = zend_string_init_interned("REPEATABLE_READ", sizeof("REPEATABLE_READ") - 1, 1); + zend_string *const_REPEATABLE_READ_name = zend_string_init_interned("REPEATABLE_READ", sizeof("REPEATABLE_READ") - 1, true); zend_declare_typed_class_constant(class_entry, const_REPEATABLE_READ_name, &const_REPEATABLE_READ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REPEATABLE_READ_name); + zend_string_release_ex(const_REPEATABLE_READ_name, true); zval const_SERIALIZABLE_value; ZVAL_LONG(&const_SERIALIZABLE_value, PDO_FB_SERIALIZABLE); - zend_string *const_SERIALIZABLE_name = zend_string_init_interned("SERIALIZABLE", sizeof("SERIALIZABLE") - 1, 1); + zend_string *const_SERIALIZABLE_name = zend_string_init_interned("SERIALIZABLE", sizeof("SERIALIZABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SERIALIZABLE_name, &const_SERIALIZABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SERIALIZABLE_name); + zend_string_release_ex(const_SERIALIZABLE_name, true); zval const_WRITABLE_TRANSACTION_value; ZVAL_LONG(&const_WRITABLE_TRANSACTION_value, PDO_FB_WRITABLE_TRANSACTION); - zend_string *const_WRITABLE_TRANSACTION_name = zend_string_init_interned("WRITABLE_TRANSACTION", sizeof("WRITABLE_TRANSACTION") - 1, 1); + zend_string *const_WRITABLE_TRANSACTION_name = zend_string_init_interned("WRITABLE_TRANSACTION", sizeof("WRITABLE_TRANSACTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_WRITABLE_TRANSACTION_name, &const_WRITABLE_TRANSACTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WRITABLE_TRANSACTION_name); + zend_string_release_ex(const_WRITABLE_TRANSACTION_name, true); return class_entry; } diff --git a/ext/pdo_mysql/pdo_mysql_arginfo.h b/ext/pdo_mysql/pdo_mysql_arginfo.h index 0e9c04bd3cfd3..516109fa0520a 100644 --- a/ext/pdo_mysql/pdo_mysql_arginfo.h +++ b/ext/pdo_mysql/pdo_mysql_arginfo.h @@ -20,124 +20,124 @@ static zend_class_entry *register_class_Pdo_Mysql(zend_class_entry *class_entry_ zval const_ATTR_USE_BUFFERED_QUERY_value; ZVAL_LONG(&const_ATTR_USE_BUFFERED_QUERY_value, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY); - zend_string *const_ATTR_USE_BUFFERED_QUERY_name = zend_string_init_interned("ATTR_USE_BUFFERED_QUERY", sizeof("ATTR_USE_BUFFERED_QUERY") - 1, 1); + zend_string *const_ATTR_USE_BUFFERED_QUERY_name = zend_string_init_interned("ATTR_USE_BUFFERED_QUERY", sizeof("ATTR_USE_BUFFERED_QUERY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_USE_BUFFERED_QUERY_name, &const_ATTR_USE_BUFFERED_QUERY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_USE_BUFFERED_QUERY_name); + zend_string_release_ex(const_ATTR_USE_BUFFERED_QUERY_name, true); zval const_ATTR_LOCAL_INFILE_value; ZVAL_LONG(&const_ATTR_LOCAL_INFILE_value, PDO_MYSQL_ATTR_LOCAL_INFILE); - zend_string *const_ATTR_LOCAL_INFILE_name = zend_string_init_interned("ATTR_LOCAL_INFILE", sizeof("ATTR_LOCAL_INFILE") - 1, 1); + zend_string *const_ATTR_LOCAL_INFILE_name = zend_string_init_interned("ATTR_LOCAL_INFILE", sizeof("ATTR_LOCAL_INFILE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_LOCAL_INFILE_name, &const_ATTR_LOCAL_INFILE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_LOCAL_INFILE_name); + zend_string_release_ex(const_ATTR_LOCAL_INFILE_name, true); zval const_ATTR_INIT_COMMAND_value; ZVAL_LONG(&const_ATTR_INIT_COMMAND_value, PDO_MYSQL_ATTR_INIT_COMMAND); - zend_string *const_ATTR_INIT_COMMAND_name = zend_string_init_interned("ATTR_INIT_COMMAND", sizeof("ATTR_INIT_COMMAND") - 1, 1); + zend_string *const_ATTR_INIT_COMMAND_name = zend_string_init_interned("ATTR_INIT_COMMAND", sizeof("ATTR_INIT_COMMAND") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_INIT_COMMAND_name, &const_ATTR_INIT_COMMAND_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_INIT_COMMAND_name); + zend_string_release_ex(const_ATTR_INIT_COMMAND_name, true); #if !defined(PDO_USE_MYSQLND) zval const_ATTR_MAX_BUFFER_SIZE_value; ZVAL_LONG(&const_ATTR_MAX_BUFFER_SIZE_value, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE); - zend_string *const_ATTR_MAX_BUFFER_SIZE_name = zend_string_init_interned("ATTR_MAX_BUFFER_SIZE", sizeof("ATTR_MAX_BUFFER_SIZE") - 1, 1); + zend_string *const_ATTR_MAX_BUFFER_SIZE_name = zend_string_init_interned("ATTR_MAX_BUFFER_SIZE", sizeof("ATTR_MAX_BUFFER_SIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_MAX_BUFFER_SIZE_name, &const_ATTR_MAX_BUFFER_SIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_MAX_BUFFER_SIZE_name); + zend_string_release_ex(const_ATTR_MAX_BUFFER_SIZE_name, true); zval const_ATTR_READ_DEFAULT_FILE_value; ZVAL_LONG(&const_ATTR_READ_DEFAULT_FILE_value, PDO_MYSQL_ATTR_READ_DEFAULT_FILE); - zend_string *const_ATTR_READ_DEFAULT_FILE_name = zend_string_init_interned("ATTR_READ_DEFAULT_FILE", sizeof("ATTR_READ_DEFAULT_FILE") - 1, 1); + zend_string *const_ATTR_READ_DEFAULT_FILE_name = zend_string_init_interned("ATTR_READ_DEFAULT_FILE", sizeof("ATTR_READ_DEFAULT_FILE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_READ_DEFAULT_FILE_name, &const_ATTR_READ_DEFAULT_FILE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_READ_DEFAULT_FILE_name); + zend_string_release_ex(const_ATTR_READ_DEFAULT_FILE_name, true); zval const_ATTR_READ_DEFAULT_GROUP_value; ZVAL_LONG(&const_ATTR_READ_DEFAULT_GROUP_value, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP); - zend_string *const_ATTR_READ_DEFAULT_GROUP_name = zend_string_init_interned("ATTR_READ_DEFAULT_GROUP", sizeof("ATTR_READ_DEFAULT_GROUP") - 1, 1); + zend_string *const_ATTR_READ_DEFAULT_GROUP_name = zend_string_init_interned("ATTR_READ_DEFAULT_GROUP", sizeof("ATTR_READ_DEFAULT_GROUP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_READ_DEFAULT_GROUP_name, &const_ATTR_READ_DEFAULT_GROUP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_READ_DEFAULT_GROUP_name); + zend_string_release_ex(const_ATTR_READ_DEFAULT_GROUP_name, true); #endif zval const_ATTR_COMPRESS_value; ZVAL_LONG(&const_ATTR_COMPRESS_value, PDO_MYSQL_ATTR_COMPRESS); - zend_string *const_ATTR_COMPRESS_name = zend_string_init_interned("ATTR_COMPRESS", sizeof("ATTR_COMPRESS") - 1, 1); + zend_string *const_ATTR_COMPRESS_name = zend_string_init_interned("ATTR_COMPRESS", sizeof("ATTR_COMPRESS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_COMPRESS_name, &const_ATTR_COMPRESS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_COMPRESS_name); + zend_string_release_ex(const_ATTR_COMPRESS_name, true); zval const_ATTR_DIRECT_QUERY_value; ZVAL_LONG(&const_ATTR_DIRECT_QUERY_value, PDO_ATTR_EMULATE_PREPARES); - zend_string *const_ATTR_DIRECT_QUERY_name = zend_string_init_interned("ATTR_DIRECT_QUERY", sizeof("ATTR_DIRECT_QUERY") - 1, 1); + zend_string *const_ATTR_DIRECT_QUERY_name = zend_string_init_interned("ATTR_DIRECT_QUERY", sizeof("ATTR_DIRECT_QUERY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DIRECT_QUERY_name, &const_ATTR_DIRECT_QUERY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DIRECT_QUERY_name); + zend_string_release_ex(const_ATTR_DIRECT_QUERY_name, true); zval const_ATTR_FOUND_ROWS_value; ZVAL_LONG(&const_ATTR_FOUND_ROWS_value, PDO_MYSQL_ATTR_FOUND_ROWS); - zend_string *const_ATTR_FOUND_ROWS_name = zend_string_init_interned("ATTR_FOUND_ROWS", sizeof("ATTR_FOUND_ROWS") - 1, 1); + zend_string *const_ATTR_FOUND_ROWS_name = zend_string_init_interned("ATTR_FOUND_ROWS", sizeof("ATTR_FOUND_ROWS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_FOUND_ROWS_name, &const_ATTR_FOUND_ROWS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_FOUND_ROWS_name); + zend_string_release_ex(const_ATTR_FOUND_ROWS_name, true); zval const_ATTR_IGNORE_SPACE_value; ZVAL_LONG(&const_ATTR_IGNORE_SPACE_value, PDO_MYSQL_ATTR_IGNORE_SPACE); - zend_string *const_ATTR_IGNORE_SPACE_name = zend_string_init_interned("ATTR_IGNORE_SPACE", sizeof("ATTR_IGNORE_SPACE") - 1, 1); + zend_string *const_ATTR_IGNORE_SPACE_name = zend_string_init_interned("ATTR_IGNORE_SPACE", sizeof("ATTR_IGNORE_SPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_IGNORE_SPACE_name, &const_ATTR_IGNORE_SPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_IGNORE_SPACE_name); + zend_string_release_ex(const_ATTR_IGNORE_SPACE_name, true); zval const_ATTR_SSL_KEY_value; ZVAL_LONG(&const_ATTR_SSL_KEY_value, PDO_MYSQL_ATTR_SSL_KEY); - zend_string *const_ATTR_SSL_KEY_name = zend_string_init_interned("ATTR_SSL_KEY", sizeof("ATTR_SSL_KEY") - 1, 1); + zend_string *const_ATTR_SSL_KEY_name = zend_string_init_interned("ATTR_SSL_KEY", sizeof("ATTR_SSL_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_KEY_name, &const_ATTR_SSL_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_KEY_name); + zend_string_release_ex(const_ATTR_SSL_KEY_name, true); zval const_ATTR_SSL_CERT_value; ZVAL_LONG(&const_ATTR_SSL_CERT_value, PDO_MYSQL_ATTR_SSL_CERT); - zend_string *const_ATTR_SSL_CERT_name = zend_string_init_interned("ATTR_SSL_CERT", sizeof("ATTR_SSL_CERT") - 1, 1); + zend_string *const_ATTR_SSL_CERT_name = zend_string_init_interned("ATTR_SSL_CERT", sizeof("ATTR_SSL_CERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_CERT_name, &const_ATTR_SSL_CERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_CERT_name); + zend_string_release_ex(const_ATTR_SSL_CERT_name, true); zval const_ATTR_SSL_CA_value; ZVAL_LONG(&const_ATTR_SSL_CA_value, PDO_MYSQL_ATTR_SSL_CA); - zend_string *const_ATTR_SSL_CA_name = zend_string_init_interned("ATTR_SSL_CA", sizeof("ATTR_SSL_CA") - 1, 1); + zend_string *const_ATTR_SSL_CA_name = zend_string_init_interned("ATTR_SSL_CA", sizeof("ATTR_SSL_CA") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_CA_name, &const_ATTR_SSL_CA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_CA_name); + zend_string_release_ex(const_ATTR_SSL_CA_name, true); zval const_ATTR_SSL_CAPATH_value; ZVAL_LONG(&const_ATTR_SSL_CAPATH_value, PDO_MYSQL_ATTR_SSL_CAPATH); - zend_string *const_ATTR_SSL_CAPATH_name = zend_string_init_interned("ATTR_SSL_CAPATH", sizeof("ATTR_SSL_CAPATH") - 1, 1); + zend_string *const_ATTR_SSL_CAPATH_name = zend_string_init_interned("ATTR_SSL_CAPATH", sizeof("ATTR_SSL_CAPATH") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_CAPATH_name, &const_ATTR_SSL_CAPATH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_CAPATH_name); + zend_string_release_ex(const_ATTR_SSL_CAPATH_name, true); zval const_ATTR_SSL_CIPHER_value; ZVAL_LONG(&const_ATTR_SSL_CIPHER_value, PDO_MYSQL_ATTR_SSL_CIPHER); - zend_string *const_ATTR_SSL_CIPHER_name = zend_string_init_interned("ATTR_SSL_CIPHER", sizeof("ATTR_SSL_CIPHER") - 1, 1); + zend_string *const_ATTR_SSL_CIPHER_name = zend_string_init_interned("ATTR_SSL_CIPHER", sizeof("ATTR_SSL_CIPHER") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_CIPHER_name, &const_ATTR_SSL_CIPHER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_CIPHER_name); + zend_string_release_ex(const_ATTR_SSL_CIPHER_name, true); #if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND) zval const_ATTR_SERVER_PUBLIC_KEY_value; ZVAL_LONG(&const_ATTR_SERVER_PUBLIC_KEY_value, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY); - zend_string *const_ATTR_SERVER_PUBLIC_KEY_name = zend_string_init_interned("ATTR_SERVER_PUBLIC_KEY", sizeof("ATTR_SERVER_PUBLIC_KEY") - 1, 1); + zend_string *const_ATTR_SERVER_PUBLIC_KEY_name = zend_string_init_interned("ATTR_SERVER_PUBLIC_KEY", sizeof("ATTR_SERVER_PUBLIC_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SERVER_PUBLIC_KEY_name, &const_ATTR_SERVER_PUBLIC_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SERVER_PUBLIC_KEY_name); + zend_string_release_ex(const_ATTR_SERVER_PUBLIC_KEY_name, true); #endif zval const_ATTR_MULTI_STATEMENTS_value; ZVAL_LONG(&const_ATTR_MULTI_STATEMENTS_value, PDO_MYSQL_ATTR_MULTI_STATEMENTS); - zend_string *const_ATTR_MULTI_STATEMENTS_name = zend_string_init_interned("ATTR_MULTI_STATEMENTS", sizeof("ATTR_MULTI_STATEMENTS") - 1, 1); + zend_string *const_ATTR_MULTI_STATEMENTS_name = zend_string_init_interned("ATTR_MULTI_STATEMENTS", sizeof("ATTR_MULTI_STATEMENTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_MULTI_STATEMENTS_name, &const_ATTR_MULTI_STATEMENTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_MULTI_STATEMENTS_name); + zend_string_release_ex(const_ATTR_MULTI_STATEMENTS_name, true); #if defined(PDO_USE_MYSQLND) zval const_ATTR_SSL_VERIFY_SERVER_CERT_value; ZVAL_LONG(&const_ATTR_SSL_VERIFY_SERVER_CERT_value, PDO_MYSQL_ATTR_SSL_VERIFY_SERVER_CERT); - zend_string *const_ATTR_SSL_VERIFY_SERVER_CERT_name = zend_string_init_interned("ATTR_SSL_VERIFY_SERVER_CERT", sizeof("ATTR_SSL_VERIFY_SERVER_CERT") - 1, 1); + zend_string *const_ATTR_SSL_VERIFY_SERVER_CERT_name = zend_string_init_interned("ATTR_SSL_VERIFY_SERVER_CERT", sizeof("ATTR_SSL_VERIFY_SERVER_CERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_SSL_VERIFY_SERVER_CERT_name, &const_ATTR_SSL_VERIFY_SERVER_CERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_SSL_VERIFY_SERVER_CERT_name); + zend_string_release_ex(const_ATTR_SSL_VERIFY_SERVER_CERT_name, true); #endif #if MYSQL_VERSION_ID >= 80021 || defined(PDO_USE_MYSQLND) zval const_ATTR_LOCAL_INFILE_DIRECTORY_value; ZVAL_LONG(&const_ATTR_LOCAL_INFILE_DIRECTORY_value, PDO_MYSQL_ATTR_LOCAL_INFILE_DIRECTORY); - zend_string *const_ATTR_LOCAL_INFILE_DIRECTORY_name = zend_string_init_interned("ATTR_LOCAL_INFILE_DIRECTORY", sizeof("ATTR_LOCAL_INFILE_DIRECTORY") - 1, 1); + zend_string *const_ATTR_LOCAL_INFILE_DIRECTORY_name = zend_string_init_interned("ATTR_LOCAL_INFILE_DIRECTORY", sizeof("ATTR_LOCAL_INFILE_DIRECTORY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_LOCAL_INFILE_DIRECTORY_name, &const_ATTR_LOCAL_INFILE_DIRECTORY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_LOCAL_INFILE_DIRECTORY_name); + zend_string_release_ex(const_ATTR_LOCAL_INFILE_DIRECTORY_name, true); #endif return class_entry; diff --git a/ext/pdo_odbc/pdo_odbc_arginfo.h b/ext/pdo_odbc/pdo_odbc_arginfo.h index 5b1933d7594a0..d8ee0524feb5f 100644 --- a/ext/pdo_odbc/pdo_odbc_arginfo.h +++ b/ext/pdo_odbc/pdo_odbc_arginfo.h @@ -15,33 +15,33 @@ static zend_class_entry *register_class_Pdo_Odbc(zend_class_entry *class_entry_P zval const_ATTR_USE_CURSOR_LIBRARY_value; ZVAL_LONG(&const_ATTR_USE_CURSOR_LIBRARY_value, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY); - zend_string *const_ATTR_USE_CURSOR_LIBRARY_name = zend_string_init_interned("ATTR_USE_CURSOR_LIBRARY", sizeof("ATTR_USE_CURSOR_LIBRARY") - 1, 1); + zend_string *const_ATTR_USE_CURSOR_LIBRARY_name = zend_string_init_interned("ATTR_USE_CURSOR_LIBRARY", sizeof("ATTR_USE_CURSOR_LIBRARY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_USE_CURSOR_LIBRARY_name, &const_ATTR_USE_CURSOR_LIBRARY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_USE_CURSOR_LIBRARY_name); + zend_string_release_ex(const_ATTR_USE_CURSOR_LIBRARY_name, true); zval const_ATTR_ASSUME_UTF8_value; ZVAL_LONG(&const_ATTR_ASSUME_UTF8_value, PDO_ODBC_ATTR_ASSUME_UTF8); - zend_string *const_ATTR_ASSUME_UTF8_name = zend_string_init_interned("ATTR_ASSUME_UTF8", sizeof("ATTR_ASSUME_UTF8") - 1, 1); + zend_string *const_ATTR_ASSUME_UTF8_name = zend_string_init_interned("ATTR_ASSUME_UTF8", sizeof("ATTR_ASSUME_UTF8") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_ASSUME_UTF8_name, &const_ATTR_ASSUME_UTF8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_ASSUME_UTF8_name); + zend_string_release_ex(const_ATTR_ASSUME_UTF8_name, true); zval const_SQL_USE_IF_NEEDED_value; ZVAL_LONG(&const_SQL_USE_IF_NEEDED_value, SQL_CUR_USE_IF_NEEDED); - zend_string *const_SQL_USE_IF_NEEDED_name = zend_string_init_interned("SQL_USE_IF_NEEDED", sizeof("SQL_USE_IF_NEEDED") - 1, 1); + zend_string *const_SQL_USE_IF_NEEDED_name = zend_string_init_interned("SQL_USE_IF_NEEDED", sizeof("SQL_USE_IF_NEEDED") - 1, true); zend_declare_typed_class_constant(class_entry, const_SQL_USE_IF_NEEDED_name, &const_SQL_USE_IF_NEEDED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SQL_USE_IF_NEEDED_name); + zend_string_release_ex(const_SQL_USE_IF_NEEDED_name, true); zval const_SQL_USE_DRIVER_value; ZVAL_LONG(&const_SQL_USE_DRIVER_value, SQL_CUR_USE_DRIVER); - zend_string *const_SQL_USE_DRIVER_name = zend_string_init_interned("SQL_USE_DRIVER", sizeof("SQL_USE_DRIVER") - 1, 1); + zend_string *const_SQL_USE_DRIVER_name = zend_string_init_interned("SQL_USE_DRIVER", sizeof("SQL_USE_DRIVER") - 1, true); zend_declare_typed_class_constant(class_entry, const_SQL_USE_DRIVER_name, &const_SQL_USE_DRIVER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SQL_USE_DRIVER_name); + zend_string_release_ex(const_SQL_USE_DRIVER_name, true); zval const_SQL_USE_ODBC_value; ZVAL_LONG(&const_SQL_USE_ODBC_value, SQL_CUR_USE_ODBC); - zend_string *const_SQL_USE_ODBC_name = zend_string_init_interned("SQL_USE_ODBC", sizeof("SQL_USE_ODBC") - 1, 1); + zend_string *const_SQL_USE_ODBC_name = zend_string_init_interned("SQL_USE_ODBC", sizeof("SQL_USE_ODBC") - 1, true); zend_declare_typed_class_constant(class_entry, const_SQL_USE_ODBC_name, &const_SQL_USE_ODBC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SQL_USE_ODBC_name); + zend_string_release_ex(const_SQL_USE_ODBC_name, true); return class_entry; } diff --git a/ext/pdo_pgsql/pdo_pgsql_arginfo.h b/ext/pdo_pgsql/pdo_pgsql_arginfo.h index 5cb973a79f5a3..296207471a198 100644 --- a/ext/pdo_pgsql/pdo_pgsql_arginfo.h +++ b/ext/pdo_pgsql/pdo_pgsql_arginfo.h @@ -90,47 +90,47 @@ static zend_class_entry *register_class_Pdo_Pgsql(zend_class_entry *class_entry_ zval const_ATTR_DISABLE_PREPARES_value; ZVAL_LONG(&const_ATTR_DISABLE_PREPARES_value, PDO_PGSQL_ATTR_DISABLE_PREPARES); - zend_string *const_ATTR_DISABLE_PREPARES_name = zend_string_init_interned("ATTR_DISABLE_PREPARES", sizeof("ATTR_DISABLE_PREPARES") - 1, 1); + zend_string *const_ATTR_DISABLE_PREPARES_name = zend_string_init_interned("ATTR_DISABLE_PREPARES", sizeof("ATTR_DISABLE_PREPARES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_DISABLE_PREPARES_name, &const_ATTR_DISABLE_PREPARES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_DISABLE_PREPARES_name); + zend_string_release_ex(const_ATTR_DISABLE_PREPARES_name, true); #if defined(HAVE_PG_RESULT_MEMORY_SIZE) zval const_ATTR_RESULT_MEMORY_SIZE_value; ZVAL_LONG(&const_ATTR_RESULT_MEMORY_SIZE_value, PDO_PGSQL_ATTR_RESULT_MEMORY_SIZE); - zend_string *const_ATTR_RESULT_MEMORY_SIZE_name = zend_string_init_interned("ATTR_RESULT_MEMORY_SIZE", sizeof("ATTR_RESULT_MEMORY_SIZE") - 1, 1); + zend_string *const_ATTR_RESULT_MEMORY_SIZE_name = zend_string_init_interned("ATTR_RESULT_MEMORY_SIZE", sizeof("ATTR_RESULT_MEMORY_SIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_RESULT_MEMORY_SIZE_name, &const_ATTR_RESULT_MEMORY_SIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_RESULT_MEMORY_SIZE_name); + zend_string_release_ex(const_ATTR_RESULT_MEMORY_SIZE_name, true); #endif zval const_TRANSACTION_IDLE_value; ZVAL_LONG(&const_TRANSACTION_IDLE_value, PGSQL_TRANSACTION_IDLE); - zend_string *const_TRANSACTION_IDLE_name = zend_string_init_interned("TRANSACTION_IDLE", sizeof("TRANSACTION_IDLE") - 1, 1); + zend_string *const_TRANSACTION_IDLE_name = zend_string_init_interned("TRANSACTION_IDLE", sizeof("TRANSACTION_IDLE") - 1, true); zend_class_constant *const_TRANSACTION_IDLE = zend_declare_typed_class_constant(class_entry, const_TRANSACTION_IDLE_name, &const_TRANSACTION_IDLE_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_IDLE_name); + zend_string_release_ex(const_TRANSACTION_IDLE_name, true); zval const_TRANSACTION_ACTIVE_value; ZVAL_LONG(&const_TRANSACTION_ACTIVE_value, PGSQL_TRANSACTION_ACTIVE); - zend_string *const_TRANSACTION_ACTIVE_name = zend_string_init_interned("TRANSACTION_ACTIVE", sizeof("TRANSACTION_ACTIVE") - 1, 1); + zend_string *const_TRANSACTION_ACTIVE_name = zend_string_init_interned("TRANSACTION_ACTIVE", sizeof("TRANSACTION_ACTIVE") - 1, true); zend_class_constant *const_TRANSACTION_ACTIVE = zend_declare_typed_class_constant(class_entry, const_TRANSACTION_ACTIVE_name, &const_TRANSACTION_ACTIVE_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_ACTIVE_name); + zend_string_release_ex(const_TRANSACTION_ACTIVE_name, true); zval const_TRANSACTION_INTRANS_value; ZVAL_LONG(&const_TRANSACTION_INTRANS_value, PGSQL_TRANSACTION_INTRANS); - zend_string *const_TRANSACTION_INTRANS_name = zend_string_init_interned("TRANSACTION_INTRANS", sizeof("TRANSACTION_INTRANS") - 1, 1); + zend_string *const_TRANSACTION_INTRANS_name = zend_string_init_interned("TRANSACTION_INTRANS", sizeof("TRANSACTION_INTRANS") - 1, true); zend_class_constant *const_TRANSACTION_INTRANS = zend_declare_typed_class_constant(class_entry, const_TRANSACTION_INTRANS_name, &const_TRANSACTION_INTRANS_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_INTRANS_name); + zend_string_release_ex(const_TRANSACTION_INTRANS_name, true); zval const_TRANSACTION_INERROR_value; ZVAL_LONG(&const_TRANSACTION_INERROR_value, PGSQL_TRANSACTION_INERROR); - zend_string *const_TRANSACTION_INERROR_name = zend_string_init_interned("TRANSACTION_INERROR", sizeof("TRANSACTION_INERROR") - 1, 1); + zend_string *const_TRANSACTION_INERROR_name = zend_string_init_interned("TRANSACTION_INERROR", sizeof("TRANSACTION_INERROR") - 1, true); zend_class_constant *const_TRANSACTION_INERROR = zend_declare_typed_class_constant(class_entry, const_TRANSACTION_INERROR_name, &const_TRANSACTION_INERROR_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_INERROR_name); + zend_string_release_ex(const_TRANSACTION_INERROR_name, true); zval const_TRANSACTION_UNKNOWN_value; ZVAL_LONG(&const_TRANSACTION_UNKNOWN_value, PGSQL_TRANSACTION_UNKNOWN); - zend_string *const_TRANSACTION_UNKNOWN_name = zend_string_init_interned("TRANSACTION_UNKNOWN", sizeof("TRANSACTION_UNKNOWN") - 1, 1); + zend_string *const_TRANSACTION_UNKNOWN_name = zend_string_init_interned("TRANSACTION_UNKNOWN", sizeof("TRANSACTION_UNKNOWN") - 1, true); zend_class_constant *const_TRANSACTION_UNKNOWN = zend_declare_typed_class_constant(class_entry, const_TRANSACTION_UNKNOWN_name, &const_TRANSACTION_UNKNOWN_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_UNKNOWN_name); + zend_string_release_ex(const_TRANSACTION_UNKNOWN_name, true); zend_attribute *attribute_Deprecated_const_TRANSACTION_IDLE_0 = zend_add_class_constant_attribute(class_entry, const_TRANSACTION_IDLE, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2); diff --git a/ext/pdo_sqlite/pdo_sqlite_arginfo.h b/ext/pdo_sqlite/pdo_sqlite_arginfo.h index 44ec8bc327186..f50cdacdc2ec6 100644 --- a/ext/pdo_sqlite/pdo_sqlite_arginfo.h +++ b/ext/pdo_sqlite/pdo_sqlite_arginfo.h @@ -69,120 +69,120 @@ static zend_class_entry *register_class_Pdo_Sqlite(zend_class_entry *class_entry zval const_DETERMINISTIC_value; ZVAL_LONG(&const_DETERMINISTIC_value, SQLITE_DETERMINISTIC); - zend_string *const_DETERMINISTIC_name = zend_string_init_interned("DETERMINISTIC", sizeof("DETERMINISTIC") - 1, 1); + zend_string *const_DETERMINISTIC_name = zend_string_init_interned("DETERMINISTIC", sizeof("DETERMINISTIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DETERMINISTIC_name, &const_DETERMINISTIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DETERMINISTIC_name); + zend_string_release_ex(const_DETERMINISTIC_name, true); #endif zval const_OPEN_READONLY_value; ZVAL_LONG(&const_OPEN_READONLY_value, SQLITE_OPEN_READONLY); - zend_string *const_OPEN_READONLY_name = zend_string_init_interned("OPEN_READONLY", sizeof("OPEN_READONLY") - 1, 1); + zend_string *const_OPEN_READONLY_name = zend_string_init_interned("OPEN_READONLY", sizeof("OPEN_READONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPEN_READONLY_name, &const_OPEN_READONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPEN_READONLY_name); + zend_string_release_ex(const_OPEN_READONLY_name, true); zval const_OPEN_READWRITE_value; ZVAL_LONG(&const_OPEN_READWRITE_value, SQLITE_OPEN_READWRITE); - zend_string *const_OPEN_READWRITE_name = zend_string_init_interned("OPEN_READWRITE", sizeof("OPEN_READWRITE") - 1, 1); + zend_string *const_OPEN_READWRITE_name = zend_string_init_interned("OPEN_READWRITE", sizeof("OPEN_READWRITE") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPEN_READWRITE_name, &const_OPEN_READWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPEN_READWRITE_name); + zend_string_release_ex(const_OPEN_READWRITE_name, true); zval const_OPEN_CREATE_value; ZVAL_LONG(&const_OPEN_CREATE_value, SQLITE_OPEN_CREATE); - zend_string *const_OPEN_CREATE_name = zend_string_init_interned("OPEN_CREATE", sizeof("OPEN_CREATE") - 1, 1); + zend_string *const_OPEN_CREATE_name = zend_string_init_interned("OPEN_CREATE", sizeof("OPEN_CREATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPEN_CREATE_name, &const_OPEN_CREATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPEN_CREATE_name); + zend_string_release_ex(const_OPEN_CREATE_name, true); zval const_ATTR_OPEN_FLAGS_value; ZVAL_LONG(&const_ATTR_OPEN_FLAGS_value, PDO_SQLITE_ATTR_OPEN_FLAGS); - zend_string *const_ATTR_OPEN_FLAGS_name = zend_string_init_interned("ATTR_OPEN_FLAGS", sizeof("ATTR_OPEN_FLAGS") - 1, 1); + zend_string *const_ATTR_OPEN_FLAGS_name = zend_string_init_interned("ATTR_OPEN_FLAGS", sizeof("ATTR_OPEN_FLAGS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_OPEN_FLAGS_name, &const_ATTR_OPEN_FLAGS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_OPEN_FLAGS_name); + zend_string_release_ex(const_ATTR_OPEN_FLAGS_name, true); zval const_ATTR_READONLY_STATEMENT_value; ZVAL_LONG(&const_ATTR_READONLY_STATEMENT_value, PDO_SQLITE_ATTR_READONLY_STATEMENT); - zend_string *const_ATTR_READONLY_STATEMENT_name = zend_string_init_interned("ATTR_READONLY_STATEMENT", sizeof("ATTR_READONLY_STATEMENT") - 1, 1); + zend_string *const_ATTR_READONLY_STATEMENT_name = zend_string_init_interned("ATTR_READONLY_STATEMENT", sizeof("ATTR_READONLY_STATEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_READONLY_STATEMENT_name, &const_ATTR_READONLY_STATEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_READONLY_STATEMENT_name); + zend_string_release_ex(const_ATTR_READONLY_STATEMENT_name, true); zval const_ATTR_EXTENDED_RESULT_CODES_value; ZVAL_LONG(&const_ATTR_EXTENDED_RESULT_CODES_value, PDO_SQLITE_ATTR_EXTENDED_RESULT_CODES); - zend_string *const_ATTR_EXTENDED_RESULT_CODES_name = zend_string_init_interned("ATTR_EXTENDED_RESULT_CODES", sizeof("ATTR_EXTENDED_RESULT_CODES") - 1, 1); + zend_string *const_ATTR_EXTENDED_RESULT_CODES_name = zend_string_init_interned("ATTR_EXTENDED_RESULT_CODES", sizeof("ATTR_EXTENDED_RESULT_CODES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_EXTENDED_RESULT_CODES_name, &const_ATTR_EXTENDED_RESULT_CODES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_EXTENDED_RESULT_CODES_name); + zend_string_release_ex(const_ATTR_EXTENDED_RESULT_CODES_name, true); zval const_ATTR_BUSY_STATEMENT_value; ZVAL_LONG(&const_ATTR_BUSY_STATEMENT_value, PDO_SQLITE_ATTR_BUSY_STATEMENT); - zend_string *const_ATTR_BUSY_STATEMENT_name = zend_string_init_interned("ATTR_BUSY_STATEMENT", sizeof("ATTR_BUSY_STATEMENT") - 1, 1); + zend_string *const_ATTR_BUSY_STATEMENT_name = zend_string_init_interned("ATTR_BUSY_STATEMENT", sizeof("ATTR_BUSY_STATEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_BUSY_STATEMENT_name, &const_ATTR_BUSY_STATEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_BUSY_STATEMENT_name); + zend_string_release_ex(const_ATTR_BUSY_STATEMENT_name, true); zval const_ATTR_EXPLAIN_STATEMENT_value; ZVAL_LONG(&const_ATTR_EXPLAIN_STATEMENT_value, PDO_SQLITE_ATTR_EXPLAIN_STATEMENT); - zend_string *const_ATTR_EXPLAIN_STATEMENT_name = zend_string_init_interned("ATTR_EXPLAIN_STATEMENT", sizeof("ATTR_EXPLAIN_STATEMENT") - 1, 1); + zend_string *const_ATTR_EXPLAIN_STATEMENT_name = zend_string_init_interned("ATTR_EXPLAIN_STATEMENT", sizeof("ATTR_EXPLAIN_STATEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_EXPLAIN_STATEMENT_name, &const_ATTR_EXPLAIN_STATEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_EXPLAIN_STATEMENT_name); + zend_string_release_ex(const_ATTR_EXPLAIN_STATEMENT_name, true); zval const_ATTR_TRANSACTION_MODE_value; ZVAL_LONG(&const_ATTR_TRANSACTION_MODE_value, PDO_SQLITE_ATTR_TRANSACTION_MODE); - zend_string *const_ATTR_TRANSACTION_MODE_name = zend_string_init_interned("ATTR_TRANSACTION_MODE", sizeof("ATTR_TRANSACTION_MODE") - 1, 1); + zend_string *const_ATTR_TRANSACTION_MODE_name = zend_string_init_interned("ATTR_TRANSACTION_MODE", sizeof("ATTR_TRANSACTION_MODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTR_TRANSACTION_MODE_name, &const_ATTR_TRANSACTION_MODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTR_TRANSACTION_MODE_name); + zend_string_release_ex(const_ATTR_TRANSACTION_MODE_name, true); zval const_TRANSACTION_MODE_DEFERRED_value; ZVAL_LONG(&const_TRANSACTION_MODE_DEFERRED_value, 0); - zend_string *const_TRANSACTION_MODE_DEFERRED_name = zend_string_init_interned("TRANSACTION_MODE_DEFERRED", sizeof("TRANSACTION_MODE_DEFERRED") - 1, 1); + zend_string *const_TRANSACTION_MODE_DEFERRED_name = zend_string_init_interned("TRANSACTION_MODE_DEFERRED", sizeof("TRANSACTION_MODE_DEFERRED") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRANSACTION_MODE_DEFERRED_name, &const_TRANSACTION_MODE_DEFERRED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_MODE_DEFERRED_name); + zend_string_release_ex(const_TRANSACTION_MODE_DEFERRED_name, true); zval const_TRANSACTION_MODE_IMMEDIATE_value; ZVAL_LONG(&const_TRANSACTION_MODE_IMMEDIATE_value, 1); - zend_string *const_TRANSACTION_MODE_IMMEDIATE_name = zend_string_init_interned("TRANSACTION_MODE_IMMEDIATE", sizeof("TRANSACTION_MODE_IMMEDIATE") - 1, 1); + zend_string *const_TRANSACTION_MODE_IMMEDIATE_name = zend_string_init_interned("TRANSACTION_MODE_IMMEDIATE", sizeof("TRANSACTION_MODE_IMMEDIATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRANSACTION_MODE_IMMEDIATE_name, &const_TRANSACTION_MODE_IMMEDIATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_MODE_IMMEDIATE_name); + zend_string_release_ex(const_TRANSACTION_MODE_IMMEDIATE_name, true); zval const_TRANSACTION_MODE_EXCLUSIVE_value; ZVAL_LONG(&const_TRANSACTION_MODE_EXCLUSIVE_value, 2); - zend_string *const_TRANSACTION_MODE_EXCLUSIVE_name = zend_string_init_interned("TRANSACTION_MODE_EXCLUSIVE", sizeof("TRANSACTION_MODE_EXCLUSIVE") - 1, 1); + zend_string *const_TRANSACTION_MODE_EXCLUSIVE_name = zend_string_init_interned("TRANSACTION_MODE_EXCLUSIVE", sizeof("TRANSACTION_MODE_EXCLUSIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRANSACTION_MODE_EXCLUSIVE_name, &const_TRANSACTION_MODE_EXCLUSIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_MODE_EXCLUSIVE_name); + zend_string_release_ex(const_TRANSACTION_MODE_EXCLUSIVE_name, true); #if SQLITE_VERSION_NUMBER >= 3043000 zval const_EXPLAIN_MODE_PREPARED_value; ZVAL_LONG(&const_EXPLAIN_MODE_PREPARED_value, 0); - zend_string *const_EXPLAIN_MODE_PREPARED_name = zend_string_init_interned("EXPLAIN_MODE_PREPARED", sizeof("EXPLAIN_MODE_PREPARED") - 1, 1); + zend_string *const_EXPLAIN_MODE_PREPARED_name = zend_string_init_interned("EXPLAIN_MODE_PREPARED", sizeof("EXPLAIN_MODE_PREPARED") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_PREPARED_name, &const_EXPLAIN_MODE_PREPARED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_PREPARED_name); + zend_string_release_ex(const_EXPLAIN_MODE_PREPARED_name, true); zval const_EXPLAIN_MODE_EXPLAIN_value; ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_value, 1); - zend_string *const_EXPLAIN_MODE_EXPLAIN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN", sizeof("EXPLAIN_MODE_EXPLAIN") - 1, 1); + zend_string *const_EXPLAIN_MODE_EXPLAIN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN", sizeof("EXPLAIN_MODE_EXPLAIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_name, &const_EXPLAIN_MODE_EXPLAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_EXPLAIN_name); + zend_string_release_ex(const_EXPLAIN_MODE_EXPLAIN_name, true); zval const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value; ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, 2); - zend_string *const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN", sizeof("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN") - 1, 1); + zend_string *const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN", sizeof("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name, &const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name); + zend_string_release_ex(const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name, true); #endif zval const_OK_value; ZVAL_LONG(&const_OK_value, SQLITE_OK); - zend_string *const_OK_name = zend_string_init_interned("OK", sizeof("OK") - 1, 1); + zend_string *const_OK_name = zend_string_init_interned("OK", sizeof("OK") - 1, true); zend_declare_typed_class_constant(class_entry, const_OK_name, &const_OK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OK_name); + zend_string_release_ex(const_OK_name, true); zval const_DENY_value; ZVAL_LONG(&const_DENY_value, SQLITE_DENY); - zend_string *const_DENY_name = zend_string_init_interned("DENY", sizeof("DENY") - 1, 1); + zend_string *const_DENY_name = zend_string_init_interned("DENY", sizeof("DENY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DENY_name, &const_DENY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DENY_name); + zend_string_release_ex(const_DENY_name, true); zval const_IGNORE_value; ZVAL_LONG(&const_IGNORE_value, SQLITE_IGNORE); - zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, 1); + zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IGNORE_name, &const_IGNORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IGNORE_name); + zend_string_release_ex(const_IGNORE_name, true); return class_entry; } diff --git a/ext/phar/phar_object_arginfo.h b/ext/phar/phar_object_arginfo.h index e6c5ac75e9e7a..c77876fc3647f 100644 --- a/ext/phar/phar_object_arginfo.h +++ b/ext/phar/phar_object_arginfo.h @@ -624,99 +624,99 @@ static zend_class_entry *register_class_Phar(zend_class_entry *class_entry_Recur zval const_BZ2_value; ZVAL_LONG(&const_BZ2_value, PHAR_ENT_COMPRESSED_BZ2); - zend_string *const_BZ2_name = zend_string_init_interned("BZ2", sizeof("BZ2") - 1, 1); + zend_string *const_BZ2_name = zend_string_init_interned("BZ2", sizeof("BZ2") - 1, true); zend_declare_typed_class_constant(class_entry, const_BZ2_name, &const_BZ2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BZ2_name); + zend_string_release_ex(const_BZ2_name, true); zval const_GZ_value; ZVAL_LONG(&const_GZ_value, PHAR_ENT_COMPRESSED_GZ); - zend_string *const_GZ_name = zend_string_init_interned("GZ", sizeof("GZ") - 1, 1); + zend_string *const_GZ_name = zend_string_init_interned("GZ", sizeof("GZ") - 1, true); zend_declare_typed_class_constant(class_entry, const_GZ_name, &const_GZ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GZ_name); + zend_string_release_ex(const_GZ_name, true); zval const_NONE_value; ZVAL_LONG(&const_NONE_value, PHAR_ENT_COMPRESSED_NONE); - zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, 1); + zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NONE_name, &const_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NONE_name); + zend_string_release_ex(const_NONE_name, true); zval const_PHAR_value; ZVAL_LONG(&const_PHAR_value, PHAR_FORMAT_PHAR); - zend_string *const_PHAR_name = zend_string_init_interned("PHAR", sizeof("PHAR") - 1, 1); + zend_string *const_PHAR_name = zend_string_init_interned("PHAR", sizeof("PHAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_PHAR_name, &const_PHAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PHAR_name); + zend_string_release_ex(const_PHAR_name, true); zval const_TAR_value; ZVAL_LONG(&const_TAR_value, PHAR_FORMAT_TAR); - zend_string *const_TAR_name = zend_string_init_interned("TAR", sizeof("TAR") - 1, 1); + zend_string *const_TAR_name = zend_string_init_interned("TAR", sizeof("TAR") - 1, true); zend_declare_typed_class_constant(class_entry, const_TAR_name, &const_TAR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TAR_name); + zend_string_release_ex(const_TAR_name, true); zval const_ZIP_value; ZVAL_LONG(&const_ZIP_value, PHAR_FORMAT_ZIP); - zend_string *const_ZIP_name = zend_string_init_interned("ZIP", sizeof("ZIP") - 1, 1); + zend_string *const_ZIP_name = zend_string_init_interned("ZIP", sizeof("ZIP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ZIP_name, &const_ZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ZIP_name); + zend_string_release_ex(const_ZIP_name, true); zval const_COMPRESSED_value; ZVAL_LONG(&const_COMPRESSED_value, PHAR_ENT_COMPRESSION_MASK); - zend_string *const_COMPRESSED_name = zend_string_init_interned("COMPRESSED", sizeof("COMPRESSED") - 1, 1); + zend_string *const_COMPRESSED_name = zend_string_init_interned("COMPRESSED", sizeof("COMPRESSED") - 1, true); zend_declare_typed_class_constant(class_entry, const_COMPRESSED_name, &const_COMPRESSED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COMPRESSED_name); + zend_string_release_ex(const_COMPRESSED_name, true); zval const_PHP_value; ZVAL_LONG(&const_PHP_value, PHAR_MIME_PHP); - zend_string *const_PHP_name = zend_string_init_interned("PHP", sizeof("PHP") - 1, 1); + zend_string *const_PHP_name = zend_string_init_interned("PHP", sizeof("PHP") - 1, true); zend_declare_typed_class_constant(class_entry, const_PHP_name, &const_PHP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PHP_name); + zend_string_release_ex(const_PHP_name, true); zval const_PHPS_value; ZVAL_LONG(&const_PHPS_value, PHAR_MIME_PHPS); - zend_string *const_PHPS_name = zend_string_init_interned("PHPS", sizeof("PHPS") - 1, 1); + zend_string *const_PHPS_name = zend_string_init_interned("PHPS", sizeof("PHPS") - 1, true); zend_declare_typed_class_constant(class_entry, const_PHPS_name, &const_PHPS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PHPS_name); + zend_string_release_ex(const_PHPS_name, true); zval const_MD5_value; ZVAL_LONG(&const_MD5_value, PHAR_SIG_MD5); - zend_string *const_MD5_name = zend_string_init_interned("MD5", sizeof("MD5") - 1, 1); + zend_string *const_MD5_name = zend_string_init_interned("MD5", sizeof("MD5") - 1, true); zend_declare_typed_class_constant(class_entry, const_MD5_name, &const_MD5_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MD5_name); + zend_string_release_ex(const_MD5_name, true); zval const_OPENSSL_value; ZVAL_LONG(&const_OPENSSL_value, PHAR_SIG_OPENSSL); - zend_string *const_OPENSSL_name = zend_string_init_interned("OPENSSL", sizeof("OPENSSL") - 1, 1); + zend_string *const_OPENSSL_name = zend_string_init_interned("OPENSSL", sizeof("OPENSSL") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPENSSL_name, &const_OPENSSL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPENSSL_name); + zend_string_release_ex(const_OPENSSL_name, true); zval const_OPENSSL_SHA256_value; ZVAL_LONG(&const_OPENSSL_SHA256_value, PHAR_SIG_OPENSSL_SHA256); - zend_string *const_OPENSSL_SHA256_name = zend_string_init_interned("OPENSSL_SHA256", sizeof("OPENSSL_SHA256") - 1, 1); + zend_string *const_OPENSSL_SHA256_name = zend_string_init_interned("OPENSSL_SHA256", sizeof("OPENSSL_SHA256") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPENSSL_SHA256_name, &const_OPENSSL_SHA256_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPENSSL_SHA256_name); + zend_string_release_ex(const_OPENSSL_SHA256_name, true); zval const_OPENSSL_SHA512_value; ZVAL_LONG(&const_OPENSSL_SHA512_value, PHAR_SIG_OPENSSL_SHA512); - zend_string *const_OPENSSL_SHA512_name = zend_string_init_interned("OPENSSL_SHA512", sizeof("OPENSSL_SHA512") - 1, 1); + zend_string *const_OPENSSL_SHA512_name = zend_string_init_interned("OPENSSL_SHA512", sizeof("OPENSSL_SHA512") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPENSSL_SHA512_name, &const_OPENSSL_SHA512_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPENSSL_SHA512_name); + zend_string_release_ex(const_OPENSSL_SHA512_name, true); zval const_SHA1_value; ZVAL_LONG(&const_SHA1_value, PHAR_SIG_SHA1); - zend_string *const_SHA1_name = zend_string_init_interned("SHA1", sizeof("SHA1") - 1, 1); + zend_string *const_SHA1_name = zend_string_init_interned("SHA1", sizeof("SHA1") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHA1_name, &const_SHA1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHA1_name); + zend_string_release_ex(const_SHA1_name, true); zval const_SHA256_value; ZVAL_LONG(&const_SHA256_value, PHAR_SIG_SHA256); - zend_string *const_SHA256_name = zend_string_init_interned("SHA256", sizeof("SHA256") - 1, 1); + zend_string *const_SHA256_name = zend_string_init_interned("SHA256", sizeof("SHA256") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHA256_name, &const_SHA256_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHA256_name); + zend_string_release_ex(const_SHA256_name, true); zval const_SHA512_value; ZVAL_LONG(&const_SHA512_value, PHAR_SIG_SHA512); - zend_string *const_SHA512_name = zend_string_init_interned("SHA512", sizeof("SHA512") - 1, 1); + zend_string *const_SHA512_name = zend_string_init_interned("SHA512", sizeof("SHA512") - 1, true); zend_declare_typed_class_constant(class_entry, const_SHA512_name, &const_SHA512_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SHA512_name); + zend_string_release_ex(const_SHA512_name, true); return class_entry; } diff --git a/ext/random/random_arginfo.h b/ext/random/random_arginfo.h index ec22af1bd2b11..94c024b122369 100644 --- a/ext/random/random_arginfo.h +++ b/ext/random/random_arginfo.h @@ -318,10 +318,10 @@ static zend_class_entry *register_class_Random_Randomizer(void) zval property_engine_default_value; ZVAL_UNDEF(&property_engine_default_value); - zend_string *property_engine_name = zend_string_init("engine", sizeof("engine") - 1, 1); + zend_string *property_engine_name = zend_string_init("engine", sizeof("engine") - 1, true); zend_string *property_engine_class_Random_Engine = zend_string_init("Random\\Engine", sizeof("Random\\Engine")-1, 1); zend_declare_typed_property(class_entry, property_engine_name, &property_engine_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_engine_class_Random_Engine, 0, 0)); - zend_string_release(property_engine_name); + zend_string_release_ex(property_engine_name, true); return class_entry; } diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index 6465c659c733b..d1f1ffed0cfb6 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1421,9 +1421,9 @@ static zend_class_entry *register_class_ReflectionFunction(zend_class_entry *cla zval const_IS_DEPRECATED_value; ZVAL_LONG(&const_IS_DEPRECATED_value, ZEND_ACC_DEPRECATED); - zend_string *const_IS_DEPRECATED_name = zend_string_init_interned("IS_DEPRECATED", sizeof("IS_DEPRECATED") - 1, 1); + zend_string *const_IS_DEPRECATED_name = zend_string_init_interned("IS_DEPRECATED", sizeof("IS_DEPRECATED") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_DEPRECATED_name, &const_IS_DEPRECATED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_DEPRECATED_name); + zend_string_release_ex(const_IS_DEPRECATED_name, true); zend_attribute *attribute_Deprecated_func_isdisabled_0 = zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "isdisabled", sizeof("isdisabled") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2); @@ -1455,39 +1455,39 @@ static zend_class_entry *register_class_ReflectionMethod(zend_class_entry *class zval const_IS_STATIC_value; ZVAL_LONG(&const_IS_STATIC_value, ZEND_ACC_STATIC); - zend_string *const_IS_STATIC_name = zend_string_init_interned("IS_STATIC", sizeof("IS_STATIC") - 1, 1); + zend_string *const_IS_STATIC_name = zend_string_init_interned("IS_STATIC", sizeof("IS_STATIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_STATIC_name, &const_IS_STATIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_STATIC_name); + zend_string_release_ex(const_IS_STATIC_name, true); zval const_IS_PUBLIC_value; ZVAL_LONG(&const_IS_PUBLIC_value, ZEND_ACC_PUBLIC); - zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, 1); + zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PUBLIC_name, &const_IS_PUBLIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PUBLIC_name); + zend_string_release_ex(const_IS_PUBLIC_name, true); zval const_IS_PROTECTED_value; ZVAL_LONG(&const_IS_PROTECTED_value, ZEND_ACC_PROTECTED); - zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, 1); + zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PROTECTED_name, &const_IS_PROTECTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PROTECTED_name); + zend_string_release_ex(const_IS_PROTECTED_name, true); zval const_IS_PRIVATE_value; ZVAL_LONG(&const_IS_PRIVATE_value, ZEND_ACC_PRIVATE); - zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, 1); + zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PRIVATE_name, &const_IS_PRIVATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PRIVATE_name); + zend_string_release_ex(const_IS_PRIVATE_name, true); zval const_IS_ABSTRACT_value; ZVAL_LONG(&const_IS_ABSTRACT_value, ZEND_ACC_ABSTRACT); - zend_string *const_IS_ABSTRACT_name = zend_string_init_interned("IS_ABSTRACT", sizeof("IS_ABSTRACT") - 1, 1); + zend_string *const_IS_ABSTRACT_name = zend_string_init_interned("IS_ABSTRACT", sizeof("IS_ABSTRACT") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_ABSTRACT_name, &const_IS_ABSTRACT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_ABSTRACT_name); + zend_string_release_ex(const_IS_ABSTRACT_name, true); zval const_IS_FINAL_value; ZVAL_LONG(&const_IS_FINAL_value, ZEND_ACC_FINAL); - zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, 1); + zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_FINAL_name, &const_IS_FINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_FINAL_name); + zend_string_release_ex(const_IS_FINAL_name, true); zval property_class_default_value; ZVAL_UNDEF(&property_class_default_value); @@ -1514,39 +1514,39 @@ static zend_class_entry *register_class_ReflectionClass(zend_class_entry *class_ zval const_IS_IMPLICIT_ABSTRACT_value; ZVAL_LONG(&const_IS_IMPLICIT_ABSTRACT_value, ZEND_ACC_IMPLICIT_ABSTRACT_CLASS); - zend_string *const_IS_IMPLICIT_ABSTRACT_name = zend_string_init_interned("IS_IMPLICIT_ABSTRACT", sizeof("IS_IMPLICIT_ABSTRACT") - 1, 1); + zend_string *const_IS_IMPLICIT_ABSTRACT_name = zend_string_init_interned("IS_IMPLICIT_ABSTRACT", sizeof("IS_IMPLICIT_ABSTRACT") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_IMPLICIT_ABSTRACT_name, &const_IS_IMPLICIT_ABSTRACT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_IMPLICIT_ABSTRACT_name); + zend_string_release_ex(const_IS_IMPLICIT_ABSTRACT_name, true); zval const_IS_EXPLICIT_ABSTRACT_value; ZVAL_LONG(&const_IS_EXPLICIT_ABSTRACT_value, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - zend_string *const_IS_EXPLICIT_ABSTRACT_name = zend_string_init_interned("IS_EXPLICIT_ABSTRACT", sizeof("IS_EXPLICIT_ABSTRACT") - 1, 1); + zend_string *const_IS_EXPLICIT_ABSTRACT_name = zend_string_init_interned("IS_EXPLICIT_ABSTRACT", sizeof("IS_EXPLICIT_ABSTRACT") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_EXPLICIT_ABSTRACT_name, &const_IS_EXPLICIT_ABSTRACT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_EXPLICIT_ABSTRACT_name); + zend_string_release_ex(const_IS_EXPLICIT_ABSTRACT_name, true); zval const_IS_FINAL_value; ZVAL_LONG(&const_IS_FINAL_value, ZEND_ACC_FINAL); - zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, 1); + zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_FINAL_name, &const_IS_FINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_FINAL_name); + zend_string_release_ex(const_IS_FINAL_name, true); zval const_IS_READONLY_value; ZVAL_LONG(&const_IS_READONLY_value, ZEND_ACC_READONLY_CLASS); - zend_string *const_IS_READONLY_name = zend_string_init_interned("IS_READONLY", sizeof("IS_READONLY") - 1, 1); + zend_string *const_IS_READONLY_name = zend_string_init_interned("IS_READONLY", sizeof("IS_READONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_READONLY_name, &const_IS_READONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_READONLY_name); + zend_string_release_ex(const_IS_READONLY_name, true); zval const_SKIP_INITIALIZATION_ON_SERIALIZE_value; ZVAL_LONG(&const_SKIP_INITIALIZATION_ON_SERIALIZE_value, ZEND_LAZY_OBJECT_SKIP_INITIALIZATION_ON_SERIALIZE); - zend_string *const_SKIP_INITIALIZATION_ON_SERIALIZE_name = zend_string_init_interned("SKIP_INITIALIZATION_ON_SERIALIZE", sizeof("SKIP_INITIALIZATION_ON_SERIALIZE") - 1, 1); + zend_string *const_SKIP_INITIALIZATION_ON_SERIALIZE_name = zend_string_init_interned("SKIP_INITIALIZATION_ON_SERIALIZE", sizeof("SKIP_INITIALIZATION_ON_SERIALIZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SKIP_INITIALIZATION_ON_SERIALIZE_name, &const_SKIP_INITIALIZATION_ON_SERIALIZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SKIP_INITIALIZATION_ON_SERIALIZE_name); + zend_string_release_ex(const_SKIP_INITIALIZATION_ON_SERIALIZE_name, true); zval const_SKIP_DESTRUCTOR_value; ZVAL_LONG(&const_SKIP_DESTRUCTOR_value, ZEND_LAZY_OBJECT_SKIP_DESTRUCTOR); - zend_string *const_SKIP_DESTRUCTOR_name = zend_string_init_interned("SKIP_DESTRUCTOR", sizeof("SKIP_DESTRUCTOR") - 1, 1); + zend_string *const_SKIP_DESTRUCTOR_name = zend_string_init_interned("SKIP_DESTRUCTOR", sizeof("SKIP_DESTRUCTOR") - 1, true); zend_declare_typed_class_constant(class_entry, const_SKIP_DESTRUCTOR_name, &const_SKIP_DESTRUCTOR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SKIP_DESTRUCTOR_name); + zend_string_release_ex(const_SKIP_DESTRUCTOR_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -1592,63 +1592,63 @@ static zend_class_entry *register_class_ReflectionProperty(zend_class_entry *cla zval const_IS_STATIC_value; ZVAL_LONG(&const_IS_STATIC_value, ZEND_ACC_STATIC); - zend_string *const_IS_STATIC_name = zend_string_init_interned("IS_STATIC", sizeof("IS_STATIC") - 1, 1); + zend_string *const_IS_STATIC_name = zend_string_init_interned("IS_STATIC", sizeof("IS_STATIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_STATIC_name, &const_IS_STATIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_STATIC_name); + zend_string_release_ex(const_IS_STATIC_name, true); zval const_IS_READONLY_value; ZVAL_LONG(&const_IS_READONLY_value, ZEND_ACC_READONLY); - zend_string *const_IS_READONLY_name = zend_string_init_interned("IS_READONLY", sizeof("IS_READONLY") - 1, 1); + zend_string *const_IS_READONLY_name = zend_string_init_interned("IS_READONLY", sizeof("IS_READONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_READONLY_name, &const_IS_READONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_READONLY_name); + zend_string_release_ex(const_IS_READONLY_name, true); zval const_IS_PUBLIC_value; ZVAL_LONG(&const_IS_PUBLIC_value, ZEND_ACC_PUBLIC); - zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, 1); + zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PUBLIC_name, &const_IS_PUBLIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PUBLIC_name); + zend_string_release_ex(const_IS_PUBLIC_name, true); zval const_IS_PROTECTED_value; ZVAL_LONG(&const_IS_PROTECTED_value, ZEND_ACC_PROTECTED); - zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, 1); + zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PROTECTED_name, &const_IS_PROTECTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PROTECTED_name); + zend_string_release_ex(const_IS_PROTECTED_name, true); zval const_IS_PRIVATE_value; ZVAL_LONG(&const_IS_PRIVATE_value, ZEND_ACC_PRIVATE); - zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, 1); + zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PRIVATE_name, &const_IS_PRIVATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PRIVATE_name); + zend_string_release_ex(const_IS_PRIVATE_name, true); zval const_IS_ABSTRACT_value; ZVAL_LONG(&const_IS_ABSTRACT_value, ZEND_ACC_ABSTRACT); - zend_string *const_IS_ABSTRACT_name = zend_string_init_interned("IS_ABSTRACT", sizeof("IS_ABSTRACT") - 1, 1); + zend_string *const_IS_ABSTRACT_name = zend_string_init_interned("IS_ABSTRACT", sizeof("IS_ABSTRACT") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_ABSTRACT_name, &const_IS_ABSTRACT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_ABSTRACT_name); + zend_string_release_ex(const_IS_ABSTRACT_name, true); zval const_IS_PROTECTED_SET_value; ZVAL_LONG(&const_IS_PROTECTED_SET_value, ZEND_ACC_PROTECTED_SET); - zend_string *const_IS_PROTECTED_SET_name = zend_string_init_interned("IS_PROTECTED_SET", sizeof("IS_PROTECTED_SET") - 1, 1); + zend_string *const_IS_PROTECTED_SET_name = zend_string_init_interned("IS_PROTECTED_SET", sizeof("IS_PROTECTED_SET") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PROTECTED_SET_name, &const_IS_PROTECTED_SET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PROTECTED_SET_name); + zend_string_release_ex(const_IS_PROTECTED_SET_name, true); zval const_IS_PRIVATE_SET_value; ZVAL_LONG(&const_IS_PRIVATE_SET_value, ZEND_ACC_PRIVATE_SET); - zend_string *const_IS_PRIVATE_SET_name = zend_string_init_interned("IS_PRIVATE_SET", sizeof("IS_PRIVATE_SET") - 1, 1); + zend_string *const_IS_PRIVATE_SET_name = zend_string_init_interned("IS_PRIVATE_SET", sizeof("IS_PRIVATE_SET") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PRIVATE_SET_name, &const_IS_PRIVATE_SET_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PRIVATE_SET_name); + zend_string_release_ex(const_IS_PRIVATE_SET_name, true); zval const_IS_VIRTUAL_value; ZVAL_LONG(&const_IS_VIRTUAL_value, ZEND_ACC_VIRTUAL); - zend_string *const_IS_VIRTUAL_name = zend_string_init_interned("IS_VIRTUAL", sizeof("IS_VIRTUAL") - 1, 1); + zend_string *const_IS_VIRTUAL_name = zend_string_init_interned("IS_VIRTUAL", sizeof("IS_VIRTUAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_VIRTUAL_name, &const_IS_VIRTUAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_VIRTUAL_name); + zend_string_release_ex(const_IS_VIRTUAL_name, true); zval const_IS_FINAL_value; ZVAL_LONG(&const_IS_FINAL_value, ZEND_ACC_FINAL); - zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, 1); + zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_FINAL_name, &const_IS_FINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_FINAL_name); + zend_string_release_ex(const_IS_FINAL_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -1679,27 +1679,27 @@ static zend_class_entry *register_class_ReflectionClassConstant(zend_class_entry zval const_IS_PUBLIC_value; ZVAL_LONG(&const_IS_PUBLIC_value, ZEND_ACC_PUBLIC); - zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, 1); + zend_string *const_IS_PUBLIC_name = zend_string_init_interned("IS_PUBLIC", sizeof("IS_PUBLIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PUBLIC_name, &const_IS_PUBLIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PUBLIC_name); + zend_string_release_ex(const_IS_PUBLIC_name, true); zval const_IS_PROTECTED_value; ZVAL_LONG(&const_IS_PROTECTED_value, ZEND_ACC_PROTECTED); - zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, 1); + zend_string *const_IS_PROTECTED_name = zend_string_init_interned("IS_PROTECTED", sizeof("IS_PROTECTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PROTECTED_name, &const_IS_PROTECTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PROTECTED_name); + zend_string_release_ex(const_IS_PROTECTED_name, true); zval const_IS_PRIVATE_value; ZVAL_LONG(&const_IS_PRIVATE_value, ZEND_ACC_PRIVATE); - zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, 1); + zend_string *const_IS_PRIVATE_name = zend_string_init_interned("IS_PRIVATE", sizeof("IS_PRIVATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_PRIVATE_name, &const_IS_PRIVATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_PRIVATE_name); + zend_string_release_ex(const_IS_PRIVATE_name, true); zval const_IS_FINAL_value; ZVAL_LONG(&const_IS_FINAL_value, ZEND_ACC_FINAL); - zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, 1); + zend_string *const_IS_FINAL_name = zend_string_init_interned("IS_FINAL", sizeof("IS_FINAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_FINAL_name, &const_IS_FINAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_FINAL_name); + zend_string_release_ex(const_IS_FINAL_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -1838,9 +1838,9 @@ static zend_class_entry *register_class_ReflectionAttribute(zend_class_entry *cl zval const_IS_INSTANCEOF_value; ZVAL_LONG(&const_IS_INSTANCEOF_value, REFLECTION_ATTRIBUTE_IS_INSTANCEOF); - zend_string *const_IS_INSTANCEOF_name = zend_string_init_interned("IS_INSTANCEOF", sizeof("IS_INSTANCEOF") - 1, 1); + zend_string *const_IS_INSTANCEOF_name = zend_string_init_interned("IS_INSTANCEOF", sizeof("IS_INSTANCEOF") - 1, true); zend_declare_typed_class_constant(class_entry, const_IS_INSTANCEOF_name, &const_IS_INSTANCEOF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IS_INSTANCEOF_name); + zend_string_release_ex(const_IS_INSTANCEOF_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); diff --git a/ext/snmp/snmp_arginfo.h b/ext/snmp/snmp_arginfo.h index 18ed9c7356634..dd0fdee92969d 100644 --- a/ext/snmp/snmp_arginfo.h +++ b/ext/snmp/snmp_arginfo.h @@ -270,123 +270,123 @@ static zend_class_entry *register_class_SNMP(void) zval const_VERSION_1_value; ZVAL_LONG(&const_VERSION_1_value, SNMP_VERSION_1); - zend_string *const_VERSION_1_name = zend_string_init_interned("VERSION_1", sizeof("VERSION_1") - 1, 1); + zend_string *const_VERSION_1_name = zend_string_init_interned("VERSION_1", sizeof("VERSION_1") - 1, true); zend_declare_typed_class_constant(class_entry, const_VERSION_1_name, &const_VERSION_1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VERSION_1_name); + zend_string_release_ex(const_VERSION_1_name, true); zval const_VERSION_2c_value; ZVAL_LONG(&const_VERSION_2c_value, SNMP_VERSION_2c); - zend_string *const_VERSION_2c_name = zend_string_init_interned("VERSION_2c", sizeof("VERSION_2c") - 1, 1); + zend_string *const_VERSION_2c_name = zend_string_init_interned("VERSION_2c", sizeof("VERSION_2c") - 1, true); zend_declare_typed_class_constant(class_entry, const_VERSION_2c_name, &const_VERSION_2c_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VERSION_2c_name); + zend_string_release_ex(const_VERSION_2c_name, true); zval const_VERSION_2C_value; ZVAL_LONG(&const_VERSION_2C_value, SNMP_VERSION_2c); - zend_string *const_VERSION_2C_name = zend_string_init_interned("VERSION_2C", sizeof("VERSION_2C") - 1, 1); + zend_string *const_VERSION_2C_name = zend_string_init_interned("VERSION_2C", sizeof("VERSION_2C") - 1, true); zend_declare_typed_class_constant(class_entry, const_VERSION_2C_name, &const_VERSION_2C_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VERSION_2C_name); + zend_string_release_ex(const_VERSION_2C_name, true); zval const_VERSION_3_value; ZVAL_LONG(&const_VERSION_3_value, SNMP_VERSION_3); - zend_string *const_VERSION_3_name = zend_string_init_interned("VERSION_3", sizeof("VERSION_3") - 1, 1); + zend_string *const_VERSION_3_name = zend_string_init_interned("VERSION_3", sizeof("VERSION_3") - 1, true); zend_declare_typed_class_constant(class_entry, const_VERSION_3_name, &const_VERSION_3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VERSION_3_name); + zend_string_release_ex(const_VERSION_3_name, true); zval const_ERRNO_NOERROR_value; ZVAL_LONG(&const_ERRNO_NOERROR_value, PHP_SNMP_ERRNO_NOERROR); - zend_string *const_ERRNO_NOERROR_name = zend_string_init_interned("ERRNO_NOERROR", sizeof("ERRNO_NOERROR") - 1, 1); + zend_string *const_ERRNO_NOERROR_name = zend_string_init_interned("ERRNO_NOERROR", sizeof("ERRNO_NOERROR") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_NOERROR_name, &const_ERRNO_NOERROR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_NOERROR_name); + zend_string_release_ex(const_ERRNO_NOERROR_name, true); zval const_ERRNO_ANY_value; ZVAL_LONG(&const_ERRNO_ANY_value, PHP_SNMP_ERRNO_ANY); - zend_string *const_ERRNO_ANY_name = zend_string_init_interned("ERRNO_ANY", sizeof("ERRNO_ANY") - 1, 1); + zend_string *const_ERRNO_ANY_name = zend_string_init_interned("ERRNO_ANY", sizeof("ERRNO_ANY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_ANY_name, &const_ERRNO_ANY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_ANY_name); + zend_string_release_ex(const_ERRNO_ANY_name, true); zval const_ERRNO_GENERIC_value; ZVAL_LONG(&const_ERRNO_GENERIC_value, PHP_SNMP_ERRNO_GENERIC); - zend_string *const_ERRNO_GENERIC_name = zend_string_init_interned("ERRNO_GENERIC", sizeof("ERRNO_GENERIC") - 1, 1); + zend_string *const_ERRNO_GENERIC_name = zend_string_init_interned("ERRNO_GENERIC", sizeof("ERRNO_GENERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_GENERIC_name, &const_ERRNO_GENERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_GENERIC_name); + zend_string_release_ex(const_ERRNO_GENERIC_name, true); zval const_ERRNO_TIMEOUT_value; ZVAL_LONG(&const_ERRNO_TIMEOUT_value, PHP_SNMP_ERRNO_TIMEOUT); - zend_string *const_ERRNO_TIMEOUT_name = zend_string_init_interned("ERRNO_TIMEOUT", sizeof("ERRNO_TIMEOUT") - 1, 1); + zend_string *const_ERRNO_TIMEOUT_name = zend_string_init_interned("ERRNO_TIMEOUT", sizeof("ERRNO_TIMEOUT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_TIMEOUT_name, &const_ERRNO_TIMEOUT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_TIMEOUT_name); + zend_string_release_ex(const_ERRNO_TIMEOUT_name, true); zval const_ERRNO_ERROR_IN_REPLY_value; ZVAL_LONG(&const_ERRNO_ERROR_IN_REPLY_value, PHP_SNMP_ERRNO_ERROR_IN_REPLY); - zend_string *const_ERRNO_ERROR_IN_REPLY_name = zend_string_init_interned("ERRNO_ERROR_IN_REPLY", sizeof("ERRNO_ERROR_IN_REPLY") - 1, 1); + zend_string *const_ERRNO_ERROR_IN_REPLY_name = zend_string_init_interned("ERRNO_ERROR_IN_REPLY", sizeof("ERRNO_ERROR_IN_REPLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_ERROR_IN_REPLY_name, &const_ERRNO_ERROR_IN_REPLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_ERROR_IN_REPLY_name); + zend_string_release_ex(const_ERRNO_ERROR_IN_REPLY_name, true); zval const_ERRNO_OID_NOT_INCREASING_value; ZVAL_LONG(&const_ERRNO_OID_NOT_INCREASING_value, PHP_SNMP_ERRNO_OID_NOT_INCREASING); - zend_string *const_ERRNO_OID_NOT_INCREASING_name = zend_string_init_interned("ERRNO_OID_NOT_INCREASING", sizeof("ERRNO_OID_NOT_INCREASING") - 1, 1); + zend_string *const_ERRNO_OID_NOT_INCREASING_name = zend_string_init_interned("ERRNO_OID_NOT_INCREASING", sizeof("ERRNO_OID_NOT_INCREASING") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_OID_NOT_INCREASING_name, &const_ERRNO_OID_NOT_INCREASING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_OID_NOT_INCREASING_name); + zend_string_release_ex(const_ERRNO_OID_NOT_INCREASING_name, true); zval const_ERRNO_OID_PARSING_ERROR_value; ZVAL_LONG(&const_ERRNO_OID_PARSING_ERROR_value, PHP_SNMP_ERRNO_OID_PARSING_ERROR); - zend_string *const_ERRNO_OID_PARSING_ERROR_name = zend_string_init_interned("ERRNO_OID_PARSING_ERROR", sizeof("ERRNO_OID_PARSING_ERROR") - 1, 1); + zend_string *const_ERRNO_OID_PARSING_ERROR_name = zend_string_init_interned("ERRNO_OID_PARSING_ERROR", sizeof("ERRNO_OID_PARSING_ERROR") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_OID_PARSING_ERROR_name, &const_ERRNO_OID_PARSING_ERROR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_OID_PARSING_ERROR_name); + zend_string_release_ex(const_ERRNO_OID_PARSING_ERROR_name, true); zval const_ERRNO_MULTIPLE_SET_QUERIES_value; ZVAL_LONG(&const_ERRNO_MULTIPLE_SET_QUERIES_value, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES); - zend_string *const_ERRNO_MULTIPLE_SET_QUERIES_name = zend_string_init_interned("ERRNO_MULTIPLE_SET_QUERIES", sizeof("ERRNO_MULTIPLE_SET_QUERIES") - 1, 1); + zend_string *const_ERRNO_MULTIPLE_SET_QUERIES_name = zend_string_init_interned("ERRNO_MULTIPLE_SET_QUERIES", sizeof("ERRNO_MULTIPLE_SET_QUERIES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ERRNO_MULTIPLE_SET_QUERIES_name, &const_ERRNO_MULTIPLE_SET_QUERIES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ERRNO_MULTIPLE_SET_QUERIES_name); + zend_string_release_ex(const_ERRNO_MULTIPLE_SET_QUERIES_name, true); zval property_info_default_value; ZVAL_UNDEF(&property_info_default_value); - zend_string *property_info_name = zend_string_init("info", sizeof("info") - 1, 1); + zend_string *property_info_name = zend_string_init("info", sizeof("info") - 1, true); zend_declare_typed_property(class_entry, property_info_name, &property_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property_info_name); + zend_string_release_ex(property_info_name, true); zval property_max_oids_default_value; ZVAL_UNDEF(&property_max_oids_default_value); - zend_string *property_max_oids_name = zend_string_init("max_oids", sizeof("max_oids") - 1, 1); + zend_string *property_max_oids_name = zend_string_init("max_oids", sizeof("max_oids") - 1, true); zend_declare_typed_property(class_entry, property_max_oids_name, &property_max_oids_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_max_oids_name); + zend_string_release_ex(property_max_oids_name, true); zval property_valueretrieval_default_value; ZVAL_UNDEF(&property_valueretrieval_default_value); - zend_string *property_valueretrieval_name = zend_string_init("valueretrieval", sizeof("valueretrieval") - 1, 1); + zend_string *property_valueretrieval_name = zend_string_init("valueretrieval", sizeof("valueretrieval") - 1, true); zend_declare_typed_property(class_entry, property_valueretrieval_name, &property_valueretrieval_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_valueretrieval_name); + zend_string_release_ex(property_valueretrieval_name, true); zval property_quick_print_default_value; ZVAL_UNDEF(&property_quick_print_default_value); - zend_string *property_quick_print_name = zend_string_init("quick_print", sizeof("quick_print") - 1, 1); + zend_string *property_quick_print_name = zend_string_init("quick_print", sizeof("quick_print") - 1, true); zend_declare_typed_property(class_entry, property_quick_print_name, &property_quick_print_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_quick_print_name); + zend_string_release_ex(property_quick_print_name, true); zval property_enum_print_default_value; ZVAL_UNDEF(&property_enum_print_default_value); - zend_string *property_enum_print_name = zend_string_init("enum_print", sizeof("enum_print") - 1, 1); + zend_string *property_enum_print_name = zend_string_init("enum_print", sizeof("enum_print") - 1, true); zend_declare_typed_property(class_entry, property_enum_print_name, &property_enum_print_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_enum_print_name); + zend_string_release_ex(property_enum_print_name, true); zval property_oid_output_format_default_value; ZVAL_UNDEF(&property_oid_output_format_default_value); - zend_string *property_oid_output_format_name = zend_string_init("oid_output_format", sizeof("oid_output_format") - 1, 1); + zend_string *property_oid_output_format_name = zend_string_init("oid_output_format", sizeof("oid_output_format") - 1, true); zend_declare_typed_property(class_entry, property_oid_output_format_name, &property_oid_output_format_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_oid_output_format_name); + zend_string_release_ex(property_oid_output_format_name, true); zval property_oid_increasing_check_default_value; ZVAL_UNDEF(&property_oid_increasing_check_default_value); - zend_string *property_oid_increasing_check_name = zend_string_init("oid_increasing_check", sizeof("oid_increasing_check") - 1, 1); + zend_string *property_oid_increasing_check_name = zend_string_init("oid_increasing_check", sizeof("oid_increasing_check") - 1, true); zend_declare_typed_property(class_entry, property_oid_increasing_check_name, &property_oid_increasing_check_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_oid_increasing_check_name); + zend_string_release_ex(property_oid_increasing_check_name, true); zval property_exceptions_enabled_default_value; ZVAL_UNDEF(&property_exceptions_enabled_default_value); - zend_string *property_exceptions_enabled_name = zend_string_init("exceptions_enabled", sizeof("exceptions_enabled") - 1, 1); + zend_string *property_exceptions_enabled_name = zend_string_init("exceptions_enabled", sizeof("exceptions_enabled") - 1, true); zend_declare_typed_property(class_entry, property_exceptions_enabled_name, &property_exceptions_enabled_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_exceptions_enabled_name); + zend_string_release_ex(property_exceptions_enabled_name, true); return class_entry; } diff --git a/ext/soap/soap_arginfo.h b/ext/soap/soap_arginfo.h index 155348e9e98bb..7efa15cde2f9d 100644 --- a/ext/soap/soap_arginfo.h +++ b/ext/soap/soap_arginfo.h @@ -355,15 +355,15 @@ static zend_class_entry *register_class_SoapParam(void) zval property_param_name_default_value; ZVAL_UNDEF(&property_param_name_default_value); - zend_string *property_param_name_name = zend_string_init("param_name", sizeof("param_name") - 1, 1); + zend_string *property_param_name_name = zend_string_init("param_name", sizeof("param_name") - 1, true); zend_declare_typed_property(class_entry, property_param_name_name, &property_param_name_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_param_name_name); + zend_string_release_ex(property_param_name_name, true); zval property_param_data_default_value; ZVAL_UNDEF(&property_param_data_default_value); - zend_string *property_param_data_name = zend_string_init("param_data", sizeof("param_data") - 1, 1); + zend_string *property_param_data_name = zend_string_init("param_data", sizeof("param_data") - 1, true); zend_declare_typed_property(class_entry, property_param_data_name, &property_param_data_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_param_data_name); + zend_string_release_ex(property_param_data_name, true); return class_entry; } @@ -377,9 +377,9 @@ static zend_class_entry *register_class_SoapHeader(void) zval property_namespace_default_value; ZVAL_UNDEF(&property_namespace_default_value); - zend_string *property_namespace_name = zend_string_init("namespace", sizeof("namespace") - 1, 1); + zend_string *property_namespace_name = zend_string_init("namespace", sizeof("namespace") - 1, true); zend_declare_typed_property(class_entry, property_namespace_name, &property_namespace_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_namespace_name); + zend_string_release_ex(property_namespace_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -387,21 +387,21 @@ static zend_class_entry *register_class_SoapHeader(void) zval property_data_default_value; ZVAL_NULL(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); zval property_mustUnderstand_default_value; ZVAL_UNDEF(&property_mustUnderstand_default_value); - zend_string *property_mustUnderstand_name = zend_string_init("mustUnderstand", sizeof("mustUnderstand") - 1, 1); + zend_string *property_mustUnderstand_name = zend_string_init("mustUnderstand", sizeof("mustUnderstand") - 1, true); zend_declare_typed_property(class_entry, property_mustUnderstand_name, &property_mustUnderstand_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_mustUnderstand_name); + zend_string_release_ex(property_mustUnderstand_name, true); zval property_actor_default_value; ZVAL_UNDEF(&property_actor_default_value); - zend_string *property_actor_name = zend_string_init("actor", sizeof("actor") - 1, 1); + zend_string *property_actor_name = zend_string_init("actor", sizeof("actor") - 1, true); zend_declare_typed_property(class_entry, property_actor_name, &property_actor_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_actor_name); + zend_string_release_ex(property_actor_name, true); return class_entry; } @@ -415,51 +415,51 @@ static zend_class_entry *register_class_SoapFault(zend_class_entry *class_entry_ zval property_faultstring_default_value; ZVAL_UNDEF(&property_faultstring_default_value); - zend_string *property_faultstring_name = zend_string_init("faultstring", sizeof("faultstring") - 1, 1); + zend_string *property_faultstring_name = zend_string_init("faultstring", sizeof("faultstring") - 1, true); zend_declare_typed_property(class_entry, property_faultstring_name, &property_faultstring_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_faultstring_name); + zend_string_release_ex(property_faultstring_name, true); zval property_faultcode_default_value; ZVAL_NULL(&property_faultcode_default_value); - zend_string *property_faultcode_name = zend_string_init("faultcode", sizeof("faultcode") - 1, 1); + zend_string *property_faultcode_name = zend_string_init("faultcode", sizeof("faultcode") - 1, true); zend_declare_typed_property(class_entry, property_faultcode_name, &property_faultcode_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_faultcode_name); + zend_string_release_ex(property_faultcode_name, true); zval property_faultcodens_default_value; ZVAL_NULL(&property_faultcodens_default_value); - zend_string *property_faultcodens_name = zend_string_init("faultcodens", sizeof("faultcodens") - 1, 1); + zend_string *property_faultcodens_name = zend_string_init("faultcodens", sizeof("faultcodens") - 1, true); zend_declare_typed_property(class_entry, property_faultcodens_name, &property_faultcodens_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_faultcodens_name); + zend_string_release_ex(property_faultcodens_name, true); zval property_faultactor_default_value; ZVAL_NULL(&property_faultactor_default_value); - zend_string *property_faultactor_name = zend_string_init("faultactor", sizeof("faultactor") - 1, 1); + zend_string *property_faultactor_name = zend_string_init("faultactor", sizeof("faultactor") - 1, true); zend_declare_typed_property(class_entry, property_faultactor_name, &property_faultactor_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_faultactor_name); + zend_string_release_ex(property_faultactor_name, true); zval property_detail_default_value; ZVAL_NULL(&property_detail_default_value); - zend_string *property_detail_name = zend_string_init("detail", sizeof("detail") - 1, 1); + zend_string *property_detail_name = zend_string_init("detail", sizeof("detail") - 1, true); zend_declare_typed_property(class_entry, property_detail_name, &property_detail_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_detail_name); + zend_string_release_ex(property_detail_name, true); zval property__name_default_value; ZVAL_NULL(&property__name_default_value); - zend_string *property__name_name = zend_string_init("_name", sizeof("_name") - 1, 1); + zend_string *property__name_name = zend_string_init("_name", sizeof("_name") - 1, true); zend_declare_typed_property(class_entry, property__name_name, &property__name_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__name_name); + zend_string_release_ex(property__name_name, true); zval property_headerfault_default_value; ZVAL_NULL(&property_headerfault_default_value); - zend_string *property_headerfault_name = zend_string_init("headerfault", sizeof("headerfault") - 1, 1); + zend_string *property_headerfault_name = zend_string_init("headerfault", sizeof("headerfault") - 1, true); zend_declare_typed_property(class_entry, property_headerfault_name, &property_headerfault_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_headerfault_name); + zend_string_release_ex(property_headerfault_name, true); zval property_lang_default_value; ZVAL_EMPTY_STRING(&property_lang_default_value); - zend_string *property_lang_name = zend_string_init("lang", sizeof("lang") - 1, 1); + zend_string *property_lang_name = zend_string_init("lang", sizeof("lang") - 1, true); zend_declare_typed_property(class_entry, property_lang_name, &property_lang_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_lang_name); + zend_string_release_ex(property_lang_name, true); return class_entry; } @@ -473,39 +473,39 @@ static zend_class_entry *register_class_SoapVar(void) zval property_enc_type_default_value; ZVAL_UNDEF(&property_enc_type_default_value); - zend_string *property_enc_type_name = zend_string_init("enc_type", sizeof("enc_type") - 1, 1); + zend_string *property_enc_type_name = zend_string_init("enc_type", sizeof("enc_type") - 1, true); zend_declare_typed_property(class_entry, property_enc_type_name, &property_enc_type_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_enc_type_name); + zend_string_release_ex(property_enc_type_name, true); zval property_enc_value_default_value; ZVAL_NULL(&property_enc_value_default_value); - zend_string *property_enc_value_name = zend_string_init("enc_value", sizeof("enc_value") - 1, 1); + zend_string *property_enc_value_name = zend_string_init("enc_value", sizeof("enc_value") - 1, true); zend_declare_typed_property(class_entry, property_enc_value_name, &property_enc_value_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_enc_value_name); + zend_string_release_ex(property_enc_value_name, true); zval property_enc_stype_default_value; ZVAL_NULL(&property_enc_stype_default_value); - zend_string *property_enc_stype_name = zend_string_init("enc_stype", sizeof("enc_stype") - 1, 1); + zend_string *property_enc_stype_name = zend_string_init("enc_stype", sizeof("enc_stype") - 1, true); zend_declare_typed_property(class_entry, property_enc_stype_name, &property_enc_stype_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_enc_stype_name); + zend_string_release_ex(property_enc_stype_name, true); zval property_enc_ns_default_value; ZVAL_NULL(&property_enc_ns_default_value); - zend_string *property_enc_ns_name = zend_string_init("enc_ns", sizeof("enc_ns") - 1, 1); + zend_string *property_enc_ns_name = zend_string_init("enc_ns", sizeof("enc_ns") - 1, true); zend_declare_typed_property(class_entry, property_enc_ns_name, &property_enc_ns_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_enc_ns_name); + zend_string_release_ex(property_enc_ns_name, true); zval property_enc_name_default_value; ZVAL_NULL(&property_enc_name_default_value); - zend_string *property_enc_name_name = zend_string_init("enc_name", sizeof("enc_name") - 1, 1); + zend_string *property_enc_name_name = zend_string_init("enc_name", sizeof("enc_name") - 1, true); zend_declare_typed_property(class_entry, property_enc_name_name, &property_enc_name_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_enc_name_name); + zend_string_release_ex(property_enc_name_name, true); zval property_enc_namens_default_value; ZVAL_NULL(&property_enc_namens_default_value); - zend_string *property_enc_namens_name = zend_string_init("enc_namens", sizeof("enc_namens") - 1, 1); + zend_string *property_enc_namens_name = zend_string_init("enc_namens", sizeof("enc_namens") - 1, true); zend_declare_typed_property(class_entry, property_enc_namens_name, &property_enc_namens_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_enc_namens_name); + zend_string_release_ex(property_enc_namens_name, true); return class_entry; } @@ -519,10 +519,10 @@ static zend_class_entry *register_class_SoapServer(void) zval property___soap_fault_default_value; ZVAL_NULL(&property___soap_fault_default_value); - zend_string *property___soap_fault_name = zend_string_init("__soap_fault", sizeof("__soap_fault") - 1, 1); + zend_string *property___soap_fault_name = zend_string_init("__soap_fault", sizeof("__soap_fault") - 1, true); zend_string *property___soap_fault_class_SoapFault = zend_string_init("SoapFault", sizeof("SoapFault")-1, 1); zend_declare_typed_property(class_entry, property___soap_fault_name, &property___soap_fault_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property___soap_fault_class_SoapFault, 0, MAY_BE_NULL)); - zend_string_release(property___soap_fault_name); + zend_string_release_ex(property___soap_fault_name, true); return class_entry; } @@ -536,27 +536,27 @@ static zend_class_entry *register_class_SoapClient(void) zval property_uri_default_value; ZVAL_NULL(&property_uri_default_value); - zend_string *property_uri_name = zend_string_init("uri", sizeof("uri") - 1, 1); + zend_string *property_uri_name = zend_string_init("uri", sizeof("uri") - 1, true); zend_declare_typed_property(class_entry, property_uri_name, &property_uri_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_uri_name); + zend_string_release_ex(property_uri_name, true); zval property_style_default_value; ZVAL_NULL(&property_style_default_value); - zend_string *property_style_name = zend_string_init("style", sizeof("style") - 1, 1); + zend_string *property_style_name = zend_string_init("style", sizeof("style") - 1, true); zend_declare_typed_property(class_entry, property_style_name, &property_style_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_style_name); + zend_string_release_ex(property_style_name, true); zval property_use_default_value; ZVAL_NULL(&property_use_default_value); - zend_string *property_use_name = zend_string_init("use", sizeof("use") - 1, 1); + zend_string *property_use_name = zend_string_init("use", sizeof("use") - 1, true); zend_declare_typed_property(class_entry, property_use_name, &property_use_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_use_name); + zend_string_release_ex(property_use_name, true); zval property_location_default_value; ZVAL_NULL(&property_location_default_value); - zend_string *property_location_name = zend_string_init("location", sizeof("location") - 1, 1); + zend_string *property_location_name = zend_string_init("location", sizeof("location") - 1, true); zend_declare_typed_property(class_entry, property_location_name, &property_location_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_location_name); + zend_string_release_ex(property_location_name, true); zval property_trace_default_value; ZVAL_FALSE(&property_trace_default_value); @@ -564,192 +564,192 @@ static zend_class_entry *register_class_SoapClient(void) zval property_compression_default_value; ZVAL_NULL(&property_compression_default_value); - zend_string *property_compression_name = zend_string_init("compression", sizeof("compression") - 1, 1); + zend_string *property_compression_name = zend_string_init("compression", sizeof("compression") - 1, true); zend_declare_typed_property(class_entry, property_compression_name, &property_compression_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_compression_name); + zend_string_release_ex(property_compression_name, true); zval property_sdl_default_value; ZVAL_NULL(&property_sdl_default_value); - zend_string *property_sdl_name = zend_string_init("sdl", sizeof("sdl") - 1, 1); + zend_string *property_sdl_name = zend_string_init("sdl", sizeof("sdl") - 1, true); zend_string *property_sdl_class_Soap_Sdl = zend_string_init("Soap\\Sdl", sizeof("Soap\\Sdl")-1, 1); zend_declare_typed_property(class_entry, property_sdl_name, &property_sdl_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_sdl_class_Soap_Sdl, 0, MAY_BE_NULL)); - zend_string_release(property_sdl_name); + zend_string_release_ex(property_sdl_name, true); zval property_typemap_default_value; ZVAL_NULL(&property_typemap_default_value); - zend_string *property_typemap_name = zend_string_init("typemap", sizeof("typemap") - 1, 1); + zend_string *property_typemap_name = zend_string_init("typemap", sizeof("typemap") - 1, true); zend_declare_typed_property(class_entry, property_typemap_name, &property_typemap_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property_typemap_name); + zend_string_release_ex(property_typemap_name, true); zval property_httpsocket_default_value; ZVAL_NULL(&property_httpsocket_default_value); - zend_string *property_httpsocket_name = zend_string_init("httpsocket", sizeof("httpsocket") - 1, 1); + zend_string *property_httpsocket_name = zend_string_init("httpsocket", sizeof("httpsocket") - 1, true); zend_declare_typed_property(class_entry, property_httpsocket_name, &property_httpsocket_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property_httpsocket_name); + zend_string_release_ex(property_httpsocket_name, true); zval property_httpurl_default_value; ZVAL_NULL(&property_httpurl_default_value); - zend_string *property_httpurl_name = zend_string_init("httpurl", sizeof("httpurl") - 1, 1); + zend_string *property_httpurl_name = zend_string_init("httpurl", sizeof("httpurl") - 1, true); zend_string *property_httpurl_class_Soap_Url = zend_string_init("Soap\\\125rl", sizeof("Soap\\\125rl")-1, 1); zend_declare_typed_property(class_entry, property_httpurl_name, &property_httpurl_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_httpurl_class_Soap_Url, 0, MAY_BE_NULL)); - zend_string_release(property_httpurl_name); + zend_string_release_ex(property_httpurl_name, true); zval property__login_default_value; ZVAL_NULL(&property__login_default_value); - zend_string *property__login_name = zend_string_init("_login", sizeof("_login") - 1, 1); + zend_string *property__login_name = zend_string_init("_login", sizeof("_login") - 1, true); zend_declare_typed_property(class_entry, property__login_name, &property__login_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__login_name); + zend_string_release_ex(property__login_name, true); zval property__password_default_value; ZVAL_NULL(&property__password_default_value); - zend_string *property__password_name = zend_string_init("_password", sizeof("_password") - 1, 1); + zend_string *property__password_name = zend_string_init("_password", sizeof("_password") - 1, true); zend_declare_typed_property(class_entry, property__password_name, &property__password_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__password_name); + zend_string_release_ex(property__password_name, true); zval property__use_digest_default_value; ZVAL_FALSE(&property__use_digest_default_value); - zend_string *property__use_digest_name = zend_string_init("_use_digest", sizeof("_use_digest") - 1, 1); + zend_string *property__use_digest_name = zend_string_init("_use_digest", sizeof("_use_digest") - 1, true); zend_declare_typed_property(class_entry, property__use_digest_name, &property__use_digest_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property__use_digest_name); + zend_string_release_ex(property__use_digest_name, true); zval property__digest_default_value; ZVAL_NULL(&property__digest_default_value); - zend_string *property__digest_name = zend_string_init("_digest", sizeof("_digest") - 1, 1); + zend_string *property__digest_name = zend_string_init("_digest", sizeof("_digest") - 1, true); zend_declare_typed_property(class_entry, property__digest_name, &property__digest_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__digest_name); + zend_string_release_ex(property__digest_name, true); zval property__proxy_host_default_value; ZVAL_NULL(&property__proxy_host_default_value); - zend_string *property__proxy_host_name = zend_string_init("_proxy_host", sizeof("_proxy_host") - 1, 1); + zend_string *property__proxy_host_name = zend_string_init("_proxy_host", sizeof("_proxy_host") - 1, true); zend_declare_typed_property(class_entry, property__proxy_host_name, &property__proxy_host_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__proxy_host_name); + zend_string_release_ex(property__proxy_host_name, true); zval property__proxy_port_default_value; ZVAL_NULL(&property__proxy_port_default_value); - zend_string *property__proxy_port_name = zend_string_init("_proxy_port", sizeof("_proxy_port") - 1, 1); + zend_string *property__proxy_port_name = zend_string_init("_proxy_port", sizeof("_proxy_port") - 1, true); zend_declare_typed_property(class_entry, property__proxy_port_name, &property__proxy_port_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property__proxy_port_name); + zend_string_release_ex(property__proxy_port_name, true); zval property__proxy_login_default_value; ZVAL_NULL(&property__proxy_login_default_value); - zend_string *property__proxy_login_name = zend_string_init("_proxy_login", sizeof("_proxy_login") - 1, 1); + zend_string *property__proxy_login_name = zend_string_init("_proxy_login", sizeof("_proxy_login") - 1, true); zend_declare_typed_property(class_entry, property__proxy_login_name, &property__proxy_login_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__proxy_login_name); + zend_string_release_ex(property__proxy_login_name, true); zval property__proxy_password_default_value; ZVAL_NULL(&property__proxy_password_default_value); - zend_string *property__proxy_password_name = zend_string_init("_proxy_password", sizeof("_proxy_password") - 1, 1); + zend_string *property__proxy_password_name = zend_string_init("_proxy_password", sizeof("_proxy_password") - 1, true); zend_declare_typed_property(class_entry, property__proxy_password_name, &property__proxy_password_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__proxy_password_name); + zend_string_release_ex(property__proxy_password_name, true); zval property__exceptions_default_value; ZVAL_TRUE(&property__exceptions_default_value); - zend_string *property__exceptions_name = zend_string_init("_exceptions", sizeof("_exceptions") - 1, 1); + zend_string *property__exceptions_name = zend_string_init("_exceptions", sizeof("_exceptions") - 1, true); zend_declare_typed_property(class_entry, property__exceptions_name, &property__exceptions_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property__exceptions_name); + zend_string_release_ex(property__exceptions_name, true); zval property__encoding_default_value; ZVAL_NULL(&property__encoding_default_value); - zend_string *property__encoding_name = zend_string_init("_encoding", sizeof("_encoding") - 1, 1); + zend_string *property__encoding_name = zend_string_init("_encoding", sizeof("_encoding") - 1, true); zend_declare_typed_property(class_entry, property__encoding_name, &property__encoding_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__encoding_name); + zend_string_release_ex(property__encoding_name, true); zval property__classmap_default_value; ZVAL_NULL(&property__classmap_default_value); - zend_string *property__classmap_name = zend_string_init("_classmap", sizeof("_classmap") - 1, 1); + zend_string *property__classmap_name = zend_string_init("_classmap", sizeof("_classmap") - 1, true); zend_declare_typed_property(class_entry, property__classmap_name, &property__classmap_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property__classmap_name); + zend_string_release_ex(property__classmap_name, true); zval property__features_default_value; ZVAL_NULL(&property__features_default_value); - zend_string *property__features_name = zend_string_init("_features", sizeof("_features") - 1, 1); + zend_string *property__features_name = zend_string_init("_features", sizeof("_features") - 1, true); zend_declare_typed_property(class_entry, property__features_name, &property__features_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property__features_name); + zend_string_release_ex(property__features_name, true); zval property__connection_timeout_default_value; ZVAL_LONG(&property__connection_timeout_default_value, 0); - zend_string *property__connection_timeout_name = zend_string_init("_connection_timeout", sizeof("_connection_timeout") - 1, 1); + zend_string *property__connection_timeout_name = zend_string_init("_connection_timeout", sizeof("_connection_timeout") - 1, true); zend_declare_typed_property(class_entry, property__connection_timeout_name, &property__connection_timeout_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property__connection_timeout_name); + zend_string_release_ex(property__connection_timeout_name, true); zval property__stream_context_default_value; ZVAL_NULL(&property__stream_context_default_value); - zend_string *property__stream_context_name = zend_string_init("_stream_context", sizeof("_stream_context") - 1, 1); + zend_string *property__stream_context_name = zend_string_init("_stream_context", sizeof("_stream_context") - 1, true); zend_declare_typed_property(class_entry, property__stream_context_name, &property__stream_context_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property__stream_context_name); + zend_string_release_ex(property__stream_context_name, true); zval property__user_agent_default_value; ZVAL_NULL(&property__user_agent_default_value); - zend_string *property__user_agent_name = zend_string_init("_user_agent", sizeof("_user_agent") - 1, 1); + zend_string *property__user_agent_name = zend_string_init("_user_agent", sizeof("_user_agent") - 1, true); zend_declare_typed_property(class_entry, property__user_agent_name, &property__user_agent_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property__user_agent_name); + zend_string_release_ex(property__user_agent_name, true); zval property__keep_alive_default_value; ZVAL_TRUE(&property__keep_alive_default_value); - zend_string *property__keep_alive_name = zend_string_init("_keep_alive", sizeof("_keep_alive") - 1, 1); + zend_string *property__keep_alive_name = zend_string_init("_keep_alive", sizeof("_keep_alive") - 1, true); zend_declare_typed_property(class_entry, property__keep_alive_name, &property__keep_alive_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property__keep_alive_name); + zend_string_release_ex(property__keep_alive_name, true); zval property__ssl_method_default_value; ZVAL_NULL(&property__ssl_method_default_value); - zend_string *property__ssl_method_name = zend_string_init("_ssl_method", sizeof("_ssl_method") - 1, 1); + zend_string *property__ssl_method_name = zend_string_init("_ssl_method", sizeof("_ssl_method") - 1, true); zend_declare_typed_property(class_entry, property__ssl_method_name, &property__ssl_method_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property__ssl_method_name); + zend_string_release_ex(property__ssl_method_name, true); zval property__soap_version_default_value; ZVAL_UNDEF(&property__soap_version_default_value); - zend_string *property__soap_version_name = zend_string_init("_soap_version", sizeof("_soap_version") - 1, 1); + zend_string *property__soap_version_name = zend_string_init("_soap_version", sizeof("_soap_version") - 1, true); zend_declare_typed_property(class_entry, property__soap_version_name, &property__soap_version_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property__soap_version_name); + zend_string_release_ex(property__soap_version_name, true); zval property__use_proxy_default_value; ZVAL_NULL(&property__use_proxy_default_value); - zend_string *property__use_proxy_name = zend_string_init("_use_proxy", sizeof("_use_proxy") - 1, 1); + zend_string *property__use_proxy_name = zend_string_init("_use_proxy", sizeof("_use_proxy") - 1, true); zend_declare_typed_property(class_entry, property__use_proxy_name, &property__use_proxy_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property__use_proxy_name); + zend_string_release_ex(property__use_proxy_name, true); zval property__cookies_default_value; ZVAL_EMPTY_ARRAY(&property__cookies_default_value); - zend_string *property__cookies_name = zend_string_init("_cookies", sizeof("_cookies") - 1, 1); + zend_string *property__cookies_name = zend_string_init("_cookies", sizeof("_cookies") - 1, true); zend_declare_typed_property(class_entry, property__cookies_name, &property__cookies_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property__cookies_name); + zend_string_release_ex(property__cookies_name, true); zval property___default_headers_default_value; ZVAL_NULL(&property___default_headers_default_value); - zend_string *property___default_headers_name = zend_string_init("__default_headers", sizeof("__default_headers") - 1, 1); + zend_string *property___default_headers_name = zend_string_init("__default_headers", sizeof("__default_headers") - 1, true); zend_declare_typed_property(class_entry, property___default_headers_name, &property___default_headers_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property___default_headers_name); + zend_string_release_ex(property___default_headers_name, true); zval property___soap_fault_default_value; ZVAL_NULL(&property___soap_fault_default_value); - zend_string *property___soap_fault_name = zend_string_init("__soap_fault", sizeof("__soap_fault") - 1, 1); + zend_string *property___soap_fault_name = zend_string_init("__soap_fault", sizeof("__soap_fault") - 1, true); zend_string *property___soap_fault_class_SoapFault = zend_string_init("SoapFault", sizeof("SoapFault")-1, 1); zend_declare_typed_property(class_entry, property___soap_fault_name, &property___soap_fault_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property___soap_fault_class_SoapFault, 0, MAY_BE_NULL)); - zend_string_release(property___soap_fault_name); + zend_string_release_ex(property___soap_fault_name, true); zval property___last_request_default_value; ZVAL_NULL(&property___last_request_default_value); - zend_string *property___last_request_name = zend_string_init("__last_request", sizeof("__last_request") - 1, 1); + zend_string *property___last_request_name = zend_string_init("__last_request", sizeof("__last_request") - 1, true); zend_declare_typed_property(class_entry, property___last_request_name, &property___last_request_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property___last_request_name); + zend_string_release_ex(property___last_request_name, true); zval property___last_response_default_value; ZVAL_NULL(&property___last_response_default_value); - zend_string *property___last_response_name = zend_string_init("__last_response", sizeof("__last_response") - 1, 1); + zend_string *property___last_response_name = zend_string_init("__last_response", sizeof("__last_response") - 1, true); zend_declare_typed_property(class_entry, property___last_response_name, &property___last_response_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property___last_response_name); + zend_string_release_ex(property___last_response_name, true); zval property___last_request_headers_default_value; ZVAL_NULL(&property___last_request_headers_default_value); - zend_string *property___last_request_headers_name = zend_string_init("__last_request_headers", sizeof("__last_request_headers") - 1, 1); + zend_string *property___last_request_headers_name = zend_string_init("__last_request_headers", sizeof("__last_request_headers") - 1, true); zend_declare_typed_property(class_entry, property___last_request_headers_name, &property___last_request_headers_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property___last_request_headers_name); + zend_string_release_ex(property___last_request_headers_name, true); zval property___last_response_headers_default_value; ZVAL_NULL(&property___last_response_headers_default_value); - zend_string *property___last_response_headers_name = zend_string_init("__last_response_headers", sizeof("__last_response_headers") - 1, 1); + zend_string *property___last_response_headers_name = zend_string_init("__last_response_headers", sizeof("__last_response_headers") - 1, true); zend_declare_typed_property(class_entry, property___last_response_headers_name, &property___last_response_headers_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property___last_response_headers_name); + zend_string_release_ex(property___last_response_headers_name, true); return class_entry; } diff --git a/ext/spl/spl_array_arginfo.h b/ext/spl/spl_array_arginfo.h index 24dcadac661c8..da3b7ddb8c909 100644 --- a/ext/spl/spl_array_arginfo.h +++ b/ext/spl/spl_array_arginfo.h @@ -264,15 +264,15 @@ static zend_class_entry *register_class_ArrayObject(zend_class_entry *class_entr zval const_STD_PROP_LIST_value; ZVAL_LONG(&const_STD_PROP_LIST_value, SPL_ARRAY_STD_PROP_LIST); - zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, 1); + zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, true); zend_declare_typed_class_constant(class_entry, const_STD_PROP_LIST_name, &const_STD_PROP_LIST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_STD_PROP_LIST_name); + zend_string_release_ex(const_STD_PROP_LIST_name, true); zval const_ARRAY_AS_PROPS_value; ZVAL_LONG(&const_ARRAY_AS_PROPS_value, SPL_ARRAY_ARRAY_AS_PROPS); - zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, 1); + zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ARRAY_AS_PROPS_name, &const_ARRAY_AS_PROPS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ARRAY_AS_PROPS_name); + zend_string_release_ex(const_ARRAY_AS_PROPS_name, true); return class_entry; } @@ -287,15 +287,15 @@ static zend_class_entry *register_class_ArrayIterator(zend_class_entry *class_en zval const_STD_PROP_LIST_value; ZVAL_LONG(&const_STD_PROP_LIST_value, SPL_ARRAY_STD_PROP_LIST); - zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, 1); + zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, true); zend_declare_typed_class_constant(class_entry, const_STD_PROP_LIST_name, &const_STD_PROP_LIST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_STD_PROP_LIST_name); + zend_string_release_ex(const_STD_PROP_LIST_name, true); zval const_ARRAY_AS_PROPS_value; ZVAL_LONG(&const_ARRAY_AS_PROPS_value, SPL_ARRAY_ARRAY_AS_PROPS); - zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, 1); + zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ARRAY_AS_PROPS_name, &const_ARRAY_AS_PROPS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ARRAY_AS_PROPS_name); + zend_string_release_ex(const_ARRAY_AS_PROPS_name, true); return class_entry; } @@ -310,9 +310,9 @@ static zend_class_entry *register_class_RecursiveArrayIterator(zend_class_entry zval const_CHILD_ARRAYS_ONLY_value; ZVAL_LONG(&const_CHILD_ARRAYS_ONLY_value, SPL_ARRAY_CHILD_ARRAYS_ONLY); - zend_string *const_CHILD_ARRAYS_ONLY_name = zend_string_init_interned("CHILD_ARRAYS_ONLY", sizeof("CHILD_ARRAYS_ONLY") - 1, 1); + zend_string *const_CHILD_ARRAYS_ONLY_name = zend_string_init_interned("CHILD_ARRAYS_ONLY", sizeof("CHILD_ARRAYS_ONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHILD_ARRAYS_ONLY_name, &const_CHILD_ARRAYS_ONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHILD_ARRAYS_ONLY_name); + zend_string_release_ex(const_CHILD_ARRAYS_ONLY_name, true); return class_entry; } diff --git a/ext/spl/spl_directory_arginfo.h b/ext/spl/spl_directory_arginfo.h index 434abefef4c68..3b37c1ed6fd0e 100644 --- a/ext/spl/spl_directory_arginfo.h +++ b/ext/spl/spl_directory_arginfo.h @@ -508,75 +508,75 @@ static zend_class_entry *register_class_FilesystemIterator(zend_class_entry *cla zval const_CURRENT_MODE_MASK_value; ZVAL_LONG(&const_CURRENT_MODE_MASK_value, SPL_FILE_DIR_CURRENT_MODE_MASK); - zend_string *const_CURRENT_MODE_MASK_name = zend_string_init_interned("CURRENT_MODE_MASK", sizeof("CURRENT_MODE_MASK") - 1, 1); + zend_string *const_CURRENT_MODE_MASK_name = zend_string_init_interned("CURRENT_MODE_MASK", sizeof("CURRENT_MODE_MASK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENT_MODE_MASK_name, &const_CURRENT_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENT_MODE_MASK_name); + zend_string_release_ex(const_CURRENT_MODE_MASK_name, true); zval const_CURRENT_AS_PATHNAME_value; ZVAL_LONG(&const_CURRENT_AS_PATHNAME_value, SPL_FILE_DIR_CURRENT_AS_PATHNAME); - zend_string *const_CURRENT_AS_PATHNAME_name = zend_string_init_interned("CURRENT_AS_PATHNAME", sizeof("CURRENT_AS_PATHNAME") - 1, 1); + zend_string *const_CURRENT_AS_PATHNAME_name = zend_string_init_interned("CURRENT_AS_PATHNAME", sizeof("CURRENT_AS_PATHNAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENT_AS_PATHNAME_name, &const_CURRENT_AS_PATHNAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENT_AS_PATHNAME_name); + zend_string_release_ex(const_CURRENT_AS_PATHNAME_name, true); zval const_CURRENT_AS_FILEINFO_value; ZVAL_LONG(&const_CURRENT_AS_FILEINFO_value, SPL_FILE_DIR_CURRENT_AS_FILEINFO); - zend_string *const_CURRENT_AS_FILEINFO_name = zend_string_init_interned("CURRENT_AS_FILEINFO", sizeof("CURRENT_AS_FILEINFO") - 1, 1); + zend_string *const_CURRENT_AS_FILEINFO_name = zend_string_init_interned("CURRENT_AS_FILEINFO", sizeof("CURRENT_AS_FILEINFO") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENT_AS_FILEINFO_name, &const_CURRENT_AS_FILEINFO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENT_AS_FILEINFO_name); + zend_string_release_ex(const_CURRENT_AS_FILEINFO_name, true); zval const_CURRENT_AS_SELF_value; ZVAL_LONG(&const_CURRENT_AS_SELF_value, SPL_FILE_DIR_CURRENT_AS_SELF); - zend_string *const_CURRENT_AS_SELF_name = zend_string_init_interned("CURRENT_AS_SELF", sizeof("CURRENT_AS_SELF") - 1, 1); + zend_string *const_CURRENT_AS_SELF_name = zend_string_init_interned("CURRENT_AS_SELF", sizeof("CURRENT_AS_SELF") - 1, true); zend_declare_typed_class_constant(class_entry, const_CURRENT_AS_SELF_name, &const_CURRENT_AS_SELF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CURRENT_AS_SELF_name); + zend_string_release_ex(const_CURRENT_AS_SELF_name, true); zval const_KEY_MODE_MASK_value; ZVAL_LONG(&const_KEY_MODE_MASK_value, SPL_FILE_DIR_KEY_MODE_MASK); - zend_string *const_KEY_MODE_MASK_name = zend_string_init_interned("KEY_MODE_MASK", sizeof("KEY_MODE_MASK") - 1, 1); + zend_string *const_KEY_MODE_MASK_name = zend_string_init_interned("KEY_MODE_MASK", sizeof("KEY_MODE_MASK") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_MODE_MASK_name, &const_KEY_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_MODE_MASK_name); + zend_string_release_ex(const_KEY_MODE_MASK_name, true); zval const_KEY_AS_PATHNAME_value; ZVAL_LONG(&const_KEY_AS_PATHNAME_value, SPL_FILE_DIR_KEY_AS_PATHNAME); - zend_string *const_KEY_AS_PATHNAME_name = zend_string_init_interned("KEY_AS_PATHNAME", sizeof("KEY_AS_PATHNAME") - 1, 1); + zend_string *const_KEY_AS_PATHNAME_name = zend_string_init_interned("KEY_AS_PATHNAME", sizeof("KEY_AS_PATHNAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_AS_PATHNAME_name, &const_KEY_AS_PATHNAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_AS_PATHNAME_name); + zend_string_release_ex(const_KEY_AS_PATHNAME_name, true); zval const_FOLLOW_SYMLINKS_value; ZVAL_LONG(&const_FOLLOW_SYMLINKS_value, SPL_FILE_DIR_FOLLOW_SYMLINKS); - zend_string *const_FOLLOW_SYMLINKS_name = zend_string_init_interned("FOLLOW_SYMLINKS", sizeof("FOLLOW_SYMLINKS") - 1, 1); + zend_string *const_FOLLOW_SYMLINKS_name = zend_string_init_interned("FOLLOW_SYMLINKS", sizeof("FOLLOW_SYMLINKS") - 1, true); zend_declare_typed_class_constant(class_entry, const_FOLLOW_SYMLINKS_name, &const_FOLLOW_SYMLINKS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FOLLOW_SYMLINKS_name); + zend_string_release_ex(const_FOLLOW_SYMLINKS_name, true); zval const_KEY_AS_FILENAME_value; ZVAL_LONG(&const_KEY_AS_FILENAME_value, SPL_FILE_DIR_KEY_AS_FILENAME); - zend_string *const_KEY_AS_FILENAME_name = zend_string_init_interned("KEY_AS_FILENAME", sizeof("KEY_AS_FILENAME") - 1, 1); + zend_string *const_KEY_AS_FILENAME_name = zend_string_init_interned("KEY_AS_FILENAME", sizeof("KEY_AS_FILENAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_KEY_AS_FILENAME_name, &const_KEY_AS_FILENAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_KEY_AS_FILENAME_name); + zend_string_release_ex(const_KEY_AS_FILENAME_name, true); zval const_NEW_CURRENT_AND_KEY_value; ZVAL_LONG(&const_NEW_CURRENT_AND_KEY_value, SPL_FILE_NEW_CURRENT_AND_KEY); - zend_string *const_NEW_CURRENT_AND_KEY_name = zend_string_init_interned("NEW_CURRENT_AND_KEY", sizeof("NEW_CURRENT_AND_KEY") - 1, 1); + zend_string *const_NEW_CURRENT_AND_KEY_name = zend_string_init_interned("NEW_CURRENT_AND_KEY", sizeof("NEW_CURRENT_AND_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_NEW_CURRENT_AND_KEY_name, &const_NEW_CURRENT_AND_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NEW_CURRENT_AND_KEY_name); + zend_string_release_ex(const_NEW_CURRENT_AND_KEY_name, true); zval const_OTHER_MODE_MASK_value; ZVAL_LONG(&const_OTHER_MODE_MASK_value, SPL_FILE_DIR_OTHERS_MASK); - zend_string *const_OTHER_MODE_MASK_name = zend_string_init_interned("OTHER_MODE_MASK", sizeof("OTHER_MODE_MASK") - 1, 1); + zend_string *const_OTHER_MODE_MASK_name = zend_string_init_interned("OTHER_MODE_MASK", sizeof("OTHER_MODE_MASK") - 1, true); zend_declare_typed_class_constant(class_entry, const_OTHER_MODE_MASK_name, &const_OTHER_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OTHER_MODE_MASK_name); + zend_string_release_ex(const_OTHER_MODE_MASK_name, true); zval const_SKIP_DOTS_value; ZVAL_LONG(&const_SKIP_DOTS_value, SPL_FILE_DIR_SKIPDOTS); - zend_string *const_SKIP_DOTS_name = zend_string_init_interned("SKIP_DOTS", sizeof("SKIP_DOTS") - 1, 1); + zend_string *const_SKIP_DOTS_name = zend_string_init_interned("SKIP_DOTS", sizeof("SKIP_DOTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_SKIP_DOTS_name, &const_SKIP_DOTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SKIP_DOTS_name); + zend_string_release_ex(const_SKIP_DOTS_name, true); zval const_UNIX_PATHS_value; ZVAL_LONG(&const_UNIX_PATHS_value, SPL_FILE_DIR_UNIXPATHS); - zend_string *const_UNIX_PATHS_name = zend_string_init_interned("UNIX_PATHS", sizeof("UNIX_PATHS") - 1, 1); + zend_string *const_UNIX_PATHS_name = zend_string_init_interned("UNIX_PATHS", sizeof("UNIX_PATHS") - 1, true); zend_declare_typed_class_constant(class_entry, const_UNIX_PATHS_name, &const_UNIX_PATHS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UNIX_PATHS_name); + zend_string_release_ex(const_UNIX_PATHS_name, true); return class_entry; } @@ -613,27 +613,27 @@ static zend_class_entry *register_class_SplFileObject(zend_class_entry *class_en zval const_DROP_NEW_LINE_value; ZVAL_LONG(&const_DROP_NEW_LINE_value, SPL_FILE_OBJECT_DROP_NEW_LINE); - zend_string *const_DROP_NEW_LINE_name = zend_string_init_interned("DROP_NEW_LINE", sizeof("DROP_NEW_LINE") - 1, 1); + zend_string *const_DROP_NEW_LINE_name = zend_string_init_interned("DROP_NEW_LINE", sizeof("DROP_NEW_LINE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_NEW_LINE_name, &const_DROP_NEW_LINE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_NEW_LINE_name); + zend_string_release_ex(const_DROP_NEW_LINE_name, true); zval const_READ_AHEAD_value; ZVAL_LONG(&const_READ_AHEAD_value, SPL_FILE_OBJECT_READ_AHEAD); - zend_string *const_READ_AHEAD_name = zend_string_init_interned("READ_AHEAD", sizeof("READ_AHEAD") - 1, 1); + zend_string *const_READ_AHEAD_name = zend_string_init_interned("READ_AHEAD", sizeof("READ_AHEAD") - 1, true); zend_declare_typed_class_constant(class_entry, const_READ_AHEAD_name, &const_READ_AHEAD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_READ_AHEAD_name); + zend_string_release_ex(const_READ_AHEAD_name, true); zval const_SKIP_EMPTY_value; ZVAL_LONG(&const_SKIP_EMPTY_value, SPL_FILE_OBJECT_SKIP_EMPTY); - zend_string *const_SKIP_EMPTY_name = zend_string_init_interned("SKIP_EMPTY", sizeof("SKIP_EMPTY") - 1, 1); + zend_string *const_SKIP_EMPTY_name = zend_string_init_interned("SKIP_EMPTY", sizeof("SKIP_EMPTY") - 1, true); zend_declare_typed_class_constant(class_entry, const_SKIP_EMPTY_name, &const_SKIP_EMPTY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SKIP_EMPTY_name); + zend_string_release_ex(const_SKIP_EMPTY_name, true); zval const_READ_CSV_value; ZVAL_LONG(&const_READ_CSV_value, SPL_FILE_OBJECT_READ_CSV); - zend_string *const_READ_CSV_name = zend_string_init_interned("READ_CSV", sizeof("READ_CSV") - 1, 1); + zend_string *const_READ_CSV_name = zend_string_init_interned("READ_CSV", sizeof("READ_CSV") - 1, true); zend_declare_typed_class_constant(class_entry, const_READ_CSV_name, &const_READ_CSV_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_READ_CSV_name); + zend_string_release_ex(const_READ_CSV_name, true); return class_entry; } diff --git a/ext/spl/spl_dllist_arginfo.h b/ext/spl/spl_dllist_arginfo.h index a5b1510655138..e6ceb3dca42de 100644 --- a/ext/spl/spl_dllist_arginfo.h +++ b/ext/spl/spl_dllist_arginfo.h @@ -156,27 +156,27 @@ static zend_class_entry *register_class_SplDoublyLinkedList(zend_class_entry *cl zval const_IT_MODE_LIFO_value; ZVAL_LONG(&const_IT_MODE_LIFO_value, SPL_DLLIST_IT_LIFO); - zend_string *const_IT_MODE_LIFO_name = zend_string_init_interned("IT_MODE_LIFO", sizeof("IT_MODE_LIFO") - 1, 1); + zend_string *const_IT_MODE_LIFO_name = zend_string_init_interned("IT_MODE_LIFO", sizeof("IT_MODE_LIFO") - 1, true); zend_declare_typed_class_constant(class_entry, const_IT_MODE_LIFO_name, &const_IT_MODE_LIFO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IT_MODE_LIFO_name); + zend_string_release_ex(const_IT_MODE_LIFO_name, true); zval const_IT_MODE_FIFO_value; ZVAL_LONG(&const_IT_MODE_FIFO_value, SPL_DLLIST_IT_FIFO); - zend_string *const_IT_MODE_FIFO_name = zend_string_init_interned("IT_MODE_FIFO", sizeof("IT_MODE_FIFO") - 1, 1); + zend_string *const_IT_MODE_FIFO_name = zend_string_init_interned("IT_MODE_FIFO", sizeof("IT_MODE_FIFO") - 1, true); zend_declare_typed_class_constant(class_entry, const_IT_MODE_FIFO_name, &const_IT_MODE_FIFO_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IT_MODE_FIFO_name); + zend_string_release_ex(const_IT_MODE_FIFO_name, true); zval const_IT_MODE_DELETE_value; ZVAL_LONG(&const_IT_MODE_DELETE_value, SPL_DLLIST_IT_DELETE); - zend_string *const_IT_MODE_DELETE_name = zend_string_init_interned("IT_MODE_DELETE", sizeof("IT_MODE_DELETE") - 1, 1); + zend_string *const_IT_MODE_DELETE_name = zend_string_init_interned("IT_MODE_DELETE", sizeof("IT_MODE_DELETE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IT_MODE_DELETE_name, &const_IT_MODE_DELETE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IT_MODE_DELETE_name); + zend_string_release_ex(const_IT_MODE_DELETE_name, true); zval const_IT_MODE_KEEP_value; ZVAL_LONG(&const_IT_MODE_KEEP_value, SPL_DLLIST_IT_KEEP); - zend_string *const_IT_MODE_KEEP_name = zend_string_init_interned("IT_MODE_KEEP", sizeof("IT_MODE_KEEP") - 1, 1); + zend_string *const_IT_MODE_KEEP_name = zend_string_init_interned("IT_MODE_KEEP", sizeof("IT_MODE_KEEP") - 1, true); zend_declare_typed_class_constant(class_entry, const_IT_MODE_KEEP_name, &const_IT_MODE_KEEP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IT_MODE_KEEP_name); + zend_string_release_ex(const_IT_MODE_KEEP_name, true); return class_entry; } diff --git a/ext/spl/spl_heap_arginfo.h b/ext/spl/spl_heap_arginfo.h index be5318a68f8c6..8b79ee0902ddf 100644 --- a/ext/spl/spl_heap_arginfo.h +++ b/ext/spl/spl_heap_arginfo.h @@ -184,21 +184,21 @@ static zend_class_entry *register_class_SplPriorityQueue(zend_class_entry *class zval const_EXTR_BOTH_value; ZVAL_LONG(&const_EXTR_BOTH_value, SPL_PQUEUE_EXTR_BOTH); - zend_string *const_EXTR_BOTH_name = zend_string_init_interned("EXTR_BOTH", sizeof("EXTR_BOTH") - 1, 1); + zend_string *const_EXTR_BOTH_name = zend_string_init_interned("EXTR_BOTH", sizeof("EXTR_BOTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXTR_BOTH_name, &const_EXTR_BOTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXTR_BOTH_name); + zend_string_release_ex(const_EXTR_BOTH_name, true); zval const_EXTR_PRIORITY_value; ZVAL_LONG(&const_EXTR_PRIORITY_value, SPL_PQUEUE_EXTR_PRIORITY); - zend_string *const_EXTR_PRIORITY_name = zend_string_init_interned("EXTR_PRIORITY", sizeof("EXTR_PRIORITY") - 1, 1); + zend_string *const_EXTR_PRIORITY_name = zend_string_init_interned("EXTR_PRIORITY", sizeof("EXTR_PRIORITY") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXTR_PRIORITY_name, &const_EXTR_PRIORITY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXTR_PRIORITY_name); + zend_string_release_ex(const_EXTR_PRIORITY_name, true); zval const_EXTR_DATA_value; ZVAL_LONG(&const_EXTR_DATA_value, SPL_PQUEUE_EXTR_DATA); - zend_string *const_EXTR_DATA_name = zend_string_init_interned("EXTR_DATA", sizeof("EXTR_DATA") - 1, 1); + zend_string *const_EXTR_DATA_name = zend_string_init_interned("EXTR_DATA", sizeof("EXTR_DATA") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXTR_DATA_name, &const_EXTR_DATA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXTR_DATA_name); + zend_string_release_ex(const_EXTR_DATA_name, true); return class_entry; } diff --git a/ext/spl/spl_iterators_arginfo.h b/ext/spl/spl_iterators_arginfo.h index 439236643471e..ebd57693632d9 100644 --- a/ext/spl/spl_iterators_arginfo.h +++ b/ext/spl/spl_iterators_arginfo.h @@ -653,27 +653,27 @@ static zend_class_entry *register_class_RecursiveIteratorIterator(zend_class_ent zval const_LEAVES_ONLY_value; ZVAL_LONG(&const_LEAVES_ONLY_value, RIT_LEAVES_ONLY); - zend_string *const_LEAVES_ONLY_name = zend_string_init_interned("LEAVES_ONLY", sizeof("LEAVES_ONLY") - 1, 1); + zend_string *const_LEAVES_ONLY_name = zend_string_init_interned("LEAVES_ONLY", sizeof("LEAVES_ONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_LEAVES_ONLY_name, &const_LEAVES_ONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LEAVES_ONLY_name); + zend_string_release_ex(const_LEAVES_ONLY_name, true); zval const_SELF_FIRST_value; ZVAL_LONG(&const_SELF_FIRST_value, RIT_SELF_FIRST); - zend_string *const_SELF_FIRST_name = zend_string_init_interned("SELF_FIRST", sizeof("SELF_FIRST") - 1, 1); + zend_string *const_SELF_FIRST_name = zend_string_init_interned("SELF_FIRST", sizeof("SELF_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_SELF_FIRST_name, &const_SELF_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SELF_FIRST_name); + zend_string_release_ex(const_SELF_FIRST_name, true); zval const_CHILD_FIRST_value; ZVAL_LONG(&const_CHILD_FIRST_value, RIT_CHILD_FIRST); - zend_string *const_CHILD_FIRST_name = zend_string_init_interned("CHILD_FIRST", sizeof("CHILD_FIRST") - 1, 1); + zend_string *const_CHILD_FIRST_name = zend_string_init_interned("CHILD_FIRST", sizeof("CHILD_FIRST") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHILD_FIRST_name, &const_CHILD_FIRST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHILD_FIRST_name); + zend_string_release_ex(const_CHILD_FIRST_name, true); zval const_CATCH_GET_CHILD_value; ZVAL_LONG(&const_CATCH_GET_CHILD_value, RIT_CATCH_GET_CHILD); - zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, 1); + zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, true); zend_declare_typed_class_constant(class_entry, const_CATCH_GET_CHILD_name, &const_CATCH_GET_CHILD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CATCH_GET_CHILD_name); + zend_string_release_ex(const_CATCH_GET_CHILD_name, true); return class_entry; } @@ -762,39 +762,39 @@ static zend_class_entry *register_class_CachingIterator(zend_class_entry *class_ zval const_CALL_TOSTRING_value; ZVAL_LONG(&const_CALL_TOSTRING_value, CIT_CALL_TOSTRING); - zend_string *const_CALL_TOSTRING_name = zend_string_init_interned("CALL_TOSTRING", sizeof("CALL_TOSTRING") - 1, 1); + zend_string *const_CALL_TOSTRING_name = zend_string_init_interned("CALL_TOSTRING", sizeof("CALL_TOSTRING") - 1, true); zend_declare_typed_class_constant(class_entry, const_CALL_TOSTRING_name, &const_CALL_TOSTRING_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CALL_TOSTRING_name); + zend_string_release_ex(const_CALL_TOSTRING_name, true); zval const_CATCH_GET_CHILD_value; ZVAL_LONG(&const_CATCH_GET_CHILD_value, CIT_CATCH_GET_CHILD); - zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, 1); + zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, true); zend_declare_typed_class_constant(class_entry, const_CATCH_GET_CHILD_name, &const_CATCH_GET_CHILD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CATCH_GET_CHILD_name); + zend_string_release_ex(const_CATCH_GET_CHILD_name, true); zval const_TOSTRING_USE_KEY_value; ZVAL_LONG(&const_TOSTRING_USE_KEY_value, CIT_TOSTRING_USE_KEY); - zend_string *const_TOSTRING_USE_KEY_name = zend_string_init_interned("TOSTRING_USE_KEY", sizeof("TOSTRING_USE_KEY") - 1, 1); + zend_string *const_TOSTRING_USE_KEY_name = zend_string_init_interned("TOSTRING_USE_KEY", sizeof("TOSTRING_USE_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_TOSTRING_USE_KEY_name, &const_TOSTRING_USE_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TOSTRING_USE_KEY_name); + zend_string_release_ex(const_TOSTRING_USE_KEY_name, true); zval const_TOSTRING_USE_CURRENT_value; ZVAL_LONG(&const_TOSTRING_USE_CURRENT_value, CIT_TOSTRING_USE_CURRENT); - zend_string *const_TOSTRING_USE_CURRENT_name = zend_string_init_interned("TOSTRING_USE_CURRENT", sizeof("TOSTRING_USE_CURRENT") - 1, 1); + zend_string *const_TOSTRING_USE_CURRENT_name = zend_string_init_interned("TOSTRING_USE_CURRENT", sizeof("TOSTRING_USE_CURRENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TOSTRING_USE_CURRENT_name, &const_TOSTRING_USE_CURRENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TOSTRING_USE_CURRENT_name); + zend_string_release_ex(const_TOSTRING_USE_CURRENT_name, true); zval const_TOSTRING_USE_INNER_value; ZVAL_LONG(&const_TOSTRING_USE_INNER_value, CIT_TOSTRING_USE_INNER); - zend_string *const_TOSTRING_USE_INNER_name = zend_string_init_interned("TOSTRING_USE_INNER", sizeof("TOSTRING_USE_INNER") - 1, 1); + zend_string *const_TOSTRING_USE_INNER_name = zend_string_init_interned("TOSTRING_USE_INNER", sizeof("TOSTRING_USE_INNER") - 1, true); zend_declare_typed_class_constant(class_entry, const_TOSTRING_USE_INNER_name, &const_TOSTRING_USE_INNER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TOSTRING_USE_INNER_name); + zend_string_release_ex(const_TOSTRING_USE_INNER_name, true); zval const_FULL_CACHE_value; ZVAL_LONG(&const_FULL_CACHE_value, CIT_FULL_CACHE); - zend_string *const_FULL_CACHE_name = zend_string_init_interned("FULL_CACHE", sizeof("FULL_CACHE") - 1, 1); + zend_string *const_FULL_CACHE_name = zend_string_init_interned("FULL_CACHE", sizeof("FULL_CACHE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FULL_CACHE_name, &const_FULL_CACHE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FULL_CACHE_name); + zend_string_release_ex(const_FULL_CACHE_name, true); return class_entry; } @@ -849,51 +849,51 @@ static zend_class_entry *register_class_RegexIterator(zend_class_entry *class_en zval const_USE_KEY_value; ZVAL_LONG(&const_USE_KEY_value, REGIT_USE_KEY); - zend_string *const_USE_KEY_name = zend_string_init_interned("USE_KEY", sizeof("USE_KEY") - 1, 1); + zend_string *const_USE_KEY_name = zend_string_init_interned("USE_KEY", sizeof("USE_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_USE_KEY_name, &const_USE_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_USE_KEY_name); + zend_string_release_ex(const_USE_KEY_name, true); zval const_INVERT_MATCH_value; ZVAL_LONG(&const_INVERT_MATCH_value, REGIT_INVERTED); - zend_string *const_INVERT_MATCH_name = zend_string_init_interned("INVERT_MATCH", sizeof("INVERT_MATCH") - 1, 1); + zend_string *const_INVERT_MATCH_name = zend_string_init_interned("INVERT_MATCH", sizeof("INVERT_MATCH") - 1, true); zend_declare_typed_class_constant(class_entry, const_INVERT_MATCH_name, &const_INVERT_MATCH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INVERT_MATCH_name); + zend_string_release_ex(const_INVERT_MATCH_name, true); zval const_MATCH_value; ZVAL_LONG(&const_MATCH_value, REGIT_MODE_MATCH); - zend_string *const_MATCH_name = zend_string_init_interned("MATCH", sizeof("MATCH") - 1, 1); + zend_string *const_MATCH_name = zend_string_init_interned("MATCH", sizeof("MATCH") - 1, true); zend_declare_typed_class_constant(class_entry, const_MATCH_name, &const_MATCH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MATCH_name); + zend_string_release_ex(const_MATCH_name, true); zval const_GET_MATCH_value; ZVAL_LONG(&const_GET_MATCH_value, REGIT_MODE_GET_MATCH); - zend_string *const_GET_MATCH_name = zend_string_init_interned("GET_MATCH", sizeof("GET_MATCH") - 1, 1); + zend_string *const_GET_MATCH_name = zend_string_init_interned("GET_MATCH", sizeof("GET_MATCH") - 1, true); zend_declare_typed_class_constant(class_entry, const_GET_MATCH_name, &const_GET_MATCH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_GET_MATCH_name); + zend_string_release_ex(const_GET_MATCH_name, true); zval const_ALL_MATCHES_value; ZVAL_LONG(&const_ALL_MATCHES_value, REGIT_MODE_ALL_MATCHES); - zend_string *const_ALL_MATCHES_name = zend_string_init_interned("ALL_MATCHES", sizeof("ALL_MATCHES") - 1, 1); + zend_string *const_ALL_MATCHES_name = zend_string_init_interned("ALL_MATCHES", sizeof("ALL_MATCHES") - 1, true); zend_declare_typed_class_constant(class_entry, const_ALL_MATCHES_name, &const_ALL_MATCHES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ALL_MATCHES_name); + zend_string_release_ex(const_ALL_MATCHES_name, true); zval const_SPLIT_value; ZVAL_LONG(&const_SPLIT_value, REGIT_MODE_SPLIT); - zend_string *const_SPLIT_name = zend_string_init_interned("SPLIT", sizeof("SPLIT") - 1, 1); + zend_string *const_SPLIT_name = zend_string_init_interned("SPLIT", sizeof("SPLIT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SPLIT_name, &const_SPLIT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SPLIT_name); + zend_string_release_ex(const_SPLIT_name, true); zval const_REPLACE_value; ZVAL_LONG(&const_REPLACE_value, REGIT_MODE_REPLACE); - zend_string *const_REPLACE_name = zend_string_init_interned("REPLACE", sizeof("REPLACE") - 1, 1); + zend_string *const_REPLACE_name = zend_string_init_interned("REPLACE", sizeof("REPLACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_REPLACE_name, &const_REPLACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REPLACE_name); + zend_string_release_ex(const_REPLACE_name, true); zval property_replacement_default_value; ZVAL_NULL(&property_replacement_default_value); - zend_string *property_replacement_name = zend_string_init("replacement", sizeof("replacement") - 1, 1); + zend_string *property_replacement_name = zend_string_init("replacement", sizeof("replacement") - 1, true); zend_declare_typed_property(class_entry, property_replacement_name, &property_replacement_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_replacement_name); + zend_string_release_ex(property_replacement_name, true); return class_entry; } @@ -918,51 +918,51 @@ static zend_class_entry *register_class_RecursiveTreeIterator(zend_class_entry * zval const_BYPASS_CURRENT_value; ZVAL_LONG(&const_BYPASS_CURRENT_value, RTIT_BYPASS_CURRENT); - zend_string *const_BYPASS_CURRENT_name = zend_string_init_interned("BYPASS_CURRENT", sizeof("BYPASS_CURRENT") - 1, 1); + zend_string *const_BYPASS_CURRENT_name = zend_string_init_interned("BYPASS_CURRENT", sizeof("BYPASS_CURRENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_BYPASS_CURRENT_name, &const_BYPASS_CURRENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BYPASS_CURRENT_name); + zend_string_release_ex(const_BYPASS_CURRENT_name, true); zval const_BYPASS_KEY_value; ZVAL_LONG(&const_BYPASS_KEY_value, RTIT_BYPASS_KEY); - zend_string *const_BYPASS_KEY_name = zend_string_init_interned("BYPASS_KEY", sizeof("BYPASS_KEY") - 1, 1); + zend_string *const_BYPASS_KEY_name = zend_string_init_interned("BYPASS_KEY", sizeof("BYPASS_KEY") - 1, true); zend_declare_typed_class_constant(class_entry, const_BYPASS_KEY_name, &const_BYPASS_KEY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_BYPASS_KEY_name); + zend_string_release_ex(const_BYPASS_KEY_name, true); zval const_PREFIX_LEFT_value; ZVAL_LONG(&const_PREFIX_LEFT_value, 0); - zend_string *const_PREFIX_LEFT_name = zend_string_init_interned("PREFIX_LEFT", sizeof("PREFIX_LEFT") - 1, 1); + zend_string *const_PREFIX_LEFT_name = zend_string_init_interned("PREFIX_LEFT", sizeof("PREFIX_LEFT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_LEFT_name, &const_PREFIX_LEFT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_LEFT_name); + zend_string_release_ex(const_PREFIX_LEFT_name, true); zval const_PREFIX_MID_HAS_NEXT_value; ZVAL_LONG(&const_PREFIX_MID_HAS_NEXT_value, 1); - zend_string *const_PREFIX_MID_HAS_NEXT_name = zend_string_init_interned("PREFIX_MID_HAS_NEXT", sizeof("PREFIX_MID_HAS_NEXT") - 1, 1); + zend_string *const_PREFIX_MID_HAS_NEXT_name = zend_string_init_interned("PREFIX_MID_HAS_NEXT", sizeof("PREFIX_MID_HAS_NEXT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_MID_HAS_NEXT_name, &const_PREFIX_MID_HAS_NEXT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_MID_HAS_NEXT_name); + zend_string_release_ex(const_PREFIX_MID_HAS_NEXT_name, true); zval const_PREFIX_MID_LAST_value; ZVAL_LONG(&const_PREFIX_MID_LAST_value, 2); - zend_string *const_PREFIX_MID_LAST_name = zend_string_init_interned("PREFIX_MID_LAST", sizeof("PREFIX_MID_LAST") - 1, 1); + zend_string *const_PREFIX_MID_LAST_name = zend_string_init_interned("PREFIX_MID_LAST", sizeof("PREFIX_MID_LAST") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_MID_LAST_name, &const_PREFIX_MID_LAST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_MID_LAST_name); + zend_string_release_ex(const_PREFIX_MID_LAST_name, true); zval const_PREFIX_END_HAS_NEXT_value; ZVAL_LONG(&const_PREFIX_END_HAS_NEXT_value, 3); - zend_string *const_PREFIX_END_HAS_NEXT_name = zend_string_init_interned("PREFIX_END_HAS_NEXT", sizeof("PREFIX_END_HAS_NEXT") - 1, 1); + zend_string *const_PREFIX_END_HAS_NEXT_name = zend_string_init_interned("PREFIX_END_HAS_NEXT", sizeof("PREFIX_END_HAS_NEXT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_END_HAS_NEXT_name, &const_PREFIX_END_HAS_NEXT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_END_HAS_NEXT_name); + zend_string_release_ex(const_PREFIX_END_HAS_NEXT_name, true); zval const_PREFIX_END_LAST_value; ZVAL_LONG(&const_PREFIX_END_LAST_value, 4); - zend_string *const_PREFIX_END_LAST_name = zend_string_init_interned("PREFIX_END_LAST", sizeof("PREFIX_END_LAST") - 1, 1); + zend_string *const_PREFIX_END_LAST_name = zend_string_init_interned("PREFIX_END_LAST", sizeof("PREFIX_END_LAST") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_END_LAST_name, &const_PREFIX_END_LAST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_END_LAST_name); + zend_string_release_ex(const_PREFIX_END_LAST_name, true); zval const_PREFIX_RIGHT_value; ZVAL_LONG(&const_PREFIX_RIGHT_value, 5); - zend_string *const_PREFIX_RIGHT_name = zend_string_init_interned("PREFIX_RIGHT", sizeof("PREFIX_RIGHT") - 1, 1); + zend_string *const_PREFIX_RIGHT_name = zend_string_init_interned("PREFIX_RIGHT", sizeof("PREFIX_RIGHT") - 1, true); zend_declare_typed_class_constant(class_entry, const_PREFIX_RIGHT_name, &const_PREFIX_RIGHT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PREFIX_RIGHT_name); + zend_string_release_ex(const_PREFIX_RIGHT_name, true); return class_entry; } diff --git a/ext/spl/spl_observer_arginfo.h b/ext/spl/spl_observer_arginfo.h index ae648edd7e818..fec3ccb84203d 100644 --- a/ext/spl/spl_observer_arginfo.h +++ b/ext/spl/spl_observer_arginfo.h @@ -293,27 +293,27 @@ static zend_class_entry *register_class_MultipleIterator(zend_class_entry *class zval const_MIT_NEED_ANY_value; ZVAL_LONG(&const_MIT_NEED_ANY_value, MIT_NEED_ANY); - zend_string *const_MIT_NEED_ANY_name = zend_string_init_interned("MIT_NEED_ANY", sizeof("MIT_NEED_ANY") - 1, 1); + zend_string *const_MIT_NEED_ANY_name = zend_string_init_interned("MIT_NEED_ANY", sizeof("MIT_NEED_ANY") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIT_NEED_ANY_name, &const_MIT_NEED_ANY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIT_NEED_ANY_name); + zend_string_release_ex(const_MIT_NEED_ANY_name, true); zval const_MIT_NEED_ALL_value; ZVAL_LONG(&const_MIT_NEED_ALL_value, MIT_NEED_ALL); - zend_string *const_MIT_NEED_ALL_name = zend_string_init_interned("MIT_NEED_ALL", sizeof("MIT_NEED_ALL") - 1, 1); + zend_string *const_MIT_NEED_ALL_name = zend_string_init_interned("MIT_NEED_ALL", sizeof("MIT_NEED_ALL") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIT_NEED_ALL_name, &const_MIT_NEED_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIT_NEED_ALL_name); + zend_string_release_ex(const_MIT_NEED_ALL_name, true); zval const_MIT_KEYS_NUMERIC_value; ZVAL_LONG(&const_MIT_KEYS_NUMERIC_value, MIT_KEYS_NUMERIC); - zend_string *const_MIT_KEYS_NUMERIC_name = zend_string_init_interned("MIT_KEYS_NUMERIC", sizeof("MIT_KEYS_NUMERIC") - 1, 1); + zend_string *const_MIT_KEYS_NUMERIC_name = zend_string_init_interned("MIT_KEYS_NUMERIC", sizeof("MIT_KEYS_NUMERIC") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIT_KEYS_NUMERIC_name, &const_MIT_KEYS_NUMERIC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIT_KEYS_NUMERIC_name); + zend_string_release_ex(const_MIT_KEYS_NUMERIC_name, true); zval const_MIT_KEYS_ASSOC_value; ZVAL_LONG(&const_MIT_KEYS_ASSOC_value, MIT_KEYS_ASSOC); - zend_string *const_MIT_KEYS_ASSOC_name = zend_string_init_interned("MIT_KEYS_ASSOC", sizeof("MIT_KEYS_ASSOC") - 1, 1); + zend_string *const_MIT_KEYS_ASSOC_name = zend_string_init_interned("MIT_KEYS_ASSOC", sizeof("MIT_KEYS_ASSOC") - 1, true); zend_declare_typed_class_constant(class_entry, const_MIT_KEYS_ASSOC_name, &const_MIT_KEYS_ASSOC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_MIT_KEYS_ASSOC_name); + zend_string_release_ex(const_MIT_KEYS_ASSOC_name, true); return class_entry; } diff --git a/ext/sqlite3/sqlite3_arginfo.h b/ext/sqlite3/sqlite3_arginfo.h index 54ca70cad5c53..12c1c7d0ce961 100644 --- a/ext/sqlite3/sqlite3_arginfo.h +++ b/ext/sqlite3/sqlite3_arginfo.h @@ -332,226 +332,226 @@ static zend_class_entry *register_class_SQLite3(void) zval const_OK_value; ZVAL_LONG(&const_OK_value, SQLITE_OK); - zend_string *const_OK_name = zend_string_init_interned("OK", sizeof("OK") - 1, 1); + zend_string *const_OK_name = zend_string_init_interned("OK", sizeof("OK") - 1, true); zend_declare_typed_class_constant(class_entry, const_OK_name, &const_OK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OK_name); + zend_string_release_ex(const_OK_name, true); zval const_DENY_value; ZVAL_LONG(&const_DENY_value, SQLITE_DENY); - zend_string *const_DENY_name = zend_string_init_interned("DENY", sizeof("DENY") - 1, 1); + zend_string *const_DENY_name = zend_string_init_interned("DENY", sizeof("DENY") - 1, true); zend_declare_typed_class_constant(class_entry, const_DENY_name, &const_DENY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DENY_name); + zend_string_release_ex(const_DENY_name, true); zval const_IGNORE_value; ZVAL_LONG(&const_IGNORE_value, SQLITE_IGNORE); - zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, 1); + zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, true); zend_declare_typed_class_constant(class_entry, const_IGNORE_name, &const_IGNORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_IGNORE_name); + zend_string_release_ex(const_IGNORE_name, true); zval const_CREATE_INDEX_value; ZVAL_LONG(&const_CREATE_INDEX_value, SQLITE_CREATE_INDEX); - zend_string *const_CREATE_INDEX_name = zend_string_init_interned("CREATE_INDEX", sizeof("CREATE_INDEX") - 1, 1); + zend_string *const_CREATE_INDEX_name = zend_string_init_interned("CREATE_INDEX", sizeof("CREATE_INDEX") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_INDEX_name, &const_CREATE_INDEX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_INDEX_name); + zend_string_release_ex(const_CREATE_INDEX_name, true); zval const_CREATE_TABLE_value; ZVAL_LONG(&const_CREATE_TABLE_value, SQLITE_CREATE_TABLE); - zend_string *const_CREATE_TABLE_name = zend_string_init_interned("CREATE_TABLE", sizeof("CREATE_TABLE") - 1, 1); + zend_string *const_CREATE_TABLE_name = zend_string_init_interned("CREATE_TABLE", sizeof("CREATE_TABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TABLE_name, &const_CREATE_TABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TABLE_name); + zend_string_release_ex(const_CREATE_TABLE_name, true); zval const_CREATE_TEMP_INDEX_value; ZVAL_LONG(&const_CREATE_TEMP_INDEX_value, SQLITE_CREATE_TEMP_INDEX); - zend_string *const_CREATE_TEMP_INDEX_name = zend_string_init_interned("CREATE_TEMP_INDEX", sizeof("CREATE_TEMP_INDEX") - 1, 1); + zend_string *const_CREATE_TEMP_INDEX_name = zend_string_init_interned("CREATE_TEMP_INDEX", sizeof("CREATE_TEMP_INDEX") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TEMP_INDEX_name, &const_CREATE_TEMP_INDEX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TEMP_INDEX_name); + zend_string_release_ex(const_CREATE_TEMP_INDEX_name, true); zval const_CREATE_TEMP_TABLE_value; ZVAL_LONG(&const_CREATE_TEMP_TABLE_value, SQLITE_CREATE_TEMP_TABLE); - zend_string *const_CREATE_TEMP_TABLE_name = zend_string_init_interned("CREATE_TEMP_TABLE", sizeof("CREATE_TEMP_TABLE") - 1, 1); + zend_string *const_CREATE_TEMP_TABLE_name = zend_string_init_interned("CREATE_TEMP_TABLE", sizeof("CREATE_TEMP_TABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TEMP_TABLE_name, &const_CREATE_TEMP_TABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TEMP_TABLE_name); + zend_string_release_ex(const_CREATE_TEMP_TABLE_name, true); zval const_CREATE_TEMP_TRIGGER_value; ZVAL_LONG(&const_CREATE_TEMP_TRIGGER_value, SQLITE_CREATE_TEMP_TRIGGER); - zend_string *const_CREATE_TEMP_TRIGGER_name = zend_string_init_interned("CREATE_TEMP_TRIGGER", sizeof("CREATE_TEMP_TRIGGER") - 1, 1); + zend_string *const_CREATE_TEMP_TRIGGER_name = zend_string_init_interned("CREATE_TEMP_TRIGGER", sizeof("CREATE_TEMP_TRIGGER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TEMP_TRIGGER_name, &const_CREATE_TEMP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TEMP_TRIGGER_name); + zend_string_release_ex(const_CREATE_TEMP_TRIGGER_name, true); zval const_CREATE_TEMP_VIEW_value; ZVAL_LONG(&const_CREATE_TEMP_VIEW_value, SQLITE_CREATE_TEMP_VIEW); - zend_string *const_CREATE_TEMP_VIEW_name = zend_string_init_interned("CREATE_TEMP_VIEW", sizeof("CREATE_TEMP_VIEW") - 1, 1); + zend_string *const_CREATE_TEMP_VIEW_name = zend_string_init_interned("CREATE_TEMP_VIEW", sizeof("CREATE_TEMP_VIEW") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TEMP_VIEW_name, &const_CREATE_TEMP_VIEW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TEMP_VIEW_name); + zend_string_release_ex(const_CREATE_TEMP_VIEW_name, true); zval const_CREATE_TRIGGER_value; ZVAL_LONG(&const_CREATE_TRIGGER_value, SQLITE_CREATE_TRIGGER); - zend_string *const_CREATE_TRIGGER_name = zend_string_init_interned("CREATE_TRIGGER", sizeof("CREATE_TRIGGER") - 1, 1); + zend_string *const_CREATE_TRIGGER_name = zend_string_init_interned("CREATE_TRIGGER", sizeof("CREATE_TRIGGER") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_TRIGGER_name, &const_CREATE_TRIGGER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_TRIGGER_name); + zend_string_release_ex(const_CREATE_TRIGGER_name, true); zval const_CREATE_VIEW_value; ZVAL_LONG(&const_CREATE_VIEW_value, SQLITE_CREATE_VIEW); - zend_string *const_CREATE_VIEW_name = zend_string_init_interned("CREATE_VIEW", sizeof("CREATE_VIEW") - 1, 1); + zend_string *const_CREATE_VIEW_name = zend_string_init_interned("CREATE_VIEW", sizeof("CREATE_VIEW") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_VIEW_name, &const_CREATE_VIEW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_VIEW_name); + zend_string_release_ex(const_CREATE_VIEW_name, true); zval const_DELETE_value; ZVAL_LONG(&const_DELETE_value, SQLITE_DELETE); - zend_string *const_DELETE_name = zend_string_init_interned("DELETE", sizeof("DELETE") - 1, 1); + zend_string *const_DELETE_name = zend_string_init_interned("DELETE", sizeof("DELETE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DELETE_name, &const_DELETE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DELETE_name); + zend_string_release_ex(const_DELETE_name, true); zval const_DROP_INDEX_value; ZVAL_LONG(&const_DROP_INDEX_value, SQLITE_DROP_INDEX); - zend_string *const_DROP_INDEX_name = zend_string_init_interned("DROP_INDEX", sizeof("DROP_INDEX") - 1, 1); + zend_string *const_DROP_INDEX_name = zend_string_init_interned("DROP_INDEX", sizeof("DROP_INDEX") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_INDEX_name, &const_DROP_INDEX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_INDEX_name); + zend_string_release_ex(const_DROP_INDEX_name, true); zval const_DROP_TABLE_value; ZVAL_LONG(&const_DROP_TABLE_value, SQLITE_DROP_TABLE); - zend_string *const_DROP_TABLE_name = zend_string_init_interned("DROP_TABLE", sizeof("DROP_TABLE") - 1, 1); + zend_string *const_DROP_TABLE_name = zend_string_init_interned("DROP_TABLE", sizeof("DROP_TABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TABLE_name, &const_DROP_TABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TABLE_name); + zend_string_release_ex(const_DROP_TABLE_name, true); zval const_DROP_TEMP_INDEX_value; ZVAL_LONG(&const_DROP_TEMP_INDEX_value, SQLITE_DROP_TEMP_INDEX); - zend_string *const_DROP_TEMP_INDEX_name = zend_string_init_interned("DROP_TEMP_INDEX", sizeof("DROP_TEMP_INDEX") - 1, 1); + zend_string *const_DROP_TEMP_INDEX_name = zend_string_init_interned("DROP_TEMP_INDEX", sizeof("DROP_TEMP_INDEX") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TEMP_INDEX_name, &const_DROP_TEMP_INDEX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TEMP_INDEX_name); + zend_string_release_ex(const_DROP_TEMP_INDEX_name, true); zval const_DROP_TEMP_TABLE_value; ZVAL_LONG(&const_DROP_TEMP_TABLE_value, SQLITE_DROP_TEMP_TABLE); - zend_string *const_DROP_TEMP_TABLE_name = zend_string_init_interned("DROP_TEMP_TABLE", sizeof("DROP_TEMP_TABLE") - 1, 1); + zend_string *const_DROP_TEMP_TABLE_name = zend_string_init_interned("DROP_TEMP_TABLE", sizeof("DROP_TEMP_TABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TEMP_TABLE_name, &const_DROP_TEMP_TABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TEMP_TABLE_name); + zend_string_release_ex(const_DROP_TEMP_TABLE_name, true); zval const_DROP_TEMP_TRIGGER_value; ZVAL_LONG(&const_DROP_TEMP_TRIGGER_value, SQLITE_DROP_TEMP_TRIGGER); - zend_string *const_DROP_TEMP_TRIGGER_name = zend_string_init_interned("DROP_TEMP_TRIGGER", sizeof("DROP_TEMP_TRIGGER") - 1, 1); + zend_string *const_DROP_TEMP_TRIGGER_name = zend_string_init_interned("DROP_TEMP_TRIGGER", sizeof("DROP_TEMP_TRIGGER") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TEMP_TRIGGER_name, &const_DROP_TEMP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TEMP_TRIGGER_name); + zend_string_release_ex(const_DROP_TEMP_TRIGGER_name, true); zval const_DROP_TEMP_VIEW_value; ZVAL_LONG(&const_DROP_TEMP_VIEW_value, SQLITE_DROP_TEMP_VIEW); - zend_string *const_DROP_TEMP_VIEW_name = zend_string_init_interned("DROP_TEMP_VIEW", sizeof("DROP_TEMP_VIEW") - 1, 1); + zend_string *const_DROP_TEMP_VIEW_name = zend_string_init_interned("DROP_TEMP_VIEW", sizeof("DROP_TEMP_VIEW") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TEMP_VIEW_name, &const_DROP_TEMP_VIEW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TEMP_VIEW_name); + zend_string_release_ex(const_DROP_TEMP_VIEW_name, true); zval const_DROP_TRIGGER_value; ZVAL_LONG(&const_DROP_TRIGGER_value, SQLITE_DROP_TRIGGER); - zend_string *const_DROP_TRIGGER_name = zend_string_init_interned("DROP_TRIGGER", sizeof("DROP_TRIGGER") - 1, 1); + zend_string *const_DROP_TRIGGER_name = zend_string_init_interned("DROP_TRIGGER", sizeof("DROP_TRIGGER") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_TRIGGER_name, &const_DROP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_TRIGGER_name); + zend_string_release_ex(const_DROP_TRIGGER_name, true); zval const_DROP_VIEW_value; ZVAL_LONG(&const_DROP_VIEW_value, SQLITE_DROP_VIEW); - zend_string *const_DROP_VIEW_name = zend_string_init_interned("DROP_VIEW", sizeof("DROP_VIEW") - 1, 1); + zend_string *const_DROP_VIEW_name = zend_string_init_interned("DROP_VIEW", sizeof("DROP_VIEW") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_VIEW_name, &const_DROP_VIEW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_VIEW_name); + zend_string_release_ex(const_DROP_VIEW_name, true); zval const_INSERT_value; ZVAL_LONG(&const_INSERT_value, SQLITE_INSERT); - zend_string *const_INSERT_name = zend_string_init_interned("INSERT", sizeof("INSERT") - 1, 1); + zend_string *const_INSERT_name = zend_string_init_interned("INSERT", sizeof("INSERT") - 1, true); zend_declare_typed_class_constant(class_entry, const_INSERT_name, &const_INSERT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_INSERT_name); + zend_string_release_ex(const_INSERT_name, true); zval const_PRAGMA_value; ZVAL_LONG(&const_PRAGMA_value, SQLITE_PRAGMA); - zend_string *const_PRAGMA_name = zend_string_init_interned("PRAGMA", sizeof("PRAGMA") - 1, 1); + zend_string *const_PRAGMA_name = zend_string_init_interned("PRAGMA", sizeof("PRAGMA") - 1, true); zend_declare_typed_class_constant(class_entry, const_PRAGMA_name, &const_PRAGMA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PRAGMA_name); + zend_string_release_ex(const_PRAGMA_name, true); zval const_READ_value; ZVAL_LONG(&const_READ_value, SQLITE_READ); - zend_string *const_READ_name = zend_string_init_interned("READ", sizeof("READ") - 1, 1); + zend_string *const_READ_name = zend_string_init_interned("READ", sizeof("READ") - 1, true); zend_declare_typed_class_constant(class_entry, const_READ_name, &const_READ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_READ_name); + zend_string_release_ex(const_READ_name, true); zval const_SELECT_value; ZVAL_LONG(&const_SELECT_value, SQLITE_SELECT); - zend_string *const_SELECT_name = zend_string_init_interned("SELECT", sizeof("SELECT") - 1, 1); + zend_string *const_SELECT_name = zend_string_init_interned("SELECT", sizeof("SELECT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SELECT_name, &const_SELECT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SELECT_name); + zend_string_release_ex(const_SELECT_name, true); zval const_TRANSACTION_value; ZVAL_LONG(&const_TRANSACTION_value, SQLITE_TRANSACTION); - zend_string *const_TRANSACTION_name = zend_string_init_interned("TRANSACTION", sizeof("TRANSACTION") - 1, 1); + zend_string *const_TRANSACTION_name = zend_string_init_interned("TRANSACTION", sizeof("TRANSACTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_TRANSACTION_name, &const_TRANSACTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TRANSACTION_name); + zend_string_release_ex(const_TRANSACTION_name, true); zval const_UPDATE_value; ZVAL_LONG(&const_UPDATE_value, SQLITE_UPDATE); - zend_string *const_UPDATE_name = zend_string_init_interned("UPDATE", sizeof("UPDATE") - 1, 1); + zend_string *const_UPDATE_name = zend_string_init_interned("UPDATE", sizeof("UPDATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_UPDATE_name, &const_UPDATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_UPDATE_name); + zend_string_release_ex(const_UPDATE_name, true); zval const_ATTACH_value; ZVAL_LONG(&const_ATTACH_value, SQLITE_ATTACH); - zend_string *const_ATTACH_name = zend_string_init_interned("ATTACH", sizeof("ATTACH") - 1, 1); + zend_string *const_ATTACH_name = zend_string_init_interned("ATTACH", sizeof("ATTACH") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTACH_name, &const_ATTACH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTACH_name); + zend_string_release_ex(const_ATTACH_name, true); zval const_DETACH_value; ZVAL_LONG(&const_DETACH_value, SQLITE_DETACH); - zend_string *const_DETACH_name = zend_string_init_interned("DETACH", sizeof("DETACH") - 1, 1); + zend_string *const_DETACH_name = zend_string_init_interned("DETACH", sizeof("DETACH") - 1, true); zend_declare_typed_class_constant(class_entry, const_DETACH_name, &const_DETACH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DETACH_name); + zend_string_release_ex(const_DETACH_name, true); zval const_ALTER_TABLE_value; ZVAL_LONG(&const_ALTER_TABLE_value, SQLITE_ALTER_TABLE); - zend_string *const_ALTER_TABLE_name = zend_string_init_interned("ALTER_TABLE", sizeof("ALTER_TABLE") - 1, 1); + zend_string *const_ALTER_TABLE_name = zend_string_init_interned("ALTER_TABLE", sizeof("ALTER_TABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ALTER_TABLE_name, &const_ALTER_TABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ALTER_TABLE_name); + zend_string_release_ex(const_ALTER_TABLE_name, true); zval const_REINDEX_value; ZVAL_LONG(&const_REINDEX_value, SQLITE_REINDEX); - zend_string *const_REINDEX_name = zend_string_init_interned("REINDEX", sizeof("REINDEX") - 1, 1); + zend_string *const_REINDEX_name = zend_string_init_interned("REINDEX", sizeof("REINDEX") - 1, true); zend_declare_typed_class_constant(class_entry, const_REINDEX_name, &const_REINDEX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_REINDEX_name); + zend_string_release_ex(const_REINDEX_name, true); zval const_ANALYZE_value; ZVAL_LONG(&const_ANALYZE_value, SQLITE_ANALYZE); - zend_string *const_ANALYZE_name = zend_string_init_interned("ANALYZE", sizeof("ANALYZE") - 1, 1); + zend_string *const_ANALYZE_name = zend_string_init_interned("ANALYZE", sizeof("ANALYZE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ANALYZE_name, &const_ANALYZE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ANALYZE_name); + zend_string_release_ex(const_ANALYZE_name, true); zval const_CREATE_VTABLE_value; ZVAL_LONG(&const_CREATE_VTABLE_value, SQLITE_CREATE_VTABLE); - zend_string *const_CREATE_VTABLE_name = zend_string_init_interned("CREATE_VTABLE", sizeof("CREATE_VTABLE") - 1, 1); + zend_string *const_CREATE_VTABLE_name = zend_string_init_interned("CREATE_VTABLE", sizeof("CREATE_VTABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_VTABLE_name, &const_CREATE_VTABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_VTABLE_name); + zend_string_release_ex(const_CREATE_VTABLE_name, true); zval const_DROP_VTABLE_value; ZVAL_LONG(&const_DROP_VTABLE_value, SQLITE_DROP_VTABLE); - zend_string *const_DROP_VTABLE_name = zend_string_init_interned("DROP_VTABLE", sizeof("DROP_VTABLE") - 1, 1); + zend_string *const_DROP_VTABLE_name = zend_string_init_interned("DROP_VTABLE", sizeof("DROP_VTABLE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DROP_VTABLE_name, &const_DROP_VTABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DROP_VTABLE_name); + zend_string_release_ex(const_DROP_VTABLE_name, true); zval const_FUNCTION_value; ZVAL_LONG(&const_FUNCTION_value, SQLITE_FUNCTION); - zend_string *const_FUNCTION_name = zend_string_init_interned("FUNCTION", sizeof("FUNCTION") - 1, 1); + zend_string *const_FUNCTION_name = zend_string_init_interned("FUNCTION", sizeof("FUNCTION") - 1, true); zend_declare_typed_class_constant(class_entry, const_FUNCTION_name, &const_FUNCTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FUNCTION_name); + zend_string_release_ex(const_FUNCTION_name, true); zval const_SAVEPOINT_value; ZVAL_LONG(&const_SAVEPOINT_value, SQLITE_SAVEPOINT); - zend_string *const_SAVEPOINT_name = zend_string_init_interned("SAVEPOINT", sizeof("SAVEPOINT") - 1, 1); + zend_string *const_SAVEPOINT_name = zend_string_init_interned("SAVEPOINT", sizeof("SAVEPOINT") - 1, true); zend_declare_typed_class_constant(class_entry, const_SAVEPOINT_name, &const_SAVEPOINT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SAVEPOINT_name); + zend_string_release_ex(const_SAVEPOINT_name, true); zval const_COPY_value; ZVAL_LONG(&const_COPY_value, SQLITE_COPY); - zend_string *const_COPY_name = zend_string_init_interned("COPY", sizeof("COPY") - 1, 1); + zend_string *const_COPY_name = zend_string_init_interned("COPY", sizeof("COPY") - 1, true); zend_declare_typed_class_constant(class_entry, const_COPY_name, &const_COPY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COPY_name); + zend_string_release_ex(const_COPY_name, true); #if defined(SQLITE_RECURSIVE) zval const_RECURSIVE_value; ZVAL_LONG(&const_RECURSIVE_value, SQLITE_RECURSIVE); - zend_string *const_RECURSIVE_name = zend_string_init_interned("RECURSIVE", sizeof("RECURSIVE") - 1, 1); + zend_string *const_RECURSIVE_name = zend_string_init_interned("RECURSIVE", sizeof("RECURSIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_RECURSIVE_name, &const_RECURSIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RECURSIVE_name); + zend_string_release_ex(const_RECURSIVE_name, true); #endif return class_entry; @@ -567,21 +567,21 @@ static zend_class_entry *register_class_SQLite3Stmt(void) zval const_EXPLAIN_MODE_PREPARED_value; ZVAL_LONG(&const_EXPLAIN_MODE_PREPARED_value, 0); - zend_string *const_EXPLAIN_MODE_PREPARED_name = zend_string_init_interned("EXPLAIN_MODE_PREPARED", sizeof("EXPLAIN_MODE_PREPARED") - 1, 1); + zend_string *const_EXPLAIN_MODE_PREPARED_name = zend_string_init_interned("EXPLAIN_MODE_PREPARED", sizeof("EXPLAIN_MODE_PREPARED") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_PREPARED_name, &const_EXPLAIN_MODE_PREPARED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_PREPARED_name); + zend_string_release_ex(const_EXPLAIN_MODE_PREPARED_name, true); zval const_EXPLAIN_MODE_EXPLAIN_value; ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_value, 1); - zend_string *const_EXPLAIN_MODE_EXPLAIN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN", sizeof("EXPLAIN_MODE_EXPLAIN") - 1, 1); + zend_string *const_EXPLAIN_MODE_EXPLAIN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN", sizeof("EXPLAIN_MODE_EXPLAIN") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_name, &const_EXPLAIN_MODE_EXPLAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_EXPLAIN_name); + zend_string_release_ex(const_EXPLAIN_MODE_EXPLAIN_name, true); zval const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value; ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, 2); - zend_string *const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN", sizeof("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN") - 1, 1); + zend_string *const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name = zend_string_init_interned("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN", sizeof("EXPLAIN_MODE_EXPLAIN_QUERY_PLAN") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name, &const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name); + zend_string_release_ex(const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_name, true); #endif return class_entry; diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 668eca9aadc20..0a21d7d76426c 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -3971,9 +3971,9 @@ static zend_class_entry *register_class___PHP_Incomplete_Class(void) INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", NULL); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES); - zend_string *attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); + zend_string *attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, true); zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0, 0); - zend_string_release(attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0); + zend_string_release_ex(attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0, true); return class_entry; } diff --git a/ext/standard/dir_arginfo.h b/ext/standard/dir_arginfo.h index 703088d1eb0d5..d4cfc19556353 100644 --- a/ext/standard/dir_arginfo.h +++ b/ext/standard/dir_arginfo.h @@ -66,9 +66,9 @@ static zend_class_entry *register_class_Directory(void) zval property_handle_default_value; ZVAL_UNDEF(&property_handle_default_value); - zend_string *property_handle_name = zend_string_init("handle", sizeof("handle") - 1, 1); + zend_string *property_handle_name = zend_string_init("handle", sizeof("handle") - 1, true); zend_declare_typed_property(class_entry, property_handle_name, &property_handle_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_handle_name); + zend_string_release_ex(property_handle_name, true); return class_entry; } diff --git a/ext/standard/user_filters_arginfo.h b/ext/standard/user_filters_arginfo.h index 0411355b71222..9fd13204e2322 100644 --- a/ext/standard/user_filters_arginfo.h +++ b/ext/standard/user_filters_arginfo.h @@ -44,21 +44,21 @@ static zend_class_entry *register_class_php_user_filter(void) zval property_filtername_default_value; ZVAL_EMPTY_STRING(&property_filtername_default_value); - zend_string *property_filtername_name = zend_string_init("filtername", sizeof("filtername") - 1, 1); + zend_string *property_filtername_name = zend_string_init("filtername", sizeof("filtername") - 1, true); zend_declare_typed_property(class_entry, property_filtername_name, &property_filtername_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_filtername_name); + zend_string_release_ex(property_filtername_name, true); zval property_params_default_value; ZVAL_EMPTY_STRING(&property_params_default_value); - zend_string *property_params_name = zend_string_init("params", sizeof("params") - 1, 1); + zend_string *property_params_name = zend_string_init("params", sizeof("params") - 1, true); zend_declare_typed_property(class_entry, property_params_name, &property_params_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_params_name); + zend_string_release_ex(property_params_name, true); zval property_stream_default_value; ZVAL_NULL(&property_stream_default_value); - zend_string *property_stream_name = zend_string_init("stream", sizeof("stream") - 1, 1); + zend_string *property_stream_name = zend_string_init("stream", sizeof("stream") - 1, true); zend_declare_typed_property(class_entry, property_stream_name, &property_stream_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property_stream_name); + zend_string_release_ex(property_stream_name, true); return class_entry; } @@ -72,27 +72,27 @@ static zend_class_entry *register_class_StreamBucket(void) zval property_bucket_default_value; ZVAL_NULL(&property_bucket_default_value); - zend_string *property_bucket_name = zend_string_init("bucket", sizeof("bucket") - 1, 1); + zend_string *property_bucket_name = zend_string_init("bucket", sizeof("bucket") - 1, true); zend_declare_typed_property(class_entry, property_bucket_name, &property_bucket_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property_bucket_name); + zend_string_release_ex(property_bucket_name, true); zval property_data_default_value; ZVAL_UNDEF(&property_data_default_value); - zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, 1); + zend_string *property_data_name = zend_string_init("data", sizeof("data") - 1, true); zend_declare_typed_property(class_entry, property_data_name, &property_data_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_data_name); + zend_string_release_ex(property_data_name, true); zval property_datalen_default_value; ZVAL_UNDEF(&property_datalen_default_value); - zend_string *property_datalen_name = zend_string_init("datalen", sizeof("datalen") - 1, 1); + zend_string *property_datalen_name = zend_string_init("datalen", sizeof("datalen") - 1, true); zend_declare_typed_property(class_entry, property_datalen_name, &property_datalen_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_datalen_name); + zend_string_release_ex(property_datalen_name, true); zval property_dataLength_default_value; ZVAL_UNDEF(&property_dataLength_default_value); - zend_string *property_dataLength_name = zend_string_init("dataLength", sizeof("dataLength") - 1, 1); + zend_string *property_dataLength_name = zend_string_init("dataLength", sizeof("dataLength") - 1, true); zend_declare_typed_property(class_entry, property_dataLength_name, &property_dataLength_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_dataLength_name); + zend_string_release_ex(property_dataLength_name, true); return class_entry; } diff --git a/ext/tidy/tidy_arginfo.h b/ext/tidy/tidy_arginfo.h index 4084a29f4d908..2448b3bca2940 100644 --- a/ext/tidy/tidy_arginfo.h +++ b/ext/tidy/tidy_arginfo.h @@ -476,9 +476,9 @@ static zend_class_entry *register_class_tidy(void) zval property_errorBuffer_default_value; ZVAL_NULL(&property_errorBuffer_default_value); - zend_string *property_errorBuffer_name = zend_string_init("errorBuffer", sizeof("errorBuffer") - 1, 1); + zend_string *property_errorBuffer_name = zend_string_init("errorBuffer", sizeof("errorBuffer") - 1, true); zend_declare_typed_property(class_entry, property_errorBuffer_name, &property_errorBuffer_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); - zend_string_release(property_errorBuffer_name); + zend_string_release_ex(property_errorBuffer_name, true); zval property_value_default_value; ZVAL_NULL(&property_value_default_value); @@ -512,33 +512,33 @@ static zend_class_entry *register_class_tidyNode(void) zval property_column_default_value; ZVAL_UNDEF(&property_column_default_value); - zend_string *property_column_name = zend_string_init("column", sizeof("column") - 1, 1); + zend_string *property_column_name = zend_string_init("column", sizeof("column") - 1, true); zend_declare_typed_property(class_entry, property_column_name, &property_column_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_column_name); + zend_string_release_ex(property_column_name, true); zval property_proprietary_default_value; ZVAL_UNDEF(&property_proprietary_default_value); - zend_string *property_proprietary_name = zend_string_init("proprietary", sizeof("proprietary") - 1, 1); + zend_string *property_proprietary_name = zend_string_init("proprietary", sizeof("proprietary") - 1, true); zend_declare_typed_property(class_entry, property_proprietary_name, &property_proprietary_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_proprietary_name); + zend_string_release_ex(property_proprietary_name, true); zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_NULL)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); zval property_attribute_default_value; ZVAL_UNDEF(&property_attribute_default_value); - zend_string *property_attribute_name = zend_string_init("attribute", sizeof("attribute") - 1, 1); + zend_string *property_attribute_name = zend_string_init("attribute", sizeof("attribute") - 1, true); zend_declare_typed_property(class_entry, property_attribute_name, &property_attribute_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property_attribute_name); + zend_string_release_ex(property_attribute_name, true); zval property_child_default_value; ZVAL_UNDEF(&property_child_default_value); - zend_string *property_child_name = zend_string_init("child", sizeof("child") - 1, 1); + zend_string *property_child_name = zend_string_init("child", sizeof("child") - 1, true); zend_declare_typed_property(class_entry, property_child_name, &property_child_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY|MAY_BE_NULL)); - zend_string_release(property_child_name); + zend_string_release_ex(property_child_name, true); return class_entry; } diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index b98a5655b6c74..f5040b70cf280 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -72,15 +72,15 @@ static zend_class_entry *register_class_PhpToken(zend_class_entry *class_entry_S zval property_id_default_value; ZVAL_UNDEF(&property_id_default_value); - zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, 1); + zend_string *property_id_name = zend_string_init("id", sizeof("id") - 1, true); zend_declare_typed_property(class_entry, property_id_name, &property_id_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_id_name); + zend_string_release_ex(property_id_name, true); zval property_text_default_value; ZVAL_UNDEF(&property_text_default_value); - zend_string *property_text_name = zend_string_init("text", sizeof("text") - 1, 1); + zend_string *property_text_name = zend_string_init("text", sizeof("text") - 1, true); zend_declare_typed_property(class_entry, property_text_name, &property_text_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_text_name); + zend_string_release_ex(property_text_name, true); zval property_line_default_value; ZVAL_UNDEF(&property_line_default_value); @@ -88,9 +88,9 @@ static zend_class_entry *register_class_PhpToken(zend_class_entry *class_entry_S zval property_pos_default_value; ZVAL_UNDEF(&property_pos_default_value); - zend_string *property_pos_name = zend_string_init("pos", sizeof("pos") - 1, 1); + zend_string *property_pos_name = zend_string_init("pos", sizeof("pos") - 1, true); zend_declare_typed_property(class_entry, property_pos_name, &property_pos_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_pos_name); + zend_string_release_ex(property_pos_name, true); return class_entry; } diff --git a/ext/uri/php_uri_arginfo.h b/ext/uri/php_uri_arginfo.h index 602e996b1a226..d3a9c4fde7bca 100644 --- a/ext/uri/php_uri_arginfo.h +++ b/ext/uri/php_uri_arginfo.h @@ -374,9 +374,9 @@ static zend_class_entry *register_class_Uri_WhatWg_InvalidUrlException(zend_clas zval property_errors_default_value; ZVAL_UNDEF(&property_errors_default_value); - zend_string *property_errors_name = zend_string_init("errors", sizeof("errors") - 1, 1); + zend_string *property_errors_name = zend_string_init("errors", sizeof("errors") - 1, true); zend_declare_typed_property(class_entry, property_errors_name, &property_errors_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); - zend_string_release(property_errors_name); + zend_string_release_ex(property_errors_name, true); return class_entry; } @@ -455,9 +455,9 @@ static zend_class_entry *register_class_Uri_WhatWg_UrlValidationError(void) zval property_context_default_value; ZVAL_UNDEF(&property_context_default_value); - zend_string *property_context_name = zend_string_init("context", sizeof("context") - 1, 1); + zend_string *property_context_name = zend_string_init("context", sizeof("context") - 1, true); zend_declare_typed_property(class_entry, property_context_name, &property_context_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_context_name); + zend_string_release_ex(property_context_name, true); zval property_type_default_value; ZVAL_UNDEF(&property_type_default_value); @@ -466,9 +466,9 @@ static zend_class_entry *register_class_Uri_WhatWg_UrlValidationError(void) zval property_failure_default_value; ZVAL_UNDEF(&property_failure_default_value); - zend_string *property_failure_name = zend_string_init("failure", sizeof("failure") - 1, 1); + zend_string *property_failure_name = zend_string_init("failure", sizeof("failure") - 1, true); zend_declare_typed_property(class_entry, property_failure_name, &property_failure_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_failure_name); + zend_string_release_ex(property_failure_name, true); return class_entry; } diff --git a/ext/xmlreader/php_xmlreader_arginfo.h b/ext/xmlreader/php_xmlreader_arginfo.h index dd5ca550f606d..ef54bfa4c235f 100644 --- a/ext/xmlreader/php_xmlreader_arginfo.h +++ b/ext/xmlreader/php_xmlreader_arginfo.h @@ -180,183 +180,183 @@ static zend_class_entry *register_class_XMLReader(void) zval const_NONE_value; ZVAL_LONG(&const_NONE_value, XML_READER_TYPE_NONE); - zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, 1); + zend_string *const_NONE_name = zend_string_init_interned("NONE", sizeof("NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_NONE_name, &const_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NONE_name); + zend_string_release_ex(const_NONE_name, true); zval const_ELEMENT_value; ZVAL_LONG(&const_ELEMENT_value, XML_READER_TYPE_ELEMENT); - zend_string *const_ELEMENT_name = zend_string_init_interned("ELEMENT", sizeof("ELEMENT") - 1, 1); + zend_string *const_ELEMENT_name = zend_string_init_interned("ELEMENT", sizeof("ELEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ELEMENT_name, &const_ELEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ELEMENT_name); + zend_string_release_ex(const_ELEMENT_name, true); zval const_ATTRIBUTE_value; ZVAL_LONG(&const_ATTRIBUTE_value, XML_READER_TYPE_ATTRIBUTE); - zend_string *const_ATTRIBUTE_name = zend_string_init_interned("ATTRIBUTE", sizeof("ATTRIBUTE") - 1, 1); + zend_string *const_ATTRIBUTE_name = zend_string_init_interned("ATTRIBUTE", sizeof("ATTRIBUTE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ATTRIBUTE_name, &const_ATTRIBUTE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ATTRIBUTE_name); + zend_string_release_ex(const_ATTRIBUTE_name, true); zval const_TEXT_value; ZVAL_LONG(&const_TEXT_value, XML_READER_TYPE_TEXT); - zend_string *const_TEXT_name = zend_string_init_interned("TEXT", sizeof("TEXT") - 1, 1); + zend_string *const_TEXT_name = zend_string_init_interned("TEXT", sizeof("TEXT") - 1, true); zend_declare_typed_class_constant(class_entry, const_TEXT_name, &const_TEXT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_TEXT_name); + zend_string_release_ex(const_TEXT_name, true); zval const_CDATA_value; ZVAL_LONG(&const_CDATA_value, XML_READER_TYPE_CDATA); - zend_string *const_CDATA_name = zend_string_init_interned("CDATA", sizeof("CDATA") - 1, 1); + zend_string *const_CDATA_name = zend_string_init_interned("CDATA", sizeof("CDATA") - 1, true); zend_declare_typed_class_constant(class_entry, const_CDATA_name, &const_CDATA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CDATA_name); + zend_string_release_ex(const_CDATA_name, true); zval const_ENTITY_REF_value; ZVAL_LONG(&const_ENTITY_REF_value, XML_READER_TYPE_ENTITY_REFERENCE); - zend_string *const_ENTITY_REF_name = zend_string_init_interned("ENTITY_REF", sizeof("ENTITY_REF") - 1, 1); + zend_string *const_ENTITY_REF_name = zend_string_init_interned("ENTITY_REF", sizeof("ENTITY_REF") - 1, true); zend_declare_typed_class_constant(class_entry, const_ENTITY_REF_name, &const_ENTITY_REF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ENTITY_REF_name); + zend_string_release_ex(const_ENTITY_REF_name, true); zval const_ENTITY_value; ZVAL_LONG(&const_ENTITY_value, XML_READER_TYPE_ENTITY); - zend_string *const_ENTITY_name = zend_string_init_interned("ENTITY", sizeof("ENTITY") - 1, 1); + zend_string *const_ENTITY_name = zend_string_init_interned("ENTITY", sizeof("ENTITY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ENTITY_name, &const_ENTITY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ENTITY_name); + zend_string_release_ex(const_ENTITY_name, true); zval const_PI_value; ZVAL_LONG(&const_PI_value, XML_READER_TYPE_PROCESSING_INSTRUCTION); - zend_string *const_PI_name = zend_string_init_interned("PI", sizeof("PI") - 1, 1); + zend_string *const_PI_name = zend_string_init_interned("PI", sizeof("PI") - 1, true); zend_declare_typed_class_constant(class_entry, const_PI_name, &const_PI_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_PI_name); + zend_string_release_ex(const_PI_name, true); zval const_COMMENT_value; ZVAL_LONG(&const_COMMENT_value, XML_READER_TYPE_COMMENT); - zend_string *const_COMMENT_name = zend_string_init_interned("COMMENT", sizeof("COMMENT") - 1, 1); + zend_string *const_COMMENT_name = zend_string_init_interned("COMMENT", sizeof("COMMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_COMMENT_name, &const_COMMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_COMMENT_name); + zend_string_release_ex(const_COMMENT_name, true); zval const_DOC_value; ZVAL_LONG(&const_DOC_value, XML_READER_TYPE_DOCUMENT); - zend_string *const_DOC_name = zend_string_init_interned("DOC", sizeof("DOC") - 1, 1); + zend_string *const_DOC_name = zend_string_init_interned("DOC", sizeof("DOC") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOC_name, &const_DOC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOC_name); + zend_string_release_ex(const_DOC_name, true); zval const_DOC_TYPE_value; ZVAL_LONG(&const_DOC_TYPE_value, XML_READER_TYPE_DOCUMENT_TYPE); - zend_string *const_DOC_TYPE_name = zend_string_init_interned("DOC_TYPE", sizeof("DOC_TYPE") - 1, 1); + zend_string *const_DOC_TYPE_name = zend_string_init_interned("DOC_TYPE", sizeof("DOC_TYPE") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOC_TYPE_name, &const_DOC_TYPE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOC_TYPE_name); + zend_string_release_ex(const_DOC_TYPE_name, true); zval const_DOC_FRAGMENT_value; ZVAL_LONG(&const_DOC_FRAGMENT_value, XML_READER_TYPE_DOCUMENT_FRAGMENT); - zend_string *const_DOC_FRAGMENT_name = zend_string_init_interned("DOC_FRAGMENT", sizeof("DOC_FRAGMENT") - 1, 1); + zend_string *const_DOC_FRAGMENT_name = zend_string_init_interned("DOC_FRAGMENT", sizeof("DOC_FRAGMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_DOC_FRAGMENT_name, &const_DOC_FRAGMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DOC_FRAGMENT_name); + zend_string_release_ex(const_DOC_FRAGMENT_name, true); zval const_NOTATION_value; ZVAL_LONG(&const_NOTATION_value, XML_READER_TYPE_NOTATION); - zend_string *const_NOTATION_name = zend_string_init_interned("NOTATION", sizeof("NOTATION") - 1, 1); + zend_string *const_NOTATION_name = zend_string_init_interned("NOTATION", sizeof("NOTATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_NOTATION_name, &const_NOTATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_NOTATION_name); + zend_string_release_ex(const_NOTATION_name, true); zval const_WHITESPACE_value; ZVAL_LONG(&const_WHITESPACE_value, XML_READER_TYPE_WHITESPACE); - zend_string *const_WHITESPACE_name = zend_string_init_interned("WHITESPACE", sizeof("WHITESPACE") - 1, 1); + zend_string *const_WHITESPACE_name = zend_string_init_interned("WHITESPACE", sizeof("WHITESPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_WHITESPACE_name, &const_WHITESPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_WHITESPACE_name); + zend_string_release_ex(const_WHITESPACE_name, true); zval const_SIGNIFICANT_WHITESPACE_value; ZVAL_LONG(&const_SIGNIFICANT_WHITESPACE_value, XML_READER_TYPE_SIGNIFICANT_WHITESPACE); - zend_string *const_SIGNIFICANT_WHITESPACE_name = zend_string_init_interned("SIGNIFICANT_WHITESPACE", sizeof("SIGNIFICANT_WHITESPACE") - 1, 1); + zend_string *const_SIGNIFICANT_WHITESPACE_name = zend_string_init_interned("SIGNIFICANT_WHITESPACE", sizeof("SIGNIFICANT_WHITESPACE") - 1, true); zend_declare_typed_class_constant(class_entry, const_SIGNIFICANT_WHITESPACE_name, &const_SIGNIFICANT_WHITESPACE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SIGNIFICANT_WHITESPACE_name); + zend_string_release_ex(const_SIGNIFICANT_WHITESPACE_name, true); zval const_END_ELEMENT_value; ZVAL_LONG(&const_END_ELEMENT_value, XML_READER_TYPE_END_ELEMENT); - zend_string *const_END_ELEMENT_name = zend_string_init_interned("END_ELEMENT", sizeof("END_ELEMENT") - 1, 1); + zend_string *const_END_ELEMENT_name = zend_string_init_interned("END_ELEMENT", sizeof("END_ELEMENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_END_ELEMENT_name, &const_END_ELEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_END_ELEMENT_name); + zend_string_release_ex(const_END_ELEMENT_name, true); zval const_END_ENTITY_value; ZVAL_LONG(&const_END_ENTITY_value, XML_READER_TYPE_END_ENTITY); - zend_string *const_END_ENTITY_name = zend_string_init_interned("END_ENTITY", sizeof("END_ENTITY") - 1, 1); + zend_string *const_END_ENTITY_name = zend_string_init_interned("END_ENTITY", sizeof("END_ENTITY") - 1, true); zend_declare_typed_class_constant(class_entry, const_END_ENTITY_name, &const_END_ENTITY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_END_ENTITY_name); + zend_string_release_ex(const_END_ENTITY_name, true); zval const_XML_DECLARATION_value; ZVAL_LONG(&const_XML_DECLARATION_value, XML_READER_TYPE_XML_DECLARATION); - zend_string *const_XML_DECLARATION_name = zend_string_init_interned("XML_DECLARATION", sizeof("XML_DECLARATION") - 1, 1); + zend_string *const_XML_DECLARATION_name = zend_string_init_interned("XML_DECLARATION", sizeof("XML_DECLARATION") - 1, true); zend_declare_typed_class_constant(class_entry, const_XML_DECLARATION_name, &const_XML_DECLARATION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_XML_DECLARATION_name); + zend_string_release_ex(const_XML_DECLARATION_name, true); zval const_LOADDTD_value; ZVAL_LONG(&const_LOADDTD_value, XML_PARSER_LOADDTD); - zend_string *const_LOADDTD_name = zend_string_init_interned("LOADDTD", sizeof("LOADDTD") - 1, 1); + zend_string *const_LOADDTD_name = zend_string_init_interned("LOADDTD", sizeof("LOADDTD") - 1, true); zend_declare_typed_class_constant(class_entry, const_LOADDTD_name, &const_LOADDTD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LOADDTD_name); + zend_string_release_ex(const_LOADDTD_name, true); zval const_DEFAULTATTRS_value; ZVAL_LONG(&const_DEFAULTATTRS_value, XML_PARSER_DEFAULTATTRS); - zend_string *const_DEFAULTATTRS_name = zend_string_init_interned("DEFAULTATTRS", sizeof("DEFAULTATTRS") - 1, 1); + zend_string *const_DEFAULTATTRS_name = zend_string_init_interned("DEFAULTATTRS", sizeof("DEFAULTATTRS") - 1, true); zend_declare_typed_class_constant(class_entry, const_DEFAULTATTRS_name, &const_DEFAULTATTRS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_DEFAULTATTRS_name); + zend_string_release_ex(const_DEFAULTATTRS_name, true); zval const_VALIDATE_value; ZVAL_LONG(&const_VALIDATE_value, XML_PARSER_VALIDATE); - zend_string *const_VALIDATE_name = zend_string_init_interned("VALIDATE", sizeof("VALIDATE") - 1, 1); + zend_string *const_VALIDATE_name = zend_string_init_interned("VALIDATE", sizeof("VALIDATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_VALIDATE_name, &const_VALIDATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_VALIDATE_name); + zend_string_release_ex(const_VALIDATE_name, true); zval const_SUBST_ENTITIES_value; ZVAL_LONG(&const_SUBST_ENTITIES_value, XML_PARSER_SUBST_ENTITIES); - zend_string *const_SUBST_ENTITIES_name = zend_string_init_interned("SUBST_ENTITIES", sizeof("SUBST_ENTITIES") - 1, 1); + zend_string *const_SUBST_ENTITIES_name = zend_string_init_interned("SUBST_ENTITIES", sizeof("SUBST_ENTITIES") - 1, true); zend_declare_typed_class_constant(class_entry, const_SUBST_ENTITIES_name, &const_SUBST_ENTITIES_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_SUBST_ENTITIES_name); + zend_string_release_ex(const_SUBST_ENTITIES_name, true); zval property_attributeCount_default_value; ZVAL_UNDEF(&property_attributeCount_default_value); - zend_string *property_attributeCount_name = zend_string_init("attributeCount", sizeof("attributeCount") - 1, 1); + zend_string *property_attributeCount_name = zend_string_init("attributeCount", sizeof("attributeCount") - 1, true); zend_declare_typed_property(class_entry, property_attributeCount_name, &property_attributeCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_attributeCount_name); + zend_string_release_ex(property_attributeCount_name, true); zval property_baseURI_default_value; ZVAL_UNDEF(&property_baseURI_default_value); - zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, 1); + zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, true); zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_baseURI_name); + zend_string_release_ex(property_baseURI_name, true); zval property_depth_default_value; ZVAL_UNDEF(&property_depth_default_value); - zend_string *property_depth_name = zend_string_init("depth", sizeof("depth") - 1, 1); + zend_string *property_depth_name = zend_string_init("depth", sizeof("depth") - 1, true); zend_declare_typed_property(class_entry, property_depth_name, &property_depth_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_depth_name); + zend_string_release_ex(property_depth_name, true); zval property_hasAttributes_default_value; ZVAL_UNDEF(&property_hasAttributes_default_value); - zend_string *property_hasAttributes_name = zend_string_init("hasAttributes", sizeof("hasAttributes") - 1, 1); + zend_string *property_hasAttributes_name = zend_string_init("hasAttributes", sizeof("hasAttributes") - 1, true); zend_declare_typed_property(class_entry, property_hasAttributes_name, &property_hasAttributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_hasAttributes_name); + zend_string_release_ex(property_hasAttributes_name, true); zval property_hasValue_default_value; ZVAL_UNDEF(&property_hasValue_default_value); - zend_string *property_hasValue_name = zend_string_init("hasValue", sizeof("hasValue") - 1, 1); + zend_string *property_hasValue_name = zend_string_init("hasValue", sizeof("hasValue") - 1, true); zend_declare_typed_property(class_entry, property_hasValue_name, &property_hasValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_hasValue_name); + zend_string_release_ex(property_hasValue_name, true); zval property_isDefault_default_value; ZVAL_UNDEF(&property_isDefault_default_value); - zend_string *property_isDefault_name = zend_string_init("isDefault", sizeof("isDefault") - 1, 1); + zend_string *property_isDefault_name = zend_string_init("isDefault", sizeof("isDefault") - 1, true); zend_declare_typed_property(class_entry, property_isDefault_name, &property_isDefault_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_isDefault_name); + zend_string_release_ex(property_isDefault_name, true); zval property_isEmptyElement_default_value; ZVAL_UNDEF(&property_isEmptyElement_default_value); - zend_string *property_isEmptyElement_name = zend_string_init("isEmptyElement", sizeof("isEmptyElement") - 1, 1); + zend_string *property_isEmptyElement_name = zend_string_init("isEmptyElement", sizeof("isEmptyElement") - 1, true); zend_declare_typed_property(class_entry, property_isEmptyElement_name, &property_isEmptyElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_isEmptyElement_name); + zend_string_release_ex(property_isEmptyElement_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); - zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, 1); + zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_localName_name); + zend_string_release_ex(property_localName_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); @@ -364,21 +364,21 @@ static zend_class_entry *register_class_XMLReader(void) zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); - zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, 1); + zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_namespaceURI_name); + zend_string_release_ex(property_namespaceURI_name, true); zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); - zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, 1); + zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_nodeType_name); + zend_string_release_ex(property_nodeType_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); - zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, 1); + zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_prefix_name); + zend_string_release_ex(property_prefix_name, true); zval property_value_default_value; ZVAL_UNDEF(&property_value_default_value); @@ -386,9 +386,9 @@ static zend_class_entry *register_class_XMLReader(void) zval property_xmlLang_default_value; ZVAL_UNDEF(&property_xmlLang_default_value); - zend_string *property_xmlLang_name = zend_string_init("xmlLang", sizeof("xmlLang") - 1, 1); + zend_string *property_xmlLang_name = zend_string_init("xmlLang", sizeof("xmlLang") - 1, true); zend_declare_typed_property(class_entry, property_xmlLang_name, &property_xmlLang_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_xmlLang_name); + zend_string_release_ex(property_xmlLang_name, true); return class_entry; } diff --git a/ext/xsl/php_xsl_arginfo.h b/ext/xsl/php_xsl_arginfo.h index d640d1114a566..b1f4fd7601c58 100644 --- a/ext/xsl/php_xsl_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -119,27 +119,27 @@ static zend_class_entry *register_class_XSLTProcessor(void) zval property_doXInclude_default_value; ZVAL_FALSE(&property_doXInclude_default_value); - zend_string *property_doXInclude_name = zend_string_init("doXInclude", sizeof("doXInclude") - 1, 1); + zend_string *property_doXInclude_name = zend_string_init("doXInclude", sizeof("doXInclude") - 1, true); zend_declare_typed_property(class_entry, property_doXInclude_name, &property_doXInclude_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_doXInclude_name); + zend_string_release_ex(property_doXInclude_name, true); zval property_cloneDocument_default_value; ZVAL_FALSE(&property_cloneDocument_default_value); - zend_string *property_cloneDocument_name = zend_string_init("cloneDocument", sizeof("cloneDocument") - 1, 1); + zend_string *property_cloneDocument_name = zend_string_init("cloneDocument", sizeof("cloneDocument") - 1, true); zend_declare_typed_property(class_entry, property_cloneDocument_name, &property_cloneDocument_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_cloneDocument_name); + zend_string_release_ex(property_cloneDocument_name, true); zval property_maxTemplateDepth_default_value; ZVAL_UNDEF(&property_maxTemplateDepth_default_value); - zend_string *property_maxTemplateDepth_name = zend_string_init("maxTemplateDepth", sizeof("maxTemplateDepth") - 1, 1); + zend_string *property_maxTemplateDepth_name = zend_string_init("maxTemplateDepth", sizeof("maxTemplateDepth") - 1, true); zend_declare_typed_property(class_entry, property_maxTemplateDepth_name, &property_maxTemplateDepth_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_maxTemplateDepth_name); + zend_string_release_ex(property_maxTemplateDepth_name, true); zval property_maxTemplateVars_default_value; ZVAL_UNDEF(&property_maxTemplateVars_default_value); - zend_string *property_maxTemplateVars_name = zend_string_init("maxTemplateVars", sizeof("maxTemplateVars") - 1, 1); + zend_string *property_maxTemplateVars_name = zend_string_init("maxTemplateVars", sizeof("maxTemplateVars") - 1, true); zend_declare_typed_property(class_entry, property_maxTemplateVars_name, &property_maxTemplateVars_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_maxTemplateVars_name); + zend_string_release_ex(property_maxTemplateVars_name, true); return class_entry; } diff --git a/ext/zend_test/object_handlers_arginfo.h b/ext/zend_test/object_handlers_arginfo.h index 370ad13894aa8..0b8cff520c153 100644 --- a/ext/zend_test/object_handlers_arginfo.h +++ b/ext/zend_test/object_handlers_arginfo.h @@ -49,9 +49,9 @@ static zend_class_entry *register_class_DoOperationNoCast(void) zval property_val_default_value; ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, true); zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_val_name); + zend_string_release_ex(property_val_name, true); return class_entry; } @@ -65,9 +65,9 @@ static zend_class_entry *register_class_LongCastableNoOperations(void) zval property_val_default_value; ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, true); zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_val_name); + zend_string_release_ex(property_val_name, true); return class_entry; } @@ -81,9 +81,9 @@ static zend_class_entry *register_class_FloatCastableNoOperations(void) zval property_val_default_value; ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, true); zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_DOUBLE)); - zend_string_release(property_val_name); + zend_string_release_ex(property_val_name, true); return class_entry; } @@ -97,9 +97,9 @@ static zend_class_entry *register_class_NumericCastableNoOperations(void) zval property_val_default_value; ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, true); zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_DOUBLE)); - zend_string_release(property_val_name); + zend_string_release_ex(property_val_name, true); return class_entry; } @@ -113,51 +113,51 @@ static zend_class_entry *register_class_DimensionHandlersNoArrayAccess(void) zval property_read_default_value; ZVAL_FALSE(&property_read_default_value); - zend_string *property_read_name = zend_string_init("read", sizeof("read") - 1, 1); + zend_string *property_read_name = zend_string_init("read", sizeof("read") - 1, true); zend_declare_typed_property(class_entry, property_read_name, &property_read_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_read_name); + zend_string_release_ex(property_read_name, true); zval property_write_default_value; ZVAL_FALSE(&property_write_default_value); - zend_string *property_write_name = zend_string_init("write", sizeof("write") - 1, 1); + zend_string *property_write_name = zend_string_init("write", sizeof("write") - 1, true); zend_declare_typed_property(class_entry, property_write_name, &property_write_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_write_name); + zend_string_release_ex(property_write_name, true); zval property_has_default_value; ZVAL_FALSE(&property_has_default_value); - zend_string *property_has_name = zend_string_init("has", sizeof("has") - 1, 1); + zend_string *property_has_name = zend_string_init("has", sizeof("has") - 1, true); zend_declare_typed_property(class_entry, property_has_name, &property_has_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_has_name); + zend_string_release_ex(property_has_name, true); zval property_unset_default_value; ZVAL_FALSE(&property_unset_default_value); - zend_string *property_unset_name = zend_string_init("unset", sizeof("unset") - 1, 1); + zend_string *property_unset_name = zend_string_init("unset", sizeof("unset") - 1, true); zend_declare_typed_property(class_entry, property_unset_name, &property_unset_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_unset_name); + zend_string_release_ex(property_unset_name, true); zval property_readType_default_value; ZVAL_UNDEF(&property_readType_default_value); - zend_string *property_readType_name = zend_string_init("readType", sizeof("readType") - 1, 1); + zend_string *property_readType_name = zend_string_init("readType", sizeof("readType") - 1, true); zend_declare_typed_property(class_entry, property_readType_name, &property_readType_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_readType_name); + zend_string_release_ex(property_readType_name, true); zval property_hasOffset_default_value; ZVAL_FALSE(&property_hasOffset_default_value); - zend_string *property_hasOffset_name = zend_string_init("hasOffset", sizeof("hasOffset") - 1, 1); + zend_string *property_hasOffset_name = zend_string_init("hasOffset", sizeof("hasOffset") - 1, true); zend_declare_typed_property(class_entry, property_hasOffset_name, &property_hasOffset_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); - zend_string_release(property_hasOffset_name); + zend_string_release_ex(property_hasOffset_name, true); zval property_checkEmpty_default_value; ZVAL_UNDEF(&property_checkEmpty_default_value); - zend_string *property_checkEmpty_name = zend_string_init("checkEmpty", sizeof("checkEmpty") - 1, 1); + zend_string *property_checkEmpty_name = zend_string_init("checkEmpty", sizeof("checkEmpty") - 1, true); zend_declare_typed_property(class_entry, property_checkEmpty_name, &property_checkEmpty_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_checkEmpty_name); + zend_string_release_ex(property_checkEmpty_name, true); zval property_offset_default_value; ZVAL_UNDEF(&property_offset_default_value); - zend_string *property_offset_name = zend_string_init("offset", sizeof("offset") - 1, 1); + zend_string *property_offset_name = zend_string_init("offset", sizeof("offset") - 1, true); zend_declare_typed_property(class_entry, property_offset_name, &property_offset_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); - zend_string_release(property_offset_name); + zend_string_release_ex(property_offset_name, true); return class_entry; } diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index d2c7d6bbc2861..683b3b38648b6 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -628,44 +628,44 @@ static void register_test_symbols(int module_number) REGISTER_STRING_CONSTANT("ZendTestNS2\\ZendSubNS\\ZEND_CONSTANT_A", "namespaced", CONST_PERSISTENT); - zend_string *attribute_name_Deprecated_func_zend_test_deprecated_attr_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, 1); + zend_string *attribute_name_Deprecated_func_zend_test_deprecated_attr_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, true); zend_attribute *attribute_Deprecated_func_zend_test_deprecated_attr_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_deprecated_attr", sizeof("zend_test_deprecated_attr") - 1), attribute_name_Deprecated_func_zend_test_deprecated_attr_0, 1); - zend_string_release(attribute_name_Deprecated_func_zend_test_deprecated_attr_0); + zend_string_release_ex(attribute_name_Deprecated_func_zend_test_deprecated_attr_0, true); zend_string *attribute_Deprecated_func_zend_test_deprecated_attr_0_arg0_str = zend_string_init("custom message", strlen("custom message"), 1); ZVAL_STR(&attribute_Deprecated_func_zend_test_deprecated_attr_0->args[0].value, attribute_Deprecated_func_zend_test_deprecated_attr_0_arg0_str); attribute_Deprecated_func_zend_test_deprecated_attr_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_zend_test_nodiscard_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_zend_test_nodiscard_0 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_zend_test_nodiscard_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_nodiscard", sizeof("zend_test_nodiscard") - 1), attribute_name_NoDiscard_func_zend_test_nodiscard_0, 1); - zend_string_release(attribute_name_NoDiscard_func_zend_test_nodiscard_0); + zend_string_release_ex(attribute_name_NoDiscard_func_zend_test_nodiscard_0, true); ZVAL_STR_COPY(&attribute_NoDiscard_func_zend_test_nodiscard_0->args[0].value, attribute_Deprecated_func_zend_test_deprecated_attr_0_arg0_str); attribute_NoDiscard_func_zend_test_nodiscard_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_Deprecated_func_zend_test_deprecated_nodiscard_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, 1); + zend_string *attribute_name_Deprecated_func_zend_test_deprecated_nodiscard_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, true); zend_attribute *attribute_Deprecated_func_zend_test_deprecated_nodiscard_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_deprecated_nodiscard", sizeof("zend_test_deprecated_nodiscard") - 1), attribute_name_Deprecated_func_zend_test_deprecated_nodiscard_0, 1); - zend_string_release(attribute_name_Deprecated_func_zend_test_deprecated_nodiscard_0); + zend_string_release_ex(attribute_name_Deprecated_func_zend_test_deprecated_nodiscard_0, true); ZVAL_STR_COPY(&attribute_Deprecated_func_zend_test_deprecated_nodiscard_0->args[0].value, attribute_Deprecated_func_zend_test_deprecated_attr_0_arg0_str); attribute_Deprecated_func_zend_test_deprecated_nodiscard_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_NoDiscard_func_zend_test_deprecated_nodiscard_1 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, 1); + zend_string *attribute_name_NoDiscard_func_zend_test_deprecated_nodiscard_1 = zend_string_init_interned("NoDiscard", sizeof("NoDiscard") - 1, true); zend_attribute *attribute_NoDiscard_func_zend_test_deprecated_nodiscard_1 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_deprecated_nodiscard", sizeof("zend_test_deprecated_nodiscard") - 1), attribute_name_NoDiscard_func_zend_test_deprecated_nodiscard_1, 1); - zend_string_release(attribute_name_NoDiscard_func_zend_test_deprecated_nodiscard_1); + zend_string_release_ex(attribute_name_NoDiscard_func_zend_test_deprecated_nodiscard_1, true); zend_string *attribute_NoDiscard_func_zend_test_deprecated_nodiscard_1_arg0_str = zend_string_init("custom message 2", strlen("custom message 2"), 1); ZVAL_STR(&attribute_NoDiscard_func_zend_test_deprecated_nodiscard_1->args[0].value, attribute_NoDiscard_func_zend_test_deprecated_nodiscard_1_arg0_str); attribute_NoDiscard_func_zend_test_deprecated_nodiscard_1->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); - zend_string *attribute_name_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, 1); + zend_string *attribute_name_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, true); zend_attribute *attribute_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0 = zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_parameter_with_attribute", sizeof("zend_test_parameter_with_attribute") - 1), 0, attribute_name_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0, 1); - zend_string_release(attribute_name_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0); + zend_string_release_ex(attribute_name_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0, true); zend_string *attribute_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0_arg0_str = zend_string_init("value1", strlen("value1"), 1); ZVAL_STR(&attribute_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0->args[0].value, attribute_ZendTestParameterAttribute_func_zend_test_parameter_with_attribute_arg0_0_arg0_str); - zend_string *attribute_name_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0 = zend_string_init_interned("ZendTestAttributeWithArguments", sizeof("ZendTestAttributeWithArguments") - 1, 1); + zend_string *attribute_name_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0 = zend_string_init_interned("ZendTestAttributeWithArguments", sizeof("ZendTestAttributeWithArguments") - 1, true); zend_attribute *attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "zend_test_attribute_with_named_argument", sizeof("zend_test_attribute_with_named_argument") - 1), attribute_name_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0, 1); - zend_string_release(attribute_name_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0); + zend_string_release_ex(attribute_name_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0, true); zend_string *attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0_arg0_str = zend_string_init("foo", strlen("foo"), 1); ZVAL_STR(&attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0->args[0].value, attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0_arg0_str); - attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0->args[0].name = zend_string_init_interned("arg", sizeof("arg") - 1, 1); + attribute_ZendTestAttributeWithArguments_func_zend_test_attribute_with_named_argument_0->args[0].name = zend_string_init_interned("arg", sizeof("arg") - 1, true); #if (PHP_VERSION_ID >= 80500) zend_constant *const_ZEND_TEST_ATTRIBUTED_CONSTANT = zend_hash_str_find_ptr(EG(zend_constants), "ZEND_TEST_ATTRIBUTED_CONSTANT", sizeof("ZEND_TEST_ATTRIBUTED_CONSTANT") - 1); @@ -689,10 +689,10 @@ static zend_class_entry *register_class__ZendTestInterface(void) zval const_DUMMY_value; ZVAL_LONG(&const_DUMMY_value, 0); - zend_string *const_DUMMY_name = zend_string_init_interned("DUMMY", sizeof("DUMMY") - 1, 1); + zend_string *const_DUMMY_name = zend_string_init_interned("DUMMY", sizeof("DUMMY") - 1, true); zend_string *const_DUMMY_comment = zend_string_init_interned("/**\n * \"Lorem ipsum\"\n * @see https://www.php.net\n * @since 8.2\n */", 98, 1); zend_declare_class_constant_ex(class_entry, const_DUMMY_name, &const_DUMMY_value, ZEND_ACC_PUBLIC, const_DUMMY_comment); - zend_string_release(const_DUMMY_name); + zend_string_release_ex(const_DUMMY_name, true); return class_entry; } @@ -712,82 +712,82 @@ static zend_class_entry *register_class__ZendTestClass(zend_class_entry *class_e zval const_TYPED_CLASS_CONST1_value; ZVAL_EMPTY_ARRAY(&const_TYPED_CLASS_CONST1_value); - zend_string *const_TYPED_CLASS_CONST1_name = zend_string_init_interned("TYPED_CLASS_CONST1", sizeof("TYPED_CLASS_CONST1") - 1, 1); + zend_string *const_TYPED_CLASS_CONST1_name = zend_string_init_interned("TYPED_CLASS_CONST1", sizeof("TYPED_CLASS_CONST1") - 1, true); #if (PHP_VERSION_ID >= 80300) zend_declare_typed_class_constant(class_entry, const_TYPED_CLASS_CONST1_name, &const_TYPED_CLASS_CONST1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); #else zend_declare_class_constant_ex(class_entry, const_TYPED_CLASS_CONST1_name, &const_TYPED_CLASS_CONST1_value, ZEND_ACC_PUBLIC, NULL); #endif - zend_string_release(const_TYPED_CLASS_CONST1_name); + zend_string_release_ex(const_TYPED_CLASS_CONST1_name, true); zval const_TYPED_CLASS_CONST2_value; ZVAL_LONG(&const_TYPED_CLASS_CONST2_value, 42); - zend_string *const_TYPED_CLASS_CONST2_name = zend_string_init_interned("TYPED_CLASS_CONST2", sizeof("TYPED_CLASS_CONST2") - 1, 1); + zend_string *const_TYPED_CLASS_CONST2_name = zend_string_init_interned("TYPED_CLASS_CONST2", sizeof("TYPED_CLASS_CONST2") - 1, true); #if (PHP_VERSION_ID >= 80300) zend_declare_typed_class_constant(class_entry, const_TYPED_CLASS_CONST2_name, &const_TYPED_CLASS_CONST2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_ARRAY)); #else zend_declare_class_constant_ex(class_entry, const_TYPED_CLASS_CONST2_name, &const_TYPED_CLASS_CONST2_value, ZEND_ACC_PUBLIC, NULL); #endif - zend_string_release(const_TYPED_CLASS_CONST2_name); + zend_string_release_ex(const_TYPED_CLASS_CONST2_name, true); zval const_TYPED_CLASS_CONST3_value; ZVAL_LONG(&const_TYPED_CLASS_CONST3_value, 1); - zend_string *const_TYPED_CLASS_CONST3_name = zend_string_init_interned("TYPED_CLASS_CONST3", sizeof("TYPED_CLASS_CONST3") - 1, 1); + zend_string *const_TYPED_CLASS_CONST3_name = zend_string_init_interned("TYPED_CLASS_CONST3", sizeof("TYPED_CLASS_CONST3") - 1, true); #if (PHP_VERSION_ID >= 80300) zend_declare_typed_class_constant(class_entry, const_TYPED_CLASS_CONST3_name, &const_TYPED_CLASS_CONST3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_STRING)); #else zend_declare_class_constant_ex(class_entry, const_TYPED_CLASS_CONST3_name, &const_TYPED_CLASS_CONST3_value, ZEND_ACC_PUBLIC, NULL); #endif - zend_string_release(const_TYPED_CLASS_CONST3_name); + zend_string_release_ex(const_TYPED_CLASS_CONST3_name, true); zval const_ZEND_TEST_DEPRECATED_value; ZVAL_LONG(&const_ZEND_TEST_DEPRECATED_value, 42); - zend_string *const_ZEND_TEST_DEPRECATED_name = zend_string_init_interned("ZEND_TEST_DEPRECATED", sizeof("ZEND_TEST_DEPRECATED") - 1, 1); + zend_string *const_ZEND_TEST_DEPRECATED_name = zend_string_init_interned("ZEND_TEST_DEPRECATED", sizeof("ZEND_TEST_DEPRECATED") - 1, true); #if (PHP_VERSION_ID >= 80300) zend_declare_typed_class_constant(class_entry, const_ZEND_TEST_DEPRECATED_name, &const_ZEND_TEST_DEPRECATED_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #else zend_declare_class_constant_ex(class_entry, const_ZEND_TEST_DEPRECATED_name, &const_ZEND_TEST_DEPRECATED_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); #endif - zend_string_release(const_ZEND_TEST_DEPRECATED_name); + zend_string_release_ex(const_ZEND_TEST_DEPRECATED_name, true); zval const_ZEND_TEST_DEPRECATED_ATTR_value; ZVAL_LONG(&const_ZEND_TEST_DEPRECATED_ATTR_value, 42); - zend_string *const_ZEND_TEST_DEPRECATED_ATTR_name = zend_string_init_interned("ZEND_TEST_DEPRECATED_ATTR", sizeof("ZEND_TEST_DEPRECATED_ATTR") - 1, 1); + zend_string *const_ZEND_TEST_DEPRECATED_ATTR_name = zend_string_init_interned("ZEND_TEST_DEPRECATED_ATTR", sizeof("ZEND_TEST_DEPRECATED_ATTR") - 1, true); #if (PHP_VERSION_ID >= 80300) zend_class_constant *const_ZEND_TEST_DEPRECATED_ATTR = zend_declare_typed_class_constant(class_entry, const_ZEND_TEST_DEPRECATED_ATTR_name, &const_ZEND_TEST_DEPRECATED_ATTR_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #else zend_class_constant *const_ZEND_TEST_DEPRECATED_ATTR = zend_declare_class_constant_ex(class_entry, const_ZEND_TEST_DEPRECATED_ATTR_name, &const_ZEND_TEST_DEPRECATED_ATTR_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); #endif - zend_string_release(const_ZEND_TEST_DEPRECATED_ATTR_name); + zend_string_release_ex(const_ZEND_TEST_DEPRECATED_ATTR_name, true); zval property__StaticProp_default_value; ZVAL_NULL(&property__StaticProp_default_value); - zend_string *property__StaticProp_name = zend_string_init("_StaticProp", sizeof("_StaticProp") - 1, 1); + zend_string *property__StaticProp_name = zend_string_init("_StaticProp", sizeof("_StaticProp") - 1, true); zend_declare_typed_property(class_entry, property__StaticProp_name, &property__StaticProp_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property__StaticProp_name); + zend_string_release_ex(property__StaticProp_name, true); zval property_staticIntProp_default_value; ZVAL_LONG(&property_staticIntProp_default_value, 123); - zend_string *property_staticIntProp_name = zend_string_init("staticIntProp", sizeof("staticIntProp") - 1, 1); + zend_string *property_staticIntProp_name = zend_string_init("staticIntProp", sizeof("staticIntProp") - 1, true); zend_declare_typed_property(class_entry, property_staticIntProp_name, &property_staticIntProp_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_staticIntProp_name); + zend_string_release_ex(property_staticIntProp_name, true); zval property_intProp_default_value; ZVAL_LONG(&property_intProp_default_value, 123); - zend_string *property_intProp_name = zend_string_init("intProp", sizeof("intProp") - 1, 1); + zend_string *property_intProp_name = zend_string_init("intProp", sizeof("intProp") - 1, true); zend_declare_typed_property(class_entry, property_intProp_name, &property_intProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_intProp_name); + zend_string_release_ex(property_intProp_name, true); zval property_classProp_default_value; ZVAL_NULL(&property_classProp_default_value); - zend_string *property_classProp_name = zend_string_init("classProp", sizeof("classProp") - 1, 1); + zend_string *property_classProp_name = zend_string_init("classProp", sizeof("classProp") - 1, true); zend_string *property_classProp_class_stdClass = zend_string_init("stdClass", sizeof("stdClass")-1, 1); zend_declare_typed_property(class_entry, property_classProp_name, &property_classProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classProp_class_stdClass, 0, MAY_BE_NULL)); - zend_string_release(property_classProp_name); + zend_string_release_ex(property_classProp_name, true); zval property_classUnionProp_default_value; ZVAL_NULL(&property_classUnionProp_default_value); - zend_string *property_classUnionProp_name = zend_string_init("classUnionProp", sizeof("classUnionProp") - 1, 1); + zend_string *property_classUnionProp_name = zend_string_init("classUnionProp", sizeof("classUnionProp") - 1, true); zend_string *property_classUnionProp_class_stdClass = zend_string_init("stdClass", sizeof("stdClass") - 1, 1); zend_string *property_classUnionProp_class_Iterator = zend_string_init("Iterator", sizeof("Iterator") - 1, 1); zend_type_list *property_classUnionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); @@ -796,11 +796,11 @@ static zend_class_entry *register_class__ZendTestClass(zend_class_entry *class_e property_classUnionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_classUnionProp_class_Iterator, 0, 0); zend_type property_classUnionProp_type = ZEND_TYPE_INIT_UNION(property_classUnionProp_type_list, MAY_BE_NULL); zend_declare_typed_property(class_entry, property_classUnionProp_name, &property_classUnionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_classUnionProp_type); - zend_string_release(property_classUnionProp_name); + zend_string_release_ex(property_classUnionProp_name, true); zval property_classIntersectionProp_default_value; ZVAL_UNDEF(&property_classIntersectionProp_default_value); - zend_string *property_classIntersectionProp_name = zend_string_init("classIntersectionProp", sizeof("classIntersectionProp") - 1, 1); + zend_string *property_classIntersectionProp_name = zend_string_init("classIntersectionProp", sizeof("classIntersectionProp") - 1, true); zend_string *property_classIntersectionProp_class_Traversable = zend_string_init("Traversable", sizeof("Traversable") - 1, 1); zend_string *property_classIntersectionProp_class_Countable = zend_string_init("Countable", sizeof("Countable") - 1, 1); zend_type_list *property_classIntersectionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); @@ -809,32 +809,32 @@ static zend_class_entry *register_class__ZendTestClass(zend_class_entry *class_e property_classIntersectionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_classIntersectionProp_class_Countable, 0, 0); zend_type property_classIntersectionProp_type = ZEND_TYPE_INIT_INTERSECTION(property_classIntersectionProp_type_list, 0); zend_declare_typed_property(class_entry, property_classIntersectionProp_name, &property_classIntersectionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_classIntersectionProp_type); - zend_string_release(property_classIntersectionProp_name); + zend_string_release_ex(property_classIntersectionProp_name, true); zval property_readonlyProp_default_value; ZVAL_UNDEF(&property_readonlyProp_default_value); - zend_string *property_readonlyProp_name = zend_string_init("readonlyProp", sizeof("readonlyProp") - 1, 1); + zend_string *property_readonlyProp_name = zend_string_init("readonlyProp", sizeof("readonlyProp") - 1, true); #if (PHP_VERSION_ID >= 80100) zend_declare_typed_property(class_entry, property_readonlyProp_name, &property_readonlyProp_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #elif (PHP_VERSION_ID >= 80000) zend_declare_typed_property(class_entry, property_readonlyProp_name, &property_readonlyProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #endif - zend_string_release(property_readonlyProp_name); + zend_string_release_ex(property_readonlyProp_name, true); zval property_finalProp_default_value; ZVAL_UNDEF(&property_finalProp_default_value); - zend_string *property_finalProp_name = zend_string_init("finalProp", sizeof("finalProp") - 1, 1); + zend_string *property_finalProp_name = zend_string_init("finalProp", sizeof("finalProp") - 1, true); #if (PHP_VERSION_ID >= 80400) zend_declare_typed_property(class_entry, property_finalProp_name, &property_finalProp_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #elif (PHP_VERSION_ID >= 80000) zend_declare_typed_property(class_entry, property_finalProp_name, &property_finalProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); #endif - zend_string_release(property_finalProp_name); + zend_string_release_ex(property_finalProp_name, true); - zend_string *attribute_name_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, 1); + zend_string *attribute_name_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0 = zend_string_init_interned("Deprecated", sizeof("Deprecated") - 1, true); zend_attribute *attribute_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0 = zend_add_class_constant_attribute(class_entry, const_ZEND_TEST_DEPRECATED_ATTR, attribute_name_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0, 1); - zend_string_release(attribute_name_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0); + zend_string_release_ex(attribute_name_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0, true); zend_string *attribute_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0_arg0_str = zend_string_init("custom message", strlen("custom message"), 1); ZVAL_STR(&attribute_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0->args[0].value, attribute_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0_arg0_str); attribute_Deprecated_const_ZEND_TEST_DEPRECATED_ATTR_0->args[0].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); @@ -916,40 +916,40 @@ static zend_class_entry *register_class_ZendAttributeTest(void) zval const_TEST_CONST_value; ZVAL_LONG(&const_TEST_CONST_value, 1); - zend_string *const_TEST_CONST_name = zend_string_init_interned("TEST_CONST", sizeof("TEST_CONST") - 1, 1); + zend_string *const_TEST_CONST_name = zend_string_init_interned("TEST_CONST", sizeof("TEST_CONST") - 1, true); zend_class_constant *const_TEST_CONST = zend_declare_class_constant_ex(class_entry, const_TEST_CONST_name, &const_TEST_CONST_value, ZEND_ACC_PUBLIC, NULL); - zend_string_release(const_TEST_CONST_name); + zend_string_release_ex(const_TEST_CONST_name, true); zval property_testProp_default_value; ZVAL_NULL(&property_testProp_default_value); - zend_string *property_testProp_name = zend_string_init("testProp", sizeof("testProp") - 1, 1); + zend_string *property_testProp_name = zend_string_init("testProp", sizeof("testProp") - 1, true); zend_property_info *property_testProp = zend_declare_typed_property(class_entry, property_testProp_name, &property_testProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property_testProp_name); + zend_string_release_ex(property_testProp_name, true); - zend_string *attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_0 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, 1); + zend_string *attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_0 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, true); zend_add_class_constant_attribute(class_entry, const_TEST_CONST, attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_0, 0); - zend_string_release(attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_0); + zend_string_release_ex(attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_0, true); - zend_string *attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_1 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, 1); + zend_string *attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_1 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, true); zend_add_class_constant_attribute(class_entry, const_TEST_CONST, attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_1, 0); - zend_string_release(attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_1); + zend_string_release_ex(attribute_name_ZendTestRepeatableAttribute_const_TEST_CONST_1, true); - zend_string *attribute_name_ZendTestRepeatableAttribute_property_testProp_0 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, 1); + zend_string *attribute_name_ZendTestRepeatableAttribute_property_testProp_0 = zend_string_init_interned("ZendTestRepeatableAttribute", sizeof("ZendTestRepeatableAttribute") - 1, true); zend_add_property_attribute(class_entry, property_testProp, attribute_name_ZendTestRepeatableAttribute_property_testProp_0, 0); - zend_string_release(attribute_name_ZendTestRepeatableAttribute_property_testProp_0); + zend_string_release_ex(attribute_name_ZendTestRepeatableAttribute_property_testProp_0, true); - zend_string *attribute_name_ZendTestPropertyAttribute_property_testProp_1 = zend_string_init_interned("ZendTestPropertyAttribute", sizeof("ZendTestPropertyAttribute") - 1, 1); + zend_string *attribute_name_ZendTestPropertyAttribute_property_testProp_1 = zend_string_init_interned("ZendTestPropertyAttribute", sizeof("ZendTestPropertyAttribute") - 1, true); zend_attribute *attribute_ZendTestPropertyAttribute_property_testProp_1 = zend_add_property_attribute(class_entry, property_testProp, attribute_name_ZendTestPropertyAttribute_property_testProp_1, 1); - zend_string_release(attribute_name_ZendTestPropertyAttribute_property_testProp_1); + zend_string_release_ex(attribute_name_ZendTestPropertyAttribute_property_testProp_1, true); zend_string *attribute_ZendTestPropertyAttribute_property_testProp_1_arg0_str = zend_string_init("testProp", strlen("testProp"), 1); ZVAL_STR(&attribute_ZendTestPropertyAttribute_property_testProp_1->args[0].value, attribute_ZendTestPropertyAttribute_property_testProp_1_arg0_str); - zend_string *attribute_name_ZendTestAttribute_func_testmethod_0 = zend_string_init_interned("ZendTestAttribute", sizeof("ZendTestAttribute") - 1, 1); + zend_string *attribute_name_ZendTestAttribute_func_testmethod_0 = zend_string_init_interned("ZendTestAttribute", sizeof("ZendTestAttribute") - 1, true); zend_add_function_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "testmethod", sizeof("testmethod") - 1), attribute_name_ZendTestAttribute_func_testmethod_0, 0); - zend_string_release(attribute_name_ZendTestAttribute_func_testmethod_0); + zend_string_release_ex(attribute_name_ZendTestAttribute_func_testmethod_0, true); return class_entry; } @@ -968,13 +968,13 @@ static zend_class_entry *register_class__ZendTestTrait(void) zval property_testProp_default_value; ZVAL_NULL(&property_testProp_default_value); - zend_string *property_testProp_name = zend_string_init("testProp", sizeof("testProp") - 1, 1); + zend_string *property_testProp_name = zend_string_init("testProp", sizeof("testProp") - 1, true); zend_declare_typed_property(class_entry, property_testProp_name, &property_testProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); - zend_string_release(property_testProp_name); + zend_string_release_ex(property_testProp_name, true); zval property_classUnionProp_default_value; ZVAL_UNDEF(&property_classUnionProp_default_value); - zend_string *property_classUnionProp_name = zend_string_init("classUnionProp", sizeof("classUnionProp") - 1, 1); + zend_string *property_classUnionProp_name = zend_string_init("classUnionProp", sizeof("classUnionProp") - 1, true); zend_string *property_classUnionProp_class_Traversable = zend_string_init("Traversable", sizeof("Traversable") - 1, 1); zend_string *property_classUnionProp_class_Countable = zend_string_init("Countable", sizeof("Countable") - 1, 1); zend_type_list *property_classUnionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); @@ -983,7 +983,7 @@ static zend_class_entry *register_class__ZendTestTrait(void) property_classUnionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_classUnionProp_class_Countable, 0, 0); zend_type property_classUnionProp_type = ZEND_TYPE_INIT_UNION(property_classUnionProp_type_list, 0); zend_declare_typed_property(class_entry, property_classUnionProp_name, &property_classUnionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_classUnionProp_type); - zend_string_release(property_classUnionProp_name); + zend_string_release_ex(property_classUnionProp_name, true); return class_entry; } @@ -1000,9 +1000,9 @@ static zend_class_entry *register_class_ZendTestAttribute(void) class_entry->ce_flags |= ZEND_ACC_FINAL; #endif - zend_string *attribute_name_Attribute_class_ZendTestAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ZendTestAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ZendTestAttribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ZendTestAttribute_0, 1); - zend_string_release(attribute_name_Attribute_class_ZendTestAttribute_0); + zend_string_release_ex(attribute_name_Attribute_class_ZendTestAttribute_0, true); ZVAL_LONG(&attribute_Attribute_class_ZendTestAttribute_0->args[0].value, ZEND_ATTRIBUTE_TARGET_ALL); return class_entry; @@ -1022,17 +1022,17 @@ static zend_class_entry *register_class_ZendTestAttributeWithArguments(void) zval property_arg_default_value; ZVAL_UNDEF(&property_arg_default_value); - zend_string *property_arg_name = zend_string_init("arg", sizeof("arg") - 1, 1); + zend_string *property_arg_name = zend_string_init("arg", sizeof("arg") - 1, true); #if (PHP_VERSION_ID >= 80100) zend_declare_typed_property(class_entry, property_arg_name, &property_arg_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); #elif (PHP_VERSION_ID >= 80000) zend_declare_typed_property(class_entry, property_arg_name, &property_arg_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); #endif - zend_string_release(property_arg_name); + zend_string_release_ex(property_arg_name, true); - zend_string *attribute_name_Attribute_class_ZendTestAttributeWithArguments_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ZendTestAttributeWithArguments_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ZendTestAttributeWithArguments_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ZendTestAttributeWithArguments_0, 1); - zend_string_release(attribute_name_Attribute_class_ZendTestAttributeWithArguments_0); + zend_string_release_ex(attribute_name_Attribute_class_ZendTestAttributeWithArguments_0, true); ZVAL_LONG(&attribute_Attribute_class_ZendTestAttributeWithArguments_0->args[0].value, ZEND_ATTRIBUTE_TARGET_ALL); return class_entry; @@ -1050,9 +1050,9 @@ static zend_class_entry *register_class_ZendTestRepeatableAttribute(void) class_entry->ce_flags |= ZEND_ACC_FINAL; #endif - zend_string *attribute_name_Attribute_class_ZendTestRepeatableAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ZendTestRepeatableAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ZendTestRepeatableAttribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ZendTestRepeatableAttribute_0, 1); - zend_string_release(attribute_name_Attribute_class_ZendTestRepeatableAttribute_0); + zend_string_release_ex(attribute_name_Attribute_class_ZendTestRepeatableAttribute_0, true); ZVAL_LONG(&attribute_Attribute_class_ZendTestRepeatableAttribute_0->args[0].value, ZEND_ATTRIBUTE_TARGET_ALL | ZEND_ATTRIBUTE_IS_REPEATABLE); return class_entry; @@ -1072,13 +1072,13 @@ static zend_class_entry *register_class_ZendTestParameterAttribute(void) zval property_parameter_default_value; ZVAL_UNDEF(&property_parameter_default_value); - zend_string *property_parameter_name = zend_string_init("parameter", sizeof("parameter") - 1, 1); + zend_string *property_parameter_name = zend_string_init("parameter", sizeof("parameter") - 1, true); zend_declare_typed_property(class_entry, property_parameter_name, &property_parameter_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_parameter_name); + zend_string_release_ex(property_parameter_name, true); - zend_string *attribute_name_Attribute_class_ZendTestParameterAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ZendTestParameterAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ZendTestParameterAttribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ZendTestParameterAttribute_0, 1); - zend_string_release(attribute_name_Attribute_class_ZendTestParameterAttribute_0); + zend_string_release_ex(attribute_name_Attribute_class_ZendTestParameterAttribute_0, true); ZVAL_LONG(&attribute_Attribute_class_ZendTestParameterAttribute_0->args[0].value, ZEND_ATTRIBUTE_TARGET_PARAMETER); return class_entry; @@ -1101,14 +1101,14 @@ static zend_class_entry *register_class_ZendTestPropertyAttribute(void) zval property_parameter_default_value; ZVAL_UNDEF(&property_parameter_default_value); - zend_string *property_parameter_name = zend_string_init("parameter", sizeof("parameter") - 1, 1); + zend_string *property_parameter_name = zend_string_init("parameter", sizeof("parameter") - 1, true); zend_string *property_parameter_comment = zend_string_init_interned("/**\n * \"Lorem ipsum\"\n * @see https://www.php.net\n * @since 8.4\n */", 98, 1); zend_declare_typed_property(class_entry, property_parameter_name, &property_parameter_default_value, ZEND_ACC_PUBLIC, property_parameter_comment, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_parameter_name); + zend_string_release_ex(property_parameter_name, true); - zend_string *attribute_name_Attribute_class_ZendTestPropertyAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_string *attribute_name_Attribute_class_ZendTestPropertyAttribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, true); zend_attribute *attribute_Attribute_class_ZendTestPropertyAttribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ZendTestPropertyAttribute_0, 1); - zend_string_release(attribute_name_Attribute_class_ZendTestPropertyAttribute_0); + zend_string_release_ex(attribute_name_Attribute_class_ZendTestPropertyAttribute_0, true); ZVAL_LONG(&attribute_Attribute_class_ZendTestPropertyAttribute_0->args[0].value, ZEND_ATTRIBUTE_TARGET_PROPERTY); return class_entry; @@ -1126,15 +1126,15 @@ static zend_class_entry *register_class_ZendTestClassWithMethodWithParameterAttr #endif - zend_string *attribute_name_ZendTestParameterAttribute_func_no_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, 1); + zend_string *attribute_name_ZendTestParameterAttribute_func_no_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, true); zend_attribute *attribute_ZendTestParameterAttribute_func_no_override_arg0_0 = zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "no_override", sizeof("no_override") - 1), 0, attribute_name_ZendTestParameterAttribute_func_no_override_arg0_0, 1); - zend_string_release(attribute_name_ZendTestParameterAttribute_func_no_override_arg0_0); + zend_string_release_ex(attribute_name_ZendTestParameterAttribute_func_no_override_arg0_0, true); zend_string *attribute_ZendTestParameterAttribute_func_no_override_arg0_0_arg0_str = zend_string_init("value2", strlen("value2"), 1); ZVAL_STR(&attribute_ZendTestParameterAttribute_func_no_override_arg0_0->args[0].value, attribute_ZendTestParameterAttribute_func_no_override_arg0_0_arg0_str); - zend_string *attribute_name_ZendTestParameterAttribute_func_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, 1); + zend_string *attribute_name_ZendTestParameterAttribute_func_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, true); zend_attribute *attribute_ZendTestParameterAttribute_func_override_arg0_0 = zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "override", sizeof("override") - 1), 0, attribute_name_ZendTestParameterAttribute_func_override_arg0_0, 1); - zend_string_release(attribute_name_ZendTestParameterAttribute_func_override_arg0_0); + zend_string_release_ex(attribute_name_ZendTestParameterAttribute_func_override_arg0_0, true); zend_string *attribute_ZendTestParameterAttribute_func_override_arg0_0_arg0_str = zend_string_init("value3", strlen("value3"), 1); ZVAL_STR(&attribute_ZendTestParameterAttribute_func_override_arg0_0->args[0].value, attribute_ZendTestParameterAttribute_func_override_arg0_0_arg0_str); @@ -1153,9 +1153,9 @@ static zend_class_entry *register_class_ZendTestChildClassWithMethodWithParamete #endif - zend_string *attribute_name_ZendTestParameterAttribute_func_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, 1); + zend_string *attribute_name_ZendTestParameterAttribute_func_override_arg0_0 = zend_string_init_interned("ZendTestParameterAttribute", sizeof("ZendTestParameterAttribute") - 1, true); zend_attribute *attribute_ZendTestParameterAttribute_func_override_arg0_0 = zend_add_parameter_attribute(zend_hash_str_find_ptr(&class_entry->function_table, "override", sizeof("override") - 1), 0, attribute_name_ZendTestParameterAttribute_func_override_arg0_0, 1); - zend_string_release(attribute_name_ZendTestParameterAttribute_func_override_arg0_0); + zend_string_release_ex(attribute_name_ZendTestParameterAttribute_func_override_arg0_0, true); zend_string *attribute_ZendTestParameterAttribute_func_override_arg0_0_arg0_str = zend_string_init("value4", strlen("value4"), 1); ZVAL_STR(&attribute_ZendTestParameterAttribute_func_override_arg0_0->args[0].value, attribute_ZendTestParameterAttribute_func_override_arg0_0_arg0_str); @@ -1175,14 +1175,14 @@ static zend_class_entry *register_class_ZendTestClassWithPropertyAttribute(void) zval property_attributed_default_value; ZVAL_UNDEF(&property_attributed_default_value); - zend_string *property_attributed_name = zend_string_init("attributed", sizeof("attributed") - 1, 1); + zend_string *property_attributed_name = zend_string_init("attributed", sizeof("attributed") - 1, true); zend_property_info *property_attributed = zend_declare_typed_property(class_entry, property_attributed_name, &property_attributed_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_attributed_name); + zend_string_release_ex(property_attributed_name, true); - zend_string *attribute_name_ZendTestAttribute_property_attributed_0 = zend_string_init_interned("ZendTestAttribute", sizeof("ZendTestAttribute") - 1, 1); + zend_string *attribute_name_ZendTestAttribute_property_attributed_0 = zend_string_init_interned("ZendTestAttribute", sizeof("ZendTestAttribute") - 1, true); zend_add_property_attribute(class_entry, property_attributed, attribute_name_ZendTestAttribute_property_attributed_0, 0); - zend_string_release(attribute_name_ZendTestAttribute_property_attributed_0); + zend_string_release_ex(attribute_name_ZendTestAttribute_property_attributed_0, true); return class_entry; } @@ -1320,10 +1320,10 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zval property_foo_default_value; ZVAL_UNDEF(&property_foo_default_value); - zend_string *property_foo_name = zend_string_init("foo", sizeof("foo") - 1, 1); + zend_string *property_foo_name = zend_string_init("foo", sizeof("foo") - 1, true); zend_string *property_foo_class_ZendTestNS2_ZendSubNS_Foo = zend_string_init("ZendTestNS2\\ZendSubNS\\Foo", sizeof("ZendTestNS2\\ZendSubNS\\Foo")-1, 1); zend_declare_typed_property(class_entry, property_foo_name, &property_foo_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_foo_class_ZendTestNS2_ZendSubNS_Foo, 0, 0)); - zend_string_release(property_foo_name); + zend_string_release_ex(property_foo_name, true); return class_entry; } diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index 2a24750142c95..ed636339088f0 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -535,740 +535,740 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_CREATE_value; ZVAL_LONG(&const_CREATE_value, ZIP_CREATE); - zend_string *const_CREATE_name = zend_string_init_interned("CREATE", sizeof("CREATE") - 1, 1); + zend_string *const_CREATE_name = zend_string_init_interned("CREATE", sizeof("CREATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CREATE_name, &const_CREATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CREATE_name); + zend_string_release_ex(const_CREATE_name, true); zval const_EXCL_value; ZVAL_LONG(&const_EXCL_value, ZIP_EXCL); - zend_string *const_EXCL_name = zend_string_init_interned("EXCL", sizeof("EXCL") - 1, 1); + zend_string *const_EXCL_name = zend_string_init_interned("EXCL", sizeof("EXCL") - 1, true); zend_declare_typed_class_constant(class_entry, const_EXCL_name, &const_EXCL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EXCL_name); + zend_string_release_ex(const_EXCL_name, true); zval const_CHECKCONS_value; ZVAL_LONG(&const_CHECKCONS_value, ZIP_CHECKCONS); - zend_string *const_CHECKCONS_name = zend_string_init_interned("CHECKCONS", sizeof("CHECKCONS") - 1, 1); + zend_string *const_CHECKCONS_name = zend_string_init_interned("CHECKCONS", sizeof("CHECKCONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_CHECKCONS_name, &const_CHECKCONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CHECKCONS_name); + zend_string_release_ex(const_CHECKCONS_name, true); zval const_OVERWRITE_value; ZVAL_LONG(&const_OVERWRITE_value, ZIP_OVERWRITE); - zend_string *const_OVERWRITE_name = zend_string_init_interned("OVERWRITE", sizeof("OVERWRITE") - 1, 1); + zend_string *const_OVERWRITE_name = zend_string_init_interned("OVERWRITE", sizeof("OVERWRITE") - 1, true); zend_declare_typed_class_constant(class_entry, const_OVERWRITE_name, &const_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OVERWRITE_name); + zend_string_release_ex(const_OVERWRITE_name, true); #if defined(ZIP_RDONLY) zval const_RDONLY_value; ZVAL_LONG(&const_RDONLY_value, ZIP_RDONLY); - zend_string *const_RDONLY_name = zend_string_init_interned("RDONLY", sizeof("RDONLY") - 1, 1); + zend_string *const_RDONLY_name = zend_string_init_interned("RDONLY", sizeof("RDONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_RDONLY_name, &const_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_RDONLY_name); + zend_string_release_ex(const_RDONLY_name, true); #endif zval const_FL_NOCASE_value; ZVAL_LONG(&const_FL_NOCASE_value, ZIP_FL_NOCASE); - zend_string *const_FL_NOCASE_name = zend_string_init_interned("FL_NOCASE", sizeof("FL_NOCASE") - 1, 1); + zend_string *const_FL_NOCASE_name = zend_string_init_interned("FL_NOCASE", sizeof("FL_NOCASE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_NOCASE_name, &const_FL_NOCASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_NOCASE_name); + zend_string_release_ex(const_FL_NOCASE_name, true); zval const_FL_NODIR_value; ZVAL_LONG(&const_FL_NODIR_value, ZIP_FL_NODIR); - zend_string *const_FL_NODIR_name = zend_string_init_interned("FL_NODIR", sizeof("FL_NODIR") - 1, 1); + zend_string *const_FL_NODIR_name = zend_string_init_interned("FL_NODIR", sizeof("FL_NODIR") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_NODIR_name, &const_FL_NODIR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_NODIR_name); + zend_string_release_ex(const_FL_NODIR_name, true); zval const_FL_COMPRESSED_value; ZVAL_LONG(&const_FL_COMPRESSED_value, ZIP_FL_COMPRESSED); - zend_string *const_FL_COMPRESSED_name = zend_string_init_interned("FL_COMPRESSED", sizeof("FL_COMPRESSED") - 1, 1); + zend_string *const_FL_COMPRESSED_name = zend_string_init_interned("FL_COMPRESSED", sizeof("FL_COMPRESSED") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_COMPRESSED_name, &const_FL_COMPRESSED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_COMPRESSED_name); + zend_string_release_ex(const_FL_COMPRESSED_name, true); zval const_FL_UNCHANGED_value; ZVAL_LONG(&const_FL_UNCHANGED_value, ZIP_FL_UNCHANGED); - zend_string *const_FL_UNCHANGED_name = zend_string_init_interned("FL_UNCHANGED", sizeof("FL_UNCHANGED") - 1, 1); + zend_string *const_FL_UNCHANGED_name = zend_string_init_interned("FL_UNCHANGED", sizeof("FL_UNCHANGED") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_UNCHANGED_name, &const_FL_UNCHANGED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_UNCHANGED_name); + zend_string_release_ex(const_FL_UNCHANGED_name, true); #if defined(ZIP_FL_RECOMPRESS) zval const_FL_RECOMPRESS_value; ZVAL_LONG(&const_FL_RECOMPRESS_value, ZIP_FL_RECOMPRESS); - zend_string *const_FL_RECOMPRESS_name = zend_string_init_interned("FL_RECOMPRESS", sizeof("FL_RECOMPRESS") - 1, 1); + zend_string *const_FL_RECOMPRESS_name = zend_string_init_interned("FL_RECOMPRESS", sizeof("FL_RECOMPRESS") - 1, true); zend_class_constant *const_FL_RECOMPRESS = zend_declare_typed_class_constant(class_entry, const_FL_RECOMPRESS_name, &const_FL_RECOMPRESS_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_RECOMPRESS_name); + zend_string_release_ex(const_FL_RECOMPRESS_name, true); #endif zval const_FL_ENCRYPTED_value; ZVAL_LONG(&const_FL_ENCRYPTED_value, ZIP_FL_ENCRYPTED); - zend_string *const_FL_ENCRYPTED_name = zend_string_init_interned("FL_ENCRYPTED", sizeof("FL_ENCRYPTED") - 1, 1); + zend_string *const_FL_ENCRYPTED_name = zend_string_init_interned("FL_ENCRYPTED", sizeof("FL_ENCRYPTED") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENCRYPTED_name, &const_FL_ENCRYPTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENCRYPTED_name); + zend_string_release_ex(const_FL_ENCRYPTED_name, true); zval const_FL_OVERWRITE_value; ZVAL_LONG(&const_FL_OVERWRITE_value, ZIP_FL_OVERWRITE); - zend_string *const_FL_OVERWRITE_name = zend_string_init_interned("FL_OVERWRITE", sizeof("FL_OVERWRITE") - 1, 1); + zend_string *const_FL_OVERWRITE_name = zend_string_init_interned("FL_OVERWRITE", sizeof("FL_OVERWRITE") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_OVERWRITE_name, &const_FL_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_OVERWRITE_name); + zend_string_release_ex(const_FL_OVERWRITE_name, true); zval const_FL_LOCAL_value; ZVAL_LONG(&const_FL_LOCAL_value, ZIP_FL_LOCAL); - zend_string *const_FL_LOCAL_name = zend_string_init_interned("FL_LOCAL", sizeof("FL_LOCAL") - 1, 1); + zend_string *const_FL_LOCAL_name = zend_string_init_interned("FL_LOCAL", sizeof("FL_LOCAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_LOCAL_name, &const_FL_LOCAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_LOCAL_name); + zend_string_release_ex(const_FL_LOCAL_name, true); zval const_FL_CENTRAL_value; ZVAL_LONG(&const_FL_CENTRAL_value, ZIP_FL_CENTRAL); - zend_string *const_FL_CENTRAL_name = zend_string_init_interned("FL_CENTRAL", sizeof("FL_CENTRAL") - 1, 1); + zend_string *const_FL_CENTRAL_name = zend_string_init_interned("FL_CENTRAL", sizeof("FL_CENTRAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_CENTRAL_name, &const_FL_CENTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_CENTRAL_name); + zend_string_release_ex(const_FL_CENTRAL_name, true); zval const_FL_ENC_GUESS_value; ZVAL_LONG(&const_FL_ENC_GUESS_value, ZIP_FL_ENC_GUESS); - zend_string *const_FL_ENC_GUESS_name = zend_string_init_interned("FL_ENC_GUESS", sizeof("FL_ENC_GUESS") - 1, 1); + zend_string *const_FL_ENC_GUESS_name = zend_string_init_interned("FL_ENC_GUESS", sizeof("FL_ENC_GUESS") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENC_GUESS_name, &const_FL_ENC_GUESS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENC_GUESS_name); + zend_string_release_ex(const_FL_ENC_GUESS_name, true); zval const_FL_ENC_RAW_value; ZVAL_LONG(&const_FL_ENC_RAW_value, ZIP_FL_ENC_RAW); - zend_string *const_FL_ENC_RAW_name = zend_string_init_interned("FL_ENC_RAW", sizeof("FL_ENC_RAW") - 1, 1); + zend_string *const_FL_ENC_RAW_name = zend_string_init_interned("FL_ENC_RAW", sizeof("FL_ENC_RAW") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENC_RAW_name, &const_FL_ENC_RAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENC_RAW_name); + zend_string_release_ex(const_FL_ENC_RAW_name, true); zval const_FL_ENC_STRICT_value; ZVAL_LONG(&const_FL_ENC_STRICT_value, ZIP_FL_ENC_STRICT); - zend_string *const_FL_ENC_STRICT_name = zend_string_init_interned("FL_ENC_STRICT", sizeof("FL_ENC_STRICT") - 1, 1); + zend_string *const_FL_ENC_STRICT_name = zend_string_init_interned("FL_ENC_STRICT", sizeof("FL_ENC_STRICT") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENC_STRICT_name, &const_FL_ENC_STRICT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENC_STRICT_name); + zend_string_release_ex(const_FL_ENC_STRICT_name, true); zval const_FL_ENC_UTF_8_value; ZVAL_LONG(&const_FL_ENC_UTF_8_value, ZIP_FL_ENC_UTF_8); - zend_string *const_FL_ENC_UTF_8_name = zend_string_init_interned("FL_ENC_UTF_8", sizeof("FL_ENC_UTF_8") - 1, 1); + zend_string *const_FL_ENC_UTF_8_name = zend_string_init_interned("FL_ENC_UTF_8", sizeof("FL_ENC_UTF_8") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENC_UTF_8_name, &const_FL_ENC_UTF_8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENC_UTF_8_name); + zend_string_release_ex(const_FL_ENC_UTF_8_name, true); zval const_FL_ENC_CP437_value; ZVAL_LONG(&const_FL_ENC_CP437_value, ZIP_FL_ENC_CP437); - zend_string *const_FL_ENC_CP437_name = zend_string_init_interned("FL_ENC_CP437", sizeof("FL_ENC_CP437") - 1, 1); + zend_string *const_FL_ENC_CP437_name = zend_string_init_interned("FL_ENC_CP437", sizeof("FL_ENC_CP437") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_ENC_CP437_name, &const_FL_ENC_CP437_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_ENC_CP437_name); + zend_string_release_ex(const_FL_ENC_CP437_name, true); zval const_FL_OPEN_FILE_NOW_value; ZVAL_LONG(&const_FL_OPEN_FILE_NOW_value, ZIP_FL_OPEN_FILE_NOW); - zend_string *const_FL_OPEN_FILE_NOW_name = zend_string_init_interned("FL_OPEN_FILE_NOW", sizeof("FL_OPEN_FILE_NOW") - 1, 1); + zend_string *const_FL_OPEN_FILE_NOW_name = zend_string_init_interned("FL_OPEN_FILE_NOW", sizeof("FL_OPEN_FILE_NOW") - 1, true); zend_declare_typed_class_constant(class_entry, const_FL_OPEN_FILE_NOW_name, &const_FL_OPEN_FILE_NOW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_FL_OPEN_FILE_NOW_name); + zend_string_release_ex(const_FL_OPEN_FILE_NOW_name, true); zval const_CM_DEFAULT_value; ZVAL_LONG(&const_CM_DEFAULT_value, ZIP_CM_DEFAULT); - zend_string *const_CM_DEFAULT_name = zend_string_init_interned("CM_DEFAULT", sizeof("CM_DEFAULT") - 1, 1); + zend_string *const_CM_DEFAULT_name = zend_string_init_interned("CM_DEFAULT", sizeof("CM_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_DEFAULT_name, &const_CM_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_DEFAULT_name); + zend_string_release_ex(const_CM_DEFAULT_name, true); zval const_CM_STORE_value; ZVAL_LONG(&const_CM_STORE_value, ZIP_CM_STORE); - zend_string *const_CM_STORE_name = zend_string_init_interned("CM_STORE", sizeof("CM_STORE") - 1, 1); + zend_string *const_CM_STORE_name = zend_string_init_interned("CM_STORE", sizeof("CM_STORE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_STORE_name, &const_CM_STORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_STORE_name); + zend_string_release_ex(const_CM_STORE_name, true); zval const_CM_SHRINK_value; ZVAL_LONG(&const_CM_SHRINK_value, ZIP_CM_SHRINK); - zend_string *const_CM_SHRINK_name = zend_string_init_interned("CM_SHRINK", sizeof("CM_SHRINK") - 1, 1); + zend_string *const_CM_SHRINK_name = zend_string_init_interned("CM_SHRINK", sizeof("CM_SHRINK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_SHRINK_name, &const_CM_SHRINK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_SHRINK_name); + zend_string_release_ex(const_CM_SHRINK_name, true); zval const_CM_REDUCE_1_value; ZVAL_LONG(&const_CM_REDUCE_1_value, ZIP_CM_REDUCE_1); - zend_string *const_CM_REDUCE_1_name = zend_string_init_interned("CM_REDUCE_1", sizeof("CM_REDUCE_1") - 1, 1); + zend_string *const_CM_REDUCE_1_name = zend_string_init_interned("CM_REDUCE_1", sizeof("CM_REDUCE_1") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_1_name, &const_CM_REDUCE_1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_REDUCE_1_name); + zend_string_release_ex(const_CM_REDUCE_1_name, true); zval const_CM_REDUCE_2_value; ZVAL_LONG(&const_CM_REDUCE_2_value, ZIP_CM_REDUCE_2); - zend_string *const_CM_REDUCE_2_name = zend_string_init_interned("CM_REDUCE_2", sizeof("CM_REDUCE_2") - 1, 1); + zend_string *const_CM_REDUCE_2_name = zend_string_init_interned("CM_REDUCE_2", sizeof("CM_REDUCE_2") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_2_name, &const_CM_REDUCE_2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_REDUCE_2_name); + zend_string_release_ex(const_CM_REDUCE_2_name, true); zval const_CM_REDUCE_3_value; ZVAL_LONG(&const_CM_REDUCE_3_value, ZIP_CM_REDUCE_3); - zend_string *const_CM_REDUCE_3_name = zend_string_init_interned("CM_REDUCE_3", sizeof("CM_REDUCE_3") - 1, 1); + zend_string *const_CM_REDUCE_3_name = zend_string_init_interned("CM_REDUCE_3", sizeof("CM_REDUCE_3") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_3_name, &const_CM_REDUCE_3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_REDUCE_3_name); + zend_string_release_ex(const_CM_REDUCE_3_name, true); zval const_CM_REDUCE_4_value; ZVAL_LONG(&const_CM_REDUCE_4_value, ZIP_CM_REDUCE_4); - zend_string *const_CM_REDUCE_4_name = zend_string_init_interned("CM_REDUCE_4", sizeof("CM_REDUCE_4") - 1, 1); + zend_string *const_CM_REDUCE_4_name = zend_string_init_interned("CM_REDUCE_4", sizeof("CM_REDUCE_4") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_4_name, &const_CM_REDUCE_4_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_REDUCE_4_name); + zend_string_release_ex(const_CM_REDUCE_4_name, true); zval const_CM_IMPLODE_value; ZVAL_LONG(&const_CM_IMPLODE_value, ZIP_CM_IMPLODE); - zend_string *const_CM_IMPLODE_name = zend_string_init_interned("CM_IMPLODE", sizeof("CM_IMPLODE") - 1, 1); + zend_string *const_CM_IMPLODE_name = zend_string_init_interned("CM_IMPLODE", sizeof("CM_IMPLODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_IMPLODE_name, &const_CM_IMPLODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_IMPLODE_name); + zend_string_release_ex(const_CM_IMPLODE_name, true); zval const_CM_DEFLATE_value; ZVAL_LONG(&const_CM_DEFLATE_value, ZIP_CM_DEFLATE); - zend_string *const_CM_DEFLATE_name = zend_string_init_interned("CM_DEFLATE", sizeof("CM_DEFLATE") - 1, 1); + zend_string *const_CM_DEFLATE_name = zend_string_init_interned("CM_DEFLATE", sizeof("CM_DEFLATE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_DEFLATE_name, &const_CM_DEFLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_DEFLATE_name); + zend_string_release_ex(const_CM_DEFLATE_name, true); zval const_CM_DEFLATE64_value; ZVAL_LONG(&const_CM_DEFLATE64_value, ZIP_CM_DEFLATE64); - zend_string *const_CM_DEFLATE64_name = zend_string_init_interned("CM_DEFLATE64", sizeof("CM_DEFLATE64") - 1, 1); + zend_string *const_CM_DEFLATE64_name = zend_string_init_interned("CM_DEFLATE64", sizeof("CM_DEFLATE64") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_DEFLATE64_name, &const_CM_DEFLATE64_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_DEFLATE64_name); + zend_string_release_ex(const_CM_DEFLATE64_name, true); zval const_CM_PKWARE_IMPLODE_value; ZVAL_LONG(&const_CM_PKWARE_IMPLODE_value, ZIP_CM_PKWARE_IMPLODE); - zend_string *const_CM_PKWARE_IMPLODE_name = zend_string_init_interned("CM_PKWARE_IMPLODE", sizeof("CM_PKWARE_IMPLODE") - 1, 1); + zend_string *const_CM_PKWARE_IMPLODE_name = zend_string_init_interned("CM_PKWARE_IMPLODE", sizeof("CM_PKWARE_IMPLODE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_PKWARE_IMPLODE_name, &const_CM_PKWARE_IMPLODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_PKWARE_IMPLODE_name); + zend_string_release_ex(const_CM_PKWARE_IMPLODE_name, true); zval const_CM_BZIP2_value; ZVAL_LONG(&const_CM_BZIP2_value, ZIP_CM_BZIP2); - zend_string *const_CM_BZIP2_name = zend_string_init_interned("CM_BZIP2", sizeof("CM_BZIP2") - 1, 1); + zend_string *const_CM_BZIP2_name = zend_string_init_interned("CM_BZIP2", sizeof("CM_BZIP2") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_BZIP2_name, &const_CM_BZIP2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_BZIP2_name); + zend_string_release_ex(const_CM_BZIP2_name, true); zval const_CM_LZMA_value; ZVAL_LONG(&const_CM_LZMA_value, ZIP_CM_LZMA); - zend_string *const_CM_LZMA_name = zend_string_init_interned("CM_LZMA", sizeof("CM_LZMA") - 1, 1); + zend_string *const_CM_LZMA_name = zend_string_init_interned("CM_LZMA", sizeof("CM_LZMA") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_LZMA_name, &const_CM_LZMA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_LZMA_name); + zend_string_release_ex(const_CM_LZMA_name, true); #if defined(ZIP_CM_LZMA2) zval const_CM_LZMA2_value; ZVAL_LONG(&const_CM_LZMA2_value, ZIP_CM_LZMA2); - zend_string *const_CM_LZMA2_name = zend_string_init_interned("CM_LZMA2", sizeof("CM_LZMA2") - 1, 1); + zend_string *const_CM_LZMA2_name = zend_string_init_interned("CM_LZMA2", sizeof("CM_LZMA2") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_LZMA2_name, &const_CM_LZMA2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_LZMA2_name); + zend_string_release_ex(const_CM_LZMA2_name, true); #endif #if defined(ZIP_CM_ZSTD) zval const_CM_ZSTD_value; ZVAL_LONG(&const_CM_ZSTD_value, ZIP_CM_ZSTD); - zend_string *const_CM_ZSTD_name = zend_string_init_interned("CM_ZSTD", sizeof("CM_ZSTD") - 1, 1); + zend_string *const_CM_ZSTD_name = zend_string_init_interned("CM_ZSTD", sizeof("CM_ZSTD") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_ZSTD_name, &const_CM_ZSTD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_ZSTD_name); + zend_string_release_ex(const_CM_ZSTD_name, true); #endif #if defined(ZIP_CM_XZ) zval const_CM_XZ_value; ZVAL_LONG(&const_CM_XZ_value, ZIP_CM_XZ); - zend_string *const_CM_XZ_name = zend_string_init_interned("CM_XZ", sizeof("CM_XZ") - 1, 1); + zend_string *const_CM_XZ_name = zend_string_init_interned("CM_XZ", sizeof("CM_XZ") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_XZ_name, &const_CM_XZ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_XZ_name); + zend_string_release_ex(const_CM_XZ_name, true); #endif zval const_CM_TERSE_value; ZVAL_LONG(&const_CM_TERSE_value, ZIP_CM_TERSE); - zend_string *const_CM_TERSE_name = zend_string_init_interned("CM_TERSE", sizeof("CM_TERSE") - 1, 1); + zend_string *const_CM_TERSE_name = zend_string_init_interned("CM_TERSE", sizeof("CM_TERSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_TERSE_name, &const_CM_TERSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_TERSE_name); + zend_string_release_ex(const_CM_TERSE_name, true); zval const_CM_LZ77_value; ZVAL_LONG(&const_CM_LZ77_value, ZIP_CM_LZ77); - zend_string *const_CM_LZ77_name = zend_string_init_interned("CM_LZ77", sizeof("CM_LZ77") - 1, 1); + zend_string *const_CM_LZ77_name = zend_string_init_interned("CM_LZ77", sizeof("CM_LZ77") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_LZ77_name, &const_CM_LZ77_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_LZ77_name); + zend_string_release_ex(const_CM_LZ77_name, true); zval const_CM_WAVPACK_value; ZVAL_LONG(&const_CM_WAVPACK_value, ZIP_CM_WAVPACK); - zend_string *const_CM_WAVPACK_name = zend_string_init_interned("CM_WAVPACK", sizeof("CM_WAVPACK") - 1, 1); + zend_string *const_CM_WAVPACK_name = zend_string_init_interned("CM_WAVPACK", sizeof("CM_WAVPACK") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_WAVPACK_name, &const_CM_WAVPACK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_WAVPACK_name); + zend_string_release_ex(const_CM_WAVPACK_name, true); zval const_CM_PPMD_value; ZVAL_LONG(&const_CM_PPMD_value, ZIP_CM_PPMD); - zend_string *const_CM_PPMD_name = zend_string_init_interned("CM_PPMD", sizeof("CM_PPMD") - 1, 1); + zend_string *const_CM_PPMD_name = zend_string_init_interned("CM_PPMD", sizeof("CM_PPMD") - 1, true); zend_declare_typed_class_constant(class_entry, const_CM_PPMD_name, &const_CM_PPMD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_CM_PPMD_name); + zend_string_release_ex(const_CM_PPMD_name, true); zval const_ER_OK_value; ZVAL_LONG(&const_ER_OK_value, ZIP_ER_OK); - zend_string *const_ER_OK_name = zend_string_init_interned("ER_OK", sizeof("ER_OK") - 1, 1); + zend_string *const_ER_OK_name = zend_string_init_interned("ER_OK", sizeof("ER_OK") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_OK_name, &const_ER_OK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_OK_name); + zend_string_release_ex(const_ER_OK_name, true); zval const_ER_MULTIDISK_value; ZVAL_LONG(&const_ER_MULTIDISK_value, ZIP_ER_MULTIDISK); - zend_string *const_ER_MULTIDISK_name = zend_string_init_interned("ER_MULTIDISK", sizeof("ER_MULTIDISK") - 1, 1); + zend_string *const_ER_MULTIDISK_name = zend_string_init_interned("ER_MULTIDISK", sizeof("ER_MULTIDISK") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_MULTIDISK_name, &const_ER_MULTIDISK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_MULTIDISK_name); + zend_string_release_ex(const_ER_MULTIDISK_name, true); zval const_ER_RENAME_value; ZVAL_LONG(&const_ER_RENAME_value, ZIP_ER_RENAME); - zend_string *const_ER_RENAME_name = zend_string_init_interned("ER_RENAME", sizeof("ER_RENAME") - 1, 1); + zend_string *const_ER_RENAME_name = zend_string_init_interned("ER_RENAME", sizeof("ER_RENAME") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_RENAME_name, &const_ER_RENAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_RENAME_name); + zend_string_release_ex(const_ER_RENAME_name, true); zval const_ER_CLOSE_value; ZVAL_LONG(&const_ER_CLOSE_value, ZIP_ER_CLOSE); - zend_string *const_ER_CLOSE_name = zend_string_init_interned("ER_CLOSE", sizeof("ER_CLOSE") - 1, 1); + zend_string *const_ER_CLOSE_name = zend_string_init_interned("ER_CLOSE", sizeof("ER_CLOSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_CLOSE_name, &const_ER_CLOSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_CLOSE_name); + zend_string_release_ex(const_ER_CLOSE_name, true); zval const_ER_SEEK_value; ZVAL_LONG(&const_ER_SEEK_value, ZIP_ER_SEEK); - zend_string *const_ER_SEEK_name = zend_string_init_interned("ER_SEEK", sizeof("ER_SEEK") - 1, 1); + zend_string *const_ER_SEEK_name = zend_string_init_interned("ER_SEEK", sizeof("ER_SEEK") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_SEEK_name, &const_ER_SEEK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_SEEK_name); + zend_string_release_ex(const_ER_SEEK_name, true); zval const_ER_READ_value; ZVAL_LONG(&const_ER_READ_value, ZIP_ER_READ); - zend_string *const_ER_READ_name = zend_string_init_interned("ER_READ", sizeof("ER_READ") - 1, 1); + zend_string *const_ER_READ_name = zend_string_init_interned("ER_READ", sizeof("ER_READ") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_READ_name, &const_ER_READ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_READ_name); + zend_string_release_ex(const_ER_READ_name, true); zval const_ER_WRITE_value; ZVAL_LONG(&const_ER_WRITE_value, ZIP_ER_WRITE); - zend_string *const_ER_WRITE_name = zend_string_init_interned("ER_WRITE", sizeof("ER_WRITE") - 1, 1); + zend_string *const_ER_WRITE_name = zend_string_init_interned("ER_WRITE", sizeof("ER_WRITE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_WRITE_name, &const_ER_WRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_WRITE_name); + zend_string_release_ex(const_ER_WRITE_name, true); zval const_ER_CRC_value; ZVAL_LONG(&const_ER_CRC_value, ZIP_ER_CRC); - zend_string *const_ER_CRC_name = zend_string_init_interned("ER_CRC", sizeof("ER_CRC") - 1, 1); + zend_string *const_ER_CRC_name = zend_string_init_interned("ER_CRC", sizeof("ER_CRC") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_CRC_name, &const_ER_CRC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_CRC_name); + zend_string_release_ex(const_ER_CRC_name, true); zval const_ER_ZIPCLOSED_value; ZVAL_LONG(&const_ER_ZIPCLOSED_value, ZIP_ER_ZIPCLOSED); - zend_string *const_ER_ZIPCLOSED_name = zend_string_init_interned("ER_ZIPCLOSED", sizeof("ER_ZIPCLOSED") - 1, 1); + zend_string *const_ER_ZIPCLOSED_name = zend_string_init_interned("ER_ZIPCLOSED", sizeof("ER_ZIPCLOSED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_ZIPCLOSED_name, &const_ER_ZIPCLOSED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_ZIPCLOSED_name); + zend_string_release_ex(const_ER_ZIPCLOSED_name, true); zval const_ER_NOENT_value; ZVAL_LONG(&const_ER_NOENT_value, ZIP_ER_NOENT); - zend_string *const_ER_NOENT_name = zend_string_init_interned("ER_NOENT", sizeof("ER_NOENT") - 1, 1); + zend_string *const_ER_NOENT_name = zend_string_init_interned("ER_NOENT", sizeof("ER_NOENT") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_NOENT_name, &const_ER_NOENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_NOENT_name); + zend_string_release_ex(const_ER_NOENT_name, true); zval const_ER_EXISTS_value; ZVAL_LONG(&const_ER_EXISTS_value, ZIP_ER_EXISTS); - zend_string *const_ER_EXISTS_name = zend_string_init_interned("ER_EXISTS", sizeof("ER_EXISTS") - 1, 1); + zend_string *const_ER_EXISTS_name = zend_string_init_interned("ER_EXISTS", sizeof("ER_EXISTS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_EXISTS_name, &const_ER_EXISTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_EXISTS_name); + zend_string_release_ex(const_ER_EXISTS_name, true); zval const_ER_OPEN_value; ZVAL_LONG(&const_ER_OPEN_value, ZIP_ER_OPEN); - zend_string *const_ER_OPEN_name = zend_string_init_interned("ER_OPEN", sizeof("ER_OPEN") - 1, 1); + zend_string *const_ER_OPEN_name = zend_string_init_interned("ER_OPEN", sizeof("ER_OPEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_OPEN_name, &const_ER_OPEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_OPEN_name); + zend_string_release_ex(const_ER_OPEN_name, true); zval const_ER_TMPOPEN_value; ZVAL_LONG(&const_ER_TMPOPEN_value, ZIP_ER_TMPOPEN); - zend_string *const_ER_TMPOPEN_name = zend_string_init_interned("ER_TMPOPEN", sizeof("ER_TMPOPEN") - 1, 1); + zend_string *const_ER_TMPOPEN_name = zend_string_init_interned("ER_TMPOPEN", sizeof("ER_TMPOPEN") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_TMPOPEN_name, &const_ER_TMPOPEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_TMPOPEN_name); + zend_string_release_ex(const_ER_TMPOPEN_name, true); zval const_ER_ZLIB_value; ZVAL_LONG(&const_ER_ZLIB_value, ZIP_ER_ZLIB); - zend_string *const_ER_ZLIB_name = zend_string_init_interned("ER_ZLIB", sizeof("ER_ZLIB") - 1, 1); + zend_string *const_ER_ZLIB_name = zend_string_init_interned("ER_ZLIB", sizeof("ER_ZLIB") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_ZLIB_name, &const_ER_ZLIB_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_ZLIB_name); + zend_string_release_ex(const_ER_ZLIB_name, true); zval const_ER_MEMORY_value; ZVAL_LONG(&const_ER_MEMORY_value, ZIP_ER_MEMORY); - zend_string *const_ER_MEMORY_name = zend_string_init_interned("ER_MEMORY", sizeof("ER_MEMORY") - 1, 1); + zend_string *const_ER_MEMORY_name = zend_string_init_interned("ER_MEMORY", sizeof("ER_MEMORY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_MEMORY_name, &const_ER_MEMORY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_MEMORY_name); + zend_string_release_ex(const_ER_MEMORY_name, true); zval const_ER_CHANGED_value; ZVAL_LONG(&const_ER_CHANGED_value, ZIP_ER_CHANGED); - zend_string *const_ER_CHANGED_name = zend_string_init_interned("ER_CHANGED", sizeof("ER_CHANGED") - 1, 1); + zend_string *const_ER_CHANGED_name = zend_string_init_interned("ER_CHANGED", sizeof("ER_CHANGED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_CHANGED_name, &const_ER_CHANGED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_CHANGED_name); + zend_string_release_ex(const_ER_CHANGED_name, true); zval const_ER_COMPNOTSUPP_value; ZVAL_LONG(&const_ER_COMPNOTSUPP_value, ZIP_ER_COMPNOTSUPP); - zend_string *const_ER_COMPNOTSUPP_name = zend_string_init_interned("ER_COMPNOTSUPP", sizeof("ER_COMPNOTSUPP") - 1, 1); + zend_string *const_ER_COMPNOTSUPP_name = zend_string_init_interned("ER_COMPNOTSUPP", sizeof("ER_COMPNOTSUPP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_COMPNOTSUPP_name, &const_ER_COMPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_COMPNOTSUPP_name); + zend_string_release_ex(const_ER_COMPNOTSUPP_name, true); zval const_ER_EOF_value; ZVAL_LONG(&const_ER_EOF_value, ZIP_ER_EOF); - zend_string *const_ER_EOF_name = zend_string_init_interned("ER_EOF", sizeof("ER_EOF") - 1, 1); + zend_string *const_ER_EOF_name = zend_string_init_interned("ER_EOF", sizeof("ER_EOF") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_EOF_name, &const_ER_EOF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_EOF_name); + zend_string_release_ex(const_ER_EOF_name, true); zval const_ER_INVAL_value; ZVAL_LONG(&const_ER_INVAL_value, ZIP_ER_INVAL); - zend_string *const_ER_INVAL_name = zend_string_init_interned("ER_INVAL", sizeof("ER_INVAL") - 1, 1); + zend_string *const_ER_INVAL_name = zend_string_init_interned("ER_INVAL", sizeof("ER_INVAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_INVAL_name, &const_ER_INVAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_INVAL_name); + zend_string_release_ex(const_ER_INVAL_name, true); zval const_ER_NOZIP_value; ZVAL_LONG(&const_ER_NOZIP_value, ZIP_ER_NOZIP); - zend_string *const_ER_NOZIP_name = zend_string_init_interned("ER_NOZIP", sizeof("ER_NOZIP") - 1, 1); + zend_string *const_ER_NOZIP_name = zend_string_init_interned("ER_NOZIP", sizeof("ER_NOZIP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_NOZIP_name, &const_ER_NOZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_NOZIP_name); + zend_string_release_ex(const_ER_NOZIP_name, true); zval const_ER_INTERNAL_value; ZVAL_LONG(&const_ER_INTERNAL_value, ZIP_ER_INTERNAL); - zend_string *const_ER_INTERNAL_name = zend_string_init_interned("ER_INTERNAL", sizeof("ER_INTERNAL") - 1, 1); + zend_string *const_ER_INTERNAL_name = zend_string_init_interned("ER_INTERNAL", sizeof("ER_INTERNAL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_INTERNAL_name, &const_ER_INTERNAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_INTERNAL_name); + zend_string_release_ex(const_ER_INTERNAL_name, true); zval const_ER_INCONS_value; ZVAL_LONG(&const_ER_INCONS_value, ZIP_ER_INCONS); - zend_string *const_ER_INCONS_name = zend_string_init_interned("ER_INCONS", sizeof("ER_INCONS") - 1, 1); + zend_string *const_ER_INCONS_name = zend_string_init_interned("ER_INCONS", sizeof("ER_INCONS") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_INCONS_name, &const_ER_INCONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_INCONS_name); + zend_string_release_ex(const_ER_INCONS_name, true); zval const_ER_REMOVE_value; ZVAL_LONG(&const_ER_REMOVE_value, ZIP_ER_REMOVE); - zend_string *const_ER_REMOVE_name = zend_string_init_interned("ER_REMOVE", sizeof("ER_REMOVE") - 1, 1); + zend_string *const_ER_REMOVE_name = zend_string_init_interned("ER_REMOVE", sizeof("ER_REMOVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_REMOVE_name, &const_ER_REMOVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_REMOVE_name); + zend_string_release_ex(const_ER_REMOVE_name, true); zval const_ER_DELETED_value; ZVAL_LONG(&const_ER_DELETED_value, ZIP_ER_DELETED); - zend_string *const_ER_DELETED_name = zend_string_init_interned("ER_DELETED", sizeof("ER_DELETED") - 1, 1); + zend_string *const_ER_DELETED_name = zend_string_init_interned("ER_DELETED", sizeof("ER_DELETED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_DELETED_name, &const_ER_DELETED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_DELETED_name); + zend_string_release_ex(const_ER_DELETED_name, true); zval const_ER_ENCRNOTSUPP_value; ZVAL_LONG(&const_ER_ENCRNOTSUPP_value, ZIP_ER_ENCRNOTSUPP); - zend_string *const_ER_ENCRNOTSUPP_name = zend_string_init_interned("ER_ENCRNOTSUPP", sizeof("ER_ENCRNOTSUPP") - 1, 1); + zend_string *const_ER_ENCRNOTSUPP_name = zend_string_init_interned("ER_ENCRNOTSUPP", sizeof("ER_ENCRNOTSUPP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_ENCRNOTSUPP_name, &const_ER_ENCRNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_ENCRNOTSUPP_name); + zend_string_release_ex(const_ER_ENCRNOTSUPP_name, true); zval const_ER_RDONLY_value; ZVAL_LONG(&const_ER_RDONLY_value, ZIP_ER_RDONLY); - zend_string *const_ER_RDONLY_name = zend_string_init_interned("ER_RDONLY", sizeof("ER_RDONLY") - 1, 1); + zend_string *const_ER_RDONLY_name = zend_string_init_interned("ER_RDONLY", sizeof("ER_RDONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_RDONLY_name, &const_ER_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_RDONLY_name); + zend_string_release_ex(const_ER_RDONLY_name, true); zval const_ER_NOPASSWD_value; ZVAL_LONG(&const_ER_NOPASSWD_value, ZIP_ER_NOPASSWD); - zend_string *const_ER_NOPASSWD_name = zend_string_init_interned("ER_NOPASSWD", sizeof("ER_NOPASSWD") - 1, 1); + zend_string *const_ER_NOPASSWD_name = zend_string_init_interned("ER_NOPASSWD", sizeof("ER_NOPASSWD") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_NOPASSWD_name, &const_ER_NOPASSWD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_NOPASSWD_name); + zend_string_release_ex(const_ER_NOPASSWD_name, true); zval const_ER_WRONGPASSWD_value; ZVAL_LONG(&const_ER_WRONGPASSWD_value, ZIP_ER_WRONGPASSWD); - zend_string *const_ER_WRONGPASSWD_name = zend_string_init_interned("ER_WRONGPASSWD", sizeof("ER_WRONGPASSWD") - 1, 1); + zend_string *const_ER_WRONGPASSWD_name = zend_string_init_interned("ER_WRONGPASSWD", sizeof("ER_WRONGPASSWD") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_WRONGPASSWD_name, &const_ER_WRONGPASSWD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_WRONGPASSWD_name); + zend_string_release_ex(const_ER_WRONGPASSWD_name, true); #if defined(ZIP_ER_OPNOTSUPP) zval const_ER_OPNOTSUPP_value; ZVAL_LONG(&const_ER_OPNOTSUPP_value, ZIP_ER_OPNOTSUPP); - zend_string *const_ER_OPNOTSUPP_name = zend_string_init_interned("ER_OPNOTSUPP", sizeof("ER_OPNOTSUPP") - 1, 1); + zend_string *const_ER_OPNOTSUPP_name = zend_string_init_interned("ER_OPNOTSUPP", sizeof("ER_OPNOTSUPP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_OPNOTSUPP_name, &const_ER_OPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_OPNOTSUPP_name); + zend_string_release_ex(const_ER_OPNOTSUPP_name, true); #endif #if defined(ZIP_ER_INUSE) zval const_ER_INUSE_value; ZVAL_LONG(&const_ER_INUSE_value, ZIP_ER_INUSE); - zend_string *const_ER_INUSE_name = zend_string_init_interned("ER_INUSE", sizeof("ER_INUSE") - 1, 1); + zend_string *const_ER_INUSE_name = zend_string_init_interned("ER_INUSE", sizeof("ER_INUSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_INUSE_name, &const_ER_INUSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_INUSE_name); + zend_string_release_ex(const_ER_INUSE_name, true); #endif #if defined(ZIP_ER_TELL) zval const_ER_TELL_value; ZVAL_LONG(&const_ER_TELL_value, ZIP_ER_TELL); - zend_string *const_ER_TELL_name = zend_string_init_interned("ER_TELL", sizeof("ER_TELL") - 1, 1); + zend_string *const_ER_TELL_name = zend_string_init_interned("ER_TELL", sizeof("ER_TELL") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_TELL_name, &const_ER_TELL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_TELL_name); + zend_string_release_ex(const_ER_TELL_name, true); #endif #if defined(ZIP_ER_COMPRESSED_DATA) zval const_ER_COMPRESSED_DATA_value; ZVAL_LONG(&const_ER_COMPRESSED_DATA_value, ZIP_ER_COMPRESSED_DATA); - zend_string *const_ER_COMPRESSED_DATA_name = zend_string_init_interned("ER_COMPRESSED_DATA", sizeof("ER_COMPRESSED_DATA") - 1, 1); + zend_string *const_ER_COMPRESSED_DATA_name = zend_string_init_interned("ER_COMPRESSED_DATA", sizeof("ER_COMPRESSED_DATA") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_COMPRESSED_DATA_name, &const_ER_COMPRESSED_DATA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_COMPRESSED_DATA_name); + zend_string_release_ex(const_ER_COMPRESSED_DATA_name, true); #endif #if defined(ZIP_ER_CANCELLED) zval const_ER_CANCELLED_value; ZVAL_LONG(&const_ER_CANCELLED_value, ZIP_ER_CANCELLED); - zend_string *const_ER_CANCELLED_name = zend_string_init_interned("ER_CANCELLED", sizeof("ER_CANCELLED") - 1, 1); + zend_string *const_ER_CANCELLED_name = zend_string_init_interned("ER_CANCELLED", sizeof("ER_CANCELLED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_CANCELLED_name, &const_ER_CANCELLED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_CANCELLED_name); + zend_string_release_ex(const_ER_CANCELLED_name, true); #endif #if defined(ZIP_ER_DATA_LENGTH) zval const_ER_DATA_LENGTH_value; ZVAL_LONG(&const_ER_DATA_LENGTH_value, ZIP_ER_DATA_LENGTH); - zend_string *const_ER_DATA_LENGTH_name = zend_string_init_interned("ER_DATA_LENGTH", sizeof("ER_DATA_LENGTH") - 1, 1); + zend_string *const_ER_DATA_LENGTH_name = zend_string_init_interned("ER_DATA_LENGTH", sizeof("ER_DATA_LENGTH") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_DATA_LENGTH_name, &const_ER_DATA_LENGTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_DATA_LENGTH_name); + zend_string_release_ex(const_ER_DATA_LENGTH_name, true); #endif #if defined(ZIP_ER_NOT_ALLOWED) zval const_ER_NOT_ALLOWED_value; ZVAL_LONG(&const_ER_NOT_ALLOWED_value, ZIP_ER_NOT_ALLOWED); - zend_string *const_ER_NOT_ALLOWED_name = zend_string_init_interned("ER_NOT_ALLOWED", sizeof("ER_NOT_ALLOWED") - 1, 1); + zend_string *const_ER_NOT_ALLOWED_name = zend_string_init_interned("ER_NOT_ALLOWED", sizeof("ER_NOT_ALLOWED") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_NOT_ALLOWED_name, &const_ER_NOT_ALLOWED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_NOT_ALLOWED_name); + zend_string_release_ex(const_ER_NOT_ALLOWED_name, true); #endif #if defined(ZIP_ER_TRUNCATED_ZIP) zval const_ER_TRUNCATED_ZIP_value; ZVAL_LONG(&const_ER_TRUNCATED_ZIP_value, ZIP_ER_TRUNCATED_ZIP); - zend_string *const_ER_TRUNCATED_ZIP_name = zend_string_init_interned("ER_TRUNCATED_ZIP", sizeof("ER_TRUNCATED_ZIP") - 1, 1); + zend_string *const_ER_TRUNCATED_ZIP_name = zend_string_init_interned("ER_TRUNCATED_ZIP", sizeof("ER_TRUNCATED_ZIP") - 1, true); zend_declare_typed_class_constant(class_entry, const_ER_TRUNCATED_ZIP_name, &const_ER_TRUNCATED_ZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_ER_TRUNCATED_ZIP_name); + zend_string_release_ex(const_ER_TRUNCATED_ZIP_name, true); #endif #if defined(ZIP_AFL_RDONLY) zval const_AFL_RDONLY_value; ZVAL_LONG(&const_AFL_RDONLY_value, ZIP_AFL_RDONLY); - zend_string *const_AFL_RDONLY_name = zend_string_init_interned("AFL_RDONLY", sizeof("AFL_RDONLY") - 1, 1); + zend_string *const_AFL_RDONLY_name = zend_string_init_interned("AFL_RDONLY", sizeof("AFL_RDONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_AFL_RDONLY_name, &const_AFL_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AFL_RDONLY_name); + zend_string_release_ex(const_AFL_RDONLY_name, true); #endif #if defined(ZIP_AFL_IS_TORRENTZIP) zval const_AFL_IS_TORRENTZIP_value; ZVAL_LONG(&const_AFL_IS_TORRENTZIP_value, ZIP_AFL_IS_TORRENTZIP); - zend_string *const_AFL_IS_TORRENTZIP_name = zend_string_init_interned("AFL_IS_TORRENTZIP", sizeof("AFL_IS_TORRENTZIP") - 1, 1); + zend_string *const_AFL_IS_TORRENTZIP_name = zend_string_init_interned("AFL_IS_TORRENTZIP", sizeof("AFL_IS_TORRENTZIP") - 1, true); zend_declare_typed_class_constant(class_entry, const_AFL_IS_TORRENTZIP_name, &const_AFL_IS_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AFL_IS_TORRENTZIP_name); + zend_string_release_ex(const_AFL_IS_TORRENTZIP_name, true); #endif #if defined(ZIP_AFL_WANT_TORRENTZIP) zval const_AFL_WANT_TORRENTZIP_value; ZVAL_LONG(&const_AFL_WANT_TORRENTZIP_value, ZIP_AFL_WANT_TORRENTZIP); - zend_string *const_AFL_WANT_TORRENTZIP_name = zend_string_init_interned("AFL_WANT_TORRENTZIP", sizeof("AFL_WANT_TORRENTZIP") - 1, 1); + zend_string *const_AFL_WANT_TORRENTZIP_name = zend_string_init_interned("AFL_WANT_TORRENTZIP", sizeof("AFL_WANT_TORRENTZIP") - 1, true); zend_declare_typed_class_constant(class_entry, const_AFL_WANT_TORRENTZIP_name, &const_AFL_WANT_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AFL_WANT_TORRENTZIP_name); + zend_string_release_ex(const_AFL_WANT_TORRENTZIP_name, true); #endif #if defined(ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE) zval const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value; ZVAL_LONG(&const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value, ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE); - zend_string *const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name = zend_string_init_interned("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE", sizeof("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE") - 1, 1); + zend_string *const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name = zend_string_init_interned("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE", sizeof("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE") - 1, true); zend_declare_typed_class_constant(class_entry, const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name, &const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name); + zend_string_release_ex(const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name, true); #endif #if defined(ZIP_OPSYS_DEFAULT) zval const_OPSYS_DOS_value; ZVAL_LONG(&const_OPSYS_DOS_value, ZIP_OPSYS_DOS); - zend_string *const_OPSYS_DOS_name = zend_string_init_interned("OPSYS_DOS", sizeof("OPSYS_DOS") - 1, 1); + zend_string *const_OPSYS_DOS_name = zend_string_init_interned("OPSYS_DOS", sizeof("OPSYS_DOS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_DOS_name, &const_OPSYS_DOS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_DOS_name); + zend_string_release_ex(const_OPSYS_DOS_name, true); zval const_OPSYS_AMIGA_value; ZVAL_LONG(&const_OPSYS_AMIGA_value, ZIP_OPSYS_AMIGA); - zend_string *const_OPSYS_AMIGA_name = zend_string_init_interned("OPSYS_AMIGA", sizeof("OPSYS_AMIGA") - 1, 1); + zend_string *const_OPSYS_AMIGA_name = zend_string_init_interned("OPSYS_AMIGA", sizeof("OPSYS_AMIGA") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_AMIGA_name, &const_OPSYS_AMIGA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_AMIGA_name); + zend_string_release_ex(const_OPSYS_AMIGA_name, true); zval const_OPSYS_OPENVMS_value; ZVAL_LONG(&const_OPSYS_OPENVMS_value, ZIP_OPSYS_OPENVMS); - zend_string *const_OPSYS_OPENVMS_name = zend_string_init_interned("OPSYS_OPENVMS", sizeof("OPSYS_OPENVMS") - 1, 1); + zend_string *const_OPSYS_OPENVMS_name = zend_string_init_interned("OPSYS_OPENVMS", sizeof("OPSYS_OPENVMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_OPENVMS_name, &const_OPSYS_OPENVMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_OPENVMS_name); + zend_string_release_ex(const_OPSYS_OPENVMS_name, true); zval const_OPSYS_UNIX_value; ZVAL_LONG(&const_OPSYS_UNIX_value, ZIP_OPSYS_UNIX); - zend_string *const_OPSYS_UNIX_name = zend_string_init_interned("OPSYS_UNIX", sizeof("OPSYS_UNIX") - 1, 1); + zend_string *const_OPSYS_UNIX_name = zend_string_init_interned("OPSYS_UNIX", sizeof("OPSYS_UNIX") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_UNIX_name, &const_OPSYS_UNIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_UNIX_name); + zend_string_release_ex(const_OPSYS_UNIX_name, true); zval const_OPSYS_VM_CMS_value; ZVAL_LONG(&const_OPSYS_VM_CMS_value, ZIP_OPSYS_VM_CMS); - zend_string *const_OPSYS_VM_CMS_name = zend_string_init_interned("OPSYS_VM_CMS", sizeof("OPSYS_VM_CMS") - 1, 1); + zend_string *const_OPSYS_VM_CMS_name = zend_string_init_interned("OPSYS_VM_CMS", sizeof("OPSYS_VM_CMS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_VM_CMS_name, &const_OPSYS_VM_CMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_VM_CMS_name); + zend_string_release_ex(const_OPSYS_VM_CMS_name, true); zval const_OPSYS_ATARI_ST_value; ZVAL_LONG(&const_OPSYS_ATARI_ST_value, ZIP_OPSYS_ATARI_ST); - zend_string *const_OPSYS_ATARI_ST_name = zend_string_init_interned("OPSYS_ATARI_ST", sizeof("OPSYS_ATARI_ST") - 1, 1); + zend_string *const_OPSYS_ATARI_ST_name = zend_string_init_interned("OPSYS_ATARI_ST", sizeof("OPSYS_ATARI_ST") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_ATARI_ST_name, &const_OPSYS_ATARI_ST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_ATARI_ST_name); + zend_string_release_ex(const_OPSYS_ATARI_ST_name, true); zval const_OPSYS_OS_2_value; ZVAL_LONG(&const_OPSYS_OS_2_value, ZIP_OPSYS_OS_2); - zend_string *const_OPSYS_OS_2_name = zend_string_init_interned("OPSYS_OS_2", sizeof("OPSYS_OS_2") - 1, 1); + zend_string *const_OPSYS_OS_2_name = zend_string_init_interned("OPSYS_OS_2", sizeof("OPSYS_OS_2") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_2_name, &const_OPSYS_OS_2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_OS_2_name); + zend_string_release_ex(const_OPSYS_OS_2_name, true); zval const_OPSYS_MACINTOSH_value; ZVAL_LONG(&const_OPSYS_MACINTOSH_value, ZIP_OPSYS_MACINTOSH); - zend_string *const_OPSYS_MACINTOSH_name = zend_string_init_interned("OPSYS_MACINTOSH", sizeof("OPSYS_MACINTOSH") - 1, 1); + zend_string *const_OPSYS_MACINTOSH_name = zend_string_init_interned("OPSYS_MACINTOSH", sizeof("OPSYS_MACINTOSH") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_MACINTOSH_name, &const_OPSYS_MACINTOSH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_MACINTOSH_name); + zend_string_release_ex(const_OPSYS_MACINTOSH_name, true); zval const_OPSYS_Z_SYSTEM_value; ZVAL_LONG(&const_OPSYS_Z_SYSTEM_value, ZIP_OPSYS_Z_SYSTEM); - zend_string *const_OPSYS_Z_SYSTEM_name = zend_string_init_interned("OPSYS_Z_SYSTEM", sizeof("OPSYS_Z_SYSTEM") - 1, 1); + zend_string *const_OPSYS_Z_SYSTEM_name = zend_string_init_interned("OPSYS_Z_SYSTEM", sizeof("OPSYS_Z_SYSTEM") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_Z_SYSTEM_name, &const_OPSYS_Z_SYSTEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_Z_SYSTEM_name); + zend_string_release_ex(const_OPSYS_Z_SYSTEM_name, true); zval const_OPSYS_CPM_value; ZVAL_LONG(&const_OPSYS_CPM_value, ZIP_OPSYS_CPM); - zend_string *const_OPSYS_CPM_name = zend_string_init_interned("OPSYS_CPM", sizeof("OPSYS_CPM") - 1, 1); + zend_string *const_OPSYS_CPM_name = zend_string_init_interned("OPSYS_CPM", sizeof("OPSYS_CPM") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_CPM_name, &const_OPSYS_CPM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_CPM_name); + zend_string_release_ex(const_OPSYS_CPM_name, true); zval const_OPSYS_WINDOWS_NTFS_value; ZVAL_LONG(&const_OPSYS_WINDOWS_NTFS_value, ZIP_OPSYS_WINDOWS_NTFS); - zend_string *const_OPSYS_WINDOWS_NTFS_name = zend_string_init_interned("OPSYS_WINDOWS_NTFS", sizeof("OPSYS_WINDOWS_NTFS") - 1, 1); + zend_string *const_OPSYS_WINDOWS_NTFS_name = zend_string_init_interned("OPSYS_WINDOWS_NTFS", sizeof("OPSYS_WINDOWS_NTFS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_WINDOWS_NTFS_name, &const_OPSYS_WINDOWS_NTFS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_WINDOWS_NTFS_name); + zend_string_release_ex(const_OPSYS_WINDOWS_NTFS_name, true); zval const_OPSYS_MVS_value; ZVAL_LONG(&const_OPSYS_MVS_value, ZIP_OPSYS_MVS); - zend_string *const_OPSYS_MVS_name = zend_string_init_interned("OPSYS_MVS", sizeof("OPSYS_MVS") - 1, 1); + zend_string *const_OPSYS_MVS_name = zend_string_init_interned("OPSYS_MVS", sizeof("OPSYS_MVS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_MVS_name, &const_OPSYS_MVS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_MVS_name); + zend_string_release_ex(const_OPSYS_MVS_name, true); zval const_OPSYS_VSE_value; ZVAL_LONG(&const_OPSYS_VSE_value, ZIP_OPSYS_VSE); - zend_string *const_OPSYS_VSE_name = zend_string_init_interned("OPSYS_VSE", sizeof("OPSYS_VSE") - 1, 1); + zend_string *const_OPSYS_VSE_name = zend_string_init_interned("OPSYS_VSE", sizeof("OPSYS_VSE") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_VSE_name, &const_OPSYS_VSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_VSE_name); + zend_string_release_ex(const_OPSYS_VSE_name, true); zval const_OPSYS_ACORN_RISC_value; ZVAL_LONG(&const_OPSYS_ACORN_RISC_value, ZIP_OPSYS_ACORN_RISC); - zend_string *const_OPSYS_ACORN_RISC_name = zend_string_init_interned("OPSYS_ACORN_RISC", sizeof("OPSYS_ACORN_RISC") - 1, 1); + zend_string *const_OPSYS_ACORN_RISC_name = zend_string_init_interned("OPSYS_ACORN_RISC", sizeof("OPSYS_ACORN_RISC") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_ACORN_RISC_name, &const_OPSYS_ACORN_RISC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_ACORN_RISC_name); + zend_string_release_ex(const_OPSYS_ACORN_RISC_name, true); zval const_OPSYS_VFAT_value; ZVAL_LONG(&const_OPSYS_VFAT_value, ZIP_OPSYS_VFAT); - zend_string *const_OPSYS_VFAT_name = zend_string_init_interned("OPSYS_VFAT", sizeof("OPSYS_VFAT") - 1, 1); + zend_string *const_OPSYS_VFAT_name = zend_string_init_interned("OPSYS_VFAT", sizeof("OPSYS_VFAT") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_VFAT_name, &const_OPSYS_VFAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_VFAT_name); + zend_string_release_ex(const_OPSYS_VFAT_name, true); zval const_OPSYS_ALTERNATE_MVS_value; ZVAL_LONG(&const_OPSYS_ALTERNATE_MVS_value, ZIP_OPSYS_ALTERNATE_MVS); - zend_string *const_OPSYS_ALTERNATE_MVS_name = zend_string_init_interned("OPSYS_ALTERNATE_MVS", sizeof("OPSYS_ALTERNATE_MVS") - 1, 1); + zend_string *const_OPSYS_ALTERNATE_MVS_name = zend_string_init_interned("OPSYS_ALTERNATE_MVS", sizeof("OPSYS_ALTERNATE_MVS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_ALTERNATE_MVS_name, &const_OPSYS_ALTERNATE_MVS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_ALTERNATE_MVS_name); + zend_string_release_ex(const_OPSYS_ALTERNATE_MVS_name, true); zval const_OPSYS_BEOS_value; ZVAL_LONG(&const_OPSYS_BEOS_value, ZIP_OPSYS_BEOS); - zend_string *const_OPSYS_BEOS_name = zend_string_init_interned("OPSYS_BEOS", sizeof("OPSYS_BEOS") - 1, 1); + zend_string *const_OPSYS_BEOS_name = zend_string_init_interned("OPSYS_BEOS", sizeof("OPSYS_BEOS") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_BEOS_name, &const_OPSYS_BEOS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_BEOS_name); + zend_string_release_ex(const_OPSYS_BEOS_name, true); zval const_OPSYS_TANDEM_value; ZVAL_LONG(&const_OPSYS_TANDEM_value, ZIP_OPSYS_TANDEM); - zend_string *const_OPSYS_TANDEM_name = zend_string_init_interned("OPSYS_TANDEM", sizeof("OPSYS_TANDEM") - 1, 1); + zend_string *const_OPSYS_TANDEM_name = zend_string_init_interned("OPSYS_TANDEM", sizeof("OPSYS_TANDEM") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_TANDEM_name, &const_OPSYS_TANDEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_TANDEM_name); + zend_string_release_ex(const_OPSYS_TANDEM_name, true); zval const_OPSYS_OS_400_value; ZVAL_LONG(&const_OPSYS_OS_400_value, ZIP_OPSYS_OS_400); - zend_string *const_OPSYS_OS_400_name = zend_string_init_interned("OPSYS_OS_400", sizeof("OPSYS_OS_400") - 1, 1); + zend_string *const_OPSYS_OS_400_name = zend_string_init_interned("OPSYS_OS_400", sizeof("OPSYS_OS_400") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_400_name, &const_OPSYS_OS_400_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_OS_400_name); + zend_string_release_ex(const_OPSYS_OS_400_name, true); zval const_OPSYS_OS_X_value; ZVAL_LONG(&const_OPSYS_OS_X_value, ZIP_OPSYS_OS_X); - zend_string *const_OPSYS_OS_X_name = zend_string_init_interned("OPSYS_OS_X", sizeof("OPSYS_OS_X") - 1, 1); + zend_string *const_OPSYS_OS_X_name = zend_string_init_interned("OPSYS_OS_X", sizeof("OPSYS_OS_X") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_X_name, &const_OPSYS_OS_X_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_OS_X_name); + zend_string_release_ex(const_OPSYS_OS_X_name, true); zval const_OPSYS_DEFAULT_value; ZVAL_LONG(&const_OPSYS_DEFAULT_value, ZIP_OPSYS_DEFAULT); - zend_string *const_OPSYS_DEFAULT_name = zend_string_init_interned("OPSYS_DEFAULT", sizeof("OPSYS_DEFAULT") - 1, 1); + zend_string *const_OPSYS_DEFAULT_name = zend_string_init_interned("OPSYS_DEFAULT", sizeof("OPSYS_DEFAULT") - 1, true); zend_declare_typed_class_constant(class_entry, const_OPSYS_DEFAULT_name, &const_OPSYS_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_OPSYS_DEFAULT_name); + zend_string_release_ex(const_OPSYS_DEFAULT_name, true); #endif zval const_EM_NONE_value; ZVAL_LONG(&const_EM_NONE_value, ZIP_EM_NONE); - zend_string *const_EM_NONE_name = zend_string_init_interned("EM_NONE", sizeof("EM_NONE") - 1, 1); + zend_string *const_EM_NONE_name = zend_string_init_interned("EM_NONE", sizeof("EM_NONE") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_NONE_name, &const_EM_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_NONE_name); + zend_string_release_ex(const_EM_NONE_name, true); zval const_EM_TRAD_PKWARE_value; ZVAL_LONG(&const_EM_TRAD_PKWARE_value, ZIP_EM_TRAD_PKWARE); - zend_string *const_EM_TRAD_PKWARE_name = zend_string_init_interned("EM_TRAD_PKWARE", sizeof("EM_TRAD_PKWARE") - 1, 1); + zend_string *const_EM_TRAD_PKWARE_name = zend_string_init_interned("EM_TRAD_PKWARE", sizeof("EM_TRAD_PKWARE") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_TRAD_PKWARE_name, &const_EM_TRAD_PKWARE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_TRAD_PKWARE_name); + zend_string_release_ex(const_EM_TRAD_PKWARE_name, true); #if defined(HAVE_ENCRYPTION) zval const_EM_AES_128_value; ZVAL_LONG(&const_EM_AES_128_value, ZIP_EM_AES_128); - zend_string *const_EM_AES_128_name = zend_string_init_interned("EM_AES_128", sizeof("EM_AES_128") - 1, 1); + zend_string *const_EM_AES_128_name = zend_string_init_interned("EM_AES_128", sizeof("EM_AES_128") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_AES_128_name, &const_EM_AES_128_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_AES_128_name); + zend_string_release_ex(const_EM_AES_128_name, true); zval const_EM_AES_192_value; ZVAL_LONG(&const_EM_AES_192_value, ZIP_EM_AES_192); - zend_string *const_EM_AES_192_name = zend_string_init_interned("EM_AES_192", sizeof("EM_AES_192") - 1, 1); + zend_string *const_EM_AES_192_name = zend_string_init_interned("EM_AES_192", sizeof("EM_AES_192") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_AES_192_name, &const_EM_AES_192_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_AES_192_name); + zend_string_release_ex(const_EM_AES_192_name, true); zval const_EM_AES_256_value; ZVAL_LONG(&const_EM_AES_256_value, ZIP_EM_AES_256); - zend_string *const_EM_AES_256_name = zend_string_init_interned("EM_AES_256", sizeof("EM_AES_256") - 1, 1); + zend_string *const_EM_AES_256_name = zend_string_init_interned("EM_AES_256", sizeof("EM_AES_256") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_AES_256_name, &const_EM_AES_256_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_AES_256_name); + zend_string_release_ex(const_EM_AES_256_name, true); #endif zval const_EM_UNKNOWN_value; ZVAL_LONG(&const_EM_UNKNOWN_value, ZIP_EM_UNKNOWN); - zend_string *const_EM_UNKNOWN_name = zend_string_init_interned("EM_UNKNOWN", sizeof("EM_UNKNOWN") - 1, 1); + zend_string *const_EM_UNKNOWN_name = zend_string_init_interned("EM_UNKNOWN", sizeof("EM_UNKNOWN") - 1, true); zend_declare_typed_class_constant(class_entry, const_EM_UNKNOWN_name, &const_EM_UNKNOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_EM_UNKNOWN_name); + zend_string_release_ex(const_EM_UNKNOWN_name, true); zval const_LIBZIP_VERSION_value; zend_string *const_LIBZIP_VERSION_value_str = zend_string_init(LIBZIP_VERSION_STR, strlen(LIBZIP_VERSION_STR), 1); ZVAL_STR(&const_LIBZIP_VERSION_value, const_LIBZIP_VERSION_value_str); - zend_string *const_LIBZIP_VERSION_name = zend_string_init_interned("LIBZIP_VERSION", sizeof("LIBZIP_VERSION") - 1, 1); + zend_string *const_LIBZIP_VERSION_name = zend_string_init_interned("LIBZIP_VERSION", sizeof("LIBZIP_VERSION") - 1, true); zend_declare_typed_class_constant(class_entry, const_LIBZIP_VERSION_name, &const_LIBZIP_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(const_LIBZIP_VERSION_name); + zend_string_release_ex(const_LIBZIP_VERSION_name, true); zval const_LENGTH_TO_END_value; ZVAL_LONG(&const_LENGTH_TO_END_value, ZIP_LENGTH_TO_END); - zend_string *const_LENGTH_TO_END_name = zend_string_init_interned("LENGTH_TO_END", sizeof("LENGTH_TO_END") - 1, 1); + zend_string *const_LENGTH_TO_END_name = zend_string_init_interned("LENGTH_TO_END", sizeof("LENGTH_TO_END") - 1, true); zend_declare_typed_class_constant(class_entry, const_LENGTH_TO_END_name, &const_LENGTH_TO_END_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LENGTH_TO_END_name); + zend_string_release_ex(const_LENGTH_TO_END_name, true); #if defined(ZIP_LENGTH_UNCHECKED) zval const_LENGTH_UNCHECKED_value; ZVAL_LONG(&const_LENGTH_UNCHECKED_value, ZIP_LENGTH_UNCHECKED); - zend_string *const_LENGTH_UNCHECKED_name = zend_string_init_interned("LENGTH_UNCHECKED", sizeof("LENGTH_UNCHECKED") - 1, 1); + zend_string *const_LENGTH_UNCHECKED_name = zend_string_init_interned("LENGTH_UNCHECKED", sizeof("LENGTH_UNCHECKED") - 1, true); zend_declare_typed_class_constant(class_entry, const_LENGTH_UNCHECKED_name, &const_LENGTH_UNCHECKED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(const_LENGTH_UNCHECKED_name); + zend_string_release_ex(const_LENGTH_UNCHECKED_name, true); #endif zval property_lastId_default_value; ZVAL_UNDEF(&property_lastId_default_value); - zend_string *property_lastId_name = zend_string_init("lastId", sizeof("lastId") - 1, 1); + zend_string *property_lastId_name = zend_string_init("lastId", sizeof("lastId") - 1, true); zend_declare_typed_property(class_entry, property_lastId_name, &property_lastId_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_lastId_name); + zend_string_release_ex(property_lastId_name, true); zval property_status_default_value; ZVAL_UNDEF(&property_status_default_value); - zend_string *property_status_name = zend_string_init("status", sizeof("status") - 1, 1); + zend_string *property_status_name = zend_string_init("status", sizeof("status") - 1, true); zend_declare_typed_property(class_entry, property_status_name, &property_status_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_status_name); + zend_string_release_ex(property_status_name, true); zval property_statusSys_default_value; ZVAL_UNDEF(&property_statusSys_default_value); - zend_string *property_statusSys_name = zend_string_init("statusSys", sizeof("statusSys") - 1, 1); + zend_string *property_statusSys_name = zend_string_init("statusSys", sizeof("statusSys") - 1, true); zend_declare_typed_property(class_entry, property_statusSys_name, &property_statusSys_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_statusSys_name); + zend_string_release_ex(property_statusSys_name, true); zval property_numFiles_default_value; ZVAL_UNDEF(&property_numFiles_default_value); - zend_string *property_numFiles_name = zend_string_init("numFiles", sizeof("numFiles") - 1, 1); + zend_string *property_numFiles_name = zend_string_init("numFiles", sizeof("numFiles") - 1, true); zend_declare_typed_property(class_entry, property_numFiles_name, &property_numFiles_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_numFiles_name); + zend_string_release_ex(property_numFiles_name, true); zval property_filename_default_value; ZVAL_UNDEF(&property_filename_default_value); - zend_string *property_filename_name = zend_string_init("filename", sizeof("filename") - 1, 1); + zend_string *property_filename_name = zend_string_init("filename", sizeof("filename") - 1, true); zend_declare_typed_property(class_entry, property_filename_name, &property_filename_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_filename_name); + zend_string_release_ex(property_filename_name, true); zval property_comment_default_value; ZVAL_UNDEF(&property_comment_default_value); - zend_string *property_comment_name = zend_string_init("comment", sizeof("comment") - 1, 1); + zend_string *property_comment_name = zend_string_init("comment", sizeof("comment") - 1, true); zend_declare_typed_property(class_entry, property_comment_name, &property_comment_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); - zend_string_release(property_comment_name); + zend_string_release_ex(property_comment_name, true); #if defined(ZIP_FL_RECOMPRESS) From ed0aba0eb672bd38527b6ec7a93cf3e587a23683 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:07:43 +0200 Subject: [PATCH 126/386] Fix NEWS --- NEWS | 786 +---------------------------------------------------------- 1 file changed, 3 insertions(+), 783 deletions(-) diff --git a/NEWS b/NEWS index a1dcf7c15d6bc..2213ff10b1db7 100644 --- a/NEWS +++ b/NEWS @@ -1,790 +1,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.5.0RC2 - -- Core: - . Fix OSS-Fuzz #447521098 (Fatal error during sccp shift eval). (ilutov) - . Fixed bug GH-20002 (Broken build on *BSD with MSAN). (outtersg) - -- BcMath: - . Fixed bug GH-20006 (Power of 0 of BcMath number causes UB). (nielsdos) - -- Opcache: - . Fixed segfault in function JIT due to NAN to bool warning. (Girgias) - . Fixed bug GH-19984 (Double-free of EG(errors)/persistent_script->warnings on - persist of already persisted file). (ilutov, Arnaud) - -- SOAP: - . Fixed bug GH-19773 (SIGSEGV due to uninitialized soap_globals->lang_en). - (nielsdos, KaseyJenkins) - -- URI: - . Fixed Uri\WhatWg\Url::withPort() when an invalid value is passed. - (timwolla) - . Fixed Uri\WhatWg\Url::parse() when resolving a relative URL - against a base URL with query or fragment. (timwolla) - -25 Sep 2025, PHP 8.5.0RC1 - -- Core: - . Fixed bug GH-19765 (object_properties_load() bypasses readonly property - checks). (timwolla) - . The __sleep() and __wakeup() magic methods have been deprecated. (Girgias) - . Fixed hard_timeout with --enable-zend-max-execution-timers. (Appla) - . Fixed bug GH-19839 (Incorrect HASH_FLAG_HAS_EMPTY_IND flag on userland - array). (ilutov) - . Fixed bug GH-19823 (register_argc_argv deprecation emitted twice when - using OPcache). (timwolla) - . Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is - configured). (nielsdos) - . Fixed bug GH-19719 (Allow empty statements before declare(strict_types)). - (nielsdos) - . Casting floats that are not representable as ints now emits a warning. - (Girgias) - . Casting NAN to other types now emits a warning. (Girgias) - -- Bz2: - . Fixed bug GH-19810 (Broken bzopen() stream mode validation). (ilutov) - -- Curl: - . Fix cloning of CURLOPT_POSTFIELDS when using the clone operator instead - of the curl_copy_handle() function to clone a CurlHandle. (timwolla) - -- Date: - . Fixed GH-17159: "P" format for ::createFromFormat swallows string literals. - (nielsdos) - . The __wakeup() magic method of DateTimeInterface, DateTime, - DateTimeImmutable, DateTimeZone, DateInterval, and DatePeriod has been - deprecated in favour of the __unserialize() magic method. (Girgias) - -- Exif: - . Fix OSS-Fuzz #442954659 (zero-size box in HEIF file causes infinite loop). - (nielsdos) - . Fix OSS-Fuzz #442954659 (Crash in exif_scan_HEIF_header). (nielsdos) - . Various hardening fixes to HEIF parsing. (nielsdos) - -- FPM: - . Fixed GH-8157 (post_max_size evaluates .user.ini too late in php-fpm). - (Jakub Zelenka) - -- Iconv: - . Extends the ICONV_CONST preprocessor for illumos/solaris. (jMichaelA) - -- Opcache: - . Fixed bug GH-19669 (assertion failure in zend_jit_trace_type_to_info_ex). - (Arnaud) - . Fixed bug GH-19831 (function JIT may not deref property value). (Arnaud) - -- OpenSSL: - . Fixed build when --with-openssl-legacy-provider set. (Jakub Zelenka) - -- MBstring: - . Updated Unicode data tables to Unicode 17.0. (Yuya Hamada) - -- Reflection: - . ReflectionConstant is no longer final. (sasezaki) - -- SAPI: - . Fixed bug GH-18582 and #81451: http_response_code() does not override the - status code generated by header(). (ilutov, Jakub Zelenka) - -- Standard: - . Passing strings which are not one byte long to ord() is now deprecated. - (Girgias) - . Fixed bug GH-19801 (leaks in var_dump() and debug_zval_dump()). - (alexandre-daubois) - . Fixed GH-14402 (SplPriorityQueue, SplMinHeap, and SplMaxHeap lost their - data on serialize()). (alexandre-daubois) - -- URI: - . Fixed bug GH-19780 (InvalidUrlException should check $errors argument). - (nielsdos) - . Prevent modifying Uri\WhatWg\Url and Uri\Rfc3986\Uri objects by manually - calling __construct() or __unserialize(). (timwolla) - . Add new Uri\UriError exception that is thrown for internal error - conditions. (timwolla) - . Further clean up the internal API. (timwolla) - . Fixed bug GH-19892 (Refcounting on zend_empty_array). (ilutov, timwolla) - . Fixed handling of port numbers > 65535 with the internal - `php_uri_parse_to_struct()` API. (timwolla) - . Fix Uri\WhatWg\Url::withHost(). (timwolla) - -- Windows: - . Fix GH-19722 (_get_osfhandle asserts in debug mode when given a socket). - (dktapps) - -11 Sep 2025, PHP 8.5.0beta3 - -- Core: - . Destructing non-array values (other than NULL) using [] or list() now - emits a warning. (Girgias) - . Fixed bug GH-19637 (Incorrect Closure scope for FCC in constant - expression). (timwolla) - . Fixed bug GH-19613 (Stale array iterator pointer). (ilutov) - . Fixed bug GH-19679 (zend_ssa_range_widening may fail to converge). (Arnaud) - . Using null as an array offset or when calling array_key_exists() is now - deprecated. (alexandre-daubois) - . Fixed bug GH-19681 (PHP_EXPAND_PATH broken with bash 5.3.0). (Remi) - . Marks the stack as non-executable on Haiku. (David Carlier) - . Deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string is - now deprecated. (timwolla, nicolasgrekas) - -- CLI: - . Fixed bug GH-19461 (Improve error message on listening error with IPv6 - address). (alexandre-daubois) - -- Date: - . Fixed date_sunrise() and date_sunset() with partial-hour UTC offset. - (ilutov) - -- EXIF: - . Added support to retrieve Exif from HEIF file. (Benstone Zhang) - -- FPM: - . Fixed failed debug assertion when php_admin_value setting fails. (ilutov) - -- Filter: - . Fixed bug GH-16993 (filter_var_array with FILTER_VALIDATE_INT|FILTER_NULL_ON_FAILURE - should emit warning for invalid filter usage). (alexandre-daubois) - -- Intl: - . Added grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(), - grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and - grapheme_levenshtein() functions add $locale parameter (Yuya Hamada). - . Fixed bug GH-11952 (Fix locale strings canonicalization for IntlDateFormatter - and NumberFormatter). (alexandre-daubois) - -- ODBC: - . Removed driver-specific build flags and support. (Calvin Buckley) - -- Opcache: - . Fixed bug GH-19486 (Incorrect opline after deoptimization). (Arnaud) - . Fixed bug GH-19601 (Wrong JIT stack setup on aarch64/clang). (Arnaud) - . Fixed bug GH-19388 (Broken opcache.huge_code_pages). (Arnaud) - . Fixed bug GH-19657 (Build fails on non-glibc/musl/freebsd/macos/win - platforms). (Arnaud) - -- PCRE: - . Upgraded to pcre2lib from 10.45 to 10.46. (nielsdos) - -- PDO: - . Driver specific methods in the PDO class are now deprecated. (Arnaud) - -- PDO_SQLITE: - . Add PDO\Sqlite::ATTR_TRANSACTION_MODE connection attribute. - (Samuel Štancl) - -- Reflection: - . Fix GH-19691 (getModifierNames() not reporting asymmetric visibility). - (DanielEScherzer) - -- Session: - . Fix RC violation of session SID constant deprecation attribute. (ilutov) - -- Standard: - . Fix GH-19610 (Deprecation warnings in functions taking as argument). - (Girgias) - . Fixed bug GH-19577 (Avoid integer overflow when using a small offset - and PHP_INT_MAX with LimitIterator). (alexandre-daubois) - . Implement GH-19188: Add support for new INI mail.cr_lf_mode. - (alexandre-daubois) - -- Streams: - . Fixed bug GH-14506 (Closing a userspace stream inside a userspace handler - causes heap corruption). (nielsdos) - . Avoid double conversion to string in php_userstreamop_readdir(). (nielsdos) - -- URI: - . Added support for Uri\Rfc3986\Uri::with*() methods. (kocsismate) - . Fixed memory management of Uri\WhatWg\Url objects. (timwolla) - . Fixed memory management of the internal "parse_url" URI parser. - (timwolla) - . Fixed double-free when assigning to $errors fails when using - the Uri\WhatWg\Url parser. (timwolla) - . Reject out-of-range ports when using the Uri\Rfc3986\Uri parser. - (timwolla) - . Return null instead of 0 for Uri\Rfc3986\Uri::getPort() when the - URI contains an empty port. (timwolla) - . Fixed creation of the InvalidUrlException when not passing an - errors zval to the internal whatwg parser. (timwolla) - . Clean up naming of internal API. (timwolla) - -28 Aug 2025, PHP 8.5.0beta2 - -- Core: - . Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler() - triggers "Constant already defined" warning). (ilutov) - . Fixed bug GH-19476 (pipe operator fails to correctly handle returning - by reference). (alexandre-daubois) - . The report_memleaks INI directive has been deprecated. (alexandre-daubois) - . Constant redeclaration has been deprecated. (alexandre-daubois) - . Fixed OSS-Fuzz #439125710 (Pipe cannot be used in write context). - (nielsdos) - . Added support for configuring the URI parser for the FTP/FTPS as well as - the SSL/TLS stream wrappers as described in - https://wiki.php.net/rfc/url_parsing_api#plugability. (kocsismate) - . Fixed bug GH-19548 (Shared memory violation on property inheritance). - (alexandre-daubois) - . Fixed bug GH-19544 (GC treats ZEND_WEAKREF_TAG_MAP references as WeakMap - references). (Arnaud, timwolla) - . Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19 - on x86_64 or aarch64. (Arnaud) - . Enacted the follow-up phase of the "Path to Saner Increment/Decrement - operators" RFC, meaning that incrementing non-numeric strings is now - deprecated. (Girgias). - . Various closure binding issues are now deprecated. (alexandre-daubois) - . Fixed bug GH-18373 (Don't substitute self/parent with anonymous class). - (ilutov) - . Prohibit pipe & arrow function combination that leads to confusing parse - trees. (ilutov) - . The disable_classes INI directive has been removed. (Girgias) - . The locally predefined variable $http_response_header is deprecated. - (Girgias) - -- Filter: - . Added support for configuring the URI parser for FILTER_VALIDATE_URL - as described in https://wiki.php.net/rfc/url_parsing_api#plugability. - (kocsismate) - -- ODBC: - . Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley) - -- Opcache: - . Fixed bug GH-19493 (JIT variable not stored before YIELD). (Arnaud) - -- OpenSSL: - . Implement #81724 (openssl_cms_encrypt only allows specific ciphers). - (Jakub Zelenka) - -- PDO: - . Driver specific constants in the PDO class are now deprecated. (Arnaud) - -- Phar: - . Fixed memory leaks when verifying OpenSSL signature. (Girgias) - -- Session: - . Added support for partitioned cookies. (nielsdos) - -- SOAP: - . Added support for configuring the URI parser for SoapClient::_doRequest() - as described in https://wiki.php.net/rfc/url_parsing_api#plugability. - (kocsismate) - -- SPL: - . Deprecate ArrayObject and ArrayIterator with objects. (Girgias) - -- Standard: - . Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois) - . Passing integers outside the interval [0, 255] to chr() is now deprecated. - (Girgias) - . Added support for partitioned cookies. (nielsdos) - -- Tokenizer: - . Fixed bug GH-19507 (Corrupted result after recursive tokenization during - token_get_all()). (kubawerlos, nielsdos, Arnaud) - -- URI: - . Clean up naming of internal API (header names, symbol names). - (Máté Kocsis, timwolla) - -14 Aug 2025, PHP 8.5.0beta1 - -- Core: - . Non-canonical cast names (boolean), (integer), (double), and (binary) have - been deprecated. (Girgias) - . The $exclude_disabled parameter of the get_defined_functions() function has - been deprecated, as it no longer has any effect since PHP 8.0. (Girgias) - . Terminating case statements with a semicolon instead of a colon has - been deprecated. (theodorejb) - . The backtick operator as an alias for shell_exec() has been deprecated. - (timwolla) - . Returning null from __debugInfo() has been deprecated. (DanielEScherzer) - . Support #[\Override] on properties. (Jiří Pudil) - -- Curl: - . The curl_close() function has been deprecated. (DanielEScherzer) - . The curl_share_close() function has been deprecated. (DanielEScherzer) - -- Date: - . The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been - deprecated. (jorgsowa) - -- DOM: - . Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the - first when using ~ and :has). (nielsdos, lexborisov) - -- FileInfo - . The finfo_close() function has been deprecated. (timwolla) - . The $context parameter of the finfo_buffer() function has been deprecated - as it is ignored. (Girgias) - -- GD: - . The imagedestroy() function has been deprecated. (DanielEScherzer) +?? ??? ????, PHP 8.6.0alpha1 - Intl: - . Intl's internal error mechanism has been modernized so that it - indicates more accurately which call site caused what error. - Moreover, some ext/date exceptions have been wrapped inside a - IntlException now. (Girgias) - . The intl.error_level INI setting has been deprecated. (Girgias) - -- MySQLi: - . The mysqli_execute() alias function has been deprecated. (timwolla) - -- OpenSSL: - . Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias - algorithms appears to be broken). (Jakub Zelenka) - . The $key_length parameter for openssl_pkey_derive() has been deprecated. - (Girgias) - . Implement #80495 (Enable to set padding in openssl_(sign|verify). - (Jakub Zelenka) - . Implement #47728 (openssl_pkcs7_sign ignores new openssl flags). - (Jakub Zelenka) - -- PDO: - . The "uri:" DSN scheme has been deprecated due to security concerns with - DSNs coming from remote URIs. (timwolla) - -- Reflection: - . Fixed bug GH-17927 (Reflection: have some indication of property hooks in - `_property_string()`). (DanielEScherzer) - . The setAccessible() methods of various Reflection objects have been - deprecated, as those no longer have an effect. (timwolla) - . ReflectionClass::getConstant() for constants that do not exist has been - deprecated. (DanielEScherzer) - . ReflectionProperty::getDefaultValue() for properties without default values - has been deprecated. (DanielEScherzer) - -- SPL: - . Unregistering all autoloaders by passing the spl_autoload_call() function - as a callback argument to spl_autoload_unregister() has been deprecated. - Instead if this is needed, one should iterate over the return value of - spl_autoload_functions() and call spl_autoload_unregister() on each - value. (Girgias) - . The SplObjectStorage::contains(), SplObjectStorage::attach(), and - SplObjectStorage::detach() methods have been deprecated in favour of - SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and - SplObjectStorage::offsetUnset() respectively. (Girgias) - -- Standard: - . The socket_set_timeout() alias function has been deprecated. (timwolla) - . Passing null to to readdir(), rewinddir(), and closedir() to use the last - opened directory has been deprecated. (Girgias) - . Fixed bug GH-19153 (#[\Attribute] validation should error on - trait/interface/enum/abstract class). (DanielEScherzer) - -- XML: - . The xml_parser_free() function has been deprecated. (DanielEScherzer) - -31 Jul 2025, PHP 8.5.0alpha4 - -- Core: - . Add clone-with support to the clone() function. (timwolla, edorian) - . Fix support for non-userland stream notifiers. (timwolla) - . Added PHP_BUILD_PROVIDER constant. (timwolla) - . Fixed bug GH-19305 (Operands may be being released during comparison). - (Arnaud) - . Fixed bug GH-19306 (Generator can be resumed while fetching next value from - delegated Generator). (Arnaud) - . Fixed bug GH-19326 (Calling Generator::throw() on a running generator with - a non-Generator delegate crashes). (Arnaud) - -- Curl: - . Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan) - . Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (thecaliskan) - . Add support for CURLOPT_SSL_SIGNATURE_ALGORITHMS. (Ayesh Karunaratne) - -- FPM: - . Make FPM access log limit configurable using log_limit. (Jakub Zelenka) - -- GD: - . Fix incorrect comparison with result of php_stream_can_cast(). (Girgias) - -- Intl: - . Fix return value on failure for resourcebundle count handler. (Girgias) - . Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb) - -- OPcache: - . Disallow changing opcache.memory_consumption when SHM is already set up. - (timwolla) - . Fixed bug GH-15074 (Compiling opcache statically into ZTS PHP fails). - (Arnaud) - . Make OPcache non-optional (Arnaud, timwolla) - . Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for - deprecations). (Arnaud, timwolla) - . Fixed bug GH-19301 (opcache build failure). (Remi) - -- OpenSSL: - . Add $digest_algo parameter to openssl_public_encrypt() and - openssl_private_decrypt() functions. (Jakub Zelenka) - -- POSIX: - . posix_kill and posix_setpgid throws a ValueError on invalid process_id. - (David Carlier) - . posix_setpgid throws a ValueError on invalid process_group_id, - posix_setrlimit throws a ValueError on invalid soft_limit and hard_limit - arguments. (David Carlier) - -- Reflection: - . Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when - retrieved from ReflectionProperty::getSettableType()). (ilutov) - -- Session: - . Fixed GH-19197: build broken with ZEND_STRL usage with memcpy - when implemented as macro. (David Carlier) - -- Soap: - . Fixed bug GH-19226 (Segfault when spawning new thread in soap extension). - (Florian Engelhardt) - -- Sockets: - . socket_set_option for multicast context throws a ValueError - when the socket family is not of AF_INET/AF_INET6 family. (David Carlier) - -- Standard: - . Add HEIF/HEIC support to getimagesize. (Benstone Zhang) - . Implement #71517 (Implement SVG support for getimagesize() and friends). - (nielsdos) - . Optimized PHP html_entity_decode function. (Artem Ukrainskiy) - . Minor optimization to array_chunk(). (nielsdos) - -- URI: - . Empty host handling is fixed. (Máté Kocsis) - . Error handling of Uri\WhatWg\Url::withHost() is fixed when the input - contains a port. Now, it triggers an exception; previously, the error - was silently swallowed. (Máté Kocsis) - . Support empty URIs with Uri\Rfc3986\Uri. (timwolla) - -17 Jul 2025, PHP 8.5.0alpha2 - -- Core: - . Fix OSS-Fuzz #427814452 (pipe compilation fails with assert). - (nielsdos, ilutov) - -- DOM: - . Make cloning DOM node lists, maps, and collections fail. (nielsdos) - . Added Dom\Element::getElementsByClassName(). (nielsdos) - -- PDO_ODBC - . Fetch larger block sizes and better handle SQL_NO_TOTAL when calling - SQLGetData. (Calvin Buckley, Saki Takamachi) - -- Standard: - . Optimized pack(). (nielsdos, divinity76) - . Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated). - (nielsdos) - -- URI: - . Return the singleton UrlValidationErrorType instances from Uri\WhatWg\Url - instead of creating new objects that are different from the singleton. - (timwolla) - -03 Jul 2025, PHP 8.5.0alpha1 - -- BCMath: - . Simplify `bc_divide()` code. (SakiTakamachi) - . If the result is 0, n_scale is set to 0. (SakiTakamachi) - . If size of BC_VECTOR array is within 64 bytes, stack area is now used. - (SakiTakamachi) - -- CLI: - . Add --ini=diff to print INI settings changed from the builtin default. - (timwolla) - . Drop support for -z CLI/CGI flag. (nielsdos) - . Fixed GH-17956 - development server 404 page does not adapt to mobiles. - (pascalchevrel) - -- CURL: - . Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY - values for CURLOPT_FOLLOWLOCATION curl_easy_setopt option. (David Carlier) - -- COM: - . Fixed property access of PHP objects wrapped in variant. (cmb) - . Fixed method calls for PHP objects wrapped in variant. (cmb) - -- Core: - . Fixed bug GH-16665 (\array and \callable should not be usable in - class_alias). (nielsdos) - . Added PHP_BUILD_DATE constant. (cmb) - . Added support for Closures and first class callables in constant - expressions. (timwolla, Volker Dusch) - . Use `clock_gettime_nsec_np()` for high resolution timer on macOS - if available. (timwolla) - . Implement GH-15680 (Enhance zend_dump_op_array to properly represent - non-printable characters in string literals). (nielsdos, WangYihang) - . Add support for backtraces for fatal errors. (enorris) - . Fixed bug GH-17442 (Engine UAF with reference assign and dtor). (nielsdos) - . Improved error message of UnhandledMatchError for - zend.exception_string_param_max_len=0. (timwolla) - . Fixed bug GH-17959 (Relax missing trait fatal error to error exception). - (ilutov) - . Fixed bug GH-18033 (NULL-ptr dereference when using register_tick_function - in destructor). (nielsdos) - . Fixed bug GH-18026 (Improve "expecting token" error for ampersand). (ilutov) - . Added the #[\NoDiscard] attribute to indicate that a function's return - value is important and should be consumed. (timwolla, Volker Dusch) - . Added the (void) cast to indicate that not using a value is intentional. - (timwolla, Volker Dusch) - . Added get_error_handler(), get_exception_handler() functions. (Arnaud) - . Fixed bug GH-15753 and GH-16198 (Bind traits before parent class). (ilutov) - . Added support for casts in constant expressions. (nielsdos) - . Fixed bugs GH-17711 and GH-18022 (Infinite recursion on deprecated attribute - evaluation) and GH-18464 (Recursion protection for deprecation constants not - released on bailout). (DanielEScherzer and ilutov) - . Fixed AST printing for immediately invoked Closure. (Dmitrii Derepko) - . Properly handle __debugInfo() returning an array reference. (nielsdos) - . Properly handle reference return value from __toString(). (nielsdos) - . Added the pipe (|>) operator. (crell) - . Added support for `final` with constructor property promotion. - (DanielEScherzer) - . Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili) - . Make `clone()` a function. (timwolla, edorian) - . Fixed bug GH-19081 (Wrong lineno in property error with constructor property - promotion). (ilutov) - -- Curl: - . Added curl_multi_get_handles(). (timwolla) - . Added curl_share_init_persistent(). (enorris) - . Added CURLINFO_USED_PROXY, CURLINFO_HTTPAUTH_USED, and CURLINFO_PROXYAUTH_USED - support to curl_getinfo. (Ayesh Karunaratne) - -- Date: - . Fix undefined behaviour problems regarding integer overflow in extreme edge - cases. (nielsdos, cmb, ilutov) - -- DOM: - . Added Dom\Element::$outerHTML. (nielsdos) - . Added Dom\Element::insertAdjacentHTML(). (nielsdos) - . Added $children property to ParentNode implementations. (nielsdos) - -- Enchant: - . Added enchant_dict_remove_from_session(). (nielsdos) - . Added enchant_dict_remove(). (nielsdos) - . Fix missing empty string checks. (nielsdos) - -- EXIF: - . Add OffsetTime* Exif tags. (acc987) - -- Fileinfo: - . Upgrade to file 5.46. (nielsdos) - . Change return type of finfo_close() to true. (timwolla) - -- FPM: - . Fixed GH-17645 (FPM with httpd ProxyPass does not decode script path). - (Jakub Zelenka) - -- GD: - . Fixed bug #68629 (Transparent artifacts when using imagerotate). (pierre, - cmb) - . Fixed bug #64823 (ZTS GD fails to to find system TrueType font). (cmb) - -- Intl: - . Bumped ICU requirement to ICU >= 57.1. (cmb) - . IntlDateFormatter::setTimeZone()/datefmt_set_timezone() throws an exception - with uninitialised classes or clone failure. (David Carlier) - . Added DECIMAL_COMPACT_SHORT/DECIMAL_COMPACT_LONG for NumberFormatter class. + . Added IntlNumberRangeFormatter class to format an interval of two numbers + with a given skeleton, locale, collapse type and identity fallback. (BogdanUngureanu) - . Added Locale::isRightToLeft to check if a locale is written right to left. - (David Carlier) - . Added null bytes presence in locale inputs for Locale class. (David Carlier) - . Added grapheme_levenshtein() function. (Yuya Hamada) - . Added Locale::addLikelySubtags/Locale::minimizeSubtags to handle - adding/removing likely subtags to a locale. (David Carlier) - . Added IntlListFormatter class to format a list of items with a locale, - operands types and units. (BogdanUngureanu) - . Fixed bug GH-18566 ([intl] Weird numeric sort in Collator). (nielsdos) - -- LDAP: - . Allow ldap_get_option to retrieve global option by allowing NULL for - connection instance ($ldap). (Remi) - -- MySQLi: - . Fixed bugs GH-17900 and GH-8084 (calling mysqli::__construct twice). - (nielsdos) - -- MySQLnd: - . Added mysqlnd.collect_memory_statistics to ini quick reference. - (hauk92) - -- Opcache: - . Fixed ZTS OPcache build on Cygwin. (cmb) - . Added opcache.file_cache_read_only. (Samuel Melrose) - . Updated default value of opcache.jit_hot_loop. (Arnaud) - . Log a warning when opcache lock file permissions could not be changed. - (Taavi Eomäe) - -- OpenSSL: - . Added openssl.libctx INI that allows to select the OpenSSL library context - type and convert various parts of the extension to use the custom libctx. - (Jakub Zelenka) - -- Output: - . Fixed calculation of aligned buffer size. (cmb) - -- PCNTL: - . Extend pcntl_waitid with rusage parameter. (vrza) - -- PCRE: - . Upgraded to pcre2lib from 10.44 to 10.45. (nielsdos) - . Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options. - (mvorisek) - -- PDO_PGSQL: - . Added Iterable support for PDO::pgsqlCopyFromArray. (KentarouTakeda) - . Implement GH-15387 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) or - Pdo\Pgsql::prepare(…, [ PDO::ATTR_PREFETCH => 0 ]) make fetch() lazy - instead of storing the whole result set in memory (Guillaume Outters) - -- PDO_SQLITE: - . throw on null bytes / resolve GH-13952 (divinity76). - . Implement GH-17321: Add setAuthorizer to Pdo\Sqlite. (nielsdos) - . PDO::sqliteCreateCollation now throws a TypeError if the callback - has a wrong return type. (David Carlier) - . Added Pdo_Sqlite::ATTR_BUSY_STATEMENT constant to check - if a statement is currently executing. (David Carlier) - . Added Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT constant to set a statement - in either EXPLAIN_MODE_PREPARED, EXPLAIN_MODE_EXPLAIN, - EXPLAIN_MODE_EXPLAIN_QUERY_PLAN modes. (David Carlier) - -- PGSQL: - . Added pg_close_stmt to close a prepared statement while allowing - its name to be reused. (David Carlier) - . Added Iterable support for pgsql_copy_from. (David Carlier) - . pg_connect checks if connection_string contains any null byte, - pg_close_stmt check if the statement contains any null byte. - (David Carlier) - . Added pg_service to get the connection current service identifier. - (David Carlier) - -- POSIX: - . Added POSIX_SC_OPEN_MAX constant to get the number of file descriptors - a process can handle. (David Carlier) - . posix_ttyname() sets last_error to EBADF on invalid file descriptors, - posix_isatty() raises E_WARNING on invalid file descriptors, - posix_fpathconf checks invalid file descriptors. (David Carlier) - -- Random: - . Moves from /dev/urandom usage to arc4random_buf on Haiku. (David Carlier) - -- Reflection: - . Added ReflectionConstant::getExtension() and ::getExtensionName(). - (DanielEScherzer) - . Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF - zval for uninitialized typed properties). (nielsdos) - . Fixed bug GH-15766 (ReflectionClass::__toString() should have better output - for enums). (DanielEScherzer) - . Added ReflectionProperty::getMangledName() method. (alexandre-daubois) - -- Session: - . session_start() throws a ValueError on option argument if not a hashmap - or a TypeError if read_and_close value is not compatible with int. - (David Carlier) - -- SimpleXML: - . Fixed bug GH-12231 (SimpleXML xpath should warn when returning other return - types than node lists). (nielsdos) - -- SNMP: - . snmpget, snmpset, snmp_get2, snmp_set2, snmp_get3, snmp_set3 and - SNMP::__construct() throw an exception on invalid hostname, community - timeout and retries arguments. (David Carlier) - -- SOAP: - . Fixed bug #49169 (SoapServer calls wrong function, although "SOAP action" - header is correct). (nielsdos) - . Fix namespace handling of WSDL and XML schema in SOAP, - fixing at least GH-16320 and bug #68576. (nielsdos) - . Fixed bug #70951 (Segmentation fault on invalid WSDL cache). (nielsdos) - . Implement request #55503 (Extend __getTypes to support enumerations). - (nielsdos, datibbaw) - . Implement request #61105 (Support Soap 1.2 SoapFault Reason Text lang - attribute). (nielsdos) - -- Sockets: - . Added IPPROTO_ICMP/IPPROTO_ICMPV6 to create raw socket for ICMP usage. - (David Carlier) - . Added TCP_FUNCTION_BLK to change the TCP stack algorithm on FreeBSD. - (David Carlier) - . socket_set_option() catches possible overflow with SO_RCVTIMEO/SO_SNDTIMEO - with timeout setting on windows. (David Carlier) - . Added TCP_FUNCTION_ALIAS, TCP_REUSPORT_LB_NUMA, TCP_REUSPORT_LB_NUMA_NODOM, - TCP_REUSPORT_LB_CURDOM, TCP_BBR_ALGORITHM constants. - . socket_create_listen() throws an exception on invalid port value. - (David Carlier) - . socket_bind() throws an exception on invalid port value. - (David Carlier) - . socket_sendto() throws an exception on invalid port value. - (David Carlier) - . socket_addrinfo_lookup throws an exception on invalid hints value types. - (David Carlier) - . socket_addrinfo_lookup throws an exception if any of the hints value - overflows. (David Carlier) - . socket_addrinfo_lookup throws an exception if one or more hints entries - has an index as numeric. (David Carlier) - . socket_set_option with the options MCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUP - will throw an exception if its value is not a valid array/object. - (David Carlier) - . socket_getsockname/socket_create/socket_bind handled AF_PACKET family socket. - (David Carlier) - . Added IP_BINDANY for a socket to bind to any address. (David Carlier) - . Added SO_BUSY_POOL to reduce packets poll latency. (David Carlier) - - Added UDP_SEGMENT support to optimise multiple large datagrams over UDP - if the kernel and hardware supports it. (David Carlier) - - Added SHUT_RD, SHUT_WR and SHUT_RDWR constants for socket_shutdown(). - (David Carlier) - -- Sodium: - . Fix overall theoretical overflows on zend_string buffer allocations. - (David Carlier/nielsdos) - -- Sqlite: - . Added Sqlite3Stmt::busy to check if a statement is still being executed. - (David Carlier) - . Added Sqlite3Stmt::explain to produce a explain query plan from - the statement. (David Carlier) - . Added Sqlite3Result::fetchAll to returns all results at once from a query. - (David Carlier) - -- Standard: - . Fixed crypt() tests on musl when using --with-external-libcrypt - (Michael Orlitzky). - . Fixed bug GH-18062 (is_callable(func(...), callable_name: $name) for first - class callables returns wrong name). (timwolla) - . Added array_first() and array_last(). (nielsdos) - . Fixed bug GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types). - (nielsdos) - . Fixed exit code handling of sendmail cmd and added warnings. - (Jesse Hathaway) - . Fixed bug GH-18897 (printf: empty precision is interpreted as precision 6, - not as precision 0). (nielsdos) - -- Streams: - . Fixed bug GH-16889 (stream_select() timeout useless for pipes on Windows). - (cmb) - -- Tests: - . Allow to shuffle tests even in non-parallel mode. (dhuang00) - -- Tidy: - . tidy::__construct/parseFile/parseString methods throw an exception if - the configuration argument is invalid. (David Carlier) - -- Windows: - . Fixed bug GH-10992 (Improper long path support for relative paths). (cmb, - nielsdos) - . Fixed bug GH-16843 (Windows phpize builds ignore source subfolders). (cmb) - -- XMLWriter: - . Improved performance and reduce memory consumption. (nielsdos) - -- XSL: - . Implement request #30622 (make $namespace parameter functional). (nielsdos) - -- Zlib: - . gzfile, gzopen and readgzfile, their "use_include_path" argument - is now a boolean. (David Carlier) - . Fixed bug GH-16883 (gzopen() does not use the default stream context when - opening HTTP URLs). (nielsdos) - . Implemented GH-17668 (zlib streams should support locking). (nielsdos) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> From 28fd7597bae7c5ab326614364d58b592b4d9a6ea Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 17 Sep 2025 19:18:05 +0200 Subject: [PATCH 127/386] Add first-class callable cache This cache is implemented in two levels: A EG(callable_convert_cache) global that maps zend_function pointers to a shared callable instance, and a CALLABLE_CONVERT cache slot to remember the result of the hash table lookup. Fixes GH-19754 Closes GH-19863 --- NEWS | 4 +++ Zend/Optimizer/compact_literals.c | 6 ++++ Zend/tests/closures/fcc-cache.phpt | 8 +++++ Zend/tests/exit/exit_as_function.phpt | 6 ++-- .../constexpr/namespace_004.phpt | 8 ++--- .../first_class_callable_optimization.phpt | 6 ++-- .../trampoline_closure_named_arguments.phpt | 14 ++++---- Zend/zend_compile.c | 9 ++++- Zend/zend_execute_API.c | 6 ++++ Zend/zend_globals.h | 2 ++ Zend/zend_vm_def.h | 20 +++++++++-- Zend/zend_vm_execute.h | 36 +++++++++++++++++-- Zend/zend_vm_opcodes.c | 2 +- ext/dom/tests/registerPhpFunctionNS.phpt | 10 +++--- 14 files changed, 109 insertions(+), 28 deletions(-) create mode 100644 Zend/tests/closures/fcc-cache.phpt diff --git a/NEWS b/NEWS index 2213ff10b1db7..98862eefb5c89 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.6.0alpha1 +- Core: + . Added first-class callable cache to share instances for the duration of the + request. (ilutov) + - Intl: . Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, collapse type and identity fallback. diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c index a2fa32994feeb..447a034530e1b 100644 --- a/Zend/Optimizer/compact_literals.c +++ b/Zend/Optimizer/compact_literals.c @@ -741,6 +741,12 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx cache_size += 2 * sizeof(void *); } break; + case ZEND_CALLABLE_CONVERT: + if (opline->extended_value != (uint32_t)-1) { + opline->extended_value = cache_size; + cache_size += sizeof(void *); + } + break; } opline++; } diff --git a/Zend/tests/closures/fcc-cache.phpt b/Zend/tests/closures/fcc-cache.phpt new file mode 100644 index 0000000000000..3b47a2410d143 --- /dev/null +++ b/Zend/tests/closures/fcc-cache.phpt @@ -0,0 +1,8 @@ +--TEST-- +FCCs are cached and shared +--FILE-- + +--EXPECT-- +bool(true) diff --git a/Zend/tests/exit/exit_as_function.phpt b/Zend/tests/exit/exit_as_function.phpt index fb95b9f288171..726cf1f0d7a94 100644 --- a/Zend/tests/exit/exit_as_function.phpt +++ b/Zend/tests/exit/exit_as_function.phpt @@ -19,10 +19,10 @@ foreach ($values as $value) { } ?> ---EXPECT-- +--EXPECTF-- string(4) "exit" string(3) "die" -object(Closure)#1 (2) { +object(Closure)#%d (2) { ["function"]=> string(4) "exit" ["parameter"]=> @@ -31,7 +31,7 @@ object(Closure)#1 (2) { string(10) "" } } -object(Closure)#2 (2) { +object(Closure)#%d (2) { ["function"]=> string(4) "exit" ["parameter"]=> diff --git a/Zend/tests/first_class_callable/constexpr/namespace_004.phpt b/Zend/tests/first_class_callable/constexpr/namespace_004.phpt index 0fc23422199d5..6fe99593bf95d 100644 --- a/Zend/tests/first_class_callable/constexpr/namespace_004.phpt +++ b/Zend/tests/first_class_callable/constexpr/namespace_004.phpt @@ -26,7 +26,7 @@ foo(); ?> --EXPECTF-- -object(Closure)#1 (2) { +object(Closure)#%d (2) { ["function"]=> string(6) "strrev" ["parameter"]=> @@ -36,7 +36,7 @@ object(Closure)#1 (2) { } } string(3) "cba" -object(Closure)#2 (2) { +object(Closure)#%d (2) { ["function"]=> string(6) "strrev" ["parameter"]=> @@ -46,7 +46,7 @@ object(Closure)#2 (2) { } } string(3) "cba" -object(Closure)#2 (2) { +object(Closure)#%d (2) { ["function"]=> string(6) "strrev" ["parameter"]=> @@ -56,7 +56,7 @@ object(Closure)#2 (2) { } } string(3) "cba" -object(Closure)#1 (2) { +object(Closure)#%d (2) { ["function"]=> string(6) "strrev" ["parameter"]=> diff --git a/Zend/tests/first_class_callable/first_class_callable_optimization.phpt b/Zend/tests/first_class_callable/first_class_callable_optimization.phpt index 707b6a7299a4a..169f6dfd62cc2 100644 --- a/Zend/tests/first_class_callable/first_class_callable_optimization.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_optimization.phpt @@ -10,12 +10,12 @@ var_dump(test1(...)); var_dump(test2(...)); ?> ---EXPECT-- -object(Closure)#1 (1) { +--EXPECTF-- +object(Closure)#%d (1) { ["function"]=> string(5) "test1" } -object(Closure)#1 (1) { +object(Closure)#%d (1) { ["function"]=> string(5) "test2" } diff --git a/Zend/tests/magic_methods/trampoline_closure_named_arguments.phpt b/Zend/tests/magic_methods/trampoline_closure_named_arguments.phpt index e4ccaf16e63a6..3be14f6145ace 100644 --- a/Zend/tests/magic_methods/trampoline_closure_named_arguments.phpt +++ b/Zend/tests/magic_methods/trampoline_closure_named_arguments.phpt @@ -42,7 +42,7 @@ var_dump($type); var_dump($type->getName()); ?> ---EXPECT-- +--EXPECTF-- -- Non-static cases -- string(4) "test" array(3) { @@ -69,7 +69,7 @@ array(4) { ["a"]=> int(123) ["b"]=> - object(Test)#1 (0) { + object(Test)#%d (0) { } } string(4) "test" @@ -77,7 +77,7 @@ array(2) { ["a"]=> int(123) ["b"]=> - object(Test)#1 (0) { + object(Test)#%d (0) { } } string(4) "test" @@ -114,7 +114,7 @@ array(4) { ["a"]=> int(123) ["b"]=> - object(Test)#1 (0) { + object(Test)#%d (0) { } } string(10) "testStatic" @@ -122,7 +122,7 @@ array(2) { ["a"]=> int(123) ["b"]=> - object(Test)#1 (0) { + object(Test)#%d (0) { } } string(10) "testStatic" @@ -136,12 +136,12 @@ array(1) { -- Reflection tests -- array(1) { [0]=> - object(ReflectionParameter)#4 (1) { + object(ReflectionParameter)#%d (1) { ["name"]=> string(9) "arguments" } } bool(true) -object(ReflectionNamedType)#5 (0) { +object(ReflectionNamedType)#%d (0) { } string(5) "mixed" diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 57c012ac71a66..74b63951fa961 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3965,7 +3965,14 @@ static bool zend_compile_call_common(znode *result, zend_ast *args_ast, zend_fun opline->op1.num = zend_vm_calc_used_stack(0, fbc); } - zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT, NULL, NULL); + zend_op *callable_convert_op = zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT, NULL, NULL); + if (opline->opcode == ZEND_INIT_FCALL + || opline->opcode == ZEND_INIT_FCALL_BY_NAME + || opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) { + callable_convert_op->extended_value = zend_alloc_cache_slot(); + } else { + callable_convert_op->extended_value = (uint32_t)-1; + } return true; } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1fd0913076534..fd4ef074861fc 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -203,6 +203,8 @@ void init_executor(void) /* {{{ */ zend_fiber_init(); zend_weakrefs_init(); + zend_hash_init(&EG(callable_convert_cache), 8, NULL, ZVAL_PTR_DTOR, 0); + EG(active) = 1; } /* }}} */ @@ -420,6 +422,8 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1); zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1); + zend_hash_clean(&EG(callable_convert_cache)); + #if ZEND_DEBUG if (!CG(unclean_shutdown)) { gc_collect_cycles(); @@ -516,6 +520,8 @@ void shutdown_executor(void) /* {{{ */ if (EG(ht_iterators) != EG(ht_iterators_slots)) { efree(EG(ht_iterators)); } + + zend_hash_destroy(&EG(callable_convert_cache)); } #if ZEND_DEBUG diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 48b978b535014..fa24128ae20ed 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -319,6 +319,8 @@ struct _zend_executor_globals { zend_strtod_state strtod_state; + HashTable callable_convert_cache; + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; }; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b90117e70f226..68449b9ef0509 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9709,12 +9709,28 @@ ZEND_VM_HANDLER(167, ZEND_COPY_TMP, TMPVAR, UNUSED) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(202, ZEND_CALLABLE_CONVERT, UNUSED, UNUSED) +ZEND_VM_HANDLER(202, ZEND_CALLABLE_CONVERT, UNUSED, UNUSED, NUM|CACHE_SLOT) { USE_OPLINE zend_execute_data *call = EX(call); - zend_closure_from_frame(EX_VAR(opline->result.var), call); + if (opline->extended_value != (uint32_t)-1) { + zend_object *closure = CACHED_PTR(opline->extended_value); + if (closure) { + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + } else { + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + if (Z_TYPE_P(closure_zv) == IS_NULL) { + zend_closure_from_frame(closure_zv, call); + } + ZEND_ASSERT(Z_TYPE_P(closure_zv) == IS_OBJECT); + closure = Z_OBJ_P(closure_zv); + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + CACHE_PTR(opline->extended_value, closure); + } + } else { + zend_closure_from_frame(EX_VAR(opline->result.var), call); + } if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { OBJ_RELEASE(Z_OBJ(call->This)); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 9d940cfadbcb1..0090bf77dd30c 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -39087,7 +39087,23 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONV USE_OPLINE zend_execute_data *call = EX(call); - zend_closure_from_frame(EX_VAR(opline->result.var), call); + if (opline->extended_value != (uint32_t)-1) { + zend_object *closure = CACHED_PTR(opline->extended_value); + if (closure) { + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + } else { + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + if (Z_TYPE_P(closure_zv) == IS_NULL) { + zend_closure_from_frame(closure_zv, call); + } + ZEND_ASSERT(Z_TYPE_P(closure_zv) == IS_OBJECT); + closure = Z_OBJ_P(closure_zv); + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + CACHE_PTR(opline->extended_value, closure); + } + } else { + zend_closure_from_frame(EX_VAR(opline->result.var), call); + } if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { OBJ_RELEASE(Z_OBJ(call->This)); @@ -94308,7 +94324,23 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_S USE_OPLINE zend_execute_data *call = EX(call); - zend_closure_from_frame(EX_VAR(opline->result.var), call); + if (opline->extended_value != (uint32_t)-1) { + zend_object *closure = CACHED_PTR(opline->extended_value); + if (closure) { + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + } else { + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + if (Z_TYPE_P(closure_zv) == IS_NULL) { + zend_closure_from_frame(closure_zv, call); + } + ZEND_ASSERT(Z_TYPE_P(closure_zv) == IS_OBJECT); + closure = Z_OBJ_P(closure_zv); + ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); + CACHE_PTR(opline->extended_value, closure); + } + } else { + zend_closure_from_frame(EX_VAR(opline->result.var), call); + } if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { OBJ_RELEASE(Z_OBJ(call->This)); diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 00ad38baaafeb..936a96e55e41f 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -439,7 +439,7 @@ static uint32_t zend_vm_opcodes_flags[211] = { 0x00000101, 0x00000101, 0x00000101, - 0x00000101, + 0x01040101, 0x00002001, 0x00000101, 0x00000100, diff --git a/ext/dom/tests/registerPhpFunctionNS.phpt b/ext/dom/tests/registerPhpFunctionNS.phpt index 4c4fb157000bf..2ee98168251fd 100644 --- a/ext/dom/tests/registerPhpFunctionNS.phpt +++ b/ext/dom/tests/registerPhpFunctionNS.phpt @@ -62,14 +62,14 @@ $xpath->registerPhpFunctionNS('urn:bar', 'test', 'strtolower'); var_dump($xpath->query('//a[bar:test(string(@href)) = "https://php.net"]')); ?> ---EXPECT-- +--EXPECTF-- --- Legit cases: global function callable --- object(DOMNodeList)#5 (1) { ["length"]=> int(1) } --- Legit cases: string callable --- -object(DOMNodeList)#5 (1) { +object(DOMNodeList)#%d (1) { ["length"]=> int(1) } @@ -79,12 +79,12 @@ array(1) { [0]=> string(15) "https://PHP.net" } -object(DOMNodeList)#3 (1) { +object(DOMNodeList)#%d (1) { ["length"]=> int(0) } --- Legit cases: instance class method callable --- -object(DOMNodeList)#6 (1) { +object(DOMNodeList)#%d (1) { ["length"]=> int(1) } @@ -100,7 +100,7 @@ array(1) { --- Legit cases: global function callable that returns nothing --- string(15) "https://PHP.net" --- Legit cases: multiple namespaces --- -object(DOMNodeList)#5 (1) { +object(DOMNodeList)#%d (1) { ["length"]=> int(1) } From 5664ca68215f5013f8964cd586c296e59e1c1d37 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 11:33:48 +0100 Subject: [PATCH 128/386] Zend/Optimizer/zend_ssa.c: use bool type instead of char type --- Zend/Optimizer/zend_ssa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index b522a033250c5..ed39862c437c9 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -131,7 +131,7 @@ static zend_ssa_phi *add_pi( static void pi_range( zend_ssa_phi *phi, int min_var, int max_var, zend_long min, zend_long max, - char underflow, char overflow, char negative) /* {{{ */ + bool underflow, bool overflow, bool negative) /* {{{ */ { zend_ssa_range_constraint *constraint = &phi->constraint.range; constraint->min_var = min_var; @@ -148,16 +148,16 @@ static void pi_range( /* }}} */ static inline void pi_range_equals(zend_ssa_phi *phi, int var, zend_long val) { - pi_range(phi, var, var, val, val, 0, 0, 0); + pi_range(phi, var, var, val, val, false, false, false); } static inline void pi_range_not_equals(zend_ssa_phi *phi, int var, zend_long val) { - pi_range(phi, var, var, val, val, 0, 0, 1); + pi_range(phi, var, var, val, val, false, false, true); } static inline void pi_range_min(zend_ssa_phi *phi, int var, zend_long val) { - pi_range(phi, var, -1, val, ZEND_LONG_MAX, 0, 1, 0); + pi_range(phi, var, -1, val, ZEND_LONG_MAX, false, true, false); } static inline void pi_range_max(zend_ssa_phi *phi, int var, zend_long val) { - pi_range(phi, -1, var, ZEND_LONG_MIN, val, 1, 0, 0); + pi_range(phi, -1, var, ZEND_LONG_MIN, val, true, false, false); } static void pi_type_mask(zend_ssa_phi *phi, uint32_t type_mask) { From 0e6bdf890b4941abc995a5e51a6d6d706cc79c85 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 11:46:17 +0100 Subject: [PATCH 129/386] Zend/Optimizer/zend_inference.c: use bool type instead of int type --- Zend/Optimizer/zend_inference.c | 32 ++++++++++++++++---------------- Zend/Optimizer/zend_inference.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 2d490cea3ae19..1c93e9e9c4ff5 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1068,7 +1068,7 @@ static bool zend_inference_calc_binary_op_range( return 0; } -static bool zend_inference_calc_range(const zend_op_array *op_array, const zend_ssa *ssa, int var, int widening, int narrowing, zend_ssa_range *tmp) +static bool zend_inference_calc_range(const zend_op_array *op_array, const zend_ssa *ssa, int var, int widening, bool narrowing, zend_ssa_range *tmp) { uint32_t line; const zend_op *opline; @@ -1735,7 +1735,7 @@ static void zend_infer_ranges_warmup(const zend_op_array *op_array, zend_ssa *ss zend_bitset worklist = do_alloca(sizeof(zend_ulong) * worklist_len * 2, use_heap); zend_bitset visited = worklist + worklist_len; #ifdef NEG_RANGE - int has_inner_cycles = 0; + bool has_inner_cycles = false; memset(worklist, 0, sizeof(zend_ulong) * worklist_len); memset(visited, 0, sizeof(zend_ulong) * worklist_len); @@ -1743,7 +1743,7 @@ static void zend_infer_ranges_warmup(const zend_op_array *op_array, zend_ssa *ss while (j >= 0) { if (!zend_bitset_in(visited, j) && zend_check_inner_cycles(op_array, ssa, worklist, visited, j)) { - has_inner_cycles = 1; + has_inner_cycles = true; break; } j = next_scc_var[j]; @@ -2130,7 +2130,7 @@ ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv) } -ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert) +ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, bool write, bool insert) { uint32_t tmp = 0; @@ -4142,7 +4142,7 @@ static uint32_t get_class_entry_rank(zend_class_entry *ce) { /* Compute least common ancestor on class inheritance tree only */ static zend_class_entry *join_class_entries( - zend_class_entry *ce1, zend_class_entry *ce2, int *is_instanceof) { + zend_class_entry *ce1, zend_class_entry *ce2, bool *is_instanceof) { uint32_t rank1, rank2; if (ce1 == ce2) { return ce1; @@ -4170,7 +4170,7 @@ static zend_class_entry *join_class_entries( } if (ce1) { - *is_instanceof = 1; + *is_instanceof = true; } return ce1; } @@ -4204,7 +4204,7 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend zend_ssa_phi *p = ssa_vars[j].definition_phi; if (p->pi >= 0) { zend_class_entry *ce = ssa_var_info[p->sources[0]].ce; - int is_instanceof = ssa_var_info[p->sources[0]].is_instanceof; + bool is_instanceof = ssa_var_info[p->sources[0]].is_instanceof; tmp = get_ssa_var_info(ssa, p->sources[0]); if (!p->has_range_constraint) { @@ -4216,7 +4216,7 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend if ((tmp & MAY_BE_OBJECT) && constraint->ce && ce != constraint->ce) { if (!ce) { ce = constraint->ce; - is_instanceof = 1; + is_instanceof = true; } else if (is_instanceof && safe_instanceof(constraint->ce, ce)) { ce = constraint->ce; } else { @@ -4233,8 +4233,8 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend UPDATE_SSA_OBJ_TYPE(ce, is_instanceof, j); } } else { - int first = 1; - int is_instanceof = 0; + bool first = true; + bool is_instanceof = false; zend_class_entry *ce = NULL; tmp = 0; @@ -4251,7 +4251,7 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend if (first) { ce = info->ce; is_instanceof = info->is_instanceof; - first = 0; + first = false; } else { is_instanceof |= info->is_instanceof; ce = join_class_entries(ce, info->ce, &is_instanceof); @@ -4536,7 +4536,7 @@ uint32_t zend_get_return_info_from_signature_only( && !(func->common.fn_flags & ZEND_ACC_GENERATOR)) { type |= MAY_BE_REF; *ce = NULL; - *ce_is_instanceof = 0; + *ce_is_instanceof = false; } return type; } @@ -4557,8 +4557,8 @@ ZEND_API void zend_init_func_return_info( static void zend_func_return_info(const zend_op_array *op_array, const zend_script *script, - int recursive, - int widening, + bool recursive, + bool widening, zend_ssa_var_info *ret) { zend_func_info *info = ZEND_FUNC_INFO(op_array); @@ -4571,7 +4571,7 @@ static void zend_func_return_info(const zend_op_array *op_array, zend_class_entry *tmp_ce = NULL; int tmp_is_instanceof = -1; zend_class_entry *arg_ce; - int arg_is_instanceof; + bool arg_is_instanceof; zend_ssa_range tmp_range = {0, 0, 0, 0}; int tmp_has_range = -1; @@ -4626,7 +4626,7 @@ static void zend_func_return_info(const zend_op_array *op_array, arg_is_instanceof = info->ssa.var_info[ssa_op->op1_use].is_instanceof; } else { arg_ce = NULL; - arg_is_instanceof = 0; + arg_is_instanceof = false; } if (tmp_is_instanceof < 0) { diff --git a/Zend/Optimizer/zend_inference.h b/Zend/Optimizer/zend_inference.h index 666abc586592e..7e4841c81c493 100644 --- a/Zend/Optimizer/zend_inference.h +++ b/Zend/Optimizer/zend_inference.h @@ -221,7 +221,7 @@ ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, ze ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa); ZEND_API zend_result zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level); -ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert); +ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, bool write, bool insert); ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp); From 7c0f7f8f3496928d0f5e462c0adfb6005f01d0ce Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 11:58:32 +0100 Subject: [PATCH 130/386] Zend/Optimizer/zend_inference.c: use uint32_t type instead of int type --- Zend/Optimizer/zend_inference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 1c93e9e9c4ff5..d203cd4b47223 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2464,7 +2464,7 @@ static const zend_property_info *zend_fetch_static_prop_info(const zend_script * if (opline->op1_type == IS_CONST) { zend_class_entry *ce = NULL; if (opline->op2_type == IS_UNUSED) { - int fetch_type = opline->op2.num & ZEND_FETCH_CLASS_MASK; + uint32_t fetch_type = opline->op2.num & ZEND_FETCH_CLASS_MASK; switch (fetch_type) { case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_STATIC: From 5d959a7d626459cf9abf81f6450e14b3cf25b87f Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:03:29 +0100 Subject: [PATCH 131/386] Zend/Optimizer/zend_func_info.c: add const qualifiers --- Zend/Optimizer/zend_func_info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c index 41852dd798aa1..88117b4187b01 100644 --- a/Zend/Optimizer/zend_func_info.c +++ b/Zend/Optimizer/zend_func_info.c @@ -57,7 +57,7 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa && (call_info->num_args == 2 || call_info->num_args == 3) && ssa && !(ssa->cfg.flags & ZEND_SSA_TSSA)) { - zend_op_array *op_array = call_info->caller_op_array; + const zend_op_array *op_array = call_info->caller_op_array; uint32_t t1 = _ssa_op1_info(op_array, ssa, call_info->arg_info[0].opline, ssa->ops ? &ssa->ops[call_info->arg_info[0].opline - op_array->opcodes] : NULL); uint32_t t2 = _ssa_op1_info(op_array, ssa, call_info->arg_info[1].opline, @@ -116,7 +116,7 @@ uint32_t zend_get_internal_func_info( return 0; } - func_info_t *info = Z_PTR_P(zv); + const func_info_t *info = Z_PTR_P(zv); if (info->info_func) { return call_info ? info->info_func(call_info, ssa) : 0; } else { @@ -178,7 +178,7 @@ ZEND_API uint32_t zend_get_func_info( } else { if (!call_info->is_prototype) { // FIXME: the order of functions matters!!! - zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)callee_func); + const zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)callee_func); if (info) { ret = info->return_info.type; *ce = info->return_info.ce; From 12ab7c3cc0eeb62804c0b6cd4a04058069f08544 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:04:01 +0100 Subject: [PATCH 132/386] Zend/Optimizer/zend_func_info.c: rename parameter to prevent shadowing global variable --- Zend/Optimizer/zend_func_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c index 88117b4187b01..f3b0d663dd6df 100644 --- a/Zend/Optimizer/zend_func_info.c +++ b/Zend/Optimizer/zend_func_info.c @@ -198,13 +198,13 @@ ZEND_API uint32_t zend_get_func_info( return ret; } -static void zend_func_info_add(const func_info_t *func_infos, size_t n) +static void zend_func_info_add(const func_info_t *new_func_infos, size_t n) { for (size_t i = 0; i < n; i++) { - zend_string *key = zend_string_init_interned(func_infos[i].name, func_infos[i].name_len, 1); + zend_string *key = zend_string_init_interned(new_func_infos[i].name, new_func_infos[i].name_len, 1); - if (zend_hash_add_ptr(&func_info, key, (void**)&func_infos[i]) == NULL) { - fprintf(stderr, "ERROR: Duplicate function info for \"%s\"\n", func_infos[i].name); + if (zend_hash_add_ptr(&func_info, key, (void**)&new_func_infos[i]) == NULL) { + fprintf(stderr, "ERROR: Duplicate function info for \"%s\"\n", new_func_infos[i].name); } zend_string_release_ex(key, 1); From ada9d37527a5f84fe2550aab5e29dfe5019cdd4a Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:20:09 +0100 Subject: [PATCH 133/386] Zend/Optimizer/zend_optimizer: add const qualifiers --- Zend/Optimizer/zend_optimizer.c | 90 ++++++++++++------------ Zend/Optimizer/zend_optimizer_internal.h | 16 ++--- Zend/zend_compile.h | 2 +- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 0a05992544203..11537ccf144b6 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -41,7 +41,7 @@ struct { int last; } zend_optimizer_registered_passes = {{NULL}, 0}; -void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value) +void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, const zval *name, zval* value) { if (!ctx->constants) { ctx->constants = zend_arena_alloc(&ctx->arena, sizeof(HashTable)); @@ -103,11 +103,11 @@ zend_result zend_optimizer_eval_strlen(zval *result, const zval *op1) /* {{{ */ /* }}} */ zend_result zend_optimizer_eval_special_func_call( - zval *result, zend_string *name, zend_string *arg) { + zval *result, const zend_string *name, zend_string *arg) { if (zend_string_equals_literal(name, "function_exists") || zend_string_equals_literal(name, "is_callable")) { zend_string *lc_name = zend_string_tolower(arg); - zend_internal_function *func = zend_hash_find_ptr(EG(function_table), lc_name); + const zend_internal_function *func = zend_hash_find_ptr(EG(function_table), lc_name); zend_string_release_ex(lc_name, 0); if (func && func->type == ZEND_INTERNAL_FUNCTION @@ -180,7 +180,7 @@ zend_result zend_optimizer_eval_special_func_call( return FAILURE; } -bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value) +bool zend_optimizer_get_collected_constant(const HashTable *constants, const zval *name, zval* value) { zval *val; @@ -191,7 +191,7 @@ bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zva return false; } -void zend_optimizer_convert_to_free_op1(zend_op_array *op_array, zend_op *opline) +void zend_optimizer_convert_to_free_op1(const zend_op_array *op_array, zend_op *opline) { if (opline->op1_type == IS_CV) { opline->opcode = ZEND_CHECK_VAR; @@ -603,7 +603,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, uint32_t var, zval *val) { - zend_op *end = op_array->opcodes + op_array->last; + const zend_op *end = op_array->opcodes + op_array->last; while (opline < end) { if (opline->op1_type == type && @@ -622,7 +622,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, case ZEND_MATCH: case ZEND_MATCH_ERROR: case ZEND_JMP_NULL: { - zend_op *end = op_array->opcodes + op_array->last; + const zend_op *end = op_array->opcodes + op_array->last; while (opline < end) { if (opline->op1_type == type && opline->op1.var == var) { /* If this opcode doesn't keep the operand alive, we're done. Check @@ -653,7 +653,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, return true; } case ZEND_VERIFY_RETURN_TYPE: { - zend_arg_info *ret_info = op_array->arg_info - 1; + const zend_arg_info *ret_info = op_array->arg_info - 1; if (!ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(val)) || (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE)) { return false; @@ -685,7 +685,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array, } /* Update jump offsets after a jump was migrated to another opline */ -void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline) { +void zend_optimizer_migrate_jump(const zend_op_array *op_array, zend_op *new_opline, zend_op *opline) { switch (new_opline->opcode) { case ZEND_JMP: case ZEND_FAST_CALL: @@ -718,7 +718,7 @@ void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, z case ZEND_SWITCH_STRING: case ZEND_MATCH: { - HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); + const HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); zval *zv; ZEND_HASH_FOREACH_VAL(jumptable, zv) { Z_LVAL_P(zv) = ZEND_OPLINE_NUM_TO_OFFSET(op_array, new_opline, ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))); @@ -730,7 +730,7 @@ void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, z } /* Shift jump offsets based on shiftlist */ -void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist) { +void zend_optimizer_shift_jump(const zend_op_array *op_array, zend_op *opline, const uint32_t *shiftlist) { switch (opline->opcode) { case ZEND_JMP: case ZEND_FAST_CALL: @@ -763,7 +763,7 @@ void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_ case ZEND_SWITCH_STRING: case ZEND_MATCH: { - HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); + const HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); zval *zv; ZEND_HASH_FOREACH_VAL(jumptable, zv) { Z_LVAL_P(zv) = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv)) - shiftlist[ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))]); @@ -774,12 +774,12 @@ void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_ } } -static bool zend_optimizer_ignore_class(zval *ce_zv, zend_string *filename) +static bool zend_optimizer_ignore_class(zval *ce_zv, const zend_string *filename) { - zend_class_entry *ce = Z_PTR_P(ce_zv); + const zend_class_entry *ce = Z_PTR_P(ce_zv); if (ce->ce_flags & ZEND_ACC_PRELOADED) { - Bucket *ce_bucket = (Bucket*)((uintptr_t)ce_zv - XtOffsetOf(Bucket, val)); + const Bucket *ce_bucket = (const Bucket*)((uintptr_t)ce_zv - XtOffsetOf(Bucket, val)); size_t offset = ce_bucket - EG(class_table)->arData; if (offset < EG(persistent_classes_count)) { return false; @@ -789,15 +789,15 @@ static bool zend_optimizer_ignore_class(zval *ce_zv, zend_string *filename) && (!ce->info.user.filename || ce->info.user.filename != filename); } -static bool zend_optimizer_ignore_function(zval *fbc_zv, zend_string *filename) +static bool zend_optimizer_ignore_function(zval *fbc_zv, const zend_string *filename) { - zend_function *fbc = Z_PTR_P(fbc_zv); + const zend_function *fbc = Z_PTR_P(fbc_zv); if (fbc->type == ZEND_INTERNAL_FUNCTION) { return false; } else if (fbc->type == ZEND_USER_FUNCTION) { if (fbc->op_array.fn_flags & ZEND_ACC_PRELOADED) { - Bucket *fbc_bucket = (Bucket*)((uintptr_t)fbc_zv - XtOffsetOf(Bucket, val)); + const Bucket *fbc_bucket = (const Bucket*)((uintptr_t)fbc_zv - XtOffsetOf(Bucket, val)); size_t offset = fbc_bucket - EG(function_table)->arData; if (offset < EG(persistent_functions_count)) { return false; @@ -832,7 +832,7 @@ zend_class_entry *zend_optimizer_get_class_entry( zend_class_entry *zend_optimizer_get_class_entry_from_op1( const zend_script *script, const zend_op_array *op_array, const zend_op *opline) { if (opline->op1_type == IS_CONST) { - zval *op1 = CRT_CONSTANT(opline->op1); + const zval *op1 = CRT_CONSTANT(opline->op1); if (Z_TYPE_P(op1) == IS_STRING) { return zend_optimizer_get_class_entry(script, op_array, Z_STR_P(op1 + 1)); } @@ -855,7 +855,7 @@ const zend_class_constant *zend_fetch_class_const_info( return NULL; } if (opline->op1_type == IS_CONST) { - zval *op1 = CRT_CONSTANT(opline->op1); + const zval *op1 = CRT_CONSTANT(opline->op1); if (Z_TYPE_P(op1) == IS_STRING) { if (script) { ce = zend_optimizer_get_class_entry(script, op_array, Z_STR_P(op1 + 1)); @@ -899,7 +899,7 @@ const zend_class_constant *zend_fetch_class_const_info( } zend_function *zend_optimizer_get_called_func( - zend_script *script, zend_op_array *op_array, zend_op *opline, bool *is_prototype) + const zend_script *script, const zend_op_array *op_array, zend_op *opline, bool *is_prototype) { *is_prototype = false; switch (opline->opcode) { @@ -920,7 +920,7 @@ zend_function *zend_optimizer_get_called_func( case ZEND_INIT_FCALL_BY_NAME: case ZEND_INIT_NS_FCALL_BY_NAME: if (opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING) { - zval *function_name = CRT_CONSTANT(opline->op2) + 1; + const zval *function_name = CRT_CONSTANT(opline->op2) + 1; zend_function *func; zval *func_zv; if (script && (func = zend_hash_find_ptr(&script->function_table, Z_STR_P(function_name)))) { @@ -934,7 +934,7 @@ zend_function *zend_optimizer_get_called_func( break; case ZEND_INIT_STATIC_METHOD_CALL: if (opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING) { - zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( + const zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( script, op_array, opline); if (ce) { zend_string *func_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1); @@ -978,13 +978,13 @@ zend_function *zend_optimizer_get_called_func( } break; case ZEND_INIT_PARENT_PROPERTY_HOOK_CALL: { - zend_class_entry *scope = op_array->scope; + const zend_class_entry *scope = op_array->scope; ZEND_ASSERT(scope != NULL); if ((scope->ce_flags & ZEND_ACC_LINKED) && scope->parent) { - zend_class_entry *parent_scope = scope->parent; + const zend_class_entry *parent_scope = scope->parent; zend_string *prop_name = Z_STR_P(CRT_CONSTANT(opline->op1)); zend_property_hook_kind hook_kind = opline->op2.num; - zend_property_info *prop_info = zend_get_property_info(parent_scope, prop_name, /* silent */ true); + const zend_property_info *prop_info = zend_get_property_info(parent_scope, prop_name, /* silent */ true); if (prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO @@ -1001,7 +1001,7 @@ zend_function *zend_optimizer_get_called_func( } case ZEND_NEW: { - zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( + const zend_class_entry *ce = zend_optimizer_get_class_entry_from_op1( script, op_array, opline); if (ce && ce->type == ZEND_USER_CLASS) { return ce->constructor; @@ -1012,7 +1012,7 @@ zend_function *zend_optimizer_get_called_func( return NULL; } -uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args) { +uint32_t zend_optimizer_classify_function(const zend_string *name, uint32_t num_args) { if (zend_string_equals_literal(name, "extract")) { return ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (zend_string_equals_literal(name, "compact")) { @@ -1164,12 +1164,12 @@ static void zend_optimize(zend_op_array *op_array, static void zend_revert_pass_two(zend_op_array *op_array) { - zend_op *opline, *end; + zend_op *opline; ZEND_ASSERT((op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) != 0); opline = op_array->opcodes; - end = opline + op_array->last; + const zend_op *end = opline + op_array->last; while (opline < end) { if (opline->op1_type == IS_CONST) { ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, opline->op1); @@ -1302,7 +1302,7 @@ static void zend_redo_pass_two(zend_op_array *op_array) op_array->fn_flags |= ZEND_ACC_DONE_PASS_TWO; } -static void zend_redo_pass_two_ex(zend_op_array *op_array, zend_ssa *ssa) +static void zend_redo_pass_two_ex(zend_op_array *op_array, const zend_ssa *ssa) { zend_op *opline, *end; #if ZEND_USE_ABS_JMP_ADDR && !ZEND_USE_ABS_CONST_ADDR @@ -1331,7 +1331,7 @@ static void zend_redo_pass_two_ex(zend_op_array *op_array, zend_ssa *ssa) opline = op_array->opcodes; end = opline + op_array->last; while (opline < end) { - zend_ssa_op *ssa_op = &ssa->ops[opline - op_array->opcodes]; + const zend_ssa_op *ssa_op = &ssa->ops[opline - op_array->opcodes]; uint32_t op1_info = opline->op1_type == IS_UNUSED ? 0 : (OP1_INFO() & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_KEY_ANY)); uint32_t op2_info = opline->op1_type == IS_UNUSED ? 0 : (OP2_INFO() & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_KEY_ANY)); uint32_t res_info = @@ -1461,13 +1461,13 @@ static void zend_optimize_op_array(zend_op_array *op_array, } } -static void zend_adjust_fcall_stack_size(zend_op_array *op_array, zend_optimizer_ctx *ctx) +static void zend_adjust_fcall_stack_size(const zend_op_array *op_array, const zend_optimizer_ctx *ctx) { zend_function *func; - zend_op *opline, *end; + zend_op *opline; opline = op_array->opcodes; - end = opline + op_array->last; + const zend_op* end = opline + op_array->last; while (opline < end) { if (opline->opcode == ZEND_INIT_FCALL) { func = zend_hash_find_ptr( @@ -1481,12 +1481,12 @@ static void zend_adjust_fcall_stack_size(zend_op_array *op_array, zend_optimizer } } -static void zend_adjust_fcall_stack_size_graph(zend_op_array *op_array) +static void zend_adjust_fcall_stack_size_graph(const zend_op_array *op_array) { - zend_func_info *func_info = ZEND_FUNC_INFO(op_array); + const zend_func_info *func_info = ZEND_FUNC_INFO(op_array); if (func_info) { - zend_call_info *call_info =func_info->callee_info; + const zend_call_info *call_info =func_info->callee_info; while (call_info) { zend_op *opline = call_info->caller_init_opline; @@ -1500,9 +1500,9 @@ static void zend_adjust_fcall_stack_size_graph(zend_op_array *op_array) } } -static bool needs_live_range(zend_op_array *op_array, zend_op *def_opline) { - zend_func_info *func_info = ZEND_FUNC_INFO(op_array); - zend_ssa_op *ssa_op = &func_info->ssa.ops[def_opline - op_array->opcodes]; +static bool needs_live_range(const zend_op_array *op_array, const zend_op *def_opline) { + const zend_func_info *func_info = ZEND_FUNC_INFO(op_array); + const zend_ssa_op *ssa_op = &func_info->ssa.ops[def_opline - op_array->opcodes]; int ssa_var = ssa_op->result_def; if (ssa_var < 0) { /* Be conservative. */ @@ -1543,7 +1543,7 @@ void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void if (Z_TYPE_P(zv) == IS_ALIAS_PTR) { continue; } - zend_class_entry *ce = Z_CE_P(zv); + const zend_class_entry *ce = Z_CE_P(zv); ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) { if (op_array->scope == ce && op_array->type == ZEND_USER_FUNCTION @@ -1558,7 +1558,7 @@ void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void zend_function **hooks = property->hooks; if (property->ce == ce && property->hooks) { for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) { - zend_function *hook = hooks[i]; + const zend_function *hook = hooks[i]; if (hook && hook->common.scope == ce && !(hooks[i]->op_array.fn_flags & ZEND_ACC_TRAIT_CLONE)) { zend_foreach_op_array_helper(&hooks[i]->op_array, func, context); } @@ -1718,10 +1718,10 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l if (Z_TYPE_P(zv) == IS_ALIAS_PTR) { continue; } - zend_class_entry *ce = Z_CE_P(zv); + const zend_class_entry *ce = Z_CE_P(zv); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) { if (op_array->scope != ce && op_array->type == ZEND_USER_FUNCTION) { - zend_op_array *orig_op_array = + const zend_op_array *orig_op_array = zend_hash_find_ptr(&op_array->scope->function_table, name); ZEND_ASSERT(orig_op_array != NULL); diff --git a/Zend/Optimizer/zend_optimizer_internal.h b/Zend/Optimizer/zend_optimizer_internal.h index 4bc2543457e29..8814a3846ea8c 100644 --- a/Zend/Optimizer/zend_optimizer_internal.h +++ b/Zend/Optimizer/zend_optimizer_internal.h @@ -78,17 +78,17 @@ static inline bool zend_optimizer_is_loop_var_free(const zend_op *opline) { || (opline->opcode == ZEND_FREE && opline->extended_value == ZEND_FREE_SWITCH); } -void zend_optimizer_convert_to_free_op1(zend_op_array *op_array, zend_op *opline); +void zend_optimizer_convert_to_free_op1(const zend_op_array *op_array, zend_op *opline); uint32_t zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv); bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy); -void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value); -bool zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value); +void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, const zval *name, zval* value); +bool zend_optimizer_get_collected_constant(const HashTable *constants, const zval *name, zval* value); zend_result zend_optimizer_eval_binary_op(zval *result, uint8_t opcode, zval *op1, zval *op2); zend_result zend_optimizer_eval_unary_op(zval *result, uint8_t opcode, zval *op1); zend_result zend_optimizer_eval_cast(zval *result, uint32_t type, zval *op1); zend_result zend_optimizer_eval_strlen(zval *result, const zval *op1); zend_result zend_optimizer_eval_special_func_call( - zval *result, zend_string *name, zend_string *arg); + zval *result, const zend_string *name, zend_string *arg); bool zend_optimizer_update_op1_const(zend_op_array *op_array, zend_op *opline, zval *val); @@ -120,10 +120,10 @@ void zend_optimizer_nop_removal(zend_op_array *op_array, zend_optimizer_ctx *ctx void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx); void zend_optimizer_compact_vars(zend_op_array *op_array); zend_function *zend_optimizer_get_called_func( - zend_script *script, zend_op_array *op_array, zend_op *opline, bool *is_prototype); -uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args); -void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline); -void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist); + const zend_script *script, const zend_op_array *op_array, zend_op *opline, bool *is_prototype); +uint32_t zend_optimizer_classify_function(const zend_string *name, uint32_t num_args); +void zend_optimizer_migrate_jump(const zend_op_array *op_array, zend_op *new_opline, zend_op *opline); +void zend_optimizer_shift_jump(const zend_op_array *op_array, zend_op *opline, const uint32_t *shiftlist); uint32_t sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map); int dce_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *optimizer_ctx, zend_ssa *ssa, bool reorder_dtor_effects); zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 4a10ad99e2428..8321e4a03c1e3 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -996,7 +996,7 @@ static zend_always_inline const char *zend_get_unmangled_property_name(const zen #define ZEND_FUNCTION_DTOR zend_function_dtor #define ZEND_CLASS_DTOR destroy_zend_class -typedef bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline); +typedef bool (*zend_needs_live_range_cb)(const zend_op_array *op_array, const zend_op *opline); ZEND_API void zend_recalc_live_ranges( zend_op_array *op_array, zend_needs_live_range_cb needs_live_range); From 4a1ae938bfefbf216c6e330b6f0e4ee0742dc20d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:20:45 +0100 Subject: [PATCH 134/386] Zend/Optimizer/zend_optimizer.c: use uint32_t type instead of int --- Zend/Optimizer/zend_optimizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 11537ccf144b6..6e6be67269329 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -869,7 +869,7 @@ const zend_class_constant *zend_fetch_class_const_info( } else if (opline->op1_type == IS_UNUSED && op_array->scope && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT) && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) { - int fetch_type = opline->op1.num & ZEND_FETCH_CLASS_MASK; + uint32_t fetch_type = opline->op1.num & ZEND_FETCH_CLASS_MASK; if (fetch_type == ZEND_FETCH_CLASS_SELF) { ce = op_array->scope; } else if (fetch_type == ZEND_FETCH_CLASS_STATIC) { From d46eb44ce41b2308071f3808cba506a52ccf2149 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:22:54 +0100 Subject: [PATCH 135/386] Zend/Optimizer/optimize_func_calls.c: add const qualifiers --- Zend/Optimizer/optimize_func_calls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/optimize_func_calls.c b/Zend/Optimizer/optimize_func_calls.c index 819a33d93bb2e..62b50464e87ba 100644 --- a/Zend/Optimizer/optimize_func_calls.c +++ b/Zend/Optimizer/optimize_func_calls.c @@ -37,7 +37,7 @@ typedef struct _optimizer_call_info { uint32_t func_arg_num; } optimizer_call_info; -static void zend_delete_call_instructions(zend_op_array *op_array, zend_op *opline) +static void zend_delete_call_instructions(const zend_op_array *op_array, zend_op *opline) { int call = 0; @@ -76,7 +76,7 @@ static void zend_delete_call_instructions(zend_op_array *op_array, zend_op *opli } } -static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_op *opline, zend_function *func) +static void zend_try_inline_call(zend_op_array *op_array, const zend_op *fcall, zend_op *opline, const zend_function *func) { const uint32_t no_discard = RETURN_VALUE_USED(opline) ? 0 : ZEND_ACC_NODISCARD; @@ -153,7 +153,7 @@ static bool has_known_send_mode(const optimizer_call_info *info, uint32_t arg_nu void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) { zend_op *opline = op_array->opcodes; - zend_op *end = opline + op_array->last; + const zend_op *end = opline + op_array->last; int call = 0; void *checkpoint; optimizer_call_info *call_stack; From 4277cc82cc0ad1d61078a1ff5558e1d0abaeb4cc Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:24:00 +0100 Subject: [PATCH 136/386] Zend/Optimizer/nop_removal.c: add const qualifiers --- Zend/Optimizer/nop_removal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/nop_removal.c b/Zend/Optimizer/nop_removal.c index c39c4bb1e4ff7..7de3919ee8cb2 100644 --- a/Zend/Optimizer/nop_removal.c +++ b/Zend/Optimizer/nop_removal.c @@ -32,20 +32,20 @@ void zend_optimizer_nop_removal(zend_op_array *op_array, zend_optimizer_ctx *ctx) { - zend_op *end, *opline; + zend_op *opline; uint32_t new_count, i, shift; uint32_t *shiftlist; ALLOCA_FLAG(use_heap); shiftlist = (uint32_t *)do_alloca(sizeof(uint32_t) * op_array->last, use_heap); i = new_count = shift = 0; - end = op_array->opcodes + op_array->last; + const zend_op *end = op_array->opcodes + op_array->last; for (opline = op_array->opcodes; opline < end; opline++) { /* Kill JMP-over-NOP-s */ if (opline->opcode == ZEND_JMP && ZEND_OP1_JMP_ADDR(opline) > op_array->opcodes + i) { /* check if there are only NOPs under the branch */ - zend_op *target = ZEND_OP1_JMP_ADDR(opline) - 1; + const zend_op *target = ZEND_OP1_JMP_ADDR(opline) - 1; while (target->opcode == ZEND_NOP) { target--; From 2bd215f281ed4f8df62e80234af3bcb6d84fa2b0 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:28:35 +0100 Subject: [PATCH 137/386] Zend/Optimizer/scdf: add const qualifiers --- Zend/Optimizer/scdf.c | 18 +++++++++--------- Zend/Optimizer/scdf.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Zend/Optimizer/scdf.c b/Zend/Optimizer/scdf.c index 54925e8287b62..f3aae89b2f3b0 100644 --- a/Zend/Optimizer/scdf.c +++ b/Zend/Optimizer/scdf.c @@ -70,7 +70,7 @@ void scdf_mark_edge_feasible(scdf_ctx *scdf, int from, int to) { } else { /* Block is already executable, only a new edge became feasible. * Reevaluate phi nodes to account for changed source operands. */ - zend_ssa_block *ssa_block = &scdf->ssa->blocks[to]; + const zend_ssa_block *ssa_block = &scdf->ssa->blocks[to]; zend_ssa_phi *phi; for (phi = ssa_block->phis; phi; phi = phi->next) { zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var); @@ -101,7 +101,7 @@ void scdf_init(zend_optimizer_ctx *ctx, scdf_ctx *scdf, zend_op_array *op_array, } void scdf_solve(scdf_ctx *scdf, const char *name) { - zend_ssa *ssa = scdf->ssa; + const zend_ssa *ssa = scdf->ssa; DEBUG_PRINT("Start SCDF solve (%s)\n", name); while (!zend_bitset_empty(scdf->instr_worklist, scdf->instr_worklist_len) || !zend_bitset_empty(scdf->phi_var_worklist, scdf->phi_var_worklist_len) @@ -140,7 +140,7 @@ void scdf_solve(scdf_ctx *scdf, const char *name) { while ((i = zend_bitset_pop_first(scdf->block_worklist, scdf->block_worklist_len)) >= 0) { /* This block is now live. Interpret phis and instructions in it. */ zend_basic_block *block = &ssa->cfg.blocks[i]; - zend_ssa_block *ssa_block = &ssa->blocks[i]; + const zend_ssa_block *ssa_block = &ssa->blocks[i]; DEBUG_PRINT("Pop block %d from worklist\n", i); zend_bitset_incl(scdf->executable_blocks, i); @@ -185,7 +185,7 @@ void scdf_solve(scdf_ctx *scdf, const char *name) { * not eliminate the latter. While it cannot be reached, the FREE opcode of the loop var * is necessary for the correctness of temporary compaction. */ static bool is_live_loop_var_free( - scdf_ctx *scdf, const zend_op *opline, const zend_ssa_op *ssa_op) { + const scdf_ctx *scdf, const zend_op *opline, const zend_ssa_op *ssa_op) { if (!zend_optimizer_is_loop_var_free(opline)) { return false; } @@ -195,7 +195,7 @@ static bool is_live_loop_var_free( return false; } - zend_ssa_var *ssa_var = &scdf->ssa->vars[var]; + const zend_ssa_var *ssa_var = &scdf->ssa->vars[var]; uint32_t def_block; if (ssa_var->definition >= 0) { def_block = scdf->ssa->cfg.map[ssa_var->definition]; @@ -205,7 +205,7 @@ static bool is_live_loop_var_free( return zend_bitset_in(scdf->executable_blocks, def_block); } -static bool kept_alive_by_loop_var_free(scdf_ctx *scdf, const zend_basic_block *block) { +static bool kept_alive_by_loop_var_free(const scdf_ctx *scdf, const zend_basic_block *block) { const zend_op_array *op_array = scdf->op_array; const zend_cfg *cfg = &scdf->ssa->cfg; if (!(cfg->flags & ZEND_FUNC_FREE_LOOP_VAR)) { @@ -220,7 +220,7 @@ static bool kept_alive_by_loop_var_free(scdf_ctx *scdf, const zend_basic_block * return false; } -static uint32_t cleanup_loop_var_free_block(scdf_ctx *scdf, zend_basic_block *block) { +static uint32_t cleanup_loop_var_free_block(const scdf_ctx *scdf, const zend_basic_block *block) { zend_ssa *ssa = scdf->ssa; const zend_op_array *op_array = scdf->op_array; const zend_cfg *cfg = &ssa->cfg; @@ -256,12 +256,12 @@ static uint32_t cleanup_loop_var_free_block(scdf_ctx *scdf, zend_basic_block *bl /* Removes unreachable blocks. This will remove both the instructions (and phis) in the * blocks, as well as remove them from the successor / predecessor lists and mark them * unreachable. Blocks already marked unreachable are not removed. */ -uint32_t scdf_remove_unreachable_blocks(scdf_ctx *scdf) { +uint32_t scdf_remove_unreachable_blocks(const scdf_ctx *scdf) { zend_ssa *ssa = scdf->ssa; int i; uint32_t removed_ops = 0; for (i = 0; i < ssa->cfg.blocks_count; i++) { - zend_basic_block *block = &ssa->cfg.blocks[i]; + const zend_basic_block *block = &ssa->cfg.blocks[i]; if (!zend_bitset_in(scdf->executable_blocks, i) && (block->flags & ZEND_BB_REACHABLE)) { if (!kept_alive_by_loop_var_free(scdf, block)) { removed_ops += block->len; diff --git a/Zend/Optimizer/scdf.h b/Zend/Optimizer/scdf.h index 0d90147e84cb1..67c53ef9fc185 100644 --- a/Zend/Optimizer/scdf.h +++ b/Zend/Optimizer/scdf.h @@ -49,10 +49,10 @@ typedef struct _scdf_ctx { void scdf_init(zend_optimizer_ctx *ctx, scdf_ctx *scdf, zend_op_array *op_array, zend_ssa *ssa); void scdf_solve(scdf_ctx *scdf, const char *name); -uint32_t scdf_remove_unreachable_blocks(scdf_ctx *scdf); +uint32_t scdf_remove_unreachable_blocks(const scdf_ctx *scdf); /* Add uses to worklist */ -static inline void scdf_add_to_worklist(scdf_ctx *scdf, int var_num) { +static inline void scdf_add_to_worklist(const scdf_ctx *scdf, int var_num) { const zend_ssa *ssa = scdf->ssa; const zend_ssa_var *var = &ssa->vars[var_num]; int use; @@ -66,7 +66,7 @@ static inline void scdf_add_to_worklist(scdf_ctx *scdf, int var_num) { } /* This should usually not be necessary, however it's used for type narrowing. */ -static inline void scdf_add_def_to_worklist(scdf_ctx *scdf, int var_num) { +static inline void scdf_add_def_to_worklist(const scdf_ctx *scdf, int var_num) { const zend_ssa_var *var = &scdf->ssa->vars[var_num]; if (var->definition >= 0) { zend_bitset_incl(scdf->instr_worklist, var->definition); From 93cba98bd3453e0fa19e02364a11df04b5ef0ec3 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:30:51 +0100 Subject: [PATCH 138/386] Zend/Optimizer/scdf: use uint32_t type instead of int --- Zend/Optimizer/scdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/scdf.c b/Zend/Optimizer/scdf.c index f3aae89b2f3b0..550c8cf7b6fcf 100644 --- a/Zend/Optimizer/scdf.c +++ b/Zend/Optimizer/scdf.c @@ -158,7 +158,7 @@ void scdf_solve(scdf_ctx *scdf, const char *name) { scdf_mark_edge_feasible(scdf, i, block->successors[0]); } else { zend_op *opline = NULL; - int j, end = block->start + block->len; + uint32_t j, end = block->start + block->len; for (j = block->start; j < end; j++) { opline = &scdf->op_array->opcodes[j]; zend_bitset_excl(scdf->instr_worklist, j); From 3644fa2744f35fda55d33cad5f729106b95ee8a6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 12:34:13 +0100 Subject: [PATCH 139/386] Zend/Optimizer: add const qualifier to visit_phi's phi parameter --- Zend/Optimizer/sccp.c | 2 +- Zend/Optimizer/scdf.c | 14 +++++--------- Zend/Optimizer/scdf.h | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index f17c17e9bf06b..bbf52d8cf691e 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -2037,7 +2037,7 @@ static void join_phi_values(zval *a, zval *b, bool escape) { } } -static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) { +static void sccp_visit_phi(scdf_ctx *scdf, const zend_ssa_phi *phi) { sccp_ctx *ctx = (sccp_ctx *) scdf; zend_ssa *ssa = scdf->ssa; ZEND_ASSERT(phi->ssa_var >= 0); diff --git a/Zend/Optimizer/scdf.c b/Zend/Optimizer/scdf.c index 550c8cf7b6fcf..e5c40b8c90cf9 100644 --- a/Zend/Optimizer/scdf.c +++ b/Zend/Optimizer/scdf.c @@ -71,8 +71,7 @@ void scdf_mark_edge_feasible(scdf_ctx *scdf, int from, int to) { /* Block is already executable, only a new edge became feasible. * Reevaluate phi nodes to account for changed source operands. */ const zend_ssa_block *ssa_block = &scdf->ssa->blocks[to]; - zend_ssa_phi *phi; - for (phi = ssa_block->phis; phi; phi = phi->next) { + for (const zend_ssa_phi *phi = ssa_block->phis; phi; phi = phi->next) { zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var); scdf->handlers.visit_phi(scdf, phi); } @@ -109,7 +108,7 @@ void scdf_solve(scdf_ctx *scdf, const char *name) { ) { int i; while ((i = zend_bitset_pop_first(scdf->phi_var_worklist, scdf->phi_var_worklist_len)) >= 0) { - zend_ssa_phi *phi = ssa->vars[i].definition_phi; + const zend_ssa_phi *phi = ssa->vars[i].definition_phi; ZEND_ASSERT(phi); if (zend_bitset_in(scdf->executable_blocks, phi->block)) { scdf->handlers.visit_phi(scdf, phi); @@ -145,12 +144,9 @@ void scdf_solve(scdf_ctx *scdf, const char *name) { DEBUG_PRINT("Pop block %d from worklist\n", i); zend_bitset_incl(scdf->executable_blocks, i); - { - zend_ssa_phi *phi; - for (phi = ssa_block->phis; phi; phi = phi->next) { - zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var); - scdf->handlers.visit_phi(scdf, phi); - } + for (const zend_ssa_phi *phi = ssa_block->phis; phi; phi = phi->next) { + zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var); + scdf->handlers.visit_phi(scdf, phi); } if (block->len == 0) { diff --git a/Zend/Optimizer/scdf.h b/Zend/Optimizer/scdf.h index 67c53ef9fc185..49222880f22b8 100644 --- a/Zend/Optimizer/scdf.h +++ b/Zend/Optimizer/scdf.h @@ -39,7 +39,7 @@ typedef struct _scdf_ctx { void (*visit_instr)( struct _scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op); void (*visit_phi)( - struct _scdf_ctx *scdf, zend_ssa_phi *phi); + struct _scdf_ctx *scdf, const zend_ssa_phi *phi); void (*mark_feasible_successors)( struct _scdf_ctx *scdf, int block_num, zend_basic_block *block, zend_op *opline, zend_ssa_op *ssa_op); From dfdf992e37b337fd000977ab041adbbfac3869e2 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 13:16:18 +0100 Subject: [PATCH 140/386] ext/standard/user_filters.c: Remove useless casts --- ext/standard/user_filters.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 05eed4dab4ac3..5bc4d791bcf62 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -237,7 +237,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, len = strlen(filtername); /* determine the classname/class entry */ - if (NULL == (fdat = zend_hash_str_find_ptr(BG(user_filter_map), (char*)filtername, len))) { + if (NULL == (fdat = zend_hash_str_find_ptr(BG(user_filter_map), filtername, len))) { char *period; /* Userspace Filters using ambiguous wildcards could cause problems. @@ -285,7 +285,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0); /* filtername */ - add_property_string(&obj, "filtername", (char*)filtername); + add_property_string(&obj, "filtername", filtername); /* and the parameters, if any */ if (filterparams) { From 80e4278b590cf8ce1c4e835b213a047c8d9ffc6f Mon Sep 17 00:00:00 2001 From: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:19:03 +0200 Subject: [PATCH 141/386] Optimize performances of `str_pad()` (#19272) --- ext/standard/string.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 614e169de2a32..c96b79f349a3b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5756,6 +5756,27 @@ PHP_FUNCTION(substr_count) } /* }}} */ +static void php_str_pad_fill(zend_string *result, size_t pad_chars, const char *pad_str, size_t pad_str_len) { + char *p = ZSTR_VAL(result) + ZSTR_LEN(result); + + if (pad_str_len == 1) { + memset(p, pad_str[0], pad_chars); + ZSTR_LEN(result) += pad_chars; + return; + } + + const char *end = p + pad_chars; + while (p + pad_str_len <= end) { + p = zend_mempcpy(p, pad_str, pad_str_len); + } + + if (p < end) { + memcpy(p, pad_str, end - p); + } + + ZSTR_LEN(result) += pad_chars; +} + /* {{{ Returns input string padded on the left or right to specified length with pad_string */ PHP_FUNCTION(str_pad) { @@ -5768,7 +5789,7 @@ PHP_FUNCTION(str_pad) char *pad_str = " "; /* Pointer to padding string */ size_t pad_str_len = 1; zend_long pad_type_val = PHP_STR_PAD_RIGHT; /* The padding type value */ - size_t i, left_pad=0, right_pad=0; + size_t left_pad=0, right_pad=0; zend_string *result = NULL; /* Resulting string */ ZEND_PARSE_PARAMETERS_START(2, 4) @@ -5818,16 +5839,18 @@ PHP_FUNCTION(str_pad) } /* First we pad on the left. */ - for (i = 0; i < left_pad; i++) - ZSTR_VAL(result)[ZSTR_LEN(result)++] = pad_str[i % pad_str_len]; + if (left_pad > 0) { + php_str_pad_fill(result, left_pad, pad_str, pad_str_len); + } /* Then we copy the input string. */ memcpy(ZSTR_VAL(result) + ZSTR_LEN(result), ZSTR_VAL(input), ZSTR_LEN(input)); ZSTR_LEN(result) += ZSTR_LEN(input); /* Finally, we pad on the right. */ - for (i = 0; i < right_pad; i++) - ZSTR_VAL(result)[ZSTR_LEN(result)++] = pad_str[i % pad_str_len]; + if (right_pad > 0) { + php_str_pad_fill(result, right_pad, pad_str, pad_str_len); + } ZSTR_VAL(result)[ZSTR_LEN(result)] = '\0'; From 969e837d5b6d2511b69605c298c172e8a0a4f9d6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 3 Oct 2025 22:30:07 +0200 Subject: [PATCH 142/386] Fix compiler segfault during call compilation (#20054) Happens due to changes in 28fd7597bae where the opline opcode may be accessed after the opcode array has been reallocated. To solve this we store the opcode in a temporary variable. --- Zend/zend_compile.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 74b63951fa961..3f88ee10218d9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3956,19 +3956,21 @@ static bool zend_compile_call_common(znode *result, zend_ast *args_ast, zend_fun if (args_ast->kind == ZEND_AST_CALLABLE_CONVERT) { opline = &CG(active_op_array)->opcodes[opnum_init]; opline->extended_value = 0; + /* opcode array may be reallocated, so don't access opcode field after zend_emit_op_tmp(). */ + uint8_t opcode = opline->opcode; - if (opline->opcode == ZEND_NEW) { + if (opcode == ZEND_NEW) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot create Closure for new expression"); } - if (opline->opcode == ZEND_INIT_FCALL) { + if (opcode == ZEND_INIT_FCALL) { opline->op1.num = zend_vm_calc_used_stack(0, fbc); } zend_op *callable_convert_op = zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT, NULL, NULL); - if (opline->opcode == ZEND_INIT_FCALL - || opline->opcode == ZEND_INIT_FCALL_BY_NAME - || opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) { + if (opcode == ZEND_INIT_FCALL + || opcode == ZEND_INIT_FCALL_BY_NAME + || opcode == ZEND_INIT_NS_FCALL_BY_NAME) { callable_convert_op->extended_value = zend_alloc_cache_slot(); } else { callable_convert_op->extended_value = (uint32_t)-1; From f9c4fe4c5d337e92fd0a6df506385dc645b7394a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 3 Oct 2025 22:30:37 +0200 Subject: [PATCH 143/386] [ci skip] Fix indent --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3f88ee10218d9..3dc345ba3b6c6 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3960,7 +3960,7 @@ static bool zend_compile_call_common(znode *result, zend_ast *args_ast, zend_fun uint8_t opcode = opline->opcode; if (opcode == ZEND_NEW) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot create Closure for new expression"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot create Closure for new expression"); } if (opcode == ZEND_INIT_FCALL) { From 5c956f983848935c77971fc5744dcf1a4d38c761 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 3 Oct 2025 00:12:52 +0200 Subject: [PATCH 144/386] Avoid capturing nested arrow function parameters Fixes GH-19867 Closes GH-20041 --- Zend/zend_compile.c | 12 +++++++++++- ext/opcache/tests/gh19867.phpt | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/gh19867.phpt diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3dc345ba3b6c6..e45154157c287 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -8092,6 +8092,8 @@ typedef struct { bool varvars_used; } closure_info; +static void find_implicit_binds(closure_info *info, zend_ast *params_ast, zend_ast *stmt_ast); + static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { if (!ast) { return; @@ -8136,7 +8138,15 @@ static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { } else if (ast->kind == ZEND_AST_ARROW_FUNC) { /* For arrow functions recursively check the expression. */ zend_ast_decl *closure_ast = (zend_ast_decl *) ast; - find_implicit_binds_recursively(info, closure_ast->child[2]); + closure_info inner_info; + find_implicit_binds(&inner_info, closure_ast->child[0], closure_ast->child[2]); + if (inner_info.varvars_used) { + info->varvars_used = true; + } + if (zend_hash_num_elements(&inner_info.uses)) { + zend_hash_copy(&info->uses, &inner_info.uses, NULL); + } + zend_hash_destroy(&inner_info.uses); } else if (!zend_ast_is_special(ast)) { uint32_t i, children = zend_ast_get_num_children(ast); for (i = 0; i < children; i++) { diff --git a/ext/opcache/tests/gh19867.phpt b/ext/opcache/tests/gh19867.phpt new file mode 100644 index 0000000000000..486a366722dad --- /dev/null +++ b/ext/opcache/tests/gh19867.phpt @@ -0,0 +1,36 @@ +--TEST-- +GH-19867: Avoid capturing nested arrow function parameters +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.opt_debug_level=0x20000 +--FILE-- + fn($a, $b) => $a + $b; +?> +--EXPECTF-- +$_main: + ; (lines=%d, args=0, vars=%d, tmps=%d) + ; (after optimizer) + ; %s +0000 T0 = DECLARE_LAMBDA_FUNCTION 0 +0001 FREE T0 +0002 RETURN int(1) + +{closure:%s:%d}: + ; (lines=%d, args=0, vars=%d, tmps=%d) + ; (after optimizer) + ; %s +0000 T0 = DECLARE_LAMBDA_FUNCTION 0 +0001 RETURN T0 + +{closure:%s:%d}: + ; (lines=%d, args=2, vars=%d, tmps=%d) + ; (after optimizer) + ; %s +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 T2 = ADD CV0($a) CV1($b) +0003 RETURN T2 From 3c2a570a2225470e6135273786da14a3489178ca Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:38:28 +0200 Subject: [PATCH 145/386] Remove useless zval_ptr_dtor() in php_userstreamop_write() At this point, retval is either false or converted to a long. --- main/streams/userspace.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 888e4c90bbaf9..deae2ff5d2d3c 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -602,8 +602,6 @@ static ssize_t php_userstreamop_write(php_stream *stream, const char *buf, size_ didwrite = count; } - zval_ptr_dtor(&retval); - return didwrite; } From bcb56122b967b640077be62d3ebadd0f9fceead4 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:39:33 +0200 Subject: [PATCH 146/386] Remove useless zval_ptr_dtor() in user_filter_factory_create() At this point, retval is false. --- ext/standard/user_filters.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 5bc4d791bcf62..40ad6a5da37d2 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -301,9 +301,6 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, if (Z_TYPE(retval) != IS_UNDEF) { if (Z_TYPE(retval) == IS_FALSE) { - /* User reported filter creation error "return false;" */ - zval_ptr_dtor(&retval); - /* Kill the filter (safely) */ ZVAL_UNDEF(&filter->abstract); php_stream_filter_free(filter); From e99df6786956d36540be91ad2ef14aae549fb852 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 4 Oct 2025 12:58:29 +0200 Subject: [PATCH 147/386] Fix uouv in recursive implicit bind computation (#20056) Regressed in 5c956f98. Moved the initialization to prevent future regressions. Fixes last nightly. --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index e45154157c287..480002f682e40 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -8161,6 +8161,7 @@ static void find_implicit_binds(closure_info *info, zend_ast *params_ast, zend_a uint32_t i; zend_hash_init(&info->uses, param_list->children, NULL, NULL, 0); + info->varvars_used = false; find_implicit_binds_recursively(info, stmt_ast); @@ -8470,7 +8471,6 @@ static zend_op_array *zend_compile_func_decl_ex( zend_op_array *op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); zend_oparray_context orig_oparray_context; closure_info info; - memset(&info, 0, sizeof(closure_info)); init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE); From 337fbd65f8774fd8bc2318bec1b7fd1c5398d98f Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 12:40:41 +0100 Subject: [PATCH 148/386] Zend/Optimizer: change copy parameter type from int to bool in zend_optimizer_get_persistent_constant --- Zend/Optimizer/block_pass.c | 4 ++-- Zend/Optimizer/pass1.c | 6 +++--- Zend/Optimizer/zend_optimizer.c | 2 +- Zend/Optimizer/zend_optimizer_internal.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 9ca8b60f6c457..730ac67ef3422 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -30,7 +30,7 @@ #include "zend_dump.h" /* Checks if a constant (like "true") may be replaced by its value */ -bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy) +bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, bool copy) { zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); if (c) { @@ -371,7 +371,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array } } else if(flen == sizeof("constant")-1 && zend_binary_strcasecmp(fname, flen, "constant", sizeof("constant")-1) == 0) { zval c; - if (zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, 1 ELS_CC)) { + if (zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, true ELS_CC)) { literal_dtor(arg); MAKE_NOP(sv); MAKE_NOP(fcall); diff --git a/Zend/Optimizer/pass1.c b/Zend/Optimizer/pass1.c index 735910d52b4cd..09a0ae5fec531 100644 --- a/Zend/Optimizer/pass1.c +++ b/Zend/Optimizer/pass1.c @@ -149,7 +149,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) if (opline->op2_type == IS_CONST && Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) { /* substitute persistent constants */ - if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &result, 1)) { + if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &result, true)) { if (!ctx->constants || !zend_optimizer_get_collected_constant(ctx->constants, &ZEND_OP2_LITERAL(opline), &result)) { break; } @@ -171,7 +171,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) if (Z_TYPE_P(c) == IS_CONSTANT_AST) { zend_ast *ast = Z_ASTVAL_P(c); if (ast->kind != ZEND_AST_CONSTANT - || !zend_optimizer_get_persistent_constant(zend_ast_get_constant_name(ast), &result, 1) + || !zend_optimizer_get_persistent_constant(zend_ast_get_constant_name(ast), &result, true) || Z_TYPE(result) == IS_CONSTANT_AST) { break; } @@ -271,7 +271,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) } break; case ZEND_DEFINED: - if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &result, 0)) { + if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &result, false)) { break; } ZVAL_TRUE(&result); diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 6e6be67269329..b57ad3ad4268e 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -145,7 +145,7 @@ zend_result zend_optimizer_eval_special_func_call( return FAILURE; } if (zend_string_equals_literal(name, "constant")) { - return zend_optimizer_get_persistent_constant(arg, result, 1) ? SUCCESS : FAILURE; + return zend_optimizer_get_persistent_constant(arg, result, true) ? SUCCESS : FAILURE; } if (zend_string_equals_literal(name, "dirname")) { if (!IS_ABSOLUTE_PATH(ZSTR_VAL(arg), ZSTR_LEN(arg))) { diff --git a/Zend/Optimizer/zend_optimizer_internal.h b/Zend/Optimizer/zend_optimizer_internal.h index 8814a3846ea8c..869275811e3da 100644 --- a/Zend/Optimizer/zend_optimizer_internal.h +++ b/Zend/Optimizer/zend_optimizer_internal.h @@ -80,7 +80,7 @@ static inline bool zend_optimizer_is_loop_var_free(const zend_op *opline) { void zend_optimizer_convert_to_free_op1(const zend_op_array *op_array, zend_op *opline); uint32_t zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv); -bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy); +bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, bool copy); void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, const zval *name, zval* value); bool zend_optimizer_get_collected_constant(const HashTable *constants, const zval *name, zval* value); zend_result zend_optimizer_eval_binary_op(zval *result, uint8_t opcode, zval *op1, zval *op2); From 40b531937a441d080afcd9cc25f5472e8e079f9d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 12:49:46 +0100 Subject: [PATCH 149/386] Zend/Optimizer/block_pass.c: add const qualifiers --- Zend/Optimizer/block_pass.c | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 730ac67ef3422..191655dd9fcd3 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -32,7 +32,7 @@ /* Checks if a constant (like "true") may be replaced by its value */ bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, bool copy) { - zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); + const zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); if (c) { if ((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) && !(ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) @@ -62,9 +62,9 @@ bool zend_optimizer_get_persistent_constant(zend_string *name, zval *result, boo #define VAR_SOURCE(op) Tsource[VAR_NUM(op.var)] #define SET_VAR_SOURCE(opline) Tsource[VAR_NUM(opline->result.var)] = opline -static void strip_leading_nops(zend_op_array *op_array, zend_basic_block *b) +static void strip_leading_nops(const zend_op_array *op_array, zend_basic_block *b) { - zend_op *opcodes = op_array->opcodes; + const zend_op *opcodes = op_array->opcodes; do { b->start++; @@ -72,7 +72,7 @@ static void strip_leading_nops(zend_op_array *op_array, zend_basic_block *b) } while (b->len > 0 && opcodes[b->start].opcode == ZEND_NOP); } -static void strip_nops(zend_op_array *op_array, zend_basic_block *b) +static void strip_nops(const zend_op_array *op_array, zend_basic_block *b) { uint32_t i, j; @@ -106,7 +106,7 @@ static void strip_nops(zend_op_array *op_array, zend_basic_block *b) } } -static int get_const_switch_target(zend_cfg *cfg, zend_op_array *op_array, zend_basic_block *block, zend_op *opline, zval *val) { +static int get_const_switch_target(const zend_cfg *cfg, const zend_op_array *op_array, const zend_basic_block *block, zend_op *opline, const zval *val) { HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); zval *zv; if ((opline->opcode == ZEND_SWITCH_LONG && Z_TYPE_P(val) != IS_LONG) @@ -1009,10 +1009,10 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array } /* Rebuild plain (optimized) op_array from CFG */ -static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_optimizer_ctx *ctx) +static void assemble_code_blocks(const zend_cfg *cfg, zend_op_array *op_array, zend_optimizer_ctx *ctx) { zend_basic_block *blocks = cfg->blocks; - zend_basic_block *end = blocks + cfg->blocks_count; + const zend_basic_block *end = blocks + cfg->blocks_count; zend_basic_block *b; zend_op *new_opcodes; zend_op *opline; @@ -1025,7 +1025,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op if (b->flags & (ZEND_BB_REACHABLE|ZEND_BB_UNREACHABLE_FREE)) { opline = op_array->opcodes + b->start + b->len - 1; if (opline->opcode == ZEND_JMP) { - zend_basic_block *next = b + 1; + const zend_basic_block *next = b + 1; while (next < end && !(next->flags & ZEND_BB_REACHABLE)) { next++; @@ -1042,8 +1042,8 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op len += b->len; } else { /* this block will not be used, delete all constants there */ - zend_op *op = op_array->opcodes + b->start; - zend_op *end = op + b->len; + const zend_op *op = op_array->opcodes + b->start; + const zend_op *end = op + b->len; for (; op < end; op++) { if (op->op1_type == IS_CONST) { literal_dtor(&ZEND_OP1_LITERAL(op)); @@ -1109,7 +1109,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op case ZEND_SWITCH_STRING: case ZEND_MATCH: { - HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); + const HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); zval *zv; uint32_t s = 0; ZEND_ASSERT(b->successors_count == (opline->opcode == ZEND_MATCH ? 1 : 2) + zend_hash_num_elements(jumptable)); @@ -1161,7 +1161,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { zend_op *opline = new_opcodes; - zend_op *end = opline + len; + const zend_op *end = opline + len; while (opline < end) { if (opline->opcode == ZEND_FAST_RET && opline->op2.num != (uint32_t)-1 && @@ -1184,7 +1184,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op } } -static zend_always_inline zend_basic_block *get_target_block(const zend_cfg *cfg, zend_basic_block *block, int n, uint32_t *opt_count) +static zend_always_inline zend_basic_block *get_target_block(const zend_cfg *cfg, const zend_basic_block *block, int n, uint32_t *opt_count) { int b; zend_basic_block *target_block = cfg->blocks + block->successors[n]; @@ -1200,7 +1200,7 @@ static zend_always_inline zend_basic_block *get_target_block(const zend_cfg *cfg return target_block; } -static zend_always_inline zend_basic_block *get_follow_block(const zend_cfg *cfg, zend_basic_block *block, int n, uint32_t *opt_count) +static zend_always_inline zend_basic_block *get_follow_block(const zend_cfg *cfg, const zend_basic_block *block, int n, uint32_t *opt_count) { int b; zend_basic_block *target_block = cfg->blocks + block->successors[n]; @@ -1219,7 +1219,7 @@ static zend_always_inline zend_basic_block *get_follow_block(const zend_cfg *cfg static zend_always_inline zend_basic_block *get_next_block(const zend_cfg *cfg, zend_basic_block *block) { zend_basic_block *next_block = block + 1; - zend_basic_block *end = cfg->blocks + cfg->blocks_count; + const zend_basic_block *end = cfg->blocks + cfg->blocks_count; while (1) { if (next_block == end) { @@ -1237,7 +1237,7 @@ static zend_always_inline zend_basic_block *get_next_block(const zend_cfg *cfg, /* we use "jmp_hitlist" to avoid infinity loops during jmp optimization */ -static zend_always_inline bool in_hitlist(int target, int *jmp_hitlist, int jmp_hitlist_count) +static zend_always_inline bool in_hitlist(int target, const int *jmp_hitlist, int jmp_hitlist_count) { int i; @@ -1483,7 +1483,7 @@ static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_arr /* Find a set of variables which are used outside of the block where they are * defined. We won't apply some optimization patterns for such variables. */ -static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset used_ext, zend_optimizer_ctx *ctx) +static void zend_t_usage(const zend_cfg *cfg, const zend_op_array *op_array, zend_bitset used_ext, zend_optimizer_ctx *ctx) { int n; zend_basic_block *block, *next_block; @@ -1687,7 +1687,7 @@ static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset use zend_arena_release(&ctx->arena, checkpoint); } -static void zend_merge_blocks(zend_op_array *op_array, zend_cfg *cfg, uint32_t *opt_count) +static void zend_merge_blocks(const zend_op_array *op_array, const zend_cfg *cfg, uint32_t *opt_count) { int i; zend_basic_block *b, *bb; @@ -1707,7 +1707,7 @@ static void zend_merge_blocks(zend_op_array *op_array, zend_cfg *cfg, uint32_t * for (bb = prev + 1; bb != b; bb++) { zend_op *op = op_array->opcodes + bb->start; - zend_op *end = op + bb->len; + const zend_op *end = op + bb->len; while (op < end) { if (op->op1_type == IS_CONST) { literal_dtor(&ZEND_OP1_LITERAL(op)); From 67c6634b7b64de6d17702ce8390a0b82e5bf460d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 12:50:51 +0100 Subject: [PATCH 150/386] Zend/Optimizer/block_pass.c: change return type of get_const_switch_target --- Zend/Optimizer/block_pass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 191655dd9fcd3..10b803b719b11 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -106,7 +106,7 @@ static void strip_nops(const zend_op_array *op_array, zend_basic_block *b) } } -static int get_const_switch_target(const zend_cfg *cfg, const zend_op_array *op_array, const zend_basic_block *block, zend_op *opline, const zval *val) { +static uint32_t get_const_switch_target(const zend_cfg *cfg, const zend_op_array *op_array, const zend_basic_block *block, zend_op *opline, const zval *val) { HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline)); zval *zv; if ((opline->opcode == ZEND_SWITCH_LONG && Z_TYPE_P(val) != IS_LONG) @@ -409,7 +409,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array break; } if (opline->op1_type == IS_CONST) { - int target = get_const_switch_target(cfg, op_array, block, opline, &ZEND_OP1_LITERAL(opline)); + uint32_t target = get_const_switch_target(cfg, op_array, block, opline, &ZEND_OP1_LITERAL(opline)); literal_dtor(&ZEND_OP1_LITERAL(opline)); literal_dtor(&ZEND_OP2_LITERAL(opline)); opline->opcode = ZEND_JMP; From 152efe1706bbdab4472660d33ab3f474aed80222 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 12:53:49 +0100 Subject: [PATCH 151/386] Zend/Optimizer/block_pass.c: remove useless variable declaration and assignment src is already VAR_SOURCE(opline->op2) from before the if condition --- Zend/Optimizer/block_pass.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 10b803b719b11..df59347387e63 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -822,7 +822,6 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array src->extended_value == IS_STRING && src->op1_type != IS_CONST) { /* convert T1 = CAST(STRING, X), T2 = CONCAT(Y, T1) to T2 = CONCAT(Y,X) */ - zend_op *src = VAR_SOURCE(opline->op2); VAR_SOURCE(opline->op2) = NULL; COPY_NODE(opline->op2, src->op1); MAKE_NOP(src); From 6a43d07b623305574670ed97a916cd5179149ddd Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 12:57:36 +0100 Subject: [PATCH 152/386] Zend/Optimizer/block_pass.c: prevent variable shadowing --- Zend/Optimizer/block_pass.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index df59347387e63..b1fd8e44222e5 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -1042,8 +1042,8 @@ static void assemble_code_blocks(const zend_cfg *cfg, zend_op_array *op_array, z } else { /* this block will not be used, delete all constants there */ const zend_op *op = op_array->opcodes + b->start; - const zend_op *end = op + b->len; - for (; op < end; op++) { + const zend_op *last_op = op + b->len; + for (; op < last_op; op++) { if (op->op1_type == IS_CONST) { literal_dtor(&ZEND_OP1_LITERAL(op)); } @@ -1159,15 +1159,15 @@ static void assemble_code_blocks(const zend_cfg *cfg, zend_op_array *op_array, z } if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { - zend_op *opline = new_opcodes; - const zend_op *end = opline + len; - while (opline < end) { - if (opline->opcode == ZEND_FAST_RET && - opline->op2.num != (uint32_t)-1 && - opline->op2.num < j) { - opline->op2.num = map[opline->op2.num]; + zend_op *finally_opline = new_opcodes; + const zend_op *last_finally_op = finally_opline + len; + while (finally_opline < last_finally_op) { + if (finally_opline->opcode == ZEND_FAST_RET && + finally_opline->op2.num != (uint32_t)-1 && + finally_opline->op2.num < j) { + finally_opline->op2.num = map[finally_opline->op2.num]; } - opline++; + finally_opline++; } } } From 24162247cc89f04c3e640f02dbf7181511802beb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:19:37 +0100 Subject: [PATCH 153/386] Zend/Optimizer/dce.c: add const qualifiers --- Zend/Optimizer/dce.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Zend/Optimizer/dce.c b/Zend/Optimizer/dce.c index 8299a72fb7bd0..7993778a1257d 100644 --- a/Zend/Optimizer/dce.c +++ b/Zend/Optimizer/dce.c @@ -72,7 +72,7 @@ static inline bool is_bad_mod(const zend_ssa *ssa, int use, int def) { } static inline bool may_have_side_effects( - zend_op_array *op_array, zend_ssa *ssa, + const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op, bool reorder_dtor_effects) { switch (opline->opcode) { @@ -271,8 +271,8 @@ static inline bool may_have_side_effects( } } -static zend_always_inline void add_to_worklists(context *ctx, int var_num, int check) { - zend_ssa_var *var = &ctx->ssa->vars[var_num]; +static zend_always_inline void add_to_worklists(const context *ctx, int var_num, int check) { + const zend_ssa_var *var = &ctx->ssa->vars[var_num]; if (var->definition >= 0) { if (!check || zend_bitset_in(ctx->instr_dead, var->definition)) { zend_bitset_incl(ctx->instr_worklist, var->definition); @@ -284,14 +284,14 @@ static zend_always_inline void add_to_worklists(context *ctx, int var_num, int c } } -static inline void add_to_phi_worklist_no_val(context *ctx, int var_num) { - zend_ssa_var *var = &ctx->ssa->vars[var_num]; +static inline void add_to_phi_worklist_no_val(const context *ctx, int var_num) { + const zend_ssa_var *var = &ctx->ssa->vars[var_num]; if (var->definition_phi && zend_bitset_in(ctx->phi_dead, var_num)) { zend_bitset_incl(ctx->phi_worklist_no_val, var_num); } } -static zend_always_inline void add_operands_to_worklists(context *ctx, zend_op *opline, zend_ssa_op *ssa_op, zend_ssa *ssa, int check) { +static zend_always_inline void add_operands_to_worklists(const context *ctx, const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, int check) { if (ssa_op->result_use >= 0) { add_to_worklists(ctx, ssa_op->result_use, check); } @@ -315,16 +315,16 @@ static zend_always_inline void add_operands_to_worklists(context *ctx, zend_op * } } -static zend_always_inline void add_phi_sources_to_worklists(context *ctx, zend_ssa_phi *phi, int check) { - zend_ssa *ssa = ctx->ssa; +static zend_always_inline void add_phi_sources_to_worklists(const context *ctx, zend_ssa_phi *phi, int check) { + const zend_ssa *ssa = ctx->ssa; int source; FOREACH_PHI_SOURCE(phi, source) { add_to_worklists(ctx, source, check); } FOREACH_PHI_SOURCE_END(); } -static inline bool is_var_dead(context *ctx, int var_num) { - zend_ssa_var *var = &ctx->ssa->vars[var_num]; +static inline bool is_var_dead(const context *ctx, int var_num) { + const zend_ssa_var *var = &ctx->ssa->vars[var_num]; if (var->definition_phi) { return zend_bitset_in(ctx->phi_dead, var_num); } else if (var->definition >= 0) { @@ -338,7 +338,7 @@ static inline bool is_var_dead(context *ctx, int var_num) { } // Sometimes we can mark the var as EXT_UNUSED -static bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_op *opline) { +static bool try_remove_var_def(const context *ctx, int free_var, int use_chain, const zend_op *opline) { if (use_chain >= 0) { return false; } @@ -394,7 +394,7 @@ static zend_always_inline bool may_be_refcounted(uint32_t type) { return (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) != 0; } -static inline bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { +static inline bool is_free_of_live_var(const context *ctx, const zend_op *opline, const zend_ssa_op *ssa_op) { switch (opline->opcode) { case ZEND_FREE: /* It is always safe to remove FREEs of non-refcounted values, even if they are live. */ @@ -411,8 +411,8 @@ static inline bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_o } /* Returns whether the instruction has been DCEd */ -static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { - zend_ssa *ssa = ctx->ssa; +static bool dce_instr(const context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { + const zend_ssa *ssa = ctx->ssa; int free_var = -1; uint8_t free_var_type; @@ -464,7 +464,7 @@ static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) { return true; } -static inline int get_common_phi_source(zend_ssa *ssa, zend_ssa_phi *phi) { +static inline int get_common_phi_source(const zend_ssa *ssa, zend_ssa_phi *phi) { int common_source = -1; int source; FOREACH_PHI_SOURCE(phi, source) { @@ -484,7 +484,7 @@ static inline int get_common_phi_source(zend_ssa *ssa, zend_ssa_phi *phi) { return common_source; } -static void try_remove_trivial_phi(context *ctx, zend_ssa_phi *phi) { +static void try_remove_trivial_phi(const context *ctx, zend_ssa_phi *phi) { zend_ssa *ssa = ctx->ssa; if (phi->pi < 0) { /* Phi assignment with identical source operands */ @@ -567,7 +567,7 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *optimizer int op_data = -1; b--; - zend_basic_block *block = &ssa->cfg.blocks[b]; + const zend_basic_block *block = &ssa->cfg.blocks[b]; if (!(block->flags & ZEND_BB_REACHABLE)) { continue; } From ba3ada9cca3aadaf1ce07bf729df9a0addbb9750 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:19:50 +0100 Subject: [PATCH 154/386] Zend/Optimizer/zend_ssa: add const qualifiers --- Zend/Optimizer/zend_ssa.c | 42 +++++++++++++++++++-------------------- Zend/Optimizer/zend_ssa.h | 12 +++++------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index ed39862c437c9..99978da9d7e80 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -91,7 +91,7 @@ static bool needs_pi(const zend_op_array *op_array, const zend_dfg *dfg, const z /* }}} */ static zend_ssa_phi *add_pi( - zend_arena **arena, const zend_op_array *op_array, zend_dfg *dfg, zend_ssa *ssa, + zend_arena **arena, const zend_op_array *op_array, const zend_dfg *dfg, const zend_ssa *ssa, int from, int to, int var) /* {{{ */ { zend_ssa_phi *phi; @@ -241,8 +241,8 @@ static int find_adjusted_tmp_var(const zend_op_array *op_array, uint32_t build_f */ static void place_essa_pis( zend_arena **arena, const zend_script *script, const zend_op_array *op_array, - uint32_t build_flags, zend_ssa *ssa, zend_dfg *dfg) /* {{{ */ { - zend_basic_block *blocks = ssa->cfg.blocks; + uint32_t build_flags, const zend_ssa *ssa, const zend_dfg *dfg) /* {{{ */ { + const zend_basic_block *blocks = ssa->cfg.blocks; int j, blocks_count = ssa->cfg.blocks_count; for (j = 0; j < blocks_count; j++) { zend_ssa_phi *pi; @@ -819,12 +819,12 @@ ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *op static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */ { - zend_basic_block *blocks = ssa->cfg.blocks; - zend_ssa_block *ssa_blocks = ssa->blocks; + const zend_basic_block *blocks = ssa->cfg.blocks; + const zend_ssa_block *ssa_blocks = ssa->blocks; zend_ssa_op *ssa_ops = ssa->ops; int ssa_vars_count = ssa->vars_count; int i, j; - zend_op *opline, *end; + const zend_op *opline, *end; if (ssa_blocks[n].phis) { zend_ssa_phi *phi = ssa_blocks[n].phis; @@ -849,7 +849,7 @@ static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t bui } } - zend_ssa_op *fe_fetch_ssa_op = blocks[n].len != 0 + const zend_ssa_op *fe_fetch_ssa_op = blocks[n].len != 0 && ((end-1)->opcode == ZEND_FE_FETCH_R || (end-1)->opcode == ZEND_FE_FETCH_RW) && (end-1)->op2_type == IS_CV ? &ssa_ops[blocks[n].start + blocks[n].len - 1] : NULL; @@ -995,7 +995,7 @@ backtrack:; ZEND_API zend_result zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa) /* {{{ */ { - zend_basic_block *blocks = ssa->cfg.blocks; + const zend_basic_block *blocks = ssa->cfg.blocks; zend_ssa_block *ssa_blocks; int blocks_count = ssa->cfg.blocks_count; uint32_t set_size; @@ -1259,7 +1259,7 @@ ZEND_API void zend_ssa_compute_use_def_chains(zend_arena **arena, const zend_op_ } /* }}} */ -void zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var) /* {{{ */ +void zend_ssa_unlink_use_chain(const zend_ssa *ssa, int op, int var) /* {{{ */ { if (ssa->vars[var].use_chain == op) { ssa->vars[var].use_chain = zend_ssa_next_use(ssa->ops, var, op); @@ -1298,7 +1298,7 @@ void zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var) /* {{{ */ } /* }}} */ -void zend_ssa_replace_use_chain(zend_ssa *ssa, int op, int new_op, int var) /* {{{ */ +void zend_ssa_replace_use_chain(const zend_ssa *ssa, int op, int new_op, int var) /* {{{ */ { if (ssa->vars[var].use_chain == op) { ssa->vars[var].use_chain = new_op; @@ -1338,7 +1338,7 @@ void zend_ssa_replace_use_chain(zend_ssa *ssa, int op, int new_op, int var) /* { } /* }}} */ -void zend_ssa_remove_instr(zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op) /* {{{ */ +void zend_ssa_remove_instr(const zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op) /* {{{ */ { if (ssa_op->result_use >= 0) { zend_ssa_unlink_use_chain(ssa, ssa_op - ssa->ops, ssa_op->result_use); @@ -1369,7 +1369,7 @@ void zend_ssa_remove_instr(zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op) } /* }}} */ -static inline zend_ssa_phi **zend_ssa_next_use_phi_ptr(zend_ssa *ssa, int var, zend_ssa_phi *p) /* {{{ */ +static inline zend_ssa_phi **zend_ssa_next_use_phi_ptr(const zend_ssa *ssa, int var, zend_ssa_phi *p) /* {{{ */ { if (p->pi >= 0) { return &p->use_chains[0]; @@ -1388,7 +1388,7 @@ static inline zend_ssa_phi **zend_ssa_next_use_phi_ptr(zend_ssa *ssa, int var, z /* May be called even if source is not used in the phi (useful when removing uses in a phi * with multiple identical operands) */ -static inline void zend_ssa_remove_use_of_phi_source(zend_ssa *ssa, zend_ssa_phi *phi, int source, zend_ssa_phi *next_use_phi) /* {{{ */ +static inline void zend_ssa_remove_use_of_phi_source(const zend_ssa *ssa, const zend_ssa_phi *phi, int source, zend_ssa_phi *next_use_phi) /* {{{ */ { zend_ssa_phi **cur = &ssa->vars[source].phi_use_chain; while (*cur && *cur != phi) { @@ -1400,7 +1400,7 @@ static inline void zend_ssa_remove_use_of_phi_source(zend_ssa *ssa, zend_ssa_phi } /* }}} */ -static void zend_ssa_remove_uses_of_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ +static void zend_ssa_remove_uses_of_phi_sources(const zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ { int source; FOREACH_PHI_SOURCE(phi, source) { @@ -1409,7 +1409,7 @@ static void zend_ssa_remove_uses_of_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi } /* }}} */ -static void zend_ssa_remove_phi_from_block(zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ +static void zend_ssa_remove_phi_from_block(const zend_ssa *ssa, const zend_ssa_phi *phi) /* {{{ */ { zend_ssa_block *block = &ssa->blocks[phi->block]; zend_ssa_phi **cur = &block->phis; @@ -1438,7 +1438,7 @@ void zend_ssa_remove_defs_of_instr(zend_ssa *ssa, zend_ssa_op *ssa_op) /* {{{ */ } /* }}} */ -static inline void zend_ssa_remove_phi_source(zend_ssa *ssa, zend_ssa_phi *phi, int pred_offset, int predecessors_count) /* {{{ */ +static inline void zend_ssa_remove_phi_source(const zend_ssa *ssa, const zend_ssa_phi *phi, int pred_offset, int predecessors_count) /* {{{ */ { int j, var_num = phi->sources[pred_offset]; zend_ssa_phi *next_phi = phi->use_chains[pred_offset]; @@ -1467,7 +1467,7 @@ static inline void zend_ssa_remove_phi_source(zend_ssa *ssa, zend_ssa_phi *phi, } /* }}} */ -void zend_ssa_remove_phi(zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ +void zend_ssa_remove_phi(const zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ { ZEND_ASSERT(phi->ssa_var >= 0); ZEND_ASSERT(ssa->vars[phi->ssa_var].use_chain < 0 @@ -1479,7 +1479,7 @@ void zend_ssa_remove_phi(zend_ssa *ssa, zend_ssa_phi *phi) /* {{{ */ } /* }}} */ -void zend_ssa_remove_uses_of_var(zend_ssa *ssa, int var_num) /* {{{ */ +void zend_ssa_remove_uses_of_var(const zend_ssa *ssa, int var_num) /* {{{ */ { zend_ssa_var *var = &ssa->vars[var_num]; zend_ssa_phi *phi; @@ -1515,7 +1515,7 @@ void zend_ssa_remove_uses_of_var(zend_ssa *ssa, int var_num) /* {{{ */ void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to) /* {{{ */ { zend_basic_block *next_block = &ssa->cfg.blocks[to]; - zend_ssa_block *next_ssa_block = &ssa->blocks[to]; + const zend_ssa_block *next_ssa_block = &ssa->blocks[to]; zend_ssa_phi *phi; int j; @@ -1558,10 +1558,10 @@ void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to) /* {{{ */ } /* }}} */ -void zend_ssa_remove_block(zend_op_array *op_array, zend_ssa *ssa, int i) /* {{{ */ +void zend_ssa_remove_block(const zend_op_array *op_array, zend_ssa *ssa, int i) /* {{{ */ { zend_basic_block *block = &ssa->cfg.blocks[i]; - zend_ssa_block *ssa_block = &ssa->blocks[i]; + const zend_ssa_block *ssa_block = &ssa->blocks[i]; zend_ssa_phi *phi; int j; diff --git a/Zend/Optimizer/zend_ssa.h b/Zend/Optimizer/zend_ssa.h index 0f6d5a5685112..0696d2bba8671 100644 --- a/Zend/Optimizer/zend_ssa.h +++ b/Zend/Optimizer/zend_ssa.h @@ -147,15 +147,15 @@ BEGIN_EXTERN_C() ZEND_API zend_result zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa); ZEND_API void zend_ssa_compute_use_def_chains(zend_arena **arena, const zend_op_array *op_array, zend_ssa *ssa); ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *opline, uint32_t k, uint32_t build_flags, int ssa_vars_count, zend_ssa_op *ssa_ops, int *var); -void zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var); -void zend_ssa_replace_use_chain(zend_ssa *ssa, int op, int new_op, int var); +void zend_ssa_unlink_use_chain(const zend_ssa *ssa, int op, int var); +void zend_ssa_replace_use_chain(const zend_ssa *ssa, int op, int new_op, int var); void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to); void zend_ssa_remove_defs_of_instr(zend_ssa *ssa, zend_ssa_op *ssa_op); -void zend_ssa_remove_instr(zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op); -void zend_ssa_remove_phi(zend_ssa *ssa, zend_ssa_phi *phi); -void zend_ssa_remove_uses_of_var(zend_ssa *ssa, int var_num); -void zend_ssa_remove_block(zend_op_array *op_array, zend_ssa *ssa, int b); +void zend_ssa_remove_instr(const zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op); +void zend_ssa_remove_phi(const zend_ssa *ssa, zend_ssa_phi *phi); +void zend_ssa_remove_uses_of_var(const zend_ssa *ssa, int var_num); +void zend_ssa_remove_block(const zend_op_array *op_array, zend_ssa *ssa, int b); void zend_ssa_rename_var_uses(zend_ssa *ssa, int old_var, int new_var, bool update_types); void zend_ssa_remove_block_from_cfg(zend_ssa *ssa, int b); From 3b87caf013ec72ff74191a44a7077af5c746cb38 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:23:21 +0100 Subject: [PATCH 155/386] Zend/Optimizer/zend_dfg: add const qualifiers --- Zend/Optimizer/zend_dfg.c | 6 +++--- Zend/Optimizer/zend_dfg.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/Optimizer/zend_dfg.c b/Zend/Optimizer/zend_dfg.c index 101523141be94..d577c4c824fd4 100644 --- a/Zend/Optimizer/zend_dfg.c +++ b/Zend/Optimizer/zend_dfg.c @@ -249,7 +249,7 @@ ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_ } /* }}} */ -void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg *dfg, uint32_t build_flags) /* {{{ */ +void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const zend_dfg *dfg, uint32_t build_flags) /* {{{ */ { int set_size; zend_basic_block *blocks = cfg->blocks; @@ -267,7 +267,7 @@ void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg /* Collect "def" and "use" sets */ for (j = 0; j < blocks_count; j++) { - zend_op *opline, *end; + const zend_op *opline, *end; zend_bitset b_use, b_def; if ((blocks[j].flags & ZEND_BB_REACHABLE) == 0) { @@ -318,7 +318,7 @@ void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg /* Add predecessors of changed block to worklist */ { - int *predecessors = &cfg->predecessors[blocks[j].predecessor_offset]; + const int *predecessors = &cfg->predecessors[blocks[j].predecessor_offset]; for (k = 0; k < blocks[j].predecessors_count; k++) { zend_bitset_incl(worklist, predecessors[k]); } diff --git a/Zend/Optimizer/zend_dfg.h b/Zend/Optimizer/zend_dfg.h index b59dc62790901..af3d761ba29f8 100644 --- a/Zend/Optimizer/zend_dfg.h +++ b/Zend/Optimizer/zend_dfg.h @@ -43,7 +43,7 @@ typedef struct _zend_dfg { BEGIN_EXTERN_C() -void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg *dfg, uint32_t build_flags); +void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const zend_dfg *dfg, uint32_t build_flags); ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def); END_EXTERN_C() From 165e89f5f5749b06d8a920fd1adce746d07ad46d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:25:23 +0100 Subject: [PATCH 156/386] Zend/Optimizer/zend_dfg: use uint32_t type instead of int --- Zend/Optimizer/zend_dfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zend/Optimizer/zend_dfg.c b/Zend/Optimizer/zend_dfg.c index d577c4c824fd4..26993dea0d88a 100644 --- a/Zend/Optimizer/zend_dfg.c +++ b/Zend/Optimizer/zend_dfg.c @@ -251,14 +251,13 @@ ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_ void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const zend_dfg *dfg, uint32_t build_flags) /* {{{ */ { - int set_size; + uint32_t set_size = dfg->size; zend_basic_block *blocks = cfg->blocks; int blocks_count = cfg->blocks_count; zend_bitset tmp, def, use, in, out; int k; int j; - set_size = dfg->size; tmp = dfg->tmp; def = dfg->def; use = dfg->use; From 1b90c2c855b34f02041e8ce81643da2638c5f62c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:26:23 +0100 Subject: [PATCH 157/386] Zend/Optimizer/zend_dfg.c: rename function This is because symbols with leading _ are reserved by the C standard --- Zend/Optimizer/zend_dfg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/zend_dfg.c b/Zend/Optimizer/zend_dfg.c index 26993dea0d88a..c14d67e873a24 100644 --- a/Zend/Optimizer/zend_dfg.c +++ b/Zend/Optimizer/zend_dfg.c @@ -19,7 +19,7 @@ #include "zend_compile.h" #include "zend_dfg.h" -static zend_always_inline void _zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def) /* {{{ */ +static zend_always_inline void zend_dfg_add_use_def_op_impl(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def) /* {{{ */ { uint32_t var_num; const zend_op *next; @@ -245,7 +245,7 @@ static zend_always_inline void _zend_dfg_add_use_def_op(const zend_op_array *op_ ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def) /* {{{ */ { - _zend_dfg_add_use_def_op(op_array, opline, build_flags, use, def); + zend_dfg_add_use_def_op_impl(op_array, opline, build_flags, use, def); } /* }}} */ @@ -279,7 +279,7 @@ void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const ze b_def = DFG_BITSET(def, set_size, j); for (; opline < end; opline++) { if (opline->opcode != ZEND_OP_DATA) { - _zend_dfg_add_use_def_op(op_array, opline, build_flags, b_use, b_def); + zend_dfg_add_use_def_op_impl(op_array, opline, build_flags, b_use, b_def); } } } From 22b5569a9ea100bef8679eac71b1187854749e11 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 13:39:13 +0100 Subject: [PATCH 158/386] Zend/Optimizer/zend_inference: add const qualifiers --- Zend/Optimizer/zend_inference.c | 77 ++++++++++++++++----------------- Zend/Optimizer/zend_inference.h | 4 +- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index d203cd4b47223..107bfdc61845c 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -266,7 +266,7 @@ typedef struct _zend_scc_iterator { }; } zend_scc_iterator; -static int zend_scc_next(const zend_op_array *op_array, zend_ssa *ssa, int var, zend_scc_iterator *iterator) /* {{{ */ +static int zend_scc_next(const zend_op_array *op_array, const zend_ssa *ssa, int var, zend_scc_iterator *iterator) /* {{{ */ { zend_ssa_phi *phi; int use, var2; @@ -487,14 +487,14 @@ ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa) / #endif -ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ +ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, const zend_ssa *ssa) /* {{{ */ { zend_ssa_var *ssa_vars = ssa->vars; - zend_ssa_op *ssa_ops = ssa->ops; + const zend_ssa_op *ssa_ops = ssa->ops; int ssa_vars_count = ssa->vars_count; zend_bitset worklist; int i, j, use; - zend_ssa_phi *p; + const zend_ssa_phi *p; ALLOCA_FLAG(use_heap); if (!op_array->function_name || !ssa->vars || !ssa->ops) { @@ -1597,7 +1597,7 @@ ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, cons return 0; } -static void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, bool underflow, zend_long min, zend_long max, bool overflow) +static void zend_inference_init_range(const zend_op_array *op_array, const zend_ssa *ssa, int var, bool underflow, zend_long min, zend_long max, bool overflow) { if (underflow) { min = ZEND_LONG_MIN; @@ -1645,7 +1645,7 @@ static bool zend_inference_widening_meet(zend_ssa_var_info *var_info, zend_ssa_r return 1; } -static bool zend_ssa_range_widening(const zend_op_array *op_array, zend_ssa *ssa, int var, int scc) +static bool zend_ssa_range_widening(const zend_op_array *op_array, const zend_ssa *ssa, int var, int scc) { zend_ssa_range tmp; @@ -1690,7 +1690,7 @@ static bool zend_inference_narrowing_meet(zend_ssa_var_info *var_info, zend_ssa_ return 1; } -static bool zend_ssa_range_narrowing(const zend_op_array *op_array, zend_ssa *ssa, int var, int scc) +static bool zend_ssa_range_narrowing(const zend_op_array *op_array, const zend_ssa *ssa, int var, int scc) { zend_ssa_range tmp; @@ -2029,10 +2029,10 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) { } \ } while (0) -static void add_usages(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset worklist, int var) +static void add_usages(const zend_op_array *op_array, const zend_ssa *ssa, zend_bitset worklist, int var) { if (ssa->vars[var].phi_use_chain) { - zend_ssa_phi *p = ssa->vars[var].phi_use_chain; + const zend_ssa_phi *p = ssa->vars[var].phi_use_chain; do { zend_bitset_incl(worklist, p->ssa_var); p = zend_ssa_next_use_phi(ssa, var, p); @@ -2040,7 +2040,7 @@ static void add_usages(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset } if (ssa->vars[var].use_chain >= 0) { int use = ssa->vars[var].use_chain; - zend_ssa_op *op; + const zend_ssa_op *op; do { op = ssa->ops + use; @@ -2082,7 +2082,7 @@ static void add_usages(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset } } -static void emit_type_narrowing_warning(const zend_op_array *op_array, zend_ssa *ssa, int var) +static void emit_type_narrowing_warning(const zend_op_array *op_array, const zend_ssa *ssa, int var) { int def_op_num = ssa->vars[var].definition; const zend_op *def_opline = def_op_num >= 0 ? &op_array->opcodes[def_op_num] : NULL; @@ -2258,7 +2258,7 @@ static uint32_t assign_dim_result_type( /* For binary ops that have compound assignment operators */ static uint32_t binary_op_result_type( - zend_ssa *ssa, uint8_t opcode, uint32_t t1, uint32_t t2, int result_var, + const zend_ssa *ssa, uint8_t opcode, uint32_t t1, uint32_t t2, int result_var, zend_long optimization_level) { uint32_t tmp = 0; uint32_t t1_type = (t1 & MAY_BE_ANY) | (t1 & MAY_BE_UNDEF ? MAY_BE_NULL : 0); @@ -2435,7 +2435,7 @@ static const zend_property_info *lookup_prop_info(const zend_class_entry *ce, ze return NULL; } -static const zend_property_info *zend_fetch_prop_info(const zend_op_array *op_array, zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) +static const zend_property_info *zend_fetch_prop_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) { const zend_property_info *prop_info = NULL; if (opline->op2_type == IS_CONST) { @@ -2462,7 +2462,7 @@ static const zend_property_info *zend_fetch_static_prop_info(const zend_script * { const zend_property_info *prop_info = NULL; if (opline->op1_type == IS_CONST) { - zend_class_entry *ce = NULL; + const zend_class_entry *ce = NULL; if (opline->op2_type == IS_UNUSED) { uint32_t fetch_type = opline->op2.num & ZEND_FETCH_CLASS_MASK; switch (fetch_type) { @@ -2479,12 +2479,12 @@ static const zend_property_info *zend_fetch_static_prop_info(const zend_script * break; } } else if (opline->op2_type == IS_CONST) { - zval *zv = CRT_CONSTANT(opline->op2); + const zval *zv = CRT_CONSTANT(opline->op2); ce = zend_optimizer_get_class_entry(script, op_array, Z_STR_P(zv + 1)); } if (ce) { - zval *zv = CRT_CONSTANT(opline->op1); + const zval *zv = CRT_CONSTANT(opline->op1); prop_info = lookup_prop_info(ce, Z_STR_P(zv), op_array->scope); if (prop_info && !(prop_info->flags & ZEND_ACC_STATIC)) { prop_info = NULL; @@ -2506,13 +2506,13 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, const zend_prope return zend_convert_type(script, prop_info->type, pce); } -static bool result_may_be_separated(zend_ssa *ssa, zend_ssa_op *ssa_op) +static bool result_may_be_separated(const zend_ssa *ssa, const zend_ssa_op *ssa_op) { int tmp_var = ssa_op->result_def; if (ssa->vars[tmp_var].use_chain >= 0 && !ssa->vars[tmp_var].phi_use_chain) { - zend_ssa_op *use_op = &ssa->ops[ssa->vars[tmp_var].use_chain]; + const zend_ssa_op *use_op = &ssa->ops[ssa->vars[tmp_var].use_chain]; /* TODO: analyze instructions between ssa_op and use_op */ if (use_op == ssa_op + 1) { @@ -3028,7 +3028,7 @@ static zend_always_inline zend_result _zend_update_type_info( break; case ZEND_ASSIGN_OBJ: if (opline->op1_type == IS_CV) { - zend_class_entry *ce = ssa_var_info[ssa_op->op1_use].ce; + const zend_class_entry *ce = ssa_var_info[ssa_op->op1_use].ce; bool add_rc = (t1 & (MAY_BE_OBJECT|MAY_BE_REF)) && (!ce || ce->__set /* Non-default write_property may be set within create_object. */ @@ -4120,7 +4120,7 @@ ZEND_API zend_result zend_update_type_info( const zend_op_array *op_array, zend_ssa *ssa, const zend_script *script, - zend_op *opline, + const zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes, zend_long optimization_level) @@ -4129,7 +4129,7 @@ ZEND_API zend_result zend_update_type_info( false); } -static uint32_t get_class_entry_rank(zend_class_entry *ce) { +static uint32_t get_class_entry_rank(const zend_class_entry *ce) { uint32_t rank = 0; if (ce->ce_flags & ZEND_ACC_LINKED) { while (ce->parent) { @@ -4175,7 +4175,7 @@ static zend_class_entry *join_class_entries( return ce1; } -static bool safe_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) { +static bool safe_instanceof(const zend_class_entry *ce1, const zend_class_entry *ce2) { if (ce1 == ce2) { return 1; } @@ -4188,7 +4188,7 @@ static bool safe_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) { static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_bitset worklist, zend_long optimization_level) { - zend_basic_block *blocks = ssa->cfg.blocks; + const zend_basic_block *blocks = ssa->cfg.blocks; zend_ssa_var *ssa_vars = ssa->vars; zend_ssa_var_info *ssa_var_info = ssa->var_info; int ssa_vars_count = ssa->vars_count; @@ -4208,7 +4208,7 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend tmp = get_ssa_var_info(ssa, p->sources[0]); if (!p->has_range_constraint) { - zend_ssa_type_constraint *constraint = &p->constraint.type; + const zend_ssa_type_constraint *constraint = &p->constraint.type; tmp &= constraint->type_mask; if (!(tmp & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) { tmp &= ~(MAY_BE_RC1|MAY_BE_RCN); @@ -4270,18 +4270,18 @@ static zend_result zend_infer_types_ex(const zend_op_array *op_array, const zend return SUCCESS; } -static bool is_narrowable_instr(zend_op *opline) { +static bool is_narrowable_instr(const zend_op *opline) { return opline->opcode == ZEND_ADD || opline->opcode == ZEND_SUB || opline->opcode == ZEND_MUL || opline->opcode == ZEND_DIV; } -static bool is_effective_op1_double_cast(zend_op *opline, zval *op2) { +static bool is_effective_op1_double_cast(const zend_op *opline, const zval *op2) { return (opline->opcode == ZEND_ADD && Z_LVAL_P(op2) == 0) || (opline->opcode == ZEND_SUB && Z_LVAL_P(op2) == 0) || (opline->opcode == ZEND_MUL && Z_LVAL_P(op2) == 1) || (opline->opcode == ZEND_DIV && Z_LVAL_P(op2) == 1); } -static bool is_effective_op2_double_cast(zend_op *opline, zval *op1) { +static bool is_effective_op2_double_cast(const zend_op *opline, const zval *op1) { /* In PHP it holds that (double)(0-$int) is bitwise identical to 0.0-(double)$int, * so allowing SUB here is fine. */ return (opline->opcode == ZEND_ADD && Z_LVAL_P(op1) == 0) @@ -4493,19 +4493,18 @@ static zend_result zend_type_narrowing(const zend_op_array *op_array, const zend return SUCCESS; } -static bool is_recursive_tail_call(const zend_op_array *op_array, - zend_op *opline) +static bool is_recursive_tail_call(const zend_op_array *op_array, const zend_op *opline) { - zend_func_info *info = ZEND_FUNC_INFO(op_array); + const zend_func_info *info = ZEND_FUNC_INFO(op_array); if (info->ssa.ops && info->ssa.vars && info->call_map && info->ssa.ops[opline - op_array->opcodes].op1_use >= 0 && info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition >= 0) { - zend_op *op = op_array->opcodes + info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition; + const zend_op *op = op_array->opcodes + info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition; if (op->opcode == ZEND_DO_UCALL) { - zend_call_info *call_info = info->call_map[op - op_array->opcodes]; + const zend_call_info *call_info = info->call_map[op - op_array->opcodes]; if (call_info && op_array == &call_info->callee_func->op_array) { return 1; } @@ -4521,7 +4520,7 @@ uint32_t zend_get_return_info_from_signature_only( if (func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && (use_tentative_return_info || !ZEND_ARG_TYPE_IS_TENTATIVE(func->common.arg_info - 1)) ) { - zend_arg_info *ret_info = func->common.arg_info - 1; + const zend_arg_info *ret_info = func->common.arg_info - 1; type = zend_fetch_arg_info_type(script, ret_info, ce); *ce_is_instanceof = ce != NULL; } else { @@ -4561,10 +4560,10 @@ static void zend_func_return_info(const zend_op_array *op_array, bool widening, zend_ssa_var_info *ret) { - zend_func_info *info = ZEND_FUNC_INFO(op_array); - zend_ssa *ssa = &info->ssa; + const zend_func_info *info = ZEND_FUNC_INFO(op_array); + const zend_ssa *ssa = &info->ssa; int blocks_count = info->ssa.cfg.blocks_count; - zend_basic_block *blocks = info->ssa.cfg.blocks; + const zend_basic_block *blocks = info->ssa.cfg.blocks; int j; uint32_t t1; uint32_t tmp = 0; @@ -4595,7 +4594,7 @@ static void zend_func_return_info(const zend_op_array *op_array, zend_op *opline = op_array->opcodes + blocks[j].start + blocks[j].len - 1; if (opline->opcode == ZEND_RETURN || opline->opcode == ZEND_RETURN_BY_REF) { - zend_ssa_op *ssa_op = ssa->ops ? &ssa->ops[opline - op_array->opcodes] : NULL; + const zend_ssa_op *ssa_op = ssa->ops ? &ssa->ops[opline - op_array->opcodes] : NULL; if (!recursive && ssa_op && info->ssa.var_info && ssa_op->op1_use >= 0 && info->ssa.var_info[ssa_op->op1_use].recursive) { @@ -4642,7 +4641,7 @@ static void zend_func_return_info(const zend_op_array *op_array, } if (opline->op1_type == IS_CONST) { - zval *zv = CRT_CONSTANT(opline->op1); + const zval *zv = CRT_CONSTANT(opline->op1); if (Z_TYPE_P(zv) == IS_LONG) { if (tmp_has_range < 0) { @@ -4745,7 +4744,7 @@ static zend_result zend_infer_types(const zend_op_array *op_array, const zend_sc return SUCCESS; } -static void zend_mark_cv_references(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa) +static void zend_mark_cv_references(const zend_op_array *op_array, const zend_script *script, const zend_ssa *ssa) { int var, def; const zend_op *opline; diff --git a/Zend/Optimizer/zend_inference.h b/Zend/Optimizer/zend_inference.h index 7e4841c81c493..1b626fa2ee227 100644 --- a/Zend/Optimizer/zend_inference.h +++ b/Zend/Optimizer/zend_inference.h @@ -217,7 +217,7 @@ static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) BEGIN_EXTERN_C() -ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa); +ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, const zend_ssa *ssa); ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa); ZEND_API zend_result zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level); @@ -238,7 +238,7 @@ ZEND_API bool zend_may_throw(const zend_op *opline, const zend_ssa_op *ssa_op, c ZEND_API zend_result zend_update_type_info( const zend_op_array *op_array, zend_ssa *ssa, const zend_script *script, - zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes, + const zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes, zend_long optimization_level); END_EXTERN_C() From c128a1801bf47f62881fe50e34af1cd835d8b370 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 28 Nov 2024 17:22:36 +0100 Subject: [PATCH 159/386] Add unit test setup with php_network_connect_socket test --- tests/unit/Makefile | 31 ++++ tests/unit/main/test_network.c | 254 +++++++++++++++++++++++++++++++++ 2 files changed, 285 insertions(+) create mode 100644 tests/unit/Makefile create mode 100644 tests/unit/main/test_network.c diff --git a/tests/unit/Makefile b/tests/unit/Makefile new file mode 100644 index 0000000000000..050b05bbd215b --- /dev/null +++ b/tests/unit/Makefile @@ -0,0 +1,31 @@ +CC = gcc +CFLAGS = -g -Wall -I../../ -I../../Zend -I../../main -I../../TSRM -I. -I.. +COMMON_LDFLAGS = ../../.libs/libphp.a -lcmocka -lpthread -lm -ldl -lresolv -lutil + +TESTS = main/test_network +main/test_network_SRC = main/test_network.c +main/test_network_LDFLAGS = $(COMMON_LDFLAGS) -Wl,--wrap=connect,--wrap=poll,--wrap=getsockopt,--wrap=gettimeofday + + +# Build all tests +all: $(TESTS) + +# Build rule for each test +$(TESTS): + $(CC) $(CFLAGS) -o $@.out $($(basename $@)_SRC) $($(basename $@)_LDFLAGS) + +# Run all tests +.PHONY: test +test: $(TESTS) + @echo "Running all tests..." + @for test in $(TESTS); do \ + echo "Running $$test..."; \ + $$test.out || exit 1; \ + done + +# Clean tests +.PHONY: clean +clean: + @for test in $(TESTS); do \ + rm -f $$test.out; \ + done diff --git a/tests/unit/main/test_network.c b/tests/unit/main/test_network.c new file mode 100644 index 0000000000000..9ebdf098e414f --- /dev/null +++ b/tests/unit/main/test_network.c @@ -0,0 +1,254 @@ +#include "php.h" +#include "php_network.h" +#include + +// Mocked poll +int __wrap_poll(struct pollfd *ufds, nfds_t nfds, int timeout) +{ + function_called(); + check_expected(timeout); + + int n = mock_type(int); + if (n > 0) { + ufds->revents = 1; + } else if (n < 0) { + errno = -n; + n = -1; + } + + return n; +} + +// Mocked connect +int __wrap_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) +{ + function_called(); + errno = mock_type(int); + return errno != 0 ? -1 : 0; +} + +// Mocked getsockopt +int __wrap_getsockopt(int fd, int level, int optname, void *optval, socklen_t *optlen) +{ + function_called(); + int *error = (int *) optval; + *error = mock_type(int); + return mock_type(int); +} + +// Mocked gettimeofday +int __wrap_gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) +{ + function_called(); + struct timeval *now = mock_ptr_type(struct timeval *); + if (now) { + time_Info->tv_sec = now->tv_sec; + time_Info->tv_usec = now->tv_usec; + } + return mock_type(int); +} + +// Test successful connection +static void test_php_network_connect_socket_immediate_success(void **state) { + struct timeval timeout = { .tv_sec = 2, .tv_usec = 500000 }; + php_socket_t sockfd = 12; + int error_code = 0; + + expect_function_call(__wrap_connect); + will_return(__wrap_connect, 0); + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout, NULL, &error_code); + + assert_int_equal(result, 0); + assert_int_equal(error_code, 0); +} + +// Test successful connection in progress followed by poll +static void test_php_network_connect_socket_progress_success(void **state) { + struct timeval timeout_tv = { .tv_sec = 2, .tv_usec = 500000 }; + php_socket_t sockfd = 12; + int error_code = 0; + + // Mock connect setting EINPROGRESS errno + expect_function_call(__wrap_connect); + will_return(__wrap_connect, EINPROGRESS); + + // Mock time setting - ignored + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, NULL); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to return success + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 2500); + will_return(__wrap_poll, 1); + + // Mock no socket error + expect_function_call(__wrap_getsockopt); + will_return(__wrap_getsockopt, 0); // optval saved result + will_return(__wrap_getsockopt, 0); // actual return value + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout_tv, NULL, &error_code); + + assert_int_equal(result, 0); + assert_int_equal(error_code, 0); +} + +static void test_php_network_connect_socket_eintr_t1(void **state) { + struct timeval timeout_tv = { .tv_sec = 2, .tv_usec = 500000 }; + struct timeval start_time = { .tv_sec = 1000, .tv_usec = 0 }; // Initial time + struct timeval retry_time = { .tv_sec = 1001, .tv_usec = 200000 }; // Time after EINTR + php_socket_t sockfd = 12; + int error_code = 0; + + // Mock connect to set EINPROGRESS + expect_function_call(__wrap_connect); + will_return(__wrap_connect, EINPROGRESS); + + // Mock gettimeofday for initial call + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &start_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to return EINTR first + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 2500); + will_return(__wrap_poll, -EINTR); + + // Mock gettimeofday after EINTR + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &retry_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to succeed on retry + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 1300); + will_return(__wrap_poll, 1); + + // Mock no socket error + expect_function_call(__wrap_getsockopt); + will_return(__wrap_getsockopt, 0); + will_return(__wrap_getsockopt, 0); + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout_tv, NULL, &error_code); + + // Ensure the function succeeds + assert_int_equal(result, 0); + assert_int_equal(error_code, 0); +} + +static void test_php_network_connect_socket_eintr_t2(void **state) { + struct timeval timeout_tv = { .tv_sec = 2, .tv_usec = 1500000 }; + struct timeval start_time = { .tv_sec = 1000, .tv_usec = 300000 }; // Initial time + struct timeval retry_time = { .tv_sec = 1001, .tv_usec = 200000 }; // Time after EINTR + php_socket_t sockfd = 12; + int error_code = 0; + + // Mock connect to set EINPROGRESS + expect_function_call(__wrap_connect); + will_return(__wrap_connect, EINPROGRESS); + + // Mock gettimeofday for initial call + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &start_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to return EINTR first + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 3500); + will_return(__wrap_poll, -EINTR); + + // Mock gettimeofday after EINTR + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &retry_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to succeed on retry + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 2600); + will_return(__wrap_poll, 1); + + // Mock no socket error + expect_function_call(__wrap_getsockopt); + will_return(__wrap_getsockopt, 0); // optval saved result + will_return(__wrap_getsockopt, 0); // actual return value + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout_tv, NULL, &error_code); + + // Ensure the function succeeds + assert_int_equal(result, 0); + assert_int_equal(error_code, 0); +} + +static void test_php_network_connect_socket_eintr_t3(void **state) { + struct timeval timeout_tv = { .tv_sec = 2, .tv_usec = 500000 }; + struct timeval start_time = { .tv_sec = 1002, .tv_usec = 300000 }; // Initial time + struct timeval retry_time = { .tv_sec = 1001, .tv_usec = 2200000 }; // Time after EINTR + php_socket_t sockfd = 12; + int error_code = 0; + + // Mock connect to set EINPROGRESS + expect_function_call(__wrap_connect); + will_return(__wrap_connect, EINPROGRESS); + + // Mock gettimeofday for initial call + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &start_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to return EINTR first + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 2500); + will_return(__wrap_poll, -EINTR); + + // Mock gettimeofday after EINTR + expect_function_call(__wrap_gettimeofday); + will_return(__wrap_gettimeofday, &retry_time); + will_return(__wrap_gettimeofday, 0); + + // Mock poll to succeed on retry + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 1600); + will_return(__wrap_poll, 1); + + // Mock no socket error + expect_function_call(__wrap_getsockopt); + will_return(__wrap_getsockopt, 0); // optval saved result + will_return(__wrap_getsockopt, 0); // actual return value + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout_tv, NULL, &error_code); + + // Ensure the function succeeds + assert_int_equal(result, 0); + assert_int_equal(error_code, 0); +} + +// Test connection error (ECONNREFUSED) +static void test_php_network_connect_socket_connect_error(void **state) { + struct timeval timeout = { .tv_sec = 2, .tv_usec = 500000 }; + php_socket_t sockfd = 12; + int error_code = 0; + + // Mock connect to set ECONNREFUSED + expect_function_call(__wrap_connect); + will_return(__wrap_connect, ECONNREFUSED); + + int result = php_network_connect_socket(sockfd, NULL, 0, 0, &timeout, NULL, &error_code); + + // Ensure the function returns an error + assert_int_equal(result, -1); + assert_int_equal(error_code, ECONNREFUSED); +} + + +int main(void) { + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_php_network_connect_socket_immediate_success), + cmocka_unit_test(test_php_network_connect_socket_progress_success), + cmocka_unit_test(test_php_network_connect_socket_eintr_t1), + cmocka_unit_test(test_php_network_connect_socket_eintr_t2), + cmocka_unit_test(test_php_network_connect_socket_eintr_t3), + cmocka_unit_test(test_php_network_connect_socket_connect_error), + }; + return cmocka_run_group_tests(tests, NULL, NULL); +} \ No newline at end of file From 6fbe99964f3c9f18a27553e8193044a815a09a23 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 13 Aug 2025 13:22:20 +0200 Subject: [PATCH 160/386] Add CI for unit tests --- .../actions/configure-unit-tests/action.yml | 10 +++ .github/workflows/unit-tests.yml | 75 +++++++++++++++++++ tests/unit/Makefile | 1 + tests/unit/main/test_network.c | 2 +- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/actions/configure-unit-tests/action.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/actions/configure-unit-tests/action.yml b/.github/actions/configure-unit-tests/action.yml new file mode 100644 index 0000000000000..ef8239b7111c7 --- /dev/null +++ b/.github/actions/configure-unit-tests/action.yml @@ -0,0 +1,10 @@ +name: ./configure (unit tests) +description: Configure PHP with minimal settings for unit testing +runs: + using: composite + steps: + - shell: bash + run: | + set -x + ./buildconf --force + ./configure --disable-all --enable-embed=static diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000000000..dc52a152f7abd --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,75 @@ +name: Unit Tests +on: + push: + paths: + - 'main/network.c' + - 'tests/unit/**' + - '.github/workflows/unit-tests.yml' + branches: + - master + pull_request: + paths: + - 'main/network.c' + - 'tests/unit/**' + - '.github/workflows/unit-tests.yml' + branches: + - '**' + workflow_dispatch: ~ + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }} + cancel-in-progress: true + +env: + CC: ccache gcc + CXX: ccache g++ + +jobs: + UNIT_TESTS: + if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + name: UNIT_TESTS_LINUX_X64 + runs-on: ubuntu-24.04 + timeout-minutes: 20 + steps: + - name: git checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + set -x + sudo apt-get update + sudo apt-get install -y \ + libcmocka-dev \ + autoconf \ + gcc \ + make \ + unzip \ + bison \ + re2c \ + locales \ + ccache + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "unit-tests-${{hashFiles('main/php_version.h')}}" + append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} + + - name: ./configure (minimal build) + uses: ./.github/actions/configure-unit-tests + + - name: make libphp.a + run: | + set -x + make -j$(/usr/bin/nproc) >/dev/null + + - name: Run unit tests + run: | + set -x + cd tests/unit + make test + diff --git a/tests/unit/Makefile b/tests/unit/Makefile index 050b05bbd215b..ae8eeb8ab3ed9 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -2,6 +2,7 @@ CC = gcc CFLAGS = -g -Wall -I../../ -I../../Zend -I../../main -I../../TSRM -I. -I.. COMMON_LDFLAGS = ../../.libs/libphp.a -lcmocka -lpthread -lm -ldl -lresolv -lutil +# Update paths in .github/workflows/unit-tests.yml when adding new test to make it run in PR when such file changes TESTS = main/test_network main/test_network_SRC = main/test_network.c main/test_network_LDFLAGS = $(COMMON_LDFLAGS) -Wl,--wrap=connect,--wrap=poll,--wrap=getsockopt,--wrap=gettimeofday diff --git a/tests/unit/main/test_network.c b/tests/unit/main/test_network.c index 9ebdf098e414f..3e0e6e37ed989 100644 --- a/tests/unit/main/test_network.c +++ b/tests/unit/main/test_network.c @@ -251,4 +251,4 @@ int main(void) { cmocka_unit_test(test_php_network_connect_socket_connect_error), }; return cmocka_run_group_tests(tests, NULL, NULL); -} \ No newline at end of file +} From eacd0b5d4e4be009f3f218d60c5768a50b0454a0 Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Sun, 5 Oct 2025 20:12:26 +0200 Subject: [PATCH 161/386] zend_hrtime: check posix clock once and prefer CLOCK_MONOTONIC_RAW (#19221) --- Zend/zend_hrtime.c | 21 +++++++++++++++++++++ Zend/zend_hrtime.h | 10 ++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Zend/zend_hrtime.c b/Zend/zend_hrtime.c index 7fa36b1b654f4..773e0525cadd9 100644 --- a/Zend/zend_hrtime.c +++ b/Zend/zend_hrtime.c @@ -27,6 +27,8 @@ # include # include +ZEND_API clockid_t zend_hrtime_posix_clock_id = CLOCK_MONOTONIC; + #elif ZEND_HRTIME_PLATFORM_WINDOWS # define WIN32_LEAN_AND_MEAN @@ -66,5 +68,24 @@ void zend_startup_hrtime(void) mach_timebase_info(&zend_hrtime_timerlib_info); +#elif ZEND_HRTIME_PLATFORM_POSIX + + struct timespec ts; + +#ifdef CLOCK_MONOTONIC_RAW + if (EXPECTED(0 == clock_gettime(CLOCK_MONOTONIC_RAW, &ts))) { + zend_hrtime_posix_clock_id = CLOCK_MONOTONIC_RAW; + return; + } +#endif + + if (EXPECTED(0 == clock_gettime(zend_hrtime_posix_clock_id, &ts))) { + return; + } + + // zend_error mechanism is not initialized at that point + fprintf(stderr, "No working CLOCK_MONOTONIC* found, this should never happen\n"); + abort(); + #endif } diff --git a/Zend/zend_hrtime.h b/Zend/zend_hrtime.h index 994dd6da169ed..f3bc4deeaf502 100644 --- a/Zend/zend_hrtime.h +++ b/Zend/zend_hrtime.h @@ -72,6 +72,10 @@ ZEND_API extern double zend_hrtime_timer_scale; # include ZEND_API extern mach_timebase_info_data_t zend_hrtime_timerlib_info; +#elif ZEND_HRTIME_PLATFORM_POSIX + +ZEND_API extern clockid_t zend_hrtime_posix_clock_id; + #endif #define ZEND_NANO_IN_SEC UINT64_C(1000000000) @@ -92,10 +96,8 @@ static zend_always_inline zend_hrtime_t zend_hrtime(void) return (zend_hrtime_t)mach_absolute_time() * zend_hrtime_timerlib_info.numer / zend_hrtime_timerlib_info.denom; #elif ZEND_HRTIME_PLATFORM_POSIX struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 }; - if (EXPECTED(0 == clock_gettime(CLOCK_MONOTONIC, &ts))) { - return ((zend_hrtime_t) ts.tv_sec * (zend_hrtime_t)ZEND_NANO_IN_SEC) + ts.tv_nsec; - } - return 0; + clock_gettime(zend_hrtime_posix_clock_id, &ts); + return ((zend_hrtime_t) ts.tv_sec * (zend_hrtime_t)ZEND_NANO_IN_SEC) + ts.tv_nsec; #elif ZEND_HRTIME_PLATFORM_HPUX return (zend_hrtime_t) gethrtime(); #elif ZEND_HRTIME_PLATFORM_AIX From 985d68150179b01b028d7cb179d4e32fca140d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 7 Oct 2025 20:44:32 +0200 Subject: [PATCH 162/386] tree-wide: Replace `zval_is_true()` by `zend_is_true()` (#20065) * tree-wide: Replace `zval_is_true()` by `zend_is_true()` The former is a direct alias of the latter which is much more often used. * zend_operators: Remove `zval_is_true()` --- UPGRADING.INTERNALS | 2 ++ Zend/zend_compile.c | 2 +- Zend/zend_operators.c | 14 +++++++------- Zend/zend_operators.h | 3 --- ext/mysqli/mysqli.c | 2 +- ext/pdo/pdo_dbh.c | 2 +- ext/pdo_odbc/odbc_stmt.c | 2 +- ext/pgsql/pgsql.c | 2 +- ext/session/session.c | 6 +++--- ext/sockets/multicast.c | 4 ++-- ext/standard/head.c | 6 +++--- ext/standard/http_fopen_wrapper.c | 2 +- main/streams/userspace.c | 20 ++++++++++---------- 13 files changed, 33 insertions(+), 34 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c2ec44e1e0c2a..ada814964fc5f 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -20,6 +20,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead. . New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were added, given the primary flags were running out of bits. + . The zval_is_true() alias of zend_is_true() has been removed. Call + zend_is_true() directly instead. ======================== 2. Build system changes diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a0215611b610d..7d4b900990b5f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -12062,7 +12062,7 @@ bool zend_try_ct_eval_cast(zval *result, uint32_t type, zval *op1) } switch (type) { case _IS_BOOL: - ZVAL_BOOL(result, zval_is_true(op1)); + ZVAL_BOOL(result, zend_is_true(op1)); return true; case IS_LONG: if (Z_TYPE_P(op1) == IS_DOUBLE && !ZEND_DOUBLE_FITS_LONG(Z_DVAL_P((op1)))) { diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 9740de7d081fd..2550fcbeb1cde 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1593,7 +1593,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, } } ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BOOL_XOR); - op1_val = zval_is_true(op1); + op1_val = zend_is_true(op1); } } while (0); do { @@ -1613,7 +1613,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, } } ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BOOL_XOR); - op2_val = zval_is_true(op2); + op2_val = zend_is_true(op2); } } while (0); @@ -1641,7 +1641,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1) } ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BOOL_NOT); - ZVAL_BOOL(result, !zval_is_true(op1)); + ZVAL_BOOL(result, !zend_is_true(op1)); } return SUCCESS; } @@ -2433,13 +2433,13 @@ ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2) /* {{{ */ converted = true; } } else if (Z_TYPE_P(op1) < IS_TRUE) { - return zval_is_true(op2) ? -1 : 0; + return zend_is_true(op2) ? -1 : 0; } else if (Z_TYPE_P(op1) == IS_TRUE) { - return zval_is_true(op2) ? 0 : 1; + return zend_is_true(op2) ? 0 : 1; } else if (Z_TYPE_P(op2) < IS_TRUE) { - return zval_is_true(op1) ? 1 : 0; + return zend_is_true(op1) ? 1 : 0; } else if (Z_TYPE_P(op2) == IS_TRUE) { - return zval_is_true(op1) ? 0 : -1; + return zend_is_true(op1) ? 0 : -1; } else { op1 = _zendi_convert_scalar_to_number_silent(op1, &op1_copy); op2 = _zendi_convert_scalar_to_number_silent(op2, &op2_copy); diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index a3bf19fca8f27..4a74e6ebaefe9 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -404,9 +404,6 @@ static zend_always_inline bool try_convert_to_string(zval *op) { ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op); ZEND_API bool ZEND_FASTCALL zend_object_is_true(const zval *op); -#define zval_is_true(op) \ - zend_is_true(op) - static zend_always_inline bool i_zend_is_true(const zval *op) { bool result = 0; diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index dddb53585f14e..a46b16e1d1ecd 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -316,7 +316,7 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in zval rv; zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { - has_property = zval_is_true(value); + has_property = zend_is_true(value); zval_ptr_dtor(value); } break; diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index b34653e286728..2eaa3940f82e5 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -805,7 +805,7 @@ PDO_API bool pdo_get_bool_param(bool *bval, const zval *value) *bval = false; return true; case IS_LONG: - *bval = zval_is_true(value); + *bval = zend_is_true(value); return true; case IS_STRING: /* TODO Should string be allowed? */ default: diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 8e27d27173c0b..171fb7b7b1e95 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -803,7 +803,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val) return 0; case PDO_ODBC_ATTR_ASSUME_UTF8: - S->assume_utf8 = zval_is_true(val); + S->assume_utf8 = zend_is_true(val); return 0; default: strcpy(S->einfo.last_err_msg, "Unknown Attribute"); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index feea2ed60e6f4..dbb875e88f190 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4967,7 +4967,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string * break; /* break out for() */ } - if (zval_is_true(is_enum)) { + if (zend_is_true(is_enum)) { /* enums need to be treated like strings */ data_type = PG_TEXT; } else { diff --git a/ext/session/session.c b/ext/session/session.c index 1c01201a55bc5..8796005e9232f 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1858,15 +1858,15 @@ PHP_FUNCTION(session_set_cookie_params) domain = zval_get_string(value); found++; } else if (zend_string_equals_literal_ci(key, "secure")) { - secure = zval_is_true(value); + secure = zend_is_true(value); secure_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "partitioned")) { - partitioned = zval_is_true(value); + partitioned = zend_is_true(value); partitioned_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "httponly")) { - httponly = zval_is_true(value); + httponly = zend_is_true(value); httponly_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "samesite")) { diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index f331fd177ebfd..522e6b346f66d 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -293,7 +293,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock, goto dosockopt; case IP_MULTICAST_LOOP: - ipv4_mcast_ttl_lback = (unsigned char) zval_is_true(arg4); + ipv4_mcast_ttl_lback = (unsigned char) zend_is_true(arg4); goto ipv4_loop_ttl; case IP_MULTICAST_TTL: @@ -357,7 +357,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock, goto dosockopt; case IPV6_MULTICAST_LOOP: - ov = (int) zval_is_true(arg4); + ov = (int) zend_is_true(arg4); goto ipv6_loop_hops; case IPV6_MULTICAST_HOPS: convert_to_long(arg4); diff --git a/ext/standard/head.c b/ext/standard/head.c index 087ba6a34806c..76ba89dc01713 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -213,13 +213,13 @@ static zend_result php_head_parse_cookie_options_array(HashTable *options, zend_ } else if (zend_string_equals_literal_ci(key, "domain")) { *domain = zval_get_string(value); } else if (zend_string_equals_literal_ci(key, "secure")) { - *secure = zval_is_true(value); + *secure = zend_is_true(value); } else if (zend_string_equals_literal_ci(key, "httponly")) { - *httponly = zval_is_true(value); + *httponly = zend_is_true(value); } else if (zend_string_equals_literal_ci(key, "samesite")) { *samesite = zval_get_string(value); } else if (zend_string_equals_literal_ci(key, "partitioned")) { - *partitioned = zval_is_true(value); + *partitioned = zend_is_true(value); } else { zend_value_error("%s(): option \"%s\" is invalid", get_active_function_name(), ZSTR_VAL(key)); return FAILURE; diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index b7087befcb271..da150381f43f3 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -276,7 +276,7 @@ static zend_string *php_stream_http_response_headers_parse(php_stream_wrapper *w if (!strncasecmp(last_header_line, "Location:", sizeof("Location:")-1)) { /* Check if the location should be followed. */ if (context && (tmpzval = php_stream_context_get_option(context, "http", "follow_location")) != NULL) { - header_info->follow_location = zval_is_true(tmpzval); + header_info->follow_location = zend_is_true(tmpzval); } else if (!((response_code >= 300 && response_code < 304) || 307 == response_code || 308 == response_code)) { /* The redirection should not be automatic if follow_location is not set and diff --git a/main/streams/userspace.c b/main/streams/userspace.c index deae2ff5d2d3c..b1ea8818aeccd 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -346,7 +346,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * zval_ptr_dtor(&args[3]); goto end; } - if (zval_is_true(&zretval)) { + if (zend_is_true(&zretval)) { /* the stream is now open! */ stream = php_stream_alloc_rel(&php_stream_userspace_ops, us, 0, mode); @@ -430,7 +430,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char goto end; } - if (zval_is_true(&zretval)) { + if (zend_is_true(&zretval)) { /* the stream is now open! */ stream = php_stream_alloc_rel(&php_stream_userspace_dir_ops, us, 0, mode); @@ -672,7 +672,7 @@ static ssize_t php_userstreamop_read(php_stream *stream, char *buf, size_t count goto err; } - if (zval_is_true(&retval)) { + if (zend_is_true(&retval)) { stream->eof = 1; } zval_ptr_dtor(&retval); @@ -720,7 +720,7 @@ static int php_userstreamop_flush(php_stream *stream) zend_result call_result = zend_call_method_if_exists(Z_OBJ(us->object), func_name, &retval, 0, NULL); zend_string_release_ex(func_name, false); - int ret = call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval) ? 0 : -1; + int ret = call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval) ? 0 : -1; zval_ptr_dtor(&retval); @@ -755,7 +755,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when ret = -1; goto out; - } else if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval)) { + } else if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval)) { ret = 0; } else { ret = -1; @@ -1090,7 +1090,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1128,7 +1128,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1166,7 +1166,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1203,7 +1203,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1265,7 +1265,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); From 18d99ee4b724f9ecd18122abacfac5767bfbfb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 8 Oct 2025 10:10:16 +0200 Subject: [PATCH 163/386] json: Improve performance of `php_json_encode_array()` (#20092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of using a boolean flag to check for each element whether or not it is the first, we just unconditionally append a comma after each element and then remove the last comma at the end. For: s)[ZSTR_LEN(buf->s) - 1] != ','; + if (!empty) { + /* Drop the trailing comma. */ + ZSTR_LEN(buf->s)--; } PHP_JSON_HASH_UNPROTECT_RECURSION(obj); @@ -197,7 +198,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, } --encoder->depth; - if (need_comma) { + if (!empty) { php_json_pretty_print_char(buf, options, '\n'); php_json_pretty_print_indent(buf, options, encoder); } @@ -235,6 +236,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, uint32_t i = myht ? zend_hash_num_elements(myht) : 0; + bool empty = true; if (i > 0) { zend_string *key; zval *data; @@ -247,12 +249,6 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, if (!encode_as_object) { ZEND_ASSERT(Z_TYPE_P(data) != IS_PTR); - if (need_comma) { - smart_str_appendc(buf, ','); - } else { - need_comma = true; - } - php_json_pretty_print_char(buf, options, '\n'); php_json_pretty_print_indent(buf, options, encoder); } else { @@ -276,11 +272,6 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, } } - if (need_comma) { - smart_str_appendc(buf, ','); - } else { - need_comma = true; - } php_json_pretty_print_char(buf, options, '\n'); php_json_pretty_print_indent(buf, options, encoder); @@ -293,12 +284,6 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, smart_str_appendl(buf, "\"\"", 2); } } else { - if (need_comma) { - smart_str_appendc(buf, ','); - } else { - need_comma = true; - } - php_json_pretty_print_char(buf, options, '\n'); php_json_pretty_print_indent(buf, options, encoder); @@ -319,7 +304,15 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, return FAILURE; } zval_ptr_dtor(&tmp); + + smart_str_appendc(buf, ','); } ZEND_HASH_FOREACH_END(); + + empty = ZSTR_VAL(buf->s)[ZSTR_LEN(buf->s) - 1] != ','; + if (!empty) { + /* Drop the trailing comma. */ + ZSTR_LEN(buf->s)--; + } } PHP_JSON_HASH_UNPROTECT_RECURSION(recursion_rc); @@ -334,7 +327,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, --encoder->depth; /* Only keep closing bracket on same line for empty arrays/objects */ - if (need_comma) { + if (!empty) { php_json_pretty_print_char(buf, options, '\n'); php_json_pretty_print_indent(buf, options, encoder); } From 44af9adf79b6947a409faa465bcd96860d56fd40 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 8 Oct 2025 17:32:30 +0200 Subject: [PATCH 164/386] Drop LIBXML_HTML_ENABLED checks (#20083) It is possible to build libxml without HTML support, which would mean that PHP does not support the saveHtml() features and HTML parsing in general. It also adds some maintenance complexity. I'm not aware of any distro that does this and it shows: this has been broken since stubs have been introduced. So we can just drop it as clearly no one cares about this or we would've known about it already. It also simplifies downstream code because they can now rely on the HTML functionality to always be available. --- ext/dom/document.c | 4 ---- ext/dom/php_dom.c | 12 ------------ ext/dom/php_dom.h | 2 -- ext/dom/php_dom.stub.php | 2 -- ext/dom/php_dom_arginfo.h | 18 +++--------------- 5 files changed, 3 insertions(+), 35 deletions(-) diff --git a/ext/dom/document.c b/ext/dom/document.c index 6db729535d30a..c56ec257cec31 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -2040,8 +2040,6 @@ PHP_METHOD(DOMDocument, relaxNGValidateSource) #endif -#ifdef LIBXML_HTML_ENABLED - static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { char *source; @@ -2234,8 +2232,6 @@ PHP_METHOD(DOMDocument, saveHTML) } /* }}} end dom_document_save_html */ -#endif /* defined(LIBXML_HTML_ENABLED) */ - /* {{{ Register extended class used to create base node type */ static void dom_document_register_node_class(INTERNAL_FUNCTION_PARAMETERS, bool modern) { diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 095d07e875ea9..d360163ab5e5f 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1369,9 +1369,7 @@ PHP_MINFO_FUNCTION(dom) php_info_print_table_row(2, "DOM/XML", "enabled"); php_info_print_table_row(2, "DOM/XML API Version", DOM_API_VERSION); php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION); -#ifdef LIBXML_HTML_ENABLED php_info_print_table_row(2, "HTML Support", "enabled"); -#endif #ifdef LIBXML_XPATH_ENABLED php_info_print_table_row(2, "XPath Support", "enabled"); #endif @@ -2709,20 +2707,10 @@ xmlChar *php_dom_libxml_fix_file_path(xmlChar *path) xmlDocPtr php_dom_create_html_doc(void) { -#ifdef LIBXML_HTML_ENABLED xmlDocPtr lxml_doc = htmlNewDocNoDtD(NULL, NULL); if (EXPECTED(lxml_doc)) { lxml_doc->dict = xmlDictCreate(); } -#else - /* If HTML support is not enabled, then htmlNewDocNoDtD() is not available. - * This code mimics the behaviour. */ - xmlDocPtr lxml_doc = xmlNewDoc((const xmlChar *) "1.0"); - if (EXPECTED(lxml_doc)) { - lxml_doc->type = XML_HTML_DOCUMENT_NODE; - lxml_doc->dict = xmlDictCreate(); - } -#endif return lxml_doc; } diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 34cc4af85c568..e44f74eadeb37 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -34,10 +34,8 @@ extern zend_module_entry dom_module_entry; #include #include #include -#ifdef LIBXML_HTML_ENABLED #include #include -#endif #ifdef LIBXML_XPATH_ENABLED #include #include diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 7236e80b4d247..37a1bea62b627 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -1013,7 +1013,6 @@ public function registerNodeClass(string $baseClass, ?string $extendedClass): tr /** @tentative-return-type */ public function save(string $filename, int $options = 0): int|false {} -#ifdef LIBXML_HTML_ENABLED /** @tentative-return-type */ public function loadHTML(string $source, int $options = 0): bool {} @@ -1025,7 +1024,6 @@ public function saveHTML(?DOMNode $node = null): string|false {} /** @tentative-return-type */ public function saveHTMLFile(string $filename): int|false {} -#endif /** @tentative-return-type */ public function saveXML(?DOMNode $node = null, int $options = 0): string|false {} diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 9b2e467d1c6a9..1f3f9fd0a8a24 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 757889c0ca89cc8e9905ba465e0621fe89b6e716 */ + * Stub hash: e3495cb89e4466d9102abb10bf6461989b7c8ba9 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_dom_import_simplexml, 0, 1, DOMAttr|DOMElement, 0) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) @@ -404,16 +404,9 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DOMDocument_save ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#if defined(LIBXML_HTML_ENABLED) -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_loadHTML, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() +#define arginfo_class_DOMDocument_loadHTML arginfo_class_DOMDocument_loadXML -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_loadHTMLFile, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() +#define arginfo_class_DOMDocument_loadHTMLFile arginfo_class_DOMDocument_load ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DOMDocument_saveHTML, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, node, DOMNode, 1, "null") @@ -422,7 +415,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DOMDocument_saveHTMLFile, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_END_ARG_INFO() -#endif ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DOMDocument_saveXML, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, node, DOMNode, 1, "null") @@ -1228,12 +1220,10 @@ ZEND_METHOD(DOMDocument, loadXML); ZEND_METHOD(DOMDocument, normalizeDocument); ZEND_METHOD(DOMDocument, registerNodeClass); ZEND_METHOD(DOMDocument, save); -#if defined(LIBXML_HTML_ENABLED) ZEND_METHOD(DOMDocument, loadHTML); ZEND_METHOD(DOMDocument, loadHTMLFile); ZEND_METHOD(DOMDocument, saveHTML); ZEND_METHOD(DOMDocument, saveHTMLFile); -#endif ZEND_METHOD(DOMDocument, saveXML); #if defined(LIBXML_SCHEMAS_ENABLED) ZEND_METHOD(DOMDocument, schemaValidate); @@ -1496,12 +1486,10 @@ static const zend_function_entry class_DOMDocument_methods[] = { ZEND_ME(DOMDocument, normalizeDocument, arginfo_class_DOMDocument_normalizeDocument, ZEND_ACC_PUBLIC) ZEND_ME(DOMDocument, registerNodeClass, arginfo_class_DOMDocument_registerNodeClass, ZEND_ACC_PUBLIC) ZEND_ME(DOMDocument, save, arginfo_class_DOMDocument_save, ZEND_ACC_PUBLIC) -#if defined(LIBXML_HTML_ENABLED) ZEND_ME(DOMDocument, loadHTML, arginfo_class_DOMDocument_loadHTML, ZEND_ACC_PUBLIC) ZEND_ME(DOMDocument, loadHTMLFile, arginfo_class_DOMDocument_loadHTMLFile, ZEND_ACC_PUBLIC) ZEND_ME(DOMDocument, saveHTML, arginfo_class_DOMDocument_saveHTML, ZEND_ACC_PUBLIC) ZEND_ME(DOMDocument, saveHTMLFile, arginfo_class_DOMDocument_saveHTMLFile, ZEND_ACC_PUBLIC) -#endif ZEND_ME(DOMDocument, saveXML, arginfo_class_DOMDocument_saveXML, ZEND_ACC_PUBLIC) #if defined(LIBXML_SCHEMAS_ENABLED) ZEND_ME(DOMDocument, schemaValidate, arginfo_class_DOMDocument_schemaValidate, ZEND_ACC_PUBLIC) From aaed3ccb4791ea51fe36cb621ddce31c1716f0b9 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 8 Oct 2025 17:37:24 +0200 Subject: [PATCH 165/386] Allow by-ref assign to WeakMap even if object is not yet in the map (#20097) Previously this failed as the read_dimension which is invoked by ref-assign does not contain the logic to add the key, so it was required to first write the value using a normal assignment and then thereafter use the reference assignment. This solves it by adding the necessary logic to assign references directly. --- NEWS | 2 ++ UPGRADING | 4 ++++ .../weakmap_by_ref_dimension_assign.phpt | 13 +++++++++++ Zend/zend_weakrefs.c | 23 ++++++++++++------- 4 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 Zend/tests/weakrefs/weakmap_by_ref_dimension_assign.phpt diff --git a/NEWS b/NEWS index 1634189bde10f..38d3bde8a746e 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Added first-class callable cache to share instances for the duration of the request. (ilutov) + . It is now possible to use reference assign on WeakMap without the key + needing to be present beforehand. (nielsdos) - Intl: . Added IntlNumberRangeFormatter class to format an interval of two numbers diff --git a/UPGRADING b/UPGRADING index 51a057003b544..6873c276a0964 100644 --- a/UPGRADING +++ b/UPGRADING @@ -23,6 +23,10 @@ PHP 8.6 UPGRADE NOTES 2. New Features ======================================== +- Core: + . It is now possible to use reference assign on WeakMap without the key + needing to be present beforehand. + - Intl: . Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, IntlNumberRangeFormatter::COLLAPSE_ALL collapse and IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and diff --git a/Zend/tests/weakrefs/weakmap_by_ref_dimension_assign.phpt b/Zend/tests/weakrefs/weakmap_by_ref_dimension_assign.phpt new file mode 100644 index 0000000000000..6444de7eea6ba --- /dev/null +++ b/Zend/tests/weakrefs/weakmap_by_ref_dimension_assign.phpt @@ -0,0 +1,13 @@ +--TEST-- +By-ref assign of WeakMap dimension +--FILE-- + +--EXPECT-- +int(1) diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 518d2d8eb9ee0..83a28808811d5 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -370,18 +370,25 @@ static zval *zend_weakmap_read_dimension(zend_object *object, zval *offset, int zend_weakmap *wm = zend_weakmap_from(object); zend_object *obj_addr = Z_OBJ_P(offset); zval *zv = zend_hash_index_find(&wm->ht, zend_object_to_weakref_key(obj_addr)); - if (zv == NULL) { - if (type != BP_VAR_IS) { - zend_throw_error(NULL, - "Object %s#%d not contained in WeakMap", ZSTR_VAL(obj_addr->ce->name), obj_addr->handle); + if (type == BP_VAR_W || type == BP_VAR_RW) { + if (zv == NULL) { + zval value; + zend_weakref_register(obj_addr, ZEND_WEAKREF_ENCODE(&wm->ht, ZEND_WEAKREF_TAG_MAP)); + ZVAL_NULL(&value); + zv = zend_hash_index_add_new(&wm->ht, zend_object_to_weakref_key(obj_addr), &value); + } + ZVAL_MAKE_REF(zv); + } else { + if (zv == NULL) { + if (type != BP_VAR_IS) { + zend_throw_error(NULL, + "Object %s#%d not contained in WeakMap", ZSTR_VAL(obj_addr->ce->name), obj_addr->handle); + return NULL; + } return NULL; } - return NULL; } - if (type == BP_VAR_W || type == BP_VAR_RW) { - ZVAL_MAKE_REF(zv); - } return zv; } From 50b3222d45b21e0c0f4ea84d78aec59843e3fcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 8 Oct 2025 21:04:18 +0200 Subject: [PATCH 166/386] hash: Upgrade xxHash to 0.8.2 (#20064) --- NEWS | 3 + UPGRADING | 3 + ext/hash/xxhash/xxhash.h | 2929 ++++++++++++++++++++++++++------------ 3 files changed, 2052 insertions(+), 883 deletions(-) diff --git a/NEWS b/NEWS index 38d3bde8a746e..ab372893ce661 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,9 @@ PHP NEWS . It is now possible to use reference assign on WeakMap without the key needing to be present beforehand. (nielsdos) +- Hash: + . Upgrade xxHash to 0.8.2. (timwolla) + - Intl: . Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, collapse type and identity fallback. diff --git a/UPGRADING b/UPGRADING index 6873c276a0964..b9095380ed538 100644 --- a/UPGRADING +++ b/UPGRADING @@ -60,6 +60,9 @@ PHP 8.6 UPGRADE NOTES 9. Other Changes to Extensions ======================================== +- Hash: + . The bundled version of xxHash was upgraded to 0.8.2. + ======================================== 10. New Global Constants ======================================== diff --git a/ext/hash/xxhash/xxhash.h b/ext/hash/xxhash/xxhash.h index 259371a3addd6..a18e8c762daaa 100644 --- a/ext/hash/xxhash/xxhash.h +++ b/ext/hash/xxhash/xxhash.h @@ -1,7 +1,7 @@ /* * xxHash - Extremely Fast Hash algorithm * Header File - * Copyright (C) 2012-2020 Yann Collet + * Copyright (C) 2012-2021 Yann Collet * * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) * @@ -32,49 +32,142 @@ * - xxHash homepage: https://www.xxhash.com * - xxHash source repository: https://github.com/Cyan4973/xxHash */ + /*! * @mainpage xxHash * + * xxHash is an extremely fast non-cryptographic hash algorithm, working at RAM speed + * limits. + * + * It is proposed in four flavors, in three families: + * 1. @ref XXH32_family + * - Classic 32-bit hash function. Simple, compact, and runs on almost all + * 32-bit and 64-bit systems. + * 2. @ref XXH64_family + * - Classic 64-bit adaptation of XXH32. Just as simple, and runs well on most + * 64-bit systems (but _not_ 32-bit systems). + * 3. @ref XXH3_family + * - Modern 64-bit and 128-bit hash function family which features improved + * strength and performance across the board, especially on smaller data. + * It benefits greatly from SIMD and 64-bit without requiring it. + * + * Benchmarks + * --- + * The reference system uses an Intel i7-9700K CPU, and runs Ubuntu x64 20.04. + * The open source benchmark program is compiled with clang v10.0 using -O3 flag. + * + * | Hash Name | ISA ext | Width | Large Data Speed | Small Data Velocity | + * | -------------------- | ------- | ----: | ---------------: | ------------------: | + * | XXH3_64bits() | @b AVX2 | 64 | 59.4 GB/s | 133.1 | + * | MeowHash | AES-NI | 128 | 58.2 GB/s | 52.5 | + * | XXH3_128bits() | @b AVX2 | 128 | 57.9 GB/s | 118.1 | + * | CLHash | PCLMUL | 64 | 37.1 GB/s | 58.1 | + * | XXH3_64bits() | @b SSE2 | 64 | 31.5 GB/s | 133.1 | + * | XXH3_128bits() | @b SSE2 | 128 | 29.6 GB/s | 118.1 | + * | RAM sequential read | | N/A | 28.0 GB/s | N/A | + * | ahash | AES-NI | 64 | 22.5 GB/s | 107.2 | + * | City64 | | 64 | 22.0 GB/s | 76.6 | + * | T1ha2 | | 64 | 22.0 GB/s | 99.0 | + * | City128 | | 128 | 21.7 GB/s | 57.7 | + * | FarmHash | AES-NI | 64 | 21.3 GB/s | 71.9 | + * | XXH64() | | 64 | 19.4 GB/s | 71.0 | + * | SpookyHash | | 64 | 19.3 GB/s | 53.2 | + * | Mum | | 64 | 18.0 GB/s | 67.0 | + * | CRC32C | SSE4.2 | 32 | 13.0 GB/s | 57.9 | + * | XXH32() | | 32 | 9.7 GB/s | 71.9 | + * | City32 | | 32 | 9.1 GB/s | 66.0 | + * | Blake3* | @b AVX2 | 256 | 4.4 GB/s | 8.1 | + * | Murmur3 | | 32 | 3.9 GB/s | 56.1 | + * | SipHash* | | 64 | 3.0 GB/s | 43.2 | + * | Blake3* | @b SSE2 | 256 | 2.4 GB/s | 8.1 | + * | HighwayHash | | 64 | 1.4 GB/s | 6.0 | + * | FNV64 | | 64 | 1.2 GB/s | 62.7 | + * | Blake2* | | 256 | 1.1 GB/s | 5.1 | + * | SHA1* | | 160 | 0.8 GB/s | 5.6 | + * | MD5* | | 128 | 0.6 GB/s | 7.8 | + * @note + * - Hashes which require a specific ISA extension are noted. SSE2 is also noted, + * even though it is mandatory on x64. + * - Hashes with an asterisk are cryptographic. Note that MD5 is non-cryptographic + * by modern standards. + * - Small data velocity is a rough average of algorithm's efficiency for small + * data. For more accurate information, see the wiki. + * - More benchmarks and strength tests are found on the wiki: + * https://github.com/Cyan4973/xxHash/wiki + * + * Usage + * ------ + * All xxHash variants use a similar API. Changing the algorithm is a trivial + * substitution. + * + * @pre + * For functions which take an input and length parameter, the following + * requirements are assumed: + * - The range from [`input`, `input + length`) is valid, readable memory. + * - The only exception is if the `length` is `0`, `input` may be `NULL`. + * - For C++, the objects must have the *TriviallyCopyable* property, as the + * functions access bytes directly as if it was an array of `unsigned char`. + * + * @anchor single_shot_example + * **Single Shot** + * + * These functions are stateless functions which hash a contiguous block of memory, + * immediately returning the result. They are the easiest and usually the fastest + * option. + * + * XXH32(), XXH64(), XXH3_64bits(), XXH3_128bits() + * + * @code{.c} + * #include + * #include "xxhash.h" + * + * // Example for a function which hashes a null terminated string with XXH32(). + * XXH32_hash_t hash_string(const char* string, XXH32_hash_t seed) + * { + * // NULL pointers are only valid if the length is zero + * size_t length = (string == NULL) ? 0 : strlen(string); + * return XXH32(string, length, seed); + * } + * @endcode + * + * @anchor streaming_example + * **Streaming** + * + * These groups of functions allow incremental hashing of unknown size, even + * more than what would fit in a size_t. + * + * XXH32_reset(), XXH64_reset(), XXH3_64bits_reset(), XXH3_128bits_reset() + * + * @code{.c} + * #include + * #include + * #include "xxhash.h" + * // Example for a function which hashes a FILE incrementally with XXH3_64bits(). + * XXH64_hash_t hashFile(FILE* f) + * { + * // Allocate a state struct. Do not just use malloc() or new. + * XXH3_state_t* state = XXH3_createState(); + * assert(state != NULL && "Out of memory!"); + * // Reset the state to start a new hashing session. + * XXH3_64bits_reset(state); + * char buffer[4096]; + * size_t count; + * // Read the file in chunks + * while ((count = fread(buffer, 1, sizeof(buffer), f)) != 0) { + * // Run update() as many times as necessary to process the data + * XXH3_64bits_update(state, buffer, count); + * } + * // Retrieve the finalized hash. This will not change the state. + * XXH64_hash_t result = XXH3_64bits_digest(state); + * // Free the state. Do not use free(). + * XXH3_freeState(state); + * return result; + * } + * @endcode + * * @file xxhash.h * xxHash prototypes and implementation */ -/* TODO: update */ -/* Notice extracted from xxHash homepage: - -xxHash is an extremely fast hash algorithm, running at RAM speed limits. -It also successfully passes all tests from the SMHasher suite. - -Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) - -Name Speed Q.Score Author -xxHash 5.4 GB/s 10 -CrapWow 3.2 GB/s 2 Andrew -MurmurHash 3a 2.7 GB/s 10 Austin Appleby -SpookyHash 2.0 GB/s 10 Bob Jenkins -SBox 1.4 GB/s 9 Bret Mulvey -Lookup3 1.2 GB/s 9 Bob Jenkins -SuperFastHash 1.2 GB/s 1 Paul Hsieh -CityHash64 1.05 GB/s 10 Pike & Alakuijala -FNV 0.55 GB/s 5 Fowler, Noll, Vo -CRC32 0.43 GB/s 9 -MD5-32 0.33 GB/s 10 Ronald L. Rivest -SHA1-32 0.28 GB/s 10 - -Q.Score is a measure of quality of the hash function. -It depends on successfully passing SMHasher test set. -10 is a perfect score. - -Note: SMHasher's CRC32 implementation is not the fastest one. -Other speed-oriented implementations can be faster, -especially in combination with PCLMUL instruction: -https://fastcompression.blogspot.com/2019/03/presenting-xxh3.html?showComment=1552696407071#c3490092340461170735 - -A 64-bit version, named XXH64, is available since r35. -It offers much better speed, but for 64-bit applications only. -Name Speed on 64 bits Speed on 32 bits -XXH64 13.8 GB/s 1.9 GB/s -XXH32 6.8 GB/s 6.0 GB/s -*/ #if defined (__cplusplus) extern "C" { @@ -84,21 +177,80 @@ extern "C" { * INLINE mode ******************************/ /*! - * XXH_INLINE_ALL (and XXH_PRIVATE_API) + * @defgroup public Public API + * Contains details on the public xxHash functions. + * @{ + */ +#ifdef XXH_DOXYGEN +/*! + * @brief Gives access to internal state declaration, required for static allocation. + * + * Incompatible with dynamic linking, due to risks of ABI changes. + * + * Usage: + * @code{.c} + * #define XXH_STATIC_LINKING_ONLY + * #include "xxhash.h" + * @endcode + */ +# define XXH_STATIC_LINKING_ONLY +/* Do not undef XXH_STATIC_LINKING_ONLY for Doxygen */ + +/*! + * @brief Gives access to internal definitions. + * + * Usage: + * @code{.c} + * #define XXH_STATIC_LINKING_ONLY + * #define XXH_IMPLEMENTATION + * #include "xxhash.h" + * @endcode + */ +# define XXH_IMPLEMENTATION +/* Do not undef XXH_IMPLEMENTATION for Doxygen */ + +/*! + * @brief Exposes the implementation and marks all functions as `inline`. + * * Use these build macros to inline xxhash into the target unit. * Inlining improves performance on small inputs, especially when the length is * expressed as a compile-time constant: * - * https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html + * https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html * * It also keeps xxHash symbols private to the unit, so they are not exported. * * Usage: + * @code{.c} * #define XXH_INLINE_ALL * #include "xxhash.h" - * + * @endcode * Do not compile and link xxhash.o as a separate object, as it is not useful. */ +# define XXH_INLINE_ALL +# undef XXH_INLINE_ALL +/*! + * @brief Exposes the implementation without marking functions as inline. + */ +# define XXH_PRIVATE_API +# undef XXH_PRIVATE_API +/*! + * @brief Emulate a namespace by transparently prefixing all symbols. + * + * If you want to include _and expose_ xxHash functions from within your own + * library, but also want to avoid symbol collisions with other libraries which + * may also include xxHash, you can use @ref XXH_NAMESPACE to automatically prefix + * any public symbol from xxhash library with the value of @ref XXH_NAMESPACE + * (therefore, avoid empty or numeric values). + * + * Note that no change is required within the calling program as long as it + * includes `xxhash.h`: Regular symbol names will be automatically translated + * by this header. + */ +# define XXH_NAMESPACE /* YOUR NAME HERE */ +# undef XXH_NAMESPACE +#endif + #if (defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API)) \ && !defined(XXH_INLINE_ALL_31684351384) /* this section should be traversed only once */ @@ -213,23 +365,15 @@ extern "C" { # undef XXHASH_H_STATIC_13879238742 #endif /* XXH_INLINE_ALL || XXH_PRIVATE_API */ - - /* **************************************************************** * Stable API *****************************************************************/ #ifndef XXHASH_H_5627135585666179 #define XXHASH_H_5627135585666179 1 - -/*! - * @defgroup public Public API - * Contains details on the public xxHash functions. - * @{ - */ -/* specific declaration modes for Windows */ +/*! @brief Marks a global symbol. */ #if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API) -# if defined(_WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) +# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) # ifdef XXH_EXPORT # define XXH_PUBLIC_API __declspec(dllexport) # elif XXH_IMPORT @@ -240,24 +384,6 @@ extern "C" { # endif #endif -#ifdef XXH_DOXYGEN -/*! - * @brief Emulate a namespace by transparently prefixing all symbols. - * - * If you want to include _and expose_ xxHash functions from within your own - * library, but also want to avoid symbol collisions with other libraries which - * may also include xxHash, you can use XXH_NAMESPACE to automatically prefix - * any public symbol from xxhash library with the value of XXH_NAMESPACE - * (therefore, avoid empty or numeric values). - * - * Note that no change is required within the calling program as long as it - * includes `xxhash.h`: Regular symbol names will be automatically translated - * by this header. - */ -# define XXH_NAMESPACE /* YOUR NAME HERE */ -# undef XXH_NAMESPACE -#endif - #ifdef XXH_NAMESPACE # define XXH_CAT(A,B) A##B # define XXH_NAME2(A,B) XXH_CAT(A,B) @@ -317,12 +443,40 @@ extern "C" { #endif +/* ************************************* +* Compiler specifics +***************************************/ + +/* specific declaration modes for Windows */ +#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API) +# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) +# ifdef XXH_EXPORT +# define XXH_PUBLIC_API __declspec(dllexport) +# elif XXH_IMPORT +# define XXH_PUBLIC_API __declspec(dllimport) +# endif +# else +# define XXH_PUBLIC_API /* do nothing */ +# endif +#endif + +#if defined (__GNUC__) +# define XXH_CONSTF __attribute__((const)) +# define XXH_PUREF __attribute__((pure)) +# define XXH_MALLOCF __attribute__((malloc)) +#else +# define XXH_CONSTF /* disable */ +# define XXH_PUREF +# define XXH_MALLOCF +#endif + /* ************************************* * Version ***************************************/ #define XXH_VERSION_MAJOR 0 #define XXH_VERSION_MINOR 8 -#define XXH_VERSION_RELEASE 1 +#define XXH_VERSION_RELEASE 2 +/*! @brief Version number, encoded as two digits each */ #define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) /*! @@ -331,16 +485,22 @@ extern "C" { * This is mostly useful when xxHash is compiled as a shared library, * since the returned value comes from the library, as opposed to header file. * - * @return `XXH_VERSION_NUMBER` of the invoked library. + * @return @ref XXH_VERSION_NUMBER of the invoked library. */ -XXH_PUBLIC_API unsigned XXH_versionNumber (void); +XXH_PUBLIC_API XXH_CONSTF unsigned XXH_versionNumber (void); /* **************************** * Common basic types ******************************/ #include /* size_t */ -typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; +/*! + * @brief Exit code for the streaming API. + */ +typedef enum { + XXH_OK = 0, /*!< OK */ + XXH_ERROR /*!< Error */ +} XXH_errorcode; /*-********************************************************************** @@ -364,29 +524,27 @@ typedef uint32_t XXH32_hash_t; # include # if UINT_MAX == 0xFFFFFFFFUL typedef unsigned int XXH32_hash_t; +# elif ULONG_MAX == 0xFFFFFFFFUL + typedef unsigned long XXH32_hash_t; # else -# if ULONG_MAX == 0xFFFFFFFFUL - typedef unsigned long XXH32_hash_t; -# else -# error "unsupported platform: need a 32-bit type" -# endif +# error "unsupported platform: need a 32-bit type" # endif #endif /*! * @} * - * @defgroup xxh32_family XXH32 family + * @defgroup XXH32_family XXH32 family * @ingroup public * Contains functions used in the classic 32-bit xxHash algorithm. * * @note * XXH32 is useful for older platforms, with no or poor 64-bit performance. - * Note that @ref xxh3_family provides competitive speed - * for both 32-bit and 64-bit systems, and offers true 64/128 bit hash results. + * Note that the @ref XXH3_family provides competitive speed for both 32-bit + * and 64-bit systems, and offers true 64/128 bit hash results. * - * @see @ref xxh64_family, @ref xxh3_family : Other xxHash families - * @see @ref xxh32_impl for implementation details + * @see @ref XXH64_family, @ref XXH3_family : Other xxHash families + * @see @ref XXH32_impl for implementation details * @{ */ @@ -395,6 +553,8 @@ typedef uint32_t XXH32_hash_t; * * Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark): 5.4 GB/s * + * See @ref single_shot_example "Single Shot Example" for an example. + * * @param input The block of data to be hashed, at least @p length bytes in size. * @param length The length of @p input, in bytes. * @param seed The 32-bit seed to alter the hash's output predictably. @@ -412,8 +572,9 @@ typedef uint32_t XXH32_hash_t; * @see * XXH32_createState(), XXH32_update(), XXH32_digest(): Streaming version. */ -XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed); +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed); +#ifndef XXH_NO_STREAM /*! * Streaming functions generate the xxHash value from an incremental input. * This method is slower than single-call functions, due to state management. @@ -436,32 +597,7 @@ XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_ * * When done, release the state using `XXH*_freeState()`. * - * Example code for incrementally hashing a file: - * @code{.c} - * #include - * #include - * #define BUFFER_SIZE 256 - * - * // Note: XXH64 and XXH3 use the same interface. - * XXH32_hash_t - * hashFile(FILE* stream) - * { - * XXH32_state_t* state; - * unsigned char buf[BUFFER_SIZE]; - * size_t amt; - * XXH32_hash_t hash; - * - * state = XXH32_createState(); // Create a state - * assert(state != NULL); // Error check here - * XXH32_reset(state, 0xbaad5eed); // Reset state with our seed - * while ((amt = fread(buf, 1, sizeof(buf), stream)) != 0) { - * XXH32_update(state, buf, amt); // Hash the file in chunks - * } - * hash = XXH32_digest(state); // Finalize the hash - * XXH32_freeState(state); // Clean up - * return hash; - * } - * @endcode + * @see streaming_example at the top of @ref xxhash.h for an example. */ /*! @@ -478,7 +614,7 @@ typedef struct XXH32_state_s XXH32_state_t; * Must be freed with XXH32_freeState(). * @return An allocated XXH32_state_t on success, `NULL` on failure. */ -XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); +XXH_PUBLIC_API XXH_MALLOCF XXH32_state_t* XXH32_createState(void); /*! * @brief Frees an @ref XXH32_state_t. * @@ -546,7 +682,8 @@ XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* * * @return The calculated xxHash32 value from that state. */ -XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ /******* Canonical representation *******/ @@ -597,43 +734,72 @@ XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t * * @return The converted hash. */ -XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); +/*! @cond Doxygen ignores this part */ #ifdef __has_attribute # define XXH_HAS_ATTRIBUTE(x) __has_attribute(x) #else # define XXH_HAS_ATTRIBUTE(x) 0 #endif +/*! @endcond */ +/*! @cond Doxygen ignores this part */ +/* + * C23 __STDC_VERSION__ number hasn't been specified yet. For now + * leave as `201711L` (C17 + 1). + * TODO: Update to correct value when its been specified. + */ +#define XXH_C23_VN 201711L +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ /* C-language Attributes are added in C23. */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201710L) && defined(__has_c_attribute) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN) && defined(__has_c_attribute) # define XXH_HAS_C_ATTRIBUTE(x) __has_c_attribute(x) #else # define XXH_HAS_C_ATTRIBUTE(x) 0 #endif +/*! @endcond */ +/*! @cond Doxygen ignores this part */ #if defined(__cplusplus) && defined(__has_cpp_attribute) # define XXH_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) #else # define XXH_HAS_CPP_ATTRIBUTE(x) 0 #endif +/*! @endcond */ +/*! @cond Doxygen ignores this part */ /* -Define XXH_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute -introduced in CPP17 and C23. -CPP17 : https://en.cppreference.com/w/cpp/language/attributes/fallthrough -C23 : https://en.cppreference.com/w/c/language/attributes/fallthrough -*/ -#if XXH_HAS_C_ATTRIBUTE(x) -# define XXH_FALLTHROUGH [[fallthrough]] -#elif XXH_HAS_CPP_ATTRIBUTE(x) + * Define XXH_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute + * introduced in CPP17 and C23. + * CPP17 : https://en.cppreference.com/w/cpp/language/attributes/fallthrough + * C23 : https://en.cppreference.com/w/c/language/attributes/fallthrough + */ +#if XXH_HAS_C_ATTRIBUTE(fallthrough) || XXH_HAS_CPP_ATTRIBUTE(fallthrough) # define XXH_FALLTHROUGH [[fallthrough]] #elif XXH_HAS_ATTRIBUTE(__fallthrough__) -# define XXH_FALLTHROUGH __attribute__ ((fallthrough)) +# define XXH_FALLTHROUGH __attribute__ ((__fallthrough__)) #else -# define XXH_FALLTHROUGH +# define XXH_FALLTHROUGH /* fallthrough */ #endif +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +/* + * Define XXH_NOESCAPE for annotated pointers in public API. + * https://clang.llvm.org/docs/AttributeReference.html#noescape + * As of writing this, only supported by clang. + */ +#if XXH_HAS_ATTRIBUTE(noescape) +# define XXH_NOESCAPE __attribute__((noescape)) +#else +# define XXH_NOESCAPE +#endif +/*! @endcond */ + /*! * @} @@ -671,7 +837,7 @@ typedef uint64_t XXH64_hash_t; /*! * @} * - * @defgroup xxh64_family XXH64 family + * @defgroup XXH64_family XXH64 family * @ingroup public * @{ * Contains functions used in the classic 64-bit xxHash algorithm. @@ -682,7 +848,6 @@ typedef uint64_t XXH64_hash_t; * It provides better speed for systems with vector processing capabilities. */ - /*! * @brief Calculates the 64-bit hash of @p input using xxHash64. * @@ -706,32 +871,131 @@ typedef uint64_t XXH64_hash_t; * @see * XXH64_createState(), XXH64_update(), XXH64_digest(): Streaming version. */ -XXH_PUBLIC_API XXH64_hash_t XXH64(const void* input, size_t length, XXH64_hash_t seed); +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed); /******* Streaming *******/ +#ifndef XXH_NO_STREAM /*! * @brief The opaque state struct for the XXH64 streaming API. * * @see XXH64_state_s for details. */ typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ -XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); + +/*! + * @brief Allocates an @ref XXH64_state_t. + * + * Must be freed with XXH64_freeState(). + * @return An allocated XXH64_state_t on success, `NULL` on failure. + */ +XXH_PUBLIC_API XXH_MALLOCF XXH64_state_t* XXH64_createState(void); + +/*! + * @brief Frees an @ref XXH64_state_t. + * + * Must be allocated with XXH64_createState(). + * @param statePtr A pointer to an @ref XXH64_state_t allocated with @ref XXH64_createState(). + * @return XXH_OK. + */ XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); -XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state); -XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, XXH64_hash_t seed); -XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); -XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); +/*! + * @brief Copies one @ref XXH64_state_t to another. + * + * @param dst_state The state to copy to. + * @param src_state The state to copy from. + * @pre + * @p dst_state and @p src_state must not be `NULL` and must not overlap. + */ +XXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dst_state, const XXH64_state_t* src_state); +/*! + * @brief Resets an @ref XXH64_state_t to begin a new hash. + * + * This function resets and seeds a state. Call it before @ref XXH64_update(). + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + */ +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed); + +/*! + * @brief Consumes a block of @p input to an @ref XXH64_state_t. + * + * Call this to incrementally consume blocks of data. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + */ +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH_NOESCAPE XXH64_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Returns the calculated hash value from an @ref XXH64_state_t. + * + * @note + * Calling XXH64_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated xxHash64 value from that state. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_digest (XXH_NOESCAPE const XXH64_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ /******* Canonical representation *******/ + +/*! + * @brief Canonical (big endian) representation of @ref XXH64_hash_t. + */ typedef struct { unsigned char digest[sizeof(XXH64_hash_t)]; } XXH64_canonical_t; -XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); -XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); + +/*! + * @brief Converts an @ref XXH64_hash_t to a big endian @ref XXH64_canonical_t. + * + * @param dst The @ref XXH64_canonical_t pointer to be stored to. + * @param hash The @ref XXH64_hash_t to be converted. + * + * @pre + * @p dst must not be `NULL`. + */ +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash); + +/*! + * @brief Converts an @ref XXH64_canonical_t to a native @ref XXH64_hash_t. + * + * @param src The @ref XXH64_canonical_t to convert. + * + * @pre + * @p src must not be `NULL`. + * + * @return The converted hash. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src); + +#ifndef XXH_NO_XXH3 /*! * @} * ************************************************************************ - * @defgroup xxh3_family XXH3 family + * @defgroup XXH3_family XXH3 family * @ingroup public * @{ * @@ -751,16 +1015,26 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src * * XXH3's speed benefits greatly from SIMD and 64-bit arithmetic, * but does not require it. - * Any 32-bit and 64-bit targets that can run XXH32 smoothly - * can run XXH3 at competitive speeds, even without vector support. - * Further details are explained in the implementation. - * - * Optimized implementations are provided for AVX512, AVX2, SSE2, NEON, POWER8, - * ZVector and scalar targets. This can be controlled via the XXH_VECTOR macro. + * Most 32-bit and 64-bit targets that can run XXH32 smoothly can run XXH3 + * at competitive speeds, even without vector support. Further details are + * explained in the implementation. + * + * XXH3 has a fast scalar implementation, but it also includes accelerated SIMD + * implementations for many common platforms: + * - AVX512 + * - AVX2 + * - SSE2 + * - ARM NEON + * - WebAssembly SIMD128 + * - POWER8 VSX + * - s390x ZVector + * This can be controlled via the @ref XXH_VECTOR macro, but it automatically + * selects the best version according to predefined macros. For the x86 family, an + * automatic runtime dispatcher is included separately in @ref xxh_x86dispatch.c. * * XXH3 implementation is portable: * it has a generic C90 formulation that can be compiled on any platform, - * all implementations generage exactly the same hash value on all platforms. + * all implementations generate exactly the same hash value on all platforms. * Starting from v0.8.0, it's also labelled "stable", meaning that * any future version will also generate the same hash value. * @@ -772,24 +1046,42 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src * * The API supports one-shot hashing, streaming mode, and custom secrets. */ - /*-********************************************************************** * XXH3 64-bit variant ************************************************************************/ -/* XXH3_64bits(): - * default 64-bit variant, using default secret and default seed of 0. - * It's the fastest variant. */ -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* data, size_t len); +/*! + * @brief 64-bit unseeded variant of XXH3. + * + * This is equivalent to @ref XXH3_64bits_withSeed() with a seed of 0, however + * it may have slightly better performance due to constant propagation of the + * defaults. + * + * @see + * XXH32(), XXH64(), XXH3_128bits(): equivalent for the other xxHash algorithms + * @see + * XXH3_64bits_withSeed(), XXH3_64bits_withSecret(): other seeding variants + * @see + * XXH3_64bits_reset(), XXH3_64bits_update(), XXH3_64bits_digest(): Streaming version. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length); -/* - * XXH3_64bits_withSeed(): - * This variant generates a custom secret on the fly - * based on default secret altered using the `seed` value. +/*! + * @brief 64-bit seeded variant of XXH3 + * + * This variant generates a custom secret on the fly based on default secret + * altered using the `seed` value. + * * While this operation is decently fast, note that it's not completely free. - * Note: seed==0 produces the same results as XXH3_64bits(). + * + * @note + * seed == 0 produces the same results as @ref XXH3_64bits(). + * + * @param input The data to hash + * @param length The length + * @param seed The 64-bit seed to alter the state. */ -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, XXH64_hash_t seed); +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed); /*! * The bare minimum size for a custom secret. @@ -800,8 +1092,9 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, X */ #define XXH3_SECRET_SIZE_MIN 136 -/* - * XXH3_64bits_withSecret(): +/*! + * @brief 64-bit variant of XXH3 with a custom "secret". + * * It's possible to provide any blob of bytes as a "secret" to generate the hash. * This makes it more difficult for an external actor to prepare an intentional collision. * The main condition is that secretSize *must* be large enough (>= XXH3_SECRET_SIZE_MIN). @@ -817,10 +1110,11 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, X * This is not necessarily the case when using the blob of bytes directly * because, when hashing _small_ inputs, only a portion of the secret is employed. */ -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize); +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize); /******* Streaming *******/ +#ifndef XXH_NO_STREAM /* * Streaming requires state maintenance. * This operation costs memory and CPU. @@ -834,23 +1128,53 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret(const void* data, size_t len, * @see XXH3_state_s for details. */ typedef struct XXH3_state_s XXH3_state_t; -XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void); +XXH_PUBLIC_API XXH_MALLOCF XXH3_state_t* XXH3_createState(void); XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr); -XXH_PUBLIC_API void XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state); -/* - * XXH3_64bits_reset(): - * Initialize with default parameters. - * digest will be equivalent to `XXH3_64bits()`. +/*! + * @brief Copies one @ref XXH3_state_t to another. + * + * @param dst_state The state to copy to. + * @param src_state The state to copy from. + * @pre + * @p dst_state and @p src_state must not be `NULL` and must not overlap. */ -XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH3_state_t* statePtr); -/* - * XXH3_64bits_reset_withSeed(): - * Generate a custom secret from `seed`, and store it into `statePtr`. - * digest will be equivalent to `XXH3_64bits_withSeed()`. +XXH_PUBLIC_API void XXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state); + +/*! + * @brief Resets an @ref XXH3_state_t to begin a new hash. + * + * This function resets `statePtr` and generate a secret with default parameters. Call it before @ref XXH3_64bits_update(). + * Digest will be equivalent to `XXH3_64bits()`. + * + * @param statePtr The state struct to reset. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + * */ -XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed); -/* +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr); + +/*! + * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash. + * + * This function resets `statePtr` and generate a secret from `seed`. Call it before @ref XXH3_64bits_update(). + * Digest will be equivalent to `XXH3_64bits_withSeed()`. + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the state. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed); + +/*! * XXH3_64bits_reset_withSecret(): * `secret` is referenced, it _must outlive_ the hash streaming session. * Similar to one-shot API, `secretSize` must be >= `XXH3_SECRET_SIZE_MIN`, @@ -859,10 +1183,44 @@ XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, * When in doubt about the randomness of a candidate `secret`, * consider employing `XXH3_generateSecret()` instead (see below). */ -XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize); +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize); -XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH3_state_t* statePtr, const void* input, size_t length); -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* statePtr); +/*! + * @brief Consumes a block of @p input to an @ref XXH3_state_t. + * + * Call this to incrementally consume blocks of data. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Returns the calculated XXH3 64-bit hash value from an @ref XXH3_state_t. + * + * @note + * Calling XXH3_64bits_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated XXH3 64-bit hash value from that state. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ /* note : canonical representation of XXH3 is the same as XXH64 * since they both produce XXH64_hash_t values */ @@ -883,11 +1241,31 @@ typedef struct { XXH64_hash_t high64; /*!< `value >> 64` */ } XXH128_hash_t; -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* data, size_t len); -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed(const void* data, size_t len, XXH64_hash_t seed); -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize); +/*! + * @brief Unseeded 128-bit variant of XXH3 + * + * The 128-bit variant of XXH3 has more strength, but it has a bit of overhead + * for shorter inputs. + * + * This is equivalent to @ref XXH3_128bits_withSeed() with a seed of 0, however + * it may have slightly better performance due to constant propagation of the + * defaults. + * + * @see + * XXH32(), XXH64(), XXH3_64bits(): equivalent for the other xxHash algorithms + * @see + * XXH3_128bits_withSeed(), XXH3_128bits_withSecret(): other seeding variants + * @see + * XXH3_128bits_reset(), XXH3_128bits_update(), XXH3_128bits_digest(): Streaming version. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* data, size_t len); +/*! @brief Seeded 128-bit variant of XXH3. @see XXH3_64bits_withSeed(). */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSeed(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed); +/*! @brief Custom secret 128-bit variant of XXH3. @see XXH3_64bits_withSecret(). */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize); /******* Streaming *******/ +#ifndef XXH_NO_STREAM /* * Streaming requires state maintenance. * This operation costs memory and CPU. @@ -900,12 +1278,77 @@ XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSecret(const void* data, size_t le * All reset and streaming functions have same meaning as their 64-bit counterpart. */ -XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH3_state_t* statePtr); -XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed); -XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize); +/*! + * @brief Resets an @ref XXH3_state_t to begin a new hash. + * + * This function resets `statePtr` and generate a secret with default parameters. Call it before @ref XXH3_128bits_update(). + * Digest will be equivalent to `XXH3_128bits()`. + * + * @param statePtr The state struct to reset. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr); + +/*! + * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash. + * + * This function resets `statePtr` and generate a secret from `seed`. Call it before @ref XXH3_128bits_update(). + * Digest will be equivalent to `XXH3_128bits_withSeed()`. + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the state. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed); +/*! @brief Custom secret 128-bit variant of XXH3. @see XXH_64bits_reset_withSecret(). */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize); + +/*! + * @brief Consumes a block of @p input to an @ref XXH3_state_t. + * + * Call this to incrementally consume blocks of data. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success, @ref XXH_ERROR on failure. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); -XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update (XXH3_state_t* statePtr, const void* input, size_t length); -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* statePtr); +/*! + * @brief Returns the calculated XXH3 128-bit hash value from an @ref XXH3_state_t. + * + * @note + * Calling XXH3_128bits_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated XXH3 128-bit hash value from that state. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ /* Following helper functions make it possible to compare XXH128_hast_t values. * Since XXH128_hash_t is a structure, this capability is not offered by the language. @@ -915,26 +1358,48 @@ XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* statePtr); * XXH128_isEqual(): * Return: 1 if `h1` and `h2` are equal, 0 if they are not. */ -XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2); +XXH_PUBLIC_API XXH_PUREF int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2); /*! - * XXH128_cmp(): - * + * @brief Compares two @ref XXH128_hash_t * This comparator is compatible with stdlib's `qsort()`/`bsearch()`. * - * return: >0 if *h128_1 > *h128_2 - * =0 if *h128_1 == *h128_2 - * <0 if *h128_1 < *h128_2 + * @return: >0 if *h128_1 > *h128_2 + * =0 if *h128_1 == *h128_2 + * <0 if *h128_1 < *h128_2 */ -XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2); +XXH_PUBLIC_API XXH_PUREF int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2); /******* Canonical representation *******/ typedef struct { unsigned char digest[sizeof(XXH128_hash_t)]; } XXH128_canonical_t; -static zend_always_inline void XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash); -XXH_PUBLIC_API XXH128_hash_t XXH128_hashFromCanonical(const XXH128_canonical_t* src); +/*! + * @brief Converts an @ref XXH128_hash_t to a big endian @ref XXH128_canonical_t. + * + * @param dst The @ref XXH128_canonical_t pointer to be stored to. + * @param hash The @ref XXH128_hash_t to be converted. + * + * @pre + * @p dst must not be `NULL`. + */ +XXH_PUBLIC_API void XXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash); + +/*! + * @brief Converts an @ref XXH128_canonical_t to a native @ref XXH128_hash_t. + * + * @param src The @ref XXH128_canonical_t to convert. + * + * @pre + * @p src must not be `NULL`. + * + * @return The converted hash. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src); + + +#endif /* !XXH_NO_XXH3 */ #endif /* XXH_NO_LONG_LONG */ /*! @@ -978,7 +1443,7 @@ struct XXH32_state_s { XXH32_hash_t v[4]; /*!< Accumulator lanes */ XXH32_hash_t mem32[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */ XXH32_hash_t memsize; /*!< Amount of data in @ref mem32 */ - XXH32_hash_t reserved; /*!< Reserved field. Do not read or write to it, it may be removed. */ + XXH32_hash_t reserved; /*!< Reserved field. Do not read nor write to it. */ }; /* typedef'd to XXH32_state_t */ @@ -1002,9 +1467,11 @@ struct XXH64_state_s { XXH64_hash_t mem64[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[32]. */ XXH32_hash_t memsize; /*!< Amount of data in @ref mem64 */ XXH32_hash_t reserved32; /*!< Reserved field, needed for padding anyways*/ - XXH64_hash_t reserved64; /*!< Reserved field. Do not read or write to it, it may be removed. */ + XXH64_hash_t reserved64; /*!< Reserved field. Do not read or write to it. */ }; /* typedef'd to XXH64_state_t */ +#ifndef XXH_NO_XXH3 + #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */ # include # define XXH_ALIGN(n) alignas(n) @@ -1038,6 +1505,7 @@ struct XXH64_state_s { #define XXH3_INTERNALBUFFER_SIZE 256 /*! + * @internal * @brief Default size of the secret buffer (and @ref XXH3_kSecret). * * This is the size used in @ref XXH3_kSecret and the seeded functions. @@ -1070,7 +1538,7 @@ struct XXH64_state_s { */ struct XXH3_state_s { XXH_ALIGN_MEMBER(64, XXH64_hash_t acc[8]); - /*!< The 8 accumulators. Similar to `vN` in @ref XXH32_state_s::v1 and @ref XXH64_state_s */ + /*!< The 8 accumulators. See @ref XXH32_state_s::v and @ref XXH64_state_s::v */ XXH_ALIGN_MEMBER(64, unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]); /*!< Used to store a custom secret generated from a seed. */ XXH_ALIGN_MEMBER(64, unsigned char buffer[XXH3_INTERNALBUFFER_SIZE]); @@ -1110,69 +1578,119 @@ struct XXH3_state_s { * Note that this doesn't prepare the state for a streaming operation, * it's still necessary to use XXH3_NNbits_reset*() afterwards. */ -#define XXH3_INITSTATE(XXH3_state_ptr) { (XXH3_state_ptr)->seed = 0; } +#define XXH3_INITSTATE(XXH3_state_ptr) \ + do { \ + XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \ + tmp_xxh3_state_ptr->seed = 0; \ + tmp_xxh3_state_ptr->extSecret = NULL; \ + } while(0) -/* XXH128() : +/*! * simple alias to pre-selected XXH3_128bits variant */ -XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed); +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed); /* === Experimental API === */ /* Symbols defined below must be considered tied to a specific library version. */ -/* +/*! * XXH3_generateSecret(): * * Derive a high-entropy secret from any user-defined content, named customSeed. * The generated secret can be used in combination with `*_withSecret()` functions. - * The `_withSecret()` variants are useful to provide a higher level of protection than 64-bit seed, - * as it becomes much more difficult for an external actor to guess how to impact the calculation logic. + * The `_withSecret()` variants are useful to provide a higher level of protection + * than 64-bit seed, as it becomes much more difficult for an external actor to + * guess how to impact the calculation logic. * * The function accepts as input a custom seed of any length and any content, - * and derives from it a high-entropy secret of length @secretSize - * into an already allocated buffer @secretBuffer. - * @secretSize must be >= XXH3_SECRET_SIZE_MIN + * and derives from it a high-entropy secret of length @p secretSize into an + * already allocated buffer @p secretBuffer. * * The generated secret can then be used with any `*_withSecret()` variant. - * Functions `XXH3_128bits_withSecret()`, `XXH3_64bits_withSecret()`, - * `XXH3_128bits_reset_withSecret()` and `XXH3_64bits_reset_withSecret()` + * The functions @ref XXH3_128bits_withSecret(), @ref XXH3_64bits_withSecret(), + * @ref XXH3_128bits_reset_withSecret() and @ref XXH3_64bits_reset_withSecret() * are part of this list. They all accept a `secret` parameter - * which must be large enough for implementation reasons (>= XXH3_SECRET_SIZE_MIN) + * which must be large enough for implementation reasons (>= @ref XXH3_SECRET_SIZE_MIN) * _and_ feature very high entropy (consist of random-looking bytes). - * These conditions can be a high bar to meet, so - * XXH3_generateSecret() can be employed to ensure proper quality. + * These conditions can be a high bar to meet, so @ref XXH3_generateSecret() can + * be employed to ensure proper quality. * - * customSeed can be anything. It can have any size, even small ones, - * and its content can be anything, even "poor entropy" sources such as a bunch of zeroes. - * The resulting `secret` will nonetheless provide all required qualities. + * @p customSeed can be anything. It can have any size, even small ones, + * and its content can be anything, even "poor entropy" sources such as a bunch + * of zeroes. The resulting `secret` will nonetheless provide all required qualities. + * + * @pre + * - @p secretSize must be >= @ref XXH3_SECRET_SIZE_MIN + * - When @p customSeedSize > 0, supplying NULL as customSeed is undefined behavior. * - * When customSeedSize > 0, supplying NULL as customSeed is undefined behavior. + * Example code: + * @code{.c} + * #include + * #include + * #include + * #define XXH_STATIC_LINKING_ONLY // expose unstable API + * #include "xxhash.h" + * // Hashes argv[2] using the entropy from argv[1]. + * int main(int argc, char* argv[]) + * { + * char secret[XXH3_SECRET_SIZE_MIN]; + * if (argv != 3) { return 1; } + * XXH3_generateSecret(secret, sizeof(secret), argv[1], strlen(argv[1])); + * XXH64_hash_t h = XXH3_64bits_withSecret( + * argv[2], strlen(argv[2]), + * secret, sizeof(secret) + * ); + * printf("%016llx\n", (unsigned long long) h); + * } + * @endcode */ -XXH_PUBLIC_API XXH_errorcode XXH3_generateSecret(void* secretBuffer, size_t secretSize, const void* customSeed, size_t customSeedSize); - +XXH_PUBLIC_API XXH_errorcode XXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize); -/* - * XXH3_generateSecret_fromSeed(): - * - * Generate the same secret as the _withSeed() variants. - * - * The resulting secret has a length of XXH3_SECRET_DEFAULT_SIZE (necessarily). - * @secretBuffer must be already allocated, of size at least XXH3_SECRET_DEFAULT_SIZE bytes. +/*! + * @brief Generate the same secret as the _withSeed() variants. * * The generated secret can be used in combination with *`*_withSecret()` and `_withSecretandSeed()` variants. - * This generator is notably useful in combination with `_withSecretandSeed()`, - * as a way to emulate a faster `_withSeed()` variant. + * + * Example C++ `std::string` hash class: + * @code{.cpp} + * #include + * #define XXH_STATIC_LINKING_ONLY // expose unstable API + * #include "xxhash.h" + * // Slow, seeds each time + * class HashSlow { + * XXH64_hash_t seed; + * public: + * HashSlow(XXH64_hash_t s) : seed{s} {} + * size_t operator()(const std::string& x) const { + * return size_t{XXH3_64bits_withSeed(x.c_str(), x.length(), seed)}; + * } + * }; + * // Fast, caches the seeded secret for future uses. + * class HashFast { + * unsigned char secret[XXH3_SECRET_SIZE_MIN]; + * public: + * HashFast(XXH64_hash_t s) { + * XXH3_generateSecret_fromSeed(secret, seed); + * } + * size_t operator()(const std::string& x) const { + * return size_t{ + * XXH3_64bits_withSecret(x.c_str(), x.length(), secret, sizeof(secret)) + * }; + * } + * }; + * @endcode + * @param secretBuffer A writable buffer of @ref XXH3_SECRET_SIZE_MIN bytes + * @param seed The seed to seed the state. */ -XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed); +XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed); -/* - * *_withSecretandSeed() : +/*! * These variants generate hash values using either - * @seed for "short" keys (< XXH3_MIDSIZE_MAX = 240 bytes) - * or @secret for "large" keys (>= XXH3_MIDSIZE_MAX). + * @p seed for "short" keys (< XXH3_MIDSIZE_MAX = 240 bytes) + * or @p secret for "large" keys (>= XXH3_MIDSIZE_MAX). * * This generally benefits speed, compared to `_withSeed()` or `_withSecret()`. * `_withSeed()` has to generate the secret on the fly for "large" keys. @@ -1181,7 +1699,7 @@ XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_ * which requires more instructions than _withSeed() variants. * Therefore, _withSecretandSeed variant combines the best of both worlds. * - * When @secret has been generated by XXH3_generateSecret_fromSeed(), + * When @p secret has been generated by XXH3_generateSecret_fromSeed(), * this variant produces *exactly* the same results as `_withSeed()` variant, * hence offering only a pure speed benefit on "large" input, * by skipping the need to regenerate the secret for every large input. @@ -1190,32 +1708,34 @@ XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_ * for example with XXH3_64bits(), which then becomes the seed, * and then employ both the seed and the secret in _withSecretandSeed(). * On top of speed, an added benefit is that each bit in the secret - * has a 50% chance to swap each bit in the output, - * via its impact to the seed. + * has a 50% chance to swap each bit in the output, via its impact to the seed. + * * This is not guaranteed when using the secret directly in "small data" scenarios, * because only portions of the secret are employed for small data. */ -XXH_PUBLIC_API XXH64_hash_t -XXH3_64bits_withSecretandSeed(const void* data, size_t len, - const void* secret, size_t secretSize, +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t +XXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* data, size_t len, + XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed); - -XXH_PUBLIC_API XXH128_hash_t -XXH3_128bits_withSecretandSeed(const void* data, size_t len, - const void* secret, size_t secretSize, +/*! @copydoc XXH3_64bits_withSecretandSeed() */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t +XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length, + XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64); - +#ifndef XXH_NO_STREAM +/*! @copydoc XXH3_64bits_withSecretandSeed() */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_reset_withSecretandSeed(XXH3_state_t* statePtr, - const void* secret, size_t secretSize, +XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, + XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64); - +/*! @copydoc XXH3_64bits_withSecretandSeed() */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, - const void* secret, size_t secretSize, +XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, + XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64); +#endif /* !XXH_NO_STREAM */ - +#endif /* !XXH_NO_XXH3 */ #endif /* XXH_NO_LONG_LONG */ #if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) # define XXH_IMPLEMENTATION @@ -1269,7 +1789,7 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, /*! * @brief Define this to disable 64-bit code. * - * Useful if only using the @ref xxh32_family and you have a strict C90 compiler. + * Useful if only using the @ref XXH32_family and you have a strict C90 compiler. */ # define XXH_NO_LONG_LONG # undef XXH_NO_LONG_LONG /* don't actually */ @@ -1292,7 +1812,7 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, * Use `memcpy()`. Safe and portable. Note that most modern compilers will * eliminate the function call and treat it as an unaligned access. * - * - `XXH_FORCE_MEMORY_ACCESS=1`: `__attribute__((packed))` + * - `XXH_FORCE_MEMORY_ACCESS=1`: `__attribute__((aligned(1)))` * @par * Depends on compiler extensions and is therefore not portable. * This method is safe _if_ your compiler supports it, @@ -1312,19 +1832,47 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, * inline small `memcpy()` calls, and it might also be faster on big-endian * systems which lack a native byteswap instruction. However, some compilers * will emit literal byteshifts even if the target supports unaligned access. - * . + * * * @warning * Methods 1 and 2 rely on implementation-defined behavior. Use these with * care, as what works on one compiler/platform/optimization level may cause * another to read garbage data or even crash. * - * See http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html for details. + * See https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html for details. * * Prefer these methods in priority order (0 > 3 > 1 > 2) */ # define XXH_FORCE_MEMORY_ACCESS 0 +/*! + * @def XXH_SIZE_OPT + * @brief Controls how much xxHash optimizes for size. + * + * xxHash, when compiled, tends to result in a rather large binary size. This + * is mostly due to heavy usage to forced inlining and constant folding of the + * @ref XXH3_family to increase performance. + * + * However, some developers prefer size over speed. This option can + * significantly reduce the size of the generated code. When using the `-Os` + * or `-Oz` options on GCC or Clang, this is defined to 1 by default, + * otherwise it is defined to 0. + * + * Most of these size optimizations can be controlled manually. + * + * This is a number from 0-2. + * - `XXH_SIZE_OPT` == 0: Default. xxHash makes no size optimizations. Speed + * comes first. + * - `XXH_SIZE_OPT` == 1: Default for `-Os` and `-Oz`. xxHash is more + * conservative and disables hacks that increase code size. It implies the + * options @ref XXH_NO_INLINE_HINTS == 1, @ref XXH_FORCE_ALIGN_CHECK == 0, + * and @ref XXH3_NEON_LANES == 8 if they are not already defined. + * - `XXH_SIZE_OPT` == 2: xxHash tries to make itself as small as possible. + * Performance may cry. For example, the single shot functions just use the + * streaming API. + */ +# define XXH_SIZE_OPT 0 + /*! * @def XXH_FORCE_ALIGN_CHECK * @brief If defined to non-zero, adds a special path for aligned inputs (XXH32() @@ -1346,9 +1894,11 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, * * In these cases, the alignment check can be removed by setting this macro to 0. * Then the code will always use unaligned memory access. - * Align check is automatically disabled on x86, x64 & arm64, + * Align check is automatically disabled on x86, x64, ARM64, and some ARM chips * which are platforms known to offer good unaligned memory accesses performance. * + * It is also disabled by default when @ref XXH_SIZE_OPT >= 1. + * * This option does not affect XXH3 (only XXH32 and XXH64). */ # define XXH_FORCE_ALIGN_CHECK 0 @@ -1370,8 +1920,8 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, * XXH_NO_INLINE_HINTS marks all internal functions as static, giving the * compiler full control on whether to inline or not. * - * When not optimizing (-O0), optimizing for size (-Os, -Oz), or using - * -fno-inline with GCC or Clang, this will automatically be defined. + * When not optimizing (-O0), using `-fno-inline` with GCC or Clang, or if + * @ref XXH_SIZE_OPT >= 1, this will automatically be defined. */ # define XXH_NO_INLINE_HINTS 0 @@ -1413,34 +1963,45 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, */ # define XXH_OLD_NAMES # undef XXH_OLD_NAMES /* don't actually use, it is ugly. */ + +/*! + * @def XXH_NO_STREAM + * @brief Disables the streaming API. + * + * When xxHash is not inlined and the streaming functions are not used, disabling + * the streaming functions can improve code size significantly, especially with + * the @ref XXH3_family which tends to make constant folded copies of itself. + */ +# define XXH_NO_STREAM +# undef XXH_NO_STREAM /* don't actually */ #endif /* XXH_DOXYGEN */ /*! * @} */ #ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ - /* prefer __packed__ structures (method 1) for gcc on armv7+ and mips */ -# if !defined(__clang__) && \ -( \ - (defined(__INTEL_COMPILER) && !defined(_WIN32)) || \ - ( \ - defined(__GNUC__) && ( \ - (defined(__ARM_ARCH) && __ARM_ARCH >= 7) || \ - ( \ - defined(__mips__) && \ - (__mips <= 5 || __mips_isa_rev < 6) && \ - (!defined(__mips16) || defined(__mips_mips16e2)) \ - ) \ - ) \ - ) \ -) + /* prefer __packed__ structures (method 1) for GCC + * < ARMv7 with unaligned access (e.g. Raspbian armhf) still uses byte shifting, so we use memcpy + * which for some reason does unaligned loads. */ +# if defined(__GNUC__) && !(defined(__ARM_ARCH) && __ARM_ARCH < 7 && defined(__ARM_FEATURE_UNALIGNED)) # define XXH_FORCE_MEMORY_ACCESS 1 # endif #endif +#ifndef XXH_SIZE_OPT + /* default to 1 for -Os or -Oz */ +# if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE_SIZE__) +# define XXH_SIZE_OPT 1 +# else +# define XXH_SIZE_OPT 0 +# endif +#endif + #ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ -# if defined(__i386) || defined(__x86_64__) || defined(__aarch64__) \ - || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) /* visual */ + /* don't check on sizeopt, x86, aarch64, or arm when unaligned access is available */ +# if XXH_SIZE_OPT >= 1 || \ + defined(__i386) || defined(__x86_64__) || defined(__aarch64__) || defined(__ARM_FEATURE_UNALIGNED) \ + || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) || defined(_M_ARM) /* visual */ # define XXH_FORCE_ALIGN_CHECK 0 # else # define XXH_FORCE_ALIGN_CHECK 1 @@ -1448,8 +2009,7 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, #endif #ifndef XXH_NO_INLINE_HINTS -# if defined(__OPTIMIZE_SIZE__) /* -Os, -Oz */ \ - || defined(__NO_INLINE__) /* -O0, -fno-inline */ +# if XXH_SIZE_OPT >= 1 || defined(__NO_INLINE__) /* -O0, -fno-inline */ # define XXH_NO_INLINE_HINTS 1 # else # define XXH_NO_INLINE_HINTS 0 @@ -1479,6 +2039,24 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, /* ************************************* * Includes & Memory related functions ***************************************/ +#if defined(XXH_NO_STREAM) +/* nothing */ +#elif defined(XXH_NO_STDLIB) + +/* When requesting to disable any mention of stdlib, + * the library loses the ability to invoked malloc / free. + * In practice, it means that functions like `XXH*_createState()` + * will always fail, and return NULL. + * This flag is useful in situations where + * xxhash.h is integrated into some kernel, embedded or limited environment + * without access to dynamic allocation. + */ + +static XXH_CONSTF void* XXH_malloc(size_t s) { (void)s; return NULL; } +static void XXH_free(void* p) { (void)p; } + +#else + /* * Modify the local functions below should you wish to use * different memory routines for malloc() and free() @@ -1489,7 +2067,7 @@ XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, * @internal * @brief Modify this function to use a different routine than malloc(). */ -static void* XXH_malloc(size_t s) { return malloc(s); } +static XXH_MALLOCF void* XXH_malloc(size_t s) { return malloc(s); } /*! * @internal @@ -1497,6 +2075,8 @@ static void* XXH_malloc(size_t s) { return malloc(s); } */ static void XXH_free(void* p) { free(p); } +#endif /* XXH_NO_STDLIB */ + #include /*! @@ -1571,7 +2151,11 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) # include /* note: can still be disabled with NDEBUG */ # define XXH_ASSERT(c) assert(c) #else -# define XXH_ASSERT(c) ((void)0) +# if defined(__INTEL_COMPILER) +# define XXH_ASSERT(c) XXH_ASSUME((unsigned char) (c)) +# else +# define XXH_ASSERT(c) XXH_ASSUME(c) +# endif #endif /* note: use after variable declarations */ @@ -1603,11 +2187,19 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) * XXH3_initCustomSecret_scalar(). */ #if defined(__GNUC__) || defined(__clang__) -# define XXH_COMPILER_GUARD(var) __asm__ __volatile__("" : "+r" (var)) +# define XXH_COMPILER_GUARD(var) __asm__("" : "+r" (var)) #else # define XXH_COMPILER_GUARD(var) ((void)0) #endif +/* Specifically for NEON vectors which use the "w" constraint, on + * Clang. */ +#if defined(__clang__) && defined(__ARM_ARCH) && !defined(__wasm__) +# define XXH_COMPILER_GUARD_CLANG_NEON(var) __asm__("" : "+w" (var)) +#else +# define XXH_COMPILER_GUARD_CLANG_NEON(var) ((void)0) +#endif + /* ************************************* * Basic Types ***************************************/ @@ -1622,6 +2214,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) typedef XXH32_hash_t xxh_u32; #ifdef XXH_OLD_NAMES +# warning "XXH_OLD_NAMES is planned to be removed starting v0.9. If the program depends on it, consider moving away from it by employing newer type names directly" # define BYTE xxh_u8 # define U8 xxh_u8 # define U32 xxh_u32 @@ -1695,25 +2288,26 @@ static xxh_u32 XXH_read32(const void* memPtr) { return *(const xxh_u32*) memPtr; #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) /* - * __pack instructions are safer but compiler specific, hence potentially - * problematic for some compilers. - * - * Currently only defined for GCC and ICC. + * __attribute__((aligned(1))) is supported by gcc and clang. Originally the + * documentation claimed that it only increased the alignment, but actually it + * can decrease it on gcc, clang, and icc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502, + * https://gcc.godbolt.org/z/xYez1j67Y. */ #ifdef XXH_OLD_NAMES typedef union { xxh_u32 u32; } __attribute__((packed)) unalign; #endif static xxh_u32 XXH_read32(const void* ptr) { - typedef union { xxh_u32 u32; } __attribute__((packed)) xxh_unalign; - return ((const xxh_unalign*)ptr)->u32; + typedef __attribute__((aligned(1))) xxh_u32 xxh_unalign32; + return *((const xxh_unalign32*)ptr); } #else /* * Portable and safe solution. Generally efficient. - * see: http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html + * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html */ static xxh_u32 XXH_read32(const void* memPtr) { @@ -1789,6 +2383,51 @@ static int XXH_isLittleEndian(void) # define XXH_HAS_BUILTIN(x) 0 #endif + + +/* + * C23 and future versions have standard "unreachable()". + * Once it has been implemented reliably we can add it as an + * additional case: + * + * ``` + * #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN) + * # include + * # ifdef unreachable + * # define XXH_UNREACHABLE() unreachable() + * # endif + * #endif + * ``` + * + * Note C++23 also has std::unreachable() which can be detected + * as follows: + * ``` + * #if defined(__cpp_lib_unreachable) && (__cpp_lib_unreachable >= 202202L) + * # include + * # define XXH_UNREACHABLE() std::unreachable() + * #endif + * ``` + * NB: `__cpp_lib_unreachable` is defined in the `` header. + * We don't use that as including `` in `extern "C"` blocks + * doesn't work on GCC12 + */ + +#if XXH_HAS_BUILTIN(__builtin_unreachable) +# define XXH_UNREACHABLE() __builtin_unreachable() + +#elif defined(_MSC_VER) +# define XXH_UNREACHABLE() __assume(0) + +#else +# define XXH_UNREACHABLE() +#endif + +#if XXH_HAS_BUILTIN(__builtin_assume) +# define XXH_ASSUME(c) __builtin_assume(c) +#else +# define XXH_ASSUME(c) if (!(c)) { XXH_UNREACHABLE(); } +#endif + /*! * @internal * @def XXH_rotl32(x,r) @@ -1911,8 +2550,10 @@ XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } *********************************************************************/ /*! * @} - * @defgroup xxh32_impl XXH32 implementation + * @defgroup XXH32_impl XXH32 implementation * @ingroup impl + * + * Details on the XXH32 implementation. * @{ */ /* #define instead of static const, to be used as initializers */ @@ -1946,7 +2587,7 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input) acc += input * XXH_PRIME32_2; acc = XXH_rotl32(acc, 13); acc *= XXH_PRIME32_1; -#if (defined(__SSE4_1__) || defined(__aarch64__)) && !defined(XXH_ENABLE_AUTOVECTORIZE) +#if (defined(__SSE4_1__) || defined(__aarch64__) || defined(__wasm_simd128__)) && !defined(XXH_ENABLE_AUTOVECTORIZE) /* * UGLY HACK: * A compiler fence is the only thing that prevents GCC and Clang from @@ -1976,9 +2617,12 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input) * can load data, while v3 can multiply. SSE forces them to operate * together. * - * This is also enabled on AArch64, as Clang autovectorizes it incorrectly - * and it is pointless writing a NEON implementation that is basically the - * same speed as scalar for XXH32. + * This is also enabled on AArch64, as Clang is *very aggressive* in vectorizing + * the loop. NEON is only faster on the A53, and with the newer cores, it is less + * than half the speed. + * + * Additionally, this is used on WASM SIMD128 because it JITs to the same + * SIMD instructions and has the same issue. */ XXH_COMPILER_GUARD(acc); #endif @@ -1992,17 +2636,17 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input) * The final mix ensures that all input bits have a chance to impact any bit in * the output digest, resulting in an unbiased distribution. * - * @param h32 The hash to avalanche. + * @param hash The hash to avalanche. * @return The avalanched hash. */ -static xxh_u32 XXH32_avalanche(xxh_u32 h32) +static xxh_u32 XXH32_avalanche(xxh_u32 hash) { - h32 ^= h32 >> 15; - h32 *= XXH_PRIME32_2; - h32 ^= h32 >> 13; - h32 *= XXH_PRIME32_3; - h32 ^= h32 >> 16; - return(h32); + hash ^= hash >> 15; + hash *= XXH_PRIME32_2; + hash ^= hash >> 13; + hash *= XXH_PRIME32_3; + hash ^= hash >> 16; + return hash; } #define XXH_get32bits(p) XXH_readLE32_align(p, align) @@ -2015,24 +2659,25 @@ static xxh_u32 XXH32_avalanche(xxh_u32 h32) * This final stage will digest them to ensure that all input bytes are present * in the final mix. * - * @param h32 The hash to finalize. + * @param hash The hash to finalize. * @param ptr The pointer to the remaining input. * @param len The remaining length, modulo 16. * @param align Whether @p ptr is aligned. * @return The finalized hash. + * @see XXH64_finalize(). */ -static xxh_u32 -XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align) +static XXH_PUREF xxh_u32 +XXH32_finalize(xxh_u32 hash, const xxh_u8* ptr, size_t len, XXH_alignment align) { -#define XXH_PROCESS1 do { \ - h32 += (*ptr++) * XXH_PRIME32_5; \ - h32 = XXH_rotl32(h32, 11) * XXH_PRIME32_1; \ +#define XXH_PROCESS1 do { \ + hash += (*ptr++) * XXH_PRIME32_5; \ + hash = XXH_rotl32(hash, 11) * XXH_PRIME32_1; \ } while (0) -#define XXH_PROCESS4 do { \ - h32 += XXH_get32bits(ptr) * XXH_PRIME32_3; \ - ptr += 4; \ - h32 = XXH_rotl32(h32, 17) * XXH_PRIME32_4; \ +#define XXH_PROCESS4 do { \ + hash += XXH_get32bits(ptr) * XXH_PRIME32_3; \ + ptr += 4; \ + hash = XXH_rotl32(hash, 17) * XXH_PRIME32_4; \ } while (0) if (ptr==NULL) XXH_ASSERT(len == 0); @@ -2048,49 +2693,49 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align) XXH_PROCESS1; --len; } - return XXH32_avalanche(h32); + return XXH32_avalanche(hash); } else { switch(len&15) /* or switch(bEnd - p) */ { case 12: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 8: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 4: XXH_PROCESS4; - return XXH32_avalanche(h32); + return XXH32_avalanche(hash); case 13: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 9: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 5: XXH_PROCESS4; XXH_PROCESS1; - return XXH32_avalanche(h32); + return XXH32_avalanche(hash); case 14: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 10: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 6: XXH_PROCESS4; XXH_PROCESS1; XXH_PROCESS1; - return XXH32_avalanche(h32); + return XXH32_avalanche(hash); case 15: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 11: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 7: XXH_PROCESS4; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 3: XXH_PROCESS1; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 2: XXH_PROCESS1; - XXH_FALLTHROUGH; + XXH_FALLTHROUGH; /* fallthrough */ case 1: XXH_PROCESS1; - XXH_FALLTHROUGH; - case 0: return XXH32_avalanche(h32); + XXH_FALLTHROUGH; /* fallthrough */ + case 0: return XXH32_avalanche(hash); } XXH_ASSERT(0); - return h32; /* reaching this point is deemed impossible */ + return hash; /* reaching this point is deemed impossible */ } } @@ -2110,7 +2755,7 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align) * @param align Whether @p input is aligned. * @return The calculated hash. */ -XXH_FORCE_INLINE xxh_u32 +XXH_FORCE_INLINE XXH_PUREF xxh_u32 XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align) { xxh_u32 h32; @@ -2143,10 +2788,10 @@ XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment return XXH32_finalize(h32, input, len&15, align); } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t len, XXH32_hash_t seed) { -#if 0 +#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2 /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ XXH32_state_t state; XXH32_reset(&state, seed); @@ -2165,42 +2810,39 @@ XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t len, XXH32_hash_t s /******* Hash streaming *******/ -/*! - * @ingroup xxh32_family - */ +#ifndef XXH_NO_STREAM +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) { return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) { XXH_free(statePtr); return XXH_OK; } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState) { XXH_memcpy(dstState, srcState, sizeof(*dstState)); } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t seed) { - XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ - memset(&state, 0, sizeof(state)); - state.v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2; - state.v[1] = seed + XXH_PRIME32_2; - state.v[2] = seed + 0; - state.v[3] = seed - XXH_PRIME32_1; - /* do not write into reserved, planned to be removed in a future version */ - XXH_memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved)); + XXH_ASSERT(statePtr != NULL); + memset(statePtr, 0, sizeof(*statePtr)); + statePtr->v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2; + statePtr->v[1] = seed + XXH_PRIME32_2; + statePtr->v[2] = seed + 0; + statePtr->v[3] = seed - XXH_PRIME32_1; return XXH_OK; } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH_errorcode XXH32_update(XXH32_state_t* state, const void* input, size_t len) { @@ -2255,7 +2897,7 @@ XXH32_update(XXH32_state_t* state, const void* input, size_t len) } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH32_hash_t XXH32_digest(const XXH32_state_t* state) { xxh_u32 h32; @@ -2273,12 +2915,12 @@ XXH_PUBLIC_API XXH32_hash_t XXH32_digest(const XXH32_state_t* state) return XXH32_finalize(h32, (const xxh_u8*)state->mem32, state->memsize, XXH_aligned); } - +#endif /* !XXH_NO_STREAM */ /******* Canonical representation *******/ /*! - * @ingroup xxh32_family + * @ingroup XXH32_family * The default return values from XXH functions are unsigned 32 and 64 bit * integers. * @@ -2297,7 +2939,7 @@ XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); XXH_memcpy(dst, &hash, sizeof(*dst)); } -/*! @ingroup xxh32_family */ +/*! @ingroup XXH32_family */ XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) { return XXH_readBE32(src); @@ -2338,25 +2980,26 @@ static xxh_u64 XXH_read64(const void* memPtr) #elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) /* - * __pack instructions are safer, but compiler specific, hence potentially - * problematic for some compilers. - * - * Currently only defined for GCC and ICC. + * __attribute__((aligned(1))) is supported by gcc and clang. Originally the + * documentation claimed that it only increased the alignment, but actually it + * can decrease it on gcc, clang, and icc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502, + * https://gcc.godbolt.org/z/xYez1j67Y. */ #ifdef XXH_OLD_NAMES typedef union { xxh_u32 u32; xxh_u64 u64; } __attribute__((packed)) unalign64; #endif static xxh_u64 XXH_read64(const void* ptr) { - typedef union { xxh_u32 u32; xxh_u64 u64; } __attribute__((packed)) xxh_unalign64; - return ((const xxh_unalign64*)ptr)->u64; + typedef __attribute__((aligned(1))) xxh_u64 xxh_unalign64; + return *((const xxh_unalign64*)ptr); } #else /* * Portable and safe solution. Generally efficient. - * see: http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html + * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html */ static xxh_u64 XXH_read64(const void* memPtr) { @@ -2440,8 +3083,10 @@ XXH_readLE64_align(const void* ptr, XXH_alignment align) /******* xxh64 *******/ /*! * @} - * @defgroup xxh64_impl XXH64 implementation + * @defgroup XXH64_impl XXH64 implementation * @ingroup impl + * + * Details on the XXH64 implementation. * @{ */ /* #define rather that static const, to be used as initializers */ @@ -2459,6 +3104,7 @@ XXH_readLE64_align(const void* ptr, XXH_alignment align) # define PRIME64_5 XXH_PRIME64_5 #endif +/*! @copydoc XXH32_round */ static xxh_u64 XXH64_round(xxh_u64 acc, xxh_u64 input) { acc += input * XXH_PRIME64_2; @@ -2475,43 +3121,59 @@ static xxh_u64 XXH64_mergeRound(xxh_u64 acc, xxh_u64 val) return acc; } -static xxh_u64 XXH64_avalanche(xxh_u64 h64) +/*! @copydoc XXH32_avalanche */ +static xxh_u64 XXH64_avalanche(xxh_u64 hash) { - h64 ^= h64 >> 33; - h64 *= XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= XXH_PRIME64_3; - h64 ^= h64 >> 32; - return h64; + hash ^= hash >> 33; + hash *= XXH_PRIME64_2; + hash ^= hash >> 29; + hash *= XXH_PRIME64_3; + hash ^= hash >> 32; + return hash; } #define XXH_get64bits(p) XXH_readLE64_align(p, align) -static xxh_u64 -XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align) +/*! + * @internal + * @brief Processes the last 0-31 bytes of @p ptr. + * + * There may be up to 31 bytes remaining to consume from the input. + * This final stage will digest them to ensure that all input bytes are present + * in the final mix. + * + * @param hash The hash to finalize. + * @param ptr The pointer to the remaining input. + * @param len The remaining length, modulo 32. + * @param align Whether @p ptr is aligned. + * @return The finalized hash + * @see XXH32_finalize(). + */ +static XXH_PUREF xxh_u64 +XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align) { if (ptr==NULL) XXH_ASSERT(len == 0); len &= 31; while (len >= 8) { xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr)); ptr += 8; - h64 ^= k1; - h64 = XXH_rotl64(h64,27) * XXH_PRIME64_1 + XXH_PRIME64_4; + hash ^= k1; + hash = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4; len -= 8; } if (len >= 4) { - h64 ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1; + hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1; ptr += 4; - h64 = XXH_rotl64(h64, 23) * XXH_PRIME64_2 + XXH_PRIME64_3; + hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3; len -= 4; } while (len > 0) { - h64 ^= (*ptr++) * XXH_PRIME64_5; - h64 = XXH_rotl64(h64, 11) * XXH_PRIME64_1; + hash ^= (*ptr++) * XXH_PRIME64_5; + hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1; --len; } - return XXH64_avalanche(h64); + return XXH64_avalanche(hash); } #ifdef XXH_OLD_NAMES @@ -2524,7 +3186,15 @@ XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align) # undef XXH_PROCESS8_64 #endif -XXH_FORCE_INLINE xxh_u64 +/*! + * @internal + * @brief The implementation for @ref XXH64(). + * + * @param input , len , seed Directly passed from @ref XXH64(). + * @param align Whether @p input is aligned. + * @return The calculated hash. + */ +XXH_FORCE_INLINE XXH_PUREF xxh_u64 XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align) { xxh_u64 h64; @@ -2561,10 +3231,10 @@ XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment } -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t len, XXH64_hash_t seed) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64 (XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) { -#if 0 +#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2 /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ XXH64_state_t state; XXH64_reset(&state, seed); @@ -2582,42 +3252,40 @@ XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t len, XXH64_hash_t s } /******* Hash Streaming *******/ - -/*! @ingroup xxh64_family*/ +#ifndef XXH_NO_STREAM +/*! @ingroup XXH64_family*/ XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) { return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); } -/*! @ingroup xxh64_family */ +/*! @ingroup XXH64_family */ XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) { XXH_free(statePtr); return XXH_OK; } -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dstState, const XXH64_state_t* srcState) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dstState, const XXH64_state_t* srcState) { XXH_memcpy(dstState, srcState, sizeof(*dstState)); } -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, XXH64_hash_t seed) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed) { - XXH64_state_t state; /* use a local state to memcpy() in order to avoid strict-aliasing warnings */ - memset(&state, 0, sizeof(state)); - state.v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2; - state.v[1] = seed + XXH_PRIME64_2; - state.v[2] = seed + 0; - state.v[3] = seed - XXH_PRIME64_1; - /* do not write into reserved64, might be removed in a future version */ - XXH_memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved64)); + XXH_ASSERT(statePtr != NULL); + memset(statePtr, 0, sizeof(*statePtr)); + statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2; + statePtr->v[1] = seed + XXH_PRIME64_2; + statePtr->v[2] = seed + 0; + statePtr->v[3] = seed - XXH_PRIME64_1; return XXH_OK; } -/*! @ingroup xxh64_family */ +/*! @ingroup XXH64_family */ XXH_PUBLIC_API XXH_errorcode -XXH64_update (XXH64_state_t* state, const void* input, size_t len) +XXH64_update (XXH_NOESCAPE XXH64_state_t* state, XXH_NOESCAPE const void* input, size_t len) { if (input==NULL) { XXH_ASSERT(len == 0); @@ -2667,8 +3335,8 @@ XXH64_update (XXH64_state_t* state, const void* input, size_t len) } -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API XXH64_hash_t XXH64_digest(const XXH64_state_t* state) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64_digest(XXH_NOESCAPE const XXH64_state_t* state) { xxh_u64 h64; @@ -2686,20 +3354,20 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_digest(const XXH64_state_t* state) return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned); } - +#endif /* !XXH_NO_STREAM */ /******* Canonical representation *******/ -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash) { XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); XXH_memcpy(dst, &hash, sizeof(*dst)); } -/*! @ingroup xxh64_family */ -XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src) { return XXH_readBE64(src); } @@ -2712,7 +3380,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src ************************************************************************ */ /*! * @} - * @defgroup xxh3_impl XXH3 implementation + * @defgroup XXH3_impl XXH3 implementation * @ingroup impl * @{ */ @@ -2720,11 +3388,19 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src /* === Compiler specifics === */ #if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */ -# define XXH_RESTRICT /* disable */ +# define XXH_RESTRICT /* disable */ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */ # define XXH_RESTRICT restrict +#elif (defined (__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) \ + || (defined (__clang__)) \ + || (defined (_MSC_VER) && (_MSC_VER >= 1400)) \ + || (defined (__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300)) +/* + * There are a LOT more compilers that recognize __restrict but this + * covers the major ones. + */ +# define XXH_RESTRICT __restrict #else -/* Note: it might be useful to define __restrict or __restrict__ for some C++ compilers */ # define XXH_RESTRICT /* disable */ #endif @@ -2738,17 +3414,33 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src # define XXH_unlikely(x) (x) #endif -#if defined(__GNUC__) -# if defined(__AVX2__) -# include -# elif defined(__SSE2__) -# include -# elif defined(__ARM_NEON__) || defined(__ARM_NEON) +#ifndef XXH_HAS_INCLUDE +# ifdef __has_include +# define XXH_HAS_INCLUDE(x) __has_include(x) +# else +# define XXH_HAS_INCLUDE(x) 0 +# endif +#endif + +#if defined(__GNUC__) || defined(__clang__) +# if defined(__ARM_FEATURE_SVE) +# include +# endif +# if defined(__ARM_NEON__) || defined(__ARM_NEON) \ + || (defined(_M_ARM) && _M_ARM >= 7) \ + || defined(_M_ARM64) || defined(_M_ARM64EC) \ + || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE()) /* WASM SIMD128 via SIMDe */ # define inline __inline__ /* circumvent a clang bug */ # include # undef inline +# elif defined(__AVX2__) +# include +# elif defined(__SSE2__) +# include # endif -#elif defined(_MSC_VER) +#endif + +#if defined(_MSC_VER) # include #endif @@ -2848,7 +3540,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src * Note that these are actually implemented as macros. * * If this is not defined, it is detected automatically. - * @ref XXH_X86DISPATCH overrides this. + * internal macro XXH_X86DISPATCH overrides this. */ enum XXH_VECTOR_TYPE /* fake enum */ { XXH_SCALAR = 0, /*!< Portable scalar version */ @@ -2860,14 +3552,19 @@ enum XXH_VECTOR_TYPE /* fake enum */ { */ XXH_AVX2 = 2, /*!< AVX2 for Haswell and Bulldozer */ XXH_AVX512 = 3, /*!< AVX512 for Skylake and Icelake */ - XXH_NEON = 4, /*!< NEON for most ARMv7-A and all AArch64 */ + XXH_NEON = 4, /*!< + * NEON for most ARMv7-A, all AArch64, and WASM SIMD128 + * via the SIMDeverywhere polyfill provided with the + * Emscripten SDK. + */ XXH_VSX = 5, /*!< VSX and ZVector for POWER8/z13 (64-bit) */ + XXH_SVE = 6, /*!< SVE for some ARMv8-A and ARMv9-A */ }; /*! * @ingroup tuning * @brief Selects the minimum alignment for XXH3's accumulators. * - * When using SIMD, this should match the alignment reqired for said vector + * When using SIMD, this should match the alignment required for said vector * type, so, for example, 32 for AVX2. * * Default: Auto detected. @@ -2883,23 +3580,27 @@ enum XXH_VECTOR_TYPE /* fake enum */ { # define XXH_AVX512 3 # define XXH_NEON 4 # define XXH_VSX 5 +# define XXH_SVE 6 #endif #ifndef XXH_VECTOR /* can be defined on command line */ -# if defined(__AVX512F__) -# define XXH_VECTOR XXH_AVX512 -# elif defined(__AVX2__) -# define XXH_VECTOR XXH_AVX2 -# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2)) -# define XXH_VECTOR XXH_SSE2 +# if defined(__ARM_FEATURE_SVE) +# define XXH_VECTOR XXH_SVE # elif ( \ defined(__ARM_NEON__) || defined(__ARM_NEON) /* gcc */ \ - || defined(_M_ARM64) || defined(_M_ARM_ARMV7VE) /* msvc */ \ + || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) /* msvc */ \ + || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE()) /* wasm simd128 via SIMDe */ \ ) && ( \ defined(_WIN32) || defined(__LITTLE_ENDIAN__) /* little endian only */ \ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \ ) # define XXH_VECTOR XXH_NEON +# elif defined(__AVX512F__) +# define XXH_VECTOR XXH_AVX512 +# elif defined(__AVX2__) +# define XXH_VECTOR XXH_AVX2 +# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2)) +# define XXH_VECTOR XXH_SSE2 # elif (defined(__PPC64__) && defined(__POWER8_VECTOR__)) \ || (defined(__s390x__) && defined(__VEC__)) \ && defined(__GNUC__) /* TODO: IBM XL */ @@ -2909,6 +3610,17 @@ enum XXH_VECTOR_TYPE /* fake enum */ { # endif #endif +/* __ARM_FEATURE_SVE is only supported by GCC & Clang. */ +#if (XXH_VECTOR == XXH_SVE) && !defined(__ARM_FEATURE_SVE) +# ifdef _MSC_VER +# pragma warning(once : 4606) +# else +# warning "__ARM_FEATURE_SVE isn't supported. Use SCALAR instead." +# endif +# undef XXH_VECTOR +# define XXH_VECTOR XXH_SCALAR +#endif + /* * Controls the alignment of the accumulator, * for compatibility with aligned vector loads, which are usually faster. @@ -2928,16 +3640,26 @@ enum XXH_VECTOR_TYPE /* fake enum */ { # define XXH_ACC_ALIGN 16 # elif XXH_VECTOR == XXH_AVX512 /* avx512 */ # define XXH_ACC_ALIGN 64 +# elif XXH_VECTOR == XXH_SVE /* sve */ +# define XXH_ACC_ALIGN 64 # endif #endif #if defined(XXH_X86DISPATCH) || XXH_VECTOR == XXH_SSE2 \ || XXH_VECTOR == XXH_AVX2 || XXH_VECTOR == XXH_AVX512 # define XXH_SEC_ALIGN XXH_ACC_ALIGN +#elif XXH_VECTOR == XXH_SVE +# define XXH_SEC_ALIGN XXH_ACC_ALIGN #else # define XXH_SEC_ALIGN 8 #endif +#if defined(__GNUC__) || defined(__clang__) +# define XXH_ALIASING __attribute__((may_alias)) +#else +# define XXH_ALIASING /* nothing */ +#endif + /* * UGLY HACK: * GCC usually generates the best code with -O3 for xxHash. @@ -2961,111 +3683,130 @@ enum XXH_VECTOR_TYPE /* fake enum */ { */ #if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \ && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \ - && defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__) /* respect -O0 and -Os */ + && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */ # pragma GCC push_options # pragma GCC optimize("-O2") #endif - #if XXH_VECTOR == XXH_NEON + /* - * NEON's setup for vmlal_u32 is a little more complicated than it is on - * SSE2, AVX2, and VSX. - * - * While PMULUDQ and VMULEUW both perform a mask, VMLAL.U32 performs an upcast. - * - * To do the same operation, the 128-bit 'Q' register needs to be split into - * two 64-bit 'D' registers, performing this operation:: + * UGLY HACK: While AArch64 GCC on Linux does not seem to care, on macOS, GCC -O3 + * optimizes out the entire hashLong loop because of the aliasing violation. * - * [ a | b ] - * | '---------. .--------' | - * | x | - * | .---------' '--------. | - * [ a & 0xFFFFFFFF | b & 0xFFFFFFFF ],[ a >> 32 | b >> 32 ] - * - * Due to significant changes in aarch64, the fastest method for aarch64 is - * completely different than the fastest method for ARMv7-A. - * - * ARMv7-A treats D registers as unions overlaying Q registers, so modifying - * D11 will modify the high half of Q5. This is similar to how modifying AH - * will only affect bits 8-15 of AX on x86. - * - * VZIP takes two registers, and puts even lanes in one register and odd lanes - * in the other. + * However, GCC is also inefficient at load-store optimization with vld1q/vst1q, + * so the only option is to mark it as aliasing. + */ +typedef uint64x2_t xxh_aliasing_uint64x2_t XXH_ALIASING; + +/*! + * @internal + * @brief `vld1q_u64` but faster and alignment-safe. * - * On ARMv7-A, this strangely modifies both parameters in place instead of - * taking the usual 3-operand form. + * On AArch64, unaligned access is always safe, but on ARMv7-a, it is only + * *conditionally* safe (`vld1` has an alignment bit like `movdq[ua]` in x86). * - * Therefore, if we want to do this, we can simply use a D-form VZIP.32 on the - * lower and upper halves of the Q register to end up with the high and low - * halves where we want - all in one instruction. + * GCC for AArch64 sees `vld1q_u8` as an intrinsic instead of a load, so it + * prohibits load-store optimizations. Therefore, a direct dereference is used. * - * vzip.32 d10, d11 @ d10 = { d10[0], d11[0] }; d11 = { d10[1], d11[1] } + * Otherwise, `vld1q_u8` is used with `vreinterpretq_u8_u64` to do a safe + * unaligned load. + */ +#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__) +XXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr) /* silence -Wcast-align */ +{ + return *(xxh_aliasing_uint64x2_t const *)ptr; +} +#else +XXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr) +{ + return vreinterpretq_u64_u8(vld1q_u8((uint8_t const*)ptr)); +} +#endif + +/*! + * @internal + * @brief `vmlal_u32` on low and high halves of a vector. * - * Unfortunately we need inline assembly for this: Instructions modifying two - * registers at once is not possible in GCC or Clang's IR, and they have to - * create a copy. + * This is a workaround for AArch64 GCC < 11 which implemented arm_neon.h with + * inline assembly and were therefore incapable of merging the `vget_{low, high}_u32` + * with `vmlal_u32`. + */ +#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 11 +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + /* Inline assembly is the only way */ + __asm__("umlal %0.2d, %1.2s, %2.2s" : "+w" (acc) : "w" (lhs), "w" (rhs)); + return acc; +} +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + /* This intrinsic works as expected */ + return vmlal_high_u32(acc, lhs, rhs); +} +#else +/* Portable intrinsic versions */ +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + return vmlal_u32(acc, vget_low_u32(lhs), vget_low_u32(rhs)); +} +/*! @copydoc XXH_vmlal_low_u32 + * Assume the compiler converts this to vmlal_high_u32 on aarch64 */ +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + return vmlal_u32(acc, vget_high_u32(lhs), vget_high_u32(rhs)); +} +#endif + +/*! + * @ingroup tuning + * @brief Controls the NEON to scalar ratio for XXH3 * - * aarch64 requires a different approach. + * This can be set to 2, 4, 6, or 8. * - * In order to make it easier to write a decent compiler for aarch64, many - * quirks were removed, such as conditional execution. + * ARM Cortex CPUs are _very_ sensitive to how their pipelines are used. * - * NEON was also affected by this. + * For example, the Cortex-A73 can dispatch 3 micro-ops per cycle, but only 2 of those + * can be NEON. If you are only using NEON instructions, you are only using 2/3 of the CPU + * bandwidth. * - * aarch64 cannot access the high bits of a Q-form register, and writes to a - * D-form register zero the high bits, similar to how writes to W-form scalar - * registers (or DWORD registers on x86_64) work. + * This is even more noticeable on the more advanced cores like the Cortex-A76 which + * can dispatch 8 micro-ops per cycle, but still only 2 NEON micro-ops at once. * - * The formerly free vget_high intrinsics now require a vext (with a few - * exceptions) + * Therefore, to make the most out of the pipeline, it is beneficial to run 6 NEON lanes + * and 2 scalar lanes, which is chosen by default. * - * Additionally, VZIP was replaced by ZIP1 and ZIP2, which are the equivalent - * of PUNPCKL* and PUNPCKH* in SSE, respectively, in order to only modify one - * operand. + * This does not apply to Apple processors or 32-bit processors, which run better with + * full NEON. These will default to 8. Additionally, size-optimized builds run 8 lanes. * - * The equivalent of the VZIP.32 on the lower and upper halves would be this - * mess: + * This change benefits CPUs with large micro-op buffers without negatively affecting + * most other CPUs: * - * ext v2.4s, v0.4s, v0.4s, #2 // v2 = { v0[2], v0[3], v0[0], v0[1] } - * zip1 v1.2s, v0.2s, v2.2s // v1 = { v0[0], v2[0] } - * zip2 v0.2s, v0.2s, v1.2s // v0 = { v0[1], v2[1] } + * | Chipset | Dispatch type | NEON only | 6:2 hybrid | Diff. | + * |:----------------------|:--------------------|----------:|-----------:|------:| + * | Snapdragon 730 (A76) | 2 NEON/8 micro-ops | 8.8 GB/s | 10.1 GB/s | ~16% | + * | Snapdragon 835 (A73) | 2 NEON/3 micro-ops | 5.1 GB/s | 5.3 GB/s | ~5% | + * | Marvell PXA1928 (A53) | In-order dual-issue | 1.9 GB/s | 1.9 GB/s | 0% | + * | Apple M1 | 4 NEON/8 micro-ops | 37.3 GB/s | 36.1 GB/s | ~-3% | * - * Instead, we use a literal downcast, vmovn_u64 (XTN), and vshrn_n_u64 (SHRN): + * It also seems to fix some bad codegen on GCC, making it almost as fast as clang. * - * shrn v1.2s, v0.2d, #32 // v1 = (uint32x2_t)(v0 >> 32); - * xtn v0.2s, v0.2d // v0 = (uint32x2_t)(v0 & 0xFFFFFFFF); + * When using WASM SIMD128, if this is 2 or 6, SIMDe will scalarize 2 of the lanes meaning + * it effectively becomes worse 4. * - * This is available on ARMv7-A, but is less efficient than a single VZIP.32. + * @see XXH3_accumulate_512_neon() */ - -/*! - * Function-like macro: - * void XXH_SPLIT_IN_PLACE(uint64x2_t &in, uint32x2_t &outLo, uint32x2_t &outHi) - * { - * outLo = (uint32x2_t)(in & 0xFFFFFFFF); - * outHi = (uint32x2_t)(in >> 32); - * in = UNDEFINED; - * } - */ -# if !defined(XXH_NO_VZIP_HACK) /* define to disable */ \ - && defined(__GNUC__) \ - && !defined(__aarch64__) && !defined(__arm64__) && !defined(_M_ARM64) -# define XXH_SPLIT_IN_PLACE(in, outLo, outHi) \ - do { \ - /* Undocumented GCC/Clang operand modifier: %e0 = lower D half, %f0 = upper D half */ \ - /* https://github.com/gcc-mirror/gcc/blob/38cf91e5/gcc/config/arm/arm.c#L22486 */ \ - /* https://github.com/llvm-mirror/llvm/blob/2c4ca683/lib/Target/ARM/ARMAsmPrinter.cpp#L399 */ \ - __asm__("vzip.32 %e0, %f0" : "+w" (in)); \ - (outLo) = vget_low_u32 (vreinterpretq_u32_u64(in)); \ - (outHi) = vget_high_u32(vreinterpretq_u32_u64(in)); \ - } while (0) -# else -# define XXH_SPLIT_IN_PLACE(in, outLo, outHi) \ - do { \ - (outLo) = vmovn_u64 (in); \ - (outHi) = vshrn_n_u64 ((in), 32); \ - } while (0) +# ifndef XXH3_NEON_LANES +# if (defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || defined(_M_ARM64EC)) \ + && !defined(__APPLE__) && XXH_SIZE_OPT <= 0 +# define XXH3_NEON_LANES 6 +# else +# define XXH3_NEON_LANES XXH_ACC_NB +# endif # endif #endif /* XXH_VECTOR == XXH_NEON */ @@ -3078,27 +3819,42 @@ enum XXH_VECTOR_TYPE /* fake enum */ { * inconsistent intrinsics, spotty coverage, and multiple endiannesses. */ #if XXH_VECTOR == XXH_VSX +/* Annoyingly, these headers _may_ define three macros: `bool`, `vector`, + * and `pixel`. This is a problem for obvious reasons. + * + * These keywords are unnecessary; the spec literally says they are + * equivalent to `__bool`, `__vector`, and `__pixel` and may be undef'd + * after including the header. + * + * We use pragma push_macro/pop_macro to keep the namespace clean. */ +# pragma push_macro("bool") +# pragma push_macro("vector") +# pragma push_macro("pixel") +/* silence potential macro redefined warnings */ +# undef bool +# undef vector +# undef pixel + # if defined(__s390x__) # include # else -/* gcc's altivec.h can have the unwanted consequence to unconditionally - * #define bool, vector, and pixel keywords, - * with bad consequences for programs already using these keywords for other purposes. - * The paragraph defining these macros is skipped when __APPLE_ALTIVEC__ is defined. - * __APPLE_ALTIVEC__ is _generally_ defined automatically by the compiler, - * but it seems that, in some cases, it isn't. - * Force the build macro to be defined, so that keywords are not altered. - */ -# if defined(__GNUC__) && !defined(__APPLE_ALTIVEC__) -# define __APPLE_ALTIVEC__ -# endif # include # endif +/* Restore the original macro values, if applicable. */ +# pragma pop_macro("pixel") +# pragma pop_macro("vector") +# pragma pop_macro("bool") + typedef __vector unsigned long long xxh_u64x2; typedef __vector unsigned char xxh_u8x16; typedef __vector unsigned xxh_u32x4; +/* + * UGLY HACK: Similar to aarch64 macOS GCC, s390x GCC has the same aliasing issue. + */ +typedef xxh_u64x2 xxh_aliasing_u64x2 XXH_ALIASING; + # ifndef XXH_VSX_BE # if defined(__BIG_ENDIAN__) \ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) @@ -3150,8 +3906,9 @@ XXH_FORCE_INLINE xxh_u64x2 XXH_vec_loadu(const void *ptr) /* s390x is always big endian, no issue on this platform */ # define XXH_vec_mulo vec_mulo # define XXH_vec_mule vec_mule -# elif defined(__clang__) && XXH_HAS_BUILTIN(__builtin_altivec_vmuleuw) +# elif defined(__clang__) && XXH_HAS_BUILTIN(__builtin_altivec_vmuleuw) && !defined(__ibmxl__) /* Clang has a better way to control this, we can just use the builtin which doesn't swap. */ + /* The IBM XL Compiler (which defined __clang__) only implements the vec_* operations */ # define XXH_vec_mulo __builtin_altivec_vmulouw # define XXH_vec_mule __builtin_altivec_vmuleuw # else @@ -3172,13 +3929,28 @@ XXH_FORCE_INLINE xxh_u64x2 XXH_vec_mule(xxh_u32x4 a, xxh_u32x4 b) # endif /* XXH_vec_mulo, XXH_vec_mule */ #endif /* XXH_VECTOR == XXH_VSX */ +#if XXH_VECTOR == XXH_SVE +#define ACCRND(acc, offset) \ +do { \ + svuint64_t input_vec = svld1_u64(mask, xinput + offset); \ + svuint64_t secret_vec = svld1_u64(mask, xsecret + offset); \ + svuint64_t mixed = sveor_u64_x(mask, secret_vec, input_vec); \ + svuint64_t swapped = svtbl_u64(input_vec, kSwap); \ + svuint64_t mixed_lo = svextw_u64_x(mask, mixed); \ + svuint64_t mixed_hi = svlsr_n_u64_x(mask, mixed, 32); \ + svuint64_t mul = svmad_u64_x(mask, mixed_lo, mixed_hi, swapped); \ + acc = svadd_u64_x(mask, acc, mul); \ +} while (0) +#endif /* XXH_VECTOR == XXH_SVE */ /* prefetch * can be disabled, by declaring XXH_NO_PREFETCH build macro */ #if defined(XXH_NO_PREFETCH) # define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ #else -# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) /* _mm_prefetch() not defined outside of x86/x64 */ +# if XXH_SIZE_OPT >= 1 +# define XXH_PREFETCH(ptr) (void)(ptr) +# elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) /* _mm_prefetch() not defined outside of x86/x64 */ # include /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */ # define XXH_PREFETCH(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0) # elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) ) @@ -3215,6 +3987,8 @@ XXH_ALIGN(64) static const xxh_u8 XXH3_kSecret[XXH_SECRET_DEFAULT_SIZE] = { 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, }; +static const xxh_u64 PRIME_MX1 = 0x165667919E3779F9ULL; /*!< 0b0001011001010110011001111001000110011110001101110111100111111001 */ +static const xxh_u64 PRIME_MX2 = 0x9FB21C651E98DF25ULL; /*!< 0b1001111110110010000111000110010100011110100110001101111100100101 */ #ifdef XXH_OLD_NAMES # define kSecret XXH3_kSecret @@ -3243,7 +4017,6 @@ XXH_mult32to64(xxh_u64 x, xxh_u64 y) return (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF); } #elif defined(_MSC_VER) && defined(_M_IX86) -# include # define XXH_mult32to64(x, y) __emulu((unsigned)(x), (unsigned)(y)) #else /* @@ -3283,7 +4056,7 @@ XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) * In that case it is best to use the portable one. * https://github.com/Cyan4973/xxHash/issues/211#issuecomment-515575677 */ -#if defined(__GNUC__) && !defined(__wasm__) \ +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__wasm__) \ && defined(__SIZEOF_INT128__) \ || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128) @@ -3300,7 +4073,7 @@ XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) * * This compiles to single operand MUL on x64. */ -#elif defined(_M_X64) || defined(_M_IA64) +#elif (defined(_M_X64) || defined(_M_IA64)) && !defined(_M_ARM64EC) #ifndef _MSC_VER # pragma intrinsic(_umul128) @@ -3317,7 +4090,7 @@ XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) * * This compiles to the same MUL + UMULH as GCC/Clang's __uint128_t method. */ -#elif defined(_M_ARM64) +#elif defined(_M_ARM64) || defined(_M_ARM64EC) #ifndef _MSC_VER # pragma intrinsic(__umulh) @@ -3407,7 +4180,7 @@ XXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs) } /*! Seems to produce slightly better code on GCC for some reason. */ -XXH_FORCE_INLINE xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) +XXH_FORCE_INLINE XXH_CONSTF xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) { XXH_ASSERT(0 <= shift && shift < 64); return v64 ^ (v64 >> shift); @@ -3420,7 +4193,7 @@ XXH_FORCE_INLINE xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) static XXH64_hash_t XXH3_avalanche(xxh_u64 h64) { h64 = XXH_xorshift64(h64, 37); - h64 *= 0x165667919E3779F9ULL; + h64 *= PRIME_MX1; h64 = XXH_xorshift64(h64, 32); return h64; } @@ -3434,9 +4207,9 @@ static XXH64_hash_t XXH3_rrmxmx(xxh_u64 h64, xxh_u64 len) { /* this mix is inspired by Pelle Evensen's rrmxmx */ h64 ^= XXH_rotl64(h64, 49) ^ XXH_rotl64(h64, 24); - h64 *= 0x9FB21C651E98DF25ULL; + h64 *= PRIME_MX2; h64 ^= (h64 >> 35) + len ; - h64 *= 0x9FB21C651E98DF25ULL; + h64 *= PRIME_MX2; return XXH_xorshift64(h64, 28); } @@ -3474,7 +4247,7 @@ static XXH64_hash_t XXH3_rrmxmx(xxh_u64 h64, xxh_u64 len) * * This adds an extra layer of strength for custom secrets. */ -XXH_FORCE_INLINE XXH64_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t XXH3_len_1to3_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(input != NULL); @@ -3496,7 +4269,7 @@ XXH3_len_1to3_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_h } } -XXH_FORCE_INLINE XXH64_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(input != NULL); @@ -3512,7 +4285,7 @@ XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_h } } -XXH_FORCE_INLINE XXH64_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t XXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(input != NULL); @@ -3529,7 +4302,7 @@ XXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_ } } -XXH_FORCE_INLINE XXH64_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t XXH3_len_0to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(len <= 16); @@ -3599,7 +4372,7 @@ XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input, } /* For mid range keys, XXH3 uses a Mum-hash variant. */ -XXH_FORCE_INLINE XXH64_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, XXH64_hash_t seed) @@ -3608,6 +4381,14 @@ XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len, XXH_ASSERT(16 < len && len <= 128); { xxh_u64 acc = len * XXH_PRIME64_1; +#if XXH_SIZE_OPT >= 1 + /* Smaller and cleaner, but slightly slower. */ + unsigned int i = (unsigned int)(len - 1) / 32; + do { + acc += XXH3_mix16B(input+16 * i, secret+32*i, seed); + acc += XXH3_mix16B(input+len-16*(i+1), secret+32*i+16, seed); + } while (i-- != 0); +#else if (len > 32) { if (len > 64) { if (len > 96) { @@ -3622,14 +4403,14 @@ XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len, } acc += XXH3_mix16B(input+0, secret+0, seed); acc += XXH3_mix16B(input+len-16, secret+16, seed); - +#endif return XXH3_avalanche(acc); } } #define XXH3_MIDSIZE_MAX 240 -XXH_NO_INLINE XXH64_hash_t +XXH_NO_INLINE XXH_PUREF XXH64_hash_t XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, XXH64_hash_t seed) @@ -3641,13 +4422,17 @@ XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len, #define XXH3_MIDSIZE_LASTOFFSET 17 { xxh_u64 acc = len * XXH_PRIME64_1; - int const nbRounds = (int)len / 16; - int i; + xxh_u64 acc_end; + unsigned int const nbRounds = (unsigned int)len / 16; + unsigned int i; + XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); for (i=0; i<8; i++) { acc += XXH3_mix16B(input+(16*i), secret+(16*i), seed); } - acc = XXH3_avalanche(acc); + /* last bytes */ + acc_end = XXH3_mix16B(input + len - 16, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, seed); XXH_ASSERT(nbRounds >= 8); + acc = XXH3_avalanche(acc); #if defined(__clang__) /* Clang */ \ && (defined(__ARM_NEON) || defined(__ARM_NEON__)) /* NEON */ \ && !defined(XXH_ENABLE_AUTOVECTORIZE) /* Define to disable */ @@ -3674,11 +4459,13 @@ XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len, #pragma clang loop vectorize(disable) #endif for (i=8 ; i < nbRounds; i++) { - acc += XXH3_mix16B(input+(16*i), secret+(16*(i-8)) + XXH3_MIDSIZE_STARTOFFSET, seed); + /* + * Prevents clang for unrolling the acc loop and interleaving with this one. + */ + XXH_COMPILER_GUARD(acc); + acc_end += XXH3_mix16B(input+(16*i), secret+(16*(i-8)) + XXH3_MIDSIZE_STARTOFFSET, seed); } - /* last bytes */ - acc += XXH3_mix16B(input + len - 16, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, seed); - return XXH3_avalanche(acc); + return XXH3_avalanche(acc + acc_end); } } @@ -3694,6 +4481,47 @@ XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len, # define ACC_NB XXH_ACC_NB #endif +#ifndef XXH_PREFETCH_DIST +# ifdef __clang__ +# define XXH_PREFETCH_DIST 320 +# else +# if (XXH_VECTOR == XXH_AVX512) +# define XXH_PREFETCH_DIST 512 +# else +# define XXH_PREFETCH_DIST 384 +# endif +# endif /* __clang__ */ +#endif /* XXH_PREFETCH_DIST */ + +/* + * These macros are to generate an XXH3_accumulate() function. + * The two arguments select the name suffix and target attribute. + * + * The name of this symbol is XXH3_accumulate_() and it calls + * XXH3_accumulate_512_(). + * + * It may be useful to hand implement this function if the compiler fails to + * optimize the inline function. + */ +#define XXH3_ACCUMULATE_TEMPLATE(name) \ +void \ +XXH3_accumulate_##name(xxh_u64* XXH_RESTRICT acc, \ + const xxh_u8* XXH_RESTRICT input, \ + const xxh_u8* XXH_RESTRICT secret, \ + size_t nbStripes) \ +{ \ + size_t n; \ + for (n = 0; n < nbStripes; n++ ) { \ + const xxh_u8* const in = input + n*XXH_STRIPE_LEN; \ + XXH_PREFETCH(in + XXH_PREFETCH_DIST); \ + XXH3_accumulate_512_##name( \ + acc, \ + in, \ + secret + n*XXH_SECRET_CONSUME_RATE); \ + } \ +} + + XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) { if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64); @@ -3714,6 +4542,7 @@ XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) typedef long long xxh_i64; #endif + /* * XXH3_accumulate_512 is the tightest loop for long inputs, and it is the most optimized. * @@ -3761,7 +4590,7 @@ XXH3_accumulate_512_avx512(void* XXH_RESTRICT acc, /* data_key = data_vec ^ key_vec; */ __m512i const data_key = _mm512_xor_si512 (data_vec, key_vec); /* data_key_lo = data_key >> 32; */ - __m512i const data_key_lo = _mm512_shuffle_epi32 (data_key, (_MM_PERM_ENUM)_MM_SHUFFLE(0, 3, 0, 1)); + __m512i const data_key_lo = _mm512_srli_epi64 (data_key, 32); /* product = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */ __m512i const product = _mm512_mul_epu32 (data_key, data_key_lo); /* xacc[0] += swap(data_vec); */ @@ -3771,6 +4600,7 @@ XXH3_accumulate_512_avx512(void* XXH_RESTRICT acc, *xacc = _mm512_add_epi64(product, sum); } } +XXH_FORCE_INLINE XXH_TARGET_AVX512 XXH3_ACCUMULATE_TEMPLATE(avx512) /* * XXH3_scrambleAcc: Scrambles the accumulators to improve mixing. @@ -3804,13 +4634,12 @@ XXH3_scrambleAcc_avx512(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) /* xacc[0] ^= (xacc[0] >> 47) */ __m512i const acc_vec = *xacc; __m512i const shifted = _mm512_srli_epi64 (acc_vec, 47); - __m512i const data_vec = _mm512_xor_si512 (acc_vec, shifted); /* xacc[0] ^= secret; */ __m512i const key_vec = _mm512_loadu_si512 (secret); - __m512i const data_key = _mm512_xor_si512 (data_vec, key_vec); + __m512i const data_key = _mm512_ternarylogic_epi32(key_vec, acc_vec, shifted, 0x96 /* key_vec ^ acc_vec ^ shifted */); /* xacc[0] *= XXH_PRIME32_1; */ - __m512i const data_key_hi = _mm512_shuffle_epi32 (data_key, (_MM_PERM_ENUM)_MM_SHUFFLE(0, 3, 0, 1)); + __m512i const data_key_hi = _mm512_srli_epi64 (data_key, 32); __m512i const prod_lo = _mm512_mul_epu32 (data_key, prime32); __m512i const prod_hi = _mm512_mul_epu32 (data_key_hi, prime32); *xacc = _mm512_add_epi64(prod_lo, _mm512_slli_epi64(prod_hi, 32)); @@ -3825,7 +4654,8 @@ XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64) XXH_ASSERT(((size_t)customSecret & 63) == 0); (void)(&XXH_writeLE64); { int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m512i); - __m512i const seed = _mm512_mask_set1_epi64(_mm512_set1_epi64((xxh_i64)seed64), 0xAA, (xxh_i64)(0U - seed64)); + __m512i const seed_pos = _mm512_set1_epi64((xxh_i64)seed64); + __m512i const seed = _mm512_mask_sub_epi64(seed_pos, 0xAA, _mm512_set1_epi8(0), seed_pos); const __m512i* const src = (const __m512i*) ((const void*) XXH3_kSecret); __m512i* const dest = ( __m512i*) customSecret; @@ -3833,14 +4663,7 @@ XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64) XXH_ASSERT(((size_t)src & 63) == 0); /* control alignment */ XXH_ASSERT(((size_t)dest & 63) == 0); for (i=0; i < nbRounds; ++i) { - /* GCC has a bug, _mm512_stream_load_si512 accepts 'void*', not 'void const*', - * this will warn "discards 'const' qualifier". */ - union { - const __m512i* cp; - void* p; - } remote_const_void; - remote_const_void.cp = src + i; - dest[i] = _mm512_add_epi64(_mm512_stream_load_si512(remote_const_void.p), seed); + dest[i] = _mm512_add_epi64(_mm512_load_si512(src + i), seed); } } } @@ -3876,7 +4699,7 @@ XXH3_accumulate_512_avx2( void* XXH_RESTRICT acc, /* data_key = data_vec ^ key_vec; */ __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec); /* data_key_lo = data_key >> 32; */ - __m256i const data_key_lo = _mm256_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1)); + __m256i const data_key_lo = _mm256_srli_epi64 (data_key, 32); /* product = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */ __m256i const product = _mm256_mul_epu32 (data_key, data_key_lo); /* xacc[i] += swap(data_vec); */ @@ -3886,6 +4709,7 @@ XXH3_accumulate_512_avx2( void* XXH_RESTRICT acc, xacc[i] = _mm256_add_epi64(product, sum); } } } +XXH_FORCE_INLINE XXH_TARGET_AVX2 XXH3_ACCUMULATE_TEMPLATE(avx2) XXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_scrambleAcc_avx2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) @@ -3908,7 +4732,7 @@ XXH3_scrambleAcc_avx2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec); /* xacc[i] *= XXH_PRIME32_1; */ - __m256i const data_key_hi = _mm256_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1)); + __m256i const data_key_hi = _mm256_srli_epi64 (data_key, 32); __m256i const prod_lo = _mm256_mul_epu32 (data_key, prime32); __m256i const prod_hi = _mm256_mul_epu32 (data_key_hi, prime32); xacc[i] = _mm256_add_epi64(prod_lo, _mm256_slli_epi64(prod_hi, 32)); @@ -3940,12 +4764,12 @@ XXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_initCustomSecret_avx2(void* XXH_RESTR XXH_ASSERT(((size_t)dest & 31) == 0); /* GCC -O2 need unroll loop manually */ - dest[0] = _mm256_add_epi64(_mm256_stream_load_si256(src+0), seed); - dest[1] = _mm256_add_epi64(_mm256_stream_load_si256(src+1), seed); - dest[2] = _mm256_add_epi64(_mm256_stream_load_si256(src+2), seed); - dest[3] = _mm256_add_epi64(_mm256_stream_load_si256(src+3), seed); - dest[4] = _mm256_add_epi64(_mm256_stream_load_si256(src+4), seed); - dest[5] = _mm256_add_epi64(_mm256_stream_load_si256(src+5), seed); + dest[0] = _mm256_add_epi64(_mm256_load_si256(src+0), seed); + dest[1] = _mm256_add_epi64(_mm256_load_si256(src+1), seed); + dest[2] = _mm256_add_epi64(_mm256_load_si256(src+2), seed); + dest[3] = _mm256_add_epi64(_mm256_load_si256(src+3), seed); + dest[4] = _mm256_add_epi64(_mm256_load_si256(src+4), seed); + dest[5] = _mm256_add_epi64(_mm256_load_si256(src+5), seed); } } @@ -3992,6 +4816,7 @@ XXH3_accumulate_512_sse2( void* XXH_RESTRICT acc, xacc[i] = _mm_add_epi64(product, sum); } } } +XXH_FORCE_INLINE XXH_TARGET_SSE2 XXH3_ACCUMULATE_TEMPLATE(sse2) XXH_FORCE_INLINE XXH_TARGET_SSE2 void XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) @@ -4059,96 +4884,222 @@ XXH_FORCE_INLINE XXH_TARGET_SSE2 void XXH3_initCustomSecret_sse2(void* XXH_RESTR #if (XXH_VECTOR == XXH_NEON) +/* forward declarations for the scalar routines */ +XXH_FORCE_INLINE void +XXH3_scalarRound(void* XXH_RESTRICT acc, void const* XXH_RESTRICT input, + void const* XXH_RESTRICT secret, size_t lane); + +XXH_FORCE_INLINE void +XXH3_scalarScrambleRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT secret, size_t lane); + +/*! + * @internal + * @brief The bulk processing loop for NEON and WASM SIMD128. + * + * The NEON code path is actually partially scalar when running on AArch64. This + * is to optimize the pipelining and can have up to 15% speedup depending on the + * CPU, and it also mitigates some GCC codegen issues. + * + * @see XXH3_NEON_LANES for configuring this and details about this optimization. + * + * NEON's 32-bit to 64-bit long multiply takes a half vector of 32-bit + * integers instead of the other platforms which mask full 64-bit vectors, + * so the setup is more complicated than just shifting right. + * + * Additionally, there is an optimization for 4 lanes at once noted below. + * + * Since, as stated, the most optimal amount of lanes for Cortexes is 6, + * there needs to be *three* versions of the accumulate operation used + * for the remaining 2 lanes. + * + * WASM's SIMD128 uses SIMDe's arm_neon.h polyfill because the intrinsics overlap + * nearly perfectly. + */ + XXH_FORCE_INLINE void XXH3_accumulate_512_neon( void* XXH_RESTRICT acc, const void* XXH_RESTRICT input, const void* XXH_RESTRICT secret) { XXH_ASSERT((((size_t)acc) & 15) == 0); - { - uint64x2_t* const xacc = (uint64x2_t *) acc; + XXH_STATIC_ASSERT(XXH3_NEON_LANES > 0 && XXH3_NEON_LANES <= XXH_ACC_NB && XXH3_NEON_LANES % 2 == 0); + { /* GCC for darwin arm64 does not like aliasing here */ + xxh_aliasing_uint64x2_t* const xacc = (xxh_aliasing_uint64x2_t*) acc; /* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */ - uint8_t const* const xinput = (const uint8_t *) input; - uint8_t const* const xsecret = (const uint8_t *) secret; + uint8_t const* xinput = (const uint8_t *) input; + uint8_t const* xsecret = (const uint8_t *) secret; size_t i; - for (i=0; i < XXH_STRIPE_LEN / sizeof(uint64x2_t); i++) { +#ifdef __wasm_simd128__ + /* + * On WASM SIMD128, Clang emits direct address loads when XXH3_kSecret + * is constant propagated, which results in it converting it to this + * inside the loop: + * + * a = v128.load(XXH3_kSecret + 0 + $secret_offset, offset = 0) + * b = v128.load(XXH3_kSecret + 16 + $secret_offset, offset = 0) + * ... + * + * This requires a full 32-bit address immediate (and therefore a 6 byte + * instruction) as well as an add for each offset. + * + * Putting an asm guard prevents it from folding (at the cost of losing + * the alignment hint), and uses the free offset in `v128.load` instead + * of adding secret_offset each time which overall reduces code size by + * about a kilobyte and improves performance. + */ + XXH_COMPILER_GUARD(xsecret); +#endif + /* Scalar lanes use the normal scalarRound routine */ + for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) { + XXH3_scalarRound(acc, input, secret, i); + } + i = 0; + /* 4 NEON lanes at a time. */ + for (; i+1 < XXH3_NEON_LANES / 2; i+=2) { /* data_vec = xinput[i]; */ - uint8x16_t data_vec = vld1q_u8(xinput + (i * 16)); + uint64x2_t data_vec_1 = XXH_vld1q_u64(xinput + (i * 16)); + uint64x2_t data_vec_2 = XXH_vld1q_u64(xinput + ((i+1) * 16)); /* key_vec = xsecret[i]; */ - uint8x16_t key_vec = vld1q_u8(xsecret + (i * 16)); - uint64x2_t data_key; - uint32x2_t data_key_lo, data_key_hi; - /* xacc[i] += swap(data_vec); */ - uint64x2_t const data64 = vreinterpretq_u64_u8(data_vec); - uint64x2_t const swapped = vextq_u64(data64, data64, 1); - xacc[i] = vaddq_u64 (xacc[i], swapped); + uint64x2_t key_vec_1 = XXH_vld1q_u64(xsecret + (i * 16)); + uint64x2_t key_vec_2 = XXH_vld1q_u64(xsecret + ((i+1) * 16)); + /* data_swap = swap(data_vec) */ + uint64x2_t data_swap_1 = vextq_u64(data_vec_1, data_vec_1, 1); + uint64x2_t data_swap_2 = vextq_u64(data_vec_2, data_vec_2, 1); /* data_key = data_vec ^ key_vec; */ - data_key = vreinterpretq_u64_u8(veorq_u8(data_vec, key_vec)); - /* data_key_lo = (uint32x2_t) (data_key & 0xFFFFFFFF); - * data_key_hi = (uint32x2_t) (data_key >> 32); - * data_key = UNDEFINED; */ - XXH_SPLIT_IN_PLACE(data_key, data_key_lo, data_key_hi); - /* xacc[i] += (uint64x2_t) data_key_lo * (uint64x2_t) data_key_hi; */ - xacc[i] = vmlal_u32 (xacc[i], data_key_lo, data_key_hi); + uint64x2_t data_key_1 = veorq_u64(data_vec_1, key_vec_1); + uint64x2_t data_key_2 = veorq_u64(data_vec_2, key_vec_2); + /* + * If we reinterpret the 64x2 vectors as 32x4 vectors, we can use a + * de-interleave operation for 4 lanes in 1 step with `vuzpq_u32` to + * get one vector with the low 32 bits of each lane, and one vector + * with the high 32 bits of each lane. + * + * The intrinsic returns a double vector because the original ARMv7-a + * instruction modified both arguments in place. AArch64 and SIMD128 emit + * two instructions from this intrinsic. + * + * [ dk11L | dk11H | dk12L | dk12H ] -> [ dk11L | dk12L | dk21L | dk22L ] + * [ dk21L | dk21H | dk22L | dk22H ] -> [ dk11H | dk12H | dk21H | dk22H ] + */ + uint32x4x2_t unzipped = vuzpq_u32( + vreinterpretq_u32_u64(data_key_1), + vreinterpretq_u32_u64(data_key_2) + ); + /* data_key_lo = data_key & 0xFFFFFFFF */ + uint32x4_t data_key_lo = unzipped.val[0]; + /* data_key_hi = data_key >> 32 */ + uint32x4_t data_key_hi = unzipped.val[1]; + /* + * Then, we can split the vectors horizontally and multiply which, as for most + * widening intrinsics, have a variant that works on both high half vectors + * for free on AArch64. A similar instruction is available on SIMD128. + * + * sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi + */ + uint64x2_t sum_1 = XXH_vmlal_low_u32(data_swap_1, data_key_lo, data_key_hi); + uint64x2_t sum_2 = XXH_vmlal_high_u32(data_swap_2, data_key_lo, data_key_hi); + /* + * Clang reorders + * a += b * c; // umlal swap.2d, dkl.2s, dkh.2s + * c += a; // add acc.2d, acc.2d, swap.2d + * to + * c += a; // add acc.2d, acc.2d, swap.2d + * c += b * c; // umlal acc.2d, dkl.2s, dkh.2s + * + * While it would make sense in theory since the addition is faster, + * for reasons likely related to umlal being limited to certain NEON + * pipelines, this is worse. A compiler guard fixes this. + */ + XXH_COMPILER_GUARD_CLANG_NEON(sum_1); + XXH_COMPILER_GUARD_CLANG_NEON(sum_2); + /* xacc[i] = acc_vec + sum; */ + xacc[i] = vaddq_u64(xacc[i], sum_1); + xacc[i+1] = vaddq_u64(xacc[i+1], sum_2); + } + /* Operate on the remaining NEON lanes 2 at a time. */ + for (; i < XXH3_NEON_LANES / 2; i++) { + /* data_vec = xinput[i]; */ + uint64x2_t data_vec = XXH_vld1q_u64(xinput + (i * 16)); + /* key_vec = xsecret[i]; */ + uint64x2_t key_vec = XXH_vld1q_u64(xsecret + (i * 16)); + /* acc_vec_2 = swap(data_vec) */ + uint64x2_t data_swap = vextq_u64(data_vec, data_vec, 1); + /* data_key = data_vec ^ key_vec; */ + uint64x2_t data_key = veorq_u64(data_vec, key_vec); + /* For two lanes, just use VMOVN and VSHRN. */ + /* data_key_lo = data_key & 0xFFFFFFFF; */ + uint32x2_t data_key_lo = vmovn_u64(data_key); + /* data_key_hi = data_key >> 32; */ + uint32x2_t data_key_hi = vshrn_n_u64(data_key, 32); + /* sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi; */ + uint64x2_t sum = vmlal_u32(data_swap, data_key_lo, data_key_hi); + /* Same Clang workaround as before */ + XXH_COMPILER_GUARD_CLANG_NEON(sum); + /* xacc[i] = acc_vec + sum; */ + xacc[i] = vaddq_u64 (xacc[i], sum); } } } +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(neon) XXH_FORCE_INLINE void XXH3_scrambleAcc_neon(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) { XXH_ASSERT((((size_t)acc) & 15) == 0); - { uint64x2_t* xacc = (uint64x2_t*) acc; + { xxh_aliasing_uint64x2_t* xacc = (xxh_aliasing_uint64x2_t*) acc; uint8_t const* xsecret = (uint8_t const*) secret; - uint32x2_t prime = vdup_n_u32 (XXH_PRIME32_1); size_t i; - for (i=0; i < XXH_STRIPE_LEN/sizeof(uint64x2_t); i++) { + /* WASM uses operator overloads and doesn't need these. */ +#ifndef __wasm_simd128__ + /* { prime32_1, prime32_1 } */ + uint32x2_t const kPrimeLo = vdup_n_u32(XXH_PRIME32_1); + /* { 0, prime32_1, 0, prime32_1 } */ + uint32x4_t const kPrimeHi = vreinterpretq_u32_u64(vdupq_n_u64((xxh_u64)XXH_PRIME32_1 << 32)); +#endif + + /* AArch64 uses both scalar and neon at the same time */ + for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) { + XXH3_scalarScrambleRound(acc, secret, i); + } + for (i=0; i < XXH3_NEON_LANES / 2; i++) { /* xacc[i] ^= (xacc[i] >> 47); */ uint64x2_t acc_vec = xacc[i]; - uint64x2_t shifted = vshrq_n_u64 (acc_vec, 47); - uint64x2_t data_vec = veorq_u64 (acc_vec, shifted); + uint64x2_t shifted = vshrq_n_u64(acc_vec, 47); + uint64x2_t data_vec = veorq_u64(acc_vec, shifted); /* xacc[i] ^= xsecret[i]; */ - uint8x16_t key_vec = vld1q_u8 (xsecret + (i * 16)); - uint64x2_t data_key = veorq_u64 (data_vec, vreinterpretq_u64_u8(key_vec)); - + uint64x2_t key_vec = XXH_vld1q_u64(xsecret + (i * 16)); + uint64x2_t data_key = veorq_u64(data_vec, key_vec); /* xacc[i] *= XXH_PRIME32_1 */ - uint32x2_t data_key_lo, data_key_hi; - /* data_key_lo = (uint32x2_t) (xacc[i] & 0xFFFFFFFF); - * data_key_hi = (uint32x2_t) (xacc[i] >> 32); - * xacc[i] = UNDEFINED; */ - XXH_SPLIT_IN_PLACE(data_key, data_key_lo, data_key_hi); - { /* - * prod_hi = (data_key >> 32) * XXH_PRIME32_1; - * - * Avoid vmul_u32 + vshll_n_u32 since Clang 6 and 7 will - * incorrectly "optimize" this: - * tmp = vmul_u32(vmovn_u64(a), vmovn_u64(b)); - * shifted = vshll_n_u32(tmp, 32); - * to this: - * tmp = "vmulq_u64"(a, b); // no such thing! - * shifted = vshlq_n_u64(tmp, 32); - * - * However, unlike SSE, Clang lacks a 64-bit multiply routine - * for NEON, and it scalarizes two 64-bit multiplies instead. - * - * vmull_u32 has the same timing as vmul_u32, and it avoids - * this bug completely. - * See https://bugs.llvm.org/show_bug.cgi?id=39967 - */ - uint64x2_t prod_hi = vmull_u32 (data_key_hi, prime); - /* xacc[i] = prod_hi << 32; */ - xacc[i] = vshlq_n_u64(prod_hi, 32); - /* xacc[i] += (prod_hi & 0xFFFFFFFF) * XXH_PRIME32_1; */ - xacc[i] = vmlal_u32(xacc[i], data_key_lo, prime); - } - } } +#ifdef __wasm_simd128__ + /* SIMD128 has multiply by u64x2, use it instead of expanding and scalarizing */ + xacc[i] = data_key * XXH_PRIME32_1; +#else + /* + * Expanded version with portable NEON intrinsics + * + * lo(x) * lo(y) + (hi(x) * lo(y) << 32) + * + * prod_hi = hi(data_key) * lo(prime) << 32 + * + * Since we only need 32 bits of this multiply a trick can be used, reinterpreting the vector + * as a uint32x4_t and multiplying by { 0, prime, 0, prime } to cancel out the unwanted bits + * and avoid the shift. + */ + uint32x4_t prod_hi = vmulq_u32 (vreinterpretq_u32_u64(data_key), kPrimeHi); + /* Extract low bits for vmlal_u32 */ + uint32x2_t data_key_lo = vmovn_u64(data_key); + /* xacc[i] = prod_hi + lo(data_key) * XXH_PRIME32_1; */ + xacc[i] = vmlal_u32(vreinterpretq_u64_u32(prod_hi), data_key_lo, kPrimeLo); +#endif + } + } } - #endif #if (XXH_VECTOR == XXH_VSX) @@ -4159,23 +5110,23 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) { /* presumed aligned */ - unsigned int* const xacc = (unsigned int*) acc; - xxh_u64x2 const* const xinput = (xxh_u64x2 const*) input; /* no alignment restriction */ - xxh_u64x2 const* const xsecret = (xxh_u64x2 const*) secret; /* no alignment restriction */ + xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc; + xxh_u8 const* const xinput = (xxh_u8 const*) input; /* no alignment restriction */ + xxh_u8 const* const xsecret = (xxh_u8 const*) secret; /* no alignment restriction */ xxh_u64x2 const v32 = { 32, 32 }; size_t i; for (i = 0; i < XXH_STRIPE_LEN / sizeof(xxh_u64x2); i++) { /* data_vec = xinput[i]; */ - xxh_u64x2 const data_vec = XXH_vec_loadu(xinput + i); + xxh_u64x2 const data_vec = XXH_vec_loadu(xinput + 16*i); /* key_vec = xsecret[i]; */ - xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + i); + xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + 16*i); xxh_u64x2 const data_key = data_vec ^ key_vec; /* shuffled = (data_key << 32) | (data_key >> 32); */ xxh_u32x4 const shuffled = (xxh_u32x4)vec_rl(data_key, v32); /* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */ xxh_u64x2 const product = XXH_vec_mulo((xxh_u32x4)data_key, shuffled); /* acc_vec = xacc[i]; */ - xxh_u64x2 acc_vec = (xxh_u64x2)vec_xl(0, xacc + 4 * i); + xxh_u64x2 acc_vec = xacc[i]; acc_vec += product; /* swap high and low halves */ @@ -4184,18 +5135,18 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc, #else acc_vec += vec_xxpermdi(data_vec, data_vec, 2); #endif - /* xacc[i] = acc_vec; */ - vec_xst((xxh_u32x4)acc_vec, 0, xacc + 4 * i); + xacc[i] = acc_vec; } } +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(vsx) XXH_FORCE_INLINE void XXH3_scrambleAcc_vsx(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) { XXH_ASSERT((((size_t)acc) & 15) == 0); - { xxh_u64x2* const xacc = (xxh_u64x2*) acc; - const xxh_u64x2* const xsecret = (const xxh_u64x2*) secret; + { xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc; + const xxh_u8* const xsecret = (const xxh_u8*) secret; /* constants */ xxh_u64x2 const v32 = { 32, 32 }; xxh_u64x2 const v47 = { 47, 47 }; @@ -4207,7 +5158,7 @@ XXH3_scrambleAcc_vsx(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) xxh_u64x2 const data_vec = acc_vec ^ (acc_vec >> v47); /* xacc[i] ^= xsecret[i]; */ - xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + i); + xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + 16*i); xxh_u64x2 const data_key = data_vec ^ key_vec; /* xacc[i] *= XXH_PRIME32_1 */ @@ -4221,40 +5172,233 @@ XXH3_scrambleAcc_vsx(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) #endif +#if (XXH_VECTOR == XXH_SVE) + +XXH_FORCE_INLINE void +XXH3_accumulate_512_sve( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + uint64_t *xacc = (uint64_t *)acc; + const uint64_t *xinput = (const uint64_t *)(const void *)input; + const uint64_t *xsecret = (const uint64_t *)(const void *)secret; + svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1); + uint64_t element_count = svcntd(); + if (element_count >= 8) { + svbool_t mask = svptrue_pat_b64(SV_VL8); + svuint64_t vacc = svld1_u64(mask, xacc); + ACCRND(vacc, 0); + svst1_u64(mask, xacc, vacc); + } else if (element_count == 2) { /* sve128 */ + svbool_t mask = svptrue_pat_b64(SV_VL2); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 2); + svuint64_t acc2 = svld1_u64(mask, xacc + 4); + svuint64_t acc3 = svld1_u64(mask, xacc + 6); + ACCRND(acc0, 0); + ACCRND(acc1, 2); + ACCRND(acc2, 4); + ACCRND(acc3, 6); + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 2, acc1); + svst1_u64(mask, xacc + 4, acc2); + svst1_u64(mask, xacc + 6, acc3); + } else { + svbool_t mask = svptrue_pat_b64(SV_VL4); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 4); + ACCRND(acc0, 0); + ACCRND(acc1, 4); + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 4, acc1); + } +} + +XXH_FORCE_INLINE void +XXH3_accumulate_sve(xxh_u64* XXH_RESTRICT acc, + const xxh_u8* XXH_RESTRICT input, + const xxh_u8* XXH_RESTRICT secret, + size_t nbStripes) +{ + if (nbStripes != 0) { + uint64_t *xacc = (uint64_t *)acc; + const uint64_t *xinput = (const uint64_t *)(const void *)input; + const uint64_t *xsecret = (const uint64_t *)(const void *)secret; + svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1); + uint64_t element_count = svcntd(); + if (element_count >= 8) { + svbool_t mask = svptrue_pat_b64(SV_VL8); + svuint64_t vacc = svld1_u64(mask, xacc + 0); + do { + /* svprfd(svbool_t, void *, enum svfprop); */ + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(vacc, 0); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, vacc); + } else if (element_count == 2) { /* sve128 */ + svbool_t mask = svptrue_pat_b64(SV_VL2); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 2); + svuint64_t acc2 = svld1_u64(mask, xacc + 4); + svuint64_t acc3 = svld1_u64(mask, xacc + 6); + do { + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(acc0, 0); + ACCRND(acc1, 2); + ACCRND(acc2, 4); + ACCRND(acc3, 6); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 2, acc1); + svst1_u64(mask, xacc + 4, acc2); + svst1_u64(mask, xacc + 6, acc3); + } else { + svbool_t mask = svptrue_pat_b64(SV_VL4); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 4); + do { + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(acc0, 0); + ACCRND(acc1, 4); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 4, acc1); + } + } +} + +#endif + /* scalar variants - universal */ +#if defined(__aarch64__) && (defined(__GNUC__) || defined(__clang__)) +/* + * In XXH3_scalarRound(), GCC and Clang have a similar codegen issue, where they + * emit an excess mask and a full 64-bit multiply-add (MADD X-form). + * + * While this might not seem like much, as AArch64 is a 64-bit architecture, only + * big Cortex designs have a full 64-bit multiplier. + * + * On the little cores, the smaller 32-bit multiplier is used, and full 64-bit + * multiplies expand to 2-3 multiplies in microcode. This has a major penalty + * of up to 4 latency cycles and 2 stall cycles in the multiply pipeline. + * + * Thankfully, AArch64 still provides the 32-bit long multiply-add (UMADDL) which does + * not have this penalty and does the mask automatically. + */ +XXH_FORCE_INLINE xxh_u64 +XXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc) +{ + xxh_u64 ret; + /* note: %x = 64-bit register, %w = 32-bit register */ + __asm__("umaddl %x0, %w1, %w2, %x3" : "=r" (ret) : "r" (lhs), "r" (rhs), "r" (acc)); + return ret; +} +#else +XXH_FORCE_INLINE xxh_u64 +XXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc) +{ + return XXH_mult32to64((xxh_u32)lhs, (xxh_u32)rhs) + acc; +} +#endif + +/*! + * @internal + * @brief Scalar round for @ref XXH3_accumulate_512_scalar(). + * + * This is extracted to its own function because the NEON path uses a combination + * of NEON and scalar. + */ +XXH_FORCE_INLINE void +XXH3_scalarRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT input, + void const* XXH_RESTRICT secret, + size_t lane) +{ + xxh_u64* xacc = (xxh_u64*) acc; + xxh_u8 const* xinput = (xxh_u8 const*) input; + xxh_u8 const* xsecret = (xxh_u8 const*) secret; + XXH_ASSERT(lane < XXH_ACC_NB); + XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN-1)) == 0); + { + xxh_u64 const data_val = XXH_readLE64(xinput + lane * 8); + xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + lane * 8); + xacc[lane ^ 1] += data_val; /* swap adjacent lanes */ + xacc[lane] = XXH_mult32to64_add64(data_key /* & 0xFFFFFFFF */, data_key >> 32, xacc[lane]); + } +} + +/*! + * @internal + * @brief Processes a 64 byte block of data using the scalar path. + */ XXH_FORCE_INLINE void XXH3_accumulate_512_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT input, const void* XXH_RESTRICT secret) { - xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */ - const xxh_u8* const xinput = (const xxh_u8*) input; /* no alignment restriction */ - const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */ size_t i; - XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN-1)) == 0); + /* ARM GCC refuses to unroll this loop, resulting in a 24% slowdown on ARMv6. */ +#if defined(__GNUC__) && !defined(__clang__) \ + && (defined(__arm__) || defined(__thumb2__)) \ + && defined(__ARM_FEATURE_UNALIGNED) /* no unaligned access just wastes bytes */ \ + && XXH_SIZE_OPT <= 0 +# pragma GCC unroll 8 +#endif for (i=0; i < XXH_ACC_NB; i++) { - xxh_u64 const data_val = XXH_readLE64(xinput + 8*i); - xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + i*8); - xacc[i ^ 1] += data_val; /* swap adjacent lanes */ - xacc[i] += XXH_mult32to64(data_key & 0xFFFFFFFF, data_key >> 32); + XXH3_scalarRound(acc, input, secret, i); } } +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(scalar) +/*! + * @internal + * @brief Scalar scramble step for @ref XXH3_scrambleAcc_scalar(). + * + * This is extracted to its own function because the NEON path uses a combination + * of NEON and scalar. + */ XXH_FORCE_INLINE void -XXH3_scrambleAcc_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +XXH3_scalarScrambleRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT secret, + size_t lane) { xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */ const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */ - size_t i; XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN-1)) == 0); - for (i=0; i < XXH_ACC_NB; i++) { - xxh_u64 const key64 = XXH_readLE64(xsecret + 8*i); - xxh_u64 acc64 = xacc[i]; + XXH_ASSERT(lane < XXH_ACC_NB); + { + xxh_u64 const key64 = XXH_readLE64(xsecret + lane * 8); + xxh_u64 acc64 = xacc[lane]; acc64 = XXH_xorshift64(acc64, 47); acc64 ^= key64; acc64 *= XXH_PRIME32_1; - xacc[i] = acc64; + xacc[lane] = acc64; + } +} + +/*! + * @internal + * @brief Scrambles the accumulators after a large chunk has been read + */ +XXH_FORCE_INLINE void +XXH3_scrambleAcc_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + size_t i; + for (i=0; i < XXH_ACC_NB; i++) { + XXH3_scalarScrambleRound(acc, secret, i); } } @@ -4269,15 +5413,16 @@ XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64) const xxh_u8* kSecretPtr = XXH3_kSecret; XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); -#if defined(__clang__) && defined(__aarch64__) +#if defined(__GNUC__) && defined(__aarch64__) /* * UGLY HACK: - * Clang generates a bunch of MOV/MOVK pairs for aarch64, and they are + * GCC and Clang generate a bunch of MOV/MOVK pairs for aarch64, and they are * placed sequentially, in order, at the top of the unrolled loop. * * While MOVK is great for generating constants (2 cycles for a 64-bit - * constant compared to 4 cycles for LDR), long MOVK chains stall the - * integer pipelines: + * constant compared to 4 cycles for LDR), it fights for bandwidth with + * the arithmetic instructions. + * * I L S * MOVK * MOVK @@ -4286,7 +5431,7 @@ XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64) * ADD * SUB STR * STR - * By forcing loads from memory (as the asm line causes Clang to assume + * By forcing loads from memory (as the asm line causes the compiler to assume * that XXH3_kSecretPtr has been changed), the pipelines are used more * efficiently: * I L S @@ -4294,23 +5439,20 @@ XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64) * ADD LDR * SUB STR * STR + * + * See XXH3_NEON_LANES for details on the pipsline. + * * XXH3_64bits_withSeed, len == 256, Snapdragon 835 * without hack: 2654.4 MB/s * with hack: 3202.9 MB/s */ XXH_COMPILER_GUARD(kSecretPtr); #endif - /* - * Note: in debug mode, this overrides the asm optimization - * and Clang will emit MOVK chains again. - */ - XXH_ASSERT(kSecretPtr == XXH3_kSecret); - { int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16; int i; for (i=0; i < nbRounds; i++) { /* - * The asm hack causes Clang to assume that kSecretPtr aliases with + * The asm hack causes the compiler to assume that kSecretPtr aliases with * customSecret, and on aarch64, this prevented LDP from merging two * loads together for free. Putting the loads together before the stores * properly generates LDP. @@ -4323,7 +5465,7 @@ XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64) } -typedef void (*XXH3_f_accumulate_512)(void* XXH_RESTRICT, const void*, const void*); +typedef void (*XXH3_f_accumulate)(xxh_u64* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, size_t); typedef void (*XXH3_f_scrambleAcc)(void* XXH_RESTRICT, const void*); typedef void (*XXH3_f_initCustomSecret)(void* XXH_RESTRICT, xxh_u64); @@ -4331,82 +5473,63 @@ typedef void (*XXH3_f_initCustomSecret)(void* XXH_RESTRICT, xxh_u64); #if (XXH_VECTOR == XXH_AVX512) #define XXH3_accumulate_512 XXH3_accumulate_512_avx512 +#define XXH3_accumulate XXH3_accumulate_avx512 #define XXH3_scrambleAcc XXH3_scrambleAcc_avx512 #define XXH3_initCustomSecret XXH3_initCustomSecret_avx512 #elif (XXH_VECTOR == XXH_AVX2) #define XXH3_accumulate_512 XXH3_accumulate_512_avx2 +#define XXH3_accumulate XXH3_accumulate_avx2 #define XXH3_scrambleAcc XXH3_scrambleAcc_avx2 #define XXH3_initCustomSecret XXH3_initCustomSecret_avx2 #elif (XXH_VECTOR == XXH_SSE2) #define XXH3_accumulate_512 XXH3_accumulate_512_sse2 +#define XXH3_accumulate XXH3_accumulate_sse2 #define XXH3_scrambleAcc XXH3_scrambleAcc_sse2 #define XXH3_initCustomSecret XXH3_initCustomSecret_sse2 #elif (XXH_VECTOR == XXH_NEON) #define XXH3_accumulate_512 XXH3_accumulate_512_neon +#define XXH3_accumulate XXH3_accumulate_neon #define XXH3_scrambleAcc XXH3_scrambleAcc_neon #define XXH3_initCustomSecret XXH3_initCustomSecret_scalar #elif (XXH_VECTOR == XXH_VSX) #define XXH3_accumulate_512 XXH3_accumulate_512_vsx +#define XXH3_accumulate XXH3_accumulate_vsx #define XXH3_scrambleAcc XXH3_scrambleAcc_vsx #define XXH3_initCustomSecret XXH3_initCustomSecret_scalar +#elif (XXH_VECTOR == XXH_SVE) +#define XXH3_accumulate_512 XXH3_accumulate_512_sve +#define XXH3_accumulate XXH3_accumulate_sve +#define XXH3_scrambleAcc XXH3_scrambleAcc_scalar +#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar + #else /* scalar */ #define XXH3_accumulate_512 XXH3_accumulate_512_scalar +#define XXH3_accumulate XXH3_accumulate_scalar #define XXH3_scrambleAcc XXH3_scrambleAcc_scalar #define XXH3_initCustomSecret XXH3_initCustomSecret_scalar #endif - - -#ifndef XXH_PREFETCH_DIST -# ifdef __clang__ -# define XXH_PREFETCH_DIST 320 -# else -# if (XXH_VECTOR == XXH_AVX512) -# define XXH_PREFETCH_DIST 512 -# else -# define XXH_PREFETCH_DIST 384 -# endif -# endif /* __clang__ */ -#endif /* XXH_PREFETCH_DIST */ - -/* - * XXH3_accumulate() - * Loops over XXH3_accumulate_512(). - * Assumption: nbStripes will not overflow the secret size - */ -XXH_FORCE_INLINE void -XXH3_accumulate( xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT input, - const xxh_u8* XXH_RESTRICT secret, - size_t nbStripes, - XXH3_f_accumulate_512 f_acc512) -{ - size_t n; - for (n = 0; n < nbStripes; n++ ) { - const xxh_u8* const in = input + n*XXH_STRIPE_LEN; - XXH_PREFETCH(in + XXH_PREFETCH_DIST); - f_acc512(acc, - in, - secret + n*XXH_SECRET_CONSUME_RATE); - } -} +#if XXH_SIZE_OPT >= 1 /* don't do SIMD for initialization */ +# undef XXH3_initCustomSecret +# define XXH3_initCustomSecret XXH3_initCustomSecret_scalar +#endif XXH_FORCE_INLINE void XXH3_hashLong_internal_loop(xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble) { size_t const nbStripesPerBlock = (secretSize - XXH_STRIPE_LEN) / XXH_SECRET_CONSUME_RATE; @@ -4418,7 +5541,7 @@ XXH3_hashLong_internal_loop(xxh_u64* XXH_RESTRICT acc, XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); for (n = 0; n < nb_blocks; n++) { - XXH3_accumulate(acc, input + n*block_len, secret, nbStripesPerBlock, f_acc512); + f_acc(acc, input + n*block_len, secret, nbStripesPerBlock); f_scramble(acc, secret + secretSize - XXH_STRIPE_LEN); } @@ -4426,12 +5549,12 @@ XXH3_hashLong_internal_loop(xxh_u64* XXH_RESTRICT acc, XXH_ASSERT(len > XXH_STRIPE_LEN); { size_t const nbStripes = ((len - 1) - (block_len * nb_blocks)) / XXH_STRIPE_LEN; XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE)); - XXH3_accumulate(acc, input + nb_blocks*block_len, secret, nbStripes, f_acc512); + f_acc(acc, input + nb_blocks*block_len, secret, nbStripes); /* last stripe */ { const xxh_u8* const p = input + len - XXH_STRIPE_LEN; #define XXH_SECRET_LASTACC_START 7 /* not aligned on 8, last secret is different from acc & scrambler */ - f_acc512(acc, p, secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START); + XXH3_accumulate_512(acc, p, secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START); } } } @@ -4476,12 +5599,12 @@ XXH3_mergeAccs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secre XXH_FORCE_INLINE XXH64_hash_t XXH3_hashLong_64b_internal(const void* XXH_RESTRICT input, size_t len, const void* XXH_RESTRICT secret, size_t secretSize, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble) { XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; - XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, f_acc512, f_scramble); + XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, f_acc, f_scramble); /* converge into final hash */ XXH_STATIC_ASSERT(sizeof(acc) == 64); @@ -4495,13 +5618,15 @@ XXH3_hashLong_64b_internal(const void* XXH_RESTRICT input, size_t len, * It's important for performance to transmit secret's size (when it's static) * so that the compiler can properly optimize the vectorized loop. * This makes a big performance difference for "medium" keys (<1 KB) when using AVX instruction set. + * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE + * breaks -Og, this is XXH_NO_INLINE. */ XXH3_WITH_SECRET_INLINE XXH64_hash_t XXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len, XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) { (void)seed64; - return XXH3_hashLong_64b_internal(input, len, secret, secretLen, XXH3_accumulate_512, XXH3_scrambleAcc); + return XXH3_hashLong_64b_internal(input, len, secret, secretLen, XXH3_accumulate, XXH3_scrambleAcc); } /* @@ -4510,12 +5635,12 @@ XXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len, * Note that inside this no_inline function, we do inline the internal loop, * and provide a statically defined secret size to allow optimization of vector loop. */ -XXH_NO_INLINE XXH64_hash_t +XXH_NO_INLINE XXH_PUREF XXH64_hash_t XXH3_hashLong_64b_default(const void* XXH_RESTRICT input, size_t len, XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) { (void)seed64; (void)secret; (void)secretLen; - return XXH3_hashLong_64b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_accumulate_512, XXH3_scrambleAcc); + return XXH3_hashLong_64b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_accumulate, XXH3_scrambleAcc); } /* @@ -4532,18 +5657,20 @@ XXH3_hashLong_64b_default(const void* XXH_RESTRICT input, size_t len, XXH_FORCE_INLINE XXH64_hash_t XXH3_hashLong_64b_withSeed_internal(const void* input, size_t len, XXH64_hash_t seed, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble, XXH3_f_initCustomSecret f_initSec) { +#if XXH_SIZE_OPT <= 0 if (seed == 0) return XXH3_hashLong_64b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), - f_acc512, f_scramble); + f_acc, f_scramble); +#endif { XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; f_initSec(secret, seed); return XXH3_hashLong_64b_internal(input, len, secret, sizeof(secret), - f_acc512, f_scramble); + f_acc, f_scramble); } } @@ -4551,12 +5678,12 @@ XXH3_hashLong_64b_withSeed_internal(const void* input, size_t len, * It's important for performance that XXH3_hashLong is not inlined. */ XXH_NO_INLINE XXH64_hash_t -XXH3_hashLong_64b_withSeed(const void* input, size_t len, - XXH64_hash_t seed, const xxh_u8* secret, size_t secretLen) +XXH3_hashLong_64b_withSeed(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) { (void)secret; (void)secretLen; return XXH3_hashLong_64b_withSeed_internal(input, len, seed, - XXH3_accumulate_512, XXH3_scrambleAcc, XXH3_initCustomSecret); + XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret); } @@ -4588,37 +5715,37 @@ XXH3_64bits_internal(const void* XXH_RESTRICT input, size_t len, /* === Public entry point === */ -/*! @ingroup xxh3_family */ -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(const void* input, size_t len) +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length) { - return XXH3_64bits_internal(input, len, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_default); + return XXH3_64bits_internal(input, length, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_default); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH64_hash_t -XXH3_64bits_withSecret(const void* input, size_t len, const void* secret, size_t secretSize) +XXH3_64bits_withSecret(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize) { - return XXH3_64bits_internal(input, len, 0, secret, secretSize, XXH3_hashLong_64b_withSecret); + return XXH3_64bits_internal(input, length, 0, secret, secretSize, XXH3_hashLong_64b_withSecret); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH64_hash_t -XXH3_64bits_withSeed(const void* input, size_t len, XXH64_hash_t seed) +XXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed) { - return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed); + return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed); } XXH_PUBLIC_API XXH64_hash_t -XXH3_64bits_withSecretandSeed(const void* input, size_t len, const void* secret, size_t secretSize, XXH64_hash_t seed) +XXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) { - if (len <= XXH3_MIDSIZE_MAX) - return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL); - return XXH3_hashLong_64b_withSecret(input, len, seed, (const xxh_u8*)secret, secretSize); + if (length <= XXH3_MIDSIZE_MAX) + return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL); + return XXH3_hashLong_64b_withSecret(input, length, seed, (const xxh_u8*)secret, secretSize); } /* === XXH3 streaming === */ - +#ifndef XXH_NO_STREAM /* * Malloc's a pointer that is always aligned to align. * @@ -4642,7 +5769,7 @@ XXH3_64bits_withSecretandSeed(const void* input, size_t len, const void* secret, * * Align must be a power of 2 and 8 <= align <= 128. */ -static void* XXH_alignedMalloc(size_t s, size_t align) +static XXH_MALLOCF void* XXH_alignedMalloc(size_t s, size_t align) { XXH_ASSERT(align <= 128 && align >= 8); /* range check */ XXH_ASSERT((align & (align-1)) == 0); /* power of 2 */ @@ -4684,7 +5811,13 @@ static void XXH_alignedFree(void* p) XXH_free(base); } } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ +/*! + * @brief Allocate an @ref XXH3_state_t. + * + * Must be freed with XXH3_freeState(). + * @return An allocated XXH3_state_t on success, `NULL` on failure. + */ XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void) { XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64); @@ -4693,16 +5826,23 @@ XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void) return state; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ +/*! + * @brief Frees an @ref XXH3_state_t. + * + * Must be allocated with XXH3_createState(). + * @param statePtr A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState(). + * @return XXH_OK. + */ XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr) { XXH_alignedFree(statePtr); return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API void -XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state) +XXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state) { XXH_memcpy(dst_state, src_state, sizeof(*dst_state)); } @@ -4734,18 +5874,18 @@ XXH3_reset_internal(XXH3_state_t* statePtr, statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_reset(XXH3_state_t* statePtr) +XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr) { if (statePtr == NULL) return XXH_ERROR; XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE); return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize) +XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize) { if (statePtr == NULL) return XXH_ERROR; XXH3_reset_internal(statePtr, 0, secret, secretSize); @@ -4754,9 +5894,9 @@ XXH3_64bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed) +XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed) { if (statePtr == NULL) return XXH_ERROR; if (seed==0) return XXH3_64bits_reset(statePtr); @@ -4766,9 +5906,9 @@ XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed) return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_reset_withSecretandSeed(XXH3_state_t* statePtr, const void* secret, size_t secretSize, XXH64_hash_t seed64) +XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64) { if (statePtr == NULL) return XXH_ERROR; if (secret == NULL) return XXH_ERROR; @@ -4778,35 +5918,61 @@ XXH3_64bits_reset_withSecretandSeed(XXH3_state_t* statePtr, const void* secret, return XXH_OK; } -/* Note : when XXH3_consumeStripes() is invoked, - * there must be a guarantee that at least one more byte must be consumed from input - * so that the function can blindly consume all stripes using the "normal" secret segment */ -XXH_FORCE_INLINE void +/*! + * @internal + * @brief Processes a large input for XXH3_update() and XXH3_digest_long(). + * + * Unlike XXH3_hashLong_internal_loop(), this can process data that overlaps a block. + * + * @param acc Pointer to the 8 accumulator lanes + * @param nbStripesSoFarPtr In/out pointer to the number of leftover stripes in the block* + * @param nbStripesPerBlock Number of stripes in a block + * @param input Input pointer + * @param nbStripes Number of stripes to process + * @param secret Secret pointer + * @param secretLimit Offset of the last block in @p secret + * @param f_acc Pointer to an XXH3_accumulate implementation + * @param f_scramble Pointer to an XXH3_scrambleAcc implementation + * @return Pointer past the end of @p input after processing + */ +XXH_FORCE_INLINE const xxh_u8 * XXH3_consumeStripes(xxh_u64* XXH_RESTRICT acc, size_t* XXH_RESTRICT nbStripesSoFarPtr, size_t nbStripesPerBlock, const xxh_u8* XXH_RESTRICT input, size_t nbStripes, const xxh_u8* XXH_RESTRICT secret, size_t secretLimit, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble) { - XXH_ASSERT(nbStripes <= nbStripesPerBlock); /* can handle max 1 scramble per invocation */ - XXH_ASSERT(*nbStripesSoFarPtr < nbStripesPerBlock); - if (nbStripesPerBlock - *nbStripesSoFarPtr <= nbStripes) { - /* need a scrambling operation */ - size_t const nbStripesToEndofBlock = nbStripesPerBlock - *nbStripesSoFarPtr; - size_t const nbStripesAfterBlock = nbStripes - nbStripesToEndofBlock; - XXH3_accumulate(acc, input, secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, nbStripesToEndofBlock, f_acc512); - f_scramble(acc, secret + secretLimit); - XXH3_accumulate(acc, input + nbStripesToEndofBlock * XXH_STRIPE_LEN, secret, nbStripesAfterBlock, f_acc512); - *nbStripesSoFarPtr = nbStripesAfterBlock; - } else { - XXH3_accumulate(acc, input, secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, nbStripes, f_acc512); + const xxh_u8* initialSecret = secret + *nbStripesSoFarPtr * XXH_SECRET_CONSUME_RATE; + /* Process full blocks */ + if (nbStripes >= (nbStripesPerBlock - *nbStripesSoFarPtr)) { + /* Process the initial partial block... */ + size_t nbStripesThisIter = nbStripesPerBlock - *nbStripesSoFarPtr; + + do { + /* Accumulate and scramble */ + f_acc(acc, input, initialSecret, nbStripesThisIter); + f_scramble(acc, secret + secretLimit); + input += nbStripesThisIter * XXH_STRIPE_LEN; + nbStripes -= nbStripesThisIter; + /* Then continue the loop with the full block size */ + nbStripesThisIter = nbStripesPerBlock; + initialSecret = secret; + } while (nbStripes >= nbStripesPerBlock); + *nbStripesSoFarPtr = 0; + } + /* Process a partial block */ + if (nbStripes > 0) { + f_acc(acc, input, initialSecret, nbStripes); + input += nbStripes * XXH_STRIPE_LEN; *nbStripesSoFarPtr += nbStripes; } + /* Return end pointer */ + return input; } #ifndef XXH3_STREAM_USE_STACK -# ifndef __clang__ /* clang doesn't need additional stack space */ +# if XXH_SIZE_OPT <= 0 && !defined(__clang__) /* clang doesn't need additional stack space */ # define XXH3_STREAM_USE_STACK 1 # endif #endif @@ -4816,7 +5982,7 @@ XXH3_consumeStripes(xxh_u64* XXH_RESTRICT acc, XXH_FORCE_INLINE XXH_errorcode XXH3_update(XXH3_state_t* XXH_RESTRICT const state, const xxh_u8* XXH_RESTRICT input, size_t len, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble) { if (input==NULL) { @@ -4832,7 +5998,8 @@ XXH3_update(XXH3_state_t* XXH_RESTRICT const state, * when operating accumulators directly into state. * Operating into stack space seems to enable proper optimization. * clang, on the other hand, doesn't seem to need this trick */ - XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[8]; memcpy(acc, state->acc, sizeof(acc)); + XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[8]; + XXH_memcpy(acc, state->acc, sizeof(acc)); #else xxh_u64* XXH_RESTRICT const acc = state->acc; #endif @@ -4840,7 +6007,7 @@ XXH3_update(XXH3_state_t* XXH_RESTRICT const state, XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE); /* small input : just fill in tmp buffer */ - if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { + if (len <= XXH3_INTERNALBUFFER_SIZE - state->bufferedSize) { XXH_memcpy(state->buffer + state->bufferedSize, input, len); state->bufferedSize += (XXH32_hash_t)len; return XXH_OK; @@ -4862,57 +6029,20 @@ XXH3_update(XXH3_state_t* XXH_RESTRICT const state, &state->nbStripesSoFar, state->nbStripesPerBlock, state->buffer, XXH3_INTERNALBUFFER_STRIPES, secret, state->secretLimit, - f_acc512, f_scramble); + f_acc, f_scramble); state->bufferedSize = 0; } XXH_ASSERT(input < bEnd); - - /* large input to consume : ingest per full block */ - if ((size_t)(bEnd - input) > state->nbStripesPerBlock * XXH_STRIPE_LEN) { + if (bEnd - input > XXH3_INTERNALBUFFER_SIZE) { size_t nbStripes = (size_t)(bEnd - 1 - input) / XXH_STRIPE_LEN; - XXH_ASSERT(state->nbStripesPerBlock >= state->nbStripesSoFar); - /* join to current block's end */ - { size_t const nbStripesToEnd = state->nbStripesPerBlock - state->nbStripesSoFar; - XXH_ASSERT(nbStripes <= nbStripes); - XXH3_accumulate(acc, input, secret + state->nbStripesSoFar * XXH_SECRET_CONSUME_RATE, nbStripesToEnd, f_acc512); - f_scramble(acc, secret + state->secretLimit); - state->nbStripesSoFar = 0; - input += nbStripesToEnd * XXH_STRIPE_LEN; - nbStripes -= nbStripesToEnd; - } - /* consume per entire blocks */ - while(nbStripes >= state->nbStripesPerBlock) { - XXH3_accumulate(acc, input, secret, state->nbStripesPerBlock, f_acc512); - f_scramble(acc, secret + state->secretLimit); - input += state->nbStripesPerBlock * XXH_STRIPE_LEN; - nbStripes -= state->nbStripesPerBlock; - } - /* consume last partial block */ - XXH3_accumulate(acc, input, secret, nbStripes, f_acc512); - input += nbStripes * XXH_STRIPE_LEN; - XXH_ASSERT(input < bEnd); /* at least some bytes left */ - state->nbStripesSoFar = nbStripes; - /* buffer predecessor of last partial stripe */ - XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN); - XXH_ASSERT(bEnd - input <= XXH_STRIPE_LEN); - } else { - /* content to consume <= block size */ - /* Consume input by a multiple of internal buffer size */ - if (bEnd - input > XXH3_INTERNALBUFFER_SIZE) { - const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE; - do { - XXH3_consumeStripes(acc, + input = XXH3_consumeStripes(acc, &state->nbStripesSoFar, state->nbStripesPerBlock, - input, XXH3_INTERNALBUFFER_STRIPES, - secret, state->secretLimit, - f_acc512, f_scramble); - input += XXH3_INTERNALBUFFER_SIZE; - } while (inputbuffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN); - } - } + input, nbStripes, + secret, state->secretLimit, + f_acc, f_scramble); + XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN); + } /* Some remaining input (always) : buffer it */ XXH_ASSERT(input < bEnd); XXH_ASSERT(bEnd - input <= XXH3_INTERNALBUFFER_SIZE); @@ -4921,19 +6051,19 @@ XXH3_update(XXH3_state_t* XXH_RESTRICT const state, state->bufferedSize = (XXH32_hash_t)(bEnd-input); #if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1 /* save stack accumulators into state */ - memcpy(state->acc, acc, sizeof(acc)); + XXH_memcpy(state->acc, acc, sizeof(acc)); #endif } return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_64bits_update(XXH3_state_t* state, const void* input, size_t len) +XXH3_64bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len) { return XXH3_update(state, (const xxh_u8*)input, len, - XXH3_accumulate_512, XXH3_scrambleAcc); + XXH3_accumulate, XXH3_scrambleAcc); } @@ -4942,37 +6072,40 @@ XXH3_digest_long (XXH64_hash_t* acc, const XXH3_state_t* state, const unsigned char* secret) { + xxh_u8 lastStripe[XXH_STRIPE_LEN]; + const xxh_u8* lastStripePtr; + /* * Digest on a local copy. This way, the state remains unaltered, and it can * continue ingesting more input afterwards. */ XXH_memcpy(acc, state->acc, sizeof(state->acc)); if (state->bufferedSize >= XXH_STRIPE_LEN) { + /* Consume remaining stripes then point to remaining data in buffer */ size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN; size_t nbStripesSoFar = state->nbStripesSoFar; XXH3_consumeStripes(acc, &nbStripesSoFar, state->nbStripesPerBlock, state->buffer, nbStripes, secret, state->secretLimit, - XXH3_accumulate_512, XXH3_scrambleAcc); - /* last stripe */ - XXH3_accumulate_512(acc, - state->buffer + state->bufferedSize - XXH_STRIPE_LEN, - secret + state->secretLimit - XXH_SECRET_LASTACC_START); + XXH3_accumulate, XXH3_scrambleAcc); + lastStripePtr = state->buffer + state->bufferedSize - XXH_STRIPE_LEN; } else { /* bufferedSize < XXH_STRIPE_LEN */ - xxh_u8 lastStripe[XXH_STRIPE_LEN]; + /* Copy to temp buffer */ size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize; XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */ XXH_memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); XXH_memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize); - XXH3_accumulate_512(acc, - lastStripe, - secret + state->secretLimit - XXH_SECRET_LASTACC_START); + lastStripePtr = lastStripe; } + /* Last stripe */ + XXH3_accumulate_512(acc, + lastStripePtr, + secret + state->secretLimit - XXH_SECRET_LASTACC_START); } -/*! @ingroup xxh3_family */ -XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state) +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* state) { const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret; if (state->totalLen > XXH3_MIDSIZE_MAX) { @@ -4988,7 +6121,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state) return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen), secret, state->secretLimit + XXH_STRIPE_LEN); } - +#endif /* !XXH_NO_STREAM */ /* ========================================== @@ -5008,7 +6141,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state) * fast for a _128-bit_ hash on 32-bit (it usually clears XXH64). */ -XXH_FORCE_INLINE XXH128_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t XXH3_len_1to3_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { /* A doubled version of 1to3_64b with different constants. */ @@ -5037,7 +6170,7 @@ XXH3_len_1to3_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_ } } -XXH_FORCE_INLINE XXH128_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t XXH3_len_4to8_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(input != NULL); @@ -5057,14 +6190,14 @@ XXH3_len_4to8_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_ m128.low64 ^= (m128.high64 >> 3); m128.low64 = XXH_xorshift64(m128.low64, 35); - m128.low64 *= 0x9FB21C651E98DF25ULL; + m128.low64 *= PRIME_MX2; m128.low64 = XXH_xorshift64(m128.low64, 28); m128.high64 = XXH3_avalanche(m128.high64); return m128; } } -XXH_FORCE_INLINE XXH128_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t XXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(input != NULL); @@ -5139,7 +6272,7 @@ XXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64 /* * Assumption: `secret` size is >= XXH3_SECRET_SIZE_MIN */ -XXH_FORCE_INLINE XXH128_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t XXH3_len_0to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) { XXH_ASSERT(len <= 16); @@ -5170,7 +6303,7 @@ XXH128_mix32B(XXH128_hash_t acc, const xxh_u8* input_1, const xxh_u8* input_2, } -XXH_FORCE_INLINE XXH128_hash_t +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, XXH64_hash_t seed) @@ -5181,6 +6314,16 @@ XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len, { XXH128_hash_t acc; acc.low64 = len * XXH_PRIME64_1; acc.high64 = 0; + +#if XXH_SIZE_OPT >= 1 + { + /* Smaller, but slightly slower. */ + unsigned int i = (unsigned int)(len - 1) / 32; + do { + acc = XXH128_mix32B(acc, input+16*i, input+len-16*(i+1), secret+32*i, seed); + } while (i-- != 0); + } +#else if (len > 32) { if (len > 64) { if (len > 96) { @@ -5191,6 +6334,7 @@ XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len, acc = XXH128_mix32B(acc, input+16, input+len-32, secret+32, seed); } acc = XXH128_mix32B(acc, input, input+len-16, secret, seed); +#endif { XXH128_hash_t h128; h128.low64 = acc.low64 + acc.high64; h128.high64 = (acc.low64 * XXH_PRIME64_1) @@ -5203,7 +6347,7 @@ XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len, } } -XXH_NO_INLINE XXH128_hash_t +XXH_NO_INLINE XXH_PUREF XXH128_hash_t XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, XXH64_hash_t seed) @@ -5212,25 +6356,34 @@ XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len, XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); { XXH128_hash_t acc; - int const nbRounds = (int)len / 32; - int i; + unsigned i; acc.low64 = len * XXH_PRIME64_1; acc.high64 = 0; - for (i=0; i<4; i++) { + /* + * We set as `i` as offset + 32. We do this so that unchanged + * `len` can be used as upper bound. This reaches a sweet spot + * where both x86 and aarch64 get simple agen and good codegen + * for the loop. + */ + for (i = 32; i < 160; i += 32) { acc = XXH128_mix32B(acc, - input + (32 * i), - input + (32 * i) + 16, - secret + (32 * i), + input + i - 32, + input + i - 16, + secret + i - 32, seed); } acc.low64 = XXH3_avalanche(acc.low64); acc.high64 = XXH3_avalanche(acc.high64); - XXH_ASSERT(nbRounds >= 4); - for (i=4 ; i < nbRounds; i++) { + /* + * NB: `i <= len` will duplicate the last 32-bytes if + * len % 32 was zero. This is an unfortunate necessity to keep + * the hash result stable. + */ + for (i=160; i <= len; i += 32) { acc = XXH128_mix32B(acc, - input + (32 * i), - input + (32 * i) + 16, - secret + XXH3_MIDSIZE_STARTOFFSET + (32 * (i - 4)), + input + i - 32, + input + i - 16, + secret + XXH3_MIDSIZE_STARTOFFSET + i - 160, seed); } /* last bytes */ @@ -5238,7 +6391,7 @@ XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len, input + len - 16, input + len - 32, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET - 16, - 0ULL - seed); + (XXH64_hash_t)0 - seed); { XXH128_hash_t h128; h128.low64 = acc.low64 + acc.high64; @@ -5255,12 +6408,12 @@ XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len, XXH_FORCE_INLINE XXH128_hash_t XXH3_hashLong_128b_internal(const void* XXH_RESTRICT input, size_t len, const xxh_u8* XXH_RESTRICT secret, size_t secretSize, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble) { XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; - XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, secret, secretSize, f_acc512, f_scramble); + XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, secret, secretSize, f_acc, f_scramble); /* converge into final hash */ XXH_STATIC_ASSERT(sizeof(acc) == 64); @@ -5278,21 +6431,24 @@ XXH3_hashLong_128b_internal(const void* XXH_RESTRICT input, size_t len, } /* - * It's important for performance that XXH3_hashLong is not inlined. + * It's important for performance that XXH3_hashLong() is not inlined. */ -XXH_NO_INLINE XXH128_hash_t +XXH_NO_INLINE XXH_PUREF XXH128_hash_t XXH3_hashLong_128b_default(const void* XXH_RESTRICT input, size_t len, XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen) { (void)seed64; (void)secret; (void)secretLen; return XXH3_hashLong_128b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), - XXH3_accumulate_512, XXH3_scrambleAcc); + XXH3_accumulate, XXH3_scrambleAcc); } /* - * It's important for performance to pass @secretLen (when it's static) + * It's important for performance to pass @p secretLen (when it's static) * to the compiler, so that it can properly optimize the vectorized loop. + * + * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE + * breaks -Og, this is XXH_NO_INLINE. */ XXH3_WITH_SECRET_INLINE XXH128_hash_t XXH3_hashLong_128b_withSecret(const void* XXH_RESTRICT input, size_t len, @@ -5301,24 +6457,24 @@ XXH3_hashLong_128b_withSecret(const void* XXH_RESTRICT input, size_t len, { (void)seed64; return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, secretLen, - XXH3_accumulate_512, XXH3_scrambleAcc); + XXH3_accumulate, XXH3_scrambleAcc); } XXH_FORCE_INLINE XXH128_hash_t XXH3_hashLong_128b_withSeed_internal(const void* XXH_RESTRICT input, size_t len, XXH64_hash_t seed64, - XXH3_f_accumulate_512 f_acc512, + XXH3_f_accumulate f_acc, XXH3_f_scrambleAcc f_scramble, XXH3_f_initCustomSecret f_initSec) { if (seed64 == 0) return XXH3_hashLong_128b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), - f_acc512, f_scramble); + f_acc, f_scramble); { XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; f_initSec(secret, seed64); return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, sizeof(secret), - f_acc512, f_scramble); + f_acc, f_scramble); } } @@ -5331,7 +6487,7 @@ XXH3_hashLong_128b_withSeed(const void* input, size_t len, { (void)secret; (void)secretLen; return XXH3_hashLong_128b_withSeed_internal(input, len, seed64, - XXH3_accumulate_512, XXH3_scrambleAcc, XXH3_initCustomSecret); + XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret); } typedef XXH128_hash_t (*XXH3_hashLong128_f)(const void* XXH_RESTRICT, size_t, @@ -5361,94 +6517,93 @@ XXH3_128bits_internal(const void* input, size_t len, /* === Public XXH128 API === */ -/*! @ingroup xxh3_family */ -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(const void* input, size_t len) +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* input, size_t len) { return XXH3_128bits_internal(input, len, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_128b_default); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH128_hash_t -XXH3_128bits_withSecret(const void* input, size_t len, const void* secret, size_t secretSize) +XXH3_128bits_withSecret(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize) { return XXH3_128bits_internal(input, len, 0, (const xxh_u8*)secret, secretSize, XXH3_hashLong_128b_withSecret); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH128_hash_t -XXH3_128bits_withSeed(const void* input, size_t len, XXH64_hash_t seed) +XXH3_128bits_withSeed(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) { return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_128b_withSeed); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH128_hash_t -XXH3_128bits_withSecretandSeed(const void* input, size_t len, const void* secret, size_t secretSize, XXH64_hash_t seed) +XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) { if (len <= XXH3_MIDSIZE_MAX) return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL); return XXH3_hashLong_128b_withSecret(input, len, seed, secret, secretSize); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH128_hash_t -XXH128(const void* input, size_t len, XXH64_hash_t seed) +XXH128(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) { return XXH3_128bits_withSeed(input, len, seed); } /* === XXH3 128-bit streaming === */ - +#ifndef XXH_NO_STREAM /* * All initialization and update functions are identical to 64-bit streaming variant. * The only difference is the finalization routine. */ -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_reset(XXH3_state_t* statePtr) +XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr) { return XXH3_64bits_reset(statePtr); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize) +XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize) { return XXH3_64bits_reset_withSecret(statePtr, secret, secretSize); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed) +XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed) { return XXH3_64bits_reset_withSeed(statePtr, seed); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, const void* secret, size_t secretSize, XXH64_hash_t seed) +XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) { return XXH3_64bits_reset_withSecretandSeed(statePtr, secret, secretSize, seed); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_128bits_update(XXH3_state_t* state, const void* input, size_t len) +XXH3_128bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len) { - return XXH3_update(state, (const xxh_u8*)input, len, - XXH3_accumulate_512, XXH3_scrambleAcc); + return XXH3_64bits_update(state, input, len); } -/*! @ingroup xxh3_family */ -XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* state) +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* state) { const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret; if (state->totalLen > XXH3_MIDSIZE_MAX) { @@ -5472,13 +6627,13 @@ XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* state) return XXH3_128bits_withSecret(state->buffer, (size_t)(state->totalLen), secret, state->secretLimit + XXH_STRIPE_LEN); } - +#endif /* !XXH_NO_STREAM */ /* 128-bit utility functions */ #include /* memcmp, memcpy */ /* return : 1 is equal, 0 if different */ -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2) { /* note : XXH128_hash_t is compact, it has no padding byte */ @@ -5486,11 +6641,11 @@ XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2) } /* This prototype is compatible with stdlib's qsort(). - * return : >0 if *h128_1 > *h128_2 - * <0 if *h128_1 < *h128_2 - * =0 if *h128_1 == *h128_2 */ -/*! @ingroup xxh3_family */ -XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2) + * @return : >0 if *h128_1 > *h128_2 + * <0 if *h128_1 < *h128_2 + * =0 if *h128_1 == *h128_2 */ +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2) { XXH128_hash_t const h1 = *(const XXH128_hash_t*)h128_1; XXH128_hash_t const h2 = *(const XXH128_hash_t*)h128_2; @@ -5502,9 +6657,9 @@ XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2) /*====== Canonical representation ======*/ -/*! @ingroup xxh3_family */ -static zend_always_inline void -XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash) +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API void +XXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash) { XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == sizeof(XXH128_hash_t)); if (XXH_CPU_LITTLE_ENDIAN) { @@ -5515,9 +6670,9 @@ XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash) XXH_memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64)); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH128_hash_t -XXH128_hashFromCanonical(const XXH128_canonical_t* src) +XXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src) { XXH128_hash_t h; h.high64 = XXH_readBE64(src); @@ -5533,26 +6688,34 @@ XXH128_hashFromCanonical(const XXH128_canonical_t* src) */ #define XXH_MIN(x, y) (((x) > (y)) ? (y) : (x)) -static void XXH3_combine16(void* dst, XXH128_hash_t h128) +XXH_FORCE_INLINE void XXH3_combine16(void* dst, XXH128_hash_t h128) { XXH_writeLE64( dst, XXH_readLE64(dst) ^ h128.low64 ); XXH_writeLE64( (char*)dst+8, XXH_readLE64((char*)dst+8) ^ h128.high64 ); } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API XXH_errorcode -XXH3_generateSecret(void* secretBuffer, size_t secretSize, const void* customSeed, size_t customSeedSize) +XXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize) { +#if (XXH_DEBUGLEVEL >= 1) XXH_ASSERT(secretBuffer != NULL); - if (secretBuffer == NULL) return XXH_ERROR; XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); +#else + /* production mode, assert() are disabled */ + if (secretBuffer == NULL) return XXH_ERROR; if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR; +#endif + if (customSeedSize == 0) { customSeed = XXH3_kSecret; customSeedSize = XXH_SECRET_DEFAULT_SIZE; } +#if (XXH_DEBUGLEVEL >= 1) XXH_ASSERT(customSeed != NULL); +#else if (customSeed == NULL) return XXH_ERROR; +#endif /* Fill secretBuffer with a copy of customSeed - repeat as needed */ { size_t pos = 0; @@ -5576,9 +6739,9 @@ XXH3_generateSecret(void* secretBuffer, size_t secretSize, const void* customSee return XXH_OK; } -/*! @ingroup xxh3_family */ +/*! @ingroup XXH3_family */ XXH_PUBLIC_API void -XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed) +XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed) { XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; XXH3_initCustomSecret(secret, seed); @@ -5591,7 +6754,7 @@ XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed) /* Pop our optimization override from above */ #if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \ && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \ - && defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__) /* respect -O0 and -Os */ + && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */ # pragma GCC pop_options #endif @@ -5606,5 +6769,5 @@ XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed) #if defined (__cplusplus) -} +} /* extern "C" */ #endif From baa5319632b7fd2f4c424f25cda18a8bbf5eb64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 8 Oct 2025 22:59:54 +0200 Subject: [PATCH 167/386] json: Improve performance of `php_json_encode_array()` for non-hooked fields (#20105) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `tmp` can only ever be non-undef if there's a hooked object property, which is already an `UNEXPECTED()` case. Keep track of whether this case is hit or not to avoid needlessly calling `zval_ptr_dtor()`. For: flags & ZEND_ACC_VIRTUAL) && !prop_info->hooks[ZEND_PROPERTY_HOOK_GET]) { continue; } + need_dtor = true; data = zend_read_property_ex(prop_info->ce, Z_OBJ_P(val), prop_info->name, /* silent */ true, &tmp); if (EG(exception)) { PHP_JSON_HASH_UNPROTECT_RECURSION(recursion_rc); @@ -303,7 +305,9 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, zval_ptr_dtor(&tmp); return FAILURE; } - zval_ptr_dtor(&tmp); + if (UNEXPECTED(need_dtor)) { + zval_ptr_dtor(&tmp); + } smart_str_appendc(buf, ','); } ZEND_HASH_FOREACH_END(); From 8f488f9556dd869e4e55bb876bf75af5e1493e20 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Mon, 6 Oct 2025 17:51:39 +0200 Subject: [PATCH 168/386] Mask USR1/HUP while waiting for preloading Preloading may fork and wait for the child to exit. In case waitpid() is interrupted, the parent exits with a fatal error. This is fine when the syscall is interrupted by a signal whose disposition is set to terminate the process, but not otherwise. In the apache2handler SAPI, the parent is the control process. Restarting apache2 is done by sending SIGUSR1 or SIGHUP to the control process. Doing that during the waitpid() syscall would cause the control process to exit instead. Block the USR1 and HUP signals from being delivered during the syscall when running the apache2handler SAPI, as these are not supposed to terminate the process. FPM is fine as it masks relevant signals during php startup. Fixes GH-20051 Closes GH-20079 Co-authored-by: mycozyhom --- ext/opcache/ZendAccelerator.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 37ebc6228765a..e6a2b90e8fffc 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -5090,13 +5090,45 @@ static zend_result accel_finish_startup(void) exit(ret == SUCCESS ? 0 : 1); } else { /* parent */ - int status; +# ifdef HAVE_SIGPROCMASK + /* Interrupting the waitpid() call below with a signal would cause the + * process to exit. This is fine when the signal disposition is set to + * terminate the process, but not otherwise. + * When running the apache2handler, preloading is performed in the + * control process. SIGUSR1 and SIGHUP are used to tell the control + * process to restart children. Exiting when these signals are received + * would unexpectedly shutdown the server instead of restarting it. + * Block the USR1 and HUP signals from being delivered during the + * syscall when running the apache2handler SAPI, as these are not + * supposed to terminate the process. See GH-20051. */ + bool is_apache2handler = strcmp(sapi_module.name, "apache2handler") == 0; + sigset_t set, oldset; + if (is_apache2handler) { + if (sigemptyset(&set) + || sigaddset(&set, SIGUSR1) + || sigaddset(&set, SIGHUP)) { + ZEND_UNREACHABLE(); + } + if (sigprocmask(SIG_BLOCK, &set, &oldset)) { + ZEND_UNREACHABLE(); + } + } +# endif + int status; if (waitpid(pid, &status, 0) < 0) { zend_shared_alloc_unlock(); zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Preloading failed to waitpid(%d)", pid); } +# ifdef HAVE_SIGPROCMASK + if (is_apache2handler) { + if (sigprocmask(SIG_SETMASK, &oldset, NULL)) { + ZEND_UNREACHABLE(); + } + } +# endif + if (ZCSG(preload_script)) { preload_load(zend_map_ptr_static_last); } From 5eed7ea816f9c47bd0b1a73258843fef69c73fd8 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 10 Oct 2025 16:58:56 +0200 Subject: [PATCH 169/386] NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index ab372893ce661..993bdda130cd9 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,10 @@ PHP NEWS with a given skeleton, locale, collapse type and identity fallback. (BogdanUngureanu) +- Opcache: + . Fixed bug GH-20051 (apache2 shutdowns when restart is requested during + preloading). (Arnaud, welcomycozyhom) + - Standard: . Fixed bug GH-19926 (reset internal pointer earlier while splicing array while COW violation flag is still set). (alexandre-daubois) From 571f119f1d63f52a525559a4c06abd77ebce96b7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:17:48 +0200 Subject: [PATCH 170/386] dom: Remove pointless checks when setting options --- ext/dom/document.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/dom/document.c b/ext/dom/document.c index c56ec257cec31..4447e88cfc55a 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1432,16 +1432,16 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source, ctxt->sax->warning = php_libxml_ctx_warning; } - if (validate && ! (options & XML_PARSE_DTDVALID)) { + if (validate) { options |= XML_PARSE_DTDVALID; } - if (resolve_externals && ! (options & XML_PARSE_DTDATTR)) { + if (resolve_externals) { options |= XML_PARSE_DTDATTR; } - if (substitute_ent && ! (options & XML_PARSE_NOENT)) { + if (substitute_ent) { options |= XML_PARSE_NOENT; } - if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) { + if (keep_blanks == 0) { options |= XML_PARSE_NOBLANKS; } if (recover) { From 106079a462535d78cfb42523d19cb6925897ea24 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:20:55 +0200 Subject: [PATCH 171/386] dom: Switch to new safe option setting API This API does not suffer from the global issue and does therefore not require a sanitization fixup. The API for XML is available starting from libxml 2.13, the one for HTML since 2.14. --- ext/dom/document.c | 10 ++++++++++ ext/dom/inner_outer_html_mixin.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/ext/dom/document.c b/ext/dom/document.c index 4447e88cfc55a..4d366db08f0eb 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1448,8 +1448,12 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source, options |= XML_PARSE_RECOVER; } +#if LIBXML_VERSION >= 21300 + xmlCtxtSetOptions(ctxt, options); +#else php_libxml_sanitize_parse_ctxt_options(ctxt); xmlCtxtUseOptions(ctxt, options); +#endif if (recover) { old_error_reporting = EG(error_reporting); @@ -2086,10 +2090,16 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ ctxt->sax->error = php_libxml_ctx_error; ctxt->sax->warning = php_libxml_ctx_warning; } +#if LIBXML_VERSION >= 21400 + if (options) { + htmlCtxtSetOptions(ctxt, (int)options); + } +#else php_libxml_sanitize_parse_ctxt_options(ctxt); if (options) { htmlCtxtUseOptions(ctxt, (int)options); } +#endif htmlParseDocument(ctxt); xmlDocPtr newdoc = ctxt->myDoc; htmlFreeParserCtxt(ctxt); diff --git a/ext/dom/inner_outer_html_mixin.c b/ext/dom/inner_outer_html_mixin.c index eee525cc47a6e..85124d41689af 100644 --- a/ext/dom/inner_outer_html_mixin.c +++ b/ext/dom/inner_outer_html_mixin.c @@ -291,8 +291,12 @@ static xmlNodePtr dom_xml_fragment_parsing_algorithm(dom_object *obj, const xmlN } parser->dict = context_node->doc->dict; +#if LIBXML_VERSION >= 21300 + xmlCtxtSetOptions(parser, XML_PARSE_IGNORE_ENC | XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_NO_XXE); +#else php_libxml_sanitize_parse_ctxt_options(parser); xmlCtxtUseOptions(parser, XML_PARSE_IGNORE_ENC | XML_PARSE_NOERROR | XML_PARSE_NOWARNING); +#endif xmlCharEncodingHandlerPtr encoding = xmlFindCharEncodingHandler("UTF-8"); (void) xmlSwitchToEncoding(parser, encoding); From 890021e2be5862cae4aae0bb71a0a80515d992de Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 10:46:33 +0200 Subject: [PATCH 172/386] SimpleXML: Use RETURN_STRINGL_FAST() for key() (#20127) We do the same for getName() because names are often one char. --- ext/simplexml/simplexml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 58d7157e91d32..82165afd353db 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -2028,7 +2028,7 @@ PHP_METHOD(SimpleXMLElement, key) } curnode = intern->node->node; - RETURN_STRINGL((char*)curnode->name, xmlStrlen(curnode->name)); + RETURN_STRINGL_FAST((char*)curnode->name, xmlStrlen(curnode->name)); } /* }}} */ From a572b1015b0f57f80e0af0775525c8ae397cdba0 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 10:46:44 +0200 Subject: [PATCH 173/386] xml: Switch to safe option setting API (#20128) --- ext/xml/compat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index ea72a958006e2..21184be87182b 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -452,8 +452,12 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m return NULL; } +#if LIBXML_VERSION >= 21300 + xmlCtxtSetOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT); +#else php_libxml_sanitize_parse_ctxt_options(parser->parser); xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT); +#endif parser->parser->wellFormed = 0; if (sep != NULL) { From c3b66cdb449d0e80a960e80c7961fdd3418bda92 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 11:27:24 +0200 Subject: [PATCH 174/386] [ci skip] Fix test formatting --- ext/intl/tests/formatter/currencies.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/intl/tests/formatter/currencies.phpt b/ext/intl/tests/formatter/currencies.phpt index 01c64a0480d37..1293283e7fc2b 100644 --- a/ext/intl/tests/formatter/currencies.phpt +++ b/ext/intl/tests/formatter/currencies.phpt @@ -1,6 +1,6 @@ --TEST-- NumberFormatter: currency formatting -----DESCRIPTION-- +--DESCRIPTION-- Tests NumberFormatter with various currenct-related formatters. --EXTENSIONS-- intl From 7f655125114a4252c4c1ca99e5ae419402721bac Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 11 Oct 2025 14:16:57 +0100 Subject: [PATCH 175/386] ext/intl: migrate C code to C++ step 3. (#19411) --- ext/intl/common/common_date.h | 3 + ext/intl/config.m4 | 26 ++++----- ext/intl/config.w32 | 22 +++---- .../converter/{converter.c => converter.cpp} | 50 ++++++++-------- ext/intl/converter/converter.h | 6 ++ .../{dateformat.c => dateformat.cpp} | 6 +- ...{dateformat_attr.c => dateformat_attr.cpp} | 26 +++++---- ext/intl/dateformat/dateformat_class.h | 6 ++ ...{dateformat_data.c => dateformat_data.cpp} | 6 +- ext/intl/dateformat/dateformat_data.h | 12 ++++ ...eformat_format.c => dateformat_format.cpp} | 6 +- ...ateformat_parse.c => dateformat_parse.cpp} | 10 ++-- .../{formatter_attr.c => formatter_attr.cpp} | 58 +++++++++++-------- ext/intl/formatter/formatter_class.h | 12 ++++ .../{formatter_data.c => formatter_data.cpp} | 2 +- ext/intl/formatter/formatter_data.h | 12 ++++ ...ormatter_format.c => formatter_format.cpp} | 8 ++- .../{formatter_main.c => formatter_main.cpp} | 15 +++-- ...{formatter_parse.c => formatter_parse.cpp} | 8 ++- 19 files changed, 187 insertions(+), 107 deletions(-) rename ext/intl/converter/{converter.c => converter.cpp} (95%) rename ext/intl/dateformat/{dateformat.c => dateformat.cpp} (94%) rename ext/intl/dateformat/{dateformat_attr.c => dateformat_attr.cpp} (90%) rename ext/intl/dateformat/{dateformat_data.c => dateformat_data.cpp} (91%) rename ext/intl/dateformat/{dateformat_format.c => dateformat_format.cpp} (99%) rename ext/intl/dateformat/{dateformat_parse.c => dateformat_parse.cpp} (96%) rename ext/intl/formatter/{formatter_attr.c => formatter_attr.cpp} (86%) rename ext/intl/formatter/{formatter_data.c => formatter_data.cpp} (94%) rename ext/intl/formatter/{formatter_format.c => formatter_format.cpp} (98%) rename ext/intl/formatter/{formatter_main.c => formatter_main.cpp} (91%) rename ext/intl/formatter/{formatter_parse.c => formatter_parse.cpp} (98%) diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h index ef007c8eee687..988f279294c3c 100644 --- a/ext/intl/common/common_date.h +++ b/ext/intl/common/common_date.h @@ -24,6 +24,9 @@ U_CDECL_END #ifdef __cplusplus +// TODO once C++ migration done we can drop this workaround +#undef U_SHOW_CPLUSPLUS_API +#define U_SHOW_CPLUSPLUS_API 1 #include using icu::TimeZone; diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index f54e563af4ee5..8b95eb4b68f12 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -18,19 +18,8 @@ if test "$PHP_INTL" != "no"; then collator/collator_locale.c collator/collator_sort.c common/common_error.c - converter/converter.c - dateformat/dateformat_attr.c dateformat/dateformat_class.c - dateformat/dateformat_data.c - dateformat/dateformat_format.c - dateformat/dateformat_parse.c - dateformat/dateformat.c - formatter/formatter_attr.c formatter/formatter_class.c - formatter/formatter_data.c - formatter/formatter_format.c - formatter/formatter_main.c - formatter/formatter_parse.c grapheme/grapheme_string.c grapheme/grapheme_util.c intl_convert.c @@ -53,10 +42,16 @@ if test "$PHP_INTL" != "no"; then PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \ common/common_enum.cpp \ common/common_date.cpp \ - dateformat/dateformat_format_object.cpp \ - dateformat/dateformat_create.cpp \ + converter/converter.cpp \ + dateformat/dateformat.cpp \ + dateformat/dateformat_attr.cpp \ dateformat/dateformat_attrcpp.cpp \ + dateformat/dateformat_create.cpp \ + dateformat/dateformat_data.cpp \ + dateformat/dateformat_format.cpp \ + dateformat/dateformat_format_object.cpp \ dateformat/dateformat_helpers.cpp \ + dateformat/dateformat_parse.cpp \ dateformat/datepatterngenerator_class.cpp \ dateformat/datepatterngenerator_methods.cpp \ msgformat/msgformat_helpers.cpp \ @@ -66,6 +61,11 @@ if test "$PHP_INTL" != "no"; then calendar/calendar_class.cpp \ calendar/calendar_methods.cpp \ calendar/gregoriancalendar_methods.cpp \ + formatter/formatter_attr.cpp \ + formatter/formatter_data.cpp \ + formatter/formatter_format.cpp \ + formatter/formatter_main.cpp \ + formatter/formatter_parse.cpp \ msgformat/msgformat_attr.cpp \ msgformat/msgformat_class.cpp \ msgformat/msgformat_data.cpp \ diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index 9d68a7c2d3ef7..22db382fd0e08 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -29,15 +29,15 @@ if (PHP_INTL != "no") { common_date.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/converter", "\ - converter.c \ + converter.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/formatter", "\ - formatter_attr.c \ + formatter_attr.cpp \ formatter_class.c \ - formatter_data.c \ - formatter_format.c \ - formatter_main.c \ - formatter_parse.c \ + formatter_data.cpp \ + formatter_format.cpp \ + formatter_main.cpp \ + formatter_parse.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/listformatter", "\ listformatter_class.c \ @@ -67,13 +67,13 @@ if (PHP_INTL != "no") { rangeformatter_class.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/dateformat", "\ - dateformat.c \ + dateformat.cpp \ dateformat_class.c \ - dateformat_attr.c \ - dateformat_format.c \ + dateformat_attr.cpp \ + dateformat_format.cpp \ dateformat_format_object.cpp \ - dateformat_parse.c \ - dateformat_data.c \ + dateformat_parse.cpp \ + dateformat_data.cpp \ dateformat_attrcpp.cpp \ dateformat_helpers.cpp \ dateformat_create.cpp \ diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.cpp similarity index 95% rename from ext/intl/converter/converter.c rename to ext/intl/converter/converter.cpp index 465700e961800..ad68909b5ea3c 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.cpp @@ -12,7 +12,6 @@ +----------------------------------------------------------------------+ */ -#include "converter.h" #include "zend_exceptions.h" #include @@ -21,10 +20,13 @@ #include #include +extern "C" { +#include "converter.h" +#include "php_intl.h" #include "../intl_error.h" #include "../intl_common.h" +} #include "converter_arginfo.h" -#include "php_intl.h" typedef struct _php_converter_object { UConverter *src, *dest; @@ -238,9 +240,9 @@ static void php_converter_to_u_callback(const void *context, } if (Z_TYPE(zargs[3]) == IS_LONG) { - *pErrorCode = Z_LVAL(zargs[3]); + *pErrorCode = static_cast(Z_LVAL(zargs[3])); } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { - *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); + *pErrorCode = static_cast(Z_LVAL_P(Z_REFVAL(zargs[3]))); } zval_ptr_dtor(&zargs[0]); @@ -265,7 +267,7 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni { size_t vallen = Z_STRLEN_P(val); if (TARGET_CHECK(args, vallen)) { - args->target = zend_mempcpy(args->target, Z_STRVAL_P(val), vallen); + args->target = reinterpret_cast(zend_mempcpy(args->target, Z_STRVAL_P(val), vallen)); } return; } @@ -315,9 +317,9 @@ static void php_converter_from_u_callback(const void *context, } if (Z_TYPE(zargs[3]) == IS_LONG) { - *pErrorCode = Z_LVAL(zargs[3]); + *pErrorCode = static_cast(Z_LVAL(zargs[3])); } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { - *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); + *pErrorCode = static_cast(Z_LVAL_P(Z_REFVAL(zargs[3]))); } zval_ptr_dtor(&zargs[0]); @@ -340,7 +342,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo } ucnv_setToUCallBack(cnv, (UConverterToUCallback)php_converter_to_u_callback, (const void*)objval, - NULL, NULL, &error); + nullptr, nullptr, &error); if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); ret = false; @@ -348,7 +350,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo error = U_ZERO_ERROR; ucnv_setFromUCallBack(cnv, (UConverterFromUCallback)php_converter_from_u_callback, (const void*)objval, - NULL, NULL, &error); + nullptr, nullptr, &error); if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); ret = false; @@ -507,14 +509,14 @@ static void php_converter_resolve_callback( const char *callback_name, size_t callback_name_len ) { - zend_function *fn = zend_hash_str_find_ptr_lc(&obj->ce->function_table, callback_name, callback_name_len); - ZEND_ASSERT(fn != NULL); + zend_function *fn = reinterpret_cast(zend_hash_str_find_ptr_lc(&obj->ce->function_table, callback_name, callback_name_len)); + ZEND_ASSERT(fn != nullptr); fcc->function_handler = fn; fcc->object = obj; fcc->called_scope = obj->ce; - fcc->calling_scope = NULL; - fcc->closure = NULL; + fcc->calling_scope = nullptr; + fcc->closure = nullptr; } /* }}} */ @@ -635,16 +637,16 @@ static zend_string* php_converter_do_convert(UConverter *dest_cnv, if (!src_cnv || !dest_cnv) { php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Internal converters not initialized"); - return NULL; + return nullptr; } /* Get necessary buffer size first */ temp_len = 1 + ucnv_toUChars(src_cnv, NULL, 0, src, src_len, &error); if (U_FAILURE(error) && error != U_BUFFER_OVERFLOW_ERROR) { THROW_UFAILURE(objval, error); - return NULL; + return nullptr; } - temp = safe_emalloc(sizeof(UChar), temp_len, sizeof(UChar)); + temp = reinterpret_cast(safe_emalloc(sizeof(UChar), temp_len, sizeof(UChar))); /* Convert to intermediate UChar* array */ error = U_ZERO_ERROR; @@ -652,7 +654,7 @@ static zend_string* php_converter_do_convert(UConverter *dest_cnv, if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); efree(temp); - return NULL; + return nullptr; } temp[temp_len] = 0; @@ -661,7 +663,7 @@ static zend_string* php_converter_do_convert(UConverter *dest_cnv, if (U_FAILURE(error) && error != U_BUFFER_OVERFLOW_ERROR) { THROW_UFAILURE(objval, error); efree(temp); - return NULL; + return nullptr; } ret = zend_string_alloc(ret_len, 0); @@ -673,7 +675,7 @@ static zend_string* php_converter_do_convert(UConverter *dest_cnv, if (U_FAILURE(error)) { THROW_UFAILURE(objval, error); zend_string_efree(ret); - return NULL; + return nullptr; } return ret; @@ -735,8 +737,8 @@ PHP_METHOD(UConverter, convert) { PHP_METHOD(UConverter, transcode) { char *str, *src, *dest; size_t str_len, src_len, dest_len; - zval *options = NULL; - UConverter *src_cnv = NULL, *dest_cnv = NULL; + zval *options = nullptr; + UConverter *src_cnv = nullptr, *dest_cnv = nullptr; ZEND_PARSE_PARAMETERS_START(3, 4) Z_PARAM_STRING(str, str_len) @@ -911,7 +913,7 @@ static void php_converter_free_object(zend_object *obj) { static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval) { php_converter_object *objval; - objval = zend_object_alloc(sizeof(php_converter_object), ce); + objval = reinterpret_cast(zend_object_alloc(sizeof(php_converter_object), ce)); zend_object_std_init(&objval->obj, ce); object_properties_init(&objval->obj, ce); @@ -923,7 +925,7 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte } static zend_object *php_converter_create_object(zend_class_entry *ce) { - php_converter_object *objval = NULL; + php_converter_object *objval = nullptr; zend_object *retval = php_converter_object_ctor(ce, &objval); object_properties_init(&(objval->obj), ce); @@ -968,7 +970,7 @@ static zend_object *php_converter_clone_object(zend_object *object) { /* }}} */ /* {{{ php_converter_minit */ -int php_converter_minit(INIT_FUNC_ARGS) { +U_CFUNC int php_converter_minit(INIT_FUNC_ARGS) { php_converter_ce = register_class_UConverter(); php_converter_ce->create_object = php_converter_create_object; php_converter_ce->default_object_handlers = &php_converter_object_handlers; diff --git a/ext/intl/converter/converter.h b/ext/intl/converter/converter.h index f9fb27b82a7d0..5d779560811d0 100644 --- a/ext/intl/converter/converter.h +++ b/ext/intl/converter/converter.h @@ -21,6 +21,12 @@ #include "php.h" +#ifdef __cplusplus +extern "C" { +#endif int php_converter_minit(INIT_FUNC_ARGS); +#ifdef __cplusplus +} +#endif #endif /* PHP_INTL_CONVERTER_H */ diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.cpp similarity index 94% rename from ext/intl/dateformat/dateformat.c rename to ext/intl/dateformat/dateformat.cpp index e6ebd5b789649..cf2b445590bb9 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.cpp @@ -17,12 +17,14 @@ #include +extern "C" { #include "php_intl.h" +} #include "dateformat_class.h" #include "dateformat.h" /* {{{ Get formatter's last error code. */ -PHP_FUNCTION( datefmt_get_error_code ) +U_CFUNC PHP_FUNCTION( datefmt_get_error_code ) { DATE_FORMAT_METHOD_INIT_VARS; @@ -41,7 +43,7 @@ PHP_FUNCTION( datefmt_get_error_code ) /* }}} */ /* {{{ Get text description for formatter's last error code. */ -PHP_FUNCTION( datefmt_get_error_message ) +U_CFUNC PHP_FUNCTION( datefmt_get_error_message ) { zend_string *message = NULL; DATE_FORMAT_METHOD_INIT_VARS; diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.cpp similarity index 90% rename from ext/intl/dateformat/dateformat_attr.c rename to ext/intl/dateformat/dateformat_attr.cpp index 8032d758a939b..1ec55a806a7ca 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.cpp @@ -15,16 +15,18 @@ #include #endif +extern "C" { #include "../php_intl.h" -#include "dateformat_class.h" #include "../intl_convert.h" +} +#include "dateformat_class.h" #include "dateformat_class.h" #include #include /* {{{ Get formatter datetype. */ -PHP_FUNCTION( datefmt_get_datetype ) +U_CFUNC PHP_FUNCTION( datefmt_get_datetype ) { DATE_FORMAT_METHOD_INIT_VARS; @@ -44,7 +46,7 @@ PHP_FUNCTION( datefmt_get_datetype ) /* }}} */ /* {{{ Get formatter timetype. */ -PHP_FUNCTION( datefmt_get_timetype ) +U_CFUNC PHP_FUNCTION( datefmt_get_timetype ) { DATE_FORMAT_METHOD_INIT_VARS; @@ -64,7 +66,7 @@ PHP_FUNCTION( datefmt_get_timetype ) /* }}} */ /* {{{ Get formatter pattern. */ -PHP_FUNCTION( datefmt_get_pattern ) +U_CFUNC PHP_FUNCTION( datefmt_get_pattern ) { UChar value_buf[64]; uint32_t length = USIZE( value_buf ); @@ -100,12 +102,12 @@ PHP_FUNCTION( datefmt_get_pattern ) /* }}} */ /* {{{ Set formatter pattern. */ -PHP_FUNCTION( datefmt_set_pattern ) +U_CFUNC PHP_FUNCTION( datefmt_set_pattern ) { - char* value = NULL; + char* value = nullptr; size_t value_len = 0; int32_t slength = 0; - UChar* svalue = NULL; + UChar* svalue = nullptr; bool is_pattern_localized = false; @@ -136,9 +138,9 @@ PHP_FUNCTION( datefmt_set_pattern ) /* }}} */ /* {{{ Get formatter locale. */ -PHP_FUNCTION( datefmt_get_locale ) +U_CFUNC PHP_FUNCTION( datefmt_get_locale ) { - char *loc; + const char *loc; zend_long loc_type =ULOC_ACTUAL_LOCALE; DATE_FORMAT_METHOD_INIT_VARS; @@ -154,14 +156,14 @@ PHP_FUNCTION( datefmt_get_locale ) /* Fetch the object. */ DATE_FORMAT_METHOD_FETCH_OBJECT; - loc = (char *)udat_getLocaleByType(DATE_FORMAT_OBJECT(dfo), loc_type,&INTL_DATA_ERROR_CODE(dfo)); + loc = udat_getLocaleByType(DATE_FORMAT_OBJECT(dfo), static_cast(loc_type),&INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS(dfo, "Error getting locale"); RETURN_STRING(loc); } /* }}} */ /* {{{ Get formatter isLenient. */ -PHP_FUNCTION( datefmt_is_lenient ) +U_CFUNC PHP_FUNCTION( datefmt_is_lenient ) { DATE_FORMAT_METHOD_INIT_VARS; @@ -182,7 +184,7 @@ PHP_FUNCTION( datefmt_is_lenient ) /* }}} */ /* {{{ Set formatter lenient. */ -PHP_FUNCTION( datefmt_set_lenient ) +U_CFUNC PHP_FUNCTION( datefmt_set_lenient ) { bool isLenient = false; diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index 18afb55023b42..167a777e405fa 100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -35,8 +35,14 @@ static inline IntlDateFormatter_object *php_intl_dateformatter_fetch_object(zend } #define Z_INTL_DATEFORMATTER_P(zv) php_intl_dateformatter_fetch_object(Z_OBJ_P(zv)) +#ifdef __cplusplus +extern "C" { +#endif void dateformat_register_IntlDateFormatter_class( void ); extern zend_class_entry *IntlDateFormatter_ce_ptr; +#ifdef __cplusplus +} +#endif /* Auxiliary macros */ diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.cpp similarity index 91% rename from ext/intl/dateformat/dateformat_data.c rename to ext/intl/dateformat/dateformat_data.cpp index 9c12af6fb6059..42e7c9522055f 100644 --- a/ext/intl/dateformat/dateformat_data.c +++ b/ext/intl/dateformat/dateformat_data.cpp @@ -25,7 +25,7 @@ void dateformat_data_init( dateformat_data* datef_data ) if( !datef_data ) return; - datef_data->udatf = NULL; + datef_data->udatf = nullptr; intl_error_reset( &datef_data->error ); } /* }}} */ @@ -41,7 +41,7 @@ void dateformat_data_free( dateformat_data* datef_data ) if( datef_data->udatf ) udat_close( datef_data->udatf ); - datef_data->udatf = NULL; + datef_data->udatf = nullptr; intl_error_reset( &datef_data->error ); } /* }}} */ @@ -51,7 +51,7 @@ void dateformat_data_free( dateformat_data* datef_data ) */ dateformat_data* dateformat_data_create( void ) { - dateformat_data* datef_data = ecalloc( 1, sizeof(dateformat_data) ); + dateformat_data* datef_data = reinterpret_cast(ecalloc( 1, sizeof(dateformat_data) )); dateformat_data_init( datef_data ); diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h index 4007d1344fbb6..962ffbade31d8 100644 --- a/ext/intl/dateformat/dateformat_data.h +++ b/ext/intl/dateformat/dateformat_data.h @@ -18,7 +18,13 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_error.h" +#ifdef __cplusplus +} +#endif typedef struct { // error handling @@ -28,8 +34,14 @@ typedef struct { UDateFormat * udatf; } dateformat_data; +#ifdef __cplusplus +extern "C" { +#endif dateformat_data* dateformat_data_create( void ); void dateformat_data_init( dateformat_data* datef_data ); void dateformat_data_free( dateformat_data* datef_data ); +#ifdef __cplusplus +} +#endif #endif // DATE_FORMAT_DATA_H diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.cpp similarity index 99% rename from ext/intl/dateformat/dateformat_format.c rename to ext/intl/dateformat/dateformat_format.cpp index ee3abd052d669..4e9531a86ce54 100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.cpp @@ -16,12 +16,14 @@ #include #endif +extern "C" { #include "../php_intl.h" +#include "../intl_convert.h" +} #include #include -#include "../intl_convert.h" #include "../common/common_date.h" #include "dateformat.h" #include "dateformat_class.h" @@ -137,7 +139,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo, /* {{{ Format the time value as a string. */ -PHP_FUNCTION(datefmt_format) +U_CFUNC PHP_FUNCTION(datefmt_format) { UDate timestamp = 0; HashTable *hash_arr = NULL; diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.cpp similarity index 96% rename from ext/intl/dateformat/dateformat_parse.c rename to ext/intl/dateformat/dateformat_parse.cpp index b6e9f7c92eb6f..a82a20a42f969 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.cpp @@ -19,8 +19,10 @@ #include #include +extern "C" { #include "php_intl.h" #include "intl_convert.h" +} #include "dateformat.h" #include "dateformat_class.h" #include "dateformat_data.h" @@ -70,7 +72,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name) { - zend_long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo)); + zend_long calendar_field_val = ucal_get( parsed_calendar, static_cast(calendar_field), &INTL_DATA_ERROR_CODE(dfo)); INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" ); if( strcmp(key_name, CALENDAR_YEAR )==0 ){ @@ -126,7 +128,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex /* {{{ Parse the string $value starting at parse_pos to a Unix timestamp -int */ -PHP_FUNCTION(datefmt_parse) +U_CFUNC PHP_FUNCTION(datefmt_parse) { char* text_to_parse = NULL; size_t text_len =0; @@ -165,7 +167,7 @@ PHP_FUNCTION(datefmt_parse) } /* }}} */ -PHP_METHOD(IntlDateFormatter, parseToCalendar) +U_CFUNC PHP_METHOD(IntlDateFormatter, parseToCalendar) { zend_string *text_to_parse = NULL; zval* z_parse_pos = NULL; @@ -208,7 +210,7 @@ PHP_METHOD(IntlDateFormatter, parseToCalendar) } /* {{{ Parse the string $value to a localtime array */ -PHP_FUNCTION(datefmt_localtime) +U_CFUNC PHP_FUNCTION(datefmt_localtime) { char* text_to_parse = NULL; size_t text_len =0; diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.cpp similarity index 86% rename from ext/intl/formatter/formatter_attr.c rename to ext/intl/formatter/formatter_attr.cpp index a7cafcf5f9733..905a4415ef59b 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.cpp @@ -16,25 +16,29 @@ #include #endif +extern "C" { #include "php_intl.h" -#include "formatter_class.h" #include "intl_convert.h" +} +#include "formatter_class.h" #include /* {{{ Get formatter attribute value. */ -PHP_FUNCTION( numfmt_get_attribute ) +U_CFUNC PHP_FUNCTION( numfmt_get_attribute ) { - zend_long attribute, value; + zend_long lattribute, value; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", - &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) + &object, NumberFormatter_ce_ptr, &lattribute ) == FAILURE ) { RETURN_THROWS(); } + UNumberFormatAttribute attribute = static_cast(lattribute); + /* Fetch the object. */ FORMATTER_METHOD_FETCH_OBJECT; @@ -85,9 +89,9 @@ PHP_FUNCTION( numfmt_get_attribute ) /* }}} */ /* {{{ Get formatter attribute value. */ -PHP_FUNCTION( numfmt_get_text_attribute ) +U_CFUNC PHP_FUNCTION( numfmt_get_text_attribute ) { - zend_long attribute; + zend_long lattribute; UChar value_buf[64]; int32_t value_buf_size = USIZE( value_buf ); UChar* value = value_buf; @@ -96,7 +100,7 @@ PHP_FUNCTION( numfmt_get_text_attribute ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", - &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) + &object, NumberFormatter_ce_ptr, &lattribute ) == FAILURE ) { RETURN_THROWS(); } @@ -104,6 +108,8 @@ PHP_FUNCTION( numfmt_get_text_attribute ) /* Fetch the object. */ FORMATTER_METHOD_FETCH_OBJECT; + UNumberFormatTextAttribute attribute = static_cast(lattribute); + length = unum_getTextAttribute( FORMATTER_OBJECT(nfo), attribute, value, value_buf_size, &INTL_DATA_ERROR_CODE(nfo) ); if(INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR && length >= value_buf_size) { ++length; /* to avoid U_STRING_NOT_TERMINATED_WARNING */ @@ -122,15 +128,15 @@ PHP_FUNCTION( numfmt_get_text_attribute ) /* }}} */ /* {{{ Get formatter attribute value. */ -PHP_FUNCTION( numfmt_set_attribute ) +U_CFUNC PHP_FUNCTION( numfmt_set_attribute ) { - zend_long attribute; + zend_long lattribute; zval *value; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oln", - &object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE) + &object, NumberFormatter_ce_ptr, &lattribute, &value ) == FAILURE) { RETURN_THROWS(); } @@ -138,6 +144,8 @@ PHP_FUNCTION( numfmt_set_attribute ) /* Fetch the object. */ FORMATTER_METHOD_FETCH_OBJECT; + UNumberFormatAttribute attribute = static_cast(lattribute); + switch(attribute) { case UNUM_PARSE_INT_ONLY: case UNUM_GROUPING_USED: @@ -175,7 +183,7 @@ PHP_FUNCTION( numfmt_set_attribute ) /* }}} */ /* {{{ Get formatter attribute value. */ -PHP_FUNCTION( numfmt_set_text_attribute ) +U_CFUNC PHP_FUNCTION( numfmt_set_text_attribute ) { int32_t slength = 0; UChar *svalue = NULL; @@ -199,7 +207,7 @@ PHP_FUNCTION( numfmt_set_text_attribute ) INTL_METHOD_CHECK_STATUS( nfo, "Error converting attribute value to UTF-16" ); /* Actually set new attribute value. */ - unum_setTextAttribute(FORMATTER_OBJECT(nfo), attribute, svalue, slength, &INTL_DATA_ERROR_CODE(nfo)); + unum_setTextAttribute(FORMATTER_OBJECT(nfo), static_cast(attribute), svalue, slength, &INTL_DATA_ERROR_CODE(nfo)); if (svalue) { efree(svalue); } @@ -210,9 +218,9 @@ PHP_FUNCTION( numfmt_set_text_attribute ) /* }}} */ /* {{{ Get formatter symbol value. */ -PHP_FUNCTION( numfmt_get_symbol ) +U_CFUNC PHP_FUNCTION( numfmt_get_symbol ) { - zend_long symbol; + zend_long lsymbol; UChar value_buf[4]; UChar *value = value_buf; uint32_t length = USIZE(value_buf); @@ -220,11 +228,13 @@ PHP_FUNCTION( numfmt_get_symbol ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", - &object, NumberFormatter_ce_ptr, &symbol ) == FAILURE ) + &object, NumberFormatter_ce_ptr, &lsymbol ) == FAILURE ) { RETURN_THROWS(); } + UNumberFormatSymbol symbol = static_cast(lsymbol); + if(symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "invalid symbol value"); RETURN_FALSE; @@ -251,9 +261,9 @@ PHP_FUNCTION( numfmt_get_symbol ) /* }}} */ /* {{{ Set formatter symbol value. */ -PHP_FUNCTION( numfmt_set_symbol ) +U_CFUNC PHP_FUNCTION( numfmt_set_symbol ) { - zend_long symbol; + zend_long lsymbol; char* value = NULL; size_t value_len = 0; UChar* svalue = 0; @@ -262,11 +272,13 @@ PHP_FUNCTION( numfmt_set_symbol ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols", - &object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE ) + &object, NumberFormatter_ce_ptr, &lsymbol, &value, &value_len ) == FAILURE ) { RETURN_THROWS(); } + UNumberFormatSymbol symbol = static_cast(lsymbol); + if (symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "invalid symbol value"); RETURN_FALSE; @@ -291,7 +303,7 @@ PHP_FUNCTION( numfmt_set_symbol ) /* }}} */ /* {{{ Get formatter pattern. */ -PHP_FUNCTION( numfmt_get_pattern ) +U_CFUNC PHP_FUNCTION( numfmt_get_pattern ) { UChar value_buf[64]; uint32_t length = USIZE( value_buf ); @@ -326,7 +338,7 @@ PHP_FUNCTION( numfmt_get_pattern ) /* }}} */ /* {{{ Set formatter pattern. */ -PHP_FUNCTION( numfmt_set_pattern ) +U_CFUNC PHP_FUNCTION( numfmt_set_pattern ) { char* value = NULL; size_t value_len = 0; @@ -365,10 +377,10 @@ PHP_FUNCTION( numfmt_set_pattern ) /* }}} */ /* {{{ Get formatter locale. */ -PHP_FUNCTION( numfmt_get_locale ) +U_CFUNC PHP_FUNCTION( numfmt_get_locale ) { zend_long type = ULOC_ACTUAL_LOCALE; - char* loc; + const char* loc; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ @@ -381,7 +393,7 @@ PHP_FUNCTION( numfmt_get_locale ) /* Fetch the object. */ FORMATTER_METHOD_FETCH_OBJECT; - loc = (char *)unum_getLocaleByType(FORMATTER_OBJECT(nfo), type, &INTL_DATA_ERROR_CODE(nfo)); + loc = unum_getLocaleByType(FORMATTER_OBJECT(nfo), static_cast(type), &INTL_DATA_ERROR_CODE(nfo)); INTL_METHOD_CHECK_STATUS( nfo, "Error getting locale" ); RETURN_STRING(loc); } diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index f7da2b2201917..aae6131205e3c 100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -17,9 +17,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_common.h" #include "intl_error.h" #include "intl_data.h" +#ifdef __cplusplus +} +#endif #include "formatter_data.h" typedef struct { @@ -32,8 +38,14 @@ static inline NumberFormatter_object *php_intl_number_format_fetch_object(zend_o } #define Z_INTL_NUMBERFORMATTER_P(zv) php_intl_number_format_fetch_object(Z_OBJ_P(zv)) +#ifdef __cplusplus +extern "C" { +#endif void formatter_register_class( void ); extern zend_class_entry *NumberFormatter_ce_ptr; +#ifdef __cplusplus +} +#endif /* Auxiliary macros */ diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.cpp similarity index 94% rename from ext/intl/formatter/formatter_data.c rename to ext/intl/formatter/formatter_data.cpp index 57dbc8bde6b5e..095be92ed29e1 100644 --- a/ext/intl/formatter/formatter_data.c +++ b/ext/intl/formatter/formatter_data.cpp @@ -52,7 +52,7 @@ void formatter_data_free( formatter_data* nf_data ) */ formatter_data* formatter_data_create( void ) { - formatter_data* nf_data = ecalloc( 1, sizeof(formatter_data) ); + formatter_data* nf_data = reinterpret_cast(ecalloc( 1, sizeof(formatter_data) )); formatter_data_init( nf_data ); diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h index 817ad0d6055f3..35acc242a8db9 100644 --- a/ext/intl/formatter/formatter_data.h +++ b/ext/intl/formatter/formatter_data.h @@ -19,7 +19,13 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_error.h" +#ifdef __cplusplus +} +#endif typedef struct { // error hangling @@ -29,8 +35,14 @@ typedef struct { UNumberFormat* unum; } formatter_data; +#ifdef __cplusplus +extern "C" { +#endif formatter_data* formatter_data_create( void ); void formatter_data_init( formatter_data* nf_data ); void formatter_data_free( formatter_data* nf_data ); +#ifdef __cplusplus +} +#endif #endif // FORMATTER_DATA_H diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.cpp similarity index 98% rename from ext/intl/formatter/formatter_format.c rename to ext/intl/formatter/formatter_format.cpp index 5be732dde77e8..f28ea30b9ff8f 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.cpp @@ -16,16 +16,18 @@ #include #endif +extern "C" { #include "php_intl.h" +#include "intl_convert.h" +} #include #include "formatter_class.h" #include "formatter_format.h" -#include "intl_convert.h" /* {{{ Format a number. */ -PHP_FUNCTION( numfmt_format ) +U_CFUNC PHP_FUNCTION( numfmt_format ) { zval *number; zend_long type = FORMAT_TYPE_DEFAULT; @@ -123,7 +125,7 @@ PHP_FUNCTION( numfmt_format ) /* }}} */ /* {{{ Format a number as currency. */ -PHP_FUNCTION( numfmt_format_currency ) +U_CFUNC PHP_FUNCTION( numfmt_format_currency ) { double number; UChar format_buf[32]; diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.cpp similarity index 91% rename from ext/intl/formatter/formatter_main.c rename to ext/intl/formatter/formatter_main.cpp index d6d69f57277f9..a014323089a7e 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.cpp @@ -19,9 +19,11 @@ #include #include +extern "C" { #include "php_intl.h" -#include "formatter_class.h" #include "intl_convert.h" +} +#include "formatter_class.h" /* {{{ */ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) @@ -67,7 +69,8 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) char* canonicalized_locale = canonicalize_locale_string(locale); const char* final_locale = canonicalized_locale ? canonicalized_locale : locale; - FORMATTER_OBJECT(nfo) = unum_open(style, spattern, spattern_len, final_locale, NULL, &INTL_DATA_ERROR_CODE(nfo)); + /* Create an ICU number formatter. */ + FORMATTER_OBJECT(nfo) = unum_open(static_cast(style), spattern, spattern_len, final_locale, nullptr, &INTL_DATA_ERROR_CODE(nfo)); if (spattern) { efree(spattern); @@ -83,7 +86,7 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) /* }}} */ /* {{{ Create number formatter. */ -PHP_FUNCTION( numfmt_create ) +U_CFUNC PHP_FUNCTION( numfmt_create ) { object_init_ex( return_value, NumberFormatter_ce_ptr ); if (numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU) == FAILURE) { @@ -94,7 +97,7 @@ PHP_FUNCTION( numfmt_create ) /* }}} */ /* {{{ NumberFormatter object constructor. */ -PHP_METHOD( NumberFormatter, __construct ) +U_CFUNC PHP_METHOD( NumberFormatter, __construct ) { const bool old_use_exception = INTL_G(use_exceptions); const zend_long old_error_level = INTL_G(error_level); @@ -111,7 +114,7 @@ PHP_METHOD( NumberFormatter, __construct ) /* }}} */ /* {{{ Get formatter's last error code. */ -PHP_FUNCTION( numfmt_get_error_code ) +U_CFUNC PHP_FUNCTION( numfmt_get_error_code ) { FORMATTER_METHOD_INIT_VARS @@ -130,7 +133,7 @@ PHP_FUNCTION( numfmt_get_error_code ) /* }}} */ /* {{{ Get text description for formatter's last error code. */ -PHP_FUNCTION( numfmt_get_error_message ) +U_CFUNC PHP_FUNCTION( numfmt_get_error_message ) { zend_string *message = NULL; FORMATTER_METHOD_INIT_VARS diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.cpp similarity index 98% rename from ext/intl/formatter/formatter_parse.c rename to ext/intl/formatter/formatter_parse.cpp index ba8307419b4cf..c7d0df8cbda02 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.cpp @@ -16,19 +16,21 @@ #include #endif +extern "C" { #include "php_intl.h" +#include "intl_convert.h" +} #include #include #include "formatter_class.h" #include "formatter_format.h" -#include "intl_convert.h" #define ICU_LOCALE_BUG 1 /* {{{ Parse a number. */ -PHP_FUNCTION( numfmt_parse ) +U_CFUNC PHP_FUNCTION( numfmt_parse ) { zend_long type = FORMAT_TYPE_DOUBLE; UChar* sstr = NULL; @@ -120,7 +122,7 @@ PHP_FUNCTION( numfmt_parse ) /* }}} */ /* {{{ Parse a number as currency. */ -PHP_FUNCTION( numfmt_parse_currency ) +U_CFUNC PHP_FUNCTION( numfmt_parse_currency ) { double number; UChar currency[5] = {0}; From e82ed96bd61c4b3e3c1165b03fbed4d8979d05d9 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 18:05:18 +0200 Subject: [PATCH 176/386] soap: Fix comment (#20126) The fallthrough isn't right, but it didn't matter as the loop will definitely execute the return statement. --- ext/soap/php_encoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 484cddbcc5a3e..77d97b566fc19 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1797,9 +1797,9 @@ static sdlTypePtr model_array_element(sdlContentModelPtr model) ZEND_HASH_FOREACH_PTR(model->u.content, tmp) { return model_array_element(tmp); } ZEND_HASH_FOREACH_END(); + + break; } - /* TODO Check this is correct */ - ZEND_FALLTHROUGH; case XSD_CONTENT_GROUP: { return model_array_element(model->u.group->model); } From b272021d0c53072a73df658ead7576cf879f30c5 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 18:05:57 +0200 Subject: [PATCH 177/386] [ci skip] Remove outdated comment (#20125) Yes this is correct, the blob is returned as a string so it needs to be put that way into the return value. --- ext/pdo_sqlite/sqlite_statement.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index e9e7a0cc78609..ffb8c1ad4b3c8 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -335,7 +335,6 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret case SQLITE_BLOB: add_next_index_string(&flags, "blob"); - /* TODO Check this is correct */ ZEND_FALLTHROUGH; case SQLITE_TEXT: add_assoc_str(return_value, "native_type", ZSTR_KNOWN(ZEND_STR_STRING)); From da906ee4f9bf49eb785f372a8fe8bccf76955fdc Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:38:58 +0200 Subject: [PATCH 178/386] phar: Remove duplicated error-handling code (#20137) This is already handled by the switch below. --- ext/phar/phar_object.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index c30145d9fb940..ca19a38b2cfef 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -703,11 +703,6 @@ PHP_METHOD(Phar, webPhar) goto cleanup_fail; } - if (Z_TYPE_P(rewrite_fci.retval) == IS_UNDEF || Z_TYPE(retval) == IS_UNDEF) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false"); - goto cleanup_fail; - } - switch (Z_TYPE(retval)) { case IS_STRING: efree(entry); From f97ee5c71b41771de7aab0fe9c1572f6a5eb656e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:39:32 +0200 Subject: [PATCH 179/386] phar: Reduce code duplication in destructor (#20140) We can make a variant of the macro to control the throwing behaviour. --- ext/phar/phar_object.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index ca19a38b2cfef..0ad7c5d66d759 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4513,28 +4513,27 @@ PHP_METHOD(PharFileInfo, __construct) } /* }}} */ -#define PHAR_ENTRY_OBJECT() \ +#define PHAR_ENTRY_OBJECT_EX(throw) \ zval *zobj = ZEND_THIS; \ phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \ if (!entry_obj->entry) { \ - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ - "Cannot call method on an uninitialized PharFileInfo object"); \ - RETURN_THROWS(); \ + if (throw) { \ + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ + "Cannot call method on an uninitialized PharFileInfo object"); \ + } \ + return; \ } +#define PHAR_ENTRY_OBJECT() PHAR_ENTRY_OBJECT_EX(true) + /* {{{ clean up directory-based entry objects */ PHP_METHOD(PharFileInfo, __destruct) { - zval *zobj = ZEND_THIS; - phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); - if (zend_parse_parameters_none() == FAILURE) { RETURN_THROWS(); } - if (!entry_obj->entry) { - return; - } + PHAR_ENTRY_OBJECT_EX(false); if (entry_obj->entry->is_temp_dir) { if (entry_obj->entry->filename) { From 9c00765d64b32cc7bb9e0096574e52c10dfa0468 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:40:10 +0200 Subject: [PATCH 180/386] phar: Remove obsoleted workaround code (#20136) --- ext/phar/zip.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index ca536c9c75aae..2d43092e97ae7 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -641,13 +641,6 @@ int phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alia zend_off_t restore_pos = php_stream_tell(fp); php_stream_seek(fp, entry.offset, SEEK_SET); - /* these next lines should be for php < 5.2.6 after 5.3 filters are fixed */ - fp->writepos = 0; - fp->readpos = 0; - php_stream_seek(fp, entry.offset, SEEK_SET); - fp->writepos = 0; - fp->readpos = 0; - /* the above lines should be for php < 5.2.6 after 5.3 filters are fixed */ mydata->alias_len = entry.uncompressed_filesize; if (entry.flags & PHAR_ENT_COMPRESSED_GZ) { From 8e405ca22a1891de3ee23ee3f5f6e2f43871d474 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:28:01 +0200 Subject: [PATCH 181/386] xml: Migrate build_comment to ZendMM --- ext/xml/compat.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 21184be87182b..bdec7f97104bb 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -290,17 +290,19 @@ notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *pub_id parser->h_notation_decl(parser->user, notation, NULL, sys_id, pub_id); } -static void -build_comment(const xmlChar *data, size_t data_len, xmlChar **comment, size_t *comment_len) +static xmlChar * +build_comment(const xmlChar *data, size_t data_len, size_t *comment_len) { *comment_len = data_len + 7; - *comment = xmlMalloc(*comment_len + 1); - memcpy(*comment, "", 3); + xmlChar *comment = emalloc(*comment_len + 1); + memcpy(comment, "", 3); + + comment[*comment_len] = '\0'; - (*comment)[*comment_len] = '\0'; + return comment; } static void @@ -309,12 +311,11 @@ comment_handler(void *user, const xmlChar *comment) XML_Parser parser = (XML_Parser) user; if (parser->h_default) { - xmlChar *d_comment; size_t d_comment_len; - build_comment(comment, (size_t) xmlStrlen(comment), &d_comment, &d_comment_len); + xmlChar *d_comment = build_comment(comment, (size_t) xmlStrlen(comment), &d_comment_len); parser->h_default(parser->user, d_comment, d_comment_len); - xmlFree(d_comment); + efree(d_comment); } } From f63b011eee904e768794b4c7b0ac582da13a0c13 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:28:07 +0200 Subject: [PATCH 182/386] xml: Migrate build_entity to ZendMM --- ext/xml/compat.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index bdec7f97104bb..c2696386a40bc 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -319,15 +319,16 @@ comment_handler(void *user, const xmlChar *comment) } } -static void -build_entity(const xmlChar *name, size_t len, xmlChar **entity, size_t *entity_len) +static xmlChar * +build_entity(const xmlChar *name, size_t len, size_t *entity_len) { *entity_len = len + 2; - *entity = xmlMalloc(*entity_len + 1); - (*entity)[0] = '&'; - memcpy(*entity+1, name, len); - (*entity)[len+1] = ';'; - (*entity)[*entity_len] = '\0'; + xmlChar *entity = emalloc(*entity_len + 1); + entity[0] = '&'; + memcpy(entity + 1, name, len); + entity[len + 1] = ';'; + entity[*entity_len] = '\0'; + return entity; } static void @@ -362,12 +363,11 @@ get_entity(void *user, const xmlChar *name) if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) { /* Predefined entities will expand unless no cdata handler is present */ if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) { - xmlChar *entity; size_t len; - build_entity(name, (size_t) xmlStrlen(name), &entity, &len); + xmlChar *entity = build_entity(name, (size_t) xmlStrlen(name), &len); parser->h_default(parser->user, (const xmlChar *) entity, len); - xmlFree(entity); + efree(entity); } else { /* expat will not expand internal entities if default handler is present otherwise it will expand and pass them to cdata handler */ From c9c904f8168acc70ab874c2ea8eb381005b1a07a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:29:47 +0200 Subject: [PATCH 183/386] xml: Migrate _ns_separator to ZendMM --- ext/xml/compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index c2696386a40bc..5f1dbb1c10150 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -465,7 +465,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m /* Note: sax2 flag will be set due to the magic number in `initialized` in php_xml_compat_handlers */ ZEND_ASSERT(parser->parser->sax->initialized == XML_SAX2_MAGIC); parser->use_namespace = 1; - parser->_ns_separator = xmlStrdup(sep); + parser->_ns_separator = BAD_CAST estrdup((const char *) sep); } else { /* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt so must be set in the handlers */ @@ -718,7 +718,7 @@ XML_ParserFree(XML_Parser parser) { if (parser->use_namespace) { if (parser->_ns_separator) { - xmlFree(parser->_ns_separator); + efree(parser->_ns_separator); } } if (parser->parser->myDoc) { From 20cc3a35e5ffd977979b57042e147b2bfe4832ba Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:36:43 +0200 Subject: [PATCH 184/386] xml: Migrate start_element_handler to ZendMM --- ext/xml/compat.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 5f1dbb1c10150..92aca782f1b09 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -18,6 +18,7 @@ #if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) #include "expat_compat.h" #include "ext/libxml/php_libxml.h" +#include "Zend/zend_smart_string.h" #ifdef LIBXML_EXPAT_COMPAT @@ -38,31 +39,31 @@ static void start_element_handler(void *user, const xmlChar *name, const xmlChar **attributes) { XML_Parser parser = (XML_Parser) user; - xmlChar *qualified_name = NULL; if (parser->h_start_element == NULL) { if (parser->h_default) { int attno = 0; + smart_string qualified_name = {0}; + + smart_string_appendc(&qualified_name, '<'); + smart_string_appends(&qualified_name, (const char *) name); - qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name)); if (attributes) { while (attributes[attno] != NULL) { - int att_len; - char *att_string, *att_name, *att_value; - - att_name = (char *)attributes[attno++]; - att_value = (char *)attributes[attno++]; - - att_len = spprintf(&att_string, 0, " %s=\"%s\"", att_name, att_value); - - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len); - efree(att_string); + const char *att_name = (const char *) attributes[attno++]; + const char *att_value = (const char *) attributes[attno++]; + + smart_string_appendc(&qualified_name, ' '); + smart_string_appends(&qualified_name, att_name); + smart_string_appends(&qualified_name, "=\""); + smart_string_appends(&qualified_name, att_value); + smart_string_appendc(&qualified_name, '"'); } - } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1); - parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); - xmlFree(qualified_name); + smart_string_appendc(&qualified_name, '>'); + smart_string_0(&qualified_name); + parser->h_default(parser->user, (const XML_Char *) qualified_name.c, qualified_name.len); + smart_string_free(&qualified_name); } return; } From e0561f0c8ef43fe1a379633938bdcd99c0223b82 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:43:26 +0200 Subject: [PATCH 185/386] xml: Migrate qualify_namespace to ZendMM --- ext/xml/compat.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 92aca782f1b09..df764f1c48999 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -22,16 +22,18 @@ #ifdef LIBXML_EXPAT_COMPAT -static void -qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified) +static xmlChar * +qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI) { if (URI) { - /* Use libxml functions otherwise its memory deallocation is screwed up */ - *qualified = xmlStrdup(URI); - *qualified = xmlStrncat(*qualified, parser->_ns_separator, 1); - *qualified = xmlStrncat(*qualified, name, xmlStrlen(name)); + smart_string str = {0}; + smart_string_appends(&str, (const char *) URI); + smart_string_appends(&str, (const char *) parser->_ns_separator); + smart_string_appends(&str, (const char *) name); + smart_string_0(&str); + return BAD_CAST str.c; } else { - *qualified = xmlStrdup(name); + return BAD_CAST estrdup((const char *) name); } } @@ -151,7 +153,7 @@ start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, } return; } - qualify_namespace(parser, name, URI, &qualified_name); + qualified_name = qualify_namespace(parser, name, URI); if (attributes != NULL) { xmlChar *qualified_name_attr = NULL; @@ -160,12 +162,12 @@ start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, for (i = 0; i < nb_attributes; i += 1) { if (attributes[y+1] != NULL) { - qualify_namespace(parser, attributes[y] , attributes[y + 2], &qualified_name_attr); + qualified_name_attr = qualify_namespace(parser, attributes[y] , attributes[y + 2]); } else { - qualified_name_attr = xmlStrdup(attributes[y]); + qualified_name_attr = BAD_CAST estrdup((const char *) attributes[y]); } attrs[z] = qualified_name_attr; - attrs[z + 1] = xmlStrndup(attributes[y + 3] , (int) (attributes[y + 4] - attributes[y + 3])); + attrs[z + 1] = BAD_CAST estrndup((const char *) attributes[y + 3], attributes[y + 4] - attributes[y + 3]); z += 2; y += 5; } @@ -175,11 +177,11 @@ start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attrs); if (attrs) { for (i = 0; i < z; i++) { - xmlFree(attrs[i]); + efree(attrs[i]); } efree(attrs); } - xmlFree(qualified_name); + efree(qualified_name); } static void @@ -223,11 +225,11 @@ end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix, return; } - qualify_namespace(parser, name, URI, &qualified_name); + qualified_name = qualify_namespace(parser, name, URI); parser->h_end_element(parser->user, (const XML_Char *) qualified_name); - xmlFree(qualified_name); + efree(qualified_name); } static void From 677c7fe31bd2380c798c107e83b695bc24fc16a4 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:50:24 +0200 Subject: [PATCH 186/386] xml: Migrate start_element_handler_ns to ZendMM --- ext/xml/compat.c | 60 ++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index df764f1c48999..6ce0809cd5b09 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -93,63 +93,57 @@ start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, if (parser->h_start_element == NULL) { if (parser->h_default) { - + smart_string qualified_name = {0}; + smart_string_appendc(&qualified_name, '<'); if (prefix) { - qualified_name = xmlStrncatNew((xmlChar *)"<", prefix, xmlStrlen(prefix)); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)":", 1); - qualified_name = xmlStrncat(qualified_name, name, xmlStrlen(name)); - } else { - qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name)); + smart_string_appends(&qualified_name, (const char *) prefix); + smart_string_appendc(&qualified_name, ':'); } + smart_string_appends(&qualified_name, (const char *) name); if (namespaces) { int i, j; for (i = 0,j = 0;j < nb_namespaces;j++) { - int ns_len; - char *ns_string, *ns_prefix, *ns_url; - - ns_prefix = (char *) namespaces[i++]; - ns_url = (char *) namespaces[i++]; + const char *ns_prefix = (const char *) namespaces[i++]; + const char *ns_url = (const char *) namespaces[i++]; if (ns_prefix) { - ns_len = spprintf(&ns_string, 0, " xmlns:%s=\"%s\"", ns_prefix, ns_url); + smart_string_appends(&qualified_name, " xmlns:"); + smart_string_appends(&qualified_name, ns_prefix); + smart_string_appends(&qualified_name, "=\""); } else { - ns_len = spprintf(&ns_string, 0, " xmlns=\"%s\"", ns_url); + smart_string_appends(&qualified_name, " xmlns=\""); } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)ns_string, ns_len); - efree(ns_string); + smart_string_appends(&qualified_name, ns_url); + smart_string_appendc(&qualified_name, '"'); } } if (attributes) { for (i = 0; i < nb_attributes; i += 1) { - int att_len; - char *att_string, *att_name, *att_value, *att_prefix, *att_valueend; - - att_name = (char *) attributes[y++]; - att_prefix = (char *)attributes[y++]; + const char *att_name = (const char *) attributes[y++]; + const char *att_prefix = (const char *)attributes[y++]; y++; - att_value = (char *)attributes[y++]; - att_valueend = (char *)attributes[y++]; + const char *att_value = (const char *)attributes[y++]; + const char *att_valueend = (const char *)attributes[y++]; + smart_string_appendc(&qualified_name, ' '); if (att_prefix) { - att_len = spprintf(&att_string, 0, " %s:%s=\"", att_prefix, att_name); - } else { - att_len = spprintf(&att_string, 0, " %s=\"", att_name); + smart_string_appends(&qualified_name, att_prefix); + smart_string_appendc(&qualified_name, ':'); } + smart_string_appends(&qualified_name, att_name); + smart_string_appends(&qualified_name, "=\""); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_value, att_valueend - att_value); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)"\"", 1); - - efree(att_string); + smart_string_appendl(&qualified_name, att_value, att_valueend - att_value); + smart_string_appendc(&qualified_name, '"'); } } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1); - parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); - xmlFree(qualified_name); + smart_string_appendc(&qualified_name, '>'); + parser->h_default(parser->user, (const XML_Char *) qualified_name.c, qualified_name.len); + smart_string_free(&qualified_name); } return; } From 82125936942545ed5f15767f8739db9188745dee Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:59:30 +0200 Subject: [PATCH 187/386] phar: Stop early in compression test loop (#20142) --- ext/phar/phar_object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 0ad7c5d66d759..ed4ad2516f43b 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3169,12 +3169,14 @@ static int phar_test_compression(zval *zv, void *argument) /* {{{ */ if (!PHAR_G(has_bz2)) { if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) { *(int *) argument = 0; + return ZEND_HASH_APPLY_STOP; } } if (!PHAR_G(has_zlib)) { if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { *(int *) argument = 0; + return ZEND_HASH_APPLY_STOP; } } From f543f4951ca979f987f81c34b22dc6b1f3cd3581 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sun, 12 Oct 2025 01:20:48 +0100 Subject: [PATCH 188/386] Clean up some minor things in ext/mysqli (#20120) * Remove unused fields and typedefs * Remove unused __name parameter --- ext/mysqli/mysqli.c | 6 +----- ext/mysqli/mysqli_api.c | 20 ++++++++++---------- ext/mysqli/mysqli_nonapi.c | 10 ++++------ ext/mysqli/mysqli_priv.h | 1 - ext/mysqli/mysqli_result_iterator.c | 4 ++-- ext/mysqli/mysqli_warning.c | 2 +- ext/mysqli/php_mysqli_structs.h | 26 ++++---------------------- 7 files changed, 22 insertions(+), 47 deletions(-) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a46b16e1d1ecd..26264aa2b170f 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -136,10 +136,6 @@ void php_clear_mysql(MY_MYSQL *mysql) { zend_string_release_ex(mysql->hash_key, 0); mysql->hash_key = NULL; } - if (!Z_ISUNDEF(mysql->li_read)) { - zval_ptr_dtor(&(mysql->li_read)); - ZVAL_UNDEF(&mysql->li_read); - } } /* }}} */ @@ -788,7 +784,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags } } } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) { zend_argument_value_error(ERROR_ARG_POS(2), "must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH"); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 2a20919eee45e..65c423990bc9d 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -324,7 +324,7 @@ PHP_FUNCTION(mysqli_data_seek) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (mysqli_result_is_unbuffered(result)) { if (hasThis()) { @@ -670,7 +670,7 @@ PHP_FUNCTION(mysqli_fetch_field) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (!(field = mysql_fetch_field(result))) { RETURN_FALSE; @@ -694,7 +694,7 @@ PHP_FUNCTION(mysqli_fetch_fields) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); array_init(return_value); num_fields = mysql_num_fields(result); @@ -727,7 +727,7 @@ PHP_FUNCTION(mysqli_fetch_field_direct) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (offset >= (zend_long) mysql_num_fields(result)) { zend_argument_value_error(ERROR_ARG_POS(2), "must be less than the number of fields for this result set"); @@ -755,7 +755,7 @@ PHP_FUNCTION(mysqli_fetch_lengths) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); // TODO Warning? if (!(ret = mysql_fetch_lengths(result))) { @@ -809,7 +809,7 @@ PHP_FUNCTION(mysqli_field_seek) RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if ((uint32_t)fieldnr >= mysql_num_fields(result)) { zend_argument_value_error(ERROR_ARG_POS(2), "must be less than the number of fields for this result set"); @@ -830,7 +830,7 @@ PHP_FUNCTION(mysqli_field_tell) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); RETURN_LONG(mysql_field_tell(result)); } @@ -845,7 +845,7 @@ PHP_FUNCTION(mysqli_free_result) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); mysqli_free_result(result, false); MYSQLI_CLEAR_RESOURCE(mysql_result); @@ -1123,7 +1123,7 @@ PHP_FUNCTION(mysqli_num_fields) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); RETURN_LONG(mysql_num_fields(result)); } @@ -1138,7 +1138,7 @@ PHP_FUNCTION(mysqli_num_rows) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (mysqli_result_is_unbuffered_and_not_everything_is_fetched(result)) { zend_throw_error(NULL, "mysqli_num_rows() cannot be used in MYSQLI_USE_RESULT mode"); diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 2179d686a479f..84d43a477edba 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -107,7 +107,6 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL)); self_alloced = true; } - flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */ } else { /* We have flags too */ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s!s!s!s!l!s!l", &object, mysqli_link_class_entry, @@ -118,11 +117,10 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b mysqli_resource = (Z_MYSQLI_P(object))->ptr; MYSQLI_FETCH_RESOURCE_CONN(mysql, object, MYSQLI_STATUS_INITIALIZED); - /* set some required options */ - flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */ /* remove some insecure options */ flags &= ~CLIENT_MULTI_STATEMENTS; /* don't allow multi_queries via connect parameter */ } + flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */ if (!socket_len || !socket) { socket = MyG(default_socket); @@ -316,7 +314,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b mysql->hash_key = NULL; mysql->persistent = false; } - if (!is_real_connect && self_alloced) { + if (self_alloced) { efree(mysql); } RETVAL_FALSE; @@ -393,7 +391,7 @@ PHP_FUNCTION(mysqli_fetch_column) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &col_no) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES*, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES*, mysql_result, MYSQLI_STATUS_VALID); if (col_no < 0) { zend_argument_value_error(ERROR_ARG_POS(2), "must be greater than or equal to 0"); @@ -425,7 +423,7 @@ PHP_FUNCTION(mysqli_fetch_all) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) { RETURN_THROWS(); } - MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, MYSQLI_STATUS_VALID); if (!mode || (mode & ~MYSQLI_BOTH)) { zend_argument_value_error(ERROR_ARG_POS(2), "must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH"); diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h index f08d66b7287d9..5f7c49f0b2979 100644 --- a/ext/mysqli/mysqli_priv.h +++ b/ext/mysqli/mysqli_priv.h @@ -55,7 +55,6 @@ extern void php_clear_mysql(MY_MYSQL *); extern MYSQLI_WARNING *php_get_warnings(MYSQLND_CONN_DATA * mysql); extern void php_clear_warnings(MYSQLI_WARNING *w); -extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type); extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error); extern void php_mysqli_report_index(const char *query, unsigned int status); extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...); diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 3441e47d01a4c..5dbeaf1e3b22b 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -98,7 +98,7 @@ static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter) mysqli_object *intern = iterator->result; MYSQL_RES *result; - MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, MYSQLI_STATUS_VALID); zval_ptr_dtor(&iterator->current_row); php_mysqli_fetch_into_hash_aux(&iterator->current_row, result, MYSQLI_ASSOC); @@ -115,7 +115,7 @@ static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter) mysqli_object *intern = iterator->result; MYSQL_RES *result; - MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, "mysqli_result", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, MYSQLI_STATUS_VALID); if (mysqli_result_is_unbuffered(result)) { if (result->unbuf->eof_reached) { diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index b1427495a5066..4b0792b9684b8 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -125,7 +125,7 @@ PHP_METHOD(mysqli_warning, next) } if (obj->ptr) { - MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, ZEND_THIS, "mysqli_warning", MYSQLI_STATUS_VALID); + MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, ZEND_THIS, MYSQLI_STATUS_VALID); if (w && w->next) { w = w->next; diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 2daa5af932882..ceab4a44f3953 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -38,32 +38,14 @@ enum mysqli_status { MYSQLI_STATUS_VALID }; -typedef struct { - char *val; - zend_ulong buflen; - zend_ulong output_len; - zend_ulong type; -} VAR_BUFFER; - -typedef struct { - unsigned int var_cnt; - VAR_BUFFER *buf; - zval *vars; - my_bool *is_null; -} BIND_BUFFER; - typedef struct { MYSQL_STMT *stmt; - BIND_BUFFER param; - BIND_BUFFER result; char *query; } MY_STMT; typedef struct { MYSQL *mysql; zend_string *hash_key; - zval li_read; - php_stream *li_stream; unsigned int multi_query; bool persistent; int async_result_fetch_type; @@ -177,7 +159,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul MYSQLI_REGISTER_RESOURCE_EX(__ptr, object)\ } -#define MYSQLI_FETCH_RESOURCE(__ptr, __type, __id, __name, __check) \ +#define MYSQLI_FETCH_RESOURCE(__ptr, __type, __id, __check) \ { \ MYSQLI_RESOURCE *my_res; \ mysqli_object *intern = Z_MYSQLI_P(__id); \ @@ -192,7 +174,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul }\ } -#define MYSQLI_FETCH_RESOURCE_BY_OBJ(__ptr, __type, __obj, __name, __check) \ +#define MYSQLI_FETCH_RESOURCE_BY_OBJ(__ptr, __type, __obj, __check) \ { \ MYSQLI_RESOURCE *my_res; \ if (!(my_res = (MYSQLI_RESOURCE *)(__obj->ptr))) {\ @@ -208,7 +190,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul #define MYSQLI_FETCH_RESOURCE_CONN(__ptr, __id, __check) \ { \ - MYSQLI_FETCH_RESOURCE((__ptr), MY_MYSQL *, (__id), "mysqli_link", (__check)); \ + MYSQLI_FETCH_RESOURCE((__ptr), MY_MYSQL *, (__id), (__check)); \ if (!(__ptr)->mysql) { \ zend_throw_error(NULL, "%s object is not fully initialized", ZSTR_VAL(Z_OBJCE_P(__id)->name)); \ RETURN_THROWS(); \ @@ -217,7 +199,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul #define MYSQLI_FETCH_RESOURCE_STMT(__ptr, __id, __check) \ { \ - MYSQLI_FETCH_RESOURCE((__ptr), MY_STMT *, (__id), "mysqli_stmt", (__check)); \ + MYSQLI_FETCH_RESOURCE((__ptr), MY_STMT *, (__id), (__check)); \ ZEND_ASSERT((__ptr)->stmt && "Missing statement?"); \ } From ee43384a0be40c35aa61d618e4d57854b2116a31 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:59:18 +0200 Subject: [PATCH 189/386] [ci skip] Remove duplicated comment block --- ext/intl/locale/locale_methods.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp index fd8712b3b462a..d8e6de3a68464 100644 --- a/ext/intl/locale/locale_methods.cpp +++ b/ext/intl/locale/locale_methods.cpp @@ -1573,8 +1573,6 @@ U_CFUNC PHP_FUNCTION(locale_lookup) } /* }}} */ -/* {{{ Tries to find out best available locale based on HTTP "Accept-Language" header */ -/* }}} */ /* {{{ Tries to find out best available locale based on HTTP "Accept-Language" header */ U_CFUNC PHP_FUNCTION(locale_accept_from_http) { From 930fe03d5495675fa8f1d47a878deaa9c8f18ed6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 23:44:46 +0200 Subject: [PATCH 190/386] phar: Abstract away internal object fetching (#20147) --- ext/phar/phar_object.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 23823a1f2644e..92d96eebe4b12 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -34,6 +34,17 @@ static zend_class_entry *phar_ce_data; static zend_class_entry *phar_ce_PharException; static zend_class_entry *phar_ce_entry; +#define PHAR_FETCH_INTERNAL_EX(zv) (void *)((char *) Z_OBJ_P(zv) - Z_OBJ_P(zv)->handlers->offset); +#define PHAR_FETCH_INTERNAL() PHAR_FETCH_INTERNAL_EX(ZEND_THIS) + +#define PHAR_ARCHIVE_OBJECT() \ + phar_archive_object *phar_obj = PHAR_FETCH_INTERNAL(); \ + if (!phar_obj->archive) { \ + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ + "Cannot call method on an uninitialized Phar object"); \ + RETURN_THROWS(); \ + } + static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ */ { char *ext; @@ -1119,11 +1130,11 @@ PHP_METHOD(Phar, __construct) zend_long format = 0; phar_archive_object *phar_obj; phar_archive_data *phar_data; - zval *zobj = ZEND_THIS, arg1, arg2; + zval arg1, arg2; - phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); + phar_obj = PHAR_FETCH_INTERNAL(); - is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data); + is_data = instanceof_function(Z_OBJCE_P(ZEND_THIS), phar_ce_data); if (is_data) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ls!l", &fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) { @@ -1223,7 +1234,7 @@ PHP_METHOD(Phar, __construct) ZVAL_LONG(&arg2, flags); zend_call_known_instance_method_with_2_params(spl_ce_RecursiveDirectoryIterator->constructor, - Z_OBJ_P(zobj), NULL, &arg1, &arg2); + Z_OBJ_P(ZEND_THIS), NULL, &arg1, &arg2); zval_ptr_dtor(&arg1); @@ -1353,20 +1364,10 @@ PHP_METHOD(Phar, unlinkArchive) } /* }}} */ -#define PHAR_ARCHIVE_OBJECT() \ - zval *zobj = ZEND_THIS; \ - phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \ - if (!phar_obj->archive) { \ - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ - "Cannot call method on an uninitialized Phar object"); \ - RETURN_THROWS(); \ - } - /* {{{ if persistent, remove from the cache */ PHP_METHOD(Phar, __destruct) { - zval *zobj = ZEND_THIS; - phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); + phar_archive_object *phar_obj = PHAR_FETCH_INTERNAL(); if (zend_parse_parameters_none() == FAILURE) { RETURN_THROWS(); @@ -1458,7 +1459,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ case IS_OBJECT: if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo)) { char *test = NULL; - spl_filesystem_object *intern = (spl_filesystem_object*)((char*)Z_OBJ_P(value) - Z_OBJ_P(value)->handlers->offset); + spl_filesystem_object *intern = PHAR_FETCH_INTERNAL_EX(value); if (!base_len) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ZSTR_VAL(ce->name)); @@ -4460,13 +4461,13 @@ PHP_METHOD(PharFileInfo, __construct) phar_entry_object *entry_obj; phar_entry_info *entry_info; phar_archive_data *phar_data; - zval *zobj = ZEND_THIS, arg1; + zval arg1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) { RETURN_THROWS(); } - entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); + entry_obj = PHAR_FETCH_INTERNAL(); if (entry_obj->entry) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice"); @@ -4512,15 +4513,14 @@ PHP_METHOD(PharFileInfo, __construct) ZVAL_STRINGL(&arg1, fname, fname_len); zend_call_known_instance_method_with_1_params(spl_ce_SplFileInfo->constructor, - Z_OBJ_P(zobj), NULL, &arg1); + Z_OBJ_P(ZEND_THIS), NULL, &arg1); zval_ptr_dtor(&arg1); } /* }}} */ #define PHAR_ENTRY_OBJECT_EX(throw) \ - zval *zobj = ZEND_THIS; \ - phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \ + phar_entry_object *entry_obj = PHAR_FETCH_INTERNAL(); \ if (!entry_obj->entry) { \ if (throw) { \ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ From 29d6e29216740ce10c9876daaa6adf919773d81b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 23:45:00 +0200 Subject: [PATCH 191/386] phar: Remove confusing dtor calls (#20148) If object initialization fails the zval will be NULL, that's an implementation detail. However, it's very confusing for a reader to destroy a seemingly uninitialized zval. --- ext/phar/phar_object.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 92d96eebe4b12..f49503500625e 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1730,7 +1730,6 @@ PHP_METHOD(Phar, buildFromDirectory) } if (SUCCESS != object_init_ex(&iter, spl_ce_RecursiveDirectoryIterator)) { - zval_ptr_dtor(&iter); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1748,7 +1747,6 @@ PHP_METHOD(Phar, buildFromDirectory) if (SUCCESS != object_init_ex(&iteriter, spl_ce_RecursiveIteratorIterator)) { zval_ptr_dtor(&iter); - zval_ptr_dtor(&iteriter); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1769,7 +1767,6 @@ PHP_METHOD(Phar, buildFromDirectory) if (SUCCESS != object_init_ex(®exiter, spl_ce_RegexIterator)) { zval_ptr_dtor(&iteriter); - zval_ptr_dtor(®exiter); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname); RETURN_THROWS(); } @@ -2200,9 +2197,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* ce = phar_ce_archive; } - ZVAL_NULL(&ret); if (SUCCESS != object_init_ex(&ret, ce)) { - zval_ptr_dtor(&ret); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname); return NULL; } From 0dd2da190cee6ea2cfd89818b59c3d1db8dffacf Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 14:53:46 +0200 Subject: [PATCH 192/386] phar: Avoid memory allocation in setAlias() error code --- ext/phar/phar_object.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f49503500625e..5cb382926d6e5 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2730,13 +2730,10 @@ PHP_METHOD(Phar, setAlias) RETURN_TRUE; } if (NULL != (fd_ptr = zend_hash_find_ptr(&(PHAR_G(phar_alias_map)), new_alias))) { - spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), fd_ptr->fname); if (SUCCESS == phar_free_alias(fd_ptr, ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { - efree(error); goto valid_alias; } - zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); - efree(error); + zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), fd_ptr->fname); RETURN_THROWS(); } if (!phar_validate_alias(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { From 8e897f86029a0b8d014a43c9f270880a5d12214e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 14:55:06 +0200 Subject: [PATCH 193/386] phar: Avoid the use of goto in Phar::setAlias() --- ext/phar/phar_object.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 5cb382926d6e5..9295e067d7fa7 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2730,18 +2730,15 @@ PHP_METHOD(Phar, setAlias) RETURN_TRUE; } if (NULL != (fd_ptr = zend_hash_find_ptr(&(PHAR_G(phar_alias_map)), new_alias))) { - if (SUCCESS == phar_free_alias(fd_ptr, ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { - goto valid_alias; + if (SUCCESS != phar_free_alias(fd_ptr, ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { + zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), fd_ptr->fname); + RETURN_THROWS(); } - zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), fd_ptr->fname); - RETURN_THROWS(); - } - if (!phar_validate_alias(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { + } else if (!phar_validate_alias(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Invalid alias \"%s\" specified for phar \"%s\"", ZSTR_VAL(new_alias), phar_obj->archive->fname); RETURN_THROWS(); } -valid_alias: if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); From e52bf16390b13d07e219a340046e095de525860a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 14:57:46 +0200 Subject: [PATCH 194/386] phar: Use simpler memory management code in Phar::setAlias() The phar is CoW'd, so it is non-persistent. --- ext/phar/phar_object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 9295e067d7fa7..de58c464cf3c6 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2748,13 +2748,15 @@ PHP_METHOD(Phar, setAlias) readd = 1; } + ZEND_ASSERT(!phar_obj->archive->is_persistent); + oldalias = phar_obj->archive->alias; oldalias_len = phar_obj->archive->alias_len; old_temp = phar_obj->archive->is_temporary_alias; phar_obj->archive->alias_len = ZSTR_LEN(new_alias); if (phar_obj->archive->alias_len) { - phar_obj->archive->alias = pestrndup(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias), phar_obj->archive->is_persistent); + phar_obj->archive->alias = estrndup(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias)); } else { phar_obj->archive->alias = NULL; } @@ -2763,7 +2765,7 @@ PHP_METHOD(Phar, setAlias) phar_flush(phar_obj->archive, &error); if (error) { - pefree(phar_obj->archive->alias, phar_obj->archive->is_persistent); + efree(phar_obj->archive->alias); phar_obj->archive->alias = oldalias; phar_obj->archive->alias_len = oldalias_len; phar_obj->archive->is_temporary_alias = old_temp; From 4e562f49f35797ddd24a3e0b857aac88cafd8b07 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 5 Oct 2025 13:09:10 +0100 Subject: [PATCH 195/386] ext/sockets: socket_recvfrom() add test for missing port argument error message --- ...socket_recvfrom_ipv4_missing_port_arg.phpt | 17 +++++++++++++++ ...socket_recvfrom_ipv6_missing_port_arg.phpt | 21 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt create mode 100644 ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt diff --git a/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt b/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt new file mode 100644 index 0000000000000..2c5ed4068850e --- /dev/null +++ b/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt @@ -0,0 +1,17 @@ +--TEST-- +socket_recvfrom() with IPv4 socket missing port argument +--EXTENSIONS-- +sockets +--FILE-- +getMessage(), PHP_EOL; +} + +?> +--EXPECT-- +ArgumentCountError: Wrong parameter count for socket_recvfrom() diff --git a/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt b/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt new file mode 100644 index 0000000000000..66ce0bf291874 --- /dev/null +++ b/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt @@ -0,0 +1,21 @@ +--TEST-- +socket_recvfrom() with IPv6 socket missing port argument +--EXTENSIONS-- +sockets +--SKIPIF-- + +--FILE-- +getMessage(), PHP_EOL; +} + +?> +--EXPECT-- +ArgumentCountError: Wrong parameter count for socket_recvfrom() From fd1c3660ca9574b55f7d2657c5f47e0d3b6d8f29 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 5 Oct 2025 13:11:19 +0100 Subject: [PATCH 196/386] ext/sockets: socket_recvfrom() improve error message when port argument is missing --- ext/sockets/sockets.c | 13 +++++++++++-- .../socket_recvfrom_ipv4_missing_port_arg.phpt | 2 +- .../socket_recvfrom_ipv6_missing_port_arg.phpt | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index f9001dc56164c..4a9332498c3cc 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -18,6 +18,7 @@ +----------------------------------------------------------------------+ */ +#include "zend_exceptions.h" #ifdef HAVE_CONFIG_H #include #endif @@ -1580,7 +1581,11 @@ PHP_FUNCTION(socket_recvfrom) if (arg6 == NULL) { zend_string_efree(recv_buf); - WRONG_PARAM_COUNT; + zend_throw_exception( + zend_ce_argument_count_error, + "socket_recvfrom() expects exactly 6 arguments when argument #1 ($socket) is of type AF_INET or AF_INET6", + 0); + RETURN_THROWS(); } retval = recvfrom(php_sock->bsd_socket, ZSTR_VAL(recv_buf), arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen); @@ -1607,7 +1612,11 @@ PHP_FUNCTION(socket_recvfrom) if (arg6 == NULL) { zend_string_efree(recv_buf); - WRONG_PARAM_COUNT; + zend_throw_exception( + zend_ce_argument_count_error, + "socket_recvfrom() expects exactly 6 arguments when argument #1 ($socket) is of type AF_INET or AF_INET6", + 0); + RETURN_THROWS(); } retval = recvfrom(php_sock->bsd_socket, ZSTR_VAL(recv_buf), arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen); diff --git a/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt b/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt index 2c5ed4068850e..0554818fb67c8 100644 --- a/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt +++ b/ext/sockets/tests/socket_recvfrom_ipv4_missing_port_arg.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- -ArgumentCountError: Wrong parameter count for socket_recvfrom() +ArgumentCountError: socket_recvfrom() expects exactly 6 arguments when argument #1 ($socket) is of type AF_INET or AF_INET6 diff --git a/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt b/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt index 66ce0bf291874..957751a949763 100644 --- a/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt +++ b/ext/sockets/tests/socket_recvfrom_ipv6_missing_port_arg.phpt @@ -18,4 +18,4 @@ try { ?> --EXPECT-- -ArgumentCountError: Wrong parameter count for socket_recvfrom() +ArgumentCountError: socket_recvfrom() expects exactly 6 arguments when argument #1 ($socket) is of type AF_INET or AF_INET6 From aed3acfa113dcd7fd9741ab906fedc2761fdda53 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 15:23:28 +0100 Subject: [PATCH 197/386] ext/opcache: add const qualifiers --- ext/opcache/zend_accelerator_blacklist.c | 8 ++-- ext/opcache/zend_accelerator_blacklist.h | 4 +- ext/opcache/zend_accelerator_hash.c | 6 +-- ext/opcache/zend_accelerator_hash.h | 6 +-- ext/opcache/zend_accelerator_util_funcs.c | 48 +++++++++++------------ ext/opcache/zend_accelerator_util_funcs.h | 2 +- ext/opcache/zend_persist.c | 12 +++--- ext/opcache/zend_persist_calc.c | 20 +++++----- 8 files changed, 53 insertions(+), 53 deletions(-) diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 4c0e2f6c5a185..631f8b34608f3 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -205,7 +205,7 @@ void zend_accel_blacklist_shutdown(zend_blacklist *blacklist) return; } - zend_blacklist_entry *p = blacklist->entries, *end = blacklist->entries + blacklist->pos; + const zend_blacklist_entry *p = blacklist->entries, *end = blacklist->entries + blacklist->pos; while (ppath); p++; @@ -336,10 +336,10 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) zend_accel_blacklist_update_regexp(blacklist); } -bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len) +bool zend_accel_blacklist_is_blacklisted(const zend_blacklist *blacklist, const char *verify_path, size_t verify_path_len) { int ret = 0; - zend_regexp_list *regexp_list_it = blacklist->regexp_list; + const zend_regexp_list *regexp_list_it = blacklist->regexp_list; pcre2_match_context *mctx = php_pcre_mctx(); if (regexp_list_it == NULL) { @@ -363,7 +363,7 @@ bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify return ret; } -void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument) +void zend_accel_blacklist_apply(const zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument) { int i; diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h index 2a7921f63d947..da6e04e31b7ce 100644 --- a/ext/opcache/zend_accelerator_blacklist.h +++ b/ext/opcache/zend_accelerator_blacklist.h @@ -45,7 +45,7 @@ void zend_accel_blacklist_init(zend_blacklist *blacklist); void zend_accel_blacklist_shutdown(zend_blacklist *blacklist); void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename); -bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len); -void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument); +bool zend_accel_blacklist_is_blacklisted(const zend_blacklist *blacklist, const char *verify_path, size_t verify_path_len); +void zend_accel_blacklist_apply(const zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument); #endif /* ZEND_ACCELERATOR_BLACKLIST_H */ diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 2fd3dfb5ed56e..f62a204702298 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -138,7 +138,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, zend_ return entry; } -static zend_always_inline void* zend_accel_hash_find_ex(zend_accel_hash *accel_hash, zend_string *key, int data) +static zend_always_inline void* zend_accel_hash_find_ex(const zend_accel_hash *accel_hash, zend_string *key, int data) { zend_ulong index; zend_accel_hash_entry *entry; @@ -176,7 +176,7 @@ static zend_always_inline void* zend_accel_hash_find_ex(zend_accel_hash *accel_h /* Returns the data associated with key on success * Returns NULL if data doesn't exist */ -void* zend_accel_hash_find(zend_accel_hash *accel_hash, zend_string *key) +void* zend_accel_hash_find(const zend_accel_hash *accel_hash, zend_string *key) { return zend_accel_hash_find_ex(accel_hash, key, 1); } @@ -184,7 +184,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, zend_string *key) /* Returns the hash entry associated with key on success * Returns NULL if it doesn't exist */ -zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, zend_string *key) +zend_accel_hash_entry* zend_accel_hash_find_entry(const zend_accel_hash *accel_hash, zend_string *key) { return (zend_accel_hash_entry *)zend_accel_hash_find_ex(accel_hash, key, 0); } diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 6aa6ba7b80199..962dcc145cf43 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -72,18 +72,18 @@ zend_accel_hash_entry* zend_accel_hash_update( void *data); void* zend_accel_hash_find( - zend_accel_hash *accel_hash, + const zend_accel_hash *accel_hash, zend_string *key); zend_accel_hash_entry* zend_accel_hash_find_entry( - zend_accel_hash *accel_hash, + const zend_accel_hash *accel_hash, zend_string *key); int zend_accel_hash_unlink( zend_accel_hash *accel_hash, zend_string *key); -static inline bool zend_accel_hash_is_full(zend_accel_hash *accel_hash) +static inline bool zend_accel_hash_is_full(const zend_accel_hash *accel_hash) { if (accel_hash->num_entries == accel_hash->max_num_entries) { return true; diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index dc84f879d8d40..64b7acd41cce7 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -105,7 +105,7 @@ void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *s { Bucket *p, *end; HashTable *dst; - zend_string *filename; + const zend_string *filename; dtor_func_t orig_dtor; zend_class_entry *ce; @@ -132,10 +132,10 @@ void zend_accel_move_user_classes(HashTable *src, uint32_t count, zend_script *s src->pDestructor = orig_dtor; } -static zend_always_inline void _zend_accel_function_hash_copy(HashTable *target, HashTable *source, bool call_observers) +static zend_always_inline void _zend_accel_function_hash_copy(HashTable *target, const HashTable *source, bool call_observers) { zend_function *function1, *function2; - Bucket *p, *end; + const Bucket *p, *end; zval *t; zend_hash_extend(target, target->nNumUsed + source->nNumUsed, 0); @@ -174,20 +174,20 @@ static zend_always_inline void _zend_accel_function_hash_copy(HashTable *target, } } -static zend_always_inline void zend_accel_function_hash_copy(HashTable *target, HashTable *source) +static zend_always_inline void zend_accel_function_hash_copy(HashTable *target, const HashTable *source) { _zend_accel_function_hash_copy(target, source, false); } -static zend_never_inline void zend_accel_function_hash_copy_notify(HashTable *target, HashTable *source) +static zend_never_inline void zend_accel_function_hash_copy_notify(HashTable *target, const HashTable *source) { _zend_accel_function_hash_copy(target, source, true); } -static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, HashTable *source, bool call_observers) +static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, const HashTable *source, bool call_observers) { - Bucket *p, *end; - zval *t; + const Bucket *p, *end; + const zval *t; zend_hash_extend(target, target->nNumUsed + source->nNumUsed, 0); p = source->arData; @@ -209,7 +209,7 @@ static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, Ha * value. */ continue; } else if (UNEXPECTED(!ZCG(accel_directives).ignore_dups)) { - zend_class_entry *ce1 = Z_PTR(p->val); + const zend_class_entry *ce1 = Z_PTR(p->val); if (!(ce1->ce_flags & ZEND_ACC_ANON_CLASS)) { CG(in_compilation) = 1; zend_set_compiled_filename(ce1->info.user.filename); @@ -235,25 +235,25 @@ static zend_always_inline void _zend_accel_class_hash_copy(HashTable *target, Ha target->nInternalPointer = 0; } -static zend_always_inline void zend_accel_class_hash_copy(HashTable *target, HashTable *source) +static zend_always_inline void zend_accel_class_hash_copy(HashTable *target, const HashTable *source) { _zend_accel_class_hash_copy(target, source, false); } -static zend_never_inline void zend_accel_class_hash_copy_notify(HashTable *target, HashTable *source) +static zend_never_inline void zend_accel_class_hash_copy_notify(HashTable *target, const HashTable *source) { _zend_accel_class_hash_copy(target, source, true); } void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persistent_script) { - zend_op_array *op_array = &persistent_script->script.main_op_array; + const zend_op_array *op_array = &persistent_script->script.main_op_array; if (!(op_array->fn_flags & ZEND_ACC_EARLY_BINDING)) { return; } - zend_op *end = op_array->opcodes + op_array->last; - for (zend_op *opline = op_array->opcodes; opline < end; opline++) { + const zend_op *end = op_array->opcodes + op_array->last; + for (const zend_op *opline = op_array->opcodes; opline < end; opline++) { if (opline->opcode == ZEND_DECLARE_CLASS_DELAYED) { persistent_script->num_early_bindings++; } @@ -264,7 +264,7 @@ void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persist for (zend_op *opline = op_array->opcodes; opline < end; opline++) { if (opline->opcode == ZEND_DECLARE_CLASS_DELAYED) { - zval *lcname = RT_CONSTANT(opline, opline->op1); + const zval *lcname = RT_CONSTANT(opline, opline->op1); early_binding->lcname = zend_string_copy(Z_STR_P(lcname)); early_binding->rtd_key = zend_string_copy(Z_STR_P(lcname + 1)); early_binding->lc_parent_name = @@ -275,19 +275,19 @@ void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persist } } -void zend_accel_finalize_delayed_early_binding_list(zend_persistent_script *persistent_script) +void zend_accel_finalize_delayed_early_binding_list(const zend_persistent_script *persistent_script) { if (!persistent_script->num_early_bindings) { return; } zend_early_binding *early_binding = persistent_script->early_bindings; - zend_early_binding *early_binding_end = early_binding + persistent_script->num_early_bindings; - zend_op_array *op_array = &persistent_script->script.main_op_array; - zend_op *opline_end = op_array->opcodes + op_array->last; + const zend_early_binding *early_binding_end = early_binding + persistent_script->num_early_bindings; + const zend_op_array *op_array = &persistent_script->script.main_op_array; + const zend_op *opline_end = op_array->opcodes + op_array->last; for (zend_op *opline = op_array->opcodes; opline < opline_end; opline++) { if (opline->opcode == ZEND_DECLARE_CLASS_DELAYED) { - zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1); + const zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1); /* Skip early_binding entries that don't match, maybe their DECLARE_CLASS_DELAYED * was optimized away. */ while (!zend_string_equals(early_binding->rtd_key, rtd_key)) { @@ -310,7 +310,7 @@ void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persiste { if (persistent_script->num_early_bindings) { for (uint32_t i = 0; i < persistent_script->num_early_bindings; i++) { - zend_early_binding *early_binding = &persistent_script->early_bindings[i]; + const zend_early_binding *early_binding = &persistent_script->early_bindings[i]; zend_string_release(early_binding->lcname); zend_string_release(early_binding->rtd_key); zend_string_release(early_binding->lc_parent_name); @@ -322,7 +322,7 @@ void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persiste } static void zend_accel_do_delayed_early_binding( - zend_persistent_script *persistent_script, zend_op_array *op_array) + const zend_persistent_script *persistent_script, zend_op_array *op_array) { ZEND_ASSERT(!ZEND_MAP_PTR(op_array->run_time_cache)); ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_HEAP_RT_CACHE); @@ -336,7 +336,7 @@ static void zend_accel_do_delayed_early_binding( CG(compiled_filename) = persistent_script->script.filename; CG(in_compilation) = 1; for (uint32_t i = 0; i < persistent_script->num_early_bindings; i++) { - zend_early_binding *early_binding = &persistent_script->early_bindings[i]; + const zend_early_binding *early_binding = &persistent_script->early_bindings[i]; zend_class_entry *ce = zend_hash_find_ex_ptr(EG(class_table), early_binding->lcname, 1); if (!ce) { zval *zv = zend_hash_find_known_hash(EG(class_table), early_binding->rtd_key); @@ -448,7 +448,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, #define ADLER32_SCALAR_DO8(buf, i) ADLER32_SCALAR_DO4(buf, i); ADLER32_SCALAR_DO4(buf, i + 4); #define ADLER32_SCALAR_DO16(buf) ADLER32_SCALAR_DO8(buf, 0); ADLER32_SCALAR_DO8(buf, 8); -static zend_always_inline void adler32_do16_loop(unsigned char *buf, unsigned char *end, unsigned int *s1_out, unsigned int *s2_out) +static zend_always_inline void adler32_do16_loop(unsigned char *buf, const unsigned char *end, unsigned int *s1_out, unsigned int *s2_out) { unsigned int s1 = *s1_out; unsigned int s2 = *s2_out; diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index 53cc1de9effaa..b206e28bff9de 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -33,7 +33,7 @@ void free_persistent_script(zend_persistent_script *persistent_script, int destr void zend_accel_move_user_functions(HashTable *str, uint32_t count, zend_script *script); void zend_accel_move_user_classes(HashTable *str, uint32_t count, zend_script *script); void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persistent_script); -void zend_accel_finalize_delayed_early_binding_list(zend_persistent_script *persistent_script); +void zend_accel_finalize_delayed_early_binding_list(const zend_persistent_script *persistent_script); void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persistent_script); zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 38e58d5a16632..7a9e529172a27 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -732,7 +732,7 @@ static void zend_persist_op_array(zval *zv) } } -static zend_op_array *zend_persist_class_method(zend_op_array *op_array, zend_class_entry *ce) +static zend_op_array *zend_persist_class_method(zend_op_array *op_array, const zend_class_entry *ce) { zend_op_array *old_op_array; @@ -834,7 +834,7 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop) prop->attributes = zend_persist_attributes(prop->attributes); } if (prop->prototype) { - zend_property_info *new_prototype = (zend_property_info *) zend_shared_alloc_get_xlat_entry(prop->prototype); + const zend_property_info *new_prototype = (const zend_property_info *) zend_shared_alloc_get_xlat_entry(prop->prototype); if (new_prototype) { prop->prototype = new_prototype; } @@ -854,7 +854,7 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop) } } #endif - zend_property_info *new_prop_info = (zend_property_info *) zend_shared_alloc_get_xlat_entry(hook->prop_info); + const zend_property_info *new_prop_info = (const zend_property_info *) zend_shared_alloc_get_xlat_entry(hook->prop_info); if (new_prop_info) { hook->prop_info = new_prop_info; } @@ -868,7 +868,7 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop) static void zend_persist_class_constant(zval *zv) { - zend_class_constant *orig_c = Z_PTR_P(zv); + const zend_class_constant *orig_c = Z_PTR_P(zv); zend_class_constant *c = zend_shared_alloc_get_xlat_entry(orig_c); zend_class_entry *ce; @@ -1287,7 +1287,7 @@ void zend_update_parent_ce(zend_class_entry *ce) } #ifdef HAVE_JIT -static void zend_accel_persist_jit_op_array(zend_op_array *op_array, zend_class_entry *ce) +static void zend_accel_persist_jit_op_array(zend_op_array *op_array, const zend_class_entry *ce) { if (op_array->type == ZEND_USER_FUNCTION) { if (op_array->scope == ce @@ -1301,7 +1301,7 @@ static void zend_accel_persist_jit_op_array(zend_op_array *op_array, zend_class_ } } -static void zend_accel_persist_link_func_info(zend_op_array *op_array, zend_class_entry *ce) +static void zend_accel_persist_link_func_info(zend_op_array *op_array, const zend_class_entry *ce) { if (op_array->type == ZEND_USER_FUNCTION && !(op_array->fn_flags & ZEND_ACC_ABSTRACT)) { diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 106a69f5dd383..27c4c94702e3a 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -47,9 +47,9 @@ } while (0) static void zend_persist_zval_calc(zval *z); -static void zend_persist_op_array_calc(zval *zv); +static void zend_persist_op_array_calc(const zval *zv); -static void zend_hash_persist_calc(HashTable *ht) +static void zend_hash_persist_calc(const HashTable *ht) { if ((HT_FLAGS(ht) & HASH_FLAG_UNINITIALIZED) || ht->nNumUsed == 0) { return; @@ -79,7 +79,7 @@ static void zend_persist_ast_calc(zend_ast *ast) ADD_SIZE(sizeof(zend_ast_zval)); zend_persist_zval_calc(&((zend_ast_zval*)(ast))->val); } else if (zend_ast_is_list(ast)) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); ADD_SIZE(sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children); for (i = 0; i < list->children; i++) { if (list->child[i]) { @@ -125,7 +125,7 @@ static void zend_persist_zval_calc(zval *z) } size = zend_shared_memdup_size(Z_ARR_P(z), sizeof(zend_array)); if (size) { - HashTable *ht = Z_ARRVAL_P(z); + const HashTable *ht = Z_ARRVAL_P(z); ADD_SIZE(size); zend_hash_persist_calc(ht); @@ -218,7 +218,7 @@ static void zend_persist_type_calc(zend_type *type) static void zend_persist_op_array_calc_ex(zend_op_array *op_array) { if (op_array->function_name) { - zend_string *old_name = op_array->function_name; + const zend_string *old_name = op_array->function_name; ADD_INTERNED_STRING(op_array->function_name); /* Remember old function name, so it can be released multiple times if shared. */ if (op_array->function_name != old_name @@ -258,7 +258,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) if (op_array->literals) { zval *p = op_array->literals; - zval *end = p + op_array->last_literal; + const zval *end = p + op_array->last_literal; ADD_SIZE(sizeof(zval) * op_array->last_literal); while (p < end) { zend_persist_zval_calc(p); @@ -272,7 +272,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) /* ZEND_ACC_PTR_OPS and ZEND_ACC_OVERRIDE use the same value */ if ((op_array->fn_flags & ZEND_ACC_PTR_OPS) && !op_array->function_name) { zend_op *op = op_array->opcodes; - zend_op *end = op + op_array->last; + const zend_op *end = op + op_array->last; while (op < end) { if (op->opcode == ZEND_DECLARE_ATTRIBUTED_CONST) { HashTable *attributes = Z_PTR_P(RT_CONSTANT(op+1, (op+1)->op1)); @@ -344,7 +344,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) ADD_SIZE(ZEND_ALIGNED_SIZE(zend_extensions_op_array_persist_calc(op_array))); } -static void zend_persist_op_array_calc(zval *zv) +static void zend_persist_op_array_calc(const zval *zv) { zend_op_array *op_array = Z_PTR_P(zv); ZEND_ASSERT(op_array->type == ZEND_USER_FUNCTION); @@ -417,7 +417,7 @@ static void zend_persist_property_info_calc(zend_property_info *prop) } } -static void zend_persist_class_constant_calc(zval *zv) +static void zend_persist_class_constant_calc(const zval *zv) { zend_class_constant *c = Z_PTR_P(zv); @@ -596,7 +596,7 @@ void zend_persist_class_entry_calc(zend_class_entry *ce) } } -static void zend_accel_persist_class_table_calc(HashTable *class_table) +static void zend_accel_persist_class_table_calc(const HashTable *class_table) { Bucket *p; From 1b651dbc9e66d2644c9144951fb0078055fd438f Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 15:27:19 +0100 Subject: [PATCH 198/386] ext/opcache: use bool type instead of int --- ext/opcache/zend_accelerator_hash.c | 6 ++--- ext/opcache/zend_accelerator_module.c | 29 +++++++++++------------ ext/opcache/zend_accelerator_util_funcs.c | 4 ++-- ext/opcache/zend_accelerator_util_funcs.h | 4 ++-- ext/opcache/zend_persist.c | 2 +- ext/opcache/zend_persist.h | 4 ++-- ext/opcache/zend_persist_calc.c | 2 +- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index f62a204702298..5554266b94a06 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -138,7 +138,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, zend_ return entry; } -static zend_always_inline void* zend_accel_hash_find_ex(const zend_accel_hash *accel_hash, zend_string *key, int data) +static zend_always_inline void* zend_accel_hash_find_ex(const zend_accel_hash *accel_hash, zend_string *key, bool data) { zend_ulong index; zend_accel_hash_entry *entry; @@ -178,7 +178,7 @@ static zend_always_inline void* zend_accel_hash_find_ex(const zend_accel_hash *a */ void* zend_accel_hash_find(const zend_accel_hash *accel_hash, zend_string *key) { - return zend_accel_hash_find_ex(accel_hash, key, 1); + return zend_accel_hash_find_ex(accel_hash, key, true); } /* Returns the hash entry associated with key on success @@ -186,7 +186,7 @@ void* zend_accel_hash_find(const zend_accel_hash *accel_hash, zend_string *key) */ zend_accel_hash_entry* zend_accel_hash_find_entry(const zend_accel_hash *accel_hash, zend_string *key) { - return (zend_accel_hash_entry *)zend_accel_hash_find_ex(accel_hash, key, 0); + return (zend_accel_hash_entry *)zend_accel_hash_find_ex(accel_hash, key, false); } int zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 32d9354c1e6d5..d1751cbcbe995 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -62,7 +62,7 @@ static zif_handler orig_file_exists = NULL; static zif_handler orig_is_file = NULL; static zif_handler orig_is_readable = NULL; -static int validate_api_restriction(void) +static bool validate_api_restriction(void) { if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) { size_t len = strlen(ZCG(accel_directives).restrict_api); @@ -71,10 +71,10 @@ static int validate_api_restriction(void) strlen(SG(request_info).path_translated) < len || memcmp(SG(request_info).path_translated, ZCG(accel_directives).restrict_api, len) != 0) { zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " API is restricted by \"restrict_api\" configuration directive"); - return 0; + return false; } } - return 1; + return true; } static ZEND_INI_MH(OnUpdateMemoryConsumption) @@ -178,8 +178,8 @@ static ZEND_INI_MH(OnEnable) } return FAILURE; } else { - *p = 0; - ZCG(accelerator_enabled) = 0; + *p = false; + ZCG(accelerator_enabled) = false; return SUCCESS; } } @@ -363,7 +363,7 @@ ZEND_INI_BEGIN() #endif ZEND_INI_END() -static int filename_is_in_cache(zend_string *filename) +static bool filename_is_in_cache(zend_string *filename) { zend_string *key; @@ -373,27 +373,26 @@ static int filename_is_in_cache(zend_string *filename) if (persistent_script && !persistent_script->corrupted) { if (ZCG(accel_directives).validate_timestamps) { zend_file_handle handle; - int ret; + bool ret; zend_stream_init_filename_ex(&handle, filename); - ret = validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS - ? 1 : 0; + ret = validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS; zend_destroy_file_handle(&handle); return ret; } - return 1; + return true; } } - return 0; + return false; } -static int filename_is_in_file_cache(zend_string *filename) +static bool filename_is_in_file_cache(zend_string *filename) { zend_string *realpath = zend_resolve_path(filename); if (!realpath) { - return 0; + return false; } zend_file_handle handle; @@ -406,7 +405,7 @@ static int filename_is_in_file_cache(zend_string *filename) return result != NULL; } -static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS) +static bool accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS) { if (ZEND_NUM_ARGS() == 1) { zval *zv = ZEND_CALL_ARG(execute_data , 1); @@ -415,7 +414,7 @@ static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS) return filename_is_in_cache(Z_STR_P(zv)); } } - return 0; + return false; } static ZEND_NAMED_FUNCTION(accel_file_exists) diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 64b7acd41cce7..2de7854fb14c5 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -47,7 +47,7 @@ zend_persistent_script* create_persistent_script(void) return persistent_script; } -void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements) +void free_persistent_script(zend_persistent_script *persistent_script, bool destroy_elements) { if (!destroy_elements) { /* Both the keys and values have been transferred into the global tables. @@ -358,7 +358,7 @@ static void zend_accel_do_delayed_early_binding( CG(in_compilation) = orig_in_compilation; } -zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory) +zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, bool from_shared_memory) { zend_op_array *op_array; diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index b206e28bff9de..fa248edeef550 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -28,7 +28,7 @@ BEGIN_EXTERN_C() zend_persistent_script* create_persistent_script(void); -void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements); +void free_persistent_script(zend_persistent_script *persistent_script, bool destroy_elements); void zend_accel_move_user_functions(HashTable *str, uint32_t count, zend_script *script); void zend_accel_move_user_classes(HashTable *str, uint32_t count, zend_script *script); @@ -36,7 +36,7 @@ void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persist void zend_accel_finalize_delayed_early_binding_list(const zend_persistent_script *persistent_script); void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persistent_script); -zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory); +zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, bool from_shared_memory); #define ADLER32_INIT 1 /* initial Adler-32 value */ diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 7a9e529172a27..e1187b045b13e 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -1421,7 +1421,7 @@ static zend_early_binding *zend_persist_early_bindings( return early_bindings; } -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, int for_shm) +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, bool for_shm) { Bucket *p; diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h index 930430c9589b7..c8220217630e7 100644 --- a/ext/opcache/zend_persist.h +++ b/ext/opcache/zend_persist.h @@ -24,8 +24,8 @@ BEGIN_EXTERN_C() -uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, int for_shm); -zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, int for_shm); +uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, bool for_shm); +zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, bool for_shm); void zend_persist_class_entry_calc(zend_class_entry *ce); zend_class_entry *zend_persist_class_entry(zend_class_entry *ce); diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 27c4c94702e3a..3c763d239e5ff 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -629,7 +629,7 @@ static void zend_persist_early_bindings_calc( } } -uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, int for_shm) +uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, bool for_shm) { Bucket *p; From 20a44af376ef9ef22c65c232e5cd5fd7de67cfe5 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 15:35:26 +0100 Subject: [PATCH 199/386] ext/opcache: use zend_result type instead of int --- ext/opcache/zend_accelerator_hash.c | 2 +- ext/opcache/zend_accelerator_hash.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 5554266b94a06..5198c0b3b78c3 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -189,7 +189,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(const zend_accel_hash *accel_h return (zend_accel_hash_entry *)zend_accel_hash_find_ex(accel_hash, key, false); } -int zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key) +zend_result zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key) { zend_ulong hash_value; zend_ulong index; diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 962dcc145cf43..2f91973853864 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -79,7 +79,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry( const zend_accel_hash *accel_hash, zend_string *key); -int zend_accel_hash_unlink( +zend_result zend_accel_hash_unlink( zend_accel_hash *accel_hash, zend_string *key); From e0a82b53d4bc0de5892db5b1432632d0e14cf214 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 15:27:49 +0100 Subject: [PATCH 200/386] ext/opcache: use RETURN_BOOL() instead of if/else --- ext/opcache/zend_accelerator_module.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index d1751cbcbe995..949be6f9f8e44 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -946,11 +946,7 @@ ZEND_FUNCTION(opcache_invalidate) RETURN_FALSE; } - if (zend_accel_invalidate(script_name, force) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(zend_accel_invalidate(script_name, force) == SUCCESS); } /* {{{ Prevents JIT on function. Call it before the first invocation of the given function. */ From cab2faa48648e1310c6676120bc1c2bece38af52 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 15:30:02 +0100 Subject: [PATCH 201/386] ext/opcache/zend_accelerator_module.c: remove unused include --- ext/opcache/zend_accelerator_module.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 949be6f9f8e44..a2569e07f14c9 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -34,7 +34,6 @@ #include "SAPI.h" #include "zend_virtual_cwd.h" #include "ext/standard/info.h" -#include "ext/standard/php_filestat.h" #include "ext/date/php_date.h" #include "opcache_arginfo.h" From 3b54fa4038bc19821e8200c8c9baf92729789e5a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:47:11 +0200 Subject: [PATCH 202/386] Make entry argument nullable for phar_split_fname() to avoid extra allocations (#20146) --- ext/phar/dirstream.c | 14 ++++++-------- ext/phar/func_interceptors.c | 26 +++++++++----------------- ext/phar/phar.c | 22 ++++++++++++---------- ext/phar/phar_object.c | 18 +++++++----------- ext/phar/util.c | 11 ++++------- 5 files changed, 38 insertions(+), 53 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index c5aa292200e86..f23907ae7623a 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -349,12 +349,12 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo { phar_entry_info entry, *e; phar_archive_data *phar = NULL; - char *error, *arch, *entry2; - size_t arch_len, entry_len; + char *error, *arch; + size_t arch_len; php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2)) { + if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, NULL, NULL, 2, 2)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", no phar archive specified", url_from); return 0; } @@ -364,7 +364,6 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo } efree(arch); - efree(entry2); if (PHAR_G(readonly) && (!phar || !phar->is_data)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", write operations disabled", url_from); @@ -477,12 +476,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options { phar_entry_info *entry; phar_archive_data *phar = NULL; - char *error, *arch, *entry2; - size_t arch_len, entry_len; + char *error, *arch; + size_t arch_len; php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2)) { + if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, NULL, NULL, 2, 2)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url); return 0; } @@ -492,7 +491,6 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options } efree(arch); - efree(entry2); if (PHAR_G(readonly) && (!phar || !phar->is_data)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot rmdir directory \"%s\", write operations disabled", url); diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 976ce0b5e955c..f7e553a45ce80 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -50,12 +50,11 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { php_stream_context *context = NULL; php_stream *stream; char *name; - efree(entry); entry = estrndup(filename, filename_len); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_len; @@ -89,8 +88,8 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool using_include_path) { - char *arch, *entry; - size_t arch_len, entry_len; + char *arch; + size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -99,13 +98,10 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool return NULL; } - if (FAILURE == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0)) { + if (FAILURE == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { return NULL; } - efree(entry); - entry = NULL; - entry_len = 0; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ /* retrieving a file defaults to within the current directory, so use this if possible */ phar_archive_data *phar; @@ -122,8 +118,8 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool return NULL; } } else { - entry_len = ZSTR_LEN(filename); - entry = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &entry_len, 1); + size_t entry_len = ZSTR_LEN(filename); + char *entry = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &entry_len, 1); if (entry[0] == '/') { if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) { /* this file is not in the phar, use the original path */ @@ -509,9 +505,7 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ phar = PHAR_G(last_phar); goto splitted; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0)) { - - efree(entry); + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { entry = estrndup(filename, filename_length); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_length; @@ -751,10 +745,9 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { phar_archive_data *phar; - efree(entry); entry = filename; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_len; @@ -817,10 +810,9 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { phar_archive_data *phar; - efree(entry); entry = filename; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_len; diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 5a5012adbf18e..d2c25dfbdb711 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2298,16 +2298,18 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a *arch_len = ext_str - filename + ext_len; *arch = estrndup(filename, *arch_len); - if (ext_str[ext_len]) { - *entry_len = filename_len - *arch_len; - *entry = estrndup(ext_str+ext_len, *entry_len); -#ifdef PHP_WIN32 - phar_unixify_path_separators(*entry, *entry_len); -#endif - *entry = phar_fix_filepath(*entry, entry_len, 0); - } else { - *entry_len = 1; - *entry = estrndup("/", 1); + if (entry) { + if (ext_str[ext_len]) { + *entry_len = filename_len - *arch_len; + *entry = estrndup(ext_str+ext_len, *entry_len); + #ifdef PHP_WIN32 + phar_unixify_path_separators(*entry, *entry_len); + #endif + *entry = phar_fix_filepath(*entry, entry_len, 0); + } else { + *entry_len = 1; + *entry = estrndup("/", 1); + } } #ifdef PHP_WIN32 diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index de58c464cf3c6..6d5d39604197d 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -412,8 +412,8 @@ static void phar_postprocess_ru_web(char *fname, size_t fname_len, char **entry, PHP_METHOD(Phar, running) { zend_string *fname; - char *arch, *entry; - size_t arch_len, entry_len; + char *arch; + size_t arch_len; bool retphar = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) { @@ -427,9 +427,8 @@ PHP_METHOD(Phar, running) if ( zend_string_starts_with_literal_ci(fname, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 2, 0) + && SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0) ) { - efree(entry); if (retphar) { RETVAL_STRINGL(ZSTR_VAL(fname), arch_len + 7); efree(arch); @@ -485,8 +484,7 @@ PHP_METHOD(Phar, mount) } #endif - if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { - efree(entry); + if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, NULL, NULL, 2, 0)) { entry = NULL; if (path_len > 7 && !memcmp(path, "phar://", 7)) { @@ -1300,9 +1298,9 @@ PHP_METHOD(Phar, getSupportedCompression) /* {{{ Completely remove a phar archive from memory and disk */ PHP_METHOD(Phar, unlinkArchive) { - char *fname, *error, *arch, *entry; + char *fname, *error, *arch; size_t fname_len; - size_t arch_len, entry_len; + size_t arch_len; phar_archive_data *phar; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) { @@ -1329,16 +1327,14 @@ PHP_METHOD(Phar, unlinkArchive) if ( zend_file_name && zend_string_starts_with_literal_ci(zend_file_name, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), &arch, &arch_len, &entry, &entry_len, 2, 0) + && SUCCESS == phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), &arch, &arch_len, NULL, NULL, 2, 0) ) { if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname); efree(arch); - efree(entry); RETURN_THROWS(); } efree(arch); - efree(entry); } if (phar->is_persistent) { diff --git a/ext/phar/util.c b/ext/phar/util.c index aa30515eff6a0..26a11d99a9c14 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -267,8 +267,8 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data **pphar) /* {{{ */ { zend_string *ret; - char *path, *arch, *entry, *test; - size_t arch_len, entry_len; + char *path, *arch, *test; + size_t arch_len; phar_archive_data *phar; if (pphar) { @@ -301,12 +301,10 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data goto splitted; } - if (!is_file_a_phar_wrapper || SUCCESS != phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, &entry, &entry_len, 1, 0)) { + if (!is_file_a_phar_wrapper || SUCCESS != phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 1, 0)) { return NULL; } - efree(entry); - if (*ZSTR_VAL(filename) == '.') { size_t try_len; @@ -347,7 +345,7 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data if (ret && zend_string_starts_with_literal_ci(ret, "phar://")) { /* found phar:// */ - if (SUCCESS != phar_split_fname(ZSTR_VAL(ret), ZSTR_LEN(ret), &arch, &arch_len, &entry, &entry_len, 1, 0)) { + if (SUCCESS != phar_split_fname(ZSTR_VAL(ret), ZSTR_LEN(ret), &arch, &arch_len, NULL, NULL, 1, 0)) { return ret; } @@ -358,7 +356,6 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data } efree(arch); - efree(entry); } return ret; From aab5045a5b3c20d0ef99b3491868e40f1deb5e28 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:18:13 +0200 Subject: [PATCH 203/386] Add extra checks to Phar::mungServer() (#20141) * Add extra checks to Phar::mungServer() * [ci skip] NEWS/UPGRADING --- NEWS | 5 +++++ UPGRADING | 7 +++++++ ext/phar/phar_object.c | 6 ++++-- .../tests/invalid_string_phar_mungserver.phpt | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 ext/phar/tests/invalid_string_phar_mungserver.phpt diff --git a/NEWS b/NEWS index 993bdda130cd9..986783ce042d3 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,11 @@ PHP NEWS . Fixed bug GH-20051 (apache2 shutdowns when restart is requested during preloading). (Arnaud, welcomycozyhom) +- Phar: + . Support reference values in Phar::mungServer(). (nielsdos) + . Invalid values now throw in Phar::mungServer() instead of being silently + ignored. (nielsdos) + - Standard: . Fixed bug GH-19926 (reset internal pointer earlier while splicing array while COW violation flag is still set). (alexandre-daubois) diff --git a/UPGRADING b/UPGRADING index b9095380ed538..4b166bb5af463 100644 --- a/UPGRADING +++ b/UPGRADING @@ -19,6 +19,10 @@ PHP 8.6 UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- Phar: + . Invalid values now throw in Phar::mungServer() instead of being silently + ignored. + ======================================== 2. New Features ======================================== @@ -44,6 +48,9 @@ PHP 8.6 UPGRADE NOTES 5. Changed Functions ======================================== +- Phar: + . Phar::mungServer() now supports reference values. + ======================================== 6. New Functions ======================================== diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index a9c36f9fe59e7..2ea701743f9ff 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -903,7 +903,7 @@ PHP_METHOD(Phar, mungServer) phar_request_initialize(); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(mungvalues), data) { - + ZVAL_DEREF(data); if (Z_TYPE_P(data) != IS_STRING) { zend_throw_exception_ex(phar_ce_PharException, 0, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME"); RETURN_THROWS(); @@ -917,8 +917,10 @@ PHP_METHOD(Phar, mungServer) PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_SCRIPT_NAME; } else if (zend_string_equals_literal(Z_STR_P(data), "SCRIPT_FILENAME")) { PHAR_G(phar_SERVER_mung_list) |= PHAR_MUNG_SCRIPT_FILENAME; + } else { + zend_throw_exception_ex(phar_ce_PharException, 0, "Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME"); + RETURN_THROWS(); } - // TODO Warning for invalid value? } ZEND_HASH_FOREACH_END(); } /* }}} */ diff --git a/ext/phar/tests/invalid_string_phar_mungserver.phpt b/ext/phar/tests/invalid_string_phar_mungserver.phpt new file mode 100644 index 0000000000000..46de113f6c087 --- /dev/null +++ b/ext/phar/tests/invalid_string_phar_mungserver.phpt @@ -0,0 +1,15 @@ +--TEST-- +Passing invalid string to Phar::mungServer() +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME From 0587da9ef1f3f53060bc075b9d3e366dd78e0065 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 00:11:02 +0100 Subject: [PATCH 204/386] ext/gd/imagefilter: Add test case for manual ZPP --- ext/gd/tests/imagefilter_error1.phpt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/gd/tests/imagefilter_error1.phpt b/ext/gd/tests/imagefilter_error1.phpt index 6e2ccabb874a8..aa770d5ea8d63 100644 --- a/ext/gd/tests/imagefilter_error1.phpt +++ b/ext/gd/tests/imagefilter_error1.phpt @@ -14,6 +14,12 @@ try { } catch (TypeError $e) { echo $e->getMessage(), "\n"; } +try { + var_dump(imagefilter(20, 1)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECT-- Wrong parameter count for imagefilter() +imagefilter(): Argument #1 ($image) must be of type GdImage, int given From 6cb21229f86078342ef440e32da2e4fd1eb7f396 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 00:34:18 +0100 Subject: [PATCH 205/386] ext/gd/imagefilter: Improve wording of ArgCount error This is done by parsing this as 2 arguments with variadics that are never actually parsed --- ext/gd/gd.c | 8 ++++---- ext/gd/tests/imagefilter_error1.phpt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 5b2c34672f3b0..df741ef255d4a 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -3605,7 +3605,7 @@ PHP_FUNCTION(imagefilter) zval *tmp; typedef void (*image_filter)(INTERNAL_FUNCTION_PARAMETERS); - zend_long filtertype; + zend_long filtertype = 0; image_filter filters[] = { php_image_filter_negate , @@ -3623,9 +3623,9 @@ PHP_FUNCTION(imagefilter) php_image_filter_scatter }; - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > IMAGE_FILTER_MAX_ARGS) { - WRONG_PARAM_COUNT; - } else if (zend_parse_parameters(2, "Ol", &tmp, gd_image_ce, &filtertype) == FAILURE) { + /* We need to do some initial ZPP parsing to be able to extract the filter value */ + if (zend_parse_parameters(MIN(2, ZEND_NUM_ARGS()), "Ol*", &tmp, gd_image_ce, &filtertype) == FAILURE) { + RETURN_THROWS(); } diff --git a/ext/gd/tests/imagefilter_error1.phpt b/ext/gd/tests/imagefilter_error1.phpt index aa770d5ea8d63..cc9904e320dac 100644 --- a/ext/gd/tests/imagefilter_error1.phpt +++ b/ext/gd/tests/imagefilter_error1.phpt @@ -21,5 +21,5 @@ try { } ?> --EXPECT-- -Wrong parameter count for imagefilter() +imagefilter() expects at least 2 arguments, 1 given imagefilter(): Argument #1 ($image) must be of type GdImage, int given From e1240f25df2f56668f8159cf32faa39c7dd5a4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 14 Oct 2025 10:20:16 +0200 Subject: [PATCH 206/386] zend_operators: Remove `_zval_get_*()` PHP 7.2 compatibility macros (#20152) These have been unused for long enough and just pollute the symbol namespace. --- UPGRADING.INTERNALS | 4 ++++ Zend/zend_operators.h | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index ada814964fc5f..eab5ad233be3c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -22,6 +22,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES added, given the primary flags were running out of bits. . The zval_is_true() alias of zend_is_true() has been removed. Call zend_is_true() directly instead. + . The _zval_get_*() compatibility macros for PHP 7.2 have been removed + call the variant without the leading underscore instead. + Affected: _zval_get_long, _zval_get_double, _zval_get_string, + _zval_get_long_func, _zval_get_double_func, _zval_get_string_func ======================== 2. Build system changes diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 4a74e6ebaefe9..ff31c84c41e5e 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -390,14 +390,6 @@ static zend_always_inline bool try_convert_to_string(zval *op) { return _try_convert_to_string(op); } -/* Compatibility macros for 7.2 and below */ -#define _zval_get_long(op) zval_get_long(op) -#define _zval_get_double(op) zval_get_double(op) -#define _zval_get_string(op) zval_get_string(op) -#define _zval_get_long_func(op) zval_get_long_func(op) -#define _zval_get_double_func(op) zval_get_double_func(op) -#define _zval_get_string_func(op) zval_get_string_func(op) - #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op)); } From 44aea65486eb74640c35fa83da7e2b1a022cbf8e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 14 Oct 2025 18:48:10 +0200 Subject: [PATCH 207/386] phar: Change hacky check into an exception (#20160) phar_metadata_tracker_unserialize_or_copy() is only ever preceded by phar_metadata_tracker_has_data() which won't throw. This check is quite hacky and it should always be the responsibility of the caller to avoid calling this, even the comment acknowledges this is a hack. --- ext/phar/phar.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index d2c25dfbdb711..6d408708fc246 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -595,13 +595,9 @@ zend_result phar_metadata_tracker_unserialize_or_copy(phar_metadata_tracker *tra const bool has_unserialize_options = unserialize_options != NULL && zend_hash_num_elements(unserialize_options) > 0; /* It should be impossible to create a zval in a persistent phar/entry. */ ZEND_ASSERT(!persistent || Z_ISUNDEF(tracker->val)); + ZEND_ASSERT(!EG(exception)); if (Z_ISUNDEF(tracker->val) || has_unserialize_options) { - if (EG(exception)) { - /* Because other parts of the phar code haven't been updated to check for exceptions after doing something that may throw, - * check for exceptions before potentially serializing/unserializing instead. */ - return FAILURE; - } /* Persistent phars should always be unserialized. */ const char *start; /* Assert it should not be possible to create raw data in a persistent phar (i.e. from cache_list) */ From f2f45f37f8c8f028340528100f087317a97d2a43 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 14 Oct 2025 20:14:57 +0200 Subject: [PATCH 208/386] phar: Use object_init_with_constructor where possible (#20156) * phar: Use object_init_with_constructor where possible We could also chain the exceptions, but the current code keeps the existing behaviour by adding EG(exception) checks. * Drop redundant exception throwing --- ext/phar/phar_object.c | 51 ++++++++++++------------------------------ 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 2ea701743f9ff..cde10da0c9415 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1711,7 +1711,7 @@ PHP_METHOD(Phar, buildFromDirectory) { char *error; bool apply_reg = false; - zval arg, arg2, iter, iteriter, regexiter; + zval iter, iteriter, regexiter; struct _phar_t pass; zend_string *dir, *regex = NULL; @@ -1727,34 +1727,16 @@ PHP_METHOD(Phar, buildFromDirectory) RETURN_THROWS(); } - if (SUCCESS != object_init_ex(&iter, spl_ce_RecursiveDirectoryIterator)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); - RETURN_THROWS(); - } - - ZVAL_STR(&arg, dir); - ZVAL_LONG(&arg2, SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS); + zval args[2]; + ZVAL_STR(&args[0], dir); + ZVAL_LONG(&args[1], SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS); - zend_call_known_instance_method_with_2_params(spl_ce_RecursiveDirectoryIterator->constructor, - Z_OBJ(iter), NULL, &arg, &arg2); - - if (EG(exception)) { - zval_ptr_dtor(&iter); + if (SUCCESS != object_init_with_constructor(&iter, spl_ce_RecursiveDirectoryIterator, 2, args, NULL)) { RETURN_THROWS(); } - if (SUCCESS != object_init_ex(&iteriter, spl_ce_RecursiveIteratorIterator)) { + if (SUCCESS != object_init_with_constructor(&iteriter, spl_ce_RecursiveIteratorIterator, 1, &iter, NULL)) { zval_ptr_dtor(&iter); - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); - RETURN_THROWS(); - } - - zend_call_known_instance_method_with_1_params(spl_ce_RecursiveIteratorIterator->constructor, - Z_OBJ(iteriter), NULL, &iter); - - if (EG(exception)) { - zval_ptr_dtor(&iter); - zval_ptr_dtor(&iteriter); RETURN_THROWS(); } @@ -1763,15 +1745,13 @@ PHP_METHOD(Phar, buildFromDirectory) if (regex && ZSTR_LEN(regex) > 0) { apply_reg = true; - if (SUCCESS != object_init_ex(®exiter, spl_ce_RegexIterator)) { + ZVAL_COPY_VALUE(&args[0], &iteriter); + ZVAL_STR(&args[1], regex); + + if (SUCCESS != object_init_with_constructor(®exiter, spl_ce_RegexIterator, 2, args, NULL)) { zval_ptr_dtor(&iteriter); - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname); RETURN_THROWS(); } - - ZVAL_STR(&arg2, regex); - zend_call_known_instance_method_with_2_params(spl_ce_RegexIterator->constructor, - Z_OBJ(regexiter), NULL, &iteriter, &arg2); } array_init(return_value); @@ -2199,15 +2179,12 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* ce = phar_ce_archive; } - if (SUCCESS != object_init_ex(&ret, ce)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname); + ZVAL_STRINGL(&arg1, phar->fname, phar->fname_len); + zend_result result = object_init_with_constructor(&ret, ce, 1, &arg1, NULL); + zval_ptr_dtor_str(&arg1); + if (SUCCESS != result) { return NULL; } - - ZVAL_STRINGL(&arg1, phar->fname, phar->fname_len); - - zend_call_known_instance_method_with_1_params(ce->constructor, Z_OBJ(ret), NULL, &arg1); - zval_ptr_dtor(&arg1); return Z_OBJ(ret); err_reused_oldpath: From e2da92b15c71d2a97420ca590fa6579f049d008a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 27 Aug 2025 05:37:45 +0200 Subject: [PATCH 209/386] Fix ZipArchive callback being called after executor has shut down free_obj() for objects referenced in the main symbol table may be called only once the executor has already shut down. php_zip_cancel_callback() may attempt to invoke a user callback, which will terminate the process because user code is not expected to be executed at this point. We solve this by calling the callback in dtor_obj(), which is called earlier in the shutdown sequence. dtor_obj() will actually attempt to call it again if the object was reinitialized in the destructor, so we also avoid calling the callback when the executor has shut down in the first place. This should never matter in practice. Closes GH-19602 --- NEWS | 4 ++++ ext/zip/php_zip.c | 24 ++++++++++++++++++++++ ext/zip/tests/ZipArchive_bailout.phpt | 28 ++++++++++++++++++++++++++ ext/zip/tests/ZipArchive_destruct.phpt | 28 ++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 ext/zip/tests/ZipArchive_bailout.phpt create mode 100644 ext/zip/tests/ZipArchive_destruct.phpt diff --git a/NEWS b/NEWS index 986783ce042d3..eea553c105135 100644 --- a/NEWS +++ b/NEWS @@ -29,4 +29,8 @@ PHP NEWS . Fixed bug GH-19926 (reset internal pointer earlier while splicing array while COW violation flag is still set). (alexandre-daubois) +- Zip: + . Fixed ZipArchive callback being called after executor has shut down. + (ilutov) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 54d2fb4ff967b..cfc748ae86f91 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1002,6 +1002,21 @@ static void php_zip_cancel_callback_free(void *ptr) } #endif +static void php_zip_object_dtor(zend_object *object) +{ + zend_objects_destroy_object(object); + + ze_zip_object *intern = php_zip_fetch_object(object); + + if (intern->za) { + if (zip_close(intern->za) != 0) { + php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", zip_strerror(intern->za)); + zip_discard(intern->za); + } + intern->za = NULL; + } +} + static void php_zip_object_free_storage(zend_object *object) /* {{{ */ { ze_zip_object * intern = php_zip_fetch_object(object); @@ -2995,6 +3010,10 @@ PHP_METHOD(ZipArchive, getStream) #ifdef HAVE_PROGRESS_CALLBACK static void php_zip_progress_callback(zip_t *arch, double state, void *ptr) { + if (!EG(active)) { + return; + } + zval cb_args[1]; ze_zip_object *obj = ptr; @@ -3041,6 +3060,10 @@ static int php_zip_cancel_callback(zip_t *arch, void *ptr) zval cb_retval; ze_zip_object *obj = ptr; + if (!EG(active)) { + return 0; + } + zend_call_known_fcc(&obj->cancel_callback, &cb_retval, 0, NULL, NULL); if (Z_ISUNDEF(cb_retval)) { /* Cancel if an exception has been thrown */ @@ -3128,6 +3151,7 @@ static PHP_MINIT_FUNCTION(zip) memcpy(&zip_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); zip_object_handlers.offset = XtOffsetOf(ze_zip_object, zo); zip_object_handlers.free_obj = php_zip_object_free_storage; + zip_object_handlers.dtor_obj = php_zip_object_dtor; zip_object_handlers.clone_obj = NULL; zip_object_handlers.get_property_ptr_ptr = php_zip_get_property_ptr_ptr; diff --git a/ext/zip/tests/ZipArchive_bailout.phpt b/ext/zip/tests/ZipArchive_bailout.phpt new file mode 100644 index 0000000000000..c7e4ede8446df --- /dev/null +++ b/ext/zip/tests/ZipArchive_bailout.phpt @@ -0,0 +1,28 @@ +--TEST-- +ZipArchive destructor should be called on bailout +--EXTENSIONS-- +zip +--FILE-- +open($file, ZIPARCHIVE::CREATE); +$zip->registerCancelCallback(cb(...)); +$zip->addFromString('test', 'test'); +$fusion = $zip; + +?> +--CLEAN-- + +--EXPECTF-- +Notice: Only variable references should be returned by reference in %s on line %d + +Notice: Only variable references should be returned by reference in %s on line %d + +Notice: Only variable references should be returned by reference in %s on line %d diff --git a/ext/zip/tests/ZipArchive_destruct.phpt b/ext/zip/tests/ZipArchive_destruct.phpt new file mode 100644 index 0000000000000..7e3ef6c5dae42 --- /dev/null +++ b/ext/zip/tests/ZipArchive_destruct.phpt @@ -0,0 +1,28 @@ +--TEST-- +Leaking ZipArchive destructor +--EXTENSIONS-- +zip +--FILE-- +open($file, ZIPARCHIVE::CREATE); +$leak->addFromString('test', 'test'); + +?> +===DONE=== +--CLEAN-- + +--EXPECT-- +===DONE=== From c42fcec453b5936bf459dedd833cf0a2621f0709 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 15 Oct 2025 09:20:54 +0200 Subject: [PATCH 210/386] Remove xmlInitParser() call from DOM (#20168) Follow-up for GH-20150. --- ext/dom/document.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/dom/document.c b/ext/dom/document.c index 4d366db08f0eb..2152d98622a98 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1380,8 +1380,6 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source, substitute_ent = doc_props->substituteentities; recover = doc_props->recover || (options & XML_PARSE_RECOVER) == XML_PARSE_RECOVER; - xmlInitParser(); - if (mode == DOM_LOAD_FILE) { if (CHECK_NULL_PATH(source, source_len)) { zend_argument_value_error(1, "must not contain any null bytes"); From 6da93a86f2aafb44709ebe998ea38bea70aadd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 15 Oct 2025 10:24:22 +0200 Subject: [PATCH 211/386] zend_API: Remove `CHECK*NULL_PATH` (#20155) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * tree-wide: Replace `CHECK_NULL_PATH()` by `zend_char_has_nul_byte()` The former is a direct alias of the latter with a more explicit name and the former is explicitly documented as a “compatibility” alias. * tree-wide: Replace `CHECK_ZVAL_NULL_PATH()` by its definition The former is explicitly documented as a “compatibility” alias. * zend_API: Remove `CHECK*NULL_PATH` The `CHECK_ZVAL_NULL_PATH()` macro is unsafe, because it implicitly assumes that the given `zval*` is `IS_STRING`. Based on a GitHub search there does not seem to be any user outside of PHP, all hits were just forks / copies of php-src. --- UPGRADING.INTERNALS | 3 +++ Zend/zend_API.h | 4 ---- ext/bz2/bz2.c | 2 +- ext/dom/document.c | 8 ++++---- ext/gd/gd.c | 2 +- ext/hash/hash.c | 4 ++-- ext/openssl/openssl.c | 2 +- ext/phar/phar.c | 2 +- main/fopen_wrappers.c | 2 +- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index eab5ad233be3c..fe2781e025687 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -26,6 +26,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES call the variant without the leading underscore instead. Affected: _zval_get_long, _zval_get_double, _zval_get_string, _zval_get_long_func, _zval_get_double_func, _zval_get_string_func + . CHECK_ZVAL_NULL_PATH() and CHECK_NULL_PATH() have been removed, use + zend_str_has_nul_byte(Z_STR_P(...)) and zend_char_has_nul_byte() + respectively. ======================== 2. Build system changes diff --git a/Zend/zend_API.h b/Zend/zend_API.h index f3a56eff95079..4e2954c0a65c8 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -951,10 +951,6 @@ static zend_always_inline bool zend_char_has_nul_byte(const char *s, size_t know return known_length != strlen(s); } -/* Compatibility with PHP 8.1 and below */ -#define CHECK_ZVAL_NULL_PATH(p) zend_str_has_nul_byte(Z_STR_P(p)) -#define CHECK_NULL_PATH(p, l) zend_char_has_nul_byte(p, l) - #define ZVAL_STRINGL(z, s, l) do { \ ZVAL_NEW_STR(z, zend_string_init(s, l, 0)); \ } while (0) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index aff9d5c11b9ed..e7491f12cf315 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -352,7 +352,7 @@ PHP_FUNCTION(bzopen) RETURN_THROWS(); } - if (CHECK_ZVAL_NULL_PATH(file)) { + if (zend_str_has_nul_byte(Z_STR_P(file))) { zend_argument_type_error(1, "must not contain null bytes"); RETURN_THROWS(); } diff --git a/ext/dom/document.c b/ext/dom/document.c index 2152d98622a98..4a10f4dd19b6f 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1381,7 +1381,7 @@ xmlDocPtr dom_document_parser(zval *id, dom_load_mode mode, const char *source, recover = doc_props->recover || (options & XML_PARSE_RECOVER) == XML_PARSE_RECOVER; if (mode == DOM_LOAD_FILE) { - if (CHECK_NULL_PATH(source, source_len)) { + if (zend_char_has_nul_byte(source, source_len)) { zend_argument_value_error(1, "must not contain any null bytes"); return NULL; } @@ -1864,7 +1864,7 @@ static void dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) switch (type) { case DOM_LOAD_FILE: - if (CHECK_NULL_PATH(source, source_len)) { + if (zend_char_has_nul_byte(source, source_len)) { PHP_LIBXML_RESTORE_GLOBALS(new_parser_ctxt); zend_argument_value_error(1, "must not contain any null bytes"); RETURN_THROWS(); @@ -1971,7 +1971,7 @@ static void dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type switch (type) { case DOM_LOAD_FILE: - if (CHECK_NULL_PATH(source, source_len)) { + if (zend_char_has_nul_byte(source, source_len)) { zend_argument_value_error(1, "must not contain any null bytes"); RETURN_THROWS(); } @@ -2064,7 +2064,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ } if (mode == DOM_LOAD_FILE) { - if (CHECK_NULL_PATH(source, source_len)) { + if (zend_char_has_nul_byte(source, source_len)) { zend_argument_value_error(1, "must not contain any null bytes"); RETURN_THROWS(); } diff --git a/ext/gd/gd.c b/ext/gd/gd.c index df741ef255d4a..e946ec73d7dbb 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -4378,7 +4378,7 @@ static gdIOCtx *create_output_context(zval *to_zval, uint32_t arg_num) { } close_stream = 0; } else if (Z_TYPE_P(to_zval) == IS_STRING) { - if (CHECK_ZVAL_NULL_PATH(to_zval)) { + if (zend_str_has_nul_byte(Z_STR_P(to_zval))) { zend_argument_type_error(arg_num, "must not contain null bytes"); return NULL; } diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 98a52536a683a..d255711efbed9 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -365,7 +365,7 @@ static void php_hash_do_hash( RETURN_THROWS(); } if (isfilename) { - if (CHECK_NULL_PATH(data, data_len)) { + if (zend_char_has_nul_byte(data, data_len)) { zend_argument_value_error(1, "must not contain any null bytes"); RETURN_THROWS(); } @@ -508,7 +508,7 @@ static void php_hash_do_hash_hmac( } if (isfilename) { - if (CHECK_NULL_PATH(data, data_len)) { + if (zend_char_has_nul_byte(data, data_len)) { zend_argument_value_error(2, "must not contain any null bytes"); RETURN_THROWS(); } diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 736bdf315e3e9..2c09b89e31200 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -303,7 +303,7 @@ bool php_openssl_check_path_ex( fs_file_path_len = file_path_len; } - if (CHECK_NULL_PATH(fs_file_path, fs_file_path_len)) { + if (zend_char_has_nul_byte(fs_file_path, fs_file_path_len)) { error_msg = "must not contain any null bytes"; error_type = E_ERROR; } else if (expand_filepath(fs_file_path, real_path) == NULL) { diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 6d408708fc246..39ef82e901441 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2251,7 +2251,7 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a #endif size_t ext_len; - if (CHECK_NULL_PATH(filename, filename_len)) { + if (zend_char_has_nul_byte(filename, filename_len)) { return FAILURE; } diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index fc0dbb9a984ea..63564cc73bdfc 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -506,7 +506,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_lengt php_stream_wrapper *wrapper; zend_string *exec_filename; - if (!filename || CHECK_NULL_PATH(filename, filename_length)) { + if (!filename || zend_char_has_nul_byte(filename, filename_length)) { return NULL; } From e3e37c801fd6aea0f393a1d97c532ad91fac8bdf Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 15 Oct 2025 23:19:02 +0530 Subject: [PATCH 212/386] Upgrade nightly macOS version to macos 15 (#20159) --- .github/workflows/nightly.yml | 15 +++++++++------ .github/workflows/root.yml | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c310565f3b577..ded06c46b2ecf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,9 @@ on: libmysqlclient_with_mysqli: required: true type: boolean + macos_arm64_version: + required: true + type: string run_alpine: required: true type: boolean @@ -366,11 +369,11 @@ jobs: matrix: debug: [true, false] zts: [true, false] - os: ['13', '14'] + arch: ['X64', 'ARM64'] exclude: - - os: ${{ !inputs.run_macos_arm64 && '14' || '*never*' }} - name: "MACOS_${{ matrix.os == '13' && 'X64' || 'ARM64' }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-${{ matrix.os }} + - arch: ${{ !inputs.run_macos_arm64 && 'ARM64' || '*never*' }} + name: "MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: macos-${{ matrix.arch == 'X64' && '15-intel' || inputs.macos_arm64_version }} steps: - name: git checkout uses: actions/checkout@v5 @@ -393,7 +396,7 @@ jobs: - name: Test uses: ./.github/actions/test-macos - name: Test Tracing JIT - if: matrix.os != '14' || !matrix.zts + if: matrix.arch == 'X64' || !matrix.zts uses: ./.github/actions/test-macos with: jitType: tracing @@ -405,7 +408,7 @@ jobs: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test Function JIT - if: matrix.os != '14' || !matrix.zts + if: matrix.arch == 'X64' || !matrix.zts uses: ./.github/actions/test-macos with: jitType: function diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index b70b026eced07..2983a8e3c9081 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -52,6 +52,7 @@ jobs: branch: ${{ matrix.branch.ref }} community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} libmysqlclient_with_mysqli: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1) }} + macos_arm64_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '15' || '14' }} run_alpine: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} run_linux_ppc64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} From bbe2191002bffd25c7fbcbc3eba8c3200ebdb45d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:58:23 +0200 Subject: [PATCH 213/386] ROR the callable_convert_cache key for better hash distribution (#20052) --- Zend/zend_vm_def.h | 6 +++++- Zend/zend_vm_execute.h | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index d71c06c0a1354..3c3065e156871 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9720,7 +9720,11 @@ ZEND_VM_HANDLER(202, ZEND_CALLABLE_CONVERT, UNUSED, UNUSED, NUM|CACHE_SLOT) if (closure) { ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); } else { - zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + /* Rotate the key for better hash distribution. */ + const int shift = sizeof(size_t) == 4 ? 6 : 7; + zend_ulong key = (zend_ulong)(uintptr_t)call->func; + key = (key >> shift) | (key << ((sizeof(key) * 8) - shift)); + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), key); if (Z_TYPE_P(closure_zv) == IS_NULL) { zend_closure_from_frame(closure_zv, call); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 50b65c864ed21..50870ce463de3 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -39093,7 +39093,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONV if (closure) { ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); } else { - zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + /* Rotate the key for better hash distribution. */ + const int shift = sizeof(size_t) == 4 ? 6 : 7; + zend_ulong key = (zend_ulong)(uintptr_t)call->func; + key = (key >> shift) | (key << ((sizeof(key) * 8) - shift)); + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), key); if (Z_TYPE_P(closure_zv) == IS_NULL) { zend_closure_from_frame(closure_zv, call); } @@ -94331,7 +94335,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_S if (closure) { ZVAL_OBJ_COPY(EX_VAR(opline->result.var), closure); } else { - zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), (zend_ulong)(uintptr_t)call->func); + /* Rotate the key for better hash distribution. */ + const int shift = sizeof(size_t) == 4 ? 6 : 7; + zend_ulong key = (zend_ulong)(uintptr_t)call->func; + key = (key >> shift) | (key << ((sizeof(key) * 8) - shift)); + zval *closure_zv = zend_hash_index_lookup(&EG(callable_convert_cache), key); if (Z_TYPE_P(closure_zv) == IS_NULL) { zend_closure_from_frame(closure_zv, call); } From a3cf188568a803ff5e366def39dd89d74aab5f00 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 14:40:03 +0100 Subject: [PATCH 214/386] ext/phar: use %zu printf specifier for size_t Rather than casting to int --- ext/phar/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 285b73cf88fd9..ffb2ee399446c 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -447,7 +447,7 @@ static ssize_t phar_stream_write(php_stream *stream, const char *buf, size_t cou php_stream_seek(data->fp, data->position + data->zero, SEEK_SET); if (count != php_stream_write(data->fp, buf, count)) { - php_stream_wrapper_log_error(stream->wrapper, stream->flags, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, ZSTR_VAL(data->internal_file->filename), data->phar->fname); + php_stream_wrapper_log_error(stream->wrapper, stream->flags, "phar error: Could not write %zu characters to \"%s\" in phar \"%s\"", count, ZSTR_VAL(data->internal_file->filename), data->phar->fname); return -1; } data->position = php_stream_tell(data->fp) - data->zero; From ebbe64b03afe09a971fef4b4612c0b06f011f561 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 14:32:55 +0100 Subject: [PATCH 215/386] ext/phar: use uint32_t type instead of int --- ext/phar/phar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 50c7b778cc404..dc5fd5ca4308f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2544,7 +2544,8 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa phar_entry_info *entry, *newentry; size_t halt_offset; - int restore_alias_len, global_flags = 0; + uint32_t restore_alias_len; + uint32_t global_flags = 0; bool must_close_old_file = false; bool has_dirs = false; char manifest[18], entry_buffer[24]; From 68b419ab31d8fcbedd1f4e28f6c17a5858848fc3 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 14:22:58 +0100 Subject: [PATCH 216/386] ext/phar: use zend_result type instead of int --- ext/phar/phar_internal.h | 4 ++-- ext/phar/zip.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 736226783bef1..84cd0e433a9db 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -449,8 +449,8 @@ zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); /* zip functions in zip.c */ -int phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error); -int phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error); +zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error); +zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error); void phar_zip_flush(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); #ifdef PHAR_MAIN diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 0783b5f4e2c95..6e9c4bd5842b3 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -41,7 +41,7 @@ static inline void phar_write_16(char buffer[2], uint32_t value) # define PHAR_SET_32(var, value) phar_write_32(var, (uint32_t) (value)); # define PHAR_SET_16(var, value) phar_write_16(var, (uint16_t) (value)); -static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */ +static zend_result phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */ { union { phar_zip_extra_field_header header; @@ -226,7 +226,7 @@ static char *phar_find_eocd(const char *s, size_t n) * This is used by phar_open_from_fp to process a zip-based phar, but can be called * directly. */ -int phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error) /* {{{ */ +zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error) /* {{{ */ { phar_zip_dir_end locator; char buf[sizeof(locator) + 65536]; @@ -798,10 +798,10 @@ int phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alia /** * Create or open a zip-based phar for writing */ -int phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { phar_archive_data *phar; - int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); + zend_result ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); if (FAILURE == ret) { return FAILURE; @@ -1152,7 +1152,7 @@ static int phar_zip_changed_apply(zval *zv, void *arg) /* {{{ */ } /* }}} */ -static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pass *pass) /* {{{ */ +static zend_result phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pass *pass) /* {{{ */ { /* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */ if (!phar->is_data || phar->sig_flags) { @@ -1442,7 +1442,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def { size_t clen; - int ret = php_stream_copy_to_stream_ex(pass.centralfp, pass.filefp, PHP_STREAM_COPY_ALL, &clen); + zend_result ret = php_stream_copy_to_stream_ex(pass.centralfp, pass.filefp, PHP_STREAM_COPY_ALL, &clen); if (SUCCESS != ret || clen != cdir_size) { if (error) { spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write central-directory", phar->fname); From 2e62399fc7d44b7c9aadbe2e4e314da1e039e365 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 14:24:16 +0100 Subject: [PATCH 217/386] ext/phar: use bool type instead of int --- ext/phar/dirstream.c | 6 +-- ext/phar/phar.c | 40 ++++++++--------- ext/phar/phar_internal.h | 26 +++++------ ext/phar/phar_object.c | 94 +++++++++++++++++++--------------------- ext/phar/stream.c | 24 +++++----- ext/phar/tar.c | 14 +++--- ext/phar/util.c | 62 +++++++++++++------------- ext/phar/zip.c | 22 +++++----- 8 files changed, 142 insertions(+), 146 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index f23907ae7623a..81fa62c854dfd 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -394,7 +394,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo return 0; } - if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 2, &error, 1))) { + if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 2, &error, true))) { /* directory exists, or is a subdirectory of an existing file */ if (e->is_temp_dir) { zend_string_efree(e->filename); @@ -412,7 +412,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo return 0; } - if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &error, 1)) { + if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &error, true)) { /* entry exists as a file */ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host)); php_url_free(resource); @@ -523,7 +523,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options size_t path_len = ZSTR_LEN(resource->path) - 1; - if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, 1))) { + if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, true))) { if (error) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error); efree(error); diff --git a/ext/phar/phar.c b/ext/phar/phar.c index dc5fd5ca4308f..0ebc5820f52a0 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -736,7 +736,7 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname uint32_t len; zend_long offset; size_t sig_len; - int register_alias = 0, temp_alias = 0; + bool register_alias = 0, temp_alias = 0; char *signature = NULL; zend_string *str; @@ -1069,15 +1069,15 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname alias_len = tmp_len; alias = buffer; buffer += tmp_len; - register_alias = 1; + register_alias = true; } else if (!alias_len || !alias) { /* if we neither have an explicit nor an implicit alias, we use the filename */ alias = NULL; alias_len = 0; - register_alias = 0; + register_alias = false; } else if (alias_len) { - register_alias = 1; - temp_alias = 1; + register_alias = true; + temp_alias = true; } /* we have 5 32-bit items plus 1 byte at least */ @@ -1325,12 +1325,12 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al } /* first try to open an existing file */ - if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, 1) == SUCCESS) { + if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, true) == SUCCESS) { goto check_file; } /* next try to create a new file */ - if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, 1)) { + if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, true)) { if (error) { if (ext_len == -2) { spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname); @@ -1970,7 +1970,7 @@ static zend_result phar_check_str(const char *fname, const char *ext_str, size_t * the last parameter should be set to tell the thing to assume that filename is the full path, and only to check the * extension rules, not to iterate. */ -zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, int is_complete) /* {{{ */ +zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete) /* {{{ */ { const char *pos, *slash; @@ -2131,7 +2131,7 @@ static bool php_check_dots(const char *element, size_t n) /* {{{ */ /** * Remove .. and . references within a phar filename */ -char *phar_fix_filepath(char *path, size_t *new_len, int use_cwd) /* {{{ */ +char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd) /* {{{ */ { char *newpath; size_t newpath_len; @@ -2268,7 +2268,7 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a phar_unixify_path_separators((char *)filename, filename_len); } #endif - if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0) == FAILURE) { + if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, false) == FAILURE) { if (ext_len != -1) { if (!ext_str) { /* no / detected, restore arch for error message */ @@ -2748,7 +2748,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa } continue; } - if (!phar_get_efp(entry, 0)) { + if (!phar_get_efp(entry, false)) { /* re-open internal file pointer just-in-time */ newentry = phar_open_jit(phar, entry, error); if (!newentry) { @@ -2759,8 +2759,8 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa } entry = newentry; } - file = phar_get_efp(entry, 0); - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) { + file = phar_get_efp(entry, false); + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, true)) { if (must_close_old_file) { php_stream_close(oldfile); } @@ -2779,7 +2779,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa entry->compressed_filesize = entry->uncompressed_filesize; continue; } - filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); + filter = php_stream_filter_create(phar_compress_filter(entry, false), NULL, 0); if (!filter) { if (must_close_old_file) { php_stream_close(oldfile); @@ -2819,7 +2819,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa ZEND_ASSERT(entry->header_offset == 0); entry->header_offset = php_stream_tell(entry->cfp); php_stream_flush(file); - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { php_stream_filter_free(filter); if (must_close_old_file) { php_stream_close(oldfile); @@ -3025,8 +3025,8 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa file = entry->cfp; php_stream_seek(file, entry->header_offset, SEEK_SET); } else { - file = phar_get_efp(entry, 0); - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + file = phar_get_efp(entry, false); + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { if (must_close_old_file) { php_stream_close(oldfile); } @@ -3268,7 +3268,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) { zend_op_array *res; zend_string *name = NULL; - int failed; + bool failed; phar_archive_data *phar; if (!file_handle || !file_handle->filename) { @@ -3319,11 +3319,11 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) } zend_try { - failed = 0; + failed = false; CG(zend_lineno) = 0; res = phar_orig_compile_file(file_handle, type); } zend_catch { - failed = 1; + failed = true; res = NULL; } zend_end_try(); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 84cd0e433a9db..263bc67e8e97c 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -416,14 +416,14 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char /* utility functions */ zend_string *phar_create_default_stub(const char *index_php, const char *web_index, char **error); -char *phar_decompress_filter(phar_entry_info * entry, int return_unknown); -char *phar_compress_filter(phar_entry_info * entry, int return_unknown); +char *phar_decompress_filter(phar_entry_info * entry, bool return_unknown); +char *phar_compress_filter(phar_entry_info * entry, bool return_unknown); /* void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); */ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t filename_len, char *path, size_t path_len); zend_string *phar_find_in_include_path(zend_string *file, phar_archive_data **pphar); -char *phar_fix_filepath(char *path, size_t *new_len, int use_cwd); +char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd); phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error); void phar_parse_metadata_lazy(const char *buffer, phar_metadata_tracker *tracker, uint32_t zip_metadata_len, bool persistent); bool phar_metadata_tracker_has_data(const phar_metadata_tracker* tracker, bool persistent); @@ -434,10 +434,10 @@ void phar_metadata_tracker_clone(phar_metadata_tracker* tracker); void phar_metadata_tracker_try_ensure_has_serialized_data(phar_metadata_tracker* tracker, bool persistent); zend_result phar_metadata_tracker_unserialize_or_copy(phar_metadata_tracker* tracker, zval *value, bool persistent, HashTable *unserialize_options, const char* method_name); void destroy_phar_manifest_entry(zval *zv); -int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links); -php_stream *phar_get_efp(phar_entry_info *entry, int follow_links); +int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, bool follow_links); +php_stream *phar_get_efp(phar_entry_info *entry, bool follow_links); zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error); -zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links); +zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links); phar_entry_info *phar_get_link_source(phar_entry_info *entry); zend_result phar_open_archive_fp(phar_archive_data *phar); zend_result phar_copy_on_write(phar_archive_data **pphar); @@ -445,12 +445,12 @@ zend_result phar_copy_on_write(phar_archive_data **pphar); /* tar functions in tar.c */ bool phar_is_tar(char *buf, char *fname); zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error); -zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error); +zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); /* zip functions in zip.c */ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error); -zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error); +zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); void phar_zip_flush(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); #ifdef PHAR_MAIN @@ -463,13 +463,13 @@ extern HashTable cached_alias; bool phar_archive_delref(phar_archive_data *phar); void phar_entry_delref(phar_entry_data *idata); -phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, int security); -phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, int security); -phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, int security); -zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, int security); +phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, bool security); +phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, bool security); +phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); +zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); void phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); void phar_flush(phar_archive_data *archive, char **error); -zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, int is_complete); +zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete); zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len, int executable, int for_create); typedef enum { diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index cde10da0c9415..56307b5dfb233 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -199,7 +199,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char } /* prepare to output */ - fp = phar_get_efp(info, 1); + fp = phar_get_efp(info, true); if (!fp) { char *error; @@ -210,10 +210,10 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char } return -1; } - fp = phar_get_efp(info, 1); + fp = phar_get_efp(info, true); } position = 0; - phar_seek_efp(info, 0, SEEK_SET, 0, 1); + phar_seek_efp(info, 0, SEEK_SET, 0, true); do { got = php_stream_read(fp, buf, MIN(8192, info->uncompressed_filesize - position)); @@ -331,7 +331,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, phar_entry_info *info; if (phar && f404_len) { - info = phar_get_entry_info(phar, f404, f404_len, NULL, 1); + info = phar_get_entry_info(phar, f404, f404_len, NULL, true); if (info) { phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0); @@ -768,7 +768,7 @@ PHP_METHOD(Phar, webPhar) } if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || - (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) { + (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); if (free_pathinfo) { @@ -814,7 +814,7 @@ PHP_METHOD(Phar, webPhar) } if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || - (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) { + (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); zend_bailout(); } @@ -1067,15 +1067,13 @@ PHP_METHOD(Phar, isValidPharFilename) const char *ext_str; size_t fname_len; size_t ext_len; - int is_executable; - bool executable = true; + bool is_executable = true; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &fname, &fname_len, &executable) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &fname, &fname_len, &is_executable) == FAILURE) { RETURN_THROWS(); } - is_executable = executable; - RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS); + RETURN_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, true) == SUCCESS); } /* }}} */ @@ -1193,8 +1191,8 @@ PHP_METHOD(Phar, __construct) } if (is_data && phar_data->is_tar && phar_data->is_brandnew && format == PHAR_FORMAT_ZIP) { - phar_data->is_zip = 1; - phar_data->is_tar = 0; + phar_data->is_zip = true; + phar_data->is_tar = false; } if (fname == arch) { @@ -1631,7 +1629,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ return ZEND_HASH_APPLY_KEEP; } - if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, 1))) { + if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, true))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s cannot be created: %s", str_key, error); efree(error); @@ -1914,7 +1912,7 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f ZEND_ASSERT(!entry->link); - if (FAILURE == phar_open_entry_fp(entry, &error, 1)) { + if (FAILURE == phar_open_entry_fp(entry, &error, true)) { if (error) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, ZSTR_VAL(entry->filename), error); @@ -1927,9 +1925,9 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f } /* copy old contents in entirety */ - phar_seek_efp(entry, 0, SEEK_SET, 0, 0); + phar_seek_efp(entry, 0, SEEK_SET, 0, false); offset = php_stream_tell(fp); - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, false), fp, entry->uncompressed_filesize, NULL)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; @@ -2120,7 +2118,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* goto err_reused_oldpath; } if (!phar->is_data) { - if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 1, 1, 1)) { + if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 1, 1, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } @@ -2143,7 +2141,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } else { - if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 0, 1, 1)) { + if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 0, 1, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } @@ -2161,7 +2159,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* goto err_oldpath; } - phar_flush_ex(phar, NULL, 1, &error); + phar_flush_ex(phar, NULL, true, &error); if (error) { zend_hash_str_del(&(PHAR_G(phar_fname_map)), newpath, phar->fname_len); @@ -2222,13 +2220,13 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert switch (convert) { case PHAR_FORMAT_TAR: - phar->is_tar = 1; + phar->is_tar = true; break; case PHAR_FORMAT_ZIP: - phar->is_zip = 1; + phar->is_zip = true; break; default: - phar->is_data = 0; + phar->is_data = false; break; } @@ -2327,7 +2325,6 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert PHP_METHOD(Phar, convertToExecutable) { char *ext = NULL; - int is_data; size_t ext_len = 0; uint32_t flags; zend_object *ret; @@ -2418,8 +2415,8 @@ PHP_METHOD(Phar, convertToExecutable) } } - is_data = phar_obj->archive->is_data; - phar_obj->archive->is_data = 0; + bool is_data = phar_obj->archive->is_data; + phar_obj->archive->is_data = false; ret = phar_convert_to_other(phar_obj->archive, format, ext, flags); phar_obj->archive->is_data = is_data; @@ -2438,7 +2435,6 @@ PHP_METHOD(Phar, convertToExecutable) PHP_METHOD(Phar, convertToData) { char *ext = NULL; - int is_data; size_t ext_len = 0; uint32_t flags; zend_object *ret; @@ -2528,8 +2524,8 @@ PHP_METHOD(Phar, convertToData) } } - is_data = phar_obj->archive->is_data; - phar_obj->archive->is_data = 1; + bool is_data = phar_obj->archive->is_data; + phar_obj->archive->is_data = true; ret = phar_convert_to_other(phar_obj->archive, (int)format, ext, flags); phar_obj->archive->is_data = is_data; @@ -2676,7 +2672,7 @@ PHP_METHOD(Phar, setAlias) char *error, *oldalias; phar_archive_data *fd_ptr; size_t oldalias_len; - int old_temp, readd = 0; + bool old_temp, readd = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &new_alias) == FAILURE) { RETURN_THROWS(); @@ -2724,7 +2720,7 @@ PHP_METHOD(Phar, setAlias) } if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len))) { zend_hash_str_del(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len); - readd = 1; + readd = true; } ZEND_ASSERT(!phar_obj->archive->is_persistent); @@ -2937,7 +2933,7 @@ PHP_METHOD(Phar, setDefaultStub) char *index = NULL, *webindex = NULL, *error = NULL; zend_string *stub = NULL; size_t index_len = 0, webindex_len = 0; - int created_stub = 0; + bool created_stub = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!", &index, &index_len, &webindex, &webindex_len) == FAILURE) { RETURN_THROWS(); @@ -3551,7 +3547,7 @@ PHP_METHOD(Phar, offsetGet) PHAR_ARCHIVE_OBJECT(); /* security is 0 here so that we can get a better error message than "entry doesn't exist" */ - if (!(entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, 0))) { + if (!(entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, false))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", ZSTR_VAL(file_name), error?", ":"", error?error:""); } else { if (zend_string_equals_literal(file_name, ".phar/stub.php")) { @@ -3624,7 +3620,7 @@ static void phar_add_file(phar_archive_data **pphar, zend_string *file_name, con } #endif - if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, 1))) { + if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, true))) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created: %s", filename, error); efree(error); @@ -3696,7 +3692,7 @@ static void phar_mkdir(phar_archive_data **pphar, zend_string *dir_name) char *error; phar_entry_data *data; - if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, ZSTR_VAL(dir_name), ZSTR_LEN(dir_name), "w+b", 2, &error, 1))) { + if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, ZSTR_VAL(dir_name), ZSTR_LEN(dir_name), "w+b", 2, &error, true))) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", ZSTR_VAL(dir_name), error); efree(error); @@ -3908,13 +3904,13 @@ PHP_METHOD(Phar, getStub) if (stub->flags & PHAR_ENT_COMPRESSION_MASK) { char *filter_name; - if ((filter_name = phar_decompress_filter(stub, 0)) != NULL) { + if ((filter_name = phar_decompress_filter(stub, false)) != NULL) { filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp)); } else { filter = NULL; } if (!filter) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, 1)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, true)); RETURN_THROWS(); } php_stream_filter_append(&fp->readfilters, filter); @@ -4011,7 +4007,7 @@ PHP_METHOD(Phar, getMetadata) /* }}} */ /* {{{ Modifies the phar metadata or throws */ -static zend_result serialize_metadata_or_throw(phar_metadata_tracker *tracker, int persistent, zval *metadata) +static zend_result serialize_metadata_or_throw(phar_metadata_tracker *tracker, bool persistent, zval *metadata) { php_serialize_data_t metadata_hash; smart_str main_metadata_str = {0}; @@ -4248,8 +4244,8 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha return FAILURE; } - if ((phar_get_fp_type(entry) == PHAR_FP && (entry->flags & PHAR_ENT_COMPRESSION_MASK)) || !phar_get_efp(entry, 0)) { - if (FAILURE == phar_open_entry_fp(entry, error, 1)) { + if ((phar_get_fp_type(entry) == PHAR_FP && (entry->flags & PHAR_ENT_COMPRESSION_MASK)) || !phar_get_efp(entry, false)) { + if (FAILURE == phar_open_entry_fp(entry, error, true)) { if (error) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", ZSTR_VAL(entry->filename), fullpath, *error); } else { @@ -4261,14 +4257,14 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha } } - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to seek internal file pointer", ZSTR_VAL(entry->filename), fullpath); efree(fullpath); php_stream_close(fp); return FAILURE; } - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, false), fp, entry->uncompressed_filesize, NULL)) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", ZSTR_VAL(entry->filename), fullpath); efree(fullpath); php_stream_close(fp); @@ -4464,7 +4460,7 @@ PHP_METHOD(PharFileInfo, __construct) RETURN_THROWS(); } - if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1)) == NULL) { + if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, true)) == NULL) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? error : ""); efree(arch); @@ -4844,20 +4840,20 @@ PHP_METHOD(PharFileInfo, getContent) link = entry_obj->entry; } - if (SUCCESS != phar_open_entry_fp(link, &error, 0)) { + if (SUCCESS != phar_open_entry_fp(link, &error, false)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar error: Cannot retrieve contents, \"%s\" in phar \"%s\": %s", ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname, error); efree(error); RETURN_THROWS(); } - if (!(fp = phar_get_efp(link, 0))) { + if (!(fp = phar_get_efp(link, false))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname); RETURN_THROWS(); } - phar_seek_efp(link, 0, SEEK_SET, 0, 0); + phar_seek_efp(link, 0, SEEK_SET, 0, false); str = php_stream_copy_to_mem(fp, link->uncompressed_filesize, 0); if (str) { RETURN_STR(str); @@ -4927,7 +4923,7 @@ PHP_METHOD(PharFileInfo, compress) } /* decompress this file indirectly */ - if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) { + if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar error: Cannot decompress bzip2-compressed file \"%s\" in phar \"%s\" in order to compress with gzip: %s", ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname, error); efree(error); @@ -4958,7 +4954,7 @@ PHP_METHOD(PharFileInfo, compress) } /* decompress this file indirectly */ - if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) { + if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar error: Cannot decompress gzip-compressed file \"%s\" in phar \"%s\" in order to compress with bzip2: %s", ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname, error); efree(error); @@ -5063,7 +5059,7 @@ PHP_METHOD(PharFileInfo, decompress) RETURN_THROWS(); } /* decompress this file indirectly */ - if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) { + if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Phar error: Cannot decompress %s-compressed file \"%s\" in phar \"%s\": %s", compression_type, ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname, error); efree(error); diff --git a/ext/phar/stream.c b/ext/phar/stream.c index ffb2ee399446c..d7bcc78fd8a8d 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -191,7 +191,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha /* strip leading "/" */ internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); if (mode[0] == 'w' || (mode[0] == 'r' && mode[1] == '+')) { - if (NULL == (idata = phar_get_or_create_entry_data(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, strlen(internal_file), mode, 0, &error, 1))) { + if (NULL == (idata = phar_get_or_create_entry_data(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, strlen(internal_file), mode, 0, &error, true))) { if (error) { php_stream_wrapper_log_error(wrapper, options, "%s", error); efree(error); @@ -225,7 +225,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha metadata = pzoption; ZVAL_COPY_DEREF(&idata->internal_file->metadata_tracker.val, metadata); - idata->phar->is_modified = 1; + idata->phar->is_modified = true; } } if (opened_path) { @@ -242,7 +242,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha return NULL; } if (phar->is_tar || phar->is_zip) { - if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0)) || !idata) { + if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, false)) || !idata) { goto idata_error; } efree(internal_file); @@ -290,7 +290,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha } } /* read-only access is allowed to magic files in .phar directory */ - if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, strlen(internal_file), "r", 0, &error, 0)) || !idata) { + if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, strlen(internal_file), "r", 0, &error, false)) || !idata) { idata_error: if (error) { php_stream_wrapper_log_error(wrapper, options, "%s", error); @@ -456,7 +456,7 @@ static ssize_t phar_stream_write(php_stream *stream, const char *buf, size_t cou } data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize; data->internal_file->old_flags = data->internal_file->flags; - data->internal_file->is_modified = 1; + data->internal_file->is_modified = true; return count; } /* }}} */ @@ -699,7 +699,7 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int /* need to copy to strip leading "/", will get touched again */ internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); internal_file_len = ZSTR_LEN(resource->path) - 1; - if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, internal_file_len, "r", 0, &error, 1)) { + if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), internal_file, internal_file_len, "r", 0, &error, true)) { /* constraints of fp refcount were not met */ if (error) { php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed: %s", url, error); @@ -739,8 +739,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from char *error; phar_archive_data *phar, *pfrom, *pto; phar_entry_info *entry; - int is_dir = 0; - int is_modified = 0; + bool is_dir = false; + bool is_modified = false; error = NULL; @@ -861,8 +861,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from zend_hash_del(&phar->manifest, entry->filename); return 0; } - is_modified = 1; - entry->is_modified = 1; + is_modified = true; + entry->is_modified = true; is_dir = entry->is_dir; } else { is_dir = zend_hash_str_exists(&(phar->virtual_dirs), ZSTR_VAL(resource_from->path)+1, ZSTR_LEN(resource_from->path)-1); @@ -897,8 +897,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from memcpy(ZSTR_VAL(new_str_key) + to_len, ZSTR_VAL(str_key) + from_len, ZSTR_LEN(str_key) - from_len); ZSTR_VAL(new_str_key)[ZSTR_LEN(new_str_key)] = 0; - is_modified = 1; - entry->is_modified = 1; + is_modified = true; + entry->is_modified = true; zend_string_release(entry->filename); entry->filename = zend_string_copy(new_str_key); diff --git a/ext/phar/tar.c b/ext/phar/tar.c index c8477e9e9928b..540f265892299 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -127,7 +127,7 @@ bool phar_is_tar(char *buf, char *fname) /* {{{ */ } /* }}} */ -zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { phar_archive_data *phar; zend_result ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); @@ -210,7 +210,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch tar_header *hdr; uint32_t sum1, sum2, size, old; phar_archive_data *myphar, *actual; - int last_was_longlink = 0; + bool last_was_longlink = false; size_t linkname_len; if (error) { @@ -361,7 +361,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch } if (!last_was_longlink && hdr->typeflag == 'L') { - last_was_longlink = 1; + last_was_longlink = true; /* support the ././@LongLink system for storing long filenames */ /* Check for overflow - bug 61065 */ @@ -465,7 +465,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch GC_MAKE_PERSISTENT_LOCAL(entry.filename); } } - last_was_longlink = 0; + last_was_longlink = false; phar_add_virtual_dirs(myphar, ZSTR_VAL(entry.filename), ZSTR_LEN(entry.filename)); @@ -819,18 +819,18 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* /* write contents */ if (entry->uncompressed_filesize) { - if (FAILURE == phar_open_entry_fp(entry, fp->error, 0)) { + if (FAILURE == phar_open_entry_fp(entry, fp->error, false)) { return ZEND_HASH_APPLY_STOP; } - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { if (fp->error) { spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written, seek failed", entry->phar->fname, ZSTR_VAL(entry->filename)); } return ZEND_HASH_APPLY_STOP; } - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp->new, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, false), fp->new, entry->uncompressed_filesize, NULL)) { if (fp->error) { spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, ZSTR_VAL(entry->filename)); } diff --git a/ext/phar/util.c b/ext/phar/util.c index 26a11d99a9c14..0de84a48fdbe9 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -96,13 +96,13 @@ static php_stream *phar_get_entrypufp(const phar_entry_info *entry) } /* retrieve a phar_entry_info's current file pointer for reading contents */ -php_stream *phar_get_efp(phar_entry_info *entry, int follow_links) /* {{{ */ +php_stream *phar_get_efp(phar_entry_info *entry, bool follow_links) /* {{{ */ { if (follow_links && entry->link) { phar_entry_info *link_entry = phar_get_link_source(entry); if (link_entry && link_entry != entry) { - return phar_get_efp(link_entry, 1); + return phar_get_efp(link_entry, true); } } @@ -139,7 +139,7 @@ static zend_off_t phar_get_fp_offset(const phar_entry_info *entry) return PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].offset; } -int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links) /* {{{ */ +int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, bool follow_links) /* {{{ */ { php_stream *fp = phar_get_efp(entry, follow_links); zend_off_t temp, eoffset; @@ -193,7 +193,7 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil { phar_entry_info entry = {0}; php_stream_statbuf ssb; - int is_phar; + bool is_phar; const char *err; if (phar_path_check(&path, &path_len, &err) > pcr_is_ok) { @@ -225,8 +225,8 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil return FAILURE; } - entry.is_mounted = 1; - entry.is_crc_checked = 1; + entry.is_mounted = true; + entry.is_crc_checked = true; entry.fp_type = PHAR_TMP; if (SUCCESS != php_stream_stat_path(filename, &ssb)) { @@ -240,7 +240,7 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil #endif if (ssb.sb.st_mode & S_IFDIR) { - entry.is_dir = 1; + entry.is_dir = true; if (NULL == zend_hash_add_ptr(&phar->mounted_dirs, entry.filename, entry.filename)) { /* directory already mounted */ efree(entry.tmp); @@ -248,7 +248,7 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil return FAILURE; } } else { - entry.is_dir = 0; + entry.is_dir = false; entry.uncompressed_filesize = entry.compressed_filesize = ssb.sb.st_size; } @@ -420,7 +420,7 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) php_stream *fp; phar_entry_info *link; - if (FAILURE == phar_open_entry_fp(entry, error, 1)) { + if (FAILURE == phar_open_entry_fp(entry, error, true)) { return FAILURE; } @@ -433,14 +433,14 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) spprintf(error, 0, "phar error: unable to create temporary file"); return FAILURE; } - phar_seek_efp(entry, 0, SEEK_SET, 0, 1); + phar_seek_efp(entry, 0, SEEK_SET, 0, true); link = phar_get_link_source(entry); if (!link) { link = entry; } - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), fp, link->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, false), fp, link->uncompressed_filesize, NULL)) { if (error) { spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", ZSTR_VAL(entry->filename), entry->phar->fname); } @@ -469,7 +469,7 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) * appended, truncated, or read. For read, if the entry is marked unmodified, it is * assumed that the file pointer, if present, is opened for reading */ -zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */ +zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry; @@ -575,7 +575,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname return FAILURE; } } else if (for_append) { - phar_seek_efp(entry, 0, SEEK_END, 0, 0); + phar_seek_efp(entry, 0, SEEK_END, 0, false); } } else { if (for_write) { @@ -595,7 +595,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname } } } else { - if (FAILURE == phar_open_entry_fp(entry, error, 1)) { + if (FAILURE == phar_open_entry_fp(entry, error, true)) { return FAILURE; } } @@ -605,7 +605,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname (*ret)->position = 0; (*ret)->phar = phar; (*ret)->internal_file = entry; - (*ret)->fp = phar_get_efp(entry, 1); + (*ret)->fp = phar_get_efp(entry, true); if (entry->link) { phar_entry_info *link = phar_get_link_source(entry); if(!link) { @@ -629,7 +629,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname /** * Create a new dummy file slot within a writeable phar for a newly created file */ -phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */ +phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry, etemp; @@ -764,7 +764,7 @@ zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, c { phar_entry_info *link; - if (FAILURE == phar_open_entry_fp(source, error, 1)) { + if (FAILURE == phar_open_entry_fp(source, error, true)) { return FAILURE; } @@ -782,14 +782,14 @@ zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, c spprintf(error, 0, "phar error: unable to create temporary file"); return EOF; } - phar_seek_efp(source, 0, SEEK_SET, 0, 1); + phar_seek_efp(source, 0, SEEK_SET, 0, true); link = phar_get_link_source(source); if (!link) { link = source; } - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), dest->fp, link->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, false), dest->fp, link->uncompressed_filesize, NULL)) { php_stream_close(dest->fp); dest->fp_type = PHAR_FP; if (error) { @@ -828,7 +828,7 @@ static void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zen /* open and decompress a compressed phar entry */ -zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links) /* {{{ */ +zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links) /* {{{ */ { php_stream_filter *filter; phar_archive_data *phar = entry->phar; @@ -840,7 +840,7 @@ zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_ if (follow_links && entry->link) { phar_entry_info *link_entry = phar_get_link_source(entry); if (link_entry && link_entry != entry) { - return phar_open_entry_fp(link_entry, error, 1); + return phar_open_entry_fp(link_entry, error, true); } } @@ -896,14 +896,14 @@ zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_ ufp = phar_get_entrypufp(entry); - if ((filtername = phar_decompress_filter(entry, 0)) != NULL) { + if ((filtername = phar_decompress_filter(entry, false)) != NULL) { filter = php_stream_filter_create(filtername, NULL, 0); } else { filter = NULL; } if (!filter) { - spprintf(error, 4096, "phar error: unable to read phar \"%s\" (cannot create %s filter while decompressing file \"%s\")", phar->fname, phar_decompress_filter(entry, 1), ZSTR_VAL(entry->filename)); + spprintf(error, 4096, "phar error: unable to read phar \"%s\" (cannot create %s filter while decompressing file \"%s\")", phar->fname, phar_decompress_filter(entry, true), ZSTR_VAL(entry->filename)); return FAILURE; } @@ -953,10 +953,10 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, *error = NULL; } /* seek to start of internal file and read it */ - if (FAILURE == phar_open_entry_fp(entry, error, 1)) { + if (FAILURE == phar_open_entry_fp(entry, error, true)) { return NULL; } - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, true)) { spprintf(error, 4096, "phar error: cannot seek to start of file \"%s\" in phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); return NULL; } @@ -1191,7 +1191,7 @@ zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fn /** * Determine which stream compression filter (if any) we need to read this file */ -char * phar_compress_filter(phar_entry_info * entry, int return_unknown) /* {{{ */ +char * phar_compress_filter(phar_entry_info * entry, bool return_unknown) /* {{{ */ { switch (entry->flags & PHAR_ENT_COMPRESSION_MASK) { case PHAR_ENT_COMPRESSED_GZ: @@ -1207,7 +1207,7 @@ char * phar_compress_filter(phar_entry_info * entry, int return_unknown) /* {{{ /** * Determine which stream decompression filter (if any) we need to read this file */ -char * phar_decompress_filter(phar_entry_info * entry, int return_unknown) /* {{{ */ +char * phar_decompress_filter(phar_entry_info * entry, bool return_unknown) /* {{{ */ { uint32_t flags; @@ -1231,7 +1231,7 @@ char * phar_decompress_filter(phar_entry_info * entry, int return_unknown) /* {{ /** * retrieve information on a file contained within a phar, or null if it ain't there */ -phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, int security) /* {{{ */ +phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, bool security) /* {{{ */ { return phar_get_entry_info_dir(phar, path, path_len, 0, error, security); } @@ -1242,17 +1242,17 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t * valid pre-existing empty directory entries */ // TODO: convert this to use zend_string too -phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, int security) /* {{{ */ +phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, bool security) /* {{{ */ { const char *pcr_error; phar_entry_info *entry; - int is_dir; + bool is_dir; #ifdef PHP_WIN32 phar_unixify_path_separators(path, path_len); #endif - is_dir = (path_len && (path[path_len - 1] == '/')) ? 1 : 0; + is_dir = (path_len && (path[path_len - 1] == '/')) ? true : false; if (error) { *error = NULL; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 6e9c4bd5842b3..4949750e28706 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -798,7 +798,7 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch /** * Create or open a zip-based phar for writing */ -zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, int is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { phar_archive_data *phar; zend_result ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); @@ -849,7 +849,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ struct _phar_zip_pass *p; uint32_t newcrc32; zend_off_t offset; - int not_really_modified = 0; + bool not_really_modified = false; p = (struct _phar_zip_pass*) arg; uint16_t general_purpose_flags; @@ -923,23 +923,23 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ goto continue_dir; } - if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { + if (FAILURE == phar_open_entry_fp(entry, p->error, false)) { spprintf(p->error, 0, "unable to open file contents of file \"%s\" in zip-based phar \"%s\"", ZSTR_VAL(entry->filename), entry->phar->fname); return ZEND_HASH_APPLY_STOP; } /* we can be modified and already be compressed, such as when chmod() is executed */ if (entry->flags & PHAR_ENT_COMPRESSION_MASK && (entry->old_flags == entry->flags || !entry->old_flags)) { - not_really_modified = 1; + not_really_modified = true; goto is_compressed; } - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", ZSTR_VAL(entry->filename), entry->phar->fname); return ZEND_HASH_APPLY_STOP; } - efp = phar_get_efp(entry, 0); + efp = phar_get_efp(entry, false); newcrc32 = php_crc32_bulk_init(); php_crc32_stream_bulk_update(&newcrc32, efp, entry->uncompressed_filesize); @@ -956,7 +956,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ goto not_compressed; } - filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0); + filter = php_stream_filter_create(phar_compress_filter(entry, false), NULL, 0); if (!filter) { if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { @@ -980,7 +980,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ php_stream_flush(efp); - if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) { + if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { php_stream_filter_free(filter); spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", ZSTR_VAL(entry->filename), entry->phar->fname); return ZEND_HASH_APPLY_STOP; @@ -1093,13 +1093,13 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ php_stream_close(entry->cfp); entry->cfp = NULL; } else { - if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) { + if (FAILURE == phar_open_entry_fp(entry, p->error, false)) { return ZEND_HASH_APPLY_STOP; } - phar_seek_efp(entry, 0, SEEK_SET, 0, 0); + phar_seek_efp(entry, 0, SEEK_SET, 0, false); - if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed_filesize, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, false), p->filefp, entry->uncompressed_filesize, NULL)) { spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", ZSTR_VAL(entry->filename), entry->phar->fname); return ZEND_HASH_APPLY_STOP; } From 75c1c32ddce8b7805681fa22df122d9e51457eef Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:11:47 +0100 Subject: [PATCH 218/386] ext/phar: Return const char* as these are in the rodata section --- ext/phar/phar_internal.h | 4 ++-- ext/phar/phar_object.c | 4 ++-- ext/phar/util.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 263bc67e8e97c..63fbc4ffc991b 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -416,8 +416,8 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char /* utility functions */ zend_string *phar_create_default_stub(const char *index_php, const char *web_index, char **error); -char *phar_decompress_filter(phar_entry_info * entry, bool return_unknown); -char *phar_compress_filter(phar_entry_info * entry, bool return_unknown); +const char *phar_decompress_filter(const phar_entry_info *entry, bool return_unknown); +const char *phar_compress_filter(const phar_entry_info *entry, bool return_unknown); /* void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); */ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 56307b5dfb233..c66d2ce49a085 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3902,9 +3902,9 @@ PHP_METHOD(Phar, getStub) RETURN_THROWS(); } if (stub->flags & PHAR_ENT_COMPRESSION_MASK) { - char *filter_name; + const char *filter_name = phar_decompress_filter(stub, false); - if ((filter_name = phar_decompress_filter(stub, false)) != NULL) { + if (filter_name != NULL) { filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp)); } else { filter = NULL; diff --git a/ext/phar/util.c b/ext/phar/util.c index 0de84a48fdbe9..0d51fd1ab9fcb 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -832,7 +832,6 @@ zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow { php_stream_filter *filter; phar_archive_data *phar = entry->phar; - char *filtername; zend_off_t loc; php_stream *ufp; phar_entry_data dummy; @@ -896,8 +895,9 @@ zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow ufp = phar_get_entrypufp(entry); - if ((filtername = phar_decompress_filter(entry, false)) != NULL) { - filter = php_stream_filter_create(filtername, NULL, 0); + const char *filter_name = phar_decompress_filter(entry, false); + if (filter_name != NULL) { + filter = php_stream_filter_create(filter_name, NULL, 0); } else { filter = NULL; } @@ -1191,7 +1191,7 @@ zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fn /** * Determine which stream compression filter (if any) we need to read this file */ -char * phar_compress_filter(phar_entry_info * entry, bool return_unknown) /* {{{ */ +const char * phar_compress_filter(const phar_entry_info *entry, bool return_unknown) /* {{{ */ { switch (entry->flags & PHAR_ENT_COMPRESSION_MASK) { case PHAR_ENT_COMPRESSED_GZ: @@ -1207,7 +1207,7 @@ char * phar_compress_filter(phar_entry_info * entry, bool return_unknown) /* {{{ /** * Determine which stream decompression filter (if any) we need to read this file */ -char * phar_decompress_filter(phar_entry_info * entry, bool return_unknown) /* {{{ */ +const char * phar_decompress_filter(const phar_entry_info *entry, bool return_unknown) /* {{{ */ { uint32_t flags; From a5f61654b2e67151b179c5633e5789cd5a076032 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:29:33 +0100 Subject: [PATCH 219/386] ext/phar: use bool type instead of uint32_t --- ext/phar/phar.c | 2 +- ext/phar/phar_internal.h | 36 ++++++++++++++++++------------------ ext/phar/util.c | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 0ebc5820f52a0..2124dec2a1880 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -736,7 +736,7 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname uint32_t len; zend_long offset; size_t sig_len; - bool register_alias = 0, temp_alias = 0; + bool register_alias = false, temp_alias = false; char *signature = NULL; zend_string *str; diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 63fbc4ffc991b..11e4040d1c251 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -224,21 +224,21 @@ typedef struct _phar_entry_info { /* for stat */ unsigned short inode; - uint32_t is_crc_checked:1; - uint32_t is_modified:1; - uint32_t is_deleted:1; - uint32_t is_dir:1; + bool is_crc_checked:1; + bool is_modified:1; + bool is_deleted:1; + bool is_dir:1; /* this flag is used for mounted entries (external files mapped to location inside a phar */ - uint32_t is_mounted:1; + bool is_mounted:1; /* used when iterating */ - uint32_t is_temp_dir:1; + bool is_temp_dir:1; /* tar-based phar file stuff */ - uint32_t is_tar:1; + bool is_tar:1; /* zip-based phar file stuff */ - uint32_t is_zip:1; + bool is_zip:1; /* for cached phar entries */ - uint32_t is_persistent:1; + bool is_persistent:1; } phar_entry_info; /* information about a phar file (the archive itself) */ @@ -270,20 +270,20 @@ struct _phar_archive_data { phar_metadata_tracker metadata_tracker; uint32_t phar_pos; /* if 1, then this alias was manually specified by the user and is not a permanent alias */ - uint32_t is_temporary_alias:1; - uint32_t is_modified:1; - uint32_t is_writeable:1; - uint32_t is_brandnew:1; + bool is_temporary_alias:1; + bool is_modified:1; + bool is_writeable:1; + bool is_brandnew:1; /* defer phar creation */ - uint32_t donotflush:1; + bool donotflush:1; /* zip-based phar variables */ - uint32_t is_zip:1; + bool is_zip:1; /* tar-based phar variables */ - uint32_t is_tar:1; + bool is_tar:1; /* PharData variables */ - uint32_t is_data:1; + bool is_data:1; /* for cached phar manifests */ - uint32_t is_persistent:1; + bool is_persistent:1; }; typedef struct _phar_entry_fp_info { diff --git a/ext/phar/util.c b/ext/phar/util.c index 0d51fd1ab9fcb..51ebfb36275d7 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1252,7 +1252,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si phar_unixify_path_separators(path, path_len); #endif - is_dir = (path_len && (path[path_len - 1] == '/')) ? true : false; + is_dir = path_len && (path[path_len - 1] == '/'); if (error) { *error = NULL; From 453f9e144f3d8740d94ad97ca12250b82b5ce528 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:32:00 +0100 Subject: [PATCH 220/386] ext/phar: pad phar globals struct This saves 16 bytes --- ext/phar/phar_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 11e4040d1c251..a9290c3232187 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -105,8 +105,8 @@ ZEND_BEGIN_MODULE_GLOBALS(phar) /* for cached phars, this is a per-process store of fp/ufp */ phar_entry_fp *cached_fp; HashTable phar_alias_map; - int phar_SERVER_mung_list; char* cache_list; + int phar_SERVER_mung_list; bool readonly; bool manifest_cached; bool persist; @@ -150,8 +150,8 @@ ZEND_BEGIN_MODULE_GLOBALS(phar) /* phar_get_archive cache */ char* last_phar_name; uint32_t last_phar_name_len; - char* last_alias; uint32_t last_alias_len; + char* last_alias; phar_archive_data* last_phar; HashTable mime_types; ZEND_END_MODULE_GLOBALS(phar) From 6e6752fa61f8759661e368512f1995250ebcd50f Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:34:13 +0100 Subject: [PATCH 221/386] ext/phar: pad _phar_entry_info struct This saves 8 bytes by going from 152 to 144 bytes --- ext/phar/phar_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index a9290c3232187..9d77d68c1ece2 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -205,7 +205,6 @@ typedef struct _phar_entry_info { uint32_t old_flags; phar_metadata_tracker metadata_tracker; zend_string *filename; - enum phar_fp_type fp_type; /* offset within original phar file of the file contents */ zend_long offset_abs; /* offset within fp of the file contents */ @@ -214,6 +213,7 @@ typedef struct _phar_entry_info { zend_long header_offset; php_stream *fp; php_stream *cfp; + enum phar_fp_type fp_type; int fp_refcount; char *tmp; phar_archive_data *phar; From fb81bdd9fd2c661fe4bb6f125b65bdf58fa454fc Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:41:13 +0100 Subject: [PATCH 222/386] ext/phar: pad _phar_archive_data struct This saves 16 bytes by going from 320 to 304 bytes --- ext/phar/phar_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 9d77d68c1ece2..fe63e075c1b51 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -246,10 +246,10 @@ struct _phar_archive_data { char *fname; uint32_t fname_len; /* for phar_detect_fname_ext, this stores the location of the file extension within fname */ - char *ext; uint32_t ext_len; + char *ext; char *alias; - uint32_t alias_len; + uint32_t alias_len; char version[12]; size_t halt_offset; HashTable manifest; @@ -260,10 +260,10 @@ struct _phar_archive_data { uint32_t flags; uint32_t min_timestamp; uint32_t max_timestamp; + int refcount; php_stream *fp; /* decompressed file contents are stored here */ php_stream *ufp; - int refcount; uint32_t sig_flags; uint32_t sig_len; char *signature; From bf44b6ec4e8e22de475ba286835df1d0e4b88fdb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 15:59:25 +0100 Subject: [PATCH 223/386] ext/phar/phar.c: use zend_hash_str_exists() instead of fetching ptr and checking for NULL Especially as the ptr is never used afterwards --- ext/phar/phar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 2124dec2a1880..b1f6d39171e4d 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -510,7 +510,6 @@ static zend_result phar_open_parsed_phar(char *fname, size_t fname_len, char *al && ((alias && fname_len == phar->fname_len && !strncmp(fname, phar->fname, fname_len)) || !alias) ) { - phar_entry_info *stub; #ifdef PHP_WIN32 if (fname != save_fname) { free_alloca(fname, fname_use_heap); @@ -526,7 +525,7 @@ static zend_result phar_open_parsed_phar(char *fname, size_t fname_len, char *al if (!is_data) { /* prevent any ".phar" without a stub getting through */ if (!phar->halt_offset && !phar->is_brandnew && (phar->is_tar || phar->is_zip)) { - if (PHAR_G(readonly) && NULL == (stub = zend_hash_str_find_ptr(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) { + if (PHAR_G(readonly) && !zend_hash_str_exists(&(phar->manifest), ZEND_STRL(".phar/stub.php"))) { if (error) { spprintf(error, 0, "'%s' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive", fname); } @@ -1354,8 +1353,7 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al } if (PHAR_G(readonly) && !(*test)->is_data && ((*test)->is_tar || (*test)->is_zip)) { - phar_entry_info *stub; - if (NULL == (stub = zend_hash_str_find_ptr(&((*test)->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) { + if (!zend_hash_str_exists(&((*test)->manifest), ZEND_STRL(".phar/stub.php"))) { spprintf(error, 0, "'%s' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive", fname); return FAILURE; } From 264d650117cb6ade371af003c050ab71db549f45 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Oct 2025 16:11:52 +0100 Subject: [PATCH 224/386] ext/phar/phar_object.c: Refactor extraction code to use zend_string* --- ext/phar/phar_object.c | 45 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index c66d2ce49a085..0b7e55c5e9afa 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4108,7 +4108,7 @@ PHP_METHOD(Phar, delMetadata) } /* }}} */ -static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, char *dest, size_t dest_len, char **error) /* {{{ */ +static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, const zend_string *path, char **error) /* {{{ */ { php_stream_statbuf ssb; size_t len; @@ -4136,7 +4136,7 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha if (virtual_file_ex(&new_state, ZSTR_VAL(entry->filename), NULL, CWD_EXPAND) != 0 || new_state.cwd_length <= 1) { if (EINVAL == errno && ZSTR_LEN(entry->filename) > 50) { - spprintf(error, 4096, "Cannot extract \"%.50s...\" to \"%s...\", extracted filename is too long for filesystem", ZSTR_VAL(entry->filename), dest); + spprintf(error, 4096, "Cannot extract \"%.50s...\" to \"%s...\", extracted filename is too long for filesystem", ZSTR_VAL(entry->filename), ZSTR_VAL(path)); } else { spprintf(error, 4096, "Cannot extract \"%s\", internal error", ZSTR_VAL(entry->filename)); } @@ -4158,7 +4158,7 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha } #endif - len = spprintf(&fullpath, 0, "%s/%s", dest, filename); + len = spprintf(&fullpath, 0, "%s/%s", ZSTR_VAL(path), filename); if (len >= MAXPATHLEN) { /* truncate for error message */ @@ -4199,9 +4199,9 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha slash = zend_memrchr(filename, '/', filename_len); if (slash) { - fullpath[dest_len + (slash - filename) + 1] = '\0'; + fullpath[ZSTR_LEN(path) + (slash - filename) + 1] = '\0'; } else { - fullpath[dest_len] = '\0'; + fullpath[ZSTR_LEN(path)] = '\0'; } if (FAILURE == php_stream_stat_path(fullpath, &ssb)) { @@ -4223,9 +4223,9 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha } if (slash) { - fullpath[dest_len + (slash - filename) + 1] = '/'; + fullpath[ZSTR_LEN(path) + (slash - filename) + 1] = '/'; } else { - fullpath[dest_len] = '/'; + fullpath[ZSTR_LEN(path)] = '/'; } filename = NULL; @@ -4285,28 +4285,28 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, cha } /* }}} */ -static int extract_helper(phar_archive_data *archive, zend_string *search, char *pathto, size_t pathto_len, bool overwrite, char **error) { /* {{{ */ +static int extract_helper(const phar_archive_data *archive, zend_string *search, const zend_string *path_to, bool overwrite, char **error) { /* {{{ */ int extracted = 0; phar_entry_info *entry; if (!search) { /* nothing to match -- extract all files */ ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, error)) return -1; + if (FAILURE == phar_extract_file(overwrite, entry, path_to, error)) return -1; extracted++; } ZEND_HASH_FOREACH_END(); } else if (ZSTR_LEN(search) > 0 && '/' == ZSTR_VAL(search)[ZSTR_LEN(search) - 1]) { /* ends in "/" -- extract all entries having that prefix */ ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { if (!zend_string_starts_with(entry->filename, search)) continue; - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, error)) return -1; + if (FAILURE == phar_extract_file(overwrite, entry, path_to, error)) return -1; extracted++; } ZEND_HASH_FOREACH_END(); } else { /* otherwise, looking for an exact match */ entry = zend_hash_find_ptr(&archive->manifest, search); if (NULL == entry) return 0; - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, error)) return -1; + if (FAILURE == phar_extract_file(overwrite, entry, path_to, error)) return -1; return 1; } @@ -4319,9 +4319,8 @@ PHP_METHOD(Phar, extractTo) { php_stream *fp; php_stream_statbuf ssb; - char *pathto; + zend_string *path_to; zend_string *filename = NULL; - size_t pathto_len; int ret; zval *zval_file; HashTable *files_ht = NULL; @@ -4329,7 +4328,7 @@ PHP_METHOD(Phar, extractTo) char *error = NULL; ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_PATH(pathto, pathto_len) + Z_PARAM_PATH_STR(path_to) Z_PARAM_OPTIONAL Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(files_ht, filename) Z_PARAM_BOOL(overwrite) @@ -4347,30 +4346,30 @@ PHP_METHOD(Phar, extractTo) php_stream_close(fp); - if (pathto_len < 1) { + if (ZSTR_LEN(path_to) == 0) { zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid argument, extraction path must be non-zero length"); RETURN_THROWS(); } - if (pathto_len >= MAXPATHLEN) { - char *tmp = estrndup(pathto, 50); + if (ZSTR_LEN(path_to) >= MAXPATHLEN) { + char *tmp = estrndup(ZSTR_VAL(path_to), 50); /* truncate for error message */ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp); efree(tmp); RETURN_THROWS(); } - if (php_stream_stat_path(pathto, &ssb) < 0) { - ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); + if (php_stream_stat_path(ZSTR_VAL(path_to), &ssb) < 0) { + ret = php_stream_mkdir(ZSTR_VAL(path_to), 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); if (!ret) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Unable to create path \"%s\" for extraction", pathto); + "Unable to create path \"%s\" for extraction", ZSTR_VAL(path_to)); RETURN_THROWS(); } } else if (!(ssb.sb.st_mode & S_IFDIR)) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Unable to use path \"%s\" for extraction, it is a file, must be a directory", pathto); + "Unable to use path \"%s\" for extraction, it is a file, must be a directory", ZSTR_VAL(path_to)); RETURN_THROWS(); } @@ -4386,7 +4385,7 @@ PHP_METHOD(Phar, extractTo) "Invalid argument, array of filenames to extract contains non-string value"); RETURN_THROWS(); } - switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), pathto, pathto_len, overwrite, &error)) { + switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), path_to, overwrite, &error)) { case -1: zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); @@ -4402,7 +4401,7 @@ PHP_METHOD(Phar, extractTo) RETURN_TRUE; } - ret = extract_helper(phar_obj->archive, filename, pathto, pathto_len, overwrite, &error); + ret = extract_helper(phar_obj->archive, filename, path_to, overwrite, &error); if (-1 == ret) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); From 670a8f73ccf54edd37b8f24f13953c699904ee4c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 21:02:08 +0100 Subject: [PATCH 225/386] ext/phar: Improve signature tests --- ext/phar/tests/phar_setsignaturealgo2.phpt | 54 ++++++++++----- .../tests/tar/phar_setsignaturealgo2.phpt | 66 +++++++++++++------ .../tests/zip/phar_setsignaturealgo2.phpt | 64 +++++++++++------- 3 files changed, 122 insertions(+), 62 deletions(-) diff --git a/ext/phar/tests/phar_setsignaturealgo2.phpt b/ext/phar/tests/phar_setsignaturealgo2.phpt index 4f31836fbbbcc..82615a13da478 100644 --- a/ext/phar/tests/phar_setsignaturealgo2.phpt +++ b/ext/phar/tests/phar_setsignaturealgo2.phpt @@ -2,6 +2,7 @@ Phar::setSupportedSignatures() with hash --EXTENSIONS-- phar +openssl --SKIPIF-- getSignature()); + +echo "Set MD5:\n"; $p->setSignatureAlgorithm(Phar::MD5); var_dump($p->getSignature()); + +echo "Set SHA1:\n"; $p->setSignatureAlgorithm(Phar::SHA1); var_dump($p->getSignature()); + +echo "Set SHA256:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA256); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA256); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set SHA512:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA512); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA512); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set OPENSSL:\n"; try { -$config = __DIR__ . '/files/openssl.cnf'; -$config_arg = array('config' => $config); -$private = openssl_get_privatekey(file_get_contents(__DIR__ . '/files/private.pem')); -$pkey = ''; -openssl_pkey_export($private, $pkey, NULL, $config_arg); -$p->setSignatureAlgorithm(Phar::OPENSSL, $pkey); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $config = __DIR__ . '/files/openssl.cnf'; + $config_arg = array('config' => $config); + $private = openssl_get_privatekey(file_get_contents(__DIR__ . '/files/private.pem')); + $pkey = ''; + openssl_pkey_export($private, $pkey, NULL, $config_arg); + $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + ?> --CLEAN-- --EXPECTF-- +Default: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set MD5: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(3) "MD5" } +Set SHA1: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(5) "SHA-1" } +Set SHA256: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set SHA512: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-512" } +Set OPENSSL: array(2) { ["hash"]=> string(%d) "%s" diff --git a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt index 1a3a84303ea1b..6d60d3a680a1d 100644 --- a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt +++ b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt @@ -2,6 +2,7 @@ Phar::setSupportedSignatures() with hash, tar-based --EXTENSIONS-- phar +openssl --SKIPIF-- getSignature()); + +echo "Set MD5:\n"; $p->setSignatureAlgorithm(Phar::MD5); var_dump($p->getSignature()); + +echo "Set SHA1:\n"; $p->setSignatureAlgorithm(Phar::SHA1); var_dump($p->getSignature()); + +echo "Set SHA256:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA256); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA256); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set SHA512:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA512); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA512); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set OPENSSL:\n"; try { -$config = __DIR__ . '/../files/openssl.cnf'; -$config_arg = array('config' => $config); -$private = openssl_get_privatekey(file_get_contents(dirname(__DIR__) . '/files/private.pem')); -$pkey = ''; -openssl_pkey_export($private, $pkey, NULL, $config_arg); -$p->setSignatureAlgorithm(Phar::OPENSSL, $pkey); -var_dump($p->getSignature()); -$p->setSignatureAlgorithm(Phar::OPENSSL_SHA512, $pkey); -var_dump($p->getSignature()); -$p->setSignatureAlgorithm(Phar::OPENSSL_SHA256, $pkey); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $config = __DIR__ . '/../files/openssl.cnf'; + $config_arg = array('config' => $config); + $private = openssl_get_privatekey(file_get_contents(dirname(__DIR__) . '/files/private.pem')); + $pkey = ''; + openssl_pkey_export($private, $pkey, NULL, $config_arg); + $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey); + var_dump($p->getSignature()); + echo "Set OPENSSL_SHA512:\n"; + $p->setSignatureAlgorithm(Phar::OPENSSL_SHA512, $pkey); + var_dump($p->getSignature()); + echo "Set OPENSSL_SHA256:\n"; + $p->setSignatureAlgorithm(Phar::OPENSSL_SHA256, $pkey); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + ?> --CLEAN-- --EXPECTF-- +Default: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set MD5: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(3) "MD5" } +Set SHA1: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(5) "SHA-1" } +Set SHA256: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set SHA512: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-512" } +Set OPENSSL: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "OpenSSL" } +Set OPENSSL_SHA512: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(14) "OpenSSL_SHA512" } +Set OPENSSL_SHA256: array(2) { ["hash"]=> string(%d) "%s" diff --git a/ext/phar/tests/zip/phar_setsignaturealgo2.phpt b/ext/phar/tests/zip/phar_setsignaturealgo2.phpt index 4fb9a155c5f57..8e3eed61cf781 100644 --- a/ext/phar/tests/zip/phar_setsignaturealgo2.phpt +++ b/ext/phar/tests/zip/phar_setsignaturealgo2.phpt @@ -20,49 +20,59 @@ $fname5 = __DIR__ . '/' . basename(__FILE__, '.php') . '.5.phar.zip'; $fname6 = __DIR__ . '/' . basename(__FILE__, '.php') . '.6.phar.zip'; $p = new Phar($fname); $p['file1.txt'] = 'hi'; + +echo "Default:\n"; var_dump($p->getSignature()); + +echo "Set MD5:\n"; $p->setSignatureAlgorithm(Phar::MD5); copy($fname, $fname2); $p = new Phar($fname2); var_dump($p->getSignature()); +echo "Set SHA1:\n"; $p->setSignatureAlgorithm(Phar::SHA1); copy($fname2, $fname3); $p = new Phar($fname3); var_dump($p->getSignature()); +echo "Set SHA256:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA256); -copy($fname3, $fname4); -$p = new Phar($fname4); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA256); + copy($fname3, $fname4); + $p = new Phar($fname4); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set SHA512:\n"; try { -$p->setSignatureAlgorithm(Phar::SHA512); -copy($fname4, $fname5); -$p = new Phar($fname5); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + $p->setSignatureAlgorithm(Phar::SHA512); + copy($fname4, $fname5); + $p = new Phar($fname5); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } + +echo "Set OPENSSL:\n"; try { -$config = __DIR__ . '/../files/openssl.cnf'; -$config_arg = array('config' => $config); -$keys=openssl_pkey_new($config_arg); -openssl_pkey_export($keys, $privkey, NULL, $config_arg); -$pubkey=openssl_pkey_get_details($keys); -$p->setSignatureAlgorithm(Phar::OPENSSL, $privkey); + $config = __DIR__ . '/../files/openssl.cnf'; + $config_arg = array('config' => $config); + $keys=openssl_pkey_new($config_arg); + openssl_pkey_export($keys, $privkey, NULL, $config_arg); + $pubkey=openssl_pkey_get_details($keys); + $p->setSignatureAlgorithm(Phar::OPENSSL, $privkey); -copy($fname5, $fname6); -file_put_contents($fname6 . '.pubkey', $pubkey['key']); -$p = new Phar($fname6); -var_dump($p->getSignature()); -} catch (Exception $e) { -echo $e->getMessage(); + copy($fname5, $fname6); + file_put_contents($fname6 . '.pubkey', $pubkey['key']); + $p = new Phar($fname6); + var_dump($p->getSignature()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- @@ -76,36 +86,42 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.6.phar.zip'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.6.phar.zip.pubkey'); ?> --EXPECTF-- +Default: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set MD5: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(3) "MD5" } +Set SHA1: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(5) "SHA-1" } +Set SHA256: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-256" } +Set SHA512: array(2) { ["hash"]=> string(%d) "%s" ["hash_type"]=> string(7) "SHA-512" } +Set OPENSSL: array(2) { ["hash"]=> string(%d) "%s" From 9a24c6a89f137e1ce046270a8efa9a7f156584b4 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 21:01:29 +0100 Subject: [PATCH 226/386] ext/phar: assert function are not passed NULL pointers This simplifies some of the logic and makes the assumptions clear --- ext/phar/phar.c | 235 ++++++++++++------------------------ ext/phar/phar_internal.h | 34 +++--- ext/phar/phar_object.c | 11 +- ext/phar/phar_path_check.re | 2 +- ext/phar/stream.h | 2 +- ext/phar/tar.c | 85 +++++-------- ext/phar/util.c | 149 ++++++++--------------- ext/phar/zip.c | 99 ++++++--------- 8 files changed, 218 insertions(+), 399 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index b1f6d39171e4d..cec38aa33533e 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -414,7 +414,7 @@ void phar_entry_delref(phar_entry_data *idata) /* {{{ */ /** * Removes an entry, either by actually removing it or by marking it. */ -void phar_entry_remove(phar_entry_data *idata, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL void phar_entry_remove(phar_entry_data *idata, char **error) /* {{{ */ { phar_archive_data *phar; @@ -1310,7 +1310,7 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname /** * Create or open a phar for writing */ -zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { const char *ext_str, *z; char *my_error; @@ -1319,9 +1319,7 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al test = &unused; - if (error) { - *error = NULL; - } + *error = NULL; /* first try to open an existing file */ if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, true) == SUCCESS) { @@ -1330,25 +1328,19 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al /* next try to create a new file */ if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, true)) { - if (error) { - if (ext_len == -2) { - spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname); - } else { - spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist", fname); - } + if (ext_len == -2) { + spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname); + } else { + spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist", fname); } return FAILURE; } check_file: if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, test, &my_error) == SUCCESS) { - if (pphar) { - *pphar = *test; - } + *pphar = *test; if ((*test)->is_data && !(*test)->is_tar && !(*test)->is_zip) { - if (error) { - spprintf(error, 0, "Cannot open '%s' as a PharData object. Use Phar::__construct() for executable archives", fname); - } + spprintf(error, 0, "Cannot open '%s' as a PharData object. Use Phar::__construct() for executable archives", fname); return FAILURE; } @@ -1364,11 +1356,7 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al } return SUCCESS; } else if (my_error) { - if (error) { - *error = my_error; - } else { - efree(my_error); - } + *error = my_error; return FAILURE; } @@ -1388,16 +1376,12 @@ zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *al static zend_result phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, uint32_t options, phar_archive_data** pphar, char **error); -zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { - phar_archive_data *mydata; php_stream *fp; zend_string *actual = NULL; char *p; - if (!pphar) { - pphar = &mydata; - } if (php_check_open_basedir(fname)) { return FAILURE; } @@ -1434,15 +1418,13 @@ zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *a if (PHAR_G(readonly) && !is_data) { if (options & REPORT_ERRORS) { - if (error) { - spprintf(error, 0, "creating archive \"%s\" disabled by the php.ini setting phar.readonly", fname); - } + spprintf(error, 0, "creating archive \"%s\" disabled by the php.ini setting phar.readonly", fname); } return FAILURE; } /* set up our manifest */ - mydata = ecalloc(1, sizeof(phar_archive_data)); + phar_archive_data *mydata = ecalloc(1, sizeof(phar_archive_data)); mydata->fname = expand_filepath(fname, NULL); if (mydata->fname == NULL) { efree(mydata); @@ -1464,10 +1446,6 @@ zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *a } } - if (pphar) { - *pphar = mydata; - } - zend_hash_init(&mydata->manifest, sizeof(phar_entry_info), zend_get_hash_value, destroy_phar_manifest_entry, 0); zend_hash_init(&mydata->mounted_dirs, sizeof(char *), @@ -1494,15 +1472,11 @@ zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *a if (alias && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) { - if (error) { - spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias); - } + spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias); zend_hash_str_del(&(PHAR_G(phar_fname_map)), mydata->fname, fname_len); - if (pphar) { - *pphar = NULL; - } + *pphar = NULL; return FAILURE; } @@ -1516,21 +1490,18 @@ zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *a if (alias_len && alias) { if (NULL == zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, mydata)) { if (options & REPORT_ERRORS) { - if (error) { - spprintf(error, 0, "archive \"%s\" cannot be associated with alias \"%s\", already in use", fname, alias); - } + spprintf(error, 0, "archive \"%s\" cannot be associated with alias \"%s\", already in use", fname, alias); } zend_hash_str_del(&(PHAR_G(phar_fname_map)), mydata->fname, fname_len); - if (pphar) { - *pphar = NULL; - } + *pphar = NULL; return FAILURE; } } + *pphar = mydata; return SUCCESS; } /* }}}*/ @@ -2320,29 +2291,23 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a * Invoked when a user calls Phar::mapPhar() from within an executing .phar * to set up its manifest directly */ -zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(3) zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **error) /* {{{ */ { - if (error) { - *error = NULL; - } + *error = NULL; zend_string *fname = zend_get_executed_filename_ex(); if (!fname) { - if (error) { - spprintf(error, 0, "cannot initialize a phar outside of PHP execution"); - } + *error = estrdup("cannot initialize a phar outside of PHP execution"); return FAILURE; } - if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, false, REPORT_ERRORS, NULL, 0) == SUCCESS) { + if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias, alias_len, false, REPORT_ERRORS, NULL, NULL) == SUCCESS) { return SUCCESS; } - if (0 == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { - if (error) { - spprintf(error, 0, "__HALT_COMPILER(); must be declared in a phar"); - } + if (NULL == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { + *error = estrdup("__HALT_COMPILER(); must be declared in a phar"); return FAILURE; } @@ -2355,9 +2320,7 @@ zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **er fp = php_stream_open_wrapper(ZSTR_VAL(fname), "rb", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, &actual); if (!fp) { - if (error) { - spprintf(error, 0, "unable to open phar for reading \"%s\"", ZSTR_VAL(fname)); - } + spprintf(error, 0, "unable to open phar for reading \"%s\"", ZSTR_VAL(fname)); if (actual) { zend_string_release_ex(actual, 0); } @@ -2381,14 +2344,12 @@ zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **er /** * Validate the CRC32 of a file opened from within the phar */ -zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip) /* {{{ */ { php_stream *fp = idata->fp; phar_entry_info *entry = idata->internal_file; - if (error) { - *error = NULL; - } + *error = NULL; if (entry->is_zip && process_zip > 0) { /* verify local file header */ @@ -2396,14 +2357,15 @@ zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char * phar_zip_data_desc desc; if (SUCCESS != phar_open_archive_fp(idata->phar)) { - spprintf(error, 0, "phar error: unable to open zip-based phar archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, ZSTR_VAL(entry->filename)); + spprintf(error, 0, "phar error: unable to open zip-based phar archive \"%s\" to verify local file header for file \"%s\"", + idata->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; } php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET); if (sizeof(local) != php_stream_read(phar_get_entrypfp(idata->internal_file), (char *) &local, sizeof(local))) { - - spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, ZSTR_VAL(entry->filename)); + spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local file header for file \"%s\")", + idata->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; } @@ -2416,7 +2378,8 @@ zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char * entry->compressed_filesize, SEEK_SET); if (sizeof(desc) != php_stream_read(phar_get_entrypfp(idata->internal_file), (char *) &desc, sizeof(desc))) { - spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, ZSTR_VAL(entry->filename)); + spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local data descriptor for file \"%s\")", + idata->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; } if (desc.signature[0] == 'P' && desc.signature[1] == 'K') { @@ -2428,7 +2391,8 @@ zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char * } /* verify local header */ if (ZSTR_LEN(entry->filename) != PHAR_ZIP_16(local.filename_len) || entry->crc32 != PHAR_ZIP_32(local.crc32) || entry->uncompressed_filesize != PHAR_ZIP_32(local.uncompsize) || entry->compressed_filesize != PHAR_ZIP_32(local.compsize)) { - spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (local header of file \"%s\" does not match central directory)", idata->phar->fname, ZSTR_VAL(entry->filename)); + spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (local header of file \"%s\" does not match central directory)", + idata->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; } @@ -2456,7 +2420,8 @@ zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char * entry->is_crc_checked = 1; return SUCCESS; } else { - spprintf(error, 0, "phar error: internal corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, ZSTR_VAL(entry->filename)); + spprintf(error, 0, "phar error: internal corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", + idata->phar->fname, ZSTR_VAL(entry->filename)); return FAILURE; } } @@ -2527,7 +2492,7 @@ zend_string *phar_create_default_stub(const char *index_php, const char *web_ind } /* }}} */ -void phar_flush(phar_archive_data *phar, char **error) { +ZEND_ATTRIBUTE_NONNULL void phar_flush(phar_archive_data *phar, char **error) { phar_flush_ex(phar, NULL, false, error); } @@ -2536,7 +2501,7 @@ void phar_flush(phar_archive_data *phar, char **error) { * * if user_stub is NULL the default or existing stub should be used */ -void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ { static const char halt_stub[] = "__HALT_COMPILER();"; @@ -2562,15 +2527,11 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream *shared_cfp = NULL; if (phar->is_persistent) { - if (error) { - spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname); return; } - if (error) { - *error = NULL; - } + *error = NULL; if (!zend_hash_num_elements(&phar->manifest) && !user_stub) { return; @@ -2602,9 +2563,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa } newfile = php_stream_fopen_tmpfile(); if (!newfile) { - if (error) { - spprintf(error, 0, "unable to create temporary file"); - } + *error = estrdup("unable to create temporary file"); if (must_close_old_file) { php_stream_close(oldfile); } @@ -2619,9 +2578,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)", phar->fname); - } + spprintf(error, 0, "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)", phar->fname); return; } @@ -2637,9 +2594,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to create stub from string in new phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to create stub from string in new phar \"%s\"", phar->fname); return; } phar->halt_offset = len + end_sequence_len; @@ -2660,12 +2615,10 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - if (new_stub) { - spprintf(error, 0, "unable to create stub in new phar \"%s\"", phar->fname); - } else { - spprintf(error, 0, "unable to copy stub of old phar to new phar \"%s\"", phar->fname); - } + if (new_stub) { + spprintf(error, 0, "unable to create stub in new phar \"%s\"", phar->fname); + } else { + spprintf(error, 0, "unable to copy stub of old phar to new phar \"%s\"", phar->fname); } if (new_stub) { zend_string_free(new_stub); @@ -2763,9 +2716,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); return; } newcrc32 = php_crc32_bulk_init(); @@ -2783,15 +2734,10 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { - if (error) { - spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } - } else { - if (error) { - spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } - } + spprintf(error, 0, "unable to %s compress file \"%s\" to new phar \"%s\"", + entry->flags & PHAR_ENT_COMPRESSED_GZ ? "gzip" : "bzip2", + ZSTR_VAL(entry->filename), + phar->fname); return; } @@ -2804,9 +2750,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa entry->cfp = shared_cfp; if (!entry->cfp) { php_stream_filter_free(filter); - if (error) { - spprintf(error, 0, "unable to create temporary file"); - } + *error = estrdup("unable to create temporary file"); if (must_close_old_file) { php_stream_close(oldfile); } @@ -2823,9 +2767,8 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", + ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } php_stream_filter_append((&entry->cfp->writefilters), filter); @@ -2835,9 +2778,8 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to copy compressed file contents of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to copy compressed file contents of file \"%s\" while creating new phar \"%s\"", + ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } php_stream_filter_flush(filter, 1); @@ -2897,9 +2839,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(newfile); phar->alias_len = restore_alias_len; - if (error) { - spprintf(error, 0, "unable to write manifest header of new phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to write manifest header of new phar \"%s\"", phar->fname); goto cleanup; } @@ -2918,9 +2858,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(newfile); phar->alias_len = restore_alias_len; - if (error) { - spprintf(error, 0, "unable to write manifest meta-data of new phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to write manifest meta-data of new phar \"%s\"", phar->fname); goto cleanup; } @@ -2951,12 +2889,10 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - if (entry->is_dir) { - spprintf(error, 0, "unable to write filename of directory \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } else { - spprintf(error, 0, "unable to write filename of file \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + if (entry->is_dir) { + spprintf(error, 0, "unable to write filename of directory \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); + } else { + spprintf(error, 0, "unable to write filename of file \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); } goto cleanup; } @@ -2988,9 +2924,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } @@ -3004,9 +2938,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to write manifest padding byte"); - } + *error = estrdup("unable to write manifest padding byte"); goto cleanup; } @@ -3029,9 +2961,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } } @@ -3041,9 +2971,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(oldfile); } php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } @@ -3057,9 +2985,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa php_stream_close(newfile); - if (error) { - spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); - } + spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", ZSTR_VAL(entry->filename), phar->fname); goto cleanup; } @@ -3105,12 +3031,11 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa char *digest = NULL; size_t digest_len; - if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error)) { - if (error) { - char *save = *error; - spprintf(error, 0, "phar error: unable to write signature: %s", save); - efree(save); - } + char *signature_error = NULL; + if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, &signature_error)) { + spprintf(error, 0, "phar error: unable to write signature: %s", signature_error); + efree(signature_error); + if (digest) { efree(digest); } @@ -3167,9 +3092,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, NULL); if (!phar->fp) { phar->fp = newfile; - if (error) { - spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname); - } + spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname); return; } @@ -3183,9 +3106,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa zend_array_destroy(Z_ARR(filterparams)); if (!filter) { - if (error) { - spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname); - } + spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname); return; } @@ -3213,9 +3134,7 @@ void phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defa } if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) { - if (error) { - spprintf(error, 0, "unable to seek to __HALT_COMPILER(); in new phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to seek to __HALT_COMPILER(); in new phar \"%s\"", phar->fname); } return; diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index fe63e075c1b51..232ba579d7f0b 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -404,15 +404,15 @@ void phar_request_initialize(void); void phar_object_init(void); void phar_destroy_phar_data(phar_archive_data *phar); -zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip); +ZEND_ATTRIBUTE_NONNULL zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip); zend_result phar_open_from_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, uint32_t options, phar_archive_data** pphar, char **error); -zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); -zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); -zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(3) zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **error); zend_result phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_len); zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fname_len, char *alias, size_t alias_len, char **error); zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, char *fname, char **signature, size_t *signature_len, char **error); -zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error); +ZEND_ATTRIBUTE_NONNULL zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error); /* utility functions */ zend_string *phar_create_default_stub(const char *index_php, const char *web_index, char **error); @@ -424,7 +424,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filen zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t filename_len, char *path, size_t path_len); zend_string *phar_find_in_include_path(zend_string *file, phar_archive_data **pphar); char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd); -phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error); +ZEND_ATTRIBUTE_NONNULL phar_entry_info * phar_open_jit(const phar_archive_data *phar, phar_entry_info *entry, char **error); void phar_parse_metadata_lazy(const char *buffer, phar_metadata_tracker *tracker, uint32_t zip_metadata_len, bool persistent); bool phar_metadata_tracker_has_data(const phar_metadata_tracker* tracker, bool persistent); /* If this has data, free it and set all values to undefined. */ @@ -436,8 +436,8 @@ zend_result phar_metadata_tracker_unserialize_or_copy(phar_metadata_tracker* tra void destroy_phar_manifest_entry(zval *zv); int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, bool follow_links); php_stream *phar_get_efp(phar_entry_info *entry, bool follow_links); -zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error); -zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links); +ZEND_ATTRIBUTE_NONNULL zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error); +ZEND_ATTRIBUTE_NONNULL zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links); phar_entry_info *phar_get_link_source(phar_entry_info *entry); zend_result phar_open_archive_fp(phar_archive_data *phar); zend_result phar_copy_on_write(phar_archive_data **pphar); @@ -445,13 +445,13 @@ zend_result phar_copy_on_write(phar_archive_data **pphar); /* tar functions in tar.c */ bool phar_is_tar(char *buf, char *fname); zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error); -zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); -void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); /* zip functions in zip.c */ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error); -zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); -void phar_zip_flush(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_zip_flush(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); #ifdef PHAR_MAIN extern const php_stream_wrapper php_stream_phar_wrapper; @@ -465,10 +465,10 @@ void phar_entry_delref(phar_entry_data *idata); phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, bool security); phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, bool security); -phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); -zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); -void phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); -void phar_flush(phar_archive_data *archive, char **error); +ZEND_ATTRIBUTE_NONNULL phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); +ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); +ZEND_ATTRIBUTE_NONNULL void phar_flush(phar_archive_data *archive, char **error); zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete); zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len, int executable, int for_create); @@ -484,6 +484,6 @@ typedef enum { pcr_err_empty_entry } phar_path_check_result; -phar_path_check_result phar_path_check(char **p, size_t *len, const char **error); +ZEND_ATTRIBUTE_NONNULL phar_path_check_result phar_path_check(char **p, size_t *len, const char **error); END_EXTERN_C() diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 0b7e55c5e9afa..8a7cf236b0973 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4108,7 +4108,7 @@ PHP_METHOD(Phar, delMetadata) } /* }}} */ -static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, const zend_string *path, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, const zend_string *path, char **error) /* {{{ */ { php_stream_statbuf ssb; size_t len; @@ -4245,9 +4245,10 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, con } if ((phar_get_fp_type(entry) == PHAR_FP && (entry->flags & PHAR_ENT_COMPRESSION_MASK)) || !phar_get_efp(entry, false)) { - if (FAILURE == phar_open_entry_fp(entry, error, true)) { - if (error) { - spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", ZSTR_VAL(entry->filename), fullpath, *error); + char *open_entry_error = NULL; + if (FAILURE == phar_open_entry_fp(entry, &open_entry_error, true)) { + if (open_entry_error) { + spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", ZSTR_VAL(entry->filename), fullpath, open_entry_error); } else { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer", ZSTR_VAL(entry->filename), fullpath); } @@ -4285,7 +4286,7 @@ static zend_result phar_extract_file(bool overwrite, phar_entry_info *entry, con } /* }}} */ -static int extract_helper(const phar_archive_data *archive, zend_string *search, const zend_string *path_to, bool overwrite, char **error) { /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 3, 5) static int extract_helper(const phar_archive_data *archive, zend_string *search, const zend_string *path_to, bool overwrite, char **error) { /* {{{ */ int extracted = 0; phar_entry_info *entry; diff --git a/ext/phar/phar_path_check.re b/ext/phar/phar_path_check.re index 77aa0b1953d3c..689ffaa512442 100644 --- a/ext/phar/phar_path_check.re +++ b/ext/phar/phar_path_check.re @@ -18,7 +18,7 @@ #include "phar_internal.h" -phar_path_check_result phar_path_check(char **s, size_t *len, const char **error) +ZEND_ATTRIBUTE_NONNULL phar_path_check_result phar_path_check(char **s, size_t *len, const char **error) { const unsigned char *p = (const unsigned char*)*s; const unsigned char *m; diff --git a/ext/phar/stream.h b/ext/phar/stream.h index ce75b70dcba00..83b395b4cfca3 100644 --- a/ext/phar/stream.h +++ b/ext/phar/stream.h @@ -21,7 +21,7 @@ BEGIN_EXTERN_C() #include "ext/standard/url.h" php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options); -void phar_entry_remove(phar_entry_data *idata, char **error); +ZEND_ATTRIBUTE_NONNULL void phar_entry_remove(phar_entry_data *idata, char **error); static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context); diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 540f265892299..550183746a2c8 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -127,7 +127,7 @@ bool phar_is_tar(char *buf, char *fname) /* {{{ */ } /* }}} */ -zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { phar_archive_data *phar; zend_result ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); @@ -136,9 +136,7 @@ zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, return FAILURE; } - if (pphar) { - *pphar = phar; - } + *pphar = phar; phar->is_data = is_data; @@ -153,9 +151,7 @@ zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, } /* we've reached here - the phar exists and is a regular phar */ - if (error) { - spprintf(error, 4096, "phar tar error: \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar", fname); - } + spprintf(error, 4096, "phar tar error: \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar", fname); return FAILURE; } /* }}} */ @@ -877,7 +873,7 @@ static int phar_tar_writeheaders(zval *zv, void *argument) /* {{{ */ } /* }}} */ -static int phar_tar_setmetadata(const phar_metadata_tracker *tracker, phar_entry_info *entry, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL static int phar_tar_setmetadata(const phar_metadata_tracker *tracker, phar_entry_info *entry, char **error) /* {{{ */ { /* Copy the metadata from tracker to the new entry being written out to temporary files */ const zend_string *serialized_str; @@ -897,7 +893,7 @@ static int phar_tar_setmetadata(const phar_metadata_tracker *tracker, phar_entry entry->fp = php_stream_fopen_tmpfile(); entry->offset = entry->offset_abs = 0; if (entry->fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return -1; } if (serialized_str && ZSTR_LEN(serialized_str) != php_stream_write(entry->fp, ZSTR_VAL(serialized_str), ZSTR_LEN(serialized_str))) { @@ -910,7 +906,7 @@ static int phar_tar_setmetadata(const phar_metadata_tracker *tracker, phar_entry } /* }}} */ -static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */ { struct _phar_pass_tar_info *i = (struct _phar_pass_tar_info *)argument; char **error = i->error; @@ -964,7 +960,7 @@ static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */ } /* }}} */ -void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ { static const char newstub[] = "is_persistent) { - if (error) { - spprintf(error, 0, "internal error: attempt to flush cached tar-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "internal error: attempt to flush cached tar-based phar \"%s\"", phar->fname); return; } @@ -1002,13 +996,11 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (!phar->is_temporary_alias && phar->alias_len) { entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { - if (error) { - spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname); php_stream_close(entry.fp); return; } @@ -1028,9 +1020,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def char *pos = php_stristr(ZSTR_VAL(user_stub), halt_stub, ZSTR_LEN(user_stub), sizeof(halt_stub) - 1); if (pos == NULL) { - if (error) { - spprintf(error, 0, "illegal stub for tar-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "illegal stub for tar-based phar \"%s\"", phar->fname); return; } @@ -1040,7 +1030,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } entry.uncompressed_filesize = len + end_sequence_len; @@ -1049,9 +1039,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def len != php_stream_write(entry.fp, ZSTR_VAL(user_stub), len) || end_sequence_len != php_stream_write(entry.fp, end_sequence, end_sequence_len) ) { - if (error) { - spprintf(error, 0, "unable to create stub from string in new tar-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to create stub from string in new tar-based phar \"%s\"", phar->fname); php_stream_close(entry.fp); return; } @@ -1062,14 +1050,13 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); - if (error) { - spprintf(error, 0, "unable to %s stub in%star-based phar \"%s\", failed", user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname); - } + spprintf(error, 0, "unable to %s stub in%star-based phar \"%s\", failed", + user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname); return; } @@ -1081,9 +1068,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (NULL == zend_hash_add_mem(&phar->manifest, entry.filename, &entry, sizeof(phar_entry_info))) { php_stream_close(entry.fp); zend_string_efree(entry.filename); - if (error) { - spprintf(error, 0, "unable to create stub in tar-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to create stub in tar-based phar \"%s\"", phar->fname); return; } } else { @@ -1106,9 +1091,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def newfile = php_stream_fopen_tmpfile(); if (!newfile) { - if (error) { - spprintf(error, 0, "unable to create temporary file"); - } + *error = estrdup("unable to create temporary file"); if (must_close_old_file) { php_stream_close(oldfile); } @@ -1159,7 +1142,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass); - if (error && *error) { + if (*error) { if (must_close_old_file) { php_stream_close(oldfile); } @@ -1171,7 +1154,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass); - if (error && *error) { + if (*error) { if (must_close_old_file) { php_stream_close(oldfile); } @@ -1183,12 +1166,10 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def /* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */ if (!phar->is_data || phar->sig_flags) { - if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error)) { - if (error) { - char *save = *error; - spprintf(error, 0, "phar error: unable to write signature to tar-based phar: %s", save); - efree(save); - } + char *signature_error = NULL; + if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, &signature_error)) { + spprintf(error, 0, "phar error: unable to write signature to tar-based phar: %s", signature_error); + efree(signature_error); if (must_close_old_file) { php_stream_close(oldfile); @@ -1200,7 +1181,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); efree(signature); if (must_close_old_file) { @@ -1225,9 +1206,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (8 != php_stream_write(entry.fp, sigbuf, 8) || signature_length != php_stream_write(entry.fp, signature, signature_length)) { efree(signature); - if (error) { - spprintf(error, 0, "phar error: unable to write signature to tar-based phar %s", phar->fname); - } + spprintf(error, 0, "phar error: unable to write signature to tar-based phar %s", phar->fname); if (must_close_old_file) { php_stream_close(oldfile); @@ -1244,7 +1223,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def phar_tar_writeheaders_int(&entry, &pass); ZSTR_ALLOCA_FREE(entry.filename, use_heap); - if (error && *error) { + if (*error) { if (must_close_old_file) { php_stream_close(oldfile); } @@ -1264,7 +1243,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def } /* on error in the hash iterator above, error is set */ - if (error && *error) { + if (*error) { php_stream_close(newfile); return; } @@ -1290,9 +1269,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, NULL); if (!phar->fp) { phar->fp = newfile; - if (error) { - spprintf(error, 0, "unable to open new phar \"%s\" for writing", phar->fname); - } + spprintf(error, 0, "unable to open new phar \"%s\" for writing", phar->fname); return; } @@ -1314,9 +1291,7 @@ void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def /* copy contents uncompressed rather than lose them */ php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL); php_stream_close(newfile); - if (error) { - spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname); - } + spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname); return; } diff --git a/ext/phar/util.c b/ext/phar/util.c index 51ebfb36275d7..884e96fb979a6 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -362,8 +362,10 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data } /* }}} */ -static zend_result phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */ +static ZEND_ATTRIBUTE_NONNULL zend_result phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */ { + *error = NULL; + if (entry->fp_type == PHAR_MOD) { /* already newly created, truncate */ php_stream_truncate_set_size(entry->fp, 0); @@ -381,10 +383,6 @@ static zend_result phar_create_writeable_entry(phar_archive_data *phar, phar_ent return SUCCESS; } - if (error) { - *error = NULL; - } - /* open a new temp file for writing */ if (entry->link) { efree(entry->link); @@ -395,9 +393,7 @@ static zend_result phar_create_writeable_entry(phar_archive_data *phar, phar_ent entry->fp = php_stream_fopen_tmpfile(); if (!entry->fp) { - if (error) { - spprintf(error, 0, "phar error: unable to create temporary file"); - } + *error = estrdup("phar error: unable to create temporary file"); return FAILURE; } @@ -415,7 +411,7 @@ static zend_result phar_create_writeable_entry(phar_archive_data *phar, phar_ent } /* }}} */ -static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) /* {{{ */ { php_stream *fp; phar_entry_info *link; @@ -430,7 +426,7 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) fp = php_stream_fopen_tmpfile(); if (fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return FAILURE; } phar_seek_efp(entry, 0, SEEK_SET, 0, true); @@ -441,9 +437,7 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) } if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, false), fp, link->uncompressed_filesize, NULL)) { - if (error) { - spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", ZSTR_VAL(entry->filename), entry->phar->fname); - } + spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", ZSTR_VAL(entry->filename), entry->phar->fname); return FAILURE; } @@ -469,7 +463,7 @@ static zend_result phar_separate_entry_fp(phar_entry_info *entry, char **error) * appended, truncated, or read. For read, if the entry is marked unmodified, it is * assumed that the file pointer, if present, is opened for reading */ -zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry; @@ -478,31 +472,20 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname bool for_create = mode[0] != 'r'; bool for_trunc = mode[0] == 'w'; - if (!ret) { - return FAILURE; - } - *ret = NULL; - - if (error) { - *error = NULL; - } + *error = NULL; if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) { return FAILURE; } if (for_write && PHAR_G(readonly) && !phar->is_data) { - if (error) { - spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, disabled by ini setting", path, fname); - } + spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, disabled by ini setting", path, fname); return FAILURE; } if (!path_len) { - if (error) { - spprintf(error, 4096, "phar error: file \"\" in phar \"%s\" must not be empty", fname); - } + spprintf(error, 4096, "phar error: file \"\" in phar \"%s\" must not be empty", fname); return FAILURE; } really_get_entry: @@ -524,9 +507,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname if (for_write && phar->is_persistent) { if (FAILURE == phar_copy_on_write(&phar)) { - if (error) { - spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, could not make cached phar writeable", path, fname); - } + spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, could not make cached phar writeable", path, fname); return FAILURE; } else { goto really_get_entry; @@ -534,16 +515,12 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname } if (entry->is_modified && !for_write) { - if (error) { - spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for reading, writable file pointers are open", path, fname); - } + spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for reading, writable file pointers are open", path, fname); return FAILURE; } if (entry->fp_refcount && for_write) { - if (error) { - spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, readable file pointers are open", path, fname); - } + spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, readable file pointers are open", path, fname); return FAILURE; } @@ -629,7 +606,7 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname /** * Create a new dummy file slot within a writeable phar for a newly created file */ -phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry, etemp; @@ -654,16 +631,12 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, ch } if (phar_path_check(&path, &path_len, &pcr_error) > pcr_is_ok) { - if (error) { - spprintf(error, 0, "phar error: invalid path \"%s\" contains %s", path, pcr_error); - } + spprintf(error, 0, "phar error: invalid path \"%s\" contains %s", path, pcr_error); return NULL; } if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) { - if (error) { - spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be created, could not make cached phar writeable", path, fname); - } + spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be created, could not make cached phar writeable", path, fname); return NULL; } @@ -676,9 +649,7 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, ch etemp.fp = php_stream_fopen_tmpfile(); if (!etemp.fp) { - if (error) { - spprintf(error, 0, "phar error: unable to create temporary file"); - } + *error = estrdup("phar error: unable to create temporary file"); efree(ret); return NULL; } @@ -710,9 +681,8 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, ch if (NULL == (entry = zend_hash_add_mem(&phar->manifest, etemp.filename, &etemp, sizeof(phar_entry_info)))) { php_stream_close(etemp.fp); - if (error) { - spprintf(error, 0, "phar error: unable to add new entry \"%s\" to phar \"%s\"", ZSTR_VAL(etemp.filename), phar->fname); - } + spprintf(error, 0, "phar error: unable to add new entry \"%s\" to phar \"%s\"", + ZSTR_VAL(etemp.filename), phar->fname); efree(ret); zend_string_efree(etemp.filename); return NULL; @@ -760,7 +730,7 @@ zend_result phar_open_archive_fp(phar_archive_data *phar) /* {{{ */ /* }}} */ /* copy file data from an existing to a new phar_entry_info that is not in the manifest */ -zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error) /* {{{ */ { phar_entry_info *link; @@ -779,7 +749,7 @@ zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, c dest->is_modified = 1; dest->fp = php_stream_fopen_tmpfile(); if (dest->fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return EOF; } phar_seek_efp(source, 0, SEEK_SET, 0, true); @@ -792,9 +762,8 @@ zend_result phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, c if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, false), dest->fp, link->uncompressed_filesize, NULL)) { php_stream_close(dest->fp); dest->fp_type = PHAR_FP; - if (error) { - spprintf(error, 4096, "phar error: unable to copy contents of file \"%s\" to \"%s\" in phar archive \"%s\"", ZSTR_VAL(source->filename), ZSTR_VAL(dest->filename), source->phar->fname); - } + spprintf(error, 4096, "phar error: unable to copy contents of file \"%s\" to \"%s\" in phar archive \"%s\"", + ZSTR_VAL(source->filename), ZSTR_VAL(dest->filename), source->phar->fname); return FAILURE; } @@ -828,7 +797,7 @@ static void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zen /* open and decompress a compressed phar entry */ -zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow_links) /* {{{ */ { php_stream_filter *filter; phar_archive_data *phar = entry->phar; @@ -947,11 +916,9 @@ zend_result phar_open_entry_fp(phar_entry_info *entry, char **error, bool follow /** * helper function to open an internal file's fp just-in-time */ -phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL phar_entry_info * phar_open_jit(const phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */ { - if (error) { - *error = NULL; - } + *error = NULL; /* seek to start of internal file and read it */ if (FAILURE == phar_open_entry_fp(entry, error, true)) { return NULL; @@ -1540,7 +1507,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s #ifndef PHAR_HAVE_OPENSSL if (!zend_hash_str_exists(&module_registry, "openssl", sizeof("openssl")-1)) { if (error) { - spprintf(error, 0, "openssl not loaded"); + *error = estrdup("openssl not loaded"); } return FAILURE; } @@ -1555,7 +1522,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s php_stream_close(pfp); } if (error) { - spprintf(error, 0, "openssl public key could not be read"); + *error = estrdup("openssl public key could not be read"); } return FAILURE; } @@ -1568,7 +1535,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s zend_string_release_ex(pubkey, 0); if (error) { - spprintf(error, 0, "openssl signature could not be verified"); + *error = estrdup("openssl signature could not be verified"); } return FAILURE; @@ -1583,7 +1550,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (NULL == in) { zend_string_release_ex(pubkey, 0); if (error) { - spprintf(error, 0, "openssl signature could not be processed"); + *error = estrdup("openssl signature could not be processed"); } return FAILURE; } @@ -1594,7 +1561,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (NULL == key) { if (error) { - spprintf(error, 0, "openssl signature could not be processed"); + *error = estrdup("openssl signature could not be processed"); } return FAILURE; } @@ -1605,7 +1572,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s EVP_MD_CTX_destroy(md_ctx); } if (error) { - spprintf(error, 0, "openssl signature could not be verified"); + *error = estrdup("openssl signature could not be verified"); } return FAILURE; } @@ -1637,7 +1604,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s EVP_MD_CTX_destroy(md_ctx); if (error) { - spprintf(error, 0, "broken openssl signature"); + *error = estrdup("broken openssl signature"); } return FAILURE; @@ -1656,7 +1623,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (sig_len < sizeof(digest)) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken openssl signature"); } return FAILURE; } @@ -1682,7 +1649,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (memcmp(digest, sig, sizeof(digest))) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken openssl signature"); } return FAILURE; } @@ -1696,7 +1663,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (sig_len < sizeof(digest)) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken openssl signature"); } return FAILURE; } @@ -1722,7 +1689,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (memcmp(digest, sig, sizeof(digest))) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken signature"); } return FAILURE; } @@ -1736,7 +1703,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (sig_len < sizeof(digest)) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken signature"); } return FAILURE; } @@ -1762,7 +1729,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (memcmp(digest, sig, sizeof(digest))) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken signature"); } return FAILURE; } @@ -1776,7 +1743,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (sig_len < sizeof(digest)) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken signature"); } return FAILURE; } @@ -1802,7 +1769,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (memcmp(digest, sig, sizeof(digest))) { if (error) { - spprintf(error, 0, "broken signature"); + *error = estrdup("broken signature"); } return FAILURE; } @@ -1812,7 +1779,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s } default: if (error) { - spprintf(error, 0, "broken or unsupported signature"); + *error = estrdup("broken or unsupported signature"); } return FAILURE; } @@ -1820,7 +1787,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s } /* }}} */ -zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error) /* {{{ */ { unsigned char buf[1024]; size_t sig_len; @@ -1888,9 +1855,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char in = BIO_new_mem_buf(PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len)); if (in == NULL) { - if (error) { - spprintf(error, 0, "unable to write to phar \"%s\" with requested openssl signature", phar->fname); - } + spprintf(error, 0, "unable to write to phar \"%s\" with requested openssl signature", phar->fname); return FAILURE; } @@ -1898,18 +1863,14 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char BIO_free(in); if (!key) { - if (error) { - spprintf(error, 0, "unable to process private key"); - } + *error = estrdup("unable to process private key"); return FAILURE; } md_ctx = EVP_MD_CTX_create(); if (md_ctx == NULL) { EVP_PKEY_free(key); - if (error) { - spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); return FAILURE; } @@ -1920,9 +1881,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char EVP_PKEY_free(key); EVP_MD_CTX_free(md_ctx); efree(sigbuf); - if (error) { - spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); return FAILURE; } @@ -1931,9 +1890,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char EVP_PKEY_free(key); EVP_MD_CTX_free(md_ctx); efree(sigbuf); - if (error) { - spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); return FAILURE; } } @@ -1942,9 +1899,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char EVP_PKEY_free(key); EVP_MD_CTX_free(md_ctx); efree(sigbuf); - if (error) { - spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); - } + spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); return FAILURE; } @@ -1958,9 +1913,7 @@ zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char php_stream_seek(fp, 0, SEEK_END); if (FAILURE == phar_call_openssl_signverify(true, fp, php_stream_tell(fp), PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len), (char **)&sigbuf, &siglen, phar->sig_flags)) { - if (error) { - spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); - } + spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); return FAILURE; } #endif diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 4949750e28706..e8ffecec57147 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -798,7 +798,7 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch /** * Create or open a zip-based phar for writing */ -zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */ { phar_archive_data *phar; zend_result ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error); @@ -807,9 +807,7 @@ zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, return FAILURE; } - if (pphar) { - *pphar = phar; - } + *pphar = phar; phar->is_data = is_data; @@ -824,9 +822,7 @@ zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, } /* we've reached here - the phar exists and is a regular phar */ - if (error) { - spprintf(error, 4096, "phar zip error: phar \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar", fname); - } + spprintf(error, 4096, "phar zip error: phar \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar", fname); return FAILURE; } @@ -1178,11 +1174,11 @@ static zend_result phar_zip_applysignature(phar_archive_data *phar, struct _phar php_stream_write(newfile, ZSTR_VAL(phar->metadata_tracker.str), ZSTR_LEN(phar->metadata_tracker.str)); } - if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error)) { - if (pass->error) { - char *save = *(pass->error); - spprintf(pass->error, 0, "phar error: unable to write signature to zip-based phar: %s", save); - efree(save); + char *signature_error = NULL; + if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, &signature_error)) { + if (signature_error) { + spprintf(pass->error, 0, "phar error: unable to write signature to zip-based phar: %s", signature_error); + efree(signature_error); } php_stream_close(newfile); @@ -1231,7 +1227,7 @@ static zend_result phar_zip_applysignature(phar_archive_data *phar, struct _phar } /* }}} */ -void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error) /* {{{ */ { static const char newstub[] = "is_persistent) { - if (error) { - spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname); return; } @@ -1267,13 +1258,11 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (!phar->is_temporary_alias && phar->alias_len) { entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { - if (error) { - spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); return; } @@ -1297,9 +1286,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def char *pos = php_stristr(ZSTR_VAL(user_stub), halt_stub, ZSTR_LEN(user_stub), strlen(halt_stub)); if (pos == NULL) { - if (error) { - spprintf(error, 0, "illegal stub for zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "illegal stub for zip-based phar \"%s\"", phar->fname); return; } @@ -1309,7 +1296,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } entry.uncompressed_filesize = len + end_sequence_len; @@ -1318,9 +1305,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def len != php_stream_write(entry.fp, ZSTR_VAL(user_stub), len) || end_sequence_len != php_stream_write(entry.fp, end_sequence, end_sequence_len) ) { - if (error) { - spprintf(error, 0, "unable to create stub from string in new zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to create stub from string in new zip-based phar \"%s\"", phar->fname); php_stream_close(entry.fp); return; } @@ -1332,14 +1317,12 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); + *error = estrdup("phar error: unable to create temporary file"); return; } if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); - if (error) { - spprintf(error, 0, "unable to %s stub in%szip-based phar \"%s\", failed", user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname); - } + spprintf(error, 0, "unable to %s stub in%szip-based phar \"%s\", failed", user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname); return; } @@ -1351,9 +1334,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (NULL == zend_hash_add_mem(&phar->manifest, entry.filename, &entry, sizeof(phar_entry_info))) { php_stream_close(entry.fp); zend_string_efree(entry.filename); - if (error) { - spprintf(error, 0, "unable to create stub in zip-based phar \"%s\"", phar->fname); - } + spprintf(error, 0, "unable to create stub in zip-based phar \"%s\"", phar->fname); return; } } else { @@ -1375,6 +1356,9 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def } /* save modified files to the zip */ + char *pass_error = NULL; + struct _phar_zip_pass pass; + pass.error = &pass_error; pass.old = oldfile; pass.filefp = php_stream_fopen_tmpfile(); @@ -1383,9 +1367,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def if (must_close_old_file) { php_stream_close(oldfile); } - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to open temporary file", phar->fname); - } + spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to open temporary file", phar->fname); return; } @@ -1413,13 +1395,11 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass); phar_metadata_tracker_try_ensure_has_serialized_data(&phar->metadata_tracker, phar->is_persistent); - if (temperr) { -temperror: - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: %s", phar->fname, temperr); - } - efree(temperr); -notemperror: + if (pass_error) { +has_pass_error: + spprintf(error, 4096, "phar zip flush of \"%s\" failed: %s", phar->fname, pass_error); + efree(pass_error); +nopasserror: php_stream_close(pass.centralfp); nocentralerror: php_stream_close(pass.filefp); @@ -1430,7 +1410,8 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def } if (FAILURE == phar_zip_applysignature(phar, &pass)) { - goto temperror; + ZEND_ASSERT(pass_error != NULL); + goto has_pass_error; } /* save zip */ @@ -1444,10 +1425,8 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def size_t clen; zend_result ret = php_stream_copy_to_stream_ex(pass.centralfp, pass.filefp, PHP_STREAM_COPY_ALL, &clen); if (SUCCESS != ret || clen != cdir_size) { - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write central-directory", phar->fname); - } - goto notemperror; + spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write central-directory", phar->fname); + goto nopasserror; } } @@ -1459,23 +1438,17 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def PHAR_SET_16(eocd.comment_len, ZSTR_LEN(phar->metadata_tracker.str)); if (sizeof(eocd) != php_stream_write(pass.filefp, (char *)&eocd, sizeof(eocd))) { - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname); - } + spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname); goto nocentralerror; } if (ZSTR_LEN(phar->metadata_tracker.str) != php_stream_write(pass.filefp, ZSTR_VAL(phar->metadata_tracker.str), ZSTR_LEN(phar->metadata_tracker.str))) { - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write metadata to zip comment", phar->fname); - } + spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write metadata to zip comment", phar->fname); goto nocentralerror; } } else { if (sizeof(eocd) != php_stream_write(pass.filefp, (char *)&eocd, sizeof(eocd))) { - if (error) { - spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname); - } + spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname); goto nocentralerror; } } @@ -1504,9 +1477,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def php_stream_close(oldfile); } phar->fp = pass.filefp; - if (error) { - spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname); - } + spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname); return; } php_stream_rewind(pass.filefp); From 6ac29ec0742bdae3f864301db318a89553fa6ed0 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 00:40:42 +0100 Subject: [PATCH 227/386] ext/phar: remove unused parameters for phar_do_403() --- ext/phar/phar_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 8a7cf236b0973..3dc8b40a32c6a 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -311,7 +311,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char } /* }}} */ -static void phar_do_403(char *entry, size_t entry_len) /* {{{ */ +static void phar_do_403(void) /* {{{ */ { sapi_header_line ctr = {0}; @@ -723,7 +723,7 @@ PHP_METHOD(Phar, webPhar) break; case IS_TRUE: case IS_FALSE: - phar_do_403(entry, entry_len); + phar_do_403(); if (free_pathinfo) { efree(path_info); From c0856bc729ffef65a437eef4149465d0e795f662 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 15 Oct 2025 23:31:27 +0100 Subject: [PATCH 228/386] ext/phar: remove unused parameters for phar_do_404() --- ext/phar/phar_object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 3dc8b40a32c6a..73e0daf1ccae8 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -325,7 +325,7 @@ static void phar_do_403(void) /* {{{ */ } /* }}} */ -static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len) /* {{{ */ +static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, char *f404, size_t f404_len) /* {{{ */ { sapi_header_line ctr = {0}; phar_entry_info *info; @@ -769,7 +769,7 @@ PHP_METHOD(Phar, webPhar) if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); + phar_do_404(phar, fname, fname_len, f404, f404_len); if (free_pathinfo) { efree(path_info); @@ -815,7 +815,7 @@ PHP_METHOD(Phar, webPhar) if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); + phar_do_404(phar, fname, fname_len, f404, f404_len); zend_bailout(); } From d7eef8c4305219f7e2a23dea0bd7ca1702609ff2 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 00:42:35 +0100 Subject: [PATCH 229/386] ext/phar: use zend_string for f404 param of phar_do_404() --- ext/phar/phar_object.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 73e0daf1ccae8..e4edfee5a68b7 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -325,16 +325,16 @@ static void phar_do_403(void) /* {{{ */ } /* }}} */ -static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, char *f404, size_t f404_len) /* {{{ */ +static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, zend_string *f404) /* {{{ */ { sapi_header_line ctr = {0}; phar_entry_info *info; - if (phar && f404_len) { - info = phar_get_entry_info(phar, f404, f404_len, NULL, true); + if (phar && f404 && ZSTR_LEN(f404)) { + info = phar_get_entry_info(phar, ZSTR_VAL(f404), ZSTR_LEN(f404), NULL, true); if (info) { - phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0); + phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, ZSTR_VAL(f404), ZSTR_LEN(f404), fname, NULL, NULL, 0); return; } } @@ -559,8 +559,9 @@ PHP_METHOD(Phar, webPhar) zval *mimeoverride = NULL; zend_fcall_info rewrite_fci = {0}; zend_fcall_info_cache rewrite_fcc; - char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL; - size_t alias_len = 0, f404_len = 0, free_pathinfo = 0; + char *alias = NULL, *error, *index_php = NULL, *ru = NULL; + size_t alias_len = 0, free_pathinfo = 0; + zend_string *f404 = NULL; size_t ru_len = 0; char *fname, *path_info, *mime_type = NULL, *entry, *pt; const char *basename; @@ -571,7 +572,7 @@ PHP_METHOD(Phar, webPhar) phar_entry_info *info = NULL; size_t sapi_mod_name_len = strlen(sapi_module.name); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!af!", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!S!af!", &alias, &alias_len, &index_php, &index_php_len, &f404, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) { RETURN_THROWS(); } @@ -769,7 +770,7 @@ PHP_METHOD(Phar, webPhar) if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len); + phar_do_404(phar, fname, fname_len, f404); if (free_pathinfo) { efree(path_info); @@ -815,7 +816,7 @@ PHP_METHOD(Phar, webPhar) if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len); + phar_do_404(phar, fname, fname_len, f404); zend_bailout(); } From 8fa09cd252cfe63f045c0876fd63e8c4b0d023cd Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 15 Oct 2025 23:37:41 +0100 Subject: [PATCH 230/386] ext/phar: Use RETURN_BOOL() when possible --- ext/phar/phar_object.c | 44 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index e4edfee5a68b7..171015582796d 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1030,23 +1030,11 @@ PHP_METHOD(Phar, canCompress) phar_request_initialize(); switch (method) { case PHAR_ENT_COMPRESSED_GZ: - if (PHAR_G(has_zlib)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(PHAR_G(has_zlib)); case PHAR_ENT_COMPRESSED_BZ2: - if (PHAR_G(has_bz2)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(PHAR_G(has_bz2)); default: - if (PHAR_G(has_zlib) || PHAR_G(has_bz2)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(PHAR_G(has_zlib) || PHAR_G(has_bz2)); } } /* }}} */ @@ -2577,11 +2565,8 @@ PHP_METHOD(Phar, isWritable) } if (SUCCESS != php_stream_stat_path(phar_obj->archive->fname, &ssb)) { - if (phar_obj->archive->is_brandnew) { - /* assume it works if the file doesn't exist yet */ - RETURN_TRUE; - } - RETURN_FALSE; + /* assume it works if the file doesn't exist yet */ + RETURN_BOOL(phar_obj->archive->is_brandnew); } RETURN_BOOL((ssb.sb.st_mode & (S_IWOTH | S_IWGRP | S_IWUSR)) != 0); @@ -3503,7 +3488,6 @@ PHP_METHOD(Phar, copy) PHP_METHOD(Phar, offsetExists) { zend_string *file_name; - phar_entry_info *entry; if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &file_name) == FAILURE) { RETURN_THROWS(); @@ -3511,19 +3495,15 @@ PHP_METHOD(Phar, offsetExists) PHAR_ARCHIVE_OBJECT(); - if (zend_hash_exists(&phar_obj->archive->manifest, file_name)) { - if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { - if (entry->is_deleted) { - /* entry is deleted, but has not been flushed to disk yet */ - RETURN_FALSE; - } - } - - if (zend_string_starts_with_literal(file_name, ".phar")) { - /* none of these are real files, so they don't exist */ + const phar_entry_info *entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name); + if (entry != NULL) { + if (entry->is_deleted) { + /* entry is deleted, but has not been flushed to disk yet */ RETURN_FALSE; } - RETURN_TRUE; + + /* none of these are real files, so they don't exist */ + RETURN_BOOL(!zend_string_starts_with_literal(file_name, ".phar")); } else { /* If the info class is not based on PharFileInfo, directories are not directly instantiable */ if (UNEXPECTED(!instanceof_function(phar_obj->spl.info_class, phar_ce_entry))) { From 44a863a805819c4bf2f9fbd0b17051f5b11f4789 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 00:03:28 +0100 Subject: [PATCH 231/386] ext/phar: Do not aquire lifetime of basename parameter in phar_file_action() This is incredibly confusing. --- ext/phar/phar_object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 171015582796d..6741ca40f5667 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -168,7 +168,6 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char switch (code) { case PHAR_MIME_PHPS: - efree(basename); /* highlight source */ if (entry[0] == '/') { spprintf(&name, 4096, "phar://%s%s", arch, entry); @@ -186,7 +185,6 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char zend_bailout(); case PHAR_MIME_OTHER: /* send headers, output file contents */ - efree(basename); ctr.line_len = spprintf((char **) &(ctr.line), 0, "Content-type: %s", mime_type); sapi_header_op(SAPI_HEADER_REPLACE, &ctr); efree((void *) ctr.line); @@ -230,7 +228,6 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char case PHAR_MIME_PHP: if (basename) { phar_mung_server_vars(arch, entry, entry_len, basename, ru_len); - efree(basename); } if (entry[0] == '/') { @@ -870,6 +867,7 @@ PHP_METHOD(Phar, webPhar) code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type); } phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len); + efree(pt); finish: ; #ifdef PHP_WIN32 From 0b37777592f20f42522e94335d2ef778005ec07a Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 00:10:57 +0100 Subject: [PATCH 232/386] ext/phar/phar_object.c: add some const qualifiers --- ext/phar/phar_object.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 6741ca40f5667..e1c18cd4bac63 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -45,7 +45,7 @@ static zend_class_entry *phar_ce_entry; RETURN_THROWS(); \ } -static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ */ +static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */ { char *ext; phar_mime_type *mime; @@ -65,7 +65,7 @@ static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ } /* }}} */ -static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, char *basename, size_t request_uri_len) /* {{{ */ +static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, const char *basename, size_t request_uri_len) /* {{{ */ { HashTable *_SERVER; zval *stuff; @@ -151,7 +151,7 @@ static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, ch } /* }}} */ -static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, size_t entry_len, char *arch, char *basename, char *ru, size_t ru_len) /* {{{ */ +static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, size_t entry_len, char *arch, const char *basename, char *ru, size_t ru_len) /* {{{ */ { char *name = NULL, buf[8192]; const char *cwd; @@ -349,7 +349,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, /* post-process REQUEST_URI and retrieve the actual request URI. This is for cases like http://localhost/blah.phar/path/to/file.php/extra/stuff which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */ -static void phar_postprocess_ru_web(char *fname, size_t fname_len, char **entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ +static void phar_postprocess_ru_web(const char *fname, size_t fname_len, char **entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ { char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL; size_t e_len = *entry_len - 1, u_len = 0; @@ -627,7 +627,7 @@ PHP_METHOD(Phar, webPhar) || (sapi_mod_name_len == sizeof("litespeed") - 1 && !strncmp(sapi_module.name, "litespeed", sizeof("litespeed") - 1))) { if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF) { - HashTable *_server = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]); + const HashTable *_server = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]); zval *z_script_name, *z_path_info; if (NULL == (z_script_name = zend_hash_str_find(_server, "SCRIPT_NAME", sizeof("SCRIPT_NAME")-1)) || @@ -3114,7 +3114,7 @@ static int phar_set_compression(zval *zv, void *argument) /* {{{ */ static int phar_test_compression(zval *zv, void *argument) /* {{{ */ { - phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv); + const phar_entry_info *entry = Z_PTR_P(zv); if (entry->is_deleted) { return ZEND_HASH_APPLY_KEEP; From 3828b2426be742f5cc80512af26b5c15806f4122 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 00:56:10 +0100 Subject: [PATCH 233/386] ext/phar: Refactor phar_create_default_stub() --- ext/phar/phar.c | 50 ++++++++++++++++++++++------------------ ext/phar/phar_internal.h | 2 +- ext/phar/phar_object.c | 12 +++++----- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index cec38aa33533e..f31a4f841225f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2453,42 +2453,48 @@ static int phar_flush_clean_deleted_apply(zval *zv) /* {{{ */ #include "stub.h" /* Generated phar_get_stub() function from makestub.php script */ -zend_string *phar_create_default_stub(const char *index_php, const char *web_index, char **error) /* {{{ */ +zend_string *phar_create_default_stub(const zend_string *php_index_str, const zend_string *web_index_str, char **error) /* {{{ */ { - size_t index_len, web_len; + const char *php_index; + const char *web_index; + size_t php_len, web_len; if (error) { *error = NULL; } - if (!index_php) { - index_php = "index.php"; - } - - if (!web_index) { - web_index = "index.php"; - } - - index_len = strlen(index_php); - web_len = strlen(web_index); - - if (index_len > 400) { - /* ridiculous size not allowed for index.php startup filename */ - if (error) { - spprintf(error, 0, "Illegal filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", index_len); + if (!php_index_str) { + php_index = "index.php"; + php_len = strlen("index.php"); + } else { + php_index = ZSTR_VAL(php_index_str); + php_len = ZSTR_LEN(php_index_str); + if (php_len > 400) { + /* ridiculous size not allowed for index.php startup filename */ + if (error) { + spprintf(error, 0, "Illegal filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", php_len); + } return NULL; } } - if (web_len > 400) { - /* ridiculous size not allowed for index.php startup filename */ - if (error) { - spprintf(error, 0, "Illegal web filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", web_len); + if (!web_index_str) { + web_index = "index.php"; + web_len = strlen("index.php"); + } else { + web_index = ZSTR_VAL(web_index_str); + web_len = ZSTR_LEN(web_index_str); + + if (web_len > 400) { + /* ridiculous size not allowed for index.php startup filename */ + if (error) { + spprintf(error, 0, "Illegal web filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", web_len); + } return NULL; } } - return phar_get_stub(index_php, web_index, index_len+1, web_len+1); + return phar_get_stub(php_index, web_index, php_len+1, web_len+1); } /* }}} */ diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 232ba579d7f0b..bd3d7158c8e82 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -415,7 +415,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s ZEND_ATTRIBUTE_NONNULL zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error); /* utility functions */ -zend_string *phar_create_default_stub(const char *index_php, const char *web_index, char **error); +zend_string *phar_create_default_stub(const zend_string *php_index_str, const zend_string *web_index_str, char **error); const char *phar_decompress_filter(const phar_entry_info *entry, bool return_unknown); const char *phar_compress_filter(const phar_entry_info *entry, bool return_unknown); diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index e1c18cd4bac63..58c6140451880 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -946,11 +946,11 @@ PHP_METHOD(Phar, interceptFileFuncs) */ PHP_METHOD(Phar, createDefaultStub) { - char *index = NULL, *webindex = NULL, *error; + zend_string *index = NULL, *webindex = NULL; + char *error; zend_string *stub; - size_t index_len = 0, webindex_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p!p!", &index, &index_len, &webindex, &webindex_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|P!P!", &index, &webindex) == FAILURE) { RETURN_THROWS(); } @@ -2914,12 +2914,11 @@ PHP_METHOD(Phar, setStub) */ PHP_METHOD(Phar, setDefaultStub) { - char *index = NULL, *webindex = NULL, *error = NULL; + zend_string *index = NULL, *webindex = NULL; zend_string *stub = NULL; - size_t index_len = 0, webindex_len = 0; bool created_stub = false; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!", &index, &index_len, &webindex, &webindex_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|P!P!", &index, &webindex) == FAILURE) { RETURN_THROWS(); } @@ -2947,6 +2946,7 @@ PHP_METHOD(Phar, setDefaultStub) RETURN_THROWS(); } + char *error = NULL; if (!phar_obj->archive->is_tar && !phar_obj->archive->is_zip) { stub = phar_create_default_stub(index, webindex, &error); From ad9c60f995c3f9ff088398d73971c39a926022f8 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Oct 2025 01:33:09 +0100 Subject: [PATCH 234/386] ext/phar: start refactoring phar_postprocess_ru_web() --- ext/phar/phar_object.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 58c6140451880..6981d7c026d13 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -349,9 +349,10 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, /* post-process REQUEST_URI and retrieve the actual request URI. This is for cases like http://localhost/blah.phar/path/to/file.php/extra/stuff which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */ -static void phar_postprocess_ru_web(const char *fname, size_t fname_len, char **entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ +static void phar_postprocess_ru_web(const char *fname, size_t fname_len, const char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ { - char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL; + const char *e = entry + 1; + char *u = NULL, *u1 = NULL, *saveu = NULL; size_t e_len = *entry_len - 1, u_len = 0; phar_archive_data *pphar; @@ -746,7 +747,7 @@ PHP_METHOD(Phar, webPhar) } if (entry_len) { - phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len); + phar_postprocess_ru_web(fname, fname_len, entry, &entry_len, &ru, &ru_len); } if (!entry_len || (entry_len == 1 && entry[0] == '/')) { From fbac7a366fc9607e715b53b37bf9287278d79612 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 16 Oct 2025 23:01:41 +0200 Subject: [PATCH 235/386] phar: Get rid of bailouts in Phar::webPhar() (#20190) Bailouts are bad because they stop the GC etc. They also hide leaks. This makes the behaviour equivalent to exit(), as it's meant to stop the request (which is why bailout was used). We also have to fix some leaks that pop up then. --- ext/phar/phar_object.c | 45 +++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 6981d7c026d13..6238e51c7d5cb 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -699,6 +699,7 @@ PHP_METHOD(Phar, webPhar) zval params, retval; ZVAL_STRINGL(¶ms, entry, entry_len); + efree(entry); rewrite_fci.param_count = 1; rewrite_fci.params = ¶ms; @@ -716,9 +717,10 @@ PHP_METHOD(Phar, webPhar) switch (Z_TYPE(retval)) { case IS_STRING: - efree(entry); + /* TODO: avoid relocation??? */ entry = estrndup(Z_STRVAL_P(rewrite_fci.retval), Z_STRLEN_P(rewrite_fci.retval)); entry_len = Z_STRLEN_P(rewrite_fci.retval); + zval_ptr_dtor_str(&retval); break; case IS_TRUE: case IS_FALSE: @@ -729,15 +731,16 @@ PHP_METHOD(Phar, webPhar) } efree(pt); - zend_bailout(); + zend_throw_unwind_exit(); + return; default: + zval_ptr_dtor(&retval); zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false"); cleanup_fail: if (free_pathinfo) { efree(path_info); } - efree(entry); efree(pt); #ifdef PHP_WIN32 efree(fname); @@ -752,6 +755,10 @@ PHP_METHOD(Phar, webPhar) if (!entry_len || (entry_len == 1 && entry[0] == '/')) { efree(entry); + efree(pt); + + bool is_entry_allocated = false; + /* direct request */ if (index_php_len) { entry = index_php; @@ -759,22 +766,17 @@ PHP_METHOD(Phar, webPhar) if (entry[0] != '/') { spprintf(&entry, 0, "/%s", index_php); ++entry_len; + is_entry_allocated = true; } } else { /* assume "index.php" is starting point */ - entry = estrndup("/index.php", sizeof("/index.php")); + entry = "/index.php"; entry_len = sizeof("/index.php")-1; } if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { phar_do_404(phar, fname, fname_len, f404); - - if (free_pathinfo) { - efree(path_info); - } - - zend_bailout(); } else { char *tmp = NULL, sa = '\0'; sapi_header_line ctr = {0}; @@ -801,21 +803,32 @@ PHP_METHOD(Phar, webPhar) *tmp = sa; } - if (free_pathinfo) { - efree(path_info); - } - sapi_header_op(SAPI_HEADER_REPLACE, &ctr); sapi_send_headers(); efree((void *) ctr.line); - zend_bailout(); } + + if (is_entry_allocated) { + efree(entry); + } + if (free_pathinfo) { + efree(path_info); + } + + zend_throw_unwind_exit(); + return; } if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { + efree(entry); + efree(pt); + if (free_pathinfo) { + efree(path_info); + } phar_do_404(phar, fname, fname_len, f404); - zend_bailout(); + zend_throw_unwind_exit(); + return; } if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) { From 0ed7424a33117ead273006f1a105bf7c7f421d3e Mon Sep 17 00:00:00 2001 From: Bogdan Ungureanu Date: Fri, 17 Oct 2025 07:55:29 +0300 Subject: [PATCH 236/386] ext/intl: Fix build failure on ICU 62 caused by dateformat (#20198) --- ext/intl/dateformat/dateformat_format.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/intl/dateformat/dateformat_format.cpp b/ext/intl/dateformat/dateformat_format.cpp index 4e9531a86ce54..72fbd5f34ae7f 100644 --- a/ext/intl/dateformat/dateformat_format.cpp +++ b/ext/intl/dateformat/dateformat_format.cpp @@ -16,14 +16,14 @@ #include #endif +#include +#include + extern "C" { #include "../php_intl.h" #include "../intl_convert.h" } -#include -#include - #include "../common/common_date.h" #include "dateformat.h" #include "dateformat_class.h" From ade8e2d8cde8ffa6637aebc506d5523606613aaa Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 17 Oct 2025 08:09:42 +0200 Subject: [PATCH 237/386] phar: Drop buggy redundant Windows-only check (#20195) If the path contains '\' the path is duplicated and unixified. In practice this is always true. And if it were not, we'd get a heap corruption as the cleanup code assumes it is. --- ext/phar/phar_object.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 6238e51c7d5cb..adec611266976 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -609,10 +609,8 @@ PHP_METHOD(Phar, webPhar) fname_len = ZSTR_LEN(zend_file_name); #ifdef PHP_WIN32 - if (memchr(fname, '\\', fname_len)) { - fname = estrndup(fname, fname_len); - phar_unixify_path_separators(fname, fname_len); - } + fname = estrndup(fname, fname_len); + phar_unixify_path_separators(fname, fname_len); #endif basename = zend_memrchr(fname, '/', fname_len); From 3ee2f442d2052d2bba226ce93632daa950cc0955 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 17 Oct 2025 08:12:25 +0200 Subject: [PATCH 238/386] phar: Get rid of last bailouts in phar_file_action() (#20193) * phar: Get rid of last bailouts in phar_file_action() Follow-up on GH-20190. * [ci skip] Drop wrong comment --- ext/phar/phar_object.c | 102 ++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 63 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index adec611266976..31b9261ba1375 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -151,7 +151,12 @@ static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, co } /* }}} */ -static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, size_t entry_len, char *arch, const char *basename, char *ru, size_t ru_len) /* {{{ */ +typedef enum { + PHAR_ACT_DO_EXIT, + PHAR_ACT_GRACEFULLY_RETURN, +} phar_action_status; + +static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, size_t entry_len, char *arch, const char *basename, char *ru, size_t ru_len) /* {{{ */ { char *name = NULL, buf[8192]; const char *cwd; @@ -182,7 +187,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char #ifdef PHP_WIN32 efree(arch); #endif - zend_bailout(); + return PHAR_ACT_DO_EXIT; case PHAR_MIME_OTHER: /* send headers, output file contents */ ctr.line_len = spprintf((char **) &(ctr.line), 0, "Content-type: %s", mime_type); @@ -193,7 +198,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char efree((void *) ctr.line); if (FAILURE == sapi_send_headers()) { - zend_bailout(); + return PHAR_ACT_DO_EXIT; } /* prepare to output */ @@ -206,7 +211,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); efree(error); } - return -1; + return PHAR_ACT_GRACEFULLY_RETURN; } fp = phar_get_efp(info, true); } @@ -224,7 +229,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char } } while (1); - zend_bailout(); + return PHAR_ACT_DO_EXIT; case PHAR_MIME_PHP: if (basename) { phar_mung_server_vars(arch, entry, entry_len, basename, ru_len); @@ -299,12 +304,11 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char efree(name); } zend_end_try(); - zend_bailout(); + return PHAR_ACT_DO_EXIT; } - - return PHAR_MIME_PHP; } - return -1; + + return PHAR_ACT_GRACEFULLY_RETURN; } /* }}} */ @@ -331,6 +335,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, info = phar_get_entry_info(phar, ZSTR_VAL(f404), ZSTR_LEN(f404), NULL, true); if (info) { + /* Status doesn't matter, we're exiting anyway. */ phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, ZSTR_VAL(f404), ZSTR_LEN(f404), fname, NULL, NULL, 0); return; } @@ -569,6 +574,7 @@ PHP_METHOD(Phar, webPhar) phar_archive_data *phar = NULL; phar_entry_info *info = NULL; size_t sapi_mod_name_len = strlen(sapi_module.name); + phar_action_status status = PHAR_ACT_DO_EXIT; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!S!af!", &alias, &alias_len, &index_php, &index_php_len, &f404, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) { RETURN_THROWS(); @@ -652,9 +658,7 @@ PHP_METHOD(Phar, webPhar) pt = estrndup(Z_STRVAL_P(z_script_name), Z_STRLEN_P(z_script_name)); } else { - char *testit; - - testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1); + char *testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1); if (!(pt = strstr(testit, basename))) { efree(testit); goto finish; @@ -675,6 +679,7 @@ PHP_METHOD(Phar, webPhar) } pt = estrndup(testit, (pt - testit) + (fname_len - (basename - fname))); + efree(testit); } not_cgi = 0; } else { @@ -708,7 +713,7 @@ PHP_METHOD(Phar, webPhar) if (!EG(exception)) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback"); } - goto cleanup_fail; + goto cleanup_skip_entry; } zval_ptr_dtor_str(¶ms); @@ -723,27 +728,11 @@ PHP_METHOD(Phar, webPhar) case IS_TRUE: case IS_FALSE: phar_do_403(); - - if (free_pathinfo) { - efree(path_info); - } - efree(pt); - - zend_throw_unwind_exit(); - return; + goto cleanup_skip_entry; default: zval_ptr_dtor(&retval); zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false"); - -cleanup_fail: - if (free_pathinfo) { - efree(path_info); - } - efree(pt); -#ifdef PHP_WIN32 - efree(fname); -#endif - RETURN_THROWS(); + goto cleanup_skip_entry; } } @@ -753,7 +742,6 @@ PHP_METHOD(Phar, webPhar) if (!entry_len || (entry_len == 1 && entry[0] == '/')) { efree(entry); - efree(pt); bool is_entry_allocated = false; @@ -809,24 +797,14 @@ PHP_METHOD(Phar, webPhar) if (is_entry_allocated) { efree(entry); } - if (free_pathinfo) { - efree(path_info); - } - zend_throw_unwind_exit(); - return; + goto cleanup_skip_entry; } if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, false)) == NULL) { - efree(entry); - efree(pt); - if (free_pathinfo) { - efree(path_info); - } phar_do_404(phar, fname, fname_len, f404); - zend_throw_unwind_exit(); - return; + goto cleanup; } if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) { @@ -844,15 +822,7 @@ PHP_METHOD(Phar, webPhar) code = Z_LVAL_P(val); } else { zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed"); - if (free_pathinfo) { - efree(path_info); - } - efree(pt); - efree(entry); -#ifdef PHP_WIN32 - efree(fname); -#endif - RETURN_THROWS(); + goto cleanup; } break; case IS_STRING: @@ -861,15 +831,7 @@ PHP_METHOD(Phar, webPhar) break; default: zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed"); - if (free_pathinfo) { - efree(path_info); - } - efree(pt); - efree(entry); -#ifdef PHP_WIN32 - efree(fname); -#endif - RETURN_THROWS(); + goto cleanup; } } } @@ -878,8 +840,22 @@ PHP_METHOD(Phar, webPhar) if (!mime_type) { code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type); } - phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len); + status = phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len); + +cleanup: + efree(entry); +cleanup_skip_entry: + if (free_pathinfo) { + efree(path_info); + } efree(pt); + efree(ru); + + if (status == PHAR_ACT_DO_EXIT) { + if (!EG(exception)) { + zend_throw_unwind_exit(); + } + } finish: ; #ifdef PHP_WIN32 From 26c96d38f440a5b6476a97527e1748f9bf187541 Mon Sep 17 00:00:00 2001 From: Florian Engelhardt Date: Mon, 1 Sep 2025 13:15:35 +0200 Subject: [PATCH 239/386] re-use `sprintf()` optimisation for `printf()` Closes GH-19658 --- UPGRADING | 5 +++++ Zend/Optimizer/dce.c | 7 ++++-- Zend/Optimizer/pass1.c | 10 +++++++++ Zend/zend_compile.c | 50 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/UPGRADING b/UPGRADING index 4b166bb5af463..765b8c36a4ac8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -99,5 +99,10 @@ PHP 8.6 UPGRADE NOTES 14. Performance Improvements ======================================== +- Core: + . `printf()` using only `%s` and `%d` will be compiled into the equivalent + string interpolation, avoiding the overhead of a function call and repeatedly + parsing the format string. + - JSON: . Improve performance of encoding arrays and objects. diff --git a/Zend/Optimizer/dce.c b/Zend/Optimizer/dce.c index 7993778a1257d..41fd0f6c30af4 100644 --- a/Zend/Optimizer/dce.c +++ b/Zend/Optimizer/dce.c @@ -124,6 +124,7 @@ static inline bool may_have_side_effects( case ZEND_FUNC_NUM_ARGS: case ZEND_FUNC_GET_ARGS: case ZEND_ARRAY_KEY_EXISTS: + case ZEND_COPY_TMP: /* No side effects */ return false; case ZEND_FREE: @@ -425,10 +426,12 @@ static bool dce_instr(const context *ctx, zend_op *opline, zend_ssa_op *ssa_op) return false; } - if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) { + if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !is_var_dead(ctx, ssa_op->op1_use)) { if (!try_remove_var_def(ctx, ssa_op->op1_use, ssa_op->op1_use_chain, opline)) { if (may_be_refcounted(ssa->var_info[ssa_op->op1_use].type) - && opline->opcode != ZEND_CASE && opline->opcode != ZEND_CASE_STRICT) { + && opline->opcode != ZEND_CASE + && opline->opcode != ZEND_CASE_STRICT + && opline->opcode != ZEND_COPY_TMP) { free_var = ssa_op->op1_use; free_var_type = opline->op1_type; } diff --git a/Zend/Optimizer/pass1.c b/Zend/Optimizer/pass1.c index 09a0ae5fec531..4be966c25d896 100644 --- a/Zend/Optimizer/pass1.c +++ b/Zend/Optimizer/pass1.c @@ -264,6 +264,16 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) collect_constants = false; break; } + case ZEND_DO_UCALL: + case ZEND_DO_FCALL: + case ZEND_DO_FCALL_BY_NAME: + case ZEND_FRAMELESS_ICALL_0: + case ZEND_FRAMELESS_ICALL_1: + case ZEND_FRAMELESS_ICALL_2: + case ZEND_FRAMELESS_ICALL_3: + /* don't collect constants after any UCALL/FCALL/FRAMELESS ICALL */ + collect_constants = 0; + break; case ZEND_STRLEN: if (opline->op1_type == IS_CONST && zend_optimizer_eval_strlen(&result, &ZEND_OP1_LITERAL(opline)) == SUCCESS) { diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d61c2df0a3555..b51a519533c6b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -28,6 +28,7 @@ #include "zend_API.h" #include "zend_exceptions.h" #include "zend_interfaces.h" +#include "zend_types.h" #include "zend_virtual_cwd.h" #include "zend_multibyte.h" #include "zend_language_scanner.h" @@ -4968,6 +4969,53 @@ static zend_result zend_compile_func_sprintf(znode *result, zend_ast_list *args) return SUCCESS; } +static zend_result zend_compile_func_printf(znode *result, zend_ast_list *args) /* {{{ */ +{ + /* Special case: printf with a single constant string argument and no format specifiers. + * In this case, just emit ECHO and return the string length if needed. */ + if (args->children == 1) { + zend_eval_const_expr(&args->child[0]); + if (args->child[0]->kind != ZEND_AST_ZVAL) { + return FAILURE; + } + zval *format_string = zend_ast_get_zval(args->child[0]); + if (Z_TYPE_P(format_string) != IS_STRING) { + return FAILURE; + } + /* Check if there are any format specifiers */ + if (!memchr(Z_STRVAL_P(format_string), '%', Z_STRLEN_P(format_string))) { + /* No format specifiers - just emit ECHO and return string length */ + znode format_node; + zend_compile_expr(&format_node, args->child[0]); + zend_emit_op(NULL, ZEND_ECHO, &format_node, NULL); + + /* Return the string length as a constant if the result is used */ + result->op_type = IS_CONST; + ZVAL_LONG(&result->u.constant, Z_STRLEN_P(format_string)); + return SUCCESS; + } + } + + /* Fall back to sprintf optimization for format strings with specifiers */ + znode rope_result; + if (zend_compile_func_sprintf(&rope_result, args) != SUCCESS) { + return FAILURE; + } + + /* printf() returns the amount of bytes written, so just an ECHO of the + * resulting sprintf() optimisation might not be enough. At this early + * stage we can't detect if the result is actually used, so we just emit + * the opcodes and let them be cleaned up by the dead code elimination + * pass in the Zend Optimizer if the result of the printf() is in fact + * unused */ + znode copy; + zend_emit_op_tmp(©, ZEND_COPY_TMP, &rope_result, NULL); + zend_emit_op(NULL, ZEND_ECHO, &rope_result, NULL); + zend_emit_op_tmp(result, ZEND_STRLEN, ©, NULL); + + return SUCCESS; +} + static zend_result zend_compile_func_clone(znode *result, zend_ast_list *args) { znode arg_node; @@ -5050,6 +5098,8 @@ static zend_result zend_try_compile_special_func_ex(znode *result, zend_string * return zend_compile_func_array_key_exists(result, args); } else if (zend_string_equals_literal(lcname, "sprintf")) { return zend_compile_func_sprintf(result, args); + } else if (zend_string_equals_literal(lcname, "printf")) { + return zend_compile_func_printf(result, args); } else if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_CLONE))) { return zend_compile_func_clone(result, args); } else { From d4f3ae90d2ef3113ec79a8533253a9a270050553 Mon Sep 17 00:00:00 2001 From: Bogdan Ungureanu Date: Fri, 17 Oct 2025 22:09:14 +0300 Subject: [PATCH 240/386] ext/intl: Do not register IntlNumberRangeFormatter on ICU 62 or lower (#20197) --- ext/intl/php_intl.c | 3 ++- ext/intl/rangeformatter/rangeformatter_class.cpp | 14 +------------- ext/intl/rangeformatter/rangeformatter_class.h | 6 ------ .../rangeformatter_icu63_compatibility.phpt | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index cb43e22fc45c4..00001e9985b7f 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -190,9 +190,10 @@ PHP_MINIT_FUNCTION( intl ) /* Register 'ListFormatter' PHP class */ listformatter_register_class( ); +#if U_ICU_VERSION_MAJOR_NUM >= 63 /* Register 'NumberRangeFormatter' PHP class */ rangeformatter_register_class( ); - +#endif /* Register 'Normalizer' PHP class */ normalizer_register_Normalizer_class( ); diff --git a/ext/intl/rangeformatter/rangeformatter_class.cpp b/ext/intl/rangeformatter/rangeformatter_class.cpp index 31f385a0a9262..2042966177cb2 100644 --- a/ext/intl/rangeformatter/rangeformatter_class.cpp +++ b/ext/intl/rangeformatter/rangeformatter_class.cpp @@ -23,7 +23,6 @@ extern "C" { #include #include #include "../intl_convertcpp.h" -#endif extern "C" { #include "../intl_error.h" @@ -34,14 +33,12 @@ extern "C" { #include "intl_convert.h" } -#if U_ICU_VERSION_MAJOR_NUM >= 63 using icu::number::NumberRangeFormatter; using icu::number::NumberFormatter; using icu::number::UnlocalizedNumberFormatter; using icu::number::LocalizedNumberRangeFormatter; using icu::UnicodeString; using icu::MeasureUnit; -#endif static zend_object_handlers rangeformatter_handlers; zend_class_entry *class_entry_IntlNumberRangeFormatter; @@ -71,10 +68,6 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, __construct) U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, createFromSkeleton) { -#if U_ICU_VERSION_MAJOR_NUM < 63 - zend_throw_error(NULL, "IntlNumberRangeFormatter is not available in ICU 62 and earlier"); - RETURN_THROWS(); -#else char* skeleton; char* locale; size_t locale_len; @@ -145,15 +138,10 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, createFromSkeleton) RANGEFORMATTER_OBJECT(php_intl_numberrangeformatter_fetch_object(obj)) = nrf; RETURN_OBJ(obj); -#endif } U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, format) { -#if U_ICU_VERSION_MAJOR_NUM < 63 - zend_throw_error(NULL, "IntlNumberRangeFormatter is not available in ICU 62 and earlier"); - RETURN_THROWS(); -#else zval *start; zval *end; @@ -191,7 +179,6 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, format) INTL_G(error_level) = old_error_level; RETVAL_NEW_STR(ret); -#endif } U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, getErrorCode) @@ -236,3 +223,4 @@ void rangeformatter_register_class(void) rangeformatter_handlers.free_obj = IntlNumberRangeFormatter_object_free; rangeformatter_handlers.clone_obj = NULL; } +#endif diff --git a/ext/intl/rangeformatter/rangeformatter_class.h b/ext/intl/rangeformatter/rangeformatter_class.h index f5018cbaf71fa..661641c2ce0f0 100644 --- a/ext/intl/rangeformatter/rangeformatter_class.h +++ b/ext/intl/rangeformatter/rangeformatter_class.h @@ -15,7 +15,6 @@ #ifndef RANGEFORMATTER_CLASS_H #define RANGEFORMATTER_CLASS_H -#if U_ICU_VERSION_MAJOR_NUM >= 63 #include #ifdef __cplusplus @@ -23,18 +22,13 @@ using icu::number::LocalizedNumberRangeFormatter; #else typedef void LocalizedNumberRangeFormatter; #endif -#endif // U_ICU_VERSION_MAJOR_NUM >= 63 typedef struct { // error handling intl_error error; // formatter handling -#if U_ICU_VERSION_MAJOR_NUM >= 63 LocalizedNumberRangeFormatter* unumrf; -#else - void* unumrf; -#endif } rangeformatter_data; typedef struct { diff --git a/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt b/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt index 0d829ad538af5..9b3867161d60b 100644 --- a/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt +++ b/ext/intl/tests/rangeformatter/rangeformatter_icu63_compatibility.phpt @@ -23,4 +23,4 @@ try { } ?> --EXPECT-- -IntlNumberRangeFormatter is not available in ICU 62 and earlier +Class "IntlNumberRangeFormatter" not found \ No newline at end of file From 560a16fa19ee040e5427b03cba7e97fab769c12d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 23:58:20 +0200 Subject: [PATCH 241/386] phar: Fix potential double free on Windows (#20211) Because the code no longer bails out, these variables shouldn't be freed here as they're already freed by the caller. This also simplifies the code. Fixes nightly. --- ext/phar/phar_object.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 31b9261ba1375..9c09417e077b4 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -184,9 +184,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i highlight_file(name, &syntax_highlighter_ini); efree(name); -#ifdef PHP_WIN32 - efree(arch); -#endif return PHAR_ACT_DO_EXIT; case PHAR_MIME_OTHER: /* send headers, output file contents */ @@ -274,9 +271,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i } zend_destroy_file_handle(&file_handle); -#ifdef PHP_WIN32 - efree(arch); -#endif if (new_op_array) { ZVAL_UNDEF(&result); From 7c9c39584c952063e5c05000cce7335a3ac65cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 19 Oct 2025 17:37:38 +0200 Subject: [PATCH 242/386] zend_inheritance: Improve formatting of return-by-ref `&` in zend_get_function_declaration() (#20104) The space after `&` made it look like the `&` was not part of the signature, possibly leading to confusion why the two signatures are incompatible without carefully reading the message. --- Zend/tests/inheritance/argument_restriction_001.phpt | 2 +- Zend/tests/objects/objects_005.phpt | 2 +- Zend/tests/property_hooks/get_by_ref_implemented_by_val.phpt | 2 +- Zend/zend_inheritance.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/tests/inheritance/argument_restriction_001.phpt b/Zend/tests/inheritance/argument_restriction_001.phpt index 2c54636a58178..6eb3ff8d27062 100644 --- a/Zend/tests/inheritance/argument_restriction_001.phpt +++ b/Zend/tests/inheritance/argument_restriction_001.phpt @@ -13,4 +13,4 @@ class Sub extends Base { } ?> --EXPECTF-- -Fatal error: Declaration of & Sub::test() must be compatible with & Base::test($foo, array $bar, $option = null, $extra = 'llllllllll...') in %s on line %d +Fatal error: Declaration of &Sub::test() must be compatible with &Base::test($foo, array $bar, $option = null, $extra = 'llllllllll...') in %s on line %d diff --git a/Zend/tests/objects/objects_005.phpt b/Zend/tests/objects/objects_005.phpt index 9b9a41465f95b..7749a39d986fb 100644 --- a/Zend/tests/objects/objects_005.phpt +++ b/Zend/tests/objects/objects_005.phpt @@ -19,4 +19,4 @@ class test3 extends test { ?> --EXPECTF-- -Fatal error: Declaration of test3::foo() must be compatible with & test::foo() in %s on line %d +Fatal error: Declaration of test3::foo() must be compatible with &test::foo() in %s on line %d diff --git a/Zend/tests/property_hooks/get_by_ref_implemented_by_val.phpt b/Zend/tests/property_hooks/get_by_ref_implemented_by_val.phpt index 84eb968263546..2c507d862be6f 100644 --- a/Zend/tests/property_hooks/get_by_ref_implemented_by_val.phpt +++ b/Zend/tests/property_hooks/get_by_ref_implemented_by_val.phpt @@ -15,4 +15,4 @@ class A implements I { ?> --EXPECTF-- -Fatal error: Declaration of A::$prop::get() must be compatible with & I::$prop::get() in %s on line %d +Fatal error: Declaration of A::$prop::get() must be compatible with &I::$prop::get() in %s on line %d diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index a2da64b62c0d5..1f128764bdd3d 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -916,7 +916,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration( smart_str str = {0}; if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) { - smart_str_appends(&str, "& "); + smart_str_appendc(&str, '&'); } if (fptr->common.scope) { From a29c5d6928c28f656c6348c2371a7cd4d4add2e2 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:03:18 +0200 Subject: [PATCH 243/386] phar: Simplify phar_wrapper_stat() (#20222) We can pass NULL instead of the error pointer, as we never use the value of the error pointer anyway. --- ext/phar/stream.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ext/phar/stream.c b/ext/phar/stream.c index d7bcc78fd8a8d..77ca7137fdf50 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -558,7 +558,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f php_stream_statbuf *ssb, php_stream_context *context) /* {{{ */ { php_url *resource = NULL; - char *internal_file, *error; + char *internal_file; phar_archive_data *phar; phar_entry_info *entry; size_t internal_file_len; @@ -582,16 +582,10 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ /* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */ - if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, &error)) { + if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, NULL)) { php_url_free(resource); - if (error) { - efree(error); - } return FAILURE; } - if (error) { - efree(error); - } if (*internal_file == '\0') { /* root directory requested */ phar_dostat(phar, NULL, ssb, true); From 63e534d7cae5c50c306382e0b12e64470bd3f66a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:29:08 +0200 Subject: [PATCH 244/386] phar: Remove no-op bool casts (#20227) The field in this struct is already a bool. --- ext/phar/phar.c | 8 ++++---- ext/phar/tar.c | 6 +++--- ext/phar/zip.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index f31a4f841225f..8a41ae99199fd 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1108,11 +1108,11 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname /* set up our manifest */ zend_hash_init(&mydata->manifest, manifest_count, - zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent); + zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent); zend_hash_init(&mydata->mounted_dirs, 5, - zend_get_hash_value, NULL, (bool)mydata->is_persistent); + zend_get_hash_value, NULL, mydata->is_persistent); zend_hash_init(&mydata->virtual_dirs, manifest_count * 2, - zend_get_hash_value, NULL, (bool)mydata->is_persistent); + zend_get_hash_value, NULL, mydata->is_persistent); mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent); #ifdef PHP_WIN32 phar_unixify_path_separators(mydata->fname, fname_len); @@ -1451,7 +1451,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(c zend_hash_init(&mydata->mounted_dirs, sizeof(char *), zend_get_hash_value, NULL, 0); zend_hash_init(&mydata->virtual_dirs, sizeof(char *), - zend_get_hash_value, NULL, (bool)mydata->is_persistent); + zend_get_hash_value, NULL, mydata->is_persistent); mydata->fname_len = fname_len; snprintf(mydata->version, sizeof(mydata->version), "%s", PHP_PHAR_API_VERSION); mydata->is_temporary_alias = alias ? 0 : 1; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 550183746a2c8..8a5df4f443dc3 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -233,11 +233,11 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch myphar->is_persistent = PHAR_G(persist); /* estimate number of entries, can't be certain with tar files */ zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12), - zend_get_hash_value, destroy_phar_manifest_entry, (bool)myphar->is_persistent); + zend_get_hash_value, destroy_phar_manifest_entry, myphar->is_persistent); zend_hash_init(&myphar->mounted_dirs, 5, - zend_get_hash_value, NULL, (bool)myphar->is_persistent); + zend_get_hash_value, NULL, myphar->is_persistent); zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11), - zend_get_hash_value, NULL, (bool)myphar->is_persistent); + zend_get_hash_value, NULL, myphar->is_persistent); myphar->is_tar = 1; /* remember whether this entire phar was compressed with gz/bzip2 */ myphar->flags = compression; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index e8ffecec57147..dff893c221b94 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -336,11 +336,11 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); /* read in central directory */ zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count), - zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent); + zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent); zend_hash_init(&mydata->mounted_dirs, 5, - zend_get_hash_value, NULL, (bool)mydata->is_persistent); + zend_get_hash_value, NULL, mydata->is_persistent); zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2, - zend_get_hash_value, NULL, (bool)mydata->is_persistent); + zend_get_hash_value, NULL, mydata->is_persistent); entry.phar = mydata; entry.is_zip = 1; entry.fp_type = PHAR_FP; From 1ef7abf2bec66320c0d8bf646bad5ff37943e68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Oct 2025 08:36:41 +0200 Subject: [PATCH 245/386] zend_long: Remove `ZEND_LTOA()` (#20236) * zend_long: Remove `ZEND_LTOA()` This macro is unsafe when the given buffer is too small, since `snprintf()` returns the *required* length of the string if it would fit. Thus unconditionally writing a NUL there might result in a out-of-bounds write. * zend_long: Remove `ZEND_LTOA_BUF_LEN` --- UPGRADING.INTERNALS | 3 +++ Zend/zend_long.h | 15 --------------- ext/standard/hrtime.c | 4 ++-- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index fe2781e025687..d269bd107885e 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -29,6 +29,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES . CHECK_ZVAL_NULL_PATH() and CHECK_NULL_PATH() have been removed, use zend_str_has_nul_byte(Z_STR_P(...)) and zend_char_has_nul_byte() respectively. + . ZEND_LTOA() (and ZEND_LTOA_BUF_LEN) has been removed, as it was + unsafe. Directly use ZEND_LONG_FMT with a function from the + printf family. ======================== 2. Build system changes diff --git a/Zend/zend_long.h b/Zend/zend_long.h index 3796f1c5ababb..fef237701f3bd 100644 --- a/Zend/zend_long.h +++ b/Zend/zend_long.h @@ -51,9 +51,6 @@ typedef int32_t zend_off_t; #endif -/* Conversion macros. */ -#define ZEND_LTOA_BUF_LEN 65 - #ifdef ZEND_ENABLE_ZVAL_LONG64 # define ZEND_LONG_FMT "%" PRId64 # define ZEND_ULONG_FMT "%" PRIu64 @@ -61,7 +58,6 @@ typedef int32_t zend_off_t; # define ZEND_LONG_FMT_SPEC PRId64 # define ZEND_ULONG_FMT_SPEC PRIu64 # ifdef ZEND_WIN32 -# define ZEND_LTOA(i, s, len) _i64toa_s((i), (s), (len), 10) # define ZEND_ATOL(s) _atoi64((s)) # define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base)) # define ZEND_STRTOUL(s0, s1, base) _strtoui64((s0), (s1), (base)) @@ -69,11 +65,6 @@ typedef int32_t zend_off_t; # define ZEND_STRTOUL_PTR _strtoui64 # define ZEND_ABS _abs64 # else -# define ZEND_LTOA(i, s, len) \ - do { \ - int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \ - (s)[st] = '\0'; \ - } while (0) # define ZEND_ATOL(s) atoll((s)) # define ZEND_STRTOL(s0, s1, base) strtoll((s0), (s1), (base)) # define ZEND_STRTOUL(s0, s1, base) strtoull((s0), (s1), (base)) @@ -90,14 +81,8 @@ typedef int32_t zend_off_t; # define ZEND_LONG_FMT_SPEC PRId32 # define ZEND_ULONG_FMT_SPEC PRIu32 # ifdef ZEND_WIN32 -# define ZEND_LTOA(i, s, len) _ltoa_s((i), (s), (len), 10) # define ZEND_ATOL(s) atol((s)) # else -# define ZEND_LTOA(i, s, len) \ - do { \ - int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \ - (s)[st] = '\0'; \ - } while (0) # define ZEND_ATOL(s) atol((s)) # endif # define ZEND_STRTOL_PTR strtol diff --git a/ext/standard/hrtime.c b/ext/standard/hrtime.c index 10853493b6390..652531bd3ed4f 100644 --- a/ext/standard/hrtime.c +++ b/ext/standard/hrtime.c @@ -31,9 +31,9 @@ } while (0) #endif #define PHP_RETURN_HRTIME(t) do { \ - char _a[ZEND_LTOA_BUF_LEN]; \ + char _a[65]; \ double _d; \ - HRTIME_U64A(t, _a, ZEND_LTOA_BUF_LEN); \ + HRTIME_U64A(t, _a, sizeof(_a)); \ _d = zend_strtod(_a, NULL); \ RETURN_DOUBLE(_d); \ } while (0) From 01e339d8b81937685e69156fe17cfda9015ad053 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 20 Oct 2025 14:52:46 +0200 Subject: [PATCH 246/386] ext/tidy: Enable tidyOptGetCategory on Windows (#20226) The tidy library on Windows has been updated to tidy-html5 5.6.0 which provides tidyOptGetCategory() function and has the TidyInternalCategory enumeration. https://github.com/winlibs/libtidy --- ext/tidy/config.m4 | 3 ++- ext/tidy/config.w32 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 index ef1f5878287d0..18fa9acb3d4bd 100644 --- a/ext/tidy/config.m4 +++ b/ext/tidy/config.m4 @@ -81,7 +81,8 @@ if test "$PHP_TIDY" != "no"; then ]) AS_VAR_IF([php_ac_cv_have_tidyoptgetcategory], [yes], [AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1], - [Define to 1 if tidyOptGetCategory is available.])]) + [Define to 1 if Tidy library has the 'tidyOptGetCategory' function and + supports the 'TidyInternalCategory' enumeration.])]) CPPFLAGS=$old_CPPFLAGS diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32 index a1f93f2976af8..1b2436ac9dfad 100644 --- a/ext/tidy/config.w32 +++ b/ext/tidy/config.w32 @@ -21,6 +21,7 @@ if (PHP_TIDY != "no") { AC_DEFINE('HAVE_TIDY_H', 1, "Define to 1 if you have the header file.") AC_DEFINE('HAVE_TIDYOPTGETDOC', 1, "Define to 1 if Tidy library has the 'tidyOptGetDoc' function.") AC_DEFINE('HAVE_TIDYRELEASEDATE', 1, "Define to 1 if Tidy library has the 'tidyReleaseDate' function.") + AC_DEFINE('HAVE_TIDYOPTGETCATEGORY', 1, "Define to 1 if Tidy library has the 'tidyOptGetCategory' function and supports the 'TidyInternalCategory' enumeration.") ADD_FLAG('CFLAGS_TIDY', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); if (!PHP_TIDY_SHARED) { ADD_DEF_FILE("ext\\tidy\\php_tidy.def"); From 45a50d0d6889274d1ad4f94750572dc159ef7266 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:31:01 +0200 Subject: [PATCH 247/386] phar: Remove pointless efree() (#20232) `error` is NULL at this point, otherwise we couldn't have gotten and *shouldn't* have gotten here in the first place. --- ext/phar/dirstream.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 81fa62c854dfd..71420c11e62d6 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -450,7 +450,6 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo if (NULL == zend_hash_add_mem(&phar->manifest, entry.filename, &entry, sizeof(phar_entry_info))) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", ZSTR_VAL(entry.filename), phar->fname); - efree(error); zend_string_efree(entry.filename); return 0; } From 40b3f884260b5b3a686d8bba569317be0e2d0e2d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:31:16 +0200 Subject: [PATCH 248/386] phar: Avoid string duplication just for error message, use truncation formatting string (#20229) --- ext/phar/phar_object.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 9c09417e077b4..fba332aa21a0b 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4315,10 +4315,7 @@ PHP_METHOD(Phar, extractTo) } if (ZSTR_LEN(path_to) >= MAXPATHLEN) { - char *tmp = estrndup(ZSTR_VAL(path_to), 50); - /* truncate for error message */ - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp); - efree(tmp); + zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%.50s...\", destination directory is too long for filesystem", ZSTR_VAL(path_to)); RETURN_THROWS(); } From 0805953bb0b7b2a7bc646442a49953071556a344 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 22:55:24 +0200 Subject: [PATCH 249/386] phar: Restructure code to get rid of a goto --- ext/phar/zip.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index dff893c221b94..10301fc48e7dc 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -234,7 +234,7 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch uint16_t i; phar_archive_data *mydata = NULL; phar_entry_info entry = {0}; - char *p = buf, *ext, *actual_alias = NULL; + char *ext, *actual_alias = NULL; char *metadata = NULL; size = php_stream_tell(fp); @@ -261,7 +261,16 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch return FAILURE; } - if ((p = phar_find_eocd(buf, size)) != NULL) { + char *p = phar_find_eocd(buf, size); + if (!p) { + php_stream_close(fp); + if (error) { + spprintf(error, 4096, "phar error: end of central directory not found in zip-based phar \"%s\"", fname); + } + return FAILURE; + } + + { memcpy((void *)&locator, (void *) p, sizeof(locator)); if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) { /* split archives not handled */ @@ -301,18 +310,8 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch } else { ZVAL_UNDEF(&mydata->metadata_tracker.val); } - - goto foundit; - } - - php_stream_close(fp); - - if (error) { - spprintf(error, 4096, "phar error: end of central directory not found in zip-based phar \"%s\"", fname); } - return FAILURE; -foundit: mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent); #ifdef PHP_WIN32 phar_unixify_path_separators(mydata->fname, fname_len); From 0098f3efbce2311027ad558ce4f5eb5f02634101 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 22:55:35 +0200 Subject: [PATCH 250/386] phar: De-indent code --- ext/phar/zip.c | 60 ++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 10301fc48e7dc..5f025d75e341b 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -270,46 +270,44 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch return FAILURE; } - { - memcpy((void *)&locator, (void *) p, sizeof(locator)); - if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) { - /* split archives not handled */ - php_stream_close(fp); - if (error) { - spprintf(error, 4096, "phar error: split archives spanning multiple zips cannot be processed in zip-based phar \"%s\"", fname); - } - return FAILURE; + memcpy((void *)&locator, (void *) p, sizeof(locator)); + if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) { + /* split archives not handled */ + php_stream_close(fp); + if (error) { + spprintf(error, 4096, "phar error: split archives spanning multiple zips cannot be processed in zip-based phar \"%s\"", fname); } + return FAILURE; + } - if (PHAR_GET_16(locator.counthere) != PHAR_GET_16(locator.count)) { - if (error) { - spprintf(error, 4096, "phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar \"%s\"", fname); - } - php_stream_close(fp); - return FAILURE; + if (PHAR_GET_16(locator.counthere) != PHAR_GET_16(locator.count)) { + if (error) { + spprintf(error, 4096, "phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar \"%s\"", fname); } + php_stream_close(fp); + return FAILURE; + } - mydata = pecalloc(1, sizeof(phar_archive_data), PHAR_G(persist)); - mydata->is_persistent = PHAR_G(persist); + mydata = pecalloc(1, sizeof(phar_archive_data), PHAR_G(persist)); + mydata->is_persistent = PHAR_G(persist); - /* read in archive comment, if any */ - if (PHAR_GET_16(locator.comment_len)) { + /* read in archive comment, if any */ + if (PHAR_GET_16(locator.comment_len)) { - metadata = p + sizeof(locator); + metadata = p + sizeof(locator); - if (PHAR_GET_16(locator.comment_len) != size - (metadata - buf)) { - if (error) { - spprintf(error, 4096, "phar error: corrupt zip archive, zip file comment truncated in zip-based phar \"%s\"", fname); - } - php_stream_close(fp); - pefree(mydata, mydata->is_persistent); - return FAILURE; + if (PHAR_GET_16(locator.comment_len) != size - (metadata - buf)) { + if (error) { + spprintf(error, 4096, "phar error: corrupt zip archive, zip file comment truncated in zip-based phar \"%s\"", fname); } - - phar_parse_metadata_lazy(metadata, &mydata->metadata_tracker, PHAR_GET_16(locator.comment_len), mydata->is_persistent); - } else { - ZVAL_UNDEF(&mydata->metadata_tracker.val); + php_stream_close(fp); + pefree(mydata, mydata->is_persistent); + return FAILURE; } + + phar_parse_metadata_lazy(metadata, &mydata->metadata_tracker, PHAR_GET_16(locator.comment_len), mydata->is_persistent); + } else { + ZVAL_UNDEF(&mydata->metadata_tracker.val); } mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent); From 6291f97c149677ce9a9bb249ca16e5ffec00cafe Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:03:51 +0200 Subject: [PATCH 251/386] phar: Move code to avoid goto --- ext/phar/dirstream.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 71420c11e62d6..6b5033659ce3e 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -188,8 +188,6 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has entry = safe_emalloc(keylen, 1, 1); memcpy(entry, ZSTR_VAL(str_key), keylen); entry[keylen] = '\0'; - - goto PHAR_ADD_ENTRY; } else { if (0 != memcmp(ZSTR_VAL(str_key), dir, dirlen)) { /* entry in directory not found */ @@ -199,7 +197,6 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has continue; } } - } const char *save = ZSTR_VAL(str_key); save += dirlen + 1; /* seek to just past the path separator */ @@ -220,7 +217,8 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has entry[keylen - dirlen - 1] = '\0'; keylen = keylen - dirlen - 1; } -PHAR_ADD_ENTRY: + } + if (keylen) { /** * Add an empty element to avoid duplicates From a69b35328d02282f18c843b10df4d719f7465c08 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:03:59 +0200 Subject: [PATCH 252/386] phar: Re-indent code --- ext/phar/dirstream.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 6b5033659ce3e..f37599e7db117 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -198,25 +198,25 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has } } - const char *save = ZSTR_VAL(str_key); - save += dirlen + 1; /* seek to just past the path separator */ - - const char *has_slash = memchr(save, '/', keylen - dirlen - 1); - if (has_slash) { - /* is subdirectory */ - save -= dirlen + 1; - entry = safe_emalloc(has_slash - save + dirlen, 1, 1); - memcpy(entry, save + dirlen + 1, has_slash - save - dirlen - 1); - keylen = has_slash - save - dirlen - 1; - entry[keylen] = '\0'; - } else { - /* is file */ - save -= dirlen + 1; - entry = safe_emalloc(keylen - dirlen, 1, 1); - memcpy(entry, save + dirlen + 1, keylen - dirlen - 1); - entry[keylen - dirlen - 1] = '\0'; - keylen = keylen - dirlen - 1; - } + const char *save = ZSTR_VAL(str_key); + save += dirlen + 1; /* seek to just past the path separator */ + + const char *has_slash = memchr(save, '/', keylen - dirlen - 1); + if (has_slash) { + /* is subdirectory */ + save -= dirlen + 1; + entry = safe_emalloc(has_slash - save + dirlen, 1, 1); + memcpy(entry, save + dirlen + 1, has_slash - save - dirlen - 1); + keylen = has_slash - save - dirlen - 1; + entry[keylen] = '\0'; + } else { + /* is file */ + save -= dirlen + 1; + entry = safe_emalloc(keylen - dirlen, 1, 1); + memcpy(entry, save + dirlen + 1, keylen - dirlen - 1); + entry[keylen - dirlen - 1] = '\0'; + keylen = keylen - dirlen - 1; + } } if (keylen) { From 9c90e16e188d5fd8cca8cd77fd8c65d29308428e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:34:04 +0200 Subject: [PATCH 253/386] phar: Avoid an error goto in phar_zip_flush() (#20233) --- ext/phar/zip.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 5f025d75e341b..5abbc49d3c2ce 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1392,8 +1392,8 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_zip_flush(phar_archive_data *phar, z zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass); phar_metadata_tracker_try_ensure_has_serialized_data(&phar->metadata_tracker, phar->is_persistent); - if (pass_error) { -has_pass_error: + if (pass_error + || FAILURE == phar_zip_applysignature(phar, &pass)) { spprintf(error, 4096, "phar zip flush of \"%s\" failed: %s", phar->fname, pass_error); efree(pass_error); nopasserror: @@ -1406,11 +1406,6 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_zip_flush(phar_archive_data *phar, z return; } - if (FAILURE == phar_zip_applysignature(phar, &pass)) { - ZEND_ASSERT(pass_error != NULL); - goto has_pass_error; - } - /* save zip */ cdir_size = php_stream_tell(pass.centralfp); cdir_offset = php_stream_tell(pass.filefp); From df8ce6ddbd713d7e9163dd60d19648e2e4a8bb80 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 20 Oct 2025 00:10:40 +0200 Subject: [PATCH 254/386] Zend: remove zval_dtor() compatibility macro This is an alias for zval_ptr_dtor_nogc(). I've seen people make mistakes against this and use zval_dtor() instead of zval_ptr_dtor(). The crucial detail here is that the former won't root possible GC cycles while the latter will. We can avoid the confusion by just retiring this compatibility macro. Closes GH-20235. --- UPGRADING.INTERNALS | 2 ++ Zend/zend_variables.h | 3 --- ext/pdo/pdo_stmt.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index d269bd107885e..42e52480bbb9c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -32,6 +32,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES . ZEND_LTOA() (and ZEND_LTOA_BUF_LEN) has been removed, as it was unsafe. Directly use ZEND_LONG_FMT with a function from the printf family. + . The zval_dtor() alias of zval_ptr_dtor_nogc() has been removed. + Call zval_ptr_dtor_nogc() directly instead. ======================== 2. Build system changes diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index 1cb745ca1b1dc..d90ad9951782a 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -81,9 +81,6 @@ ZEND_API void zval_ptr_dtor(zval *zval_ptr); ZEND_API void zval_ptr_safe_dtor(zval *zval_ptr); ZEND_API void zval_internal_ptr_dtor(zval *zvalue); -/* Kept for compatibility */ -#define zval_dtor(zvalue) zval_ptr_dtor_nogc(zvalue) - ZEND_API void zval_add_ref(zval *p); END_EXTERN_C() diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index e2723c703f0ac..e87af66c75868 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1052,7 +1052,7 @@ PHP_METHOD(PDOStatement, fetch) array_init_size(return_value, 1); bool success = pdo_do_key_pair_fetch(stmt, ori, off, Z_ARRVAL_P(return_value)); if (!success) { - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); PDO_HANDLE_STMT_ERR(); RETURN_FALSE; } From 8e84e9a5514e6566ed8bbcaebfacbd32dc42f74b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:16:55 +0200 Subject: [PATCH 255/386] pgsql: Use cheaper string conversion functions --- ext/pgsql/pgsql.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 3f511d21456bd..b59c9ef8f3c87 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3409,7 +3409,8 @@ PHP_FUNCTION(pg_copy_to) static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, zval *value) { - zend_string *tmp = zval_try_get_string(value); + zend_string *tmp_tmp; + zend_string *tmp = zval_try_get_tmp_string(value, &tmp_tmp); if (UNEXPECTED(!tmp)) { return FAILURE; } @@ -3423,11 +3424,11 @@ static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, } if (PQputCopyData(pgsql, ZSTR_VAL(zquery), ZSTR_LEN(zquery)) != 1) { zend_string_release_ex(zquery, false); - zend_string_release(tmp); + zend_tmp_string_release(tmp_tmp); return FAILURE; } zend_string_release_ex(zquery, false); - zend_string_release(tmp); + zend_tmp_string_release(tmp_tmp); return SUCCESS; } From e2396a6ffb60ff3d426f3b66182f60ab4dffdc7c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:19:34 +0200 Subject: [PATCH 256/386] pgsql: Simplify pgsql_copy_from_query() by using character buffers This also avoids some unnecessary zend_string overhead. --- ext/pgsql/pgsql.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index b59c9ef8f3c87..b0e2f53cc8d98 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3414,21 +3414,20 @@ static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, if (UNEXPECTED(!tmp)) { return FAILURE; } - zend_string *zquery = zend_string_alloc(ZSTR_LEN(tmp) + 2, false); - memcpy(ZSTR_VAL(zquery), ZSTR_VAL(tmp), ZSTR_LEN(tmp) + 1); - ZSTR_LEN(zquery) = ZSTR_LEN(tmp); - if (ZSTR_LEN(tmp) > 0 && ZSTR_VAL(zquery)[ZSTR_LEN(tmp) - 1] != '\n') { - ZSTR_VAL(zquery)[ZSTR_LEN(tmp)] = '\n'; - ZSTR_VAL(zquery)[ZSTR_LEN(tmp) + 1] = '\0'; - ZSTR_LEN(zquery) ++; - } - if (PQputCopyData(pgsql, ZSTR_VAL(zquery), ZSTR_LEN(zquery)) != 1) { - zend_string_release_ex(zquery, false); - zend_tmp_string_release(tmp_tmp); - return FAILURE; + char *zquery = emalloc(ZSTR_LEN(tmp) + 2); + memcpy(zquery, ZSTR_VAL(tmp), ZSTR_LEN(tmp) + 1); + size_t zquery_len = ZSTR_LEN(tmp); + if (ZSTR_LEN(tmp) > 0 && zquery[ZSTR_LEN(tmp) - 1] != '\n') { + zquery[ZSTR_LEN(tmp)] = '\n'; + zquery[ZSTR_LEN(tmp) + 1] = '\0'; + zquery_len++; } - zend_string_release_ex(zquery, false); zend_tmp_string_release(tmp_tmp); + if (PQputCopyData(pgsql, zquery, zquery_len) != 1) { + efree(zquery); + return FAILURE; + } + efree(zquery); return SUCCESS; } From da9638298c8a578970286106e0e0ee8a031492ab Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:23:47 +0200 Subject: [PATCH 257/386] pgsql: Avoid unnecessary work in pgsql_copy_from_query() if the input already ends in a newline --- ext/pgsql/pgsql.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index b0e2f53cc8d98..1212acdd1476c 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3414,21 +3414,22 @@ static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, if (UNEXPECTED(!tmp)) { return FAILURE; } - char *zquery = emalloc(ZSTR_LEN(tmp) + 2); - memcpy(zquery, ZSTR_VAL(tmp), ZSTR_LEN(tmp) + 1); - size_t zquery_len = ZSTR_LEN(tmp); - if (ZSTR_LEN(tmp) > 0 && zquery[ZSTR_LEN(tmp) - 1] != '\n') { + + int result; + if (ZSTR_LEN(tmp) > 0 && ZSTR_VAL(tmp)[ZSTR_LEN(tmp) - 1] != '\n') { + char *zquery = emalloc(ZSTR_LEN(tmp) + 2); + memcpy(zquery, ZSTR_VAL(tmp), ZSTR_LEN(tmp) + 1); zquery[ZSTR_LEN(tmp)] = '\n'; zquery[ZSTR_LEN(tmp) + 1] = '\0'; - zquery_len++; - } - zend_tmp_string_release(tmp_tmp); - if (PQputCopyData(pgsql, zquery, zquery_len) != 1) { + result = PQputCopyData(pgsql, zquery, ZSTR_LEN(tmp) + 1); efree(zquery); - return FAILURE; + } else { + result = PQputCopyData(pgsql, ZSTR_VAL(tmp), ZSTR_LEN(tmp)); } - efree(zquery); - return SUCCESS; + + zend_tmp_string_release(tmp_tmp); + + return result != 1 ? FAILURE : SUCCESS; } /* {{{ Copy table from array */ From 5eec4d8001ca97f54ce52e7be4bd131e0f4ef0d6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:36:08 +0200 Subject: [PATCH 258/386] pgsql: Avoid duplicating strings and factor out parameter building code --- ext/pgsql/pgsql.c | 144 +++++++++++++++++----------------------------- 1 file changed, 53 insertions(+), 91 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 1212acdd1476c..89c99cd84132a 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1223,26 +1223,55 @@ PHP_FUNCTION(pg_query) } } -static void _php_pgsql_free_params(char **params, int num_params) +/* The char pointer MUST refer to the char* of a zend_string struct */ +static void php_pgsql_zend_string_release_from_char_pointer(char *ptr) { + zend_string_release((zend_string*) (ptr - XtOffsetOf(zend_string, val))); +} + +static void _php_pgsql_free_params(char **params, uint32_t num_params) { - int i; - for (i = 0; i < num_params; i++) { + for (uint32_t i = 0; i < num_params; i++) { if (params[i]) { - efree(params[i]); + php_pgsql_zend_string_release_from_char_pointer(params[i]); } } efree(params); } +static char **php_pgsql_make_arguments(const HashTable *param_arr, int *num_params) +{ + /* This conversion is safe because of the limit of number of elements in a table. */ + *num_params = (int) zend_hash_num_elements(param_arr); + char **params = safe_emalloc(sizeof(char *), *num_params, 0); + uint32_t i = 0; + + ZEND_HASH_FOREACH_VAL(param_arr, zval *tmp) { + ZVAL_DEREF(tmp); + if (Z_TYPE_P(tmp) == IS_NULL) { + params[i] = NULL; + } else { + zend_string *param_str = zval_try_get_string(tmp); + if (!param_str) { + _php_pgsql_free_params(params, i); + return NULL; + } + params[i] = ZSTR_VAL(param_str); + } + i++; + } ZEND_HASH_FOREACH_END(); + + return params; +} + /* Execute a query */ PHP_FUNCTION(pg_query_params) { zval *pgsql_link = NULL; - zval *pv_param_arr, *tmp; + zval *pv_param_arr; char *query; size_t query_len; bool leftover = false; - int num_params = 0; + int num_params; char **params = NULL; pgsql_link_handle *link; PGconn *pgsql; @@ -1286,26 +1315,9 @@ PHP_FUNCTION(pg_query_params) php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); } - num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) { - ZVAL_DEREF(tmp); - if (Z_TYPE_P(tmp) == IS_NULL) { - params[i] = NULL; - } else { - zend_string *param_str = zval_try_get_string(tmp); - if (!param_str) { - _php_pgsql_free_params(params, i); - RETURN_THROWS(); - } - params[i] = estrndup(ZSTR_VAL(param_str), ZSTR_LEN(param_str)); - zend_string_release(param_str); - } - i++; - } ZEND_HASH_FOREACH_END(); + params = php_pgsql_make_arguments(Z_ARRVAL_P(pv_param_arr), &num_params); + if (UNEXPECTED(!params)) { + RETURN_THROWS(); } pgsql_result = PQexecParams(pgsql, query, num_params, @@ -1440,11 +1452,11 @@ PHP_FUNCTION(pg_prepare) PHP_FUNCTION(pg_execute) { zval *pgsql_link = NULL; - zval *pv_param_arr, *tmp; + zval *pv_param_arr; char *stmtname; size_t stmtname_len; bool leftover = false; - int num_params = 0; + int num_params; char **params = NULL; PGconn *pgsql; pgsql_link_handle *link; @@ -1488,25 +1500,9 @@ PHP_FUNCTION(pg_execute) php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); } - num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) { - ZVAL_DEREF(tmp); - if (Z_TYPE_P(tmp) == IS_NULL) { - params[i] = NULL; - } else { - zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(tmp, &tmp_str); - - params[i] = estrndup(ZSTR_VAL(str), ZSTR_LEN(str)); - zend_tmp_string_release(tmp_str); - } - - i++; - } ZEND_HASH_FOREACH_END(); + params = php_pgsql_make_arguments(Z_ARRVAL_P(pv_param_arr), &num_params); + if (UNEXPECTED(!params)) { + RETURN_THROWS(); } pgsql_result = PQexecPrepared(pgsql, stmtname, num_params, @@ -4034,9 +4030,9 @@ PHP_FUNCTION(pg_send_query) /* {{{ Send asynchronous parameterized query */ PHP_FUNCTION(pg_send_query_params) { - zval *pgsql_link, *pv_param_arr, *tmp; + zval *pgsql_link, *pv_param_arr; pgsql_link_handle *link; - int num_params = 0; + int num_params; char **params = NULL; char *query; size_t query_len; @@ -4066,25 +4062,9 @@ PHP_FUNCTION(pg_send_query_params) "There are results on this connection. Call pg_get_result() until it returns FALSE"); } - num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) { - ZVAL_DEREF(tmp); - if (Z_TYPE_P(tmp) == IS_NULL) { - params[i] = NULL; - } else { - zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(tmp, &tmp_str); - - params[i] = estrndup(ZSTR_VAL(str), ZSTR_LEN(str)); - zend_tmp_string_release(tmp_str); - } - - i++; - } ZEND_HASH_FOREACH_END(); + params = php_pgsql_make_arguments(Z_ARRVAL_P(pv_param_arr), &num_params); + if (UNEXPECTED(!params)) { + RETURN_THROWS(); } if (PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)) { @@ -4206,8 +4186,8 @@ PHP_FUNCTION(pg_send_execute) { zval *pgsql_link; pgsql_link_handle *link; - zval *pv_param_arr, *tmp; - int num_params = 0; + zval *pv_param_arr; + int num_params; char **params = NULL; char *stmtname; size_t stmtname_len; @@ -4237,27 +4217,9 @@ PHP_FUNCTION(pg_send_execute) "There are results on this connection. Call pg_get_result() until it returns FALSE"); } - num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr)); - if (num_params > 0) { - int i = 0; - params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) { - ZVAL_DEREF(tmp); - if (Z_TYPE_P(tmp) == IS_NULL) { - params[i] = NULL; - } else { - zend_string *tmp_str = zval_try_get_string(tmp); - if (UNEXPECTED(!tmp_str)) { - _php_pgsql_free_params(params, i); - return; - } - params[i] = estrndup(ZSTR_VAL(tmp_str), ZSTR_LEN(tmp_str)); - zend_string_release(tmp_str); - } - - i++; - } ZEND_HASH_FOREACH_END(); + params = php_pgsql_make_arguments(Z_ARRVAL_P(pv_param_arr), &num_params); + if (UNEXPECTED(!params)) { + RETURN_THROWS(); } if (PQsendQueryPrepared(pgsql, stmtname, num_params, (const char * const *)params, NULL, NULL, 0)) { From d0ad286ec8615cdeda04a9e07c958e2f316d004d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 16:02:06 +0100 Subject: [PATCH 259/386] Zend: use type uint32_t for zend_lineno global --- Zend/zend_compile.c | 4 ++-- Zend/zend_compile.h | 2 +- Zend/zend_globals.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 27a07fffc733b..97e36d6b2498a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -519,7 +519,7 @@ ZEND_API zend_string *zend_get_compiled_filename(void) /* {{{ */ } /* }}} */ -ZEND_API int zend_get_compiled_lineno(void) /* {{{ */ +ZEND_API uint32_t zend_get_compiled_lineno(void) /* {{{ */ { return CG(zend_lineno); } @@ -4697,7 +4697,7 @@ static const zend_frameless_function_info *find_frameless_function_info(zend_ast static uint32_t zend_compile_frameless_icall_ex(znode *result, zend_ast_list *args, zend_function *fbc, const zend_frameless_function_info *frameless_function_info, uint32_t type) { - int lineno = CG(zend_lineno); + uint32_t lineno = CG(zend_lineno); uint32_t num_args = frameless_function_info->num_args; uint32_t offset = find_frameless_function_offset(num_args, frameless_function_info->handler); znode arg_zvs[3]; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 8321e4a03c1e3..e8b429bc4696a 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -894,7 +894,7 @@ void shutdown_scanner(void); ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename); ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename); ZEND_API zend_string *zend_get_compiled_filename(void); -ZEND_API int zend_get_compiled_lineno(void); +ZEND_API uint32_t zend_get_compiled_lineno(void); ZEND_API size_t zend_get_scanned_file_offset(void); ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var); diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index fa24128ae20ed..df84a3d0f6b62 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -88,7 +88,7 @@ struct _zend_compiler_globals { zend_string *compiled_filename; - int zend_lineno; + uint32_t zend_lineno; zend_op_array *active_op_array; From f5e782ec2d0a4a6d01d95034bcde6f171d2f61c7 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 16:06:59 +0100 Subject: [PATCH 260/386] Zend: use type uint32_t for ticks_count global --- Zend/zend_globals.h | 2 +- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index df84a3d0f6b62..d43c60b95810b 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -204,7 +204,7 @@ struct _zend_executor_globals { zend_execute_data *current_observed_frame; - int ticks_count; + uint32_t ticks_count; zend_long precision; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 3c3065e156871..34e58639c64cd 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8006,7 +8006,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY, NUM) { USE_OPLINE - if ((uint32_t)++EG(ticks_count) >= opline->extended_value) { + if (++EG(ticks_count) >= opline->extended_value) { EG(ticks_count) = 0; if (zend_ticks_function) { SAVE_OPLINE(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 50870ce463de3..cc8bc51a7f4ea 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3278,7 +3278,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_TICKS_SPEC_HA { USE_OPLINE - if ((uint32_t)++EG(ticks_count) >= opline->extended_value) { + if (++EG(ticks_count) >= opline->extended_value) { EG(ticks_count) = 0; if (zend_ticks_function) { SAVE_OPLINE(); @@ -58798,7 +58798,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_TICKS_SPEC_TAILCAL { USE_OPLINE - if ((uint32_t)++EG(ticks_count) >= opline->extended_value) { + if (++EG(ticks_count) >= opline->extended_value) { EG(ticks_count) = 0; if (zend_ticks_function) { SAVE_OPLINE(); From 3db0ea682a8243f2aed6e89449a906c2adb33e88 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 16:13:46 +0100 Subject: [PATCH 261/386] Zend: use type uint32_t for lineno ini scanner global --- Zend/zend_globals.h | 2 +- Zend/zend_ini_parser.y | 2 +- Zend/zend_ini_scanner.h | 2 +- Zend/zend_ini_scanner.l | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index d43c60b95810b..ef81ae5faaf25 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -343,7 +343,7 @@ struct _zend_ini_scanner_globals { zend_stack state_stack; zend_string *filename; - int lineno; + uint32_t lineno; /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */ int scanner_mode; diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 5f788f152fb6a..748ccd2235a6d 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -205,7 +205,7 @@ static ZEND_COLD void ini_error(const char *msg) error_buf_len = 128 + (int)strlen(msg) + (int)strlen(currently_parsed_filename); /* should be more than enough */ error_buf = (char *) emalloc(error_buf_len); - sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno()); + sprintf(error_buf, "%s in %s on line %" PRIu32 "\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno()); } else { error_buf = estrdup("Invalid configuration directive\n"); } diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index 62546413c7cb2..9a6c84fce4292 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -30,7 +30,7 @@ typedef struct _zend_file_handle zend_file_handle; #define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */ BEGIN_EXTERN_C() -ZEND_COLD int zend_ini_scanner_get_lineno(void); +ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void); ZEND_COLD const char *zend_ini_scanner_get_filename(void); zend_result zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode); zend_result zend_ini_prepare_string_for_scanning(const char *str, int scanner_mode); diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index b87f4e33cc8f8..d3f71ba8bc340 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -230,7 +230,7 @@ void shutdown_ini_scanner(void) /* }}} */ /* {{{ zend_ini_scanner_get_lineno() */ -ZEND_COLD int zend_ini_scanner_get_lineno(void) +ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void) { return SCNG(lineno); } From 51a4e06b08bd0242e50468efe178b323834e99eb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 16:39:09 +0100 Subject: [PATCH 262/386] Zend: use type uint32_t for refcount CE field --- Zend/zend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend.h b/Zend/zend.h index 163b48015d9b8..2155be43c12b5 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -152,7 +152,7 @@ struct _zend_class_entry { zend_class_entry *parent; zend_string *parent_name; }; - int refcount; + uint32_t refcount; uint32_t ce_flags; uint32_t ce_flags2; From 40a42cffd81b7f01fed25b3f7d02cb4d2ead700d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Oct 2025 16:37:17 +0100 Subject: [PATCH 263/386] Zend: use type uint32_t for default_static_members_count CE field --- Zend/zend.h | 2 +- Zend/zend_object_handlers.c | 3 +-- ext/opcache/zend_persist.c | 3 +-- ext/opcache/zend_persist_calc.c | 4 +--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index 2155be43c12b5..aff48ca0e2068 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -157,7 +157,7 @@ struct _zend_class_entry { uint32_t ce_flags2; int default_properties_count; - int default_static_members_count; + uint32_t default_static_members_count; zval *default_properties_table; zval *default_static_members_table; ZEND_MAP_PTR_DEF(zval *, static_members_table); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 17676e8edea48..7514a1ddef82f 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2006,7 +2006,6 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */ { - int i; zval *p; if (class_type->default_static_members_count && !CE_STATIC_MEMBERS(class_type)) { @@ -2015,7 +2014,7 @@ ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */ } ZEND_MAP_PTR_SET(class_type->static_members_table, emalloc(sizeof(zval) * class_type->default_static_members_count)); - for (i = 0; i < class_type->default_static_members_count; i++) { + for (uint32_t i = 0; i < class_type->default_static_members_count; i++) { p = &class_type->default_static_members_table[i]; if (Z_TYPE_P(p) == IS_INDIRECT) { zval *q = &CE_STATIC_MEMBERS(class_type->parent)[i]; diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index e1187b045b13e..ef69cceb0250b 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -967,12 +967,11 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce) } } if (ce->default_static_members_table) { - int i; ce->default_static_members_table = zend_shared_memdup_free(ce->default_static_members_table, sizeof(zval) * ce->default_static_members_count); /* Persist only static properties in this class. * Static properties from parent classes will be handled in class_copy_ctor and are marked with IS_INDIRECT */ - for (i = 0; i < ce->default_static_members_count; i++) { + for (uint32_t i = 0; i < ce->default_static_members_count; i++) { if (Z_TYPE(ce->default_static_members_table[i]) != IS_INDIRECT) { zend_persist_zval(&ce->default_static_members_table[i]); } diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 3c763d239e5ff..c638d66619d0f 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -479,10 +479,8 @@ void zend_persist_class_entry_calc(zend_class_entry *ce) } } if (ce->default_static_members_table) { - int i; - ADD_SIZE(sizeof(zval) * ce->default_static_members_count); - for (i = 0; i < ce->default_static_members_count; i++) { + for (uint32_t i = 0; i < ce->default_static_members_count; i++) { if (Z_TYPE(ce->default_static_members_table[i]) != IS_INDIRECT) { zend_persist_zval_calc(&ce->default_static_members_table[i]); } From 25de02b81c5d127db837ec6146b74f5b7822e478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 22 Oct 2025 08:41:21 +0200 Subject: [PATCH 264/386] uri: Improve type safety for `php_uri_parser_rfc3986_userinfo_*()` (#20244) The signature for these functions does not need to match a specific function pointer signature, thus there is no need for a `void*` to take the uri. --- ext/uri/uri_parser_rfc3986.c | 4 ++-- ext/uri/uri_parser_rfc3986.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/uri/uri_parser_rfc3986.c b/ext/uri/uri_parser_rfc3986.c index 30707fde13020..a24fb467bf340 100644 --- a/ext/uri/uri_parser_rfc3986.c +++ b/ext/uri/uri_parser_rfc3986.c @@ -149,7 +149,7 @@ static zend_result php_uri_parser_rfc3986_scheme_write(void *uri, zval *value, z } } -ZEND_ATTRIBUTE_NONNULL zend_result php_uri_parser_rfc3986_userinfo_read(void *uri, php_uri_component_read_mode read_mode, zval *retval) +ZEND_ATTRIBUTE_NONNULL zend_result php_uri_parser_rfc3986_userinfo_read(php_uri_parser_rfc3986_uris *uri, php_uri_component_read_mode read_mode, zval *retval) { const UriUriA *uriparser_uri = get_uri_for_reading(uri, read_mode); @@ -162,7 +162,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result php_uri_parser_rfc3986_userinfo_read(void *ur return SUCCESS; } -zend_result php_uri_parser_rfc3986_userinfo_write(void *uri, zval *value, zval *errors) +zend_result php_uri_parser_rfc3986_userinfo_write(php_uri_parser_rfc3986_uris *uri, zval *value, zval *errors) { UriUriA *uriparser_uri = get_uri_for_writing(uri); int result; diff --git a/ext/uri/uri_parser_rfc3986.h b/ext/uri/uri_parser_rfc3986.h index fbbfefb30af61..4d88478b6063d 100644 --- a/ext/uri/uri_parser_rfc3986.h +++ b/ext/uri/uri_parser_rfc3986.h @@ -23,8 +23,8 @@ PHPAPI extern const php_uri_parser php_uri_parser_rfc3986; typedef struct php_uri_parser_rfc3986_uris php_uri_parser_rfc3986_uris; -zend_result php_uri_parser_rfc3986_userinfo_read(void *uri, php_uri_component_read_mode read_mode, zval *retval); -zend_result php_uri_parser_rfc3986_userinfo_write(void *uri, zval *value, zval *errors); +zend_result php_uri_parser_rfc3986_userinfo_read(php_uri_parser_rfc3986_uris *uri, php_uri_component_read_mode read_mode, zval *retval); +zend_result php_uri_parser_rfc3986_userinfo_write(php_uri_parser_rfc3986_uris *uri, zval *value, zval *errors); php_uri_parser_rfc3986_uris *php_uri_parser_rfc3986_parse_ex(const char *uri_str, size_t uri_str_len, const php_uri_parser_rfc3986_uris *uriparser_base_url, bool silent); From f8656fae35d90f89f2cef6a32c7173aa0c6b27a8 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 22 Oct 2025 22:56:48 +0100 Subject: [PATCH 265/386] Zend: use uint32_t type instead of int for extended_value counter --- Zend/zend_execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c8863a4b27ad5..69665c5bbbb1f 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -4935,7 +4935,7 @@ static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, if (last->opcode == ZEND_ROPE_INIT) { zend_string_release_ex(*rope, 0); } else { - int j = last->extended_value; + uint32_t j = last->extended_value; do { zend_string_release_ex(rope[j], 0); } while (j--); From 09c39a8fd9e944a1c0e85cdaf542f838440f4d63 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 23 Oct 2025 08:23:55 +0200 Subject: [PATCH 266/386] Fix OSS-Fuzz #454273637: UAF with printf optimization and const output (#20261) Note that ZEND_COPY_TMP isn't even valid for CONSTs, and we would need to add a ref even if it were, so just add special handling instead to simplify it. --- Zend/tests/oss_fuzz_454273637.phpt | 8 ++++++++ Zend/zend_compile.c | 14 +++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Zend/tests/oss_fuzz_454273637.phpt diff --git a/Zend/tests/oss_fuzz_454273637.phpt b/Zend/tests/oss_fuzz_454273637.phpt new file mode 100644 index 0000000000000..fbcdb57ed2a16 --- /dev/null +++ b/Zend/tests/oss_fuzz_454273637.phpt @@ -0,0 +1,8 @@ +--TEST-- +OSS-Fuzz #454273637 (UAF with printf optimization and const output) +--FILE-- + +--EXPECT-- +% diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 97e36d6b2498a..8f10f1577ca72 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5009,9 +5009,17 @@ static zend_result zend_compile_func_printf(znode *result, zend_ast_list *args) * pass in the Zend Optimizer if the result of the printf() is in fact * unused */ znode copy; - zend_emit_op_tmp(©, ZEND_COPY_TMP, &rope_result, NULL); - zend_emit_op(NULL, ZEND_ECHO, &rope_result, NULL); - zend_emit_op_tmp(result, ZEND_STRLEN, ©, NULL); + if (rope_result.op_type != IS_CONST) { + /* Note: ZEND_COPY_TMP is only valid for TMPVAR. */ + ZEND_ASSERT(rope_result.op_type == IS_TMP_VAR); + zend_emit_op_tmp(©, ZEND_COPY_TMP, &rope_result, NULL); + zend_emit_op(NULL, ZEND_ECHO, &rope_result, NULL); + zend_emit_op_tmp(result, ZEND_STRLEN, ©, NULL); + } else { + zend_emit_op(NULL, ZEND_ECHO, &rope_result, NULL); + result->op_type = IS_CONST; + ZVAL_LONG(&result->u.constant, Z_STRLEN(rope_result.u.constant)); + } return SUCCESS; } From 025e16cb541e7c5e6a1755f759e520d9af01db00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 23 Oct 2025 09:28:19 +0200 Subject: [PATCH 267/386] zend_compile: Optimize arguments for ZEND_NEW (#20259) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * zend_compile: Add `is_func_accessible()` helper * zend_compile: Use `zend_set_class_name_op1()` in `zend_compile_new()` * zend_compile: Optimize arguments for ZEND_NEW Apply the optimization for static method calls to `new` calls, since `new` is effectively a static method for all intents and purposes. For: function_table, lcname); - if (!fbc || (fbc->common.fn_flags & ZEND_ACC_PUBLIC) || ce == CG(active_class_entry)) { - return fbc; + if ((fbc->common.fn_flags & ZEND_ACC_PUBLIC) || fbc->common.scope == CG(active_class_entry)) { + return true; } if (!(fbc->common.fn_flags & ZEND_ACC_PRIVATE) && (fbc->common.scope->ce_flags & ZEND_ACC_LINKED) && (!CG(active_class_entry) || (CG(active_class_entry)->ce_flags & ZEND_ACC_LINKED)) && zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry))) { + return true; + } + + return false; +} + +static zend_function *zend_get_compatible_func_or_null(zend_class_entry *ce, zend_string *lcname) /* {{{ */ +{ + zend_function *fbc = zend_hash_find_ptr(&ce->function_table, lcname); + + if (!fbc || is_func_accessible(fbc)) { return fbc; } @@ -5489,16 +5499,40 @@ static void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */ opline = zend_emit_op(result, ZEND_NEW, NULL, NULL); - if (class_node.op_type == IS_CONST) { - opline->op1_type = IS_CONST; - opline->op1.constant = zend_add_class_name_literal( - Z_STR(class_node.u.constant)); + zend_set_class_name_op1(opline, &class_node); + + if (opline->op1_type == IS_CONST) { opline->op2.num = zend_alloc_cache_slot(); - } else { - SET_NODE(opline->op1, &class_node); } - zend_compile_call_common(&ctor_result, args_ast, NULL, ast->lineno); + zend_class_entry *ce = NULL; + if (opline->op1_type == IS_CONST) { + zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op1) + 1); + ce = zend_hash_find_ptr(CG(class_table), lcname); + if (ce) { + if (zend_compile_ignore_class(ce, CG(active_op_array)->filename)) { + ce = NULL; + } + } else if (CG(active_class_entry) + && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { + ce = CG(active_class_entry); + } + } else if (opline->op1_type == IS_UNUSED + && (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF + && zend_is_scope_known()) { + ce = CG(active_class_entry); + } + + + zend_function *fbc = NULL; + if (ce + && ce->default_object_handlers->get_constructor == zend_std_get_constructor + && ce->constructor + && is_func_accessible(ce->constructor)) { + fbc = ce->constructor; + } + + zend_compile_call_common(&ctor_result, args_ast, fbc, ast->lineno); zend_do_free(&ctor_result); } /* }}} */ diff --git a/ext/opcache/tests/named_parameter_new.phpt b/ext/opcache/tests/named_parameter_new.phpt new file mode 100644 index 0000000000000..78bce98897702 --- /dev/null +++ b/ext/opcache/tests/named_parameter_new.phpt @@ -0,0 +1,72 @@ +--TEST-- +Named Parameters are optimized for known constructors +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.opt_debug_level=0x20000 +--SKIPIF-- + +--EXTENSIONS-- +opcache +--FILE-- + +--EXPECTF-- +$_main: + ; (lines=4, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %s +0000 INIT_STATIC_METHOD_CALL 1 string("MyClass") string("new") +0001 SEND_VAL int(1) 1 +0002 DO_UCALL +0003 RETURN int(1) + +MyClass::__construct: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %s +0000 CV0($foo) = RECV 1 +0001 CV1($bar) = RECV_INIT 2 int(0) +0002 ASSIGN_OBJ THIS string("foo") +0003 OP_DATA CV0($foo) +0004 ASSIGN_OBJ THIS string("bar") +0005 OP_DATA CV1($bar) +0006 RETURN null + +MyClass::new: + ; (lines=10, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %s +0000 CV0($bar) = RECV 1 +0001 V2 = NEW 1 string("Random\\Engine\\Xoshiro256StarStar") +0002 SEND_VAL int(123) 1 +0003 DO_FCALL +0004 CV1($engine) = QM_ASSIGN V2 +0005 V2 = NEW 2 (self) (exception) +0006 SEND_VAR CV1($engine) 1 +0007 SEND_VAR CV0($bar) 2 +0008 DO_FCALL +0009 RETURN V2 +LIVE RANGES: + 2: 0002 - 0004 (new) + 2: 0006 - 0009 (new) diff --git a/ext/opcache/tests/opt/gh18107_1.phpt b/ext/opcache/tests/opt/gh18107_1.phpt index fea270a4d5a08..062ccd464559b 100644 --- a/ext/opcache/tests/opt/gh18107_1.phpt +++ b/ext/opcache/tests/opt/gh18107_1.phpt @@ -30,12 +30,12 @@ $_main: 0000 T1 = ISSET_ISEMPTY_CV (isset) CV0($badvar) 0001 JMPNZ T1 0006 0002 V3 = NEW 1 string("Exception") -0003 SEND_VAL_EX string("Should happen") 1 +0003 SEND_VAL%S string("Should happen") 1 0004 DO_FCALL 0005 THROW V3 0006 JMP 0006 0007 V6 = NEW 1 string("Exception") -0008 SEND_VAL_EX string("Should not happen") 1 +0008 SEND_VAL%S string("Should not happen") 1 0009 DO_FCALL 0010 THROW V6 0011 FAST_RET T5 diff --git a/ext/opcache/tests/opt/gh18107_2.phpt b/ext/opcache/tests/opt/gh18107_2.phpt index aaf58b4f820de..bd34a54edf6e6 100644 --- a/ext/opcache/tests/opt/gh18107_2.phpt +++ b/ext/opcache/tests/opt/gh18107_2.phpt @@ -33,7 +33,7 @@ $_main: 0000 T2 = ISSET_ISEMPTY_CV (isset) CV0($badvar) 0001 JMPNZ T2 0008 0002 V4 = NEW 1 string("Exception") -0003 SEND_VAL_EX string("Should happen") 1 +0003 SEND_VAL%S string("Should happen") 1 0004 DO_FCALL 0005 THROW V4 0006 CV1($e) = CATCH string("Throwable") @@ -41,7 +41,7 @@ $_main: 0008 T6 = FAST_CALL 0010 0009 JMP 0015 0010 V7 = NEW 1 string("Exception") -0011 SEND_VAL_EX string("Should not happen") 1 +0011 SEND_VAL%S string("Should not happen") 1 0012 DO_FCALL 0013 THROW V7 0014 FAST_RET T6 From 005d04aa961fda6fa69585d9a5fd2a52db1bb90b Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 23 Oct 2025 16:30:46 +0100 Subject: [PATCH 268/386] zend_call_function: emit function deprecation before setting up call frame (#20264) --- .../zend_call_function_deprecated_frame.phpt | 25 +++++++++++++++++++ Zend/zend_execute_API.c | 7 +++--- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 Zend/tests/functions/zend_call_function_deprecated_frame.phpt diff --git a/Zend/tests/functions/zend_call_function_deprecated_frame.phpt b/Zend/tests/functions/zend_call_function_deprecated_frame.phpt new file mode 100644 index 0000000000000..ce2943a876e2b --- /dev/null +++ b/Zend/tests/functions/zend_call_function_deprecated_frame.phpt @@ -0,0 +1,25 @@ +--TEST-- +Deprecated function notice promoted to exception within zend_call_function() +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught Exception: Function foo() is deprecated in %s:%d +Stack trace: +#0 [internal function]: {closure:%s:%d}(16384, 'Function foo() ...', '%s', %d) +#1 %s(%d): array_map(Object(Closure), Array) +#2 {main} + thrown in %s on line %d diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 54ddcd48f2d3f..f174aac49ef4d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -862,18 +862,17 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ call_info = ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC | ZEND_CALL_HAS_THIS; } - call = zend_vm_stack_push_call_frame(call_info, - func, fci->param_count, object_or_called_scope); - if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_DEPRECATED)) { zend_deprecated_function(func); if (UNEXPECTED(EG(exception))) { - zend_vm_stack_free_call_frame(call); return SUCCESS; } } + call = zend_vm_stack_push_call_frame(call_info, + func, fci->param_count, object_or_called_scope); + for (uint32_t i = 0; i < fci->param_count; i++) { zval *param = ZEND_CALL_ARG(call, i+1); zval *arg = &fci->params[i]; From eafbc6b3e6b59786601420dfb27c3682d0cfd86c Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 24 Oct 2025 17:40:18 +0200 Subject: [PATCH 269/386] [skip ci] Fix opcache dump test for VARIATION job --- ext/opcache/tests/named_parameter_new.phpt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/opcache/tests/named_parameter_new.phpt b/ext/opcache/tests/named_parameter_new.phpt index 78bce98897702..1f6f64333c988 100644 --- a/ext/opcache/tests/named_parameter_new.phpt +++ b/ext/opcache/tests/named_parameter_new.phpt @@ -33,7 +33,7 @@ MyClass::new(bar: 1); ?> --EXPECTF-- $_main: - ; (lines=4, args=0, vars=0, tmps=0) + ; (lines=4, args=0, vars=0, tmps=%d) ; (after optimizer) ; %s 0000 INIT_STATIC_METHOD_CALL 1 string("MyClass") string("new") @@ -42,7 +42,7 @@ $_main: 0003 RETURN int(1) MyClass::__construct: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %s 0000 CV0($foo) = RECV 1 @@ -54,7 +54,7 @@ MyClass::__construct: 0006 RETURN null MyClass::new: - ; (lines=10, args=1, vars=2, tmps=1) + ; (lines=10, args=1, vars=2, tmps=%d) ; (after optimizer) ; %s 0000 CV0($bar) = RECV 1 From 5a7fd1de418b1379c535b3e196f1825f50877e11 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 25 Oct 2025 11:15:34 +0200 Subject: [PATCH 270/386] Make bug70417.phpt less flaky --- ext/phar/tests/tar/bug70417.phpt | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/ext/phar/tests/tar/bug70417.phpt b/ext/phar/tests/tar/bug70417.phpt index 4d98a18954cc3..504d7e1e387b6 100644 --- a/ext/phar/tests/tar/bug70417.phpt +++ b/ext/phar/tests/tar/bug70417.phpt @@ -3,32 +3,17 @@ Bug #70417 (PharData::compress() doesn't close temp file) --EXTENSIONS-- phar zlib ---SKIPIF-- - --FILE-- /dev/null', $out); // Note: valgrind can produce false positives for /usr/bin/lsof - return count($out); -} $filename = __DIR__ . '/bug70417.tar'; @unlink("$filename.gz"); -$openFiles1 = countOpenFiles(); +$resBefore = count(get_resources()); $arch = new PharData($filename); $arch->addFromString('foo', 'bar'); $arch->compress(Phar::GZ); unset($arch); -$openFiles2 = countOpenFiles(); -var_dump($openFiles1 === $openFiles2); +$resAfter = count(get_resources()); +var_dump($resBefore === $resAfter); ?> --CLEAN-- Date: Sat, 25 Oct 2025 21:01:28 +0200 Subject: [PATCH 271/386] phar: Use a loop instead of goto when looking for extensions (#20289) This gets rid of a TODO and makes the code clearer. --- ext/phar/phar.c | 57 ++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 15cdddb21af4f..b7bd61b86019f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2034,45 +2034,40 @@ zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len } } - // TODO Use some sort of loop here instead of a goto pos = memchr(filename + 1, '.', filename_len); -next_extension: - if (!pos) { - return FAILURE; - } - - while (pos != filename && (*(pos - 1) == '/' || *(pos - 1) == '\0')) { - pos = memchr(pos + 1, '.', filename_len - (pos - filename) - 1); - if (!pos) { - return FAILURE; + while (pos) { + while (pos != filename && (*(pos - 1) == '/' || *(pos - 1) == '\0')) { + pos = memchr(pos + 1, '.', filename_len - (pos - filename) - 1); + if (!pos) { + return FAILURE; + } } - } - slash = memchr(pos, '/', filename_len - (pos - filename)); + slash = memchr(pos, '/', filename_len - (pos - filename)); - if (!slash) { - /* this is a url like "phar://blah.phar" with no directory */ - *ext_str = pos; - *ext_len = strlen(pos); + if (!slash) { + /* this is a url like "phar://blah.phar" with no directory */ + *ext_str = pos; + *ext_len = strlen(pos); - /* file extension must contain "phar" */ - return phar_check_str(filename, *ext_str, *ext_len, executable, for_create); - } + /* file extension must contain "phar" */ + return phar_check_str(filename, *ext_str, *ext_len, executable, for_create); + } - /* we've found an extension that ends at a directory separator */ - *ext_str = pos; - *ext_len = slash - pos; + /* we've found an extension that ends at a directory separator */ + *ext_str = pos; + *ext_len = slash - pos; - if (phar_check_str(filename, *ext_str, *ext_len, executable, for_create) == SUCCESS) { - return SUCCESS; - } + if (phar_check_str(filename, *ext_str, *ext_len, executable, for_create) == SUCCESS) { + return SUCCESS; + } - /* look for more extensions */ - pos = strchr(pos + 1, '.'); - if (pos) { - *ext_str = NULL; - *ext_len = 0; - goto next_extension; + /* look for more extensions */ + pos = strchr(pos + 1, '.'); + if (pos) { + *ext_str = NULL; + *ext_len = 0; + } } return FAILURE; From 86a15f9a1bf7d9d5f2774f78157ae5fc48cd4e77 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 25 Oct 2025 21:01:41 +0200 Subject: [PATCH 272/386] phar: Remove redundant *error check (#20288) The failure of the iterator is already checked above at line 1157. --- ext/phar/tar.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 8a5df4f443dc3..4847597cce2ea 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -1242,12 +1242,6 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_tar_flush(phar_archive_data *phar, z php_stream_close(oldfile); } - /* on error in the hash iterator above, error is set */ - if (*error) { - php_stream_close(newfile); - return; - } - if (phar->fp && pass.free_fp) { php_stream_close(phar->fp); } From 275ec6f3352ffa423409751f4488439179c65528 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sat, 25 Oct 2025 22:36:09 +0100 Subject: [PATCH 273/386] Zend: make zend_copy_parameters_array() private (#20265) And slightly refactor implementation. --- UPGRADING.INTERNALS | 1 + Zend/zend_API.c | 22 ---------------------- Zend/zend_API.h | 3 --- Zend/zend_closures.c | 17 +++++++++++++++-- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 42e52480bbb9c..15f6620496d45 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -34,6 +34,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES printf family. . The zval_dtor() alias of zval_ptr_dtor_nogc() has been removed. Call zval_ptr_dtor_nogc() directly instead. + . The internal zend_copy_parameters_array() function is no longer exposed. ======================== 2. Build system changes diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 1b97974686edb..e05cc7e506f68 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -76,28 +76,6 @@ ZEND_API zend_result zend_get_parameters_array_ex(uint32_t param_count, zval *ar } /* }}} */ -ZEND_API zend_result zend_copy_parameters_array(uint32_t param_count, zval *argument_array) /* {{{ */ -{ - zval *param_ptr; - uint32_t arg_count; - - param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1); - arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - - if (param_count>arg_count) { - return FAILURE; - } - - while (param_count-->0) { - Z_TRY_ADDREF_P(param_ptr); - zend_hash_next_index_insert_new(Z_ARRVAL_P(argument_array), param_ptr); - param_ptr++; - } - - return SUCCESS; -} -/* }}} */ - ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */ { const char *space; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 4e2954c0a65c8..24e686b721efd 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -347,9 +347,6 @@ ZEND_API void zend_set_dl_use_deepbind(bool use_deepbind); ZEND_API zend_result zend_get_parameters_array_ex(uint32_t param_count, zval *argument_array); -/* internal function to efficiently copy parameters when executing __call() */ -ZEND_API zend_result zend_copy_parameters_array(uint32_t param_count, zval *argument_array); - #define zend_get_parameters_array(ht, param_count, argument_array) \ zend_get_parameters_array_ex(param_count, argument_array) #define zend_parse_parameters_none() \ diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 4c2b85f5d48c3..948139a865905 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -287,6 +287,19 @@ ZEND_METHOD(Closure, bindTo) do_closure_bind(return_value, ZEND_THIS, newthis, scope_obj, scope_str); } +static void zend_copy_parameters_array(const uint32_t param_count, HashTable *argument_array) /* {{{ */ +{ + zval *param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1); + + ZEND_ASSERT(param_count <= ZEND_CALL_NUM_ARGS(EG(current_execute_data))); + + for (uint32_t i = 0; i < param_count; i++) { + Z_TRY_ADDREF_P(param_ptr); + zend_hash_next_index_insert_new(argument_array, param_ptr); + param_ptr++; + } +} + static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ { zend_fcall_info fci; zend_fcall_info_cache fcc; @@ -310,14 +323,14 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ { array_init_size(&fci.params[1], ZEND_NUM_ARGS() + zend_hash_num_elements(EX(extra_named_params))); /* Avoid conversion from packed to mixed later. */ zend_hash_real_init_mixed(Z_ARRVAL(fci.params[1])); - zend_copy_parameters_array(ZEND_NUM_ARGS(), &fci.params[1]); + zend_copy_parameters_array(ZEND_NUM_ARGS(), Z_ARRVAL(fci.params[1])); ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, named_param_zval) { Z_TRY_ADDREF_P(named_param_zval); zend_hash_add_new(Z_ARRVAL(fci.params[1]), name, named_param_zval); } ZEND_HASH_FOREACH_END(); } else if (ZEND_NUM_ARGS()) { array_init_size(&fci.params[1], ZEND_NUM_ARGS()); - zend_copy_parameters_array(ZEND_NUM_ARGS(), &fci.params[1]); + zend_copy_parameters_array(ZEND_NUM_ARGS(), Z_ARRVAL(fci.params[1])); } else { ZVAL_EMPTY_ARRAY(&fci.params[1]); } From 5d0499af7e9f00f56274dcb397339f3883ffd03e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 26 Oct 2025 08:39:33 +0100 Subject: [PATCH 274/386] Don't duplicate protoname for stream wrappers (#20292) This is never used. --- main/streams/userspace.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/streams/userspace.c b/main/streams/userspace.c index b1ea8818aeccd..f5e25aa96c772 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -37,7 +37,6 @@ static int le_protocols; struct php_user_stream_wrapper { php_stream_wrapper wrapper; - char * protoname; zend_class_entry *ce; zend_resource *resource; }; @@ -72,7 +71,6 @@ static void stream_wrapper_dtor(zend_resource *rsrc) { struct php_user_stream_wrapper * uwrap = (struct php_user_stream_wrapper*)rsrc->ptr; - efree(uwrap->protoname); efree(uwrap); } @@ -468,7 +466,6 @@ PHP_FUNCTION(stream_wrapper_register) uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap)); uwrap->ce = ce; - uwrap->protoname = estrndup(ZSTR_VAL(protocol), ZSTR_LEN(protocol)); uwrap->wrapper.wops = &user_stream_wops; uwrap->wrapper.abstract = uwrap; uwrap->wrapper.is_url = ((flags & PHP_STREAM_IS_URL) != 0); From c0214e49d2636794be3bb88a2e5e79b85f8e15b1 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 26 Oct 2025 18:28:40 +0000 Subject: [PATCH 275/386] Zend: remove zend_make_callable() function (#20269) The name of this function is confusing, it doesn't make a zval callable just normalizes strings to an array pair if the string references a static method. In general, to store a userland function it is encouraged to store the resolved FCC rather than the zval. Moreover, a sourcegraph search shows no usage of this API in external open source code. --- UPGRADING.INTERNALS | 4 ++++ Zend/zend_API.c | 18 ------------------ Zend/zend_API.h | 1 - 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 15f6620496d45..f14a4d1b0c9f8 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -35,6 +35,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The zval_dtor() alias of zval_ptr_dtor_nogc() has been removed. Call zval_ptr_dtor_nogc() directly instead. . The internal zend_copy_parameters_array() function is no longer exposed. + . The zend_make_callable() function has been removed, if a callable zval + needs to be obtained use the zend_get_callable_zval_from_fcc() function + instead. If this was used to store a callable, then an FCC should be + stored instead. ======================== 2. Build system changes diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e05cc7e506f68..d9c951c928896 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4232,24 +4232,6 @@ ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string } /* }}} */ -ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */ -{ - zend_fcall_info_cache fcc; - - if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_SUPPRESS_DEPRECATIONS, callable_name, &fcc, NULL)) { - if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) { - zval_ptr_dtor_str(callable); - array_init(callable); - add_next_index_str(callable, zend_string_copy(fcc.calling_scope->name)); - add_next_index_str(callable, zend_string_copy(fcc.function_handler->common.function_name)); - } - zend_release_fcall_info_cache(&fcc); - return 1; - } - return 0; -} -/* }}} */ - ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */ { if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 24e686b721efd..440a1874adff1 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -417,7 +417,6 @@ ZEND_API bool zend_is_callable_at_frame( uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); -ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name); ZEND_API const char *zend_get_module_version(const char *module_name); ZEND_API zend_result zend_get_module_started(const char *module_name); From 6c1402031ddcf4d13fd9f3a63439c10a40cc6bcb Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 18 Oct 2025 17:04:00 +0100 Subject: [PATCH 276/386] ext/zip: code refactoring. - change few helpers signatures. - ZipArchive::extractTo now accepts only string entries for the files list. close GH-20218 --- UPGRADING | 5 + ext/zip/php_zip.c | 300 +++++++++++++++---------------------------- ext/zip/zip_stream.c | 2 +- 3 files changed, 111 insertions(+), 196 deletions(-) diff --git a/UPGRADING b/UPGRADING index 4cc79ebd33042..eb158460cefb7 100644 --- a/UPGRADING +++ b/UPGRADING @@ -51,6 +51,11 @@ PHP 8.6 UPGRADE NOTES - Phar: . Phar::mungServer() now supports reference values. +- Zip: + . ZipArchive::extractTo now raises a TypeError for the + files argument if one or more of the entries is not + a string. + ======================================== 6. New Functions ======================================== diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 92614bd40b82d..cf0234e7c2669 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -111,11 +111,8 @@ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */ } /* }}} */ -# define CWD_STATE_ALLOC(l) emalloc(l) -# define CWD_STATE_FREE(s) efree(s) - /* {{{ php_zip_extract_file */ -static int php_zip_extract_file(struct zip * za, char *dest, const char *file, size_t file_len, zip_int64_t idx) +static bool php_zip_extract_file(struct zip * za, char *dest, const char *file, size_t file_len, zip_int64_t idx) { php_stream_statbuf ssb; struct zip_file *zf; @@ -136,10 +133,10 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s if (idx < 0) { idx = zip_name_locate(za, file, 0); if (idx < 0) { - return 0; + return false; } } - new_state.cwd = CWD_STATE_ALLOC(1); + new_state.cwd = emalloc(1); new_state.cwd[0] = '\0'; new_state.cwd_length = 0; @@ -149,14 +146,14 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s virtual_file_ex(&new_state, file, NULL, CWD_EXPAND); path_cleaned = php_zip_make_relative_path(new_state.cwd, new_state.cwd_length); if(!path_cleaned) { - CWD_STATE_FREE(new_state.cwd); - return 0; + efree(new_state.cwd); + return false; } path_cleaned_len = strlen(path_cleaned); if (path_cleaned_len >= MAXPATHLEN || zip_stat_index(za, idx, 0, &sb) != 0) { - CWD_STATE_FREE(new_state.cwd); - return 0; + efree(new_state.cwd); + return false; } /* it is a directory only, see #40228 */ @@ -177,9 +174,9 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) { efree(file_dirname_fullpath); - zend_string_release_ex(file_basename, 0); - CWD_STATE_FREE(new_state.cwd); - return 0; + zend_string_release_ex(file_basename, false); + efree(new_state.cwd); + return false; } } @@ -189,33 +186,33 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s if (!ret) { efree(file_dirname_fullpath); if (!is_dir_only) { - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); } - CWD_STATE_FREE(new_state.cwd); - return 0; + efree(new_state.cwd); + return false; } } /* it is a standalone directory, job done */ if (is_dir_only) { efree(file_dirname_fullpath); - CWD_STATE_FREE(new_state.cwd); - return 1; + efree(new_state.cwd); + return true; } len = spprintf(&fullpath, 0, "%s/%s", file_dirname_fullpath, ZSTR_VAL(file_basename)); if (!len) { efree(file_dirname_fullpath); - zend_string_release_ex(file_basename, 0); - CWD_STATE_FREE(new_state.cwd); - return 0; + zend_string_release_ex(file_basename, false); + efree(new_state.cwd); + return false; } else if (len > MAXPATHLEN) { php_error_docref(NULL, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN); efree(fullpath); efree(file_dirname_fullpath); - zend_string_release_ex(file_basename, 0); - CWD_STATE_FREE(new_state.cwd); - return 0; + zend_string_release_ex(file_basename, false); + efree(new_state.cwd); + return false; } /* check again the full path, not sure if it @@ -225,9 +222,9 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s if (ZIP_OPENBASEDIR_CHECKPATH(fullpath)) { efree(fullpath); efree(file_dirname_fullpath); - zend_string_release_ex(file_basename, 0); - CWD_STATE_FREE(new_state.cwd); - return 0; + zend_string_release_ex(file_basename, false); + efree(new_state.cwd); + return false; } zf = zip_fopen_index(za, idx, 0); @@ -262,19 +259,15 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s done: efree(fullpath); - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); efree(file_dirname_fullpath); - CWD_STATE_FREE(new_state.cwd); + efree(new_state.cwd); - if (n<0) { - return 0; - } else { - return 1; - } + return !(n < 0); } /* }}} */ -static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t filename_len, +static zend_result php_zip_add_file(ze_zip_object *obj, const char *filename, size_t filename_len, char *entry_name, size_t entry_name_len, /* unused if replace >= 0 */ zip_uint64_t offset_start, zip_uint64_t offset_len, zend_long replace, /* index to replace, add new file if < 0 */ @@ -286,24 +279,24 @@ static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t fil php_stream_statbuf ssb; if (ZIP_OPENBASEDIR_CHECKPATH(filename)) { - return -1; + return FAILURE; } if (!expand_filepath(filename, resolved_path)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); - return -1; + return FAILURE; } if (php_stream_stat_path_ex(resolved_path, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); - return -1; + return FAILURE; } if (flags & ZIP_FL_OPEN_FILE_NOW) { FILE *fd; fd = fopen(resolved_path, "rb"); if (!fd) { - return -1; + return FAILURE; } flags ^= ZIP_FL_OPEN_FILE_NOW; zs = zip_source_filep(obj->za, fd, offset_start, offset_len); @@ -311,25 +304,25 @@ static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t fil zs = zip_source_file(obj->za, resolved_path, offset_start, offset_len); } if (!zs) { - return -1; + return FAILURE; } /* Replace */ if (replace >= 0) { if (zip_file_replace(obj->za, replace, zs, flags) < 0) { zip_source_free(zs); - return -1; + return FAILURE; } zip_error_clear(obj->za); - return 1; + return SUCCESS; } /* Add */ obj->last_id = zip_file_add(obj->za, entry_name, zs, flags); if (obj->last_id < 0) { zip_source_free(zs); - return -1; + return FAILURE; } zip_error_clear(obj->za); - return 1; + return SUCCESS; } /* }}} */ @@ -349,7 +342,7 @@ typedef struct { } zip_options; /* Expects opts to be zero-initialized. */ -static int php_zip_parse_options(HashTable *options, zip_options *opts) +static zend_result php_zip_parse_options(HashTable *options, zip_options *opts) /* {{{ */ { zval *option; @@ -397,7 +390,7 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts) if (Z_TYPE_P(option) != IS_STRING) { zend_type_error("Option \"enc_password\" must be of type string, %s given", zend_zval_value_name(option)); - return -1; + return FAILURE; } opts->enc_password = Z_STRVAL_P(option); } @@ -408,17 +401,17 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts) if (Z_TYPE_P(option) != IS_STRING) { zend_type_error("Option \"remove_path\" must be of type string, %s given", zend_zval_value_name(option)); - return -1; + return FAILURE; } if (Z_STRLEN_P(option) == 0) { zend_value_error("Option \"remove_path\" must not be empty"); - return -1; + return FAILURE; } if (Z_STRLEN_P(option) >= MAXPATHLEN) { zend_value_error("Option \"remove_path\" must be less than %d bytes", MAXPATHLEN - 1); - return -1; + return FAILURE; } opts->remove_path_len = Z_STRLEN_P(option); opts->remove_path = Z_STRVAL_P(option); @@ -428,17 +421,17 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts) if (Z_TYPE_P(option) != IS_STRING) { zend_type_error("Option \"add_path\" must be of type string, %s given", zend_zval_value_name(option)); - return -1; + return FAILURE; } if (Z_STRLEN_P(option) == 0) { zend_value_error("Option \"add_path\" must not be empty"); - return -1; + return FAILURE; } if (Z_STRLEN_P(option) >= MAXPATHLEN) { zend_value_error("Option \"add_path\" must be less than %d bytes", MAXPATHLEN - 1); - return -1; + return FAILURE; } opts->add_path_len = Z_STRLEN_P(option); opts->add_path = Z_STRVAL_P(option); @@ -448,12 +441,12 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts) if (Z_TYPE_P(option) != IS_LONG) { zend_type_error("Option \"flags\" must be of type int, %s given", zend_zval_value_name(option)); - return -1; + return FAILURE; } opts->flags = Z_LVAL_P(option); } - return 1; + return SUCCESS; } /* }}} */ @@ -575,7 +568,7 @@ static char * php_zipobj_get_zip_comment(ze_zip_object *obj, int *len) /* {{{ */ } /* }}} */ -int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value) /* {{{ */ +int php_zip_glob(zend_string *spattern, zend_long flags, zval *return_value) /* {{{ */ { int cwd_skip = 0; #ifdef ZTS @@ -584,9 +577,11 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v char *result; #endif php_glob_t globbuf; - size_t n; int ret; + const char *pattern = ZSTR_VAL(spattern); + size_t pattern_len = ZSTR_LEN(spattern); + if (pattern_len >= MAXPATHLEN) { php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); return -1; @@ -646,7 +641,7 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v } array_init(return_value); - for (n = 0; n < globbuf.gl_pathc; n++) { + for (size_t n = 0; n < globbuf.gl_pathc; n++) { /* we need to do this every time since PHP_GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the * following: @@ -717,7 +712,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val re = pcre_get_compiled_regex(regexp, &capture_count); if (!re) { for (i = 0; i < files_cnt; i++) { - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); } efree(namelist); php_error_docref(NULL, E_WARNING, "Invalid expression"); @@ -734,28 +729,28 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val if ((namelist_len == 1 && ZSTR_VAL(namelist[i])[0] == '.') || (namelist_len == 2 && ZSTR_VAL(namelist[i])[0] == '.' && ZSTR_VAL(namelist[i])[1] == '.')) { - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); continue; } if ((path_len + namelist_len + 1) >= MAXPATHLEN) { php_error_docref(NULL, E_WARNING, "add_path string too long (max: %u, %zu given)", MAXPATHLEN - 1, (path_len + namelist_len + 1)); - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); break; } match_data = php_pcre_create_match_data(capture_count, re); if (!match_data) { /* Allocation failed, but can proceed to the next pattern. */ - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); continue; } rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, 0, match_data, mctx); php_pcre_free_match_data(match_data); /* 0 means that the vector is too small to hold all the captured substring offsets */ if (rc < 0) { - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); continue; } @@ -763,17 +758,17 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val if (0 != VCWD_STAT(fullpath, &s)) { php_error_docref(NULL, E_WARNING, "Cannot read <%s>", fullpath); - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); continue; } if (S_IFDIR == (s.st_mode & S_IFMT)) { - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); continue; } add_next_index_string(return_value, fullpath); - zend_string_release_ex(namelist[i], 0); + zend_string_release_ex(namelist[i], false); } efree(namelist); } @@ -806,9 +801,9 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z hnd.read_const_char_func = read_char_func; hnd.read_int_func = read_int_func; hnd.type = rettype; - str = zend_string_init_interned(name, strlen(name), 1); + str = zend_string_init_interned(name, strlen(name), true); zend_hash_add_mem(prop_handler, str, &hnd, sizeof(zip_prop_handler)); - zend_string_release_ex(str, 1); + zend_string_release_ex(str, true); } /* }}} */ @@ -961,12 +956,12 @@ static HashTable *php_zip_get_properties(zend_object *object)/* {{{ */ zend_string *key; obj = php_zip_fetch_object(object); - props = zend_std_get_properties(object); if (obj->prop_handler == NULL) { return NULL; } + props = zend_std_get_properties(object); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(obj->prop_handler, key, hnd) { zval *ret, val; ret = php_zip_property_reader(obj, hnd, &val); @@ -1219,7 +1214,7 @@ PHP_FUNCTION(zip_read) RETURN_THROWS(); } - if (rsrc_int && rsrc_int->za) { + if (rsrc_int->za) { if (rsrc_int->index_current >= rsrc_int->num_files) { RETURN_FALSE; } @@ -1272,11 +1267,7 @@ PHP_FUNCTION(zip_entry_open) RETURN_THROWS(); } - if (zr_rsrc->zf != NULL) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(zr_rsrc->zf != NULL); } /* }}} */ @@ -1321,7 +1312,7 @@ PHP_FUNCTION(zip_entry_read) } if (zr_rsrc->zf) { - buffer = zend_string_safe_alloc(1, len, 0, 0); + buffer = zend_string_safe_alloc(1, len, 0, false); n = zip_fread(zr_rsrc->zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer)); if (n > 0) { ZSTR_VAL(buffer)[n] = '\0'; @@ -1514,12 +1505,7 @@ PHP_METHOD(ZipArchive, setPassword) RETURN_FALSE; } - int res = zip_set_default_password(intern, (const char *)password); - if (res == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(zip_set_default_password(intern, (const char *)password) == 0); } /* }}} */ @@ -1569,11 +1555,7 @@ PHP_METHOD(ZipArchive, close) ze_obj->filename_len = 0; ze_obj->za = NULL; - if (!err) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + RETURN_BOOL(!err); } /* }}} */ @@ -1729,24 +1711,21 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* zend_argument_must_not_be_empty_error(1); RETURN_THROWS(); } - if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) < 0)) { + if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) == FAILURE)) { RETURN_THROWS(); } if (type == 1) { - found = php_zip_glob(ZSTR_VAL(pattern), ZSTR_LEN(pattern), glob_flags, return_value); + found = php_zip_glob(pattern, glob_flags, return_value); } else { found = php_zip_pcre(pattern, path, path_len, return_value); } if (found > 0) { - int i; zval *zval_file; - ze_zip_object *ze_obj; + ze_zip_object *ze_obj = Z_ZIP_P(self); - ze_obj = Z_ZIP_P(self); - - for (i = 0; i < found; i++) { + for (int i = 0; i < found; i++) { char *file_stripped, *entry_name; size_t entry_name_len, file_stripped_len; char entry_name_buf[MAXPATHLEN]; @@ -1773,7 +1752,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* if (opts.add_path) { if ((opts.add_path_len + file_stripped_len) > MAXPATHLEN) { if (basename) { - zend_string_release_ex(basename, 0); + zend_string_release_ex(basename, false); } php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %zd given)", MAXPATHLEN - 1, (opts.add_path_len + file_stripped_len)); @@ -1788,12 +1767,12 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* entry_name = entry_name_buf; entry_name_len = strlen(entry_name); if (basename) { - zend_string_release_ex(basename, 0); + zend_string_release_ex(basename, false); basename = NULL; } if (php_zip_add_file(ze_obj, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), - entry_name, entry_name_len, 0, 0, -1, opts.flags) < 0) { + entry_name, entry_name_len, 0, 0, -1, opts.flags) == FAILURE) { zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } @@ -1860,12 +1839,8 @@ PHP_METHOD(ZipArchive, addFile) entry_name_len = ZSTR_LEN(filename); } - if (php_zip_add_file(Z_ZIP_P(self), ZSTR_VAL(filename), ZSTR_LEN(filename), - entry_name, entry_name_len, offset_start, offset_len, -1, flags) < 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(php_zip_add_file(Z_ZIP_P(self), ZSTR_VAL(filename), ZSTR_LEN(filename), + entry_name, entry_name_len, offset_start, offset_len, -1, flags) == SUCCESS); } /* }}} */ @@ -1893,12 +1868,8 @@ PHP_METHOD(ZipArchive, replaceFile) RETURN_THROWS(); } - if (php_zip_add_file(Z_ZIP_P(self), ZSTR_VAL(filename), ZSTR_LEN(filename), - NULL, 0, offset_start, offset_len, index, flags) < 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(php_zip_add_file(Z_ZIP_P(self), ZSTR_VAL(filename), ZSTR_LEN(filename), + NULL, 0, offset_start, offset_len, index, flags) == SUCCESS); } /* }}} */ @@ -2068,11 +2039,7 @@ PHP_METHOD(ZipArchive, setArchiveComment) RETURN_THROWS(); } - if (zip_set_archive_comment(intern, (const char *)comment, comment_len)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_set_archive_comment(intern, (const char *)comment, comment_len) == 0); } /* }}} */ @@ -2111,11 +2078,7 @@ PHP_METHOD(ZipArchive, setArchiveFlag) ZIP_FROM_OBJECT(intern, self); - if (zip_set_archive_flag(intern, flag, (int)value)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_set_archive_flag(intern, flag, (int)value) == 0); } PHP_METHOD(ZipArchive, getArchiveFlag) @@ -2221,10 +2184,7 @@ PHP_METHOD(ZipArchive, setExternalAttributesName) idx = zip_name_locate(intern, name, 0); - if (idx < 0) { - RETURN_FALSE; - } - if (zip_file_set_external_attributes(intern, idx, (zip_flags_t)flags, + if (idx < 0 || zip_file_set_external_attributes(intern, idx, (zip_flags_t)flags, (zip_uint8_t)(opsys&0xff), (zip_uint32_t)attr) < 0) { RETURN_FALSE; } @@ -2248,11 +2208,8 @@ PHP_METHOD(ZipArchive, setExternalAttributesIndex) ZIP_FROM_OBJECT(intern, self); PHP_ZIP_STAT_INDEX(intern, index, 0, sb); - if (zip_file_set_external_attributes(intern, (zip_uint64_t)index, - (zip_flags_t)flags, (zip_uint8_t)(opsys&0xff), (zip_uint32_t)attr) < 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_file_set_external_attributes(intern, (zip_uint64_t)index, + (zip_flags_t)flags, (zip_uint8_t)(opsys&0xff), (zip_uint32_t)attr) == 0); } /* }}} */ @@ -2282,10 +2239,7 @@ PHP_METHOD(ZipArchive, getExternalAttributesName) idx = zip_name_locate(intern, name, 0); - if (idx < 0) { - RETURN_FALSE; - } - if (zip_file_get_external_attributes(intern, idx, + if (idx < 0 || zip_file_get_external_attributes(intern, idx, (zip_flags_t)flags, &opsys, &attr) < 0) { RETURN_FALSE; } @@ -2386,10 +2340,7 @@ PHP_METHOD(ZipArchive, setEncryptionIndex) RETURN_FALSE; } - if (zip_file_set_encryption(intern, index, (zip_uint16_t)method, password)) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_file_set_encryption(intern, index, (zip_uint16_t)method, password) == 0); } /* }}} */ #endif @@ -2480,11 +2431,8 @@ PHP_METHOD(ZipArchive, setCompressionName) RETURN_FALSE; } - if (zip_set_file_compression(intern, (zip_uint64_t)idx, - (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_set_file_compression(intern, (zip_uint64_t)idx, + (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) == 0); } /* }}} */ @@ -2503,11 +2451,8 @@ PHP_METHOD(ZipArchive, setCompressionIndex) ZIP_FROM_OBJECT(intern, this); - if (zip_set_file_compression(intern, (zip_uint64_t)index, - (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_set_file_compression(intern, (zip_uint64_t)index, + (zip_int32_t)comp_method, (zip_uint32_t)comp_flags) == 0); } /* }}} */ @@ -2540,11 +2485,8 @@ PHP_METHOD(ZipArchive, setMtimeName) RETURN_FALSE; } - if (zip_file_set_mtime(intern, (zip_uint64_t)idx, - (time_t)mtime, (zip_uint32_t)flags) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_file_set_mtime(intern, (zip_uint64_t)idx, + (time_t)mtime, (zip_uint32_t)flags) == 0); } /* }}} */ @@ -2563,11 +2505,8 @@ PHP_METHOD(ZipArchive, setMtimeIndex) ZIP_FROM_OBJECT(intern, this); - if (zip_file_set_mtime(intern, (zip_uint64_t)index, - (time_t)mtime, (zip_uint32_t)flags) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(zip_file_set_mtime(intern, (zip_uint64_t)index, + (time_t)mtime, (zip_uint32_t)flags) == 0); } /* }}} */ #endif @@ -2589,11 +2528,7 @@ PHP_METHOD(ZipArchive, deleteIndex) RETURN_FALSE; } - if (zip_delete(intern, index) < 0) { - RETURN_FALSE; - } - - RETURN_TRUE; + RETURN_BOOL(zip_delete(intern, index) == 0); } /* }}} */ @@ -2648,11 +2583,7 @@ PHP_METHOD(ZipArchive, renameIndex) RETURN_THROWS(); } - if (zip_file_rename(intern, index, (const char *)new_name, 0) != 0) { - RETURN_FALSE; - } - - RETURN_TRUE; + RETURN_BOOL(zip_file_rename(intern, index, (const char *)new_name, 0) == 0); } /* }}} */ @@ -2678,11 +2609,7 @@ PHP_METHOD(ZipArchive, renameName) PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - if (zip_file_rename(intern, sb.index, (const char *)new_name, 0)) { - RETURN_FALSE; - } - - RETURN_TRUE; + RETURN_BOOL(zip_file_rename(intern, sb.index, (const char *)new_name, 0) == 0); } /* }}} */ @@ -2703,11 +2630,7 @@ PHP_METHOD(ZipArchive, unchangeIndex) RETURN_FALSE; } - if (zip_unchange(intern, index) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_unchange(intern, index) == 0); } /* }}} */ @@ -2732,11 +2655,7 @@ PHP_METHOD(ZipArchive, unchangeName) PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - if (zip_unchange(intern, sb.index) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_unchange(intern, sb.index) == 0); } /* }}} */ @@ -2752,11 +2671,7 @@ PHP_METHOD(ZipArchive, unchangeAll) ZIP_FROM_OBJECT(intern, self); - if (zip_unchange_all(intern) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_unchange_all(intern) == 0); } /* }}} */ @@ -2772,11 +2687,7 @@ PHP_METHOD(ZipArchive, unchangeArchive) ZIP_FROM_OBJECT(intern, self); - if (zip_unchange_archive(intern) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } + RETURN_BOOL(zip_unchange_archive(intern) == 0); } /* }}} */ @@ -2832,14 +2743,13 @@ PHP_METHOD(ZipArchive, extractTo) for (i = 0; i < nelems; i++) { zval *zval_file; if ((zval_file = zend_hash_index_find_deref(files_ht, i)) != NULL) { - switch (Z_TYPE_P(zval_file)) { - case IS_LONG: - break; - case IS_STRING: + if (Z_TYPE_P(zval_file) == IS_STRING) { if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), -1)) { RETURN_FALSE; } - break; + } else { + zend_argument_type_error(2, "must only have elements of type string, %s given", zend_zval_value_name(zval_file)); + RETURN_THROWS(); } } } diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index a32324347d674..c0283b49eaaf3 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -82,7 +82,7 @@ static ssize_t php_zip_ops_write(php_stream *stream, const char *buf, size_t cou return -1; } - return count; + return (ssize_t)count; } /* }}} */ From ed6218d5b1b228333a1bb2f24ecc6901006532d2 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 28 Oct 2025 07:52:55 +0100 Subject: [PATCH 277/386] phar: Use ZEND_PARSE_PARAMETERS_NONE() (#20313) This is equivalent to the non-fast-ZPP code, but is less lines. --- ext/phar/phar_object.c | 117 ++++++++++------------------------------- 1 file changed, 29 insertions(+), 88 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index fba332aa21a0b..155a3fca67bf2 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -915,9 +915,7 @@ PHP_METHOD(Phar, mungServer) */ PHP_METHOD(Phar, interceptFileFuncs) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); phar_intercept_functions(); } /* }}} */ @@ -991,9 +989,7 @@ PHP_METHOD(Phar, loadPhar) /* {{{ Returns the api version */ PHP_METHOD(Phar, apiVersion) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_STRINGL(PHP_PHAR_API_VERSION, sizeof(PHP_PHAR_API_VERSION)-1); } /* }}}*/ @@ -1022,9 +1018,7 @@ PHP_METHOD(Phar, canCompress) /* {{{ Returns whether phar extension supports writing and creating phars */ PHP_METHOD(Phar, canWrite) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(!PHAR_G(readonly)); } /* }}} */ @@ -1220,9 +1214,7 @@ PHP_METHOD(Phar, __construct) /* {{{ Return array of supported signature types */ PHP_METHOD(Phar, getSupportedSignatures) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -1247,9 +1239,7 @@ PHP_METHOD(Phar, getSupportedSignatures) /* {{{ Return array of supported comparession algorithms */ PHP_METHOD(Phar, getSupportedCompression) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); phar_request_initialize(); @@ -1334,9 +1324,7 @@ PHP_METHOD(Phar, __destruct) { phar_archive_object *phar_obj = PHAR_FETCH_INTERNAL(); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (phar_obj->archive && phar_obj->archive->is_persistent) { zend_hash_str_del(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(phar_obj->archive)); @@ -2511,9 +2499,7 @@ PHP_METHOD(Phar, convertToData) */ PHP_METHOD(Phar, isCompressed) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2534,9 +2520,7 @@ PHP_METHOD(Phar, isWritable) { php_stream_statbuf ssb; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2604,9 +2588,7 @@ PHP_METHOD(Phar, delete) /* {{{ Returns the alias for the Phar or NULL. */ PHP_METHOD(Phar, getAlias) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2619,9 +2601,7 @@ PHP_METHOD(Phar, getAlias) /* {{{ Returns the real path to the phar archive on disk */ PHP_METHOD(Phar, getPath) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2731,9 +2711,7 @@ PHP_METHOD(Phar, setAlias) /* {{{ Return version info of Phar archive */ PHP_METHOD(Phar, getVersion) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2744,9 +2722,7 @@ PHP_METHOD(Phar, getVersion) /* {{{ Do not flush a writeable phar (save its contents) until explicitly requested */ PHP_METHOD(Phar, startBuffering) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2757,9 +2733,7 @@ PHP_METHOD(Phar, startBuffering) /* {{{ Returns whether write operations are flushing to disk immediately. */ PHP_METHOD(Phar, isBuffering) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -2772,9 +2746,7 @@ PHP_METHOD(Phar, stopBuffering) { char *error; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -3020,9 +2992,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm) /* {{{ Returns a hash signature, or FALSE if the archive is unsigned. */ PHP_METHOD(Phar, getSignature) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -3067,9 +3037,7 @@ PHP_METHOD(Phar, getSignature) /* {{{ Return whether phar was modified */ PHP_METHOD(Phar, getModified) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -3329,10 +3297,7 @@ PHP_METHOD(Phar, decompressFiles) { char *error; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -3846,9 +3811,7 @@ PHP_METHOD(Phar, getStub) php_stream_filter *filter = NULL; phar_entry_info *stub; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -3937,9 +3900,7 @@ PHP_METHOD(Phar, getStub) /* {{{ Returns TRUE if the phar has global metadata, FALSE otherwise. */ PHP_METHOD(Phar, hasMetadata) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -4040,9 +4001,7 @@ PHP_METHOD(Phar, delMetadata) { char *error; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); @@ -4458,9 +4417,7 @@ PHP_METHOD(PharFileInfo, __construct) /* {{{ clean up directory-based entry objects */ PHP_METHOD(PharFileInfo, __destruct) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT_EX(false); @@ -4483,9 +4440,7 @@ PHP_METHOD(PharFileInfo, __destruct) /* {{{ Returns the compressed size */ PHP_METHOD(PharFileInfo, getCompressedSize) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4526,9 +4481,7 @@ PHP_METHOD(PharFileInfo, isCompressed) /* {{{ Returns CRC32 code or throws an exception if not CRC checked */ PHP_METHOD(PharFileInfo, getCRC32) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4550,9 +4503,7 @@ PHP_METHOD(PharFileInfo, getCRC32) /* {{{ Returns whether file entry is CRC checked */ PHP_METHOD(PharFileInfo, isCRCChecked) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4563,9 +4514,7 @@ PHP_METHOD(PharFileInfo, isCRCChecked) /* {{{ Returns the Phar file entry flags */ PHP_METHOD(PharFileInfo, getPharFlags) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4638,9 +4587,7 @@ PHP_METHOD(PharFileInfo, chmod) /* {{{ Returns the metadata of the entry */ PHP_METHOD(PharFileInfo, hasMetadata) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4723,9 +4670,7 @@ PHP_METHOD(PharFileInfo, delMetadata) { char *error; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4780,9 +4725,7 @@ PHP_METHOD(PharFileInfo, getContent) phar_entry_info *link; zend_string *str; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); @@ -4954,9 +4897,7 @@ PHP_METHOD(PharFileInfo, decompress) char *error; char *compression_type; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHAR_ENTRY_OBJECT(); From 336fbf09d77ecbf0dddf47c32e91989b6c3e3216 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:23:51 +0100 Subject: [PATCH 278/386] [ci skip] Remove very outdated comment --- Zend/zend_hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 687450569bf6c..6064b42218327 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -2851,7 +2851,6 @@ ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(const HashTable * } -/* This function should be made binary safe */ ZEND_API zend_hash_key_type ZEND_FASTCALL zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, const HashPosition *pos) { uint32_t idx; From 7815ab9b223e2441415fe55d944a16f9a9bb9dd7 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 29 Oct 2025 13:22:56 +0000 Subject: [PATCH 279/386] Zend: add const qualifiers when possible for _zend_execute_data.func related uses (#20263) The initial motivation was to see if it is possible to make the `func` field of `_zend_execute_data` constant. For various reasons, this is not possible, but the added `const` qualifiers during this exploration remain useful. --- Zend/zend.c | 8 +++----- Zend/zend_API.c | 22 ++++++++++----------- Zend/zend_API.h | 8 ++++---- Zend/zend_closures.c | 2 +- Zend/zend_closures.h | 2 +- Zend/zend_execute.c | 18 ++++++++--------- Zend/zend_execute.h | 6 +++--- Zend/zend_execute_API.c | 6 +++--- Zend/zend_object_handlers.c | 4 ++-- Zend/zend_observer.c | 39 +++++++++++++++++-------------------- Zend/zend_observer.h | 14 ++++++------- 11 files changed, 62 insertions(+), 67 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 82b6e189108cd..4d024444a4be9 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1501,12 +1501,10 @@ ZEND_API ZEND_COLD void zend_error_zstr_at( /* Report about uncaught exception in case of fatal errors */ if (EG(exception)) { - zend_execute_data *ex; - const zend_op *opline; - if (type & E_FATAL_ERRORS) { - ex = EG(current_execute_data); - opline = NULL; + zend_execute_data *ex = EG(current_execute_data); + const zend_op *opline = NULL; + while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { ex = ex->prev_execute_data; } diff --git a/Zend/zend_API.c b/Zend/zend_API.c index d9c951c928896..7897ac1473601 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -480,7 +480,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **p /* }}} */ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32_t arg_num) { - zend_function *func = zend_active_function(); + const zend_function *func = zend_active_function(); ZEND_ASSERT(arg_num > 0); uint32_t arg_offset = arg_num - 1; if (arg_offset >= func->common.num_args) { @@ -488,7 +488,7 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32 arg_offset = func->common.num_args; } - zend_arg_info *arg_info = &func->common.arg_info[arg_offset]; + const zend_arg_info *arg_info = &func->common.arg_info[arg_offset]; zend_string *func_name = get_active_function_or_method_name(); const char *arg_name = get_active_function_arg_name(arg_num); @@ -1118,7 +1118,7 @@ ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg } static ZEND_COLD void zend_parse_parameters_debug_error(const char *msg) { - zend_function *active_function = EG(current_execute_data)->func; + const zend_function *active_function = EG(current_execute_data)->func; const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; zend_error_noreturn(E_CORE_ERROR, "%s%s%s(): %s", @@ -3681,12 +3681,12 @@ ZEND_API void zend_disable_functions(const char *function_list) /* {{{ */ } /* }}} */ -static zend_always_inline zend_class_entry *get_scope(zend_execute_data *frame) +static zend_always_inline zend_class_entry *get_scope(const zend_execute_data *frame) { return frame && frame->func ? frame->func->common.scope : NULL; } -static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *scope, zend_execute_data *frame, zend_fcall_info_cache *fcc, bool *strict_class, char **error, bool suppress_deprecation) /* {{{ */ +static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *scope, const zend_execute_data *frame, zend_fcall_info_cache *fcc, bool *strict_class, char **error, bool suppress_deprecation) /* {{{ */ { bool ret = false; zend_class_entry *ce; @@ -3790,7 +3790,7 @@ ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc) { } } -static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_execute_data *frame, zend_fcall_info_cache *fcc, bool strict_class, char **error, bool suppress_deprecation) /* {{{ */ +static zend_always_inline bool zend_is_callable_check_func(zval *callable, const zend_execute_data *frame, zend_fcall_info_cache *fcc, bool strict_class, char **error, bool suppress_deprecation) /* {{{ */ { zend_class_entry *ce_org = fcc->calling_scope; bool retval = false; @@ -4036,7 +4036,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, zend_ } /* }}} */ -ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object) /* {{{ */ +ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object) /* {{{ */ { try_again: switch (Z_TYPE_P(callable)) { @@ -4070,7 +4070,7 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *obj } case IS_OBJECT: { - zend_class_entry *ce = Z_OBJCE_P(callable); + const zend_class_entry *ce = Z_OBJCE_P(callable); if (ce == zend_ce_closure) { const zend_function *fn = zend_get_closure_method_def(Z_OBJ_P(callable)); @@ -4101,7 +4101,7 @@ ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */ /* }}} */ ZEND_API bool zend_is_callable_at_frame( - zval *callable, zend_object *object, zend_execute_data *frame, + zval *callable, zend_object *object, const zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error) /* {{{ */ { bool ret; @@ -4214,7 +4214,7 @@ ZEND_API bool zend_is_callable_at_frame( ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */ { /* Determine callability at the first parent user frame. */ - zend_execute_data *frame = EG(current_execute_data); + const zend_execute_data *frame = EG(current_execute_data); while (frame && (!frame->func || !ZEND_USER_CODE(frame->func->type))) { frame = frame->prev_execute_data; } @@ -5274,7 +5274,7 @@ static zend_string *try_parse_string(const char *str, size_t len, char quote) { } ZEND_API zend_result zend_get_default_from_internal_arg_info( - zval *default_value_zval, zend_internal_arg_info *arg_info) + zval *default_value_zval, const zend_internal_arg_info *arg_info) { const char *default_value = arg_info->default_value; if (!default_value) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 440a1874adff1..d322fd485ca64 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -410,10 +410,10 @@ ZEND_API ZEND_COLD void zend_wrong_property_read(zval *object, zval *property); #define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1) ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); -ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object); +ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object); ZEND_API zend_string *zend_get_callable_name(zval *callable); ZEND_API bool zend_is_callable_at_frame( - zval *callable, zend_object *object, zend_execute_data *frame, + zval *callable, zend_object *object, const zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); @@ -896,7 +896,7 @@ ZEND_API zend_result zend_set_local_var_str(const char *name, size_t len, zval * static zend_always_inline zend_result zend_forbid_dynamic_call(void) { - zend_execute_data *ex = EG(current_execute_data); + const zend_execute_data *ex = EG(current_execute_data); ZEND_ASSERT(ex != NULL && ex->func != NULL); if (ZEND_CALL_INFO(ex) & ZEND_CALL_DYNAMIC) { @@ -927,7 +927,7 @@ ZEND_API bool zend_is_iterable(const zval *iterable); ZEND_API bool zend_is_countable(const zval *countable); ZEND_API zend_result zend_get_default_from_internal_arg_info( - zval *default_value_zval, zend_internal_arg_info *arg_info); + zval *default_value_zval, const zend_internal_arg_info *arg_info); END_EXTERN_C() diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 948139a865905..4ecb6b2c493b9 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -888,7 +888,7 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_clas /* __call and __callStatic name the arguments "$arguments" in the docs. */ static zend_internal_arg_info trampoline_arg_info[] = {ZEND_ARG_VARIADIC_TYPE_INFO(false, arguments, IS_MIXED, false)}; -void zend_closure_from_frame(zval *return_value, zend_execute_data *call) { /* {{{ */ +void zend_closure_from_frame(zval *return_value, const zend_execute_data *call) { /* {{{ */ zval instance; zend_internal_function trampoline; zend_function *mptr = call->func; diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index ced1b5ba48c15..8bea4ffb051e8 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -31,7 +31,7 @@ BEGIN_EXTERN_C() void zend_register_closure_ce(void); void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var); void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val); -void zend_closure_from_frame(zval *closure_zv, zend_execute_data *frame); +void zend_closure_from_frame(zval *closure_zv, const zend_execute_data *frame); extern ZEND_API zend_class_entry *zend_ce_closure; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 69665c5bbbb1f..d411dcbc3b953 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -4346,7 +4346,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_fcall_interrupt(zend_execute_data *ca */ static zend_never_inline void zend_copy_extra_args(EXECUTE_DATA_D) { - zend_op_array *op_array = &EX(func)->op_array; + const zend_op_array *op_array = &EX(func)->op_array; uint32_t first_extra_arg = op_array->num_args; uint32_t num_args = EX_NUM_ARGS(); zval *src; @@ -4926,7 +4926,7 @@ static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, zval_ptr_dtor_nogc(var); } else if (kind == ZEND_LIVE_ROPE) { zend_string **rope = (zend_string **)var; - zend_op *last = EX(func)->op_array.opcodes + op_num; + const zend_op *last = EX(func)->op_array.opcodes + op_num; while ((last->opcode != ZEND_ROPE_ADD && last->opcode != ZEND_ROPE_INIT) || last->result.var != var_num) { ZEND_ASSERT(last >= EX(func)->op_array.opcodes); @@ -4982,7 +4982,7 @@ ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_d return NULL; } - zend_op_array *op_array = &EX(func)->op_array; + const zend_op_array *op_array = &EX(func)->op_array; if (!(EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE)) { uint32_t i, num_cvs = EX(func)->op_array.last_var; @@ -4993,7 +4993,7 @@ ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_d if (EX_CALL_INFO() & ZEND_CALL_FREE_EXTRA_ARGS) { zval *zv = EX_VAR_NUM(op_array->last_var + op_array->T); - zval *end = zv + (EX_NUM_ARGS() - op_array->num_args); + const zval *end = zv + (EX_NUM_ARGS() - op_array->num_args); while (zv != end) { zend_get_gc_buffer_add_zval(gc_buffer, zv++); } @@ -5462,7 +5462,7 @@ static zend_never_inline zend_result ZEND_FASTCALL zend_quick_check_constant( } /* }}} */ static zend_always_inline uint32_t zend_get_arg_offset_by_name( - zend_function *fbc, zend_string *arg_name, void **cache_slot) { + const zend_function *fbc, const zend_string *arg_name, void **cache_slot) { /* Due to closures, the `fbc` address isn't unique if the memory address is reused. * The argument info will be however and uniquely positions the arguments. * We do support NULL arg_info, so we have to distinguish that from an uninitialized cache slot. */ @@ -5477,7 +5477,7 @@ static zend_always_inline uint32_t zend_get_arg_offset_by_name( if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) || EXPECTED(fbc->common.fn_flags & ZEND_ACC_USER_ARG_INFO)) { for (uint32_t i = 0; i < num_args; i++) { - zend_arg_info *arg_info = &fbc->common.arg_info[i]; + const zend_arg_info *arg_info = &fbc->common.arg_info[i]; if (zend_string_equals(arg_name, arg_info->name)) { if (fbc->type == ZEND_USER_FUNCTION && (!fbc->op_array.refcount || !(fbc->op_array.fn_flags & ZEND_ACC_CLOSURE))) { *cache_slot = unique_id; @@ -5489,7 +5489,7 @@ static zend_always_inline uint32_t zend_get_arg_offset_by_name( } else { ZEND_ASSERT(num_args == 0 || fbc->internal_function.arg_info); for (uint32_t i = 0; i < num_args; i++) { - zend_internal_arg_info *arg_info = &fbc->internal_function.arg_info[i]; + const zend_internal_arg_info *arg_info = &fbc->internal_function.arg_info[i]; size_t len = strlen(arg_info->name); if (zend_string_equals_cstr(arg_name, arg_info->name, len)) { *cache_slot = unique_id; @@ -5517,7 +5517,7 @@ zval * ZEND_FASTCALL zend_handle_named_arg( zend_execute_data **call_ptr, zend_string *arg_name, uint32_t *arg_num_ptr, void **cache_slot) { zend_execute_data *call = *call_ptr; - zend_function *fbc = call->func; + const zend_function *fbc = call->func; uint32_t arg_offset = zend_get_arg_offset_by_name(fbc, arg_name, cache_slot); if (UNEXPECTED(arg_offset == (uint32_t) -1)) { zend_throw_error(NULL, "Unknown named parameter $%s", ZSTR_VAL(arg_name)); @@ -5603,7 +5603,7 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal continue; } - zend_op *opline = &op_array->opcodes[i]; + const zend_op *opline = &op_array->opcodes[i]; if (EXPECTED(opline->opcode == ZEND_RECV_INIT)) { zval *default_value = RT_CONSTANT(opline, opline->op2); if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) { diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 920c702785ca4..4715fd00fd463 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -453,11 +453,11 @@ ZEND_API const char *get_active_class_name(const char **space); ZEND_API const char *get_active_function_name(void); ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); -ZEND_API zend_function *zend_active_function_ex(const zend_execute_data *execute_data); +ZEND_API const zend_function *zend_active_function_ex(const zend_execute_data *execute_data); -static zend_always_inline zend_function *zend_active_function(void) +static zend_always_inline const zend_function *zend_active_function(void) { - zend_function *func = EG(current_execute_data)->func; + const zend_function *func = EG(current_execute_data)->func; if (ZEND_USER_CODE(func->type)) { return zend_active_function_ex(EG(current_execute_data)); } else { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f174aac49ef4d..660975f9bc1b5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -601,9 +601,9 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */ } /* }}} */ -ZEND_API zend_function *zend_active_function_ex(const zend_execute_data *execute_data) +ZEND_API const zend_function *zend_active_function_ex(const zend_execute_data *execute_data) { - zend_function *func = EX(func); + const zend_function *func = EX(func); /* Resolve function if op is a frameless call. */ if (ZEND_USER_CODE(func->type)) { @@ -717,7 +717,7 @@ ZEND_API uint32_t zend_get_executed_lineno(void) /* {{{ */ ZEND_API zend_class_entry *zend_get_executed_scope(void) /* {{{ */ { - zend_execute_data *ex = EG(current_execute_data); + const zend_execute_data *ex = EG(current_execute_data); while (1) { if (!ex) { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 79be10572d3bf..68daa207ee6e4 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -680,7 +680,7 @@ static ZEND_FUNCTION(zend_parent_hook_set_trampoline); static bool zend_is_in_hook(const zend_property_info *prop_info) { - zend_execute_data *execute_data = EG(current_execute_data); + const zend_execute_data *execute_data = EG(current_execute_data); if (!execute_data || !EX(func) || !EX(func)->common.prop_info) { return false; } @@ -996,7 +996,7 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int /* }}} */ static zend_always_inline bool property_uses_strict_types(void) { - zend_execute_data *execute_data = EG(current_execute_data); + const zend_execute_data *execute_data = EG(current_execute_data); return execute_data && execute_data->func && ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)); diff --git a/Zend/zend_observer.c b/Zend/zend_observer.c index 15722eb6b2eb3..bee20bdbc20dc 100644 --- a/Zend/zend_observer.c +++ b/Zend/zend_observer.c @@ -115,8 +115,8 @@ ZEND_API void zend_observer_shutdown(void) static void zend_observer_fcall_install(zend_execute_data *execute_data) { - zend_llist *list = &zend_observers_fcall_list; - zend_function *function = execute_data->func; + const zend_llist *list = &zend_observers_fcall_list; + const zend_function *function = execute_data->func; ZEND_ASSERT(RUN_TIME_CACHE(&function->common)); zend_observer_fcall_begin_handler *begin_handlers = ZEND_OBSERVER_DATA(function), *begin_handlers_start = begin_handlers; @@ -126,7 +126,7 @@ static void zend_observer_fcall_install(zend_execute_data *execute_data) *end_handlers = ZEND_OBSERVER_NOT_OBSERVED; bool has_handlers = false; - for (zend_llist_element *element = list->head; element; element = element->next) { + for (const zend_llist_element *element = list->head; element; element = element->next) { zend_observer_fcall_init init; memcpy(&init, element->data, sizeof init); zend_observer_fcall_handlers handlers = init(execute_data); @@ -157,7 +157,7 @@ static void zend_observer_fcall_install(zend_execute_data *execute_data) * the previous next handler is now at the place where the current handler was. * Hence, the next handler executed will be the one after the next handler. * Callees must thus invoke the next handler themselves, with the same arguments they were passed. */ -static bool zend_observer_remove_handler(void **first_handler, void *old_handler, void **next_handler) { +static bool zend_observer_remove_handler(void **first_handler, const void *old_handler, void **next_handler) { size_t registered_observers = zend_observers_fcall_list.count; void **last_handler = first_handler + registered_observers - 1; @@ -179,7 +179,7 @@ static bool zend_observer_remove_handler(void **first_handler, void *old_handler return false; } -ZEND_API void zend_observer_add_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin) { +ZEND_API void zend_observer_add_begin_handler(const zend_function *function, zend_observer_fcall_begin_handler begin) { size_t registered_observers = zend_observers_fcall_list.count; zend_observer_fcall_begin_handler *first_handler = ZEND_OBSERVER_DATA(function), *last_handler = first_handler + registered_observers - 1; if (*first_handler == ZEND_OBSERVER_NOT_OBSERVED || *first_handler == ZEND_OBSERVER_NONE_OBSERVED) { @@ -196,7 +196,7 @@ ZEND_API void zend_observer_add_begin_handler(zend_function *function, zend_obse } } -ZEND_API bool zend_observer_remove_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin, zend_observer_fcall_begin_handler *next) { +ZEND_API bool zend_observer_remove_begin_handler(const zend_function *function, zend_observer_fcall_begin_handler begin, zend_observer_fcall_begin_handler *next) { void **begin_handlers = (void **)ZEND_OBSERVER_DATA(function); if (zend_observer_remove_handler(begin_handlers, begin, (void**)next)) { // Ensure invariant: ZEND_OBSERVER_NONE_OBSERVED in begin_handlers if both are not observed @@ -211,7 +211,7 @@ ZEND_API bool zend_observer_remove_begin_handler(zend_function *function, zend_o return false; } -ZEND_API void zend_observer_add_end_handler(zend_function *function, zend_observer_fcall_end_handler end) { +ZEND_API void zend_observer_add_end_handler(const zend_function *function, zend_observer_fcall_end_handler end) { size_t registered_observers = zend_observers_fcall_list.count; void **begin_handler = (void **)ZEND_OBSERVER_DATA(function); zend_observer_fcall_end_handler *end_handler = (zend_observer_fcall_end_handler *)begin_handler + registered_observers; @@ -226,7 +226,7 @@ ZEND_API void zend_observer_add_end_handler(zend_function *function, zend_observ *end_handler = end; } -ZEND_API bool zend_observer_remove_end_handler(zend_function *function, zend_observer_fcall_end_handler end, zend_observer_fcall_end_handler *next) { +ZEND_API bool zend_observer_remove_end_handler(const zend_function *function, zend_observer_fcall_end_handler end, zend_observer_fcall_end_handler *next) { size_t registered_observers = zend_observers_fcall_list.count; void **begin_handlers = (void **)ZEND_OBSERVER_DATA(function); void **end_handlers = begin_handlers + registered_observers; @@ -241,7 +241,7 @@ ZEND_API bool zend_observer_remove_end_handler(zend_function *function, zend_obs } static inline zend_execute_data **prev_observed_frame(zend_execute_data *execute_data) { - zend_function *func = EX(func); + const zend_function *func = EX(func); ZEND_ASSERT(func); return (zend_execute_data **)&Z_PTR_P(EX_VAR_NUM((ZEND_USER_CODE(func->type) ? func->op_array.last_var : ZEND_CALL_NUM_ARGS(execute_data)) + func->common.T - 1)); } @@ -256,7 +256,7 @@ static void ZEND_FASTCALL _zend_observe_fcall_begin(zend_execute_data *execute_d ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin_prechecked(zend_execute_data *execute_data, zend_observer_fcall_begin_handler *handler) { - zend_observer_fcall_begin_handler *possible_handlers_end = handler + zend_observers_fcall_list.count; + const zend_observer_fcall_begin_handler *possible_handlers_end = handler + zend_observers_fcall_list.count; if (!*handler) { zend_observer_fcall_install(execute_data); @@ -265,7 +265,7 @@ ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin_prechecked(zend_execute_da } } - zend_observer_fcall_end_handler *end_handler = (zend_observer_fcall_end_handler *)possible_handlers_end; + const zend_observer_fcall_end_handler *end_handler = (const zend_observer_fcall_end_handler *)possible_handlers_end; if (*end_handler != ZEND_OBSERVER_NOT_OBSERVED) { *prev_observed_frame(execute_data) = EG(current_observed_frame); EG(current_observed_frame) = execute_data; @@ -294,7 +294,7 @@ ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin(zend_execute_data *execute } static inline void call_end_observers(zend_execute_data *execute_data, zval *return_value) { - zend_function *func = EX(func); + const zend_function *func = EX(func); ZEND_ASSERT(func); zend_observer_fcall_end_handler *handler = (zend_observer_fcall_end_handler *)ZEND_OBSERVER_DATA(func) + zend_observers_fcall_list.count; @@ -340,7 +340,7 @@ ZEND_API void ZEND_FASTCALL _zend_observer_function_declared_notify(zend_op_arra return; } - for (zend_llist_element *element = zend_observer_function_declared_callbacks.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_function_declared_callbacks.head; element; element = element->next) { zend_observer_function_declared_cb callback = *(zend_observer_function_declared_cb *) (element->data); callback(op_array, name); } @@ -358,7 +358,7 @@ ZEND_API void ZEND_FASTCALL _zend_observer_class_linked_notify(zend_class_entry return; } - for (zend_llist_element *element = zend_observer_class_linked_callbacks.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_class_linked_callbacks.head; element; element = element->next) { zend_observer_class_linked_cb callback = *(zend_observer_class_linked_cb *) (element->data); callback(ce, name); } @@ -372,7 +372,7 @@ ZEND_API void zend_observer_error_register(zend_observer_error_cb cb) ZEND_API void _zend_observer_error_notify(int type, zend_string *error_filename, uint32_t error_lineno, zend_string *message) { - for (zend_llist_element *element = zend_observer_error_callbacks.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_error_callbacks.head; element; element = element->next) { zend_observer_error_cb callback = *(zend_observer_error_cb *) (element->data); callback(type, error_filename, error_lineno, message); } @@ -395,12 +395,11 @@ ZEND_API void zend_observer_fiber_destroy_register(zend_observer_fiber_destroy_h ZEND_API void ZEND_FASTCALL zend_observer_fiber_init_notify(zend_fiber_context *initializing) { - zend_llist_element *element; zend_observer_fiber_init_handler callback; initializing->top_observed_frame = NULL; - for (element = zend_observer_fiber_init.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_fiber_init.head; element; element = element->next) { callback = *(zend_observer_fiber_init_handler *) element->data; callback(initializing); } @@ -408,14 +407,13 @@ ZEND_API void ZEND_FASTCALL zend_observer_fiber_init_notify(zend_fiber_context * ZEND_API void ZEND_FASTCALL zend_observer_fiber_switch_notify(zend_fiber_context *from, zend_fiber_context *to) { - zend_llist_element *element; zend_observer_fiber_switch_handler callback; if (from->status == ZEND_FIBER_STATUS_DEAD) { zend_observer_fcall_end_all(); // fiber is either finished (call will do nothing) or has bailed out } - for (element = zend_observer_fiber_switch.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_fiber_switch.head; element; element = element->next) { callback = *(zend_observer_fiber_switch_handler *) element->data; callback(from, to); } @@ -426,10 +424,9 @@ ZEND_API void ZEND_FASTCALL zend_observer_fiber_switch_notify(zend_fiber_context ZEND_API void ZEND_FASTCALL zend_observer_fiber_destroy_notify(zend_fiber_context *destroying) { - zend_llist_element *element; zend_observer_fiber_destroy_handler callback; - for (element = zend_observer_fiber_destroy.head; element; element = element->next) { + for (const zend_llist_element *element = zend_observer_fiber_destroy.head; element; element = element->next) { callback = *(zend_observer_fiber_destroy_handler *) element->data; callback(destroying); } diff --git a/Zend/zend_observer.h b/Zend/zend_observer.h index bb8964692c370..cfec5200055af 100644 --- a/Zend/zend_observer.h +++ b/Zend/zend_observer.h @@ -74,10 +74,10 @@ ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init); // Call during runtime, but only if you have used zend_observer_fcall_register. // You must not have more than one begin and one end handler active at the same time. Remove the old one first, if there is an existing one. -ZEND_API void zend_observer_add_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin); -ZEND_API bool zend_observer_remove_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin, zend_observer_fcall_begin_handler *next); -ZEND_API void zend_observer_add_end_handler(zend_function *function, zend_observer_fcall_end_handler end); -ZEND_API bool zend_observer_remove_end_handler(zend_function *function, zend_observer_fcall_end_handler end, zend_observer_fcall_end_handler *next); +ZEND_API void zend_observer_add_begin_handler(const zend_function *function, zend_observer_fcall_begin_handler begin); +ZEND_API bool zend_observer_remove_begin_handler(const zend_function *function, zend_observer_fcall_begin_handler begin, zend_observer_fcall_begin_handler *next); +ZEND_API void zend_observer_add_end_handler(const zend_function *function, zend_observer_fcall_end_handler end); +ZEND_API bool zend_observer_remove_end_handler(const zend_function *function, zend_observer_fcall_end_handler end, zend_observer_fcall_end_handler *next); ZEND_API void zend_observer_startup(void); // Called by engine before MINITs ZEND_API void zend_observer_post_startup(void); // Called by engine after MINITs @@ -88,13 +88,13 @@ ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin(zend_execute_data *execute /* prechecked: the call is actually observed. */ ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin_prechecked(zend_execute_data *execute_data, zend_observer_fcall_begin_handler *observer_data); -static zend_always_inline bool zend_observer_handler_is_unobserved(zend_observer_fcall_begin_handler *handler) { +static zend_always_inline bool zend_observer_handler_is_unobserved(const zend_observer_fcall_begin_handler *handler) { return *handler == ZEND_OBSERVER_NONE_OBSERVED; } /* Initial check for observers has not happened yet or no observers are installed. */ -static zend_always_inline bool zend_observer_fcall_has_no_observers(zend_execute_data *execute_data, bool allow_generator, zend_observer_fcall_begin_handler **handler) { - zend_function *function = EX(func); +static zend_always_inline bool zend_observer_fcall_has_no_observers(const zend_execute_data *execute_data, bool allow_generator, zend_observer_fcall_begin_handler **handler) { + const zend_function *function = EX(func); void *ZEND_MAP_PTR(runtime_cache) = ZEND_MAP_PTR(function->common.run_time_cache); if (function->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE | (allow_generator ? 0 : ZEND_ACC_GENERATOR))) { From 23162d852a204566e5af1149913ddd3c2db1d996 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 29 Oct 2025 13:24:36 +0000 Subject: [PATCH 280/386] Add UPGRADING information for Zend API change Related to 7815ab9b223e2441415fe55d944a16f9a9bb9dd7 --- UPGRADING.INTERNALS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index f14a4d1b0c9f8..3869677779716 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -39,6 +39,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES needs to be obtained use the zend_get_callable_zval_from_fcc() function instead. If this was used to store a callable, then an FCC should be stored instead. + . The zend_active_function{_ex}() functions now return a const zend_function + pointer. ======================== 2. Build system changes From fee4e1889f366ac59aea4bcd32f049e192f34ca8 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 29 Oct 2025 17:23:13 +0100 Subject: [PATCH 281/386] mbstring: Avoid pointless refcounted copy (#20325) These scalars can use the ZVAL_COPY_VALUE variant instead of ZVAL_COPY because they don't need refcounting. --- ext/mbstring/mbstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 34d759ae30e4b..ceb182a0a258d 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2788,7 +2788,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons case IS_FALSE: case IS_LONG: case IS_DOUBLE: - ZVAL_COPY(&entry_tmp, entry); + ZVAL_COPY_VALUE(&entry_tmp, entry); break; case IS_ARRAY: chash = php_mb_convert_encoding_recursive( From ee40791aff42a9367c4ea0603f6a458682d8e29c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 29 Oct 2025 18:58:43 +0000 Subject: [PATCH 282/386] Zend/zend_compile.c: remove unused fbc parameter of zend_try_compile_special_func_ex() --- Zend/zend_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 12f45ecbae1ae..31eff9a5b1876 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5038,7 +5038,7 @@ static zend_result zend_compile_func_clone(znode *result, zend_ast_list *args) return SUCCESS; } -static zend_result zend_try_compile_special_func_ex(znode *result, zend_string *lcname, zend_ast_list *args, zend_function *fbc, uint32_t type) /* {{{ */ +static zend_result zend_try_compile_special_func_ex(znode *result, zend_string *lcname, zend_ast_list *args, uint32_t type) /* {{{ */ { if (zend_string_equals_literal(lcname, "strlen")) { return zend_compile_func_strlen(result, args); @@ -5131,7 +5131,7 @@ static zend_result zend_try_compile_special_func(znode *result, zend_string *lcn return FAILURE; } - if (zend_try_compile_special_func_ex(result, lcname, args, fbc, type) == SUCCESS) { + if (zend_try_compile_special_func_ex(result, lcname, args, type) == SUCCESS) { return SUCCESS; } From c669fbf370b2edaf33fcd9d0543c40ebe60c8361 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 24 Sep 2025 22:40:04 +0100 Subject: [PATCH 283/386] Zend/zend_compile: add const qualifiers --- Zend/zend_API.c | 4 +- Zend/zend_API.h | 4 +- Zend/zend_compile.c | 525 ++++++++++++++++++++++---------------------- Zend/zend_compile.h | 14 +- Zend/zend_execute.h | 2 +- 5 files changed, 270 insertions(+), 279 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index bcbeedcebeea8..fdf3ccaf0ff77 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -430,7 +430,7 @@ ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num) zend_argument_value_error(arg_num, "must not be empty"); } -ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, zend_class_entry *old_ce) +ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, const zend_class_entry *old_ce) { if (old_ce->type == ZEND_INTERNAL_CLASS) { zend_error(type, "Cannot redeclare %s %s", @@ -445,7 +445,7 @@ ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string } } -ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, zend_class_entry *old_ce) +ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, const zend_class_entry *old_ce) { zend_class_redeclaration_error_ex(type, old_ce->name, old_ce); } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d322fd485ca64..d8ad9edabf5bb 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1564,8 +1564,8 @@ ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...); ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format, ...); ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num); -ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, zend_class_entry *old_ce); -ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, zend_class_entry *old_ce); +ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, const zend_class_entry *old_ce); +ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, const zend_class_entry *old_ce); #define ZPP_ERROR_OK 0 #define ZPP_ERROR_FAILURE 1 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 31eff9a5b1876..4632a3fca189f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -349,7 +349,7 @@ void zend_oparray_context_begin(zend_oparray_context *prev_context, zend_op_arra } /* }}} */ -void zend_oparray_context_end(zend_oparray_context *prev_context) /* {{{ */ +void zend_oparray_context_end(const zend_oparray_context *prev_context) /* {{{ */ { if (CG(context).brk_cont_array) { efree(CG(context).brk_cont_array); @@ -412,7 +412,7 @@ void zend_file_context_begin(zend_file_context *prev_context) /* {{{ */ } /* }}} */ -void zend_file_context_end(zend_file_context *prev_context) /* {{{ */ +void zend_file_context_end(const zend_file_context *prev_context) /* {{{ */ { zend_end_namespace(); zend_hash_destroy(&FC(seen_symbols)); @@ -447,7 +447,7 @@ static void zend_register_seen_symbol(zend_string *name, uint32_t kind) { } static bool zend_have_seen_symbol(zend_string *name, uint32_t kind) { - zval *zv = zend_hash_find(&FC(seen_symbols), name); + const zval *zv = zend_hash_find(&FC(seen_symbols), name); return zv && (Z_LVAL_P(zv) & kind) != 0; } @@ -572,7 +572,7 @@ zend_string *zval_make_interned_string(zval *zv) } /* Common part of zend_add_literal and zend_append_individual_literal */ -static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int literal_position) /* {{{ */ +static inline void zend_insert_literal(const zend_op_array *op_array, zval *zv, int literal_position) /* {{{ */ { zval *lit = CT_CONSTANT_EX(op_array, literal_position); if (Z_TYPE_P(zv) == IS_STRING) { @@ -952,7 +952,7 @@ uint32_t zend_modifier_token_to_flag(zend_modifier_target target, uint32_t token uint32_t zend_modifier_list_to_flags(zend_modifier_target target, zend_ast *modifiers) { uint32_t flags = 0; - zend_ast_list *modifier_list = zend_ast_get_list(modifiers); + const zend_ast_list *modifier_list = zend_ast_get_list(modifiers); for (uint32_t i = 0; i < modifier_list->children; i++) { uint32_t token = (uint32_t) Z_LVAL_P(zend_ast_get_zval(modifier_list->child[i])); @@ -1051,20 +1051,20 @@ uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag, zend_modifi } /* }}} */ -ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name) { +ZEND_API zend_string *zend_create_member_string(const zend_string *class_name, const zend_string *member_name) { return zend_string_concat3( ZSTR_VAL(class_name), ZSTR_LEN(class_name), "::", sizeof("::") - 1, ZSTR_VAL(member_name), ZSTR_LEN(member_name)); } -static zend_string *zend_concat_names(char *name1, size_t name1_len, char *name2, size_t name2_len) { +static zend_string *zend_concat_names(const char *name1, size_t name1_len, const char *name2, size_t name2_len) { return zend_string_concat3(name1, name1_len, "\\", 1, name2, name2_len); } static zend_string *zend_prefix_with_ns(zend_string *name) { if (FC(current_namespace)) { - zend_string *ns = FC(current_namespace); + const zend_string *ns = FC(current_namespace); return zend_concat_names(ZSTR_VAL(ns), ZSTR_LEN(ns), ZSTR_VAL(name), ZSTR_LEN(name)); } else { return zend_string_copy(name); @@ -1073,9 +1073,9 @@ static zend_string *zend_prefix_with_ns(zend_string *name) { static zend_string *zend_resolve_non_class_name( zend_string *name, uint32_t type, bool *is_fully_qualified, - bool case_sensitive, HashTable *current_import_sub + bool case_sensitive, const HashTable *current_import_sub ) { - char *compound; + const char *compound; *is_fully_qualified = false; if (ZSTR_VAL(name)[0] == '\\') { @@ -1117,7 +1117,7 @@ static zend_string *zend_resolve_non_class_name( if (compound && FC(imports)) { /* If the first part of a qualified name is an alias, substitute it. */ size_t len = compound - ZSTR_VAL(name); - zend_string *import_name = zend_hash_str_find_ptr_lc(FC(imports), ZSTR_VAL(name), len); + const zend_string *import_name = zend_hash_str_find_ptr_lc(FC(imports), ZSTR_VAL(name), len); if (import_name) { return zend_concat_names( @@ -1143,7 +1143,7 @@ static zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, bo static zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* {{{ */ { - char *compound; + const char *compound; if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(name)) { if (type == ZEND_NAME_FQ) { @@ -1181,7 +1181,7 @@ static zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* if (compound) { /* If the first part of a qualified name is an alias, substitute it. */ size_t len = compound - ZSTR_VAL(name); - zend_string *import_name = + const zend_string *import_name = zend_hash_str_find_ptr_lc(FC(imports), ZSTR_VAL(name), len); if (import_name) { @@ -1206,7 +1206,7 @@ static zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* static zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */ { - zval *class_name = zend_ast_get_zval(ast); + const zval *class_name = zend_ast_get_zval(ast); if (Z_TYPE_P(class_name) != IS_STRING) { zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name"); } @@ -1225,8 +1225,6 @@ static void str_dtor(zval *zv) /* {{{ */ { } /* }}} */ -static bool zend_is_call(zend_ast *ast); - static uint32_t zend_add_try_element(uint32_t try_op) /* {{{ */ { zend_op_array *op_array = CG(active_op_array); @@ -1264,14 +1262,14 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */ } /* }}} */ -static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zend_string *lcname, zend_op_array *op_array, bool compile_time) /* {{{ */ +static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(const zend_string *lcname, const zend_op_array *op_array, bool compile_time) /* {{{ */ { - zval *zv = zend_hash_find_known_hash(compile_time ? CG(function_table) : EG(function_table), lcname); + const zval *zv = zend_hash_find_known_hash(compile_time ? CG(function_table) : EG(function_table), lcname); int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR; - zend_function *old_function; + const zend_function *old_function; ZEND_ASSERT(zv != NULL); - old_function = (zend_function*)Z_PTR_P(zv); + old_function = Z_PTR_P(zv); if (old_function->type == ZEND_USER_FUNCTION && old_function->op_array.last > 0) { zend_error_noreturn(error_level, "Cannot redeclare function %s() (previously declared in %s:%d)", @@ -1284,7 +1282,7 @@ static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zen } } -ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname) /* {{{ */ +ZEND_API zend_result do_bind_function(zend_function *func, const zval *lcname) /* {{{ */ { zend_function *added_func = zend_hash_add_ptr(EG(function_table), Z_STR_P(lcname), func); if (UNEXPECTED(!added_func)) { @@ -1304,7 +1302,7 @@ ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname) /* {{{ /* }}} */ ZEND_API zend_class_entry *zend_bind_class_in_slot( - zval *class_table_slot, zval *lcname, zend_string *lc_parent_name) + zval *class_table_slot, const zval *lcname, zend_string *lc_parent_name) { zend_class_entry *ce = Z_PTR_P(class_table_slot); bool is_preloaded = @@ -1346,7 +1344,6 @@ ZEND_API zend_class_entry *zend_bind_class_in_slot( ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /* {{{ */ { - zend_class_entry *ce; zval *rtd_key, *zv; rtd_key = lcname + 1; @@ -1354,7 +1351,7 @@ ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /* zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(rtd_key)); if (UNEXPECTED(!zv)) { - ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname)); + const zend_class_entry *ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname)); ZEND_ASSERT(ce); zend_class_redeclaration_error(E_COMPILE_ERROR, ce); return FAILURE; @@ -1383,7 +1380,7 @@ static zend_string *add_type_string(zend_string *type, zend_string *new_type, bo return result; } -static zend_string *resolve_class_name(zend_string *name, zend_class_entry *scope) { +static zend_string *resolve_class_name(zend_string *name, const zend_class_entry *scope) { if (scope) { if (zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_SELF))) { name = scope->name; @@ -1465,7 +1462,7 @@ zend_string *zend_type_to_string_resolved(const zend_type type, zend_class_entry zend_string *name = ZSTR_KNOWN(ZEND_STR_STATIC); // During compilation of eval'd code the called scope refers to the scope calling the eval if (scope && !zend_is_compiling()) { - zend_class_entry *called_scope = zend_get_called_scope(EG(current_execute_data)); + const zend_class_entry *called_scope = zend_get_called_scope(EG(current_execute_data)); if (called_scope) { name = called_scope->name; } @@ -1619,7 +1616,7 @@ ZEND_API zend_result zend_unmangle_property_name_ex(const zend_string *name, con } /* }}} */ -static bool array_is_const_ex(zend_array *array, uint32_t *max_checks) +static bool array_is_const_ex(const zend_array *array, uint32_t *max_checks) { if (zend_hash_num_elements(array) > *max_checks) { return false; @@ -1642,13 +1639,13 @@ static bool array_is_const_ex(zend_array *array, uint32_t *max_checks) return true; } -static bool array_is_const(zend_array *array) +static bool array_is_const(const zend_array *array) { uint32_t max_checks = 50; return array_is_const_ex(array, &max_checks); } -static bool can_ct_eval_const(zend_constant *c) { +static bool can_ct_eval_const(const zend_constant *c) { if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) { return 0; } @@ -1717,7 +1714,7 @@ static inline bool zend_is_scope_known(void) /* {{{ */ } /* }}} */ -static inline bool class_name_refers_to_active_ce(zend_string *class_name, uint32_t fetch_type) /* {{{ */ +static inline bool class_name_refers_to_active_ce(const zend_string *class_name, uint32_t fetch_type) /* {{{ */ { if (!CG(active_class_entry)) { return 0; @@ -1785,7 +1782,7 @@ static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */ static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast) /* {{{ */ { uint32_t fetch_type; - zval *class_name; + const zval *class_name; if (class_ast->kind != ZEND_AST_ZVAL) { return 0; @@ -1825,7 +1822,7 @@ static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *c /* }}} */ /* We don't use zend_verify_const_access because we need to deal with unlinked classes. */ -static bool zend_verify_ct_const_access(zend_class_constant *c, zend_class_entry *scope) +static bool zend_verify_ct_const_access(const zend_class_constant *c, const zend_class_entry *scope) { if (ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED) { return 0; @@ -1870,7 +1867,7 @@ static bool zend_try_ct_eval_class_const(zval *zv, zend_string *class_name, zend if (class_name_refers_to_active_ce(class_name, fetch_type)) { cc = zend_hash_find_ptr(&CG(active_class_entry)->constants_table, name); } else if (fetch_type == ZEND_FETCH_CLASS_DEFAULT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION)) { - zend_class_entry *ce = zend_hash_find_ptr_lc(CG(class_table), class_name); + const zend_class_entry *ce = zend_hash_find_ptr_lc(CG(class_table), class_name); if (ce) { cc = zend_hash_find_ptr(&ce->constants_table, name); } else { @@ -2542,7 +2539,7 @@ static uint32_t zend_short_circuiting_checkpoint(void) return zend_stack_count(&CG(short_circuiting_opnums)); } -static void zend_short_circuiting_commit(uint32_t checkpoint, znode *result, zend_ast *ast) +static void zend_short_circuiting_commit(uint32_t checkpoint, znode *result, const zend_ast *ast) { bool is_short_circuited = zend_ast_kind_is_short_circuited(ast->kind) || ast->kind == ZEND_AST_ISSET || ast->kind == ZEND_AST_EMPTY; @@ -2608,7 +2605,7 @@ static void zend_compile_memoized_expr(znode *result, zend_ast *expr) /* {{{ */ zend_hash_index_update_mem( CG(memoized_exprs), (uintptr_t) expr, &memoized_result, sizeof(znode)); } else if (memoize_mode == ZEND_MEMOIZE_FETCH) { - znode *memoized_result = zend_hash_index_find_ptr(CG(memoized_exprs), (uintptr_t) expr); + const znode *memoized_result = zend_hash_index_find_ptr(CG(memoized_exprs), (uintptr_t) expr); *result = *memoized_result; if (result->op_type == IS_CONST) { Z_TRY_ADDREF(result->u.constant); @@ -2620,7 +2617,7 @@ static void zend_compile_memoized_expr(znode *result, zend_ast *expr) /* {{{ */ /* }}} */ static void zend_emit_return_type_check( - znode *expr, zend_arg_info *return_info, bool implicit) /* {{{ */ + znode *expr, const zend_arg_info *return_info, bool implicit) /* {{{ */ { zend_type type = return_info->type; if (ZEND_TYPE_IS_SET(type)) { @@ -2714,7 +2711,7 @@ void zend_emit_final_return(bool return_one) /* {{{ */ } /* }}} */ -static inline bool zend_is_variable(zend_ast *ast) /* {{{ */ +static inline bool zend_is_variable(const zend_ast *ast) /* {{{ */ { return ast->kind == ZEND_AST_VAR || ast->kind == ZEND_AST_DIM @@ -2724,7 +2721,7 @@ static inline bool zend_is_variable(zend_ast *ast) /* {{{ */ } /* }}} */ -static inline bool zend_is_call(zend_ast *ast) /* {{{ */ +static inline bool zend_is_call(const zend_ast *ast) /* {{{ */ { return ast->kind == ZEND_AST_CALL || ast->kind == ZEND_AST_METHOD_CALL @@ -2734,13 +2731,13 @@ static inline bool zend_is_call(zend_ast *ast) /* {{{ */ } /* }}} */ -static inline bool zend_is_variable_or_call(zend_ast *ast) /* {{{ */ +static inline bool zend_is_variable_or_call(const zend_ast *ast) /* {{{ */ { return zend_is_variable(ast) || zend_is_call(ast); } /* }}} */ -static inline bool zend_is_unticked_stmt(zend_ast *ast) /* {{{ */ +static inline bool zend_is_unticked_stmt(const zend_ast *ast) /* {{{ */ { return ast->kind == ZEND_AST_STMT_LIST || ast->kind == ZEND_AST_LABEL || ast->kind == ZEND_AST_PROP_DECL || ast->kind == ZEND_AST_CLASS_CONST_GROUP @@ -2748,7 +2745,7 @@ static inline bool zend_is_unticked_stmt(zend_ast *ast) /* {{{ */ } /* }}} */ -static inline bool zend_can_write_to_variable(zend_ast *ast) /* {{{ */ +static inline bool zend_can_write_to_variable(const zend_ast *ast) /* {{{ */ { while ( ast->kind == ZEND_AST_DIM @@ -2784,7 +2781,7 @@ static inline void zend_handle_numeric_op(znode *node) /* {{{ */ } /* }}} */ -static inline void zend_handle_numeric_dim(zend_op *opline, znode *dim_node) /* {{{ */ +static inline void zend_handle_numeric_dim(const zend_op *opline, znode *dim_node) /* {{{ */ { if (Z_TYPE(dim_node->u.constant) == IS_STRING) { zend_ulong index; @@ -2870,7 +2867,7 @@ static void zend_compile_class_ref(znode *result, zend_ast *name_ast, uint32_t f } /* }}} */ -static zend_result zend_try_compile_cv(znode *result, zend_ast *ast, uint32_t type) /* {{{ */ +static zend_result zend_try_compile_cv(znode *result, const zend_ast *ast, uint32_t type) /* {{{ */ { zend_ast *name_ast = ast->child[0]; if (name_ast->kind == ZEND_AST_ZVAL) { @@ -2911,7 +2908,7 @@ static zend_result zend_try_compile_cv(znode *result, zend_ast *ast, uint32_t ty } /* }}} */ -static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint32_t type, bool delayed) /* {{{ */ +static zend_op *zend_compile_simple_var_no_cv(znode *result, const zend_ast *ast, uint32_t type, bool delayed) /* {{{ */ { zend_ast *name_ast = ast->child[0]; znode name_node; @@ -2949,10 +2946,10 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint } /* }}} */ -static bool is_this_fetch(zend_ast *ast) /* {{{ */ +static bool is_this_fetch(const zend_ast *ast) /* {{{ */ { if (ast->kind == ZEND_AST_VAR && ast->child[0]->kind == ZEND_AST_ZVAL) { - zval *name = zend_ast_get_zval(ast->child[0]); + const zval *name = zend_ast_get_zval(ast->child[0]); return Z_TYPE_P(name) == IS_STRING && zend_string_equals(Z_STR_P(name), ZSTR_KNOWN(ZEND_STR_THIS)); } @@ -2963,25 +2960,25 @@ static bool is_this_fetch(zend_ast *ast) /* {{{ */ static bool is_globals_fetch(const zend_ast *ast) { if (ast->kind == ZEND_AST_VAR && ast->child[0]->kind == ZEND_AST_ZVAL) { - zval *name = zend_ast_get_zval(ast->child[0]); + const zval *name = zend_ast_get_zval(ast->child[0]); return Z_TYPE_P(name) == IS_STRING && zend_string_equals_literal(Z_STR_P(name), "GLOBALS"); } return 0; } -static bool is_global_var_fetch(zend_ast *ast) +static bool is_global_var_fetch(const zend_ast *ast) { return ast->kind == ZEND_AST_DIM && is_globals_fetch(ast->child[0]); } static bool this_guaranteed_exists(void) /* {{{ */ { - zend_oparray_context *ctx = &CG(context); + const zend_oparray_context *ctx = &CG(context); while (ctx) { /* Instance methods always have a $this. * This also includes closures that have a scope and use $this. */ - zend_op_array *op_array = ctx->op_array; + const zend_op_array *op_array = ctx->op_array; if (op_array->fn_flags & ZEND_ACC_STATIC) { return false; } else if (op_array->scope) { @@ -2995,7 +2992,7 @@ static bool this_guaranteed_exists(void) /* {{{ */ } /* }}} */ -static zend_op *zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, bool delayed) /* {{{ */ +static zend_op *zend_compile_simple_var(znode *result, const zend_ast *ast, uint32_t type, bool delayed) /* {{{ */ { if (is_this_fetch(ast)) { zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL); @@ -3019,7 +3016,7 @@ static zend_op *zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t t } /* }}} */ -static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t type) /* {{{ */ +static void zend_separate_if_call_and_write(znode *node, const zend_ast *ast, uint32_t type) /* {{{ */ { if (type != BP_VAR_R && type != BP_VAR_IS @@ -3037,7 +3034,7 @@ static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t } /* }}} */ -static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node) /* {{{ */ +static inline void zend_emit_assign_znode(zend_ast *var_ast, const znode *value_node) /* {{{ */ { znode dummy_node; zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN, var_ast, @@ -3245,7 +3242,7 @@ static zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t } /* }}} */ -static void zend_verify_list_assign_target(zend_ast *var_ast, zend_ast_attr array_style) /* {{{ */ { +static void zend_verify_list_assign_target(const zend_ast *var_ast, zend_ast_attr array_style) /* {{{ */ { if (var_ast->kind == ZEND_AST_ARRAY) { if (var_ast->attr == ZEND_ARRAY_SYNTAX_LONG) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot assign to array(), use [] instead"); @@ -3259,11 +3256,11 @@ static void zend_verify_list_assign_target(zend_ast *var_ast, zend_ast_attr arra } /* }}} */ -static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_node); +static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, const znode *value_node); /* Propagate refs used on leaf elements to the surrounding list() structures. */ static bool zend_propagate_list_refs(zend_ast *ast) { /* {{{ */ - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); bool has_refs = false; uint32_t i; @@ -3283,10 +3280,10 @@ static bool zend_propagate_list_refs(zend_ast *ast) { /* {{{ */ } /* }}} */ -static bool list_is_keyed(zend_ast_list *list) +static bool list_is_keyed(const zend_ast_list *list) { for (uint32_t i = 0; i < list->children; i++) { - zend_ast *child = list->child[i]; + const zend_ast *child = list->child[i]; if (child) { return child->kind == ZEND_AST_ARRAY_ELEM && child->child[1] != NULL; } @@ -3407,7 +3404,7 @@ static void zend_ensure_writable_variable(const zend_ast *ast) /* {{{ */ /* }}} */ /* Detects $a... = $a pattern */ -static bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast) /* {{{ */ +static bool zend_is_assign_to_self(const zend_ast *var_ast, const zend_ast *expr_ast) /* {{{ */ { if (expr_ast->kind != ZEND_AST_VAR || expr_ast->child[0]->kind != ZEND_AST_ZVAL) { return 0; @@ -3433,7 +3430,7 @@ static bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast) /* {{{ /* }}} */ static void zend_compile_expr_with_potential_assign_to_self( - znode *expr_node, zend_ast *expr_ast, zend_ast *var_ast) { + znode *expr_node, zend_ast *expr_ast, const zend_ast *var_ast) { if (zend_is_assign_to_self(var_ast, expr_ast) && !is_this_fetch(expr_ast)) { /* $a[0] = $a should evaluate the right $a first */ znode cv_node; @@ -3607,7 +3604,7 @@ static void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_node) /* {{{ */ +static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, const znode *value_node) /* {{{ */ { znode dummy_node; zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN_REF, var_ast, @@ -3689,11 +3686,11 @@ static void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static uint32_t zend_get_arg_num(zend_function *fn, zend_string *arg_name) { +static uint32_t zend_get_arg_num(const zend_function *fn, const zend_string *arg_name) { // TODO: Caching? if (fn->type == ZEND_USER_FUNCTION) { for (uint32_t i = 0; i < fn->common.num_args; i++) { - zend_arg_info *arg_info = &fn->op_array.arg_info[i]; + const zend_arg_info *arg_info = &fn->op_array.arg_info[i]; if (zend_string_equals(arg_info->name, arg_name)) { return i + 1; } @@ -3701,7 +3698,7 @@ static uint32_t zend_get_arg_num(zend_function *fn, zend_string *arg_name) { } else { ZEND_ASSERT(fn->common.num_args == 0 || fn->internal_function.arg_info); for (uint32_t i = 0; i < fn->common.num_args; i++) { - zend_internal_arg_info *arg_info = &fn->internal_function.arg_info[i]; + const zend_internal_arg_info *arg_info = &fn->internal_function.arg_info[i]; size_t len = strlen(arg_info->name); if (zend_string_equals_cstr(arg_name, arg_info->name, len)) { return i + 1; @@ -3714,9 +3711,9 @@ static uint32_t zend_get_arg_num(zend_function *fn, zend_string *arg_name) { } static uint32_t zend_compile_args( - zend_ast *ast, zend_function *fbc, bool *may_have_extra_named_args) /* {{{ */ + zend_ast *ast, const zend_function *fbc, bool *may_have_extra_named_args) /* {{{ */ { - zend_ast_list *args = zend_ast_get_list(ast); + const zend_ast_list *args = zend_ast_get_list(ast); uint32_t i; bool uses_arg_unpack = false; uint32_t arg_count = 0; /* number of arguments not including unpacks */ @@ -3916,7 +3913,7 @@ static uint32_t zend_compile_args( } /* }}} */ -ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc, bool result_used) /* {{{ */ +ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, const zend_function *fbc, bool result_used) /* {{{ */ { uint32_t no_discard = result_used ? 0 : ZEND_ACC_NODISCARD; @@ -3949,7 +3946,7 @@ ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc, bo } /* }}} */ -static bool zend_compile_call_common(znode *result, zend_ast *args_ast, zend_function *fbc, uint32_t lineno) /* {{{ */ +static bool zend_compile_call_common(znode *result, zend_ast *args_ast, const zend_function *fbc, uint32_t lineno) /* {{{ */ { zend_op *opline; uint32_t opnum_init = get_next_op_number() - 1; @@ -4057,11 +4054,11 @@ static void zend_compile_dynamic_call(znode *result, znode *name_node, zend_ast } /* }}} */ -static inline bool zend_args_contain_unpack_or_named(zend_ast_list *args) /* {{{ */ +static inline bool zend_args_contain_unpack_or_named(const zend_ast_list *args) /* {{{ */ { uint32_t i; for (i = 0; i < args->children; ++i) { - zend_ast *arg = args->child[i]; + const zend_ast *arg = args->child[i]; if (arg->kind == ZEND_AST_UNPACK || arg->kind == ZEND_AST_NAMED_ARG) { return 1; } @@ -4070,7 +4067,7 @@ static inline bool zend_args_contain_unpack_or_named(zend_ast_list *args) /* {{{ } /* }}} */ -static zend_result zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_strlen(znode *result, const zend_ast_list *args) /* {{{ */ { znode arg_node; @@ -4090,7 +4087,7 @@ static zend_result zend_compile_func_strlen(znode *result, zend_ast_list *args) } /* }}} */ -static zend_result zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */ +static zend_result zend_compile_func_typecheck(znode *result, const zend_ast_list *args, uint32_t type) /* {{{ */ { znode arg_node; zend_op *opline; @@ -4110,7 +4107,7 @@ static zend_result zend_compile_func_typecheck(znode *result, zend_ast_list *arg } /* }}} */ -static zend_result zend_compile_func_is_scalar(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_is_scalar(znode *result, const zend_ast_list *args) /* {{{ */ { znode arg_node; zend_op *opline; @@ -4125,7 +4122,7 @@ static zend_result zend_compile_func_is_scalar(znode *result, zend_ast_list *arg return SUCCESS; } -static zend_result zend_compile_func_cast(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */ +static zend_result zend_compile_func_cast(znode *result, const zend_ast_list *args, uint32_t type) /* {{{ */ { znode arg_node; zend_op *opline; @@ -4145,7 +4142,7 @@ static zend_result zend_compile_func_cast(znode *result, zend_ast_list *args, ui } /* }}} */ -static zend_result zend_compile_func_defined(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_defined(znode *result, const zend_ast_list *args) /* {{{ */ { zend_string *name; zend_op *opline; @@ -4219,11 +4216,11 @@ static zend_result zend_compile_func_ord(znode *result, const zend_ast_list *arg /* We can only calculate the stack size for functions that have been fully compiled, otherwise * additional CV or TMP slots may still be added. This prevents the use of INIT_FCALL for * directly or indirectly recursive function calls. */ -static bool fbc_is_finalized(zend_function *fbc) { +static bool fbc_is_finalized(const zend_function *fbc) { return !ZEND_USER_CODE(fbc->type) || (fbc->common.fn_flags & ZEND_ACC_DONE_PASS_TWO); } -static bool zend_compile_ignore_class(zend_class_entry *ce, zend_string *filename) +static bool zend_compile_ignore_class(const zend_class_entry *ce, const zend_string *filename) { if (ce->type == ZEND_INTERNAL_CLASS) { return CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES; @@ -4233,7 +4230,7 @@ static bool zend_compile_ignore_class(zend_class_entry *ce, zend_string *filenam } } -static bool zend_compile_ignore_function(zend_function *fbc, zend_string *filename) +static bool zend_compile_ignore_function(const zend_function *fbc, const zend_string *filename) { if (fbc->type == ZEND_INTERNAL_FUNCTION) { return CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS; @@ -4348,7 +4345,7 @@ static zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, ze /* }}} */ /* cuf = call_user_func */ -static zend_result zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */ +static zend_result zend_compile_func_cuf(znode *result, const zend_ast_list *args, zend_string *lcname) /* {{{ */ { uint32_t i; @@ -4374,7 +4371,7 @@ static zend_result zend_compile_func_cuf(znode *result, zend_ast_list *args, zen } /* }}} */ -static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc, uint32_t lineno) /* {{{ */ +static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, const zend_function *fbc, uint32_t lineno) /* {{{ */ { if (EG(assertions) >= 0) { znode name_node; @@ -4509,7 +4506,7 @@ static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args } /* }}} */ -static zend_result zend_compile_func_count(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */ +static zend_result zend_compile_func_count(znode *result, const zend_ast_list *args, const zend_string *lcname) /* {{{ */ { znode arg_node; zend_op *opline; @@ -4526,7 +4523,7 @@ static zend_result zend_compile_func_count(znode *result, zend_ast_list *args, z } /* }}} */ -static zend_result zend_compile_func_get_class(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_get_class(znode *result, const zend_ast_list *args) /* {{{ */ { if (args->children == 0) { zend_emit_op_tmp(result, ZEND_GET_CLASS, NULL, NULL); @@ -4544,7 +4541,7 @@ static zend_result zend_compile_func_get_class(znode *result, zend_ast_list *arg } /* }}} */ -static zend_result zend_compile_func_get_called_class(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_get_called_class(znode *result, const zend_ast_list *args) /* {{{ */ { if (args->children != 0) { return FAILURE; @@ -4555,7 +4552,7 @@ static zend_result zend_compile_func_get_called_class(znode *result, zend_ast_li } /* }}} */ -static zend_result zend_compile_func_gettype(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_gettype(znode *result, const zend_ast_list *args) /* {{{ */ { znode arg_node; @@ -4569,7 +4566,7 @@ static zend_result zend_compile_func_gettype(znode *result, zend_ast_list *args) } /* }}} */ -static zend_result zend_compile_func_num_args(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_num_args(znode *result, const zend_ast_list *args) /* {{{ */ { if (CG(active_op_array)->function_name && args->children == 0) { zend_emit_op_tmp(result, ZEND_FUNC_NUM_ARGS, NULL, NULL); @@ -4580,7 +4577,7 @@ static zend_result zend_compile_func_num_args(znode *result, zend_ast_list *args } /* }}} */ -static zend_result zend_compile_func_get_args(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_get_args(znode *result, const zend_ast_list *args) /* {{{ */ { if (CG(active_op_array)->function_name && args->children == 0) { zend_emit_op_tmp(result, ZEND_FUNC_GET_ARGS, NULL, NULL); @@ -4591,7 +4588,7 @@ static zend_result zend_compile_func_get_args(znode *result, zend_ast_list *args } /* }}} */ -static zend_result zend_compile_func_array_key_exists(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_array_key_exists(znode *result, const zend_ast_list *args) /* {{{ */ { znode subject, needle; @@ -4607,7 +4604,7 @@ static zend_result zend_compile_func_array_key_exists(znode *result, zend_ast_li } /* }}} */ -static zend_result zend_compile_func_array_slice(znode *result, zend_ast_list *args) /* {{{ */ +static zend_result zend_compile_func_array_slice(znode *result, const zend_ast_list *args) /* {{{ */ { if (CG(active_op_array)->function_name && args->children == 2 @@ -4620,8 +4617,8 @@ static zend_result zend_compile_func_array_slice(znode *result, zend_ast_list *a zend_string *orig_name = zend_ast_get_str(args->child[0]->child[0]); bool is_fully_qualified; zend_string *name = zend_resolve_function_name(orig_name, args->child[0]->child[0]->attr, &is_fully_qualified); - zend_ast_list *list = zend_ast_get_list(args->child[0]->child[1]); - zval *zv = zend_ast_get_zval(args->child[1]); + const zend_ast_list *list = zend_ast_get_list(args->child[0]->child[1]); + const zval *zv = zend_ast_get_zval(args->child[1]); znode first; if (zend_string_equals_literal_ci(name, "func_get_args") @@ -4640,7 +4637,7 @@ static zend_result zend_compile_func_array_slice(znode *result, zend_ast_list *a } /* }}} */ -static uint32_t find_frameless_function_offset(uint32_t arity, void *handler) +static uint32_t find_frameless_function_offset(uint32_t arity, const void *handler) { void **handlers = zend_flf_handlers; void **current = handlers; @@ -4654,7 +4651,7 @@ static uint32_t find_frameless_function_offset(uint32_t arity, void *handler) return (uint32_t)-1; } -static const zend_frameless_function_info *find_frameless_function_info(zend_ast_list *args, zend_function *fbc, uint32_t type) +static const zend_frameless_function_info *find_frameless_function_info(const zend_ast_list *args, const zend_function *fbc, uint32_t type) { if (zend_execute_internal) { return NULL; @@ -4695,7 +4692,7 @@ static const zend_frameless_function_info *find_frameless_function_info(zend_ast return NULL; } -static uint32_t zend_compile_frameless_icall_ex(znode *result, zend_ast_list *args, zend_function *fbc, const zend_frameless_function_info *frameless_function_info, uint32_t type) +static uint32_t zend_compile_frameless_icall_ex(znode *result, const zend_ast_list *args, const zend_function *fbc, const zend_frameless_function_info *frameless_function_info, uint32_t type) { uint32_t lineno = CG(zend_lineno); uint32_t num_args = frameless_function_info->num_args; @@ -4705,7 +4702,7 @@ static uint32_t zend_compile_frameless_icall_ex(znode *result, zend_ast_list *ar if (i < args->children) { zend_compile_expr(&arg_zvs[i], args->child[i]); } else { - zend_internal_arg_info *arg_info = (zend_internal_arg_info *)&fbc->common.arg_info[i]; + const zend_internal_arg_info *arg_info = (const zend_internal_arg_info *)&fbc->common.arg_info[i]; arg_zvs[i].op_type = IS_CONST; if (zend_get_default_from_internal_arg_info(&arg_zvs[i].u.constant, arg_info) == FAILURE) { ZEND_UNREACHABLE(); @@ -4729,7 +4726,7 @@ static uint32_t zend_compile_frameless_icall_ex(znode *result, zend_ast_list *ar return opnum; } -static uint32_t zend_compile_frameless_icall(znode *result, zend_ast_list *args, zend_function *fbc, uint32_t type) +static uint32_t zend_compile_frameless_icall(znode *result, const zend_ast_list *args, const zend_function *fbc, uint32_t type) { const zend_frameless_function_info *frameless_function_info = find_frameless_function_info(args, fbc, type); if (!frameless_function_info) { @@ -4739,12 +4736,12 @@ static uint32_t zend_compile_frameless_icall(znode *result, zend_ast_list *args, return zend_compile_frameless_icall_ex(result, args, fbc, frameless_function_info, type); } -static void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args_ast, uint32_t lineno, uint32_t type) /* {{{ */ +static void zend_compile_ns_call(znode *result, const znode *name_node, zend_ast *args_ast, uint32_t lineno, uint32_t type) /* {{{ */ { int name_constants = zend_add_ns_func_name_literal(Z_STR(name_node->u.constant)); /* Find frameless function with same name. */ - zend_function *frameless_function = NULL; + const zend_function *frameless_function = NULL; if (args_ast->kind != ZEND_AST_CALLABLE_CONVERT && !zend_args_contain_unpack_or_named(zend_ast_get_list(args_ast)) /* Avoid blowing up op count with nested frameless branches. */ @@ -5024,7 +5021,7 @@ static zend_result zend_compile_func_printf(znode *result, zend_ast_list *args) return SUCCESS; } -static zend_result zend_compile_func_clone(znode *result, zend_ast_list *args) +static zend_result zend_compile_func_clone(znode *result, const zend_ast_list *args) { znode arg_node; @@ -5115,7 +5112,7 @@ static zend_result zend_try_compile_special_func_ex(znode *result, zend_string * } } -static zend_result zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_list *args, zend_function *fbc, uint32_t type) /* {{{ */ +static zend_result zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_list *args, const zend_function *fbc, uint32_t type) /* {{{ */ { if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) { return FAILURE; @@ -5158,11 +5155,11 @@ static zend_string *zend_copy_unmangled_prop_name(zend_string *prop_name) } } -static bool zend_compile_parent_property_hook_call(znode *result, zend_ast *ast, uint32_t type) +static bool zend_compile_parent_property_hook_call(znode *result, const zend_ast *ast, uint32_t type) { ZEND_ASSERT(ast->kind == ZEND_AST_STATIC_CALL); - zend_ast *class_ast = ast->child[0]; + const zend_ast *class_ast = ast->child[0]; zend_ast *method_ast = ast->child[1]; /* Recognize parent::$prop::get() pattern. */ @@ -5217,13 +5214,12 @@ static bool zend_compile_parent_property_hook_call(znode *result, zend_ast *ast, opline->op1.constant = zend_add_literal_string(&property_name); opline->op2.num = hook_kind; - zend_function *fbc = NULL; - zend_compile_call_common(result, args_ast, fbc, zend_ast_get_lineno(method_ast)); + zend_compile_call_common(result, args_ast, NULL, zend_ast_get_lineno(method_ast)); return true; } -static void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */ +static void zend_compile_call(znode *result, const zend_ast *ast, uint32_t type) /* {{{ */ { zend_ast *name_ast = ast->child[0]; zend_ast *args_ast = ast->child[1]; @@ -5251,14 +5247,11 @@ static void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{ } { - zval *name = &name_node.u.constant; - zend_string *lcname; - zend_function *fbc; - zend_op *opline; - - lcname = zend_string_tolower(Z_STR_P(name)); + const zval *name = &name_node.u.constant; + zend_string *lcname = zend_string_tolower(Z_STR_P(name)); zval *fbc_zv = zend_hash_find(CG(function_table), lcname); - fbc = fbc_zv ? Z_PTR_P(fbc_zv) : NULL; + const zend_function *fbc = fbc_zv ? Z_PTR_P(fbc_zv) : NULL; + zend_op *opline; /* Special assert() handling should apply independently of compiler flags. */ if (fbc && zend_string_equals_literal(lcname, "assert") && !is_callable_convert) { @@ -5293,7 +5286,7 @@ static void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{ /* Store offset to function from symbol table in op2.extra. */ if (fbc->type == ZEND_INTERNAL_FUNCTION) { - Bucket *fbc_bucket = (Bucket*)((uintptr_t)fbc_zv - XtOffsetOf(Bucket, val)); + const Bucket *fbc_bucket = (const Bucket*)((uintptr_t)fbc_zv - XtOffsetOf(Bucket, val)); Z_EXTRA_P(CT_CONSTANT(opline->op2)) = fbc_bucket - CG(function_table)->arData; } @@ -5310,7 +5303,7 @@ static void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type znode obj_node, method_node; zend_op *opline; - zend_function *fbc = NULL; + const zend_function *fbc = NULL; bool nullsafe = ast->kind == ZEND_AST_NULLSAFE_METHOD_CALL; uint32_t short_circuiting_checkpoint = zend_short_circuiting_checkpoint(); @@ -5370,7 +5363,7 @@ static void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type } /* }}} */ -static bool zend_is_constructor(zend_string *name) /* {{{ */ +static bool zend_is_constructor(const zend_string *name) /* {{{ */ { return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME); } @@ -5392,9 +5385,9 @@ static bool is_func_accessible(const zend_function *fbc) return false; } -static zend_function *zend_get_compatible_func_or_null(zend_class_entry *ce, zend_string *lcname) /* {{{ */ +static const zend_function *zend_get_compatible_func_or_null(const zend_class_entry *ce, zend_string *lcname) /* {{{ */ { - zend_function *fbc = zend_hash_find_ptr(&ce->function_table, lcname); + const zend_function *fbc = zend_hash_find_ptr(&ce->function_table, lcname); if (!fbc || is_func_accessible(fbc)) { return fbc; @@ -5412,7 +5405,7 @@ static void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type znode class_node, method_node; zend_op *opline; - zend_function *fbc = NULL; + const zend_function *fbc = NULL; if (zend_compile_parent_property_hook_call(result, ast, type)) { return; @@ -5480,7 +5473,7 @@ static void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type } /* }}} */ -static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel); +static void zend_compile_class_decl(znode *result, const zend_ast *ast, bool toplevel); static void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */ { @@ -5524,7 +5517,7 @@ static void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */ } - zend_function *fbc = NULL; + const zend_function *fbc = NULL; if (ce && ce->default_object_handlers->get_constructor == zend_std_get_constructor && ce->constructor @@ -5651,7 +5644,7 @@ static void zend_compile_static_var(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_unset(zend_ast *ast) /* {{{ */ +static void zend_compile_unset(const zend_ast *ast) /* {{{ */ { zend_ast *var_ast = ast->child[0]; znode var_node; @@ -5705,7 +5698,7 @@ static void zend_compile_unset(zend_ast *ast) /* {{{ */ static bool zend_handle_loops_and_finally_ex(zend_long depth, znode *return_value) /* {{{ */ { - zend_loop_var *base; + const zend_loop_var *base; zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); if (!loop_var) { @@ -5760,7 +5753,7 @@ static bool zend_handle_loops_and_finally(znode *return_value) /* {{{ */ static bool zend_has_finally_ex(zend_long depth) /* {{{ */ { - zend_loop_var *base; + const zend_loop_var *base; zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); if (!loop_var) { @@ -5790,7 +5783,7 @@ static bool zend_has_finally(void) /* {{{ */ } /* }}} */ -static void zend_compile_return(zend_ast *ast) /* {{{ */ +static void zend_compile_return(const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0; @@ -5858,7 +5851,7 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_void_cast(znode *result, zend_ast *ast) +static void zend_compile_void_cast(znode *result, const zend_ast *ast) { zend_ast *expr_ast = ast->child[0]; znode expr_node; @@ -5878,7 +5871,7 @@ static void zend_compile_void_cast(znode *result, zend_ast *ast) } } -static void zend_compile_echo(zend_ast *ast) /* {{{ */ +static void zend_compile_echo(const zend_ast *ast) /* {{{ */ { zend_op *opline; zend_ast *expr_ast = ast->child[0]; @@ -5891,7 +5884,7 @@ static void zend_compile_echo(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_throw(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_throw(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; @@ -5908,7 +5901,7 @@ static void zend_compile_throw(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_break_continue(zend_ast *ast) /* {{{ */ +static void zend_compile_break_continue(const zend_ast *ast) /* {{{ */ { zend_ast *depth_ast = ast->child[0]; @@ -5918,7 +5911,7 @@ static void zend_compile_break_continue(zend_ast *ast) /* {{{ */ ZEND_ASSERT(ast->kind == ZEND_AST_BREAK || ast->kind == ZEND_AST_CONTINUE); if (depth_ast) { - zval *depth_zv; + const zval *depth_zv; if (depth_ast->kind != ZEND_AST_ZVAL) { zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand " "is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue"); @@ -6019,7 +6012,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ } for (current = 0; current < op_array->last_try_catch; ++current) { - zend_try_catch_element *elem = &op_array->try_catch_array[current]; + const zend_try_catch_element *elem = &op_array->try_catch_array[current]; if (elem->try_op > opnum) { break; } @@ -6046,7 +6039,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */ } /* }}} */ -static void zend_compile_goto(zend_ast *ast) /* {{{ */ +static void zend_compile_goto(const zend_ast *ast) /* {{{ */ { zend_ast *label_ast = ast->child[0]; znode label_node; @@ -6063,7 +6056,7 @@ static void zend_compile_goto(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_label(zend_ast *ast) /* {{{ */ +static void zend_compile_label(const zend_ast *ast) /* {{{ */ { zend_string *label = zend_ast_get_str(ast->child[0]); zend_label dest; @@ -6082,7 +6075,7 @@ static void zend_compile_label(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_while(zend_ast *ast) /* {{{ */ +static void zend_compile_while(const zend_ast *ast) /* {{{ */ { zend_ast *cond_ast = ast->child[0]; zend_ast *stmt_ast = ast->child[1]; @@ -6106,7 +6099,7 @@ static void zend_compile_while(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_do_while(zend_ast *ast) /* {{{ */ +static void zend_compile_do_while(const zend_ast *ast) /* {{{ */ { zend_ast *stmt_ast = ast->child[0]; zend_ast *cond_ast = ast->child[1]; @@ -6130,7 +6123,7 @@ static void zend_compile_do_while(zend_ast *ast) /* {{{ */ static void zend_compile_for_expr_list(znode *result, zend_ast *ast) /* {{{ */ { - zend_ast_list *list; + const zend_ast_list *list; uint32_t i; result->op_type = IS_CONST; @@ -6156,7 +6149,7 @@ static void zend_compile_for_expr_list(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_for(zend_ast *ast) /* {{{ */ +static void zend_compile_for(const zend_ast *ast) /* {{{ */ { zend_ast *init_ast = ast->child[0]; zend_ast *cond_ast = ast->child[1]; @@ -6284,7 +6277,7 @@ static void zend_compile_foreach(zend_ast *ast) /* {{{ */ static void zend_compile_if(zend_ast *ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; uint32_t *jmp_opnums = NULL; @@ -6293,7 +6286,7 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */ } for (i = 0; i < list->children; ++i) { - zend_ast *elem_ast = list->child[i]; + const zend_ast *elem_ast = list->child[i]; zend_ast *cond_ast = elem_ast->child[0]; zend_ast *stmt_ast = elem_ast->child[1]; @@ -6334,13 +6327,13 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */ } /* }}} */ -static uint8_t determine_switch_jumptable_type(zend_ast_list *cases) { +static uint8_t determine_switch_jumptable_type(const zend_ast_list *cases) { uint32_t i; uint8_t common_type = IS_UNDEF; for (i = 0; i < cases->children; i++) { zend_ast *case_ast = cases->child[i]; zend_ast **cond_ast = &case_ast->child[0]; - zval *cond_zv; + const zval *cond_zv; if (!case_ast->child[0]) { /* Skip default clause */ continue; @@ -6375,7 +6368,7 @@ static uint8_t determine_switch_jumptable_type(zend_ast_list *cases) { return common_type; } -static bool should_use_jumptable(zend_ast_list *cases, uint8_t jumptable_type) { +static bool should_use_jumptable(const zend_ast_list *cases, uint8_t jumptable_type) { if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) { return 0; } @@ -6529,26 +6522,26 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ } /* }}} */ -static uint32_t count_match_conds(zend_ast_list *arms) +static uint32_t count_match_conds(const zend_ast_list *arms) { uint32_t num_conds = 0; for (uint32_t i = 0; i < arms->children; i++) { - zend_ast *arm_ast = arms->child[i]; + const zend_ast *arm_ast = arms->child[i]; if (arm_ast->child[0] == NULL) { continue; } - zend_ast_list *conds = zend_ast_get_list(arm_ast->child[0]); + const zend_ast_list *conds = zend_ast_get_list(arm_ast->child[0]); num_conds += conds->children; } return num_conds; } -static bool can_match_use_jumptable(zend_ast_list *arms) { +static bool can_match_use_jumptable(const zend_ast_list *arms) { for (uint32_t i = 0; i < arms->children; i++) { - zend_ast *arm_ast = arms->child[i]; + const zend_ast *arm_ast = arms->child[i]; if (!arm_ast->child[0]) { /* Skip default arm */ continue; @@ -6563,7 +6556,7 @@ static bool can_match_use_jumptable(zend_ast_list *arms) { return 0; } - zval *cond_zv = zend_ast_get_zval(*cond_ast); + const zval *cond_zv = zend_ast_get_zval(*cond_ast); if (Z_TYPE_P(cond_zv) != IS_LONG && Z_TYPE_P(cond_zv) != IS_STRING) { return 0; } @@ -6580,8 +6573,7 @@ static bool zend_is_pipe_optimizable_callable_name(zend_ast *ast) * pipe optimization that uses a temporary znode for the reference elimination. * Therefore, disable the optimization for assert. * Note that "assert" as a name is always treated as fully qualified. */ - zend_string *str = zend_ast_get_str(ast); - return !zend_string_equals_literal_ci(str, "assert"); + return !zend_string_equals_literal_ci(zend_ast_get_str(ast), "assert"); } return true; @@ -6831,10 +6823,10 @@ static void zend_compile_match(znode *result, zend_ast *ast) efree(jmp_end_opnums); } -static void zend_compile_try(zend_ast *ast) /* {{{ */ +static void zend_compile_try(const zend_ast *ast) /* {{{ */ { zend_ast *try_ast = ast->child[0]; - zend_ast_list *catches = zend_ast_get_list(ast->child[1]); + const zend_ast_list *catches = zend_ast_get_list(ast->child[1]); zend_ast *finally_ast = ast->child[2]; uint32_t i, j; @@ -6885,8 +6877,8 @@ static void zend_compile_try(zend_ast *ast) /* {{{ */ } for (i = 0; i < catches->children; ++i) { - zend_ast *catch_ast = catches->child[i]; - zend_ast_list *classes = zend_ast_get_list(catch_ast->child[0]); + const zend_ast *catch_ast = catches->child[i]; + const zend_ast_list *classes = zend_ast_get_list(catch_ast->child[0]); zend_ast *var_ast = catch_ast->child[1]; zend_ast *stmt_ast = catch_ast->child[2]; zend_string *var_name = var_ast ? zval_make_interned_string(zend_ast_get_zval(var_ast)) : NULL; @@ -7008,13 +7000,13 @@ static void zend_compile_try(zend_ast *ast) /* {{{ */ /* Encoding declarations must already be handled during parsing */ bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ { - zend_ast_list *declares = zend_ast_get_list(ast); + const zend_ast_list *declares = zend_ast_get_list(ast); uint32_t i; for (i = 0; i < declares->children; ++i) { - zend_ast *declare_ast = declares->child[i]; + const zend_ast *declare_ast = declares->child[i]; zend_ast *name_ast = declare_ast->child[0]; zend_ast *value_ast = declare_ast->child[1]; - zend_string *name = zend_ast_get_str(name_ast); + const zend_string *name = zend_ast_get_str(name_ast); if (zend_string_equals_literal_ci(name, "encoding")) { if (value_ast->kind != ZEND_AST_ZVAL) { @@ -7058,10 +7050,10 @@ bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ /* }}} */ /* Check whether this is the first statement, not counting declares. */ -static zend_result zend_is_first_statement(zend_ast *ast, bool allow_nop) /* {{{ */ +static zend_result zend_is_first_statement(const zend_ast *ast, bool allow_nop) /* {{{ */ { uint32_t i = 0; - zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); + const zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); while (i < file_ast->children) { if (file_ast->child[i] == ast) { @@ -7079,9 +7071,9 @@ static zend_result zend_is_first_statement(zend_ast *ast, bool allow_nop) /* {{{ } /* }}} */ -static void zend_compile_declare(zend_ast *ast) /* {{{ */ +static void zend_compile_declare(const zend_ast *ast) /* {{{ */ { - zend_ast_list *declares = zend_ast_get_list(ast->child[0]); + const zend_ast_list *declares = zend_ast_get_list(ast->child[0]); zend_ast *stmt_ast = ast->child[1]; zend_declarables orig_declarables = FC(declarables); uint32_t i; @@ -7145,7 +7137,7 @@ static void zend_compile_declare(zend_ast *ast) /* {{{ */ static void zend_compile_stmt_list(zend_ast *ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; for (i = 0; i < list->children; ++i) { zend_compile_stmt(list->child[i]); @@ -7271,9 +7263,9 @@ static void zend_are_intersection_types_redundant(const zend_type left_type, con { ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(left_type)); ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(right_type)); - zend_type_list *l_type_list = ZEND_TYPE_LIST(left_type); - zend_type_list *r_type_list = ZEND_TYPE_LIST(right_type); - zend_type_list *smaller_type_list, *larger_type_list; + const zend_type_list *l_type_list = ZEND_TYPE_LIST(left_type); + const zend_type_list *r_type_list = ZEND_TYPE_LIST(right_type); + const zend_type_list *smaller_type_list, *larger_type_list; bool flipped = false; if (r_type_list->num_types < l_type_list->num_types) { @@ -7363,7 +7355,7 @@ static zend_type zend_compile_typename_ex( } if (ast->kind == ZEND_AST_TYPE_UNION) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_type_list *type_list; bool is_composite = false; bool has_only_iterable_class = true; @@ -7479,7 +7471,7 @@ static zend_type zend_compile_typename_ex( ZSTR_VAL(type_str)); } } else if (ast->kind == ZEND_AST_TYPE_INTERSECTION) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_type_list *type_list; /* Allocate the type list directly on the arena as it must be a type @@ -7609,20 +7601,20 @@ static void zend_compile_attributes( zend_attribute *attr; zend_internal_attribute *config; - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t g, i, j; ZEND_ASSERT(ast->kind == ZEND_AST_ATTRIBUTE_LIST); for (g = 0; g < list->children; g++) { - zend_ast_list *group = zend_ast_get_list(list->child[g]); + const zend_ast_list *group = zend_ast_get_list(list->child[g]); ZEND_ASSERT(group->kind == ZEND_AST_ATTRIBUTE_GROUP); for (i = 0; i < group->children; i++) { ZEND_ASSERT(group->child[i]->kind == ZEND_AST_ATTRIBUTE); - zend_ast *el = group->child[i]; + const zend_ast *el = group->child[i]; if (el->child[1] && el->child[1]->kind == ZEND_AST_CALLABLE_CONVERT) { @@ -7691,7 +7683,7 @@ static void zend_compile_attributes( if (*attributes != NULL) { /* Allow delaying target validation for forward compatibility. */ - zend_attribute *delayed_target_validation = NULL; + const zend_attribute *delayed_target_validation = NULL; if (target == ZEND_ATTRIBUTE_TARGET_PARAMETER) { ZEND_ASSERT(offset >= 1); /* zend_get_parameter_attribute_str will add 1 too */ @@ -7752,10 +7744,10 @@ static void zend_compile_attributes( static void zend_compile_property_hooks( zend_property_info *prop_info, zend_string *prop_name, - zend_ast *prop_type_ast, zend_ast_list *hooks); + zend_ast *prop_type_ast, const zend_ast_list *hooks); typedef struct { - zend_string *property_name; + const zend_string *property_name; bool uses_property; } find_property_usage_context; @@ -7767,14 +7759,14 @@ static void zend_property_hook_find_property_usage(zend_ast **ast_ptr, void *_co if (ast == NULL) { return; } else if (ast->kind == ZEND_AST_PROP || ast->kind == ZEND_AST_NULLSAFE_PROP) { - zend_ast *object_ast = ast->child[0]; + const zend_ast *object_ast = ast->child[0]; zend_ast *property_ast = ast->child[1]; if (object_ast->kind == ZEND_AST_VAR && object_ast->child[0]->kind == ZEND_AST_ZVAL && property_ast->kind == ZEND_AST_ZVAL) { - zval *object = zend_ast_get_zval(object_ast->child[0]); - zval *property = zend_ast_get_zval(property_ast); + const zval *object = zend_ast_get_zval(object_ast->child[0]); + const zval *property = zend_ast_get_zval(property_ast); if (Z_TYPE_P(object) == IS_STRING && Z_TYPE_P(property) == IS_STRING && zend_string_equals_literal(Z_STR_P(object), "this") @@ -7792,7 +7784,7 @@ static void zend_property_hook_find_property_usage(zend_ast **ast_ptr, void *_co } } -static bool zend_property_hook_uses_property(zend_string *property_name, zend_string *hook_name, zend_ast *hook_ast) +static bool zend_property_hook_uses_property(const zend_string *property_name, const zend_string *hook_name, zend_ast *hook_ast) { if (zend_string_equals_literal_ci(hook_name, "set") && hook_ast->kind == ZEND_AST_PROPERTY_HOOK_SHORT_BODY) { @@ -7804,7 +7796,7 @@ static bool zend_property_hook_uses_property(zend_string *property_name, zend_st return context.uses_property; } -static bool zend_property_is_virtual(zend_class_entry *ce, zend_string *property_name, zend_ast *hooks_ast, uint32_t flags) +static bool zend_property_is_virtual(const zend_class_entry *ce, const zend_string *property_name, zend_ast *hooks_ast, uint32_t flags) { if (ce->ce_flags & ZEND_ACC_INTERFACE) { return true; @@ -7815,9 +7807,9 @@ static bool zend_property_is_virtual(zend_class_entry *ce, zend_string *property bool is_virtual = true; - zend_ast_list *hooks = zend_ast_get_list(hooks_ast); + const zend_ast_list *hooks = zend_ast_get_list(hooks_ast); for (uint32_t i = 0; i < hooks->children; i++) { - zend_ast_decl *hook = (zend_ast_decl *) hooks->child[i]; + const zend_ast_decl *hook = (const zend_ast_decl *) hooks->child[i]; zend_ast *body = hook->child[2]; if (body && zend_property_hook_uses_property(property_name, hook->name, body)) { is_virtual = false; @@ -8017,16 +8009,16 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 } if (is_promoted) { - zend_op_array *op_array = CG(active_op_array); - zend_class_entry *scope = op_array->scope; + const zend_op_array *active_op_array = CG(active_op_array); + zend_class_entry *scope = active_op_array->scope; bool is_ctor = - scope && zend_is_constructor(op_array->function_name); + scope && zend_is_constructor(active_op_array->function_name); if (!is_ctor) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare promoted property outside a constructor"); } - if ((op_array->fn_flags & ZEND_ACC_ABSTRACT) + if ((active_op_array->fn_flags & ZEND_ACC_ABSTRACT) || (scope->ce_flags & ZEND_ACC_INTERFACE)) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare promoted property in an abstract constructor"); @@ -8081,7 +8073,7 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 property_flags | (zend_property_is_virtual(scope, name, hooks_ast, property_flags) ? ZEND_ACC_VIRTUAL : 0) | ZEND_ACC_PROMOTED, doc_comment, type); if (hooks_ast) { - zend_ast_list *hooks = zend_ast_get_list(hooks_ast); + const zend_ast_list *hooks = zend_ast_get_list(hooks_ast); zend_compile_property_hooks(prop, name, type_ast, hooks); } if (attributes_ast) { @@ -8136,7 +8128,7 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 static void zend_compile_closure_binding(znode *closure, zend_op_array *op_array, zend_ast *uses_ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(uses_ast); + const zend_ast_list *list = zend_ast_get_list(uses_ast); uint32_t i; if (!list->children) { @@ -8211,17 +8203,17 @@ static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { find_implicit_binds_recursively(info, name_ast); } } else if (zend_ast_is_list(ast)) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; for (i = 0; i < list->children; i++) { find_implicit_binds_recursively(info, list->child[i]); } } else if (ast->kind == ZEND_AST_CLOSURE) { /* For normal closures add the use() list. */ - zend_ast_decl *closure_ast = (zend_ast_decl *) ast; + const zend_ast_decl *closure_ast = (const zend_ast_decl *) ast; zend_ast *uses_ast = closure_ast->child[1]; if (uses_ast) { - zend_ast_list *uses_list = zend_ast_get_list(uses_ast); + const zend_ast_list *uses_list = zend_ast_get_list(uses_ast); uint32_t i; for (i = 0; i < uses_list->children; i++) { zend_hash_add_empty_element(&info->uses, zend_ast_get_str(uses_list->child[i])); @@ -8229,7 +8221,7 @@ static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { } } else if (ast->kind == ZEND_AST_ARROW_FUNC) { /* For arrow functions recursively check the expression. */ - zend_ast_decl *closure_ast = (zend_ast_decl *) ast; + const zend_ast_decl *closure_ast = (const zend_ast_decl *) ast; closure_info inner_info; find_implicit_binds(&inner_info, closure_ast->child[0], closure_ast->child[2]); if (inner_info.varvars_used) { @@ -8249,7 +8241,7 @@ static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) { static void find_implicit_binds(closure_info *info, zend_ast *params_ast, zend_ast *stmt_ast) { - zend_ast_list *param_list = zend_ast_get_list(params_ast); + const zend_ast_list *param_list = zend_ast_get_list(params_ast); uint32_t i; zend_hash_init(&info->uses, param_list->children, NULL, NULL, 0); @@ -8259,13 +8251,13 @@ static void find_implicit_binds(closure_info *info, zend_ast *params_ast, zend_a /* Remove variables that are parameters */ for (i = 0; i < param_list->children; i++) { - zend_ast *param_ast = param_list->child[i]; + const zend_ast *param_ast = param_list->child[i]; zend_hash_del(&info->uses, zend_ast_get_str(param_ast->child[1])); } } static void compile_implicit_lexical_binds( - closure_info *info, znode *closure, zend_op_array *op_array) + const closure_info *info, znode *closure, zend_op_array *op_array) { zend_string *var_name; zend_op *opline; @@ -8293,8 +8285,8 @@ static void compile_implicit_lexical_binds( static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ { - zend_op_array *op_array = CG(active_op_array); - zend_ast_list *list = zend_ast_get_list(ast); + const zend_op_array *op_array = CG(active_op_array); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; for (i = 0; i < list->children; ++i) { @@ -8325,7 +8317,7 @@ static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_implicit_closure_uses(closure_info *info) +static void zend_compile_implicit_closure_uses(const closure_info *info) { zend_string *var_name; ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name) @@ -8450,7 +8442,7 @@ enum func_decl_level { FUNC_DECL_LEVEL_CONSTEXPR, }; -static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, enum func_decl_level level) /* {{{ */ +static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, const zend_ast_decl *decl, enum func_decl_level level) /* {{{ */ { zend_string *unqualified_name, *name, *lcname; zend_op *opline; @@ -8462,7 +8454,7 @@ static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_string *class = zend_empty_string; zend_string *separator = zend_empty_string; zend_string *function = filename; - char *parens = ""; + const char *parens = ""; if (CG(active_op_array) && CG(active_op_array)->function_name) { if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { @@ -8500,7 +8492,7 @@ static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, lcname = zend_string_tolower(name); if (FC(imports_function)) { - zend_string *import_name = + const zend_string *import_name = zend_hash_find_ptr_lc(FC(imports_function), unqualified_name); if (import_name && !zend_string_equals_ci(lcname, import_name)) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare function %s() (previously declared as local import)", @@ -8614,7 +8606,7 @@ static zend_op_array *zend_compile_func_decl_ex( zend_compile_attributes(&op_array->attributes, decl->child[4], 0, target, 0); - zend_attribute *override_attribute = zend_get_attribute_str( + const zend_attribute *override_attribute = zend_get_attribute_str( op_array->attributes, "override", sizeof("override")-1 @@ -8624,7 +8616,7 @@ static zend_op_array *zend_compile_func_decl_ex( op_array->fn_flags |= ZEND_ACC_OVERRIDE; } - zend_attribute *deprecated_attribute = zend_get_attribute_str( + const zend_attribute *deprecated_attribute = zend_get_attribute_str( op_array->attributes, "deprecated", sizeof("deprecated")-1 @@ -8672,7 +8664,7 @@ static zend_op_array *zend_compile_func_decl_ex( if (ast->kind == ZEND_AST_ARROW_FUNC && decl->child[2]->kind != ZEND_AST_RETURN) { bool needs_return = true; if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { - zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; + const zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; needs_return = !ZEND_TYPE_CONTAINS_CODE(return_info->type, IS_NEVER); } if (needs_return) { @@ -8690,7 +8682,7 @@ static zend_op_array *zend_compile_func_decl_ex( ZEND_ASSERT(!is_hook); if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { - zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; + const zend_arg_info *return_info = CG(active_op_array)->arg_info - 1; if (ZEND_TYPE_CONTAINS_CODE(return_info->type, IS_VOID)) { zend_error_noreturn(E_COMPILE_ERROR, "A void %s does not return a value, but #[\\NoDiscard] requires a return value", @@ -8750,7 +8742,7 @@ static zend_op_array *zend_compile_func_decl(znode *result, zend_ast *ast, enum return zend_compile_func_decl_ex(result, ast, level, /* property_info */ NULL, (zend_property_hook_kind)-1); } -zend_property_hook_kind zend_get_property_hook_kind_from_name(zend_string *name) { +zend_property_hook_kind zend_get_property_hook_kind_from_name(const zend_string *name) { if (zend_string_equals_literal_ci(name, "get")) { return ZEND_PROPERTY_HOOK_GET; } else if (zend_string_equals_literal_ci(name, "set")) { @@ -8762,7 +8754,7 @@ zend_property_hook_kind zend_get_property_hook_kind_from_name(zend_string *name) static void zend_compile_property_hooks( zend_property_info *prop_info, zend_string *prop_name, - zend_ast *prop_type_ast, zend_ast_list *hooks) + zend_ast *prop_type_ast, const zend_ast_list *hooks) { zend_class_entry *ce = CG(active_class_entry); @@ -8846,12 +8838,12 @@ static void zend_compile_property_hooks( *return_type_ast_ptr = prop_type_ast; } else if (hook_kind == ZEND_PROPERTY_HOOK_SET) { if (hook->child[0]) { - zend_ast_list *param_list = zend_ast_get_list(hook->child[0]); + const zend_ast_list *param_list = zend_ast_get_list(hook->child[0]); if (param_list->children != 1) { zend_error_noreturn(E_COMPILE_ERROR, "%s hook of property %s::$%s must accept exactly one parameters", ZSTR_VAL(name), ZSTR_VAL(ce->name), ZSTR_VAL(prop_name)); } - zend_ast *value_param_ast = param_list->child[0]; + const zend_ast *value_param_ast = param_list->child[0]; if (value_param_ast->attr & ZEND_PARAM_REF) { zend_error_noreturn(E_COMPILE_ERROR, "Parameter $%s of %s hook %s::$%s must not be pass-by-reference", ZSTR_VAL(zend_ast_get_str(value_param_ast->child[1])), ZSTR_VAL(name), ZSTR_VAL(ce->name), ZSTR_VAL(prop_name)); @@ -8942,7 +8934,7 @@ static void zend_compile_property_hooks( static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, zend_ast *attr_ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_class_entry *ce = CG(active_class_entry); uint32_t i, children = list->children; @@ -9077,7 +9069,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f if (attr_ast) { zend_compile_attributes(&info->attributes, attr_ast, 0, ZEND_ATTRIBUTE_TARGET_PROPERTY, 0); - zend_attribute *override_attribute = zend_get_attribute_str(info->attributes, "override", sizeof("override")-1); + const zend_attribute *override_attribute = zend_get_attribute_str(info->attributes, "override", sizeof("override")-1); if (override_attribute) { info->flags |= ZEND_ACC_OVERRIDE; } @@ -9088,7 +9080,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f } /* }}} */ -static void zend_compile_prop_group(zend_ast *ast) /* {{{ */ +static void zend_compile_prop_group(const zend_ast *ast) /* {{{ */ { zend_ast *type_ast = ast->child[0]; zend_ast *prop_ast = ast->child[1]; @@ -9110,7 +9102,7 @@ static void zend_check_trait_alias_modifiers(uint32_t attr) /* {{{ */ static void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_ast *attr_ast, zend_ast *type_ast) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_class_entry *ce = CG(active_class_entry); uint32_t i, children = list->children; @@ -9159,7 +9151,7 @@ static void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_as if (attr_ast) { zend_compile_attributes(&c->attributes, attr_ast, 0, ZEND_ATTRIBUTE_TARGET_CLASS_CONST, 0); - zend_attribute *deprecated = zend_get_attribute_str(c->attributes, "deprecated", sizeof("deprecated")-1); + const zend_attribute *deprecated = zend_get_attribute_str(c->attributes, "deprecated", sizeof("deprecated")-1); if (deprecated) { ZEND_CLASS_CONST_FLAGS(c) |= ZEND_ACC_DEPRECATED; @@ -9172,7 +9164,7 @@ static void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_as } } -static void zend_compile_class_const_group(zend_ast *ast) /* {{{ */ +static void zend_compile_class_const_group(const zend_ast *ast) /* {{{ */ { zend_ast *const_ast = ast->child[0]; zend_ast *attr_ast = ast->child[1]; @@ -9182,7 +9174,7 @@ static void zend_compile_class_const_group(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_method_ref(zend_ast *ast, zend_trait_method_reference *method_ref) /* {{{ */ +static void zend_compile_method_ref(const zend_ast *ast, zend_trait_method_reference *method_ref) /* {{{ */ { zend_ast *class_ast = ast->child[0]; zend_ast *method_ast = ast->child[1]; @@ -9197,11 +9189,11 @@ static void zend_compile_method_ref(zend_ast *ast, zend_trait_method_reference * } /* }}} */ -static void zend_compile_trait_precedence(zend_ast *ast) /* {{{ */ +static void zend_compile_trait_precedence(const zend_ast *ast) /* {{{ */ { - zend_ast *method_ref_ast = ast->child[0]; + const zend_ast *method_ref_ast = ast->child[0]; zend_ast *insteadof_ast = ast->child[1]; - zend_ast_list *insteadof_list = zend_ast_get_list(insteadof_ast); + const zend_ast_list *insteadof_list = zend_ast_get_list(insteadof_ast); uint32_t i; zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence) + (insteadof_list->children - 1) * sizeof(zend_string*)); @@ -9218,9 +9210,9 @@ static void zend_compile_trait_precedence(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */ +static void zend_compile_trait_alias(const zend_ast *ast) /* {{{ */ { - zend_ast *method_ref_ast = ast->child[0]; + const zend_ast *method_ref_ast = ast->child[0]; zend_ast *alias_ast = ast->child[1]; uint32_t modifiers = ast->attr; @@ -9242,9 +9234,9 @@ static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_use_trait(zend_ast *ast) /* {{{ */ +static void zend_compile_use_trait(const zend_ast *ast) /* {{{ */ { - zend_ast_list *traits = zend_ast_get_list(ast->child[0]); + const zend_ast_list *traits = zend_ast_get_list(ast->child[0]); zend_ast_list *adaptations = ast->child[1] ? zend_ast_get_list(ast->child[1]) : NULL; zend_class_entry *ce = CG(active_class_entry); uint32_t i; @@ -9271,7 +9263,7 @@ static void zend_compile_use_trait(zend_ast *ast) /* {{{ */ } for (i = 0; i < adaptations->children; ++i) { - zend_ast *adaptation_ast = adaptations->child[i]; + const zend_ast *adaptation_ast = adaptations->child[i]; switch (adaptation_ast->kind) { case ZEND_AST_TRAIT_PRECEDENCE: zend_compile_trait_precedence(adaptation_ast); @@ -9287,7 +9279,7 @@ static void zend_compile_use_trait(zend_ast *ast) /* {{{ */ static void zend_compile_implements(zend_ast *ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_class_entry *ce = CG(active_class_entry); zend_class_name *interface_names; uint32_t i; @@ -9306,7 +9298,7 @@ static void zend_compile_implements(zend_ast *ast) /* {{{ */ } /* }}} */ -static zend_string *zend_generate_anon_class_name(zend_ast_decl *decl) +static zend_string *zend_generate_anon_class_name(const zend_ast_decl *decl) { zend_string *filename = CG(active_op_array)->filename; uint32_t start_lineno = decl->start_lineno; @@ -9316,7 +9308,7 @@ static zend_string *zend_generate_anon_class_name(zend_ast_decl *decl) if (decl->child[0]) { prefix = zend_resolve_const_class_name_reference(decl->child[0], "class name"); } else if (decl->child[1]) { - zend_ast_list *list = zend_ast_get_list(decl->child[1]); + const zend_ast_list *list = zend_ast_get_list(decl->child[1]); prefix = zend_resolve_const_class_name_reference(list->child[0], "interface name"); } @@ -9346,9 +9338,9 @@ static void zend_compile_enum_backing_type(zend_class_entry *ce, zend_ast *enum_ zend_type_release(type, 0); } -static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel) /* {{{ */ +static void zend_compile_class_decl(znode *result, const zend_ast *ast, bool toplevel) /* {{{ */ { - zend_ast_decl *decl = (zend_ast_decl *) ast; + const zend_ast_decl *decl = (const zend_ast_decl *) ast; zend_ast *extends_ast = decl->child[0]; zend_ast *implements_ast = decl->child[1]; zend_ast *stmt_ast = decl->child[2]; @@ -9668,7 +9660,7 @@ static char *zend_get_use_type_str(uint32_t type) /* {{{ */ } /* }}} */ -static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend_string *new_name, zend_string *check_name) /* {{{ */ +static void zend_check_already_in_use(uint32_t type, const zend_string *old_name, const zend_string *new_name, const zend_string *check_name) /* {{{ */ { if (zend_string_equals_ci(old_name, check_name)) { return; @@ -9681,7 +9673,7 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend static void zend_compile_use(zend_ast *ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; zend_string *current_ns = FC(current_namespace); uint32_t type = ast->attr; @@ -9689,7 +9681,7 @@ static void zend_compile_use(zend_ast *ast) /* {{{ */ bool case_sensitive = type == ZEND_SYMBOL_CONST; for (i = 0; i < list->children; ++i) { - zend_ast *use_ast = list->child[i]; + const zend_ast *use_ast = list->child[i]; zend_ast *old_name_ast = use_ast->child[0]; zend_ast *new_name_ast = use_ast->child[1]; zend_string *old_name = zend_ast_get_str(old_name_ast); @@ -9752,11 +9744,11 @@ static void zend_compile_use(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_group_use(zend_ast *ast) /* {{{ */ +static void zend_compile_group_use(const zend_ast *ast) /* {{{ */ { uint32_t i; - zend_string *ns = zend_ast_get_str(ast->child[0]); - zend_ast_list *list = zend_ast_get_list(ast->child[1]); + const zend_string *ns = zend_ast_get_str(ast->child[0]); + const zend_ast_list *list = zend_ast_get_list(ast->child[1]); for (i = 0; i < list->children; i++) { zend_ast *inline_use, *use = list->child[i]; @@ -9846,7 +9838,7 @@ static void zend_compile_const_decl(zend_ast *ast) /* {{{ */ } /* }}}*/ -static void zend_compile_namespace(zend_ast *ast) /* {{{ */ +static void zend_compile_namespace(const zend_ast *ast) /* {{{ */ { zend_ast *name_ast = ast->child[0]; zend_ast *stmt_ast = ast->child[1]; @@ -9909,12 +9901,11 @@ static void zend_compile_namespace(zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_halt_compiler(zend_ast *ast) /* {{{ */ +static void zend_compile_halt_compiler(const zend_ast *ast) /* {{{ */ { zend_ast *offset_ast = ast->child[0]; zend_long offset = Z_LVAL_P(zend_ast_get_zval(offset_ast)); - zend_string *filename, *name; const char const_name[] = "__COMPILER_HALT_OFFSET__"; if (FC(has_bracketed_namespaces) && FC(in_namespace)) { @@ -9922,8 +9913,8 @@ static void zend_compile_halt_compiler(zend_ast *ast) /* {{{ */ "__HALT_COMPILER() can only be used from the outermost scope"); } - filename = zend_get_compiled_filename(); - name = zend_mangle_property_name(const_name, sizeof(const_name) - 1, + const zend_string *filename = zend_get_compiled_filename(); + zend_string *name = zend_mangle_property_name(const_name, sizeof(const_name) - 1, ZSTR_VAL(filename), ZSTR_LEN(filename), false); /* Avoid repeated declaration of the __COMPILER_HALT_OFFSET__ constant in @@ -9935,10 +9926,10 @@ static void zend_compile_halt_compiler(zend_ast *ast) /* {{{ */ } /* }}} */ -static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */ +static bool zend_try_ct_eval_magic_const(zval *zv, const zend_ast *ast) /* {{{ */ { - zend_op_array *op_array = CG(active_op_array); - zend_class_entry *ce = CG(active_class_entry); + const zend_op_array *op_array = CG(active_op_array); + const zend_class_entry *ce = CG(active_class_entry); switch (ast->attr) { case T_LINE: @@ -9949,7 +9940,7 @@ static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */ break; case T_DIR: { - zend_string *filename = CG(compiled_filename); + const zend_string *filename = CG(compiled_filename); zend_string *dirname = zend_string_init(ZSTR_VAL(filename), ZSTR_LEN(filename), 0); #ifdef ZEND_WIN32 ZSTR_LEN(dirname) = php_win32_ioutil_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname)); @@ -10138,7 +10129,7 @@ static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zva return 0; } - binary_op_type fn = get_binary_op(opcode); + const binary_op_type fn = get_binary_op(opcode); fn(result, op1, op2); return 1; } @@ -10168,7 +10159,7 @@ static inline bool zend_try_ct_eval_unary_op(zval *result, uint32_t opcode, zval return 0; } - unary_op_type fn = get_unary_op(opcode); + const unary_op_type fn = get_unary_op(opcode); fn(result, op); return 1; } @@ -10184,7 +10175,7 @@ static inline bool zend_try_ct_eval_unary_pm(zval *result, zend_ast_kind kind, z static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *op1, zval *op2) /* {{{ */ { - binary_op_type fn = kind == ZEND_AST_GREATER + const binary_op_type fn = kind == ZEND_AST_GREATER ? is_smaller_function : is_smaller_or_equal_function; fn(result, op2, op1); } @@ -10192,7 +10183,7 @@ static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval * static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); zend_ast *last_elem_ast = NULL; uint32_t i; bool is_constant = true; @@ -10244,14 +10235,14 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ array_init_size(result, list->children); for (i = 0; i < list->children; ++i) { - zend_ast *elem_ast = list->child[i]; + const zend_ast *elem_ast = list->child[i]; zend_ast *value_ast = elem_ast->child[0]; zend_ast *key_ast; zval *value = zend_ast_get_zval(value_ast); if (elem_ast->kind == ZEND_AST_UNPACK) { if (Z_TYPE_P(value) == IS_ARRAY) { - HashTable *ht = Z_ARRVAL_P(value); + const HashTable *ht = Z_ARRVAL_P(value); zval *val; zend_string *key; @@ -10275,7 +10266,7 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ key_ast = elem_ast->child[1]; if (key_ast) { - zval *key = zend_ast_get_zval(key_ast); + const zval *key = zend_ast_get_zval(key_ast); switch (Z_TYPE_P(key)) { case IS_LONG: zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(key), value); @@ -10414,7 +10405,7 @@ static void zend_compile_greater(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_unary_op(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_unary_op(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; uint32_t opcode = ast->attr; @@ -10510,7 +10501,7 @@ static void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ * } /* }}} */ -static void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_post_incdec(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *var_ast = ast->child[0]; ZEND_ASSERT(ast->kind == ZEND_AST_POST_INC || ast->kind == ZEND_AST_POST_DEC); @@ -10537,7 +10528,7 @@ static void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_pre_incdec(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *var_ast = ast->child[0]; ZEND_ASSERT(ast->kind == ZEND_AST_PRE_INC || ast->kind == ZEND_AST_PRE_DEC); @@ -10566,7 +10557,7 @@ static void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_cast(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_cast(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; znode expr_node; @@ -10805,7 +10796,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_print(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_print(znode *result, const zend_ast *ast) /* {{{ */ { zend_op *opline; zend_ast *expr_ast = ast->child[0]; @@ -10856,7 +10847,7 @@ static void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_yield_from(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_yield_from(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; znode expr_node; @@ -10905,7 +10896,7 @@ static void zend_compile_instanceof(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_include_or_eval(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_include_or_eval(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; znode expr_node; @@ -10921,7 +10912,7 @@ static void zend_compile_include_or_eval(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_isset_or_empty(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *var_ast = ast->child[0]; @@ -11001,7 +10992,7 @@ static void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_silence(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_silence(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; znode silence_node; @@ -11020,7 +11011,7 @@ static void zend_compile_silence(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_shell_exec(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_shell_exec(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; @@ -11119,7 +11110,7 @@ static void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_const(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *name_ast = ast->child[0]; @@ -11133,7 +11124,7 @@ static void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */ zend_ast *last = CG(ast); while (last && last->kind == ZEND_AST_STMT_LIST) { - zend_ast_list *list = zend_ast_get_list(last); + const zend_ast_list *list = zend_ast_get_list(last); if (list->children == 0) { break; } @@ -11210,7 +11201,7 @@ static void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_class_name(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_class_name(znode *result, const zend_ast *ast) /* {{{ */ { zend_ast *class_ast = ast->child[0]; @@ -11405,7 +11396,7 @@ static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */ } /* }}} */ -static void zend_compile_magic_const(znode *result, zend_ast *ast) /* {{{ */ +static void zend_compile_magic_const(znode *result, const zend_ast *ast) /* {{{ */ { zend_op *opline; @@ -11580,7 +11571,7 @@ static void zend_compile_const_expr_new(zend_ast **ast_ptr) zend_ast *class_ast = (*ast_ptr)->child[0]; zend_compile_const_expr_class_reference(class_ast); - zend_ast *args_ast = (*ast_ptr)->child[1]; + const zend_ast *args_ast = (*ast_ptr)->child[1]; if (args_ast->kind == ZEND_AST_CALLABLE_CONVERT) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot create Closure for new expression"); } @@ -11589,7 +11580,7 @@ static void zend_compile_const_expr_new(zend_ast **ast_ptr) static void zend_compile_const_expr_closure(zend_ast **ast_ptr) { zend_ast_decl *closure_ast = (zend_ast_decl *) *ast_ptr; - zend_ast *uses_ast = closure_ast->child[1]; + const zend_ast *uses_ast = closure_ast->child[1]; if (!(closure_ast->flags & ZEND_ACC_STATIC)) { zend_error_noreturn(E_COMPILE_ERROR, "Closures in constant expressions must be static"); @@ -11663,7 +11654,7 @@ static void zend_compile_const_expr_args(zend_ast **ast_ptr) zend_ast_list *list = zend_ast_get_list(*ast_ptr); bool uses_named_args = false; for (uint32_t i = 0; i < list->children; i++) { - zend_ast *arg = list->child[i]; + const zend_ast *arg = list->child[i]; if (arg->kind == ZEND_AST_UNPACK) { zend_error_noreturn(E_COMPILE_ERROR, "Argument unpacking in constant expressions is not supported"); @@ -11687,7 +11678,7 @@ typedef struct { static void zend_compile_const_expr(zend_ast **ast_ptr, void *context) /* {{{ */ { - const_expr_context *ctx = (const_expr_context *) context; + const const_expr_context *ctx = context; zend_ast *ast = *ast_ptr; if (ast == NULL || ast->kind == ZEND_AST_ZVAL) { return; @@ -11766,7 +11757,7 @@ void zend_compile_top_stmt(zend_ast *ast) /* {{{ */ } if (ast->kind == ZEND_AST_STMT_LIST) { - zend_ast_list *list = zend_ast_get_list(ast); + const zend_ast_list *list = zend_ast_get_list(ast); uint32_t i; for (i = 0; i < list->children; ++i) { zend_compile_top_stmt(list->child[i]); @@ -12321,7 +12312,7 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */ case ZEND_AST_DIM: { /* constant expression should be always read context ... */ - zval *container, *dim; + const zval *container, *dim; if (ast->child[1] == NULL) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index e8b429bc4696a..86fab4b57ded6 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -461,7 +461,7 @@ const char *zend_visibility_string(uint32_t fn_flags); /* Stored in zend_property_info.offset, not returned by zend_get_property_offset(). */ #define ZEND_VIRTUAL_PROPERTY_OFFSET ((uint32_t)-1) -zend_property_hook_kind zend_get_property_hook_kind_from_name(zend_string *name); +zend_property_hook_kind zend_get_property_hook_kind_from_name(const zend_string *name); typedef struct _zend_property_info { uint32_t offset; /* property offset for object properties or @@ -880,9 +880,9 @@ void shutdown_compiler(void); void zend_init_compiler_data_structures(void); void zend_oparray_context_begin(zend_oparray_context *prev_context, zend_op_array *op_array); -void zend_oparray_context_end(zend_oparray_context *prev_context); +void zend_oparray_context_end(const zend_oparray_context *prev_context); void zend_file_context_begin(zend_file_context *prev_context); -void zend_file_context_end(zend_file_context *prev_context); +void zend_file_context_end(const zend_file_context *prev_context); extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type); extern ZEND_API zend_op_array *(*zend_compile_string)(zend_string *source_string, const char *filename, zend_compile_position position); @@ -933,8 +933,8 @@ uint32_t zend_modifier_list_to_flags(zend_modifier_target target, zend_ast *modi bool zend_handle_encoding_declaration(zend_ast *ast); ZEND_API zend_class_entry *zend_bind_class_in_slot( - zval *class_table_slot, zval *lcname, zend_string *lc_parent_name); -ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname); + zval *class_table_slot, const zval *lcname, zend_string *lc_parent_name); +ZEND_API zend_result do_bind_function(zend_function *func, const zval *lcname); ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name); void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline); @@ -963,7 +963,7 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle); ZEND_API void zend_cleanup_mutable_class_data(zend_class_entry *ce); ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce); ZEND_API void zend_type_release(zend_type type, bool persistent); -ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name); +ZEND_API zend_string *zend_create_member_string(const zend_string *class_name, const zend_string *member_name); ZEND_API ZEND_COLD void zend_user_exception_handler(void); @@ -1005,7 +1005,7 @@ ZEND_API bool zend_is_compiling(void); ZEND_API char *zend_make_compiled_string_description(const char *name); ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers); uint32_t zend_get_class_fetch_type(const zend_string *name); -ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc, bool result_used); +ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, const zend_function *fbc, bool result_used); ZEND_API bool zend_is_smart_branch(const zend_op *opline); typedef bool (*zend_auto_global_callback)(zend_string *name); diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 4715fd00fd463..8858f9fce96ae 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -359,7 +359,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(ui } } -static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, zend_function *func) +static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, const zend_function *func) { uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args + func->common.T; From 425b97e0b643da1dd7cbb7aba392e36b82243bc3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:45:52 +0100 Subject: [PATCH 284/386] phar: Remove unused macro (#20343) --- ext/phar/phar.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index b7bd61b86019f..c5bfb1b34c24f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -464,17 +464,10 @@ ZEND_ATTRIBUTE_NONNULL void phar_entry_remove(phar_entry_data *idata, char **err | ((uint32_t)(((unsigned char*)(buffer))[1]) << 8) \ | ((uint32_t)((unsigned char*)(buffer))[0]); \ (buffer) += 4 -# define PHAR_GET_16(buffer, var) \ - var = ((uint16_t)(((unsigned char*)(buffer))[1]) << 8) \ - | ((uint16_t)((unsigned char*)(buffer))[0]); \ - (buffer) += 2 #else # define PHAR_GET_32(buffer, var) \ memcpy(&var, buffer, sizeof(var)); \ buffer += 4 -# define PHAR_GET_16(buffer, var) \ - var = *(uint16_t*)(buffer); \ - buffer += 2 #endif #define PHAR_ZIP_16(var) ((uint16_t)((((uint16_t)var[0]) & 0xff) | \ (((uint16_t)var[1]) & 0xff) << 8)) From a979e9f897a90a580e883b1f39ce5673686ffc67 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 1 Nov 2025 19:41:37 +0000 Subject: [PATCH 285/386] ext/zip: lifting libzip minimum support. 0.11 dates back from 2013 whereas 1.0.0 is from 2015. Thus, simplifying the extension removing unlikely old api code usage. centos 7 can always uses an alternative repository (e.g. remi's); solaris 10 can access the 1.5.2 release via OpenCSW. close GH-20355 --- NEWS | 2 ++ ext/zip/config.m4 | 9 +-------- ext/zip/php_zip.c | 44 ++++++-------------------------------------- 3 files changed, 9 insertions(+), 46 deletions(-) diff --git a/NEWS b/NEWS index 8b8000311cdeb..92b404f3a68a1 100644 --- a/NEWS +++ b/NEWS @@ -36,5 +36,7 @@ PHP NEWS - Zip: . Fixed ZipArchive callback being called after executor has shut down. (ilutov) + . Support minimum version for libzip dependency updated to 1.0.0. + (David Carlier) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 643397c197216..29ae030d37b66 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -4,18 +4,11 @@ PHP_ARG_WITH([zip], [Include Zip read/write support])]) if test "$PHP_ZIP" != "no"; then - PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0]) + PKG_CHECK_MODULES([LIBZIP], [libzip >= 1.0.0 libzip != 1.3.1 libzip != 1.7.0]) PHP_EVAL_INCLINE([$LIBZIP_CFLAGS]) PHP_EVAL_LIBLINE([$LIBZIP_LIBS], [ZIP_SHARED_LIBADD]) - PHP_CHECK_LIBRARY([zip], [zip_file_set_mtime], - [AC_DEFINE([HAVE_SET_MTIME], [1], - [Define to 1 if libzip library has the 'zip_file_set_mtime' function - (available since 1.0.0).])], - [AC_MSG_WARN([Libzip >= 1.0.0 needed for setting mtime])], - [$LIBZIP_LIBS]) - PHP_CHECK_LIBRARY([zip], [zip_file_set_encryption], [AC_DEFINE([HAVE_ENCRYPTION], [1], [Define to 1 if libzip library has encryption support (available since diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index cf0234e7c2669..8fd778035ddcb 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -496,17 +496,11 @@ static zend_long php_zip_status(ze_zip_object *obj) /* {{{ */ int zep = obj->err_zip; /* saved err if closed */ if (obj->za) { -#if LIBZIP_VERSION_MAJOR < 1 - int syp; - - zip_error_get(obj->za, &zep, &syp); -#else zip_error_t *err; err = zip_get_error(obj->za); zep = zip_error_code_zip(err); zip_error_fini(err); -#endif } return zep; } @@ -523,17 +517,11 @@ static zend_long php_zip_status_sys(ze_zip_object *obj) /* {{{ */ int syp = obj->err_sys; /* saved err if closed */ if (obj->za) { -#if LIBZIP_VERSION_MAJOR < 1 - int zep; - - zip_error_get(obj->za, &zep, &syp); -#else zip_error_t *err; err = zip_get_error(obj->za); syp = zip_error_code_system(err); zip_error_fini(err); -#endif } return syp; } @@ -1529,18 +1517,12 @@ PHP_METHOD(ZipArchive, close) if (err) { php_error_docref(NULL, E_WARNING, "%s", zip_strerror(intern)); /* Save error for property reader */ - #if LIBZIP_VERSION_MAJOR < 1 - zip_error_get(intern, &ze_obj->err_zip, &ze_obj->err_sys); - #else - { - zip_error_t *ziperr; - - ziperr = zip_get_error(intern); - ze_obj->err_zip = zip_error_code_zip(ziperr); - ze_obj->err_sys = zip_error_code_system(ziperr); - zip_error_fini(ziperr); - } - #endif + zip_error_t *ziperr; + + ziperr = zip_get_error(intern); + ze_obj->err_zip = zip_error_code_zip(ziperr); + ze_obj->err_sys = zip_error_code_system(ziperr); + zip_error_fini(ziperr); zip_discard(intern); } else { ze_obj->err_zip = 0; @@ -1601,10 +1583,6 @@ PHP_METHOD(ZipArchive, clearError) PHP_METHOD(ZipArchive, getStatusString) { zval *self = ZEND_THIS; -#if LIBZIP_VERSION_MAJOR < 1 - int zep, syp, len; - char error_string[128]; -#endif ze_zip_object *ze_obj; if (zend_parse_parameters_none() == FAILURE) { @@ -1613,15 +1591,6 @@ PHP_METHOD(ZipArchive, getStatusString) ze_obj = Z_ZIP_P(self); /* not ZIP_FROM_OBJECT as we can use saved error after close */ -#if LIBZIP_VERSION_MAJOR < 1 - if (ze_obj->za) { - zip_error_get(ze_obj->za, &zep, &syp); - len = zip_error_to_str(error_string, 128, zep, syp); - } else { - len = zip_error_to_str(error_string, 128, ze_obj->err_zip, ze_obj->err_sys); - } - RETVAL_STRINGL(error_string, len); -#else if (ze_obj->za) { zip_error_t *err; @@ -1636,7 +1605,6 @@ PHP_METHOD(ZipArchive, getStatusString) RETVAL_STRING(zip_error_strerror(&err)); zip_error_fini(&err); } -#endif } /* }}} */ From 4bd3a9006e3ce98f1cf89639bb0c6af12b5f0427 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 2 Nov 2025 15:05:44 +0100 Subject: [PATCH 286/386] Use release_ex consistently in php_strtr_array_ex() (#20359) Reduces code size from 2056 -> 2006 on x86-64 with GCC 15.2.1. --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index c96b79f349a3b..386b3ec0f1f11 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2972,7 +2972,7 @@ static void php_strtr_array_ex(zval *return_value, zend_string *input, HashTable len = ZSTR_LEN(key_used); if (UNEXPECTED(len > slen)) { /* skip long patterns */ - zend_string_release(key_used); + zend_string_release_ex(key_used, false); continue; } if (len > maxlen) { From 9300a5076d6f8e7bd5eef627d2ad35323211595d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 2 Nov 2025 15:07:15 +0100 Subject: [PATCH 287/386] Reduce code size of strripos() (#20358) Reduction of 1325 -> 1213 on x86-64 with GCC 15.2.1. --- ext/standard/string.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 386b3ec0f1f11..6fb39c5a6bd24 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2109,13 +2109,11 @@ PHP_FUNCTION(strripos) needle_dup = zend_string_tolower(needle); if ((found = (char *)zend_memnrstr(p, ZSTR_VAL(needle_dup), ZSTR_LEN(needle_dup), e))) { RETVAL_LONG(found - ZSTR_VAL(haystack_dup)); - zend_string_release_ex(needle_dup, 0); - zend_string_release_ex(haystack_dup, 0); } else { - zend_string_release_ex(needle_dup, 0); - zend_string_release_ex(haystack_dup, 0); - RETURN_FALSE; + RETVAL_FALSE; } + zend_string_release_ex(needle_dup, false); + zend_string_release_ex(haystack_dup, false); } /* }}} */ From 8d1a42fd10862d1d7c10e11b64a620dcaff208bf Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 2 Nov 2025 20:45:04 +0100 Subject: [PATCH 288/386] ext/zip: Sync remaining parts for libzip >= 1.0.0 (#20365) Follow up of GH-20355 --- ext/zip/config.w32 | 2 +- ext/zip/php_zip.c | 2 -- ext/zip/php_zip.stub.php | 2 -- ext/zip/php_zip_arginfo.h | 8 +------- ext/zip/tests/oo_setmtime.phpt | 5 ----- ext/zip/zip_stream.c | 7 ------- 6 files changed, 2 insertions(+), 24 deletions(-) diff --git a/ext/zip/config.w32 b/ext/zip/config.w32 index c0226f8976460..9b80aefaaad0b 100644 --- a/ext/zip/config.w32 +++ b/ext/zip/config.w32 @@ -17,7 +17,7 @@ if (PHP_ZIP != "no") { } AC_DEFINE('HAVE_ZIP', 1, "Define to 1 if the PHP extension 'zip' is available."); - ADD_FLAG("CFLAGS_ZIP", "/D HAVE_SET_MTIME /D HAVE_ENCRYPTION /D HAVE_LIBZIP_VERSION /D HAVE_PROGRESS_CALLBACK /D HAVE_CANCEL_CALLBACK /D HAVE_METHOD_SUPPORTED /D LZMA_API_STATIC"); + ADD_FLAG("CFLAGS_ZIP", "/D HAVE_ENCRYPTION /D HAVE_LIBZIP_VERSION /D HAVE_PROGRESS_CALLBACK /D HAVE_CANCEL_CALLBACK /D HAVE_METHOD_SUPPORTED /D LZMA_API_STATIC"); } else { WARNING("zip not enabled; libraries and headers not found"); } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 8fd778035ddcb..008e82104e4d3 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2424,7 +2424,6 @@ PHP_METHOD(ZipArchive, setCompressionIndex) } /* }}} */ -#ifdef HAVE_SET_MTIME /* {{{ Set the modification time of a file in zip, using its name */ PHP_METHOD(ZipArchive, setMtimeName) { @@ -2477,7 +2476,6 @@ PHP_METHOD(ZipArchive, setMtimeIndex) (time_t)mtime, (zip_uint32_t)flags) == 0); } /* }}} */ -#endif /* {{{ Delete a file using its index */ PHP_METHOD(ZipArchive, deleteIndex) diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index 3473d27bf2050..8a37b2508da18 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -704,13 +704,11 @@ public function setCommentIndex(int $index, string $comment): bool {} /** @tentative-return-type */ public function setCommentName(string $name, string $comment): bool {} -#ifdef HAVE_SET_MTIME /** @tentative-return-type */ public function setMtimeIndex(int $index, int $timestamp, int $flags = 0): bool {} /** @tentative-return-type */ public function setMtimeName(string $name, int $timestamp, int $flags = 0): bool {} -#endif /** @tentative-return-type */ public function getCommentIndex(int $index, int $flags = 0): string|false {} diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index ed636339088f0..ba4f867e8af73 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 53e04d9b2c25cc8a0c9fe51914b5a47280834fb8 */ + * Stub hash: 1f77735273373672b9c8c5b92c46e23ea99faeaf */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -138,7 +138,6 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setCo ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) ZEND_END_ARG_INFO() -#if defined(HAVE_SET_MTIME) ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setMtimeIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) @@ -150,7 +149,6 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setMt ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#endif ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getCommentIndex, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) @@ -334,10 +332,8 @@ ZEND_METHOD(ZipArchive, setArchiveFlag); ZEND_METHOD(ZipArchive, getArchiveFlag); ZEND_METHOD(ZipArchive, setCommentIndex); ZEND_METHOD(ZipArchive, setCommentName); -#if defined(HAVE_SET_MTIME) ZEND_METHOD(ZipArchive, setMtimeIndex); ZEND_METHOD(ZipArchive, setMtimeName); -#endif ZEND_METHOD(ZipArchive, getCommentIndex); ZEND_METHOD(ZipArchive, getCommentName); ZEND_METHOD(ZipArchive, deleteIndex); @@ -414,10 +410,8 @@ static const zend_function_entry class_ZipArchive_methods[] = { ZEND_ME(ZipArchive, getArchiveFlag, arginfo_class_ZipArchive_getArchiveFlag, ZEND_ACC_PUBLIC) ZEND_ME(ZipArchive, setCommentIndex, arginfo_class_ZipArchive_setCommentIndex, ZEND_ACC_PUBLIC) ZEND_ME(ZipArchive, setCommentName, arginfo_class_ZipArchive_setCommentName, ZEND_ACC_PUBLIC) -#if defined(HAVE_SET_MTIME) ZEND_ME(ZipArchive, setMtimeIndex, arginfo_class_ZipArchive_setMtimeIndex, ZEND_ACC_PUBLIC) ZEND_ME(ZipArchive, setMtimeName, arginfo_class_ZipArchive_setMtimeName, ZEND_ACC_PUBLIC) -#endif ZEND_ME(ZipArchive, getCommentIndex, arginfo_class_ZipArchive_getCommentIndex, ZEND_ACC_PUBLIC) ZEND_ME(ZipArchive, getCommentName, arginfo_class_ZipArchive_getCommentName, ZEND_ACC_PUBLIC) ZEND_ME(ZipArchive, deleteIndex, arginfo_class_ZipArchive_deleteIndex, ZEND_ACC_PUBLIC) diff --git a/ext/zip/tests/oo_setmtime.phpt b/ext/zip/tests/oo_setmtime.phpt index 8c3c4eb7cca32..bf34dd722b519 100644 --- a/ext/zip/tests/oo_setmtime.phpt +++ b/ext/zip/tests/oo_setmtime.phpt @@ -2,11 +2,6 @@ setMtime --EXTENSIONS-- zip ---SKIPIF-- - --INI-- date.timezone=UTC --FILE-- diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index c0283b49eaaf3..76e4588f249e5 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -49,18 +49,11 @@ static ssize_t php_zip_ops_read(php_stream *stream, char *buf, size_t count) if (self->zf) { n = zip_fread(self->zf, buf, count); if (n < 0) { -#if LIBZIP_VERSION_MAJOR < 1 - int ze, se; - zip_file_error_get(self->zf, &ze, &se); - stream->eof = 1; - php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf)); -#else zip_error_t *err; err = zip_file_get_error(self->zf); stream->eof = 1; php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_error_strerror(err)); zip_error_fini(err); -#endif return -1; } /* cast count to signed value to avoid possibly negative n From 83e3a6d903b92bd58e9b575b2257c280c15b4cef Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 2 Nov 2025 21:10:03 +0000 Subject: [PATCH 289/386] ext/intl: migrate C code to C++ step 4. (#20170) --- .../{collator_attr.c => collator_attr.cpp} | 21 ++-- .../{collator_class.c => collator_class.cpp} | 22 ++-- ext/intl/collator/collator_class.h | 12 ++ ...ollator_compare.c => collator_compare.cpp} | 11 +- ...ollator_convert.c => collator_convert.cpp} | 35 +++--- ext/intl/collator/collator_convert.h | 6 + ...{collator_create.c => collator_create.cpp} | 13 +- .../{collator_error.c => collator_error.cpp} | 17 ++- ...r_is_numeric.c => collator_is_numeric.cpp} | 18 +-- ...{collator_locale.c => collator_locale.cpp} | 17 ++- .../{collator_sort.c => collator_sort.cpp} | 67 +++++----- ext/intl/config.m4 | 28 ++--- ext/intl/config.w32 | 26 ++-- ext/intl/grapheme/grapheme.h | 6 + ...{grapheme_string.c => grapheme_string.cpp} | 118 ++++++++++-------- .../{grapheme_util.c => grapheme_util.cpp} | 25 ++-- ext/intl/grapheme/grapheme_util.h | 6 + ...matter_class.c => listformatter_class.cpp} | 33 ++--- ext/intl/listformatter/listformatter_class.h | 6 + ...rator_class.c => transliterator_class.cpp} | 26 ++-- .../transliterator/transliterator_class.h | 12 ++ ...r_methods.c => transliterator_methods.cpp} | 89 +++++++------ 22 files changed, 370 insertions(+), 244 deletions(-) rename ext/intl/collator/{collator_attr.c => collator_attr.cpp} (81%) rename ext/intl/collator/{collator_class.c => collator_class.cpp} (85%) rename ext/intl/collator/{collator_compare.c => collator_compare.cpp} (95%) rename ext/intl/collator/{collator_convert.c => collator_convert.cpp} (90%) rename ext/intl/collator/{collator_create.c => collator_create.cpp} (91%) rename ext/intl/collator/{collator_error.c => collator_error.cpp} (87%) rename ext/intl/collator/{collator_is_numeric.c => collator_is_numeric.cpp} (96%) rename ext/intl/collator/{collator_locale.c => collator_locale.cpp} (82%) rename ext/intl/collator/{collator_sort.c => collator_sort.cpp} (88%) rename ext/intl/grapheme/{grapheme_string.c => grapheme_string.cpp} (90%) rename ext/intl/grapheme/{grapheme_util.c => grapheme_util.cpp} (89%) rename ext/intl/listformatter/{listformatter_class.c => listformatter_class.cpp} (89%) rename ext/intl/transliterator/{transliterator_class.c => transliterator_class.cpp} (88%) rename ext/intl/transliterator/{transliterator_methods.c => transliterator_methods.cpp} (84%) diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.cpp similarity index 81% rename from ext/intl/collator/collator_attr.c rename to ext/intl/collator/collator_attr.cpp index f16ae0cc5285d..f56596deb6b0e 100644 --- a/ext/intl/collator/collator_attr.c +++ b/ext/intl/collator/collator_attr.cpp @@ -17,14 +17,21 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +} #include "collator_class.h" #include "collator_convert.h" #include /* {{{ Get collation attribute value. */ -PHP_FUNCTION( collator_get_attribute ) +U_CFUNC PHP_FUNCTION( collator_get_attribute ) { zend_long attribute, value; @@ -40,7 +47,7 @@ PHP_FUNCTION( collator_get_attribute ) /* Fetch the object. */ COLLATOR_METHOD_FETCH_OBJECT; - value = ucol_getAttribute( co->ucoll, attribute, COLLATOR_ERROR_CODE_P( co ) ); + value = ucol_getAttribute( co->ucoll, static_cast(attribute), COLLATOR_ERROR_CODE_P( co ) ); COLLATOR_CHECK_STATUS( co, "Error getting attribute value" ); RETURN_LONG( value ); @@ -48,7 +55,7 @@ PHP_FUNCTION( collator_get_attribute ) /* }}} */ /* {{{ Set collation attribute. */ -PHP_FUNCTION( collator_set_attribute ) +U_CFUNC PHP_FUNCTION( collator_set_attribute ) { zend_long attribute, value; COLLATOR_METHOD_INIT_VARS @@ -65,7 +72,7 @@ PHP_FUNCTION( collator_set_attribute ) COLLATOR_METHOD_FETCH_OBJECT; /* Set new value for the given attribute. */ - ucol_setAttribute( co->ucoll, attribute, value, COLLATOR_ERROR_CODE_P( co ) ); + ucol_setAttribute( co->ucoll, static_cast(attribute), static_cast(value), COLLATOR_ERROR_CODE_P( co ) ); COLLATOR_CHECK_STATUS( co, "Error setting attribute value" ); RETURN_TRUE; @@ -73,7 +80,7 @@ PHP_FUNCTION( collator_set_attribute ) /* }}} */ /* {{{ Returns the current collation strength. */ -PHP_FUNCTION( collator_get_strength ) +U_CFUNC PHP_FUNCTION( collator_get_strength ) { COLLATOR_METHOD_INIT_VARS @@ -93,7 +100,7 @@ PHP_FUNCTION( collator_get_strength ) /* }}} */ /* {{{ Set the collation strength. */ -PHP_FUNCTION( collator_set_strength ) +U_CFUNC PHP_FUNCTION( collator_set_strength ) { zend_long strength; @@ -110,7 +117,7 @@ PHP_FUNCTION( collator_set_strength ) COLLATOR_METHOD_FETCH_OBJECT; /* Set given strength. */ - ucol_setStrength( co->ucoll, strength ); + ucol_setStrength( co->ucoll, static_cast(strength) ); RETURN_TRUE; } diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.cpp similarity index 85% rename from ext/intl/collator/collator_class.c rename to ext/intl/collator/collator_class.cpp index 3a883c9e2e645..293a089c26796 100644 --- a/ext/intl/collator/collator_class.c +++ b/ext/intl/collator/collator_class.cpp @@ -15,16 +15,18 @@ #include "collator.h" #include "collator_class.h" +extern "C" { #include "php_intl.h" +#include "intl_error.h" +#include "collator_arginfo.h" +} #include "collator_sort.h" #include "collator_convert.h" -#include "intl_error.h" #include -#include "collator_arginfo.h" -zend_class_entry *Collator_ce_ptr = NULL; +zend_class_entry *Collator_ce_ptr = nullptr; static zend_object_handlers Collator_handlers; /* @@ -43,9 +45,9 @@ void Collator_objects_free(zend_object *object ) /* }}} */ /* {{{ Collator_object_create */ -zend_object *Collator_object_create(zend_class_entry *ce ) +U_CFUNC zend_object *Collator_object_create(zend_class_entry *ce ) { - Collator_object *intern = zend_object_alloc(sizeof(Collator_object), ce); + Collator_object *intern = reinterpret_cast(zend_object_alloc(sizeof(Collator_object), ce)); intl_error_init(COLLATOR_ERROR_P(intern)); zend_object_std_init(&intern->zo, ce ); object_properties_init(&intern->zo, ce); @@ -61,7 +63,7 @@ zend_object *Collator_object_create(zend_class_entry *ce ) /* {{{ collator_register_Collator_symbols * Initialize 'Collator' class */ -void collator_register_Collator_symbols(int module_number) +U_CFUNC void collator_register_Collator_symbols(int module_number) { register_collator_symbols(module_number); @@ -75,7 +77,7 @@ void collator_register_Collator_symbols(int module_number) /* Collator has no usable clone semantics - ucol_cloneBinary/ucol_openBinary require binary buffer for which we don't have the place to keep */ Collator_handlers.offset = XtOffsetOf(Collator_object, zo); - Collator_handlers.clone_obj = NULL; + Collator_handlers.clone_obj = nullptr; Collator_handlers.free_obj = Collator_objects_free; } /* }}} */ @@ -84,7 +86,7 @@ void collator_register_Collator_symbols(int module_number) * Initialize internals of Collator_object. * Must be called before any other call to 'collator_object_...' functions. */ -void collator_object_init( Collator_object* co ) +U_CFUNC void collator_object_init( Collator_object* co ) { if( !co ) return; @@ -96,7 +98,7 @@ void collator_object_init( Collator_object* co ) /* {{{ void collator_object_destroy( Collator_object* co ) * Clean up mem allocted by internals of Collator_object */ -void collator_object_destroy( Collator_object* co ) +U_CFUNC void collator_object_destroy( Collator_object* co ) { if( !co ) return; @@ -104,7 +106,7 @@ void collator_object_destroy( Collator_object* co ) if( co->ucoll ) { ucol_close( co->ucoll ); - co->ucoll = NULL; + co->ucoll = nullptr; } intl_error_reset( COLLATOR_ERROR_P( co ) ); diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h index 311ab5623db4e..a281b2bec8ada 100644 --- a/ext/intl/collator/collator_class.h +++ b/ext/intl/collator/collator_class.h @@ -18,9 +18,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "../intl_common.h" #include "../intl_error.h" #include "../intl_data.h" +#ifdef __cplusplus +} +#endif #include @@ -46,9 +52,15 @@ static inline Collator_object *php_intl_collator_fetch_object(zend_object *obj) } #define Z_INTL_COLLATOR_P(zv) php_intl_collator_fetch_object(Z_OBJ_P(zv)) +#ifdef __cplusplus +extern "C" { +#endif void collator_register_Collator_symbols(int module_number); void collator_object_init( Collator_object* co ); void collator_object_destroy( Collator_object* co ); +#ifdef __cplusplus +} +#endif extern zend_class_entry *Collator_ce_ptr; diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.cpp similarity index 95% rename from ext/intl/collator/collator_compare.c rename to ext/intl/collator/collator_compare.cpp index bafaf166ac7a6..38e283a6d8530 100644 --- a/ext/intl/collator/collator_compare.c +++ b/ext/intl/collator/collator_compare.cpp @@ -17,12 +17,19 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" -#include "collator_class.h" #include "intl_convert.h" +} +#include "collator_class.h" /* {{{ Compare two strings. */ -PHP_FUNCTION( collator_compare ) +U_CFUNC PHP_FUNCTION( collator_compare ) { char* str1 = NULL; char* str2 = NULL; diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.cpp similarity index 90% rename from ext/intl/collator/collator_convert.c rename to ext/intl/collator/collator_convert.cpp index 68f177e36b0ff..d4de15aa0b822 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.cpp @@ -17,11 +17,18 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +#include "intl_convert.h" +} #include "collator_class.h" #include "collator_is_numeric.h" #include "collator_convert.h" -#include "intl_convert.h" #include #include @@ -106,7 +113,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( /* {{{ collator_convert_hash_from_utf8_to_utf16 * Convert values of the given hash from UTF-8 encoding to UTF-16LE. */ -void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status ) +U_CFUNC void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status ) { zend_ulong hashIndex; zval *hashData; @@ -125,7 +132,7 @@ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* stat /* {{{ collator_convert_hash_from_utf16_to_utf8 * Convert values of the given hash from UTF-16LE encoding to UTF-8. */ -void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status ) +U_CFUNC void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status ) { zend_ulong hashIndex; zend_string *hashKey; @@ -150,7 +157,7 @@ void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* stat * * @return zval* Converted string. */ -zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv ) +U_CFUNC zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv ) { zend_string* u8str; UErrorCode status = U_ZERO_ERROR; @@ -168,7 +175,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv ) } /* }}} */ -zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str) +U_CFUNC zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str) { UErrorCode status = U_ZERO_ERROR; @@ -189,9 +196,9 @@ zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str) /* {{{ collator_convert_object_to_string * Convert object to UTF16-encoded string. */ -zval* collator_convert_object_to_string( zval* obj, zval *rv ) +U_CFUNC zval* collator_convert_object_to_string( zval* obj, zval *rv ) { - zval* zstr = NULL; + zval* zstr = nullptr; UErrorCode status = U_ZERO_ERROR; /* Bail out if it's not an object. */ @@ -211,7 +218,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv ) } /* Object wasn't successfully converted => bail out. */ - if( zstr == NULL ) + if( zstr == nullptr ) { COLLATOR_CONVERT_RETURN_FAILED( obj ); } @@ -244,7 +251,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv ) * * @return zval* Number. If str is not numeric string return number zero. */ -zval* collator_convert_string_to_number( zval* str, zval *rv ) +U_CFUNC zval* collator_convert_string_to_number( zval* str, zval *rv ) { zval* num = collator_convert_string_to_number_if_possible( str, rv ); if( num == str ) @@ -268,7 +275,7 @@ zval* collator_convert_string_to_number( zval* str, zval *rv ) * * @return zval* Number. If str is not numeric string return number zero. */ -zval* collator_convert_string_to_double( zval* str, zval *rv ) +U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv ) { zval* num = collator_convert_string_to_number( str, rv ); if( Z_TYPE_P(num) == IS_LONG ) @@ -289,7 +296,7 @@ zval* collator_convert_string_to_double( zval* str, zval *rv ) * @return zval* Number if str is numeric string. Otherwise * original str param. */ -zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) +U_CFUNC zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) { uint8_t is_numeric = 0; zend_long lval = 0; @@ -323,7 +330,7 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) * * @return zend_string* UTF16 string. */ -zend_string *collator_zval_to_string(zval *arg) +U_CFUNC zend_string *collator_zval_to_string(zval *arg) { // TODO: This is extremely weird in that it leaves pre-existing strings alone and does not // perform a UTF-8 to UTF-16 conversion for them. The assumption is that values that are @@ -347,9 +354,9 @@ zend_string *collator_zval_to_string(zval *arg) * @return zval* Normalized copy of arg or unmodified arg * if normalization is not needed. */ -zval* collator_normalize_sort_argument( zval* arg, zval *rv ) +U_CFUNC zval* collator_normalize_sort_argument( zval* arg, zval *rv ) { - zval* n_arg = NULL; + zval* n_arg = nullptr; if( Z_TYPE_P( arg ) != IS_STRING ) { diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h index 1d58560964399..8c5356095b7a1 100644 --- a/ext/intl/collator/collator_convert.h +++ b/ext/intl/collator/collator_convert.h @@ -19,6 +19,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status ); void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status ); @@ -32,5 +35,8 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ); zval* collator_convert_string_to_double( zval* str, zval *rv ); zend_string *collator_zval_to_string(zval *arg); +#ifdef __cplusplus +} +#endif #endif // COLLATOR_CONVERT_H diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.cpp similarity index 91% rename from ext/intl/collator/collator_create.c rename to ext/intl/collator/collator_create.cpp index 5e6b0dee9ce6e..59280bcdbed5e 100644 --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.cpp @@ -17,7 +17,14 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +} #include "collator_class.h" #include "intl_data.h" @@ -29,7 +36,7 @@ static int collator_ctor(INTERNAL_FUNCTION_PARAMETERS) zval* object; Collator_object* co; - intl_error_reset( NULL ); + intl_error_reset( nullptr ); object = return_value; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STRING(locale, locale_len) @@ -50,7 +57,7 @@ static int collator_ctor(INTERNAL_FUNCTION_PARAMETERS) /* }}} */ /* {{{ Create collator. */ -PHP_FUNCTION( collator_create ) +U_CFUNC PHP_FUNCTION( collator_create ) { object_init_ex( return_value, Collator_ce_ptr ); if (collator_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU) == FAILURE) { @@ -61,7 +68,7 @@ PHP_FUNCTION( collator_create ) /* }}} */ /* {{{ Collator object constructor. */ -PHP_METHOD( Collator, __construct ) +U_CFUNC PHP_METHOD( Collator, __construct ) { const bool old_use_exception = INTL_G(use_exceptions); const zend_long old_error_level = INTL_G(error_level); diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.cpp similarity index 87% rename from ext/intl/collator/collator_error.c rename to ext/intl/collator/collator_error.cpp index 2189b312d7c29..aa333b5098a04 100644 --- a/ext/intl/collator/collator_error.c +++ b/ext/intl/collator/collator_error.cpp @@ -17,11 +17,18 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +} #include "collator_class.h" /* {{{ Get collator's last error code. */ -PHP_FUNCTION( collator_get_error_code ) +U_CFUNC PHP_FUNCTION( collator_get_error_code ) { COLLATOR_METHOD_INIT_VARS @@ -34,7 +41,7 @@ PHP_FUNCTION( collator_get_error_code ) /* Fetch the object (without resetting its last error code). */ co = Z_INTL_COLLATOR_P(object); - if( co == NULL ) + if( co == nullptr ) RETURN_FALSE; /* Return collator's last error code. */ @@ -43,9 +50,9 @@ PHP_FUNCTION( collator_get_error_code ) /* }}} */ /* {{{ Get text description for collator's last error code. */ -PHP_FUNCTION( collator_get_error_message ) +U_CFUNC PHP_FUNCTION( collator_get_error_message ) { - zend_string* message = NULL; + zend_string* message = nullptr; COLLATOR_METHOD_INIT_VARS @@ -58,7 +65,7 @@ PHP_FUNCTION( collator_get_error_message ) /* Fetch the object (without resetting its last error code). */ co = Z_INTL_COLLATOR_P( object ); - if( co == NULL ) + if( co == nullptr ) RETURN_FALSE; /* Return last error message. */ diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.cpp similarity index 96% rename from ext/intl/collator/collator_is_numeric.c rename to ext/intl/collator/collator_is_numeric.cpp index 4c473d9477116..b3cc52085deaa 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.cpp @@ -82,20 +82,20 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */ } *bufpos = '\0'; - value = zend_strtod(numbuf, NULL); + value = zend_strtod(numbuf, nullptr); if (numbuf != buf) { free_alloca(numbuf, use_heap); } - if (endptr != NULL) { + if (endptr != nullptr) { *endptr = (UChar *)u; } return value; } - if (endptr != NULL) { + if (endptr != nullptr) { *endptr = (UChar *)nptr; } @@ -118,10 +118,10 @@ static zend_long collator_u_strtol(const UChar *nptr, UChar **endptr, int base) zend_ulong cutoff; int neg = 0, any, cutlim; - if (s == NULL) { + if (s == nullptr) { errno = ERANGE; - if (endptr != NULL) { - *endptr = NULL; + if (endptr != nullptr) { + *endptr = nullptr; } return 0; } @@ -194,7 +194,7 @@ static zend_long collator_u_strtol(const UChar *nptr, UChar **endptr, int base) errno = ERANGE; } else if (neg) acc = -acc; - if (endptr != NULL) + if (endptr != nullptr) *endptr = (UChar *)(any ? s - 1 : nptr); return (acc); } @@ -235,12 +235,12 @@ uint8_t collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double return 0; } } else { - end_ptr_long = NULL; + end_ptr_long = nullptr; } local_dval = collator_u_strtod(str, &end_ptr_double); if (local_dval == 0 && end_ptr_double == str) { - end_ptr_double = NULL; + end_ptr_double = nullptr; } else { end_ptr_double = collator_skip_ws(end_ptr_double); if (end_ptr_double == str+length) { /* floating point string */ diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.cpp similarity index 82% rename from ext/intl/collator/collator_locale.c rename to ext/intl/collator/collator_locale.cpp index a7aafa74c26bd..67b3d1342cc75 100644 --- a/ext/intl/collator/collator_locale.c +++ b/ext/intl/collator/collator_locale.cpp @@ -17,17 +17,24 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +} #include "collator_class.h" #include "intl_convert.h" #include /* {{{ Gets the locale name of the collator. */ -PHP_FUNCTION( collator_get_locale ) +U_CFUNC PHP_FUNCTION( collator_get_locale ) { zend_long type = 0; - char* locale_name = NULL; + char* locale_name = nullptr; COLLATOR_METHOD_INIT_VARS @@ -42,16 +49,16 @@ PHP_FUNCTION( collator_get_locale ) COLLATOR_METHOD_FETCH_OBJECT; if (!co || !co->ucoll) { - intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); + intl_error_set_code( nullptr, COLLATOR_ERROR_CODE( co ) ); intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Object not initialized"); - zend_throw_error(NULL, "Object not initialized"); + zend_throw_error(nullptr, "Object not initialized"); RETURN_THROWS(); } /* Get locale by specified type. */ locale_name = (char*) ucol_getLocaleByType( - co->ucoll, type, COLLATOR_ERROR_CODE_P( co ) ); + co->ucoll, static_cast(type), COLLATOR_ERROR_CODE_P( co ) ); COLLATOR_CHECK_STATUS( co, "Error getting locale by type" ); /* Return it. */ diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.cpp similarity index 88% rename from ext/intl/collator/collator_sort.c rename to ext/intl/collator/collator_sort.cpp index 99b75aa0ef2be..003d7f45a837f 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.cpp @@ -17,12 +17,19 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" +#include "intl_convert.h" +} #include "collator.h" #include "collator_class.h" #include "collator_sort.h" #include "collator_convert.h" -#include "intl_convert.h" /** * Declare 'index' which will point to sort key in sort key @@ -50,8 +57,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2) zval str1, str2; zval num1, num2; zval norm1, norm2; - zval *num1_p = NULL, *num2_p = NULL; - zval *norm1_p = NULL, *norm2_p = NULL; + zval *num1_p = nullptr, *num2_p = nullptr; + zval *norm1_p = nullptr, *norm2_p = nullptr; zval *str1_p, *str2_p; ZVAL_NULL(&str1); @@ -66,7 +73,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2) str2_p == ( num2_p = collator_convert_string_to_number_if_possible( str2_p, &num2 ) ) ) ) { /* Compare the strings using ICU. */ - ZEND_ASSERT(INTL_G(current_collator) != NULL); + ZEND_ASSERT(INTL_G(current_collator) != nullptr); ZVAL_LONG(result, ucol_strcoll( INTL_G(current_collator), INTL_ZSTR_VAL(Z_STR_P(str1_p)), INTL_ZSTR_LEN(Z_STR_P(str1_p)), @@ -132,8 +139,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2) static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2) { zval num1, num2; - zval *num1_p = NULL; - zval *num2_p = NULL; + zval *num1_p = nullptr; + zval *num2_p = nullptr; if( Z_TYPE_P(op1) == IS_STRING ) { @@ -168,7 +175,7 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2) zend_string *str2 = collator_zval_to_string(op2); /* Compare the strings using ICU. */ - ZEND_ASSERT(INTL_G(current_collator) != NULL); + ZEND_ASSERT(INTL_G(current_collator) != nullptr); ZVAL_LONG(result, ucol_strcoll( INTL_G(current_collator), INTL_ZSTR_VAL(str1), INTL_ZSTR_LEN(str1), @@ -253,8 +260,8 @@ static collator_compare_func_t collator_get_compare_function( const zend_long so static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS ) { UCollator* saved_collator; - zval* array = NULL; - HashTable* hash = NULL; + zval* array = nullptr; + HashTable* hash = nullptr; zend_long sort_flags = COLLATOR_SORT_REGULAR; COLLATOR_METHOD_INIT_VARS @@ -302,7 +309,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS ) /* }}} */ /* {{{ Sort array using specified collator. */ -PHP_FUNCTION( collator_sort ) +U_CFUNC PHP_FUNCTION( collator_sort ) { collator_sort_internal( true, INTERNAL_FUNCTION_PARAM_PASSTHRU ); } @@ -320,28 +327,28 @@ static void collator_sortkey_swap(collator_sort_key_index_t *p, collator_sort_ke /* {{{ Equivalent to standard PHP sort using Collator. * Uses ICU ucol_getSortKey for performance. */ -PHP_FUNCTION( collator_sort_with_sort_keys ) +U_CFUNC PHP_FUNCTION( collator_sort_with_sort_keys ) { - zval* array = NULL; + zval* array = nullptr; zval garbage; - HashTable* hash = NULL; - zval* hashData = NULL; /* currently processed item of input hash */ + HashTable* hash = nullptr; + zval* hashData = nullptr; /* currently processed item of input hash */ - char* sortKeyBuf = NULL; /* buffer to store sort keys */ + char* sortKeyBuf = nullptr; /* buffer to store sort keys */ uint32_t sortKeyBufSize = DEF_SORT_KEYS_BUF_SIZE; /* buffer size */ ptrdiff_t sortKeyBufOffset = 0; /* pos in buffer to store sort key */ uint32_t sortKeyLen = 0; /* the length of currently processing key */ uint32_t bufLeft = 0; uint32_t bufIncrement = 0; - collator_sort_key_index_t* sortKeyIndxBuf = NULL; /* buffer to store 'indexes' which will be passed to 'qsort' */ + collator_sort_key_index_t* sortKeyIndxBuf = nullptr; /* buffer to store 'indexes' which will be passed to 'qsort' */ uint32_t sortKeyIndxBufSize = DEF_SORT_KEYS_INDX_BUF_SIZE; uint32_t sortKeyIndxSize = sizeof( collator_sort_key_index_t ); uint32_t sortKeyCount = 0; uint32_t j = 0; - UChar* utf16_buf = NULL; /* tmp buffer to hold current processing string in utf-16 */ + UChar* utf16_buf = nullptr; /* tmp buffer to hold current processing string in utf-16 */ int utf16_buf_size = DEF_UTF16_BUF_SIZE; /* the length of utf16_buf */ int utf16_len = 0; /* length of converted string */ @@ -358,7 +365,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) COLLATOR_METHOD_FETCH_OBJECT; if (!co || !co->ucoll) { - intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); + intl_error_set_code( nullptr, COLLATOR_ERROR_CODE( co ) ); intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Object not initialized"); zend_throw_error(NULL, "Object not initialized"); @@ -374,8 +381,8 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) RETURN_TRUE; /* Create bufers */ - sortKeyBuf = ecalloc( sortKeyBufSize, sizeof( char ) ); - sortKeyIndxBuf = ecalloc( sortKeyIndxBufSize, sizeof( uint8_t ) ); + sortKeyBuf = reinterpret_cast(ecalloc( sortKeyBufSize, sizeof( char ) )); + sortKeyIndxBuf = reinterpret_cast(ecalloc( sortKeyIndxBufSize, sizeof( uint8_t ) )); utf16_buf = eumalloc( utf16_buf_size ); /* Iterate through input hash and create a sort key for each value. */ @@ -391,7 +398,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) { - intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); + intl_error_set_code( nullptr, COLLATOR_ERROR_CODE( co ) ); intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed"); if( utf16_buf ) @@ -430,7 +437,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) sortKeyBufSize += bufIncrement; bufLeft += bufIncrement; - sortKeyBuf = erealloc( sortKeyBuf, sortKeyBufSize ); + sortKeyBuf = reinterpret_cast(erealloc( sortKeyBuf, sortKeyBufSize )); sortKeyLen = ucol_getSortKey( co->ucoll, utf16_buf, utf16_len, (uint8_t*)sortKeyBuf + sortKeyBufOffset, bufLeft ); } @@ -442,7 +449,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) sortKeyIndxBufSize += bufIncrement; - sortKeyIndxBuf = erealloc( sortKeyIndxBuf, sortKeyIndxBufSize ); + sortKeyIndxBuf = reinterpret_cast(erealloc( sortKeyIndxBuf, sortKeyIndxBufSize )); } sortKeyIndxBuf[sortKeyCount].key = (char*)sortKeyBufOffset; /* remember just offset, cause address */ @@ -485,18 +492,18 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) /* }}} */ /* {{{ Sort array using specified collator, maintaining index association. */ -PHP_FUNCTION( collator_asort ) +U_CFUNC PHP_FUNCTION( collator_asort ) { collator_sort_internal( false, INTERNAL_FUNCTION_PARAM_PASSTHRU ); } /* }}} */ /* {{{ Get a sort key for a string from a Collator. */ -PHP_FUNCTION( collator_get_sort_key ) +U_CFUNC PHP_FUNCTION( collator_get_sort_key ) { - char* str = NULL; + char* str = nullptr; size_t str_len = 0; - UChar* ustr = NULL; + UChar* ustr = nullptr; int32_t ustr_len = 0; int key_len = 0; zend_string* key_str; @@ -514,7 +521,7 @@ PHP_FUNCTION( collator_get_sort_key ) COLLATOR_METHOD_FETCH_OBJECT; if (!co || !co->ucoll) { - intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); + intl_error_set_code( nullptr, COLLATOR_ERROR_CODE( co ) ); intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Object not initialized"); zend_throw_error(NULL, "Object not initialized"); @@ -531,7 +538,7 @@ PHP_FUNCTION( collator_get_sort_key ) if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) { /* Set global error code. */ - intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); + intl_error_set_code( nullptr, COLLATOR_ERROR_CODE( co ) ); /* Set error messages. */ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Error converting first argument to UTF-16"); @@ -541,7 +548,7 @@ PHP_FUNCTION( collator_get_sort_key ) /* ucol_getSortKey is exception in that the key length includes the * NUL terminator*/ - key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, NULL, 0); + key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, nullptr, 0); if(!key_len) { efree( ustr ); RETURN_FALSE; diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index 8b95eb4b68f12..aa1348029fa7d 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -8,23 +8,11 @@ if test "$PHP_INTL" != "no"; then PHP_SUBST([INTL_SHARED_LIBADD]) INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" PHP_NEW_EXTENSION([intl], m4_normalize([ - collator/collator_attr.c - collator/collator_class.c - collator/collator_compare.c - collator/collator_convert.c - collator/collator_create.c - collator/collator_error.c - collator/collator_is_numeric.c - collator/collator_locale.c - collator/collator_sort.c common/common_error.c dateformat/dateformat_class.c formatter/formatter_class.c - grapheme/grapheme_string.c - grapheme/grapheme_util.c intl_convert.c intl_error.c - listformatter/listformatter_class.c php_intl.c resourcebundle/resourcebundle_class.c resourcebundle/resourcebundle_iterator.c @@ -32,14 +20,21 @@ if test "$PHP_INTL" != "no"; then spoofchecker/spoofchecker_class.c spoofchecker/spoofchecker_create.c spoofchecker/spoofchecker_main.c - transliterator/transliterator_class.c - transliterator/transliterator_methods.c ]), [$ext_shared],, [$INTL_COMMON_FLAGS], [cxx]) PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \ + collator/collator_attr.cpp \ + collator/collator_class.cpp \ + collator/collator_compare.cpp \ + collator/collator_convert.cpp \ + collator/collator_create.cpp \ + collator/collator_error.cpp \ + collator/collator_is_numeric.cpp \ + collator/collator_locale.cpp \ + collator/collator_sort.cpp \ common/common_enum.cpp \ common/common_date.cpp \ converter/converter.cpp \ @@ -54,6 +49,8 @@ if test "$PHP_INTL" != "no"; then dateformat/dateformat_parse.cpp \ dateformat/datepatterngenerator_class.cpp \ dateformat/datepatterngenerator_methods.cpp \ + grapheme/grapheme_string.cpp \ + grapheme/grapheme_util.cpp \ msgformat/msgformat_helpers.cpp \ rangeformatter/rangeformatter_class.cpp \ timezone/timezone_class.cpp \ @@ -80,6 +77,9 @@ if test "$PHP_INTL" != "no"; then breakiterator/rulebasedbreakiterator_methods.cpp \ breakiterator/codepointiterator_internal.cpp \ breakiterator/codepointiterator_methods.cpp \ + listformatter/listformatter_class.cpp \ + transliterator/transliterator_class.cpp \ + transliterator/transliterator_methods.cpp \ idn/idn.cpp \ locale/locale_class.cpp \ locale/locale_methods.cpp \ diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index 22db382fd0e08..d0720ff1af18b 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -13,15 +13,15 @@ if (PHP_INTL != "no") { "/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_EXTENSION_DEP('intl', 'date'); ADD_SOURCES(configure_module_dirname + "/collator", "\ - collator_attr.c \ - collator_class.c \ - collator_compare.c \ - collator_convert.c \ - collator_create.c \ - collator_error.c \ - collator_is_numeric.c \ - collator_locale.c \ - collator_sort.c \ + collator_attr.cpp \ + collator_class.cpp \ + collator_compare.cpp \ + collator_convert.cpp \ + collator_create.cpp \ + collator_error.cpp \ + collator_is_numeric.cpp \ + collator_locale.cpp \ + collator_sort.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/common", "\ common_error.c \ @@ -40,7 +40,7 @@ if (PHP_INTL != "no") { formatter_parse.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/listformatter", "\ - listformatter_class.c \ + listformatter_class.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/locale", "\ locale.cpp \ @@ -57,7 +57,7 @@ if (PHP_INTL != "no") { msgformat_parse.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/grapheme", "\ - grapheme_string.c grapheme_util.c \ + grapheme_string.cpp grapheme_util.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/normalizer", "\ normalizer_class.cpp \ @@ -101,8 +101,8 @@ if (PHP_INTL != "no") { } ADD_SOURCES(configure_module_dirname + "/transliterator", "\ - transliterator_class.c \ - transliterator_methods.c", + transliterator_class.cpp \ + transliterator_methods.cpp", "intl"); ADD_SOURCES(configure_module_dirname + "/timezone", "\ diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h index 003e0d49317a9..8ec470d479272 100644 --- a/ext/intl/grapheme/grapheme.h +++ b/ext/intl/grapheme/grapheme.h @@ -18,7 +18,13 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif void grapheme_close_global_iterator( void ); +#ifdef __cplusplus +} +#endif #define GRAPHEME_EXTRACT_TYPE_COUNT 0 #define GRAPHEME_EXTRACT_TYPE_MAXBYTES 1 diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.cpp similarity index 90% rename from ext/intl/grapheme/grapheme_string.c rename to ext/intl/grapheme/grapheme_string.cpp index 28d3130c3959d..6dd5a002a65b8 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.cpp @@ -17,9 +17,16 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include #include "grapheme.h" #include "grapheme_util.h" +} #include #include @@ -30,11 +37,11 @@ /* }}} */ /* {{{ Get number of graphemes in a string */ -PHP_FUNCTION(grapheme_strlen) +U_CFUNC PHP_FUNCTION(grapheme_strlen) { char* string; size_t string_len; - UChar* ustring = NULL; + UChar* ustring = nullptr; int ustring_len = 0; zend_long ret_len; UErrorCode status; @@ -54,17 +61,17 @@ PHP_FUNCTION(grapheme_strlen) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16"); + intl_error_set_custom_msg( nullptr, "Error converting input string to UTF-16"); if (ustring) { efree( ustring ); } RETURN_NULL(); } - ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 ); + ret_len = grapheme_split_string(ustring, ustring_len, nullptr, 0 ); if (ustring) { efree( ustring ); @@ -79,7 +86,7 @@ PHP_FUNCTION(grapheme_strlen) /* }}} */ /* {{{ Find position of first occurrence of a string within another */ -PHP_FUNCTION(grapheme_strpos) +U_CFUNC PHP_FUNCTION(grapheme_strpos) { char *haystack, *needle, *locale = ""; size_t haystack_len, needle_len, locale_len = 0; @@ -122,7 +129,7 @@ PHP_FUNCTION(grapheme_strpos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, /* fIgnoreCase */ 0, /* last */ 0, locale); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, nullptr, /* fIgnoreCase */ 0, /* last */ 0, locale); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -133,7 +140,7 @@ PHP_FUNCTION(grapheme_strpos) /* }}} */ /* {{{ Find position of first occurrence of a string within another, ignoring case differences */ -PHP_FUNCTION(grapheme_stripos) +U_CFUNC PHP_FUNCTION(grapheme_stripos) { char *haystack, *needle, *locale = ""; size_t haystack_len, needle_len, locale_len = 0; @@ -187,7 +194,7 @@ PHP_FUNCTION(grapheme_stripos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, /* fIgnoreCase */ 1, /*last */ 0, locale); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, nullptr, /* fIgnoreCase */ 1, /*last */ 0, locale); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -199,7 +206,7 @@ PHP_FUNCTION(grapheme_stripos) /* }}} */ /* {{{ Find position of last occurrence of a string within another */ -PHP_FUNCTION(grapheme_strrpos) +U_CFUNC PHP_FUNCTION(grapheme_strrpos) { char *haystack, *needle; char *locale = ""; @@ -246,7 +253,7 @@ PHP_FUNCTION(grapheme_strrpos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, /* f_ignore_case */ 0, /* last */ 1, locale); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, nullptr, /* f_ignore_case */ 0, /* last */ 1, locale); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -259,7 +266,7 @@ PHP_FUNCTION(grapheme_strrpos) /* }}} */ /* {{{ Find position of last occurrence of a string within another, ignoring case */ -PHP_FUNCTION(grapheme_strripos) +U_CFUNC PHP_FUNCTION(grapheme_strripos) { char *haystack, *needle, *locale = ""; size_t haystack_len, needle_len, locale_len = 0; @@ -314,7 +321,7 @@ PHP_FUNCTION(grapheme_strripos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, /* f_ignore_case */ 1, /*last */ 1, locale); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, nullptr, /* f_ignore_case */ 1, /*last */ 1, locale); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -327,7 +334,7 @@ PHP_FUNCTION(grapheme_strripos) /* }}} */ /* {{{ Returns part of a string */ -PHP_FUNCTION(grapheme_substr) +U_CFUNC PHP_FUNCTION(grapheme_substr) { char *str, *locale = ""; zend_string *u8_sub_str; @@ -339,7 +346,7 @@ PHP_FUNCTION(grapheme_substr) int iter_val; UErrorCode status; unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; - UBreakIterator* bi = NULL; + UBreakIterator* bi = nullptr; int sub_str_start_pos, sub_str_end_pos; int32_t (*iter_func)(UBreakIterator *); bool no_length = true; @@ -375,25 +382,25 @@ PHP_FUNCTION(grapheme_substr) char *sub_str; grapheme_substr_ascii(str, str_len, start, (int32_t)length, &sub_str, &asub_str_len); - if ( NULL == sub_str ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "invalid parameters"); + if ( nullptr == sub_str ) { + intl_error_set( nullptr, U_ILLEGAL_ARGUMENT_ERROR, "invalid parameters"); RETURN_FALSE; } RETURN_STRINGL(sub_str, asub_str_len); } - ustr = NULL; + ustr = nullptr; ustr_len = 0; status = U_ZERO_ERROR; intl_convert_utf8_to_utf16(&ustr, &ustr_len, str, str_len, &status); if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16"); + intl_error_set_custom_msg( nullptr, "Error converting input string to UTF-16"); if (ustr) { efree( ustr ); } @@ -458,10 +465,10 @@ PHP_FUNCTION(grapheme_substr) if ( !u8_sub_str ) { /* Set global error code. */ - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8"); + intl_error_set_custom_msg( nullptr, "Error converting output string to UTF-8"); RETURN_FALSE; } @@ -527,10 +534,10 @@ PHP_FUNCTION(grapheme_substr) if ( !u8_sub_str ) { /* Set global error code. */ - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8"); + intl_error_set_custom_msg( nullptr, "Error converting output string to UTF-8"); RETURN_FALSE; } @@ -602,14 +609,14 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas /* }}} */ /* {{{ Finds first occurrence of a string within another */ -PHP_FUNCTION(grapheme_strstr) +U_CFUNC PHP_FUNCTION(grapheme_strstr) { strstr_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0 /* f_ignore_case */); } /* }}} */ /* {{{ Finds first occurrence of a string within another */ -PHP_FUNCTION(grapheme_stristr) +U_CFUNC PHP_FUNCTION(grapheme_stristr) { strstr_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1 /* f_ignore_case */); } @@ -712,7 +719,7 @@ static const grapheme_extract_iter grapheme_extract_iters[] = { /* }}} */ /* {{{ Function to extract a sequence of default grapheme clusters */ -PHP_FUNCTION(grapheme_extract) +U_CFUNC PHP_FUNCTION(grapheme_extract) { char *str, *pstr; UText ut = UTEXT_INITIALIZER; @@ -723,9 +730,9 @@ PHP_FUNCTION(grapheme_extract) zend_long extract_type = GRAPHEME_EXTRACT_TYPE_COUNT; UErrorCode status; unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; - UBreakIterator* bi = NULL; + UBreakIterator* bi = nullptr; int ret_pos; - zval *next = NULL; /* return offset of next part of the string */ + zval *next = nullptr; /* return offset of next part of the string */ ZEND_PARSE_PARAMETERS_START(2, 5) Z_PARAM_STRING(str, str_len) @@ -740,7 +747,7 @@ PHP_FUNCTION(grapheme_extract) lstart += str_len; } - if ( NULL != next ) { + if ( nullptr != next ) { ZEND_ASSERT(Z_ISREF_P(next)); ZEND_TRY_ASSIGN_REF_LONG(next, lstart); if (UNEXPECTED(EG(exception))) { @@ -754,7 +761,7 @@ PHP_FUNCTION(grapheme_extract) } if ( lstart > INT32_MAX || lstart < 0 || (size_t)lstart >= str_len ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "start not contained in string"); + intl_error_set( nullptr, U_ILLEGAL_ARGUMENT_ERROR, "start not contained in string"); RETURN_FALSE; } @@ -785,7 +792,7 @@ PHP_FUNCTION(grapheme_extract) pstr++; start++; if ( pstr >= str_end ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, + intl_error_set( nullptr, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: invalid input string"); RETURN_FALSE; @@ -801,7 +808,7 @@ PHP_FUNCTION(grapheme_extract) if ( -1 != grapheme_ascii_check((unsigned char *)pstr, MIN(size + 1, str_len)) ) { size_t nsize = MIN(size, str_len); - if ( NULL != next ) { + if ( nullptr != next ) { ZEND_TRY_ASSIGN_REF_LONG(next, start + nsize); } RETURN_STRINGL(pstr, nsize); @@ -812,15 +819,15 @@ PHP_FUNCTION(grapheme_extract) if ( U_FAILURE( status ) ) { /* Set global error code. */ - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error opening UTF-8 text"); + intl_error_set_custom_msg( nullptr, "Error opening UTF-8 text"); RETURN_FALSE; } - bi = NULL; + bi = nullptr; status = U_ZERO_ERROR; bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status ); @@ -835,14 +842,14 @@ PHP_FUNCTION(grapheme_extract) utext_close(&ut); ubrk_close(bi); - if ( NULL != next ) { + if ( nullptr != next ) { ZEND_TRY_ASSIGN_REF_LONG(next, start + ret_pos); } RETURN_STRINGL(((char *)pstr), ret_pos); } -PHP_FUNCTION(grapheme_str_split) +U_CFUNC PHP_FUNCTION(grapheme_str_split) { char *pstr, *end; zend_string *str; @@ -852,7 +859,7 @@ PHP_FUNCTION(grapheme_str_split) UErrorCode ustatus = U_ZERO_ERROR; int32_t pos, current, i, end_len = 0; UBreakIterator* bi; - UText *ut = NULL; + UText *ut = nullptr; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(str) @@ -874,15 +881,15 @@ PHP_FUNCTION(grapheme_str_split) if ( U_FAILURE( ustatus ) ) { /* Set global error code. */ - intl_error_set_code( NULL, ustatus ); + intl_error_set_code( nullptr, ustatus ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error opening UTF-8 text"); + intl_error_set_custom_msg( nullptr, "Error opening UTF-8 text"); RETURN_FALSE; } - bi = NULL; + bi = nullptr; ustatus = U_ZERO_ERROR; bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &ustatus ); @@ -920,7 +927,7 @@ PHP_FUNCTION(grapheme_str_split) ubrk_close(bi); } -PHP_FUNCTION(grapheme_levenshtein) +U_CFUNC PHP_FUNCTION(grapheme_levenshtein) { zend_string *string1, *string2; zend_long cost_ins = 1; @@ -959,11 +966,17 @@ PHP_FUNCTION(grapheme_levenshtein) size_t i2; char *pstr1, *pstr2; - UChar *ustring1 = NULL; - UChar *ustring2 = NULL; + UChar *ustring1 = nullptr; + UChar *ustring2 = nullptr; int32_t ustring1_len = 0; int32_t ustring2_len = 0; + int32_t current1 = 0; + int32_t current2 = 0; + int32_t pos1 = 0; + int32_t pos2 = 0; + + UCollator *collator = nullptr; UErrorCode ustatus = U_ZERO_ERROR; @@ -1002,8 +1015,8 @@ PHP_FUNCTION(grapheme_levenshtein) UBreakIterator *bi1, *bi2; int32_t strlen_1, strlen_2; - strlen_1 = grapheme_split_string(ustring1, ustring1_len, NULL, 0); - strlen_2 = grapheme_split_string(ustring2, ustring2_len, NULL, 0); + strlen_1 = grapheme_split_string(ustring1, ustring1_len, nullptr, 0); + strlen_2 = grapheme_split_string(ustring2, ustring2_len, nullptr, 0); if (UNEXPECTED(strlen_1 < 0 || strlen_2 < 0)) { RETVAL_FALSE; goto out_ustring2; @@ -1053,7 +1066,7 @@ PHP_FUNCTION(grapheme_levenshtein) RETVAL_FALSE; goto out_bi2; } - UCollator *collator = ucol_open(locale, &ustatus); + collator = ucol_open(locale, &ustatus); if (U_FAILURE(ustatus)) { intl_error_set_code(NULL, ustatus); @@ -1063,18 +1076,13 @@ PHP_FUNCTION(grapheme_levenshtein) } zend_long *p1, *p2, *tmp; - p1 = safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0); - p2 = safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0); + p1 = reinterpret_cast(safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0)); + p2 = reinterpret_cast(safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0)); for (i2 = 0; i2 <= strlen_2; i2++) { p1[i2] = i2 * cost_ins; } - int32_t current1 = 0; - int32_t current2 = 0; - int32_t pos1 = 0; - int32_t pos2 = 0; - while (true) { current1 = ubrk_current(bi1); pos1 = ubrk_next(bi1); diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.cpp similarity index 89% rename from ext/intl/grapheme/grapheme_util.c rename to ext/intl/grapheme/grapheme_util.cpp index 825eea9468cb3..a04f3db0b8a6d 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.cpp @@ -17,10 +17,17 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include #include "grapheme.h" #include "grapheme_util.h" #include "intl_common.h" +} #include #include @@ -33,7 +40,7 @@ ZEND_EXTERN_MODULE_GLOBALS( intl ) /* }}} */ /* {{{ grapheme_close_global_iterator - clean up */ -void +U_CFUNC void grapheme_close_global_iterator( void ) { UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator ); @@ -45,7 +52,7 @@ grapheme_close_global_iterator( void ) /* }}} */ /* {{{ grapheme_substr_ascii f='from' - starting point, l='length' */ -void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len) +U_CFUNC void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len) { int32_t str_len2 = (int32_t)str_len; /* in order to avoid signed/unsigned problems */ *sub_str = NULL; @@ -94,7 +101,7 @@ void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char /* {{{ grapheme_strpos_utf16 - strrpos using utf16*/ -int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last, const char* locale) +U_CFUNC int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last, const char* locale) { UChar *uhaystack = NULL, *uneedle = NULL; int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0; @@ -212,7 +219,7 @@ int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, /* }}} */ /* {{{ grapheme_ascii_check: ASCII check */ -zend_long grapheme_ascii_check(const unsigned char *day, size_t len) +U_CFUNC zend_long grapheme_ascii_check(const unsigned char *day, size_t len) { int ret_len = len; while ( len-- ) { @@ -226,7 +233,7 @@ zend_long grapheme_ascii_check(const unsigned char *day, size_t len) /* }}} */ /* {{{ grapheme_split_string: find and optionally return grapheme boundaries */ -int32_t grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len ) +U_CFUNC int32_t grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len ) { unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; UErrorCode status = U_ZERO_ERROR; @@ -264,7 +271,7 @@ int32_t grapheme_split_string(const UChar *text, int32_t text_length, int bounda /* }}} */ /* {{{ grapheme_count_graphemes */ -int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) +U_CFUNC int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) { int ret_len = 0; int pos = 0; @@ -288,7 +295,7 @@ int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t stri /* {{{ grapheme_get_haystack_offset - bump the haystack pointer based on the grapheme count offset */ -int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) +U_CFUNC int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) { int32_t pos; int32_t (*iter_op)(UBreakIterator* bi); @@ -328,7 +335,7 @@ int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) /* }}} */ /* {{{ grapheme_strrpos_ascii: borrowed from the php ext/standard/string.c */ -zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset) +U_CFUNC zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset) { char *p, *e; @@ -368,7 +375,7 @@ zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *need /* }}} */ /* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */ -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ) +U_CFUNC UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ) { UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator ); diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 9d276a9dcfe26..57d2ace384f89 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -15,6 +15,9 @@ #ifndef GRAPHEME_GRAPHEME_UTIL_H #define GRAPHEME_GRAPHEME_UTIL_H +#ifdef __cplusplus +extern "C" { +#endif #include "php_intl.h" #include "intl_convert.h" @@ -35,6 +38,9 @@ int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t stri int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ); +#ifdef __cplusplus +} +#endif /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ #define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset > (zend_long) max_len) ) diff --git a/ext/intl/listformatter/listformatter_class.c b/ext/intl/listformatter/listformatter_class.cpp similarity index 89% rename from ext/intl/listformatter/listformatter_class.c rename to ext/intl/listformatter/listformatter_class.cpp index 1aa849370ab8f..8a7f9ffef9c2b 100644 --- a/ext/intl/listformatter/listformatter_class.c +++ b/ext/intl/listformatter/listformatter_class.cpp @@ -12,12 +12,14 @@ +----------------------------------------------------------------------+ */ +extern "C" { #include "php.h" #include "php_intl.h" +#include "intl_convert.h" +} #include #include "listformatter_class.h" #include "listformatter_arginfo.h" -#include "intl_convert.h" static zend_object_handlers listformatter_handlers; @@ -28,7 +30,7 @@ static void listformatter_free_obj(zend_object *object) if( obj->lf_data.ulistfmt ) ulistfmt_close( obj->lf_data.ulistfmt ); - obj->lf_data.ulistfmt = NULL; + obj->lf_data.ulistfmt = nullptr; intl_error_reset( &obj->lf_data.error ); zend_object_std_dtor(&obj->zo); @@ -37,9 +39,9 @@ static void listformatter_free_obj(zend_object *object) static zend_object *listformatter_create_object(zend_class_entry *class_type) { ListFormatter_object *obj; - obj = zend_object_alloc(sizeof(ListFormatter_object), class_type); + obj = reinterpret_cast(zend_object_alloc(sizeof(ListFormatter_object), class_type)); - obj->lf_data.ulistfmt = NULL; + obj->lf_data.ulistfmt = nullptr; intl_error_reset( &obj->lf_data.error ); zend_object_std_init(&obj->zo, class_type); @@ -93,7 +95,7 @@ PHP_METHOD(IntlListFormatter, __construct) RETURN_THROWS(); } - LISTFORMATTER_OBJECT(obj) = ulistfmt_openForType(locale, type, width, &status); + LISTFORMATTER_OBJECT(obj) = ulistfmt_openForType(locale, static_cast(type), static_cast(width), &status); #else if (type != INTL_LISTFORMATTER_FALLBACK_TYPE_AND) { zend_argument_value_error(2, "contains an unsupported type. ICU 66 and below only support IntlListFormatter::TYPE_AND"); @@ -109,7 +111,7 @@ PHP_METHOD(IntlListFormatter, __construct) #endif if (U_FAILURE(status)) { - intl_error_set(NULL, status, "Constructor failed"); + intl_error_set(nullptr, status, "Constructor failed"); zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0); RETURN_THROWS(); } @@ -140,7 +142,7 @@ PHP_METHOD(IntlListFormatter, format) str_val = zval_get_tmp_string(val, &tmp_str); // Convert PHP string to UTF-16 - UChar *ustr = NULL; + UChar *ustr = nullptr; int32_t ustr_len = 0; UErrorCode status = U_ZERO_ERROR; @@ -154,7 +156,7 @@ PHP_METHOD(IntlListFormatter, format) } efree(items); efree(itemLengths); - intl_error_set(NULL, status, "Failed to convert string to UTF-16"); + intl_error_set(nullptr, status, "Failed to convert string to UTF-16"); RETURN_FALSE; } @@ -165,12 +167,13 @@ PHP_METHOD(IntlListFormatter, format) UErrorCode status = U_ZERO_ERROR; int32_t resultLength; - UChar *result = NULL; + UChar *result = nullptr; + zend_string *ret = nullptr; - resultLength = ulistfmt_format(LISTFORMATTER_OBJECT(obj), items, itemLengths, count, NULL, 0, &status); + resultLength = ulistfmt_format(LISTFORMATTER_OBJECT(obj), items, itemLengths, count, nullptr, 0, &status); if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR) { - intl_error_set(NULL, status, "Failed to format list"); + intl_error_set(nullptr, status, "Failed to format list"); RETVAL_FALSE; goto cleanup; } @@ -184,17 +187,17 @@ PHP_METHOD(IntlListFormatter, format) if (result) { efree(result); } - intl_error_set(NULL, status, "Failed to format list"); + intl_error_set(nullptr, status, "Failed to format list"); RETVAL_FALSE; goto cleanup; } // Convert result back to UTF-8 - zend_string *ret = intl_convert_utf16_to_utf8(result, resultLength, &status); + ret = intl_convert_utf16_to_utf8(result, resultLength, &status); efree(result); if (!ret) { - intl_error_set(NULL, status, "Failed to convert result to UTF-8"); + intl_error_set(nullptr, status, "Failed to convert result to UTF-8"); RETVAL_FALSE; } else { RETVAL_NEW_STR(ret); @@ -237,5 +240,5 @@ void listformatter_register_class(void) memcpy(&listformatter_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); listformatter_handlers.offset = XtOffsetOf(ListFormatter_object, zo); listformatter_handlers.free_obj = listformatter_free_obj; - listformatter_handlers.clone_obj = NULL; + listformatter_handlers.clone_obj = nullptr; } diff --git a/ext/intl/listformatter/listformatter_class.h b/ext/intl/listformatter/listformatter_class.h index 8fe8137796bfb..8edbf8d63e2d0 100644 --- a/ext/intl/listformatter/listformatter_class.h +++ b/ext/intl/listformatter/listformatter_class.h @@ -46,8 +46,14 @@ static inline ListFormatter_object *php_intl_listformatter_fetch_object(zend_obj #define LISTFORMATTER_OBJECT(lfo) (lfo)->lf_data.ulistfmt +#ifdef __cplusplus +extern "C" { +#endif void listformatter_register_class( void ); extern zend_class_entry *ListFormatter_ce_ptr; +#ifdef __cplusplus +} +#endif #define INTL_LISTFORMATTER_FALLBACK_TYPE_AND 0 #define INTL_LISTFORMATTER_FALLBACK_WIDTH_WIDE 0 diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.cpp similarity index 88% rename from ext/intl/transliterator/transliterator_class.c rename to ext/intl/transliterator/transliterator_class.cpp index 438b71c2c417a..fd0cd4f3c3e64 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.cpp @@ -13,22 +13,24 @@ */ #include "transliterator_class.h" +extern "C" { #include "php_intl.h" -#include "transliterator_arginfo.h" #include "intl_error.h" #include "intl_convert.h" #include "intl_data.h" +#include "transliterator_arginfo.h" +} #include -zend_class_entry *Transliterator_ce_ptr = NULL; +zend_class_entry *Transliterator_ce_ptr = nullptr; zend_object_handlers Transliterator_handlers; /* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status ) * Initialize internals of Transliterator_object. */ -int transliterator_object_construct( zval *object, +U_CFUNC int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status ) { @@ -40,7 +42,7 @@ int transliterator_object_construct( zval *object, TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; - assert( to->utrans == NULL ); + assert( to->utrans == nullptr ); /* this assignment must happen before any return with failure because the * caller relies on it always being made (so it can just destroy the object * to close the transliterator) */ @@ -88,7 +90,7 @@ static void transliterator_object_destroy( Transliterator_object* to ) if( to->utrans ) { utrans_close( to->utrans ); - to->utrans = NULL; + to->utrans = nullptr; } intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); @@ -111,7 +113,7 @@ static zend_object *Transliterator_object_create( zend_class_entry *ce ) { Transliterator_object* intern; - intern = zend_object_alloc(sizeof(Transliterator_object), ce); + intern = reinterpret_cast(zend_object_alloc(sizeof(Transliterator_object), ce)); zend_object_std_init( &intern->zo, ce ); object_properties_init( &intern->zo, ce ); @@ -133,22 +135,22 @@ static zend_object *Transliterator_clone_obj( zend_object *object ) Transliterator_object *to_new = php_intl_transliterator_fetch_object(ret_val); zend_objects_clone_members( &to_new->zo, &to_orig->zo ); - if (to_orig->utrans != NULL) { - /* guaranteed to return NULL if it fails */ + if (to_orig->utrans != nullptr) { + /* guaranteed to return nullptr if it fails */ UErrorCode error = U_ZERO_ERROR; UTransliterator *utrans = utrans_clone( to_orig->utrans, &error); if (U_FAILURE(error)) { - if (utrans != NULL) { + if (utrans != nullptr) { transliterator_object_destroy(to_new); } - zend_throw_error(NULL, "Failed to clone Transliterator"); + zend_throw_error(nullptr, "Failed to clone Transliterator"); } else { to_new->utrans = utrans; } } else { /* We shouldn't have unconstructed objects in the first place */ - zend_throw_error(NULL, "Cannot clone uninitialized Transliterator"); + zend_throw_error(nullptr, "Cannot clone uninitialized Transliterator"); } return ret_val; @@ -158,7 +160,7 @@ static zend_object *Transliterator_clone_obj( zend_object *object ) /* {{{ transliterator_register_Transliterator_class * Initialize 'Transliterator' class */ -void transliterator_register_Transliterator_class( void ) +U_CFUNC void transliterator_register_Transliterator_class( void ) { /* Create and register 'Transliterator' class. */ Transliterator_ce_ptr = register_class_Transliterator(); diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h index 2ce85d6cfdb74..7e02d6fa5e287 100644 --- a/ext/intl/transliterator/transliterator_class.h +++ b/ext/intl/transliterator/transliterator_class.h @@ -17,8 +17,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_common.h" #include "intl_error.h" +#ifdef __cplusplus +} +#endif #include @@ -56,6 +62,9 @@ static inline Transliterator_object *php_intl_transliterator_fetch_object(zend_o RETURN_THROWS(); \ } +#ifdef __cplusplus +extern "C" { +#endif int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status ); @@ -64,5 +73,8 @@ void transliterator_register_Transliterator_class( void ); extern zend_class_entry *Transliterator_ce_ptr; extern zend_object_handlers Transliterator_handlers; +#ifdef __cplusplus +} +#endif #endif /* #ifndef TRANSLITERATOR_CLASS_H */ diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.cpp similarity index 84% rename from ext/intl/transliterator/transliterator_methods.c rename to ext/intl/transliterator/transliterator_methods.cpp index 9c1f48608cf21..d8a8cbb7a49ec 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.cpp @@ -16,23 +16,30 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" -#include "transliterator.h" -#include "transliterator_class.h" #include "intl_data.h" #include "intl_convert.h" +} +#include "transliterator.h" +#include "transliterator_class.h" #include static int create_transliterator( char *str_id, size_t str_id_len, zend_long direction, zval *object ) { Transliterator_object *to; - UChar *ustr_id = NULL; + UChar *ustr_id = nullptr; int32_t ustr_id_len = 0; UTransliterator *utrans; UParseError parse_error; - intl_error_reset( NULL ); + intl_error_reset( nullptr ); if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) ) { @@ -47,31 +54,31 @@ static int create_transliterator( char *str_id, size_t str_id_len, zend_long dir intl_convert_utf8_to_utf16( &ustr_id, &ustr_id_len, str_id, str_id_len, TRANSLITERATOR_ERROR_CODE_P( to ) ); if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); - intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed"); + intl_error_set_code( nullptr, TRANSLITERATOR_ERROR_CODE( to ) ); + intl_error_set_custom_msg( nullptr, "String conversion of id to UTF-16 failed"); zval_ptr_dtor( object ); return FAILURE; } /* Open ICU Transliterator. */ utrans = utrans_openU( ustr_id, ustr_id_len, (UTransDirection ) direction, - NULL, -1, &parse_error, TRANSLITERATOR_ERROR_CODE_P( to ) ); + nullptr, -1, &parse_error, TRANSLITERATOR_ERROR_CODE_P( to ) ); if (ustr_id) { efree( ustr_id ); } if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - char *buf = NULL; - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); + char *buf = nullptr; + intl_error_set_code( nullptr, TRANSLITERATOR_ERROR_CODE( to ) ); spprintf( &buf, 0, "unable to open ICU transliterator" " with id \"%s\"", str_id ); - if( buf == NULL ) { - intl_error_set_custom_msg(NULL, "unable to open ICU transliterator"); + if( buf == nullptr ) { + intl_error_set_custom_msg(nullptr, "unable to open ICU transliterator"); } else { - intl_error_set_custom_msg(NULL, buf); + intl_error_set_custom_msg(nullptr, buf); efree( buf ); } zval_ptr_dtor( object ); @@ -82,8 +89,8 @@ static int create_transliterator( char *str_id, size_t str_id_len, zend_long dir /* no need to close the transliterator manually on construction error */ if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); - intl_error_set_custom_msg(NULL, "internal constructor call failed"); + intl_error_set_code( nullptr, TRANSLITERATOR_ERROR_CODE( to ) ); + intl_error_set_custom_msg(nullptr, "internal constructor call failed"); zval_ptr_dtor( object ); return FAILURE; } @@ -92,7 +99,7 @@ static int create_transliterator( char *str_id, size_t str_id_len, zend_long dir } /* {{{ Opens a transliterator by id. */ -PHP_FUNCTION( transliterator_create ) +U_CFUNC PHP_FUNCTION( transliterator_create ) { char *str_id; size_t str_id_len; @@ -119,11 +126,11 @@ PHP_FUNCTION( transliterator_create ) /* }}} */ /* {{{ Opens a transliterator by id. */ -PHP_FUNCTION( transliterator_create_from_rules ) +U_CFUNC PHP_FUNCTION( transliterator_create_from_rules ) { char *str_rules; size_t str_rules_len; - UChar *ustr_rules = NULL; + UChar *ustr_rules = nullptr; int32_t ustr_rules_len = 0; zend_long direction = TRANSLITERATOR_FORWARD; UParseError parse_error; @@ -161,16 +168,16 @@ PHP_FUNCTION( transliterator_create_from_rules ) efree( ustr_rules ); } - intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) ); + intl_error_set_code( nullptr, INTL_DATA_ERROR_CODE( to ) ); if( U_FAILURE( INTL_DATA_ERROR_CODE( to ) ) ) { - char *msg = NULL; + char *msg = nullptr; smart_str parse_error_str; parse_error_str = intl_parse_error_to_string( &parse_error ); spprintf( &msg, 0, "unable to " "create ICU transliterator from rules (%s)", parse_error_str.s? ZSTR_VAL(parse_error_str.s) : "" ); smart_str_free( &parse_error_str ); - if( msg != NULL ) + if( msg != nullptr ) { intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg); efree( msg ); @@ -185,7 +192,7 @@ PHP_FUNCTION( transliterator_create_from_rules ) /* }}} */ /* {{{ Opens the inverse transliterator transliterator. */ -PHP_FUNCTION( transliterator_create_inverse ) +U_CFUNC PHP_FUNCTION( transliterator_create_inverse ) { Transliterator_object *to_orig; UTransliterator *utrans; @@ -214,14 +221,14 @@ PHP_FUNCTION( transliterator_create_inverse ) /* }}} */ /* {{{ Return an array with the registered transliterator IDs. */ -PHP_FUNCTION( transliterator_list_ids ) +U_CFUNC PHP_FUNCTION( transliterator_list_ids ) { UEnumeration *en; const UChar *elem; int32_t elem_len; UErrorCode status = U_ZERO_ERROR; - intl_error_reset( NULL ); + intl_error_reset( nullptr ); ZEND_PARSE_PARAMETERS_NONE(); @@ -245,23 +252,23 @@ PHP_FUNCTION( transliterator_list_ids ) } uenum_close( en ); - intl_error_set_code( NULL, status ); + intl_error_set_code( nullptr, status ); if( U_FAILURE( status ) ) { zend_array_destroy( Z_ARR_P(return_value) ); RETVAL_FALSE; - intl_error_set_custom_msg( NULL, + intl_error_set_custom_msg( nullptr, "Failed to build array of registered transliterators"); } } /* }}} */ /* {{{ Transliterate a string. */ -PHP_FUNCTION( transliterator_transliterate ) +U_CFUNC PHP_FUNCTION( transliterator_transliterate ) { char *str; - UChar *ustr = NULL, - *uresult = NULL; + UChar *ustr = nullptr, + *uresult = nullptr; size_t str_len; int32_t ustr_len = 0, capacity, @@ -276,7 +283,7 @@ PHP_FUNCTION( transliterator_transliterate ) ZVAL_UNDEF(&tmp_object); - if (object == NULL) { + if (object == nullptr) { /* in non-OOP version, accept both a transliterator and a string */ zend_string *arg1_str; zend_object *arg1_obj; @@ -296,8 +303,8 @@ PHP_FUNCTION( transliterator_transliterate ) if( res == FAILURE ) { if (!EG(exception)) { - zend_string *message = intl_error_get_message( NULL ); - php_error_docref(NULL, E_WARNING, "Could not create transliterator with ID \"%s\" (%s)", ZSTR_VAL(arg1_str), ZSTR_VAL(message) ); + zend_string *message = intl_error_get_message( nullptr ); + php_error_docref(nullptr, E_WARNING, "Could not create transliterator with ID \"%s\" (%s)", ZSTR_VAL(arg1_str), ZSTR_VAL(message) ); zend_string_free( message ); } ZVAL_UNDEF(&tmp_object); @@ -343,7 +350,7 @@ PHP_FUNCTION( transliterator_transliterate ) "Neither \"start\" nor the \"end\" " "arguments can exceed the number of UTF-16 code units " "(in this case, %d)", (int) ustr_len ); - if(msg != NULL ) + if(msg != nullptr ) { intl_errors_set(TRANSLITERATOR_ERROR_P(to), U_ILLEGAL_ARGUMENT_ERROR, msg); efree( msg ); @@ -351,7 +358,7 @@ PHP_FUNCTION( transliterator_transliterate ) goto cleanup; } - uresult = safe_emalloc( ustr_len, sizeof( UChar ), 1 * sizeof( UChar ) ); + uresult = reinterpret_cast(safe_emalloc( ustr_len, sizeof( UChar ), 1 * sizeof( UChar ) )); capacity = ustr_len + 1; while( 1 ) @@ -366,21 +373,21 @@ PHP_FUNCTION( transliterator_transliterate ) { efree( uresult ); - uresult = safe_emalloc( uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) ); + uresult = reinterpret_cast(safe_emalloc( uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) )); capacity = uresult_len + 1; intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); } else if(TRANSLITERATOR_ERROR_CODE( to ) == U_STRING_NOT_TERMINATED_WARNING ) { - uresult = safe_erealloc( uresult, uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) ); + uresult = reinterpret_cast(safe_erealloc( uresult, uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) )); intl_error_reset( TRANSLITERATOR_ERROR_P( to ) ); break; } else if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) ) { - intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) ); + intl_error_set_code( nullptr, TRANSLITERATOR_ERROR_CODE( to ) ); intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to ), "transliteration failed"); goto cleanup; } @@ -412,16 +419,16 @@ PHP_FUNCTION( transliterator_transliterate ) } /* }}} */ -PHP_METHOD( Transliterator, __construct ) +U_CFUNC PHP_METHOD( Transliterator, __construct ) { /* this constructor shouldn't be called as it's private */ - zend_throw_exception( NULL, + zend_throw_exception( nullptr, "An object of this type cannot be created with the new operator.", 0 ); } /* {{{ Get the last error code for this transliterator. */ -PHP_FUNCTION( transliterator_get_error_code ) +U_CFUNC PHP_FUNCTION( transliterator_get_error_code ) { TRANSLITERATOR_METHOD_INIT_VARS @@ -440,9 +447,9 @@ PHP_FUNCTION( transliterator_get_error_code ) /* {{{ Get the last error message for this transliterator. */ -PHP_FUNCTION( transliterator_get_error_message ) +U_CFUNC PHP_FUNCTION( transliterator_get_error_message ) { - zend_string* message = NULL; + zend_string* message = nullptr; TRANSLITERATOR_METHOD_INIT_VARS if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", From 197a455bc02e95522d52aa69f7cec19f6d91cfab Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 2 Nov 2025 23:47:10 +0100 Subject: [PATCH 290/386] sqlite3: remove nonsensical return_value dtor (#20360) --- ext/sqlite3/sqlite3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 720aef5638caf..ea2ca11ca2535 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1916,7 +1916,6 @@ PHP_METHOD(SQLite3Stmt, __construct) errcode = sqlite3_prepare_v2(db_obj->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &(stmt_obj->stmt), NULL); if (errcode != SQLITE_OK) { php_sqlite3_error(db_obj, errcode, "Unable to prepare statement: %s", sqlite3_errmsg(db_obj->db)); - zval_ptr_dtor(return_value); RETURN_FALSE; } stmt_obj->initialised = true; From f00a30102cd78d4b4102d19ab1aae8d580646828 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 3 Nov 2025 08:07:38 +0100 Subject: [PATCH 291/386] dom: Minor cleanup in text.c (#20372) --- ext/dom/text.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/ext/dom/text.c b/ext/dom/text.c index ca8fcf63d3aca..b08619252b850 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -96,7 +96,6 @@ Modern spec URL: https://dom.spec.whatwg.org/#dom-text-splittext */ PHP_METHOD(DOMText, splitText) { - zval *id; xmlChar *first; xmlChar *second; xmlNodePtr node; @@ -105,11 +104,10 @@ PHP_METHOD(DOMText, splitText) int length; dom_object *intern; - id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) { RETURN_THROWS(); } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); + DOM_GET_OBJ(node, ZEND_THIS, xmlNodePtr, intern); if (offset < 0) { zend_argument_value_error(1, "must be greater than or equal to 0"); @@ -155,21 +153,11 @@ Since: DOM Level 3 */ PHP_METHOD(DOMText, isWhitespaceInElementContent) { - zval *id; xmlNodePtr node; dom_object *intern; - - id = ZEND_THIS; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - if (xmlIsBlankNode(node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } + ZEND_PARSE_PARAMETERS_NONE(); + DOM_GET_OBJ(node, ZEND_THIS, xmlNodePtr, intern); + RETURN_BOOL(xmlIsBlankNode(node)); } /* }}} end dom_text_is_whitespace_in_element_content */ From aead67d0bb2f6a3903325b68f274e6b1bceb7bce Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 25 Sep 2025 20:33:10 +0200 Subject: [PATCH 292/386] Add so_reuseaddr stream socket context option This is to allow disabling of SO_REUSEADDR that is enabled by default. To achieve better compatibility on Windows SO_EXCLUSIVEADDRUSE is set if so_reuseaddr is false. Closes GH-19967 --- NEWS | 4 ++ UPGRADING | 6 ++ ext/standard/tests/network/so_reuseaddr.phpt | 73 ++++++++++++++++++++ main/network.c | 9 ++- main/php_network.h | 2 +- main/streams/xp_socket.c | 10 +++ 6 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/network/so_reuseaddr.phpt diff --git a/NEWS b/NEWS index 92b404f3a68a1..938aa1f72edb6 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,10 @@ PHP NEWS . Fixed bug GH-19926 (reset internal pointer earlier while splicing array while COW violation flag is still set). (alexandre-daubois) +- Streams: + . Added so_reuseaddr streams context socket option that allows disabling + address resuse. + - Zip: . Fixed ZipArchive callback being called after executor has shut down. (ilutov) diff --git a/UPGRADING b/UPGRADING index eb158460cefb7..f4a455caefa1f 100644 --- a/UPGRADING +++ b/UPGRADING @@ -36,6 +36,12 @@ PHP 8.6 UPGRADE NOTES IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks. It is supported from icu 63. + +- Streams: + . Added stream socket context option so_reuseaddr that allows disabling + address reuse (SO_REUSEADDR) and explicitly uses SO_EXCLUSIVEADDRUSE on + Windows. + ======================================== 3. Changes in SAPI modules ======================================== diff --git a/ext/standard/tests/network/so_reuseaddr.phpt b/ext/standard/tests/network/so_reuseaddr.phpt new file mode 100644 index 0000000000000..d400a81ac33d3 --- /dev/null +++ b/ext/standard/tests/network/so_reuseaddr.phpt @@ -0,0 +1,73 @@ +--TEST-- +stream_socket_server() SO_REUSEADDR context option test +--FILE-- + ['so_reuseaddr' => false]]); +$server3 = stream_socket_server("tcp://127.0.0.1:0", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context); +if (!$server3) { + die('Unable to create server3'); +} + +$addr = stream_socket_get_name($server3, false); +$port = (int)substr(strrchr($addr, ':'), 1); + +$client3 = stream_socket_client("tcp://127.0.0.1:$port"); +$accepted = stream_socket_accept($server3, 1); + +// Force real TCP connection with data +fwrite($client3, "test"); +fread($accepted, 4); +fwrite($accepted, "response"); +fread($client3, 8); + +// Client closes first (becomes active closer) +fclose($client3); // This enters TIME_WAIT +if (!$is_win) { // Windows would always succeed if server is closed + fclose($server3); +} + +// Try immediate bind with SO_REUSEADDR disabled (should fail) +$server4 = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context); +if ($server4) { + echo "Disabled: Server restart succeeded\n"; + fclose($server4); +} else { + echo "Disabled: Server restart failed\n"; +} +?> +--EXPECT-- +Default: Server restart succeeded +Disabled: Server restart failed diff --git a/main/network.c b/main/network.c index 7be64c2c4e1f1..0dadf0bb4dc3a 100644 --- a/main/network.c +++ b/main/network.c @@ -496,8 +496,13 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po /* attempt to bind */ -#ifdef SO_REUSEADDR - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&sockoptval, sizeof(sockoptval)); + if (sockopts & STREAM_SOCKOP_SO_REUSEADDR) { + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&sockoptval, sizeof(sockoptval)); + } +#ifdef PHP_WIN32 + else { + setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char*)&sockoptval, sizeof(sockoptval)); + } #endif #ifdef IPV6_V6ONLY if (sockopts & STREAM_SOCKOP_IPV6_V6ONLY) { diff --git a/main/php_network.h b/main/php_network.h index 6df73cf7af0d0..45e1e1902631d 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -123,7 +123,7 @@ typedef int php_socket_t; #define STREAM_SOCKOP_IPV6_V6ONLY (1 << 3) #define STREAM_SOCKOP_IPV6_V6ONLY_ENABLED (1 << 4) #define STREAM_SOCKOP_TCP_NODELAY (1 << 5) - +#define STREAM_SOCKOP_SO_REUSEADDR (1 << 6) /* uncomment this to debug poll(2) emulation on systems that have poll(2) */ /* #define PHP_USE_POLL_2_EMULATION 1 */ diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index e3e81323c3fc7..db35a9b7952c8 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -718,6 +718,16 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * } #endif +#ifdef SO_REUSEADDR + /* SO_REUSEADDR is enabled by default so this option is just to disable it if set to false. */ + if (!PHP_STREAM_CONTEXT(stream) + || (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_reuseaddr")) == NULL + || zend_is_true(tmpzval) + ) { + sockopts |= STREAM_SOCKOP_SO_REUSEADDR; + } +#endif + #ifdef SO_BROADCAST if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ && PHP_STREAM_CONTEXT(stream) From f900035b273c17c67948d89dcad76e03e885b60e Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 20 Oct 2025 22:42:56 +0000 Subject: [PATCH 293/386] network: on freebsd using SO_REUSEPORT_LB for a better distribution. SO_REUSEPORT on FreeBSD acts differently as the underlying semantic is different (as it predates Linux) since it s more for UDP/multicasts. The SO_REUSEPORT_LB flag, however, uses load balancing for group of address:port combinations which is how Linux is implemented. Co-authored-by: Jakub Zelenka --- main/network.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/network.c b/main/network.c index 0dadf0bb4dc3a..6c43321cf2e8a 100644 --- a/main/network.c +++ b/main/network.c @@ -512,7 +512,13 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po #endif #ifdef SO_REUSEPORT if (sockopts & STREAM_SOCKOP_SO_REUSEPORT) { +# ifdef SO_REUSEPORT_LB + /* Historically, SO_REUSEPORT on FreeBSD predates Linux version, however does not + * involve load balancing grouping thus SO_REUSEPORT_LB is the genuine equivalent.*/ + setsockopt(sock, SOL_SOCKET, SO_REUSEPORT_LB, (char*)&sockoptval, sizeof(sockoptval)); +# else setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (char*)&sockoptval, sizeof(sockoptval)); +# endif } #endif #ifdef SO_BROADCAST From 5151b9d8d6606dbb3eccaef45d2390511fbc91dd Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Mon, 3 Nov 2025 12:40:50 +0100 Subject: [PATCH 294/386] Add test for so_reuseport stream socket option --- ext/standard/tests/network/so_reuseport.phpt | 136 +++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 ext/standard/tests/network/so_reuseport.phpt diff --git a/ext/standard/tests/network/so_reuseport.phpt b/ext/standard/tests/network/so_reuseport.phpt new file mode 100644 index 0000000000000..12a07bbd42364 --- /dev/null +++ b/ext/standard/tests/network/so_reuseport.phpt @@ -0,0 +1,136 @@ +--TEST-- +stream_socket_server() SO_REUSEPORT context option test +--SKIPIF-- + +--FILE-- + ['so_reuseport' => true]]); +$server1 = stream_socket_server("tcp://127.0.0.1:0", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context1); + +if (!$server1) { + die('Unable to create server1'); +} + +$addr = stream_socket_get_name($server1, false); +$port = (int)substr(strrchr($addr, ':'), 1); + +// Establish actual connection on server1 +$client1 = stream_socket_client("tcp://127.0.0.1:$port"); +$accepted1 = stream_socket_accept($server1, 1); + +// Force real TCP connection with data +fwrite($client1, "test"); +fread($accepted1, 4); +fwrite($accepted1, "response"); +fread($client1, 8); + +// Try to bind second server to SAME port with SO_REUSEPORT (while server1 still active) +$context2 = stream_context_create(['socket' => ['so_reuseport' => true]]); +$server2 = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context2); + +if ($server2) { + echo "SO_REUSEPORT enabled: Multiple servers succeeded\n"; + + // Verify server2 can also accept connections + $client2 = stream_socket_client("tcp://127.0.0.1:$port"); + $accepted2_on_srv1 = @stream_socket_accept($server1, 0.1); + $accepted2_on_srv2 = @stream_socket_accept($server2, 0.1); + + if ($accepted2_on_srv1 || $accepted2_on_srv2) { + echo "SO_REUSEPORT enabled: Connections accepted\n"; + } + + if ($accepted2_on_srv1) fclose($accepted2_on_srv1); + if ($accepted2_on_srv2) fclose($accepted2_on_srv2); + if ($client2) fclose($client2); + + fclose($server2); +} else { + echo "SO_REUSEPORT enabled: Multiple servers failed\n"; +} + +fclose($accepted1); +fclose($client1); +fclose($server1); + +// SO_REUSEPORT disabled (default) - should NOT allow multiple servers +$server3 = stream_socket_server("tcp://127.0.0.1:0", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN); + +if (!$server3) { + die('Unable to create server3'); +} + +$addr = stream_socket_get_name($server3, false); +$port = (int)substr(strrchr($addr, ':'), 1); + +$client3 = stream_socket_client("tcp://127.0.0.1:$port"); +$accepted3 = stream_socket_accept($server3, 1); + +fwrite($client3, "test"); +fread($accepted3, 4); +fwrite($accepted3, "response"); +fread($client3, 8); + +// Try to bind second server WITHOUT SO_REUSEPORT (while server3 still active) +$server4 = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN); + +if ($server4) { + echo "SO_REUSEPORT disabled: Multiple servers succeeded\n"; + fclose($server4); +} else { + echo "SO_REUSEPORT disabled: Multiple servers failed\n"; +} + +fclose($accepted3); +fclose($client3); +fclose($server3); + +// SO_REUSEPORT explicitly disabled +$context3 = stream_context_create(['socket' => ['so_reuseport' => false]]); +$server5 = stream_socket_server("tcp://127.0.0.1:0", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context3); + +if (!$server5) { + die('Unable to create server5'); +} + +$addr = stream_socket_get_name($server5, false); +$port = (int)substr(strrchr($addr, ':'), 1); + +$client5 = stream_socket_client("tcp://127.0.0.1:$port"); +$accepted5 = stream_socket_accept($server5, 1); + +fwrite($client5, "test"); +fread($accepted5, 4); +fwrite($accepted5, "response"); +fread($client5, 8); + +$context4 = stream_context_create(['socket' => ['so_reuseport' => false]]); +$server6 = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, + STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context4); + +if ($server6) { + echo "SO_REUSEPORT explicitly disabled: Multiple servers succeeded\n"; + fclose($server6); +} else { + echo "SO_REUSEPORT explicitly disabled: Multiple servers failed\n"; +} + +fclose($accepted5); +fclose($client5); +fclose($server5); +?> +--EXPECT-- +SO_REUSEPORT enabled: Multiple servers succeeded +SO_REUSEPORT enabled: Connections accepted +SO_REUSEPORT disabled: Multiple servers failed +SO_REUSEPORT explicitly disabled: Multiple servers failed From bda37c11618b84ed267835d48c7c8adeddf1db06 Mon Sep 17 00:00:00 2001 From: Sujan Miya Date: Mon, 3 Nov 2025 20:30:52 +0600 Subject: [PATCH 295/386] [skip ci] Fix typo in CODING_STANDARDS.md (GH-20364) --- CODING_STANDARDS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md index c599194ed50e3..47b76717c8391 100644 --- a/CODING_STANDARDS.md +++ b/CODING_STANDARDS.md @@ -276,7 +276,7 @@ rewritten to comply with these rules. 1. The length of constant string literals should be calculated via ``strlen()`` instead of using ``sizeof()-1`` as it is clearer and any modern compiler - will optimize it away. Legacy usages of the latter style exists within the + will optimize it away. Legacy usages of the latter style exist within the codebase but should not be refactored, unless larger refactoring around that code is taking place. From 540fd6e96bb12a466cb0e4ea4696fd1ad618ef7f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:46:56 +0100 Subject: [PATCH 296/386] dom: Optimize splitText() (#20371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids duplicating the intermediate strings, by transferring ownership. It's hard to measure the improvement in a reliable way, as we have to operate on the same node. The following benchmark shows a nice improvement (although not perfect as a benchmark): ```php loadXML('testabcdef'); $text = $dom->documentElement->firstChild; for ($i = 0; $i < 1000000; $i++) { $text2 = clone $text; $text2->splitText(5); } ``` Only tested on my desktop i7-4790: ``` Benchmark 1: ./sapi/cli/php x.php Time (mean ± σ): 284.1 ms ± 2.8 ms [User: 280.0 ms, System: 3.0 ms] Range (min … max): 281.4 ms … 291.3 ms 10 runs Benchmark 2: ./sapi/cli/php_old x.php Time (mean ± σ): 314.0 ms ± 7.8 ms [User: 309.2 ms, System: 2.9 ms] Range (min … max): 306.5 ms … 328.0 ms 10 runs Summary ./sapi/cli/php x.php ran 1.11 ± 0.03 times faster than ./sapi/cli/php_old x.php ``` --- UPGRADING | 3 +++ ext/dom/text.c | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/UPGRADING b/UPGRADING index f4a455caefa1f..7a3aff95da8ef 100644 --- a/UPGRADING +++ b/UPGRADING @@ -117,5 +117,8 @@ PHP 8.6 UPGRADE NOTES . Arguments are now passed more efficiently to known constructors (e.g. when using new self()). +- DOM: + . Made splitText() faster and consume less memory. + - JSON: . Improve performance of encoding arrays and objects. diff --git a/ext/dom/text.c b/ext/dom/text.c index b08619252b850..4c503201c8bfe 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -127,17 +127,18 @@ PHP_METHOD(DOMText, splitText) first = xmlUTF8Strndup(cur, (int)offset); second = xmlUTF8Strsub(cur, (int)offset, (int)(length - offset)); - xmlNodeSetContent(node, first); - nnode = xmlNewDocText(node->doc, second); - - xmlFree(first); - xmlFree(second); + xmlNodeSetContent(node, NULL); + node->content = first; + nnode = xmlNewDocText(node->doc, NULL); if (nnode == NULL) { + xmlFree(second); php_dom_throw_error(INVALID_STATE_ERR, /* strict */ true); RETURN_THROWS(); } + nnode->content = second; + if (node->parent != NULL) { nnode->type = XML_ELEMENT_NODE; xmlAddNextSibling(node, nnode); From 2d105afce7d66cb42cbfd3226a35879548eabbd8 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Mon, 3 Nov 2025 19:12:09 +0100 Subject: [PATCH 297/386] socket: properly expose TCP keepalive constants (#20376) This fixes missing constants on MacOS where TCP_KEEPALIVE, TCP_KEEPINTVL and TCP_KEEPCNT are available. Currently only TCP_KEEPALIVE is defined there. --- ext/sockets/sockets.stub.php | 4 ++ ext/sockets/sockets_arginfo.h | 6 ++- ext/sockets/tests/socket_tcp_keepalive.phpt | 52 +++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 ext/sockets/tests/socket_tcp_keepalive.phpt diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php index 6050a89414565..3df9b598a1e8f 100644 --- a/ext/sockets/sockets.stub.php +++ b/ext/sockets/sockets.stub.php @@ -643,11 +643,15 @@ * @cvalue TCP_KEEPIDLE */ const TCP_KEEPIDLE = UNKNOWN; +#endif +#ifdef TCP_KEEPINTVL /** * @var int * @cvalue TCP_KEEPINTVL */ const TCP_KEEPINTVL = UNKNOWN; +#endif +#ifdef TCP_KEEPCNT /** * @var int * @cvalue TCP_KEEPCNT diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h index b7af6eb6b89ac..edfc344ff8cc0 100644 --- a/ext/sockets/sockets_arginfo.h +++ b/ext/sockets/sockets_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7b1baf47dce2fb08faa5616068238ea078d1609b */ + * Stub hash: f754368e28f6e45bf3a63a403e49f5659c29d2c6 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) @@ -544,7 +544,11 @@ static void register_sockets_symbols(int module_number) #endif #if defined(TCP_KEEPIDLE) REGISTER_LONG_CONSTANT("TCP_KEEPIDLE", TCP_KEEPIDLE, CONST_PERSISTENT); +#endif +#if defined(TCP_KEEPINTVL) REGISTER_LONG_CONSTANT("TCP_KEEPINTVL", TCP_KEEPINTVL, CONST_PERSISTENT); +#endif +#if defined(TCP_KEEPCNT) REGISTER_LONG_CONSTANT("TCP_KEEPCNT", TCP_KEEPCNT, CONST_PERSISTENT); #endif #if defined(TCP_FUNCTION_BLK) diff --git a/ext/sockets/tests/socket_tcp_keepalive.phpt b/ext/sockets/tests/socket_tcp_keepalive.phpt new file mode 100644 index 0000000000000..cef570dc62b2b --- /dev/null +++ b/ext/sockets/tests/socket_tcp_keepalive.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test SO_KEEPALIVE and TCP keepalive constants +--EXTENSIONS-- +sockets +--SKIPIF-- + +--FILE-- + +--EXPECT-- +SO_KEEPALIVE: enabled +TCP_KEEPIDLE: 60 +TCP_KEEPINTVL: 10 +TCP_KEEPCNT: 5 From 7b6b233ce8ea0c19bdac305781cb35fad1a31aff Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:35:26 +0100 Subject: [PATCH 298/386] Optimize array_fill_keys() (#20347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the refcount update outside of the loop. For the following benchmark: ```php $r = range(0, 1000); $v = new stdClass(); for ($i = 0; $i < 100000; $i++) { array_fill_keys($r, $v); } ``` On an i7-4790: ``` Benchmark 1: ./sapi/cli/php_old ../x.php Time (mean ± σ): 507.5 ms ± 4.8 ms [User: 505.1 ms, System: 1.2 ms] Range (min … max): 501.2 ms … 518.4 ms 10 runs Benchmark 2: ./sapi/cli/php ../x.php Time (mean ± σ): 479.8 ms ± 3.1 ms [User: 476.8 ms, System: 1.8 ms] Range (min … max): 475.0 ms … 486.7 ms 10 runs Summary ./sapi/cli/php ../x.php ran 1.06 ± 0.01 times faster than ./sapi/cli/php_old ../x.php ``` On an i7-1185G7: ``` Benchmark 1: ./sapi/cli/php x.php Time (mean ± σ): 343.9 ms ± 3.1 ms [User: 341.1 ms, System: 2.3 ms] Range (min … max): 337.9 ms … 347.8 ms 10 runs Benchmark 2: ./sapi/cli/php_old x.php Time (mean ± σ): 357.8 ms ± 2.3 ms [User: 355.7 ms, System: 1.6 ms] Range (min … max): 355.0 ms … 362.6 ms 10 runs Summary ./sapi/cli/php x.php ran 1.04 ± 0.01 times faster than ./sapi/cli/php_old x.php ``` --- UPGRADING | 3 +++ Zend/zend_hash.h | 11 +++++++++++ ext/standard/array.c | 9 ++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/UPGRADING b/UPGRADING index 7a3aff95da8ef..858e1cffa9535 100644 --- a/UPGRADING +++ b/UPGRADING @@ -122,3 +122,6 @@ PHP 8.6 UPGRADE NOTES - JSON: . Improve performance of encoding arrays and objects. + +- Standard: + . Improved performance of array_fill_keys(). diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 57020bbcad0b2..3a501b7f37df1 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -473,6 +473,17 @@ static zend_always_inline bool zend_hash_str_exists_ind(const HashTable *ht, con Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF); } +static zend_always_inline zval *zend_symtable_add(HashTable *ht, zend_string *key, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_add(ht, idx, pData); + } else { + return zend_hash_add(ht, key, pData); + } +} + static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData) { zend_ulong idx; diff --git a/ext/standard/array.c b/ext/standard/array.c index 4097d71899011..32d28fe70220a 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2830,16 +2830,19 @@ PHP_FUNCTION(array_fill_keys) ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), entry) { ZVAL_DEREF(entry); - Z_TRY_ADDREF_P(val); if (Z_TYPE_P(entry) == IS_LONG) { - zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), val); + zend_hash_index_add(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), val); } else { zend_string *tmp_key; zend_string *key = zval_get_tmp_string(entry, &tmp_key); - zend_symtable_update(Z_ARRVAL_P(return_value), key, val); + zend_symtable_add(Z_ARRVAL_P(return_value), key, val); zend_tmp_string_release(tmp_key); } } ZEND_HASH_FOREACH_END(); + + if (Z_REFCOUNTED_P(val)) { + GC_ADDREF_EX(Z_COUNTED_P(val), zend_hash_num_elements(Z_ARRVAL_P(return_value))); + } } /* }}} */ From b460062f7083ea6213e2d0dba9b05b8e68113c54 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 4 Nov 2025 08:32:06 +0100 Subject: [PATCH 299/386] random: Use ZVAL_EMPTY_ARRAY() for members in serialization (#20382) --- ext/random/engine_mt19937.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/random/engine_mt19937.c b/ext/random/engine_mt19937.c index 7c9d1741d81f1..e8a1ee5cf8087 100644 --- a/ext/random/engine_mt19937.c +++ b/ext/random/engine_mt19937.c @@ -324,8 +324,7 @@ PHP_METHOD(Random_Engine_Mt19937, __serialize) array_init(return_value); /* members */ - ZVAL_ARR(&t, zend_std_get_properties(&engine->std)); - Z_TRY_ADDREF(t); + ZVAL_EMPTY_ARRAY(&t); zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &t); /* state */ From 3f8dc377a369e7d59c1d8ccc2c3a8b0222e9a38a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 4 Nov 2025 21:38:38 +0100 Subject: [PATCH 300/386] Improve performance of array_walk() (#20322) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We never need to use refcounted copies for arguments because the copy to the call frame already increments the refcount. For the following benchmark: ```php $a = range(0, 10); for ($i = 0; $i < 1000000; $i++) array_walk($a, fn ($val, $idx, $arg) => $val + $arg, 2); ``` On an i7-4790: ``` Benchmark 1: ./sapi/cli/php x.php Time (mean ± σ): 593.0 ms ± 5.4 ms [User: 589.8 ms, System: 1.7 ms] Range (min … max): 583.3 ms … 600.9 ms 10 runs Benchmark 2: ./sapi/cli/php_old x.php Time (mean ± σ): 637.8 ms ± 4.6 ms [User: 633.9 ms, System: 2.2 ms] Range (min … max): 633.4 ms … 649.2 ms 10 runs Summary ./sapi/cli/php x.php ran 1.08 ± 0.01 times faster than ./sapi/cli/php_old x.php ``` On an i7-1185G7: ``` Benchmark 1: ./sapi/cli/php x.php Time (mean ± σ): 362.3 ms ± 2.0 ms [User: 359.9 ms, System: 1.9 ms] Range (min … max): 359.6 ms … 367.1 ms 10 runs Benchmark 2: ./sapi/cli/php_old x.php Time (mean ± σ): 385.5 ms ± 1.8 ms [User: 383.2 ms, System: 1.9 ms] Range (min … max): 381.5 ms … 387.2 ms 10 runs Summary ./sapi/cli/php x.php ran 1.06 ± 0.01 times faster than ./sapi/cli/php_old x.php ``` --- UPGRADING | 1 + ext/standard/array.c | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/UPGRADING b/UPGRADING index 858e1cffa9535..b0c30bc714576 100644 --- a/UPGRADING +++ b/UPGRADING @@ -125,3 +125,4 @@ PHP 8.6 UPGRADE NOTES - Standard: . Improved performance of array_fill_keys(). + . Improved performance of array_walk(). diff --git a/ext/standard/array.c b/ext/standard/array.c index 32d28fe70220a..d1a7996ea6b27 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1457,7 +1457,7 @@ static zend_result php_array_walk( /* Set up known arguments */ ZVAL_UNDEF(&args[1]); if (userdata) { - ZVAL_COPY(&args[2], userdata); + ZVAL_COPY_VALUE(&args[2], userdata); } fci.retval = &retval; @@ -1531,21 +1531,14 @@ static zend_result php_array_walk( } zval_ptr_dtor(&ref); } else { - ZVAL_COPY(&args[0], zv); + ZVAL_COPY_VALUE(&args[0], zv); /* Call the userland function */ result = zend_call_function(&fci, &context->fci_cache); - if (result == SUCCESS) { - zval_ptr_dtor(&retval); - } - - zval_ptr_dtor(&args[0]); + zval_ptr_dtor(&retval); } - if (Z_TYPE(args[1]) != IS_UNDEF) { - zval_ptr_dtor(&args[1]); - ZVAL_UNDEF(&args[1]); - } + zval_ptr_dtor_str(&args[1]); if (result == FAILURE) { break; @@ -1565,9 +1558,6 @@ static zend_result php_array_walk( } } while (!EG(exception)); - if (userdata) { - zval_ptr_dtor(&args[2]); - } zend_hash_iterator_del(ht_iter); return result; } From 1cf63a93801e02d9f75dde59b849dcfa632b9237 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 5 Nov 2025 00:36:24 +0100 Subject: [PATCH 301/386] ext/fileinfo: Remove duplicate HAVE_STDINT_H definition (#20392) --- ext/fileinfo/libmagic/config.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/fileinfo/libmagic/config.h b/ext/fileinfo/libmagic/config.h index 4af6e06c4127d..34a10d59faa18 100644 --- a/ext/fileinfo/libmagic/config.h +++ b/ext/fileinfo/libmagic/config.h @@ -2,11 +2,7 @@ #include "php_libmagic.h" #ifndef HAVE_STDINT_H -#define HAVE_STDINT_H 1 -#endif - -#ifndef HAVE_STDINT_H -#define HAVE_STDINT_H 1 +# define HAVE_STDINT_H 1 #endif #ifndef HAVE_VISIBILITY From 331e6ae548e7552169f494148fdc6fa0a906ddfb Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 5 Nov 2025 20:13:32 +0100 Subject: [PATCH 302/386] tidy: Avoid some work when creating attributes (#20390) We know these can't be numeric strings, so directly use the hash table APIs. Also use ZVAL_STRING_FAST because many attributes are 0/1 chars long. --- ext/tidy/tidy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 63820d1a3075b..54028537d39ea 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -616,12 +616,14 @@ static void tidy_add_node_default_properties(PHPTidyObj *obj) do { const char *attr_name = tidyAttrName(tempattr); if (attr_name) { + zval value; const char *val = tidyAttrValue(tempattr); if (val) { - add_assoc_string(&attribute, attr_name, val); + ZVAL_STRING_FAST(&value, val); } else { - add_assoc_str(&attribute, attr_name, zend_empty_string); + ZVAL_EMPTY_STRING(&value); } + zend_hash_str_add_new(Z_ARRVAL(attribute), attr_name, strlen(attr_name), &value); } } while((tempattr = tidyAttrNext(tempattr))); } else { From 423e50c57d78bfcfd5331cc0a8b77f3b93e719e0 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 5 Nov 2025 21:46:32 +0000 Subject: [PATCH 303/386] zend_object_handler.c: call zend_get_call_trampoline_func() and pass zend_function* directly (#20297) Abstracting away the bool parameter is not that useful, and doesn't make the code more legible. Moreover, it is not needed if one passes the zend_function* directly, which we always have. This is because it can be derived/copied from the fn_flags. --- UPGRADING.INTERNALS | 2 ++ Zend/zend_API.c | 2 +- Zend/zend_object_handlers.c | 33 ++++++++------------------------- Zend/zend_object_handlers.h | 2 +- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 3869677779716..385ad0445cc99 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -41,6 +41,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES stored instead. . The zend_active_function{_ex}() functions now return a const zend_function pointer. + . The zend_get_call_trampoline_func() API now takes the __call or + __callStatic zend_function* instead of a CE and a boolean argument. ======================== 2. Build system changes diff --git a/Zend/zend_API.c b/Zend/zend_API.c index fdf3ccaf0ff77..147e8b239961c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3955,7 +3955,7 @@ static zend_always_inline bool zend_is_callable_check_func(zval *callable, const get_function_via_handler: if (fcc->object && fcc->calling_scope == ce_org) { if (strict_class && ce_org->__call) { - fcc->function_handler = zend_get_call_trampoline_func(ce_org, mname, 0); + fcc->function_handler = zend_get_call_trampoline_func(ce_org->__call, mname); call_via_handler = 1; retval = true; } else { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 68daa207ee6e4..ec628dbfc9fe9 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1674,19 +1674,17 @@ ZEND_API bool zend_check_protected(const zend_class_entry *ce, const zend_class_ } /* }}} */ -ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce, zend_string *method_name, bool is_static) /* {{{ */ +ZEND_API ZEND_ATTRIBUTE_NONNULL zend_function *zend_get_call_trampoline_func( + const zend_function *fbc, zend_string *method_name) /* {{{ */ { size_t mname_len; zend_op_array *func; - zend_function *fbc = is_static ? ce->__callstatic : ce->__call; /* We use non-NULL value to avoid useless run_time_cache allocation. * The low bit must be zero, to not be interpreted as a MAP_PTR offset. */ static const void *dummy = (void*)(intptr_t)2; static const zend_arg_info arg_info[1] = {{0}}; - ZEND_ASSERT(fbc); - if (EXPECTED(EG(trampoline).common.function_name == NULL)) { func = &EG(trampoline).op_array; } else { @@ -1700,13 +1698,10 @@ ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce func->fn_flags = ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_PUBLIC | ZEND_ACC_VARIADIC - | (fbc->common.fn_flags & (ZEND_ACC_RETURN_REFERENCE|ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED|ZEND_ACC_NODISCARD)); + | (fbc->common.fn_flags & (ZEND_ACC_RETURN_REFERENCE|ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED|ZEND_ACC_NODISCARD|ZEND_ACC_STATIC)); func->fn_flags2 = 0; /* Attributes outlive the trampoline because they are created by the compiler. */ func->attributes = fbc->common.attributes; - if (is_static) { - func->fn_flags |= ZEND_ACC_STATIC; - } func->opcodes = &EG(call_trampoline_op); ZEND_MAP_PTR_INIT(func->run_time_cache, (void**)dummy); func->scope = fbc->common.scope; @@ -1828,12 +1823,6 @@ ZEND_API zend_function *zend_get_property_hook_trampoline( return func; } -static zend_always_inline zend_function *zend_get_user_call_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */ -{ - return zend_get_call_trampoline_func(ce, method_name, false); -} -/* }}} */ - ZEND_API ZEND_COLD zend_never_inline void zend_bad_method_call(const zend_function *fbc, const zend_string *method_name, const zend_class_entry *scope) /* {{{ */ { zend_throw_error(NULL, "Call to %s method %s::%s() from %s%s", @@ -1875,7 +1864,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * ZSTR_ALLOCA_FREE(lc_method_name, use_heap); } if (zobj->ce->__call) { - return zend_get_user_call_function(zobj->ce, method_name); + return zend_get_call_trampoline_func(zobj->ce->__call, method_name); } else { return NULL; } @@ -1901,7 +1890,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * if (UNEXPECTED(fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(fbc), scope))) { if (zobj->ce->__call) { - fbc = zend_get_user_call_function(zobj->ce, method_name); + fbc = zend_get_call_trampoline_func(zobj->ce->__call, method_name); } else { zend_bad_method_call(fbc, method_name, scope); fbc = NULL; @@ -1922,14 +1911,8 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * } /* }}} */ -static zend_always_inline zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */ -{ - return zend_get_call_trampoline_func(ce, method_name, true); -} -/* }}} */ - static zend_always_inline zend_function *get_static_method_fallback( - zend_class_entry *ce, zend_string *function_name) + const zend_class_entry *ce, zend_string *function_name) { zend_object *object; if (ce->__call && @@ -1939,9 +1922,9 @@ static zend_always_inline zend_function *get_static_method_fallback( * see: tests/classes/__call_004.phpt */ ZEND_ASSERT(object->ce->__call); - return zend_get_user_call_function(object->ce, function_name); + return zend_get_call_trampoline_func(object->ce->__call, function_name); } else if (ce->__callstatic) { - return zend_get_user_callstatic_function(ce, function_name); + return zend_get_call_trampoline_func(ce->__callstatic, function_name); } else { return NULL; } diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 84d0b57d7aa28..0b255f4304280 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -312,7 +312,7 @@ ZEND_API bool zend_check_protected(const zend_class_entry *ce, const zend_class_ ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_string *prop_info_name, bool is_dynamic); -ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce, zend_string *method_name, bool is_static); +ZEND_API ZEND_ATTRIBUTE_NONNULL zend_function *zend_get_call_trampoline_func(const zend_function *fbc, zend_string *method_name); ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member); From ca40ec284b99bedc02419929ddc77f37f81d1e2a Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 5 Nov 2025 23:21:34 +0100 Subject: [PATCH 304/386] ext/zlib: Remove unused ZLIB_EXPORTS (#20400) This macro was probably once used in zconf.h on Windows in some custom(ized) zlib versions. Current zlib versions don't use this macro anywhere - zlib.net, winlibs... --- ext/zlib/config.w32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 index 3bc24d88e1735..63ca949813ce1 100644 --- a/ext/zlib/config.w32 +++ b/ext/zlib/config.w32 @@ -6,7 +6,7 @@ if (PHP_ZLIB == "yes") { if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) && CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)) { - EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", PHP_ZLIB_SHARED, "/D ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", PHP_ZLIB_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE("HAVE_ZLIB", 1, "Define to 1 if the PHP extension 'zlib' is available."); if (!PHP_ZLIB_SHARED) { From 129f6e536d84bedf525f145d1e468daa9125037c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 5 Nov 2025 22:33:25 +0000 Subject: [PATCH 305/386] ext/pgsql: Refactor parameter parsing for a few functions (#20068) --- ext/pgsql/pgsql.c | 165 ++++++++++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 72 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 9c60015985c6d..cf4285bf26374 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1978,39 +1978,12 @@ PHP_FUNCTION(pg_fetch_result) /* }}} */ /* {{{ void php_pgsql_fetch_hash */ -static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_type, int into_object) +static void php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_long row, bool row_is_null, zend_long result_type) { - zval *result; PGresult *pgsql_result; pgsql_result_handle *pg_result; int i, num_fields, pgsql_row; - zend_long row; - bool row_is_null = true; char *field_name; - HashTable *ctor_params = NULL; - zend_class_entry *ce = NULL; - - if (into_object) { - ZEND_PARSE_PARAMETERS_START(1, 4) - Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(row, row_is_null) - Z_PARAM_CLASS(ce) - Z_PARAM_ARRAY_HT(ctor_params) - ZEND_PARSE_PARAMETERS_END(); - - if (!ce) { - ce = zend_standard_class_def; - } - result_type = PGSQL_ASSOC; - } else { - ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(row, row_is_null) - Z_PARAM_LONG(result_type) - ZEND_PARSE_PARAMETERS_END(); - } if (!row_is_null && row < 0) { zend_argument_value_error(2, "must be greater than or equal to 0"); @@ -2054,7 +2027,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ add_assoc_null(return_value, field_name); } } else { - char *element = PQgetvalue(pgsql_result, pgsql_row, i); + const char *element = PQgetvalue(pgsql_result, pgsql_row, i); if (element) { const size_t element_len = strlen(element); @@ -2069,67 +2042,116 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ } } } - - if (into_object) { - zval dataset; - - ZVAL_COPY_VALUE(&dataset, return_value); - zend_result obj_initialized = object_init_ex(return_value, ce); - if (UNEXPECTED(obj_initialized == FAILURE)) { - zval_ptr_dtor(&dataset); - RETURN_THROWS(); - } - if (!ce->default_properties_count && !ce->__set) { - Z_OBJ_P(return_value)->properties = Z_ARR(dataset); - } else { - zend_merge_properties(return_value, Z_ARRVAL(dataset)); - zval_ptr_dtor(&dataset); - } - - if (ce->constructor) { - zend_call_known_function(ce->constructor, Z_OBJ_P(return_value), Z_OBJCE_P(return_value), - /* retval */ NULL, /* argc */ 0, /* params */ NULL, ctor_params); - } else if (ctor_params && zend_hash_num_elements(ctor_params) > 0) { - zend_argument_value_error(3, - "must be empty when the specified class (%s) does not have a constructor", - ZSTR_VAL(ce->name) - ); - } - } } /* }}} */ /* {{{ Get a row as an enumerated array */ PHP_FUNCTION(pg_fetch_row) { - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_NUM, 0); + zval *result; + zend_long row = 0; + bool row_is_null = true; + zend_long result_type = PGSQL_NUM; + + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(row, row_is_null) + Z_PARAM_LONG(result_type) + ZEND_PARSE_PARAMETERS_END(); + + php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); } /* }}} */ /* {{{ Fetch a row as an assoc array */ PHP_FUNCTION(pg_fetch_assoc) { - /* pg_fetch_assoc() is added from PHP 4.3.0. It should raise error, when - there is 3rd parameter */ - if (ZEND_NUM_ARGS() > 2) - WRONG_PARAM_COUNT; - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 0); + zval *result; + zend_long row = 0; + bool row_is_null = true; + + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(row, row_is_null) + ZEND_PARSE_PARAMETERS_END(); + + php_pgsql_fetch_hash(return_value, result, row, row_is_null, PGSQL_ASSOC); } /* }}} */ /* {{{ Fetch a row as an array */ PHP_FUNCTION(pg_fetch_array) { - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_BOTH, 0); + zval *result; + zend_long row = 0; + bool row_is_null = true; + zend_long result_type = PGSQL_BOTH; + + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(row, row_is_null) + Z_PARAM_LONG(result_type) + ZEND_PARSE_PARAMETERS_END(); + + php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); } /* }}} */ /* {{{ Fetch a row as an object */ PHP_FUNCTION(pg_fetch_object) { + zval *result; + zend_long row = 0; + bool row_is_null = true; + zend_class_entry *ce = NULL; + HashTable *ctor_params = NULL; + + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_OBJECT_OF_CLASS(result, pgsql_result_ce) + Z_PARAM_OPTIONAL + Z_PARAM_LONG_OR_NULL(row, row_is_null) + Z_PARAM_CLASS(ce) + Z_PARAM_ARRAY_HT(ctor_params) + ZEND_PARSE_PARAMETERS_END(); + + if (!ce) { + ce = zend_standard_class_def; + } + + if (!ce->constructor && ctor_params && zend_hash_num_elements(ctor_params) > 0) { + zend_argument_value_error(3, + "must be empty when the specified class (%s) does not have a constructor", + ZSTR_VAL(ce->name) + ); + RETURN_THROWS(); + } + /* pg_fetch_object() allowed result_type used to be. 3rd parameter must be allowed for compatibility */ - php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 1); + zval dataset; + php_pgsql_fetch_hash(&dataset, result, row, row_is_null, PGSQL_ASSOC); + + // TODO: Check CE is an instantiable class earlier? + zend_result obj_initialized = object_init_ex(return_value, ce); + if (UNEXPECTED(obj_initialized == FAILURE)) { + zval_ptr_dtor(&dataset); + RETURN_THROWS(); + } + if (!ce->default_properties_count && !ce->__set) { + Z_OBJ_P(return_value)->properties = Z_ARR(dataset); + } else { + zend_merge_properties(return_value, Z_ARRVAL(dataset)); + zval_ptr_dtor(&dataset); + } + + // TODO: Need to grab constructor via object handler as this allows instantiating internal objects with overridden get_constructor + if (ce->constructor) { + zend_call_known_function(ce->constructor, Z_OBJ_P(return_value), Z_OBJCE_P(return_value), + /* retval */ NULL, /* argc */ 0, /* params */ NULL, ctor_params); + } } /* }}} */ @@ -2863,19 +2885,18 @@ PHP_FUNCTION(pg_lo_import) Oid returned_oid; pgsql_link_handle *link; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), - "OP|z", &pgsql_link, pgsql_link_ce, &file_in, &oid) == SUCCESS) { + /* Deprecated signature with implicit connection */ + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "P|z", &file_in, &oid) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "OP|z", &pgsql_link, pgsql_link_ce, &file_in, &oid) == FAILURE) { + RETURN_THROWS(); + } link = Z_PGSQL_LINK_P(pgsql_link); CHECK_PGSQL_LINK(link); - } - else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), - "P|z", &file_in, &oid) == SUCCESS) { + } else { + /* Load implicit connection */ link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); } - else { - WRONG_PARAM_COUNT; - } if (php_check_open_basedir(ZSTR_VAL(file_in))) { RETURN_FALSE; From d3c5163c25c0bc82b72af2f1b09e9d85d92c3668 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 5 Nov 2025 22:35:36 +0000 Subject: [PATCH 306/386] zend_object_handlers.h: Remove duplicate function definition --- Zend/zend_object_handlers.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 0b255f4304280..238d9539a7d5a 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -316,8 +316,6 @@ ZEND_API ZEND_ATTRIBUTE_NONNULL zend_function *zend_get_call_trampoline_func(con ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member); -ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member); - ZEND_API uint32_t *zend_get_recursion_guard(zend_object *zobj); /* Default behavior for get_properties_for. For use as a fallback in custom From db8c331d07bf644e61361487c4acd1a84f0677a9 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 6 Nov 2025 18:49:23 +0100 Subject: [PATCH 307/386] array_unshift: Add fast optimized case for packed arrays (#20353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Packed arrays are likely common in this case, as with array_shift which already has a similar optimization. For the following benchmark: ```php Date: Thu, 6 Nov 2025 23:36:43 +0100 Subject: [PATCH 308/386] array_unshift: Use specialised iteration macro (#20410) Forgot this while working on GH-20353, but this could avoid some checks depending on the compiler optimizations. --- ext/standard/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 9f7709092dde6..0ef700f14a746 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3763,7 +3763,7 @@ PHP_FUNCTION(array_unshift) zend_hash_next_index_insert_new(&new_hash, &args[i]); } - ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(stack), key, value) { + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(stack), key, value) { if (key) { zend_hash_add_new(&new_hash, key, value); } else { From 0953e898db44403d81f73a38974c4bcd35eb5f88 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 6 Nov 2025 22:47:28 +0000 Subject: [PATCH 309/386] Fix pg_fetch_object() when an error occurs in subroutine (#20407) This is a follow-up of GH-20068 --- ext/pgsql/pgsql.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index cf4285bf26374..77425b25aee17 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1977,8 +1977,9 @@ PHP_FUNCTION(pg_fetch_result) } /* }}} */ -/* {{{ void php_pgsql_fetch_hash */ -static void php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_long row, bool row_is_null, zend_long result_type) +/* Returns true when the return_value was populated with an array, + * otherwise when an error occurs false is returned, in which case the return_value is NOT initialized */ +static bool php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_long row, bool row_is_null, zend_long result_type) { PGresult *pgsql_result; pgsql_result_handle *pg_result; @@ -1987,23 +1988,26 @@ static void php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_lo if (!row_is_null && row < 0) { zend_argument_value_error(2, "must be greater than or equal to 0"); - RETURN_THROWS(); + return false; } if (!(result_type & PGSQL_BOTH)) { zend_argument_value_error(3, "must be one of PGSQL_ASSOC, PGSQL_NUM, or PGSQL_BOTH"); - RETURN_THROWS(); + return false; } pg_result = Z_PGSQL_RESULT_P(result); - CHECK_PGSQL_RESULT(pg_result); + if (UNEXPECTED(pg_result->result == NULL)) { + zend_throw_error(NULL, "PostgreSQL result has already been closed"); + return false; + } pgsql_result = pg_result->result; if (!row_is_null) { if (row >= PQntuples(pgsql_result)) { php_error_docref(NULL, E_WARNING, "Unable to jump to row " ZEND_LONG_FMT " on PostgreSQL result index " ZEND_LONG_FMT, row, Z_LVAL_P(result)); - RETURN_FALSE; + return false; } pgsql_row = (int)row; pg_result->row = pgsql_row; @@ -2011,7 +2015,7 @@ static void php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_lo /* If 2nd param is NULL, use internal row counter to access next row */ pgsql_row = pg_result->row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - RETURN_FALSE; + return false; } pg_result->row++; } @@ -2042,8 +2046,8 @@ static void php_pgsql_fetch_hash(zval *return_value, const zval *result, zend_lo } } } + return true; } -/* }}} */ /* {{{ Get a row as an enumerated array */ PHP_FUNCTION(pg_fetch_row) @@ -2060,7 +2064,10 @@ PHP_FUNCTION(pg_fetch_row) Z_PARAM_LONG(result_type) ZEND_PARSE_PARAMETERS_END(); - php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); + if (UNEXPECTED(!php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type))) { + /* Either an exception is thrown, or we return false */ + RETURN_FALSE; + } } /* }}} */ @@ -2077,7 +2084,10 @@ PHP_FUNCTION(pg_fetch_assoc) Z_PARAM_LONG_OR_NULL(row, row_is_null) ZEND_PARSE_PARAMETERS_END(); - php_pgsql_fetch_hash(return_value, result, row, row_is_null, PGSQL_ASSOC); + if (UNEXPECTED(!php_pgsql_fetch_hash(return_value, result, row, row_is_null, PGSQL_ASSOC))) { + /* Either an exception is thrown, or we return false */ + RETURN_FALSE; + } } /* }}} */ @@ -2096,7 +2106,10 @@ PHP_FUNCTION(pg_fetch_array) Z_PARAM_LONG(result_type) ZEND_PARSE_PARAMETERS_END(); - php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); + if (UNEXPECTED(!php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type))) { + /* Either an exception is thrown, or we return false */ + RETURN_FALSE; + } } /* }}} */ @@ -2129,10 +2142,11 @@ PHP_FUNCTION(pg_fetch_object) RETURN_THROWS(); } - /* pg_fetch_object() allowed result_type used to be. 3rd parameter - must be allowed for compatibility */ zval dataset; - php_pgsql_fetch_hash(&dataset, result, row, row_is_null, PGSQL_ASSOC); + if (UNEXPECTED(!php_pgsql_fetch_hash(&dataset, result, row, row_is_null, PGSQL_ASSOC))) { + /* Either an exception is thrown, or we return false */ + RETURN_FALSE; + } // TODO: Check CE is an instantiable class earlier? zend_result obj_initialized = object_init_ex(return_value, ce); From 297179dbcc643dd7c0e7f2eee5099ffbd1be8b05 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 6 Nov 2025 22:47:39 +0000 Subject: [PATCH 310/386] zend_object_handlers: add some const qualifiers (#20402) --- Zend/zend_API.c | 5 ++--- Zend/zend_object_handlers.c | 44 ++++++++++++++++++------------------- Zend/zend_object_handlers.h | 2 +- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 147e8b239961c..89ffe419cd6e4 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1687,10 +1687,9 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti if (object->ce->default_properties_count) { zval *prop; zend_string *key; - zend_property_info *property_info; ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(properties, key, prop) { - property_info = zend_get_property_info(object->ce, key, 1); + const zend_property_info *property_info = zend_get_property_info(object->ce, key, 1); if (property_info != ZEND_WRONG_PROPERTY_INFO && property_info && (property_info->flags & ZEND_ACC_STATIC) == 0) { @@ -1719,7 +1718,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties) zval *prop, tmp; zend_string *key; zend_long h; - zend_property_info *property_info; + const zend_property_info *property_info; ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) { if (key) { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index ec628dbfc9fe9..470fb76ec14e1 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -106,8 +106,7 @@ ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj) /* {{{ /* Implements the fast path for array cast */ ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj) /* {{{ */ { - zend_property_info *prop_info; - zend_class_entry *ce = zobj->ce; + const zend_class_entry *ce = zobj->ce; HashTable *ht; zval* prop; int i; @@ -118,7 +117,7 @@ ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj) /* if (ce->default_properties_count) { zend_hash_real_init_mixed(ht); for (i = 0; i < ce->default_properties_count; i++) { - prop_info = ce->properties_info_table[i]; + const zend_property_info *prop_info = ce->properties_info_table[i]; if (!prop_info) { continue; @@ -192,7 +191,7 @@ ZEND_API HashTable *zend_std_get_gc(zend_object *zobj, zval **table, int *n) /* ZEND_API HashTable *zend_std_get_debug_info(zend_object *object, int *is_temp) /* {{{ */ { - zend_class_entry *ce = object->ce; + const zend_class_entry *ce = object->ce; zval retval; HashTable *ht; @@ -334,7 +333,7 @@ static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property( zend_error(E_DEPRECATED, "Creation of dynamic property %s::$%s is deprecated", ZSTR_VAL(obj->ce->name), ZSTR_VAL(member)); if (UNEXPECTED(GC_DELREF(obj) == 0)) { - zend_class_entry *ce = obj->ce; + const zend_class_entry *ce = obj->ce; zend_objects_store_del(obj); if (!EG(exception)) { /* We cannot continue execution and have to throw an exception */ @@ -347,7 +346,7 @@ static ZEND_COLD zend_never_inline bool zend_deprecated_dynamic_property( } static ZEND_COLD zend_never_inline void zend_readonly_property_unset_error( - zend_class_entry *ce, zend_string *member) { + const zend_class_entry *ce, const zend_string *member) { zend_throw_error(NULL, "Cannot unset readonly property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(member)); } @@ -711,7 +710,7 @@ static bool zend_should_call_hook(const zend_property_info *prop_info, const zen return true; } -static ZEND_COLD void zend_throw_no_prop_backing_value_access(zend_string *class_name, zend_string *prop_name, bool is_read) +static ZEND_COLD void zend_throw_no_prop_backing_value_access(const zend_string *class_name, const zend_string *prop_name, bool is_read) { zend_throw_error(NULL, "Must not %s virtual property %s::$%s", is_read ? "read from" : "write to", @@ -719,7 +718,7 @@ static ZEND_COLD void zend_throw_no_prop_backing_value_access(zend_string *class } static bool zend_call_get_hook( - const zend_property_info *prop_info, zend_string *prop_name, + const zend_property_info *prop_info, const zend_string *prop_name, zend_function *get, zend_object *zobj, zval *rv) { if (!zend_should_call_hook(prop_info, zobj)) { @@ -842,7 +841,7 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int goto exit; } - zend_class_entry *ce = zobj->ce; + const zend_class_entry *ce = zobj->ce; if (!zend_call_get_hook(prop_info, name, get, zobj, rv)) { if (EG(exception)) { @@ -850,7 +849,7 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int } /* Reads from backing store can only occur in hooks, and hence will always remain simple. */ - zend_execute_data *execute_data = EG(current_execute_data); + const zend_execute_data *execute_data = EG(current_execute_data); if (cache_slot && EX(opline) && EX(opline)->opcode == ZEND_FETCH_OBJ_R && EX(opline)->op1_type == IS_UNUSED) { ZEND_SET_PROPERTY_HOOK_SIMPLE_READ(cache_slot); } @@ -1274,7 +1273,7 @@ found:; } /* }}} */ -static ZEND_COLD zend_never_inline void zend_bad_array_access(zend_class_entry *ce) /* {{{ */ +static ZEND_COLD zend_never_inline void zend_bad_array_access(const zend_class_entry *ce) /* {{{ */ { zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name)); } @@ -1282,7 +1281,7 @@ static ZEND_COLD zend_never_inline void zend_bad_array_access(zend_class_entry * ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv) /* {{{ */ { - zend_class_entry *ce = object->ce; + const zend_class_entry *ce = object->ce; zval tmp_offset; /* arrayaccess_funcs_ptr is set if (and only if) the class implements zend_ce_arrayaccess */ @@ -1333,7 +1332,7 @@ ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int ty ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval *value) /* {{{ */ { - zend_class_entry *ce = object->ce; + const zend_class_entry *ce = object->ce; zval tmp_offset; zend_class_arrayaccess_funcs *funcs = ce->arrayaccess_funcs_ptr; @@ -1356,7 +1355,7 @@ ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval * // todo: make zend_std_has_dimension return bool as well ZEND_API int zend_std_has_dimension(zend_object *object, zval *offset, int check_empty) /* {{{ */ { - zend_class_entry *ce = object->ce; + const zend_class_entry *ce = object->ce; zval retval, tmp_offset; bool result; @@ -1610,7 +1609,7 @@ ZEND_API void zend_std_unset_property(zend_object *zobj, zend_string *name, void ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset) /* {{{ */ { - zend_class_entry *ce = object->ce; + const zend_class_entry *ce = object->ce; zval tmp_offset; zend_class_arrayaccess_funcs *funcs = ce->arrayaccess_funcs_ptr; @@ -1626,7 +1625,7 @@ ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset) /* {{{ } /* }}} */ -static zend_never_inline zend_function *zend_get_parent_private_method(zend_class_entry *scope, zend_class_entry *ce, zend_string *function_name) /* {{{ */ +static zend_never_inline zend_function *zend_get_parent_private_method(const zend_class_entry *scope, const zend_class_entry *ce, zend_string *function_name) /* {{{ */ { zval *func; zend_function *fbc; @@ -1747,7 +1746,7 @@ static ZEND_FUNCTION(zend_parent_hook_get_trampoline) } zval rv; - zval *retval = obj->handlers->read_property(obj, prop_name, BP_VAR_R, NULL, &rv); + const zval *retval = obj->handlers->read_property(obj, prop_name, BP_VAR_R, NULL, &rv); if (retval == &rv) { RETVAL_COPY_VALUE(retval); } else { @@ -1846,7 +1845,6 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * zval *func; zend_function *fbc; zend_string *lc_method_name; - zend_class_entry *scope; ALLOCA_FLAG(use_heap); if (EXPECTED(key != NULL)) { @@ -1874,7 +1872,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string * /* Check access level */ if (fbc->op_array.fn_flags & (ZEND_ACC_CHANGED|ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) { - scope = zend_get_executed_scope(); + const zend_class_entry *scope = zend_get_executed_scope(); if (fbc->common.scope != scope) { if (fbc->op_array.fn_flags & ZEND_ACC_CHANGED) { @@ -1930,7 +1928,7 @@ static zend_always_inline zend_function *get_static_method_fallback( } } -ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name, const zval *key) /* {{{ */ +ZEND_API zend_function *zend_std_get_static_method(const zend_class_entry *ce, zend_string *function_name, const zval *key) /* {{{ */ { zend_string *lc_function_name; if (EXPECTED(key != NULL)) { @@ -1944,7 +1942,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st if (EXPECTED(func)) { fbc = Z_FUNC_P(func); if (!(fbc->common.fn_flags & ZEND_ACC_PUBLIC)) { - zend_class_entry *scope = zend_get_executed_scope(); + const zend_class_entry *scope = zend_get_executed_scope(); ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_PUBLIC)); if (!zend_check_method_accessible(fbc, scope)) { zend_function *fallback_fbc = get_static_method_fallback(ce, function_name); @@ -2442,7 +2440,7 @@ ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *w { switch (type) { case IS_STRING: { - zend_class_entry *ce = readobj->ce; + const zend_class_entry *ce = readobj->ce; if (ce->__tostring) { zval retval; GC_ADDREF(readobj); @@ -2475,7 +2473,7 @@ ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *w ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */ { zend_class_entry *ce = obj->ce; - zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE)); + const zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE)); if (func == NULL) { return FAILURE; diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 238d9539a7d5a..59277c09d8024 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -248,7 +248,7 @@ extern const ZEND_API zend_object_handlers std_object_handlers; #define ZEND_PROPERTY_EXISTS 0x2 /* Property exists */ ZEND_API void zend_class_init_statics(zend_class_entry *ce); -ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key); +ZEND_API zend_function *zend_std_get_static_method(const zend_class_entry *ce, zend_string *function_name_strval, const zval *key); ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info); ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type); ZEND_API ZEND_COLD bool zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name); From 55d449fca4c63dc877d599df35ef35fae456aa03 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 20:01:04 +0000 Subject: [PATCH 311/386] Zend: remove zend_set_hash_symbol() API (#20413) This is unused both within php-src and a SourceGraph search returned 0 results. This is also confusing as it talks about symbol tables without actually using any of the corresponding update functions. --- UPGRADING.INTERNALS | 1 + Zend/zend_API.c | 23 ----------------------- Zend/zend_API.h | 2 -- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 385ad0445cc99..57cae9aa04724 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -43,6 +43,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES pointer. . The zend_get_call_trampoline_func() API now takes the __call or __callStatic zend_function* instead of a CE and a boolean argument. + . The zend_set_hash_symbol() API has been removed. ======================== 2. Build system changes diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 89ffe419cd6e4..097a27452196e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3611,29 +3611,6 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_ } /* }}} */ -// TODO num_symbol_tables as unsigned int? -ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...) /* {{{ */ -{ - HashTable *symbol_table; - va_list symbol_table_list; - - if (num_symbol_tables <= 0) return FAILURE; - - if (is_ref) { - ZVAL_MAKE_REF(symbol); - } - - va_start(symbol_table_list, num_symbol_tables); - while (num_symbol_tables-- > 0) { - symbol_table = va_arg(symbol_table_list, HashTable *); - zend_hash_str_update(symbol_table, name, name_length, symbol); - Z_TRY_ADDREF_P(symbol); - } - va_end(symbol_table_list); - return SUCCESS; -} -/* }}} */ - /* Disabled functions support */ static void zend_disable_function(const char *function_name, size_t function_name_length) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d8ad9edabf5bb..eba5ef8c8a08e 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -884,8 +884,6 @@ ZEND_API zend_result zend_call_method_if_exists( zend_object *object, zend_string *method_name, zval *retval, uint32_t param_count, zval *params); -ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...); - ZEND_API zend_result zend_delete_global_variable(zend_string *name); ZEND_API zend_array *zend_rebuild_symbol_table(void); From d9dea1a5b2d26d45b83e44c0df56e327ca7bf7e9 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 20:42:34 +0000 Subject: [PATCH 312/386] ext/snmp: remove unused header include Smart strings are not in use in this file --- ext/snmp/snmp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index db2d0ad87867e..0ff8d41c1e6ce 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -34,7 +34,6 @@ #include "php_snmp.h" #include "zend_exceptions.h" -#include "zend_smart_string.h" #include "ext/spl/spl_exceptions.h" #ifdef HAVE_SNMP From fe74aa1a9a9d1d8ad64666955cf676eb7075b1c6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 02:58:42 +0000 Subject: [PATCH 313/386] zend_API.c: rename variable to prevent variable shadowing --- Zend/zend_API.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 097a27452196e..9e25ddb495b21 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3733,14 +3733,14 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc ret = true; } } else if ((ce = zend_lookup_class(name)) != NULL) { - zend_class_entry *scope = get_scope(frame); + zend_class_entry *frame_scope = get_scope(frame); fcc->calling_scope = ce; - if (scope && !fcc->object) { + if (frame_scope && !fcc->object) { zend_object *object = zend_get_this_object(frame); if (object && - instanceof_function(object->ce, scope) && - instanceof_function(scope, ce)) { + instanceof_function(object->ce, frame_scope) && + instanceof_function(frame_scope, ce)) { fcc->object = object; fcc->called_scope = object->ce; } else { From ccda8b16d4bdb5ca129f233663ea1088e1053287 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 02:58:00 +0000 Subject: [PATCH 314/386] zend_API.c: add const qualifiers --- Zend/zend.h | 2 +- Zend/zend_API.c | 68 ++++++++++++++++++++++++------------------------- Zend/zend_API.h | 38 +++++++++++++-------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index aff48ca0e2068..8957241ccfb37 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -442,7 +442,7 @@ typedef struct { BEGIN_EXTERN_C() ZEND_API void zend_save_error_handling(zend_error_handling *current); ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current); -ZEND_API void zend_restore_error_handling(zend_error_handling *saved); +ZEND_API void zend_restore_error_handling(const zend_error_handling *saved); ZEND_API void zend_begin_record_errors(void); ZEND_API void zend_emit_recorded_errors(void); ZEND_API void zend_emit_recorded_errors_ex(uint32_t num_errors, zend_error_info **errors); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 9e25ddb495b21..4a08952677627 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -85,7 +85,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */ } /* }}} */ -ZEND_API ZEND_COLD void zend_wrong_property_read(zval *object, zval *property) +ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *property) { zend_string *tmp_property_name; zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); @@ -225,7 +225,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, uint32_t num, char *name, zend_expected_type expected_type, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, uint32_t num, char *name, zend_expected_type expected_type, const zval *arg) /* {{{ */ { switch (error_code) { case ZPP_ERROR_WRONG_CALLBACK: @@ -266,7 +266,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, const zval *arg) /* {{{ */ { static const char * const expected_error[] = { Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR) @@ -287,7 +287,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t n } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -297,7 +297,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -307,7 +307,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(u } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -317,7 +317,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(u } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -327,7 +327,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -337,7 +337,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error } /* }}} */ -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, const zval *arg) /* {{{ */ { if (EG(exception)) { return; @@ -1374,7 +1374,7 @@ ZEND_API zend_result zend_parse_method_parameters_ex(int flags, uint32_t num_arg /* This function should be called after the constructor has been called * because it may call __set from the uninitialized object otherwise. */ -ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */ +ZEND_API void zend_merge_properties(const zval *obj, const HashTable *properties) /* {{{ */ { zend_object *zobj = Z_OBJ_P(obj); zend_object_write_property_t write_property = zobj->handlers->write_property; @@ -1396,7 +1396,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */ } /* }}} */ -static zend_class_mutable_data *zend_allocate_mutable_data(zend_class_entry *class_type) /* {{{ */ +static zend_class_mutable_data *zend_allocate_mutable_data(const zend_class_entry *class_type) /* {{{ */ { zend_class_mutable_data *mutable_data; @@ -1412,7 +1412,7 @@ static zend_class_mutable_data *zend_allocate_mutable_data(zend_class_entry *cla } /* }}} */ -ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_type) /* {{{ */ +ZEND_API HashTable *zend_separate_class_constants_table(const zend_class_entry *class_type) /* {{{ */ { zend_class_mutable_data *mutable_data; HashTable *constants_table; @@ -1452,7 +1452,7 @@ ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_ return constants_table; } -static zend_result update_property(zval *val, zend_property_info *prop_info) { +static zend_result update_property(zval *val, const zend_property_info *prop_info) { if (ZEND_TYPE_IS_SET(prop_info->type)) { zval tmp; @@ -1713,7 +1713,7 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti } /* }}} */ -ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */ +ZEND_API void object_properties_load(zend_object *object, const HashTable *properties) /* {{{ */ { zval *prop, tmp; zend_string *key; @@ -2769,7 +2769,7 @@ static void zend_check_magic_method_no_return_type( } } -ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type) /* {{{ */ +ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, const zend_string *lcname, int error_type) /* {{{ */ { if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') { @@ -2866,7 +2866,7 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, } /* }}} */ -ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, zend_string *lcname) +ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, const zend_string *lcname) { if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') { /* pass */ @@ -3283,7 +3283,7 @@ static void clean_module_classes(int module_number) /* {{{ */ /* Child classes may reuse structures from parent classes, so destroy in reverse order. */ Bucket *bucket; ZEND_HASH_REVERSE_FOREACH_BUCKET(EG(class_table), bucket) { - zend_class_entry *ce = Z_CE(bucket->val); + const zend_class_entry *ce = Z_CE(bucket->val); if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { zend_hash_del_bucket(EG(class_table), bucket); } @@ -3294,8 +3294,8 @@ static void clean_module_classes(int module_number) /* {{{ */ static int clean_module_function(zval *el, void *arg) /* {{{ */ { - zend_function *fe = (zend_function *) Z_PTR_P(el); - zend_module_entry *module = (zend_module_entry *) arg; + const zend_function *fe = (zend_function *) Z_PTR_P(el); + const zend_module_entry *module = arg; if (fe->common.type == ZEND_INTERNAL_FUNCTION && fe->internal_function.module == module) { return ZEND_HASH_APPLY_REMOVE; } else { @@ -3383,7 +3383,7 @@ ZEND_API void zend_activate_modules(void) /* {{{ */ zend_module_entry **p = module_request_startup_handlers; while (*p) { - zend_module_entry *module = *p; + const zend_module_entry *module = *p; if (module->request_startup_func(module->type, module->module_number)==FAILURE) { zend_error(E_WARNING, "request_startup() for %s module failed", module->name); @@ -3412,7 +3412,7 @@ ZEND_API void zend_deactivate_modules(void) /* {{{ */ zend_module_entry **p = module_request_shutdown_handlers; while (*p) { - zend_module_entry *module = *p; + const zend_module_entry *module = *p; zend_try { module->request_shutdown_func(module->type, module->module_number); } zend_end_try(); @@ -3461,7 +3461,7 @@ ZEND_API void zend_post_deactivate_modules(void) /* {{{ */ zend_module_entry **p = module_post_deactivate_handlers; while (*p) { - zend_module_entry *module = *p; + const zend_module_entry *module = *p; module->post_deactivate_func(); p++; @@ -3477,7 +3477,7 @@ ZEND_API int zend_next_free_module(void) /* {{{ */ } /* }}} */ -static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, uint32_t ce_flags) /* {{{ */ +static zend_class_entry *do_register_internal_class(const zend_class_entry *orig_class_entry, uint32_t ce_flags) /* {{{ */ { zend_class_entry *class_entry = malloc(sizeof(zend_class_entry)); zend_string *lowercase_name; @@ -3513,14 +3513,14 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class * If both parent_ce and parent_name are NULL it does a regular class registration * If parent_name is specified but not found NULL is returned */ -ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce) /* {{{ */ +ZEND_API zend_class_entry *zend_register_internal_class_ex(const zend_class_entry *class_entry, zend_class_entry *parent_ce) /* {{{ */ { return zend_register_internal_class_with_flags(class_entry, parent_ce, 0); } /* }}} */ ZEND_API zend_class_entry *zend_register_internal_class_with_flags( - zend_class_entry *class_entry, + const zend_class_entry *class_entry, zend_class_entry *parent_ce, uint32_t ce_flags ) { @@ -3558,13 +3558,13 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry, int num_inter /* A class that contains at least one abstract method automatically becomes an abstract class. */ -ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry) /* {{{ */ +ZEND_API zend_class_entry *zend_register_internal_class(const zend_class_entry *orig_class_entry) /* {{{ */ { return do_register_internal_class(orig_class_entry, 0); } /* }}} */ -ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry) /* {{{ */ +ZEND_API zend_class_entry *zend_register_internal_interface(const zend_class_entry *orig_class_entry) /* {{{ */ { return do_register_internal_class(orig_class_entry, ZEND_ACC_INTERFACE); } @@ -3733,7 +3733,7 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc ret = true; } } else if ((ce = zend_lookup_class(name)) != NULL) { - zend_class_entry *frame_scope = get_scope(frame); + const zend_class_entry *frame_scope = get_scope(frame); fcc->calling_scope = ce; if (frame_scope && !fcc->object) { zend_object *object = zend_get_this_object(frame); @@ -3770,7 +3770,7 @@ ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc) { } } -static zend_always_inline bool zend_is_callable_check_func(zval *callable, const zend_execute_data *frame, zend_fcall_info_cache *fcc, bool strict_class, char **error, bool suppress_deprecation) /* {{{ */ +static zend_always_inline bool zend_is_callable_check_func(const zval *callable, const zend_execute_data *frame, zend_fcall_info_cache *fcc, bool strict_class, char **error, bool suppress_deprecation) /* {{{ */ { zend_class_entry *ce_org = fcc->calling_scope; bool retval = false; @@ -4028,8 +4028,8 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_objec case IS_ARRAY: { - zval *method = NULL; - zval *obj = NULL; + const zval *method = NULL; + const zval *obj = NULL; if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) { obj = zend_hash_index_find_deref(Z_ARRVAL_P(callable), 0); @@ -4081,7 +4081,7 @@ ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */ /* }}} */ ZEND_API bool zend_is_callable_at_frame( - zval *callable, zend_object *object, const zend_execute_data *frame, + const zval *callable, zend_object *object, const zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error) /* {{{ */ { bool ret; @@ -4402,7 +4402,7 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */ } /* }}} */ -static zend_always_inline bool is_persistent_class(zend_class_entry *ce) { +static zend_always_inline bool is_persistent_class(const zend_class_entry *ce) { return (ce->type & ZEND_INTERNAL_CLASS) && ce->info.internal.module->type == MODULE_PERSISTENT; } @@ -5154,7 +5154,7 @@ ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, } /* }}} */ -ZEND_API void zend_restore_error_handling(zend_error_handling *saved) /* {{{ */ +ZEND_API void zend_restore_error_handling(const zend_error_handling *saved) /* {{{ */ { EG(error_handling) = saved->handling; EG(exception_class) = saved->exception; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index eba5ef8c8a08e..e6d5a024cf61b 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -384,13 +384,13 @@ ZEND_API void zend_startup_modules(void); ZEND_API void zend_collect_module_handlers(void); ZEND_API void zend_destroy_modules(void); ZEND_API void zend_check_magic_method_implementation( - const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type); -ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, zend_string *lcname); + const zend_class_entry *ce, const zend_function *fptr, const zend_string *lcname, int error_type); +ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, const zend_string *lcname); -ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry); -ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce); -ZEND_API zend_class_entry *zend_register_internal_class_with_flags(zend_class_entry *class_entry, zend_class_entry *parent_ce, uint32_t flags); -ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry); +ZEND_API zend_class_entry *zend_register_internal_class(const zend_class_entry *class_entry); +ZEND_API zend_class_entry *zend_register_internal_class_ex(const zend_class_entry *class_entry, zend_class_entry *parent_ce); +ZEND_API zend_class_entry *zend_register_internal_class_with_flags(const zend_class_entry *class_entry, zend_class_entry *parent_ce, uint32_t flags); +ZEND_API zend_class_entry *zend_register_internal_interface(const zend_class_entry *orig_class_entry); ZEND_API void zend_class_implements(zend_class_entry *class_entry, int num_interfaces, ...); ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce, bool persistent); @@ -404,7 +404,7 @@ static zend_always_inline zend_result zend_register_class_alias(const char *name ZEND_API void zend_disable_functions(const char *function_list); ZEND_API ZEND_COLD void zend_wrong_param_count(void); -ZEND_API ZEND_COLD void zend_wrong_property_read(zval *object, zval *property); +ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *property); #define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0) #define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1) @@ -413,7 +413,7 @@ ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object); ZEND_API zend_string *zend_get_callable_name(zval *callable); ZEND_API bool zend_is_callable_at_frame( - zval *callable, zend_object *object, const zend_execute_data *frame, + const zval *callable, zend_object *object, const zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); @@ -443,7 +443,7 @@ ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const cha ZEND_API zend_result zend_update_class_constant(zend_class_constant *c, const zend_string *name, zend_class_entry *scope); ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type); -ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_type); +ZEND_API HashTable *zend_separate_class_constants_table(const zend_class_entry *class_type); static zend_always_inline HashTable *zend_class_constants_table(zend_class_entry *ce) { if ((ce->ce_flags & ZEND_ACC_HAS_AST_CONSTANTS) && ZEND_MAP_PTR(ce->mutable_data)) { @@ -539,9 +539,9 @@ ZEND_API zend_result object_init_with_constructor(zval *arg, zend_class_entry *c ZEND_API zend_result object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties); ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type); ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties); -ZEND_API void object_properties_load(zend_object *object, HashTable *properties); +ZEND_API void object_properties_load(zend_object *object, const HashTable *properties); -ZEND_API void zend_merge_properties(zval *obj, HashTable *properties); +ZEND_API void zend_merge_properties(const zval *obj, const HashTable *properties); ZEND_API void add_assoc_long_ex(zval *arg, const char *key, size_t key_len, zend_long n); ZEND_API void add_assoc_null_ex(zval *arg, const char *key, size_t key_len); @@ -1546,14 +1546,14 @@ typedef enum _zend_expected_type { ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, uint32_t num, char *name, zend_expected_type expected_type, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(uint32_t num, const char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null_error(uint32_t num, const char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, uint32_t num, char *name, zend_expected_type expected_type, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(uint32_t num, const char *name, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null_error(uint32_t num, const char *name, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, const zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, const zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, char *error); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_or_null_error(uint32_t num, char *error); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void); From 5ab594cf01c31b1ae89c0a3a584100a1d0798dab Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 21:21:54 +0000 Subject: [PATCH 315/386] Optimize smart_str_append_scalar() for true/false There is no point in having both cases together just to branch on them again to figure out what to print. --- Zend/zend_smart_str.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c index 501f6e6176c8b..c779ee5c97cab 100644 --- a/Zend/zend_smart_str.c +++ b/Zend/zend_smart_str.c @@ -208,8 +208,11 @@ ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *dest, const zval break; case IS_TRUE: + smart_str_appendl(dest, "true", sizeof("true")-1); + break; + case IS_FALSE: - smart_str_appends(dest, Z_TYPE_P(value) == IS_TRUE ? "true" : "false"); + smart_str_appendl(dest, "false", sizeof("false")-1); break; case IS_DOUBLE: From 0af87e970323e9a0ef282d0e752d90db9a260f13 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 2 Nov 2025 11:32:33 +0100 Subject: [PATCH 316/386] Improve performance of intval('+0b...', 2) and intval('0b...', 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For this benchmark: ```php Date: Fri, 7 Nov 2025 23:57:47 +0100 Subject: [PATCH 317/386] standard: Avoid double hash table lookup in iptcparse() Closes GH-20420. --- UPGRADING.INTERNALS | 1 + Zend/zend_hash.c | 7 +++++++ Zend/zend_hash.h | 1 + ext/standard/iptc.c | 8 +++----- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 57cae9aa04724..88df8f6edb2f5 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -44,6 +44,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The zend_get_call_trampoline_func() API now takes the __call or __callStatic zend_function* instead of a CE and a boolean argument. . The zend_set_hash_symbol() API has been removed. + . Added zend_hash_str_lookup(). ======================== 2. Build system changes diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 6064b42218327..c00397e9fe9e3 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -1062,6 +1062,13 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_new(HashTable *ht, const char *st return _zend_hash_str_add_or_update_i(ht, str, len, h, pData, HASH_ADD_NEW); } +ZEND_API zval* ZEND_FASTCALL zend_hash_str_lookup(HashTable *ht, const char *str, size_t len) +{ + zend_ulong h = zend_hash_func(str, len); + + return _zend_hash_str_add_or_update_i(ht, str, len, h, NULL, HASH_LOOKUP); +} + ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h) { zval dummy; diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 3a501b7f37df1..70d9721cb7a17 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -218,6 +218,7 @@ static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_stri /* Find or add NULL, if doesn't exist */ ZEND_API zval* ZEND_FASTCALL zend_hash_lookup(HashTable *ht, zend_string *key); ZEND_API zval* ZEND_FASTCALL zend_hash_index_lookup(HashTable *ht, zend_ulong h); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_lookup(HashTable *ht, const char *str, size_t len); #define ZEND_HASH_INDEX_LOOKUP(_ht, _h, _ret) do { \ if (EXPECTED(HT_IS_PACKED(_ht))) { \ diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 44dd33bab10ac..5078c0813ccb8 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -308,7 +308,6 @@ PHP_FUNCTION(iptcparse) unsigned char *buffer, recnum, dataset; char *str, key[16]; size_t str_len; - zval values, *element; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STRING(str, str_len) @@ -357,10 +356,9 @@ PHP_FUNCTION(iptcparse) array_init(return_value); } - if ((element = zend_hash_str_find(Z_ARRVAL_P(return_value), key, strlen(key))) == NULL) { - array_init(&values); - - element = zend_hash_str_update(Z_ARRVAL_P(return_value), key, strlen(key), &values); + zval *element = zend_hash_str_lookup(Z_ARRVAL_P(return_value), key, strlen(key)); + if (Z_ISNULL_P(element)) { + array_init(element); } add_next_index_stringl(element, (char *) buffer+inx, len); From 8d44508a4f9cf1ae78f8556fcf66c8717fab692f Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 8 Nov 2025 07:31:38 -0800 Subject: [PATCH 318/386] ext/intl/spoofchecker: remove outdated TODO about documentation (#20425) Documented in php/doc-en#2274 [skip ci] --- ext/intl/spoofchecker/spoofchecker_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index afea503bc0e4b..a4b1ad591fdd6 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -136,7 +136,6 @@ PHP_METHOD(Spoofchecker, setChecks) /* }}} */ #if U_ICU_VERSION_MAJOR_NUM >= 58 -/* TODO Document this method on PHP.net */ /* {{{ Set the loosest restriction level allowed for strings. */ PHP_METHOD(Spoofchecker, setRestrictionLevel) { From bc458e5d08358f58dd4d9ed47220237ed8959fca Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 8 Nov 2025 17:19:55 +0100 Subject: [PATCH 319/386] [ci skip] Remove misleading comment --- ext/standard/array.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 0ef700f14a746..605c21b2012c1 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3869,7 +3869,6 @@ static inline Bucket* find_bucket_at_offset(HashTable* ht, zend_long offset) ZEND_ASSERT(offset >= 0 && offset <= ht->nNumOfElements); if (HT_IS_WITHOUT_HOLES(ht)) { /* There's no need to iterate over the array to filter out holes if there are no holes */ - /* This properly handles both packed and unpacked arrays. */ return ht->arData + offset; } /* Otherwise, this code has to iterate over the HashTable and skip holes in the array. */ @@ -3896,7 +3895,6 @@ static inline zval* find_packed_val_at_offset(HashTable* ht, zend_long offset) ZEND_ASSERT(offset >= 0 && offset <= ht->nNumOfElements); if (HT_IS_WITHOUT_HOLES(ht)) { /* There's no need to iterate over the array to filter out holes if there are no holes */ - /* This properly handles both packed and unpacked arrays. */ return ht->arPacked + offset; } /* Otherwise, this code has to iterate over the HashTable and skip holes in the array. */ From cf961531534cb44cb000d99acb640a014901bae7 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sat, 8 Nov 2025 17:26:21 +0000 Subject: [PATCH 320/386] main.c: do not use printf variant if not needed (#20418) --- main/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/main/main.c b/main/main.c index e33ef29d61bb7..6d29d3462b517 100644 --- a/main/main.c +++ b/main/main.c @@ -127,8 +127,8 @@ PHPAPI char *php_get_version(sapi_module_struct *sapi_module) { smart_string version_info = {0}; smart_string_append_printf(&version_info, - "PHP %s (%s) (built: %s) (%s)\n", - PHP_VERSION, sapi_module->name, php_build_date, + "PHP " PHP_VERSION " (%s) (built: %s) (%s)\n", + sapi_module->name, php_build_date, #ifdef ZTS "ZTS" #else @@ -148,8 +148,12 @@ PHPAPI char *php_get_version(sapi_module_struct *sapi_module) #endif ); smart_string_appends(&version_info, "Copyright (c) The PHP Group\n"); - if (php_build_provider()) { - smart_string_append_printf(&version_info, "Built by %s\n", php_build_provider()); + + const char *build_provider = php_build_provider(); + if (build_provider) { + smart_string_appends(&version_info, "Built by "); + smart_string_appends(&version_info, build_provider); + smart_string_appendc(&version_info, '\n'); } smart_string_appends(&version_info, get_zend_version()); smart_string_0(&version_info); @@ -160,7 +164,7 @@ PHPAPI char *php_get_version(sapi_module_struct *sapi_module) PHPAPI void php_print_version(sapi_module_struct *sapi_module) { char *version_info = php_get_version(sapi_module); - php_printf("%s", version_info); + PHPWRITE(version_info, strlen(version_info)); efree(version_info); } From a09cc6ede6a3ff2afaf283d0a87bf99dcfa57338 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 8 Nov 2025 23:02:00 +0100 Subject: [PATCH 321/386] standard: Optimize str_split() (#20419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three optimizations: - If the entire string is returned, we don't need to duplicate it. - Use packed filling logic. - Use fast construction of strings. This is useful when splitting strings on length=1. In that case I get a 6x speedup in the code below. Bench: ```php $x = str_repeat('A', 100); for ($i = 0; $i < 1000000; $i++) str_split($x, 10); ``` On an i7-4790: ``` Benchmark 1: ./sapi/cli/php x.php Time (mean ± σ): 160.1 ms ± 6.4 ms [User: 157.3 ms, System: 1.8 ms] Range (min … max): 155.6 ms … 184.7 ms 18 runs Benchmark 2: ./sapi/cli/php_old x.php Time (mean ± σ): 202.6 ms ± 4.0 ms [User: 199.1 ms, System: 1.9 ms] Range (min … max): 197.4 ms … 209.2 ms 14 runs Summary ./sapi/cli/php x.php ran 1.27 ± 0.06 times faster than ./sapi/cli/php_old x.php ``` The performance gain increases with smaller lengths. --- UPGRADING | 1 + ext/standard/string.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/UPGRADING b/UPGRADING index ddef86c1ae373..5da76d924fbf8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -128,3 +128,4 @@ PHP 8.6 UPGRADE NOTES . Improved performance of array_unshift(). . Improved performance of array_walk(). . Improved performance of intval('+0b...', 2) and intval('0b...', 2). + . Improved performance of str_split(). diff --git a/ext/standard/string.c b/ext/standard/string.c index 6fb39c5a6bd24..ddf4221bf6edb 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6152,23 +6152,31 @@ PHP_FUNCTION(str_split) } array_init_size(return_value, 1); - add_next_index_stringl(return_value, ZSTR_VAL(str), ZSTR_LEN(str)); + GC_TRY_ADDREF(str); + add_next_index_str(return_value, str); return; } array_init_size(return_value, (uint32_t)(((ZSTR_LEN(str) - 1) / split_length) + 1)); + zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); n_reg_segments = ZSTR_LEN(str) / split_length; p = ZSTR_VAL(str); - while (n_reg_segments-- > 0) { - add_next_index_stringl(return_value, p, split_length); - p += split_length; - } + ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) { + zval zv; + while (n_reg_segments-- > 0) { + ZEND_ASSERT(split_length > 0); + ZVAL_STRINGL_FAST(&zv, p, split_length); + ZEND_HASH_FILL_ADD(&zv); + p += split_length; + } - if (p != (ZSTR_VAL(str) + ZSTR_LEN(str))) { - add_next_index_stringl(return_value, p, (ZSTR_VAL(str) + ZSTR_LEN(str) - p)); - } + if (p != (ZSTR_VAL(str) + ZSTR_LEN(str))) { + ZVAL_STRINGL_FAST(&zv, p, (ZSTR_VAL(str) + ZSTR_LEN(str) - p)); + ZEND_HASH_FILL_ADD(&zv); + } + } ZEND_HASH_FILL_END(); } /* }}} */ From f4c3097059a1ba108aebd9b035f5bf1e8c69f7a7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:14:50 +0100 Subject: [PATCH 322/386] array_map: Avoid needing refcounted copies and cleanup Since this will be copied on the call frame, a refcounted copy is not necessary. --- ext/standard/array.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index a3f85337df988..539fb5faf8b86 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6928,7 +6928,7 @@ PHP_FUNCTION(array_map) ZVAL_NULL(¶ms[i]); break; } else if (Z_TYPE(Z_ARRVAL(arrays[i])->arPacked[pos]) != IS_UNDEF) { - ZVAL_COPY(¶ms[i], &Z_ARRVAL(arrays[i])->arPacked[pos]); + ZVAL_COPY_VALUE(¶ms[i], &Z_ARRVAL(arrays[i])->arPacked[pos]); array_pos[i] = pos + 1; break; } @@ -6940,7 +6940,7 @@ PHP_FUNCTION(array_map) ZVAL_NULL(¶ms[i]); break; } else if (Z_TYPE(Z_ARRVAL(arrays[i])->arData[pos].val) != IS_UNDEF) { - ZVAL_COPY(¶ms[i], &Z_ARRVAL(arrays[i])->arData[pos].val); + ZVAL_COPY_VALUE(¶ms[i], &Z_ARRVAL(arrays[i])->arData[pos].val); array_pos[i] = pos + 1; break; } @@ -6960,15 +6960,8 @@ PHP_FUNCTION(array_map) if (Z_TYPE(result) == IS_UNDEF) { efree(array_pos); zend_array_destroy(Z_ARR_P(return_value)); - for (i = 0; i < n_arrays; i++) { - zval_ptr_dtor(¶ms[i]); - } efree(params); RETURN_NULL(); - } else { - for (i = 0; i < n_arrays; i++) { - zval_ptr_dtor(¶ms[i]); - } } zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &result); From 080cf1026816289c3876b16848709bc157794097 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:17:12 +0100 Subject: [PATCH 323/386] array_map: Move fci configuration outside of loop --- ext/standard/array.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 539fb5faf8b86..89a68567075e2 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6916,6 +6916,10 @@ PHP_FUNCTION(array_map) } else { zval *params = (zval *)safe_emalloc(n_arrays, sizeof(zval), 0); + fci.retval = &result; + fci.param_count = n_arrays; + fci.params = params; + /* We iterate through all the arrays at once. */ for (k = 0; k < maxlen; k++) { for (i = 0; i < n_arrays; i++) { @@ -6949,10 +6953,6 @@ PHP_FUNCTION(array_map) } } - fci.retval = &result; - fci.param_count = n_arrays; - fci.params = params; - zend_result ret = zend_call_function(&fci, &fci_cache); ZEND_ASSERT(ret == SUCCESS); ZEND_IGNORE_VALUE(ret); From 9bf1240d9f68472e290e321424446013b8e92ef5 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:18:09 +0100 Subject: [PATCH 324/386] array_map: Delay allocation of array_pos --- ext/standard/array.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 89a68567075e2..2bc397280431e 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6854,12 +6854,9 @@ PHP_FUNCTION(array_map) } ZEND_HASH_FOREACH_END(); } } else { - uint32_t *array_pos = (HashPosition *)ecalloc(n_arrays, sizeof(HashPosition)); - for (i = 0; i < n_arrays; i++) { if (Z_TYPE(arrays[i]) != IS_ARRAY) { zend_argument_type_error(i + 2, "must be of type array, %s given", zend_zval_value_name(&arrays[i])); - efree(array_pos); RETURN_THROWS(); } if (zend_hash_num_elements(Z_ARRVAL(arrays[i])) > maxlen) { @@ -6867,6 +6864,7 @@ PHP_FUNCTION(array_map) } } + uint32_t *array_pos = ecalloc(n_arrays, sizeof(HashPosition)); array_init_size(return_value, maxlen); if (!ZEND_FCI_INITIALIZED(fci)) { From 60a0f107a4240fc0816dfba17277d35a6b3c843e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:24:36 +0100 Subject: [PATCH 325/386] array_map: Rely on VM to clean up in case of an exception This makes the code more compact, and less weird: the stub doesn't indicate that this function can return NULL. --- ext/standard/array.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 2bc397280431e..ec73cc163dc50 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6819,8 +6819,7 @@ PHP_FUNCTION(array_map) ZEND_IGNORE_VALUE(ret); if (UNEXPECTED(Z_ISUNDEF(result))) { ZEND_HASH_FILL_FINISH(); - zend_array_destroy(output); - RETURN_NULL(); + RETURN_THROWS(); } } else { ZVAL_UNDEF(&result); @@ -6843,8 +6842,7 @@ PHP_FUNCTION(array_map) ZEND_ASSERT(ret == SUCCESS); ZEND_IGNORE_VALUE(ret); if (UNEXPECTED(Z_ISUNDEF(result))) { - zend_array_destroy(output); - RETURN_NULL(); + RETURN_THROWS(); } if (str_key) { _zend_hash_append(output, str_key, &result); @@ -6957,9 +6955,8 @@ PHP_FUNCTION(array_map) if (Z_TYPE(result) == IS_UNDEF) { efree(array_pos); - zend_array_destroy(Z_ARR_P(return_value)); efree(params); - RETURN_NULL(); + RETURN_THROWS(); } zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &result); From 79adb01bfcab91d26b521737a5fb359994c7b3cb Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:25:04 +0100 Subject: [PATCH 326/386] array_map: Avoid allocation by using Z_EXTRA storage of parameters --- ext/standard/array.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index ec73cc163dc50..3a782ec1ea40c 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6773,11 +6773,11 @@ PHP_FUNCTION(array_all) PHP_FUNCTION(array_map) { zval *arrays = NULL; - int n_arrays = 0; + uint32_t n_arrays = 0; zval result; zend_fcall_info fci; zend_fcall_info_cache fci_cache; - int i; + uint32_t i; uint32_t k, maxlen = 0; ZEND_PARSE_PARAMETERS_START(2, -1) @@ -6862,10 +6862,10 @@ PHP_FUNCTION(array_map) } } - uint32_t *array_pos = ecalloc(n_arrays, sizeof(HashPosition)); array_init_size(return_value, maxlen); if (!ZEND_FCI_INITIALIZED(fci)) { + uint32_t *array_pos = ecalloc(n_arrays, sizeof(HashPosition)); zval zv; /* We iterate through all the arrays at once. */ @@ -6909,9 +6909,16 @@ PHP_FUNCTION(array_map) zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &result); } + + efree(array_pos); } else { zval *params = (zval *)safe_emalloc(n_arrays, sizeof(zval), 0); + /* Remember next starting point in the array, initialize those as zeros. */ + for (i = 0; i < n_arrays; i++) { + Z_EXTRA(params[i]) = 0; + } + fci.retval = &result; fci.param_count = n_arrays; fci.params = params; @@ -6921,7 +6928,7 @@ PHP_FUNCTION(array_map) for (i = 0; i < n_arrays; i++) { /* If this array still has elements, add the current one to the * parameter list, otherwise use null value. */ - uint32_t pos = array_pos[i]; + uint32_t pos = Z_EXTRA(params[i]); if (HT_IS_PACKED(Z_ARRVAL(arrays[i]))) { while (1) { if (pos >= Z_ARRVAL(arrays[i])->nNumUsed) { @@ -6929,7 +6936,7 @@ PHP_FUNCTION(array_map) break; } else if (Z_TYPE(Z_ARRVAL(arrays[i])->arPacked[pos]) != IS_UNDEF) { ZVAL_COPY_VALUE(¶ms[i], &Z_ARRVAL(arrays[i])->arPacked[pos]); - array_pos[i] = pos + 1; + Z_EXTRA(params[i]) = pos + 1; break; } pos++; @@ -6941,7 +6948,7 @@ PHP_FUNCTION(array_map) break; } else if (Z_TYPE(Z_ARRVAL(arrays[i])->arData[pos].val) != IS_UNDEF) { ZVAL_COPY_VALUE(¶ms[i], &Z_ARRVAL(arrays[i])->arData[pos].val); - array_pos[i] = pos + 1; + Z_EXTRA(params[i]) = pos + 1; break; } pos++; @@ -6954,7 +6961,6 @@ PHP_FUNCTION(array_map) ZEND_IGNORE_VALUE(ret); if (Z_TYPE(result) == IS_UNDEF) { - efree(array_pos); efree(params); RETURN_THROWS(); } @@ -6964,7 +6970,6 @@ PHP_FUNCTION(array_map) efree(params); } - efree(array_pos); } } /* }}} */ From 7b4270adf0413bf381d2b101dbd548bf34dd1c62 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 8 Nov 2025 18:11:12 +0100 Subject: [PATCH 327/386] Update UPGRADING for array_map() performance --- UPGRADING | 1 + 1 file changed, 1 insertion(+) diff --git a/UPGRADING b/UPGRADING index 5da76d924fbf8..3b0301522d460 100644 --- a/UPGRADING +++ b/UPGRADING @@ -125,6 +125,7 @@ PHP 8.6 UPGRADE NOTES - Standard: . Improved performance of array_fill_keys(). + . Improved performance of array_map() with multiple arrays passed. . Improved performance of array_unshift(). . Improved performance of array_walk(). . Improved performance of intval('+0b...', 2) and intval('0b...', 2). From f765c3632b7f2f81bf5668bd71398a5191b6a393 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 9 Nov 2025 14:36:22 +0100 Subject: [PATCH 328/386] Zend: Remove useless zval & dtor from define() --- Zend/zend_builtin_functions.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index eab2a03990112..b6b69db4bc78d 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -555,7 +555,7 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */ ZEND_FUNCTION(define) { zend_string *name; - zval *val, val_free; + zval *val; bool non_cs = 0; zend_constant c; @@ -575,8 +575,6 @@ ZEND_FUNCTION(define) zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported"); } - ZVAL_UNDEF(&val_free); - if (Z_TYPE_P(val) == IS_ARRAY) { if (Z_REFCOUNTED_P(val)) { if (!validate_constant_array_argument(Z_ARRVAL_P(val), 2)) { @@ -589,7 +587,6 @@ ZEND_FUNCTION(define) } ZVAL_COPY(&c.value, val); - zval_ptr_dtor(&val_free); register_constant: /* non persistent */ From 0d3f9ce5237820d8b954adf04d1d78abc673923b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 9 Nov 2025 14:37:14 +0100 Subject: [PATCH 329/386] Zend: Get rid of goto in define() --- Zend/zend_builtin_functions.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b6b69db4bc78d..ca1a84631b250 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -575,20 +575,16 @@ ZEND_FUNCTION(define) zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported"); } - if (Z_TYPE_P(val) == IS_ARRAY) { - if (Z_REFCOUNTED_P(val)) { - if (!validate_constant_array_argument(Z_ARRVAL_P(val), 2)) { - RETURN_THROWS(); - } else { - copy_constant_array(&c.value, val); - goto register_constant; - } + if (Z_TYPE_P(val) == IS_ARRAY && Z_REFCOUNTED_P(val)) { + if (!validate_constant_array_argument(Z_ARRVAL_P(val), 2)) { + RETURN_THROWS(); + } else { + copy_constant_array(&c.value, val); } + } else { + ZVAL_COPY(&c.value, val); } - ZVAL_COPY(&c.value, val); - -register_constant: /* non persistent */ ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT); c.name = zend_string_copy(name); From e97c0dc340be7387498b92b182b9356b960a3bd0 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 9 Nov 2025 21:57:25 +0000 Subject: [PATCH 330/386] ext/intl: migrate C to C++ code step 5. (#20424) --- .../{common_error.c => common_error.cpp} | 14 +++++----- ext/intl/config.m4 | 18 ++++++------- ext/intl/config.w32 | 18 ++++++------- ...ateformat_class.c => dateformat_class.cpp} | 6 +++-- ext/intl/dateformat/dateformat_class.h | 6 +++++ ext/intl/dateformat/dateformat_format.cpp | 2 +- ...{formatter_class.c => formatter_class.cpp} | 14 ++++++---- ext/intl/formatter/formatter_class.h | 2 +- .../{resourcebundle.c => resourcebundle.cpp} | 4 ++- ext/intl/resourcebundle/resourcebundle.h | 6 +++++ ...undle_class.c => resourcebundle_class.cpp} | 27 +++++++++++-------- .../resourcebundle/resourcebundle_class.h | 13 ++++++++- ...iterator.c => resourcebundle_iterator.cpp} | 6 +++-- .../resourcebundle/resourcebundle_iterator.h | 6 +++++ ...checker_class.c => spoofchecker_class.cpp} | 14 +++++----- ext/intl/spoofchecker/spoofchecker_class.h | 12 +++++++++ ...ecker_create.c => spoofchecker_create.cpp} | 11 ++++++-- ...ofchecker_main.c => spoofchecker_main.cpp} | 19 ++++++++----- 18 files changed, 136 insertions(+), 62 deletions(-) rename ext/intl/common/{common_error.c => common_error.cpp} (84%) rename ext/intl/dateformat/{dateformat_class.c => dateformat_class.cpp} (95%) rename ext/intl/formatter/{formatter_class.c => formatter_class.cpp} (89%) rename ext/intl/resourcebundle/{resourcebundle.c => resourcebundle.cpp} (96%) rename ext/intl/resourcebundle/{resourcebundle_class.c => resourcebundle_class.cpp} (95%) rename ext/intl/resourcebundle/{resourcebundle_iterator.c => resourcebundle_iterator.cpp} (95%) rename ext/intl/spoofchecker/{spoofchecker_class.c => spoofchecker_class.cpp} (90%) rename ext/intl/spoofchecker/{spoofchecker_create.c => spoofchecker_create.cpp} (94%) rename ext/intl/spoofchecker/{spoofchecker_main.c => spoofchecker_main.cpp} (95%) diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.cpp similarity index 84% rename from ext/intl/common/common_error.c rename to ext/intl/common/common_error.cpp index 733a1913ad08f..cb12d8dff8f3d 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.cpp @@ -17,11 +17,13 @@ #include #endif +extern "C" { #include "php_intl.h" #include "intl_error.h" +} /* {{{ Get code of the last occurred error. */ -PHP_FUNCTION( intl_get_error_code ) +U_CFUNC PHP_FUNCTION( intl_get_error_code ) { ZEND_PARSE_PARAMETERS_NONE(); @@ -30,7 +32,7 @@ PHP_FUNCTION( intl_get_error_code ) /* }}} */ /* {{{ Get text description of the last occurred error. */ -PHP_FUNCTION( intl_get_error_message ) +U_CFUNC PHP_FUNCTION( intl_get_error_message ) { ZEND_PARSE_PARAMETERS_NONE(); @@ -42,7 +44,7 @@ PHP_FUNCTION( intl_get_error_message ) * Returns true if it does, and false if the code * indicates success or a warning. */ -PHP_FUNCTION( intl_is_failure ) +U_CFUNC PHP_FUNCTION( intl_is_failure ) { zend_long err_code; @@ -50,14 +52,14 @@ PHP_FUNCTION( intl_is_failure ) Z_PARAM_LONG(err_code) ZEND_PARSE_PARAMETERS_END(); - RETURN_BOOL( U_FAILURE( err_code ) ); + RETURN_BOOL( U_FAILURE( static_cast(err_code) ) ); } /* }}} */ /* {{{ Return a string for a given error code. * The string will be the same as the name of the error code constant. */ -PHP_FUNCTION( intl_error_name ) +U_CFUNC PHP_FUNCTION( intl_error_name ) { zend_long err_code; @@ -65,6 +67,6 @@ PHP_FUNCTION( intl_error_name ) Z_PARAM_LONG(err_code) ZEND_PARSE_PARAMETERS_END(); - RETURN_STRING( (char*)u_errorName( err_code ) ); + RETURN_STRING( (char*)u_errorName( static_cast(err_code) ) ); } /* }}} */ diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index aa1348029fa7d..7251f22835349 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -8,18 +8,9 @@ if test "$PHP_INTL" != "no"; then PHP_SUBST([INTL_SHARED_LIBADD]) INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" PHP_NEW_EXTENSION([intl], m4_normalize([ - common/common_error.c - dateformat/dateformat_class.c - formatter/formatter_class.c intl_convert.c intl_error.c php_intl.c - resourcebundle/resourcebundle_class.c - resourcebundle/resourcebundle_iterator.c - resourcebundle/resourcebundle.c - spoofchecker/spoofchecker_class.c - spoofchecker/spoofchecker_create.c - spoofchecker/spoofchecker_main.c ]), [$ext_shared],, [$INTL_COMMON_FLAGS], @@ -37,6 +28,8 @@ if test "$PHP_INTL" != "no"; then collator/collator_sort.cpp \ common/common_enum.cpp \ common/common_date.cpp \ + common/common_error.cpp \ + dateformat/dateformat_class.cpp \ converter/converter.cpp \ dateformat/dateformat.cpp \ dateformat/dateformat_attr.cpp \ @@ -49,6 +42,7 @@ if test "$PHP_INTL" != "no"; then dateformat/dateformat_parse.cpp \ dateformat/datepatterngenerator_class.cpp \ dateformat/datepatterngenerator_methods.cpp \ + formatter/formatter_class.cpp \ grapheme/grapheme_string.cpp \ grapheme/grapheme_util.cpp \ msgformat/msgformat_helpers.cpp \ @@ -84,6 +78,12 @@ if test "$PHP_INTL" != "no"; then locale/locale_class.cpp \ locale/locale_methods.cpp \ locale/locale.cpp \ + resourcebundle/resourcebundle_class.cpp \ + resourcebundle/resourcebundle_iterator.cpp \ + resourcebundle/resourcebundle.cpp \ + spoofchecker/spoofchecker_class.cpp \ + spoofchecker/spoofchecker_create.cpp \ + spoofchecker/spoofchecker_main.cpp \ uchar/uchar.cpp" PHP_REQUIRE_CXX() diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index d0720ff1af18b..d5c86d1236712 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -24,7 +24,7 @@ if (PHP_INTL != "no") { collator_sort.cpp \ ", "intl"); ADD_SOURCES(configure_module_dirname + "/common", "\ - common_error.c \ + common_error.cpp \ common_enum.cpp \ common_date.cpp \ ", "intl"); @@ -33,7 +33,7 @@ if (PHP_INTL != "no") { ", "intl"); ADD_SOURCES(configure_module_dirname + "/formatter", "\ formatter_attr.cpp \ - formatter_class.c \ + formatter_class.cpp \ formatter_data.cpp \ formatter_format.cpp \ formatter_main.cpp \ @@ -68,7 +68,7 @@ if (PHP_INTL != "no") { ", "intl"); ADD_SOURCES(configure_module_dirname + "/dateformat", "\ dateformat.cpp \ - dateformat_class.c \ + dateformat_class.cpp \ dateformat_attr.cpp \ dateformat_format.cpp \ dateformat_format_object.cpp \ @@ -87,16 +87,16 @@ if (PHP_INTL != "no") { idn.cpp", "intl"); ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\ - resourcebundle.c \ - resourcebundle_class.c \ - resourcebundle_iterator.c", + resourcebundle.cpp \ + resourcebundle_class.cpp \ + resourcebundle_iterator.cpp", "intl"); if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) { ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\ - spoofchecker_class.c \ - spoofchecker_create.c \ - spoofchecker_main.c", + spoofchecker_class.cpp \ + spoofchecker_create.cpp \ + spoofchecker_main.cpp", "intl"); } diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.cpp similarity index 95% rename from ext/intl/dateformat/dateformat_class.c rename to ext/intl/dateformat/dateformat_class.cpp index 15bf5bf23ce57..b6ccf97990073 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.cpp @@ -11,13 +11,15 @@ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ */ -#include +#include +extern "C" { #include "dateformat_class.h" #include "php_intl.h" #include "dateformat_data.h" #include "dateformat.h" #include "dateformat_arginfo.h" +} #include @@ -48,7 +50,7 @@ zend_object *IntlDateFormatter_object_create(zend_class_entry *ce) { IntlDateFormatter_object* intern; - intern = zend_object_alloc(sizeof(IntlDateFormatter_object), ce); + intern = reinterpret_cast(zend_object_alloc(sizeof(IntlDateFormatter_object), ce)); dateformat_data_init( &intern->datef_data ); zend_object_std_init( &intern->zo, ce ); object_properties_init(&intern->zo, ce); diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index 167a777e405fa..e722c40b4bd9f 100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -16,9 +16,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_common.h" #include "intl_error.h" #include "intl_data.h" +#ifdef __cplusplus +} +#endif #include "dateformat_data.h" typedef struct { diff --git a/ext/intl/dateformat/dateformat_format.cpp b/ext/intl/dateformat/dateformat_format.cpp index 72fbd5f34ae7f..30570a5887c17 100644 --- a/ext/intl/dateformat/dateformat_format.cpp +++ b/ext/intl/dateformat/dateformat_format.cpp @@ -17,7 +17,7 @@ #endif #include -#include +#include extern "C" { #include "../php_intl.h" diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.cpp similarity index 89% rename from ext/intl/formatter/formatter_class.c rename to ext/intl/formatter/formatter_class.cpp index 7832824c94e1c..214e1e57dae8a 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.cpp @@ -15,15 +15,19 @@ #include #include "formatter_class.h" +extern "C" { #include "php_intl.h" #include "formatter_data.h" #include "formatter_format.h" +} #include #include "Zend/zend_attributes.h" #include "Zend/zend_interfaces.h" +extern "C" { #include "formatter_arginfo.h" +} zend_class_entry *NumberFormatter_ce_ptr = NULL; static zend_object_handlers NumberFormatter_handlers; @@ -33,7 +37,7 @@ static zend_object_handlers NumberFormatter_handlers; */ /* {{{ NumberFormatter_objects_free */ -void NumberFormatter_object_free( zend_object *object ) +U_CFUNC void NumberFormatter_object_free( zend_object *object ) { NumberFormatter_object* nfo = php_intl_number_format_fetch_object(object); @@ -44,11 +48,11 @@ void NumberFormatter_object_free( zend_object *object ) /* }}} */ /* {{{ NumberFormatter_object_create */ -zend_object *NumberFormatter_object_create(zend_class_entry *ce) +U_CFUNC zend_object *NumberFormatter_object_create(zend_class_entry *ce) { NumberFormatter_object* intern; - intern = zend_object_alloc(sizeof(NumberFormatter_object), ce); + intern = reinterpret_cast(zend_object_alloc(sizeof(NumberFormatter_object), ce)); formatter_data_init( &intern->nf_data ); zend_object_std_init( &intern->zo, ce ); object_properties_init(&intern->zo, ce); @@ -58,7 +62,7 @@ zend_object *NumberFormatter_object_create(zend_class_entry *ce) /* }}} */ /* {{{ NumberFormatter_object_clone */ -zend_object *NumberFormatter_object_clone(zend_object *object) +U_CFUNC zend_object *NumberFormatter_object_clone(zend_object *object) { NumberFormatter_object *nfo = php_intl_number_format_fetch_object(object); zend_object *new_obj = NumberFormatter_ce_ptr->create_object(object->ce); @@ -88,7 +92,7 @@ zend_object *NumberFormatter_object_clone(zend_object *object) /* {{{ formatter_register_class * Initialize 'NumberFormatter' class */ -void formatter_register_class( void ) +U_CFUNC void formatter_register_class( void ) { /* Create and register 'NumberFormatter' class. */ NumberFormatter_ce_ptr = register_class_NumberFormatter(); diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index aae6131205e3c..bf21825b5f5f4 100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -23,10 +23,10 @@ extern "C" { #include "intl_common.h" #include "intl_error.h" #include "intl_data.h" +#include "formatter_data.h" #ifdef __cplusplus } #endif -#include "formatter_data.h" typedef struct { formatter_data nf_data; diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.cpp similarity index 96% rename from ext/intl/resourcebundle/resourcebundle.c rename to ext/intl/resourcebundle/resourcebundle.cpp index e29596f01872e..b8c5c00efaba6 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.cpp @@ -17,12 +17,14 @@ #include #include +extern "C" { #include "intl_convert.h" #include "intl_data.h" #include "resourcebundle/resourcebundle_class.h" +} /* {{{ ResourceBundle_extract_value */ -void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source ) +U_CFUNC void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source ) { UResType restype; const UChar* ufield; diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h index ddcf75b8c50ac..c46908a8edff2 100644 --- a/ext/intl/resourcebundle/resourcebundle.h +++ b/ext/intl/resourcebundle/resourcebundle.h @@ -21,6 +21,12 @@ #include "resourcebundle/resourcebundle_class.h" +#ifdef __cplusplus +extern "C" { +#endif void resourcebundle_extract_value( zval *target, ResourceBundle_object *source); +#ifdef __cplusplus +} +#endif #endif // #ifndef RESOURCEBUNDLE_CLASS_H diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.cpp similarity index 95% rename from ext/intl/resourcebundle/resourcebundle_class.c rename to ext/intl/resourcebundle/resourcebundle_class.cpp index 165e60cc1d3a1..d88ba2ad13170 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.cpp @@ -16,19 +16,24 @@ #include #include + +extern "C" { #include +#include +} + #include #include -#include +extern "C" { #include "php_intl.h" #include "intl_data.h" #include "intl_common.h" - #include "resourcebundle/resourcebundle.h" #include "resourcebundle/resourcebundle_iterator.h" #include "resourcebundle/resourcebundle_class.h" #include "resourcebundle/resourcebundle_arginfo.h" +} zend_class_entry *ResourceBundle_ce_ptr = NULL; @@ -58,7 +63,7 @@ static zend_object *ResourceBundle_object_create( zend_class_entry *ce ) { ResourceBundle_object *rb; - rb = zend_object_alloc(sizeof(ResourceBundle_object), ce); + rb = reinterpret_cast(zend_object_alloc(sizeof(ResourceBundle_object), ce)); zend_object_std_init( &rb->zend, ce ); object_properties_init( &rb->zend, ce); @@ -152,7 +157,7 @@ PHP_METHOD( ResourceBundle, __construct ) /* }}} */ /* {{{ */ -PHP_FUNCTION( resourcebundle_create ) +U_CFUNC PHP_FUNCTION( resourcebundle_create ) { object_init_ex( return_value, ResourceBundle_ce_ptr ); if (resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU) == FAILURE) { @@ -234,7 +239,7 @@ static zval *resource_bundle_array_fetch( /* }}} */ /* {{{ resourcebundle_array_get */ -zval *resourcebundle_array_get(zend_object *object, zval *offset, int type, zval *rv) +U_CFUNC zval *resourcebundle_array_get(zend_object *object, zval *offset, int type, zval *rv) { if (offset == NULL) { zend_throw_error(NULL, "Cannot apply [] to ResourceBundle object"); @@ -254,7 +259,7 @@ zval *resourcebundle_array_get(zend_object *object, zval *offset, int type, zval /* }}} */ /* {{{ Get resource identified by numerical index or key name. */ -PHP_FUNCTION( resourcebundle_get ) +U_CFUNC PHP_FUNCTION( resourcebundle_get ) { bool fallback = true; zend_object *resource_bundle = NULL; @@ -312,7 +317,7 @@ static zend_result resourcebundle_array_count(zend_object *object, zend_long *co /* }}} */ /* {{{ Get resources count */ -PHP_FUNCTION( resourcebundle_count ) +U_CFUNC PHP_FUNCTION( resourcebundle_count ) { int32_t len; RESOURCEBUNDLE_METHOD_INIT_VARS; @@ -328,7 +333,7 @@ PHP_FUNCTION( resourcebundle_count ) } /* {{{ Get available locales from ResourceBundle name */ -PHP_FUNCTION( resourcebundle_locales ) +U_CFUNC PHP_FUNCTION( resourcebundle_locales ) { char * bundlename; size_t bundlename_len = 0; @@ -368,7 +373,7 @@ PHP_FUNCTION( resourcebundle_locales ) /* }}} */ /* {{{ Get text description for ResourceBundle's last error code. */ -PHP_FUNCTION( resourcebundle_get_error_code ) +U_CFUNC PHP_FUNCTION( resourcebundle_get_error_code ) { RESOURCEBUNDLE_METHOD_INIT_VARS; @@ -385,7 +390,7 @@ PHP_FUNCTION( resourcebundle_get_error_code ) /* }}} */ /* {{{ Get text description for ResourceBundle's last error. */ -PHP_FUNCTION( resourcebundle_get_error_message ) +U_CFUNC PHP_FUNCTION( resourcebundle_get_error_message ) { zend_string* message = NULL; RESOURCEBUNDLE_METHOD_INIT_VARS; @@ -411,7 +416,7 @@ PHP_METHOD(ResourceBundle, getIterator) { /* {{{ resourcebundle_register_class * Initialize 'ResourceBundle' class */ -void resourcebundle_register_class( void ) +U_CFUNC void resourcebundle_register_class( void ) { ResourceBundle_ce_ptr = register_class_ResourceBundle(zend_ce_aggregate, zend_ce_countable); ResourceBundle_ce_ptr->create_object = ResourceBundle_object_create; diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h index be397c8d47601..334532bde99b7 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.h +++ b/ext/intl/resourcebundle/resourcebundle_class.h @@ -18,9 +18,14 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif #include "php.h" - #include "intl_error.h" +#ifdef __cplusplus +} +#endif typedef struct { intl_error error; @@ -46,7 +51,13 @@ static inline ResourceBundle_object *php_intl_resourcebundle_fetch_object(zend_o #define RESOURCEBUNDLE_OBJECT(rb) (rb)->me +#ifdef __cplusplus +extern "C" { +#endif void resourcebundle_register_class( void ); extern zend_class_entry *ResourceBundle_ce_ptr; +#ifdef __cplusplus +} +#endif #endif // #ifndef RESOURCEBUNDLE_CLASS_H diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.cpp similarity index 95% rename from ext/intl/resourcebundle/resourcebundle_iterator.c rename to ext/intl/resourcebundle/resourcebundle_iterator.cpp index c79269e475070..7747b34adbd4c 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.c +++ b/ext/intl/resourcebundle/resourcebundle_iterator.cpp @@ -12,9 +12,11 @@ +----------------------------------------------------------------------+ */ +extern "C" { #include #include #include +} #include "resourcebundle/resourcebundle.h" #include "resourcebundle/resourcebundle_class.h" @@ -145,7 +147,7 @@ static const zend_object_iterator_funcs resourcebundle_iterator_funcs = { /* }}} */ /* {{{ resourcebundle_get_iterator */ -zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref ) +U_CFUNC zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref ) { if (byref) { zend_throw_error(NULL, "An iterator cannot be used with foreach by reference"); @@ -153,7 +155,7 @@ zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *o } ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P(object ); - ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) ); + ResourceBundle_iterator *iterator = reinterpret_cast(emalloc( sizeof( ResourceBundle_iterator )) ); zend_iterator_init(&iterator->intern); Z_ADDREF_P(object); diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h index 1ad948723160f..c323d4e17b4c9 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.h +++ b/ext/intl/resourcebundle/resourcebundle_iterator.h @@ -29,6 +29,12 @@ typedef struct { zend_long i; } ResourceBundle_iterator; +#ifdef __cplusplus +extern "C" { +#endif zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref ); +#ifdef __cplusplus +} +#endif #endif // #ifndef RESOURCEBUNDLE_ITERATOR_H diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.cpp similarity index 90% rename from ext/intl/spoofchecker/spoofchecker_class.c rename to ext/intl/spoofchecker/spoofchecker_class.cpp index 6fa59edd47b00..ba4c64321f14e 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.cpp @@ -13,9 +13,11 @@ */ #include "spoofchecker_class.h" +extern "C" { #include "spoofchecker_arginfo.h" #include "php_intl.h" #include "intl_error.h" +} #include @@ -27,7 +29,7 @@ static zend_object_handlers Spoofchecker_handlers; */ /* {{{ Spoofchecker_objects_free */ -void Spoofchecker_objects_free(zend_object *object) +U_CFUNC void Spoofchecker_objects_free(zend_object *object) { Spoofchecker_object* co = php_intl_spoofchecker_fetch_object(object); @@ -38,11 +40,11 @@ void Spoofchecker_objects_free(zend_object *object) /* }}} */ /* {{{ Spoofchecker_object_create */ -zend_object *Spoofchecker_object_create(zend_class_entry *ce) +U_CFUNC zend_object *Spoofchecker_object_create(zend_class_entry *ce) { Spoofchecker_object* intern; - intern = zend_object_alloc(sizeof(Spoofchecker_object), ce); + intern = reinterpret_cast(zend_object_alloc(sizeof(Spoofchecker_object), ce)); intl_error_init(SPOOFCHECKER_ERROR_P(intern)); zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); @@ -87,7 +89,7 @@ static zend_object *spoofchecker_clone_obj(zend_object *object) /* {{{ */ /* {{{ spoofchecker_register_Spoofchecker_class * Initialize 'Spoofchecker' class */ -void spoofchecker_register_Spoofchecker_class(void) +U_CFUNC void spoofchecker_register_Spoofchecker_class(void) { /* Create and register 'Spoofchecker' class. */ Spoofchecker_ce_ptr = register_class_Spoofchecker(); @@ -106,7 +108,7 @@ void spoofchecker_register_Spoofchecker_class(void) * Initialize internals of Spoofchecker_object. * Must be called before any other call to 'spoofchecker_object_...' functions. */ -void spoofchecker_object_init(Spoofchecker_object* co) +U_CFUNC void spoofchecker_object_init(Spoofchecker_object* co) { if (!co) { return; @@ -119,7 +121,7 @@ void spoofchecker_object_init(Spoofchecker_object* co) /* {{{ void spoofchecker_object_destroy( Spoofchecker_object* co ) * Clean up mem allocted by internals of Spoofchecker_object */ -void spoofchecker_object_destroy(Spoofchecker_object* co) +U_CFUNC void spoofchecker_object_destroy(Spoofchecker_object* co) { if (!co) { return; diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h index a471c055c2ce6..06701eb60e36e 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.h +++ b/ext/intl/spoofchecker/spoofchecker_class.h @@ -17,9 +17,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "intl_common.h" #include "intl_error.h" #include "intl_data.h" +#ifdef __cplusplus +} +#endif #include @@ -47,10 +53,16 @@ static inline Spoofchecker_object *php_intl_spoofchecker_fetch_object(zend_objec #define SPOOFCHECKER_ERROR_CODE(co) INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co)) #define SPOOFCHECKER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co))) +#ifdef __cplusplus +extern "C" { +#endif void spoofchecker_register_Spoofchecker_class(void); void spoofchecker_object_init(Spoofchecker_object* co); void spoofchecker_object_destroy(Spoofchecker_object* co); +#ifdef __cplusplus +} +#endif extern zend_class_entry *Spoofchecker_ce_ptr; diff --git a/ext/intl/spoofchecker/spoofchecker_create.c b/ext/intl/spoofchecker/spoofchecker_create.cpp similarity index 94% rename from ext/intl/spoofchecker/spoofchecker_create.c rename to ext/intl/spoofchecker/spoofchecker_create.cpp index 7cb51adef4e24..1ed4055cccd10 100644 --- a/ext/intl/spoofchecker/spoofchecker_create.c +++ b/ext/intl/spoofchecker/spoofchecker_create.cpp @@ -16,12 +16,19 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" -#include "spoofchecker_class.h" #include "intl_data.h" +} +#include "spoofchecker_class.h" /* {{{ Spoofchecker object constructor. */ -PHP_METHOD(Spoofchecker, __construct) +U_CFUNC PHP_METHOD(Spoofchecker, __construct) { #if U_ICU_VERSION_MAJOR_NUM < 58 int checks; diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.cpp similarity index 95% rename from ext/intl/spoofchecker/spoofchecker_main.c rename to ext/intl/spoofchecker/spoofchecker_main.cpp index a4b1ad591fdd6..ddbf02a0d3ded 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.cpp @@ -16,12 +16,19 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" #include "intl_convert.h" +} #include "spoofchecker_class.h" /* {{{ Checks if a given text contains any suspicious characters */ -PHP_METHOD(Spoofchecker, isSuspicious) +U_CFUNC PHP_METHOD(Spoofchecker, isSuspicious) { int32_t ret, errmask; zend_string *text; @@ -62,7 +69,7 @@ PHP_METHOD(Spoofchecker, isSuspicious) /* }}} */ /* {{{ Checks if a given text contains any confusable characters */ -PHP_METHOD(Spoofchecker, areConfusable) +U_CFUNC PHP_METHOD(Spoofchecker, areConfusable) { int ret; zend_string *s1, *s2; @@ -95,7 +102,7 @@ PHP_METHOD(Spoofchecker, areConfusable) /* }}} */ /* {{{ Locales to use when running checks */ -PHP_METHOD(Spoofchecker, setAllowedLocales) +U_CFUNC PHP_METHOD(Spoofchecker, setAllowedLocales) { zend_string *locales; SPOOFCHECKER_METHOD_INIT_VARS; @@ -116,7 +123,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales) /* }}} */ /* {{{ Set the checks to run */ -PHP_METHOD(Spoofchecker, setChecks) +U_CFUNC PHP_METHOD(Spoofchecker, setChecks) { zend_long checks; SPOOFCHECKER_METHOD_INIT_VARS; @@ -137,7 +144,7 @@ PHP_METHOD(Spoofchecker, setChecks) #if U_ICU_VERSION_MAJOR_NUM >= 58 /* {{{ Set the loosest restriction level allowed for strings. */ -PHP_METHOD(Spoofchecker, setRestrictionLevel) +U_CFUNC PHP_METHOD(Spoofchecker, setRestrictionLevel) { zend_long level; SPOOFCHECKER_METHOD_INIT_VARS; @@ -165,7 +172,7 @@ PHP_METHOD(Spoofchecker, setRestrictionLevel) /* }}} */ #endif -PHP_METHOD(Spoofchecker, setAllowedChars) +U_CFUNC PHP_METHOD(Spoofchecker, setAllowedChars) { zend_string *pattern; UChar *upattern = NULL; From 3e982a8d9d5b50f06c989d45e27077de2195842d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 10 Nov 2025 22:41:14 +0100 Subject: [PATCH 331/386] standard: Remove redundant code in range() (#20432) If we use signed integers (which fit the unsigned chars), then we can avoid the extra checks. Also move an exception check to the proper place. --- ext/standard/array.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 3a782ec1ea40c..eac3d516e3f80 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3040,18 +3040,18 @@ PHP_FUNCTION(range) if (start_type == IS_STRING || end_type == IS_STRING) { php_error_docref(NULL, E_WARNING, "Argument #3 ($step) must be of type int when generating an array" " of characters, inputs converted to 0"); - } - if (UNEXPECTED(EG(exception))) { - RETURN_THROWS(); + if (UNEXPECTED(EG(exception))) { + RETURN_THROWS(); + } } end_type = IS_LONG; start_type = IS_LONG; goto handle_numeric_inputs; } - /* Generate array of characters */ - unsigned char low = (unsigned char)Z_STRVAL_P(user_start)[0]; - unsigned char high = (unsigned char)Z_STRVAL_P(user_end)[0]; + /* Generate array of characters, as ints to make bounds checking possible in the loop condition */ + int low = Z_STRVAL_P(user_start)[0]; + int high = Z_STRVAL_P(user_end)[0]; /* Decreasing char range */ if (low > high) { @@ -3062,12 +3062,9 @@ PHP_FUNCTION(range) array_init_size(return_value, (uint32_t)(((low - high) / step) + 1)); zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) { - for (; low >= high; low -= (unsigned int)step) { + for (; low >= high; low -= step) { ZEND_HASH_FILL_SET_INTERNED_STR(ZSTR_CHAR(low)); ZEND_HASH_FILL_NEXT(); - if (((signed int)low - step) < 0) { - break; - } } } ZEND_HASH_FILL_END(); } else if (high > low) { /* Increasing char range */ @@ -3080,12 +3077,9 @@ PHP_FUNCTION(range) array_init_size(return_value, (uint32_t)(((high - low) / step) + 1)); zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) { - for (; low <= high; low += (unsigned int)step) { + for (; low <= high; low += step) { ZEND_HASH_FILL_SET_INTERNED_STR(ZSTR_CHAR(low)); ZEND_HASH_FILL_NEXT(); - if (((signed int)low + step) > 255) { - break; - } } } ZEND_HASH_FILL_END(); } else { From 15b996348abc2fb3b35ce384489a0d59b4644c97 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:41:42 +0100 Subject: [PATCH 332/386] standard: Use specialised macro in array_merge() --- ext/standard/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index eac3d516e3f80..9a9ec99e3b12b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4311,7 +4311,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET bool copy = 1; zend_string *string_key; - ZEND_HASH_FOREACH_STR_KEY(Z_ARRVAL_P(ret), string_key) { + ZEND_HASH_MAP_FOREACH_STR_KEY(Z_ARRVAL_P(ret), string_key) { if (!string_key) { copy = 0; break; From e32c2c3e0b253094fb3553bf5bda4ee037b29c37 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:42:16 +0100 Subject: [PATCH 333/386] standard: Use RETURN_COPY()/RETVAL_ARR() in array_merge() --- ext/standard/array.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 9a9ec99e3b12b..031e136870252 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4304,8 +4304,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET if (ret) { if (HT_IS_PACKED(Z_ARRVAL_P(ret))) { if (HT_IS_WITHOUT_HOLES(Z_ARRVAL_P(ret))) { - ZVAL_COPY(return_value, ret); - return; + RETURN_COPY(ret); } } else { bool copy = 1; @@ -4318,8 +4317,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET } } ZEND_HASH_FOREACH_END(); if (copy) { - ZVAL_COPY(return_value, ret); - return; + RETURN_COPY(ret); } } } @@ -4334,7 +4332,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET if (HT_IS_WITHOUT_HOLES(src) && zend_may_modify_arg_in_place(arg)) { dest = src; in_place = true; - ZVAL_ARR(return_value, dest); + RETVAL_ARR(dest); } else { array_init_size(return_value, count); dest = Z_ARRVAL_P(return_value); From aafb8a66239e20acd18122c0a0c75294855e286f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:44:01 +0100 Subject: [PATCH 334/386] standard: Use booleans in array_merge() --- ext/standard/array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 031e136870252..6de17f2bff7f9 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4307,12 +4307,12 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET RETURN_COPY(ret); } } else { - bool copy = 1; + bool copy = true; zend_string *string_key; ZEND_HASH_MAP_FOREACH_STR_KEY(Z_ARRVAL_P(ret), string_key) { if (!string_key) { - copy = 0; + copy = false; break; } } ZEND_HASH_FOREACH_END(); From 5185d46ccc2f3858d343c5cf4edc5bc4220c7cd1 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:01:38 +0100 Subject: [PATCH 335/386] Fix zero-extension on range() char parameters --- ext/standard/array.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 6de17f2bff7f9..0389eb1840a96 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3049,9 +3049,9 @@ PHP_FUNCTION(range) goto handle_numeric_inputs; } - /* Generate array of characters, as ints to make bounds checking possible in the loop condition */ - int low = Z_STRVAL_P(user_start)[0]; - int high = Z_STRVAL_P(user_end)[0]; + /* Generate array of characters, as zero-extended ints to make bounds checking possible in the loop condition */ + int low = (unsigned char) Z_STRVAL_P(user_start)[0]; + int high = (unsigned char) Z_STRVAL_P(user_end)[0]; /* Decreasing char range */ if (low > high) { From da238e7a11101a042fe42147acf6ba0b23eea66a Mon Sep 17 00:00:00 2001 From: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:31:58 +0100 Subject: [PATCH 336/386] ext/spl: convert `zend_parse_parameters_none()` to fast ZPP (#20441) --- ext/spl/php_spl.c | 8 +- ext/spl/spl_array.c | 60 ++++---------- ext/spl/spl_directory.c | 172 ++++++++++----------------------------- ext/spl/spl_dllist.c | 64 ++++----------- ext/spl/spl_fixedarray.c | 24 ++---- ext/spl/spl_heap.c | 68 ++++------------ ext/spl/spl_observer.c | 64 ++++----------- 7 files changed, 115 insertions(+), 345 deletions(-) diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 6de7a6d6635af..0acfcbc5c16d0 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -216,9 +216,7 @@ PHP_FUNCTION(class_uses) /* {{{ Return an array containing the names of all classes and interfaces defined in SPL */ PHP_FUNCTION(spl_classes) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -619,9 +617,7 @@ PHP_FUNCTION(spl_autoload_functions) { autoload_func_info *alfi; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); if (spl_autoload_functions) { diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index d430513ca11fa..3d6870a7ee953 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -753,9 +753,7 @@ PHP_METHOD(ArrayObject, getArrayCopy) zval *object = ZEND_THIS; spl_array_object *intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(zend_array_dup(spl_array_get_hash_table(intern))); } /* }}} */ @@ -1086,9 +1084,7 @@ PHP_METHOD(ArrayObject, getIteratorClass) zval *object = ZEND_THIS; spl_array_object *intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_string_addref(intern->ce_get_iterator->name); RETURN_STR(intern->ce_get_iterator->name); @@ -1101,9 +1097,7 @@ PHP_METHOD(ArrayObject, getFlags) zval *object = ZEND_THIS; spl_array_object *intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->ar_flags & ~SPL_ARRAY_INT_MASK); } @@ -1150,9 +1144,7 @@ PHP_METHOD(ArrayObject, getIterator) zval *object = ZEND_THIS; spl_array_object *intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_OBJ(spl_array_object_new_ex(intern->ce_get_iterator, Z_OBJ_P(object), 0)); } @@ -1203,9 +1195,7 @@ PHP_METHOD(ArrayObject, count) { spl_array_object *intern = Z_SPLARRAY_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(spl_array_object_count_elements_helper(intern)); } /* }}} */ @@ -1305,9 +1295,7 @@ PHP_METHOD(ArrayObject, serialize) php_serialize_data_t var_hash; smart_str buf = {0}; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHP_VAR_SERIALIZE_INIT(var_hash); @@ -1453,9 +1441,7 @@ PHP_METHOD(ArrayObject, __serialize) spl_array_object *intern = Z_SPLARRAY_P(ZEND_THIS); zval tmp; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -1559,9 +1545,7 @@ PHP_METHOD(ArrayObject, __unserialize) /* {{{ */ PHP_METHOD(ArrayObject, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_array_get_debug_info(Z_OBJ_P(ZEND_THIS))); } /* }}} */ @@ -1739,9 +1723,7 @@ PHP_METHOD(ArrayIterator, rewind) zval *object = ZEND_THIS; spl_array_object *intern = Z_SPLARRAY_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_array_rewind(intern); } @@ -1783,9 +1765,7 @@ PHP_METHOD(ArrayIterator, current) zval *entry; HashTable *aht = spl_array_get_hash_table(intern); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if ((entry = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, intern))) == NULL) { RETURN_NULL(); @@ -1812,9 +1792,7 @@ void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */ /* {{{ Return current array key */ PHP_METHOD(ArrayIterator, key) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_array_iterator_key(ZEND_THIS, return_value); } /* }}} */ @@ -1826,9 +1804,7 @@ PHP_METHOD(ArrayIterator, next) spl_array_object *intern = Z_SPLARRAY_P(object); HashTable *aht = spl_array_get_hash_table(intern); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_array_next_ex(intern, aht); } @@ -1841,9 +1817,7 @@ PHP_METHOD(ArrayIterator, valid) spl_array_object *intern = Z_SPLARRAY_P(object); HashTable *aht = spl_array_get_hash_table(intern); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(zend_hash_has_more_elements_ex(aht, spl_array_get_pos_ptr(aht, intern)) == SUCCESS); } @@ -1858,9 +1832,7 @@ PHP_METHOD(RecursiveArrayIterator, hasChildren) spl_array_object *intern = Z_SPLARRAY_P(object); HashTable *aht = spl_array_get_hash_table(intern); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if ((entry = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, intern))) == NULL) { RETURN_FALSE; @@ -1898,9 +1870,7 @@ PHP_METHOD(RecursiveArrayIterator, getChildren) spl_array_object *intern = Z_SPLARRAY_P(object); HashTable *aht = spl_array_get_hash_table(intern); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if ((entry = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, intern))) == NULL) { RETURN_NULL(); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index a769d627a54cd..c67a6ec4b2824 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -737,9 +737,7 @@ PHP_METHOD(DirectoryIterator, rewind) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); intern->u.dir.index = 0; @@ -753,9 +751,7 @@ PHP_METHOD(DirectoryIterator, key) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); RETURN_LONG(intern->u.dir.index); @@ -765,9 +761,7 @@ PHP_METHOD(DirectoryIterator, key) /* {{{ Return this (needed for Iterator interface) */ PHP_METHOD(DirectoryIterator, current) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS))); RETURN_OBJ_COPY(Z_OBJ_P(ZEND_THIS)); @@ -780,9 +774,7 @@ PHP_METHOD(DirectoryIterator, next) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); bool skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); intern->u.dir.index++; @@ -831,9 +823,7 @@ PHP_METHOD(DirectoryIterator, valid) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); RETURN_BOOL(intern->u.dir.entry.d_name[0] != '\0'); @@ -846,9 +836,7 @@ PHP_METHOD(SplFileInfo, getPath) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); zend_string *path; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); path = spl_filesystem_object_get_path(intern); if (path) { @@ -865,9 +853,7 @@ PHP_METHOD(SplFileInfo, getFilename) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); zend_string *path; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!intern->file_name) { zend_throw_error(NULL, "Object not initialized"); @@ -894,9 +880,7 @@ PHP_METHOD(DirectoryIterator, getFilename) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); RETURN_STRING(intern->u.dir.entry.d_name); @@ -914,9 +898,7 @@ PHP_METHOD(SplFileInfo, getExtension) size_t idx; zend_string *ret; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!intern->file_name) { zend_throw_error(NULL, "Object not initialized"); @@ -959,9 +941,7 @@ PHP_METHOD(DirectoryIterator, getExtension) size_t idx; zend_string *fname; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0); @@ -1039,9 +1019,7 @@ PHP_METHOD(SplFileInfo, getPathname) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); zend_string *path; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); path = spl_filesystem_object_get_pathname(intern); if (path) { RETURN_STR_COPY(path); @@ -1056,9 +1034,7 @@ PHP_METHOD(FilesystemIterator, key) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (SPL_FILE_DIR_KEY(intern, SPL_FILE_DIR_KEY_AS_FILENAME)) { RETURN_STRING(intern->u.dir.entry.d_name); @@ -1076,9 +1052,7 @@ PHP_METHOD(FilesystemIterator, current) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { if (spl_filesystem_object_get_file_name(intern) == FAILURE) { @@ -1101,9 +1075,7 @@ PHP_METHOD(DirectoryIterator, isDot) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_DIRECTORY_ITERATOR_IS_INITIALIZED(intern); RETURN_BOOL(spl_filesystem_is_dot(intern->u.dir.entry.d_name)); @@ -1137,9 +1109,7 @@ PHP_METHOD(SplFileInfo, func_name) \ { \ spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); \ zend_error_handling error_handling; \ - if (zend_parse_parameters_none() == FAILURE) { \ - RETURN_THROWS(); \ - } \ + ZEND_PARSE_PARAMETERS_NONE(); \ if (spl_filesystem_object_get_file_name(intern) == FAILURE) { \ RETURN_THROWS(); \ } \ @@ -1216,9 +1186,7 @@ PHP_METHOD(SplFileInfo, getLinkTarget) ssize_t ret; char buff[MAXPATHLEN]; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (intern->file_name == NULL) { if (spl_filesystem_object_get_file_name(intern) == FAILURE) { @@ -1263,9 +1231,7 @@ PHP_METHOD(SplFileInfo, getRealPath) char buff[MAXPATHLEN]; char *filename; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) { if (spl_filesystem_object_get_file_name(intern) == FAILURE) { @@ -1375,9 +1341,7 @@ PHP_METHOD(SplFileInfo, getPathInfo) /* {{{ */ PHP_METHOD(SplFileInfo, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_filesystem_object_get_debug_info(Z_OBJ_P(ZEND_THIS))); } /* }}} */ @@ -1385,9 +1349,7 @@ PHP_METHOD(SplFileInfo, __debugInfo) /* {{{ */ PHP_METHOD(SplFileInfo, _bad_state_ex) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_throw_error(NULL, "The parent constructor was not called: the object is in an invalid state"); RETURN_THROWS(); } @@ -1406,9 +1368,7 @@ PHP_METHOD(FilesystemIterator, rewind) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); bool skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern->u.dir.index = 0; if (intern->u.dir.dirp) { @@ -1425,9 +1385,7 @@ PHP_METHOD(FilesystemIterator, getFlags) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->flags & (SPL_FILE_DIR_KEY_MODE_MASK | SPL_FILE_DIR_CURRENT_MODE_MASK | SPL_FILE_DIR_OTHERS_MASK)); } /* }}} */ @@ -1491,9 +1449,7 @@ PHP_METHOD(RecursiveDirectoryIterator, getChildren) spl_filesystem_object *subdir; char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (spl_filesystem_object_get_file_name(intern) == FAILURE) { RETURN_THROWS(); @@ -1534,9 +1490,7 @@ PHP_METHOD(RecursiveDirectoryIterator, getSubPath) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (intern->u.dir.sub_path) { RETURN_STR_COPY(intern->u.dir.sub_path); @@ -1552,9 +1506,7 @@ PHP_METHOD(RecursiveDirectoryIterator, getSubPathname) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (intern->u.dir.sub_path) { RETURN_NEW_STR(strpprintf(0, "%s%c%s", ZSTR_VAL(intern->u.dir.sub_path), slash, intern->u.dir.entry.d_name)); @@ -1583,9 +1535,7 @@ PHP_METHOD(GlobIterator, count) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (EXPECTED(spl_intern_is_glob(intern))) { RETURN_LONG(php_glob_stream_get_count(intern->u.dir.dirp, NULL)); @@ -2100,9 +2050,7 @@ PHP_METHOD(SplFileObject, rewind) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_filesystem_file_rewind(ZEND_THIS, intern); } /* }}} */ @@ -2112,9 +2060,7 @@ PHP_METHOD(SplFileObject, eof) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2126,9 +2072,7 @@ PHP_METHOD(SplFileObject, valid) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { RETURN_BOOL(intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)); @@ -2144,9 +2088,7 @@ PHP_METHOD(SplFileObject, fgets) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2161,9 +2103,7 @@ PHP_METHOD(SplFileObject, current) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2185,9 +2125,7 @@ PHP_METHOD(SplFileObject, key) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); /* Do not read the next line to support correct counting with fgetc() if (!intern->u.file.current_line) { @@ -2201,9 +2139,7 @@ PHP_METHOD(SplFileObject, next) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_filesystem_file_free_line(intern); if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { @@ -2227,9 +2163,7 @@ PHP_METHOD(SplFileObject, getFlags) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->flags & SPL_FILE_OBJECT_MASK); } /* }}} */ @@ -2258,9 +2192,7 @@ PHP_METHOD(SplFileObject, getMaxLineLen) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG((zend_long)intern->u.file.max_line_len); } /* }}} */ @@ -2268,9 +2200,7 @@ PHP_METHOD(SplFileObject, getMaxLineLen) /* {{{ Return false */ PHP_METHOD(SplFileObject, hasChildren) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_FALSE; } /* }}} */ @@ -2278,9 +2208,7 @@ PHP_METHOD(SplFileObject, hasChildren) /* {{{ Read NULL */ PHP_METHOD(SplFileObject, getChildren) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); /* return NULL */ } /* }}} */ @@ -2431,9 +2359,7 @@ PHP_METHOD(SplFileObject, getCsvControl) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); char delimiter[2], enclosure[2], escape[2]; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -2476,9 +2402,7 @@ PHP_METHOD(SplFileObject, fflush) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2491,9 +2415,7 @@ PHP_METHOD(SplFileObject, ftell) spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); zend_long ret; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2527,9 +2449,7 @@ PHP_METHOD(SplFileObject, fgetc) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2552,9 +2472,7 @@ PHP_METHOD(SplFileObject, fpassthru) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2654,9 +2572,7 @@ PHP_METHOD(SplFileObject, fstat) { spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); @@ -2722,9 +2638,7 @@ PHP_METHOD(SplFileObject, seek) PHP_METHOD(SplFileObject, __toString) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_filesystem_object *intern = spl_filesystem_from_obj(Z_OBJ_P(ZEND_THIS)); diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 9401af3ae00de..867f492fab16d 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -511,9 +511,7 @@ PHP_METHOD(SplDoublyLinkedList, pop) { spl_dllist_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLDLLIST_P(ZEND_THIS); spl_ptr_llist_pop(intern->llist, return_value); @@ -530,9 +528,7 @@ PHP_METHOD(SplDoublyLinkedList, shift) { spl_dllist_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLDLLIST_P(ZEND_THIS); spl_ptr_llist_shift(intern->llist, return_value); @@ -550,9 +546,7 @@ PHP_METHOD(SplDoublyLinkedList, top) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLDLLIST_P(ZEND_THIS); value = spl_ptr_llist_last(intern->llist); @@ -572,9 +566,7 @@ PHP_METHOD(SplDoublyLinkedList, bottom) zval *value; spl_dllist_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLDLLIST_P(ZEND_THIS); value = spl_ptr_llist_first(intern->llist); @@ -594,9 +586,7 @@ PHP_METHOD(SplDoublyLinkedList, count) zend_long count; spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); count = spl_ptr_llist_count(intern->llist); RETURN_LONG(count); @@ -608,9 +598,7 @@ PHP_METHOD(SplDoublyLinkedList, isEmpty) { zend_long count; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_dllist_object_count_elements(Z_OBJ_P(ZEND_THIS), &count); RETURN_BOOL(count == 0); @@ -646,9 +634,7 @@ PHP_METHOD(SplDoublyLinkedList, getIteratorMode) { spl_dllist_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLDLLIST_P(ZEND_THIS); @@ -914,9 +900,7 @@ PHP_METHOD(SplDoublyLinkedList, key) { spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->traverse_position); } @@ -927,9 +911,7 @@ PHP_METHOD(SplDoublyLinkedList, prev) { spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO); } @@ -940,9 +922,7 @@ PHP_METHOD(SplDoublyLinkedList, next) { spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags); } @@ -953,9 +933,7 @@ PHP_METHOD(SplDoublyLinkedList, valid) { spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(intern->traverse_pointer != NULL); } @@ -966,9 +944,7 @@ PHP_METHOD(SplDoublyLinkedList, rewind) { spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags); } @@ -980,9 +956,7 @@ PHP_METHOD(SplDoublyLinkedList, current) spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS); spl_ptr_llist_element *element = intern->traverse_pointer; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (element == NULL || Z_ISUNDEF(element->data)) { RETURN_NULL(); @@ -1001,9 +975,7 @@ PHP_METHOD(SplDoublyLinkedList, serialize) zval flags; php_serialize_data_t var_hash; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHP_VAR_SERIALIZE_INIT(var_hash); @@ -1099,9 +1071,7 @@ PHP_METHOD(SplDoublyLinkedList, __serialize) spl_ptr_llist_element *current = intern->llist->head; zval tmp; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -1205,9 +1175,7 @@ PHP_METHOD(SplDoublyLinkedList, add) /* {{{ */ PHP_METHOD(SplDoublyLinkedList, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_dllist_object_get_debug_info(Z_OBJ_P(ZEND_THIS))); } /* }}} */ diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 61447e2d41bf4..a5e9ed166d8b3 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -562,9 +562,7 @@ PHP_METHOD(SplFixedArray, __wakeup) HashTable *intern_ht = zend_std_get_properties(Z_OBJ_P(ZEND_THIS)); zval *data; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (intern->array.size == 0) { int index = 0; @@ -589,9 +587,7 @@ PHP_METHOD(SplFixedArray, __serialize) zval *current; zend_string *key; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); HashTable *ht = zend_std_get_properties(&intern->std); uint32_t num_properties = zend_hash_num_elements(ht); @@ -666,9 +662,7 @@ PHP_METHOD(SplFixedArray, count) zval *object = ZEND_THIS; spl_fixedarray_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLFIXEDARRAY_P(object); RETURN_LONG(intern->array.size); @@ -678,9 +672,7 @@ PHP_METHOD(SplFixedArray, toArray) { spl_fixedarray_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); @@ -774,9 +766,7 @@ PHP_METHOD(SplFixedArray, getSize) zval *object = ZEND_THIS; spl_fixedarray_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLFIXEDARRAY_P(object); RETURN_LONG(intern->array.size); @@ -871,9 +861,7 @@ PHP_METHOD(SplFixedArray, offsetUnset) /* Create a new iterator from a SplFixedArray instance. */ PHP_METHOD(SplFixedArray, getIterator) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_create_internal_iterator_zval(return_value, ZEND_THIS); } diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 5d36266393b04..85fc5f8bb698b 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -575,9 +575,7 @@ PHP_METHOD(SplHeap, count) zend_long count; spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); count = spl_ptr_heap_count(intern->heap); RETURN_LONG(count); @@ -589,9 +587,7 @@ PHP_METHOD(SplHeap, isEmpty) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(spl_ptr_heap_count(intern->heap) == 0); } @@ -640,9 +636,7 @@ PHP_METHOD(SplHeap, extract) { spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -705,9 +699,7 @@ PHP_METHOD(SplPriorityQueue, extract) spl_pqueue_elem elem; spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -731,9 +723,7 @@ PHP_METHOD(SplPriorityQueue, top) spl_heap_object *intern; spl_pqueue_elem *elem; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -780,9 +770,7 @@ PHP_METHOD(SplPriorityQueue, getExtractFlags) { spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -795,9 +783,7 @@ PHP_METHOD(SplHeap, recoverFromCorruption) { spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -812,9 +798,7 @@ PHP_METHOD(SplHeap, isCorrupted) { spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -841,9 +825,7 @@ PHP_METHOD(SplHeap, top) zval *value; spl_heap_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_SPLHEAP_P(ZEND_THIS); @@ -970,9 +952,7 @@ PHP_METHOD(SplHeap, key) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->heap->count - 1); } @@ -983,9 +963,7 @@ PHP_METHOD(SplHeap, next) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_ptr_heap_delete_top(intern->heap, NULL, ZEND_THIS); } @@ -996,9 +974,7 @@ PHP_METHOD(SplHeap, valid) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(intern->heap->count != 0); } @@ -1007,9 +983,7 @@ PHP_METHOD(SplHeap, valid) /* {{{ Rewind the datastructure back to the start */ PHP_METHOD(SplHeap, rewind) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); /* do nothing, the iterator always points to the top element */ } /* }}} */ @@ -1019,9 +993,7 @@ PHP_METHOD(SplHeap, current) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!intern->heap->count) { RETURN_NULL(); @@ -1037,9 +1009,7 @@ PHP_METHOD(SplPriorityQueue, current) { spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!intern->heap->count) { RETURN_NULL(); @@ -1053,9 +1023,7 @@ PHP_METHOD(SplPriorityQueue, current) /* {{{ */ PHP_METHOD(SplHeap, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_heap_object_get_debug_info(spl_ce_SplHeap, Z_OBJ_P(ZEND_THIS))); } /* }}} */ @@ -1063,9 +1031,7 @@ PHP_METHOD(SplHeap, __debugInfo) /* {{{ */ PHP_METHOD(SplPriorityQueue, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_heap_object_get_debug_info(spl_ce_SplPriorityQueue, Z_OBJ_P(ZEND_THIS))); } /* }}} */ diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 540e5c2c0ff94..801c091fbb42d 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -673,9 +673,7 @@ PHP_METHOD(SplObjectStorage, rewind) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); intern->index = 0; @@ -686,9 +684,7 @@ PHP_METHOD(SplObjectStorage, valid) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS); } /* }}} */ @@ -698,9 +694,7 @@ PHP_METHOD(SplObjectStorage, key) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->index); } /* }}} */ @@ -711,9 +705,7 @@ PHP_METHOD(SplObjectStorage, current) spl_SplObjectStorageElement *element; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) { zend_throw_exception(spl_ce_RuntimeException, "Called current() on invalid iterator", 0); @@ -728,9 +720,7 @@ PHP_METHOD(SplObjectStorage, getInfo) spl_SplObjectStorageElement *element; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) { RETURN_NULL(); @@ -763,9 +753,7 @@ PHP_METHOD(SplObjectStorage, next) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_hash_move_forward_ex(&intern->storage, &intern->pos); intern->index++; @@ -825,9 +813,7 @@ PHP_METHOD(SplObjectStorage, serialize) php_serialize_data_t var_hash; smart_str buf = {0}; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PHP_VAR_SERIALIZE_INIT(var_hash); @@ -999,9 +985,7 @@ PHP_METHOD(SplObjectStorage, __serialize) spl_SplObjectStorageElement *elem; zval tmp; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -1069,9 +1053,7 @@ PHP_METHOD(SplObjectStorage, __unserialize) /* {{{ */ PHP_METHOD(SplObjectStorage, __debugInfo) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_ARR(spl_object_storage_debug_info(Z_OBJ_P(ZEND_THIS))); } @@ -1100,9 +1082,7 @@ PHP_METHOD(MultipleIterator, getFlags) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(intern->flags); } /* }}} */ @@ -1193,9 +1173,7 @@ PHP_METHOD(MultipleIterator, countIterators) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(zend_hash_num_elements(&intern->storage)); } @@ -1208,9 +1186,7 @@ PHP_METHOD(MultipleIterator, rewind) intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) { @@ -1229,9 +1205,7 @@ PHP_METHOD(MultipleIterator, next) intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) { @@ -1252,9 +1226,7 @@ PHP_METHOD(MultipleIterator, valid) intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!zend_hash_num_elements(&intern->storage)) { RETURN_FALSE; @@ -1361,9 +1333,7 @@ PHP_METHOD(MultipleIterator, current) spl_SplObjectStorage *intern; intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value); } @@ -1375,9 +1345,7 @@ PHP_METHOD(MultipleIterator, key) spl_SplObjectStorage *intern; intern = Z_SPLOBJSTORAGE_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value); } From 08ba240c81811dda0dc672c9d6cacb3bb10c5741 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 11:19:29 +0100 Subject: [PATCH 337/386] simplexml: Avoid double lookups and unnecessary allocations in getNamespaces() (#20447) --- ext/simplexml/simplexml.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index d3248bb812086..16a8aaa22fc3a 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1413,14 +1413,10 @@ PHP_METHOD(SimpleXMLElement, asXML) static inline void sxe_add_namespace_name_raw(zval *return_value, const char *prefix, const char *href) { - zend_string *key = zend_string_init(prefix, strlen(prefix), 0); - zval zv; - - if (!zend_hash_exists(Z_ARRVAL_P(return_value), key)) { - ZVAL_STRING(&zv, href); - zend_hash_add_new(Z_ARRVAL_P(return_value), key, &zv); + zval *zv = zend_hash_str_lookup(Z_ARRVAL_P(return_value), prefix, strlen(prefix)); + if (Z_ISNULL_P(zv)) { + ZVAL_STRING(zv, href); } - zend_string_release_ex(key, 0); } static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns) /* {{{ */ From 618e576614004c8853a3660435f8552b0cfbe77b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:41:18 +0100 Subject: [PATCH 338/386] Minor DOM cleanups --- ext/dom/element.c | 9 +-------- ext/dom/node.c | 17 ++++------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ext/dom/element.c b/ext/dom/element.c index cf1a762768a87..797f215e173d1 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1210,19 +1210,17 @@ Since: DOM Level 2 */ PHP_METHOD(DOMElement, getAttributeNodeNS) { - zval *id; xmlNodePtr elemp; xmlAttrPtr attrp; dom_object *intern; size_t uri_len, name_len; char *uri, *name; - id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { RETURN_THROWS(); } - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); + DOM_GET_OBJ(elemp, ZEND_THIS, xmlNodePtr, intern); bool follow_spec = php_dom_follow_spec_intern(intern); if (follow_spec && uri_len == 0) { @@ -1239,16 +1237,11 @@ PHP_METHOD(DOMElement, getAttributeNodeNS) /* Keep parent alive, because we're a fake child. */ GC_ADDREF(&intern->std); (void) php_dom_create_fake_namespace_decl(elemp, nsptr, return_value, intern); - } else { - RETURN_NULL(); } - } else { - RETURN_NULL(); } } else { DOM_RET_OBJ((xmlNodePtr) attrp, intern); } - } /* }}} end dom_element_get_attribute_node_ns */ diff --git a/ext/dom/node.c b/ext/dom/node.c index 40aaf27669268..debc08c4958c7 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1878,8 +1878,7 @@ static void dom_node_lookup_prefix(INTERNAL_FUNCTION_PARAMETERS, bool modern) case XML_DOCUMENT_FRAG_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: - RETURN_NULL(); - break; + return; default: lookupp = nodep->parent; } @@ -1898,8 +1897,6 @@ static void dom_node_lookup_prefix(INTERNAL_FUNCTION_PARAMETERS, bool modern) } } } - - RETURN_NULL(); } PHP_METHOD(DOMNode, lookupPrefix) @@ -2065,16 +2062,14 @@ PHP_METHOD(DOMNode, lookupNamespaceURI) prefix = NULL; } const char *ns_uri = dom_locate_a_namespace(nodep, prefix); - if (ns_uri == NULL) { - RETURN_NULL(); - } else { + if (ns_uri != NULL) { RETURN_STRING(ns_uri); } } else { if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { nodep = xmlDocGetRootElement((xmlDocPtr) nodep); if (nodep == NULL) { - RETURN_NULL(); + return; } } @@ -2083,8 +2078,6 @@ PHP_METHOD(DOMNode, lookupNamespaceURI) RETURN_STRING((char *) nsptr->href); } } - - RETURN_NULL(); } /* }}} end dom_node_lookup_namespace_uri */ @@ -2294,13 +2287,12 @@ static void dom_node_get_node_path(INTERNAL_FUNCTION_PARAMETERS, bool throw) zval *id; xmlNode *nodep; dom_object *intern; - char *value; ZEND_PARSE_PARAMETERS_NONE(); DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); - value = (char *) xmlGetNodePath(nodep); + char *value = (char *) xmlGetNodePath(nodep); if (value == NULL) { /* This is only possible when an invalid argument is passed (e.g. namespace declaration, but that's not the case for this call site), * or on allocation failure. So in other words, this only happens on allocation failure. */ @@ -2308,7 +2300,6 @@ static void dom_node_get_node_path(INTERNAL_FUNCTION_PARAMETERS, bool throw) php_dom_throw_error(INVALID_STATE_ERR, /* strict */ true); RETURN_THROWS(); } - RETURN_NULL(); } else { RETVAL_STRING(value); xmlFree(value); From a596e05cf3563f5f43bf02d39f5c74ab47344273 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:44:13 +0100 Subject: [PATCH 339/386] phar: Make phar_is_tar() and referenced functions const correct (#20451) --- ext/phar/phar.c | 2 +- ext/phar/phar_internal.h | 2 +- ext/phar/tar.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index b7becf27e32db..51b28ec2b7499 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1719,7 +1719,7 @@ static zend_result phar_open_from_fp(php_stream* fp, char *fname, size_t fname_l } if (got >= 512) { - if (phar_is_tar((char *) pos, fname)) { /* TODO: fix const correctness */ + if (phar_is_tar(pos, fname)) { php_stream_rewind(fp); return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, compression, error); } diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index bd3d7158c8e82..5acb0873ebdbc 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -443,7 +443,7 @@ zend_result phar_open_archive_fp(phar_archive_data *phar); zend_result phar_copy_on_write(phar_archive_data **pphar); /* tar functions in tar.c */ -bool phar_is_tar(char *buf, char *fname); +bool phar_is_tar(const char *buf, const char *fname); zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 4847597cce2ea..67994289d0a9f 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -87,10 +87,10 @@ static zend_result phar_tar_octal(char *buf, uint32_t val, size_t len) /* {{{ */ } /* }}} */ -static uint32_t phar_tar_checksum(char *buf, size_t len) /* {{{ */ +static uint32_t phar_tar_checksum(const char *buf, size_t len) /* {{{ */ { uint32_t sum = 0; - char *end = buf + len; + const char *end = buf + len; while (buf != end) { sum += (unsigned char)*buf; @@ -100,7 +100,7 @@ static uint32_t phar_tar_checksum(char *buf, size_t len) /* {{{ */ } /* }}} */ -bool phar_is_tar(char *buf, char *fname) /* {{{ */ +bool phar_is_tar(const char *buf, const char *fname) /* {{{ */ { tar_header *header = (tar_header *) buf; uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum)); From 27a2caa2329a0a5d8ce6f029e27fa900b3ba7b59 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 11 Nov 2025 18:11:54 +0000 Subject: [PATCH 340/386] zend_attributes: add const qualifiers (#20448) --- Zend/zend_attributes.c | 18 +++++++++--------- Zend/zend_attributes.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index b69e192701e48..cba95810ba496 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -38,7 +38,7 @@ static zend_object_handlers attributes_object_handlers_sensitive_parameter_value static HashTable internal_attributes; -uint32_t zend_attribute_attribute_get_flags(zend_attribute *attr, zend_class_entry *scope) +uint32_t zend_attribute_attribute_get_flags(const zend_attribute *attr, zend_class_entry *scope) { // TODO: More proper signature validation: Too many args, incorrect arg names. if (attr->argc > 0) { @@ -265,7 +265,7 @@ ZEND_METHOD(NoDiscard, __construct) } } -static zend_attribute *get_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset) +static zend_attribute *get_attribute(const HashTable *attributes, const zend_string *lcname, uint32_t offset) { if (attributes) { zend_attribute *attr; @@ -280,7 +280,7 @@ static zend_attribute *get_attribute(HashTable *attributes, zend_string *lcname, return NULL; } -static zend_attribute *get_attribute_str(HashTable *attributes, const char *str, size_t len, uint32_t offset) +static zend_attribute *get_attribute_str(const HashTable *attributes, const char *str, size_t len, uint32_t offset) { if (attributes) { zend_attribute *attr; @@ -295,27 +295,27 @@ static zend_attribute *get_attribute_str(HashTable *attributes, const char *str, return NULL; } -ZEND_API zend_attribute *zend_get_attribute(HashTable *attributes, zend_string *lcname) +ZEND_API zend_attribute *zend_get_attribute(const HashTable *attributes, const zend_string *lcname) { return get_attribute(attributes, lcname, 0); } -ZEND_API zend_attribute *zend_get_attribute_str(HashTable *attributes, const char *str, size_t len) +ZEND_API zend_attribute *zend_get_attribute_str(const HashTable *attributes, const char *str, size_t len) { return get_attribute_str(attributes, str, len, 0); } -ZEND_API zend_attribute *zend_get_parameter_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset) +ZEND_API zend_attribute *zend_get_parameter_attribute(const HashTable *attributes, const zend_string *lcname, uint32_t offset) { return get_attribute(attributes, lcname, offset + 1); } -ZEND_API zend_attribute *zend_get_parameter_attribute_str(HashTable *attributes, const char *str, size_t len, uint32_t offset) +ZEND_API zend_attribute *zend_get_parameter_attribute_str(const HashTable *attributes, const char *str, size_t len, uint32_t offset) { return get_attribute_str(attributes, str, len, offset + 1); } -ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope) +ZEND_API zend_result zend_get_attribute_value(zval *ret, const zend_attribute *attr, uint32_t i, zend_class_entry *scope) { if (i >= attr->argc) { return FAILURE; @@ -447,7 +447,7 @@ ZEND_API zend_string *zend_get_attribute_target_names(uint32_t flags) return smart_str_extract(&str); } -ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr) +ZEND_API bool zend_is_attribute_repeated(const HashTable *attributes, const zend_attribute *attr) { zend_attribute *other; diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h index 10227c2d1e8ef..f8b61ac9d1666 100644 --- a/Zend/zend_attributes.h +++ b/Zend/zend_attributes.h @@ -77,17 +77,17 @@ typedef struct _zend_internal_attribute { zend_string* (*validator)(zend_attribute *attr, uint32_t target, zend_class_entry *scope); } zend_internal_attribute; -ZEND_API zend_attribute *zend_get_attribute(HashTable *attributes, zend_string *lcname); -ZEND_API zend_attribute *zend_get_attribute_str(HashTable *attributes, const char *str, size_t len); +ZEND_API zend_attribute *zend_get_attribute(const HashTable *attributes, const zend_string *lcname); +ZEND_API zend_attribute *zend_get_attribute_str(const HashTable *attributes, const char *str, size_t len); -ZEND_API zend_attribute *zend_get_parameter_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset); -ZEND_API zend_attribute *zend_get_parameter_attribute_str(HashTable *attributes, const char *str, size_t len, uint32_t offset); +ZEND_API zend_attribute *zend_get_parameter_attribute(const HashTable *attributes, const zend_string *lcname, uint32_t offset); +ZEND_API zend_attribute *zend_get_parameter_attribute_str(const HashTable *attributes, const char *str, size_t len, uint32_t offset); -ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope); +ZEND_API zend_result zend_get_attribute_value(zval *ret, const zend_attribute *attr, uint32_t i, zend_class_entry *scope); ZEND_API zend_result zend_get_attribute_object(zval *out, zend_class_entry *attribute_ce, zend_attribute *attribute_data, zend_class_entry *scope, zend_string *filename); ZEND_API zend_string *zend_get_attribute_target_names(uint32_t targets); -ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr); +ZEND_API bool zend_is_attribute_repeated(const HashTable *attributes, const zend_attribute *attr); ZEND_API zend_internal_attribute *zend_mark_internal_attribute(zend_class_entry *ce); ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags); @@ -97,7 +97,7 @@ ZEND_API zend_attribute *zend_add_attribute( HashTable **attributes, zend_string *name, uint32_t argc, uint32_t flags, uint32_t offset, uint32_t lineno); -uint32_t zend_attribute_attribute_get_flags(zend_attribute *attr, zend_class_entry *scope); +uint32_t zend_attribute_attribute_get_flags(const zend_attribute *attr, zend_class_entry *scope); END_EXTERN_C() @@ -119,13 +119,13 @@ static zend_always_inline zend_attribute *zend_add_parameter_attribute(zend_func return zend_add_attribute(&func->common.attributes, name, argc, flags, offset + 1, 0); } -static zend_always_inline zend_attribute *zend_add_property_attribute(zend_class_entry *ce, zend_property_info *info, zend_string *name, uint32_t argc) +static zend_always_inline zend_attribute *zend_add_property_attribute(const zend_class_entry *ce, zend_property_info *info, zend_string *name, uint32_t argc) { uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; return zend_add_attribute(&info->attributes, name, argc, flags, 0, 0); } -static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend_class_entry *ce, zend_class_constant *c, zend_string *name, uint32_t argc) +static zend_always_inline zend_attribute *zend_add_class_constant_attribute(const zend_class_entry *ce, zend_class_constant *c, zend_string *name, uint32_t argc) { uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0); From c95a944c1b72dff922061aeee6da36f38aaa04e5 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:15:27 +0100 Subject: [PATCH 341/386] Zend: Factor out is_sensitive check --- Zend/zend_builtin_functions.c | 45 +++++++++++++---------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index d0733fbd8c8b5..9d83a4917d974 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1715,6 +1715,18 @@ ZEND_FUNCTION(get_defined_constants) } /* }}} */ +static bool backtrace_is_arg_sensitive(const zend_execute_data *call, uint32_t offset) +{ + zend_attribute *attribute = zend_get_parameter_attribute_str( + call->func->common.attributes, + "sensitiveparameter", + sizeof("sensitiveparameter") - 1, + offset + ); + + return attribute != NULL; +} + static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /* {{{ */ { uint32_t num_args = ZEND_CALL_NUM_ARGS(call); @@ -1738,14 +1750,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / zend_string *arg_name = call->func->op_array.vars[i]; zval original_arg; zval *arg = zend_hash_find_ex_ind(call->symbol_table, arg_name, 1); - zend_attribute *attribute = zend_get_parameter_attribute_str( - call->func->common.attributes, - "sensitiveparameter", - sizeof("sensitiveparameter") - 1, - i - ); - - bool is_sensitive = attribute != NULL; + bool is_sensitive = backtrace_is_arg_sensitive(call, i); if (arg) { ZVAL_DEREF(arg); @@ -1770,13 +1775,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / } else { while (i < first_extra_arg) { zval original_arg; - zend_attribute *attribute = zend_get_parameter_attribute_str( - call->func->common.attributes, - "sensitiveparameter", - sizeof("sensitiveparameter") - 1, - i - ); - bool is_sensitive = attribute != NULL; + bool is_sensitive = backtrace_is_arg_sensitive(call, i); if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) { zval *arg = p; @@ -1809,13 +1808,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / bool is_sensitive = 0; if (i < call->func->common.num_args || call->func->common.fn_flags & ZEND_ACC_VARIADIC) { - zend_attribute *attribute = zend_get_parameter_attribute_str( - call->func->common.attributes, - "sensitiveparameter", - sizeof("sensitiveparameter") - 1, - MIN(i, call->func->common.num_args) - ); - is_sensitive = attribute != NULL; + is_sensitive = backtrace_is_arg_sensitive(call, MIN(i, call->func->common.num_args)); } if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) { @@ -1852,13 +1845,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / ZEND_ASSERT(call->func->common.fn_flags & ZEND_ACC_VARIADIC); - zend_attribute *attribute = zend_get_parameter_attribute_str( - call->func->common.attributes, - "sensitiveparameter", - sizeof("sensitiveparameter") - 1, - call->func->common.num_args - ); - bool is_sensitive = attribute != NULL; + bool is_sensitive = backtrace_is_arg_sensitive(call, call->func->common.num_args); SEPARATE_ARRAY(arg_array); ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(call->extra_named_params, name, arg) { From f15c7121fb956e84ace73eaef2df9ae442d4c3c1 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:18:22 +0100 Subject: [PATCH 342/386] Zend: Use object_init_with_constructor() for SensitiveParameterValue --- Zend/zend_builtin_functions.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 9d83a4917d974..a1b8a2a161e75 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1761,8 +1761,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / if (is_sensitive) { zval redacted_arg; - object_init_ex(&redacted_arg, zend_ce_sensitive_parameter_value); - zend_call_known_function(Z_OBJCE_P(&redacted_arg)->constructor, Z_OBJ_P(&redacted_arg), Z_OBJCE_P(&redacted_arg), NULL, 1, &original_arg, NULL); + object_init_with_constructor(&redacted_arg, zend_ce_sensitive_parameter_value, 1, &original_arg, NULL); ZEND_HASH_FILL_SET(&redacted_arg); } else { Z_TRY_ADDREF_P(&original_arg); @@ -1787,8 +1786,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / if (is_sensitive) { zval redacted_arg; - object_init_ex(&redacted_arg, zend_ce_sensitive_parameter_value); - zend_call_known_function(Z_OBJCE_P(&redacted_arg)->constructor, Z_OBJ_P(&redacted_arg), Z_OBJCE_P(&redacted_arg), NULL, 1, &original_arg, NULL); + object_init_with_constructor(&redacted_arg, zend_ce_sensitive_parameter_value, 1, &original_arg, NULL); ZEND_HASH_FILL_SET(&redacted_arg); } else { Z_TRY_ADDREF_P(&original_arg); @@ -1821,8 +1819,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / if (is_sensitive) { zval redacted_arg; - object_init_ex(&redacted_arg, zend_ce_sensitive_parameter_value); - zend_call_known_function(Z_OBJCE_P(&redacted_arg)->constructor, Z_OBJ_P(&redacted_arg), Z_OBJCE_P(&redacted_arg), NULL, 1, &original_arg, NULL); + object_init_with_constructor(&redacted_arg, zend_ce_sensitive_parameter_value, 1, &original_arg, NULL); ZEND_HASH_FILL_SET(&redacted_arg); } else { Z_TRY_ADDREF_P(&original_arg); @@ -1852,8 +1849,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) / ZVAL_DEREF(arg); if (is_sensitive) { zval redacted_arg; - object_init_ex(&redacted_arg, zend_ce_sensitive_parameter_value); - zend_call_method_with_1_params(Z_OBJ_P(&redacted_arg), zend_ce_sensitive_parameter_value, &zend_ce_sensitive_parameter_value->constructor, "__construct", NULL, arg); + object_init_with_constructor(&redacted_arg, zend_ce_sensitive_parameter_value, 1, arg, NULL); zend_hash_add_new(Z_ARRVAL_P(arg_array), name, &redacted_arg); } else { Z_TRY_ADDREF_P(arg); From b9562adff6597aa43ed91967c679e4a4ebac95f6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 12 Nov 2025 17:20:41 +0100 Subject: [PATCH 343/386] standard: Simplify array_chunk() (#20423) --- ext/standard/array.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 0389eb1840a96..7bedbdfe59fdc 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -7037,8 +7037,7 @@ PHP_FUNCTION(array_chunk) if (size > num_in) { if (num_in == 0) { - RETVAL_EMPTY_ARRAY(); - return; + RETURN_EMPTY_ARRAY(); } size = num_in; } @@ -7046,12 +7045,11 @@ PHP_FUNCTION(array_chunk) array_init_size(return_value, (uint32_t)(((num_in - 1) / size) + 1)); zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); - ZVAL_UNDEF(&chunk); - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(input), num_key, str_key, entry) { /* If new chunk, create and initialize it. */ - if (Z_TYPE(chunk) == IS_UNDEF) { + if (current == 0) { array_init_size(&chunk, (uint32_t)size); + add_next_index_zval(return_value, &chunk); } /* Add entry to the chunk, preserving keys if necessary. */ @@ -7066,19 +7064,10 @@ PHP_FUNCTION(array_chunk) } zval_add_ref(entry); - /* If reached the chunk size, add it to the result array, and reset the - * pointer. */ if (++current == size) { - add_next_index_zval(return_value, &chunk); - ZVAL_UNDEF(&chunk); current = 0; } } ZEND_HASH_FOREACH_END(); - - /* Add the final chunk if there is one. */ - if (Z_TYPE(chunk) != IS_UNDEF) { - add_next_index_zval(return_value, &chunk); - } } /* }}} */ From 7db647dd9943ee59069847e953c933dd7b4de3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 12 Nov 2025 18:10:21 +0100 Subject: [PATCH 344/386] Verify bundled PCRE2 in CI Closes GH-20354 --- .../actions/verify-generated-files/action.yml | 3 +- .github/scripts/download-bundled/pcre2.sh | 32 ++++++++++++++ .github/scripts/test-directory-unchanged.sh | 13 ++++++ .github/workflows/verify-bundled-files.yml | 43 +++++++++++++++++++ ext/pcre/pcre2lib/pcre2_chartables.c | 12 ++---- 5 files changed, 92 insertions(+), 11 deletions(-) create mode 100755 .github/scripts/download-bundled/pcre2.sh create mode 100755 .github/scripts/test-directory-unchanged.sh create mode 100644 .github/workflows/verify-bundled-files.yml diff --git a/.github/actions/verify-generated-files/action.yml b/.github/actions/verify-generated-files/action.yml index 13f0cf9f128bb..79c49dbfcfffb 100644 --- a/.github/actions/verify-generated-files/action.yml +++ b/.github/actions/verify-generated-files/action.yml @@ -13,5 +13,4 @@ runs: ext/tokenizer/tokenizer_data_gen.php build/gen_stub.php -f --generate-optimizer-info --verify ext/phar/makestub.php - # Use the -a flag for a bug in git 2.46.0, which doesn't consider changed -diff files. - git add . -N && git diff -a --exit-code + .github/scripts/test-directory-unchanged.sh . diff --git a/.github/scripts/download-bundled/pcre2.sh b/.github/scripts/download-bundled/pcre2.sh new file mode 100755 index 0000000000000..b43554206c929 --- /dev/null +++ b/.github/scripts/download-bundled/pcre2.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -ex +cd "$(dirname "$0")/../../.." + +revision=refs/tags/pcre2-10.44 + +git clone --depth 1 --recurse-submodules --revision="$revision" https://github.com/PCRE2Project/pcre2.git /tmp/php-src-bundled/pcre2 + +rm -rf ext/pcre/pcre2lib +cp -R /tmp/php-src-bundled/pcre2/src ext/pcre/pcre2lib + +cd ext/pcre/pcre2lib + +# remove unneeded files +rm config.h.generic +rm pcre2.h.in +rm pcre2_dftables.c +rm pcre2_fuzzsupport.c +rm pcre2_jit_test.c +rm pcre2demo.c +rm pcre2grep.c +rm pcre2posix.c +rm pcre2posix.h +rm pcre2posix_test.c +rm pcre2test.c + +# move renamed files +mv pcre2.h.generic pcre2.h +mv pcre2_chartables.c.dist pcre2_chartables.c + +# add extra files +git restore config.h # based on config.h.generic but with many changes diff --git a/.github/scripts/test-directory-unchanged.sh b/.github/scripts/test-directory-unchanged.sh new file mode 100755 index 0000000000000..0ce7fd4cc4afd --- /dev/null +++ b/.github/scripts/test-directory-unchanged.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -ex + +cd "$(dirname "$0")/../../$1" + +# notify git about untracked (except ignored) files +git add -N . + +# display overview of changed files +git status . + +# display diff of working directory vs HEAD commit and set exit code +git diff -a --exit-code HEAD . diff --git a/.github/workflows/verify-bundled-files.yml b/.github/workflows/verify-bundled-files.yml new file mode 100644 index 0000000000000..e15fcb36a0e7a --- /dev/null +++ b/.github/workflows/verify-bundled-files.yml @@ -0,0 +1,43 @@ +name: Verify Bundled Files + +on: + push: + paths: &paths + - '.github/scripts/download-bundled/pcre2.sh' + - 'ext/pcre/pcre2lib/**' + pull_request: + paths: *paths + schedule: + - cron: "0 1 * * *" + workflow_dispatch: ~ + +permissions: + contents: read + +jobs: + VERIFY_BUNDLED_FILES: + name: Verify Bundled Files + runs-on: ubuntu-24.04 + steps: + - name: git checkout + uses: actions/checkout@v5 + + - name: Detect changed files + uses: dorny/paths-filter@v3 + id: changes + with: + base: master + filters: | + pcre2: + - '.github/scripts/download-bundled/pcre2.sh' + - 'ext/pcre/pcre2lib/**' + + - name: PCRE2 + if: ${{ !cancelled() && (steps.changes.outputs.pcre2 == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} + run: | + echo "::group::Download" + .github/scripts/download-bundled/pcre2.sh + echo "::endgroup::" + echo "::group::Verify files" + .github/scripts/test-directory-unchanged.sh ext/pcre/pcre2lib + echo "::endgroup::" diff --git a/ext/pcre/pcre2lib/pcre2_chartables.c b/ext/pcre/pcre2lib/pcre2_chartables.c index 861914d1ac3ac..7362c3f2345ab 100644 --- a/ext/pcre/pcre2lib/pcre2_chartables.c +++ b/ext/pcre/pcre2lib/pcre2_chartables.c @@ -5,7 +5,8 @@ /* This file was automatically written by the pcre2_dftables auxiliary program. It contains character tables that are used when no external tables are passed to PCRE2 by the application that calls it. The tables -are used only for characters whose code values are less than 256. */ +are used only for characters whose code values are less than 256, and +only relevant if not in UCP mode. */ /* This set of tables was written in the C locale. */ @@ -18,13 +19,6 @@ PCRE2 is configured with --enable-rebuild-chartables. However, you can run pcre2_dftables manually with the -L option to build tables using the LC_ALL locale. */ -/* The following #include is present because without it gcc 4.x may remove -the array definition from the final binary if PCRE2 is built into a static -library and dead code stripping is activated. This leads to link errors. -Pulling in the header ensures that the array gets flagged as "someone -outside this compilation unit might reference this" and so it will always -be supplied to the linker. */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -163,7 +157,7 @@ graph, print, punct, and cntrl. Other classes are built from combinations. */ 0x02 letter 0x04 lower case letter 0x08 decimal digit - 0x10 alphanumeric or '_' + 0x10 word (alphanumeric or '_') */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ From 4743dd673e3c894e93c8344e79b8e80704400742 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 12 Nov 2025 19:33:38 +0100 Subject: [PATCH 345/386] ext/session: Remove unused source files and headers on Windows (#20463) These are only useful on Unix-like environments when libmm is enabled via configuration option. --- ext/session/config.w32 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/session/config.w32 b/ext/session/config.w32 index 825bc8b61d291..40f9f78a313ed 100644 --- a/ext/session/config.w32 +++ b/ext/session/config.w32 @@ -3,10 +3,10 @@ ARG_ENABLE("session", "session support", "yes"); if (PHP_SESSION == "yes") { - EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_EXTENSION_DEP('session', 'date'); // https://bugs.php.net/53141 ADD_EXTENSION_DEP('session', 'spl', true); AC_DEFINE("HAVE_PHP_SESSION", 1, "Define to 1 if the PHP extension 'session' is available."); - PHP_INSTALL_HEADERS("ext/session", "mod_mm.h php_session.h mod_files.h mod_user.h"); + PHP_INSTALL_HEADERS("ext/session", "php_session.h mod_files.h mod_user.h"); } From db8d35e7ebe9d3ea94b8058f29b1eb4b9a7e0f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 12 Nov 2025 21:28:56 +0100 Subject: [PATCH 346/386] tree-wide: Replace `ZEND_WRONG_PARAM_COUNT()` by its definition (#20066) * tree-wide: Replace `WRONG_PARAM_COUNT` by `ZEND_WRONG_PARAM_COUNT()` This is a direct alias. * tree-wide: Replace `ZEND_WRONG_PARAM_COUNT()` by its definition This macro was hiding control flow (the return statement) and thus was particularly unhygienic. --- UPGRADING.INTERNALS | 3 +++ Zend/zend_API.h | 2 -- ext/ldap/ldap.c | 3 ++- ext/spl/spl_directory.c | 3 ++- ext/standard/file.c | 3 ++- ext/standard/string.c | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 88df8f6edb2f5..028779705a736 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -45,6 +45,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES __callStatic zend_function* instead of a CE and a boolean argument. . The zend_set_hash_symbol() API has been removed. . Added zend_hash_str_lookup(). + . The WRONG_PARAM_COUNT and ZEND_WRONG_PARAM_COUNT() macros have been + removed. Call zend_wrong_param_count(); followed by RETURN_THROWS(); + instead. ======================== 2. Build system changes diff --git a/Zend/zend_API.h b/Zend/zend_API.h index e6d5a024cf61b..1bb47a2e8703d 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -523,9 +523,7 @@ ZEND_API const char *zend_get_type_by_const(int type); #define getThis() (hasThis() ? ZEND_THIS : NULL) #define ZEND_IS_METHOD_CALL() (EX(func)->common.scope != NULL) -#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT() #define ZEND_NUM_ARGS() EX_NUM_ARGS() -#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(); return; } #ifndef ZEND_WIN32 #define DLEXPORT diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 366903b2c2ab1..e9acd18990664 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -980,7 +980,8 @@ PHP_FUNCTION(ldap_connect) #ifdef HAVE_ORALDAP if (ZEND_NUM_ARGS() == 3 || ZEND_NUM_ARGS() == 4) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!lssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index c67a6ec4b2824..5ef7540f822d1 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2501,7 +2501,8 @@ PHP_METHOD(SplFileObject, fscanf) int result = php_sscanf_internal(ZSTR_VAL(intern->u.file.current_line), ZSTR_VAL(format_str), (int)num_varargs, varargs, 0, return_value); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */ diff --git a/ext/standard/file.c b/ext/standard/file.c index ab6ed4fbadd2d..fdeabd1872d20 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -961,7 +961,8 @@ PHP_FUNCTION(fscanf) efree(buf); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index ddf4221bf6edb..029c7a29bb478 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5873,7 +5873,8 @@ PHP_FUNCTION(sscanf) result = php_sscanf_internal(str, format, num_args, args, 0, return_value); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */ From 31bd92d2dc152e93de8474ebc217999330537ea1 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 13 Nov 2025 01:34:45 +0000 Subject: [PATCH 347/386] ext/standard/array.c: refactor sort functions (#20462) Consolidate userland functions to rely on a single implementation Split get_comparison functions into a reverse and a normal one Use bool type when applicable --- ext/standard/array.c | 315 ++++++++++++++++--------------------------- 1 file changed, 119 insertions(+), 196 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 7bedbdfe59fdc..54b26a3dadfd5 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -214,7 +214,7 @@ static zend_always_inline int php_array_key_compare_string_unstable_i(Bucket *f, } /* }}} */ -static int php_array_key_compare_string_natural_general(Bucket *f, Bucket *s, int fold_case) /* {{{ */ +static int php_array_key_compare_string_natural_general(Bucket *f, Bucket *s, bool fold_case) /* {{{ */ { const char *s1, *s2; size_t l1, l2; @@ -241,25 +241,25 @@ static int php_array_key_compare_string_natural_general(Bucket *f, Bucket *s, in static int php_array_key_compare_string_natural_case(Bucket *a, Bucket *b) /* {{{ */ { - RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(a, b, 1)); + RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(a, b, true)); } /* }}} */ static int php_array_reverse_key_compare_string_natural_case(Bucket *a, Bucket *b) /* {{{ */ { - RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(b, a, 1)); + RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(b, a, true)); } /* }}} */ static int php_array_key_compare_string_natural(Bucket *a, Bucket *b) /* {{{ */ { - RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(a, b, 0)); + RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(a, b, false)); } /* }}} */ static int php_array_reverse_key_compare_string_natural(Bucket *a, Bucket *b) /* {{{ */ { - RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(b, a, 0)); + RETURN_STABLE_SORT(a, b, php_array_key_compare_string_natural_general(b, a, false)); } /* }}} */ @@ -327,7 +327,7 @@ static zend_always_inline int php_array_data_compare_string_unstable_i(Bucket *f } /* }}} */ -static int php_array_natural_general_compare(Bucket *f, Bucket *s, int fold_case) /* {{{ */ +static int php_array_natural_general_compare(Bucket *f, Bucket *s, bool fold_case) /* {{{ */ { zend_string *tmp_str1, *tmp_str2; zend_string *str1 = zval_get_tmp_string(&f->val, &tmp_str1); @@ -343,13 +343,13 @@ static int php_array_natural_general_compare(Bucket *f, Bucket *s, int fold_case static zend_always_inline int php_array_natural_compare_unstable_i(Bucket *a, Bucket *b) /* {{{ */ { - return php_array_natural_general_compare(a, b, 0); + return php_array_natural_general_compare(a, b, false); } /* }}} */ static zend_always_inline int php_array_natural_case_compare_unstable_i(Bucket *a, Bucket *b) /* {{{ */ { - return php_array_natural_general_compare(a, b, 1); + return php_array_natural_general_compare(a, b, true); } /* }}} */ @@ -372,135 +372,127 @@ DEFINE_SORT_VARIANTS(data_compare_string_locale); DEFINE_SORT_VARIANTS(natural_compare); DEFINE_SORT_VARIANTS(natural_case_compare); -static bucket_compare_func_t php_get_key_compare_func(zend_long sort_type, int reverse) /* {{{ */ +static bucket_compare_func_t php_get_key_compare_func(zend_long sort_type) { switch (sort_type & ~PHP_SORT_FLAG_CASE) { case PHP_SORT_NUMERIC: - if (reverse) { - return php_array_reverse_key_compare_numeric; - } else { - return php_array_key_compare_numeric; - } - break; + return php_array_key_compare_numeric; case PHP_SORT_STRING: if (sort_type & PHP_SORT_FLAG_CASE) { - if (reverse) { - return php_array_reverse_key_compare_string_case; - } else { - return php_array_key_compare_string_case; - } + return php_array_key_compare_string_case; } else { - if (reverse) { - return php_array_reverse_key_compare_string; - } else { - return php_array_key_compare_string; - } + return php_array_key_compare_string; } - break; case PHP_SORT_NATURAL: if (sort_type & PHP_SORT_FLAG_CASE) { - if (reverse) { - return php_array_reverse_key_compare_string_natural_case; - } else { - return php_array_key_compare_string_natural_case; - } + return php_array_key_compare_string_natural_case; } else { - if (reverse) { - return php_array_reverse_key_compare_string_natural; - } else { - return php_array_key_compare_string_natural; - } + return php_array_key_compare_string_natural; } - break; case PHP_SORT_LOCALE_STRING: - if (reverse) { - return php_array_reverse_key_compare_string_locale; - } else { - return php_array_key_compare_string_locale; - } - break; + return php_array_key_compare_string_locale; case PHP_SORT_REGULAR: default: - if (reverse) { - return php_array_reverse_key_compare; - } else { - return php_array_key_compare; - } - break; + return php_array_key_compare; } return NULL; } -/* }}} */ -static bucket_compare_func_t php_get_data_compare_func(zend_long sort_type, int reverse) /* {{{ */ +static bucket_compare_func_t php_get_key_reverse_compare_func(zend_long sort_type) { switch (sort_type & ~PHP_SORT_FLAG_CASE) { case PHP_SORT_NUMERIC: - if (reverse) { - return php_array_reverse_data_compare_numeric; - } else { - return php_array_data_compare_numeric; - } - break; + return php_array_reverse_key_compare_numeric; case PHP_SORT_STRING: if (sort_type & PHP_SORT_FLAG_CASE) { - if (reverse) { - return php_array_reverse_data_compare_string_case; - } else { - return php_array_data_compare_string_case; - } + return php_array_reverse_key_compare_string_case; } else { - if (reverse) { - return php_array_reverse_data_compare_string; - } else { - return php_array_data_compare_string; - } + return php_array_reverse_key_compare_string; } - break; case PHP_SORT_NATURAL: if (sort_type & PHP_SORT_FLAG_CASE) { - if (reverse) { - return php_array_reverse_natural_case_compare; - } else { - return php_array_natural_case_compare; - } + return php_array_reverse_key_compare_string_natural_case; } else { - if (reverse) { - return php_array_reverse_natural_compare; - } else { - return php_array_natural_compare; - } + return php_array_reverse_key_compare_string_natural; } - break; case PHP_SORT_LOCALE_STRING: - if (reverse) { - return php_array_reverse_data_compare_string_locale; + return php_array_reverse_key_compare_string_locale; + + case PHP_SORT_REGULAR: + default: + return php_array_reverse_key_compare; + } + return NULL; +} + +static bucket_compare_func_t php_get_data_compare_func(zend_long sort_type) /* {{{ */ +{ + switch (sort_type & ~PHP_SORT_FLAG_CASE) { + case PHP_SORT_NUMERIC: + return php_array_data_compare_numeric; + + case PHP_SORT_STRING: + if (sort_type & PHP_SORT_FLAG_CASE) { + return php_array_data_compare_string_case; } else { - return php_array_data_compare_string_locale; + return php_array_data_compare_string; } - break; + + case PHP_SORT_NATURAL: + if (sort_type & PHP_SORT_FLAG_CASE) { + return php_array_natural_case_compare; + } else { + return php_array_natural_compare; + } + + case PHP_SORT_LOCALE_STRING: + return php_array_data_compare_string_locale; case PHP_SORT_REGULAR: default: - if (reverse) { - return php_array_reverse_data_compare; + return php_array_data_compare; + } + return NULL; +} + +static bucket_compare_func_t php_get_data_reverse_compare_func(zend_long sort_type) /* {{{ */ +{ + switch (sort_type & ~PHP_SORT_FLAG_CASE) { + case PHP_SORT_NUMERIC: + return php_array_reverse_data_compare_numeric; + + case PHP_SORT_STRING: + if (sort_type & PHP_SORT_FLAG_CASE) { + return php_array_reverse_data_compare_string_case; } else { - return php_array_data_compare; + return php_array_reverse_data_compare_string; } - break; + + case PHP_SORT_NATURAL: + if (sort_type & PHP_SORT_FLAG_CASE) { + return php_array_reverse_natural_case_compare; + } else { + return php_array_reverse_natural_compare; + } + + case PHP_SORT_LOCALE_STRING: + return php_array_reverse_data_compare_string_locale; + + case PHP_SORT_REGULAR: + default: + return php_array_reverse_data_compare; } return NULL; } -/* }}} */ -static bucket_compare_func_t php_get_data_compare_func_unstable(zend_long sort_type, int reverse) /* {{{ */ +static bucket_compare_func_t php_get_data_compare_func_unstable(zend_long sort_type, bool reverse) /* {{{ */ { switch (sort_type & ~PHP_SORT_FLAG_CASE) { case PHP_SORT_NUMERIC: @@ -564,48 +556,6 @@ static bucket_compare_func_t php_get_data_compare_func_unstable(zend_long sort_t } /* }}} */ -/* {{{ Sort an array by key value in reverse order */ -PHP_FUNCTION(krsort) -{ - zval *array; - zend_long sort_type = PHP_SORT_REGULAR; - bucket_compare_func_t cmp; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(sort_type) - ZEND_PARSE_PARAMETERS_END(); - - cmp = php_get_key_compare_func(sort_type, 1); - - zend_hash_sort(Z_ARRVAL_P(array), cmp, 0); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ Sort an array by key */ -PHP_FUNCTION(ksort) -{ - zval *array; - zend_long sort_type = PHP_SORT_REGULAR; - bucket_compare_func_t cmp; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(sort_type) - ZEND_PARSE_PARAMETERS_END(); - - cmp = php_get_key_compare_func(sort_type, 0); - - zend_hash_sort(Z_ARRVAL_P(array), cmp, 0); - - RETURN_TRUE; -} -/* }}} */ - PHPAPI zend_long php_count_recursive(HashTable *ht) /* {{{ */ { zend_long cnt = 0; @@ -702,119 +652,92 @@ PHP_FUNCTION(count) } /* }}} */ -static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) /* {{{ */ +static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, bucket_compare_func_t sort_fn) { - zval *array; + HashTable *array; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY_EX(array, 0, 1) + Z_PARAM_ARRAY_HT_EX(array, 0, 1) ZEND_PARSE_PARAMETERS_END(); - if (fold_case) { - zend_array_sort(Z_ARRVAL_P(array), php_array_natural_case_compare, 0); - } else { - zend_array_sort(Z_ARRVAL_P(array), php_array_natural_compare, 0); - } + zend_array_sort(array, sort_fn, false); RETURN_TRUE; } -/* }}} */ /* {{{ Sort an array using natural sort */ PHP_FUNCTION(natsort) { - php_natsort(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_natsort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_natural_compare); } /* }}} */ /* {{{ Sort an array using case-insensitive natural sort */ PHP_FUNCTION(natcasesort) { - php_natsort(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); + php_natsort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_natural_case_compare); } /* }}} */ -/* {{{ Sort an array and maintain index association */ -PHP_FUNCTION(asort) -{ - zval *array; +typedef bucket_compare_func_t(*get_compare_function)(zend_long); + +static zend_always_inline void php_sort(INTERNAL_FUNCTION_PARAMETERS, get_compare_function get_cmp, bool renumber) { + HashTable *array; zend_long sort_type = PHP_SORT_REGULAR; bucket_compare_func_t cmp; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) + Z_PARAM_ARRAY_HT_EX(array, 0, 1) Z_PARAM_OPTIONAL Z_PARAM_LONG(sort_type) ZEND_PARSE_PARAMETERS_END(); - cmp = php_get_data_compare_func(sort_type, 0); + cmp = get_cmp(sort_type); - zend_array_sort(Z_ARRVAL_P(array), cmp, 0); + zend_array_sort(array, cmp, renumber); RETURN_TRUE; } + +/* {{{ Sort an array and maintain index association */ +PHP_FUNCTION(asort) +{ + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_data_compare_func, false); +} /* }}} */ /* {{{ Sort an array in reverse order and maintain index association */ PHP_FUNCTION(arsort) { - zval *array; - zend_long sort_type = PHP_SORT_REGULAR; - bucket_compare_func_t cmp; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(sort_type) - ZEND_PARSE_PARAMETERS_END(); - - cmp = php_get_data_compare_func(sort_type, 1); - - zend_array_sort(Z_ARRVAL_P(array), cmp, 0); - - RETURN_TRUE; + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_data_reverse_compare_func, false); } /* }}} */ /* {{{ Sort an array */ PHP_FUNCTION(sort) { - zval *array; - zend_long sort_type = PHP_SORT_REGULAR; - bucket_compare_func_t cmp; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(sort_type) - ZEND_PARSE_PARAMETERS_END(); - - cmp = php_get_data_compare_func(sort_type, 0); - - zend_array_sort(Z_ARRVAL_P(array), cmp, 1); - - RETURN_TRUE; + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_data_compare_func, true); } /* }}} */ /* {{{ Sort an array in reverse order */ PHP_FUNCTION(rsort) { - zval *array; - zend_long sort_type = PHP_SORT_REGULAR; - bucket_compare_func_t cmp; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY_EX(array, 0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(sort_type) - ZEND_PARSE_PARAMETERS_END(); - - cmp = php_get_data_compare_func(sort_type, 1); + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_data_reverse_compare_func, true); +} +/* }}} */ - zend_array_sort(Z_ARRVAL_P(array), cmp, 1); +/* {{{ Sort an array by key value in reverse order */ +PHP_FUNCTION(krsort) +{ + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_key_reverse_compare_func, false); +} +/* }}} */ - RETURN_TRUE; +/* {{{ Sort an array by key */ +PHP_FUNCTION(ksort) +{ + php_sort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_get_key_compare_func, false); } /* }}} */ @@ -912,14 +835,14 @@ static void php_usort(INTERNAL_FUNCTION_PARAMETERS, bucket_compare_func_t compar /* {{{ Sort an array by values using a user-defined comparison function */ PHP_FUNCTION(usort) { - php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_compare, 1); + php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_compare, true); } /* }}} */ /* {{{ Sort an array with a user-defined comparison function and maintain index association */ PHP_FUNCTION(uasort) { - php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_compare, 0); + php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_compare, false); } /* }}} */ @@ -986,7 +909,7 @@ static int php_array_user_key_compare(Bucket *a, Bucket *b) /* {{{ */ /* {{{ Sort an array by keys using a user-defined comparison function */ PHP_FUNCTION(uksort) { - php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_key_compare, 0); + php_usort(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_array_user_key_compare, false); } /* }}} */ @@ -5014,7 +4937,7 @@ PHP_FUNCTION(array_unique) return; } - cmp = php_get_data_compare_func_unstable(sort_type, 0); + cmp = php_get_data_compare_func_unstable(sort_type, false); bool in_place = zend_may_modify_arg_in_place(array); if (in_place) { From 94831808af4bf469230e857d2a6cac007f8e6e31 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 13 Nov 2025 08:31:02 +0100 Subject: [PATCH 348/386] xml: Drop unused version function (#20467) --- ext/xml/compat.c | 5 ----- ext/xml/expat_compat.h | 1 - 2 files changed, 6 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 6bdb2695c7d5f..450362ef7efe4 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -652,11 +652,6 @@ XML_GetCurrentByteCount(XML_Parser parser) return (int) XML_GetCurrentByteIndex(parser); } -PHP_XML_API const XML_Char *XML_ExpatVersion(void) -{ - return (const XML_Char *) "1.0"; -} - PHP_XML_API void XML_ParserFree(XML_Parser parser) { diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index 94ca8aeb4c351..1cb6f5d140e5b 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -148,7 +148,6 @@ PHP_XML_API int XML_GetCurrentLineNumber(XML_Parser); PHP_XML_API int XML_GetCurrentColumnNumber(XML_Parser); PHP_XML_API long XML_GetCurrentByteIndex(XML_Parser); PHP_XML_API int XML_GetCurrentByteCount(XML_Parser); -PHP_XML_API const XML_Char *XML_ExpatVersion(void); PHP_XML_API void XML_ParserFree(XML_Parser); #elif defined(HAVE_LIBEXPAT) From 9cd367362da5442861f30d3b41e967d641b90cbd Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 13 Nov 2025 23:33:50 +0100 Subject: [PATCH 349/386] [ci skip] UPGRADING.INTERNALS entry for 94831808 --- UPGRADING.INTERNALS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 028779705a736..1650e6b109000 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -57,6 +57,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES 3. Module changes ======================== +- ext/xml: + . Removed the XML_ExpatVersion() libxml compatibility wrapper, + as it was unused. + ======================== 4. OpCode changes ======================== From 11070509aeff04623a4825b3bbcc55b86a785042 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:23:13 +0100 Subject: [PATCH 350/386] xml: Drop unused XML_GetCurrentByteCount() compatibility wrapper (#20476) --- UPGRADING.INTERNALS | 2 ++ ext/xml/compat.c | 8 -------- ext/xml/expat_compat.h | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 1650e6b109000..33632968368c7 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -60,6 +60,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES - ext/xml: . Removed the XML_ExpatVersion() libxml compatibility wrapper, as it was unused. + . Removed the XML_GetCurrentByteCount() libxml compatibility wrapper, + as it was unused and could return the wrong result. ======================== 4. OpCode changes diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 450362ef7efe4..72a0720bfcb62 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -644,14 +644,6 @@ XML_GetCurrentByteIndex(XML_Parser parser) (parser->parser->input->cur - parser->parser->input->base); } -PHP_XML_API int -XML_GetCurrentByteCount(XML_Parser parser) -{ - /* TODO: this is identical to ByteIndex; it should probably - * be different */ - return (int) XML_GetCurrentByteIndex(parser); -} - PHP_XML_API void XML_ParserFree(XML_Parser parser) { diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index 1cb6f5d140e5b..a7faffbac504f 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -147,7 +147,6 @@ PHP_XML_API const XML_Char *XML_ErrorString(int); PHP_XML_API int XML_GetCurrentLineNumber(XML_Parser); PHP_XML_API int XML_GetCurrentColumnNumber(XML_Parser); PHP_XML_API long XML_GetCurrentByteIndex(XML_Parser); -PHP_XML_API int XML_GetCurrentByteCount(XML_Parser); PHP_XML_API void XML_ParserFree(XML_Parser); #elif defined(HAVE_LIBEXPAT) From 0375060d16bfa21b0d3ce4868bf67114278dda60 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 15 Nov 2025 01:02:11 +0100 Subject: [PATCH 351/386] xml: Don't make copies of the object, remove self-reference (#20471) --- ext/xml/xml.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 813718bb8a229..0b46aa6b2fe2f 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -64,11 +64,7 @@ typedef struct { XML_Parser parser; XML_Char *target_encoding; - /* Reference to the object itself, for convenience. - * It is not owned, do not release it. */ - zval index; - - zend_object *object; + zend_object *object; /* object with handlers */ zend_fcall_info_cache startElementHandler; zend_fcall_info_cache endElementHandler; zend_fcall_info_cache characterDataHandler; @@ -641,7 +637,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha if (ZEND_FCC_INITIALIZED(parser->startElementHandler)) { zval args[3]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); ZVAL_STR(&args[1], xml_stripped_tag(tag_name, parser->toffset)); array_init(&args[2]); @@ -660,7 +656,6 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha } zend_call_known_fcc(&parser->startElementHandler, /* retval */ NULL, /* param_count */ 3, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor(&args[2]); } @@ -742,11 +737,10 @@ void xml_endElementHandler(void *userData, const XML_Char *name) if (ZEND_FCC_INITIALIZED(parser->endElementHandler)) { zval args[2]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); ZVAL_STR(&args[1], xml_stripped_tag(tag_name, parser->toffset)); zend_call_known_fcc(&parser->endElementHandler, /* retval */ NULL, /* param_count */ 2, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); } @@ -803,11 +797,10 @@ void xml_characterDataHandler(void *userData, const XML_Char *s, int len) if (ZEND_FCC_INITIALIZED(parser->characterDataHandler)) { zval args[2]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(s, len, parser->target_encoding, &args[1]); zend_call_known_fcc(&parser->characterDataHandler, /* retval */ NULL, /* param_count */ 2, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); } @@ -911,12 +904,11 @@ void xml_processingInstructionHandler(void *userData, const XML_Char *target, co zval args[3]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(target, 0, parser->target_encoding, &args[1]); xml_xmlchar_zval(data, 0, parser->target_encoding, &args[2]); zend_call_known_fcc(&parser->processingInstructionHandler, /* retval */ NULL, /* param_count */ 3, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor_str(&args[2]); } @@ -933,11 +925,10 @@ void xml_defaultHandler(void *userData, const XML_Char *s, int len) zval args[2]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(s, len, parser->target_encoding, &args[1]); zend_call_known_fcc(&parser->defaultHandler, /* retval */ NULL, /* param_count */ 2, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); } /* }}} */ @@ -955,7 +946,7 @@ void xml_unparsedEntityDeclHandler(void *userData, zval args[6]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(entityName, 0, parser->target_encoding, &args[1]); xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); @@ -963,7 +954,6 @@ void xml_unparsedEntityDeclHandler(void *userData, xml_xmlchar_zval(notationName, 0, parser->target_encoding, &args[5]); zend_call_known_fcc(&parser->unparsedEntityDeclHandler, /* retval */ NULL, /* param_count */ 6, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor_str(&args[2]); zval_ptr_dtor_str(&args[3]); @@ -984,14 +974,13 @@ void xml_notationDeclHandler(void *userData, const XML_Char *notationName, zval args[5]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(notationName, 0, parser->target_encoding, &args[1]); xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]); zend_call_known_fcc(&parser->notationDeclHandler, /* retval */ NULL, /* param_count */ 5, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor_str(&args[2]); zval_ptr_dtor_str(&args[3]); @@ -1013,14 +1002,13 @@ int xml_externalEntityRefHandler(XML_Parser userData, const XML_Char *openEntity zval args[5]; zval retval; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(openEntityNames, 0, parser->target_encoding, &args[1]); xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]); zend_call_known_fcc(&parser->externalEntityRefHandler, /* retval */ &retval, /* param_count */ 5, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor_str(&args[2]); zval_ptr_dtor_str(&args[3]); @@ -1048,12 +1036,11 @@ void xml_startNamespaceDeclHandler(void *userData,const XML_Char *prefix, const zval args[3]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(prefix, 0, parser->target_encoding, &args[1]); xml_xmlchar_zval(uri, 0, parser->target_encoding, &args[2]); zend_call_known_fcc(&parser->startNamespaceDeclHandler, /* retval */ NULL, /* param_count */ 3, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); zval_ptr_dtor_str(&args[2]); } @@ -1070,11 +1057,10 @@ void xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix) zval args[2]; - ZVAL_COPY(&args[0], &parser->index); + ZVAL_OBJ(&args[0], &parser->std); xml_xmlchar_zval(prefix, 0, parser->target_encoding, &args[1]); zend_call_known_fcc(&parser->endNamespaceDeclHandler, /* retval */ NULL, /* param_count */ 2, args, /* named_params */ NULL); - zval_ptr_dtor(&args[0]); zval_ptr_dtor_str(&args[1]); } /* }}} */ @@ -1133,7 +1119,6 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp parser->parsehuge = false; /* It's the default for BC & DoS protection */ XML_SetUserData(parser->parser, parser); - ZVAL_COPY_VALUE(&parser->index, return_value); } /* }}} */ From 94c256f9973e6d3af4ba2e0c9a82ee5e65b66e9d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 15 Nov 2025 18:53:05 +0100 Subject: [PATCH 352/386] Properly silence set-but-unused-var warning --- ext/mbstring/mbstring.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index ceb182a0a258d..7fda240b7051a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -5578,19 +5578,16 @@ static bool mb_check_str_encoding(zend_string *str, const mbfl_encoding *encodin static bool php_mb_check_encoding_recursive(HashTable *vars, const mbfl_encoding *encoding) { - zend_long idx; zend_string *key; zval *entry; bool valid = true; - (void)(idx); /* Suppress spurious compiler warning that `idx` is not used */ - if (GC_IS_RECURSIVE(vars)) { php_error_docref(NULL, E_WARNING, "Cannot not handle circular references"); return false; } GC_TRY_PROTECT_RECURSION(vars); - ZEND_HASH_FOREACH_KEY_VAL(vars, idx, key, entry) { + ZEND_HASH_FOREACH_STR_KEY_VAL(vars, key, entry) { ZVAL_DEREF(entry); if (key) { if (!mb_check_str_encoding(key, encoding)) { From 0194b381d6c0f38e4213910b7fba039923b4883a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 16 Nov 2025 01:17:50 +0100 Subject: [PATCH 353/386] [ci skip] Update my username --- NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 7124d1bc278ae..0b1b0d9da64e1 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,7 @@ PHP NEWS . Added first-class callable cache to share instances for the duration of the request. (ilutov) . It is now possible to use reference assign on WeakMap without the key - needing to be present beforehand. (nielsdos) + needing to be present beforehand. (ndossche) - Hash: . Upgrade xxHash to 0.8.2. (timwolla) @@ -25,9 +25,9 @@ PHP NEWS preloading). (Arnaud, welcomycozyhom) - Phar: - . Support reference values in Phar::mungServer(). (nielsdos) + . Support reference values in Phar::mungServer(). (ndossche) . Invalid values now throw in Phar::mungServer() instead of being silently - ignored. (nielsdos) + ignored. (ndossche) - Reflection: . Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true From 035f95cf5e016236cca11bc293dc04d40b40e45c Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Sun, 16 Nov 2025 09:02:20 +0100 Subject: [PATCH 354/386] Deprecate ZEND_SIZE_MAX and point to SIZE_MAX directly (#19244) --- Zend/zend_types.h | 15 ++------------- ext/standard/formatted_print.c | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Zend/zend_types.h b/Zend/zend_types.h index a3d3e4da6362d..43aa2aa86a00e 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -62,19 +62,8 @@ typedef enum { typedef ZEND_RESULT_CODE zend_result; -#ifdef ZEND_ENABLE_ZVAL_LONG64 -# ifdef ZEND_WIN32 -# define ZEND_SIZE_MAX _UI64_MAX -# else -# define ZEND_SIZE_MAX SIZE_MAX -# endif -#else -# if defined(ZEND_WIN32) -# define ZEND_SIZE_MAX _UI32_MAX -# else -# define ZEND_SIZE_MAX SIZE_MAX -# endif -#endif +/* This constant is deprecated, use SIZE_MAX instead */ +#define ZEND_SIZE_MAX SIZE_MAX #ifdef ZTS #define ZEND_TLS static TSRM_TLS diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index c0246653dfe3f..b0fbfcc89099f 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -103,7 +103,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add, if (req_size > ZSTR_LEN(*buffer)) { size_t size = ZSTR_LEN(*buffer); while (req_size > size) { - if (size > ZEND_SIZE_MAX/2) { + if (size > SIZE_MAX/2) { zend_error_noreturn(E_ERROR, "Field width %zd is too long", req_size); } size <<= 1; From 5bed2a8920f89ce07fdecd44ed845ce544947f50 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 16 Nov 2025 05:57:00 -0800 Subject: [PATCH 355/386] Avoid string copy in ZipArchive::addFromString() (#20497) Instead of copying the data we increment the refcount of the string. --- UPGRADING | 3 +++ ext/zip/php_zip.c | 11 +++++------ ext/zip/php_zip.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/UPGRADING b/UPGRADING index 3b0301522d460..1e84b8beee97a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -130,3 +130,6 @@ PHP 8.6 UPGRADE NOTES . Improved performance of array_walk(). . Improved performance of intval('+0b...', 2) and intval('0b...', 2). . Improved performance of str_split(). + +- Zip: + . Avoid string copies in ZipArchive::addFromString(). diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 40c098d8901ca..06bd41d602c06 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1014,7 +1014,7 @@ static void php_zip_object_free_storage(zend_object *object) /* {{{ */ if (intern->buffers_cnt>0) { for (i=0; ibuffers_cnt; i++) { - efree(intern->buffers[i]); + zend_string_release(intern->buffers[i]); } efree(intern->buffers); } @@ -1868,17 +1868,16 @@ PHP_METHOD(ZipArchive, addFromString) ze_obj = Z_ZIP_P(self); if (ze_obj->buffers_cnt) { - ze_obj->buffers = (char **)safe_erealloc(ze_obj->buffers, sizeof(char *), (ze_obj->buffers_cnt+1), 0); + ze_obj->buffers = safe_erealloc(ze_obj->buffers, sizeof(*ze_obj->buffers), (ze_obj->buffers_cnt + 1), 0); pos = ze_obj->buffers_cnt++; } else { - ze_obj->buffers = (char **)emalloc(sizeof(char *)); + ze_obj->buffers = emalloc(sizeof(*ze_obj->buffers)); ze_obj->buffers_cnt++; pos = 0; } - ze_obj->buffers[pos] = (char *)safe_emalloc(ZSTR_LEN(buffer), 1, 1); - memcpy(ze_obj->buffers[pos], ZSTR_VAL(buffer), ZSTR_LEN(buffer) + 1); + ze_obj->buffers[pos] = zend_string_copy(buffer); - zs = zip_source_buffer(intern, ze_obj->buffers[pos], ZSTR_LEN(buffer), 0); + zs = zip_source_buffer(intern, ZSTR_VAL(buffer), ZSTR_LEN(buffer), 0); if (zs == NULL) { RETURN_FALSE; diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 61e7fb8dad1ea..5dc7bab250042 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -68,7 +68,7 @@ typedef struct _ze_zip_read_rsrc { /* Extends zend object */ typedef struct _ze_zip_object { struct zip *za; - char **buffers; + zend_string **buffers; HashTable *prop_handler; char *filename; int filename_len; From e844700333a3f23f2166afdc5fd955f335d52861 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 13:05:42 +0100 Subject: [PATCH 356/386] ext/standard/tests/filter: Add zlib dependency And remove strange function to check if a filter is available --- ext/standard/tests/filters/filter_errors.inc | 11 ----------- .../filters/filter_errors_convert_base64_decode.phpt | 2 -- .../tests/filters/filter_errors_zlib_inflate.phpt | 4 ++-- ext/standard/tests/filters/gh13264.phpt | 4 ++-- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/ext/standard/tests/filters/filter_errors.inc b/ext/standard/tests/filters/filter_errors.inc index 18711844f834e..e933eea725e2e 100644 --- a/ext/standard/tests/filters/filter_errors.inc +++ b/ext/standard/tests/filters/filter_errors.inc @@ -1,16 +1,5 @@ --FILE-- +--EXTENSIONS-- +zlib --FILE-- +--EXTENSIONS-- +zlib --FILE-- Date: Thu, 2 Oct 2025 18:38:39 +0100 Subject: [PATCH 357/386] Move stream filter tests to ext/standard/tests/filters/ folder --- {Zend/tests => ext/standard/tests/filters}/bug21478.phpt | 0 ext/standard/tests/{file => filters}/bug39551.phpt | 0 ext/standard/tests/{streams => filters}/bug77069.phpt | 0 ext/standard/tests/{streams => filters}/bug77080.phpt | 0 {Zend/tests => ext/standard/tests/filters}/bug78406.phpt | 0 ext/standard/tests/{streams => filters}/bug78506.phpt | 0 ext/standard/tests/{streams => filters}/bug79984.phpt | 0 ext/standard/tests/{streams => filters}/gh17650.phpt | 0 .../tests/{streams => filters}/stream_filter_register.phpt | 0 .../tests/{streams => filters}/stream_multi_filters_close.phpt | 0 .../tests/{streams => filters}/user_streams_consumed_bug.phpt | 0 ext/standard/tests/{file => filters}/userfilters.phpt | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {Zend/tests => ext/standard/tests/filters}/bug21478.phpt (100%) rename ext/standard/tests/{file => filters}/bug39551.phpt (100%) rename ext/standard/tests/{streams => filters}/bug77069.phpt (100%) rename ext/standard/tests/{streams => filters}/bug77080.phpt (100%) rename {Zend/tests => ext/standard/tests/filters}/bug78406.phpt (100%) rename ext/standard/tests/{streams => filters}/bug78506.phpt (100%) rename ext/standard/tests/{streams => filters}/bug79984.phpt (100%) rename ext/standard/tests/{streams => filters}/gh17650.phpt (100%) rename ext/standard/tests/{streams => filters}/stream_filter_register.phpt (100%) rename ext/standard/tests/{streams => filters}/stream_multi_filters_close.phpt (100%) rename ext/standard/tests/{streams => filters}/user_streams_consumed_bug.phpt (100%) rename ext/standard/tests/{file => filters}/userfilters.phpt (100%) diff --git a/Zend/tests/bug21478.phpt b/ext/standard/tests/filters/bug21478.phpt similarity index 100% rename from Zend/tests/bug21478.phpt rename to ext/standard/tests/filters/bug21478.phpt diff --git a/ext/standard/tests/file/bug39551.phpt b/ext/standard/tests/filters/bug39551.phpt similarity index 100% rename from ext/standard/tests/file/bug39551.phpt rename to ext/standard/tests/filters/bug39551.phpt diff --git a/ext/standard/tests/streams/bug77069.phpt b/ext/standard/tests/filters/bug77069.phpt similarity index 100% rename from ext/standard/tests/streams/bug77069.phpt rename to ext/standard/tests/filters/bug77069.phpt diff --git a/ext/standard/tests/streams/bug77080.phpt b/ext/standard/tests/filters/bug77080.phpt similarity index 100% rename from ext/standard/tests/streams/bug77080.phpt rename to ext/standard/tests/filters/bug77080.phpt diff --git a/Zend/tests/bug78406.phpt b/ext/standard/tests/filters/bug78406.phpt similarity index 100% rename from Zend/tests/bug78406.phpt rename to ext/standard/tests/filters/bug78406.phpt diff --git a/ext/standard/tests/streams/bug78506.phpt b/ext/standard/tests/filters/bug78506.phpt similarity index 100% rename from ext/standard/tests/streams/bug78506.phpt rename to ext/standard/tests/filters/bug78506.phpt diff --git a/ext/standard/tests/streams/bug79984.phpt b/ext/standard/tests/filters/bug79984.phpt similarity index 100% rename from ext/standard/tests/streams/bug79984.phpt rename to ext/standard/tests/filters/bug79984.phpt diff --git a/ext/standard/tests/streams/gh17650.phpt b/ext/standard/tests/filters/gh17650.phpt similarity index 100% rename from ext/standard/tests/streams/gh17650.phpt rename to ext/standard/tests/filters/gh17650.phpt diff --git a/ext/standard/tests/streams/stream_filter_register.phpt b/ext/standard/tests/filters/stream_filter_register.phpt similarity index 100% rename from ext/standard/tests/streams/stream_filter_register.phpt rename to ext/standard/tests/filters/stream_filter_register.phpt diff --git a/ext/standard/tests/streams/stream_multi_filters_close.phpt b/ext/standard/tests/filters/stream_multi_filters_close.phpt similarity index 100% rename from ext/standard/tests/streams/stream_multi_filters_close.phpt rename to ext/standard/tests/filters/stream_multi_filters_close.phpt diff --git a/ext/standard/tests/streams/user_streams_consumed_bug.phpt b/ext/standard/tests/filters/user_streams_consumed_bug.phpt similarity index 100% rename from ext/standard/tests/streams/user_streams_consumed_bug.phpt rename to ext/standard/tests/filters/user_streams_consumed_bug.phpt diff --git a/ext/standard/tests/file/userfilters.phpt b/ext/standard/tests/filters/userfilters.phpt similarity index 100% rename from ext/standard/tests/file/userfilters.phpt rename to ext/standard/tests/filters/userfilters.phpt From 9c33091713f8d289c3fc924b8beefd6174b65bb1 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Oct 2025 19:30:20 +0100 Subject: [PATCH 358/386] ext/standard: add a bunch of whacky stream filter tests --- ...er_class_coerce_consumed_by_ref_param.phpt | 32 +++++++++++++++++ ...ter_register_class_completely_invalid.phpt | 33 +++++++++++++++++ ...mpletely_invalid_filtername_prop_type.phpt | 28 +++++++++++++++ ...s_completely_invalid_no_dynamic_props.phpt | 28 +++++++++++++++ ...egister_class_private_filtername_prop.phpt | 28 +++++++++++++++ ...ilter_register_class_throwing_onclose.phpt | 30 ++++++++++++++++ ...lter_register_class_throwing_oncreate.phpt | 27 ++++++++++++++ ...am_filter_register_filter_always_feed.phpt | 24 +++++++++++++ ...eam_filter_register_mock_class_filter.phpt | 30 ++++++++++++++++ ...ock_class_filter_incorect_return_type.phpt | 32 +++++++++++++++++ ...register_mock_class_filter_is_private.phpt | 35 +++++++++++++++++++ ...am_filter_register_non_existing_class.phpt | 21 +++++++++++ 12 files changed, 348 insertions(+) create mode 100644 ext/standard/tests/filters/stream_filter_register_class_coerce_consumed_by_ref_param.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_completely_invalid.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_completely_invalid_filtername_prop_type.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_completely_invalid_no_dynamic_props.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_private_filtername_prop.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_throwing_onclose.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_class_throwing_oncreate.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_filter_always_feed.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_mock_class_filter.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_mock_class_filter_incorect_return_type.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_mock_class_filter_is_private.phpt create mode 100644 ext/standard/tests/filters/stream_filter_register_non_existing_class.phpt diff --git a/ext/standard/tests/filters/stream_filter_register_class_coerce_consumed_by_ref_param.phpt b/ext/standard/tests/filters/stream_filter_register_class_coerce_consumed_by_ref_param.phpt new file mode 100644 index 0000000000000..f5f0ecca79751 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_coerce_consumed_by_ref_param.phpt @@ -0,0 +1,32 @@ +--TEST-- +stream_filter_register() with a class that coerces the $consumed parameter of filter method +--XFAIL-- +This leaks memory +--FILE-- + +--EXPECTF-- +bool(true) +resource(4) of type (stream filter) + +Warning: Object of class stdClass could not be converted to int in %s on line %d + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d +int(1) + +Warning: Object of class stdClass could not be converted to int in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_class_completely_invalid.phpt b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid.phpt new file mode 100644 index 0000000000000..6bd3e7bc1c9dc --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid.phpt @@ -0,0 +1,33 @@ +--TEST-- +stream_filter_register() with a class name that exist but does not extend php_user_filter nor mock anything +--FILE-- + +--EXPECTF-- +bool(true) + +Deprecated: Creation of dynamic property foo::$filtername is deprecated in %s on line %d + +Deprecated: Creation of dynamic property foo::$params is deprecated in %s on line %d +resource(%d) of type (stream filter) + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d + +Fatal error: Uncaught Error: Invalid callback foo::filter, class foo does not have a method "filter" in %s:%d +Stack trace: +#0 %s(%d): fwrite(Resource id #%d, 'Hello\n') +#1 {main} + thrown in %s on line %d + +Fatal error: Invalid callback foo::filter, class foo does not have a method "filter" in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_filtername_prop_type.phpt b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_filtername_prop_type.phpt new file mode 100644 index 0000000000000..793c112791a99 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_filtername_prop_type.phpt @@ -0,0 +1,28 @@ +--TEST-- +stream_filter_register() with a class name exist but does not extend php_user_filter and defines a $filtername prop with different type +--FILE-- + +--EXPECTF-- +bool(true) + +Deprecated: Creation of dynamic property foo::$params is deprecated in %s on line %d + +Fatal error: Uncaught TypeError: Cannot assign string to property foo::$filtername of type array in %s:%d +Stack trace: +#0 %s(%d): stream_filter_append(Resource id #2, 'invalid_filter') +#1 {main} + thrown in %s on line %d + +Fatal error: Invalid callback foo::filter, class foo does not have a method "filter" in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_no_dynamic_props.phpt b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_no_dynamic_props.phpt new file mode 100644 index 0000000000000..86994d5c1b665 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_completely_invalid_no_dynamic_props.phpt @@ -0,0 +1,28 @@ +--TEST-- +stream_filter_register() with a class name exist but does not extend php_user_filter and cannot have dynamic properties +--FILE-- + +--EXPECTF-- +bool(true) + +Fatal error: Uncaught Error: Cannot create dynamic property SensitiveParameter::$filtername in %s:%d +Stack trace: +#0 %s(%d): stream_filter_append(Resource id #%d, 'invalid_filter') +#1 {main} + +Next Error: Cannot create dynamic property SensitiveParameter::$params in %s:%d +Stack trace: +#0 %s(%d): stream_filter_append(Resource id #%d, 'invalid_filter') +#1 {main} + thrown in %s on line %d + +Fatal error: Invalid callback SensitiveParameter::filter, class SensitiveParameter does not have a method "filter" in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_class_private_filtername_prop.phpt b/ext/standard/tests/filters/stream_filter_register_class_private_filtername_prop.phpt new file mode 100644 index 0000000000000..6b9be4bbbb4b7 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_private_filtername_prop.phpt @@ -0,0 +1,28 @@ +--TEST-- +stream_filter_register() with a class name exist but does not extend php_user_filter and defines a private $filtername prop +--FILE-- + +--EXPECTF-- +bool(true) + +Deprecated: Creation of dynamic property foo::$params is deprecated in %s on line %d + +Fatal error: Uncaught Error: Cannot access private property foo::$filtername in %s:%d +Stack trace: +#0 %s(%d): stream_filter_append(Resource id #2, 'invalid_filter') +#1 {main} + thrown in %s on line %d + +Fatal error: Invalid callback foo::filter, class foo does not have a method "filter" in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_class_throwing_onclose.phpt b/ext/standard/tests/filters/stream_filter_register_class_throwing_onclose.phpt new file mode 100644 index 0000000000000..76b925cc0483a --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_throwing_onclose.phpt @@ -0,0 +1,30 @@ +--TEST-- +stream_filter_register() with a class that has a onclose method that throws +--FILE-- + +--EXPECTF-- +bool(true) +resource(4) of type (stream filter) + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d +bool(false) + +Fatal error: Uncaught Exception: No in %s:%d +Stack trace: +#0 [internal function]: foo->onclose() +#1 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/filters/stream_filter_register_class_throwing_oncreate.phpt b/ext/standard/tests/filters/stream_filter_register_class_throwing_oncreate.phpt new file mode 100644 index 0000000000000..3e429a2cc343a --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_class_throwing_oncreate.phpt @@ -0,0 +1,27 @@ +--TEST-- +stream_filter_register() with a class that has a oncreate method that throws +--FILE-- + +--EXPECTF-- +bool(true) + +Fatal error: Uncaught Exception: No in %s:%d +Stack trace: +#0 [internal function]: foo->oncreate() +#1 %s(%d): stream_filter_append(Resource id #2, 'invalid_filter') +#2 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/filters/stream_filter_register_filter_always_feed.phpt b/ext/standard/tests/filters/stream_filter_register_filter_always_feed.phpt new file mode 100644 index 0000000000000..7a3d3f8899938 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_filter_always_feed.phpt @@ -0,0 +1,24 @@ +--TEST-- +stream_filter_register() with a filter method always returning PSFS_FEED_ME +--FILE-- + +--EXPECTF-- +bool(true) +resource(4) of type (stream filter) + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d +int(0) diff --git a/ext/standard/tests/filters/stream_filter_register_mock_class_filter.phpt b/ext/standard/tests/filters/stream_filter_register_mock_class_filter.phpt new file mode 100644 index 0000000000000..4d2309a718eb5 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_mock_class_filter.phpt @@ -0,0 +1,30 @@ +--TEST-- +stream_filter_register() with a class name exist that mocks php_user_filter with a filter method +--XFAIL-- +This leaks memory +--FILE-- + +--EXPECTF-- +bool(true) +resource(4) of type (stream filter) + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d +int(0) diff --git a/ext/standard/tests/filters/stream_filter_register_mock_class_filter_incorect_return_type.phpt b/ext/standard/tests/filters/stream_filter_register_mock_class_filter_incorect_return_type.phpt new file mode 100644 index 0000000000000..b5ec8da3dde1b --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_mock_class_filter_incorect_return_type.phpt @@ -0,0 +1,32 @@ +--TEST-- +stream_filter_register() with a class name exist that mocks php_user_filter with a filter method returning not an int +--FILE-- + +--EXPECTF-- +bool(true) +resource(4) of type (stream filter) + +Warning: Object of class stdClass could not be converted to int in %s on line %d + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d +int(0) + +Warning: Object of class stdClass could not be converted to int in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_mock_class_filter_is_private.phpt b/ext/standard/tests/filters/stream_filter_register_mock_class_filter_is_private.phpt new file mode 100644 index 0000000000000..6abffe1ff5f80 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_mock_class_filter_is_private.phpt @@ -0,0 +1,35 @@ +--TEST-- +stream_filter_register() with a class name exist that mocks php_user_filter with a private filter method +--FILE-- + +--EXPECTF-- +bool(true) +resource(%d) of type (stream filter) + +Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d + +Fatal error: Uncaught Error: Invalid callback foo::filter, cannot access private method foo::filter() in %s:%d +Stack trace: +#0 %s(%d): fwrite(Resource id #%d, 'Hello\n') +#1 {main} + thrown in %s on line %d + +Fatal error: Invalid callback foo::filter, cannot access private method foo::filter() in Unknown on line 0 diff --git a/ext/standard/tests/filters/stream_filter_register_non_existing_class.phpt b/ext/standard/tests/filters/stream_filter_register_non_existing_class.phpt new file mode 100644 index 0000000000000..1c08201cff0c5 --- /dev/null +++ b/ext/standard/tests/filters/stream_filter_register_non_existing_class.phpt @@ -0,0 +1,21 @@ +--TEST-- +stream_filter_register() with a class name that does not exist +--FILE-- + +--EXPECTF-- +bool(true) + +Warning: stream_filter_append(): User-filter "not_existing_filter" requires class "not_existing", but that class is not defined in %s on line %d + +Warning: stream_filter_append(): Unable to create or locate filter "not_existing_filter" in %s on line %d +Hello +int(6) From ac7fddfaccc7069ada009804143e77478290c589 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 16 Nov 2025 14:35:37 +0000 Subject: [PATCH 359/386] ext/zip: further micro optimisations. (#20362) - earlier return on invalid inputs from some ZipArchive methods. - apply comp_flags type check for setCompressionName()/setCompressionIndex(). and throw exception for these - add comp_flags check when passed as userland array option. - adding a wrapper for zip_file_set_encryption workaround. --- ext/zip/php_zip.c | 117 +++++++++++++++++---------- ext/zip/tests/oo_addglob2.phpt | 24 +++++- ext/zip/tests/oo_setcompression.phpt | 28 +++++++ ext/zip/zip_stream.c | 12 +-- 4 files changed, 130 insertions(+), 51 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 06bd41d602c06..49506a198628e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -74,6 +74,17 @@ static int le_zip_entry; # define add_ascii_assoc_string add_assoc_string # define add_ascii_assoc_long add_assoc_long +static bool php_zip_file_set_encryption(struct zip *intern, zend_long index, zend_long method, char *password) { + // FIXME: is a workaround to reset/free the password in case of consecutive calls. + // when libzip 1.11.5 is available, we can save this call in this case. + if (UNEXPECTED(zip_file_set_encryption(intern, (zip_uint64_t)index, ZIP_EM_NONE, NULL) < 0)) { + php_error_docref(NULL, E_WARNING, "password reset failed"); + return false; + } + + return (zip_file_set_encryption(intern, (zip_uint64_t)index, (zip_uint16_t)method, password) == 0); +} + /* Flatten a path by making a relative path (to .)*/ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */ { @@ -367,14 +378,22 @@ static zend_result php_zip_parse_options(HashTable *options, zip_options *opts) php_error_docref(NULL, E_WARNING, "Option \"comp_method\" must be of type int, %s given", zend_zval_value_name(option)); } - opts->comp_method = zval_get_long(option); + zend_long comp_method = zval_get_long(option); + if (comp_method < 0 || comp_method > INT_MAX) { + php_error_docref(NULL, E_WARNING, "Option \"comp_method\" must be between 0 and %d", INT_MAX); + } + opts->comp_method = (zip_int32_t)comp_method; if ((option = zend_hash_str_find(options, "comp_flags", sizeof("comp_flags") - 1)) != NULL) { if (Z_TYPE_P(option) != IS_LONG) { php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be of type int, %s given", zend_zval_value_name(option)); } - opts->comp_flags = zval_get_long(option); + zend_long comp_flags = zval_get_long(option); + if (comp_flags < 0 || comp_flags > USHRT_MAX) { + php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be between 0 and %u", USHRT_MAX); + } + opts->comp_flags = (zip_uint32_t)comp_flags; } } @@ -1752,12 +1771,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* } #ifdef HAVE_ENCRYPTION if (opts.enc_method >= 0) { - if (UNEXPECTED(zip_file_set_encryption(ze_obj->za, ze_obj->last_id, ZIP_EM_NONE, NULL) < 0)) { - zend_array_destroy(Z_ARR_P(return_value)); - php_error_docref(NULL, E_WARNING, "password reset failed"); - RETURN_FALSE; - } - if (zip_file_set_encryption(ze_obj->za, ze_obj->last_id, opts.enc_method, opts.enc_password)) { + if (!php_zip_file_set_encryption(ze_obj->za, ze_obj->last_id, opts.enc_method, opts.enc_password)) { zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } @@ -2279,15 +2293,7 @@ PHP_METHOD(ZipArchive, setEncryptionName) RETURN_FALSE; } - if (UNEXPECTED(zip_file_set_encryption(intern, idx, ZIP_EM_NONE, NULL) < 0)) { - php_error_docref(NULL, E_WARNING, "password reset failed"); - RETURN_FALSE; - } - - if (zip_file_set_encryption(intern, idx, (zip_uint16_t)method, password)) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(php_zip_file_set_encryption(intern, idx, method, password)); } /* }}} */ @@ -2307,12 +2313,7 @@ PHP_METHOD(ZipArchive, setEncryptionIndex) ZIP_FROM_OBJECT(intern, self); - if (UNEXPECTED(zip_file_set_encryption(intern, index, ZIP_EM_NONE, NULL) < 0)) { - php_error_docref(NULL, E_WARNING, "password reset failed"); - RETURN_FALSE; - } - - RETURN_BOOL(zip_file_set_encryption(intern, index, (zip_uint16_t)method, password) == 0); + RETURN_BOOL(php_zip_file_set_encryption(intern, index, method, password)); } /* }}} */ #endif @@ -2390,13 +2391,23 @@ PHP_METHOD(ZipArchive, setCompressionName) RETURN_THROWS(); } - ZIP_FROM_OBJECT(intern, this); - if (name_len == 0) { zend_argument_must_not_be_empty_error(1); RETURN_THROWS(); } + if (comp_method < -1 || comp_method > INT_MAX) { + zend_argument_value_error(2, "must be between -1 and %d", INT_MAX); + RETURN_THROWS(); + } + + if (comp_flags < 0 || comp_flags > USHRT_MAX) { + // comp_flags is cast down accordingly in libzip, zip_entry_t compression_level is of zip_uint16_t + zend_argument_value_error(3, "must be between 0 and %u", USHRT_MAX); + RETURN_THROWS(); + } + + ZIP_FROM_OBJECT(intern, this); idx = zip_name_locate(intern, name, 0); if (idx < 0) { @@ -2421,6 +2432,21 @@ PHP_METHOD(ZipArchive, setCompressionIndex) RETURN_THROWS(); } + if (index < 0) { + RETURN_FALSE; + } + + if (comp_method < -1 || comp_method > INT_MAX) { + zend_argument_value_error(2, "must be between -1 and %d", INT_MAX); + RETURN_THROWS(); + } + + if (comp_flags < 0 || comp_flags > USHRT_MAX) { + // comp_flags is cast down accordingly in libzip, zip_entry_t compression_level is of zip_uint16_t + zend_argument_value_error(3, "must be between 0 and %u", USHRT_MAX); + RETURN_THROWS(); + } + ZIP_FROM_OBJECT(intern, this); RETURN_BOOL(zip_set_file_compression(intern, (zip_uint64_t)index, @@ -2443,13 +2469,13 @@ PHP_METHOD(ZipArchive, setMtimeName) RETURN_THROWS(); } - ZIP_FROM_OBJECT(intern, this); - if (name_len == 0) { zend_argument_must_not_be_empty_error(1); RETURN_THROWS(); } + ZIP_FROM_OBJECT(intern, this); + idx = zip_name_locate(intern, name, 0); if (idx < 0) { @@ -2515,17 +2541,15 @@ PHP_METHOD(ZipArchive, deleteName) RETURN_THROWS(); } - ZIP_FROM_OBJECT(intern, self); - if (name_len < 1) { RETURN_FALSE; } + ZIP_FROM_OBJECT(intern, self); + PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - if (zip_delete(intern, sb.index)) { - RETURN_FALSE; - } - RETURN_TRUE; + + RETURN_BOOL(zip_delete(intern, sb.index) == 0); } /* }}} */ @@ -2546,13 +2570,13 @@ PHP_METHOD(ZipArchive, renameIndex) RETURN_FALSE; } - ZIP_FROM_OBJECT(intern, self); - if (new_name_len == 0) { zend_argument_must_not_be_empty_error(2); RETURN_THROWS(); } + ZIP_FROM_OBJECT(intern, self); + RETURN_BOOL(zip_file_rename(intern, index, (const char *)new_name, 0) == 0); } /* }}} */ @@ -2594,12 +2618,12 @@ PHP_METHOD(ZipArchive, unchangeIndex) RETURN_THROWS(); } - ZIP_FROM_OBJECT(intern, self); - if (index < 0) { RETURN_FALSE; } + ZIP_FROM_OBJECT(intern, self); + RETURN_BOOL(zip_unchange(intern, index) == 0); } /* }}} */ @@ -2617,12 +2641,12 @@ PHP_METHOD(ZipArchive, unchangeName) RETURN_THROWS(); } - ZIP_FROM_OBJECT(intern, self); - if (name_len < 1) { RETURN_FALSE; } + ZIP_FROM_OBJECT(intern, self); + PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); RETURN_BOOL(zip_unchange(intern, sb.index) == 0); @@ -2686,8 +2710,6 @@ PHP_METHOD(ZipArchive, extractTo) Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(files_ht, files_str) ZEND_PARSE_PARAMETERS_END(); - ZIP_FROM_OBJECT(intern, self); - if (pathto_len < 1) { RETURN_FALSE; } @@ -2700,6 +2722,7 @@ PHP_METHOD(ZipArchive, extractTo) } uint32_t nelems, i; + ZIP_FROM_OBJECT(intern, self); if (files_str) { if (!php_zip_extract_file(intern, pathto, ZSTR_VAL(files_str), ZSTR_LEN(files_str), -1)) { @@ -2796,7 +2819,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ RETURN_FALSE; } - buffer = zend_string_safe_alloc(1, len, 0, 0); + buffer = zend_string_safe_alloc(1, len, 0, false); n = zip_fread(zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer)); if (n < 1) { zend_string_efree(buffer); @@ -3005,6 +3028,10 @@ PHP_METHOD(ZipArchive, isCompressionMethodSupported) if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) { return; } + if (method < -1 || method > INT_MAX) { + zend_argument_value_error(1, "must be between -1 and %d", INT_MAX); + RETURN_THROWS(); + } RETVAL_BOOL(zip_compression_method_supported((zip_int32_t)method, enc)); } /* }}} */ @@ -3018,7 +3045,11 @@ PHP_METHOD(ZipArchive, isEncryptionMethodSupported) if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) { return; } - RETVAL_BOOL(zip_encryption_method_supported((zip_uint16_t)method, enc)); + if (method < 0 || method > USHRT_MAX) { + zend_argument_value_error(1, "must be between 0 and %u", USHRT_MAX); + RETURN_THROWS(); + } + RETURN_BOOL(zip_encryption_method_supported((zip_uint16_t)method, enc)); } /* }}} */ #endif diff --git a/ext/zip/tests/oo_addglob2.phpt b/ext/zip/tests/oo_addglob2.phpt index 517c0b7fd7fda..a98a222712052 100644 --- a/ext/zip/tests/oo_addglob2.phpt +++ b/ext/zip/tests/oo_addglob2.phpt @@ -33,10 +33,26 @@ if (!$zip->addGlob($dirname . 'foo.*', GLOB_BRACE, $options)) { $options = [ 'remove_all_path' => true, 'comp_method' => ZipArchive::CM_STORE, - 'comp_flags' => 5, + 'comp_flags' => PHP_INT_MIN, 'enc_method' => ZipArchive::EM_AES_256, 'enc_password' => 'secret', ]; + +try { + $zip->addGlob($dirname. 'bar.*', GLOB_BRACE, $options); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +$options['comp_flags'] = 65536; + +try { + $zip->addGlob($dirname. 'bar.*', GLOB_BRACE, $options); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +$options['comp_flags'] = 5; if (!$zip->addGlob($dirname . 'bar.*', GLOB_BRACE, $options)) { echo "failed 2\n"; } @@ -61,6 +77,10 @@ $dirname = __DIR__ . '/'; include $dirname . 'utils.inc'; rmdir_rf(__DIR__ . '/__tmp_oo_addglob2/'); ?> ---EXPECT-- +--EXPECTF-- + +Warning: ZipArchive::addGlob(): Option "comp_flags" must be between 0 and 65535 in %s on line %d + +Warning: ZipArchive::addGlob(): Option "comp_flags" must be between 0 and 65535 in %s on line %d 0: foo.txt, comp=8, enc=0 1: bar.txt, comp=0, enc=259 diff --git a/ext/zip/tests/oo_setcompression.phpt b/ext/zip/tests/oo_setcompression.phpt index 6b3291463659b..3d90d1e985cdd 100644 --- a/ext/zip/tests/oo_setcompression.phpt +++ b/ext/zip/tests/oo_setcompression.phpt @@ -28,6 +28,30 @@ var_dump($zip->setCompressionName('entry2.txt', ZipArchive::CM_DEFAULT)); var_dump($zip->setCompressionName('dir/entry3.txt', ZipArchive::CM_STORE)); var_dump($zip->setCompressionName('entry4.txt', ZipArchive::CM_DEFLATE)); +try { + $zip->setCompressionName('entry5.txt', PHP_INT_MIN); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +try { + $zip->setCompressionName('entry5.txt', PHP_INT_MAX); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +try { + $zip->setCompressionIndex(4, PHP_INT_MIN); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +try { + $zip->setCompressionIndex(4, PHP_INT_MAX); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + var_dump($zip->setCompressionIndex(4, ZipArchive::CM_STORE)); var_dump($zip->setCompressionIndex(5, ZipArchive::CM_DEFLATE)); var_dump($zip->setCompressionIndex(6, ZipArchive::CM_DEFAULT)); @@ -57,6 +81,10 @@ unlink($tmpfile); bool(true) bool(true) bool(true) +ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d +ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d +ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d +ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d bool(true) bool(true) bool(true) diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index 76e4588f249e5..50f097de3c876 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -150,7 +150,7 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ fragment++; if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) { - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); return -1; } @@ -159,7 +159,7 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ memset(ssb, 0, sizeof(php_stream_statbuf)); if (zip_stat(za, fragment, ZIP_FL_NOCASE, &sb) != 0) { zip_close(za); - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); return -1; } zip_close(za); @@ -183,7 +183,7 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ #endif ssb->sb.st_ino = -1; } - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); return 0; } /* }}} */ @@ -312,7 +312,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, fragment++; if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) { - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); return NULL; } @@ -344,14 +344,14 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, } if (opened_path) { - *opened_path = zend_string_init(path, strlen(path), 0); + *opened_path = zend_string_init(path, path_len, false); } } else { zip_close(za); } } - zend_string_release_ex(file_basename, 0); + zend_string_release_ex(file_basename, false); if (!stream) { return NULL; From bc08fa3b95f3590352da63bb7cf8ab5293aa45db Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Sun, 16 Nov 2025 15:41:00 +0100 Subject: [PATCH 360/386] ext/bz2: use `uint64_t` type instead of conditional defined code --- ext/bz2/bz2.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index e7491f12cf315..200f2fdbf1a09 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -504,11 +504,7 @@ PHP_FUNCTION(bzdecompress) size_t source_len; int error; bool small = 0; -#ifdef PHP_WIN32 - unsigned __int64 size = 0; -#else - unsigned long long size = 0; -#endif + uint64_t size = 0; bz_stream bzs; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &source, &source_len, &small)) { @@ -535,26 +531,22 @@ PHP_FUNCTION(bzdecompress) /* compression is better then 2:1, need to allocate more memory */ bzs.avail_out = source_len; size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; -#ifndef ZEND_ENABLE_ZVAL_LONG64 - if (size > SIZE_MAX) { + if (UNEXPECTED(size > SIZE_MAX)) { /* no reason to continue if we're going to drop it anyway */ break; } -#endif + dest = zend_string_safe_realloc(dest, 1, bzs.avail_out+1, (size_t) size, 0); bzs.next_out = ZSTR_VAL(dest) + size; } if (error == BZ_STREAM_END || error == BZ_OK) { size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; -#ifndef ZEND_ENABLE_ZVAL_LONG64 if (UNEXPECTED(size > SIZE_MAX)) { - php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX); + php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zu", SIZE_MAX); zend_string_efree(dest); RETVAL_LONG(BZ_MEM_ERROR); - } else -#endif - { + } else { dest = zend_string_safe_realloc(dest, 1, (size_t)size, 1, 0); ZSTR_LEN(dest) = (size_t)size; ZSTR_VAL(dest)[(size_t)size] = '\0'; From 88d811708baef9e3014ed195502385c6bf2adba8 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 17 Nov 2025 13:05:22 +0100 Subject: [PATCH 361/386] Remove PHP_HAVE_STREAMS (#20508) This was once an indicator for PHP extensions whether PHP 4.3.0 or later is used. Today, this is redundant. --- UPGRADING.INTERNALS | 1 + main/php.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 33632968368c7..e35557e71f462 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -48,6 +48,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The WRONG_PARAM_COUNT and ZEND_WRONG_PARAM_COUNT() macros have been removed. Call zend_wrong_param_count(); followed by RETURN_THROWS(); instead. + . PHP_HAVE_STREAMS macro removed from . ======================== 2. Build system changes diff --git a/main/php.h b/main/php.h index 8bb47ed275825..32222cfca94e0 100644 --- a/main/php.h +++ b/main/php.h @@ -23,7 +23,6 @@ #endif #define PHP_API_VERSION 20250926 -#define PHP_HAVE_STREAMS #define YYDEBUG 0 #define PHP_DEFAULT_CHARSET "UTF-8" From f411e7fd0f407deaa4ae6780837620174e979264 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 17 Nov 2025 15:18:14 +0100 Subject: [PATCH 362/386] Fix 32-bit failure of ext-zip oo_setcompression.phpt (GH-20511) --- ext/zip/tests/oo_setcompression.phpt | 14 ----------- ext/zip/tests/oo_setcompression_64bit.phpt | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 ext/zip/tests/oo_setcompression_64bit.phpt diff --git a/ext/zip/tests/oo_setcompression.phpt b/ext/zip/tests/oo_setcompression.phpt index 3d90d1e985cdd..1b7e817688dde 100644 --- a/ext/zip/tests/oo_setcompression.phpt +++ b/ext/zip/tests/oo_setcompression.phpt @@ -34,24 +34,12 @@ try { echo $e->getMessage(), PHP_EOL; } -try { - $zip->setCompressionName('entry5.txt', PHP_INT_MAX); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; -} - try { $zip->setCompressionIndex(4, PHP_INT_MIN); } catch (\ValueError $e) { echo $e->getMessage(), PHP_EOL; } -try { - $zip->setCompressionIndex(4, PHP_INT_MAX); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; -} - var_dump($zip->setCompressionIndex(4, ZipArchive::CM_STORE)); var_dump($zip->setCompressionIndex(5, ZipArchive::CM_DEFLATE)); var_dump($zip->setCompressionIndex(6, ZipArchive::CM_DEFAULT)); @@ -82,8 +70,6 @@ bool(true) bool(true) bool(true) ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d -ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d -ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d bool(true) bool(true) diff --git a/ext/zip/tests/oo_setcompression_64bit.phpt b/ext/zip/tests/oo_setcompression_64bit.phpt new file mode 100644 index 0000000000000..cb093e8ccfc9d --- /dev/null +++ b/ext/zip/tests/oo_setcompression_64bit.phpt @@ -0,0 +1,29 @@ +--TEST-- +setCompressionName and setCompressionIndex methods +--EXTENSIONS-- +zip +--SKIPIF-- + +--FILE-- +setCompressionName('entry5.txt', PHP_INT_MAX); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +try { + $zip->setCompressionIndex(4, PHP_INT_MAX); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +?> +--EXPECTF-- +ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d +ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d From 4a12745705bcc863949f9b42abc0981f47052725 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:49:13 -0800 Subject: [PATCH 363/386] xml: Optimize attribute array construction (#20515) Attributes can't be numeric strings by the definition of the grammar, so don't bother with the symbol table stuff. --- ext/xml/xml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 0b46aa6b2fe2f..89c0dcd0dc4a5 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -648,7 +648,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding); ZVAL_STR(&tmp, val); - zend_symtable_update(Z_ARRVAL(args[2]), att, &tmp); + zend_hash_update(Z_ARRVAL(args[2]), att, &tmp); attributes += 2; @@ -688,7 +688,7 @@ void xml_startElementHandler(void *userData, const XML_Char *name, const XML_Cha val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding); ZVAL_STR(&tmp, val); - zend_symtable_update(Z_ARRVAL(atr), att, &tmp); + zend_hash_update(Z_ARRVAL(atr), att, &tmp); atcnt++; attributes += 2; From e929602ed06b33be834984acc072fb2c1f236eab Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 18 Nov 2025 18:32:59 +0000 Subject: [PATCH 364/386] ext/soap: HTTP request micro optimisations. (#20516) smart string is a bit overkill for the cookie id here. --- ext/soap/php_http.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 48305ad627256..63c0093eb05c8 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1014,8 +1014,7 @@ int make_http_soap_request( char *eqpos = strstr(cookie, "="); char *sempos = strstr(cookie, ";"); if (eqpos != NULL && (sempos == NULL || sempos > eqpos)) { - smart_str name = {0}; - int cookie_len; + size_t cookie_len; zval zcookie; if (sempos != NULL) { @@ -1024,8 +1023,7 @@ int make_http_soap_request( cookie_len = strlen(cookie)-(eqpos-cookie)-1; } - smart_str_appendl(&name, cookie, eqpos - cookie); - smart_str_0(&name); + zend_string *name = zend_string_init(cookie, eqpos - cookie, false); array_init(&zcookie); add_index_stringl(&zcookie, 0, eqpos + 1, cookie_len); @@ -1063,8 +1061,8 @@ int make_http_soap_request( GC_ADDREF(uri->host); } - zend_symtable_update(Z_ARRVAL_P(cookies), name.s, &zcookie); - smart_str_free(&name); + zend_symtable_update(Z_ARRVAL_P(cookies), name, &zcookie); + zend_string_release_ex(name, false); } cookie_itt = cookie_itt + cookie_len; From abc1910b4f3e7b6c1f1fb15a6af52aec4c13d311 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 14 Nov 2025 08:12:32 +0000 Subject: [PATCH 365/386] ext/standard/array.c: refactor php_valid_var_name() --- ext/standard/array.c | 85 +++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 53 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 54b26a3dadfd5..d8be2fc1f3024 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1675,9 +1675,8 @@ PHP_FUNCTION(array_search) } /* }}} */ -static zend_always_inline int php_valid_var_name(const char *var_name, size_t var_name_len) /* {{{ */ +static zend_always_inline bool php_valid_var_name(const zend_string *var_name) /* {{{ */ { -#if 1 /* first 256 bits for first character, and second 256 bits for the next */ static const uint32_t charset[8] = { /* 31 0 63 32 95 64 127 96 */ @@ -1687,48 +1686,28 @@ static zend_always_inline int php_valid_var_name(const char *var_name, size_t va /* 31 0 63 32 95 64 127 96 */ 0x00000000, 0x03ff0000, 0x87fffffe, 0x07fffffe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}; -#endif - size_t i; - uint32_t ch; - if (UNEXPECTED(!var_name_len)) { - return 0; + if (UNEXPECTED(!ZSTR_LEN(var_name))) { + return false; } /* These are allowed as first char: [a-zA-Z_\x7f-\xff] */ - ch = (uint32_t)((unsigned char *)var_name)[0]; -#if 1 + uint32_t ch = (uint32_t)((unsigned char *)ZSTR_VAL(var_name))[0]; if (UNEXPECTED(!ZEND_BIT_TEST(charset, ch))) { -#else - if (var_name[0] != '_' && - (ch < 65 /* A */ || /* Z */ ch > 90) && - (ch < 97 /* a */ || /* z */ ch > 122) && - (ch < 127 /* 0x7f */ || /* 0xff */ ch > 255) - ) { -#endif - return 0; + return false; } /* And these as the rest: [a-zA-Z0-9_\x7f-\xff] */ - if (var_name_len > 1) { - i = 1; + if (ZSTR_LEN(var_name) > 1) { + size_t i = 1; do { - ch = (uint32_t)((unsigned char *)var_name)[i]; -#if 1 + ch = (uint32_t)((unsigned char *)ZSTR_VAL(var_name))[i]; if (UNEXPECTED(!ZEND_BIT_TEST(charset2, ch))) { -#else - if (var_name[i] != '_' && - (ch < 48 /* 0 */ || /* 9 */ ch > 57) && - (ch < 65 /* A */ || /* Z */ ch > 90) && - (ch < 97 /* a */ || /* z */ ch > 122) && - (ch < 127 /* 0x7f */ || /* 0xff */ ch > 255) - ) { -#endif - return 0; + return false; } - } while (++i < var_name_len); + } while (++i < ZSTR_LEN(var_name)); } - return 1; + return true; } /* }}} */ @@ -1768,7 +1747,7 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t continue; } } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals_literal(var_name, "GLOBALS")) { @@ -1814,7 +1793,7 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table continue; } } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals_literal(var_name, "GLOBALS")) { @@ -1850,7 +1829,7 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t if (!var_name) { continue; } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -1902,7 +1881,7 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table if (!var_name) { continue; } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -1963,7 +1942,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s } } php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2017,7 +1996,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo } } php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2080,7 +2059,7 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol } prefix: php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2104,7 +2083,7 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol } zval_ptr_dtor_str(&final_name); } else { - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -2152,7 +2131,7 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab } prefix: php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2176,7 +2155,7 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab } zval_ptr_dtor_str(&final_name); } else { - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -2211,7 +2190,7 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_ php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); } - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2258,7 +2237,7 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); } - if (php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (php_valid_var_name(Z_STR(final_name))) { if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { zend_throw_error(NULL, "Cannot re-assign $this"); return -1; @@ -2296,10 +2275,10 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { if (var_name) { - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name)) + if (!php_valid_var_name(var_name) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (!php_valid_var_name(Z_STR(final_name))) { zval_ptr_dtor_str(&final_name); continue; } @@ -2310,7 +2289,7 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym zend_string *str = zend_long_to_str(num_key); php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); - if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (!php_valid_var_name(Z_STR(final_name))) { zval_ptr_dtor_str(&final_name); continue; } @@ -2351,10 +2330,10 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { if (var_name) { - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name)) + if (!php_valid_var_name(var_name) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (!php_valid_var_name(Z_STR(final_name))) { zval_ptr_dtor_str(&final_name); continue; } @@ -2365,7 +2344,7 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ zend_string *str = zend_long_to_str(num_key); php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); zend_string_release_ex(str, 0); - if (!php_valid_var_name(Z_STRVAL(final_name), Z_STRLEN(final_name))) { + if (!php_valid_var_name(Z_STR(final_name))) { zval_ptr_dtor_str(&final_name); continue; } @@ -2410,7 +2389,7 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table) if (!var_name) { continue; } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -2458,7 +2437,7 @@ static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /* if (!var_name) { continue; } - if (!php_valid_var_name(ZSTR_VAL(var_name), ZSTR_LEN(var_name))) { + if (!php_valid_var_name(var_name)) { continue; } if (zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { @@ -2519,7 +2498,7 @@ PHP_FUNCTION(extract) } if (prefix) { - if (ZSTR_LEN(prefix) && !php_valid_var_name(ZSTR_VAL(prefix), ZSTR_LEN(prefix))) { + if (ZSTR_LEN(prefix) && !php_valid_var_name(prefix)) { zend_argument_value_error(3, "must be a valid identifier"); RETURN_THROWS(); } From 6cd80f715f30ee1131eb1660faf45ea0f8e23501 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 14 Nov 2025 08:26:44 +0000 Subject: [PATCH 366/386] ext/standard/array.c: assert on conditions which are always false --- ext/standard/array.c | 267 ++++++++++++++++++++----------------------- 1 file changed, 127 insertions(+), 140 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index d8be2fc1f3024..321a688d1d13e 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1943,26 +1943,24 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s } php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + if (Z_ISREF_P(entry)) { + Z_ADDREF_P(entry); } else { - if (Z_ISREF_P(entry)) { - Z_ADDREF_P(entry); - } else { - ZVAL_MAKE_REF_EX(entry, 2); - } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - zval_ptr_dtor(orig_var); - ZVAL_REF(orig_var, Z_REF_P(entry)); - } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + ZVAL_MAKE_REF_EX(entry, 2); + } + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + zval_ptr_dtor(orig_var); + ZVAL_REF(orig_var, Z_REF_P(entry)); + } else { + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } @@ -1997,26 +1995,24 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo } php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; - } else { - ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); - if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); - return -1; - } - } else { - Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + ZVAL_DEREF(entry); + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); + if (UNEXPECTED(EG(exception))) { + zend_string_release_ex(Z_STR(final_name), 0); + return -1; + } + } else { + Z_TRY_ADDREF_P(entry); + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } @@ -2060,26 +2056,24 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol prefix: php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + if (Z_ISREF_P(entry)) { + Z_ADDREF_P(entry); } else { - if (Z_ISREF_P(entry)) { - Z_ADDREF_P(entry); - } else { - ZVAL_MAKE_REF_EX(entry, 2); - } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - zval_ptr_dtor(orig_var); - ZVAL_REF(orig_var, Z_REF_P(entry)); - } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + ZVAL_MAKE_REF_EX(entry, 2); + } + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + zval_ptr_dtor(orig_var); + ZVAL_REF(orig_var, Z_REF_P(entry)); + } else { + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } else { @@ -2132,26 +2126,24 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab prefix: php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; - } else { - ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); - if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); - return -1; - } - } else { - Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + ZVAL_DEREF(entry); + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); + if (UNEXPECTED(EG(exception))) { + zend_string_release_ex(Z_STR(final_name), 0); + return -1; + } + } else { + Z_TRY_ADDREF_P(entry); + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } else { @@ -2191,26 +2183,24 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_ zend_string_release_ex(str, 0); } if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + if (Z_ISREF_P(entry)) { + Z_ADDREF_P(entry); } else { - if (Z_ISREF_P(entry)) { - Z_ADDREF_P(entry); - } else { - ZVAL_MAKE_REF_EX(entry, 2); - } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - zval_ptr_dtor(orig_var); - ZVAL_REF(orig_var, Z_REF_P(entry)); - } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + ZVAL_MAKE_REF_EX(entry, 2); + } + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + zval_ptr_dtor(orig_var); + ZVAL_REF(orig_var, Z_REF_P(entry)); + } else { + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } ZEND_HASH_FOREACH_END(); @@ -2238,26 +2228,24 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl zend_string_release_ex(str, 0); } if (php_valid_var_name(Z_STR(final_name))) { - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; - } else { - ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); - if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); - return -1; - } - } else { - Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + ZVAL_DEREF(entry); + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); + if (UNEXPECTED(EG(exception))) { + zend_string_release_ex(Z_STR(final_name), 0); + return -1; + } + } else { + Z_TRY_ADDREF_P(entry); + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; } zval_ptr_dtor_str(&final_name); } ZEND_HASH_FOREACH_END(); @@ -2294,26 +2282,25 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym continue; } } - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; + + /* We previously checked if the var name is "this" to prefix it */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + if (Z_ISREF_P(entry)) { + Z_ADDREF_P(entry); } else { - if (Z_ISREF_P(entry)) { - Z_ADDREF_P(entry); - } else { - ZVAL_MAKE_REF_EX(entry, 2); - } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - zval_ptr_dtor(orig_var); - ZVAL_REF(orig_var, Z_REF_P(entry)); - } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + ZVAL_MAKE_REF_EX(entry, 2); + } + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + zval_ptr_dtor(orig_var); + ZVAL_REF(orig_var, Z_REF_P(entry)); + } else { + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; + zval_ptr_dtor_str(&final_name); } ZEND_HASH_FOREACH_END(); @@ -2349,26 +2336,26 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ continue; } } - if (zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))) { - zend_throw_error(NULL, "Cannot re-assign $this"); - return -1; - } else { - ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { - if (Z_TYPE_P(orig_var) == IS_INDIRECT) { - orig_var = Z_INDIRECT_P(orig_var); - } - ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); - if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); - return -1; - } - } else { - Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + + /* We previously checked if the var name is "this" to prefix it */ + ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + + ZVAL_DEREF(entry); + if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if (Z_TYPE_P(orig_var) == IS_INDIRECT) { + orig_var = Z_INDIRECT_P(orig_var); } - count++; + ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); + if (UNEXPECTED(EG(exception))) { + zend_string_release_ex(Z_STR(final_name), 0); + return -1; + } + } else { + Z_TRY_ADDREF_P(entry); + zend_hash_add_new(symbol_table, Z_STR(final_name), entry); } + count++; + zval_ptr_dtor_str(&final_name); } ZEND_HASH_FOREACH_END(); From 8587bb2f93bf5378854542969a78cacf31610f66 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 14 Nov 2025 08:21:02 +0000 Subject: [PATCH 367/386] ext/standard/array.c: refactor php_prefix_varname() --- ext/standard/array.c | 180 ++++++++++++++++----------------- ext/standard/basic_functions.h | 1 - 2 files changed, 87 insertions(+), 94 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 321a688d1d13e..3ccb5d25a9db6 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1711,20 +1711,10 @@ static zend_always_inline bool php_valid_var_name(const zend_string *var_name) / } /* }}} */ -PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore) /* {{{ */ +static zend_string* php_prefix_varname(const zend_string *prefix, const zend_string *var_name) { - ZVAL_NEW_STR(result, zend_string_alloc(ZSTR_LEN(prefix) + (add_underscore ? 1 : 0) + var_name_len, 0)); - memcpy(Z_STRVAL_P(result), ZSTR_VAL(prefix), ZSTR_LEN(prefix)); - - if (add_underscore) { - Z_STRVAL_P(result)[ZSTR_LEN(prefix)] = '_'; - } - - memcpy(Z_STRVAL_P(result) + ZSTR_LEN(prefix) + (add_underscore ? 1 : 0), var_name, var_name_len + 1); - - return SUCCESS; + return zend_string_concat3(ZSTR_VAL(prefix), ZSTR_LEN(prefix), ZEND_STRL("_"), ZSTR_VAL(var_name), ZSTR_LEN(var_name)); } -/* }}} */ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_table) /* {{{ */ { @@ -1917,7 +1907,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s { zend_long count = 0; zend_string *var_name; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; if (HT_IS_PACKED(arr)) { return 0; @@ -1941,28 +1931,28 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s continue; } } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STR(final_name))) { + zend_string *final_name = php_prefix_varname(prefix, var_name); + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); if (Z_ISREF_P(entry)) { Z_ADDREF_P(entry); } else { ZVAL_MAKE_REF_EX(entry, 2); } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } zval_ptr_dtor(orig_var); ZVAL_REF(orig_var, Z_REF_P(entry)); } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } } ZEND_HASH_FOREACH_END(); @@ -1974,7 +1964,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo { zend_long count = 0; zend_string *var_name; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; if (HT_IS_PACKED(arr)) { return 0; @@ -1993,28 +1983,28 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo continue; } } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STR(final_name))) { + zend_string *final_name = php_prefix_varname(prefix, var_name); + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); + zend_string_release_ex(final_name, 0); return -1; } } else { Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } } ZEND_HASH_FOREACH_END(); @@ -2026,7 +2016,7 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol { zend_long count = 0; zend_string *var_name; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; if (HT_IS_PACKED(arr)) { return 0; @@ -2053,29 +2043,29 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol continue; } } -prefix: - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STR(final_name))) { +prefix:; + zend_string *final_name = php_prefix_varname(prefix, var_name); + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); if (Z_ISREF_P(entry)) { Z_ADDREF_P(entry); } else { ZVAL_MAKE_REF_EX(entry, 2); } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } zval_ptr_dtor(orig_var); ZVAL_REF(orig_var, Z_REF_P(entry)); } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } else { if (!php_valid_var_name(var_name)) { continue; @@ -2101,7 +2091,7 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab { zend_long count = 0; zend_string *var_name; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; if (HT_IS_PACKED(arr)) { return 0; @@ -2123,29 +2113,29 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab continue; } } -prefix: - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (php_valid_var_name(Z_STR(final_name))) { +prefix:; + zend_string *final_name = php_prefix_varname(prefix, var_name); + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); + zend_string_release_ex(final_name, false); return -1; } } else { Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } else { if (!php_valid_var_name(var_name)) { continue; @@ -2169,40 +2159,41 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_ zend_long count = 0; zend_string *var_name; zend_ulong num_key; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { + zend_string *final_name; if (var_name) { if (ZSTR_LEN(var_name) == 0) { continue; } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); + final_name = php_prefix_varname(prefix, var_name); } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); - zend_string_release_ex(str, 0); + final_name = php_prefix_varname(prefix, str); + zend_string_release_ex(str, false); } - if (php_valid_var_name(Z_STR(final_name))) { + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); if (Z_ISREF_P(entry)) { Z_ADDREF_P(entry); } else { ZVAL_MAKE_REF_EX(entry, 2); } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } zval_ptr_dtor(orig_var); ZVAL_REF(orig_var, Z_REF_P(entry)); } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } ZEND_HASH_FOREACH_END(); return count; @@ -2214,40 +2205,41 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl zend_long count = 0; zend_string *var_name; zend_ulong num_key; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { + zend_string *final_name; if (var_name) { if (ZSTR_LEN(var_name) == 0) { continue; } - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); + final_name = php_prefix_varname(prefix, var_name); } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); - zend_string_release_ex(str, 0); + final_name = php_prefix_varname(prefix, str); + zend_string_release_ex(str, false); } - if (php_valid_var_name(Z_STR(final_name))) { + if (php_valid_var_name(final_name)) { /* Prefixed varname cannot be equal to "this" due to underscore between prefix and name */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); + zend_string_release_ex(final_name, false); return -1; } } else { Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; } - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } ZEND_HASH_FOREACH_END(); return count; @@ -2259,49 +2251,51 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym zend_long count = 0; zend_string *var_name; zend_ulong num_key; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { + zend_string *final_name; if (var_name) { - if (!php_valid_var_name(var_name) - || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (!php_valid_var_name(Z_STR(final_name))) { - zval_ptr_dtor_str(&final_name); + if (!php_valid_var_name(var_name) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { + final_name = php_prefix_varname(prefix, var_name); + + if (!php_valid_var_name(final_name)) { + zend_string_release_ex(final_name, false); continue; } } else { - ZVAL_STR_COPY(&final_name, var_name); + final_name = zend_string_copy(var_name); } } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); - zend_string_release_ex(str, 0); - if (!php_valid_var_name(Z_STR(final_name))) { - zval_ptr_dtor_str(&final_name); + final_name = php_prefix_varname(prefix, str); + zend_string_release_ex(str, false); + if (!php_valid_var_name(final_name)) { + zend_string_release_ex(final_name, false); continue; } } /* We previously checked if the var name is "this" to prefix it */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); + if (Z_ISREF_P(entry)) { Z_ADDREF_P(entry); } else { ZVAL_MAKE_REF_EX(entry, 2); } - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } zval_ptr_dtor(orig_var); ZVAL_REF(orig_var, Z_REF_P(entry)); } else { - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } ZEND_HASH_FOREACH_END(); return count; @@ -2313,50 +2307,50 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ zend_long count = 0; zend_string *var_name; zend_ulong num_key; - zval *entry, *orig_var, final_name; + zval *entry, *orig_var; ZEND_HASH_FOREACH_KEY_VAL(arr, num_key, var_name, entry) { + zend_string *final_name; if (var_name) { - if (!php_valid_var_name(var_name) - || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { - php_prefix_varname(&final_name, prefix, ZSTR_VAL(var_name), ZSTR_LEN(var_name), true); - if (!php_valid_var_name(Z_STR(final_name))) { - zval_ptr_dtor_str(&final_name); + if (!php_valid_var_name(var_name) || zend_string_equals(var_name, ZSTR_KNOWN(ZEND_STR_THIS))) { + final_name = php_prefix_varname(prefix, var_name); + if (!php_valid_var_name(final_name)) { + zend_string_release_ex(final_name, false); continue; } } else { - ZVAL_STR_COPY(&final_name, var_name); + final_name = zend_string_copy(var_name); } } else { zend_string *str = zend_long_to_str(num_key); - php_prefix_varname(&final_name, prefix, ZSTR_VAL(str), ZSTR_LEN(str), true); + final_name = php_prefix_varname(prefix, str); zend_string_release_ex(str, 0); - if (!php_valid_var_name(Z_STR(final_name))) { - zval_ptr_dtor_str(&final_name); + if (!php_valid_var_name(final_name)) { + zend_string_release_ex(final_name, false); continue; } } /* We previously checked if the var name is "this" to prefix it */ - ZEND_ASSERT(!zend_string_equals(Z_STR(final_name), ZSTR_KNOWN(ZEND_STR_THIS))); + ZEND_ASSERT(!zend_string_equals(final_name, ZSTR_KNOWN(ZEND_STR_THIS))); ZVAL_DEREF(entry); - if ((orig_var = zend_hash_find(symbol_table, Z_STR(final_name))) != NULL) { + if ((orig_var = zend_hash_find(symbol_table, final_name)) != NULL) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) { orig_var = Z_INDIRECT_P(orig_var); } ZEND_TRY_ASSIGN_COPY_EX(orig_var, entry, 0); if (UNEXPECTED(EG(exception))) { - zend_string_release_ex(Z_STR(final_name), 0); + zend_string_release_ex(final_name, false); return -1; } } else { Z_TRY_ADDREF_P(entry); - zend_hash_add_new(symbol_table, Z_STR(final_name), entry); + zend_hash_add_new(symbol_table, final_name, entry); } count++; - zval_ptr_dtor_str(&final_name); + zend_string_release_ex(final_name, false); } ZEND_HASH_FOREACH_END(); return count; diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index bad6fcf4e645e..8c8c6ba58dfd6 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -49,7 +49,6 @@ PHP_RSHUTDOWN_FUNCTION(browscap); /* Left for BC (not binary safe!) */ PHPAPI int _php_error_log(int opt_err, const char *message, const char *opt, const char *headers); PHPAPI int _php_error_log_ex(int opt_err, const char *message, size_t message_len, const char *opt, const char *headers); -PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore); typedef struct _php_basic_globals { HashTable *user_shutdown_function_names; From 095fd26c95baa4025ba811762c1920709dcf93eb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 14 Nov 2025 08:48:07 +0000 Subject: [PATCH 368/386] ext/standard/array.c: add const qualifiers for extract() related functions --- ext/standard/array.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 3ccb5d25a9db6..f1b25387db060 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1716,7 +1716,7 @@ static zend_string* php_prefix_varname(const zend_string *prefix, const zend_str return zend_string_concat3(ZSTR_VAL(prefix), ZSTR_LEN(prefix), ZEND_STRL("_"), ZSTR_VAL(var_name), ZSTR_LEN(var_name)); } -static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_ref_if_exists(const zend_array *arr, const zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -1762,7 +1762,7 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t } /* }}} */ -static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_if_exists(const zend_array *arr, const zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -1806,7 +1806,7 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table } /* }}} */ -static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_ref_overwrite(const zend_array *arr, zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -1858,7 +1858,7 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t } /* }}} */ -static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_overwrite(const zend_array *arr, zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -1903,7 +1903,7 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table } /* }}} */ -static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_ref_prefix_if_exists(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -1960,7 +1960,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s } /* }}} */ -static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_prefix_if_exists(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2012,7 +2012,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo } /* }}} */ -static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_ref_prefix_same(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2087,7 +2087,7 @@ prefix:; } /* }}} */ -static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_prefix_same(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2154,7 +2154,7 @@ prefix:; } /* }}} */ -static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_ref_prefix_all(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2200,7 +2200,7 @@ static zend_long php_extract_ref_prefix_all(zend_array *arr, zend_array *symbol_ } /* }}} */ -static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_prefix_all(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2246,7 +2246,7 @@ static zend_long php_extract_prefix_all(zend_array *arr, zend_array *symbol_tabl } /* }}} */ -static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_ref_prefix_invalid(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2302,7 +2302,7 @@ static zend_long php_extract_ref_prefix_invalid(zend_array *arr, zend_array *sym } /* }}} */ -static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_table, zend_string *prefix) /* {{{ */ +static zend_long php_extract_prefix_invalid(const zend_array *arr, zend_array *symbol_table, const zend_string *prefix) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2357,7 +2357,7 @@ static zend_long php_extract_prefix_invalid(zend_array *arr, zend_array *symbol_ } /* }}} */ -static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_ref_skip(const zend_array *arr, zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; @@ -2405,7 +2405,7 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table) } /* }}} */ -static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /* {{{ */ +static zend_long php_extract_skip(const zend_array *arr, zend_array *symbol_table) /* {{{ */ { zend_long count = 0; zend_string *var_name; From d026e2bca1d544ca2a3698087e5098199ada0bac Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 16 Nov 2025 22:14:15 +0000 Subject: [PATCH 369/386] ext/standard/array.c: add tests when extracting negative keys --- .../tests/array/extract_negative_keys.phpt | 31 +++++++++++++++++++ .../tests/array/extract_negative_keys2.phpt | 11 +++++++ 2 files changed, 42 insertions(+) create mode 100644 ext/standard/tests/array/extract_negative_keys.phpt create mode 100644 ext/standard/tests/array/extract_negative_keys2.phpt diff --git a/ext/standard/tests/array/extract_negative_keys.phpt b/ext/standard/tests/array/extract_negative_keys.phpt new file mode 100644 index 0000000000000..55fce2a656570 --- /dev/null +++ b/ext/standard/tests/array/extract_negative_keys.phpt @@ -0,0 +1,31 @@ +--TEST-- +extract() with negative keys +--FILE-- + 'hello', 'world', 2 => 'positive', 'check' => 'extracted']; + +function foo(array $a) { + extract($a, EXTR_PREFIX_ALL, 'prefix'); + var_dump(get_defined_vars()); +} + +foo($a); +?> +--EXPECT-- +array(3) { + ["a"]=> + array(4) { + [-5]=> + string(5) "hello" + [-4]=> + string(5) "world" + [2]=> + string(8) "positive" + ["check"]=> + string(9) "extracted" + } + ["prefix_2"]=> + string(8) "positive" + ["prefix_check"]=> + string(9) "extracted" +} diff --git a/ext/standard/tests/array/extract_negative_keys2.phpt b/ext/standard/tests/array/extract_negative_keys2.phpt new file mode 100644 index 0000000000000..dd2a1fa7a18a4 --- /dev/null +++ b/ext/standard/tests/array/extract_negative_keys2.phpt @@ -0,0 +1,11 @@ +--TEST-- +extract() with negative keys +--FILE-- + "foo"]; +var_dump(extract($arr, EXTR_PREFIX_ALL | EXTR_REFS, "prefix")); + +?> +--EXPECT-- +int(0) From d40ae97f52b0c026e37072dbd896d67e949b91d3 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 19 Nov 2025 20:42:31 +0000 Subject: [PATCH 370/386] Zend language scanner: minor refactorings (#20480) * Use uint32_t type * Remove some useless size_t casts * Explain why we include zend_globals.h --- Zend/zend_language_scanner.h | 3 ++- Zend/zend_language_scanner.l | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index 612c845479272..c494564ba2349 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -20,6 +20,7 @@ #ifndef ZEND_SCANNER_H #define ZEND_SCANNER_H +/* The zend_php_scanner_event enum is declared in zend_globals and we don't want everything to include zend_language_scanner.h */ #include "zend_globals.h" typedef struct _zend_lex_state { @@ -71,7 +72,7 @@ typedef struct _zend_heredoc_label { /* Track locations of unclosed {, [, (, etc. for better syntax error reporting */ typedef struct _zend_nest_location { char text; - int lineno; + uint32_t lineno; } zend_nest_location; BEGIN_EXTERN_C() diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 3ecb2f8d0ee45..1e26ddbd99199 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -30,6 +30,7 @@ #include "zend_language_scanner_defs.h" #include +#include #include "zend.h" #ifdef ZEND_WIN32 # include @@ -600,7 +601,7 @@ static zend_op_array *zend_compile(int type) CG(ast_arena) = zend_arena_create(1024 * 32); if (!zendparse()) { - int last_lineno = CG(zend_lineno); + uint32_t last_lineno = CG(zend_lineno); zend_file_context original_file_context; zend_oparray_context original_oparray_context; zend_op_array *original_active_op_array = CG(active_op_array); @@ -1140,7 +1141,7 @@ skip_escape_conversion: unsigned char *str; // TODO: avoid realocation ??? s = Z_STRVAL_P(zendlval); - SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval)); + SCNG(output_filter)(&str, &sz, (unsigned char *)s, Z_STRLEN_P(zendlval)); zval_ptr_dtor(zendlval); ZVAL_STRINGL(zendlval, (char *) str, sz); efree(str); @@ -1172,7 +1173,7 @@ static bool strip_multiline_string_indentation( const char *str = Z_STRVAL_P(zendlval), *end = str + Z_STRLEN_P(zendlval); char *copy = Z_STRVAL_P(zendlval); - int newline_count = 0; + uint32_t newline_count = 0; size_t newline_len; const char *nl; @@ -1253,7 +1254,7 @@ static void copy_heredoc_label_stack(void *void_heredoc_label) } /* Check that { }, [ ], ( ) are nested correctly */ -static void report_bad_nesting(char opening, int opening_lineno, char closing) +static void report_bad_nesting(char opening, uint32_t opening_lineno, char closing) { char buf[256]; size_t used = 0; @@ -1361,7 +1362,7 @@ int ZEND_FASTCALL lex_scan(zval *zendlval, zend_parser_stack_elem *elem) { int token; int offset; -int start_line = CG(zend_lineno); +uint32_t start_line = CG(zend_lineno); ZVAL_UNDEF(zendlval); restart: @@ -2499,7 +2500,7 @@ inline_char_handler: if (YYCURSOR < YYLIMIT) { YYCURSOR++; } else { - zend_throw_exception_ex(zend_ce_parse_error, 0, "Unterminated comment starting line %d", CG(zend_lineno)); + zend_throw_exception_ex(zend_ce_parse_error, 0, "Unterminated comment starting line %" PRIu32, CG(zend_lineno)); if (PARSER_MODE()) { RETURN_TOKEN(T_ERROR); } @@ -2616,7 +2617,7 @@ skip_escape_conversion: zend_string *new_str; s = Z_STRVAL_P(zendlval); // TODO: avoid reallocation ??? - SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval)); + SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, Z_STRLEN_P(zendlval)); new_str = zend_string_init(str, sz, 0); if (str != s) { efree(str); From d9d55f011d0d1ecb0a1a5d7e3a19a9dd181f7361 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 20 Nov 2025 15:15:19 +0100 Subject: [PATCH 371/386] ext/gd: Enable HAVE_GD_GET_INTERPOLATION (#20535) Bundled libgd has gdImageGetInterpolationMethod() function. It is available as of libgd 2.1.1. --- ext/gd/config.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 0d024c9ea1cf3..a997238b7f75c 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -265,6 +265,10 @@ if test "$PHP_GD" != "no"; then AC_DEFINE([HAVE_GD_BUNDLED], [1], [Define to 1 if gd extension uses GD library bundled in PHP.]) + AC_DEFINE([HAVE_GD_GET_INTERPOLATION], [1], + [Define to 1 if GD library has the 'gdImageGetInterpolationMethod' + function.]) + dnl Various checks for GD features PHP_SETUP_ZLIB([GD_SHARED_LIBADD]) PHP_GD_PNG From 4e2bd0c5b78072b46b8da01297aa0a61ecd89ab8 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Thu, 20 Nov 2025 19:22:15 +0000 Subject: [PATCH 372/386] ext/soap: SoapClient::__setCookie() to deal with name as digits. (#20526) --- ext/soap/soap.c | 4 ++-- ext/soap/tests/soap_set_cookie.phpt | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 ext/soap/tests/soap_set_cookie.phpt diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 23e74606e996a..471b2d622d98a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2835,12 +2835,12 @@ PHP_METHOD(SoapClient, __setCookie) zval *cookies = Z_CLIENT_COOKIES_P(ZEND_THIS); SEPARATE_ARRAY(cookies); if (val == NULL) { - zend_hash_del(Z_ARRVAL_P(cookies), name); + zend_symtable_del(Z_ARRVAL_P(cookies), name); } else { zval zcookie; array_init(&zcookie); add_index_str(&zcookie, 0, zend_string_copy(val)); - zend_hash_update(Z_ARRVAL_P(cookies), name, &zcookie); + zend_symtable_update(Z_ARRVAL_P(cookies), name, &zcookie); } } /* }}} */ diff --git a/ext/soap/tests/soap_set_cookie.phpt b/ext/soap/tests/soap_set_cookie.phpt new file mode 100644 index 0000000000000..a23aa18bb4b75 --- /dev/null +++ b/ext/soap/tests/soap_set_cookie.phpt @@ -0,0 +1,22 @@ +--TEST-- +SoapClient::__setCookie with numeric keys +--EXTENSIONS-- +soap +--FILE-- + 'mo:http://www.w3.org/', 'location' => 'http://example.com')); +$client->__setCookie("123", "456"); +var_dump($client->__getCookies()); +$client->__setCookie("123", NULL); +var_dump($client->__getCookies()); +?> +--EXPECT-- +array(1) { + [123]=> + array(1) { + [0]=> + string(3) "456" + } +} +array(0) { +} From 586eba94d8a23934200656c2646f2c887a2906a6 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 20 Nov 2025 20:24:31 +0000 Subject: [PATCH 373/386] [skip ci] Forgotten NEWS update --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 0b1b0d9da64e1..604945a77c701 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,10 @@ PHP NEWS . Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true for classes with property hooks). (alexandre-daubois) +- Soap: + . Soap::__setCookie() when cookie name is a digit is now not stored and represented + as a string anymore but a int. (David Carlier) + - Standard: . Fixed bug GH-19926 (reset internal pointer earlier while splicing array while COW violation flag is still set). (alexandre-daubois) From ca7f55600232fdcde8da1cc27167006dca1cf967 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 20 Nov 2025 12:54:38 -0800 Subject: [PATCH 374/386] xml: Use strlen() (#20544) --- ext/xml/xml.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 89c0dcd0dc4a5..7a9329bcc8041 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -131,7 +131,7 @@ inline static char xml_decode_iso_8859_1(unsigned short); inline static unsigned short xml_encode_us_ascii(unsigned char); inline static char xml_decode_us_ascii(unsigned short); static void xml_xmlchar_zval(const XML_Char *, int, const XML_Char *, zval *); -static int xml_xmlcharlen(const XML_Char *); +static size_t xml_xmlcharlen(const XML_Char *); static void xml_add_to_info(xml_parser *parser, zend_string *name); inline static zend_string *xml_decode_tag(xml_parser *parser, const XML_Char *tag); @@ -536,15 +536,9 @@ static zend_string *xml_utf8_decode(const XML_Char *s, size_t len, const XML_Cha /* }}} */ /* {{{ xml_xmlcharlen() */ -static int xml_xmlcharlen(const XML_Char *s) +static size_t xml_xmlcharlen(const XML_Char *s) { - int len = 0; - - while (*s) { - len++; - s++; - } - return len; + return strlen((const char *) s); } /* }}} */ From 3abdef26fe9d4c71e1d7313f38eafbe1fa938aa2 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 22 Nov 2025 08:58:41 -0800 Subject: [PATCH 375/386] VM: Reuse result variable in ICALL_0 implementation (#20561) This reduces the assembly size from 52 to 46 bytes on x86-64 with GCC 15.2.1, strangely. Before: ``` <+0>: sub $0x8,%rsp <+4>: movslq 0x10(%r15),%rax <+8>: movslq 0x10(%r15),%rdi <+12>: mov %r15,(%r14) <+15>: mov 0x14(%r15),%edx <+19>: movl $0x1,0x8(%r14,%rax,1) <+28>: mov 0x140695d(%rip),%rax # 0x1addfe0 <+35>: add %r14,%rdi <+38>: call *(%rax,%rdx,8) <+41>: mov (%r14),%r15 <+44>: add $0x8,%rsp <+48>: add $0x20,%r15 <+52>: ret ``` After: ``` <+0>: sub $0x8,%rsp <+4>: movslq 0x10(%r15),%rdi <+8>: mov 0x14(%r15),%edx <+12>: mov %r15,(%r14) <+15>: mov 0xace58a(%rip),%rax # 0x10d9840 <+22>: add %r14,%rdi <+25>: movl $0x1,0x8(%rdi) <+32>: call *(%rax,%rdx,8) <+35>: mov (%r14),%r15 <+38>: add $0x8,%rsp <+42>: add $0x20,%r15 <+46>: ret ``` --- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 07a0ecf1e2631..1b91f11662c7a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9800,7 +9800,7 @@ ZEND_VM_HANDLER(204, ZEND_FRAMELESS_ICALL_0, UNUSED, UNUSED, SPEC(OBSERVER)) #endif { zend_frameless_function_0 function = (zend_frameless_function_0)ZEND_FLF_HANDLER(opline); - function(EX_VAR(opline->result.var)); + function(result); } ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a6b79495d7c03..801bf0ee69e0d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -39304,7 +39304,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FRAMELESS_ICA #endif { zend_frameless_function_0 function = (zend_frameless_function_0)ZEND_FLF_HANDLER(opline); - function(EX_VAR(opline->result.var)); + function(result); } ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -39324,7 +39324,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FRAMELESS_ICA #endif { zend_frameless_function_0 function = (zend_frameless_function_0)ZEND_FLF_HANDLER(opline); - function(EX_VAR(opline->result.var)); + function(result); } ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -94770,7 +94770,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FRAMELESS_ICALL_0_ #endif { zend_frameless_function_0 function = (zend_frameless_function_0)ZEND_FLF_HANDLER(opline); - function(EX_VAR(opline->result.var)); + function(result); } ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -94790,7 +94790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FRAMELESS_ICALL_0_ #endif { zend_frameless_function_0 function = (zend_frameless_function_0)ZEND_FLF_HANDLER(opline); - function(EX_VAR(opline->result.var)); + function(result); } ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } From 1ee8dfd6fcf02ce7cc3662381e4cfa76de47ec3b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:09:23 -0800 Subject: [PATCH 376/386] Remove pointless EG(exception) checks when parsing coercive string argument (#20568) The is_numeric_str_function() family cannot throw. --- Zend/zend_API.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 4a08952677627..601d753bd2aa6 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -592,9 +592,6 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long return 0; } } - if (UNEXPECTED(EG(exception))) { - return 0; - } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("int", arg_num)) { return 0; @@ -641,9 +638,6 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double * return 0; } } - if (UNEXPECTED(EG(exception))) { - return 0; - } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("float", arg_num)) { return 0; From ada74006907ec630d6dce764ddc2f5d9e0e18331 Mon Sep 17 00:00:00 2001 From: Sayed Zayeem <6727845+returntruejoy@users.noreply.github.com> Date: Thu, 27 Nov 2025 04:53:13 +0600 Subject: [PATCH 377/386] [skip ci] Update year in LICENSE (GH-20598) Co-authored-by: Sayed Zayeem Abdullah --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0815d7eb79119..b155a18c2fb73 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -------------------------------------------------------------------- The PHP License, version 3.01 -Copyright (c) 1999 - 2024 The PHP Group. All rights reserved. +Copyright (c) 1999 - 2025 The PHP Group. All rights reserved. -------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without From dcac024bb0857d97091b1d0e9fb16c9cb41cd505 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 29 Nov 2025 02:21:24 -0800 Subject: [PATCH 378/386] spl: Avoid pointless copies for internal construction calls (#20610) --- ext/spl/spl_directory.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 5ef7540f822d1..ad6fc54aeb3ea 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -480,9 +480,8 @@ static spl_filesystem_object *spl_filesystem_object_create_info(zend_string *fil RETVAL_OBJ(&intern->std); if (ce->constructor->common.scope != spl_ce_SplFileInfo) { - ZVAL_STR_COPY(&arg1, file_path); + ZVAL_STR(&arg1, file_path); zend_call_method_with_1_params(Z_OBJ_P(return_value), ce, &ce->constructor, "__construct", NULL, &arg1); - zval_ptr_dtor(&arg1); } else { spl_filesystem_info_set_filename(intern, file_path); } @@ -520,9 +519,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int num_args, sp } if (ce->constructor->common.scope != spl_ce_SplFileInfo) { - ZVAL_STR_COPY(&arg1, source->file_name); + ZVAL_STR(&arg1, source->file_name); zend_call_method_with_1_params(Z_OBJ_P(return_value), ce, &ce->constructor, "__construct", NULL, &arg1); - zval_ptr_dtor(&arg1); } else { intern->file_name = zend_string_copy(source->file_name); intern->path = spl_filesystem_object_get_path(source); @@ -549,11 +547,9 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int num_args, sp } if (ce->constructor->common.scope != spl_ce_SplFileObject) { - ZVAL_STR_COPY(&arg1, source->file_name); - ZVAL_STR_COPY(&arg2, open_mode); + ZVAL_STR(&arg1, source->file_name); + ZVAL_STR(&arg2, open_mode); zend_call_method_with_2_params(Z_OBJ_P(return_value), ce, &ce->constructor, "__construct", NULL, &arg1, &arg2); - zval_ptr_dtor(&arg1); - zval_ptr_dtor(&arg2); } else { intern->file_name = source->file_name; intern->path = spl_filesystem_object_get_path(source); From 5ae1261c6f8ff2738ab0e9262da0d17cf440e3e7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 29 Nov 2025 02:21:33 -0800 Subject: [PATCH 379/386] phar: Remove dead store (#20611) This is overwritten later anyway by contents_len. --- ext/phar/phar_object.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index acd9aa0cff655..11a0dd17a4e57 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1622,8 +1622,6 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ data->internal_file->offset_abs = data->internal_file->offset = php_stream_tell(p_obj->fp); data->fp = NULL; php_stream_copy_to_stream_ex(fp, p_obj->fp, PHP_STREAM_COPY_ALL, &contents_len); - data->internal_file->uncompressed_filesize = data->internal_file->compressed_filesize = - php_stream_tell(p_obj->fp) - data->internal_file->offset; if (php_stream_stat(fp, &ssb) != -1) { data->internal_file->flags = ssb.sb.st_mode & PHAR_ENT_PERM_MASK ; } else { From 927830da8668d58422b3d16645b3dcce160cd233 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 29 Nov 2025 05:36:59 -0800 Subject: [PATCH 380/386] phar: Remove unused min_timestamp field (#20617) --- ext/phar/phar.c | 10 ++-------- ext/phar/phar_internal.h | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 23624ce6bcc78..30c3b371e6bbd 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1149,15 +1149,9 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname PHAR_GET_32(buffer, entry.uncompressed_filesize); PHAR_GET_32(buffer, entry.timestamp); - if (offset == halt_offset + manifest_len + 4) { - mydata->min_timestamp = entry.timestamp; + if (offset == halt_offset + manifest_len + 4 + || mydata->max_timestamp < entry.timestamp) { mydata->max_timestamp = entry.timestamp; - } else { - if (mydata->min_timestamp > entry.timestamp) { - mydata->min_timestamp = entry.timestamp; - } else if (mydata->max_timestamp < entry.timestamp) { - mydata->max_timestamp = entry.timestamp; - } } PHAR_GET_32(buffer, entry.compressed_filesize); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 46e45ec61b723..5fc4354545318 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -258,7 +258,6 @@ struct _phar_archive_data { /* hash of mounted directory paths */ HashTable mounted_dirs; uint32_t flags; - uint32_t min_timestamp; uint32_t max_timestamp; int refcount; php_stream *fp; From b074c5cc551f3f985cefe0267e50968191403114 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 28 Nov 2025 18:45:32 +0100 Subject: [PATCH 381/386] reflection: Remove dead code Since the executor needs to be active at this point, the only way you could get an UNDEF return value is by having an exception. Therefore, `!EG(exception)` is always false. The check doesn't make sense, remove it. --- ext/reflection/php_reflection.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a86ce16feb407..3327fdc7f6f6d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2141,12 +2141,6 @@ ZEND_METHOD(ReflectionFunction, invoke) zend_call_known_fcc(&fcc, &retval, num_args, params, named_params); - if (Z_TYPE(retval) == IS_UNDEF && !EG(exception)) { - zend_throw_exception_ex(reflection_exception_ptr, 0, - "Invocation of function %s() failed", ZSTR_VAL(fptr->common.function_name)); - RETURN_THROWS(); - } - if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } @@ -2180,12 +2174,6 @@ ZEND_METHOD(ReflectionFunction, invokeArgs) zend_call_known_fcc(&fcc, &retval, /* num_params */ 0, /* params */ NULL, params); - if (Z_TYPE(retval) == IS_UNDEF && !EG(exception)) { - zend_throw_exception_ex(reflection_exception_ptr, 0, - "Invocation of function %s() failed", ZSTR_VAL(fptr->common.function_name)); - RETURN_THROWS(); - } - if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } @@ -3496,12 +3484,6 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) callback = _copy_function(mptr); zend_call_known_function(callback, (object ? Z_OBJ_P(object) : NULL), intern->ce, &retval, argc, params, named_params); - if (Z_TYPE(retval) == IS_UNDEF && !EG(exception)) { - zend_throw_exception_ex(reflection_exception_ptr, 0, - "Invocation of method %s::%s() failed", ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name)); - RETURN_THROWS(); - } - if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } From b64cd429ca4f6cadf9220c0a0cba4afbfe101687 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 28 Nov 2025 18:46:52 +0100 Subject: [PATCH 382/386] reflection: Use RETURN_COPY_VALUE() --- ext/reflection/php_reflection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 3327fdc7f6f6d..05454b24c4e68 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2144,7 +2144,7 @@ ZEND_METHOD(ReflectionFunction, invoke) if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } - ZVAL_COPY_VALUE(return_value, &retval); + RETURN_COPY_VALUE(&retval); } /* }}} */ @@ -2177,7 +2177,7 @@ ZEND_METHOD(ReflectionFunction, invokeArgs) if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } - ZVAL_COPY_VALUE(return_value, &retval); + RETURN_COPY_VALUE(&retval); } /* }}} */ @@ -3487,7 +3487,7 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) if (Z_ISREF(retval)) { zend_unwrap_reference(&retval); } - ZVAL_COPY_VALUE(return_value, &retval); + RETURN_COPY_VALUE(&retval); } /* }}} */ From e025f2a14846ed5f9a83df7ed811aaf3043a4dd4 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:39:04 -0800 Subject: [PATCH 383/386] reflection: Test ReflectionFunction::__toString() with bound variables (#20608) --- ...ionFunction__toString_bound_variables.phpt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ext/reflection/tests/ReflectionFunction__toString_bound_variables.phpt diff --git a/ext/reflection/tests/ReflectionFunction__toString_bound_variables.phpt b/ext/reflection/tests/ReflectionFunction__toString_bound_variables.phpt new file mode 100644 index 0000000000000..142e661361496 --- /dev/null +++ b/ext/reflection/tests/ReflectionFunction__toString_bound_variables.phpt @@ -0,0 +1,32 @@ +--TEST-- +ReflectionFunction::__toString() with bound variables +--FILE-- + 0; + +$rf = new ReflectionFunction($closure_without_bounds); +echo (string) $rf; + +$global = ""; +$closure_with_bounds = function() use($global) { + static $counter = 0; + return $counter++; +}; + +$rf = new ReflectionFunction($closure_with_bounds); +echo (string) $rf; + +?> +--EXPECTF-- +Closure [ function {closure:%s:%d} ] { + @@ %sReflectionFunction__toString_bound_variables.php 3 - 3 +} +Closure [ function {closure:%s:%d} ] { + @@ %sReflectionFunction__toString_bound_variables.php 9 - 12 + + - Bound Variables [2] { + Variable #0 [ $global ] + Variable #1 [ $counter ] + } +} From 13bf672cdb1bcd9684225f6f0473c071434bdc8c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 28 Nov 2025 19:03:22 +0100 Subject: [PATCH 384/386] reflection: Use zend_hash_str_find_ptr_lc() where possible --- ext/reflection/php_reflection.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 05454b24c4e68..4cf3edd47375e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1432,13 +1432,7 @@ static void reflection_extension_factory_ex(zval *object, zend_module_entry *mod static void reflection_extension_factory(zval *object, const char *name_str) { size_t name_len = strlen(name_str); - zend_string *lcname; - struct _zend_module_entry *module; - - lcname = zend_string_alloc(name_len, 0); - zend_str_tolower_copy(ZSTR_VAL(lcname), name_str, name_len); - module = zend_hash_find_ptr(&module_registry, lcname); - zend_string_efree(lcname); + struct _zend_module_entry *module = zend_hash_str_find_ptr_lc(&module_registry, name_str, name_len); if (!module) { return; } @@ -6643,12 +6637,10 @@ ZEND_METHOD(ReflectionProperty, isFinal) ZEND_METHOD(ReflectionExtension, __construct) { zval *object; - char *lcname; reflection_object *intern; zend_module_entry *module; char *name_str; size_t name_len; - ALLOCA_FLAG(use_heap) if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) { RETURN_THROWS(); @@ -6656,15 +6648,11 @@ ZEND_METHOD(ReflectionExtension, __construct) object = ZEND_THIS; intern = Z_REFLECTION_P(object); - lcname = do_alloca(name_len + 1, use_heap); - zend_str_tolower_copy(lcname, name_str, name_len); - if ((module = zend_hash_str_find_ptr(&module_registry, lcname, name_len)) == NULL) { - free_alloca(lcname, use_heap); + if ((module = zend_hash_str_find_ptr_lc(&module_registry, name_str, name_len)) == NULL) { zend_throw_exception_ex(reflection_exception_ptr, 0, "Extension \"%s\" does not exist", name_str); RETURN_THROWS(); } - free_alloca(lcname, use_heap); zval *prop_name = reflection_prop_name(object); zval_ptr_dtor(prop_name); ZVAL_STRING(prop_name, module->name); From 157864af49eab6561e02412e7838d9a195968efe Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 28 Nov 2025 19:47:44 +0100 Subject: [PATCH 385/386] reflection: Use zend_hash_find_ptr_lc() where possible --- ext/reflection/php_reflection.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4cf3edd47375e..d6e55c982b425 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6639,18 +6639,17 @@ ZEND_METHOD(ReflectionExtension, __construct) zval *object; reflection_object *intern; zend_module_entry *module; - char *name_str; - size_t name_len; + zend_string *name_str; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name_str) == FAILURE) { RETURN_THROWS(); } object = ZEND_THIS; intern = Z_REFLECTION_P(object); - if ((module = zend_hash_str_find_ptr_lc(&module_registry, name_str, name_len)) == NULL) { + if ((module = zend_hash_find_ptr_lc(&module_registry, name_str)) == NULL) { zend_throw_exception_ex(reflection_exception_ptr, 0, - "Extension \"%s\" does not exist", name_str); + "Extension \"%s\" does not exist", ZSTR_VAL(name_str)); RETURN_THROWS(); } zval *prop_name = reflection_prop_name(object); From 6b197ee4edfcd8c9bc2d0cc9d89f663b21187594 Mon Sep 17 00:00:00 2001 From: Tobias Vorwachs Date: Tue, 18 Nov 2025 17:15:06 +0100 Subject: [PATCH 386/386] mbstring: fix missing copying of detect_order_list to current_detect_order_list on ini_set('mbstring.detect_order', string) Closes GH-20523. --- NEWS | 4 ++ UPGRADING | 7 +++ ext/mbstring/mbstring.c | 10 ++++ .../tests/mb_detect_order_with_ini_set.phpt | 60 +++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 ext/mbstring/tests/mb_detect_order_with_ini_set.phpt diff --git a/NEWS b/NEWS index 604945a77c701..18d931bccded7 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,10 @@ PHP NEWS . Fixed bug GH-20483 (ASAN stack overflow with fiber.stack_size INI small value). (David Carlier) +- Mbstring: + . ini_set() with mbstring.detect_order changes the order of mb_detect_order + as intended, since mbstring.detect_order is an INI_ALL setting. (tobee94) + - Opcache: . Fixed bug GH-20051 (apache2 shutdowns when restart is requested during preloading). (Arnaud, welcomycozyhom) diff --git a/UPGRADING b/UPGRADING index 1e84b8beee97a..7f0fcaf8943a8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -98,6 +98,13 @@ PHP 8.6 UPGRADE NOTES When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit points is printed in exit info output, in debug builds. +- Mbstring: + . The mbstring.detect_order INI directive now updates the internal detection + order when changed at runtime via ini_set(). Previously, runtime changes + using ini_set() did not take effect for mb_detect_order(). Setting the + directive to NULL or an empty string at runtime now leaves the previously + configured detection order unchanged. + ======================================== 12. Windows Support ======================================== diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 7fda240b7051a..8f94e50ddc861 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -718,6 +718,11 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order) } MBSTRG(detect_order_list) = list; MBSTRG(detect_order_list_size) = size; + + if (stage == PHP_INI_STAGE_RUNTIME) { + php_mb_populate_current_detect_order_list(); + } + return SUCCESS; } /* }}} */ @@ -5981,6 +5986,11 @@ static void php_mb_populate_current_detect_order_list(void) entry[i] = mbfl_no2encoding(src[i]); } } + + if (MBSTRG(current_detect_order_list) != NULL) { + efree(ZEND_VOIDP(MBSTRG(current_detect_order_list))); + } + MBSTRG(current_detect_order_list) = entry; MBSTRG(current_detect_order_list_size) = nentries; } diff --git a/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt b/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt new file mode 100644 index 0000000000000..ba59f3388b85e --- /dev/null +++ b/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test mb_detect_order() function : ini set changes order +--EXTENSIONS-- +mbstring +--INI-- +mbstring.detect_order=UTF-8,ISO-8859-15,ISO-8859-1,ASCII +--FILE-- + +--EXPECT-- +array(4) { + [0]=> + string(5) "UTF-8" + [1]=> + string(11) "ISO-8859-15" + [2]=> + string(10) "ISO-8859-1" + [3]=> + string(5) "ASCII" +} +array(3) { + [0]=> + string(5) "UTF-8" + [1]=> + string(10) "ISO-8859-1" + [2]=> + string(5) "ASCII" +} +array(1) { + [0]=> + string(5) "UTF-8" +} +array(1) { + [0]=> + string(5) "UTF-8" +} +array(1) { + [0]=> + string(5) "UTF-8" +} +