diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index acd9c1220c20e..53bd4df5a1ca5 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -22,15 +22,23 @@ body:
```
validations:
required: true
- - type: input
+ - type: textarea
attributes:
label: PHP Version
- description: "The used PHP version. Make sure it is [supported](https://www.php.net/supported-versions.php)."
- placeholder: "PHP 8.0.12"
+ description: |
+ Please run PHP with the `-v` flag (e.g. `php -v`, `php8.3 -v`, `php-fpm -v` or similar) and provide the full output of that command. If executing that command is not possible, please provide the full version number as given in PHPInfo.
+
+ Please make sure that the used PHP version [is a supported version](https://www.php.net/supported-versions.php).
+ placeholder: |
+ PHP 8.3.19 (cli) (built: Mar 13 2025 17:44:40) (NTS)
+ Copyright (c) The PHP Group
+ Zend Engine v4.3.19, Copyright (c) Zend Technologies
+ with Zend OPcache v8.3.19, Copyright (c), by Zend Technologies
+ render: plain
validations:
required: true
- type: input
attributes:
label: Operating System
description: "The used operating system, if relevant."
- placeholder: "Ubuntu 20.04"
+ placeholder: "Ubuntu 24.04"
diff --git a/.github/actions/freebsd/action.yml b/.github/actions/freebsd/action.yml
index 415790bab5a71..d375a51a6d173 100644
--- a/.github/actions/freebsd/action.yml
+++ b/.github/actions/freebsd/action.yml
@@ -27,7 +27,6 @@ runs:
bzip2 \
t1lib \
gmp \
- tidyp \
libsodium \
libzip \
libxml2 \
diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat
index e15259b3acc39..43e7763e70294 100644
--- a/.github/scripts/windows/test_task.bat
+++ b/.github/scripts/windows/test_task.bat
@@ -58,12 +58,15 @@ if "%PLATFORM%" == "x64" (
curl -sLo Firebird.zip %PHP_FIREBIRD_DOWNLOAD_URL%
7z x -oC:\Firebird Firebird.zip
set PDO_FIREBIRD_TEST_DATABASE=C:\test.fdb
-set PDO_FIREBIRD_TEST_DSN=firebird:dbname=%PDO_FIREBIRD_TEST_DATABASE%
+set PDO_FIREBIRD_TEST_DSN=firebird:dbname=127.0.0.1:%PDO_FIREBIRD_TEST_DATABASE%
set PDO_FIREBIRD_TEST_USER=SYSDBA
set PDO_FIREBIRD_TEST_PASS=phpfi
+echo create user %PDO_FIREBIRD_TEST_USER% password '%PDO_FIREBIRD_TEST_PASS%';> C:\Firebird\create_user.sql
+echo commit;>> C:\Firebird\create_user.sql
echo create database '%PDO_FIREBIRD_TEST_DATABASE%' user '%PDO_FIREBIRD_TEST_USER%' password '%PDO_FIREBIRD_TEST_PASS%';> C:\Firebird\setup.sql
C:\Firebird\instsvc.exe install -n TestInstance
C:\Firebird\isql -q -i C:\Firebird\setup.sql
+C:\Firebird\isql -q -i C:\Firebird\create_user.sql -user sysdba %PDO_FIREBIRD_TEST_DATABASE%
C:\Firebird\instsvc.exe start -n TestInstance
if %errorlevel% neq 0 exit /b 3
path C:\Firebird;%PATH%
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index c9e6850604312..1b1532af7f799 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -29,6 +29,9 @@ on:
windows_version:
required: true
type: string
+ skip_laravel:
+ required: true
+ type: boolean
skip_symfony:
required: true
type: boolean
@@ -550,7 +553,7 @@ jobs:
git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1
cd "amphp-$repository"
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
vendor/bin/phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
@@ -559,12 +562,12 @@ jobs:
done
exit $X
- name: Test Laravel
- if: ${{ !cancelled() }}
+ if: ${{ !cancelled() && !inputs.skip_laravel }}
run: |
git clone https://github.com/laravel/framework.git --depth=1
cd framework
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
# Hack to disable a test that hangs
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
@@ -581,7 +584,7 @@ jobs:
git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1
cd "reactphp-$repository"
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
vendor/bin/phpunit || EXIT_CODE=$?
if [ $[EXIT_CODE:-0} -gt 128 ]; then
X=1;
@@ -595,7 +598,7 @@ jobs:
git clone https://github.com/revoltphp/event-loop.git --depth=1
cd event-loop
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
vendor/bin/phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
exit 1
@@ -606,7 +609,7 @@ jobs:
git clone https://github.com/symfony/symfony.git --depth=1
cd symfony
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
php ./phpunit install
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
@@ -627,7 +630,7 @@ jobs:
git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
cd phpunit
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
php ./phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
exit 1
@@ -635,7 +638,7 @@ jobs:
- name: 'Symfony Preloading'
if: ${{ !cancelled() && !inputs.skip_symfony }}
run: |
- php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs
+ php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-req=php+
cd symfony_demo
git rev-parse HEAD
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
@@ -646,7 +649,7 @@ jobs:
git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1
cd wordpress
git rev-parse HEAD
- php /usr/bin/composer install --no-progress --ignore-platform-reqs
+ php /usr/bin/composer install --no-progress --ignore-platform-req=php+
cp wp-tests-config-sample.php wp-tests-config.php
sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php
sed -i 's/yourusernamehere/root/g' wp-tests-config.php
diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml
index 2bb895e96b668..a98bb39ba0d92 100644
--- a/.github/workflows/root.yml
+++ b/.github/workflows/root.yml
@@ -59,6 +59,7 @@ jobs:
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
|| '22.04' }}
windows_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '2022' || '2019' }}
+ skip_laravel: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
skip_symfony: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
skip_wordpress: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
secrets: inherit
diff --git a/.gitignore b/.gitignore
index 91120a5fa6b2f..55c441323cf15 100644
--- a/.gitignore
+++ b/.gitignore
@@ -237,6 +237,7 @@ php
**/tests/**/*.exp
**/tests/**/*.log
**/tests/**/*.sh
+**/tests/**/*.stdin
# Generated by some test cases
**/tests/**/*.db
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a9f34c239c55e..a91545fa9bd79 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,6 +32,12 @@ had several contributions accepted, commit privileges are often quickly granted.
PHP welcomes pull requests to [add tests](#writing-tests), fix bugs and to
implement RFCs. Please be sure to include tests as appropriate!
+By submitting a pull request, you certify that you have the necessary rights
+to submit the work, that the work does not violate any third-party rights
+(including those of your employer, if applicable), and that you license your
+contribution under the PHP License or under another license if explicitly
+accepted by the PHP project maintainers.
+
If you are fixing a bug, then please submit your PR against the lowest actively
supported branch of PHP that the bug affects (only green branches on
[the supported version page](https://www.php.net/supported-versions.php) are
@@ -353,7 +359,7 @@ Currently, we have the following branches in use:
| master | Active development branch for PHP 8.5, which is open for backwards incompatible changes and major internal API changes. |
| 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 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. |
| PHP-8.1 | Is used to release the PHP 8.1.x series. This is an old stable version and is open for security fixes only. |
| PHP-8.0 | This branch is closed. |
| PHP-7.4 | This branch is closed. |
diff --git a/NEWS b/NEWS
index 65cebd217e130..98f8efa4fadfd 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,10 @@ PHP NEWS
. 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_FOLLOLOCATION 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)
@@ -44,6 +48,7 @@ PHP NEWS
(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)
- Curl:
. Added curl_multi_get_handles(). (timwolla)
@@ -63,8 +68,12 @@ PHP NEWS
. Added enchant_dict_remove_from_session(). (nielsdos)
. Added enchant_dict_remove(). (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).
@@ -81,6 +90,12 @@ PHP NEWS
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)
- MySQLi:
. Fixed bugs GH-17900 and GH-8084 (calling mysqli::__construct twice).
@@ -108,6 +123,10 @@ PHP NEWS
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)
+
- PGSQL:
. Added pg_close_stmt to close a prepared statement while allowing
its name to be reused. (David Carlier)
diff --git a/UPGRADING b/UPGRADING
index 082439b9264c8..04bc66c4890c4 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -82,8 +82,10 @@ PHP 8.5 UPGRADE NOTES
emitted.
To pass a variable by-ref to a constructor argument use the general
array value reference assignment: $ctor_args = [&$valByRef]
- . Attempting to modify a PDOStatement during a call to PDO::fetch(),
- PDO::fetchObject(), PDO::fetchAll() will now throw an Error.
+ . 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
has changed.
@@ -97,7 +99,7 @@ PHP 8.5 UPGRADE NOTES
long on a PDOStatement resulting from the Firebird driver.
- SimpleXML:
- - Passing an XPath expression that returns something other than a node set
+ . 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.
@@ -130,6 +132,11 @@ PHP 8.5 UPGRADE NOTES
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
- Curl:
. Added support for share handles that are persisted across multiple PHP
@@ -147,10 +154,33 @@ PHP 8.5 UPGRADE NOTES
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 of redirect
+ if they are allowed. CURLFOLLOW_FIRSTONLY to follow only the
+ first redirect thus if there any follow up redirect, it won't go
+ any further. CURLFOLLOW_ALL is equivalent to set CURLOPT_FOLLOWLOCATION
+ to true.
- DOM:
. Added Dom\Element::$outerHTML.
+- EXIF:
+ . Add OffsetTime* Exif tags.
+
+- 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.
+
- XSL:
. The $namespace argument of XSLTProcessor::getParameter(),
XSLTProcessor::setParameter() and XSLTProcessor::removeParameter()
@@ -174,17 +204,17 @@ PHP 8.5 UPGRADE NOTES
default.
- FPM:
- . FPM with httpd ProxyPass decodes the full scirpt path script path. Added
- fastcgi.script_path_encoded INI setting to prevent this new behevior.
+ . FPM with httpd ProxyPass decodes the full script path. Added
+ fastcgi.script_path_encoded INI setting to prevent this new behavior.
========================================
4. Deprecated Functionality
========================================
- 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
+ . 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
========================================
5. Changed Functions
@@ -193,10 +223,18 @@ PHP 8.5 UPGRADE NOTES
- 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.
+
+- libxml:
+ . libxml_set_external_entity_loader() now has a formal return type of true.
- PCNTL:
. pcntl_exec() now has a formal return type of false.
@@ -207,6 +245,10 @@ PHP 8.5 UPGRADE NOTES
PDO::ATTR_PREFETCH sets to 0 which set to lazy fetch mode.
In this mode, statements cannot be run parallely.
+- 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.
+
- PGSQL:
. pg_copy_from also supports inputs as Iterable.
. pg_connect checks if the connection_string argument contains
@@ -290,6 +332,17 @@ PHP 8.5 UPGRADE NOTES
. 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
+
+- 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
@@ -300,6 +353,8 @@ PHP 8.5 UPGRADE NOTES
. ReflectionConstant::getFileName() was introduced.
. ReflectionConstant::getExtension() and
ReflectionConstant::getExtensionName() were introduced.
+ . ReflectionConstant::getAttributes() was introduced.
+ RFC: https://wiki.php.net/rfc/attributes-on-constants
========================================
7. New Classes and Interfaces
@@ -318,8 +373,16 @@ 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 to file 5.46.
+ . The return type of finfo_close() has been changed to true, rather
+ than bool.
+
- PCRE:
. Upgraded to pcre2lib from 10.44 to 10.45.
@@ -340,6 +403,10 @@ PHP 8.5 UPGRADE NOTES
. CURLINFO_USED_PROXY.
. CURLINFO_HTTPAUTH_USED.
. CURLINFO_PROXYAUTH_USED.
+ . CURLOPT_INFILESIZE_LARGE.
+ . CURLFOLLOW_ALL.
+ . CURLFOLLOW_OBEYCODE.
+ . CURLFOLLOW_FIRSTONLY.
- Intl:
. DECIMAL_COMPACT_SHORT.
@@ -432,10 +499,22 @@ PHP 8.5 UPGRADE NOTES
14. Performance Improvements
========================================
+- Core:
+ . Remove OPcodes for identity comparisons against booleans, particularly
+ for the match(true) pattern.
+
- 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().
+
- XMLReader:
. Improved property access performance.
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index eb5ccd7bd0bd0..7c7f093e50cce 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -25,6 +25,8 @@ PHP 8.5 INTERNALS UPGRADE NOTES
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.
========================
2. Build system changes
@@ -59,6 +61,10 @@ PHP 8.5 INTERNALS UPGRADE NOTES
is still valid. This is useful when a GC cycle is collected and the
database object can be destroyed prior to destroying the statement.
+- ext/standard
+ . Added php_url_decode_ex() and php_raw_url_decode_ex() that unlike their
+ non-ex counterparts do not work in-place.
+
========================
4. OpCode changes
========================
diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c
index 2b6d71c385457..96a0e81f03825 100644
--- a/Zend/Optimizer/block_pass.c
+++ b/Zend/Optimizer/block_pass.c
@@ -470,7 +470,67 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
goto optimize_bool;
}
break;
+ case ZEND_IS_IDENTICAL:
+ if (opline->op1_type == IS_CONST &&
+ opline->op2_type == IS_CONST) {
+ goto optimize_constant_binary_op;
+ }
+ if (opline->op1_type == IS_CONST &&
+ (Z_TYPE(ZEND_OP1_LITERAL(opline)) <= IS_TRUE && Z_TYPE(ZEND_OP1_LITERAL(opline)) >= IS_NULL)) {
+ /* IS_IDENTICAL(TRUE, T) => TYPE_CHECK(T, TRUE)
+ * IS_IDENTICAL(FALSE, T) => TYPE_CHECK(T, FALSE)
+ * IS_IDENTICAL(NULL, T) => TYPE_CHECK(T, NULL)
+ */
+ opline->opcode = ZEND_TYPE_CHECK;
+ opline->extended_value = (1 << Z_TYPE(ZEND_OP1_LITERAL(opline)));
+ COPY_NODE(opline->op1, opline->op2);
+ SET_UNUSED(opline->op2);
+ ++(*opt_count);
+ goto optimize_type_check;
+ } else if (opline->op2_type == IS_CONST &&
+ (Z_TYPE(ZEND_OP2_LITERAL(opline)) <= IS_TRUE && Z_TYPE(ZEND_OP2_LITERAL(opline)) >= IS_NULL)) {
+ /* IS_IDENTICAL(T, TRUE) => TYPE_CHECK(T, TRUE)
+ * IS_IDENTICAL(T, FALSE) => TYPE_CHECK(T, FALSE)
+ * IS_IDENTICAL(T, NULL) => TYPE_CHECK(T, NULL)
+ */
+ opline->opcode = ZEND_TYPE_CHECK;
+ opline->extended_value = (1 << Z_TYPE(ZEND_OP2_LITERAL(opline)));
+ SET_UNUSED(opline->op2);
+ ++(*opt_count);
+ goto optimize_type_check;
+ }
+ break;
+ case ZEND_TYPE_CHECK:
+optimize_type_check:
+ if (opline->extended_value == (1 << IS_TRUE) || opline->extended_value == (1 << IS_FALSE)) {
+ if (opline->op1_type == IS_TMP_VAR &&
+ !zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) {
+ src = VAR_SOURCE(opline->op1);
+
+ if (src) {
+ switch (src->opcode) {
+ case ZEND_BOOL:
+ case ZEND_BOOL_NOT:
+ /* T = BOOL(X) + TYPE_CHECK(T, TRUE) -> BOOL(X), NOP
+ * T = BOOL(X) + TYPE_CHECK(T, FALSE) -> BOOL_NOT(X), NOP
+ * T = BOOL_NOT(X) + TYPE_CHECK(T, TRUE) -> BOOL_NOT(X), NOP
+ * T = BOOL_NOT(X) + TYPE_CHECK(T, FALSE) -> BOOL(X), NOP
+ */
+ src->opcode =
+ ((src->opcode == ZEND_BOOL) == (opline->extended_value == (1 << IS_TRUE))) ?
+ ZEND_BOOL : ZEND_BOOL_NOT;
+ COPY_NODE(src->result, opline->result);
+ SET_VAR_SOURCE(src);
+ MAKE_NOP(opline);
+ ++(*opt_count);
+ break;
+ }
+ }
+ }
+ }
+ break;
+
case ZEND_BOOL:
case ZEND_BOOL_NOT:
optimize_bool:
@@ -803,7 +863,6 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
case ZEND_SR:
case ZEND_IS_SMALLER:
case ZEND_IS_SMALLER_OR_EQUAL:
- case ZEND_IS_IDENTICAL:
case ZEND_IS_NOT_IDENTICAL:
case ZEND_BOOL_XOR:
case ZEND_BW_OR:
diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c
index db973572aca3a..d0aaccec7ce2c 100644
--- a/Zend/Optimizer/compact_literals.c
+++ b/Zend/Optimizer/compact_literals.c
@@ -43,50 +43,6 @@ typedef struct _literal_info {
info[n].num_related = (related); \
} while (0)
-static size_t type_num_classes(const zend_op_array *op_array, uint32_t arg_num)
-{
- zend_arg_info *arg_info;
- if (arg_num > 0) {
- if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
- return 0;
- }
- if (EXPECTED(arg_num <= op_array->num_args)) {
- arg_info = &op_array->arg_info[arg_num-1];
- } else if (UNEXPECTED(op_array->fn_flags & ZEND_ACC_VARIADIC)) {
- arg_info = &op_array->arg_info[op_array->num_args];
- } else {
- return 0;
- }
- } else {
- arg_info = op_array->arg_info - 1;
- }
-
- if (ZEND_TYPE_IS_COMPLEX(arg_info->type)) {
- if (ZEND_TYPE_HAS_LIST(arg_info->type)) {
- /* Intersection types cannot have nested list types */
- if (ZEND_TYPE_IS_INTERSECTION(arg_info->type)) {
- return ZEND_TYPE_LIST(arg_info->type)->num_types;
- }
- ZEND_ASSERT(ZEND_TYPE_IS_UNION(arg_info->type));
- size_t count = 0;
- zend_type *list_type;
-
- ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(arg_info->type), list_type) {
- if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {
- count += ZEND_TYPE_LIST(*list_type)->num_types;
- } else {
- ZEND_ASSERT(!ZEND_TYPE_HAS_LIST(*list_type));
- count += 1;
- }
- } ZEND_TYPE_LIST_FOREACH_END();
- return count;
- }
- return 1;
- }
-
- return 0;
-}
-
static uint32_t add_static_slot(HashTable *hash,
zend_op_array *op_array,
uint32_t op1,
@@ -504,26 +460,6 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
opline->op2.constant = map[opline->op2.constant];
}
switch (opline->opcode) {
- case ZEND_RECV_INIT:
- case ZEND_RECV:
- case ZEND_RECV_VARIADIC:
- {
- size_t num_classes = type_num_classes(op_array, opline->op1.num);
- if (num_classes) {
- opline->extended_value = cache_size;
- cache_size += num_classes * sizeof(void *);
- }
- break;
- }
- case ZEND_VERIFY_RETURN_TYPE:
- {
- size_t num_classes = type_num_classes(op_array, 0);
- if (num_classes) {
- opline->op2.num = cache_size;
- cache_size += num_classes * sizeof(void *);
- }
- break;
- }
case ZEND_ASSIGN_STATIC_PROP_OP:
if (opline->op1_type == IS_CONST) {
// op1 static property
diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c
index 2c3aaae065997..bf85764c93b49 100644
--- a/Zend/Optimizer/dfa_pass.c
+++ b/Zend/Optimizer/dfa_pass.c
@@ -254,7 +254,7 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa, zend_op
free_alloca(shiftlist, use_heap);
}
-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;
}
@@ -267,9 +267,9 @@ static bool safe_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
static inline bool can_elide_list_type(
const zend_script *script, const zend_op_array *op_array,
- const zend_ssa_var_info *use_info, zend_type type)
+ const zend_ssa_var_info *use_info, const zend_type type)
{
- zend_type *single_type;
+ const zend_type *single_type;
/* For intersection: result==false is failure, default is success.
* For union: result==true is success, default is failure. */
bool is_intersection = ZEND_TYPE_IS_INTERSECTION(type);
@@ -280,7 +280,7 @@ static inline bool can_elide_list_type(
}
if (ZEND_TYPE_HAS_NAME(*single_type)) {
zend_string *lcname = zend_string_tolower(ZEND_TYPE_NAME(*single_type));
- zend_class_entry *ce = zend_optimizer_get_class_entry(script, op_array, lcname);
+ const zend_class_entry *ce = zend_optimizer_get_class_entry(script, op_array, lcname);
zend_string_release(lcname);
bool result = ce && safe_instanceof(use_info->ce, ce);
if (result == !is_intersection) {
diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c
index 9f2e3115d3666..fd8735354c6da 100644
--- a/Zend/Optimizer/zend_optimizer.c
+++ b/Zend/Optimizer/zend_optimizer.c
@@ -82,31 +82,8 @@ 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) /* {{{ */
{
- switch (type) {
- case IS_NULL:
- ZVAL_NULL(result);
- return SUCCESS;
- case _IS_BOOL:
- ZVAL_BOOL(result, zval_is_true(op1));
- return SUCCESS;
- case IS_LONG:
- ZVAL_LONG(result, zval_get_long(op1));
- return SUCCESS;
- case IS_DOUBLE:
- ZVAL_DOUBLE(result, zval_get_double(op1));
- return SUCCESS;
- case IS_STRING:
- /* Conversion from double to string takes into account run-time
- 'precision' setting and cannot be evaluated at compile-time */
- if (Z_TYPE_P(op1) != IS_ARRAY && Z_TYPE_P(op1) != IS_DOUBLE) {
- ZVAL_STR(result, zval_get_string(op1));
- return SUCCESS;
- }
- break;
- case IS_ARRAY:
- ZVAL_COPY(result, op1);
- convert_to_array(result);
- return SUCCESS;
+ if (zend_try_ct_eval_cast(result, type, op1)) {
+ return SUCCESS;
}
return FAILURE;
}
diff --git a/Zend/asm/save_xmm_x86_64_ms_masm.asm b/Zend/asm/save_xmm_x86_64_ms_masm.asm
new file mode 100644
index 0000000000000..1569d6bdb0e86
--- /dev/null
+++ b/Zend/asm/save_xmm_x86_64_ms_masm.asm
@@ -0,0 +1,43 @@
+.code
+
+; ZEND_API void execute_ex(zend_execute_data *ex)
+PUBLIC execute_ex
+
+EXTERN execute_ex_real:PROC
+
+; Assembly wrapper around the real execute_ex function, so that we can
+; save the preserved registers when re-entering the VM from JIT code.
+; See GH-18136.
+execute_ex PROC EXPORT FRAME
+ ; 10 floating points numbers
+ ; 32 bytes shadow space
+ ; 8 bytes to align after the return address
+ sub rsp, 8*10 + 32 + 8
+ .allocstack 8*10 + 32 + 8
+ .endprolog
+ movsd qword ptr [rsp + 32 + 8*0], xmm6
+ movsd qword ptr [rsp + 32 + 8*1], xmm7
+ movsd qword ptr [rsp + 32 + 8*2], xmm8
+ movsd qword ptr [rsp + 32 + 8*3], xmm9
+ movsd qword ptr [rsp + 32 + 8*4], xmm10
+ movsd qword ptr [rsp + 32 + 8*5], xmm11
+ movsd qword ptr [rsp + 32 + 8*6], xmm12
+ movsd qword ptr [rsp + 32 + 8*7], xmm13
+ movsd qword ptr [rsp + 32 + 8*8], xmm14
+ movsd qword ptr [rsp + 32 + 8*9], xmm15
+ call execute_ex_real
+ movsd xmm6, qword ptr [rsp + 32 + 8*0]
+ movsd xmm7, qword ptr [rsp + 32 + 8*1]
+ movsd xmm8, qword ptr [rsp + 32 + 8*2]
+ movsd xmm9, qword ptr [rsp + 32 + 8*3]
+ movsd xmm10, qword ptr [rsp + 32 + 8*4]
+ movsd xmm11, qword ptr [rsp + 32 + 8*5]
+ movsd xmm12, qword ptr [rsp + 32 + 8*6]
+ movsd xmm13, qword ptr [rsp + 32 + 8*7]
+ movsd xmm14, qword ptr [rsp + 32 + 8*8]
+ movsd xmm15, qword ptr [rsp + 32 + 8*9]
+ add rsp, 8*10 + 32 + 8
+ ret
+execute_ex ENDP
+
+END
diff --git a/Zend/tests/attributes/001_placement.phpt b/Zend/tests/attributes/001_placement.phpt
index 518c890ef2c4a..3162aca61a726 100644
--- a/Zend/tests/attributes/001_placement.phpt
+++ b/Zend/tests/attributes/001_placement.phpt
@@ -25,6 +25,9 @@ $f2 = #[A1(9)] function () { };
$f3 = #[A1(10)] fn () => 1;
+#[A1(11)]
+const CT_CONSTANT = 'Demo';
+
$ref = new \ReflectionClass(Foo::class);
$sources = [
@@ -37,7 +40,8 @@ $sources = [
new \ReflectionObject($object),
new \ReflectionFunction('f1'),
new \ReflectionFunction($f2),
- new \ReflectionFunction($f3)
+ new \ReflectionFunction($f3),
+ new \ReflectionConstant('CT_CONSTANT'),
];
foreach ($sources as $r) {
@@ -132,3 +136,11 @@ array(1) {
[0]=>
int(10)
}
+
+string(18) "ReflectionConstant"
+int(1)
+string(2) "A1"
+array(1) {
+ [0]=>
+ int(11)
+}
diff --git a/Zend/tests/attributes/029_reflect_internal_symbols.phpt b/Zend/tests/attributes/029_reflect_internal_symbols.phpt
index d4dc29a0bb997..fdc06cd49db9a 100644
--- a/Zend/tests/attributes/029_reflect_internal_symbols.phpt
+++ b/Zend/tests/attributes/029_reflect_internal_symbols.phpt
@@ -18,6 +18,9 @@ var_dump($rcc->getAttributes());
$rp = new ReflectionProperty('Exception', 'message');
var_dump($rp->getAttributes());
+$rct = new ReflectionConstant('PHP_VERSION');
+var_dump($rct->getAttributes());
+
?>
--EXPECT--
array(0) {
@@ -30,3 +33,5 @@ array(0) {
}
array(0) {
}
+array(0) {
+}
diff --git a/Zend/tests/attributes/034_target_values.phpt b/Zend/tests/attributes/034_target_values.phpt
new file mode 100644
index 0000000000000..e56c0c285fbd6
--- /dev/null
+++ b/Zend/tests/attributes/034_target_values.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Attribute flags are all different, TARGET_ALL includes all targets
+--FILE--
+
+--EXPECT--
+Attribute::TARGET_CLASS = 1 (127 & 1 === 1)
+Attribute::TARGET_FUNCTION = 2 (127 & 2 === 2)
+Attribute::TARGET_METHOD = 4 (127 & 4 === 4)
+Attribute::TARGET_PROPERTY = 8 (127 & 8 === 8)
+Attribute::TARGET_CLASS_CONSTANT = 16 (127 & 16 === 16)
+Attribute::TARGET_PARAMETER = 32 (127 & 32 === 32)
+Attribute::TARGET_CONSTANT = 64 (127 & 64 === 64)
+Attribute::IS_REPEATABLE = 128 (127 & 128 === 0)
+int(127)
+int(127)
+bool(true)
diff --git a/Zend/tests/attributes/constants/allow_named_parameters.phpt b/Zend/tests/attributes/constants/allow_named_parameters.phpt
new file mode 100644
index 0000000000000..7b11bc3c68165
--- /dev/null
+++ b/Zend/tests/attributes/constants/allow_named_parameters.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Verify that named parameters can be passed to attributes on constants
+--FILE--
+getAttributes();
+var_dump($attribs);
+var_dump($attribs[0]->getArguments());
+$attribs[0]->newInstance();
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
+array(2) {
+ ["second"]=>
+ string(3) "bar"
+ ["first"]=>
+ string(3) "foo"
+}
+first: foo
+second: bar
diff --git a/Zend/tests/attributes/constants/ast_export.phpt b/Zend/tests/attributes/constants/ast_export.phpt
new file mode 100644
index 0000000000000..655fe1a9ddecb
--- /dev/null
+++ b/Zend/tests/attributes/constants/ast_export.phpt
@@ -0,0 +1,34 @@
+--TEST--
+AST can be recreated when constants have attributes
+--EXTENSIONS--
+zend_test
+--FILE--
+
+--EXPECT--
+#[MyAttrib]
+const WITH_ATTRIBUTE = true;
+#[First]
+#[Second]
+const WITH_UNGROUPED = true;
+#[First, Second]
+const WITH_GROUPED = true;
+#[MyAttrib(5, param: 'example')]
+const WITH_PARAMETERS = true;
+echo zend_test_compile_to_ast(file_get_contents(__FILE__));
diff --git a/Zend/tests/attributes/constants/constant_listed_as_target-internal.phpt b/Zend/tests/attributes/constants/constant_listed_as_target-internal.phpt
new file mode 100644
index 0000000000000..b0b88c2f6edab
--- /dev/null
+++ b/Zend/tests/attributes/constants/constant_listed_as_target-internal.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Constants listed in valid targets when used wrong (internal attribute)
+--FILE--
+
+--EXPECTF--
+Fatal error: Attribute "Deprecated" cannot target class (allowed targets: function, method, class constant, constant) in %s on line %d
diff --git a/Zend/tests/attributes/constants/constant_listed_as_target-userland.phpt b/Zend/tests/attributes/constants/constant_listed_as_target-userland.phpt
new file mode 100644
index 0000000000000..0fcdf7795bda3
--- /dev/null
+++ b/Zend/tests/attributes/constants/constant_listed_as_target-userland.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Constants listed in valid targets when used wrong (userland attribute)
+--FILE--
+getAttributes();
+var_dump($attribs);
+$attribs[0]->newInstance();
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(19) "MyConstantAttribute"
+ }
+}
+
+Fatal error: Uncaught Error: Attribute "MyConstantAttribute" cannot target class (allowed targets: constant) in %s:%d
+Stack trace:
+#0 %s(%d): ReflectionAttribute->newInstance()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/attributes/constants/constant_redefined_addition.phpt b/Zend/tests/attributes/constants/constant_redefined_addition.phpt
new file mode 100644
index 0000000000000..08f9670989627
--- /dev/null
+++ b/Zend/tests/attributes/constants/constant_redefined_addition.phpt
@@ -0,0 +1,21 @@
+--TEST--
+If a constant is redefined, attributes remain unchanged (no attributes)
+--FILE--
+getAttributes())
+
+?>
+--EXPECTF--
+Warning: Constant MY_CONST already defined in %s on line %d
+No attributes
+array(0) {
+}
diff --git a/Zend/tests/attributes/constants/constant_redefined_change.phpt b/Zend/tests/attributes/constants/constant_redefined_change.phpt
new file mode 100644
index 0000000000000..158753ee07d84
--- /dev/null
+++ b/Zend/tests/attributes/constants/constant_redefined_change.phpt
@@ -0,0 +1,27 @@
+--TEST--
+If a constant is redefined, attributes remain unchanged (different attributes)
+--FILE--
+getAttributes())
+
+?>
+--EXPECTF--
+Warning: Constant MY_CONST already defined in %s on line %d
+Has attributes (1)
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
diff --git a/Zend/tests/attributes/constants/constant_redefined_removal.phpt b/Zend/tests/attributes/constants/constant_redefined_removal.phpt
new file mode 100644
index 0000000000000..0b679a55985e3
--- /dev/null
+++ b/Zend/tests/attributes/constants/constant_redefined_removal.phpt
@@ -0,0 +1,26 @@
+--TEST--
+If a constant is redefined, attributes remain unchanged (had attributes)
+--FILE--
+getAttributes())
+
+?>
+--EXPECTF--
+Warning: Constant MY_CONST already defined in %s on line %d
+Has attributes
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
diff --git a/Zend/tests/attributes/constants/multiple_attributes_grouped.phpt b/Zend/tests/attributes/constants/multiple_attributes_grouped.phpt
new file mode 100644
index 0000000000000..71736b68008d8
--- /dev/null
+++ b/Zend/tests/attributes/constants/multiple_attributes_grouped.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Multiple attributes in a group are allowed
+--FILE--
+getAttributes());
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ [1]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(3) "Bar"
+ }
+}
diff --git a/Zend/tests/attributes/constants/multiple_attributes_ungrouped.phpt b/Zend/tests/attributes/constants/multiple_attributes_ungrouped.phpt
new file mode 100644
index 0000000000000..2f177a9efd3f6
--- /dev/null
+++ b/Zend/tests/attributes/constants/multiple_attributes_ungrouped.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Multiple attributes in separate groups are allowed
+--FILE--
+getAttributes());
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ [1]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(3) "Bar"
+ }
+}
diff --git a/Zend/tests/attributes/constants/multiple_constants_error.phpt b/Zend/tests/attributes/constants/multiple_constants_error.phpt
new file mode 100644
index 0000000000000..d4258c9f4d080
--- /dev/null
+++ b/Zend/tests/attributes/constants/multiple_constants_error.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Error trying to add attributes to multiple constants at once
+--FILE--
+
+--EXPECTF--
+Fatal error: Cannot apply attributes to multiple constants at once in %s on line %d
diff --git a/Zend/tests/attributes/constants/must_target_const-internal.phpt b/Zend/tests/attributes/constants/must_target_const-internal.phpt
new file mode 100644
index 0000000000000..cedb6c5bd161a
--- /dev/null
+++ b/Zend/tests/attributes/constants/must_target_const-internal.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Error when attribute does not target constants (internal attribute)
+--FILE--
+
+--EXPECTF--
+Fatal error: Attribute "Attribute" cannot target constant (allowed targets: class) in %s on line %d
diff --git a/Zend/tests/attributes/constants/must_target_const-userland.phpt b/Zend/tests/attributes/constants/must_target_const-userland.phpt
new file mode 100644
index 0000000000000..3799cf2142006
--- /dev/null
+++ b/Zend/tests/attributes/constants/must_target_const-userland.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Error when attribute does not target constants (useland attribute)
+--FILE--
+getAttributes();
+var_dump($attribs);
+$attribs[0]->newInstance();
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(19) "MyFunctionAttribute"
+ }
+}
+
+Fatal error: Uncaught Error: Attribute "MyFunctionAttribute" cannot target constant (allowed targets: function) in %s:%d
+Stack trace:
+#0 %s(%d): ReflectionAttribute->newInstance()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/attributes/constants/not_repeatable-internal.phpt b/Zend/tests/attributes/constants/not_repeatable-internal.phpt
new file mode 100644
index 0000000000000..b3602e186f046
--- /dev/null
+++ b/Zend/tests/attributes/constants/not_repeatable-internal.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Validation of attribute repetition (not allowed; internal attribute)
+--FILE--
+
+--EXPECTF--
+Fatal error: Attribute "Deprecated" must not be repeated in %s on line %d
diff --git a/Zend/tests/attributes/constants/not_repeatable-userland.phpt b/Zend/tests/attributes/constants/not_repeatable-userland.phpt
new file mode 100644
index 0000000000000..85c0f2dff1e8b
--- /dev/null
+++ b/Zend/tests/attributes/constants/not_repeatable-userland.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Validation of attribute repetition (not allowed; userland attribute)
+--FILE--
+getAttributes();
+var_dump($attributes);
+$attributes[0]->newInstance();
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+ [1]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
+
+Fatal error: Uncaught Error: Attribute "MyAttribute" must not be repeated in %s:%d
+Stack trace:
+#0 %s(%d): ReflectionAttribute->newInstance()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/attributes/constants/repeatable-internal.phpt b/Zend/tests/attributes/constants/repeatable-internal.phpt
new file mode 100644
index 0000000000000..57cb9eaf274db
--- /dev/null
+++ b/Zend/tests/attributes/constants/repeatable-internal.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Validation of attribute repetition (is allowed; internal attribute)
+--EXTENSIONS--
+zend_test
+--FILE--
+
+--EXPECT--
+Done
diff --git a/Zend/tests/attributes/constants/repeatable-userland.phpt b/Zend/tests/attributes/constants/repeatable-userland.phpt
new file mode 100644
index 0000000000000..ce31a903dbc57
--- /dev/null
+++ b/Zend/tests/attributes/constants/repeatable-userland.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Validation of attribute repetition (is allowed; userland attribute)
+--FILE--
+getAttributes();
+var_dump($attributes);
+$attributes[0]->newInstance();
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+ [1]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
diff --git a/Zend/tests/attributes/constants/target_all_targets_const-default.phpt b/Zend/tests/attributes/constants/target_all_targets_const-default.phpt
new file mode 100644
index 0000000000000..7f79a59cd65bd
--- /dev/null
+++ b/Zend/tests/attributes/constants/target_all_targets_const-default.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Attributes with TARGET_ALL (from the default) can target constants
+--FILE--
+getAttributes();
+var_dump($attribs);
+$attribs[0]->newInstance();
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
diff --git a/Zend/tests/attributes/constants/target_all_targets_const-explicit.phpt b/Zend/tests/attributes/constants/target_all_targets_const-explicit.phpt
new file mode 100644
index 0000000000000..6daa11b9a537d
--- /dev/null
+++ b/Zend/tests/attributes/constants/target_all_targets_const-explicit.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Attributes with TARGET_ALL (from an explicit parameter) can target constants
+--FILE--
+getAttributes();
+var_dump($attribs);
+$attribs[0]->newInstance();
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(ReflectionAttribute)#%d (1) {
+ ["name"]=>
+ string(11) "MyAttribute"
+ }
+}
diff --git a/Zend/tests/attributes/deprecated/constants/const_messages.phpt b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
new file mode 100644
index 0000000000000..1cf8b11af1565
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/const_messages.phpt
@@ -0,0 +1,49 @@
+--TEST--
+#[\Deprecated]: Messages on compile time constants.
+--FILE--
+
+--EXPECTF--
+Deprecated: Constant DeprecatedConst1 is deprecated in %s on line %d
+1
+
+Deprecated: Constant DeprecatedConst2 is deprecated, use DEPRECATED_CONST_2 in %s on line %d
+2
+
+Deprecated: Constant DeprecatedConst3 is deprecated, use DEPRECATED_CONST_3 in %s on line %d
+3
+
+Deprecated: Constant DeprecatedConst4 is deprecated since 1.0, use DEPRECATED_CONST_4 in %s on line %d
+4
+
+Deprecated: Constant DeprecatedConst5 is deprecated since 1.0, use DEPRECATED_CONST_5 in %s on line %d
+5
+
+Deprecated: Constant DeprecatedConst6 is deprecated since 1.0 in %s on line %d
+6
+
diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_001.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_001.phpt
new file mode 100644
index 0000000000000..955174b293e20
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+#[\Deprecated]: Using the value of a deprecated constant as the deprecation message.
+--FILE--
+
+--EXPECTF--
+Deprecated: Constant TEST is deprecated, from itself in %s on line %d
+
+Deprecated: Constant TEST2 is deprecated in %s on line %d
+
+Deprecated: Constant TEST3 is deprecated, from another in %s on line %d
diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
new file mode 100644
index 0000000000000..f749293d8facc
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt
@@ -0,0 +1,34 @@
+--TEST--
+#[\Deprecated]: Using the value of a deprecated constant as the deprecation message with a throwing error handler.
+--FILE--
+getMessage(), PHP_EOL;
+}
+
+try {
+ TEST3;
+} catch (ErrorException $e) {
+ echo "Caught: ", $e->getMessage(), PHP_EOL;
+}
+
+?>
+--EXPECT--
+Caught: Constant TEST is deprecated, from itself
+Caught: Constant TEST2 is deprecated
diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_003.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_003.phpt
new file mode 100644
index 0000000000000..c37b57dc42176
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_003.phpt
@@ -0,0 +1,21 @@
+--TEST--
+#[\Deprecated]: Using the value of a deprecated constant in a constant expression.
+--FILE--
+
+--EXPECTF--
+Deprecated: Constant PREFIX is deprecated, prefix in %s on line %d
+
+Deprecated: Constant SUFFIX is deprecated, suffix in %s on line %d
+string(12) "prefixsuffix"
diff --git a/Zend/tests/attributes/deprecated/constants/error_code.phpt b/Zend/tests/attributes/deprecated/constants/error_code.phpt
new file mode 100644
index 0000000000000..0a8efd7f970b4
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/error_code.phpt
@@ -0,0 +1,19 @@
+--TEST--
+#[\Deprecated]: Code is E_USER_DEPRECATED for constants.
+--FILE--
+
+--EXPECT--
+int(16384)
+int(16384)
+bool(true)
diff --git a/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt b/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt
new file mode 100644
index 0000000000000..a968e26673e39
--- /dev/null
+++ b/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+#[\Deprecated]: Constant with value unknown at compile time.
+--FILE--
+
+--EXPECTF--
+Deprecated: Constant CONSTANT is deprecated in %s on line %d
+string(8) "Prefix-%c"
+bool(true)
diff --git a/Zend/tests/attributes/nodiscard/005.phpt b/Zend/tests/attributes/nodiscard/005.phpt
index ec8f33e5299d6..9ef1566372892 100644
--- a/Zend/tests/attributes/nodiscard/005.phpt
+++ b/Zend/tests/attributes/nodiscard/005.phpt
@@ -1,17 +1,11 @@
--TEST--
-#[\NoDiscard]: Native function and method.
+#[\NoDiscard]: Native method.
--FILE--
setTimestamp(0);
?>
--EXPECTF--
-Warning: The return value of function flock() should either be used or intentionally ignored by casting it as (void), as locking the stream might have failed in %s on line %d
-
Warning: The return value of method DateTimeImmutable::setTimestamp() should either be used or intentionally ignored by casting it as (void), as DateTimeImmutable::setTimestamp() does not modify the object itself in %s on line %d
diff --git a/Zend/tests/attributes/nodiscard/007.phpt b/Zend/tests/attributes/nodiscard/007.phpt
index 84dff0c8e44f6..1b72de8c22a06 100644
--- a/Zend/tests/attributes/nodiscard/007.phpt
+++ b/Zend/tests/attributes/nodiscard/007.phpt
@@ -7,15 +7,11 @@ zend_test.observer.execute_internal=1
--FILE--
--EXPECTF--
-
-Warning: The return value of function flock() should either be used or intentionally ignored by casting it as (void), as locking the stream might have failed in %s on line %d
-
-
+Warning: The return value of function zend_test_nodiscard() should either be used or intentionally ignored by casting it as (void), custom message in %s on line %d
+
diff --git a/Zend/tests/attributes/nodiscard/010.phpt b/Zend/tests/attributes/nodiscard/010.phpt
new file mode 100644
index 0000000000000..5534fc3404da9
--- /dev/null
+++ b/Zend/tests/attributes/nodiscard/010.phpt
@@ -0,0 +1,12 @@
+--TEST--
+#[\NoDiscard]: Native function.
+--EXTENSIONS--
+zend_test
+--FILE--
+
+--EXPECTF--
+Warning: The return value of function zend_test_nodiscard() should either be used or intentionally ignored by casting it as (void), custom message in %s on line %d
diff --git a/Zend/tests/constexpr/constant_expressions_cast.phpt b/Zend/tests/constexpr/constant_expressions_cast.phpt
new file mode 100644
index 0000000000000..0fd7c48260c18
--- /dev/null
+++ b/Zend/tests/constexpr/constant_expressions_cast.phpt
@@ -0,0 +1,129 @@
+--TEST--
+Constant expressions with cast
+--FILE--
+ 1];
+const T5 = (float) 5;
+const T6 = (array) "";
+const T7 = (array) var_dump(...);
+const T8 = (array) new X;
+const T9 = (array) new DateTime;
+const T10 = (int) new DateTime;
+
+var_dump(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10);
+
+const C_FLOAT = 0.3;
+const C_EMPTY_ARRAY = [];
+const C_ARRAY = ["a" => 1];
+const C_INT = 5;
+const C_EMPTY_STRING = "";
+const C_CALLABLE = var_dump(...);
+const C_USER_OBJECT = new X;
+const C_DATE_TIME = new DateTime;
+
+const T11 = (int) C_FLOAT;
+const T12 = (bool) C_FLOAT;
+const T13 = (string) C_EMPTY_ARRAY;
+const T14 = (object) C_ARRAY;
+const T15 = (float) C_INT;
+const T16 = (array) C_EMPTY_STRING;
+const T17 = (array) C_CALLABLE;
+const T18 = (array) C_USER_OBJECT;
+const T19 = (array) C_DATE_TIME;
+const T20 = (int) C_DATE_TIME;
+
+var_dump(T11, T12, T13, T14, T15, T16, T17, T18, T19, T20);
+?>
+--EXPECTF--
+Warning: Array to string conversion in %s on line %d
+
+Warning: Object of class DateTime could not be converted to int in %s on line %d
+int(0)
+bool(true)
+string(5) "Array"
+object(stdClass)#%d (1) {
+ ["a"]=>
+ int(1)
+}
+float(5)
+array(1) {
+ [0]=>
+ string(0) ""
+}
+array(1) {
+ [0]=>
+ object(Closure)#%d (2) {
+ ["function"]=>
+ string(8) "var_dump"
+ ["parameter"]=>
+ array(2) {
+ ["$value"]=>
+ string(10) ""
+ ["$values"]=>
+ string(10) ""
+ }
+ }
+}
+array(1) {
+ ["foo"]=>
+ int(3)
+}
+array(3) {
+ ["date"]=>
+ string(%d) "%s"
+ ["timezone_type"]=>
+ int(%d)
+ ["timezone"]=>
+ string(%d) "%s"
+}
+int(1)
+
+Warning: Array to string conversion in %s on line %d
+
+Warning: Object of class DateTime could not be converted to int in %s on line %d
+int(0)
+bool(true)
+string(5) "Array"
+object(stdClass)#%d (1) {
+ ["a"]=>
+ int(1)
+}
+float(5)
+array(1) {
+ [0]=>
+ string(0) ""
+}
+array(1) {
+ [0]=>
+ object(Closure)#%d (2) {
+ ["function"]=>
+ string(8) "var_dump"
+ ["parameter"]=>
+ array(2) {
+ ["$value"]=>
+ string(10) ""
+ ["$values"]=>
+ string(10) ""
+ }
+ }
+}
+array(1) {
+ ["foo"]=>
+ int(3)
+}
+array(3) {
+ ["date"]=>
+ string(%d) "%s"
+ ["timezone_type"]=>
+ int(%d)
+ ["timezone"]=>
+ string(%d) "%s"
+}
+int(1)
diff --git a/Zend/tests/constexpr/constant_expressions_cast_object_property.phpt b/Zend/tests/constexpr/constant_expressions_cast_object_property.phpt
new file mode 100644
index 0000000000000..63616f0f8bf3b
--- /dev/null
+++ b/Zend/tests/constexpr/constant_expressions_cast_object_property.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Constant expressions with object cast in property
+--FILE--
+
+--EXPECTF--
+Fatal error: Object casts are not supported in this context in %s on line %d
diff --git a/Zend/tests/inheritance/bug70957.phpt b/Zend/tests/inheritance/bug70957.phpt
index 9341fcd288d95..6e5a51d9edea4 100644
--- a/Zend/tests/inheritance/bug70957.phpt
+++ b/Zend/tests/inheritance/bug70957.phpt
@@ -19,4 +19,4 @@ class B extends Foo
}
?>
--EXPECTF--
-Fatal error: Declaration of T::bar() must be compatible with Foo::bar($a = 'Foo') in %s on line %d
+Fatal error: Declaration of B::bar() must be compatible with Foo::bar($a = 'Foo') in %s on line %d
diff --git a/Zend/tests/oss_fuzz_410939023.phpt b/Zend/tests/oss_fuzz_410939023.phpt
new file mode 100644
index 0000000000000..9c024bf5b5b06
--- /dev/null
+++ b/Zend/tests/oss_fuzz_410939023.phpt
@@ -0,0 +1,11 @@
+--TEST--
+OSS-Fuzz #410939023: Use of magic const within const expr cast
+--FILE--
+
+--EXPECT--
+string(0) ""
diff --git a/Zend/tests/property_hooks/gh18268.phpt b/Zend/tests/property_hooks/gh18268.phpt
new file mode 100644
index 0000000000000..9836bb6d96270
--- /dev/null
+++ b/Zend/tests/property_hooks/gh18268.phpt
@@ -0,0 +1,23 @@
+--TEST--
+GH-18268: array_walk() on object with added property hooks
+--FILE--
+
+--EXPECT--
+int(42)
diff --git a/Zend/tests/traits/bug78776.phpt b/Zend/tests/traits/bug78776.phpt
index 3696d955a3a3e..feecfeb8fddd4 100644
--- a/Zend/tests/traits/bug78776.phpt
+++ b/Zend/tests/traits/bug78776.phpt
@@ -25,4 +25,4 @@ B::createApp();
?>
--EXPECTF--
-Fatal error: Cannot make non static method A::createApp() static in class C in %s on line %d
+Fatal error: Cannot make non static method A::createApp() static in class B in %s on line %d
diff --git a/Zend/tests/traits/bug81192.phpt b/Zend/tests/traits/bug81192.phpt
index 00f6f1d2fbf71..268df826ddfde 100644
--- a/Zend/tests/traits/bug81192.phpt
+++ b/Zend/tests/traits/bug81192.phpt
@@ -17,4 +17,4 @@ class B extends A {
?>
--EXPECTF--
-Fatal error: Declaration of T::foo(): string must be compatible with A::foo(): int in %sbug81192_trait.inc on line 4
+Fatal error: Declaration of B::foo(): string must be compatible with A::foo(): int in %sbug81192_trait.inc on line 4
diff --git a/Zend/tests/traits/bugs/abstract-methods05.phpt b/Zend/tests/traits/bugs/abstract-methods05.phpt
index 96619eae910b8..e0ffc60c14921 100644
--- a/Zend/tests/traits/bugs/abstract-methods05.phpt
+++ b/Zend/tests/traits/bugs/abstract-methods05.phpt
@@ -22,4 +22,4 @@ class TraitsTest1 {
?>
--EXPECTF--
-Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
+Fatal error: Declaration of TraitsTest1::hello() must be compatible with THelloA::hello($a) in %s on line %d
diff --git a/Zend/tests/traits/bugs/abstract-methods06.phpt b/Zend/tests/traits/bugs/abstract-methods06.phpt
index 8e2f25b048e0b..82ad805aed538 100644
--- a/Zend/tests/traits/bugs/abstract-methods06.phpt
+++ b/Zend/tests/traits/bugs/abstract-methods06.phpt
@@ -23,4 +23,4 @@ class TraitsTest1 {
?>
--EXPECTF--
-Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
+Fatal error: Declaration of TraitsTest1::hello() must be compatible with THelloA::hello($a) in %s on line %d
diff --git a/Zend/tests/traits/gh18295.phpt b/Zend/tests/traits/gh18295.phpt
new file mode 100644
index 0000000000000..438431a5b4eec
--- /dev/null
+++ b/Zend/tests/traits/gh18295.phpt
@@ -0,0 +1,21 @@
+--TEST--
+GH-18295: Parent self is substitutable with child self through trait
+--FILE--
+
+===DONE===
+--EXPECT--
+===DONE===
diff --git a/Zend/tests/traits/inheritance003.phpt b/Zend/tests/traits/inheritance003.phpt
index 1e630eef61d88..1826a084c5a01 100644
--- a/Zend/tests/traits/inheritance003.phpt
+++ b/Zend/tests/traits/inheritance003.phpt
@@ -35,4 +35,4 @@ $o->sayHello(array());
--EXPECTF--
World!
-Fatal error: Declaration of SayWorld::sayHello(Base $d) must be compatible with Base::sayHello(array $a) in %s on line %d
+Fatal error: Declaration of MyHelloWorld::sayHello(Base $d) must be compatible with Base::sayHello(array $a) in %s on line %d
diff --git a/Zend/tests/type_casts/gh18301_cast_to_void_for.phpt b/Zend/tests/type_casts/gh18301_cast_to_void_for.phpt
new file mode 100644
index 0000000000000..2ff7cfb0cb17b
--- /dev/null
+++ b/Zend/tests/type_casts/gh18301_cast_to_void_for.phpt
@@ -0,0 +1,46 @@
+--TEST--
+GH-18301: casting to void is allowed in for’s expression lists
+--FILE--
+
+--EXPECTF--
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+4
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+10
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+16
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+22
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+28
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
+
+Warning: The return value of function incCount() should either be used or intentionally ignored by casting it as (void) in %s on line %d
diff --git a/Zend/tests/type_casts/gh18301_cast_to_void_statement_for_condition.phpt b/Zend/tests/type_casts/gh18301_cast_to_void_statement_for_condition.phpt
new file mode 100644
index 0000000000000..6c90b2f7987c6
--- /dev/null
+++ b/Zend/tests/type_casts/gh18301_cast_to_void_statement_for_condition.phpt
@@ -0,0 +1,9 @@
+--TEST--
+GH-18301: casting to void is not allowed at the end of a for condition
+--FILE--
+
+--EXPECTF--
+Parse error: syntax error, unexpected token ";", expecting "," in %s on line %d
diff --git a/Zend/tests/type_declarations/variance/trait_error.phpt b/Zend/tests/type_declarations/variance/trait_error.phpt
index 667b177a5b931..dd4ac59d8e7e8 100644
--- a/Zend/tests/type_declarations/variance/trait_error.phpt
+++ b/Zend/tests/type_declarations/variance/trait_error.phpt
@@ -17,4 +17,4 @@ class U extends X {
?>
--EXPECTF--
-Fatal error: Could not check compatibility between T::method($r): B and X::method($a): A, because class B is not available in %s on line %d
+Fatal error: Could not check compatibility between U::method($r): B and X::method($a): A, because class B is not available in %s on line %d
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 4c31fba5e506e..e0006e7d7275f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2914,14 +2914,14 @@ static zend_always_inline void zend_normalize_internal_type(zend_type *type) {
ZEND_ASSERT(!ZEND_TYPE_CONTAINS_CODE(*type, IS_RESOURCE) && "resource is not allowed in a zend_type");
}
zend_type *current;
- ZEND_TYPE_FOREACH(*type, current) {
+ ZEND_TYPE_FOREACH_MUTABLE(*type, current) {
if (ZEND_TYPE_HAS_NAME(*current)) {
zend_string *name = zend_new_interned_string(ZEND_TYPE_NAME(*current));
zend_alloc_ce_cache(name);
ZEND_TYPE_SET_PTR(*current, name);
} else if (ZEND_TYPE_HAS_LIST(*current)) {
zend_type *inner;
- ZEND_TYPE_FOREACH(*current, inner) {
+ ZEND_TYPE_FOREACH_MUTABLE(*current, inner) {
ZEND_ASSERT(!ZEND_TYPE_HAS_LITERAL_NAME(*inner) && !ZEND_TYPE_HAS_LIST(*inner));
if (ZEND_TYPE_HAS_NAME(*inner)) {
zend_string *name = zend_new_interned_string(ZEND_TYPE_NAME(*inner));
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 6aeffce25d8e5..a644de8e15134 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -690,8 +690,13 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
#define call_user_function_named(function_table, object, function_name, retval_ptr, param_count, params, named_params) \
_call_user_function_impl(object, function_name, retval_ptr, param_count, params, named_params)
-ZEND_API extern const zend_fcall_info empty_fcall_info;
-ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
+#ifndef __cplusplus
+# define empty_fcall_info (zend_fcall_info) {0}
+# define empty_fcall_info_cache (zend_fcall_info_cache) {0}
+#else
+# define empty_fcall_info zend_fcall_info {0}
+# define empty_fcall_info_cache zend_fcall_info_cache {0}
+#endif
/** Build zend_call_info/cache from a zval*
*
@@ -800,7 +805,7 @@ static zend_always_inline void zend_fcc_dtor(zend_fcall_info_cache *fcc)
if (fcc->closure) {
OBJ_RELEASE(fcc->closure);
}
- memcpy(fcc, &empty_fcall_info_cache, sizeof(zend_fcall_info_cache));
+ *fcc = empty_fcall_info_cache;
}
ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc, zval *callable);
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 2551f876d4465..5437208694d49 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -702,6 +702,41 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner(
}
zval_ptr_dtor_nogc(&op1);
break;
+ case ZEND_AST_CAST:
+ if (UNEXPECTED(zend_ast_evaluate_ex(&op1, ast->child[0], scope, &short_circuited, ctx) != SUCCESS)) {
+ ret = FAILURE;
+ break;
+ }
+ if (ast->attr == Z_TYPE(op1)) {
+ ZVAL_COPY_VALUE(result, &op1);
+ } else {
+ switch (ast->attr) {
+ case _IS_BOOL:
+ ZVAL_BOOL(result, zend_is_true(&op1));
+ break;
+ case IS_LONG:
+ ZVAL_LONG(result, zval_get_long_func(&op1, false));
+ break;
+ case IS_DOUBLE:
+ ZVAL_DOUBLE(result, zval_get_double_func(&op1));
+ break;
+ case IS_STRING:
+ ZVAL_STR(result, zval_get_string_func(&op1));
+ break;
+ case IS_ARRAY:
+ zend_cast_zval_to_array(result, &op1, IS_VAR);
+ break;
+ case IS_OBJECT:
+ zend_cast_zval_to_object(result, &op1, IS_VAR);
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE();
+ }
+ zval_ptr_dtor_nogc(&op1);
+ if (UNEXPECTED(EG(exception))) {
+ ret = FAILURE;
+ }
+ }
+ break;
case ZEND_AST_OR:
if (UNEXPECTED(zend_ast_evaluate_ex(&op1, ast->child[0], scope, &short_circuited, ctx) != SUCCESS)) {
ret = FAILURE;
@@ -1596,11 +1631,14 @@ static ZEND_COLD void zend_ast_export_var(smart_str *str, zend_ast *ast, int pri
smart_str_appendc(str, '}');
}
-static ZEND_COLD void zend_ast_export_list(smart_str *str, zend_ast_list *list, bool separator, int priority, int indent)
+/* Use zend_ast_export_list() unless fewer than `list->children` children should
+ * be exported. */
+static ZEND_COLD void zend_ast_export_list_ex(smart_str *str, zend_ast_list *list, bool separator, int priority, int indent, int children)
{
+ ZEND_ASSERT(children <= list->children);
uint32_t i = 0;
- while (i < list->children) {
+ while (i < children) {
if (i != 0 && separator) {
smart_str_appends(str, ", ");
}
@@ -1609,6 +1647,11 @@ static ZEND_COLD void zend_ast_export_list(smart_str *str, zend_ast_list *list,
}
}
+static ZEND_COLD void zend_ast_export_list(smart_str *str, zend_ast_list *list, bool separator, int priority, int indent)
+{
+ zend_ast_export_list_ex(str, list, separator, priority, indent, list->children);
+}
+
static ZEND_COLD void zend_ast_export_encaps_list(smart_str *str, char quote, zend_ast_list *list, int indent)
{
uint32_t i = 0;
@@ -2181,9 +2224,26 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
goto simple_list;
}
- case ZEND_AST_CONST_DECL:
+ case ZEND_AST_CONST_DECL: {
+ zend_ast_list *ast_list = zend_ast_get_list(ast);
+ /* Attributes are stored at the end of the list if present. */
+ if (ast_list->child[ast_list->children - 1]->kind == ZEND_AST_ATTRIBUTE_LIST) {
+ zend_ast_export_attributes(
+ str,
+ ast_list->child[ast_list->children - 1],
+ indent,
+ 1
+ );
+ /* 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);
+ break;
+ }
smart_str_appends(str, "const ");
goto simple_list;
+ }
case ZEND_AST_CLASS_CONST_GROUP:
if (ast->child[1]) {
zend_ast_export_attributes(str, ast->child[1], indent, 1);
@@ -2881,6 +2941,12 @@ zend_ast * ZEND_FASTCALL zend_ast_with_attributes(zend_ast *ast, zend_ast *attr)
case ZEND_AST_CLASS_CONST_GROUP:
ast->child[1] = attr;
break;
+ case ZEND_AST_CONST_DECL:
+ /* Since constants are already stored in a list, just add the attributes
+ * to that list instead of storing them elsewhere;
+ * zend_compile_const_decl() checks the kind of the list elements. */
+ zend_ast_list_add(ast, attr);
+ break;
EMPTY_SWITCH_DEFAULT_CASE()
}
diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c
index 48f79c12610f6..c3633801be83e 100644
--- a/Zend/zend_attributes.c
+++ b/Zend/zend_attributes.c
@@ -378,7 +378,8 @@ static const char *target_names[] = {
"method",
"property",
"class constant",
- "parameter"
+ "parameter",
+ "constant"
};
ZEND_API zend_string *zend_get_attribute_target_names(uint32_t flags)
diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h
index 468488800ebf8..eb464772c100c 100644
--- a/Zend/zend_attributes.h
+++ b/Zend/zend_attributes.h
@@ -28,9 +28,10 @@
#define ZEND_ATTRIBUTE_TARGET_PROPERTY (1<<3)
#define ZEND_ATTRIBUTE_TARGET_CLASS_CONST (1<<4)
#define ZEND_ATTRIBUTE_TARGET_PARAMETER (1<<5)
-#define ZEND_ATTRIBUTE_TARGET_ALL ((1<<6) - 1)
-#define ZEND_ATTRIBUTE_IS_REPEATABLE (1<<6)
-#define ZEND_ATTRIBUTE_FLAGS ((1<<7) - 1)
+#define ZEND_ATTRIBUTE_TARGET_CONST (1<<6)
+#define ZEND_ATTRIBUTE_TARGET_ALL ((1<<7) - 1)
+#define ZEND_ATTRIBUTE_IS_REPEATABLE (1<<7)
+#define ZEND_ATTRIBUTE_FLAGS ((1<<8) - 1)
/* Flags for zend_attribute.flags */
#define ZEND_ATTRIBUTE_PERSISTENT (1<<0)
diff --git a/Zend/zend_attributes.stub.php b/Zend/zend_attributes.stub.php
index 6351ccd771838..fe70de83e4d21 100644
--- a/Zend/zend_attributes.stub.php
+++ b/Zend/zend_attributes.stub.php
@@ -17,6 +17,8 @@ final class Attribute
const int TARGET_CLASS_CONSTANT = UNKNOWN;
/** @cvalue ZEND_ATTRIBUTE_TARGET_PARAMETER */
const int TARGET_PARAMETER = UNKNOWN;
+ /** @cvalue ZEND_ATTRIBUTE_TARGET_CONST */
+ const int TARGET_CONSTANT = UNKNOWN;
/** @cvalue ZEND_ATTRIBUTE_TARGET_ALL */
const int TARGET_ALL = UNKNOWN;
/** @cvalue ZEND_ATTRIBUTE_IS_REPEATABLE */
@@ -75,7 +77,7 @@ public function __construct() {}
/**
* @strict-properties
*/
-#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION|Attribute::TARGET_CLASS_CONSTANT)]
+#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION|Attribute::TARGET_CLASS_CONSTANT|Attribute::TARGET_CONSTANT)]
final class Deprecated
{
public readonly ?string $message;
diff --git a/Zend/zend_attributes_arginfo.h b/Zend/zend_attributes_arginfo.h
index aecb216291071..14afe40c01adf 100644
--- a/Zend/zend_attributes_arginfo.h
+++ b/Zend/zend_attributes_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6b54bc195be211caabb395b621380681953c1f5a */
+ * Stub hash: 9aee3d8f2ced376f5929048444eaa2529ff90311 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Attribute___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "Attribute::TARGET_ALL")
@@ -129,6 +129,12 @@ static zend_class_entry *register_class_Attribute(void)
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);
+ 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_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);
+
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);
@@ -258,7 +264,7 @@ static zend_class_entry *register_class_Deprecated(void)
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);
zval attribute_Attribute_class_Deprecated_0_arg0;
- ZVAL_LONG(&attribute_Attribute_class_Deprecated_0_arg0, ZEND_ATTRIBUTE_TARGET_METHOD | ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_CLASS_CONST);
+ ZVAL_LONG(&attribute_Attribute_class_Deprecated_0_arg0, ZEND_ATTRIBUTE_TARGET_METHOD | ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_CLASS_CONST | ZEND_ATTRIBUTE_TARGET_CONST);
ZVAL_COPY_VALUE(&attribute_Attribute_class_Deprecated_0->args[0].value, &attribute_Attribute_class_Deprecated_0_arg0);
return class_entry;
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2e405de30ea62..0669d106f15e9 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1407,10 +1407,10 @@ static zend_string *resolve_class_name(zend_string *name, zend_class_entry *scop
}
static zend_string *add_intersection_type(zend_string *str,
- zend_type_list *intersection_type_list, zend_class_entry *scope,
+ const zend_type_list *intersection_type_list, zend_class_entry *scope,
bool is_bracketed)
{
- zend_type *single_type;
+ const zend_type *single_type;
zend_string *intersection_str = NULL;
ZEND_TYPE_LIST_FOREACH(intersection_type_list, single_type) {
@@ -1432,7 +1432,7 @@ static zend_string *add_intersection_type(zend_string *str,
return str;
}
-zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scope) {
+zend_string *zend_type_to_string_resolved(const zend_type type, zend_class_entry *scope) {
zend_string *str = NULL;
/* Pure intersection type */
@@ -1441,7 +1441,7 @@ zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scop
str = add_intersection_type(str, ZEND_TYPE_LIST(type), scope, /* is_bracketed */ false);
} else if (ZEND_TYPE_HAS_LIST(type)) {
/* A union type might not be a list */
- zend_type *list_type;
+ const zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {
str = add_intersection_type(str, ZEND_TYPE_LIST(*list_type), scope, /* is_bracketed */ true);
@@ -1527,7 +1527,7 @@ ZEND_API zend_string *zend_type_to_string(zend_type type) {
return zend_type_to_string_resolved(type, NULL);
}
-static bool is_generator_compatible_class_type(zend_string *name) {
+static bool is_generator_compatible_class_type(const zend_string *name) {
return zend_string_equals_ci(name, ZSTR_KNOWN(ZEND_STR_TRAVERSABLE))
|| zend_string_equals_literal_ci(name, "Iterator")
|| zend_string_equals_literal_ci(name, "Generator");
@@ -1541,10 +1541,10 @@ static void zend_mark_function_as_generator(void) /* {{{ */
}
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
- zend_type return_type = CG(active_op_array)->arg_info[-1].type;
+ const zend_type return_type = CG(active_op_array)->arg_info[-1].type;
bool valid_type = (ZEND_TYPE_FULL_MASK(return_type) & MAY_BE_OBJECT) != 0;
if (!valid_type) {
- zend_type *single_type;
+ const zend_type *single_type;
ZEND_TYPE_FOREACH(return_type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)
&& is_generator_compatible_class_type(ZEND_TYPE_NAME(*single_type))) {
@@ -2620,33 +2620,6 @@ static void zend_compile_memoized_expr(znode *result, zend_ast *expr) /* {{{ */
}
/* }}} */
-/* Remember to update type_num_classes() in compact_literals.c when changing this function */
-static size_t zend_type_get_num_classes(zend_type type) {
- if (!ZEND_TYPE_IS_COMPLEX(type)) {
- return 0;
- }
- if (ZEND_TYPE_HAS_LIST(type)) {
- /* Intersection types cannot have nested list types */
- if (ZEND_TYPE_IS_INTERSECTION(type)) {
- return ZEND_TYPE_LIST(type)->num_types;
- }
- ZEND_ASSERT(ZEND_TYPE_IS_UNION(type));
- size_t count = 0;
- zend_type *list_type;
-
- ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
- if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {
- count += ZEND_TYPE_LIST(*list_type)->num_types;
- } else {
- ZEND_ASSERT(!ZEND_TYPE_HAS_LIST(*list_type));
- count += 1;
- }
- } ZEND_TYPE_LIST_FOREACH_END();
- return count;
- }
- return 1;
-}
-
static void zend_emit_return_type_check(
znode *expr, zend_arg_info *return_info, bool implicit) /* {{{ */
{
@@ -2708,8 +2681,6 @@ static void zend_emit_return_type_check(
opline->result_type = expr->op_type = IS_TMP_VAR;
opline->result.var = expr->u.op.var = get_temporary_variable();
}
-
- opline->op2.num = zend_alloc_cache_slots(zend_type_get_num_classes(return_info->type));
}
}
/* }}} */
@@ -5746,6 +5717,26 @@ static void zend_compile_return(zend_ast *ast) /* {{{ */
}
/* }}} */
+static void zend_compile_void_cast(znode *result, zend_ast *ast)
+{
+ zend_ast *expr_ast = ast->child[0];
+ znode expr_node;
+ zend_op *opline;
+
+ zend_compile_expr(&expr_node, expr_ast);
+
+ switch (expr_node.op_type) {
+ case IS_TMP_VAR:
+ case IS_VAR:
+ opline = zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
+ opline->extended_value = ZEND_FREE_VOID_CAST;
+ break;
+ case IS_CONST:
+ zend_do_free(&expr_node);
+ break;
+ }
+}
+
static void zend_compile_echo(zend_ast *ast) /* {{{ */
{
zend_op *opline;
@@ -5996,7 +5987,7 @@ static void zend_compile_do_while(zend_ast *ast) /* {{{ */
}
/* }}} */
-static void zend_compile_expr_list(znode *result, zend_ast *ast) /* {{{ */
+static void zend_compile_for_expr_list(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list;
uint32_t i;
@@ -6013,7 +6004,13 @@ static void zend_compile_expr_list(znode *result, zend_ast *ast) /* {{{ */
zend_ast *expr_ast = list->child[i];
zend_do_free(result);
- zend_compile_expr(result, expr_ast);
+ if (expr_ast->kind == ZEND_AST_CAST_VOID) {
+ zend_compile_void_cast(NULL, expr_ast);
+ result->op_type = IS_CONST;
+ ZVAL_NULL(&result->u.constant);
+ } else {
+ zend_compile_expr(result, expr_ast);
+ }
}
}
/* }}} */
@@ -6028,7 +6025,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */
znode result;
uint32_t opnum_start, opnum_jmp, opnum_loop;
- zend_compile_expr_list(&result, init_ast);
+ zend_compile_for_expr_list(&result, init_ast);
zend_do_free(&result);
opnum_jmp = zend_emit_jump(0);
@@ -6039,11 +6036,11 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */
zend_compile_stmt(stmt_ast);
opnum_loop = get_next_op_number();
- zend_compile_expr_list(&result, loop_ast);
+ zend_compile_for_expr_list(&result, loop_ast);
zend_do_free(&result);
zend_update_jump_target_to_next(opnum_jmp);
- zend_compile_expr_list(&result, cond_ast);
+ zend_compile_for_expr_list(&result, cond_ast);
zend_do_extended_stmt();
zend_emit_cond_jump(ZEND_JMPNZ, &result, opnum_start);
@@ -7048,7 +7045,7 @@ static zend_type zend_compile_single_typename(zend_ast *ast)
}
}
-static void zend_are_intersection_types_redundant(zend_type left_type, zend_type right_type)
+static void zend_are_intersection_types_redundant(const zend_type left_type, const zend_type right_type)
{
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(left_type));
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(right_type));
@@ -7067,9 +7064,9 @@ static void zend_are_intersection_types_redundant(zend_type left_type, zend_type
}
unsigned int sum = 0;
- zend_type *outer_type;
+ const zend_type *outer_type;
ZEND_TYPE_LIST_FOREACH(smaller_type_list, outer_type)
- zend_type *inner_type;
+ const zend_type *inner_type;
ZEND_TYPE_LIST_FOREACH(larger_type_list, inner_type)
if (zend_string_equals_ci(ZEND_TYPE_NAME(*inner_type), ZEND_TYPE_NAME(*outer_type))) {
sum++;
@@ -7098,12 +7095,12 @@ static void zend_are_intersection_types_redundant(zend_type left_type, zend_type
}
}
-static void zend_is_intersection_type_redundant_by_single_type(zend_type intersection_type, zend_type single_type)
+static void zend_is_intersection_type_redundant_by_single_type(const zend_type intersection_type, const zend_type single_type)
{
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(intersection_type));
ZEND_ASSERT(!ZEND_TYPE_IS_INTERSECTION(single_type));
- zend_type *single_intersection_type = NULL;
+ const zend_type *single_intersection_type = NULL;
ZEND_TYPE_FOREACH(intersection_type, single_intersection_type)
if (zend_string_equals_ci(ZEND_TYPE_NAME(*single_intersection_type), ZEND_TYPE_NAME(single_type))) {
zend_string *single_type_str = zend_type_to_string(single_type);
@@ -7115,7 +7112,7 @@ static void zend_is_intersection_type_redundant_by_single_type(zend_type interse
}
/* Used by both intersection and union types prior to transforming the type list to a full zend_type */
-static void zend_is_type_list_redundant_by_single_type(zend_type_list *type_list, zend_type type)
+static void zend_is_type_list_redundant_by_single_type(const zend_type_list *type_list, const zend_type type)
{
ZEND_ASSERT(!ZEND_TYPE_IS_INTERSECTION(type));
for (size_t i = 0; i < type_list->num_types - 1; i++) {
@@ -7754,12 +7751,6 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32
SET_NODE(opline->result, &var_node);
opline->op1.num = i + 1;
- if (type_ast) {
- /* Allocate cache slot to speed-up run-time class resolution */
- opline->extended_value =
- zend_alloc_cache_slots(zend_type_get_num_classes(arg_info->type));
- }
-
uint32_t arg_info_flags = _ZEND_ARG_INFO_FLAGS(is_ref, is_variadic, /* is_tentative */ 0)
| (is_promoted ? _ZEND_IS_PROMOTED_BIT : 0);
ZEND_TYPE_FULL_MASK(arg_info->type) |= arg_info_flags;
@@ -9511,8 +9502,16 @@ static void zend_compile_const_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
+ zend_ast *attributes_ast = NULL;
+ zend_op *last_op = NULL;
for (i = 0; i < list->children; ++i) {
zend_ast *const_ast = list->child[i];
+ if (const_ast->kind == ZEND_AST_ATTRIBUTE_LIST) {
+ ZEND_ASSERT(i == list->children - 1);
+ attributes_ast = const_ast;
+ continue;
+ }
+ ZEND_ASSERT(const_ast->kind == ZEND_AST_CONST_ELEM);
zend_ast *name_ast = const_ast->child[0];
zend_ast **value_ast_ptr = &const_ast->child[1];
zend_string *unqualified_name = zend_ast_get_str(name_ast);
@@ -9543,10 +9542,33 @@ static void zend_compile_const_decl(zend_ast *ast) /* {{{ */
name_node.op_type = IS_CONST;
ZVAL_STR(&name_node.u.constant, name);
- zend_emit_op(NULL, ZEND_DECLARE_CONST, &name_node, &value_node);
+ last_op = zend_emit_op(NULL, ZEND_DECLARE_CONST, &name_node, &value_node);
zend_register_seen_symbol(name, ZEND_SYMBOL_CONST);
}
+ if (attributes_ast == NULL) {
+ return;
+ }
+ /* Validate: attributes can only be applied to one constant at a time
+ * Since we store the AST for the attributes in the list of children,
+ * there should be exactly 2 children. */
+ if (list->children > 2) {
+ zend_error_noreturn(
+ E_COMPILE_ERROR,
+ "Cannot apply attributes to multiple constants at once"
+ );
+ }
+
+ HashTable *attributes = NULL;
+ zend_compile_attributes(&attributes, list->child[1], 0, ZEND_ATTRIBUTE_TARGET_CONST, 0);
+
+ ZEND_ASSERT(last_op != NULL);
+ last_op->opcode = ZEND_DECLARE_ATTRIBUTED_CONST;
+ znode attribs_node;
+ attribs_node.op_type = IS_CONST;
+ ZVAL_PTR(&attribs_node.u.constant, attributes);
+ zend_emit_op_data(&attribs_node);
+ CG(active_op_array)->fn_flags |= ZEND_ACC_PTR_OPS;
}
/* }}}*/
@@ -10629,26 +10651,6 @@ static void zend_compile_include_or_eval(znode *result, zend_ast *ast) /* {{{ */
}
/* }}} */
-static void zend_compile_void_cast(znode *result, zend_ast *ast)
-{
- zend_ast *expr_ast = ast->child[0];
- znode expr_node;
- zend_op *opline;
-
- zend_compile_expr(&expr_node, expr_ast);
-
- switch (expr_node.op_type) {
- case IS_TMP_VAR:
- case IS_VAR:
- opline = zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
- opline->extended_value = ZEND_FREE_VOID_CAST;
- break;
- case IS_CONST:
- zend_do_free(&expr_node);
- break;
- }
-}
-
static void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
@@ -11156,6 +11158,7 @@ static bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
|| kind == ZEND_AST_AND || kind == ZEND_AST_OR
|| kind == ZEND_AST_UNARY_OP
|| kind == ZEND_AST_UNARY_PLUS || kind == ZEND_AST_UNARY_MINUS
+ || kind == ZEND_AST_CAST
|| kind == ZEND_AST_CONDITIONAL || kind == ZEND_AST_DIM
|| kind == ZEND_AST_ARRAY || kind == ZEND_AST_ARRAY_ELEM
|| kind == ZEND_AST_UNPACK
@@ -11430,6 +11433,12 @@ static void zend_compile_const_expr(zend_ast **ast_ptr, void *context) /* {{{ */
case ZEND_AST_MAGIC_CONST:
zend_compile_const_expr_magic_const(ast_ptr);
break;
+ case ZEND_AST_CAST:
+ if (ast->attr == IS_OBJECT && !ctx->allow_dynamic) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "Object casts are not supported in this context");
+ }
+ break;
case ZEND_AST_NEW:
if (!ctx->allow_dynamic) {
zend_error_noreturn(E_COMPILE_ERROR,
@@ -11864,6 +11873,34 @@ static zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t
}
/* }}} */
+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));
+ return true;
+ case IS_LONG:
+ ZVAL_LONG(result, zval_get_long(op1));
+ return true;
+ case IS_DOUBLE:
+ ZVAL_DOUBLE(result, zval_get_double(op1));
+ return true;
+ case IS_STRING:
+ /* Conversion from double to string takes into account run-time
+ 'precision' setting and cannot be evaluated at compile-time */
+ if (Z_TYPE_P(op1) != IS_ARRAY && Z_TYPE_P(op1) != IS_DOUBLE) {
+ ZVAL_STR(result, zval_get_string(op1));
+ return true;
+ }
+ break;
+ case IS_ARRAY:
+ ZVAL_COPY(result, op1);
+ convert_to_array(result);
+ return true;
+ }
+ return false;
+}
+
static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
@@ -12149,6 +12186,13 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
return;
+ case ZEND_AST_CAST:
+ zend_eval_const_expr(&ast->child[0]);
+ if (ast->child[0]->kind == ZEND_AST_ZVAL
+ && zend_try_ct_eval_cast(&result, ast->attr, zend_ast_get_zval(ast->child[0]))) {
+ break;
+ }
+ return;
default:
return;
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index db087bdd60035..62d0fbcded2ee 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -395,6 +395,11 @@ typedef struct _zend_oparray_context {
/* has #[\Override] attribute | | | */
#define ZEND_ACC_OVERRIDE (1 << 28) /* | X | | */
/* | | | */
+/* Has IS_PTR operands that needs special cleaning; same | | | */
+/* value as ZEND_ACC_OVERRIDE but override is for class | | | */
+/* methods and this is for the top level op array | | | */
+#define ZEND_ACC_PTR_OPS (1 << 28) /* | X | | */
+/* | | | */
/* has #[\NoDiscard] attribute | | | */
#define ZEND_ACC_NODISCARD (1 << 29) /* | X | | */
/* | | | */
@@ -467,6 +472,8 @@ typedef struct _zend_property_info {
((uint32_t)(XtOffsetOf(zend_object, properties_table) + sizeof(zval) * (num)))
#define OBJ_PROP_TO_NUM(offset) \
(((offset) - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))
+#define OBJ_PROP_SLOT_TO_OFFSET(obj, slot) \
+ ((uintptr_t)(slot) - (uintptr_t)(obj))
typedef struct _zend_class_constant {
zval value; /* flags are stored in u2 */
@@ -1299,4 +1306,6 @@ ZEND_API bool zend_is_op_long_compatible(const zval *op);
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, const zval *op2);
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op);
+bool zend_try_ct_eval_cast(zval *result, uint32_t type, zval *op1);
+
#endif /* ZEND_COMPILE_H */
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index f29466cfe2c9c..28a4b7b048cf0 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -18,6 +18,7 @@
*/
#include "zend.h"
+#include "zend_attributes.h"
#include "zend_constants.h"
#include "zend_exceptions.h"
#include "zend_execute.h"
@@ -49,6 +50,9 @@ void free_zend_constant(zval *zv)
if (c->filename) {
zend_string_release_ex(c->filename, 0);
}
+ if (c->attributes) {
+ zend_hash_release(c->attributes);
+ }
efree(c);
} else {
zval_internal_ptr_dtor(&c->value);
@@ -58,6 +62,9 @@ void free_zend_constant(zval *zv)
if (c->filename) {
zend_string_release_ex(c->filename, 1);
}
+ if (c->attributes) {
+ zend_hash_release(c->attributes);
+ }
free(c);
}
}
@@ -77,6 +84,9 @@ static void copy_zend_constant(zval *zv)
if (c->filename != NULL) {
c->filename = zend_string_copy(c->filename);
}
+ if (c->attributes != NULL) {
+ c->attributes = zend_array_dup(c->attributes);
+ }
if (Z_TYPE(c->value) == IS_STRING) {
Z_STR(c->value) = zend_string_dup(Z_STR(c->value), 1);
}
@@ -467,7 +477,11 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
}
if (!(flags & ZEND_FETCH_CLASS_SILENT) && (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED)) {
- zend_error(E_DEPRECATED, "Constant %s is deprecated", name);
+ if (!CONST_IS_RECURSIVE(c)) {
+ CONST_PROTECT_RECURSION(c);
+ zend_deprecated_constant(c, c->name);
+ CONST_UNPROTECT_RECURSION(c);
+ }
}
return &c->value;
}
@@ -514,6 +528,8 @@ ZEND_API zend_result zend_register_constant(zend_constant *c)
}
}
+ c->attributes = NULL;
+
/* Check if the user is trying to define any special constant */
if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__")
|| (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)))
@@ -535,3 +551,22 @@ ZEND_API zend_result zend_register_constant(zend_constant *c)
}
return ret;
}
+
+void zend_constant_add_attributes(zend_constant *c, HashTable *attributes) {
+ GC_TRY_ADDREF(attributes);
+ c->attributes = attributes;
+
+ zend_attribute *deprecated_attribute = zend_get_attribute_str(
+ c->attributes,
+ "deprecated",
+ strlen("deprecated")
+ );
+
+ if (deprecated_attribute) {
+ ZEND_CONSTANT_SET_FLAGS(
+ c,
+ ZEND_CONSTANT_FLAGS(c) | CONST_DEPRECATED,
+ ZEND_CONSTANT_MODULE_NUMBER(c)
+ );
+ }
+}
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 4a4da46bfc9b1..3912215d80775 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -45,6 +45,7 @@ typedef struct _zend_constant {
zval value;
zend_string *name;
zend_string *filename;
+ HashTable *attributes;
} zend_constant;
#define ZEND_CONSTANT_FLAGS(c) \
@@ -97,6 +98,7 @@ ZEND_API void zend_register_double_constant(const char *name, size_t name_len, d
ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, int flags, int module_number);
ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval, size_t strlen, int flags, int module_number);
ZEND_API zend_result zend_register_constant(zend_constant *c);
+void zend_constant_add_attributes(zend_constant *c, HashTable *attributes);
#ifdef ZTS
void zend_copy_constants(HashTable *target, HashTable *source);
#endif
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 4fed2af3a92fd..0fbfdfa07ef04 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -609,7 +609,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg
zend_string_release(func_name);
}
-static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_prop_error(zend_property_info *prop) {
+static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_prop_error(const zend_property_info *prop) {
zend_string *type_str = zend_type_to_string(prop->type);
zend_type_error(
"Cannot auto-initialize an array inside property %s::$%s of type %s",
@@ -619,7 +619,7 @@ static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_prop_error(zend_
zend_string_release(type_str);
}
-static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_ref_error(zend_property_info *prop) {
+static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_ref_error(const zend_property_info *prop) {
zend_string *type_str = zend_type_to_string(prop->type);
zend_type_error(
"Cannot auto-initialize an array inside a reference held by property %s::$%s of type %s",
@@ -630,7 +630,7 @@ static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_ref_error(zend_p
}
static zend_never_inline ZEND_COLD void zend_throw_access_uninit_prop_by_ref_error(
- zend_property_info *prop) {
+ const zend_property_info *prop) {
zend_throw_error(NULL,
"Cannot access uninitialized non-nullable property %s::$%s by reference",
ZSTR_VAL(prop->ce->name),
@@ -638,7 +638,7 @@ static zend_never_inline ZEND_COLD void zend_throw_access_uninit_prop_by_ref_err
}
/* this should modify object only if it's empty */
-static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_error(zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC)
+static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_error(const zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC)
{
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
@@ -673,7 +673,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_erro
}
static ZEND_COLD void zend_verify_type_error_common(
- const zend_function *zf, const zend_arg_info *arg_info, zval *value,
+ const zend_function *zf, const zend_arg_info *arg_info, const zval *value,
const char **fname, const char **fsep, const char **fclass,
zend_string **need_msg, const char **given_kind)
{
@@ -696,9 +696,9 @@ static ZEND_COLD void zend_verify_type_error_common(
}
ZEND_API ZEND_COLD void zend_verify_arg_error(
- const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value)
+ const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value)
{
- zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
+ const zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname, *fsep, *fclass;
zend_string *need_msg;
const char *given_msg;
@@ -909,7 +909,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modificati
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
}
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type)
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(const uint8_t type)
{
zend_type_error("Cannot use value of type %s as class constant name", zend_get_type_by_const(type));
}
@@ -975,9 +975,9 @@ static zend_always_inline const zend_class_entry *zend_ce_from_type(
}
static bool zend_check_intersection_for_property_or_class_constant_class_type(
- const zend_class_entry *scope, zend_type_list *intersection_type_list, const zend_class_entry *value_ce)
+ const zend_class_entry *scope, const zend_type_list *intersection_type_list, const zend_class_entry *value_ce)
{
- zend_type *list_type;
+ const zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(intersection_type_list, list_type) {
ZEND_ASSERT(!ZEND_TYPE_HAS_LIST(*list_type));
@@ -990,13 +990,13 @@ static bool zend_check_intersection_for_property_or_class_constant_class_type(
}
static bool zend_check_and_resolve_property_or_class_constant_class_type(
- const zend_class_entry *scope, zend_type member_type, const zend_class_entry *value_ce) {
+ const zend_class_entry *scope, const zend_type member_type, const zend_class_entry *value_ce) {
if (ZEND_TYPE_HAS_LIST(member_type)) {
- zend_type *list_type;
if (ZEND_TYPE_IS_INTERSECTION(member_type)) {
return zend_check_intersection_for_property_or_class_constant_class_type(
scope, ZEND_TYPE_LIST(member_type), value_ce);
} else {
+ const zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(member_type), list_type) {
if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {
if (zend_check_intersection_for_property_or_class_constant_class_type(
@@ -1059,7 +1059,7 @@ ZEND_API bool zend_never_inline zend_verify_property_type(const zend_property_in
return i_zend_verify_property_type(info, property, strict);
}
-static zend_never_inline zval* zend_assign_to_typed_prop(zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr EXECUTE_DATA_DC)
+static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr EXECUTE_DATA_DC)
{
zval tmp;
@@ -1087,7 +1087,7 @@ static zend_never_inline zval* zend_assign_to_typed_prop(zend_property_info *inf
return zend_assign_to_variable_ex(property_val, &tmp, IS_TMP_VAR, EX_USES_STRICT_TYPES(), garbage_ptr);
}
-static zend_always_inline bool zend_value_instanceof_static(zval *zv) {
+static zend_always_inline bool zend_value_instanceof_static(const zval *zv) {
if (Z_TYPE_P(zv) != IS_OBJECT) {
return 0;
}
@@ -1099,23 +1099,9 @@ static zend_always_inline bool zend_value_instanceof_static(zval *zv) {
return instanceof_function(Z_OBJCE_P(zv), called_scope);
}
-/* The cache_slot may only be NULL in debug builds, where arginfo verification of
- * internal functions is enabled. Avoid unnecessary checks in release builds. */
-#if ZEND_DEBUG
-# define HAVE_CACHE_SLOT (cache_slot != NULL)
-#else
-# define HAVE_CACHE_SLOT 1
-#endif
-
-#define PROGRESS_CACHE_SLOT() if (HAVE_CACHE_SLOT) {cache_slot++;}
-
-static zend_always_inline zend_class_entry *zend_fetch_ce_from_cache_slot(
- void **cache_slot, zend_type *type)
+static zend_always_inline zend_class_entry *zend_fetch_ce_from_type(
+ const zend_type *type)
{
- if (EXPECTED(HAVE_CACHE_SLOT && *cache_slot)) {
- return (zend_class_entry *) *cache_slot;
- }
-
zend_string *name = ZEND_TYPE_NAME(*type);
zend_class_entry *ce;
if (ZSTR_HAS_CE_CACHE(name)) {
@@ -1134,68 +1120,54 @@ static zend_always_inline zend_class_entry *zend_fetch_ce_from_cache_slot(
return NULL;
}
}
- if (HAVE_CACHE_SLOT) {
- *cache_slot = (void *) ce;
- }
return ce;
}
-static bool zend_check_intersection_type_from_cache_slot(zend_type_list *intersection_type_list,
- zend_class_entry *arg_ce, void ***cache_slot_ptr)
+static bool zend_check_intersection_type_from_list(
+ const zend_type_list *intersection_type_list,
+ zend_class_entry *arg_ce)
{
- void **cache_slot = *cache_slot_ptr;
zend_class_entry *ce;
- zend_type *list_type;
- bool status = true;
+ const zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(intersection_type_list, list_type) {
- /* Only check classes if the type might be valid */
- if (status) {
- ce = zend_fetch_ce_from_cache_slot(cache_slot, list_type);
- /* If type is not an instance of one of the types taking part in the
- * intersection it cannot be a valid instance of the whole intersection type. */
- if (!ce || !instanceof_function(arg_ce, ce)) {
- status = false;
- }
+ ce = zend_fetch_ce_from_type(list_type);
+ /* If type is not an instance of one of the types taking part in the
+ * intersection it cannot be a valid instance of the whole intersection type. */
+ if (!ce || !instanceof_function(arg_ce, ce)) {
+ return false;
}
- PROGRESS_CACHE_SLOT();
} ZEND_TYPE_LIST_FOREACH_END();
- if (HAVE_CACHE_SLOT) {
- *cache_slot_ptr = cache_slot;
- }
- return status;
+ return true;
}
static zend_always_inline bool zend_check_type_slow(
- zend_type *type, zval *arg, zend_reference *ref, void **cache_slot,
+ const zend_type *type, zval *arg, const zend_reference *ref,
bool is_return_type, bool is_internal)
{
- uint32_t type_mask;
if (ZEND_TYPE_IS_COMPLEX(*type) && EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
zend_class_entry *ce;
if (UNEXPECTED(ZEND_TYPE_HAS_LIST(*type))) {
- zend_type *list_type;
if (ZEND_TYPE_IS_INTERSECTION(*type)) {
- return zend_check_intersection_type_from_cache_slot(ZEND_TYPE_LIST(*type), Z_OBJCE_P(arg), &cache_slot);
+ return zend_check_intersection_type_from_list(ZEND_TYPE_LIST(*type), Z_OBJCE_P(arg));
} else {
+ const zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*type), list_type) {
if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {
- if (zend_check_intersection_type_from_cache_slot(ZEND_TYPE_LIST(*list_type), Z_OBJCE_P(arg), &cache_slot)) {
+ if (zend_check_intersection_type_from_list(ZEND_TYPE_LIST(*list_type), Z_OBJCE_P(arg))) {
return true;
}
- /* The cache_slot is progressed in zend_check_intersection_type_from_cache_slot() */
} else {
ZEND_ASSERT(!ZEND_TYPE_HAS_LIST(*list_type));
- ce = zend_fetch_ce_from_cache_slot(cache_slot, list_type);
+ ce = zend_fetch_ce_from_type(list_type);
/* Instance of a single type part of a union is sufficient to pass the type check */
if (ce && instanceof_function(Z_OBJCE_P(arg), ce)) {
return true;
}
- PROGRESS_CACHE_SLOT();
}
} ZEND_TYPE_LIST_FOREACH_END();
}
} else {
- ce = zend_fetch_ce_from_cache_slot(cache_slot, type);
+ ce = zend_fetch_ce_from_type(type);
/* If we have a CE we check if it satisfies the type constraint,
* otherwise it will check if a standard type satisfies it. */
if (ce && instanceof_function(Z_OBJCE_P(arg), ce)) {
@@ -1204,7 +1176,7 @@ static zend_always_inline bool zend_check_type_slow(
}
}
- type_mask = ZEND_TYPE_FULL_MASK(*type);
+ const uint32_t type_mask = ZEND_TYPE_FULL_MASK(*type);
if ((type_mask & MAY_BE_CALLABLE) &&
zend_is_callable(arg, is_internal ? IS_CALLABLE_SUPPRESS_DEPRECATIONS : 0, NULL)) {
return 1;
@@ -1232,10 +1204,10 @@ static zend_always_inline bool zend_check_type_slow(
}
static zend_always_inline bool zend_check_type(
- zend_type *type, zval *arg, void **cache_slot, zend_class_entry *scope,
+ const zend_type *type, zval *arg, zend_class_entry *scope,
bool is_return_type, bool is_internal)
{
- zend_reference *ref = NULL;
+ const zend_reference *ref = NULL;
ZEND_ASSERT(ZEND_TYPE_IS_SET(*type));
if (UNEXPECTED(Z_ISREF_P(arg))) {
@@ -1247,25 +1219,25 @@ static zend_always_inline bool zend_check_type(
return 1;
}
- return zend_check_type_slow(type, arg, ref, cache_slot, is_return_type, is_internal);
+ return zend_check_type_slow(type, arg, ref, is_return_type, is_internal);
}
ZEND_API bool zend_check_user_type_slow(
- zend_type *type, zval *arg, zend_reference *ref, void **cache_slot, bool is_return_type)
+ const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type)
{
return zend_check_type_slow(
- type, arg, ref, cache_slot, is_return_type, /* is_internal */ false);
+ type, arg, ref, is_return_type, /* is_internal */ false);
}
-static zend_always_inline bool zend_verify_recv_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, void **cache_slot)
+static zend_always_inline bool zend_verify_recv_arg_type(const zend_function *zf, uint32_t arg_num, zval *arg)
{
- zend_arg_info *cur_arg_info;
+ const zend_arg_info *cur_arg_info;
ZEND_ASSERT(arg_num <= zf->common.num_args);
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, cache_slot, zf->common.scope, 0, 0))) {
+ && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, zf->common.scope, 0, 0))) {
zend_verify_arg_error(zf, cur_arg_info, arg_num, arg);
return 0;
}
@@ -1274,10 +1246,10 @@ static zend_always_inline bool zend_verify_recv_arg_type(zend_function *zf, uint
}
static zend_always_inline bool zend_verify_variadic_arg_type(
- zend_function *zf, zend_arg_info *arg_info, uint32_t arg_num, zval *arg, void **cache_slot)
+ 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, cache_slot, zf->common.scope, 0, 0))) {
+ if (UNEXPECTED(!zend_check_type(&arg_info->type, arg, zf->common.scope, 0, 0))) {
zend_verify_arg_error(zf, arg_info, arg_num, arg);
return 0;
}
@@ -1285,7 +1257,7 @@ static zend_always_inline bool zend_verify_variadic_arg_type(
return 1;
}
-static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_types(zend_function *fbc, zend_execute_data *call)
+static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_types(const zend_function *fbc, zend_execute_data *call)
{
uint32_t i;
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
@@ -1302,7 +1274,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, /* cache_slot */ NULL, fbc->common.scope, 0, /* is_internal */ 1))) {
+ && UNEXPECTED(!zend_check_type(&cur_arg_info->type, arg, fbc->common.scope, 0, /* is_internal */ 1))) {
return 0;
}
arg++;
@@ -1314,7 +1286,7 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
/* Determine whether an internal call should throw, because the passed arguments violate
* an arginfo constraint. This is only checked in debug builds. In release builds, we
* trust that arginfo matches what is enforced by zend_parse_parameters. */
-ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
+ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call)
{
if (fbc->internal_function.handler == ZEND_FN(pass) || (fbc->internal_function.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
/* Be lenient about the special pass function and about fake closures. */
@@ -1341,7 +1313,7 @@ ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_d
return 0;
}
-ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc)
+ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc)
{
zend_error_noreturn(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
@@ -1353,10 +1325,10 @@ ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc)
# define ZEND_VERIFY_FUNC_INFO 0
#endif
-static void zend_verify_internal_func_info(zend_function *fn, zval *retval) {
+static void zend_verify_internal_func_info(const zend_function *fn, const zval *retval) {
#if ZEND_VERIFY_FUNC_INFO
zend_string *name = fn->common.function_name;
- uint32_t type_mask = zend_get_internal_func_info(fn, NULL, NULL);
+ const uint32_t type_mask = zend_get_internal_func_info(fn, NULL, NULL);
if (!type_mask) {
return;
}
@@ -1371,14 +1343,14 @@ static void zend_verify_internal_func_info(zend_function *fn, zval *retval) {
}
}
- uint32_t type = 1u << Z_TYPE_P(retval);
+ const uint32_t type = 1u << Z_TYPE_P(retval);
if (!(type_mask & type)) {
zend_error_noreturn(E_CORE_ERROR, "%s() missing type %s",
ZSTR_VAL(name), zend_get_type_by_const(Z_TYPE_P(retval)));
}
if (Z_TYPE_P(retval) == IS_ARRAY) {
- HashTable *ht = Z_ARRVAL_P(retval);
+ const HashTable *ht = Z_ARRVAL_P(retval);
uint32_t num_checked = 0;
zend_string *str;
zval *val;
@@ -1395,7 +1367,7 @@ static void zend_verify_internal_func_info(zend_function *fn, zval *retval) {
}
}
- uint32_t array_type = 1u << (Z_TYPE_P(val) + MAY_BE_ARRAY_SHIFT);
+ const uint32_t array_type = 1u << (Z_TYPE_P(val) + MAY_BE_ARRAY_SHIFT);
if (!(type_mask & array_type)) {
zend_error_noreturn(E_CORE_ERROR,
"%s() missing array element type %s",
@@ -1412,9 +1384,9 @@ static void zend_verify_internal_func_info(zend_function *fn, zval *retval) {
}
#endif
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data)
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data)
{
- zend_execute_data *ptr = EX(prev_execute_data);
+ const zend_execute_data *ptr = EX(prev_execute_data);
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
@@ -1437,7 +1409,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
}
}
-ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, zval *value)
+ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zval *value)
{
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
@@ -1464,7 +1436,7 @@ ZEND_API ZEND_COLD void zend_verify_never_error(const zend_function *zf)
}
#if ZEND_DEBUG
-static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, zval *value)
+static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const zval *value)
{
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
@@ -1496,9 +1468,9 @@ static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, con
fclass, fsep, fname, returned_msg, returned_kind);
}
-ZEND_API bool zend_verify_internal_return_type(zend_function *zf, zval *ret)
+ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *ret)
{
- zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
+ const zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_VOID) {
if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) {
@@ -1508,7 +1480,7 @@ ZEND_API bool zend_verify_internal_return_type(zend_function *zf, zval *ret)
return 1;
}
- if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, /* cache_slot */ NULL, NULL, 1, /* is_internal */ 1))) {
+ if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, NULL, 1, /* is_internal */ 1))) {
zend_verify_internal_return_error(zf, ret);
return 0;
}
@@ -1523,7 +1495,7 @@ static ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf)
zend_verify_return_error(zf, NULL);
}
-static zend_always_inline bool zend_check_class_constant_type(zend_class_constant *c, zval *constant)
+static zend_always_inline bool zend_check_class_constant_type(const zend_class_constant *c, zval *constant)
{
ZEND_ASSERT(!Z_ISREF_P(constant));
if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(c->type, Z_TYPE_P(constant)))) {
@@ -1540,7 +1512,7 @@ static zend_always_inline bool zend_check_class_constant_type(zend_class_constan
return zend_verify_scalar_type_hint(type_mask, constant, true, false);
}
-ZEND_API bool zend_never_inline zend_verify_class_constant_type(zend_class_constant *c, const zend_string *name, zval *constant)
+ZEND_API bool zend_never_inline zend_verify_class_constant_type(const zend_class_constant *c, const zend_string *name, zval *constant)
{
if (!zend_check_class_constant_type(c, constant)) {
zend_verify_class_constant_type_error(c, name, constant);
@@ -1709,7 +1681,7 @@ static zend_never_inline void zend_binary_assign_op_typed_ref(zend_reference *re
}
}
-static zend_never_inline void zend_binary_assign_op_typed_prop(zend_property_info *prop_info, zval *zptr, zval *value OPLINE_DC EXECUTE_DATA_DC)
+static zend_never_inline void zend_binary_assign_op_typed_prop(const zend_property_info *prop_info, zval *zptr, zval *value OPLINE_DC EXECUTE_DATA_DC)
{
zval z_copy;
@@ -2007,6 +1979,24 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_class_constant(const zend_
zend_string_release(message_suffix);
}
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_constant(const zend_constant *c, const zend_string *constant_name)
+{
+ zend_string *message_suffix = ZSTR_EMPTY_ALLOC();
+
+ if (get_deprecation_suffix_from_attribute(c->attributes, NULL, &message_suffix) == FAILURE) {
+ return;
+ }
+
+ int code = ZEND_CONSTANT_MODULE_NUMBER(c) == PHP_USER_CONSTANT ? E_USER_DEPRECATED : E_DEPRECATED;
+
+ zend_error_unchecked(code, "Constant %s is deprecated%S",
+ ZSTR_VAL(constant_name),
+ message_suffix
+ );
+
+ zend_string_release(message_suffix);
+}
+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void)
{
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
@@ -5350,7 +5340,11 @@ static zend_always_inline zend_result _zend_quick_get_constant(
if (!check_defined_only) {
ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value);
if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) {
- zend_error(E_DEPRECATED, "Constant %s is deprecated", ZSTR_VAL(c->name));
+ if (!CONST_IS_RECURSIVE(c)) {
+ CONST_PROTECT_RECURSION(c);
+ zend_deprecated_constant(c, c->name);
+ CONST_UNPROTECT_RECURSION(c);
+ }
return SUCCESS;
}
}
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index e96a217a2904f..cf15c9e3b2db5 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -25,6 +25,7 @@
#include "zend_hash.h"
#include "zend_operators.h"
#include "zend_variables.h"
+#include "zend_constants.h"
#include
@@ -60,10 +61,11 @@ ZEND_API zend_result zend_eval_stringl_ex(const char *str, size_t str_len, zval
/* export zend_pass_function to allow comparisons against it */
extern ZEND_API const zend_internal_function zend_pass_function;
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_nodiscard_function(const zend_function *fbc);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_class_constant(const zend_class_constant *c, const zend_string *constant_name);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_constant(const zend_constant *c, const zend_string *constant_name);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void);
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_use_resource_as_offset(const zval *dim);
@@ -95,23 +97,23 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_pr
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void);
ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_property_info *prop_info);
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *info, const char *operation);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *prop_info, const char *operation);
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
ZEND_API ZEND_COLD void zend_verify_arg_error(
- const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value);
+ const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value);
ZEND_API ZEND_COLD void zend_verify_return_error(
- const zend_function *zf, zval *value);
+ const zend_function *zf, const zval *value);
ZEND_API ZEND_COLD void zend_verify_never_error(
const zend_function *zf);
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);
ZEND_API bool zend_check_user_type_slow(
- zend_type *type, zval *arg, zend_reference *ref, void **cache_slot, bool is_return_type);
+ const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type);
#if ZEND_DEBUG
-ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call);
-ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc);
-ZEND_API bool zend_verify_internal_return_type(zend_function *zf, zval *ret);
+ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call);
+ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc);
+ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *ret);
#endif
#define ZEND_REF_TYPE_SOURCES(ref) \
@@ -219,6 +221,60 @@ static zend_always_inline void zend_safe_assign_to_variable_noref(zval *variable
}
}
+static zend_always_inline void zend_cast_zval_to_object(zval *result, zval *expr, uint8_t op1_type) {
+ HashTable *ht;
+
+ ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
+ if (Z_TYPE_P(expr) == IS_ARRAY) {
+ ht = zend_symtable_to_proptable(Z_ARR_P(expr));
+ if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
+ /* TODO: try not to duplicate immutable arrays as well ??? */
+ ht = zend_array_dup(ht);
+ }
+ Z_OBJ_P(result)->properties = ht;
+ } else if (Z_TYPE_P(expr) != IS_NULL) {
+ Z_OBJ_P(result)->properties = ht = zend_new_array(1);
+ expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
+ if (op1_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
+ } else {
+ if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
+ }
+ }
+}
+
+static zend_always_inline void zend_cast_zval_to_array(zval *result, zval *expr, uint8_t op1_type) {
+ extern zend_class_entry *zend_ce_closure;
+ if (op1_type == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
+ if (Z_TYPE_P(expr) != IS_NULL) {
+ ZVAL_ARR(result, zend_new_array(1));
+ expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
+ if (op1_type == IS_CONST) {
+ if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
+ } else {
+ if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
+ }
+ } else {
+ ZVAL_EMPTY_ARRAY(result);
+ }
+ } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
+ /* Optimized version without rebuilding properties HashTable */
+ ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
+ } else {
+ HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
+ if (obj_ht) {
+ /* fast copy */
+ ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
+ (Z_OBJCE_P(expr)->default_properties_count ||
+ Z_OBJ_P(expr)->handlers != &std_object_handlers ||
+ GC_IS_RECURSIVE(obj_ht))));
+ zend_release_properties(obj_ht);
+ } else {
+ ZVAL_EMPTY_ARRAY(result);
+ }
+ }
+}
+
ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp);
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope);
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_with_ctx(zval *pp, zend_class_entry *scope, zend_ast_evaluate_ctx *ctx);
@@ -522,7 +578,7 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((bool)(ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS))
-ZEND_API bool zend_verify_class_constant_type(zend_class_constant *c, const zend_string *name, zval *constant);
+ZEND_API bool zend_verify_class_constant_type(const zend_class_constant *c, const zend_string *name, zval *constant);
ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant);
ZEND_API bool zend_verify_property_type(const zend_property_info *info, zval *property, bool strict);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1f55521fb72f1..9a7803e44e66e 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -53,10 +53,6 @@ ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data);
ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);
ZEND_API zend_class_entry *(*zend_autoload)(zend_string *name, zend_string *lc_name);
-/* true globals */
-ZEND_API const zend_fcall_info empty_fcall_info = {0};
-ZEND_API const zend_fcall_info_cache empty_fcall_info_cache = {0};
-
#ifdef ZEND_WIN32
ZEND_TLS HANDLE tq_timer = NULL;
#endif
@@ -304,6 +300,9 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown)
if (c->filename) {
zend_string_release_ex(c->filename, 0);
}
+ if (c->attributes) {
+ zend_hash_release(c->attributes);
+ }
efree(c);
zend_string_release_ex(key, 0);
} ZEND_HASH_MAP_FOREACH_END_DEL();
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 8bddb0c208835..66cfb250d1fec 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -30,7 +30,6 @@
#if defined(__AVX2__)
# include
#elif defined( __SSE2__)
-# include
# include
#endif
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 8747e11d151fc..e718eb5684e65 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -83,7 +83,7 @@ static void zend_type_list_copy_ctor(
}
zend_type *list_type;
- ZEND_TYPE_LIST_FOREACH(new_list, list_type) {
+ ZEND_TYPE_LIST_FOREACH_MUTABLE(new_list, list_type) {
zend_type_copy_ctor(list_type, use_arena, persistent);
} ZEND_TYPE_LIST_FOREACH_END();
}
@@ -96,7 +96,7 @@ static void zend_type_copy_ctor(zend_type *const type, bool use_arena, bool pers
}
}
-static zend_function *zend_duplicate_internal_function(zend_function *func, const zend_class_entry *ce) /* {{{ */
+static zend_function *zend_duplicate_internal_function(const zend_function *func, const zend_class_entry *ce) /* {{{ */
{
zend_function *new_function;
@@ -310,7 +310,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(zend_class_entry *ce1, const zend_class_entry *ce2) {
+static bool unlinked_instanceof(const zend_class_entry *ce1, const zend_class_entry *ce2) {
if (ce1 == ce2) {
return 1;
}
@@ -347,7 +347,7 @@ static bool unlinked_instanceof(zend_class_entry *ce1, const zend_class_entry *c
}
} else {
for (i = 0; i < ce1->num_interfaces; i++) {
- zend_class_entry *ce = zend_lookup_class_ex(
+ const zend_class_entry *ce = zend_lookup_class_ex(
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
/* Avoid recursing if class implements itself. */
@@ -362,7 +362,7 @@ static bool unlinked_instanceof(zend_class_entry *ce1, const zend_class_entry *c
}
static bool zend_type_permits_self(
- zend_type type, zend_class_entry *scope, zend_class_entry *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;
}
@@ -370,11 +370,11 @@ static bool zend_type_permits_self(
/* Any types that may satisfy self must have already been loaded at this point
* (as a parent or interface), so we never need to register delayed variance obligations
* for this case. */
- zend_type *single_type;
+ const zend_type *single_type;
ZEND_TYPE_FOREACH(type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)) {
zend_string *name = resolve_class_name(scope, ZEND_TYPE_NAME(*single_type));
- zend_class_entry *ce = lookup_class(self, name);
+ const zend_class_entry *ce = lookup_class(self, name);
if (ce && unlinked_instanceof(self, ce)) {
return 1;
}
@@ -428,12 +428,12 @@ static void track_class_dependency(zend_class_entry *ce, zend_string *class_name
/* Check whether any type in the fe_type intersection type is a subtype of the proto class. */
static inheritance_status zend_is_intersection_subtype_of_class(
- zend_class_entry *fe_scope, zend_type fe_type,
+ zend_class_entry *fe_scope, const zend_type fe_type,
zend_class_entry *proto_scope, zend_string *proto_class_name, zend_class_entry *proto_ce)
{
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(fe_type));
bool have_unresolved = false;
- zend_type *single_type;
+ const zend_type *single_type;
/* Traverse the list of child types and check that at least one is
* a subtype of the parent type being checked */
@@ -473,7 +473,7 @@ static inheritance_status zend_is_intersection_subtype_of_class(
/* Check whether a single class proto type is a subtype of a potentially complex fe_type. */
static inheritance_status zend_is_class_subtype_of_type(
zend_class_entry *fe_scope, zend_string *fe_class_name,
- zend_class_entry *proto_scope, zend_type proto_type) {
+ zend_class_entry *proto_scope, const zend_type proto_type) {
zend_class_entry *fe_ce = NULL;
bool have_unresolved = 0;
@@ -513,7 +513,7 @@ static inheritance_status zend_is_class_subtype_of_type(
}
}
- zend_type *single_type;
+ const zend_type *single_type;
/* Traverse the list of parent types and check if the current child (FE)
* class is the subtype of at least one of them (union) or all of them (intersection). */
@@ -584,15 +584,15 @@ static inheritance_status zend_is_class_subtype_of_type(
return is_intersection ? INHERITANCE_SUCCESS : INHERITANCE_ERROR;
}
-static zend_string *get_class_from_type(zend_class_entry *scope, zend_type single_type) {
+static zend_string *get_class_from_type(const zend_class_entry *scope, const zend_type single_type) {
if (ZEND_TYPE_HAS_NAME(single_type)) {
return resolve_class_name(scope, ZEND_TYPE_NAME(single_type));
}
return NULL;
}
-static void register_unresolved_classes(zend_class_entry *scope, zend_type type) {
- zend_type *single_type;
+static void register_unresolved_classes(zend_class_entry *scope, const zend_type type) {
+ const zend_type *single_type;
ZEND_TYPE_FOREACH(type, single_type) {
if (ZEND_TYPE_HAS_LIST(*single_type)) {
register_unresolved_classes(scope, *single_type);
@@ -606,11 +606,11 @@ static void register_unresolved_classes(zend_class_entry *scope, zend_type type)
}
static inheritance_status zend_is_intersection_subtype_of_type(
- zend_class_entry *fe_scope, zend_type fe_type,
- zend_class_entry *proto_scope, zend_type proto_type)
+ zend_class_entry *fe_scope, const zend_type fe_type,
+ zend_class_entry *proto_scope, const zend_type proto_type)
{
bool have_unresolved = false;
- zend_type *single_type;
+ const zend_type *single_type;
uint32_t proto_type_mask = ZEND_TYPE_PURE_MASK(proto_type);
/* Currently, for object type any class name would be allowed here.
@@ -672,8 +672,8 @@ static inheritance_status zend_is_intersection_subtype_of_type(
}
ZEND_API inheritance_status zend_perform_covariant_type_check(
- zend_class_entry *fe_scope, zend_type fe_type,
- zend_class_entry *proto_scope, zend_type proto_type)
+ zend_class_entry *fe_scope, const zend_type fe_type,
+ zend_class_entry *proto_scope, const zend_type proto_type)
{
ZEND_ASSERT(ZEND_TYPE_IS_SET(fe_type) && ZEND_TYPE_IS_SET(proto_type));
@@ -706,7 +706,6 @@ ZEND_API inheritance_status zend_perform_covariant_type_check(
}
}
- zend_type *single_type;
inheritance_status early_exit_status;
bool have_unresolved = false;
@@ -728,6 +727,7 @@ ZEND_API inheritance_status zend_perform_covariant_type_check(
* We need to iterate over fe_type (U_i) first and the logic is independent of
* whether proto_type is a union or intersection (only the inner check differs). */
early_exit_status = INHERITANCE_ERROR;
+ const zend_type *single_type;
ZEND_TYPE_FOREACH(fe_type, single_type) {
inheritance_status status;
/* Union has an intersection type as it's member */
@@ -790,7 +790,7 @@ static inheritance_status zend_do_perform_implementation_check(
const zend_function *fe, zend_class_entry *fe_scope,
const zend_function *proto, zend_class_entry *proto_scope) /* {{{ */
{
- uint32_t i, num_args, proto_num_args, fe_num_args;
+ uint32_t num_args, proto_num_args, fe_num_args;
inheritance_status status, local_status;
bool proto_is_variadic, fe_is_variadic;
@@ -831,7 +831,7 @@ static inheritance_status zend_do_perform_implementation_check(
num_args = MAX(proto_num_args, fe_num_args);
status = INHERITANCE_SUCCESS;
- for (i = 0; i < num_args; i++) {
+ for (uint32_t i = 0; i < num_args; i++) {
zend_arg_info *proto_arg_info =
i < proto_num_args ? &proto->common.arg_info[i] :
proto_is_variadic ? &proto->common.arg_info[proto_num_args - 1] : NULL;
@@ -933,7 +933,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration(
smart_str_appendc(&str, '(');
if (fptr->common.arg_info) {
- uint32_t i, num_args, required;
+ uint32_t num_args, required;
zend_arg_info *arg_info = fptr->common.arg_info;
required = fptr->common.required_num_args;
@@ -941,7 +941,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration(
if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) {
num_args++;
}
- for (i = 0; i < num_args;) {
+ for (uint32_t i = 0; i < num_args;) {
zend_append_type_hint(&str, scope, arg_info, 0);
if (ZEND_ARG_SEND_MODE(arg_info)) {
@@ -973,7 +973,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration(
{
uint32_t idx = i;
zend_op *op = fptr->op_array.opcodes;
- zend_op *end = op + fptr->op_array.last;
+ const zend_op *end = op + fptr->op_array.last;
++idx;
while (op < end) {
@@ -1366,7 +1366,7 @@ static inheritance_status verify_property_type_compatibility(
return INHERITANCE_SUCCESS;
}
-static bool property_has_operation(zend_property_info *prop_info, zend_property_hook_kind kind)
+static bool property_has_operation(const zend_property_info *prop_info, zend_property_hook_kind kind)
{
return (!(prop_info->flags & ZEND_ACC_VIRTUAL)
&& (kind == ZEND_PROPERTY_HOOK_GET || !(prop_info->flags & ZEND_ACC_READONLY)))
@@ -1451,10 +1451,9 @@ static prop_variance prop_get_variance(const zend_property_info *prop_info) {
static void do_inherit_property(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce) /* {{{ */
{
zval *child = zend_hash_find_known_hash(&ce->properties_info, key);
- zend_property_info *child_info;
if (UNEXPECTED(child)) {
- child_info = Z_PTR_P(child);
+ zend_property_info *child_info = Z_PTR_P(child);
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_CHANGED)) {
child_info->flags |= ZEND_ACC_CHANGED;
}
@@ -1596,7 +1595,6 @@ static void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_en
{
/* expects interface to be contained in ce's interface list already */
uint32_t i, ce_num, if_num = iface->num_interfaces;
- zend_class_entry *entry;
ce_num = ce->num_interfaces;
@@ -1608,7 +1606,7 @@ static void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_en
/* Inherit the interfaces, only if they're not already inherited by the class */
while (if_num--) {
- entry = iface->interfaces[if_num];
+ zend_class_entry *entry = iface->interfaces[if_num];
for (i = 0; i < ce_num; i++) {
if (ce->interfaces[i] == entry) {
break;
@@ -1651,7 +1649,7 @@ static inheritance_status class_constant_types_compatible(const zend_class_const
}
static bool do_inherit_constant_check(
- zend_class_entry *ce, zend_class_constant *parent_constant, zend_string *name);
+ zend_class_entry *ce, const zend_class_constant *parent_constant, zend_string *name);
static void do_inherit_class_constant(zend_string *name, zend_class_constant *parent_const, zend_class_entry *ce) /* {{{ */
{
@@ -1724,7 +1722,7 @@ void zend_build_properties_info_table(zend_class_entry *ce)
} ZEND_HASH_FOREACH_END();
}
-ZEND_API void zend_verify_hooked_property(zend_class_entry *ce, zend_property_info *prop_info, zend_string *prop_name)
+ZEND_API void zend_verify_hooked_property(const zend_class_entry *ce, zend_property_info *prop_info, zend_string *prop_name)
{
if (!prop_info->hooks) {
return;
@@ -1748,7 +1746,7 @@ ZEND_API void zend_verify_hooked_property(zend_class_entry *ce, zend_property_in
ZVAL_NULL(&ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]);
}
for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) {
- zend_function *func = prop_info->hooks[i];
+ const zend_function *func = prop_info->hooks[i];
if (func) {
if ((zend_property_hook_kind)i == ZEND_PROPERTY_HOOK_GET
&& (func->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -1830,7 +1828,6 @@ static void zend_link_hooked_object_iter(zend_class_entry *ce) {
ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked) /* {{{ */
{
zend_property_info *property_info;
- zend_function *func;
zend_string *key;
if (UNEXPECTED(ce->ce_flags & ZEND_ACC_INTERFACE)) {
@@ -2021,6 +2018,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par
if (!checked) {
flags |= ZEND_INHERITANCE_CHECK_PROTO | ZEND_INHERITANCE_CHECK_VISIBILITY;
}
+ zend_function *func;
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) {
do_inherit_method(key, func, ce, 0, flags);
} ZEND_HASH_FOREACH_END();
@@ -2079,7 +2077,7 @@ static zend_always_inline bool check_trait_property_or_constant_value_compatibil
/** @return bool Returns true if the class constant should be inherited, i.e. whether it doesn't already exist. */
static bool do_inherit_constant_check(
- zend_class_entry *ce, zend_class_constant *parent_constant, zend_string *name
+ zend_class_entry *ce, const zend_class_constant *parent_constant, zend_string *name
) {
zval *zv = zend_hash_find_known_hash(&ce->constants_table, name);
if (zv == NULL) {
@@ -2126,7 +2124,7 @@ static bool do_inherit_constant_check(
}
/* }}} */
-static void do_inherit_iface_constant(zend_string *name, zend_class_constant *c, zend_class_entry *ce, zend_class_entry *iface) /* {{{ */
+static void do_inherit_iface_constant(zend_string *name, zend_class_constant *c, zend_class_entry *ce, const zend_class_entry *iface) /* {{{ */
{
if (do_inherit_constant_check(ce, c, name)) {
zend_class_constant *ct;
@@ -2196,27 +2194,27 @@ static void do_interface_implementation(zend_class_entry *ce, zend_class_entry *
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface) /* {{{ */
{
- uint32_t i, ignore = 0;
+ bool ignore = false;
uint32_t current_iface_num = ce->num_interfaces;
uint32_t parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
- zend_string *key;
- zend_class_constant *c;
ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED);
- for (i = 0; i < ce->num_interfaces; i++) {
+ for (uint32_t i = 0; i < ce->num_interfaces; i++) {
if (ce->interfaces[i] == NULL) {
memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
i--;
} else if (ce->interfaces[i] == iface) {
if (EXPECTED(i < parent_iface_num)) {
- ignore = 1;
+ ignore = true;
} else {
zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ZSTR_VAL(ce->name), ZSTR_VAL(iface->name));
}
}
}
if (ignore) {
+ zend_string *key;
+ zend_class_constant *c;
/* Check for attempt to redeclare interface constants */
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&iface->constants_table, key, c) {
do_inherit_constant_check(ce, c, key);
@@ -2238,15 +2236,14 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry **interfaces) /* {{{ */
{
- zend_class_entry *iface;
uint32_t num_parent_interfaces = ce->parent ? ce->parent->num_interfaces : 0;
uint32_t num_interfaces = num_parent_interfaces;
zend_string *key;
zend_class_constant *c;
- uint32_t i, j;
+ uint32_t i;
for (i = 0; i < ce->num_interfaces; i++) {
- iface = interfaces[num_parent_interfaces + i];
+ zend_class_entry *iface = interfaces[num_parent_interfaces + i];
if (!(iface->ce_flags & ZEND_ACC_LINKED)) {
add_dependency_obligation(ce, iface);
}
@@ -2255,7 +2252,7 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ZSTR_VAL(ce->name), ZSTR_VAL(iface->name));
return;
}
- for (j = 0; j < num_interfaces; j++) {
+ for (uint32_t j = 0; j < num_interfaces; j++) {
if (interfaces[j] == iface) {
if (j >= num_parent_interfaces) {
efree(interfaces);
@@ -2304,7 +2301,7 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
/* }}} */
-void zend_inheritance_check_override(zend_class_entry *ce)
+void zend_inheritance_check_override(const zend_class_entry *ce)
{
zend_function *f;
@@ -2426,7 +2423,7 @@ static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /*
}
/* }}} */
-static void zend_traits_check_private_final_inheritance(uint32_t original_fn_flags, zend_function *fn_copy, zend_string *name)
+static void zend_traits_check_private_final_inheritance(uint32_t original_fn_flags, const zend_function *fn_copy, const zend_string *name)
{
/* If the function was originally already private+final, then it will have
* already been warned about. Only emit this error when the used trait method
@@ -2442,7 +2439,6 @@ static void zend_traits_check_private_final_inheritance(uint32_t original_fn_fla
static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable *exclude_table, zend_class_entry **aliases) /* {{{ */
{
zend_trait_alias *alias, **alias_ptr;
- zend_string *lcname;
zend_function fn_copy;
int i;
@@ -2466,7 +2462,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
zend_traits_check_private_final_inheritance(fn->common.fn_flags, &fn_copy, alias->alias);
- lcname = zend_string_tolower(alias->alias);
+ zend_string *lcname = zend_string_tolower(alias->alias);
zend_add_trait_method(ce, alias->alias, lcname, &fn_copy);
zend_string_release_ex(lcname, 0);
}
@@ -2510,16 +2506,14 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
}
/* }}} */
-static uint32_t zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait, zend_class_entry **traits) /* {{{ */
+static uint32_t zend_check_trait_usage(const zend_class_entry *ce, const zend_class_entry *trait, zend_class_entry **traits) /* {{{ */
{
- uint32_t i;
-
if (UNEXPECTED((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT)) {
zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", ZSTR_VAL(trait->name));
return 0;
}
- for (i = 0; i < ce->num_traits; i++) {
+ for (uint32_t i = 0; i < ce->num_traits; i++) {
if (traits[i] == trait) {
return i;
}
@@ -2532,7 +2526,6 @@ static uint32_t zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *t
static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_entry **traits, HashTable ***exclude_tables_ptr, zend_class_entry ***aliases_ptr) /* {{{ */
{
size_t i, j = 0;
- zend_trait_precedence **precedences;
zend_trait_precedence *cur_precedence;
zend_trait_method_reference *cur_method_ref;
zend_string *lc_trait_name;
@@ -2545,7 +2538,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_e
if (ce->trait_precedences) {
exclude_tables = ecalloc(ce->num_traits, sizeof(HashTable*));
i = 0;
- precedences = ce->trait_precedences;
+ zend_trait_precedence **precedences = ce->trait_precedences;
ce->trait_precedences = NULL;
while ((cur_precedence = precedences[i])) {
/** Resolve classes for all precedence operations. */
@@ -2619,7 +2612,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_e
aliases = ecalloc(i, sizeof(zend_class_entry*));
i = 0;
while (ce->trait_aliases[i]) {
- zend_trait_alias *cur_alias = ce->trait_aliases[i];
+ const zend_trait_alias *cur_alias = ce->trait_aliases[i];
cur_method_ref = &ce->trait_aliases[i]->trait_method;
lcname = zend_string_tolower(cur_method_ref->method_name);
if (cur_method_ref->class_name) {
@@ -2736,10 +2729,8 @@ static const zend_class_entry* find_first_constant_definition(const zend_class_e
* process like this is needed to find the location of the first definition
* of the constant from traits.
*/
- size_t i;
-
if (colliding_ce == ce) {
- for (i = 0; i < current_trait; i++) {
+ for (size_t i = 0; i < current_trait; i++) {
if (traits[i]
&& zend_hash_exists(&traits[i]->constants_table, constant_name)) {
return traits[i];
@@ -2806,9 +2797,7 @@ static bool do_trait_constant_check(
static void zend_do_traits_constant_binding(zend_class_entry *ce, zend_class_entry **traits) /* {{{ */
{
- size_t i;
-
- for (i = 0; i < ce->num_traits; i++) {
+ for (uint32_t i = 0; i < ce->num_traits; i++) {
zend_string *constant_name;
zend_class_constant *constant;
@@ -2850,10 +2839,8 @@ static void zend_do_traits_constant_binding(zend_class_entry *ce, zend_class_ent
static const zend_class_entry* find_first_property_definition(const zend_class_entry *ce, zend_class_entry **traits, size_t current_trait, zend_string *prop_name, const zend_class_entry *colliding_ce) /* {{{ */
{
- size_t i;
-
if (colliding_ce == ce) {
- for (i = 0; i < current_trait; i++) {
+ for (size_t i = 0; i < current_trait; i++) {
if (traits[i]
&& zend_hash_exists(&traits[i]->properties_info, prop_name)) {
return traits[i];
@@ -2867,20 +2854,17 @@ static const zend_class_entry* find_first_property_definition(const zend_class_e
static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_entry **traits) /* {{{ */
{
- size_t i;
zend_property_info *property_info;
const zend_property_info *colliding_prop;
- zend_property_info *new_prop;
zend_string* prop_name;
zval* prop_value;
- zend_string *doc_comment;
/* In the following steps the properties are inserted into the property table
* for that, a very strict approach is applied:
* - check for compatibility, if not compatible with any property in class -> fatal
* - if compatible, then strict notice
*/
- for (i = 0; i < ce->num_traits; i++) {
+ for (uint32_t i = 0; i < ce->num_traits; i++) {
if (!traits[i]) {
continue;
}
@@ -2960,12 +2944,13 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
prop_value = &tmp_prop_value;
ZVAL_UNDEF(&tmp_prop_value);
}
- doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
+
+ zend_string *doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
zend_type type = property_info->type;
/* Assumption: only userland classes can use traits, as such the type must be arena allocated */
zend_type_copy_ctor(&type, /* use arena */ true, /* persistent */ false);
- new_prop = zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, type);
+ zend_property_info *new_prop = zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, type);
if (property_info->attributes) {
new_prop->attributes = property_info->attributes;
@@ -2978,9 +2963,9 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
zend_function **hooks = new_prop->hooks =
zend_arena_alloc(&CG(arena), ZEND_PROPERTY_HOOK_STRUCT_SIZE);
memcpy(hooks, property_info->hooks, ZEND_PROPERTY_HOOK_STRUCT_SIZE);
- for (uint32_t i = 0; i < ZEND_PROPERTY_HOOK_COUNT; i++) {
- if (hooks[i]) {
- zend_function *old_fn = hooks[i];
+ for (uint32_t j = 0; j < ZEND_PROPERTY_HOOK_COUNT; j++) {
+ if (hooks[j]) {
+ zend_function *old_fn = hooks[j];
/* Hooks are not yet supported for internal properties. */
ZEND_ASSERT(ZEND_USER_CODE(old_fn->type));
@@ -2995,7 +2980,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
zend_fixup_trait_method(new_fn, ce);
- hooks[i] = new_fn;
+ hooks[j] = new_fn;
}
}
ce->ce_flags |= ZEND_ACC_USE_GUARDS;
@@ -3221,7 +3206,7 @@ static void add_property_hook_obligation(
static void resolve_delayed_variance_obligations(zend_class_entry *ce);
-static void check_variance_obligation(variance_obligation *obligation) {
+static void check_variance_obligation(const variance_obligation *obligation) {
if (obligation->type == OBLIGATION_DEPENDENCY) {
zend_class_entry *dependency_ce = obligation->dependency_ce;
if (dependency_ce->ce_flags & ZEND_ACC_UNRESOLVED_VARIANCE) {
@@ -3260,7 +3245,7 @@ static void check_variance_obligation(variance_obligation *obligation) {
}
}
-static void load_delayed_classes(zend_class_entry *ce) {
+static void load_delayed_classes(const zend_class_entry *ce) {
HashTable *delayed_autoloads = CG(delayed_autoloads);
if (!delayed_autoloads) {
return;
@@ -3289,11 +3274,11 @@ static void load_delayed_classes(zend_class_entry *ce) {
}
static void resolve_delayed_variance_obligations(zend_class_entry *ce) {
- HashTable *all_obligations = CG(delayed_variance_obligations), *obligations;
+ HashTable *all_obligations = CG(delayed_variance_obligations);
zend_ulong num_key = (zend_ulong) (uintptr_t) ce;
ZEND_ASSERT(all_obligations != NULL);
- obligations = zend_hash_index_find_ptr(all_obligations, num_key);
+ const HashTable *obligations = zend_hash_index_find_ptr(all_obligations, num_key);
ZEND_ASSERT(obligations != NULL);
variance_obligation *obligation;
@@ -3327,7 +3312,7 @@ static void check_unrecoverable_load_failure(const zend_class_entry *ce) {
} while (0)
static zend_op_array *zend_lazy_method_load(
- zend_op_array *op_array, zend_class_entry *ce, const zend_class_entry *pce) {
+ const zend_op_array *op_array, zend_class_entry *ce, const zend_class_entry *pce) {
ZEND_ASSERT(op_array->type == ZEND_USER_FUNCTION);
ZEND_ASSERT(op_array->scope == pce);
ZEND_ASSERT(op_array->prototype == NULL);
@@ -3341,12 +3326,10 @@ static zend_op_array *zend_lazy_method_load(
return new_op_array;
}
-static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
+static zend_class_entry *zend_lazy_class_load(const zend_class_entry *pce)
{
- zend_class_entry *ce;
- Bucket *p, *end;
+ zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
- ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
memcpy(ce, pce, sizeof(zend_class_entry));
ce->ce_flags &= ~ZEND_ACC_IMMUTABLE;
ce->refcount = 1;
@@ -3361,7 +3344,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
if (ce->default_properties_table) {
zval *dst = emalloc(sizeof(zval) * ce->default_properties_count);
zval *src = ce->default_properties_table;
- zval *end = src + ce->default_properties_count;
+ const zval *end = src + ce->default_properties_count;
ce->default_properties_table = dst;
for (; src != end; src++, dst++) {
@@ -3372,11 +3355,11 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
/* methods */
ce->function_table.pDestructor = ZEND_FUNCTION_DTOR;
if (!(HT_FLAGS(&ce->function_table) & HASH_FLAG_UNINITIALIZED)) {
- p = emalloc(HT_SIZE(&ce->function_table));
+ Bucket *p = emalloc(HT_SIZE(&ce->function_table));
memcpy(p, HT_GET_DATA_ADDR(&ce->function_table), HT_USED_SIZE(&ce->function_table));
HT_SET_DATA_ADDR(&ce->function_table, p);
p = ce->function_table.arData;
- end = p + ce->function_table.nNumUsed;
+ const Bucket *end = p + ce->function_table.nNumUsed;
for (; p != end; p++) {
zend_op_array *op_array = Z_PTR(p->val);
zend_op_array *new_op_array = Z_PTR(p->val) = zend_lazy_method_load(op_array, ce, pce);
@@ -3401,7 +3384,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
if (ce->default_static_members_table) {
zval *dst = emalloc(sizeof(zval) * ce->default_static_members_count);
zval *src = ce->default_static_members_table;
- zval *end = src + ce->default_static_members_count;
+ const zval *end = src + ce->default_static_members_count;
ce->default_static_members_table = dst;
for (; src != end; src++, dst++) {
@@ -3412,15 +3395,15 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
/* properties_info */
if (!(HT_FLAGS(&ce->properties_info) & HASH_FLAG_UNINITIALIZED)) {
- p = emalloc(HT_SIZE(&ce->properties_info));
+ Bucket *p = emalloc(HT_SIZE(&ce->properties_info));
memcpy(p, HT_GET_DATA_ADDR(&ce->properties_info), HT_USED_SIZE(&ce->properties_info));
HT_SET_DATA_ADDR(&ce->properties_info, p);
p = ce->properties_info.arData;
- end = p + ce->properties_info.nNumUsed;
+ const Bucket *end = p + ce->properties_info.nNumUsed;
for (; p != end; p++) {
- zend_property_info *prop_info, *new_prop_info;
+ zend_property_info *new_prop_info;
- prop_info = Z_PTR(p->val);
+ const zend_property_info *prop_info = Z_PTR(p->val);
ZEND_ASSERT(prop_info->ce == pce);
ZEND_ASSERT(prop_info->prototype == prop_info);
new_prop_info= zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
@@ -3448,15 +3431,15 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
/* constants table */
if (!(HT_FLAGS(&ce->constants_table) & HASH_FLAG_UNINITIALIZED)) {
- p = emalloc(HT_SIZE(&ce->constants_table));
+ Bucket *p = emalloc(HT_SIZE(&ce->constants_table));
memcpy(p, HT_GET_DATA_ADDR(&ce->constants_table), HT_USED_SIZE(&ce->constants_table));
HT_SET_DATA_ADDR(&ce->constants_table, p);
p = ce->constants_table.arData;
- end = p + ce->constants_table.nNumUsed;
+ const Bucket *end = p + ce->constants_table.nNumUsed;
for (; p != end; p++) {
- zend_class_constant *c, *new_c;
+ zend_class_constant *new_c;
- c = Z_PTR(p->val);
+ const zend_class_constant *c = Z_PTR(p->val);
ZEND_ASSERT(c->ce == pce);
new_c = zend_arena_alloc(&CG(arena), sizeof(zend_class_constant));
Z_PTR(p->val) = new_c;
@@ -3481,7 +3464,7 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
} while (0)
#endif
-ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_name, zend_string *key) /* {{{ */
+ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_name, const zend_string *key) /* {{{ */
{
/* Load parent/interface dependencies first, so we can still gracefully abort linking
* with an exception and remove the class from the class table. This is only possible
@@ -3625,6 +3608,11 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
zend_do_traits_method_binding(ce, traits_and_interfaces, trait_exclude_tables, trait_aliases, false, &trait_contains_abstract_methods);
zend_do_traits_constant_binding(ce, traits_and_interfaces);
zend_do_traits_property_binding(ce, traits_and_interfaces);
+
+ zend_function *fn;
+ ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, fn) {
+ zend_fixup_trait_method(fn, ce);
+ } ZEND_HASH_FOREACH_END();
}
if (parent) {
if (!(parent->ce_flags & ZEND_ACC_LINKED)) {
@@ -3635,6 +3623,13 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
if (ce->num_traits) {
if (trait_contains_abstract_methods) {
zend_do_traits_method_binding(ce, traits_and_interfaces, trait_exclude_tables, trait_aliases, true, &trait_contains_abstract_methods);
+
+ /* New abstract methods may have been added, make sure to add
+ * ZEND_ACC_IMPLICIT_ABSTRACT_CLASS to ce. */
+ zend_function *fn;
+ ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, fn) {
+ zend_fixup_trait_method(fn, ce);
+ } ZEND_HASH_FOREACH_END();
}
if (trait_exclude_tables) {
@@ -3651,11 +3646,6 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
if (trait_aliases) {
efree(trait_aliases);
}
-
- zend_function *fn;
- ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, fn) {
- zend_fixup_trait_method(fn, ce);
- } ZEND_HASH_FOREACH_END();
}
if (ce->num_interfaces) {
/* Also copy the parent interfaces here, so we don't need to reallocate later. */
@@ -3784,7 +3774,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
/* }}} */
/* Check whether early binding is prevented due to unresolved types in inheritance checks. */
-static inheritance_status zend_can_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce) /* {{{ */
+static inheritance_status zend_can_early_bind(zend_class_entry *ce, const zend_class_entry *parent_ce) /* {{{ */
{
zend_string *key;
zend_function *parent_func;
diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h
index 477874181e416..7171a9385f3ba 100644
--- a/Zend/zend_inheritance.h
+++ b/Zend/zend_inheritance.h
@@ -32,13 +32,13 @@ static zend_always_inline void zend_do_inheritance(zend_class_entry *ce, zend_cl
zend_do_inheritance_ex(ce, parent_ce, 0);
}
-ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_name, zend_string *key);
+ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_name, const zend_string *key);
void zend_verify_abstract_class(zend_class_entry *ce);
void zend_build_properties_info_table(zend_class_entry *ce);
ZEND_API zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding);
-void zend_inheritance_check_override(zend_class_entry *ce);
+void zend_inheritance_check_override(const zend_class_entry *ce);
ZEND_API extern zend_class_entry* (*zend_inheritance_cache_get)(zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces);
ZEND_API extern zend_class_entry* (*zend_inheritance_cache_add)(zend_class_entry *ce, zend_class_entry *proto, zend_class_entry *parent, zend_class_entry **traits_and_interfaces, HashTable *dependencies);
@@ -53,7 +53,7 @@ typedef enum {
ZEND_API zend_inheritance_status zend_verify_property_hook_variance(const zend_property_info *prop_info, const zend_function *func);
ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error(const zend_property_info *prop_info);
ZEND_API ZEND_COLD ZEND_NORETURN void zend_hooked_property_variance_error_ex(zend_string *value_param_name, zend_string *class_name, zend_string *prop_name);
-ZEND_API void zend_verify_hooked_property(zend_class_entry *ce, zend_property_info *prop_info, zend_string *prop_name);
+ZEND_API void zend_verify_hooked_property(const zend_class_entry *ce, zend_property_info *prop_info, zend_string *prop_name);
END_EXTERN_C()
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 9483a83b4e955..0c5bb36501e72 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -268,7 +268,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%type callable_expr callable_variable static_member new_variable
%type encaps_var encaps_var_offset isset_variables
%type top_statement_list use_declarations const_list inner_statement_list if_stmt
-%type alt_if_stmt for_exprs switch_case_list global_var_list static_var_list
+%type alt_if_stmt for_cond_exprs for_exprs switch_case_list global_var_list static_var_list
%type echo_expr_list unset_variables catch_name_list catch_list optional_variable parameter_list class_statement_list
%type implements_list case_list if_stmt_without_else
%type non_empty_parameter_list argument_list non_empty_argument_list property_list
@@ -391,6 +391,7 @@ attributed_statement:
| trait_declaration_statement { $$ = $1; }
| interface_declaration_statement { $$ = $1; }
| enum_declaration_statement { $$ = $1; }
+ | T_CONST const_list ';' { $$ = $2; }
;
top_statement:
@@ -414,7 +415,6 @@ top_statement:
| T_USE use_type group_use_declaration ';' { $$ = $3; $$->attr = $2; }
| T_USE use_declarations ';' { $$ = $2; $$->attr = ZEND_SYMBOL_CLASS; }
| T_USE use_type use_declarations ';' { $$ = $3; $$->attr = $2; }
- | T_CONST const_list ';' { $$ = $2; }
;
use_type:
@@ -508,7 +508,7 @@ statement:
{ $$ = zend_ast_create(ZEND_AST_WHILE, $3, $5); }
| T_DO statement T_WHILE '(' expr ')' ';'
{ $$ = zend_ast_create(ZEND_AST_DO_WHILE, $2, $5); }
- | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
+ | T_FOR '(' for_exprs ';' for_cond_exprs ';' for_exprs ')' for_statement
{ $$ = zend_ast_create(ZEND_AST_FOR, $3, $5, $7, $9); }
| T_SWITCH '(' expr ')' switch_case_list
{ $$ = zend_ast_create(ZEND_AST_SWITCH, $3, $5); }
@@ -1169,6 +1169,12 @@ echo_expr:
expr { $$ = zend_ast_create(ZEND_AST_ECHO, $1); }
;
+for_cond_exprs:
+ %empty { $$ = NULL; }
+ | non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
+ | expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
+;
+
for_exprs:
%empty { $$ = NULL; }
| non_empty_for_exprs { $$ = $1; }
@@ -1176,6 +1182,8 @@ for_exprs:
non_empty_for_exprs:
non_empty_for_exprs ',' expr { $$ = zend_ast_list_add($1, $3); }
+ | non_empty_for_exprs ',' T_VOID_CAST expr { $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CAST_VOID, $4)); }
+ | T_VOID_CAST expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, zend_ast_create(ZEND_AST_CAST_VOID, $2)); }
| expr { $$ = zend_ast_create_list(1, ZEND_AST_EXPR_LIST, $1); }
;
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 1ba250bec6439..9b1b6dd4fcbb4 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -203,7 +203,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ *
ZEND_API ZEND_COLD zend_property_info *zend_get_property_info_for_slot_slow(zend_object *obj, zval *slot)
{
- uintptr_t offset = (uintptr_t)slot - (uintptr_t)obj->properties_table;
+ uintptr_t offset = OBJ_PROP_SLOT_TO_OFFSET(obj, slot);
zend_property_info *prop_info;
ZEND_HASH_MAP_FOREACH_PTR(&obj->ce->properties_info, prop_info) {
if (prop_info->offset == offset) {
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index ce052024ae7a0..6e7d31e15a40f 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -112,7 +112,7 @@ ZEND_API void destroy_zend_function(zend_function *function)
ZEND_API void zend_type_release(zend_type type, bool persistent) {
if (ZEND_TYPE_HAS_LIST(type)) {
zend_type *list_type;
- ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
+ ZEND_TYPE_LIST_FOREACH_MUTABLE(ZEND_TYPE_LIST(type), list_type) {
zend_type_release(*list_type, persistent);
} ZEND_TYPE_LIST_FOREACH_END();
if (!ZEND_TYPE_USES_ARENA(type)) {
@@ -580,6 +580,18 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
efree(op_array->vars);
}
+ /* 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;
+ while (op < end) {
+ if (op->opcode == ZEND_DECLARE_ATTRIBUTED_CONST) {
+ HashTable *attributes = Z_PTR_P(RT_CONSTANT(op+1, (op+1)->op1));
+ zend_hash_release(attributes);
+ }
+ op++;
+ }
+ }
if (op_array->literals) {
zval *literal = op_array->literals;
zval *end = literal + op_array->last_literal;
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index f839cec3b3667..4a6d00b9d73ea 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -28,7 +28,6 @@
#include
#ifdef __SSE2__
-# include
# include
#endif
#if defined(__AVX2__)
@@ -209,8 +208,14 @@ typedef struct {
/* This iterates over a zend_type_list. */
#define ZEND_TYPE_LIST_FOREACH(list, type_ptr) do { \
+ const zend_type *_list = (list)->types; \
+ const zend_type *_end = _list + (list)->num_types; \
+ for (; _list < _end; _list++) { \
+ type_ptr = _list;
+
+#define ZEND_TYPE_LIST_FOREACH_MUTABLE(list, type_ptr) do { \
zend_type *_list = (list)->types; \
- zend_type *_end = _list + (list)->num_types; \
+ const zend_type *_end = _list + (list)->num_types; \
for (; _list < _end; _list++) { \
type_ptr = _list;
@@ -221,7 +226,22 @@ typedef struct {
/* This iterates over any zend_type. If it's a type list, all list elements will
* be visited. If it's a single type, only the single type is visited. */
#define ZEND_TYPE_FOREACH(type, type_ptr) do { \
- zend_type *_cur, *_end; \
+ const zend_type *_cur, *_end; \
+ if (ZEND_TYPE_HAS_LIST(type)) { \
+ zend_type_list *_list = ZEND_TYPE_LIST(type); \
+ _cur = _list->types; \
+ _end = _cur + _list->num_types; \
+ } else { \
+ _cur = &(type); \
+ _end = _cur + 1; \
+ } \
+ do { \
+ type_ptr = _cur;
+
+
+#define ZEND_TYPE_FOREACH_MUTABLE(type, type_ptr) do { \
+ zend_type *_cur; \
+ const zend_type *_end; \
if (ZEND_TYPE_HAS_LIST(type)) { \
zend_type_list *_list = ZEND_TYPE_LIST(type); \
_cur = _list->types; \
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 162b7e84cefbe..9c2ba0038b4a4 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4423,7 +4423,7 @@ ZEND_VM_C_LABEL(fcall_end):
ZEND_VM_CONTINUE();
}
-ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV, UNUSED|CACHE_SLOT)
+ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV, UNUSED)
{
if (OP1_TYPE == IS_UNUSED) {
SAVE_OPLINE();
@@ -4465,7 +4465,6 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -4482,7 +4481,7 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -5657,11 +5656,10 @@ ZEND_VM_HOT_HANDLER(199, ZEND_CHECK_UNDEF_ARGS, UNUSED, UNUSED)
ZEND_VM_COLD_HELPER(zend_missing_arg_helper, ANY, ANY)
{
-#ifdef ZEND_VM_IP_GLOBAL_REG
USE_OPLINE
SAVE_OPLINE();
-#endif
+
zend_missing_arg_error(execute_data);
HANDLE_EXCEPTION();
}
@@ -5671,14 +5669,14 @@ ZEND_VM_HELPER(zend_verify_recv_arg_type_helper, ANY, ANY, zval *op_1)
USE_OPLINE
SAVE_OPLINE();
- if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1))) {
HANDLE_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED, CACHE_SLOT)
+ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED)
{
USE_OPLINE
uint32_t arg_num = opline->op1.num;
@@ -5697,7 +5695,7 @@ ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED, CACHE_SLOT)
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_RECV, op->op2.num == MAY_BE_ANY, ZEND_RECV_NOTYPE, NUM, NUM, CACHE_SLOT)
+ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_RECV, op->op2.num == MAY_BE_ANY, ZEND_RECV_NOTYPE, NUM, NUM)
{
USE_OPLINE
uint32_t arg_num = opline->op1.num;
@@ -5709,7 +5707,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_RECV, op->op2.num == MAY_BE_ANY, ZEND_RECV_NO
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST, CACHE_SLOT)
+ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST)
{
USE_OPLINE
uint32_t arg_num;
@@ -5749,7 +5747,7 @@ ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST, CACHE_SLOT)
ZEND_VM_C_LABEL(recv_init_check_type):
if ((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0) {
SAVE_OPLINE();
- if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param))) {
HANDLE_EXCEPTION();
}
}
@@ -5759,7 +5757,7 @@ ZEND_VM_C_LABEL(recv_init_check_type):
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED, CACHE_SLOT)
+ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED)
{
USE_OPLINE
uint32_t arg_num = opline->op1.num;
@@ -5782,7 +5780,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED, CACHE_SLOT)
if (ZEND_TYPE_IS_SET(arg_info->type)) {
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
do {
- if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param))) {
ZEND_HASH_FILL_FINISH();
HANDLE_EXCEPTION();
}
@@ -5810,7 +5808,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED, CACHE_SLOT)
if (ZEND_TYPE_IS_SET(arg_info->type)) {
SEPARATE_ARRAY(params);
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) {
- if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param))) {
HANDLE_EXCEPTION();
}
Z_TRY_ADDREF_P(param);
@@ -6460,7 +6458,6 @@ ZEND_VM_COLD_CONST_HANDLER(51, ZEND_CAST, CONST|TMP|VAR|CV, ANY, TYPE)
USE_OPLINE
zval *expr;
zval *result = EX_VAR(opline->result.var);
- HashTable *ht;
SAVE_OPLINE();
expr = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -6494,53 +6491,10 @@ ZEND_VM_COLD_CONST_HANDLER(51, ZEND_CAST, CONST|TMP|VAR|CV, ANY, TYPE)
}
if (opline->extended_value == IS_ARRAY) {
- if (OP1_TYPE == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
- if (Z_TYPE_P(expr) != IS_NULL) {
- ZVAL_ARR(result, zend_new_array(1));
- expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
- if (OP1_TYPE == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
- /* Optimized version without rebuilding properties HashTable */
- ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
- } else {
- HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
- if (obj_ht) {
- /* fast copy */
- ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
- (Z_OBJCE_P(expr)->default_properties_count ||
- Z_OBJ_P(expr)->handlers != &std_object_handlers ||
- GC_IS_RECURSIVE(obj_ht))));
- zend_release_properties(obj_ht);
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- }
+ zend_cast_zval_to_array(result, expr, OP1_TYPE);
} else {
ZEND_ASSERT(opline->extended_value == IS_OBJECT);
- ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
- if (Z_TYPE_P(expr) == IS_ARRAY) {
- ht = zend_symtable_to_proptable(Z_ARR_P(expr));
- if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
- /* TODO: try not to duplicate immutable arrays as well ??? */
- ht = zend_array_dup(ht);
- }
- Z_OBJ_P(result)->properties = ht;
- } else if (Z_TYPE_P(expr) != IS_NULL) {
- Z_OBJ_P(result)->properties = ht = zend_new_array(1);
- expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
- if (OP1_TYPE == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- }
+ zend_cast_zval_to_object(result, expr, OP1_TYPE);
}
}
@@ -8307,6 +8261,49 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
+ZEND_VM_HANDLER(210, ZEND_DECLARE_ATTRIBUTED_CONST, CONST, CONST)
+{
+ USE_OPLINE
+ zval *name;
+ zval *val;
+ zend_constant c;
+
+ SAVE_OPLINE();
+ name = GET_OP1_ZVAL_PTR(BP_VAR_R);
+ val = GET_OP2_ZVAL_PTR(BP_VAR_R);
+
+ ZVAL_COPY(&c.value, val);
+ if (Z_OPT_CONSTANT(c.value)) {
+ if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
+ zval_ptr_dtor_nogc(&c.value);
+ FREE_OP1();
+ FREE_OP2();
+ HANDLE_EXCEPTION();
+ }
+ }
+ /* non persistent, case sensitive */
+ ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT);
+ c.name = zend_string_copy(Z_STR_P(name));
+
+ if (zend_register_constant(&c) == FAILURE) {
+ FREE_OP1();
+ FREE_OP2();
+ /* two opcodes used, second one is the data with attributes */
+ ZEND_VM_NEXT_OPCODE_EX(1, 2);
+ }
+
+ HashTable *attributes = Z_PTR_P(GET_OP_DATA_ZVAL_PTR(BP_VAR_R));
+ zend_constant *registered = zend_get_constant_ptr(c.name);
+ ZEND_ASSERT(attributes != NULL);
+ ZEND_ASSERT(registered != NULL);
+ zend_constant_add_attributes(registered, attributes);
+
+ FREE_OP1();
+ FREE_OP2();
+ /* two opcodes used, second one is the data with attributes */
+ ZEND_VM_NEXT_OPCODE_EX(1, 2);
+}
+
ZEND_VM_HANDLER(142, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, NUM)
{
USE_OPLINE
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 902e254ff2424..226e0446abbd1 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -306,6 +306,8 @@ static uint8_t zend_user_opcodes[256] = {0,
241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
+#include "Zend/zend_vm_opcodes.h"
+
#define SPEC_START_MASK 0x0000ffff
#define SPEC_EXTRA_MASK 0xfffc0000
#define SPEC_RULE_OP1 0x00010000
@@ -367,13 +369,13 @@ static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op
#ifdef ZEND_VM_FP_GLOBAL_REG
# define ZEND_OPCODE_HANDLER_ARGS void
# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU
-# define ZEND_OPCODE_HANDLER_ARGS_DC
-# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC
+# define ZEND_OPCODE_HANDLER_ARGS_EX
+# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX
#else
-# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data
-# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data
-# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS
-# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU
+# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data, const zend_op *opline
+# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data, opline
+# define ZEND_OPCODE_HANDLER_ARGS_EX ZEND_OPCODE_HANDLER_ARGS,
+# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX ZEND_OPCODE_HANDLER_ARGS_PASSTHRU,
#endif
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
@@ -394,18 +396,18 @@ static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op
# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE
# endif
#else
-# define ZEND_OPCODE_HANDLER_RET int
+# define ZEND_OPCODE_HANDLER_RET const zend_op *
# define ZEND_VM_TAIL_CALL(call) return call
-# define ZEND_VM_CONTINUE() return 0
-# define ZEND_VM_RETURN() return -1
+# define ZEND_VM_CONTINUE() return opline
+# define ZEND_VM_RETURN() return (const zend_op*)ZEND_VM_ENTER_BIT
# define ZEND_VM_HOT
# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE
#endif
typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS);
-#define DCL_OPLINE
#ifdef ZEND_VM_IP_GLOBAL_REG
+# define DCL_OPLINE
# define OPLINE opline
# define USE_OPLINE
# define LOAD_OPLINE() opline = EX(opline)
@@ -414,12 +416,13 @@ typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_H
# define SAVE_OPLINE() EX(opline) = opline
# define SAVE_OPLINE_EX() SAVE_OPLINE()
#else
-# define OPLINE EX(opline)
-# define USE_OPLINE const zend_op *opline = EX(opline);
-# define LOAD_OPLINE()
-# define LOAD_OPLINE_EX()
-# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()
-# define SAVE_OPLINE()
+# define DCL_OPLINE const zend_op *opline;
+# define OPLINE opline
+# define USE_OPLINE
+# define LOAD_OPLINE() opline = EX(opline)
+# define LOAD_OPLINE_EX() opline = EX(opline)
+# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1
+# define SAVE_OPLINE() EX(opline) = opline
# define SAVE_OPLINE_EX()
#endif
#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()
@@ -433,9 +436,10 @@ typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_H
# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTER_EX()
# define ZEND_VM_LEAVE() return 2
#else
-# define ZEND_VM_ENTER_EX() return 1
-# define ZEND_VM_ENTER() return 1
-# define ZEND_VM_LEAVE() return 2
+# define ZEND_VM_ENTER_BIT 1ULL
+# define ZEND_VM_ENTER_EX() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT)
+# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_ENTER_EX()
+# define ZEND_VM_LEAVE() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT)
#endif
#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -444,7 +448,7 @@ typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_H
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS);
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_add_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_add_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -465,7 +469,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_add_helper_S
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_sub_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_sub_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -486,7 +490,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_sub_helper_S
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mul_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mul_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -517,7 +521,7 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mo
HANDLE_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mod_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mod_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -538,7 +542,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mod_helper_S
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_left_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_left_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -559,7 +563,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_left_h
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_right_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_right_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -580,7 +584,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_right_
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
int ret;
USE_OPLINE
@@ -602,7 +606,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_equal_hel
ZEND_VM_SMART_BRANCH(ret == 0, 1);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_not_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
int ret;
USE_OPLINE
@@ -624,7 +628,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_not_equal
ZEND_VM_SMART_BRANCH(ret != 0, 1);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
int ret;
USE_OPLINE
@@ -646,7 +650,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_h
ZEND_VM_SMART_BRANCH(ret < 0, 1);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_or_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
int ret;
USE_OPLINE
@@ -668,7 +672,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_o
ZEND_VM_SMART_BRANCH(ret <= 0, 1);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_or_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_or_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -689,7 +693,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_or_helper
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_and_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_and_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -710,7 +714,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_and_helpe
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_xor_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_xor_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
USE_OPLINE
@@ -731,7 +735,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_xor_helpe
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_not_helper_SPEC(zval *op_1 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_not_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1)
{
USE_OPLINE
@@ -876,7 +880,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_STATIC_PROP_SPEC_HAND
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */
-static zend_always_inline ZEND_OPCODE_HANDLER_RET zend_fetch_static_prop_helper_SPEC(int type ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_always_inline ZEND_OPCODE_HANDLER_RET zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX int type)
{
USE_OPLINE
zval *prop;
@@ -913,19 +917,19 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET zend_fetch_static_prop_helper_
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_R_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_R));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_W_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_W));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_RW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_RW));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
@@ -941,13 +945,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPE
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_UNSET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_UNSET));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_IS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_IS));
}
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
@@ -2365,7 +2369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
}
}
-static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX uint32_t _arg_num, zval *_arg)
{
USE_OPLINE
@@ -2743,21 +2747,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
{
-#ifdef ZEND_VM_IP_GLOBAL_REG
USE_OPLINE
SAVE_OPLINE();
-#endif
+
zend_missing_arg_error(execute_data);
HANDLE_EXCEPTION();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_verify_recv_arg_type_helper_SPEC(zval *op_1 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_verify_recv_arg_type_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1)
{
USE_OPLINE
SAVE_OPLINE();
- if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1))) {
HANDLE_EXCEPTION();
}
@@ -2776,7 +2779,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_NOTYPE_SPEC_H
ZEND_VM_NEXT_OPCODE();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_case_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_case_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX zval *op_1, zval *op_2)
{
int ret;
USE_OPLINE
@@ -3256,7 +3259,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NOP_SPEC_HANDLER(Z
ZEND_VM_NEXT_OPCODE();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_dispatch_try_catch_finally_helper_SPEC(uint32_t try_catch_offset, uint32_t op_num ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_dispatch_try_catch_finally_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_EX uint32_t try_catch_offset, uint32_t op_num)
{
/* May be NULL during generator closing (only finally blocks are executed) */
zend_object *ex = EG(exception);
@@ -3339,7 +3342,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
/* Exception was thrown before executing any op */
if (UNEXPECTED(!throw_op)) {
- ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(-1, 0 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX -1, 0));
}
uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes;
@@ -3403,7 +3406,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
}
}
- ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, throw_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX current_try_catch_offset, throw_op_num));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -3502,7 +3505,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
Z_OBJ_P(fast_call) = NULL;
current_try_catch_offset = opline->op2.num;
current_op_num = opline - EX(func)->op_array.opcodes;
- ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, current_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX current_try_catch_offset, current_op_num));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -4190,7 +4193,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CON
recv_init_check_type:
if ((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0) {
SAVE_OPLINE();
- if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param))) {
HANDLE_EXCEPTION();
}
}
@@ -4266,7 +4269,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_UNUSED_H
param = EX_VAR(opline->result.var);
if (UNEXPECTED(!(opline->op2.num & (1u << Z_TYPE_P(param))))) {
- ZEND_VM_TAIL_CALL(zend_verify_recv_arg_type_helper_SPEC(param ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_verify_recv_arg_type_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX param));
}
ZEND_VM_NEXT_OPCODE();
@@ -4295,7 +4298,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_UNUSED_HAND
if (ZEND_TYPE_IS_SET(arg_info->type)) {
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
do {
- if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param))) {
ZEND_HASH_FILL_FINISH();
HANDLE_EXCEPTION();
}
@@ -4323,7 +4326,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_UNUSED_HAND
if (ZEND_TYPE_IS_SET(arg_info->type)) {
SEPARATE_ARRAY(params);
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) {
- if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
+ if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param))) {
HANDLE_EXCEPTION();
}
Z_TRY_ADDREF_P(param);
@@ -4460,7 +4463,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(op1 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5233,7 +5236,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_H
USE_OPLINE
zval *expr;
zval *result = EX_VAR(opline->result.var);
- HashTable *ht;
SAVE_OPLINE();
expr = RT_CONSTANT(opline, opline->op1);
@@ -5266,53 +5268,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_H
}
if (opline->extended_value == IS_ARRAY) {
- if (IS_CONST == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
- if (Z_TYPE_P(expr) != IS_NULL) {
- ZVAL_ARR(result, zend_new_array(1));
- expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
- if (IS_CONST == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
- /* Optimized version without rebuilding properties HashTable */
- ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
- } else {
- HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
- if (obj_ht) {
- /* fast copy */
- ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
- (Z_OBJCE_P(expr)->default_properties_count ||
- Z_OBJ_P(expr)->handlers != &std_object_handlers ||
- GC_IS_RECURSIVE(obj_ht))));
- zend_release_properties(obj_ht);
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- }
+ zend_cast_zval_to_array(result, expr, IS_CONST);
} else {
ZEND_ASSERT(opline->extended_value == IS_OBJECT);
- ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
- if (Z_TYPE_P(expr) == IS_ARRAY) {
- ht = zend_symtable_to_proptable(Z_ARR_P(expr));
- if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
- /* TODO: try not to duplicate immutable arrays as well ??? */
- ht = zend_array_dup(ht);
- }
- Z_OBJ_P(result)->properties = ht;
- } else if (Z_TYPE_P(expr) != IS_NULL) {
- Z_OBJ_P(result)->properties = ht = zend_new_array(1);
- expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
- if (IS_CONST == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- }
+ zend_cast_zval_to_object(result, expr, IS_CONST);
}
}
@@ -6156,7 +6115,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SIMPLE
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(arg, value);
@@ -6198,7 +6157,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CO
}
}
- ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6236,7 +6195,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CO
}
}
- ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6277,7 +6236,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CO
}
}
- ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6318,7 +6277,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CO
}
}
- ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6339,7 +6298,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CON
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6358,7 +6317,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CON
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6460,7 +6419,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CON
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6518,7 +6477,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6561,7 +6520,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_C
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6608,7 +6567,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQU
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6640,7 +6599,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6658,7 +6617,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6676,7 +6635,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -7615,7 +7574,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_CONST_H
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(arg, value);
@@ -8083,6 +8042,48 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
+static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zval *name;
+ zval *val;
+ zend_constant c;
+
+ SAVE_OPLINE();
+ name = RT_CONSTANT(opline, opline->op1);
+ val = RT_CONSTANT(opline, opline->op2);
+
+ ZVAL_COPY(&c.value, val);
+ if (Z_OPT_CONSTANT(c.value)) {
+ if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
+ zval_ptr_dtor_nogc(&c.value);
+
+
+ HANDLE_EXCEPTION();
+ }
+ }
+ /* non persistent, case sensitive */
+ ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT);
+ c.name = zend_string_copy(Z_STR_P(name));
+
+ if (zend_register_constant(&c) == FAILURE) {
+
+
+ /* two opcodes used, second one is the data with attributes */
+ ZEND_VM_NEXT_OPCODE_EX(1, 2);
+ }
+
+ HashTable *attributes = Z_PTR_P(get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1));
+ zend_constant *registered = zend_get_constant_ptr(c.name);
+ ZEND_ASSERT(attributes != NULL);
+ ZEND_ASSERT(registered != NULL);
+ zend_constant_add_attributes(registered, attributes);
+
+
+ /* two opcodes used, second one is the data with attributes */
+ ZEND_VM_NEXT_OPCODE_EX(1, 2);
+}
+
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -8411,7 +8412,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP
}
}
- ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8449,7 +8450,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP
}
}
- ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8476,7 +8477,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLE
}
}
- ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8497,7 +8498,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8516,7 +8517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8559,7 +8560,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8602,7 +8603,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CO
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8645,7 +8646,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CO
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8692,7 +8693,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8739,7 +8740,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8786,7 +8787,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -10540,7 +10541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLE
ZEND_VM_RETURN();
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_EX int type)
{
USE_OPLINE
zval *varname;
@@ -10643,17 +10644,17 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_R));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_W));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_RW));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -10661,17 +10662,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUS
int fetch_type =
(UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ?
BP_VAR_W : BP_VAR_R;
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX fetch_type));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_UNSET));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_IS));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */
@@ -10869,7 +10870,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYP
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -10886,7 +10886,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYP
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -10948,7 +10948,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(arg, value);
@@ -10985,7 +10985,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_C
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(arg, value);
@@ -13040,7 +13040,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMPVAR
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(op1 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13108,7 +13108,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_TMPVARCV_
}
}
- ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13146,7 +13146,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_
}
}
- ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13187,7 +13187,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLE
}
}
- ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13214,7 +13214,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLE
}
}
- ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13235,7 +13235,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13254,7 +13254,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13297,7 +13297,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13340,7 +13340,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TM
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13383,7 +13383,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TM
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13430,7 +13430,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13477,7 +13477,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13524,7 +13524,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13542,7 +13542,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARC
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13560,7 +13560,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13578,7 +13578,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14128,7 +14128,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_TMPVARCV_
}
}
- ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14166,7 +14166,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_
}
}
- ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14207,7 +14207,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HAN
}
}
- ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14234,7 +14234,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HAN
}
}
- ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14255,7 +14255,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HAND
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14274,7 +14274,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HAND
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14317,7 +14317,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVA
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14360,7 +14360,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TM
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14403,7 +14403,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TM
goto is_smaller_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14450,7 +14450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14497,7 +14497,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14544,7 +14544,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
goto is_smaller_or_equal_double;
}
}
- ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14562,7 +14562,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARC
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14580,7 +14580,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -14598,7 +14598,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR
ZEND_VM_NEXT_OPCODE();
}
- ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -15893,7 +15893,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HAN
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -15951,7 +15951,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMP
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16009,7 +16009,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMP
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16067,7 +16067,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16125,7 +16125,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16183,7 +16183,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16907,7 +16907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER
}
}
}
- ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17386,7 +17386,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17444,7 +17444,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JM
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17502,7 +17502,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JM
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17560,7 +17560,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17618,7 +17618,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17676,7 +17676,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18372,7 +18372,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLE
}
}
}
- ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18582,7 +18582,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_HAN
ZEND_VM_SMART_BRANCH(result, 1);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_EX int type)
{
USE_OPLINE
zval *varname;
@@ -18685,17 +18685,17 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_R));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_W));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_RW));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18703,17 +18703,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNU
int fetch_type =
(UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ?
BP_VAR_W : BP_VAR_R;
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX fetch_type));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_UNSET));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_IS));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */
@@ -19779,7 +19779,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZE
}
}
}
- ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -20155,7 +20155,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
USE_OPLINE
zval *expr;
zval *result = EX_VAR(opline->result.var);
- HashTable *ht;
SAVE_OPLINE();
expr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
@@ -20188,53 +20187,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
}
if (opline->extended_value == IS_ARRAY) {
- if (IS_TMP_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
- if (Z_TYPE_P(expr) != IS_NULL) {
- ZVAL_ARR(result, zend_new_array(1));
- expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
- if (IS_TMP_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
- /* Optimized version without rebuilding properties HashTable */
- ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
- } else {
- HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
- if (obj_ht) {
- /* fast copy */
- ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
- (Z_OBJCE_P(expr)->default_properties_count ||
- Z_OBJ_P(expr)->handlers != &std_object_handlers ||
- GC_IS_RECURSIVE(obj_ht))));
- zend_release_properties(obj_ht);
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- }
+ zend_cast_zval_to_array(result, expr, IS_TMP_VAR);
} else {
ZEND_ASSERT(opline->extended_value == IS_OBJECT);
- ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
- if (Z_TYPE_P(expr) == IS_ARRAY) {
- ht = zend_symtable_to_proptable(Z_ARR_P(expr));
- if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
- /* TODO: try not to duplicate immutable arrays as well ??? */
- ht = zend_array_dup(ht);
- }
- Z_OBJ_P(result)->properties = ht;
- } else if (Z_TYPE_P(expr) != IS_NULL) {
- Z_OBJ_P(result)->properties = ht = zend_new_array(1);
- expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
- if (IS_TMP_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- }
+ zend_cast_zval_to_object(result, expr, IS_TMP_VAR);
}
}
@@ -20797,7 +20753,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_CONST_HAN
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
ZVAL_COPY_VALUE(arg, value);
@@ -21606,7 +21562,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UN
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -21623,7 +21578,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UN
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -21657,7 +21612,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_HA
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
ZVAL_COPY_VALUE(arg, value);
@@ -21694,7 +21649,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_T
}
} else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
send_val_by_ref:
- ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX arg_num, arg));
}
value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
ZVAL_COPY_VALUE(arg, value);
@@ -22822,7 +22777,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
USE_OPLINE
zval *expr;
zval *result = EX_VAR(opline->result.var);
- HashTable *ht;
SAVE_OPLINE();
expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
@@ -22856,53 +22810,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
}
if (opline->extended_value == IS_ARRAY) {
- if (IS_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
- if (Z_TYPE_P(expr) != IS_NULL) {
- ZVAL_ARR(result, zend_new_array(1));
- expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
- if (IS_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
- /* Optimized version without rebuilding properties HashTable */
- ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
- } else {
- HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
- if (obj_ht) {
- /* fast copy */
- ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
- (Z_OBJCE_P(expr)->default_properties_count ||
- Z_OBJ_P(expr)->handlers != &std_object_handlers ||
- GC_IS_RECURSIVE(obj_ht))));
- zend_release_properties(obj_ht);
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- }
+ zend_cast_zval_to_array(result, expr, IS_VAR);
} else {
ZEND_ASSERT(opline->extended_value == IS_OBJECT);
- ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
- if (Z_TYPE_P(expr) == IS_ARRAY) {
- ht = zend_symtable_to_proptable(Z_ARR_P(expr));
- if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
- /* TODO: try not to duplicate immutable arrays as well ??? */
- ht = zend_array_dup(ht);
- }
- Z_OBJ_P(result)->properties = ht;
- } else if (Z_TYPE_P(expr) != IS_NULL) {
- Z_OBJ_P(result)->properties = ht = zend_new_array(1);
- expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
- if (IS_VAR == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- }
+ zend_cast_zval_to_object(result, expr, IS_VAR);
}
}
@@ -30086,7 +29997,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UN
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -30103,7 +30013,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UN
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -37880,7 +37790,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -37897,7 +37806,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -41065,7 +40974,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
USE_OPLINE
zval *expr;
zval *result = EX_VAR(opline->result.var);
- HashTable *ht;
SAVE_OPLINE();
expr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
@@ -41098,53 +41006,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
}
if (opline->extended_value == IS_ARRAY) {
- if (IS_CV == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) {
- if (Z_TYPE_P(expr) != IS_NULL) {
- ZVAL_ARR(result, zend_new_array(1));
- expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
- if (IS_CV == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- } else if (ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(expr)) {
- /* Optimized version without rebuilding properties HashTable */
- ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
- } else {
- HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
- if (obj_ht) {
- /* fast copy */
- ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht,
- (Z_OBJCE_P(expr)->default_properties_count ||
- Z_OBJ_P(expr)->handlers != &std_object_handlers ||
- GC_IS_RECURSIVE(obj_ht))));
- zend_release_properties(obj_ht);
- } else {
- ZVAL_EMPTY_ARRAY(result);
- }
- }
+ zend_cast_zval_to_array(result, expr, IS_CV);
} else {
ZEND_ASSERT(opline->extended_value == IS_OBJECT);
- ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def));
- if (Z_TYPE_P(expr) == IS_ARRAY) {
- ht = zend_symtable_to_proptable(Z_ARR_P(expr));
- if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) {
- /* TODO: try not to duplicate immutable arrays as well ??? */
- ht = zend_array_dup(ht);
- }
- Z_OBJ_P(result)->properties = ht;
- } else if (Z_TYPE_P(expr) != IS_NULL) {
- Z_OBJ_P(result)->properties = ht = zend_new_array(1);
- expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr);
- if (IS_CV == IS_CONST) {
- if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr);
- } else {
- if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
- }
- }
+ zend_cast_zval_to_object(result, expr, IS_CV);
}
}
@@ -42271,7 +42136,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -42329,7 +42194,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_HA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -42387,7 +42252,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_H
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -42445,7 +42310,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HAN
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -42503,7 +42368,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMP
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -42561,7 +42426,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMP
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46224,7 +46089,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLE
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46282,7 +46147,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_H
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46340,7 +46205,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46398,7 +46263,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HA
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46456,7 +46321,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JM
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -46514,7 +46379,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JM
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -49845,7 +49710,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED_H
ZEND_VM_NEXT_OPCODE_EX(1, 2);
}
-static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC)
+static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_EX int type)
{
USE_OPLINE
zval *varname;
@@ -49948,17 +49813,17 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_R));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_W));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_RW));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -49966,17 +49831,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_
int fetch_type =
(UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ?
BP_VAR_W : BP_VAR_R;
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX fetch_type));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_UNSET));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
- ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX BP_VAR_IS));
}
/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */
@@ -50681,7 +50546,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNU
}
zend_reference *ref = NULL;
- void *cache_slot = CACHE_ADDR(opline->op2.num);
if (UNEXPECTED(retval_ref != retval_ptr)) {
if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
ref = Z_REF_P(retval_ref);
@@ -50698,7 +50562,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNU
}
SAVE_OPLINE();
- if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) {
+ if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, 1, 0))) {
zend_verify_return_error(EX(func), retval_ptr);
HANDLE_EXCEPTION();
}
@@ -51727,7 +51591,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZE
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -51785,7 +51649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDL
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -51843,7 +51707,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HAND
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -51901,7 +51765,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLE
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -51959,7 +51823,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_H
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -52017,7 +51881,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_
}
}
}
- ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
+ ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX op1, op2));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -55131,10 +54995,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDL
# pragma GCC optimize("no-gcse")
# pragma GCC optimize("no-ivopts")
#endif
+#ifdef _WIN64
+/* See save_xmm_x86_64_ms_masm.asm */
+void execute_ex_real(zend_execute_data *ex)
+#else
ZEND_API void execute_ex(zend_execute_data *ex)
+#endif
{
DCL_OPLINE
+#if defined(__GNUC__) && defined(__aarch64__)
+ __asm__ __volatile__ (""::: "v8","v9","v10","v11","v12","v13","v14","v15");
+#endif
+
#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_FP_GLOBAL_REG)
struct {
#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE
@@ -57738,6 +57611,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_FRAMELESS_ICALL_3_SPEC_OBSERVER_LABEL,
(void*)&&ZEND_JMP_FRAMELESS_SPEC_CONST_LABEL,
(void*)&&ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED_LABEL,
+ (void*)&&ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_INIT_FCALL_OFFSET_SPEC_CONST_LABEL,
(void*)&&ZEND_RECV_NOTYPE_SPEC_LABEL,
(void*)&&ZEND_NULL_LABEL,
@@ -58677,19 +58551,17 @@ ZEND_API void execute_ex(zend_execute_data *ex)
#endif /* ZEND_CHECK_STACK_LIMIT */
while (1) {
-#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)
- int ret;
-#endif
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
HYBRID_SWITCH() {
-#else
+#else /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */
#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
if (UNEXPECTED(!OPLINE)) {
#else
- if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) {
-#endif
+ opline = ((opcode_handler_t)opline->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ if (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT))) {
#endif
+#endif /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_OP_SPEC):
VM_TRACE(ZEND_ASSIGN_STATIC_PROP_OP_SPEC)
@@ -59714,6 +59586,11 @@ ZEND_API void execute_ex(zend_execute_data *ex)
ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
VM_TRACE_OP_END(ZEND_DECLARE_CONST_SPEC_CONST_CONST)
HYBRID_BREAK();
+ HYBRID_CASE(ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST):
+ VM_TRACE(ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST)
+ ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+ VM_TRACE_OP_END(ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST)
+ HYBRID_BREAK();
HYBRID_CASE(ZEND_YIELD_SPEC_CONST_CONST):
VM_TRACE(ZEND_YIELD_SPEC_CONST_CONST)
ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -64284,7 +64161,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
VM_TRACE_OP_END(ZEND_NULL)
HYBRID_BREAK(); /* Never reached */
-#else
+#else /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */
#ifdef ZEND_VM_FP_GLOBAL_REG
execute_data = vm_stack_data.orig_execute_data;
# ifdef ZEND_VM_IP_GLOBAL_REG
@@ -64292,7 +64169,8 @@ ZEND_API void execute_ex(zend_execute_data *ex)
# endif
return;
#else
- if (EXPECTED(ret > 0)) {
+ opline = (const zend_op*)((uintptr_t)opline & ~ZEND_VM_ENTER_BIT);
+ if (EXPECTED(opline != NULL)) {
execute_data = EG(current_execute_data);
ZEND_VM_LOOP_INTERRUPT_CHECK();
} else {
@@ -64302,7 +64180,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
return;
}
#endif
-#endif
+#endif /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */
}
}
@@ -66925,6 +66803,7 @@ void zend_vm_init(void)
ZEND_FRAMELESS_ICALL_3_SPEC_OBSERVER_HANDLER,
ZEND_JMP_FRAMELESS_SPEC_CONST_HANDLER,
ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED_HANDLER,
+ ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_HANDLER,
ZEND_INIT_FCALL_OFFSET_SPEC_CONST_HANDLER,
ZEND_RECV_NOTYPE_SPEC_HANDLER,
ZEND_NULL_HANDLER,
@@ -67882,7 +67761,7 @@ void zend_vm_init(void)
1255,
1256 | SPEC_RULE_OP1,
1261 | SPEC_RULE_OP1,
- 3486,
+ 3487,
1266 | SPEC_RULE_OP1,
1271 | SPEC_RULE_OP1,
1276 | SPEC_RULE_OP2,
@@ -67916,7 +67795,7 @@ void zend_vm_init(void)
1559 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
1584 | SPEC_RULE_OP1,
1589,
- 3486,
+ 3487,
1590 | SPEC_RULE_OP1,
1595 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
1620 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
@@ -68047,52 +67926,52 @@ void zend_vm_init(void)
2573 | SPEC_RULE_OBSERVER,
2575,
2576,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
- 3486,
+ 2577,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
+ 3487,
};
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
zend_opcode_handler_funcs = labels;
@@ -68265,7 +68144,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2585 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2586 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -68273,7 +68152,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2610 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2611 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -68281,7 +68160,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2635 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2636 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -68292,17 +68171,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2660 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
+ spec = 2661 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
} else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2685 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
+ spec = 2686 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2710 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
+ spec = 2711 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
}
break;
case ZEND_MUL:
@@ -68313,17 +68192,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2735 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2736 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2760 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2761 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2785 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 2786 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_IDENTICAL:
@@ -68334,14 +68213,14 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2810 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2811 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2885 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2886 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) {
- spec = 3110 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 3111 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_NOT_IDENTICAL:
@@ -68352,14 +68231,14 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2960 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2961 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3035 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 3036 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) {
- spec = 3115 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
+ spec = 3116 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_EQUAL:
@@ -68370,12 +68249,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2810 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2811 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2885 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2886 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_NOT_EQUAL:
@@ -68386,12 +68265,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 2960 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 2961 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3035 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
+ spec = 3036 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_SMALLER:
@@ -68399,12 +68278,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3120 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
+ spec = 3121 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3195 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
+ spec = 3196 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
}
break;
case ZEND_IS_SMALLER_OR_EQUAL:
@@ -68412,79 +68291,79 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3270 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
+ spec = 3271 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3345 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
+ spec = 3346 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
}
break;
case ZEND_QM_ASSIGN:
if (op1_info == MAY_BE_LONG) {
- spec = 3432 | SPEC_RULE_OP1;
+ spec = 3433 | SPEC_RULE_OP1;
} else if (op1_info == MAY_BE_DOUBLE) {
- spec = 3437 | SPEC_RULE_OP1;
+ spec = 3438 | SPEC_RULE_OP1;
} else if ((op->op1_type == IS_CONST) ? !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)) : (!(op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE))))) {
- spec = 3442 | SPEC_RULE_OP1;
+ spec = 3443 | SPEC_RULE_OP1;
}
break;
case ZEND_PRE_INC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
- spec = 3420 | SPEC_RULE_RETVAL;
+ spec = 3421 | SPEC_RULE_RETVAL;
} else if (op1_info == MAY_BE_LONG) {
- spec = 3422 | SPEC_RULE_RETVAL;
+ spec = 3423 | SPEC_RULE_RETVAL;
}
break;
case ZEND_PRE_DEC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
- spec = 3424 | SPEC_RULE_RETVAL;
+ spec = 3425 | SPEC_RULE_RETVAL;
} else if (op1_info == MAY_BE_LONG) {
- spec = 3426 | SPEC_RULE_RETVAL;
+ spec = 3427 | SPEC_RULE_RETVAL;
}
break;
case ZEND_POST_INC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
- spec = 3428;
- } else if (op1_info == MAY_BE_LONG) {
spec = 3429;
+ } else if (op1_info == MAY_BE_LONG) {
+ spec = 3430;
}
break;
case ZEND_POST_DEC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
- spec = 3430;
- } else if (op1_info == MAY_BE_LONG) {
spec = 3431;
+ } else if (op1_info == MAY_BE_LONG) {
+ spec = 3432;
}
break;
case ZEND_JMP:
if (OP_JMP_ADDR(op, op->op1) > op) {
- spec = 2584;
+ spec = 2585;
}
break;
case ZEND_INIT_FCALL:
if (Z_EXTRA_P(RT_CONSTANT(op, op->op2)) != 0) {
- spec = 2577;
+ spec = 2578;
}
break;
case ZEND_RECV:
if (op->op2.num == MAY_BE_ANY) {
- spec = 2578;
+ spec = 2579;
}
break;
case ZEND_SEND_VAL:
if (op->op1_type == IS_CONST && op->op2_type == IS_UNUSED && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) {
- spec = 3482;
+ spec = 3483;
}
break;
case ZEND_SEND_VAR_EX:
if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) {
- spec = 3477 | SPEC_RULE_OP1;
+ spec = 3478 | SPEC_RULE_OP1;
}
break;
case ZEND_FE_FETCH_R:
if (op->op2_type == IS_CV && (op1_info & (MAY_BE_ANY|MAY_BE_REF)) == MAY_BE_ARRAY) {
- spec = 3484 | SPEC_RULE_RETVAL;
+ spec = 3485 | SPEC_RULE_RETVAL;
}
break;
case ZEND_FETCH_DIM_R:
@@ -68492,22 +68371,22 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
- spec = 3447 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
+ spec = 3448 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
}
break;
case ZEND_SEND_VAL_EX:
if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && op->op1_type == IS_CONST && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) {
- spec = 3483;
+ spec = 3484;
}
break;
case ZEND_SEND_VAR:
if (op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) {
- spec = 3472 | SPEC_RULE_OP1;
+ spec = 3473 | SPEC_RULE_OP1;
}
break;
case ZEND_COUNT:
if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY) {
- spec = 2579 | SPEC_RULE_OP1;
+ spec = 2580 | SPEC_RULE_OP1;
}
break;
case ZEND_BW_OR:
@@ -68536,6 +68415,7 @@ ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
opcode_handler_t handler;
#endif
+ DCL_OPLINE;
int ret;
#ifdef ZEND_VM_IP_GLOBAL_REG
const zend_op *orig_opline = opline;
@@ -68563,8 +68443,23 @@ ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)
ret = -1;
}
#else
- ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
- SAVE_OPLINE();
+ opline = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+if (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT))) {
+ opline = (const zend_op*)((uintptr_t)opline & ~ZEND_VM_ENTER_BIT);
+ if (EXPECTED(opline)) {
+ /* ZEND_VM_ENTER() or ZEND_VM_LEAVE() */
+ ret = EG(current_execute_data) != ex ? (int)(EG(current_execute_data)->prev_execute_data != ex) + 1 : 0;
+ execute_data = EG(current_execute_data);
+ SAVE_OPLINE();
+ } else {
+ /* ZEND_VM_RETURN() */
+ ret = -1;
+ }
+ } else {
+ /* ZEND_VM_CONTINUE() */
+ SAVE_OPLINE();
+ ret = 0;
+ }
#endif
#ifdef ZEND_VM_FP_GLOBAL_REG
execute_data = orig_execute_data;
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
index 717d4ffd3e8af..6fecd39346a70 100644
--- a/Zend/zend_vm_execute.skl
+++ b/Zend/zend_vm_execute.skl
@@ -1,3 +1,5 @@
+#include "Zend/zend_vm_opcodes.h"
+
{%DEFINES%}
#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__)
@@ -5,10 +7,19 @@
# pragma GCC optimize("no-gcse")
# pragma GCC optimize("no-ivopts")
#endif
+#ifdef _WIN64
+/* See save_xmm_x86_64_ms_masm.asm */
+void {%EXECUTOR_NAME%}_ex_real(zend_execute_data *ex)
+#else
ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex)
+#endif
{
DCL_OPLINE
+#if defined(__GNUC__) && defined(__aarch64__)
+ __asm__ __volatile__ (""::: "v8","v9","v10","v11","v12","v13","v14","v15");
+#endif
+
{%HELPER_VARS%}
{%INTERNAL_LABELS%}
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index c94cd6b616e43..5a4a31b60b8d3 100755
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -818,7 +818,7 @@ function($matches) use ($spec, $prefix, $op1, $op2, $extra_spec) {
if (isset($matches[2])) {
// extra args
$args = substr(preg_replace("/,\s*[A-Za-z0-9_]*\s*,\s*([^,)\s]*)\s*/", ", $1", $matches[2]), 2);
- return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(" . $args. " ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC))";
+ return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX " . $args . "))";
}
return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU))";
}
@@ -852,7 +852,7 @@ function($matches) use ($spec, $prefix, $op1, $op2, $extra_spec, $name) {
if (isset($matches[2])) {
// extra args
$args = substr(preg_replace("/,\s*[A-Za-z0-9_]*\s*,\s*([^,)\s]*)\s*/", ", $1", $matches[2]), 2);
- return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(" . $args. " ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC))";
+ return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX " . $args . "))";
}
return "ZEND_VM_TAIL_CALL(" . helper_name($matches[1], $spec, $op1, $op2, $extra_spec) . "(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU))";
}
@@ -1164,7 +1164,7 @@ function gen_helper($f, $spec, $kind, $name, $op1, $op2, $param, $code, $lineno,
out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDLER_ARGS)\n");
} else {
// Helper with parameter
- out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCODE_HANDLER_ARGS_DC)\n");
+ out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDLER_ARGS_EX $param)\n");
}
break;
case ZEND_VM_KIND_SWITCH:
@@ -1870,13 +1870,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS_EX\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX\n");
out($f,"#else\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
- out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data, const zend_op *opline\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data, opline\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS_EX ZEND_OPCODE_HANDLER_ARGS, \n");
+ out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX ZEND_OPCODE_HANDLER_ARGS_PASSTHRU, \n");
out($f,"#endif\n");
out($f,"\n");
out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
@@ -1902,10 +1902,10 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
}
out($f,"#else\n");
- out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
+ out($f,"# define ZEND_OPCODE_HANDLER_RET const zend_op *\n");
out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
- out($f,"# define ZEND_VM_CONTINUE() return 0\n");
- out($f,"# define ZEND_VM_RETURN() return -1\n");
+ out($f,"# define ZEND_VM_CONTINUE() return opline\n");
+ out($f,"# define ZEND_VM_RETURN() return (const zend_op*)ZEND_VM_ENTER_BIT\n");
if ($kind == ZEND_VM_KIND_HYBRID) {
out($f,"# define ZEND_VM_HOT\n");
}
@@ -1914,8 +1914,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,"\n");
out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS);\n");
out($f,"\n");
- out($f,"#define DCL_OPLINE\n");
out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
+ out($f,"# define DCL_OPLINE\n");
out($f,"# define OPLINE opline\n");
out($f,"# define USE_OPLINE\n");
out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
@@ -1924,12 +1924,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
out($f,"#else\n");
- out($f,"# define OPLINE EX(opline)\n");
- out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
- out($f,"# define LOAD_OPLINE()\n");
- out($f,"# define LOAD_OPLINE_EX()\n");
- out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
- out($f,"# define SAVE_OPLINE()\n");
+ out($f,"# define DCL_OPLINE const zend_op *opline;\n");
+ out($f,"# define OPLINE opline\n");
+ out($f,"# define USE_OPLINE\n");
+ out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
+ out($f,"# define LOAD_OPLINE_EX() opline = EX(opline)\n");
+ out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
+ out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
out($f,"# define SAVE_OPLINE_EX()\n");
out($f,"#endif\n");
out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
@@ -1943,9 +1944,10 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTER_EX()\n");
out($f,"# define ZEND_VM_LEAVE() return 2\n");
out($f,"#else\n");
- out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
- out($f,"# define ZEND_VM_ENTER() return 1\n");
- out($f,"# define ZEND_VM_LEAVE() return 2\n");
+ out($f,"# define ZEND_VM_ENTER_BIT 1ULL\n");
+ out($f,"# define ZEND_VM_ENTER_EX() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT)\n");
+ out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_ENTER_EX()\n");
+ out($f,"# define ZEND_VM_LEAVE() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT)\n");
out($f,"#endif\n");
out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
@@ -2119,12 +2121,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
}
break;
case "ZEND_VM_CONTINUE_LABEL":
- if ($kind == ZEND_VM_KIND_CALL || $kind == ZEND_VM_KIND_HYBRID) {
- // Only SWITCH dispatch method use it
- out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
- out($f,$m[1]."\tint ret;".$m[3]."\n");
- out($f,"#endif\n");
- } else if ($kind == ZEND_VM_KIND_SWITCH) {
+ if ($kind == ZEND_VM_KIND_SWITCH) {
// Only SWITCH dispatch method use it
out($f,"zend_vm_continue:".$m[3]."\n");
} else {
@@ -2143,16 +2140,17 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
case ZEND_VM_KIND_HYBRID:
out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
- out($f,"#else\n");
+ out($f,"#else /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */\n");
case ZEND_VM_KIND_CALL:
out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
out($f,"#else\n");
- out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0))".$m[3]."\n");
+ out($f, $m[1]."opline = ((opcode_handler_t)opline->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
+ out($f, $m[1]."if (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT)))".$m[3]."\n");
out($f,"#endif\n");
if ($kind == ZEND_VM_KIND_HYBRID) {
- out($f,"#endif\n");
+ out($f,"#endif /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */\n");
}
break;
}
@@ -2168,7 +2166,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
if ($kind == ZEND_VM_KIND_CALL || $kind == ZEND_VM_KIND_HYBRID) {
// Executor is defined as a set of functions
if ($kind == ZEND_VM_KIND_HYBRID) {
- out($f,"#else\n");
+ out($f,"#else /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */\n");
}
out($f,
"#ifdef ZEND_VM_FP_GLOBAL_REG\n" .
@@ -2178,18 +2176,19 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
"# endif\n" .
$m[1]."return;\n" .
"#else\n" .
- $m[1]."if (EXPECTED(ret > 0)) {\n" .
+ $m[1]."opline = (const zend_op*)((uintptr_t)opline & ~ZEND_VM_ENTER_BIT);\n".
+ $m[1]."if (EXPECTED(opline != NULL)) {\n" .
$m[1]."\texecute_data = EG(current_execute_data);\n".
$m[1]."\tZEND_VM_LOOP_INTERRUPT_CHECK();\n".
$m[1]."} else {\n" .
"# ifdef ZEND_VM_IP_GLOBAL_REG\n" .
$m[1]."\topline = vm_stack_data.orig_opline;\n" .
- "# endif\n".
+ "# endif\n" .
$m[1]."\treturn;\n".
$m[1]."}\n".
"#endif\n");
if ($kind == ZEND_VM_KIND_HYBRID) {
- out($f,"#endif\n");
+ out($f,"#endif /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */\n");
}
}
break;
@@ -2335,6 +2334,8 @@ function gen_vm_opcodes_header(
): string {
$str = HEADER_TEXT;
$str .= "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n";
+ $str .= "#include \"Zend/zend_portability.h\"\n";
+ $str .= "\n";
$str .= "#define ZEND_VM_SPEC\t\t" . ZEND_VM_SPEC . "\n";
$str .= "#define ZEND_VM_LINES\t\t" . ZEND_VM_LINES . "\n";
$str .= "#define ZEND_VM_KIND_CALL\t" . ZEND_VM_KIND_CALL . "\n";
@@ -2968,6 +2969,7 @@ function gen_vm($def, $skel) {
out($f, "\topcode_handler_t handler;\n");
out($f,"#endif\n");
}
+ out($f, "\tDCL_OPLINE;\n");
out($f, "\tint ret;\n");
out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
out($f, "\tconst zend_op *orig_opline = opline;\n");
@@ -3001,8 +3003,24 @@ function gen_vm($def, $skel) {
out($f, "\t\tret = -1;\n");
out($f, "\t}\n");
out($f, "#else\n");
- out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
- out($f, "\tSAVE_OPLINE();\n");
+ out($f, "\topline = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
+
+ out($f, "if (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT))) {\n");
+ out($f, "\t\topline = (const zend_op*)((uintptr_t)opline & ~ZEND_VM_ENTER_BIT);\n");
+ out($f, "\t\tif (EXPECTED(opline)) {\n");
+ out($f, "\t\t\t/* ZEND_VM_ENTER() or ZEND_VM_LEAVE() */\n");
+ out($f, "\t\t\tret = EG(current_execute_data) != ex ? (int)(EG(current_execute_data)->prev_execute_data != ex) + 1 : 0;\n");
+ out($f, "\t\t\texecute_data = EG(current_execute_data);\n");
+ out($f, "\t\t\tSAVE_OPLINE();\n");
+ out($f, "\t\t} else {\n");
+ out($f, "\t\t\t/* ZEND_VM_RETURN() */\n");
+ out($f, "\t\t\tret = -1;\n");
+ out($f, "\t\t}\n");
+ out($f, "\t} else {\n");
+ out($f, "\t\t/* ZEND_VM_CONTINUE() */\n");
+ out($f, "\t\tSAVE_OPLINE();\n");
+ out($f, "\t\tret = 0;\n");
+ out($f, "\t}\n");
out($f, "#endif\n");
out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
out($f, "\texecute_data = orig_execute_data;\n");
diff --git a/Zend/zend_vm_handlers.h b/Zend/zend_vm_handlers.h
index 7f3a3cb5de260..cbbc6a4772788 100644
--- a/Zend/zend_vm_handlers.h
+++ b/Zend/zend_vm_handlers.h
@@ -1372,502 +1372,503 @@
_(2574, ZEND_FRAMELESS_ICALL_3_SPEC_OBSERVER) \
_(2575, ZEND_JMP_FRAMELESS_SPEC_CONST) \
_(2576, ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED) \
- _(2577, ZEND_INIT_FCALL_OFFSET_SPEC_CONST) \
- _(2578, ZEND_RECV_NOTYPE_SPEC) \
- _(2580, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \
+ _(2577, ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST) \
+ _(2578, ZEND_INIT_FCALL_OFFSET_SPEC_CONST) \
+ _(2579, ZEND_RECV_NOTYPE_SPEC) \
_(2581, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \
- _(2583, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \
- _(2584, ZEND_JMP_FORWARD_SPEC) \
- _(2590, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2591, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2582, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \
+ _(2584, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \
+ _(2585, ZEND_JMP_FORWARD_SPEC) \
+ _(2591, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2592, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2594, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2595, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2596, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2593, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2595, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2596, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2597, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2599, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2605, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2606, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2598, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2600, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2606, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2607, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2609, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2615, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
- _(2616, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2608, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2610, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2616, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
_(2617, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2619, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2620, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
- _(2621, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2618, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2620, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2621, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
_(2622, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2624, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2630, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
- _(2631, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2623, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2625, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2631, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \
_(2632, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2634, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2640, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2641, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2633, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2635, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2641, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2642, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2644, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2645, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2646, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2643, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2645, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2646, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2647, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2649, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2655, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2656, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2648, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2650, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2656, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2657, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2659, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2661, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \
+ _(2658, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2660, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
_(2662, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \
- _(2664, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \
- _(2665, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2666, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2663, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \
+ _(2665, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \
+ _(2666, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2667, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2669, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2670, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2671, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2668, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2670, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2671, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2672, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2674, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2680, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2681, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2673, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2675, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2681, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2682, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2684, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2686, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \
+ _(2683, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2685, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
_(2687, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \
- _(2689, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \
- _(2690, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
- _(2691, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2688, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \
+ _(2690, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \
+ _(2691, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
_(2692, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2694, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2695, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
- _(2696, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2693, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2695, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2696, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
_(2697, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2699, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2705, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
- _(2706, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2698, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2700, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2706, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \
_(2707, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2709, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2711, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(2708, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2710, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \
_(2712, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(2714, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(2715, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2716, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2713, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(2715, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(2716, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2717, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2719, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2720, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2721, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2718, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2720, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2721, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2722, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2724, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2730, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2731, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2723, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2725, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2731, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2732, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2734, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2740, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2741, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2733, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2735, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2741, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2742, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2744, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2745, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2746, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2743, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2745, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2746, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2747, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2749, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2755, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
- _(2756, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2748, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2750, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2756, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \
_(2757, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2759, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
- _(2765, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
- _(2766, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2758, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2760, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \
+ _(2766, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
_(2767, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2769, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2770, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
- _(2771, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2768, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2770, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2771, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
_(2772, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2774, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2780, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
- _(2781, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2773, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2775, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2781, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \
_(2782, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2784, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2790, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2791, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2783, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2785, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2791, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2792, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2794, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2795, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2796, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2793, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2795, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2796, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2797, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2799, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2805, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2806, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2798, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2800, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2806, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \
_(2807, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2809, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2825, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(2826, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2827, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2828, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2831, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2832, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2833, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2837, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2838, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2839, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2840, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(2841, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2842, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2843, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2844, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2845, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2846, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2847, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2848, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2852, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2853, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2854, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2870, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(2871, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2872, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2873, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2874, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2875, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2876, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2877, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2878, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2882, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2883, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2884, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2900, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2901, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2902, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2903, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2906, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2907, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2908, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2912, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2913, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2914, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2915, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2916, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2917, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2918, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2919, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2920, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2921, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2922, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2923, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2927, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2928, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2929, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2945, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(2946, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2947, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2948, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2949, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2950, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2951, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2952, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2953, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2957, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(2958, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2959, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2975, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(2976, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2977, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2978, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2981, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2982, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2983, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2987, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2988, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2989, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2990, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(2991, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(2992, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(2993, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2994, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2995, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(2996, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(2997, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(2998, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3002, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3003, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3004, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3020, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(3021, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3022, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3023, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3024, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3025, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3026, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3027, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3028, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3032, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3033, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3034, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3050, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3051, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3052, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3053, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3056, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3057, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3058, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3062, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3063, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3064, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3065, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3066, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3067, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3068, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3069, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3070, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3071, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3072, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3073, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3077, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3078, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3079, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3095, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3096, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3097, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3098, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3099, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3100, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3101, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3102, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3103, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3107, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3108, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3109, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3110, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \
- _(3114, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \
- _(3115, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \
- _(3119, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \
- _(3123, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
- _(3124, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3125, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3126, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
- _(3127, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3128, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3132, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
- _(3133, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3134, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3135, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
- _(3136, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3142, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3143, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3147, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3148, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3149, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3150, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
- _(3151, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3153, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3154, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3155, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3156, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3157, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3158, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3162, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3163, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3164, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3180, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
- _(3181, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3183, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3184, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3185, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3186, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3187, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3188, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3192, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3193, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3194, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3207, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3209, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3210, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3211, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3217, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3218, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3222, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3223, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3224, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3225, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3226, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3228, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3229, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3230, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3231, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3232, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3233, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3237, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3238, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3239, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3255, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3256, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3258, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3259, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3260, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3261, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3262, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3263, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3267, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3268, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3269, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
- _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
- _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3282, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
- _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3284, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3285, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(3286, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3292, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3293, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3297, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3298, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3299, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3300, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(3301, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3303, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3304, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3305, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3306, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3307, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3308, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3312, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3313, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3314, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3330, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
- _(3331, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3333, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3334, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3335, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3336, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3337, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3338, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3342, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
- _(3343, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3344, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3357, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
- _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
- _(3359, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
- _(3360, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3361, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3367, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3368, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3372, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3373, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3374, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3375, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3376, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3378, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3379, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3380, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3381, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3382, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3383, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3387, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3388, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3389, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3405, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
- _(3406, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
- _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
- _(3408, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3409, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3410, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3411, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3412, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3413, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3417, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
- _(3418, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
- _(3419, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
- _(3420, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \
- _(3421, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \
- _(3422, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \
- _(3423, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \
- _(3424, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \
- _(3425, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \
- _(3426, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \
- _(3427, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \
- _(3428, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \
- _(3429, ZEND_POST_INC_LONG_SPEC_CV) \
- _(3430, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \
- _(3431, ZEND_POST_DEC_LONG_SPEC_CV) \
- _(3432, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \
- _(3433, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \
+ _(2808, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2810, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2826, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(2827, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2828, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2831, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2832, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2833, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2834, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2838, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2839, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2840, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2841, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(2842, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2843, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2844, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2845, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2846, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2847, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2848, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2849, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2853, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2854, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2855, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2871, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(2872, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2873, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2874, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2875, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2876, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2877, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2878, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2879, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2883, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2884, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2885, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2901, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(2902, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2903, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2906, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2907, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2908, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2909, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2913, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2914, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2915, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2916, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(2917, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2918, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2919, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2920, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2921, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2922, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2923, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2924, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2928, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2929, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2930, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2946, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(2947, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2948, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2949, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2950, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2951, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2952, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2953, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2954, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2958, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(2959, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2960, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2976, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(2977, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2978, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2981, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2982, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2983, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2984, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2988, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2989, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2990, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2991, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(2992, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(2993, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(2994, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2995, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2996, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(2997, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(2998, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(2999, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3003, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3004, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3005, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3021, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(3022, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3023, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3024, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3025, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3026, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3027, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3028, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3029, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3033, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3034, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3035, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3051, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3052, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3053, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3056, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3057, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3058, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3059, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3063, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3064, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3065, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3066, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3067, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3068, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3069, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3070, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3071, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3072, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3073, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3074, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3078, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3079, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3080, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3096, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3097, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3098, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3099, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3100, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3101, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3102, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3103, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3104, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3108, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3109, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3110, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3111, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \
+ _(3115, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \
+ _(3116, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \
+ _(3120, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \
+ _(3124, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
+ _(3125, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3126, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3127, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
+ _(3128, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3129, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3133, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \
+ _(3134, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3135, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3136, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
+ _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3142, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3143, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3144, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3148, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3149, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3150, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3151, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
+ _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3153, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3154, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3155, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3156, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3157, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3158, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3159, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3163, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3164, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3165, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3181, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \
+ _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3183, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3184, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3185, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3186, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3187, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3188, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3189, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3193, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3194, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3195, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3204, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3209, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3210, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3211, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3217, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3218, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3219, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3223, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3224, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3225, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3226, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3228, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3229, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3230, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3231, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3232, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3233, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3234, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3238, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3239, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3240, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3256, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3258, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3259, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3260, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3261, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3262, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3263, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3264, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3268, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3269, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3270, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
+ _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
+ _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3279, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \
+ _(3284, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3285, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3286, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3292, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3293, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3294, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3298, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3299, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3300, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3301, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3303, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3304, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3305, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3306, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3307, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3308, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3309, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3313, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3314, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3315, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3331, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \
+ _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3333, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3334, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3335, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3336, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3337, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3338, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3339, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3343, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \
+ _(3344, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3345, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3354, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \
+ _(3359, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \
+ _(3360, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \
+ _(3361, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3367, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3368, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3369, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3373, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3374, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3375, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3376, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3378, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3379, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3380, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3381, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3382, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3383, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3384, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3388, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3389, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3390, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3406, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \
+ _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \
+ _(3408, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \
+ _(3409, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3410, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3411, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3412, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3413, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3414, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3418, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \
+ _(3419, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
+ _(3420, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
+ _(3421, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \
+ _(3422, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \
+ _(3423, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \
+ _(3424, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \
+ _(3425, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \
+ _(3426, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \
+ _(3427, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \
+ _(3428, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \
+ _(3429, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \
+ _(3430, ZEND_POST_INC_LONG_SPEC_CV) \
+ _(3431, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \
+ _(3432, ZEND_POST_DEC_LONG_SPEC_CV) \
+ _(3433, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \
_(3434, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \
- _(3436, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \
- _(3437, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \
- _(3438, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \
+ _(3435, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \
+ _(3437, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \
+ _(3438, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \
_(3439, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \
- _(3441, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \
- _(3442, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \
- _(3443, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \
+ _(3440, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \
+ _(3442, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \
+ _(3443, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \
_(3444, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \
- _(3446, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \
- _(3448, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \
+ _(3445, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \
+ _(3447, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \
_(3449, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \
- _(3451, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \
- _(3452, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \
- _(3453, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3450, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \
+ _(3452, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \
+ _(3453, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \
_(3454, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
- _(3456, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
- _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \
- _(3458, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3455, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3458, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \
_(3459, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
- _(3461, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
- _(3467, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \
- _(3468, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \
+ _(3460, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3462, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \
+ _(3468, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \
_(3469, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \
- _(3471, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \
- _(3474, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \
- _(3476, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \
- _(3479, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \
- _(3481, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \
- _(3482, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \
- _(3483, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \
- _(3484, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \
- _(3485, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \
- _(3485+1, ZEND_NULL)
+ _(3470, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \
+ _(3472, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \
+ _(3475, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \
+ _(3477, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \
+ _(3480, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \
+ _(3482, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \
+ _(3483, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \
+ _(3484, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \
+ _(3485, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \
+ _(3486, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \
+ _(3486+1, ZEND_NULL)
diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c
index 202dfd3f734f3..00ad38baaafeb 100644
--- a/Zend/zend_vm_opcodes.c
+++ b/Zend/zend_vm_opcodes.c
@@ -22,7 +22,7 @@
#include
#include
-static const char *zend_vm_opcodes_names[210] = {
+static const char *zend_vm_opcodes_names[211] = {
"ZEND_NOP",
"ZEND_ADD",
"ZEND_SUB",
@@ -233,9 +233,10 @@ static const char *zend_vm_opcodes_names[210] = {
"ZEND_FRAMELESS_ICALL_3",
"ZEND_JMP_FRAMELESS",
"ZEND_INIT_PARENT_PROPERTY_HOOK_CALL",
+ "ZEND_DECLARE_ATTRIBUTED_CONST",
};
-static uint32_t zend_vm_opcodes_flags[210] = {
+static uint32_t zend_vm_opcodes_flags[211] = {
0x00000000,
0x00000b0b,
0x00000b0b,
@@ -299,8 +300,8 @@ static uint32_t zend_vm_opcodes_flags[210] = {
0x00000000,
0x01040310,
0x00000003,
- 0x00040110,
- 0x00040310,
+ 0x00000110,
+ 0x00000310,
0x00001307,
0x00001301,
0x00001301,
@@ -360,7 +361,7 @@ static uint32_t zend_vm_opcodes_flags[210] = {
0x00000007,
0x00040003,
0x09000007,
- 0x0000a103,
+ 0x00000103,
0x00002003,
0x03000001,
0x00000005,
@@ -400,7 +401,7 @@ static uint32_t zend_vm_opcodes_flags[210] = {
0x00000003,
0x00000020,
0x00003000,
- 0x00040110,
+ 0x00000110,
0x00000000,
0x00000007,
0x00000105,
@@ -446,6 +447,7 @@ static uint32_t zend_vm_opcodes_flags[210] = {
0x00000000,
0x01042003,
0x01001103,
+ 0x00000303,
};
ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode) {
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index d472b5b9660f5..29469bb5f7dca 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -21,6 +21,8 @@
#ifndef ZEND_VM_OPCODES_H
#define ZEND_VM_OPCODES_H
+#include "Zend/zend_portability.h"
+
#define ZEND_VM_SPEC 1
#define ZEND_VM_LINES 0
#define ZEND_VM_KIND_CALL 1
@@ -291,7 +293,8 @@ END_EXTERN_C()
#define ZEND_FRAMELESS_ICALL_3 207
#define ZEND_JMP_FRAMELESS 208
#define ZEND_INIT_PARENT_PROPERTY_HOOK_CALL 209
+#define ZEND_DECLARE_ATTRIBUTED_CONST 210
-#define ZEND_VM_LAST_OPCODE 209
+#define ZEND_VM_LAST_OPCODE 210
#endif
diff --git a/build/gen_stub.php b/build/gen_stub.php
index e69846733a9d9..1919d2e702a27 100755
--- a/build/gen_stub.php
+++ b/build/gen_stub.php
@@ -1390,7 +1390,13 @@ public function getFunctionEntry(): string {
$name = "zim_" . $this->name->getDeclarationClassName() . "_" . $this->name->methodName;
if ($isVanillaEntry) {
- $functionEntryCode = "\tZEND_ME(" . $this->name->getDeclarationClassName() . ", " . $this->name->methodName . ", $argInfoName, " . implode("|", reset($flagsByPhpVersions)) . ")";
+ $template = "\tZEND_ME(" . $this->name->getDeclarationClassName() . ", " . $this->name->methodName . ", $argInfoName, %s)\n";
+ $flagsCode = generateVersionDependentFlagCode(
+ $template,
+ $flagsByPhpVersions,
+ $this->minimumPhpVersionIdCompatibility
+ );
+ $functionEntryCode = rtrim(implode("", $flagsCode));
}
}
}
@@ -1406,7 +1412,15 @@ public function getFunctionEntry(): string {
$zendName = '"' . $functionName . '"';
$name = "zif_$declarationName";
- if ($isVanillaEntry && reset($flagsByPhpVersions) === ["0"]) {
+ // Can only use ZEND_FE() if we have no flags for *all* versions
+ $hasFlags = false;
+ foreach ($flagsByPhpVersions as $flags) {
+ if ($flags !== ['0']) {
+ $hasFlags = true;
+ break;
+ }
+ }
+ if ($isVanillaEntry && !$hasFlags) {
$functionEntryCode = "\tZEND_FE($declarationName, $argInfoName)";
}
}
@@ -1523,9 +1537,6 @@ private function getArginfoFlagsByPhpVersions(): array
case "Deprecated":
$flags[] = "ZEND_ACC_DEPRECATED";
break;
- case "NoDiscard":
- $flags[] = "ZEND_ACC_NODISCARD";
- break;
}
}
@@ -1534,12 +1545,24 @@ private function getArginfoFlagsByPhpVersions(): array
$php82AndAboveFlags[] = "ZEND_ACC_COMPILE_TIME_EVAL";
}
+ $php85AndAboveFlags = $php82AndAboveFlags;
+ foreach ($this->attributes as $attr) {
+ switch ($attr->class) {
+ case "NoDiscard":
+ $php85AndAboveFlags[] = "ZEND_ACC_NODISCARD";
+ break;
+ }
+ }
+
if (empty($flags)) {
$flags[] = "0";
}
if (empty($php82AndAboveFlags)) {
$php82AndAboveFlags[] = "0";
}
+ if (empty($php85AndAboveFlags)) {
+ $php85AndAboveFlags[] = "0";
+ }
return [
PHP_70_VERSION_ID => $flags,
@@ -1548,7 +1571,7 @@ private function getArginfoFlagsByPhpVersions(): array
PHP_82_VERSION_ID => $php82AndAboveFlags,
PHP_83_VERSION_ID => $php82AndAboveFlags,
PHP_84_VERSION_ID => $php82AndAboveFlags,
- PHP_85_VERSION_ID => $php82AndAboveFlags,
+ PHP_85_VERSION_ID => $php85AndAboveFlags,
];
}
@@ -2174,7 +2197,7 @@ public function enterNode(Node $expr)
static function (Expr $expr) use ($allConstInfos, &$isUnknownConstValue) {
// $expr is a ConstFetch with a name of a C macro here
if (!$expr instanceof Expr\ConstFetch) {
- throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsupported value");
+ throw new Exception("Expression at line " . $expr->getStartLine() . " must be a global, non-magic constant");
}
$constName = $expr->name->__toString();
diff --git a/docs/release-process.md b/docs/release-process.md
index 36963b4318ead..5d603a22f078e 100644
--- a/docs/release-process.md
+++ b/docs/release-process.md
@@ -6,6 +6,7 @@ repository available according to the release schedule.
The release schedule for each version is published on the
[PHP wiki](https://wiki.php.net):
+- [PHP 8.4](https://wiki.php.net/todo/php84)
- [PHP 8.3](https://wiki.php.net/todo/php83)
- [PHP 8.2](https://wiki.php.net/todo/php82)
- [PHP 8.1](https://wiki.php.net/todo/php81)
@@ -73,7 +74,7 @@ releases.
> When you are unsure about anything, ask a previous RM before proceeding.
> Ideally, make sure a previous RM is available to answer questions during
> the first few releases of your version. For the steps related to the
- > `web-php`, `web-qa`, and `web-php-distributions` repositories, try to have
+ > `web-php` and `web-php-distributions` repositories, try to have
> someone from the webmaster team on hand.
5. Verify the tags to be extra sure everything was tagged properly.
@@ -325,7 +326,7 @@ slightly different steps. We'll call attention where the steps differ.
downloads.php.net.
```shell
- scp php-X.Y.ZRCn.tar.* downloads.php.net:~/public_html/
+ scp php-X.Y.ZRCn.tar.* downloads.internal.php.net:~/public_html/
```
> 💬 **Hint** \
@@ -359,11 +360,10 @@ slightly different steps. We'll call attention where the steps differ.
## Announcing a non-stable release (alpha/beta/RC)
-1. Switch to your local clone of the `web-qa` repository and update the
+1. Switch to your local clone of the `web-php` repository and update the
information in the `$QA_RELEASES` array in `include/release-qa.php`.
Follow the documentation in the file for editing the QA release information.
- See also [Announce 8.1.0RC3][] and [8.1.6RC1][] for examples.
Add, commit, and push your changes, when finished.
@@ -716,20 +716,7 @@ slightly different steps. We'll call attention where the steps differ.
```shell
./bin/news2html 'https://github.com/php/php-src/raw/php-X.Y.Z/NEWS' 'X.Y.Z' 'ChangeLog-X.php'
```
-
-9. Review all the changes in `web-php`, commit, and push them.
-
- ```shell
- git add -p
- git add archive/entries/*.xml releases/*.php
- git commit --gpg-sign=YOURKEYID -m "Announce PHP X.Y.Z"
- git push upstream master
- ```
-
- See [Announce PHP 8.1.6][] for an example commit.
-
-10. Switch to your local clone of the `web-qa` repository and update the
- information in the `$QA_RELEASES` array in `include/release-qa.php`.
+8. Update the information in the `$QA_RELEASES` array in `include/release-qa.php`.
The array probably contains information about the RC released two weeks ago
in preparation for the current release. Since the current release is now GA,
@@ -737,18 +724,20 @@ slightly different steps. We'll call attention where the steps differ.
It is sufficient to set the `number` property for the release to `0` to
stop displaying the RC build on the QA website. You may also remove the
- sha256 hashes for the RC tarballs, but it's not necessary. For an example,
- see [PHP 8.1.6 released][].
+ sha256 hashes for the RC tarballs, but it's not necessary.
- Add, commit, and push your changes, when finished.
+9. Review all the changes in `web-php`, commit, and push them.
```shell
git add -p
- git commit --gpg-sign=YOURKEYID -m "PHP X.Y.Z released"
+ git add archive/entries/*.xml releases/*.php
+ git commit --gpg-sign=YOURKEYID -m "Announce PHP X.Y.Z"
git push upstream master
```
-11. 🚨 **Before sending announcement emails, check to make sure the websites have
+ See [Announce PHP 8.1.6][] for an example commit.
+
+10. 🚨 **Before sending announcement emails, check to make sure the websites have
synced.**
* Make sure the tarballs are available from, e.g.,
@@ -760,8 +749,8 @@ slightly different steps. We'll call attention where the steps differ.
e.g., https://www.php.net/ChangeLog-8.php
* Is there a release page for the new version?
e.g., `https://www.php.net/releases/X_Y_Z.php`
- * Does the RC for this version still appear on the QA home page?
- https://qa.php.net
+ * Does the RC for this version still appear on the Release Candidate Builds page?
+ https://www.php.net/release-candidates.php
Keep in mind it may take up to an hour for the websites to sync.
@@ -986,21 +975,22 @@ volunteers to begin the selection process for the next release managers.
## New release manager checklist
-1. Request membership to the
+1. Fill out [the form](https://www.php.net/git-php.php)
+ to get a PHP account (if you don't already have one).
+
+2. Request membership to the
[release managers group](https://github.com/orgs/php/teams/release-managers) on GitHub.
-2. Subscribe to the php-announce@lists.php.net mailing list by emailing
+3. Subscribe to the php-announce@lists.php.net mailing list by emailing
php-announce+subscribe@lists.php.net
-3. Email systems@php.net to get setup for access to downloads.php.net, to be
+4. Email systems@php.net to get setup for access to downloads.php.net, to be
added to the release-managers@php.net distribution list, and to be added to
the moderators for php-announce@lists.php.net so you are able to moderate
your release announcements.
Provide the following information in a single email:
- - Preferred Unix username (will also become part of location to download RCs,
- such as `https://downloads.php.net/~derick/`).
- An SSH public key, preferably a new unique one for PHP systems and
projects.
- Read [Machine Access](https://wiki.php.net/systems#machine_access) to set
@@ -1021,7 +1011,7 @@ volunteers to begin the selection process for the next release managers.
> "[Send emails from a different address or alias][]."
-4. Create a [GPG key][] for your @php.net address.
+5. Create a [GPG key][] for your @php.net address.
> 💡 **Tip** \
> If you're new to GPG, follow GitHub's instructions for
@@ -1086,11 +1076,10 @@ volunteers to begin the selection process for the next release managers.
git push
```
-5. Make sure you have the following repositories cloned locally:
+6. Make sure you have the following repositories cloned locally:
* https://github.com/php/php-src
* https://github.com/php/web-php
- * https://github.com/php/web-qa
* https://github.com/php/web-php-distributions
@@ -1105,13 +1094,10 @@ volunteers to begin the selection process for the next release managers.
[Update NEWS for PHP 8.2.0RC6]: https://github.com/php/php-src/commit/4ccc414961a70200d638ca281a35f893226d74e2
[PHP 8.3 is now for PHP 8.3.21-dev]: https://github.com/php/php-src/commit/b57f425cfe20a11003253427424cc0517483550b
[GitHub command line tool]: https://cli.github.com
-[Announce 8.1.0RC3]: https://github.com/php/web-qa/commit/f264b711fd3827803b79bbb342959eae57ea502b
-[8.1.6RC1]: https://github.com/php/web-qa/commit/e6d61ad7a9d8be0b1cd159af29f3b9cbdde33384
[merged upwards as usual]: https://wiki.php.net/vcs/gitworkflow
[Update versions for PHP 8.1.7]: https://github.com/php/php-src/commit/d35e577a1bd0b35b9386cea97cddc73fd98eed6d
[Update NEWS for PHP 8.1.7]: https://github.com/php/php-src/commit/b241f07f52ca9f87bf52be81817f475e6e727439
[Announce PHP 8.1.6]: https://github.com/php/web-php/commit/9f796a96c65f07e45845ec248933bfb0010b94a9
-[PHP 8.1.6 released]: https://github.com/php/web-qa/commit/bff725f8373cf6fd9d97ba62a8517b19721a4c2e
[feature freeze]: https://en.wikipedia.org/wiki/Freeze_(software_engineering)
[Prepare for PHP 8.2]: https://github.com/php/php-src/commit/1c33ddb5e5598c5385c4c965992c6e031fd00dd6
[Prepare for PHP 8.2 (bis)]: https://github.com/php/php-src/commit/a93e12f8a6dfc23e334339317c97aa35356db821
diff --git a/docs/source/_static/css/code-no-font-ligatures.css b/docs/source/_static/css/code-no-font-ligatures.css
new file mode 100644
index 0000000000000..1ae51476f013e
--- /dev/null
+++ b/docs/source/_static/css/code-no-font-ligatures.css
@@ -0,0 +1,3 @@
+code {
+ font-variant-ligatures: none;
+}
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 1129eb08a8216..f28102206a9fa 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -16,10 +16,12 @@
author = 'The PHP Group'
extensions = [
'sphinx_design',
+ 'sphinx.ext.autosectionlabel',
]
templates_path = ['_templates']
html_theme = 'sphinxawesome_theme'
html_static_path = ['_static']
+html_css_files = ['css/code-no-font-ligatures.css']
html_title = project
html_permalinks_icon = Icons.permalinks_icon
theme_options = ThemeOptions(
diff --git a/docs/source/core/data-structures/zend_constant.rst b/docs/source/core/data-structures/zend_constant.rst
index a4245d6e3c13f..a5e85dc78638c 100644
--- a/docs/source/core/data-structures/zend_constant.rst
+++ b/docs/source/core/data-structures/zend_constant.rst
@@ -15,10 +15,12 @@ PHP constants (referring to non-class constants) are stored in a dedicated struc
zval value;
zend_string *name;
zend_string *filename;
+ HashTable *attributes;
} zend_constant;
The ``value`` field stores both the value itself and some metadata. The ``name`` and ``filename``
-store the name of the constant and the name of the file in which it was defined.
+store the name of the constant and the name of the file in which it was defined. The ``attributes``
+field stores the attributes applied to the constant.
*******
value
@@ -59,6 +61,15 @@ constants that have already been defined. This string is released when the const
filename
**********
-Finally, the ``filename`` holds another ``zend_string`` with the name of the file in which the
-constant was defined, or ``NULL`` if not defined userland code. This field provides the foundation
-for the PHP method ``ReflectionConstant::getFileName()``.
+The ``filename`` holds another ``zend_string`` with the name of the file in which the constant was
+defined, or ``NULL`` if not defined userland code. This field provides the foundation for the PHP
+method ``ReflectionConstant::getFileName()``.
+
+************
+ attributes
+************
+
+The ``attributes`` holds a ``HashTable`` (essentially an array) with the details of the attributes
+that were applied to the constant. Note that attributes can only be added to constants declared at
+compile time via ``const``, e.g. ``const EXAMPLE = 123``, not those declared at runtime, e.g.
+``define( 'EXAMPLE', 123 );``.
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 53178820892a6..21e2526f47f64 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -20,6 +20,8 @@
:hidden:
miscellaneous/stubs
+ miscellaneous/writing-tests
+ miscellaneous/running-tests
Welcome to the php-src documentation!
diff --git a/docs/source/miscellaneous/running-tests.rst b/docs/source/miscellaneous/running-tests.rst
new file mode 100644
index 0000000000000..c85e9f4c24dea
--- /dev/null
+++ b/docs/source/miscellaneous/running-tests.rst
@@ -0,0 +1,160 @@
+###############
+ Running Tests
+###############
+
+The easiest way to test your PHP build is to run make test from the command line after successfully
+compiling. This will run the all tests for all enabled functionalities and extensions located in
+tests folders under the source root directory using the PHP CLI binary.
+
+``make test`` executes the ``run-tests.php`` script under the source root (parallel builds will not
+work). Therefore you can execute the script as follows:
+
+.. code:: shell
+
+ TEST_PHP_EXECUTABLE=sapi/cli/php \
+ sapi/cli/php [-c /path/to/php.ini] run-tests.php [ext/foo/tests/GLOB]
+
+******************************************
+ Which php executable does make test use?
+******************************************
+
+If you are running the ``run-tests.php`` script from the command line (as above) you must set the
+``TEST_PHP_EXECUTABLE`` environment variable to explicitly select the PHP executable that is to be
+tested, that is, used to run the test scripts.
+
+If you run the tests using make test, the PHP CLI and CGI executables are automatically set for you.
+``make test`` executes ``run-tests.php`` script with the CLI binary. Some test scripts such as
+session must be executed by CGI SAPI. Therefore, you must build PHP with CGI SAPI to perform all
+tests.
+
+**Note:** The PHP binary executing ``run-tests.php`` and the PHP binary used for executing test
+scripts may differ. If you use different PHP binary for executing ``run-tests.php`` script, you may
+get errors.
+
+************************
+ Which php.ini is used?
+************************
+
+``make test`` uses the same ``php.ini`` file as it would once installed. The tests have been written
+to be independent of that ``php.ini`` file, so if you find a test that is affected by a setting,
+please report this, so we can address the issue.
+
+**********************************
+ Which test scripts are executed?
+**********************************
+
+The ``run-tests.php`` (``make test``), without any arguments executes all test scripts by extracting
+all directories named tests from the source root and any subdirectories below. If there are files,
+which have a phpt extension, ``run-tests.php`` looks at the sections in these files, determines
+whether it should run it, by evaluating the ``SKIPIF`` section. If the test is eligible for
+execution, the ``FILE`` section is extracted into a ``.php`` file (with the same name besides the
+extension) and gets executed. When an argument is given or ``TESTS`` environment variable is set,
+the GLOB is expanded by the shell and any file with extension ``*.phpt`` is regarded as a test file.
+
+Tester can easily execute tests selectively with as follows:
+
+.. code:: shell
+
+ ./sapi/cli/php run-tests.php ext/mbstring/*
+ ./sapi/cli/php run-tests.php ext/mbstring/020.phpt
+
+**************
+ Test results
+**************
+
+Test results are printed to standard output. If there is a failed test, the ``run-tests.php`` script
+saves the result, the expected result and the code executed to the test script directory. For
+example, if ``ext/myext/tests/myext.phpt`` fails to pass, the following files are created:
+
+- ``ext/myext/tests/myext.php`` - actual test file executed
+- ``ext/myext/tests/myext.log`` - log of test execution (L)
+- ``ext/myext/tests/myext.exp`` - expected output (E)
+- ``ext/myext/tests/myext.out`` - output from test script (O)
+- ``ext/myext/tests/myext.diff`` - diff of .out and .exp (D)
+
+Failed tests are always bugs. Either the test is bugged or not considering factors applying to the
+tester's environment, or there is a bug in PHP. If this is a known bug, we strive to provide bug
+numbers, in either the test name or the file name. You can check the status of such a bug, by going
+to: ``https://bugs.php.net/12345`` where 12345 is the bug number. For clarity and automated
+processing, bug numbers are prefixed by a hash sign '#' in test names and/or test cases are named
+``bug12345.phpt``.
+
+**Note:** The files generated by tests can be selected by setting the environment variable
+``TEST_PHP_LOG_FORMAT``. For each file you want to be generated use the character in brackets as
+shown above (default is LEOD). The php file will be generated always.
+
+**Note**: You can set environment variable ``TEST_PHP_DETAILED`` to enable detailed test
+information.
+
+*******************
+ Automated testing
+*******************
+
+If you like to keep up to speed, with latest developments and quality assurance, setting the
+environment variable ``NO_INTERACTION`` to 1, will not prompt the tester for any user input.
+
+Normally, the exit status of make test is zero, regardless of the results of independent tests. Set
+the environment variable ``REPORT_EXIT_STATUS`` to ``1``, and make test will set the exit status
+("$?") to non-zero, when an individual test has failed.
+
+Example script to be run by cron:
+
+.. code:: shell
+
+ ========== qa-test.sh =============
+ #!/bin/sh
+
+ CO_DIR=$HOME/cvs/php7
+ MYMAIL=qa-test@domain.com
+ TMPDIR=/var/tmp
+ TODAY=`date +"%Y%m%d"`
+
+ # Make sure compilation environment is correct
+ CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
+ export MAKE=gmake
+ export CC=gcc
+
+ # Set test environment
+ export NO_INTERACTION=1
+ export REPORT_EXIT_STATUS=1
+
+ cd $CO_DIR
+ cvs update . >>$TMPDIR/phpqatest.$TODAY
+ ./cvsclean ; ./buildconf ; ./configure $CONFIGURE_OPTS ; $MAKE
+ $MAKE test >>$TMPDIR/phpqatest.$TODAY 2>&1
+ if test $? -gt 0
+ then
+ cat $TMPDIR/phpqatest.$TODAY | mail -s"PHP-QA Test Failed for $TODAY" $MYMAIL
+ fi
+ ========== end of qa-test.sh =============
+
+**Note:** The exit status of ``run-tests.php`` will be ``1`` when ``REPORT_EXIT_STATUS`` is set. The
+result of make test may be higher than that. At present, gmake 3.79.1 returns 2, so it is advised to
+test for non-zero, rather then a specific value.
+
+When ``make test`` finished running tests, and if there are any failed tests, the script asks to
+send the logs to the PHP QA mailing list. Please answer ``y`` to this question so that we can
+efficiently process the results, entering your e-mail address (which will not be transmitted in
+plain text to any list) enables us to ask you some more information if a test failed. Note that this
+script also uploads php -i output so your hostname may be transmitted.
+
+Specific tests can also be executed, like running tests for a certain extension. To do this you can
+do like so (for example the standard library):
+
+.. code:: shell
+
+ make test TESTS=ext/standard.
+
+Where ``TESTS=`` points to a directory containing .phpt files or a single .phpt file like:
+
+.. code:: shell
+
+ make test TESTS=tests/basic/001.phpt.
+
+You can also pass options directly to the underlying script that runs the test suite
+(``run-tests.phpt``) using ``TESTS=``, for example to check for memory leaks using Valgrind, the
+``-m`` option can be passed along: ``make test TESTS="-m Zend/"``. For a full list of options that
+can be passed along, then run ``make test TESTS=-h``.
+
+*Windows users:* On Windows the ``make`` command is called ``nmake`` instead of ``make``. This means
+that on Windows you will have to run ``nmake test``, to run the test suite.
diff --git a/docs/source/miscellaneous/writing-tests.rst b/docs/source/miscellaneous/writing-tests.rst
new file mode 100644
index 0000000000000..fd09d80f1275e
--- /dev/null
+++ b/docs/source/miscellaneous/writing-tests.rst
@@ -0,0 +1,2868 @@
+###############
+ Writing Tests
+###############
+
+******************
+ phpt Test Basics
+******************
+
+The first thing you need to know about tests is that we need more!!! Although PHP works just great
+99.99% of the time, not having a very comprehensive test suite means that we take more risks every
+time we add to or modify the PHP implementation. The second thing you need to know is that if you
+can write PHP you can write tests. Thirdly — we are a friendly and welcoming community, don't be
+scared about writing to (php-qa@lists.php.net) — we won't bite!
+
+So what are phpt tests?
+
+ A phpt test is a little script used by the php internal and quality assurance teams to test PHP's
+ functionality. It can be used with new releases to make sure they can do all the things that
+ previous releases can, or to help find bugs in current releases. By writing phpt tests you are
+ helping to make PHP more stable.
+
+What skills are needed to write a phpt test?
+
+ All that is really needed to write a phpt test is a basic understanding of the PHP language, a
+ text editor, and a way to get the results of your code. That is it. So if you have been writing
+ and running PHP scripts already — you have everything you need.
+
+What do you write phpt tests on?
+
+ Basically you can write a phpt test on one of the various php functions available. You can write
+ a test on a basic language function (a string function or an array function) , or a function
+ provided by one of PHP's numerous extensions (a mysql function or a image function or a mcrypt
+ function).
+
+ You can find out what functions already have phpt tests by looking in the `html version
+ `_ of the git repository (``ext/standard/tests/`` is a good place
+ to start looking — though not all the tests currently written are in there).
+
+ If you want more guidance than that you can always ask the PHP Quality Assurance Team on their
+ mailing list (php-qa@lists.php.net) where they would like you to direct your attentions.
+
+How is a phpt test is used?
+
+ When a test is called by the ``run-tests.php`` script it takes various parts of the phpt file to
+ name and create a .php file. That .php file is then executed. The output of the .php file is then
+ compared to a different section of the phpt file. If the output of the script "matches" the
+ output provided in the phpt script — it passes.
+
+What should a phpt test do?
+
+ Basically — it should try and break the PHP function. It should check not only the functions
+ normal parameters, but it should also check edge cases. Intentionally generating an error is
+ allowed and encouraged.
+
+********************
+ Writing phpt Tests
+********************
+
+Naming Conventions
+==================
+
+Phpt tests follow a very strict naming convention. This is done to easily identify what each phpt
+test is for. Tests should be named according to the following list:
+
+Tests for bugs
+ bug.phpt (bug17123.phpt)
+
+Tests for a function's basic behaviour
+ _basic.phpt (dba_open_basic.phpt)
+
+Tests for a function's error behaviour
+ _error.phpt (dba_open_error.phpt)
+
+Tests for variations in a function's behaviour
+ _variation.phpt (dba_open_variation.phpt)
+
+General tests for extensions
+ .phpt (dba_003.phpt)
+
+The convention of using _basic, _error and _variation was introduced when we found that writing a
+single test case for each function resulted in unacceptably large test cases. It's quite hard to
+debug problems when the test case generates 100s of lines of output.
+
+The "basic" test case for a function should just address the single most simple thing that the
+function is designed to do. For example, if writing a test for the sin() function a basic test would
+just be to check that sin() returns the correct values for some known angles — eg 30, 90, 180.
+
+The "error" tests for a function are test cases which are designed to provoke errors, warnings or
+notices. There can be more than one error case, if so the convention is to name the test cases
+mytest_error1.phpt, mytest_error2.phpt and so on.
+
+The "variation" tests are any tests that don't fit into "basic" or "error" tests. For example one
+might use a variation tests to test boundary conditions.
+
+How big is a test case?
+=======================
+
+Small. Really — the smaller the better, a good guide is no more than 10 lines of output. The reason
+for this is that if we break something in PHP and it breaks your test case we need to be able to
+find out quite quickly what we broke, going through 1000s of line of test case output is not easy.
+Having said that it's sometimes just not practical to stay within the 10 line guideline, in this
+case you can help a lot by commenting the output. You may find plenty of much longer tests in PHP -
+the small tests message is something that we learnt over time, in fact we are slowly going through
+and splitting tests up when we need to.
+
+Comments
+========
+
+Comments help. Not an essay — just a couple of lines on what the objective of the test is. It may
+seem completely obvious to you as you write it, but it might not be to someone looking at it later
+on.
+
+Basic Format
+============
+
+A test must contain the sections TEST, FILE and either EXPECT or EXPECTF at a minimum. The example
+below illustrates a minimal test.
+
+*ext/standard/tests/strings/strtr.phpt*
+
+.. code:: php
+
+ --TEST--
+ strtr() function — basic test for strtr()
+ --FILE--
+ "hi", "hi"=>"hello", "a"=>"A", "world"=>"planet");
+ var_dump(strtr("# hi all, I said hello world! #", $trans));
+ ?>
+ --EXPECT--
+ string(32) "# hello All, I sAid hi planet! #"
+
+As you can see the file is divided into several sections. The TEST section holds a one line title of
+the phpt test, this should be a simple description and shouldn't ever excede one line, if you need
+to write more explanation add comments in the body of the test case. The phpt files name is used
+when generating a .php file. The FILE section is used as the body of the .php file, so don't forget
+to open and close your php tags. The EXPECT section is the part used as a comparison to see if the
+test passes. It is a good idea to generate output with var_dump() calls.
+
+PHPT structure details
+======================
+
+A phpt test can have many more parts than just the minimum. In fact some of the mandatory parts have
+alternatives that may be used if the situation warrants it. The phpt sections are documented here.
+
+Analyzing failing tests
+=======================
+
+While writing tests you will probably run into tests not passing while you think they should. The
+'make test' command provides you with debug information. Several files will be added per test in the
+same directory as the .phpt file itself. Considering your test file is named foo.phpt, these files
+provide you with information that can help you find out what went wrong:
+
+foo.diff
+
+ A diff file between the expected output (be it in EXPECT, EXPECTF or another option) and the
+ actual output.
+
+foo.exp
+
+ The expected output.
+
+foo.log
+
+ A log containing expected output, actual output and results. Most likely very similar to info in
+ the other files.
+
+foo.out
+
+ The actual output of your .phpt test part.
+
+foo.php
+
+ The php code that was executed for this test.
+
+foo.sh
+
+ An executable file that executes the test for you as it was executed during failure.
+
+Testing your test cases
+=======================
+
+Most people who write tests for PHP don't have access to a huge number of operating systems but the
+tests are run on every system that runs PHP. It's good to test your test on as many platforms as you
+can — Linux and Windows are the most important, it's increasingly important to make sure that tests
+run on 64 bit as well as 32 bit platforms. If you only have access to one operating system — don't
+worry, if you have karma, commit the test but watch php-qa@lists.php.net for reports of failures on
+other platforms. If you don't have karma to commit have a look at the next section.
+
+When you are testing your test case it's really important to make sure that you clean up any
+temporary resources (eg files) that you used in the test. There is a special ``--CLEAN--`` section
+to help you do this — see `here <#clean>`_.
+
+Another good check is to look at what lines of code in the PHP source your test case covers. This is
+easy to do, there are some instructions on the `PHP Wiki
+`_.
+
+What should I do with my test case when I've written and tested it?
+===================================================================
+
+The next step is to get someone to review it. If it's short you can paste it into a note and send it
+to php-qa@lists.php.net. If the test is a bit too long for that then put it somewhere were people
+can download it (`pastebin `_ is sometimes used). Appending tests to notes as
+files doesn't work well - so please don't do that. Your note to php-qa@lists.php.net should say what
+level of PHP you have tested it on and what platform(s) you've run it on. Someone from the PHP QA
+group will review your test and reply to you. They may ask for some changes or suggest better ways
+to do things, or they may commit it to PHP.
+
+Writing Portable PHP Tests
+==========================
+
+Writing portable tests can be hard if you don't have access to all the many platforms that PHP can
+run on. Do your best. If in doubt, don't disable a test. It is better that the test runs in as many
+environments as possible.
+
+If you know a new test won't run in a specific environment, try to write the complementary test for
+that environment.
+
+Make sure sets of data are consistently ordered. SQL queries are not guaranteed to return results in
+the same order unless an ORDER BY clause is used. Directory listings are another example that can
+vary: use an appropriate PHP function to sort them before printing. Both of these examples have
+affected PHP tests in the past.
+
+Make sure that any test touching parsing or display of dates uses a hard-defined timezone —
+preferable 'UTC'. It is important that this is defined in the file section using:
+
+.. code:: php
+
+ date_default_timezone_set('UTC');
+
+and not in the INI section. This is because of the order in which settings are checked which is:
+
+.. code::
+
+ date_default_timezone_set() -> TZ environmental -> INI setting -> System Setting
+
+If a TZ environmental varaibale is found the INI setting will be ignored.
+
+Tests that run, or only have have matching EXPECT output, on 32bit platforms can use a SKIPIF
+section like:
+
+.. code:: php
+
+ --SKIPIF--
+
+
+Tests for 64bit platforms can use:
+
+.. code:: php
+
+ --SKIPIF--
+
+
+To run a test only on Windows:
+
+.. code:: php
+
+ --SKIPIF--
+
+
+To run a test only on Linux:
+
+.. code:: php
+
+ --SKIPIF--
+
+
+To skip a test on Mac OS X Darwin:
+
+.. code:: php
+
+ --SKIPIF--
+
+
+**********
+ Examples
+**********
+
+EXPECTF
+=======
+
+``/ext/standard/tests/strings/str_shuffle.phpt`` is a good example for using ``EXPECTF`` instead of
+``EXPECT``. From time to time the algorithm used for shuffle changed and sometimes the machine used
+to execute the code has influence on the result of shuffle. But it always returns a three character
+string detectable by ``%s`` (that matches any string until the end of the line). Other scan-able
+forms are ``%a`` for any amount of chars (at least one), ``%i`` for integers, ``%d`` for numbers
+only, ``%f`` for floating point values, ``%c`` for single characters, ``%x`` for hexadecimal values,
+``%w`` for any number of whitespace characters and ``%e`` for ``DIRECTORY_SEPARATOR`` (``'\'`` or
+``'/'``).
+
+See also `EXPECTF <#expectf>`_ details.
+
+*/ext/standard/tests/strings/str_shuffle.phpt*
+
+.. code:: php
+
+ --TEST--
+ Testing str_shuffle.
+ --FILE--
+
+ --EXPECTF--
+ string(3) "%s"
+ string(3) "123"
+
+EXPECTREGEX
+===========
+
+``/ext/standard/tests/strings/strings001.phpt`` is a good example for using ``EXPECTREGEX`` instead
+of ``EXPECT``. This test also shows that in ``EXPECTREGEX`` some characters need to be escaped since
+otherwise they would be interpreted as a regular expression.
+
+*/ext/standard/tests/strings/strings001.phpt*
+
+.. code:: php
+
+ --TEST--
+ Test whether strstr() and strrchr() are binary safe.
+ --FILE--
+
+ --EXPECTREGEX--
+ string\(18\) \"nica\x00turska panica\"
+ string\(19\) \" nica\x00turska panica\"
+
+EXTENSIONS
+==========
+
+Some tests depend on PHP extensions that may be unavailable. These extensions should be listed in
+the ``EXTENSIONS`` section. If an extension is missing, PHP will try to find it in a shared module
+and skip the test if it's not there.
+
+*/ext/sodium/tests/crypto_scalarmult.phpt*
+
+.. code:: php
+
+ --TEST--
+ Check for libsodium scalarmult
+ --EXTENSIONS--
+ sodium
+ --FILE--
+
+ --FILE--
+ [snip]
+
+Test script and ``SKIPIF`` code should be directly written into ``\*.phpt``. However, it is
+recommended to use include files when more test scripts depend on the same ``SKIPIF`` code or when
+certain test files need the same values for some input.
+
+Note: no file used by any test should have one of the following extensions: ".php", ".log", ".mem",
+".exp", ".out" or ".diff". When you use an include file for the ``SKIPIF`` section it should be
+named "skipif.inc" and an include file used in the ``FILE`` section of many tests should be named
+"test.inc".
+
+*************
+ Final Notes
+*************
+
+Cleaning up after running a test
+================================
+
+Sometimes test cases create files or directories as part of the test case and it's important to
+remove these after the test ends, the ``--CLEAN--`` section is provided to help with this.
+
+The PHP code in the ``--CLEAN--`` section is executed separately from the code in the ``--FILE--``
+section. For example, this code:
+
+.. code:: php
+
+ --TEST--
+ Will fail to clean up
+ --FILE--
+
+ --CLEAN--
+
+ --EXPECT--
+
+will not remove the temporary file because the variable $temp_filename is not defined in the
+``--CLEAN--`` section.
+
+Here is a better way to write the code:
+
+.. code:: php
+
+ --TEST--
+ This will remove temporary files
+ --FILE--
+
+ --CLEAN--
+
+ --EXPECT--
+
+Note the use of the ``__DIR__`` construct which will ensure that the temporary file is created in
+the same directory as the phpt test script.
+
+When creating temporary files it is a good idea to use an extension that indicates the use of the
+file, eg .tmp. It's also a good idea to avoid using extensions that are already used for other
+purposes, eg .inc, .php. Similarly, it is helpful to give the temporary file a name that is clearly
+related to the test case. For example, mytest.phpt should create mytest.tmp (or mytestN.tmp, N=1,
+2,3,...) then if by any chance the temporary file isnt't removed properly it will be obvious which
+test case created it.
+
+When writing and debugging a test case with a ``--CLEAN--`` section it is helpful to remember that
+the php code in the ``--CLEAN--`` section is executed separately from the code in the ``--FILE--``
+section. For example, in a test case called mytest.phpt, code from the ``--FILE--`` section is run
+from a file called mytest.php and code from the ``--CLEAN--`` section is run from a file called
+mytest.clean.php. If the test passes, both the .php and .clean.php files are removed by
+``run-tests.php``. You can prevent the removal by using the --keep option of ``run-tests.php``, this
+is a very useful option if you need to check that the ``--CLEAN--`` section code is working as you
+intended.
+
+Finally — if you are using CVS it's helpful to add the extension that you use for test-related
+temporary files to the .cvsignore file — this will help to prevent you from accidentally checking
+temporary files into CVS.
+
+Redirecting tests
+=================
+
+Using ``--REDIRECTTEST--`` it is possible to redirect from one test to a bunch of other tests. That
+way multiple extensions can refer to the same set of test scripts probably using it with a different
+configuration.
+
+The block is eval'd and supposed to return an array describing how to redirect. The resulting array
+must contain the key 'TEST' that stores the redirect target as a string. This string usually is the
+directory where the test scripts are located and should be relative. Optionally you can use the
+'ENV' as an array configuring the environment to be set when executing the tests. This way you can
+pass configuration to the executed tests.
+
+Redirect tests may especially contain ``--SKIPIF--``, ``--ENV--``, and ``--ARGS--`` sections but
+they no not use any ``--EXPECT--`` section.
+
+The redirected tests themselves are just normal tests.
+
+Error reporting in tests
+========================
+
+All tests should run correctly with error_reporting(E_ALL) and display_errors=1. This is the default
+when called from ``run-tests.php``. If you have a good reason for lowering the error reporting, use
+``--INI--`` section and comment this in your testcode.
+
+If your test intentionally generates a PHP warning message use $php_errormsg variable, which you can
+then output. This will result in a consistent error message output across all platforms and PHP
+configurations, preventing your test from failing due inconsistencies in the error message content.
+Alternatively you can use ``--EXPECTF--`` and check for the message by replacing the path of the
+source of the message with ``%s`` and the line number with ``%d``. The end of a message in a test
+file ``example.phpt`` then looks like ``in %sexample.php on line %d``. We explicitly dropped the
+last path divider as that is a system dependent character ``/`` or ``\``.
+
+Last bit
+========
+
+Often you want to run test scripts without ``run-tests.php`` by executing them on command line like
+any other php script. But sometimes it disturbs having a long ``--EXPECT--`` block, so that you
+don't see the actual output as it scrolls away overwritten by the blocks following the actual file
+block. The workaround is to use terminate the ``--FILE--`` section with the two lines ``===DONE===``
+and ````. When doing so ``run-tests.php`` does not execute the line containing the
+exit call as that would suppress leak messages. Actually ``run-tests.php`` ignores any part after a
+line consisting only of ``===DONE===``.
+
+Here is an example:
+
+.. code:: php
+
+ --TEST--
+ Test hypot() — dealing with mixed number/character input
+ --INI--
+ precision=14
+ --FILE--
+
+ ===DONE===
+
+ --EXPECTF--
+ 23abc :-33 float(40.224370722238)
+ ===DONE===
+
+If executed as PHP script the output will stop after the code on the ``--FILE--`` section has been
+run.
+
+***********
+ Reference
+***********
+
+PHPT Sections
+=============
+
+``--TEST--``
+------------
+
+**Description:** Title of test as a single line short description.
+
+**Required:** Yes
+
+**Format:** Plain text. We recommend a single line only.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --TEST--
+ Test filter_input() with GET and POST data.
+
+Example 1 (full): :ref:`sample001.phpt`
+
+``--DESCRIPTION--``
+-------------------
+
+**Description:** If your test requires more than a single line title to adequately describe it, you
+can use this section for further explanation. Multiple lines are allowed and besides being used for
+information, this section is completely ignored by the test binary.
+
+**Required:** No
+
+**Format:** Plain text, multiple lines.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --DESCRIPTION--
+ This test covers both valid and invalid usages of filter_input() with INPUT_GET and INPUT_POST data and several differnet filter sanitizers.
+
+Example 1 (full): :ref:`sample001.phpt`
+
+``--CREDITS--``
+---------------
+
+**Description:** Used to credit contributors without CVS commit rights, who put their name and email
+on the first line. If the test was part of a TestFest event, then # followed by the name of the
+event and the date (YYYY-MM-DD) on the second line.
+
+**Required:** No. For newly created tests this section should no longer be included, as test
+authorship is already accurately tracked by Git. If multiple authors should be credited, the
+`Co-authored-by` tag in the commit message may be used.
+
+**Format:** Name Email [Event]
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --CREDITS--
+ Felipe Pena
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: text
+
+ --CREDITS--
+ Zoe Slattery zoe@php.net
+ # TestFest Munich 2009-05-19
+
+Example 2 (full): :ref:`sample002.phpt`
+
+``--SKIPIF--``
+--------------
+
+**Description:** A condition or set of conditions used to determine if a test should be skipped.
+Tests that are only applicable to a certain platform, extension or PHP version are good reasons for
+using a ``--SKIPIF--`` section.
+
+A common practice for extension tests is to write your ``--SKIPIF--`` extension criteria into a file
+call skipif.inc and then including that file in the ``--SKIPIF--`` section of all your extension
+tests. This promotes the DRY principle and reduces future code maintenance.
+
+**Required:** No.
+
+**Format:** PHP code enclosed by PHP tags. If the output of this scripts starts with "skip", the
+test is skipped. If the output starts with "xfail", the test is marked as expected failure. If the
+output starts with "flaky", the test is marked as flaky test. The "xfail" convention is supported as
+of PHP 7.2.0. The "flaky" convention is supported as of PHP 8.2.25 and PHP 8.3.13, respectively.
+
+Example 1 (snippet):
+
+.. code:: php
+
+ --SKIPIF--
+
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: php
+
+ --SKIPIF--
+
+
+Example 2 (full): :ref:`sample003.phpt`
+
+Example 3 (snippet):
+
+.. code:: php
+
+ --SKIPIF--
+
+
+Example 3 (full): :ref:`xfailif.phpt`
+
+Example 4 (snippet):
+
+.. code:: php
+
+ --SKIPIF--
+ string
&d=12345.7
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: xml
+
+ --POST--
+
+
+
+
+
+
+Example 2 (full): :ref:`sample005.phpt`
+
+``--POST_RAW--``
+----------------
+
+**Description:** Raw POST data to be passed to the test script. This differs from the section above
+because it doesn't automatically set the Content-Type, this leaves you free to define your own
+within the section. This section forces the use of the CGI binary instead of the usual CLI one.
+
+**Required:** No.
+
+Requirements: PHP CGI binary.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** Follows the HTTP post data format.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --POST_RAW--
+ Content-type: multipart/form-data, boundary=AaB03x
+
+ --AaB03x content-disposition: form-data; name="field1"
+
+ Joe Blow
+ --AaB03x
+ content-disposition: form-data; name="pics"; filename="file1.txt"
+ Content-Type: text/plain
+
+ abcdef123456789
+ --AaB03x--
+
+Example 1 (full): :ref:`sample006.phpt`
+
+``--PUT--``
+-----------
+
+**Description:** Similar to the section above, PUT data to be passed to the test script. This
+section forces the use of the CGI binary instead of the usual CLI one.
+
+**Required:** No.
+
+Requirements: PHP CGI binary.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** Raw data optionally preceded by a Content-Type header.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --PUT--
+ Content-Type: text/json
+
+ {"name":"default output handler","type":0,"flags":112,"level":0,"chunk_size":0,"buffer_size":16384,"buffer_used":3}
+
+``--GZIP_POST--``
+-----------------
+
+**Description:** When this section exists, the POST data will be gzencode()'d. This section forces
+the use of the CGI binary instead of the usual CLI one.
+
+**Required:** No.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** Just add the content to be gzencode()'d in the section.
+
+Example 1 (snippet):
+
+.. code:: xml
+
+ --GZIP_POST--
+
+
+
+
+
+
+Example 1 (full): :ref:`sample005.phpt`
+
+``--DEFLATE_POST--``
+--------------------
+
+**Description:** When this section exists, the POST data will be gzcompress()'ed. This section
+forces the use of the CGI binary instead of the usual CLI one.
+
+**Required:** No.
+
+Requirements:
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** Just add the content to be gzcompress()'ed in the section.
+
+Example 1 (snippet):
+
+.. code:: xml
+
+ --DEFLATE_POST--
+
+
+
+
+
+
+
+Example 1 (full): :ref:`sample007.phpt`
+
+``--GET--``
+-----------
+
+**Description:** GET variables to be passed to the test script. This section forces the use of the
+CGI binary instead of the usual CLI one.
+
+**Required:** No.
+
+Requirements: PHP CGI binary.
+
+**Format:** A single line of text passed as the GET data to the script.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --GET--
+ a=test&b=http://example.com
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: text
+
+ --GET--
+ ar[elm1]=1234&ar[elm2]=0660&a=0234
+
+Example 2 (full): :ref:`sample008.phpt`
+
+``--COOKIE--``
+--------------
+
+**Description:** Cookies to be passed to the test script. This section forces the use of the CGI
+binary instead of the usual CLI one.
+
+**Required:** No.
+
+Requirements: PHP CGI binary.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** A single line of text in a valid HTTP cookie format.
+
+Example 1 (snippet):
+
+.. code::
+
+ --COOKIE--
+ hello=World;goodbye=MrChips
+
+Example 1 (full): :ref:`sample002.phpt`
+
+``--STDIN--``
+-------------
+
+**Description:** Data to be fed to the test script's standard input.
+
+**Required:** No.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** Any text within this section is passed as STDIN to PHP.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --STDIN--
+ fooBar
+ use this to input some thing to the php script
+
+Example 1 (full): :ref:`sample009.phpt`
+
+``--INI--``
+-----------
+
+**Description:** To be used if you need a specific php.ini setting for the test.
+
+**Required:** No.
+
+**Format:** Key value pairs including automatically replaced tags. One setting per line. Content
+that is not a valid ini setting may cause failures.
+
+The following is a list of all tags and what they are used to represent:
+
+- ``{PWD}``: Represents the directory of the file containing the ``--INI--`` section.
+- ``{TMP}``: Represents the system's temporary directory. Available as of PHP 7.2.19 and 7.3.6.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --INI--
+ precision=14
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: text
+
+ --INI--
+ session.use_cookies=0
+ session.cache_limiter=
+ register_globals=1
+ session.serialize_handler=php
+ session.save_handler=files
+
+Example 2 (full): :ref:`sample003.phpt`
+
+``--ARGS--``
+------------
+
+**Description:** A single line defining the arguments passed to PHP.
+
+**Required:** No.
+
+**Format:** A single line of text that is passed as the argument(s) to the PHP CLI.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --ARGS--
+ --arg value --arg=value -avalue -a=value -a value
+
+Example 1 (full): :ref:`sample010.phpt`
+
+``--ENV--``
+-----------
+
+**Description:** Configures environment variables such as those found in the ``$_SERVER`` global
+array.
+
+**Required:** No.
+
+**Format:** Key value pairs. One setting per line.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --ENV--
+ SCRIPT_NAME=/frontcontroller10.php
+ REQUEST_URI=/frontcontroller10.php/hi
+ PATH_INFO=/hi
+
+Example 1 (full): :ref:`sample018.phpt`
+
+``--PHPDBG--``
+--------------
+
+**Description:** This section takes arbitrary phpdbg commands and executes the test file according
+to them as it would be run in the phpdbg prompt.
+
+**Required:** No.
+
+**Format:** Arbitrary phpdbg commands
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --PHPDBG--
+ b
+ 4
+ b
+ del
+ 0
+ b
+ 5
+ r
+ b
+ del
+ 1
+ r
+ y
+ q
+
+Example 1 (full): :ref:`phpdbg_1.phpt`
+
+``--FILE--``
+------------
+
+**Description:** The test source code.
+
+**Required:** One of the ``FILE`` type sections is required.
+
+**Format:** PHP source code enclosed by PHP tags.
+
+Example 1 (snippet):
+
+.. code:: php
+
+ --FILE--
+
+
+Example 1 (full): :ref:`sample001.phpt`
+
+``--FILEEOF--``
+---------------
+
+**Description:** An alternative to ``--FILE--`` where any trailing line breaks (\n || \r || \r\n
+found at the end of the section) are omitted. This is an extreme edge-case feature, so 99.99% of the
+time you won't need this section.
+
+**Required:** One of the ``FILE`` type sections is required.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** PHP source code enclosed by PHP tags.
+
+Example 1 (snippet):
+
+.. code:: php
+
+ --FILEEOF--
+ array(
+ 'PDOTEST_DSN' => 'sqlite2::memory:'
+ ),
+ 'TESTS' => 'ext/pdo/tests'
+ );
+
+Example 1 (full): :ref:`sample013.phpt` Note: The destination tests for this example are not
+included. See the PDO extension tests for reference to live tests using this section.
+
+Example 2 (snippet):
+
+.. code:: php
+
+ --REDIRECTTEST--
+ # magic auto-configuration
+
+ $config = array(
+ 'TESTS' => 'ext/pdo/tests'
+ );
+
+ if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
+ if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
+ }
+ } else {
+ $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'root';
+ $config['ENV']['PDOTEST_PASS'] = '';
+ }
+
+ return $config;
+
+Example 2 (full): :ref:`sample014.phpt`
+
+Note: The destination tests for this example are not included. See the PDO extension tests for
+reference to live tests using this section.
+
+``--CGI--``
+-----------
+
+**Description:** This section takes no value. It merely provides a simple marker for tests that MUST
+be run as CGI, even if there is no ``--POST--`` or ``--GET--`` sections in the test file.
+
+**Required:** No.
+
+**Format:** No value, just the ``--CGI--`` statement.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --CGI--
+
+Example 1 (full): :ref:`sample016.phpt`
+
+``--XFAIL--``
+-------------
+
+**Description:** This section identifies this test as one that is currently expected to fail. It
+should include a brief description of why it's expected to fail. Reasons for such expectations
+include tests that are written before the functionality they are testing is implemented or notice of
+a bug which is due to upstream code such as an extension which provides PHP support for some other
+software.
+
+Please do NOT include an ``--XFAIL--`` without providing a text description for the reason it's
+being used.
+
+**Required:** No.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** A short plain text description of why this test is currently expected to fail.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --XFAIL--
+ This bug might be still open on aix5.2-ppc64 and hpux11.23-ia64
+
+Example 1 (full): :ref:`sample017.phpt`
+
+``--FLAKY--``
+-------------
+
+**Description:** This section identifies this test as one that occassionally fails. If the test
+actually fails, it will be retried one more time, and that result will be reported. The section
+should include a brief description of why the test is flaky. Reasons for this include tests that
+rely on relatively precise timing, or temporary disc states. Available as of PHP 8.1.22 and 8.2.9,
+respectively.
+
+Please do NOT include a ``--FLAKY--`` section without providing a text description for the reason it
+is being used.
+
+**Required:** No.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** A short plain text description of why this test is flaky.
+
+Example 1 (snippet):
+
+.. code::
+
+ --FLAKY--
+ This test frequently fails in CI
+
+Example 1 (full): flaky.phpt
+
+``--EXPECTHEADERS--``
+---------------------
+
+**Description:** The expected headers. Any header specified here must exist in the response and have
+the same value or the test fails. Additional headers found in the actual tests while running are
+ignored.
+
+**Required:** No.
+
+**Format:** HTTP style headers. May include multiple lines.
+
+Example 1 (snippet):
+
+--EXPECTHEADERS-- Status: 404
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --EXPECTHEADERS--
+ Content-type: text/html; charset=UTF-8
+ Status: 403 Access Denied
+
+Example 1 (full): :ref:`sample018.phpt`
+
+Note: The destination tests for this example are not included. See the phar extension tests for
+reference to live tests using this section.
+
+``--EXPECT--``
+--------------
+
+**Description:** The expected output from the test script. This must match the actual output from
+the test script exactly for the test to pass.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Format:** Plain text. Multiple lines of text are allowed.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --EXPECT--
+ array(2) {
+ ["hello"]=>
+ string(5) "World"
+ ["goodbye"]=>
+ string(7) "MrChips"
+ }
+
+Example 1 (full): :ref:`sample002.phpt`
+
+``--EXPECT_EXTERNAL--``
+-----------------------
+
+**Description:** Similar to to ``--EXPECT--`` section, but just stating a filename where to load the
+expected output from.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Test Script Support:** ``run-tests.php``
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --EXPECT_EXTERNAL--
+ test001.expected.txt
+
+*test001.expected.txt*
+
+.. code:: php
+
+ array(2) {
+ ["hello"]=>
+ string(5) "World"
+ ["goodbye"]=>
+ string(7) "MrChips"
+ }
+
+``--EXPECTF--``
+---------------
+
+**Description:** An alternative of ``--EXPECT--``. Where it differs from ``--EXPECT--`` is that it
+uses a number of substitution tags for strings, spaces, digits, etc. that appear in test case output
+but which may vary between test runs. The most common example of this is to use %s and %d to match
+the file path and line number which are output by PHP Warnings.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Format:** Plain text including tags which are inserted to represent different types of output
+which are not guaranteed to have the same value on subsequent runs or when run on different
+platforms.
+
+The following is a list of all tags and what they are used to represent:
+
+ - ``%e``: Represents a directory separator, for example / on Linux.
+ - ``%s``: One or more of anything (character or white space) except the end of line character.
+ - ``%S``: Zero or more of anything (character or white space) except the end of line character.
+ - ``%a``: One or more of anything (character or white space) including the end of line
+ character.
+ - ``%A``: Zero or more of anything (character or white space) including the end of line
+ character.
+ - ``%w``: Zero or more white space characters.
+ - ``%i``: A signed integer value, for example +3142, -3142, 3142.
+ - ``%d``: An unsigned integer value, for example 123456.
+ - ``%x``: One or more hexadecimal character. That is, characters in the range 0-9, a-f, A-F.
+ - ``%f``: A floating point number, for example: 3.142, -3.142, 3.142E-10, 3.142e+10.
+ - ``%c``: A single character of any sort (.).
+ - ``%r...%r``: Any string (...) enclosed between two ``%r`` will be treated as a regular
+ expression.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --EXPECTF--
+ string(4) "test"
+ string(18) "http://example.com"
+ string(27) "<b>test</b>"
+
+ Notice: Object of class stdClass could not be converted to int in %ssample001.php on line %d
+ bool(false)
+ string(6) "string"
+ float(12345.7)
+ string(29) "<p>string</p>"
+ bool(false)
+
+ Warning: filter_var() expects parameter 2 to be long, string given in %s011.php on line %d
+ NULL
+
+ Warning: filter_input() expects parameter 3 to be long, string given in %s011.php on line %d
+ NULL
+
+ Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d
+ NULL
+
+ Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d
+ NULL
+ Done
+
+Example 1 (full): :ref:`sample001.phpt`
+
+Example 2 (snippet):
+
+.. code:: text
+
+ --EXPECTF--
+ Warning: bzopen() expects exactly 2 parameters, 0 given in %s on line %d NULL
+
+ Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): filename cannot be empty in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): filename cannot be empty in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): 'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): 'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d
+ bool(false)
+ resource(%d) of type (stream) Done
+
+Example 2 (full): :ref:`sample019.phpt`
+
+Example 3 (snippet):
+
+.. code:: text
+
+ --EXPECTF--
+ object(DOMNodeList)#%d (0) {
+ }
+ int(0)
+ bool(true)
+ bool(true)
+ string(0) ""
+ bool(true)
+ bool(true)
+ bool(false)
+ bool(false)
+
+Example 2 (full): :ref:`sample020.phpt`
+
+``--EXPECTF_EXTERNAL--``
+------------------------
+
+**Description:** Similar to to ``--EXPECTF--`` section, but like the ``--EXPECT_EXTERNAL--`` section
+just stating a filename where to load the expected output from.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Test Script Support:** ``run-tests.php``
+
+``--EXPECTREGEX--``
+-------------------
+
+**Description:** An alternative of ``--EXPECT--``. This form allows the tester to specify the result
+in a regular expression.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Format:** Plain text including regular expression patterns which represent data that can vary
+between subsequent runs of a test or when run on different platforms.
+
+Example 1 (snippet):
+
+.. code:: text
+
+ --EXPECTREGEX--
+ M_E : 2.718281[0-9]*
+ M_LOG2E : 1.442695[0-9]*
+ M_LOG10E : 0.434294[0-9]*
+ M_LN2 : 0.693147[0-9]*
+ M_LN10 : 2.302585[0-9]*
+ M_PI : 3.141592[0-9]*
+ M_PI_2 : 1.570796[0-9]*
+ M_PI_4 : 0.785398[0-9]*
+ M_1_PI : 0.318309[0-9]*
+ M_2_PI : 0.636619[0-9]*
+ M_SQRTPI : 1.772453[0-9]*
+ M_2_SQRTPI: 1.128379[0-9]*
+ M_LNPI : 1.144729[0-9]*
+ M_EULER : 0.577215[0-9]*
+ M_SQRT2 : 1.414213[0-9]*
+ M_SQRT1_2 : 0.707106[0-9]*
+ M_SQRT3 : 1.732050[0-9]*
+
+Example 1 (full): :ref:`sample021.phpt`
+
+Example 2 (snippet):
+
+.. code:: text
+
+ --EXPECTF--
+ *** Testing imap_append() : basic functionality ***
+ Create a new mailbox for test
+ Create a temporary mailbox and add 0 msgs
+ .. mailbox '%s' created
+ Add a couple of msgs to new mailbox {%s}INBOX.%s
+ bool(true)
+ bool(true)
+ Msg Count after append : 2
+ List the msg headers
+ array(2) {
+ [0]=>
+ string(%d) "%w%s 1)%s webmaster@something. Test message (%d chars)"
+ [1]=>
+ string(%d) "%w%s 2)%s webmaster@something. Another test (%d chars)"
+ }
+
+Example 2 (full): :ref:`sample025.phpt`
+
+Example 3 (snippet):
+
+.. code:: text
+
+ --EXPECTREGEX--
+ string\(4\) \"-012\"
+ string\(8\) \"2d303132\"
+ (string\(13\) \" 4294967284\"|string\(20\) \"18446744073709551604\")
+ (string\(26\) \"20202034323934393637323834\"|string\(40\) \"3138343436373434303733373039353531363034\")
+
+ Example 3 (full): :ref:`sample023.phpt`
+
+``--EXPECTREGEX_EXTERNAL--``
+----------------------------
+
+**Description:** Similar to to ``--EXPECTREGEX--`` section, but like the ``--EXPECT_EXTERNAL--``
+section just stating a filename where to load the expected output from.
+
+**Required:** One of the ``EXPECT`` type sections is required.
+
+**Test Script Support:** ``run-tests.php``
+
+``--CLEAN--``
+-------------
+
+**Description:** Code that is executed after a test completes. It's main purpose is to allow you to
+clean up after yourself. You might need to remove files created during the test or close sockets or
+database connections following a test. Infact, even if a test fails or encounters a fatal error
+during the test, the code found in the ``--CLEAN--`` section will still run.
+
+Code in the clean section is run in a completely different process than the one the test was run in.
+So do not try accessing variables you created in the ``--FILE--`` section from inside the
+``--CLEAN--`` section, they won't exist.
+
+Using the switch ``--no-clean`` on ``run-tests.php``, you can prevent the code found in the
+``--CLEAN--`` section of a test from running. This allows you to inspect generated data or files
+without them being removed by the ``--CLEAN--`` section.
+
+**Required:** No.
+
+**Test Script Support:** ``run-tests.php``
+
+**Format:** PHP source code enclosed by PHP tags.
+
+Example 1 (snippet):
+
+.. code:: php
+
+ --CLEAN--
+
+
+Example 1 (full): :ref:`sample024.phpt`
+
+Example 2 (snippet):
+
+.. code:: php
+
+ --CLEAN--
+
+
+Example 2 (full): :ref:`sample025.phpt`
+
+Example 3 (snippet):
+
+.. code:: php
+
+ --CLEAN--
+
+
+Example 3 (full): :ref:`sample022.phpt`
+
+Samples
+=======
+
+capture_stdio_1.phpt
+--------------------
+
+.. code:: php
+
+ --TEST--
+ Test covering the I/O stdin and stdout streams.
+ --DESCRIPTION--
+ This tests checks if the output of stdin and stdout I/O streams match the
+ expected content.
+ --CAPTURE_STDIO--
+ STDIN STDERR
+ --FILE--
+
+ --EXPECT--
+ This is error sent to the stderr I/O stream
+
+capture_stdio_2.phpt
+--------------------
+
+.. code:: php
+
+ --TEST--
+ Test covering the I/O stdin and stderr streams.
+ --DESCRIPTION--
+ This tests checks if the output of stdin and stderr I/O streams match the
+ expected content.
+ --CAPTURE_STDIO--
+ STDIN STDOUT
+ --FILE--
+
+ --EXPECT--
+ Hello, world. This is sent to the stdout I/O stream
+
+capture_stdio_3.phpt
+--------------------
+
+.. code:: php
+
+ --TEST--
+ Test covering the all standard I/O streams.
+ --DESCRIPTION--
+ This tests checks if the output of stdin, stdout and stderr I/O streams match
+ the expected content.
+ --CAPTURE_STDIO--
+ STDIN STDOUT STDERR
+ --FILE--
+
+ --EXPECT--
+ Hello, world. This is sent to the stdout I/O stream
+ This is error sent to the stderr I/O stream
+
+clean.php
+---------
+
+.. code:: php
+
+ Nmsgs; $i++) {
+ imap_delete($imap_stream, $i);
+ }
+
+ $mailboxes = imap_getmailboxes($imap_stream, $server, '*');
+
+ foreach($mailboxes as $value) {
+ // Only delete mailboxes with our prefix
+ if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) {
+ if (strlen($match[1]) >= strlen($mailbox_prefix)
+ && substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) {
+ imap_deletemailbox($imap_stream, $value->name);
+ }
+ }
+ }
+
+ imap_close($imap_stream, CL_EXPUNGE);
+ ?>
+
+conflicts_1.phpt
+----------------
+
+.. code:: php
+
+ --TEST--
+ Test get_headers() function : test with context
+ --CONFLICTS--
+ server
+ --FILE--
+ array(
+ 'method' => 'HEAD'
+ )
+ );
+
+ $context = stream_context_create($opts);
+ $headers = get_headers("https://".PHP_CLI_SERVER_ADDRESS, 1, $context);
+ echo $headers["X-Request-Method"]."\n";
+
+ stream_context_set_default($opts);
+ $headers = get_headers("https://".PHP_CLI_SERVER_ADDRESS, 1);
+ echo $headers["X-Request-Method"]."\n";
+
+ echo "Done";
+ ?>
+ --EXPECT--
+ HEAD
+ HEAD
+ Done
+
+extensions.phpt
+---------------
+
+.. code:: php
+
+ --TEST--
+ phpt EXTENSIONS directive with shared extensions
+ --DESCRIPTION--
+ This test covers the presence of some loaded extensions with a list of additional
+ extensions to be loaded when running test.
+ --EXTENSIONS--
+ curl
+ imagick
+ tokenizer
+ --FILE--
+
+ --EXPECT--
+ bool(true)
+ bool(true)
+ bool(true)
+
+file012.phpt
+------------
+
+.. code:: php
+
+
+
+phpdbg_1.phpt
+-------------
+
+.. code:: php
+
+ --TEST--
+ Test deleting breakpoints
+ --PHPDBG--
+ b 4
+ b del 0
+ b 5
+ r
+ b del 1
+ r
+ y
+ q
+ --EXPECTF--
+ [Successful compilation of %s]
+ prompt> [Breakpoint #0 added at %s:4]
+ prompt> [Deleted breakpoint #0]
+ prompt> [Breakpoint #1 added at %s:5]
+ prompt> 12
+ [Breakpoint #1 at %s:5, hits: 1]
+ >00005: echo $i++;
+ 00006: echo $i++;
+ 00007:
+ prompt> [Deleted breakpoint #1]
+ prompt> Do you really want to restart execution? (type y or n): 1234
+ [Script ended normally]
+ prompt>
+ --FILE--
+
+ --INI--
+ precision=14
+ --SKIPIF--
+
+ --GET--
+ a=test&b=https://example.com
+ --POST--
+ c=string
&d=12345.7
+ --FILE--
+
+ --EXPECTF--
+ string(4) "test"
+ string(19) "https://example.com"
+ string(27) "<b>test</b>"
+
+ Notice: Object of class stdClass could not be converted to int in %ssample001.php on line %d
+ bool(false)
+ string(6) "string"
+ float(12345.7)
+ string(29) "<p>string</p>"
+ bool(false)
+
+ Warning: filter_var() expects parameter 2 to be long, string given in %ssample001.php on line %d
+ NULL
+
+ Warning: filter_input() expects parameter 3 to be long, string given in %ssample001.php on line %d
+ NULL
+
+ Warning: filter_var() expects at most 3 parameters, 5 given in %ssample001.php on line %d
+ NULL
+
+ Warning: filter_var() expects at most 3 parameters, 5 given in %ssample001.php on line %d
+ NULL
+ Done
+
+sample002.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Test receipt of cookie data.
+ --CREDITS--
+ Zoe Slattery zoe@php.net
+ # TestFest Munich 2009-05-19
+ --COOKIE--
+ hello=World;goodbye=MrChips
+ --FILE--
+
+ --EXPECT--
+ array(2) {
+ ["hello"]=>
+ string(5) "World"
+ ["goodbye"]=>
+ string(7) "MrChips"
+ }
+
+sample003.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ session object deserialization
+ --SKIPIF--
+
+ --INI--
+ session.use_cookies=0
+ session.cache_limiter=
+ register_globals=1
+ session.serialize_handler=php
+ session.save_handler=files
+ --FILE--
+ yes++; }
+ }
+
+ session_id("abtest");
+ session_start();
+ session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
+
+ $baz->method();
+ $arr[3]->method();
+
+ var_dump($baz);
+ var_dump($arr);
+ session_destroy();
+ --EXPECT--
+ object(foo)#1 (2) {
+ ["bar"]=>
+ string(2) "ok"
+ ["yes"]=>
+ int(2)
+ }
+ array(1) {
+ [3]=>
+ object(foo)#2 (2) {
+ ["bar"]=>
+ string(2) "ok"
+ ["yes"]=>
+ int(2)
+ }
+ }
+
+sample005.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ SOAP Server 19: compressed request (gzip)
+ --SKIPIF--
+
+ --INI--
+ precision=14
+ --GZIP_POST--
+
+
+
+
+
+ --FILE--
+ "http://testuri.org"));
+ $server->addfunction("test");
+ $server->handle();
+ echo "ok\n";
+ ?>
+ --EXPECT--
+
+ Hello World
+ ok
+
+sample006.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ is_uploaded_file() function
+ --CREDITS--
+ Dave Kelsey
+ --SKIPIF--
+
+ --POST_RAW--
+ Content-type: multipart/form-data, boundary=AaB03x
+
+ --AaB03x
+ content-disposition: form-data; name="field1"
+
+ Joe Blow
+ --AaB03x
+ content-disposition: form-data; name="pics"; filename="file1.txt"
+ Content-Type: text/plain
+
+ abcdef123456789
+ --AaB03x--
+ --FILE--
+
+ --EXPECTF--
+ bool(true)
+ bool(false)
+ bool(false)
+ bool(false)
+
+ Warning: is_uploaded_file() expects exactly 1 parameter, 0 given in %s on line %d
+ NULL
+
+ Warning: is_uploaded_file() expects exactly 1 parameter, 2 given in %s on line %d
+ NULL
+
+sample007.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ SOAP Server 20: compressed request (deflate)
+ --SKIPIF--
+
+ --INI--
+ precision=14
+ --DEFLATE_POST--
+
+
+
+
+
+
+ --FILE--
+ "http://testuri.org"));
+ $server->addfunction("test");
+ $server->handle();
+ echo "ok\n";
+ ?>
+ --EXPECT--
+
+ Hello World
+ ok
+
+sample008.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ GET/POST/REQUEST Test with input_filter
+ --SKIPIF--
+
+ --POST--
+ d=379
+ --GET--
+ ar[elm1]=1234&ar[elm2]=0660&a=0234
+ --FILE--
+ FILTER_FLAG_ALLOW_OCTAL));
+ var_dump($ret);
+
+ $ret = filter_input(INPUT_GET, 'ar', FILTER_VALIDATE_INT, array('flags'=>FILTER_REQUIRE_ARRAY));
+ var_dump($ret);
+
+ $ret = filter_input(INPUT_GET, 'ar', FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
+ var_dump($ret);
+
+ ?>
+ --EXPECT--
+ bool(false)
+ int(156)
+ array(2) {
+ ["elm1"]=>
+ int(1234)
+ ["elm2"]=>
+ bool(false)
+ }
+ array(2) {
+ ["elm1"]=>
+ int(1234)
+ ["elm2"]=>
+ int(432)
+ }
+
+sample009.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ STDIN input
+ --FILE--
+
+ --STDIN--
+ fooBar
+ use this to input some thing to the php script
+ --EXPECT--
+ string(54) "fooBar
+ use this to input some thing to the php script
+ "
+
+sample010.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ getopt#005 (Required values)
+ --ARGS--
+ --arg value --arg=value -avalue -a=value -a value
+ --INI--
+ register_argc_argv=On
+ variables_order=GPS
+ --FILE--
+
+ --EXPECT--
+ array(2) {
+ ["arg"]=>
+ array(2) {
+ [0]=>
+ string(5) "value"
+ [1]=>
+ string(5) "value"
+ }
+ ["a"]=>
+ array(3) {
+ [0]=>
+ string(5) "value"
+ [1]=>
+ string(5) "value"
+ [2]=>
+ string(5) "value"
+ }
+ }
+
+sample011.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Bug #35382 (Comment in end of file produces fatal error)
+ --FILEEOF--
+
+ --REDIRECTTEST--
+ return array(
+ 'ENV' => array(
+ 'PDOTEST_DSN' => 'sqlite2::memory:'
+ ),
+ 'TESTS' => 'ext/pdo/tests'
+ );
+
+sample014.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ MySQL
+ --SKIPIF--
+
+ --REDIRECTTEST--
+ # magic auto-configuration
+
+ $config = array(
+ 'TESTS' => 'ext/pdo/tests'
+ );
+
+ if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
+ if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
+ }
+ } else {
+ $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'root';
+ $config['ENV']['PDOTEST_PASS'] = '';
+ }
+
+ return $config;
+
+sample016.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Test get variables with CGI binary
+ --GET--
+ hello=World&goodbye=MrChips
+ --CGI--
+ --FILE--
+
+ --EXPECT--
+ array(2) {
+ ["hello"]=>
+ string(5) "World"
+ ["goodbye"]=>
+ string(7) "MrChips"
+ }
+
+sample017.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ PDO Common: Bug #34630 (inserting streams as LOBs)
+ --SKIPIF--
+
+ --FILE--
+ getAttribute(PDO::ATTR_DRIVER_NAME);
+ $is_oci = $driver == 'oci';
+
+ if ($is_oci) {
+ $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val BLOB)');
+ } else {
+ $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(256))');
+ }
+ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ $fp = tmpfile();
+ fwrite($fp, "I am the LOB data");
+ rewind($fp);
+
+ if ($is_oci) {
+ /* oracle is a bit different; you need to initiate a transaction otherwise
+ * the empty blob will be committed implicitly when the statement is
+ * executed */
+ $db->beginTransaction();
+ $insert = $db->prepare("insert into test (id, val) values (1, EMPTY_BLOB()) RETURNING val INTO :blob");
+ } else {
+ $insert = $db->prepare("insert into test (id, val) values (1, :blob)");
+ }
+ $insert->bindValue(':blob', $fp, PDO::PARAM_LOB);
+ $insert->execute();
+ $insert = null;
+
+ $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
+ var_dump($db->query("SELECT * from test")->fetchAll(PDO::FETCH_ASSOC));
+
+ ?>
+ --XFAIL--
+ This bug might be still open on aix5.2-ppc64 and hpux11.23-ia64
+ --EXPECT--
+ array(1) {
+ [0]=>
+ array(2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(17) "I am the LOB data"
+ }
+ }
+
+sample018.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Phar front controller rewrite access denied [cache_list]
+ --INI--
+ default_charset=UTF-8
+ phar.cache_list={PWD}/frontcontroller10.php
+ --SKIPIF--
+
+ --ENV--
+ SCRIPT_NAME=/frontcontroller10.php
+ REQUEST_URI=/frontcontroller10.php/hi
+ PATH_INFO=/hi
+ --FILE_EXTERNAL--
+ files/frontcontroller4.phar
+ --EXPECTHEADERS--
+ Content-type: text/html; charset=UTF-8
+ Status: 403 Access Denied
+ --EXPECT--
+
+
+ Access Denied
+
+
+ 403 - File /hi Access Denied
+
+
+
+sample019.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ bzopen() and invalid parameters
+ --SKIPIF--
+
+ --FILE--
+
+ --EXPECTF--
+ Warning: bzopen() expects exactly 2 parameters, 0 given in %s on line %d
+ NULL
+
+ Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): filename cannot be empty in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): filename cannot be empty in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): 'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(): 'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+ bool(false)
+
+ Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d
+ bool(false)
+ resource(%d) of type (stream)
+ Done
+
+sample020.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Bug #42082 (NodeList length zero should be empty)
+ --FILE--
+ query('*');
+ var_dump($nodes);
+ var_dump($nodes->length);
+ $length = $nodes->length;
+ var_dump(empty($nodes->length), empty($length));
+
+ $doc->loadXML("");
+ var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue));
+ var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType))
+ ?>
+ --EXPECTF--
+ object(DOMNodeList)#%d (0) {
+ }
+ int(0)
+ bool(true)
+ bool(true)
+ string(0) ""
+ bool(true)
+ bool(true)
+ bool(false)
+ bool(false)
+
+sample021.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Math constants
+ --INI--
+ precision=14
+ --FILE--
+
+ --EXPECTREGEX--
+ M_E : 2.718281[0-9]*
+ M_LOG2E : 1.442695[0-9]*
+ M_LOG10E : 0.434294[0-9]*
+ M_LN2 : 0.693147[0-9]*
+ M_LN10 : 2.302585[0-9]*
+ M_PI : 3.141592[0-9]*
+ M_PI_2 : 1.570796[0-9]*
+ M_PI_4 : 0.785398[0-9]*
+ M_1_PI : 0.318309[0-9]*
+ M_2_PI : 0.636619[0-9]*
+ M_SQRTPI : 1.772453[0-9]*
+ M_2_SQRTPI: 1.128379[0-9]*
+ M_LNPI : 1.144729[0-9]*
+ M_EULER : 0.577215[0-9]*
+ M_SQRT2 : 1.414213[0-9]*
+ M_SQRT1_2 : 0.707106[0-9]*
+ M_SQRT3 : 1.732050[0-9]*
+
+sample022.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ shm_detach() tests
+ --SKIPIF--
+
+ --FILE--
+
+ --CLEAN--
+
+ --EXPECTF--
+ Warning: shm_detach() expects exactly 1 parameter, 0 given in %ssample022.php on line %d
+ NULL
+
+ Warning: shm_detach() expects exactly 1 parameter, 2 given in %ssample022.php on line %d
+ NULL
+ bool(true)
+
+ Warning: shm_detach(): %d is not a valid sysvshm resource in %ssample022.php on line %d
+ bool(false)
+
+ Warning: shm_remove(): %d is not a valid sysvshm resource in %ssample022.php on line %d
+
+ Warning: shm_detach() expects parameter 1 to be resource, integer given in %ssample022.php on line %d
+ NULL
+
+ Warning: shm_detach() expects parameter 1 to be resource, integer given in %ssample022.php on line %d
+ NULL
+
+ Warning: shm_detach() expects parameter 1 to be resource, integer given in %ssample022.php on line %d
+ NULL
+ Done
+
+sample023.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Bug #23894 (sprintf() decimal specifiers problem)
+ --FILE--
+
+ --EXPECTREGEX--
+ string\(4\) \"-012\"
+ string\(8\) \"2d303132\"
+ (string\(13\) \" 4294967284\"|string\(20\) \"18446744073709551604\")
+ (string\(26\) \"20202034323934393637323834\"|string\(40\) \"3138343436373434303733373039353531363034\")
+
+sample024.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ DOMDocument::save Test basic function of save method
+ --SKIPIF--
+
+ --FILE--
+ formatOutput = true;
+
+ $root = $doc->createElement('book');
+
+ $root = $doc->appendChild($root);
+
+ $title = $doc->createElement('title');
+ $title = $root->appendChild($title);
+
+ $text = $doc->createTextNode('This is the title');
+ $text = $title->appendChild($text);
+
+ $temp_filename = __DIR__.'/DomDocument_save_basic.tmp';
+
+ echo 'Wrote: ' . $doc->save($temp_filename) . ' bytes'; // Wrote: 72 bytes
+ ?>
+ --CLEAN--
+
+ --EXPECTF--
+ Wrote: 72 bytes
+
+sample025.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ Test imap_append() function : basic functionality
+ --SKIPIF--
+
+ --FILE--
+ Mailbox . "\n";
+ var_dump(imap_append($imap_stream, $mb_details->Mailbox
+ , "From: webmaster@something.com\r\n"
+ . "To: info@something.com\r\n"
+ . "Subject: Test message\r\n"
+ . "\r\n"
+ . "this is a test message, please ignore\r\n"
+ ));
+
+ var_dump(imap_append($imap_stream, $mb_details->Mailbox
+ , "From: webmaster@something.com\r\n"
+ . "To: info@something.com\r\n"
+ . "Subject: Another test\r\n"
+ . "\r\n"
+ . "this is another test message, please ignore it too!!\r\n"
+ ));
+
+ $check = imap_check($imap_stream);
+ echo "Msg Count after append : ". $check->Nmsgs . "\n";
+
+ echo "List the msg headers\n";
+ var_dump(imap_headers($imap_stream));
+
+ imap_close($imap_stream);
+ ?>
+ --CLEAN--
+
+ --EXPECTF--
+ *** Testing imap_append() : basic functionality ***
+ Create a new mailbox for test
+ Create a temporary mailbox and add 0 msgs
+ .. mailbox '%s' created
+ Add a couple of msgs to new mailbox {%s}INBOX.%s
+ bool(true)
+ bool(true)
+ Msg Count after append : 2
+ List the msg headers
+ array(2) {
+ [0]=>
+ string(%d) "%w%s 1)%s webmaster@something. Test message (%d chars)"
+ [1]=>
+ string(%d) "%w%s 2)%s webmaster@something. Another test (%d chars)"
+ }
+
+sample026.phpt
+--------------
+
+.. code:: php
+
+ --TEST--
+ SPL: ArrayIterator implementing RecursiveIterator
+ --FILE--
+ array(21, 22 => array(221, 222), 23 => array(231)), 3);
+
+ $dir = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY);
+
+ foreach ($dir as $file) {
+ print "$file\n";
+ }
+
+ ?>
+ ===DONE===
+
+ --EXPECT--
+ 1
+ 21
+ 221
+ 222
+ 231
+ 3
+
+skipif2.phpt
+------------
+
+.. code:: php
+
+
+
+skipif.phpt
+-----------
+
+.. code:: php
+
+
+
+xfailif.phpt
+------------
+
+.. code:: php
+
+ --TEST--
+ Handling of errors during linking
+ --INI--
+ opcache.enable=1
+ opcache.enable_cli=1
+ opcache.optimization_level=-1
+ opcache.preload={PWD}/preload_inheritance_error_ind.inc
+ --SKIPIF--
+
+ --FILE--
+
+ --EXPECTF--
+ Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in %spreload_inheritance_error.inc on line 8
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 962f839ba83f4..2e9cb6c3ad774 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -179,6 +179,26 @@ static zend_result php_str2num(bc_num *num, const zend_string *str)
}
/* }}} */
+static void bc_pow_err(bc_raise_status status, uint32_t arg_num)
+{
+ /* If arg_num is 0, it means it is an op */
+ switch (status) {
+ case BC_RAISE_STATUS_DIVIDE_BY_ZERO:
+ zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Negative power of zero");
+ break;
+ case BC_RAISE_STATUS_LEN_IS_OVERFLOW:
+ case BC_RAISE_STATUS_SCALE_IS_OVERFLOW:
+ case BC_RAISE_STATUS_FULLLEN_IS_OVERFLOW:
+ if (arg_num == 0) {
+ zend_value_error("exponent is too large, the number of digits overflowed");
+ } else {
+ zend_argument_value_error(arg_num, "exponent is too large, the number of digits overflowed");
+ }
+ break;
+ EMPTY_SWITCH_DEFAULT_CASE();
+ }
+}
+
/* {{{ Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
{
@@ -615,11 +635,11 @@ PHP_FUNCTION(bcpow)
goto cleanup;
}
- if (!bc_raise(first, exponent, &result, scale)) {
- zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Negative power of zero");
+ bc_raise_status ret_status = bc_raise(first, exponent, &result, scale);
+ if (UNEXPECTED(ret_status != BC_RAISE_STATUS_OK)) {
+ bc_pow_err(ret_status, 2);
goto cleanup;
}
-
RETVAL_NEW_STR(bc_num2str_ex(result, scale));
cleanup: {
@@ -1144,8 +1164,9 @@ static zend_result bcmath_number_pow_internal(
}
return FAILURE;
}
- if (!bc_raise(n1, exponent, ret, *scale)) {
- zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Negative power of zero");
+ bc_raise_status ret_status = bc_raise(n1, exponent, ret, *scale);
+ if (UNEXPECTED(ret_status != BC_RAISE_STATUS_OK)) {
+ bc_pow_err(ret_status, is_op ? 0 : 1);
return FAILURE;
}
bc_rm_trailing_zeros(*ret);
@@ -1164,7 +1185,7 @@ static zend_always_inline bcmath_number_obj_t *bcmath_number_new_obj(bc_num ret,
return intern;
}
-static zend_result bcmath_number_parse_num(zval *zv, zend_object **obj, zend_string **str, zend_long *lval)
+static zend_result bcmath_number_parse_num(const zval *zv, zend_object **obj, zend_string **str, zend_long *lval)
{
if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), bcmath_number_ce)) {
*obj = Z_OBJ_P(zv);
@@ -1372,7 +1393,7 @@ static int bcmath_number_compare(zval *op1, zval *op2)
}
static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err(
- bc_num *num, size_t *scale, zend_object *obj, zend_string *str, zend_long lval, uint32_t arg_num)
+ bc_num *num, size_t *scale, const zend_object *obj, const zend_string *str, zend_long lval, uint32_t arg_num)
{
size_t full_scale = 0;
if (UNEXPECTED(bc_num_from_obj_or_str_or_long(num, &full_scale, obj, str, lval) == FAILURE)) {
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h
index 1f05ad51f7f26..fa335ae404808 100644
--- a/ext/bcmath/libbcmath/src/bcmath.h
+++ b/ext/bcmath/libbcmath/src/bcmath.h
@@ -147,8 +147,6 @@ bc_num bc_multiply(bc_num n1, bc_num n2, size_t scale);
*(result) = mul_ex; \
} while (0)
-bc_num bc_square(bc_num n1, size_t scale);
-
bool bc_divide(bc_num n1, bc_num n2, bc_num *quot, size_t scale);
bool bc_modulo(bc_num num1, bc_num num2, bc_num *resul, size_t scale);
@@ -159,6 +157,14 @@ bc_num bc_floor_or_ceil(bc_num num, bool is_floor);
size_t bc_round(bc_num num, zend_long places, zend_long mode, bc_num *result);
+typedef enum {
+ BC_RAISE_STATUS_OK,
+ BC_RAISE_STATUS_LEN_IS_OVERFLOW,
+ BC_RAISE_STATUS_SCALE_IS_OVERFLOW,
+ BC_RAISE_STATUS_FULLLEN_IS_OVERFLOW,
+ BC_RAISE_STATUS_DIVIDE_BY_ZERO,
+} bc_raise_status;
+
typedef enum {
OK,
BASE_HAS_FRACTIONAL,
@@ -170,7 +176,7 @@ typedef enum {
raise_mod_status bc_raisemod(bc_num base, bc_num exponent, bc_num mod, bc_num *result, size_t scale);
-bool bc_raise(bc_num base, long exponent, bc_num *result, size_t scale);
+bc_raise_status bc_raise(bc_num base, long exponent, bc_num *result, size_t scale);
void bc_raise_bc_exponent(bc_num base, bc_num exponent, bc_num *resul, size_t scale);
diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c
index 2c24dab777059..06ef246782089 100644
--- a/ext/bcmath/libbcmath/src/compare.c
+++ b/ext/bcmath/libbcmath/src/compare.c
@@ -41,8 +41,6 @@
bcmath_compare_result _bc_do_compare(bc_num n1, bc_num n2, size_t scale, bool use_sign)
{
- char *n1ptr, *n2ptr;
-
/* First, compare signs. */
if (use_sign && n1->n_sign != n2->n_sign) {
/*
@@ -91,8 +89,8 @@ bcmath_compare_result _bc_do_compare(bc_num n1, bc_num n2, size_t scale, bool us
/* If we get here, they have the same number of integer digits.
check the integer part and the equal length part of the fraction. */
size_t count = n1->n_len + MIN (n1_scale, n2_scale);
- n1ptr = n1->n_value;
- n2ptr = n2->n_value;
+ const char *n1ptr = n1->n_value;
+ const char *n2ptr = n2->n_value;
while ((count > 0) && (*n1ptr == *n2ptr)) {
n1ptr++;
diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c
index 1cf8a434c8608..24ec9a64d77fc 100644
--- a/ext/bcmath/libbcmath/src/div.c
+++ b/ext/bcmath/libbcmath/src/div.c
@@ -70,7 +70,7 @@ static inline void bc_fast_div(
*/
static inline void bc_standard_div(
BC_VECTOR *numerator_vectors, size_t numerator_arr_size,
- BC_VECTOR *divisor_vectors, size_t divisor_arr_size, size_t divisor_len,
+ const BC_VECTOR *divisor_vectors, size_t divisor_arr_size, size_t divisor_len,
BC_VECTOR *quot_vectors, size_t quot_arr_size
) {
size_t numerator_top_index = numerator_arr_size - 1;
@@ -354,10 +354,10 @@ bool bc_divide(bc_num numerator, bc_num divisor, bc_num *quot, size_t scale)
return true;
}
- char *numeratorptr = numerator->n_value;
+ const char *numeratorptr = numerator->n_value;
size_t numerator_size = numerator->n_len + quot_scale + divisor->n_scale;
- char *divisorptr = divisor->n_value;
+ const char *divisorptr = divisor->n_value;
size_t divisor_size = divisor->n_len + divisor->n_scale;
/* check and remove numerator leading zeros */
diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c
index feb50120c70c3..f516f2bda72df 100644
--- a/ext/bcmath/libbcmath/src/doaddsub.c
+++ b/ext/bcmath/libbcmath/src/doaddsub.c
@@ -46,7 +46,7 @@ bc_num _bc_do_add(bc_num n1, bc_num n2)
size_t min_len = MIN (n1->n_len, n2->n_len);
size_t min_scale = MIN(n1->n_scale, n2->n_scale);
size_t min_bytes = min_len + min_scale;
- char *n1ptr, *n2ptr, *sumptr;
+ char *sumptr;
bool carry = 0;
size_t count;
@@ -54,8 +54,8 @@ bc_num _bc_do_add(bc_num n1, bc_num n2)
sum = bc_new_num_nonzeroed(sum_len, sum_scale);
/* Start with the fraction part. Initialize the pointers. */
- n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale - 1);
- n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale - 1);
+ const char *n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale - 1);
+ const char *n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale - 1);
sumptr = (char *) (sum->n_value + sum_scale + sum_len - 1);
/* Add the fraction part. First copy the longer fraction.*/
@@ -182,14 +182,14 @@ bc_num _bc_do_sub(bc_num n1, bc_num n2)
size_t borrow = 0;
size_t count;
int val;
- char *n1ptr, *n2ptr, *diffptr;
+ char *diffptr;
/* Allocate temporary storage. */
diff = bc_new_num_nonzeroed(diff_len, diff_scale);
/* Initialize the subtract. */
- n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale - 1);
- n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale - 1);
+ const char *n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale - 1);
+ const char *n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale - 1);
diffptr = (char *) (diff->n_value + diff_len + diff_scale - 1);
/* Take care of the longer scaled number. */
diff --git a/ext/bcmath/libbcmath/src/private.h b/ext/bcmath/libbcmath/src/private.h
index 91facfb2f8b40..de9045a16c7e5 100644
--- a/ext/bcmath/libbcmath/src/private.h
+++ b/ext/bcmath/libbcmath/src/private.h
@@ -84,6 +84,9 @@ static const BC_VECTOR BC_POW_10_LUT[9] = {
bcmath_compare_result _bc_do_compare (bc_num n1, bc_num n2, size_t scale, bool use_sign);
bc_num _bc_do_add (bc_num n1, bc_num n2);
bc_num _bc_do_sub (bc_num n1, bc_num n2);
+void bc_multiply_vector(
+ const BC_VECTOR *n1_vector, size_t n1_arr_size, const BC_VECTOR *n2_vector, size_t n2_arr_size,
+ BC_VECTOR *prod_vector, size_t prod_arr_size);
void _bc_rm_leading_zeros (bc_num num);
#endif
diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c
index 1e283864694b6..5df8130c24219 100644
--- a/ext/bcmath/libbcmath/src/raise.c
+++ b/ext/bcmath/libbcmath/src/raise.c
@@ -30,31 +30,155 @@
*************************************************************************/
#include "bcmath.h"
+#include "convert.h"
+#include "private.h"
#include
#include
#include
-void bc_square_ex(bc_num n1, bc_num *result, size_t scale_min) {
- bc_num square_ex = bc_square(n1, scale_min);
- bc_free_num(result);
- *(result) = square_ex;
+static inline size_t bc_multiply_vector_ex(
+ BC_VECTOR **n1_vector, size_t n1_arr_size, BC_VECTOR *n2_vector, size_t n2_arr_size, BC_VECTOR **result_vector)
+{
+ size_t result_arr_size = n1_arr_size + n2_arr_size;
+ bc_multiply_vector(*n1_vector, n1_arr_size, n2_vector, n2_arr_size, *result_vector, result_arr_size);
+
+ /* Eliminate extra zeros because they increase the number of calculations. */
+ while ((*result_vector)[result_arr_size - 1] == 0) {
+ result_arr_size--;
+ }
+
+ /* Swap n1_vector and result_vector. */
+ BC_VECTOR *tmp = *n1_vector;
+ *n1_vector = *result_vector;
+ *result_vector = tmp;
+
+ return result_arr_size;
+}
+
+static inline size_t bc_square_vector_ex(BC_VECTOR **base_vector, size_t base_arr_size, BC_VECTOR **result_vector)
+{
+ return bc_multiply_vector_ex(base_vector, base_arr_size, *base_vector, base_arr_size, result_vector);
+}
+
+/* Use "exponentiation by squaring". This is the fast path when the results are small. */
+static inline bc_num bc_fast_raise(
+ const char *base_end, long exponent, size_t base_len, size_t power_len, size_t power_scale, size_t power_full_len)
+{
+ BC_VECTOR base_vector = 0;
+
+ /* Convert to BC_VECTOR[] */
+ bc_convert_to_vector(&base_vector, base_end, base_len);
+
+ while ((exponent & 1) == 0) {
+ base_vector *= base_vector;
+ exponent >>= 1;
+ }
+
+ /* copy base to power */
+ BC_VECTOR power_vector = base_vector;
+ exponent >>= 1;
+
+ while (exponent > 0) {
+ base_vector *= base_vector;
+ if ((exponent & 1) == 1) {
+ power_vector *= base_vector;
+ }
+ exponent >>= 1;
+ }
+
+ bc_num power = bc_new_num_nonzeroed(power_len, power_scale);
+ char *pptr = power->n_value;
+ char *pend = pptr + power_full_len - 1;
+
+ while (pend >= pptr) {
+ *pend-- = power_vector % BASE;
+ power_vector /= BASE;
+ }
+ return power;
+}
+
+/* Use "exponentiation by squaring". This is the standard path. */
+static bc_num bc_standard_raise(
+ const char *base_ptr, const char *base_end, long exponent, size_t base_len, size_t power_scale)
+{
+ /* Remove the leading zeros as they will be filled in later. */
+ while (*base_ptr == 0) {
+ base_ptr++;
+ base_len--;
+ }
+
+ size_t base_arr_size = BC_ARR_SIZE_FROM_LEN(base_len);
+ /* Since it is guaranteed that base_len * exponent does not overflow, there is no possibility of overflow here. */
+ size_t max_power_arr_size = base_arr_size * exponent;
+
+ /* The allocated memory area is reused on a rotational basis, so the same size is required. */
+ BC_VECTOR *buf = safe_emalloc(max_power_arr_size, sizeof(BC_VECTOR) * 3, 0);
+ BC_VECTOR *base_vector = buf;
+ BC_VECTOR *power_vector = base_vector + max_power_arr_size;
+ BC_VECTOR *tmp_result_vector = power_vector + max_power_arr_size;
+
+ /* Convert to BC_VECTOR[] */
+ bc_convert_to_vector(base_vector, base_end, base_len);
+
+ while ((exponent & 1) == 0) {
+ base_arr_size = bc_square_vector_ex(&base_vector, base_arr_size, &tmp_result_vector);
+ exponent >>= 1;
+ }
+
+ /* copy base to power */
+ size_t power_arr_size = base_arr_size;
+ for (size_t i = 0; i < base_arr_size; i++) {
+ power_vector[i] = base_vector[i];
+ }
+ exponent >>= 1;
+
+ while (exponent > 0) {
+ base_arr_size = bc_square_vector_ex(&base_vector, base_arr_size, &tmp_result_vector);
+ if ((exponent & 1) == 1) {
+ power_arr_size = bc_multiply_vector_ex(&power_vector, power_arr_size, base_vector, base_arr_size, &tmp_result_vector);
+ }
+ exponent >>= 1;
+ }
+
+ /* Convert to bc_num */
+ size_t power_leading_zeros = 0;
+ size_t power_len;
+ size_t power_full_len = power_arr_size * BC_VECTOR_SIZE;
+ if (power_full_len > power_scale) {
+ power_len = power_full_len - power_scale;
+ } else {
+ power_len = 1;
+ power_leading_zeros = power_scale - power_full_len + 1;
+ power_full_len = power_scale + 1;
+ }
+ bc_num power = bc_new_num_nonzeroed(power_len, power_scale);
+
+ char *pptr = power->n_value;
+ char *pend = pptr + power_full_len - 1;
+
+ /* Pad with leading zeros if necessary. */
+ memset(pptr, 0, power_leading_zeros);
+ pptr += power_leading_zeros;
+
+ bc_convert_vector_to_char(power_vector, pptr, pend, power_arr_size);
+
+ efree(buf);
+
+ return power;
}
/* Raise "base" to the "exponent" power. The result is placed in RESULT.
Maximum exponent is LONG_MAX. If a "exponent" is not an integer,
only the integer part is used. */
-bool bc_raise(bc_num base, long exponent, bc_num *result, size_t scale) {
- bc_num temp, power;
+bc_raise_status bc_raise(bc_num base, long exponent, bc_num *result, size_t scale) {
size_t rscale;
- size_t pwrscale;
- size_t calcscale;
bool is_neg;
/* Special case if exponent is a zero. */
if (exponent == 0) {
bc_free_num (result);
*result = bc_copy_num(BCG(_one_));
- return true;
+ return BC_RAISE_STATUS_OK;
}
/* Other initializations. */
@@ -67,44 +191,66 @@ bool bc_raise(bc_num base, long exponent, bc_num *result, size_t scale) {
rscale = MIN (base->n_scale * exponent, MAX(scale, base->n_scale));
}
- /* Set initial value of temp. */
- power = bc_copy_num(base);
- pwrscale = base->n_scale;
- while ((exponent & 1) == 0) {
- pwrscale = 2 * pwrscale;
- bc_square_ex(power, &power, pwrscale);
- exponent = exponent >> 1;
+ if (bc_is_zero(base)) {
+ /* If the exponent is negative, it divides by 0 */
+ return is_neg ? BC_RAISE_STATUS_DIVIDE_BY_ZERO : BC_RAISE_STATUS_OK;
}
- temp = bc_copy_num(power);
- calcscale = pwrscale;
- exponent = exponent >> 1;
- /* Do the calculation. */
- while (exponent > 0) {
- pwrscale = 2 * pwrscale;
- bc_square_ex(power, &power, pwrscale);
- if ((exponent & 1) == 1) {
- calcscale = pwrscale + calcscale;
- bc_multiply_ex(temp, power, &temp, calcscale);
- }
- exponent = exponent >> 1;
+ /* check overflow */
+ if (UNEXPECTED(base->n_len > SIZE_MAX / exponent)) {
+ return BC_RAISE_STATUS_LEN_IS_OVERFLOW;
+ }
+ if (UNEXPECTED(base->n_scale > SIZE_MAX / exponent)) {
+ return BC_RAISE_STATUS_SCALE_IS_OVERFLOW;
+ }
+
+ size_t base_len = base->n_len + base->n_scale;
+ size_t power_len = base->n_len * exponent;
+ size_t power_scale = base->n_scale * exponent;
+
+ /* check overflow */
+ if (UNEXPECTED(power_len > SIZE_MAX - power_scale)) {
+ return BC_RAISE_STATUS_FULLLEN_IS_OVERFLOW;
+ }
+ size_t power_full_len = power_len + power_scale;
+
+ sign power_sign;
+ if (base->n_sign == MINUS && (exponent & 1) == 1) {
+ power_sign = MINUS;
+ } else {
+ power_sign = PLUS;
+ }
+
+ const char *base_end = base->n_value + base_len - 1;
+
+ bc_num power;
+ if (base_len <= BC_VECTOR_SIZE && power_full_len <= BC_VECTOR_SIZE * 2) {
+ power = bc_fast_raise(base_end, exponent, base_len, power_len, power_scale, power_full_len);
+ } else {
+ power = bc_standard_raise(base->n_value, base_end, exponent, base_len, power_scale);
+ }
+
+ _bc_rm_leading_zeros(power);
+ if (bc_is_zero(power)) {
+ power->n_sign = PLUS;
+ power->n_scale = 0;
+ } else {
+ power->n_sign = power_sign;
}
/* Assign the value. */
if (is_neg) {
- if (bc_divide(BCG(_one_), temp, result, rscale) == false) {
- bc_free_num (&temp);
+ if (bc_divide(BCG(_one_), power, result, rscale) == false) {
bc_free_num (&power);
- return false;
+ return BC_RAISE_STATUS_DIVIDE_BY_ZERO;
}
- bc_free_num (&temp);
+ bc_free_num (&power);
} else {
bc_free_num (result);
- *result = temp;
+ *result = power;
(*result)->n_scale = MIN(scale, (*result)->n_scale);
}
- bc_free_num (&power);
- return true;
+ return BC_RAISE_STATUS_OK;
}
/* This is used internally by BCMath */
diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c
index 26ce1641db410..5e69fd7eb0336 100644
--- a/ext/bcmath/libbcmath/src/recmul.c
+++ b/ext/bcmath/libbcmath/src/recmul.c
@@ -72,43 +72,37 @@ static inline void bc_fast_mul(bc_num n1, size_t n1len, bc_num n2, size_t n2len,
}
}
-/*
- * Equivalent of bc_fast_mul for small numbers to perform computations
- * without using array.
- */
-static inline void bc_fast_square(bc_num n1, size_t n1len, bc_num *prod)
+static inline void bc_standard_vector_mul(
+ const BC_VECTOR *n1_vector, size_t n1_arr_size, const BC_VECTOR *n2_vector, size_t n2_arr_size,
+ BC_VECTOR *prod_vector, size_t prod_arr_size)
{
- const char *n1end = n1->n_value + n1len - 1;
-
- BC_VECTOR n1_vector = bc_partial_convert_to_vector(n1end, n1len);
- BC_VECTOR prod_vector = n1_vector * n1_vector;
-
- size_t prodlen = n1len + n1len;
- *prod = bc_new_num_nonzeroed(prodlen, 0);
- char *pptr = (*prod)->n_value;
- char *pend = pptr + prodlen - 1;
+ for (size_t i = 0; i < prod_arr_size; i++) {
+ prod_vector[i] = 0;
+ }
- while (pend >= pptr) {
- *pend-- = prod_vector % BASE;
- prod_vector /= BASE;
+ /* Multiplication and addition */
+ size_t count = 0;
+ for (size_t i = 0; i < n1_arr_size; i++) {
+ /*
+ * This calculation adds the result multiple times to the array entries.
+ * When multiplying large numbers of digits, there is a possibility of
+ * overflow, so digit adjustment is performed beforehand.
+ */
+ if (UNEXPECTED(count >= BC_VECTOR_NO_OVERFLOW_ADD_COUNT)) {
+ bc_mul_carry_calc(prod_vector, prod_arr_size);
+ count = 0;
+ }
+ count++;
+ for (size_t j = 0; j < n2_arr_size; j++) {
+ prod_vector[i + j] += n1_vector[i] * n2_vector[j];
+ }
}
-}
-/* Common part of functions bc_standard_mul and bc_standard_square
- * that takes a vector and converts it to a bc_num */
-static inline void bc_mul_finish_from_vector(BC_VECTOR *prod_vector, size_t prod_arr_size, size_t prodlen, bc_num *prod) {
/*
* Move a value exceeding 4/8 digits by carrying to the next digit.
* However, the last digit does nothing.
*/
bc_mul_carry_calc(prod_vector, prod_arr_size);
-
- /* Convert to bc_num */
- *prod = bc_new_num_nonzeroed(prodlen, 0);
- char *pptr = (*prod)->n_value;
- char *pend = pptr + prodlen - 1;
-
- bc_convert_vector_to_char(prod_vector, pptr, pend, prod_arr_size);
}
/*
@@ -121,7 +115,6 @@ static inline void bc_mul_finish_from_vector(BC_VECTOR *prod_vector, size_t prod
*/
static void bc_standard_mul(bc_num n1, size_t n1len, bc_num n2, size_t n2len, bc_num *prod)
{
- size_t i;
const char *n1end = n1->n_value + n1len - 1;
const char *n2end = n2->n_value + n2len - 1;
size_t prodlen = n1len + n2len;
@@ -147,88 +140,24 @@ static void bc_standard_mul(bc_num n1, size_t n1len, bc_num n2, size_t n2len, bc
BC_VECTOR *n2_vector = n1_vector + n1_arr_size;
BC_VECTOR *prod_vector = n2_vector + n2_arr_size;
- for (i = 0; i < prod_arr_size; i++) {
- prod_vector[i] = 0;
- }
-
/* Convert to BC_VECTOR[] */
bc_convert_to_vector(n1_vector, n1end, n1len);
bc_convert_to_vector(n2_vector, n2end, n2len);
- /* Multiplication and addition */
- size_t count = 0;
- for (i = 0; i < n1_arr_size; i++) {
- /*
- * This calculation adds the result multiple times to the array entries.
- * When multiplying large numbers of digits, there is a possibility of
- * overflow, so digit adjustment is performed beforehand.
- */
- if (UNEXPECTED(count >= BC_VECTOR_NO_OVERFLOW_ADD_COUNT)) {
- bc_mul_carry_calc(prod_vector, prod_arr_size);
- count = 0;
- }
- count++;
- for (size_t j = 0; j < n2_arr_size; j++) {
- prod_vector[i + j] += n1_vector[i] * n2_vector[j];
- }
- }
+ /* Do multiply */
+ bc_standard_vector_mul(n1_vector, n1_arr_size, n2_vector, n2_arr_size, prod_vector, prod_arr_size);
- bc_mul_finish_from_vector(prod_vector, prod_arr_size, prodlen, prod);
+ /* Convert to bc_num */
+ *prod = bc_new_num_nonzeroed(prodlen, 0);
+ char *pptr = (*prod)->n_value;
+ char *pend = pptr + prodlen - 1;
+ bc_convert_vector_to_char(prod_vector, pptr, pend, prod_arr_size);
if (allocation_arr_size > BC_STACK_VECTOR_SIZE) {
efree(n1_vector);
}
}
-/** This is bc_standard_mul implementation for square */
-static void bc_standard_square(bc_num n1, size_t n1len, bc_num *prod)
-{
- size_t i;
- const char *n1end = n1->n_value + n1len - 1;
- size_t prodlen = n1len + n1len;
-
- size_t n1_arr_size = BC_ARR_SIZE_FROM_LEN(n1len);
- size_t prod_arr_size = BC_ARR_SIZE_FROM_LEN(prodlen);
-
- BC_VECTOR *buf = safe_emalloc(n1_arr_size + n1_arr_size + prod_arr_size, sizeof(BC_VECTOR), 0);
-
- BC_VECTOR *n1_vector = buf;
- BC_VECTOR *prod_vector = n1_vector + n1_arr_size + n1_arr_size;
-
- for (i = 0; i < prod_arr_size; i++) {
- prod_vector[i] = 0;
- }
-
- /* Convert to BC_VECTOR[] */
- bc_convert_to_vector(n1_vector, n1end, n1len);
-
- /* Multiplication and addition */
- size_t count = 0;
- for (i = 0; i < n1_arr_size; i++) {
- /*
- * This calculation adds the result multiple times to the array entries.
- * When multiplying large numbers of digits, there is a possibility of
- * overflow, so digit adjustment is performed beforehand.
- */
- if (UNEXPECTED(count >= BC_VECTOR_NO_OVERFLOW_ADD_COUNT)) {
- bc_mul_carry_calc(prod_vector, prod_arr_size);
- count = 0;
- }
- count++;
- for (size_t j = 0; j < n1_arr_size; j++) {
- prod_vector[i + j] += n1_vector[i] * n1_vector[j];
- }
- }
-
- bc_mul_finish_from_vector(prod_vector, prod_arr_size, prodlen, prod);
-
- efree(buf);
-}
-
-/* The multiply routine. N2 times N1 is put int PROD with the scale of
- the result being MIN(N2 scale+N1 scale, MAX (SCALE, N2 scale, N1 scale)).
- */
-
bc_num bc_multiply(bc_num n1, bc_num n2, size_t scale)
{
bc_num prod;
@@ -258,24 +187,17 @@ bc_num bc_multiply(bc_num n1, bc_num n2, size_t scale)
return prod;
}
-bc_num bc_square(bc_num n1, size_t scale)
+void bc_multiply_vector(
+ const BC_VECTOR *n1_vector, size_t n1_arr_size, const BC_VECTOR *n2_vector, size_t n2_arr_size,
+ BC_VECTOR *prod_vector, size_t prod_arr_size)
{
- bc_num prod;
-
- size_t len1 = n1->n_len + n1->n_scale;
- size_t full_scale = n1->n_scale + n1->n_scale;
- size_t prod_scale = MIN(full_scale, MAX(scale, n1->n_scale));
-
- if (len1 <= BC_VECTOR_SIZE) {
- bc_fast_square(n1, len1, &prod);
+ if (n1_arr_size == 1 && n2_arr_size == 1) {
+ prod_vector[0] = *n1_vector * *n2_vector;
+ if (prod_arr_size == 2) {
+ prod_vector[1] = prod_vector[0] / BC_VECTOR_BOUNDARY_NUM;
+ prod_vector[0] %= BC_VECTOR_BOUNDARY_NUM;
+ }
} else {
- bc_standard_square(n1, len1, &prod);
+ bc_standard_vector_mul(n1_vector, n1_arr_size, n2_vector, n2_arr_size, prod_vector, prod_arr_size);
}
-
- prod->n_sign = PLUS;
- prod->n_len -= full_scale;
- prod->n_scale = prod_scale;
- _bc_rm_leading_zeros(prod);
-
- return prod;
}
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index a0503dab0600f..0f9a4b99a37bc 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -131,8 +131,10 @@ static void _php_cal_info(int cal, zval *ret)
calendar = &cal_conversion_table[cal];
array_init(ret);
- array_init(&months);
- array_init(&smonths);
+ array_init_size(&months, calendar->num_months + 1);
+ array_init_size(&smonths, calendar->num_months + 1);
+ zend_hash_real_init_packed(Z_ARRVAL(months));
+ zend_hash_real_init_packed(Z_ARRVAL(smonths));
for (i = 1; i <= calendar->num_months; i++) {
add_index_string(&months, i, calendar->month_name_long[i]);
@@ -160,7 +162,8 @@ PHP_FUNCTION(cal_info)
int i;
zval val;
- array_init(return_value);
+ array_init_size(return_value, CAL_NUM_CALS);
+ zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
for (i = 0; i < CAL_NUM_CALS; i++) {
_php_cal_info(i, &val);
diff --git a/ext/curl/curl.stub.php b/ext/curl/curl.stub.php
index c9abe237339b5..cbcb52bc7b0a2 100644
--- a/ext/curl/curl.stub.php
+++ b/ext/curl/curl.stub.php
@@ -188,6 +188,11 @@
* @cvalue CURLOPT_INFILESIZE
*/
const CURLOPT_INFILESIZE = UNKNOWN;
+/**
+ * @var int
+ * @cvalue CURLOPT_INFILESIZE_LARGE
+ */
+const CURLOPT_INFILESIZE_LARGE = UNKNOWN;
/**
* @var int
* @cvalue CURLOPT_INTERFACE
@@ -492,6 +497,24 @@
*/
const CURLOPT_DEBUGFUNCTION = UNKNOWN;
+#if LIBCURL_VERSION_NUM >= 0x080d00 /* Available since 8.13.0 */
+/**
+ * @var int
+ * @cvalue CURLFOLLOW_ALL
+ */
+const CURLFOLLOW_ALL = UNKNOWN;
+/**
+ * @var int
+ * @cvalue CURLFOLLOW_OBEYCODE
+ */
+const CURLFOLLOW_OBEYCODE = UNKNOWN;
+/**
+ * @var int
+ * @cvalue CURLFOLLOW_FIRSTONLY
+ */
+const CURLFOLLOW_FIRSTONLY = UNKNOWN;
+#endif
+
/**
* @var int
* @cvalue CURLINFO_TEXT
diff --git a/ext/curl/curl_arginfo.h b/ext/curl/curl_arginfo.h
index 6a81d1e92c88f..8928da3f47453 100644
--- a/ext/curl/curl_arginfo.h
+++ b/ext/curl/curl_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 48fc95503f4f8cc96575ff6f31fdd1e4cdc5969e */
+ * Stub hash: 792cdfa8a8ce190d73dffe679c51a41a2ee46cd7 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
@@ -263,6 +263,7 @@ static void register_curl_symbols(int module_number)
REGISTER_LONG_CONSTANT("CURLOPT_HTTP_VERSION", CURLOPT_HTTP_VERSION, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_INFILE", CURLOPT_INFILE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_INFILESIZE", CURLOPT_INFILESIZE, CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("CURLOPT_INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_INTERFACE", CURLOPT_INTERFACE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_KRB4LEVEL", CURLOPT_KRB4LEVEL, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CONST_PERSISTENT);
@@ -325,6 +326,15 @@ static void register_curl_symbols(int module_number)
REGISTER_LONG_CONSTANT("CURLOPT_WRITEHEADER", CURLOPT_WRITEHEADER, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLOPT_DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION, CONST_PERSISTENT);
+#if LIBCURL_VERSION_NUM >= 0x080d00 /* Available since 8.13.0 */
+ REGISTER_LONG_CONSTANT("CURLFOLLOW_ALL", CURLFOLLOW_ALL, CONST_PERSISTENT);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x080d00 /* Available since 8.13.0 */
+ REGISTER_LONG_CONSTANT("CURLFOLLOW_OBEYCODE", CURLFOLLOW_OBEYCODE, CONST_PERSISTENT);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x080d00 /* Available since 8.13.0 */
+ REGISTER_LONG_CONSTANT("CURLFOLLOW_FIRSTONLY", CURLFOLLOW_FIRSTONLY, CONST_PERSISTENT);
+#endif
REGISTER_LONG_CONSTANT("CURLINFO_TEXT", CURLINFO_TEXT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLINFO_HEADER_IN", CURLINFO_HEADER_IN, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CURLINFO_DATA_IN", CURLINFO_DATA_IN, CONST_PERSISTENT);
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index aebb336378bc0..dcfdf7de359f1 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1863,6 +1863,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
#if LIBCURL_VERSION_NUM >= 0x080900 /* Available since 8.9.0 */
case CURLOPT_TCP_KEEPCNT:
#endif
+ case CURLOPT_FOLLOWLOCATION:
lval = zval_get_long(zvalue);
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
(PG(open_basedir) && *PG(open_basedir)) && (lval & CURLPROTO_FILE)) {
@@ -1895,14 +1896,11 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
case CURLOPT_SSLKEYTYPE:
case CURLOPT_SSL_CIPHER_LIST:
case CURLOPT_USERAGENT:
- case CURLOPT_USERPWD:
case CURLOPT_COOKIELIST:
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
- case CURLOPT_PASSWORD:
case CURLOPT_PROXYPASSWORD:
case CURLOPT_PROXYUSERNAME:
- case CURLOPT_USERNAME:
case CURLOPT_NOPROXY:
case CURLOPT_SOCKS5_GSSAPI_SERVICE:
case CURLOPT_MAIL_FROM:
@@ -1996,6 +1994,12 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
case CURLOPT_HSTS:
#endif
case CURLOPT_KRBLEVEL:
+ // Authorization header would be implictly set
+ // with an empty string thus we explictly set the option
+ // to null to avoid this unwarranted side effect
+ case CURLOPT_USERPWD:
+ case CURLOPT_USERNAME:
+ case CURLOPT_PASSWORD:
{
if (Z_ISNULL_P(zvalue)) {
error = curl_easy_setopt(ch->cp, option, NULL);
@@ -2210,11 +2214,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
/* Do nothing, just backward compatibility */
break;
- case CURLOPT_FOLLOWLOCATION:
- lval = zend_is_true(zvalue);
- error = curl_easy_setopt(ch->cp, option, lval);
- break;
-
case CURLOPT_POSTFIELDS:
if (Z_TYPE_P(zvalue) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(zvalue)) == 0) {
@@ -2244,6 +2243,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
break;
/* Curl off_t options */
+ case CURLOPT_INFILESIZE_LARGE:
case CURLOPT_MAX_RECV_SPEED_LARGE:
case CURLOPT_MAX_SEND_SPEED_LARGE:
case CURLOPT_MAXFILESIZE_LARGE:
@@ -2746,6 +2746,7 @@ PHP_FUNCTION(curl_getinfo)
if (curl_easy_getinfo(ch->cp, option, &slist) == CURLE_OK) {
struct curl_slist *current = slist;
array_init(return_value);
+ zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
while (current) {
add_next_index_string(return_value, current->data);
current = current->next;
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index fd0a8316646f6..f664bc05e0e89 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -185,7 +185,8 @@ PHP_FUNCTION(curl_multi_get_handles)
mh = Z_CURL_MULTI_P(z_mh);
- array_init(return_value);
+ array_init_size(return_value, zend_llist_count(&mh->easyh));
+ zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
zend_llist_position pos;
zval *pz_ch;
@@ -420,10 +421,11 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
ch->cp = easy;
_php_setup_easy_copy_handlers(ch, parent);
- array_init(&headers);
+ array_init_size(&headers, num_headers);
+ zend_hash_real_init_packed(Z_ARRVAL(headers));
for (size_t i = 0; i < num_headers; i++) {
char *header = curl_pushheader_bynum(push_headers, i);
- add_next_index_string(&headers, header);
+ add_index_string(&headers, i, header);
}
ZEND_ASSERT(pz_parent_ch);
diff --git a/ext/curl/tests/Caddyfile b/ext/curl/tests/Caddyfile
index 30686f0bb9fa2..67b82434ba4c6 100644
--- a/ext/curl/tests/Caddyfile
+++ b/ext/curl/tests/Caddyfile
@@ -12,6 +12,11 @@ respond /serverpush "main response"
respond /serverpush/pushed "pushed response"
push /serverpush /serverpush/pushed
+route /show_upload_size {
+ templates
+ respond `Content-length: ={{.Req.Header.Get "Content-length"}}=`
+}
+
basic_auth /http-basic-auth {
# bcrypt password hash for "password", calculated with 'caddy hash-password'
user $2a$14$yUKl9SGqVTAAqPTzLup.DefsbXXx3kfreNnzpJOUHcIrKnr5lgef2
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION.phpt
new file mode 100644
index 0000000000000..31661e2eaffb9
--- /dev/null
+++ b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION.phpt
@@ -0,0 +1,36 @@
+--TEST--
+CURLOPT_FOLLOWLOCATION values
+--EXTENSIONS--
+curl
+--SKIPIF--
+= 8.13.0');
+?>
+--FILE--
+
+--EXPECTF--
+bool(true)
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+
diff --git a/ext/curl/tests/curl_setopt_CURLOPT_INFILESIZE_LARGE.phpt b/ext/curl/tests/curl_setopt_CURLOPT_INFILESIZE_LARGE.phpt
new file mode 100644
index 0000000000000..5063958412b5a
--- /dev/null
+++ b/ext/curl/tests/curl_setopt_CURLOPT_INFILESIZE_LARGE.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Curl option CURLOPT_INFILESIZE_LARGE
+--EXTENSIONS--
+curl
+--SKIPIF--
+
+--FILE--
+ true,
+ CURLOPT_UPLOAD => true,
+ CURLOPT_INFILE => $f,
+ CURLOPT_INFILESIZE => filesize(__FILE__),
+ CURLOPT_CONNECTTIMEOUT => 3,
+ CURLOPT_TIMEOUT => 3,
+ CURLOPT_SSL_VERIFYHOST => 0,
+ CURLOPT_SSL_VERIFYPEER => 0,
+]));
+
+var_dump(curl_exec($ch));
+
+var_dump(curl_setopt($ch, CURLOPT_INFILESIZE, -1));
+var_dump(curl_exec($ch));
+
+var_dump(curl_setopt($ch, CURLOPT_INFILESIZE_LARGE, -1));
+var_dump(curl_exec($ch));
+
+rewind($f);
+var_dump(curl_setopt($ch, CURLOPT_INFILESIZE, filesize(__FILE__)));
+var_dump(curl_exec($ch));
+var_dump(curl_setopt($ch, CURLOPT_INFILESIZE_LARGE, -1));
+var_dump(curl_exec($ch));
+
+rewind($f);
+var_dump(curl_setopt($ch, CURLOPT_INFILESIZE_LARGE, filesize(__FILE__)));
+var_dump(curl_exec($ch));
+
+var_dump(curl_error($ch));
+
+?>
+--EXPECTF--
+bool(true)
+string(21) "Content-length: =%d="
+bool(true)
+string(18) "Content-length: =="
+bool(true)
+string(18) "Content-length: =="
+bool(true)
+string(21) "Content-length: =%d="
+bool(true)
+string(18) "Content-length: =="
+bool(true)
+string(21) "Content-length: =%d="
+string(0) ""
diff --git a/ext/curl/tests/gh18458.phpt b/ext/curl/tests/gh18458.phpt
new file mode 100644
index 0000000000000..702737ac369ba
--- /dev/null
+++ b/ext/curl/tests/gh18458.phpt
@@ -0,0 +1,33 @@
+--TEST--
+GH-18458 (authorization header is set despite CURLOPT_USERPWD set to null)
+--EXTENSIONS--
+curl
+--SKIPIF--
+
+--FILE--
+
+--EXPECTF--
+%A
+bool(false)
+%A
+bool(false)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index a533552621f2a..a991c5072f941 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -4567,7 +4567,9 @@ static zval *date_interval_get_property_ptr_ptr(zend_object *object, zend_string
zend_string_equals_literal(name, "days") ||
zend_string_equals_literal(name, "invert") ) {
/* Fallback to read_property. */
- cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
+ if (cache_slot) {
+ cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
+ }
ret = NULL;
} else {
ret = zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
@@ -5514,7 +5516,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, bool calc_s
if (N > 24 || N < 0) {
N -= floor(N / 24) * 24;
}
- if (N > 24 || N < 0) {
+ if (!(N <= 24 && N >= 0)) {
RETURN_FALSE;
}
@@ -5586,7 +5588,7 @@ PHP_FUNCTION(date_sun_info)
array_init(return_value);
/* Get sun up/down and transit */
- rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -50.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit);
+ rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -35.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit);
switch (rs) {
case -1: /* always below */
add_assoc_bool(return_value, "sunrise", 0);
diff --git a/ext/date/tests/bug-gh18076.phpt b/ext/date/tests/bug-gh18076.phpt
new file mode 100644
index 0000000000000..2c1eaa200fad3
--- /dev/null
+++ b/ext/date/tests/bug-gh18076.phpt
@@ -0,0 +1,12 @@
+--TEST--
+GH-18076 (Since PHP 8, date_sun_info() returns inaccurate sunrise and sunset times)
+--FILE--
+
+--EXPECT--
+05:59:21
+18:14:48
diff --git a/ext/date/tests/date_sun_info_001.phpt b/ext/date/tests/date_sun_info_001.phpt
index 708d2550ccac5..c9096af46d4b1 100644
--- a/ext/date/tests/date_sun_info_001.phpt
+++ b/ext/date/tests/date_sun_info_001.phpt
@@ -10,9 +10,9 @@ echo "Done\n";
--EXPECT--
array(9) {
["sunrise"]=>
- int(1165897682)
+ int(1165897761)
["sunset"]=>
- int(1165934239)
+ int(1165934160)
["transit"]=>
int(1165915961)
["civil_twilight_begin"]=>
diff --git a/ext/date/tests/date_sun_info_002.phpt b/ext/date/tests/date_sun_info_002.phpt
index 1ff58295e31e3..ac319796d61c9 100644
--- a/ext/date/tests/date_sun_info_002.phpt
+++ b/ext/date/tests/date_sun_info_002.phpt
@@ -11,8 +11,8 @@ foreach ($sun_info as $key => $elem )
echo "Done\n";
?>
--EXPECT--
-2007-04-13 06:11:26 CEST sunrise
-2007-04-13 20:32:56 CEST sunset
+2007-04-13 06:13:31 CEST sunrise
+2007-04-13 20:30:51 CEST sunset
2007-04-13 13:22:11 CEST transit
2007-04-13 05:29:22 CEST civil_twilight_begin
2007-04-13 21:15:00 CEST civil_twilight_end
diff --git a/ext/date/tests/gh18304.phpt b/ext/date/tests/gh18304.phpt
new file mode 100644
index 0000000000000..4bab058a7ec4a
--- /dev/null
+++ b/ext/date/tests/gh18304.phpt
@@ -0,0 +1,35 @@
+--TEST--
+GH-18304 (Changing the properties of a DateInterval through dynamic properties triggers a SegFault)
+--CREDITS--
+orose-assetgo
+--FILE--
+$field += $i;
+var_dump($di);
+?>
+--EXPECT--
+object(DateInterval)#1 (10) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(1)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["f"]=>
+ float(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ bool(false)
+ ["from_string"]=>
+ bool(false)
+}
diff --git a/ext/date/tests/gh18481.phpt b/ext/date/tests/gh18481.phpt
new file mode 100644
index 0000000000000..074f244c3a3a3
--- /dev/null
+++ b/ext/date/tests/gh18481.phpt
@@ -0,0 +1,29 @@
+--TEST--
+GH-18481 (date_sunrise with utcOffset as INF)
+--FILE--
+
+--EXPECTF--
+Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
+
+Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
+bool(false)
+
+Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
+
+Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
+bool(false)
+
+Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
+
+Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
+bool(false)
+
+Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
+
+Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
+bool(false)
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index dcfab6d70dbbd..086998973e20a 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -1,5 +1,5 @@
/*
- +----------------------------------------------------------------------+
++----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -857,9 +857,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
}
if (!connection->info->lock.fp) {
/* stream operation already wrote an error message */
- zend_string_release_ex(resource_key, /* persistent */ false);
- zval_ptr_dtor(return_value);
- RETURN_FALSE;
+ goto fail;
}
if (!error && !php_stream_supports_lock(connection->info->lock.fp)) {
error = "Stream does not support locking";
@@ -878,9 +876,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
}
if (!connection->info->fp) {
/* stream operation already wrote an error message */
- zend_string_release_ex(resource_key, /* persistent */ false);
- zval_ptr_dtor(return_value);
- RETURN_FALSE;
+ goto fail;
}
if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) {
/* Needed because some systems do not allow to write to the original
@@ -888,9 +884,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
*/
if (SUCCESS != php_stream_cast(connection->info->fp, PHP_STREAM_AS_FD, (void*)&connection->info->fd, 1)) {
php_error_docref(NULL, E_WARNING, "Could not cast stream");
- zend_string_release_ex(resource_key, /* persistent */ false);
- zval_ptr_dtor(return_value);
- RETURN_FALSE;
+ goto fail;
#ifdef F_SETFL
} else if (modenr == DBA_CREAT) {
int flags = fcntl(connection->info->fd, F_GETFL);
@@ -924,9 +918,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
php_error_docref(NULL, E_WARNING, "Driver initialization failed for handler: %s", hptr->name);
}
}
- zend_string_release_ex(resource_key, /* persistent */ false);
- zval_ptr_dtor(return_value);
- RETURN_FALSE;
+ goto fail;
}
connection->info->hnd = hptr;
@@ -935,6 +927,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
if (zend_register_persistent_resource_ex(connection->hash, connection->info, le_pdb) == NULL) {
php_error_docref(NULL, E_WARNING, "Could not register persistent resource");
zend_string_release_ex(resource_key, /* persistent */ false);
+ dba_close_connection(connection);
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -942,6 +935,14 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
zend_hash_add_new(&DBA_G(connections), connection->hash, return_value);
zend_string_release_ex(resource_key, /* persistent */ false);
+ return;
+fail:
+ zend_string_release_ex(resource_key, /* persistent */ false);
+ zend_string_release_ex(connection->hash, persistent);
+ dba_close_info(connection->info);
+ connection->info = NULL;
+ zval_ptr_dtor(return_value);
+ RETURN_FALSE;
}
/* }}} */
diff --git a/ext/dba/tests/gh18247.phpt b/ext/dba/tests/gh18247.phpt
new file mode 100644
index 0000000000000..bb757452321d9
--- /dev/null
+++ b/ext/dba/tests/gh18247.phpt
@@ -0,0 +1,12 @@
+--TEST--
+GH-18247: dba_open() memory leak on invalid path
+--EXTENSIONS--
+dba
+--FILE--
+
+--EXPECTF--
+
+Warning: dba_popen(/inexistent): Failed to open stream: No such file or directory in %s on line %d
+bool(false)
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index e292728de271d..a0797967d1e76 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -189,9 +189,8 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
objmap->nodetype != XML_NOTATION_NODE) {
if (objmap->nodetype == DOM_NODESET) {
HashTable *nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
- zval *entry;
- zend_hash_move_forward_ex(nodeht, &iterator->pos);
- if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
+ zval *entry = zend_hash_index_find(nodeht, iterator->index);
+ if (entry) {
zval_ptr_dtor(&iterator->curobj);
ZVAL_COPY(&iterator->curobj, entry);
return;
@@ -263,8 +262,6 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
dom_object *intern;
dom_nnodemap_object *objmap;
xmlNodePtr curnode=NULL;
- HashTable *nodeht;
- zval *entry;
php_dom_iterator *iterator;
if (by_ref) {
@@ -284,9 +281,9 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
if (objmap->nodetype != XML_ENTITY_NODE &&
objmap->nodetype != XML_NOTATION_NODE) {
if (objmap->nodetype == DOM_NODESET) {
- nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
- zend_hash_internal_pointer_reset_ex(nodeht, &iterator->pos);
- if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
+ HashTable *nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
+ zval *entry = zend_hash_index_find(nodeht, 0);
+ if (entry) {
ZVAL_COPY(&iterator->curobj, entry);
}
} else {
diff --git a/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c b/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c
index 0a9f900cb566a..67aefde4f9016 100644
--- a/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c
+++ b/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c
@@ -3,7 +3,7 @@
*
* Author: Alexander Borisov
* Adapted for PHP + libxml2 by: Niels Dossche
- * Based on Lexbor 2.4.0 (upstream commit e9d35f6384de7bd8c1b79e7111bc3a44f8822967)
+ * Based on Lexbor (upstream commit b347aa4e4da4e82b1cae18989ceea1aa0278daf1)
*/
#include
@@ -967,7 +967,7 @@ lxb_selectors_state_has_relative(const xmlNode *node,
break;
}
- while (node !=root && node->next == NULL) {
+ while (node != root && node->next == NULL && node->parent != NULL) {
node = node->parent;
}
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 652ef22e506ab..0751284bdc976 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -357,7 +357,9 @@ static zval *dom_get_property_ptr_ptr(zend_object *object, zend_string *name, in
return zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
}
- cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
+ if (cache_slot) {
+ cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
+ }
return NULL;
}
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index 438857305db66..31fec5a7cabcb 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -97,7 +97,6 @@ typedef struct dom_nnodemap_object {
typedef struct {
zend_object_iterator intern;
zval curobj;
- HashPosition pos;
/* intern->index is only updated for FE_* opcodes, not for e.g. unpacking,
* yet we need to track the position of the node relative to the start. */
zend_ulong index;
diff --git a/ext/dom/tests/DOMElement_toggleAttribute.phpt b/ext/dom/tests/DOMElement_toggleAttribute.phpt
index ed29be899dac2..b9e9989e1fe09 100644
--- a/ext/dom/tests/DOMElement_toggleAttribute.phpt
+++ b/ext/dom/tests/DOMElement_toggleAttribute.phpt
@@ -87,7 +87,7 @@ echo "Checking toggled namespace:\n";
var_dump($dom->documentElement->getAttribute('xmlns:anotheron'));
?>
---EXPECT--
+--EXPECTF--
Invalid Character Error
--- Selected attribute tests (HTML) ---
bool(false)
@@ -95,10 +95,10 @@ bool(false)
bool(true)
-
+
bool(true)
-
+
bool(false)
diff --git a/ext/dom/tests/gh10234.phpt b/ext/dom/tests/gh10234.phpt
index 5edc8fc6c1ff1..11d39cd625a79 100644
--- a/ext/dom/tests/gh10234.phpt
+++ b/ext/dom/tests/gh10234.phpt
@@ -55,7 +55,7 @@ $document->documentElement->textContent = "quote 'test'";
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
?>
---EXPECT--
+--EXPECTF--
-- Attribute tests --
string(38) "
"
@@ -67,10 +67,10 @@ string(13) "hello & world"
string(50) "
"
string(9) "hi"
-string(54) "
+string(%d) "hi<\/b>")%r>
"
string(12) "quote "test""
-string(45) "
+string(%d) "
"
string(12) "quote 'test'"
string(45) "
diff --git a/ext/dom/tests/gh18304.phpt b/ext/dom/tests/gh18304.phpt
new file mode 100644
index 0000000000000..ead44306ff801
--- /dev/null
+++ b/ext/dom/tests/gh18304.phpt
@@ -0,0 +1,15 @@
+--TEST--
+GH-18304 (Changing the properties of a DateInterval through dynamic properties triggers a SegFault)
+--CREDITS--
+orose-assetgo
+--EXTENSIONS--
+dom
+--FILE--
+$field .= 'hello';
+var_dump($text->$field);
+?>
+--EXPECT--
+string(5) "hello"
diff --git a/ext/dom/tests/modern/css_selectors/lexbor274.phpt b/ext/dom/tests/modern/css_selectors/lexbor274.phpt
new file mode 100644
index 0000000000000..836280b166648
--- /dev/null
+++ b/ext/dom/tests/modern/css_selectors/lexbor274.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Lexbor #274
+--EXTENSIONS--
+dom
+--FILE--
+\n