diff --git a/.cirrus.yml b/.cirrus.yml index 28c0a8259129..a5910b782136 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,186 +1,6 @@ env: CIRRUS_CLONE_DEPTH: 1 -asan_task: - name: ASAN_DEBUG_NTS - container: - image: gcc:latest - additional_containers: - - name: mysql - image: mysql:8 - port: 3306 - cpu: 1.0 - memory: 1G - env: - MYSQL_ROOT_PASSWORD: "root" - MYSQL_DATABASE: "test" - install_script: - - apt-get update -y - - >- - apt-get install -y - bison - re2c - locales - locales-all - `#ldap-utils` - openssl - `slapd` - libgmp-dev - libicu-dev - `#libtidy-dev` - `#libenchant-dev` - libaspell-dev - libpspell-dev - libsasl2-dev - libxpm-dev - libzip-dev - `#libsqlite3-dev` - libwebp-dev - libonig-dev - libkrb5-dev - libgssapi-krb5-2 - libcurl4-openssl-dev - libxml2-dev - libxslt1-dev - libpq-dev - libreadline-dev - `#libldap2-dev` - libsodium-dev - libargon2-0-dev - libmm-dev - `#libsnmp-dev` - `#postgresql` - `#postgresql-contrib` - `#snmpd` - `#snmp-mibs-downloader` - `#freetds-dev` - `#unixodbc-dev` - llvm - clang - libc-client-dev - dovecot-core - dovecot-pop3d - dovecot-imapd - `#sendmail` - `#firebird-dev` - liblmdb-dev - libtokyocabinet-dev - libdb-dev - libqdbm-dev - libjpeg-dev - libpng-dev - libfreetype6-dev - build_script: - - ./buildconf -f - - >- - ./configure - --enable-debug - --enable-zts - --enable-option-checking=fatal - --prefix=/usr - --enable-phpdbg - --enable-fpm - --enable-opcache - --disable-opcache-jit - --with-pdo-mysql=mysqlnd - --with-mysqli=mysqlnd - `#--with-pgsql` - `#--with-pdo-pgsql` - `#--with-pdo-sqlite` - --enable-intl - --without-pear - --enable-gd - --with-jpeg - --with-webp - --with-freetype - --with-xpm - --enable-exif - --with-zip - --with-zlib - --with-zlib-dir=/usr - --enable-soap - --enable-xmlreader - --with-xsl - `#--with-tidy` - --enable-sysvsem - --enable-sysvshm - --enable-shmop - --enable-pcntl - --with-readline - --enable-mbstring - --with-curl - --with-gettext - --enable-sockets - --with-bz2 - --with-openssl - --with-gmp - --enable-bcmath - --enable-calendar - --enable-ftp - --with-pspell=/usr - `#--with-enchant=/usr` - --with-kerberos - --enable-sysvmsg - --with-ffi - --enable-zend-test - `#--enable-dl-test=shared` - `#--with-ldap` - `#--with-ldap-sasl` - --with-password-argon2 - --with-mhash - --with-sodium - --enable-dba - --with-cdb - --enable-flatfile - --enable-inifile - --with-tcadb - --with-lmdb - --with-qdbm - `#--with-snmp` - `#--with-unixODBC` - `#--with-imap` - --with-kerberos - --with-imap-ssl - `#--with-pdo-odbc=unixODBC,/usr` - `#--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient` - `#--with-oci8=shared,instantclient,/opt/oracle/instantclient` - --with-config-file-path=/etc - --with-config-file-scan-dir=/etc/php.d - `#--with-pdo-firebird` - `#--with-pdo-dblib` - --enable-werror - CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address' - CC=clang - CXX=clang++ - - make -j2 - - make install - - mkdir -p /etc/php.d - - echo opcache.enable_cli=1 > /etc/php.d/opcache.ini - - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - # Specify opcache.preload_user as we're running as root. - - echo opcache.preload_user=root >> /etc/php.d/opcache.ini - tests_script: - - export SKIP_IO_CAPTURE_TESTS=1 - - export CI_NO_IPV6=1 - - export MYSQL_TEST_HOST=127.0.0.1 - - export MYSQL_TEST_USER=root - - export MYSQL_TEST_PASSWD=root - - export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" - - export PDO_MYSQL_TEST_USER=root - - export PDO_MYSQL_TEST_PASS=root - - >- - sapi/cli/php run-tests.php - -P -q -x -j2 - -g FAIL,BORK,LEAK,XLEAK - --no-progress - --offline - --show-diff - --show-slow 1000 - --set-timeout 120 - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --asan - freebsd_task: name: FREEBSD_DEBUG_NTS freebsd_instance: diff --git a/.gitattributes b/.gitattributes index a5318009efdb..ccf0353eec4f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,11 +19,11 @@ *.php diff=php *.[ch] diff=cpp -# Collapse generated files within a pull request. -**/*_arginfo.h linguist-generated -/Zend/zend_vm_execute.h linguist-generated -/Zend/zend_vm_handlers.h linguist-generated -/Zend/zend_vm_opcodes.[ch] linguist-generated +# Collapse generated files within git and pull request diff. +**/*_arginfo.h linguist-generated -diff +/Zend/zend_vm_execute.h linguist-generated -diff +/Zend/zend_vm_handlers.h linguist-generated -diff +/Zend/zend_vm_opcodes.[ch] linguist-generated -diff # The OSS fuzz files are bunary /ext/date/tests/ossfuzz*.txt binary diff --git a/.github/actions/apt-x64/action.yml b/.github/actions/apt-x64/action.yml index 621b18532e05..704388fee8c7 100644 --- a/.github/actions/apt-x64/action.yml +++ b/.github/actions/apt-x64/action.yml @@ -46,6 +46,7 @@ runs: freetds-dev \ unixodbc-dev \ llvm \ + clang \ libc-client-dev \ dovecot-core \ dovecot-pop3d \ diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml index ee802334490a..6011a87e4878 100644 --- a/.github/actions/configure-x64/action.yml +++ b/.github/actions/configure-x64/action.yml @@ -3,6 +3,9 @@ inputs: configurationParameters: default: '' required: false + skipSlow: + default: false + required: false runs: using: composite steps: @@ -17,9 +20,9 @@ runs: --enable-fpm \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ + ${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \ --enable-intl \ --without-pear \ --enable-gd \ @@ -34,7 +37,7 @@ runs: --enable-soap \ --enable-xmlreader \ --with-xsl \ - --with-tidy \ + ${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \ --enable-sysvsem \ --enable-sysvshm \ --enable-shmop \ @@ -51,14 +54,14 @@ runs: --enable-calendar \ --enable-ftp \ --with-pspell=/usr \ - --with-enchant=/usr \ + ${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \ --with-kerberos \ --enable-sysvmsg \ --with-ffi \ --enable-zend-test \ - --enable-dl-test=shared \ - --with-ldap \ - --with-ldap-sasl \ + ${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \ --with-password-argon2 \ --with-mhash \ --with-sodium \ @@ -69,16 +72,16 @@ runs: --with-tcadb \ --with-lmdb \ --with-qdbm \ - --with-snmp \ - --with-unixODBC \ - --with-imap \ - --with-imap-ssl \ - --with-pdo-odbc=unixODBC,/usr \ - --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \ - --with-oci8=shared,instantclient,/opt/oracle/instantclient \ + ${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-oci8=shared,instantclient,/opt/oracle/instantclient' || '' }} \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ - --with-pdo-firebird \ - --with-pdo-dblib \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \ --enable-werror \ ${{ inputs.configurationParameters }} diff --git a/.github/actions/install-linux/action.yml b/.github/actions/install-linux/action.yml index 7ac2ae4c4fcb..d2f7ea23b2ef 100644 --- a/.github/actions/install-linux/action.yml +++ b/.github/actions/install-linux/action.yml @@ -1,4 +1,8 @@ name: Install +inputs: + withOci: + default: true + required: false runs: using: composite steps: @@ -10,5 +14,5 @@ runs: sudo chmod 777 /etc/php.d echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini - echo extension=oci8.so > /etc/php.d/oci8.ini - echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini + ${{ inputs.withOci == 'true' && 'echo extension=oci8.so > /etc/php.d/oci8.ini' || '' }} + ${{ inputs.withOci == 'true' && 'echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini' || '' }} diff --git a/.github/actions/setup-windows/action.yml b/.github/actions/setup-windows/action.yml new file mode 100644 index 000000000000..4786242455a1 --- /dev/null +++ b/.github/actions/setup-windows/action.yml @@ -0,0 +1,18 @@ +name: Setup +runs: + using: composite + steps: + - name: Setup MySQL + shell: pwsh + run: | + choco install mysql -y --no-progress --params="/port:3306" + mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;" + - name: Setup MSSQL + shell: pwsh + run: | + choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=Password12!" + - name: Setup PostgreSQL + shell: pwsh + run: | + Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running + pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" } diff --git a/.github/actions/setup-x64/action.yml b/.github/actions/setup-x64/action.yml index 91cf7ea51c35..bec213375b7c 100644 --- a/.github/actions/setup-x64/action.yml +++ b/.github/actions/setup-x64/action.yml @@ -12,6 +12,8 @@ runs: # Ensure local_infile tests can run. mysql -uroot -proot -e "SET GLOBAL local_infile = true" docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;" + docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "create login odbc_test with password='password', check_policy=off; create user odbc_test for login odbc_test; grant alter, control, delete to odbc_test;" + docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "ALTER SERVER ROLE sysadmin ADD MEMBER odbc_test;" sudo locale-gen de_DE ./.github/scripts/setup-slapd.sh diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index 9b7d0d100608..7657ff8c85ad 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -30,6 +30,10 @@ runs: export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8" export PGSQL_TEST_CONNSTR="host=postgres dbname=test port=5432 user=postgres password=postgres" export PDO_PGSQL_TEST_DSN="host=postgres dbname=test port=5432 user=postgres password=postgres" + export ODBC_TEST_USER="odbc_test" + export ODBC_TEST_PASS="password" + export ODBC_TEST_DSN="Driver={ODBC Driver 17 for SQL Server};Server=127.0.0.1;Database=master;uid=$ODBC_TEST_USER;pwd=$ODBC_TEST_PASS" + export PDO_ODBC_TEST_DSN="odbc:$ODBC_TEST_DSN" export SKIP_IO_CAPTURE_TESTS=1 export TEST_PHP_JUNIT=junit.out.xml export STACK_LIMIT_DEFAULTS_CHECK=1 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3d72752a23a8..34eb6ff9e8e6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -836,3 +836,38 @@ jobs: uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} + WINDOWS: + strategy: + fail-fast: false + matrix: + include: + - x64: true + zts: true + opcache: true + - x64: false + zts: false + opcache: false + name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: windows-2019 + env: + PHP_BUILD_CACHE_BASE_DIR: C:\build-cache + PHP_BUILD_OBJ_DIR: C:\obj + PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk + PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0 + PHP_BUILD_CRT: vs16 + PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} + THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}" + INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" + PARALLEL: -j2 + OPCACHE: "${{ matrix.opcache && '1' || '0' }}" + steps: + - name: git config + run: git config --global core.autocrlf false && git config --global core.eol lf + - name: git checkout + uses: actions/checkout@v3 + - name: Setup + uses: ./.github/actions/setup-windows + - name: Build + run: .github/scripts/windows/build.bat + - name: Test + run: .github/scripts/windows/test.bat diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 35519428a166..236fb31c28ec 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,6 +16,14 @@ on: - PHP-8.2 - master pull_request: + paths-ignore: + - docs/* + - NEWS + - UPGRADING + - UPGRADING.INTERNALS + - README.md + - CONTRIBUTING.md + - CODING_STANDARDS.md branches: - '**' permissions: @@ -39,11 +47,13 @@ jobs: fail-fast: false matrix: include: - - debug: true - zts: false - debug: false + zts: false + asan: false + - debug: true zts: true - name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + asan: true + name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" runs-on: ubuntu-22.04 steps: - name: git checkout @@ -62,7 +72,7 @@ jobs: # This duplicates the "job.name" expression above because # GitHub has no way to query the job name (github.job is the # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}" + key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" append-timestamp: false - name: ./configure uses: ./.github/actions/configure-x64 @@ -70,72 +80,32 @@ jobs: configurationParameters: >- --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts + ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang CXX=clang++ --disable-opcache-jit' || '' }} + skipSlow: ${{ matrix.asan }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install-linux + with: + withOci: ${{ !matrix.asan }} - name: Setup uses: ./.github/actions/setup-x64 - name: Test + if: matrix.asan == false uses: ./.github/actions/test-linux with: testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - - name: Test Tracing JIT + - name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }} uses: ./.github/actions/test-linux with: - testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT + testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }} runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 - -d opcache.jit_buffer_size=16M + ${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }} + ${{ matrix.asan && '--asan -x' || '' }} - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - LINUX_X32: - name: LINUX_X32_DEBUG_ZTS - runs-on: ubuntu-latest - container: - image: ubuntu:22.04 - env: - MYSQL_TEST_HOST: mysql - PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test - PDO_MYSQL_TEST_HOST: mysql - services: - mysql: - image: mysql:8 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - steps: - - name: git checkout - uses: actions/checkout@v3 - - name: apt - uses: ./.github/actions/apt-x32 - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - - name: ./configure - uses: ./.github/actions/configure-x32 - with: - configurationParameters: >- - --enable-debug - --enable-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux-x32 - - name: Test - uses: ./.github/actions/test-linux - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - -d opcache.jit_buffer_size=16M MACOS_DEBUG_NTS: runs-on: macos-11 steps: @@ -158,10 +128,6 @@ jobs: make -j$(sysctl -n hw.logicalcpu) >/dev/null - name: make install run: sudo make install - - name: Test - uses: ./.github/actions/test-macos - with: - testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - name: Test Tracing JIT uses: ./.github/actions/test-macos with: @@ -174,17 +140,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files WINDOWS: - strategy: - fail-fast: false - matrix: - include: - - x64: true - zts: false - opcache: true - - x64: false - zts: true - opcache: false - name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + name: WINDOWS_X64_ZTS runs-on: windows-2019 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache @@ -192,27 +148,18 @@ jobs: PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0 PHP_BUILD_CRT: vs16 - PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} - THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}" - INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" + PLATFORM: x64 + THREAD_SAFE: "1" + INTRINSICS: AVX2 PARALLEL: -j2 - OPCACHE: "${{ matrix.opcache && '1' || '0' }}" + OPCACHE: "1" steps: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf - name: git checkout uses: actions/checkout@v3 - - name: Setup MySQL - run: | - choco install mysql -y --no-progress --params="/port:3306" - mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;" - - name: Setup MSSQL - run: | - choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=Password12!" - - name: Setup PostgreSQL - run: | - Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running - pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" } + - name: Setup + uses: ./.github/actions/setup-windows - name: Build run: .github/scripts/windows/build.bat - name: Test diff --git a/NEWS b/NEWS index 90283ae15398..c5f24c90b174 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,23 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.3.0beta2 +?? ??? ????, PHP 8.3.0beta3 + +- Core: + . Fixed strerror_r detection at configuration time. (Kévin Dunglas) + +- DOM: + . adoptNode now respects the strict error checking property. (nielsdos) + . Align DOMChildNode parent checks with spec. (nielsdos) + +- Opcache: + . Avoid resetting JIT counter handlers from multiple processes/threads. + (ilutov) + +- Standard: + . Fixed bug GH-11870 (Fix off-by-one bug when truncating tempnam prefix) + (athos-ribeiro) + +03 Aug 2023, PHP 8.3.0beta2 - Bcmath . Fixed GH-11761 (removing trailing zeros from numbers) (jorgsowa) @@ -8,9 +25,28 @@ PHP NEWS - Core: . Fixed oss-fuzz #60741 (Leak in open_basedir). (ilutov) +- DOM: + . Fixed bug GH-11792 (LIBXML_NOXMLDECL is not implemented or broken). + (nielsdos) + - FFI: . Fix leaking definitions when using FFI::cdef()->new(...). (ilutov) +- Libxml: + . Fixed bug GHSA-3qrf-m4j2-pcrr (Security issue with external entity loading + in XML without enabling it). (CVE-2023-3823) (nielsdos, ilutov) + +- MBString: + . Fix use-after-free of mb_list_encodings() return value. (ilutov) + +- Opcache: + . Avoid adding an unnecessary read-lock when loading script from shm if + restart is in progress. (mikhainin) + +- Phar: + . Fixed bug GHSA-jqcx-ccgc-xwhv (Buffer mismanagement in phar_dir_read()). + (CVE-2023-3824) (nielsdos) + - Streams: . Fixed bug GH-11735 (Use-after-free when unregistering user stream wrapper from itself). (ilutov) diff --git a/UPGRADING b/UPGRADING index 56af1f0c1d41..1aa82831d524 100644 --- a/UPGRADING +++ b/UPGRADING @@ -24,8 +24,6 @@ PHP 8.3 UPGRADE NOTES Error when using more than `zend.max_allowed_stack_size-zend.reserved_stack_size` bytes of stack (`fiber.stack_size-zend.reserved_stack_size` for fibers). - . Class constants can now be accessed dynamically using the C::{$name} syntax. - RFC: https://wiki.php.net/rfc/dynamic_class_constant_fetch . Executing proc_get_status() multiple times will now always return the right value on posix systems. Previously, only the first call of the function returned the right value. Executing proc_close() after proc_get_status() will @@ -41,8 +39,6 @@ PHP 8.3 UPGRADE NOTES property to the class directly without traits. . Assigning a negative index n to an empty array will now make sure that the next index is n+1 instead of 0. - . Static variable initializers can now contain arbitrary expressions. - RFC: https://wiki.php.net/rfc/arbitrary_static_variable_initializers . Class constant visibility variance is now correctly checked when inherited from interfaces. . WeakMaps entries whose key maps to itself (possibly transitively) may now be @@ -50,10 +46,27 @@ PHP 8.3 UPGRADE NOTES iterating over the WeakMap (reachability via iteration is considered weak). Previously, such entries would never be automatically removed. +- DOM: + . DOMChildNode::after(), DOMChildNode::before(), DOMChildNode::replaceWith() + on a node that has no parent is now a no-op instead of a hierarchy exception, + which is the behaviour spec demands. + . Using the DOMParentNode and DOMChildNode methods without a document now works + instead of throwing a HIERARCHY_REQUEST_ERR DOMException. This is in line with + the behaviour spec demands. + - FFI: . C functions that have a return type of void now return null instead of returning the following object object(FFI\CData:void) { } +- Opcache: + . The opcache.consistency_checks INI directive was removed. This feature was + broken with the tracing JIT, as well as with inheritance cache, and has been + disabled without a way to enable it since PHP 8.1.18 and PHP 8.2.5. Both the + tracing JIT and inheritance cache may modify shm after the script has been + persisted, invalidating its checksum. The attempted fix skipped over the + modifiable pointers but was rejected due to complexity. For this reason, it + was decided to remove the feature instead. + - Standard: . The range() function has had various changes: * A TypeError is now thrown when passing objects, resources, or arrays @@ -95,10 +108,19 @@ PHP 8.3 UPGRADE NOTES . Added the #[\Override] attribute to check that a method exists in a parent class or implemented interface. RFC: https://wiki.php.net/rfc/marking_overriden_methods + . Class constants can now be accessed dynamically using the C::{$name} syntax. + RFC: https://wiki.php.net/rfc/dynamic_class_constant_fetch + . Static variable initializers can now contain arbitrary expressions. + RFC: https://wiki.php.net/rfc/arbitrary_static_variable_initializers - CLI . It is now possible to lint multiple files. +- Opcache + . opcache_get_status()['scripts'][n]['revalidate'] now contains a Unix + timestamp of when the next revalidation of the scripts timestamp is due, + dictated by the opcache.revalidate_freq INI directive. + - Posix . posix_getrlimit() now takes an optional $res parameter to allow fetching a single resource limit. @@ -160,8 +182,8 @@ PHP 8.3 UPGRADE NOTES RFC: https://wiki.php.net/rfc/deprecations_php_8_3#mt_rand_php - Standard: - . The assert_option() function is now deprecated. - . The ASSERT_ACTIVE, ASSERT_BAIL,ASSERT_CALLBACK, ASSERT_EXCEPTION, and + . The assert_options() function is now deprecated. + . The ASSERT_ACTIVE, ASSERT_BAIL, ASSERT_CALLBACK, ASSERT_EXCEPTION, and ASSERT_WARNING constants have been deprecated. RFC: https://wiki.php.net/rfc/assert-string-eval-cleanup @@ -200,8 +222,22 @@ PHP 8.3 UPGRADE NOTES circumvented by prepending `./` to the path. . User exception handlers now catch exceptions during shutdown. +- Calendar + . easter_date() now supports years from 1970 to 2,000,000,000 on 64-bit systems, + previously it only supported years in the range from 1970 to 2037. + +- Curl: + . curl_getinfo() now supports two new constants: CURLINFO_CAPATH and + CURLINFO_CAINFO. If option is null, the following two additional keys are + present: "capath" and "cainfo". + - Dom: . Changed DOMCharacterData::appendData() tentative return type to true. + . DOMDocument::loadHTML(), DOMDocument::loadHTMLFile(), DOMDocument::loadXML(), + and DOMDocument::loadXMLFile() now have a tentative return type of bool. + Previously, this was documented as having a return type of DOMDocument|bool, + but DOMDocument cannot be returned since PHP 8.0 as it is no longer statically + callable. - Gd: . Changed imagerotate signature, removed the `ignore_transparent` argument @@ -216,11 +252,6 @@ PHP 8.3 UPGRADE NOTES . IntlChar::enumCharNames is now returning a boolean. Previously it returned null on success and false on failure. -- Curl: - . curl_getinfo() now supports two new constants: CURLINFO_CAPATH and - CURLINFO_CAINFO. If option is null, the following two additional keys are - present: "capath" and "cainfo". - - MBString: . mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional casing rules for the Greek letter sigma. For mb_convert_case, conditional @@ -255,6 +286,11 @@ PHP 8.3 UPGRADE NOTES . mysqli_poll now raises a ValueError when the read nor error arguments are passed. +- ODBC + . odbc_autocommit() now accepts null for the $enable parameter. + Passing null has the same behaviour as passing only 1 parameter, + namely indicating if the autocommit feature is enabled or not. + - PGSQL: . pg_fetch_object now raises a ValueError instead of an Exception when the constructor_args argument is non empty with the class not having @@ -350,8 +386,12 @@ PHP 8.3 UPGRADE NOTES . Added posix_eaccess call to check the effective user id's permission for a path. - PGSQL: - . Added pg_set_error_context_visilibity to set the visibility of the context + . Added pg_set_error_context_visibility to set the visibility of the context in error messages (with libpq >= 9.6). + . Added pg_enter_pipeline_mode(). + . Added pg_exit_pipeline_mode(). + . Added pg_pipeline_sync(). + . Added pg_pipeline_status(). - Random: . Added Randomizer::getBytesFromString(). @@ -443,15 +483,32 @@ PHP 8.3 UPGRADE NOTES . SIGINFO - PGSQL: - . PGSQL_TRACE_SUPPRESS_TIMESTAMPS. - . PGSQL_TRACE_REGRESS_MODE. - . PGSQL_ERRORS_SQLSTATE. + . PGSQL_TRACE_SUPPRESS_TIMESTAMPS + . PGSQL_TRACE_REGRESS_MODE + . PGSQL_ERRORS_SQLSTATE + . PGSQL_PIPELINE_SYNC + . PGSQL_PIPELINE_ON + . PGSQL_PIPELINE_OFF + . PGSQL_PIPELINE_ABORTED + . PGSQL_SHOW_CONTEXT_NEVER + . PGSQL_SHOW_CONTEXT_ERRORS + . PGSQL_SHOW_CONTEXT_ALWAYS - Posix: - . POSIX_SC_ARG_MAX. - . POSIX_SC_PAGESIZE. - . POSIX_SC_NPROCESSORS_CONF. - . POSIX_SC_NPROCESSORS_ONLN. + . POSIX_SC_ARG_MAX + . POSIX_SC_PAGESIZE + . POSIX_SC_NPROCESSORS_CONF + . POSIX_SC_NPROCESSORS_ONLN + . POSIX_PC_LINK_MAX + . POSIX_PC_MAX_CANON + . POSIX_PC_MAX_INPUT + . POSIX_PC_NAME_MAX + . POSIX_PC_PATH_MAX + . POSIX_PC_PIPE_BUF + . POSIX_PC_CHOWN_RESTRICTED + . POSIX_PC_NO_TRUNC + . POSIX_PC_ALLOC_SIZE_MIN + . POSIX_PC_SYMLINK_MAX - Sockets: . SO_ATTACH_REUSEPORT_CBPF (Linux only). @@ -483,6 +540,8 @@ PHP 8.3 UPGRADE NOTES . ZipArchive::AFL_WANT_TORRENTZIP (libzip >= 1.10) . ZipArchive::AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE (libzip >= 1.10) . ZipArchive::FL_OPEN_FILE_NOW + . ZipArchive::LENGTH_TO_END as default value for addFile and replaceFile + . ZipArchive::LENGTH_UNCHECKED (libzip >= 1.10.1) ======================================== 11. Changes to INI File Handling @@ -565,6 +624,7 @@ PHP 8.3 UPGRADE NOTES longer takes quadratic time by default. . Getting text content from nodes now avoids an allocation, resulting in a performance gain. + . DOMChildNode::remove() now runs in O(1) performance. - Standard: . The file() flags error check is now about 7% faster. diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 4a3254b2353c..1a8c5970c7f0 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -70,8 +70,6 @@ PHP 8.3 INTERNALS UPGRADE NOTES * _php_stream_dirent now has an extra d_type field that is used to store the directory entry type. This can be used to avoid additional stat calls for types when the type is already known. -* zend_std_get_properties_for now calls the cast_object handler when casting - objects to arrays. ======================== 2. Build system changes diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 5897cce24da8..5339de4b6449 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -174,7 +174,8 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array && opline->opcode != ZEND_MATCH && zend_optimizer_update_op1_const(op_array, opline, &c)) { VAR_SOURCE(op1) = NULL; - if (!zend_bitset_in(used_ext, VAR_NUM(src->result.var))) { + if (opline->opcode != ZEND_JMP_NULL + && !zend_bitset_in(used_ext, VAR_NUM(src->result.var))) { literal_dtor(&ZEND_OP1_LITERAL(src)); MAKE_NOP(src); } diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 3c4a8019fcb4..1c3e13acff44 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -381,8 +381,6 @@ int emu(const opcode_handler_t *ip, void *fp) { fi if test "$ZEND_GCC_GLOBAL_REGS" = "yes"; then AC_DEFINE([HAVE_GCC_GLOBAL_REGS], 1, [Define if the target system has support for global register variables]) -else - HAVE_GCC_GLOBAL_REGS=no fi AC_MSG_RESULT($ZEND_GCC_GLOBAL_REGS) diff --git a/Zend/tests/bug78010.phpt b/Zend/tests/bug78010.phpt index 82334e78a25c..6b266b77b667 100644 --- a/Zend/tests/bug78010.phpt +++ b/Zend/tests/bug78010.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #78010: Segmentation fault during GC +--SKIPIF-- + --INI-- memory_limit=2G --FILE-- diff --git a/Zend/tests/in-de-crement/object_cannot_incdec.phpt b/Zend/tests/in-de-crement/object_cannot_incdec.phpt new file mode 100644 index 000000000000..39a41d61dd3e --- /dev/null +++ b/Zend/tests/in-de-crement/object_cannot_incdec.phpt @@ -0,0 +1,45 @@ +--TEST-- +Cannot increment/decrement objects +--FILE-- +getMessage(), PHP_EOL; + var_dump($o); +} +try { + $o--; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +try { + ++$o; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +try { + --$o; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +?> +--EXPECT-- +Cannot increment Foo +object(Foo)#1 (0) { +} +Cannot decrement Foo +object(Foo)#1 (0) { +} +Cannot increment Foo +object(Foo)#1 (0) { +} +Cannot decrement Foo +object(Foo)#1 (0) { +} diff --git a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt new file mode 100644 index 000000000000..b4c193a67182 --- /dev/null +++ b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt @@ -0,0 +1,45 @@ +--TEST-- +Cannot increment/decrement objects +--FILE-- +getMessage(), PHP_EOL; + var_dump($o); +} +try { + $y = $o--; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +try { + $y = ++$o; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +try { + $y = --$o; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; + var_dump($o); +} +?> +--EXPECT-- +Cannot increment Foo +object(Foo)#1 (0) { +} +Cannot decrement Foo +object(Foo)#1 (0) { +} +Cannot increment Foo +object(Foo)#1 (0) { +} +Cannot decrement Foo +object(Foo)#1 (0) { +} diff --git a/Zend/tests/in-de-crement/oss-fuzz-60709_globals.phpt b/Zend/tests/in-de-crement/oss-fuzz-60709_globals.phpt new file mode 100644 index 000000000000..d6405a28f966 --- /dev/null +++ b/Zend/tests/in-de-crement/oss-fuzz-60709_globals.phpt @@ -0,0 +1,36 @@ +--TEST-- +oss-fuzz #60709: Test +--FILE-- + +--EXPECT-- +POST DEC +Undefined variable $x +Decrement on type null has no effect, this will change in the next major version of PHP +NULL +POST INC +Undefined variable $x +NULL +PRE DEC +Undefined variable $x +Decrement on type null has no effect, this will change in the next major version of PHP +NULL +PRE INC +Undefined variable $x +int(1) diff --git a/Zend/tests/in-de-crement/oss-fuzz-60734_predec-object.phpt b/Zend/tests/in-de-crement/oss-fuzz-60734_predec-object.phpt new file mode 100644 index 000000000000..0f0e19c8c2d5 --- /dev/null +++ b/Zend/tests/in-de-crement/oss-fuzz-60734_predec-object.phpt @@ -0,0 +1,14 @@ +--TEST-- +OSS Fuzz #60734: use-after-free visible in ASAN build pre decrement. +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught TypeError: Cannot decrement Foo in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/in-de-crement/oss-fuzz-60734_preinc-object.phpt b/Zend/tests/in-de-crement/oss-fuzz-60734_preinc-object.phpt new file mode 100644 index 000000000000..3bae551f04f4 --- /dev/null +++ b/Zend/tests/in-de-crement/oss-fuzz-60734_preinc-object.phpt @@ -0,0 +1,14 @@ +--TEST-- +OSS Fuzz #60734: use-after-free visible in ASAN build pre increment. +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught TypeError: Cannot increment Foo in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/in-de-crement/overloaded_access.phpt b/Zend/tests/in-de-crement/overloaded_access.phpt new file mode 100644 index 000000000000..56a5c2b1d47a --- /dev/null +++ b/Zend/tests/in-de-crement/overloaded_access.phpt @@ -0,0 +1,36 @@ +--TEST-- +Overloaded array access with pre increment/decrement +--FILE-- +getMessage() . "\n"; +} +$foo = new Foo; +try { + $foo[0]--; +} catch (Throwable $ex) { + echo $ex->getMessage() . "\n"; +} +?> +--EXPECT-- +Cannot increment array +Cannot decrement array diff --git a/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt new file mode 100644 index 000000000000..d2f27ed32324 --- /dev/null +++ b/Zend/tests/in-de-crement/unset_globals_in_error_handler.phpt @@ -0,0 +1,130 @@ +--TEST-- +Unset variable via $GLOBALS array in error_handler +--FILE-- + +--EXPECT-- +NULL (only --) +POST DEC +Decrement on type null has no effect, this will change in the next major version of PHP +NULL +PRE DEC +Decrement on type null has no effect, this will change in the next major version of PHP +NULL +Empty string +POST INC +Increment on non-alphanumeric string is deprecated +string(0) "" +POST DEC +Decrement on empty string is deprecated as non-numeric +string(0) "" +PRE INC +Increment on non-alphanumeric string is deprecated +string(1) "1" +PRE DEC +Decrement on empty string is deprecated as non-numeric +int(-1) +Non fill ASCII (only ++) +POST INC +Increment on non-alphanumeric string is deprecated +string(4) " ad " +PRE INC +Increment on non-alphanumeric string is deprecated +string(4) " ad " +Bool +POST INC +Increment on type bool has no effect, this will change in the next major version of PHP +bool(false) +POST DEC +Decrement on type bool has no effect, this will change in the next major version of PHP +bool(false) +PRE INC +Increment on type bool has no effect, this will change in the next major version of PHP +bool(false) +PRE DEC +Decrement on type bool has no effect, this will change in the next major version of PHP +bool(false) +POST INC +Increment on type bool has no effect, this will change in the next major version of PHP +bool(true) +POST DEC +Decrement on type bool has no effect, this will change in the next major version of PHP +bool(true) +PRE INC +Increment on type bool has no effect, this will change in the next major version of PHP +bool(true) +PRE DEC +Decrement on type bool has no effect, this will change in the next major version of PHP +bool(true) diff --git a/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt new file mode 100644 index 000000000000..33d18b9a6279 --- /dev/null +++ b/Zend/tests/in-de-crement/unset_object_property_in_error_handler.phpt @@ -0,0 +1,143 @@ +--TEST-- +Unset property via error_handler +--FILE-- +a); + } +} + +$c = new C; +set_error_handler([$c, 'errorHandler']); + +/* default property value */ +var_dump(--$c->a); + +echo "NULL (only --)\n"; +echo "POST DEC\n"; +$c->a = null; +var_dump($c->a--); +unset($c->a); +echo "PRE DEC\n"; +$c->a = null; +var_dump(--$c->a); +unset($c->a); +echo "Empty string\n"; +echo "POST INC\n"; +$c->a = ""; +var_dump($c->a++); +unset($c->a); +echo "POST DEC\n"; +$c->a = ""; +var_dump($c->a--); +unset($c->a); +echo "PRE INC\n"; +$c->a = ""; +var_dump(++$c->a); +unset($c->a); +echo "PRE DEC\n"; +$c->a = ""; +var_dump(--$c->a); +unset($c->a); +echo "Non fill ASCII (only ++)\n"; +echo "POST INC\n"; +$c->a = " ad "; +var_dump($c->a++); +unset($c->a); +echo "PRE INC\n"; +$c->a = " ad "; +var_dump(++$c->a); +unset($c->a); +echo "Bool\n"; +echo "POST INC\n"; +$c->a = false; +var_dump($c->a++); +unset($c->a); +echo "POST DEC\n"; +$c->a = false; +var_dump($c->a--); +unset($c->a); +echo "PRE INC\n"; +$c->a = false; +var_dump(++$c->a); +unset($c->a); +echo "PRE DEC\n"; +$c->a = false; +var_dump(--$c->a); +unset($c->a); +echo "POST INC\n"; +$c->a = true; +var_dump($c->a++); +unset($c->a); +echo "POST DEC\n"; +$c->a = true; +var_dump($c->a--); +unset($c->a); +echo "PRE INC\n"; +$c->a = true; +var_dump(++$c->a); +unset($c->a); +echo "PRE DEC\n"; +$c->a = true; +var_dump(--$c->a); +unset($c->a); +?> +--EXPECT-- +string(87) "Decrement on type null has no effect, this will change in the next major version of PHP" +NULL +NULL (only --) +POST DEC +string(87) "Decrement on type null has no effect, this will change in the next major version of PHP" +NULL +PRE DEC +string(87) "Decrement on type null has no effect, this will change in the next major version of PHP" +NULL +Empty string +POST INC +string(50) "Increment on non-alphanumeric string is deprecated" +string(0) "" +POST DEC +string(54) "Decrement on empty string is deprecated as non-numeric" +string(0) "" +PRE INC +string(50) "Increment on non-alphanumeric string is deprecated" +string(1) "1" +PRE DEC +string(54) "Decrement on empty string is deprecated as non-numeric" +int(-1) +Non fill ASCII (only ++) +POST INC +string(50) "Increment on non-alphanumeric string is deprecated" +string(4) " ad " +PRE INC +string(50) "Increment on non-alphanumeric string is deprecated" +string(4) " ad " +Bool +POST INC +string(87) "Increment on type bool has no effect, this will change in the next major version of PHP" +bool(false) +POST DEC +string(87) "Decrement on type bool has no effect, this will change in the next major version of PHP" +bool(false) +PRE INC +string(87) "Increment on type bool has no effect, this will change in the next major version of PHP" +bool(false) +PRE DEC +string(87) "Decrement on type bool has no effect, this will change in the next major version of PHP" +bool(false) +POST INC +string(87) "Increment on type bool has no effect, this will change in the next major version of PHP" +bool(true) +POST DEC +string(87) "Decrement on type bool has no effect, this will change in the next major version of PHP" +bool(true) +PRE INC +string(87) "Increment on type bool has no effect, this will change in the next major version of PHP" +bool(true) +PRE DEC +string(87) "Decrement on type bool has no effect, this will change in the next major version of PHP" +bool(true) diff --git a/Zend/zend.c b/Zend/zend.c index 56770ac3111c..8c3351e177f2 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1646,9 +1646,15 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char * ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message) { -#ifdef HAVE_STR_ERROR_R - char buf[1024]; - strerror_r(errn, buf, sizeof(buf)); +#ifdef HAVE_STRERROR_R + char b[1024]; + +# ifdef STRERROR_R_CHAR_P + char *buf = strerror_r(errn, b, sizeof(b)); +# else + strerror_r(errn, b, sizeof(b)); + char *buf = b; +# endif #else char *buf = strerror(errn); #endif diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 7335baf849d5..5dcf7ce5d711 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2401,6 +2401,18 @@ void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *ptr, size_t size ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { +#if ZEND_MM_CUSTOM + if (UNEXPECTED(heap->use_custom_heap)) { + if (heap->custom_heap.std._malloc == tracked_malloc) { + zend_ulong h = ((uintptr_t) ptr) >> ZEND_MM_ALIGNMENT_LOG2; + zval *size_zv = zend_hash_index_find(heap->tracked_allocs, h); + if (size_zv) { + return Z_LVAL_P(size_zv); + } + } + return 0; + } +#endif return zend_mm_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } @@ -2434,6 +2446,13 @@ ZEND_API bool is_zend_ptr(const void *ptr) { #if ZEND_MM_CUSTOM if (AG(mm_heap)->use_custom_heap) { + if (AG(mm_heap)->custom_heap.std._malloc == tracked_malloc) { + zend_ulong h = ((uintptr_t) ptr) >> ZEND_MM_ALIGNMENT_LOG2; + zval *size_zv = zend_hash_index_find(AG(mm_heap)->tracked_allocs, h); + if (size_zv) { + return 1; + } + } return 0; } #endif @@ -2629,12 +2648,7 @@ ZEND_API void* ZEND_FASTCALL _erealloc2(void *ptr, size_t size, size_t copy_size ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { -#if ZEND_MM_CUSTOM - if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) { - return 0; - } -#endif - return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); + return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1595f51fb13a..5dff47798b01 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5334,11 +5334,11 @@ static void zend_compile_goto(zend_ast *ast) /* {{{ */ zend_ast *label_ast = ast->child[0]; znode label_node; zend_op *opline; - uint32_t opnum_start = get_next_op_number(); zend_compile_expr(&label_node, label_ast); /* Label resolution and unwinding adjustments happen in pass two. */ + uint32_t opnum_start = get_next_op_number(); zend_handle_loops_and_finally(NULL); opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node); opline->op1.num = get_next_op_number() - opnum_start - 1; diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index f2cb6764788b..d0c18040ab46 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -523,6 +523,12 @@ ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_prope ZEND_COLD void zend_match_unhandled_error(const zval *value); +static zend_always_inline void *zend_get_bad_ptr(void) +{ + ZEND_UNREACHABLE(); + return NULL; +} + END_EXTERN_C() #endif /* ZEND_EXECUTE_H */ diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 9efe205abe03..d2198ba2d118 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -923,6 +923,8 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ } if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_MAY_HAVE_UNDEF)) { + /* zend_handle_undef_args assumes prev_execute_data is initialized. */ + call->prev_execute_data = NULL; if (zend_handle_undef_args(call) == FAILURE) { zend_vm_stack_free_args(call); zend_vm_stack_free_call_frame(call); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 1ff5ed63782a..b18d0f46f80a 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1975,16 +1975,6 @@ ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purp } ZEND_FALLTHROUGH; case ZEND_PROP_PURPOSE_ARRAY_CAST: - if (obj->handlers->cast_object != std_object_handlers.cast_object) { - zval result; - if (obj->handlers->cast_object(obj, &result, IS_ARRAY) == SUCCESS) { - return Z_ARRVAL(result); - } - if (EG(exception)) { - return NULL; - } - } - ZEND_FALLTHROUGH; case ZEND_PROP_PURPOSE_SERIALIZE: case ZEND_PROP_PURPOSE_VAR_EXPORT: case ZEND_PROP_PURPOSE_JSON: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 293d7cc029ea..7f1b3234acea 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2657,9 +2657,18 @@ ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ } break; case IS_FALSE: - case IS_TRUE: + case IS_TRUE: { + /* Error handler can undef/change type of op1, save it and reset it in case those cases */ + zval copy; + ZVAL_COPY_VALUE(©, op1); zend_error(E_WARNING, "Increment on type bool has no effect, this will change in the next major version of PHP"); + zval_ptr_dtor(op1); + ZVAL_COPY_VALUE(op1, ©); + if (EG(exception)) { + return FAILURE; + } break; + } case IS_REFERENCE: op1 = Z_REFVAL_P(op1); goto try_again; @@ -2735,19 +2744,31 @@ ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ } } break; - case IS_NULL: + case IS_NULL: { + /* Error handler can undef/change type of op1, save it and reset it in case those cases */ + zval copy; + ZVAL_COPY_VALUE(©, op1); zend_error(E_WARNING, "Decrement on type null has no effect, this will change in the next major version of PHP"); + zval_ptr_dtor(op1); + ZVAL_COPY_VALUE(op1, ©); if (EG(exception)) { return FAILURE; } break; + } case IS_FALSE: - case IS_TRUE: + case IS_TRUE: { + /* Error handler can undef/change type of op1, save it and reset it in case those cases */ + zval copy; + ZVAL_COPY_VALUE(©, op1); zend_error(E_WARNING, "Decrement on type bool has no effect, this will change in the next major version of PHP"); + zval_ptr_dtor(op1); + ZVAL_COPY_VALUE(op1, ©); if (EG(exception)) { return FAILURE; } break; + } case IS_REFERENCE: op1 = Z_REFVAL_P(op1); goto try_again; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b2e3e60a2941..51f35118d9de 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1500,9 +1500,6 @@ ZEND_VM_HELPER(zend_pre_inc_helper, VAR|CV, ANY) } } increment_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -1555,9 +1552,6 @@ ZEND_VM_HELPER(zend_pre_dec_helper, VAR|CV, ANY) } } decrement_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -9350,6 +9344,21 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +ZEND_VM_TYPE_SPEC_HANDLER(ZEND_COUNT, (op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY, ZEND_COUNT_ARRAY, CV|TMPVAR, UNUSED) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + ZEND_VM_COLD_CONST_HANDLER(191, ZEND_GET_CLASS, UNUSED|CONST|TMPVAR|CV, UNUSED) { USE_OPLINE diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 1db9b06a1788..90f105f611e6 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4491,7 +4491,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE break; } - retval_ptr = NULL; + retval_ptr = zend_get_bad_ptr(); if (IS_CONST == IS_VAR) { ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); @@ -5209,7 +5209,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_ SAVE_OPLINE(); if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { - array_ref = array_ptr = NULL; + array_ref = array_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -7313,7 +7313,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C SAVE_OPLINE(); if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -7670,7 +7670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -9644,7 +9644,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_T SAVE_OPLINE(); if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -9951,7 +9951,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLE } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -10567,7 +10567,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_U SAVE_OPLINE(); if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -10794,7 +10794,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -12021,7 +12021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C SAVE_OPLINE(); if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -12327,7 +12327,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -18216,6 +18216,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(_get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -19278,7 +19293,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER break; } - retval_ptr = NULL; + retval_ptr = zend_get_bad_ptr(); if (IS_TMP_VAR == IS_VAR) { ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); @@ -19545,7 +19560,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z SAVE_OPLINE(); if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { - array_ref = array_ptr = NULL; + array_ref = array_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -20027,7 +20042,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CON SAVE_OPLINE(); if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -20171,7 +20186,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -20471,7 +20486,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP SAVE_OPLINE(); if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -20615,7 +20630,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMPVAR_HANDLER( } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -20932,7 +20947,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNU SAVE_OPLINE(); if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -21076,7 +21091,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER( } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -21336,7 +21351,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_ SAVE_OPLINE(); if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { - expr_ptr = NULL; + expr_ptr = zend_get_bad_ptr(); if (Z_ISREF_P(expr_ptr)) { Z_ADDREF_P(expr_ptr); } else { @@ -21480,7 +21495,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND } } } else { - zval *value_ptr = NULL; + zval *value_ptr = zend_get_bad_ptr(); /* If a function call result is yielded and the function did * not return by reference we throw a notice. */ @@ -21624,9 +21639,6 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_inc_help } } increment_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -21697,9 +21709,6 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_dec_help } } decrement_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -38999,9 +39008,6 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_inc_help } } increment_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -39071,9 +39077,6 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_dec_help } } decrement_function(var_ptr); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } } while (0); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -49855,6 +49858,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(EX_VAR(opline->op1.var)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if (IS_CV & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -56018,6 +56036,11 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_LABEL, (void*)&&ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_LABEL, (void*)&&ZEND_RECV_NOTYPE_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_LABEL, (void*)&&ZEND_JMP_FORWARD_SPEC_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, @@ -58928,6 +58951,10 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_COUNT_SPEC_TMPVAR_UNUSED) ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); HYBRID_CASE(ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED): VM_TRACE(ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED) ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -61250,6 +61277,10 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_COUNT_SPEC_CV_UNUSED) ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_ARRAY_SPEC_CV_UNUSED): + VM_TRACE(ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) + ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); HYBRID_CASE(ZEND_GET_CLASS_SPEC_CV_UNUSED): VM_TRACE(ZEND_GET_CLASS_SPEC_CV_UNUSED) ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -64127,6 +64158,11 @@ void zend_vm_init(void) ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_HANDLER, ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_HANDLER, ZEND_RECV_NOTYPE_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER, ZEND_JMP_FORWARD_SPEC_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, @@ -65077,7 +65113,7 @@ void zend_vm_init(void) 1255, 1256 | SPEC_RULE_OP1, 1261 | SPEC_RULE_OP1, - 3471, + 3476, 1266 | SPEC_RULE_OP1, 1271 | SPEC_RULE_OP1, 1276 | SPEC_RULE_OP2, @@ -65236,58 +65272,58 @@ void zend_vm_init(void) 2565, 2566, 2567, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, - 3471, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, }; #if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) zend_opcode_handler_funcs = labels; @@ -65460,7 +65496,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 = 2570 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2575 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -65468,7 +65504,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 = 2595 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2600 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -65476,7 +65512,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 = 2620 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2625 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -65487,17 +65523,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 = 2645 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2650 | 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 = 2670 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2675 | 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 = 2695 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2700 | SPEC_RULE_OP1 | SPEC_RULE_OP2; } break; case ZEND_MUL: @@ -65508,17 +65544,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 = 2720 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2725 | 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 = 2745 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2750 | 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 = 2770 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2775 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_IDENTICAL: @@ -65529,14 +65565,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 = 2795 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2800 | 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 = 2870 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2875 | 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 = 3095 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 3100 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_NOT_IDENTICAL: @@ -65547,14 +65583,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 = 2945 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2950 | 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 = 3020 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3025 | 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 = 3100 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 3105 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_EQUAL: @@ -65565,12 +65601,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 = 2795 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2800 | 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 = 2870 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2875 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_NOT_EQUAL: @@ -65581,12 +65617,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 = 2945 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2950 | 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 = 3020 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3025 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_SMALLER: @@ -65594,12 +65630,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 = 3105 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3110 | 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 = 3180 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3185 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } break; case ZEND_IS_SMALLER_OR_EQUAL: @@ -65607,54 +65643,54 @@ 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 = 3255 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3260 | 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 = 3330 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3335 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } break; case ZEND_QM_ASSIGN: if (op1_info == MAY_BE_LONG) { - spec = 3417 | SPEC_RULE_OP1; - } else if (op1_info == MAY_BE_DOUBLE) { spec = 3422 | 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))))) { + } else if (op1_info == MAY_BE_DOUBLE) { spec = 3427 | 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 = 3432 | SPEC_RULE_OP1; } break; case ZEND_PRE_INC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3405 | SPEC_RULE_RETVAL; + spec = 3410 | SPEC_RULE_RETVAL; } else if (op1_info == MAY_BE_LONG) { - spec = 3407 | SPEC_RULE_RETVAL; + spec = 3412 | SPEC_RULE_RETVAL; } break; case ZEND_PRE_DEC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3409 | SPEC_RULE_RETVAL; + spec = 3414 | SPEC_RULE_RETVAL; } else if (op1_info == MAY_BE_LONG) { - spec = 3411 | SPEC_RULE_RETVAL; + spec = 3416 | SPEC_RULE_RETVAL; } break; case ZEND_POST_INC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3413; + spec = 3418; } else if (op1_info == MAY_BE_LONG) { - spec = 3414; + spec = 3419; } break; case ZEND_POST_DEC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3415; + spec = 3420; } else if (op1_info == MAY_BE_LONG) { - spec = 3416; + spec = 3421; } break; case ZEND_JMP: if (OP_JMP_ADDR(op, op->op1) > op) { - spec = 2569; + spec = 2574; } break; case ZEND_RECV: @@ -65664,17 +65700,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t 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 = 3467; + spec = 3472; } 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 = 3462 | SPEC_RULE_OP1; + spec = 3467 | 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 = 3469 | SPEC_RULE_RETVAL; + spec = 3474 | SPEC_RULE_RETVAL; } break; case ZEND_FETCH_DIM_R: @@ -65682,17 +65718,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 = 3432 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 3437 | 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 = 3468; + spec = 3473; } break; case ZEND_SEND_VAR: if (op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) { - spec = 3457 | SPEC_RULE_OP1; + spec = 3462 | SPEC_RULE_OP1; + } + break; + case ZEND_COUNT: + if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY) { + spec = 2569 | SPEC_RULE_OP1; } break; case ZEND_BW_OR: diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 0f6154c64db9..79b765387127 100755 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -232,9 +232,9 @@ $op1_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr(opline->op1_type, opline->op1, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "NULL", "CV" => "_get_zval_ptr_cv_\\1(opline->op1.var EXECUTE_DATA_CC)", "TMPVAR" => "???", @@ -243,9 +243,9 @@ $op2_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr(opline->op2_type, opline->op2, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "NULL", "CV" => "_get_zval_ptr_cv_\\1(opline->op2.var EXECUTE_DATA_CC)", "TMPVAR" => "???", @@ -298,9 +298,9 @@ $op1_get_zval_ptr_ptr_undef = array( "ANY" => "get_zval_ptr_ptr_undef(opline->op1_type, opline->op1, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "NULL", "CV" => "EX_VAR(opline->op1.var)", "TMPVAR" => "???", @@ -309,9 +309,9 @@ $op2_get_zval_ptr_ptr_undef = array( "ANY" => "get_zval_ptr_ptr_undef(opline->op2_type, opline->op2, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "NULL", "CV" => "EX_VAR(opline->op2.var)", "TMPVAR" => "???", @@ -386,9 +386,9 @@ $op1_get_obj_zval_ptr_ptr = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op1_type, opline->op1, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "&EX(This)", "CV" => "_get_zval_ptr_cv_\\1(opline->op1.var EXECUTE_DATA_CC)", "TMPVAR" => "???", @@ -397,9 +397,9 @@ $op2_get_obj_zval_ptr_ptr = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, opline->op2, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "&EX(This)", "CV" => "_get_zval_ptr_cv_\\1(opline->op2.var EXECUTE_DATA_CC)", "TMPVAR" => "???", @@ -408,9 +408,9 @@ $op1_get_obj_zval_ptr_ptr_undef = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op1_type, opline->op1, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "&EX(This)", "CV" => "EX_VAR(opline->op1.var)", "TMPVAR" => "???", @@ -419,9 +419,9 @@ $op2_get_obj_zval_ptr_ptr_undef = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, opline->op2, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "&EX(This)", "CV" => "EX_VAR(opline->op2.var)", "TMPVAR" => "???", @@ -518,9 +518,9 @@ $op_data_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr((opline+1)->op1_type, (opline+1)->op1, \\1)", - "TMP" => "NULL", + "TMP" => "zend_get_bad_ptr()", "VAR" => "_get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC)", - "CONST" => "NULL", + "CONST" => "zend_get_bad_ptr()", "UNUSED" => "NULL", "CV" => "_get_zval_ptr_cv_\\1((opline+1)->op1.var EXECUTE_DATA_CC)", "TMPVAR" => "???", diff --git a/Zend/zend_vm_handlers.h b/Zend/zend_vm_handlers.h index 97dfeac30cae..400b5c606a88 100644 --- a/Zend/zend_vm_handlers.h +++ b/Zend/zend_vm_handlers.h @@ -1364,497 +1364,500 @@ _(2566, ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED) \ _(2567, ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV) \ _(2568, ZEND_RECV_NOTYPE_SPEC) \ - _(2569, ZEND_JMP_FORWARD_SPEC) \ - _(2575, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2576, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2577, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2579, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2570, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \ + _(2571, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \ + _(2573, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \ + _(2574, ZEND_JMP_FORWARD_SPEC) \ _(2580, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2581, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2582, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2584, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2590, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2591, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2592, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2594, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2600, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ - _(2601, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2602, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2604, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2585, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2586, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2587, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2589, 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) \ + _(2597, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2599, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2605, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ _(2606, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2607, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2609, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2615, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ - _(2616, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2617, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2619, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2625, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2626, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2627, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2629, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2610, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2611, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2612, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2614, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2620, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2621, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2622, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2624, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2630, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2631, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2632, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2634, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2640, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2641, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2642, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2644, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2646, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2647, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2649, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2650, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2651, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2652, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2654, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2635, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2636, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2637, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2639, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2645, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2646, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2647, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2649, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2651, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2652, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2654, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ _(2655, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2656, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2657, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2659, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2665, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2666, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2667, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2669, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2671, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2672, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2674, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2675, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ - _(2676, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2677, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2679, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2660, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2661, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2662, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2664, 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) \ + _(2672, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2674, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2676, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2677, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2679, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ _(2680, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ _(2681, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2682, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2684, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2690, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ - _(2691, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2692, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2694, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2696, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2697, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2699, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2700, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2701, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2702, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2704, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2685, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2686, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2687, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2689, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2695, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2696, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2697, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2699, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2701, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2702, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2704, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ _(2705, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2706, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2707, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2709, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2715, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2716, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2717, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2719, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2725, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2726, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2727, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2729, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2710, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2711, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2712, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2714, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2720, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2721, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2722, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2724, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2730, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2731, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2732, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2734, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2740, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2741, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2742, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2744, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2750, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ - _(2751, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2752, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2754, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2735, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2736, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2737, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2739, 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) \ + _(2747, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2749, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2755, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ _(2756, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2757, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2759, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2765, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ - _(2766, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2767, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2769, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2775, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2776, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2777, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2779, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2760, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2761, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2762, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2764, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2770, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2771, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2772, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2774, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2780, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2781, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2782, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2784, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2790, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2791, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2792, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2794, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2810, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2811, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2812, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2813, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2814, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2815, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2816, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2817, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2818, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2822, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2823, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2824, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(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) \ - _(2855, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2856, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2857, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2858, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2859, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2860, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2861, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2862, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2863, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2867, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2868, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2869, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2885, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2886, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2887, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2888, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2889, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2890, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2891, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2892, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2893, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2897, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2898, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2899, ZEND_IS_EQUAL_DOUBLE_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) \ - _(2930, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2931, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2932, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2933, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2934, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2935, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2936, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2937, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2938, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2942, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2943, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2944, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2960, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2961, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2962, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2963, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2964, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2965, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2966, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2967, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2968, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2972, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2973, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2974, ZEND_IS_NOT_EQUAL_LONG_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) \ - _(3005, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3006, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3007, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3008, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3009, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3010, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3011, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3012, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3013, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3017, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3018, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3019, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3035, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3036, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3037, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3038, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3039, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3040, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3041, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3042, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3043, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3047, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3048, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3049, ZEND_IS_NOT_EQUAL_DOUBLE_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) \ - _(3080, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3081, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3082, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3083, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3084, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3085, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3086, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3087, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3088, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3092, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3093, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3094, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3095, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ - _(3099, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \ - _(3100, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ - _(3104, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \ - _(3108, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3109, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3110, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3111, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3112, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3113, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3117, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3118, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3119, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3120, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ - _(3121, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3122, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3123, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3124, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3125, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3126, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3127, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3128, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3132, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3133, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3134, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_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) \ - _(3165, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ - _(3166, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3167, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3168, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3169, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3170, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3171, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3172, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3173, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3177, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3178, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3179, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3183, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3184, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3185, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3186, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3187, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3188, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3192, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3193, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3194, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3195, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3196, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3197, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3207, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3209, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_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) \ - _(3240, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3241, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3242, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3243, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3244, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3245, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3246, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3247, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3248, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3252, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3253, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3254, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3258, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3259, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3260, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3261, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3262, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3263, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3267, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3268, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3269, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3270, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3271, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3272, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3282, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3284, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_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) \ - _(3315, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3316, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3317, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3318, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3319, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3320, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3321, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3322, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3323, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3327, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3328, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3329, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3333, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3334, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3335, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3336, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3337, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3338, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3342, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3343, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3344, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3345, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3346, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3347, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3357, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3359, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_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) \ - _(3390, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3391, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3392, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3393, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3394, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3395, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3396, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3397, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3398, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3402, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3403, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3404, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3405, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ - _(3406, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ - _(3407, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \ - _(3408, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \ - _(3409, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ - _(3410, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ - _(3411, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \ - _(3412, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \ - _(3413, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \ - _(3414, ZEND_POST_INC_LONG_SPEC_CV) \ - _(3415, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \ - _(3416, ZEND_POST_DEC_LONG_SPEC_CV) \ - _(3417, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \ - _(3418, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3419, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3421, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3422, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \ - _(3423, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3424, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3426, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3427, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \ - _(3428, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3429, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3431, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3433, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3434, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3436, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3437, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ - _(3438, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3439, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3441, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(2785, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2786, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2787, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2789, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2795, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2796, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2797, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2799, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2815, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2816, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2817, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2818, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2819, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2820, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2821, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2822, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2823, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2827, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2828, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2831, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2832, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2833, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2834, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2835, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2836, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2837, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2838, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2842, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2843, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2844, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2860, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2861, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2862, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2863, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2864, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2865, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2866, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2867, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2868, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2872, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2873, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2874, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2890, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2891, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2892, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2893, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2894, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2895, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2896, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2897, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2898, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2902, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2903, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2906, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2907, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2908, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2909, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2910, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2911, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2912, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2913, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2917, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2918, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2919, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2935, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2936, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2937, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2938, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2939, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2940, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2941, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2942, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2943, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2947, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2948, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2949, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2965, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2966, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2967, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2968, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2969, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2970, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2971, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2972, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2973, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2977, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2978, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2981, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2982, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2983, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2984, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2985, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2986, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2987, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2988, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2992, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2993, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2994, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3010, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3011, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3012, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3013, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3014, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3015, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3016, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3017, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3018, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3022, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3023, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3024, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3040, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3041, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3042, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3043, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3044, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3045, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3046, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3047, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3048, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3052, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3053, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3056, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3057, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3058, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3059, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3060, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3061, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3062, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3063, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3067, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3068, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3069, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3085, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3086, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3087, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3088, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3089, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3090, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3091, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3092, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3093, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3097, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3098, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3099, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3100, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3104, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3105, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3109, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3113, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3114, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3115, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3116, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3117, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3118, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3122, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3123, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3124, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3125, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3126, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3127, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3128, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3129, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3130, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3131, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3132, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3133, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3142, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3143, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3144, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3145, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3146, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3147, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3148, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3153, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3154, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3170, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3171, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3172, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3173, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3174, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3175, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3176, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3177, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3178, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3183, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3184, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3188, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3189, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3190, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3191, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3192, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3193, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3197, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3204, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3205, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3206, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3207, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3217, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3218, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3219, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3220, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3221, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3222, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3223, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3228, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3229, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3245, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3246, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3247, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3248, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3249, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3250, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3251, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3252, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3253, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3258, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3259, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3263, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3264, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3265, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3266, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3267, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3268, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3272, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3279, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3280, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3281, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3282, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3292, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3293, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3294, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3295, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3296, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3297, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3298, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3303, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3304, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3320, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3321, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3322, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3323, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3324, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3325, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3326, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3327, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3328, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3333, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3334, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3338, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3339, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3340, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3341, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3342, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3343, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3347, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3354, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3355, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3356, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3357, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3367, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3368, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3369, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3370, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3371, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3372, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3373, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3378, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3379, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3395, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3396, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3397, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3398, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3399, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3400, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3401, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3402, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3403, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3408, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3409, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3410, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3411, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3412, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3413, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \ + _(3414, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3415, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3416, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3417, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \ + _(3418, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3419, ZEND_POST_INC_LONG_SPEC_CV) \ + _(3420, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3421, ZEND_POST_DEC_LONG_SPEC_CV) \ + _(3422, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \ + _(3423, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3424, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3426, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3427, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \ + _(3428, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3429, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3431, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3432, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \ + _(3433, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3434, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3436, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3438, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3439, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3441, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ _(3442, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ _(3443, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ _(3444, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ _(3446, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3452, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \ - _(3453, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3454, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3456, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3459, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \ - _(3461, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \ - _(3464, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \ - _(3466, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \ - _(3467, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \ - _(3468, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \ - _(3469, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \ - _(3470, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \ - _(3470+1, ZEND_NULL) + _(3447, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ + _(3448, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3449, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3451, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \ + _(3458, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3459, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3461, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3464, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \ + _(3466, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \ + _(3469, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \ + _(3471, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \ + _(3472, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \ + _(3473, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \ + _(3474, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \ + _(3475, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \ + _(3475+1, ZEND_NULL) diff --git a/build/gen_stub.php b/build/gen_stub.php index 7e3ba56984e6..1fff123d84c0 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2735,27 +2735,15 @@ public function getClassSynopsisDocument(array $classMap, iterable $allConstInfo public function getClassSynopsisElement(DOMDocument $doc, array $classMap, iterable $allConstInfos): ?DOMElement { $classSynopsis = $doc->createElement("classsynopsis"); - if ($this->type === "interface") { - $classSynopsis->setAttribute("class", "interface"); - } - $classSynopsis->appendChild(new DOMText("\n ")); + $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class"); - $ooElement = self::createOoElement($doc, $this, true, false, false, 4); + $exceptionOverride = $this->isException($classMap) ? "exception" : null; + $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, 4); if (!$ooElement) { return null; } + $classSynopsis->appendChild(new DOMText("\n ")); $classSynopsis->appendChild($ooElement); - $classSynopsis->appendChild(new DOMText("\n\n ")); - - $classSynopsisInfo = $doc->createElement("classsynopsisinfo"); - $classSynopsisInfo->appendChild(new DOMText("\n ")); - $ooElement = self::createOoElement($doc, $this, false, true, false, 5); - if (!$ooElement) { - return null; - } - $classSynopsisInfo->appendChild($ooElement); - - $classSynopsis->appendChild($classSynopsisInfo); foreach ($this->extends as $k => $parent) { $parentInfo = $classMap[$parent->toString()] ?? null; @@ -2766,33 +2754,32 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera $ooElement = self::createOoElement( $doc, $parentInfo, + null, false, - false, - $k === 0 && $this->type === "class", - 5 + $k === 0 ? "extends" : null, + 4 ); if (!$ooElement) { return null; } - $classSynopsisInfo->appendChild(new DOMText("\n\n ")); - $classSynopsisInfo->appendChild($ooElement); + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsis->appendChild($ooElement); } - foreach ($this->implements as $interface) { + foreach ($this->implements as $k => $interface) { $interfaceInfo = $classMap[$interface->toString()] ?? null; if (!$interfaceInfo) { throw new Exception("Missing implemented interface " . $interface->toString()); } - $ooElement = self::createOoElement($doc, $interfaceInfo, false, false, false, 5); + $ooElement = self::createOoElement($doc, $interfaceInfo, null, false, $k === 0 ? "implements" : null, 4); if (!$ooElement) { return null; } - $classSynopsisInfo->appendChild(new DOMText("\n\n ")); - $classSynopsisInfo->appendChild($ooElement); + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsis->appendChild($ooElement); } - $classSynopsisInfo->appendChild(new DOMText("\n ")); /** @var array $parentsWithInheritedConstants */ $parentsWithInheritedConstants = []; @@ -2921,9 +2908,9 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera private static function createOoElement( DOMDocument $doc, ClassInfo $classInfo, - bool $overrideToClass, + ?string $typeOverride, bool $withModifiers, - bool $isExtends, + ?string $modifierOverride, int $indentationLevel ): ?DOMElement { $indentation = str_repeat(" ", $indentationLevel); @@ -2933,12 +2920,12 @@ private static function createOoElement( return null; } - $type = $overrideToClass ? "class" : $classInfo->type; + $type = $typeOverride !== null ? $typeOverride : $classInfo->type; $ooElement = $doc->createElement("oo$type"); $ooElement->appendChild(new DOMText("\n$indentation ")); - if ($isExtends) { - $ooElement->appendChild($doc->createElement('modifier', 'extends')); + if ($modifierOverride !== null) { + $ooElement->appendChild($doc->createElement('modifier', $modifierOverride)); $ooElement->appendChild(new DOMText("\n$indentation ")); } elseif ($withModifiers) { if ($classInfo->flags & Class_::MODIFIER_FINAL) { @@ -3046,6 +3033,40 @@ private function collectInheritedMembers( } } + /** @param array $classMap */ + private function isException(array $classMap): bool + { + if ($this->name->toString() === "Throwable") { + return true; + } + + foreach ($this->extends as $parentName) { + $parent = $classMap[$parentName->toString()] ?? null; + if ($parent === null) { + throw new Exception("Missing parent class " . $parentName->toString()); + } + + if ($parent->isException($classMap)) { + return true; + } + } + + if ($this->type === "class") { + foreach ($this->implements as $interfaceName) { + $interface = $classMap[$interfaceName->toString()] ?? null; + if ($interface === null) { + throw new Exception("Missing implemented interface " . $interfaceName->toString()); + } + + if ($interface->isException($classMap)) { + return true; + } + } + } + + return false; + } + private function hasConstructor(): bool { foreach ($this->funcInfos as $funcInfo) { diff --git a/configure.ac b/configure.ac index 46c653673dd1..03f8b95b90cd 100644 --- a/configure.ac +++ b/configure.ac @@ -648,9 +648,11 @@ asprintf \ nanosleep \ memmem \ memrchr \ -strerror_r \ ) +dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version. +AC_FUNC_STRERROR_R + AX_FUNC_WHICH_GETHOSTBYNAME_R dnl Some systems (like OpenSolaris) do not have nanosleep in libc. @@ -1255,14 +1257,14 @@ fi dnl Configuring Zend and TSRM. dnl ---------------------------------------------------------------------------- +PHP_HELP_SEPARATOR([Zend:]) +PHP_CONFIGURE_PART(Configuring Zend) + AC_ARG_ENABLE([fiber-asm], [AS_HELP_STRING([--disable-fiber-asm], [Disable the use of boost fiber assembly files])], [fiber_asm=$enableval], [fiber_asm='yes']) -PHP_HELP_SEPARATOR([Zend:]) -PHP_CONFIGURE_PART(Configuring Zend) - AS_CASE([$host_cpu], [x86_64*|amd64*], [fiber_cpu="x86_64"], [x86*|amd*|i?86*|pentium], [fiber_cpu="i386"], @@ -1375,7 +1377,6 @@ fi ZEND_EXTRA_LIBS="$LIBS" unset LIBS -PHP_HELP_SEPARATOR([TSRM:]) PHP_CONFIGURE_PART(Configuring TSRM) if test "$PHP_THREAD_SAFETY" = "yes"; then TSRM_CHECK_PTHREADS diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index c319abd17fef..579e8af72eac 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -13,6 +13,7 @@ | Authors: Shane Caraveo | | Colin Viebrock | | Hartmut Holzgraefe | + | Arne Perschke | +----------------------------------------------------------------------+ */ @@ -21,6 +22,10 @@ #include "sdncal.h" #include +/** + * If `gm` is true this will return the timestamp at midnight on Easter of the given year. If it is false this + * will return the number of days Easter is after March 21st. + */ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm) { /* based on code by Simon Kershaw, */ @@ -48,10 +53,27 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm) } } - if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */ + #ifdef ZEND_ENABLE_ZVAL_LONG64 + /* Compiling for 64bit, allow years between 1970 and 2.000.000.000 */ + if (gm && year < 1970) { + /* timestamps only start after 1970 */ + zend_argument_value_error(1, "must be a year after 1970 (inclusive)"); + RETURN_THROWS(); + } + + if (gm && year > 2000000000) { + /* timestamps only go up to the year 2.000.000.000 */ + zend_argument_value_error(1, "must be a year before 2.000.000.000 (inclusive)"); + RETURN_THROWS(); + } + #else + /* Compiling for 32bit, allow years between 1970 and 2037 */ + if (gm && (year < 1970 || year > 2037)) { zend_argument_value_error(1, "must be between 1970 and 2037 (inclusive)"); RETURN_THROWS(); } + #endif + golden = (year % 19) + 1; /* the Golden number */ diff --git a/ext/calendar/tests/easter_date.phpt b/ext/calendar/tests/easter_date_32bit.phpt similarity index 81% rename from ext/calendar/tests/easter_date.phpt rename to ext/calendar/tests/easter_date_32bit.phpt index a41c310de9b8..52f880edc113 100644 --- a/ext/calendar/tests/easter_date.phpt +++ b/ext/calendar/tests/easter_date_32bit.phpt @@ -1,5 +1,7 @@ --TEST-- -easter_date() +Test easter_date() on 32bit systems +--SKIPIF-- + --INI-- date.timezone=UTC --ENV-- diff --git a/ext/calendar/tests/easter_date_64bit.phpt b/ext/calendar/tests/easter_date_64bit.phpt new file mode 100644 index 000000000000..3939b7e4a4d4 --- /dev/null +++ b/ext/calendar/tests/easter_date_64bit.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test easter_date() on 64bit systems +--SKIPIF-- + +--INI-- +date.timezone=UTC +--ENV-- +TZ=UTC +--EXTENSIONS-- +calendar +--FILE-- +getMessage()}\n"; +} +?> +--EXPECT-- +2000-04-23 +2001-04-15 +2002-03-31 +2045-04-09 +2046-03-25 +2047-04-14 +easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive) diff --git a/ext/calendar/tests/easter_date_checks_upper_bound_32bit.phpt b/ext/calendar/tests/easter_date_checks_upper_bound_32bit.phpt new file mode 100644 index 000000000000..6a9cee8027fb --- /dev/null +++ b/ext/calendar/tests/easter_date_checks_upper_bound_32bit.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test easter_date() on 32bit systems checks the upper year limit +--SKIPIF-- + +--INI-- +date.timezone=UTC +--ENV-- +TZ=UTC +--EXTENSIONS-- +calendar +--FILE-- +getMessage()}\n"; +} +?> +--EXPECT-- +easter_date(): Argument #1 ($year) must be between 1970 and 2037 (inclusive) diff --git a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt new file mode 100644 index 000000000000..2c7afbdfa2d9 --- /dev/null +++ b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test easter_date() on 64bit systems checks the upper year limit +--SKIPIF-- + +--INI-- +date.timezone=UTC +--ENV-- +TZ=UTC +--EXTENSIONS-- +calendar +--FILE-- +getMessage()}\n"; +} +?> +--EXPECT-- +easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive) diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 93b1c414b7c7..0c73d8c4a3a7 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -431,10 +431,6 @@ static int com_objects_compare(zval *object1, zval *object2) static zend_result com_object_cast(zend_object *readobj, zval *writeobj, int type) { - if (type == IS_ARRAY) { - return FAILURE; - } - php_com_dotnet_object *obj; VARIANT v; VARTYPE vt = VT_EMPTY; diff --git a/ext/curl/tests/curl_basic_009.phpt b/ext/curl/tests/curl_basic_009.phpt index 26bc35891cca..ade7cffcb828 100644 --- a/ext/curl/tests/curl_basic_009.phpt +++ b/ext/curl/tests/curl_basic_009.phpt @@ -7,7 +7,8 @@ curl --FILE-- tok = cursor; s->len = 0; -#line 1135 "ext/date/lib/parse_date.re" +#line 1136 "ext/date/lib/parse_date.re" -#line 1010 "" +#line 1011 "" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1187,23 +1188,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(2, *YYCURSOR); ++YYCURSOR; YYDEBUG(3, *YYCURSOR); -#line 1968 "ext/date/lib/parse_date.re" +#line 1969 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 1196 "" +#line 1197 "" yy4: YYDEBUG(4, *YYCURSOR); ++YYCURSOR; yy5: YYDEBUG(5, *YYCURSOR); -#line 1974 "ext/date/lib/parse_date.re" +#line 1975 "ext/date/lib/parse_date.re" { add_error(s, TIMELIB_ERR_UNEXPECTED_CHARACTER, "Unexpected character"); goto std; } -#line 1207 "" +#line 1208 "" yy6: YYDEBUG(6, *YYCURSOR); yyaccept = 0; @@ -1218,11 +1219,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy58; yy8: YYDEBUG(8, *YYCURSOR); -#line 1963 "ext/date/lib/parse_date.re" +#line 1964 "ext/date/lib/parse_date.re" { goto std; } -#line 1226 "" +#line 1227 "" yy9: YYDEBUG(9, *YYCURSOR); yych = *++YYCURSOR; @@ -1256,11 +1257,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(11, *YYCURSOR); ++YYCURSOR; YYDEBUG(12, *YYCURSOR); -#line 1958 "ext/date/lib/parse_date.re" +#line 1959 "ext/date/lib/parse_date.re" { goto std; } -#line 1264 "" +#line 1265 "" yy13: YYDEBUG(13, *YYCURSOR); yyaccept = 1; @@ -1761,7 +1762,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy20: YYDEBUG(20, *YYCURSOR); -#line 1873 "ext/date/lib/parse_date.re" +#line 1874 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -1775,7 +1776,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 1779 "" +#line 1780 "" yy21: YYDEBUG(21, *YYCURSOR); yych = *++YYCURSOR; @@ -3580,7 +3581,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy81: YYDEBUG(81, *YYCURSOR); -#line 1620 "ext/date/lib/parse_date.re" +#line 1621 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenoyearrev"); TIMELIB_INIT; @@ -3591,7 +3592,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 3595 "" +#line 3596 "" yy82: YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; @@ -4106,7 +4107,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } if (yych == '.') goto yy289; YYDEBUG(114, *YYCURSOR); -#line 1195 "ext/date/lib/parse_date.re" +#line 1196 "ext/date/lib/parse_date.re" { timelib_ull i; @@ -4131,7 +4132,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 4135 "" +#line 4136 "" yy115: YYDEBUG(115, *YYCURSOR); ++YYCURSOR; @@ -5857,7 +5858,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy177: YYDEBUG(177, *YYCURSOR); -#line 1361 "ext/date/lib/parse_date.re" +#line 1362 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("timetiny24 | timeshort24 | timelong24 | iso8601long"); @@ -5884,7 +5885,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 5888 "" +#line 5889 "" yy178: YYDEBUG(178, *YYCURSOR); yyaccept = 4; @@ -6913,7 +6914,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy224: YYDEBUG(224, *YYCURSOR); -#line 1455 "ext/date/lib/parse_date.re" +#line 1456 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("americanshort | american"); @@ -6928,7 +6929,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 6932 "" +#line 6933 "" yy225: YYDEBUG(225, *YYCURSOR); yyaccept = 5; @@ -7171,7 +7172,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy431; yy251: YYDEBUG(251, *YYCURSOR); -#line 1537 "ext/date/lib/parse_date.re" +#line 1538 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datefull"); @@ -7185,7 +7186,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 7189 "" +#line 7190 "" yy252: YYDEBUG(252, *YYCURSOR); yyaccept = 3; @@ -7299,7 +7300,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'e') goto yy440; yy260: YYDEBUG(260, *YYCURSOR); -#line 1942 "ext/date/lib/parse_date.re" +#line 1943 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -7314,7 +7315,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 7318 "" +#line 7319 "" yy261: YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; @@ -7760,7 +7761,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy471; yy290: YYDEBUG(290, *YYCURSOR); -#line 1221 "ext/date/lib/parse_date.re" +#line 1222 "ext/date/lib/parse_date.re" { timelib_sll i; timelib_ull us; @@ -7799,7 +7800,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 7803 "" +#line 7804 "" yy291: YYDEBUG(291, *YYCURSOR); yych = *++YYCURSOR; @@ -7824,7 +7825,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy293: YYDEBUG(293, *YYCURSOR); -#line 1783 "ext/date/lib/parse_date.re" +#line 1784 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("ago"); TIMELIB_INIT; @@ -7844,7 +7845,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 7848 "" +#line 7849 "" yy294: YYDEBUG(294, *YYCURSOR); yyaccept = 7; @@ -7883,7 +7884,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy295: YYDEBUG(295, *YYCURSOR); -#line 1863 "ext/date/lib/parse_date.re" +#line 1864 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -7892,7 +7893,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 7896 "" +#line 7897 "" yy296: YYDEBUG(296, *YYCURSOR); yyaccept = 7; @@ -8467,7 +8468,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy315: YYDEBUG(315, *YYCURSOR); -#line 1804 "ext/date/lib/parse_date.re" +#line 1805 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -8484,7 +8485,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 8488 "" +#line 8489 "" yy316: YYDEBUG(316, *YYCURSOR); yych = *++YYCURSOR; @@ -8752,7 +8753,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy325: YYDEBUG(325, *YYCURSOR); -#line 1606 "ext/date/lib/parse_date.re" +#line 1607 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datetextual | datenoyear"); @@ -8765,7 +8766,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 8769 "" +#line 8770 "" yy326: YYDEBUG(326, *YYCURSOR); yyaccept = 10; @@ -9459,7 +9460,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy351: YYDEBUG(351, *YYCURSOR); -#line 1152 "ext/date/lib/parse_date.re" +#line 1153 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("now"); TIMELIB_INIT; @@ -9467,7 +9468,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 9471 "" +#line 9472 "" yy352: YYDEBUG(352, *YYCURSOR); yyaccept = 2; @@ -10970,7 +10971,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy420: YYDEBUG(420, *YYCURSOR); -#line 1389 "ext/date/lib/parse_date.re" +#line 1390 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("gnunocolon"); TIMELIB_INIT; @@ -10992,7 +10993,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 10996 "" +#line 10997 "" yy421: YYDEBUG(421, *YYCURSOR); yyaccept = 13; @@ -11073,7 +11074,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy422: YYDEBUG(422, *YYCURSOR); -#line 1774 "ext/date/lib/parse_date.re" +#line 1775 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("year4"); TIMELIB_INIT; @@ -11081,7 +11082,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 11085 "" +#line 11086 "" yy423: YYDEBUG(423, *YYCURSOR); yyaccept = 3; @@ -11688,7 +11689,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(456, *YYCURSOR); ++YYCURSOR; YYDEBUG(457, *YYCURSOR); -#line 1323 "ext/date/lib/parse_date.re" +#line 1324 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); TIMELIB_INIT; @@ -11705,7 +11706,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 11709 "" +#line 11710 "" yy458: YYDEBUG(458, *YYCURSOR); yych = *++YYCURSOR; @@ -13032,7 +13033,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy526: YYDEBUG(526, *YYCURSOR); -#line 1161 "ext/date/lib/parse_date.re" +#line 1162 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("noon"); TIMELIB_INIT; @@ -13043,7 +13044,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 13047 "" +#line 13048 "" yy527: YYDEBUG(527, *YYCURSOR); yyaccept = 2; @@ -14089,7 +14090,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy567: YYDEBUG(567, *YYCURSOR); -#line 1523 "ext/date/lib/parse_date.re" +#line 1524 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshort"); @@ -14102,7 +14103,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 14106 "" +#line 14107 "" yy568: YYDEBUG(568, *YYCURSOR); yyaccept = 15; @@ -14553,7 +14554,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy600: YYDEBUG(600, *YYCURSOR); -#line 1592 "ext/date/lib/parse_date.re" +#line 1593 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenodayrev"); @@ -14566,7 +14567,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 14570 "" +#line 14571 "" yy601: YYDEBUG(601, *YYCURSOR); yych = *++YYCURSOR; @@ -15941,7 +15942,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(696, *YYCURSOR); ++YYCURSOR; YYDEBUG(697, *YYCURSOR); -#line 1578 "ext/date/lib/parse_date.re" +#line 1579 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenoday"); @@ -15954,7 +15955,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 15958 "" +#line 15959 "" yy698: YYDEBUG(698, *YYCURSOR); yych = *++YYCURSOR; @@ -16515,7 +16516,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy722: YYDEBUG(722, *YYCURSOR); -#line 1173 "ext/date/lib/parse_date.re" +#line 1174 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("midnight | today"); TIMELIB_INIT; @@ -16524,7 +16525,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16528 "" +#line 16529 "" yy723: YYDEBUG(723, *YYCURSOR); yych = *++YYCURSOR; @@ -16834,7 +16835,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy897; yy739: YYDEBUG(739, *YYCURSOR); -#line 1564 "ext/date/lib/parse_date.re" +#line 1565 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pointed date YY"); @@ -16847,7 +16848,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 16851 "" +#line 16852 "" yy740: YYDEBUG(740, *YYCURSOR); yyaccept = 15; @@ -16959,7 +16960,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy752: YYDEBUG(752, *YYCURSOR); -#line 1509 "ext/date/lib/parse_date.re" +#line 1510 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshorter"); @@ -16972,7 +16973,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 16976 "" +#line 16977 "" yy753: YYDEBUG(753, *YYCURSOR); yyaccept = 18; @@ -17221,7 +17222,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy777: YYDEBUG(777, *YYCURSOR); -#line 1435 "ext/date/lib/parse_date.re" +#line 1436 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("iso8601nocolon"); @@ -17240,7 +17241,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 17244 "" +#line 17245 "" yy778: YYDEBUG(778, *YYCURSOR); yyaccept = 19; @@ -18468,7 +18469,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy849: YYDEBUG(849, *YYCURSOR); -#line 1912 "ext/date/lib/parse_date.re" +#line 1913 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -18497,7 +18498,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 18501 "" +#line 18502 "" yy850: YYDEBUG(850, *YYCURSOR); yyaccept = 20; @@ -19541,7 +19542,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy926: YYDEBUG(926, *YYCURSOR); -#line 1670 "ext/date/lib/parse_date.re" +#line 1671 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgydotd"); @@ -19554,7 +19555,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 19558 "" +#line 19559 "" yy927: YYDEBUG(927, *YYCURSOR); yyaccept = 21; @@ -19808,7 +19809,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '7') goto yy1059; yy942: YYDEBUG(942, *YYCURSOR); -#line 1703 "ext/date/lib/parse_date.re" +#line 1704 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweek"); @@ -19826,7 +19827,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 19830 "" +#line 19831 "" yy943: YYDEBUG(943, *YYCURSOR); yych = *++YYCURSOR; @@ -20302,7 +20303,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'e') goto yy1094; yy982: YYDEBUG(982, *YYCURSOR); -#line 1846 "ext/date/lib/parse_date.re" +#line 1847 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -20318,7 +20319,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 20322 "" +#line 20323 "" yy983: YYDEBUG(983, *YYCURSOR); yych = *++YYCURSOR; @@ -20665,7 +20666,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1020, *YYCURSOR); ++YYCURSOR; YYDEBUG(1021, *YYCURSOR); -#line 1552 "ext/date/lib/parse_date.re" +#line 1553 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pointed date YYYY"); TIMELIB_INIT; @@ -20676,7 +20677,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 20680 "" +#line 20681 "" yy1022: YYDEBUG(1022, *YYCURSOR); ++YYCURSOR; @@ -20705,7 +20706,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1025: YYDEBUG(1025, *YYCURSOR); -#line 1483 "ext/date/lib/parse_date.re" +#line 1484 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("iso8601date2"); @@ -20718,7 +20719,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 20722 "" +#line 20723 "" yy1026: YYDEBUG(1026, *YYCURSOR); yyaccept = 15; @@ -20938,7 +20939,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1043: YYDEBUG(1043, *YYCURSOR); -#line 1471 "ext/date/lib/parse_date.re" +#line 1472 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); TIMELIB_INIT; @@ -20949,7 +20950,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 20953 "" +#line 20954 "" yy1044: YYDEBUG(1044, *YYCURSOR); yyaccept = 26; @@ -21064,7 +21065,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1048: YYDEBUG(1048, *YYCURSOR); -#line 1632 "ext/date/lib/parse_date.re" +#line 1633 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenocolon"); TIMELIB_INIT; @@ -21075,7 +21076,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 21079 "" +#line 21080 "" yy1049: YYDEBUG(1049, *YYCURSOR); yych = *++YYCURSOR; @@ -21145,7 +21146,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1059, *YYCURSOR); ++YYCURSOR; YYDEBUG(1060, *YYCURSOR); -#line 1684 "ext/date/lib/parse_date.re" +#line 1685 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweekday"); @@ -21163,7 +21164,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 21167 "" +#line 21168 "" yy1061: YYDEBUG(1061, *YYCURSOR); yych = *++YYCURSOR; @@ -21226,7 +21227,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1143; yy1070: YYDEBUG(1070, *YYCURSOR); -#line 1722 "ext/date/lib/parse_date.re" +#line 1723 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextshort"); @@ -21239,7 +21240,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 21243 "" +#line 21244 "" yy1071: YYDEBUG(1071, *YYCURSOR); yych = *++YYCURSOR; @@ -21712,7 +21713,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy1107: YYDEBUG(1107, *YYCURSOR); -#line 1183 "ext/date/lib/parse_date.re" +#line 1184 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("tomorrow"); TIMELIB_INIT; @@ -21723,7 +21724,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21727 "" +#line 21728 "" yy1108: YYDEBUG(1108, *YYCURSOR); yyaccept = 28; @@ -22060,7 +22061,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1140, *YYCURSOR); ++YYCURSOR; YYDEBUG(1141, *YYCURSOR); -#line 1736 "ext/date/lib/parse_date.re" +#line 1737 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextreverse"); @@ -22073,7 +22074,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 22077 "" +#line 22078 "" yy1142: YYDEBUG(1142, *YYCURSOR); ++YYCURSOR; @@ -22117,7 +22118,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1145: YYDEBUG(1145, *YYCURSOR); -#line 1278 "ext/date/lib/parse_date.re" +#line 1279 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("backof | frontof"); TIMELIB_INIT; @@ -22139,7 +22140,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 22143 "" +#line 22144 "" yy1146: YYDEBUG(1146, *YYCURSOR); yyaccept = 29; @@ -22463,7 +22464,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1172: YYDEBUG(1172, *YYCURSOR); -#line 1822 "ext/date/lib/parse_date.re" +#line 1823 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -22486,7 +22487,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22490 "" +#line 22491 "" yy1173: YYDEBUG(1173, *YYCURSOR); yych = *++YYCURSOR; @@ -22498,7 +22499,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy1175: YYDEBUG(1175, *YYCURSOR); -#line 1140 "ext/date/lib/parse_date.re" +#line 1141 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("yesterday"); TIMELIB_INIT; @@ -22509,7 +22510,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22513 "" +#line 22514 "" yy1176: YYDEBUG(1176, *YYCURSOR); yyaccept = 31; @@ -23002,7 +23003,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1222, *YYCURSOR); ++YYCURSOR; YYDEBUG(1223, *YYCURSOR); -#line 1888 "ext/date/lib/parse_date.re" +#line 1889 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); TIMELIB_INIT; @@ -23025,7 +23026,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 23029 "" +#line 23030 "" yy1224: YYDEBUG(1224, *YYCURSOR); yych = *++YYCURSOR; @@ -23527,7 +23528,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1268, *YYCURSOR); ++YYCURSOR; YYDEBUG(1269, *YYCURSOR); -#line 1301 "ext/date/lib/parse_date.re" +#line 1302 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -23548,7 +23549,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 23552 "" +#line 23553 "" yy1270: YYDEBUG(1270, *YYCURSOR); yyaccept = 24; @@ -23595,7 +23596,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1273, *YYCURSOR); ++YYCURSOR; YYDEBUG(1274, *YYCURSOR); -#line 1261 "ext/date/lib/parse_date.re" +#line 1262 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("firstdayof | lastdayof"); TIMELIB_INIT; @@ -23611,12 +23612,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 23615 "" +#line 23616 "" yy1275: YYDEBUG(1275, *YYCURSOR); ++YYCURSOR; YYDEBUG(1276, *YYCURSOR); -#line 1497 "ext/date/lib/parse_date.re" +#line 1498 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("iso8601datex"); TIMELIB_INIT; @@ -23627,7 +23628,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 23631 "" +#line 23632 "" yy1277: YYDEBUG(1277, *YYCURSOR); yych = *++YYCURSOR; @@ -23730,7 +23731,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1290, *YYCURSOR); ++YYCURSOR; YYDEBUG(1291, *YYCURSOR); -#line 1341 "ext/date/lib/parse_date.re" +#line 1342 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("mssqltime"); TIMELIB_INIT; @@ -23749,7 +23750,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 23753 "" +#line 23754 "" yy1292: YYDEBUG(1292, *YYCURSOR); yych = *++YYCURSOR; @@ -24173,7 +24174,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1331; yy1329: YYDEBUG(1329, *YYCURSOR); -#line 1644 "ext/date/lib/parse_date.re" +#line 1645 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); @@ -24198,7 +24199,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 24202 "" +#line 24203 "" yy1330: YYDEBUG(1330, *YYCURSOR); yych = *++YYCURSOR; @@ -24568,7 +24569,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy1383; yy1375: YYDEBUG(1375, *YYCURSOR); -#line 1750 "ext/date/lib/parse_date.re" +#line 1751 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("clf"); @@ -24591,7 +24592,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 24595 "" +#line 24596 "" yy1376: YYDEBUG(1376, *YYCURSOR); yyaccept = 33; @@ -24823,7 +24824,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == ':') goto yy1286; goto yy1329; } -#line 1978 "ext/date/lib/parse_date.re" +#line 1979 "ext/date/lib/parse_date.re" } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 8895c9bd0b21..3159ff7fa8ca 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -674,7 +674,8 @@ static void timelib_eat_spaces(const char **ptr) *ptr += 2; continue; } - } while (false); + break; + } while (true); } static void timelib_eat_until_separator(const char **ptr) diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 35253c426a7d..a532bf60356c 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -30,9 +30,9 @@ # include "timelib_config.h" #endif -#define TIMELIB_VERSION 202208 -#define TIMELIB_EXTENDED_VERSION 20220801 -#define TIMELIB_ASCII_VERSION "2022.08" +#define TIMELIB_VERSION 202209 +#define TIMELIB_EXTENDED_VERSION 20220901 +#define TIMELIB_ASCII_VERSION "2022.09" #include #include diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 0fae1380674d..48c82bf7ec69 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -4956,6 +4956,12 @@ PHP_METHOD(DatePeriod, __construct) RETURN_THROWS(); } } else { + /* check initialisation */ + DATE_CHECK_INITIALIZED(Z_PHPDATE_P(start)->time, date_ce_interface); + if (end) { + DATE_CHECK_INITIALIZED(Z_PHPDATE_P(end)->time, date_ce_interface); + } + /* init */ php_interval_obj *intobj = Z_PHPINTERVAL_P(interval); @@ -5483,6 +5489,11 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, Has if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) { php_date_obj *date_obj; date_obj = Z_PHPDATE_P(ht_entry); + + if (!date_obj->time) { + return 0; + } + if (period_obj->start != NULL) { timelib_time_dtor(period_obj->start); } @@ -5500,6 +5511,11 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, Has if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) { php_date_obj *date_obj; date_obj = Z_PHPDATE_P(ht_entry); + + if (!date_obj->time) { + return 0; + } + if (period_obj->end != NULL) { timelib_time_dtor(period_obj->end); } @@ -5516,6 +5532,11 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, Has if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) { php_date_obj *date_obj; date_obj = Z_PHPDATE_P(ht_entry); + + if (!date_obj->time) { + return 0; + } + if (period_obj->current != NULL) { timelib_time_dtor(period_obj->current); } @@ -5532,6 +5553,11 @@ static bool php_date_period_initialize_from_hash(php_period_obj *period_obj, Has if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_interval) { php_interval_obj *interval_obj; interval_obj = Z_PHPINTERVAL_P(ht_entry); + + if (!interval_obj->initialized) { + return 0; + } + if (period_obj->interval != NULL) { timelib_rel_time_dtor(period_obj->interval); } diff --git a/ext/date/tests/bug-gh11416.phpt b/ext/date/tests/bug-gh11416.phpt new file mode 100644 index 000000000000..546867924cb4 --- /dev/null +++ b/ext/date/tests/bug-gh11416.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug GH-11416: Crash with DatePeriod when uninitialised objects are passed in +--INI-- +date.timezone=UTC +--FILE-- +newInstanceWithoutConstructor(); +try { + new DatePeriod($date, new DateInterval('P1D'), 2); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +$date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); +try { + new DatePeriod($now, new DateInterval('P1D'), $date); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +$date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); +$dateperiod = (new ReflectionClass(DatePeriod::class))->newInstanceWithoutConstructor(); +$dateinterval = (new ReflectionClass(DateInterval::class))->newInstanceWithoutConstructor(); +try { + $dateperiod->__unserialize(['start' => $date]); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +try { + $dateperiod->__unserialize(['start' => $now, 'end' => $date]); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +try { + $dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $date]); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +try { + $dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $now, 'interval' => $dateinterval]); +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} + +try { + $dateperiod->__unserialize([ + 'start' => $now, 'end' => $now, 'current' => $now, 'interval' => $simpleInterval, + 'recurrences' => 2, 'include_start_date' => true, 'include_end_date' => true, + ]); + echo "DatePeriod::__unserialize: SUCCESS\n"; +} catch (Error $e) { + echo get_class($e), ': ', $e->getMessage(), "\n"; +} +echo "OK\n"; +?> +--EXPECT-- +DateObjectError: Object of type DateTimeInterface has not been correctly initialized by calling parent::__construct() in its constructor +DateObjectError: Object of type DateTimeInterface has not been correctly initialized by calling parent::__construct() in its constructor +Error: Invalid serialization data for DatePeriod object +Error: Invalid serialization data for DatePeriod object +Error: Invalid serialization data for DatePeriod object +Error: Invalid serialization data for DatePeriod object +DatePeriod::__unserialize: SUCCESS +OK diff --git a/ext/date/tests/gh11854.phpt b/ext/date/tests/gh11854.phpt new file mode 100644 index 000000000000..ddcce97d1ed1 --- /dev/null +++ b/ext/date/tests/gh11854.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug GH-11854 (DateTime:createFromFormat stopped parsing DateTime with extra space) +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +object(DateTime)#1 (3) { + ["date"]=> + string(26) "2023-08-02 08:37:50.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} diff --git a/ext/dba/tests/dba_tcadb.phpt b/ext/dba/tests/dba_tcadb.phpt index 6459c5b372ea..d0a0e34cb8e3 100644 --- a/ext/dba/tests/dba_tcadb.phpt +++ b/ext/dba/tests/dba_tcadb.phpt @@ -23,7 +23,7 @@ require_once __DIR__ . '/setup/setup_dba_tests.inc'; $db_name = 'dba_tcadb.tch'; cleanup_standard_db($db_name); ?> ---EXPECT-- +--EXPECTF-- === RUNNING WITH FILE LOCK === Remove key 1 and 3 bool(true) @@ -71,4 +71,4 @@ array(6) { === RUNNING WITH DB LOCK (default) === SAME OUTPUT AS PREVIOUS RUN === RUNNING WITH NO LOCK === -SAME OUTPUT AS PREVIOUS RUN +SAME OUTPUT AS PREVIOUS RUN%S diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 0cbfc2c61305..c5ed97a44f9c 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -62,7 +62,7 @@ PHP_METHOD(DOMAttr, __construct) oldnode = dom_object_get_node(intern); if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern); } diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index e95e1a9030f3..08d4937341d1 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -52,7 +52,7 @@ PHP_METHOD(DOMCdataSection, __construct) intern = Z_DOMOBJ_P(ZEND_THIS); oldnode = dom_object_get_node(intern); if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); } diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 76fe3200d462..16a52a5a4e24 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -50,13 +50,11 @@ PHP_METHOD(DOMComment, __construct) } intern = Z_DOMOBJ_P(ZEND_THIS); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern); + oldnode = dom_object_get_node(intern); + if (oldnode != NULL) { + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } + php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern); } /* }}} end DOMComment::__construct */ diff --git a/ext/dom/document.c b/ext/dom/document.c index aabccd072085..bfb06d7e4cca 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -23,6 +23,7 @@ #if defined(HAVE_LIBXML) && defined(HAVE_DOM) #include "php_dom.h" #include +#include #ifdef LIBXML_SCHEMAS_ENABLED #include #include @@ -187,7 +188,7 @@ int dom_document_standalone_read(dom_object *obj, zval *retval) return FAILURE; } - ZVAL_BOOL(retval, docp->standalone); + ZVAL_BOOL(retval, docp->standalone > 0); return SUCCESS; } @@ -1062,8 +1063,8 @@ PHP_METHOD(DOMDocument, adoptNode) || nodep->type == XML_DTD_NODE || nodep->type == XML_ENTITY_NODE || nodep->type == XML_NOTATION_NODE)) { - php_dom_throw_error(NOT_SUPPORTED_ERR, true); - RETURN_THROWS(); + php_dom_throw_error(NOT_SUPPORTED_ERR, dom_get_strict_error(dom_object_nodep->document)); + RETURN_FALSE; } xmlDocPtr new_document; @@ -1126,22 +1127,20 @@ PHP_METHOD(DOMDocument, __construct) } intern = Z_DOMOBJ_P(ZEND_THIS); - if (intern != NULL) { - olddoc = (xmlDocPtr) dom_object_get_node(intern); - if (olddoc != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern); - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern); - if (refcount != 0) { - olddoc->_private = NULL; - } + olddoc = (xmlDocPtr) dom_object_get_node(intern); + if (olddoc != NULL) { + php_libxml_decrement_node_ptr((php_libxml_node_object *) intern); + refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern); + if (refcount != 0) { + olddoc->_private = NULL; } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp) == -1) { - /* docp is always non-null so php_libxml_increment_doc_ref() never returns -1 */ - ZEND_UNREACHABLE(); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern); } + intern->document = NULL; + if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp) == -1) { + /* docp is always non-null so php_libxml_increment_doc_ref() never returns -1 */ + ZEND_UNREACHABLE(); + } + php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern); } /* }}} end DOMDocument::__construct */ @@ -1203,17 +1202,13 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so { xmlDocPtr ret; xmlParserCtxtPtr ctxt = NULL; - dom_object *intern; - php_libxml_ref_obj *document = NULL; int validate, recover, resolve_externals, keep_blanks, substitute_ent; int resolved_path_len; int old_error_reporting = 0; char *directory=NULL, resolved_path[MAXPATHLEN + 1]; - if (id != NULL) { - intern = Z_DOMOBJ_P(id); - document = intern->document; - } + dom_object *intern = Z_DOMOBJ_P(id); + php_libxml_ref_obj *document = intern->document; libxml_doc_props const* doc_props = dom_get_doc_props_read_only(document); validate = doc_props->validateonparse; @@ -1284,6 +1279,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so options |= XML_PARSE_NOBLANKS; } + php_libxml_sanitize_parse_ctxt_options(ctxt); xmlCtxtUseOptions(ctxt, options); ctxt->recovery = recover; @@ -1315,22 +1311,52 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so } /* }}} */ +static void dom_finish_loading_document(zval *this, zval *return_value, xmlDocPtr newdoc) +{ + if (!newdoc) + RETURN_FALSE; + + dom_object *intern = Z_DOMOBJ_P(this); + size_t old_modification_nr = 0; + if (intern != NULL) { + xmlDocPtr docp = (xmlDocPtr) dom_object_get_node(intern); + dom_doc_propsptr doc_prop = NULL; + if (docp != NULL) { + const php_libxml_doc_ptr *doc_ptr = docp->_private; + ZEND_ASSERT(doc_ptr != NULL); /* Must exist, we have a document */ + old_modification_nr = doc_ptr->cache_tag.modification_nr; + php_libxml_decrement_node_ptr((php_libxml_node_object *) intern); + doc_prop = intern->document->doc_props; + intern->document->doc_props = NULL; + int refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern); + if (refcount != 0) { + docp->_private = NULL; + } + } + intern->document = NULL; + if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) { + RETURN_FALSE; + } + intern->document->doc_props = doc_prop; + } + + php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern); + /* Since iterators should invalidate, we need to start the modification number from the old counter */ + if (old_modification_nr != 0) { + php_libxml_doc_ptr* doc_ptr = (php_libxml_doc_ptr*) ((php_libxml_node_object*) intern)->node; /* downcast */ + doc_ptr->cache_tag.modification_nr = old_modification_nr; + php_libxml_invalidate_node_list_cache(doc_ptr); + } + + RETURN_TRUE; +} + /* {{{ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) */ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { - zval *id; - xmlDoc *docp = NULL, *newdoc; - dom_doc_propsptr doc_prop; - dom_object *intern; char *source; size_t source_len; - int refcount, ret; zend_long options = 0; - id = getThis(); - if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) { - id = NULL; - } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) { RETURN_THROWS(); } @@ -1348,48 +1374,9 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { RETURN_FALSE; } - newdoc = dom_document_parser(id, mode, source, source_len, options); - - if (!newdoc) - RETURN_FALSE; - - if (id != NULL) { - intern = Z_DOMOBJ_P(id); - size_t old_modification_nr = 0; - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - const php_libxml_doc_ptr *doc_ptr = docp->_private; - ZEND_ASSERT(doc_ptr != NULL); /* Must exist, we have a document */ - old_modification_nr = doc_ptr->cache_tag.modification_nr; - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) { - RETURN_FALSE; - } - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern); - /* Since iterators should invalidate, we need to start the modification number from the old counter */ - if (old_modification_nr != 0) { - php_libxml_doc_ptr* doc_ptr = (php_libxml_doc_ptr*) ((php_libxml_node_object*) intern)->node; /* downcast */ - doc_ptr->cache_tag.modification_nr = old_modification_nr; - php_libxml_invalidate_node_list_cache(doc_ptr); - } + xmlDocPtr newdoc = dom_document_parser(ZEND_THIS, mode, source, source_len, options); - RETURN_TRUE; - } else { - DOM_RET_OBJ((xmlNodePtr) newdoc, &ret, NULL); - } + dom_finish_loading_document(ZEND_THIS, return_value, newdoc); } /* }}} end dom_parser_document */ @@ -1462,9 +1449,9 @@ PHP_METHOD(DOMDocument, saveXML) xmlDoc *docp; xmlNode *node; xmlBufferPtr buf; - xmlChar *mem; + const xmlChar *mem; dom_object *intern, *nodeobj; - int size, format, saveempty = 0; + int size, format, old_xml_save_no_empty_tags; zend_long options = 0; id = ZEND_THIS; @@ -1484,42 +1471,59 @@ PHP_METHOD(DOMDocument, saveXML) php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document)); RETURN_FALSE; } + buf = xmlBufferCreate(); if (!buf) { php_error_docref(NULL, E_WARNING, "Could not fetch buffer"); RETURN_FALSE; } - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } + /* Save libxml2 global, override its vaule, and restore after saving. */ + old_xml_save_no_empty_tags = xmlSaveNoEmptyTags; + xmlSaveNoEmptyTags = (options & LIBXML_SAVE_NOEMPTYTAG) ? 1 : 0; xmlNodeDump(buf, docp, node, 0, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - mem = (xmlChar*) xmlBufferContent(buf); - if (!mem) { - xmlBufferFree(buf); + xmlSaveNoEmptyTags = old_xml_save_no_empty_tags; + } else { + buf = xmlBufferCreate(); + if (!buf) { + php_error_docref(NULL, E_WARNING, "Could not fetch buffer"); RETURN_FALSE; } - RETVAL_STRING((char *) mem); - xmlBufferFree(buf); - } else { - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; + + int converted_options = XML_SAVE_AS_XML; + if (options & XML_SAVE_NO_DECL) { + converted_options |= XML_SAVE_NO_DECL; } + if (format) { + converted_options |= XML_SAVE_FORMAT; + } + /* Save libxml2 global, override its vaule, and restore after saving. */ + old_xml_save_no_empty_tags = xmlSaveNoEmptyTags; + xmlSaveNoEmptyTags = (options & LIBXML_SAVE_NOEMPTYTAG) ? 1 : 0; /* Encoding is handled from the encoding property set on the document */ - xmlDocDumpFormatMemory(docp, &mem, &size, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; + xmlSaveCtxtPtr ctxt = xmlSaveToBuffer(buf, (const char *) docp->encoding, converted_options); + xmlSaveNoEmptyTags = old_xml_save_no_empty_tags; + if (UNEXPECTED(!ctxt)) { + xmlBufferFree(buf); + php_error_docref(NULL, E_WARNING, "Could not create save context"); + RETURN_FALSE; } - if (!size || !mem) { + if (UNEXPECTED(xmlSaveDoc(ctxt, docp) < 0)) { + (void) xmlSaveClose(ctxt); + xmlBufferFree(buf); + php_error_docref(NULL, E_WARNING, "Could not save document"); RETURN_FALSE; } - RETVAL_STRINGL((char *) mem, size); - xmlFree(mem); + (void) xmlSaveFlush(ctxt); + (void) xmlSaveClose(ctxt); } + mem = xmlBufferContent(buf); + if (!mem) { + xmlBufferFree(buf); + RETURN_FALSE; + } + size = xmlBufferLength(buf); + RETVAL_STRINGL((const char *) mem, size); + xmlBufferFree(buf); } /* }}} end dom_document_savexml */ @@ -1586,7 +1590,9 @@ PHP_METHOD(DOMDocument, xinclude) DOM_GET_OBJ(docp, id, xmlDocPtr, intern); + PHP_LIBXML_SANITIZE_GLOBALS(xinclude); err = xmlXIncludeProcessFlags(docp, (int)flags); + PHP_LIBXML_RESTORE_GLOBALS(xinclude); /* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these are added via xmlXIncludeProcess to mark beginning and ending of xincluded document @@ -1626,6 +1632,7 @@ PHP_METHOD(DOMDocument, validate) DOM_GET_OBJ(docp, id, xmlDocPtr, intern); + PHP_LIBXML_SANITIZE_GLOBALS(validate); cvp = xmlNewValidCtxt(); cvp->userData = NULL; @@ -1637,6 +1644,7 @@ PHP_METHOD(DOMDocument, validate) } else { RETVAL_FALSE; } + PHP_LIBXML_RESTORE_GLOBALS(validate); xmlFreeValidCtxt(cvp); @@ -1671,14 +1679,18 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type DOM_GET_OBJ(docp, id, xmlDocPtr, intern); + PHP_LIBXML_SANITIZE_GLOBALS(new_parser_ctxt); + switch (type) { case DOM_LOAD_FILE: if (CHECK_NULL_PATH(source, source_len)) { + PHP_LIBXML_RESTORE_GLOBALS(new_parser_ctxt); zend_argument_value_error(1, "must not contain any null bytes"); RETURN_THROWS(); } valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN); if (!valid_file) { + PHP_LIBXML_RESTORE_GLOBALS(new_parser_ctxt); php_error_docref(NULL, E_WARNING, "Invalid Schema file source"); RETURN_FALSE; } @@ -1699,6 +1711,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type parser); sptr = xmlSchemaParse(parser); xmlSchemaFreeParserCtxt(parser); + PHP_LIBXML_RESTORE_GLOBALS(new_parser_ctxt); if (!sptr) { if (!EG(exception)) { php_error_docref(NULL, E_WARNING, "Invalid Schema"); @@ -1719,11 +1732,13 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE; } + PHP_LIBXML_SANITIZE_GLOBALS(validate); xmlSchemaSetValidOptions(vptr, valid_opts); xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); is_valid = xmlSchemaValidateDoc(vptr, docp); xmlSchemaFree(sptr); xmlSchemaFreeValidCtxt(vptr); + PHP_LIBXML_RESTORE_GLOBALS(validate); if (is_valid == 0) { RETURN_TRUE; @@ -1794,12 +1809,14 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ return; } + PHP_LIBXML_SANITIZE_GLOBALS(parse); xmlRelaxNGSetParserErrors(parser, (xmlRelaxNGValidityErrorFunc) php_libxml_error_handler, (xmlRelaxNGValidityWarningFunc) php_libxml_error_handler, parser); sptr = xmlRelaxNGParse(parser); xmlRelaxNGFreeParserCtxt(parser); + PHP_LIBXML_RESTORE_GLOBALS(parse); if (!sptr) { php_error_docref(NULL, E_WARNING, "Invalid RelaxNG"); RETURN_FALSE; @@ -1847,18 +1864,11 @@ PHP_METHOD(DOMDocument, relaxNGValidateSource) static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { - zval *id; - xmlDoc *docp = NULL, *newdoc; - dom_object *intern; - dom_doc_propsptr doc_prop; char *source; size_t source_len; - int refcount, ret; zend_long options = 0; htmlParserCtxtPtr ctxt; - id = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) { RETURN_THROWS(); } @@ -1898,53 +1908,15 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ ctxt->sax->error = php_libxml_ctx_error; ctxt->sax->warning = php_libxml_ctx_warning; } + php_libxml_sanitize_parse_ctxt_options(ctxt); if (options) { htmlCtxtUseOptions(ctxt, (int)options); } htmlParseDocument(ctxt); - newdoc = ctxt->myDoc; + xmlDocPtr newdoc = ctxt->myDoc; htmlFreeParserCtxt(ctxt); - if (!newdoc) - RETURN_FALSE; - - if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) { - intern = Z_DOMOBJ_P(id); - size_t old_modification_nr = 0; - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - const php_libxml_doc_ptr *doc_ptr = docp->_private; - ZEND_ASSERT(doc_ptr != NULL); /* Must exist, we have a document */ - old_modification_nr = doc_ptr->cache_tag.modification_nr; - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) { - RETURN_FALSE; - } - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern); - /* Since iterators should invalidate, we need to start the modification number from the old counter */ - if (old_modification_nr != 0) { - php_libxml_doc_ptr* doc_ptr = (php_libxml_doc_ptr*) ((php_libxml_node_object*) intern)->node; /* downcast */ - doc_ptr->cache_tag.modification_nr = old_modification_nr; - php_libxml_invalidate_node_list_cache(doc_ptr); - } - - RETURN_TRUE; - } else { - DOM_RET_OBJ((xmlNodePtr) newdoc, &ret, NULL); - } + dom_finish_loading_document(ZEND_THIS, return_value, newdoc); } /* }}} */ diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 36265293ae38..332680917202 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -50,9 +50,8 @@ PHP_METHOD(DOMDocumentFragment, __construct) intern = Z_DOMOBJ_P(ZEND_THIS); oldnode = dom_object_get_node(intern); if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } - /* php_dom_set_object(intern, nodep); */ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); } /* }}} end DOMDocumentFragment::__construct */ @@ -80,7 +79,9 @@ PHP_METHOD(DOMDocumentFragment, appendXML) { } if (data) { + PHP_LIBXML_SANITIZE_GLOBALS(parse); err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, (xmlChar *) data, &lst); + PHP_LIBXML_RESTORE_GLOBALS(parse); if (err != 0) { RETURN_FALSE; } diff --git a/ext/dom/element.c b/ext/dom/element.c index 8d734c12c1c2..d09518419228 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -97,7 +97,7 @@ PHP_METHOD(DOMElement, __construct) intern = Z_DOMOBJ_P(ZEND_THIS); oldnode = dom_object_get_node(intern); if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); } diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 16aadabfb599..61f0b92eedc2 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -57,13 +57,11 @@ PHP_METHOD(DOMEntityReference, __construct) } intern = Z_DOMOBJ_P(ZEND_THIS); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern); + oldnode = dom_object_get_node(intern); + if (oldnode != NULL) { + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } + php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern); } /* }}} end DOMEntityReference::__construct */ diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index ffccc78652cd..8b225d75c92c 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -128,12 +128,8 @@ static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNod { for (uint32_t i = 0; i < nodesc; i++) { if (Z_TYPE(nodes[i]) == IS_OBJECT) { - const zend_class_entry *ce = Z_OBJCE(nodes[i]); - - if (instanceof_function(ce, dom_node_class_entry)) { - if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) { - return true; - } + if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) { + return true; } } } @@ -141,25 +137,23 @@ static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNod return false; } -xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNode, zval *nodes, uint32_t nodesc) +static xmlDocPtr dom_doc_from_context_node(xmlNodePtr contextNode) +{ + if (contextNode->type == XML_DOCUMENT_NODE || contextNode->type == XML_HTML_DOCUMENT_NODE) { + return (xmlDocPtr) contextNode; + } else { + return contextNode->doc; + } +} + +xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNode, zval *nodes, int nodesc) { xmlDoc *documentNode; xmlNode *fragment; xmlNode *newNode; - zend_class_entry *ce; dom_object *newNodeObj; - int stricterror; - - if (document == NULL) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, 1); - return NULL; - } - if (contextNode->type == XML_DOCUMENT_NODE || contextNode->type == XML_HTML_DOCUMENT_NODE) { - documentNode = (xmlDoc *) contextNode; - } else { - documentNode = contextNode->doc; - } + documentNode = dom_doc_from_context_node(contextNode); fragment = xmlNewDocFragment(documentNode); @@ -167,78 +161,57 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod return NULL; } - stricterror = dom_get_strict_error(document); - for (uint32_t i = 0; i < nodesc; i++) { if (Z_TYPE(nodes[i]) == IS_OBJECT) { - ce = Z_OBJCE(nodes[i]); - - if (instanceof_function(ce, dom_node_class_entry)) { - newNodeObj = Z_DOMOBJ_P(&nodes[i]); - newNode = dom_object_get_node(newNodeObj); + newNodeObj = Z_DOMOBJ_P(&nodes[i]); + newNode = dom_object_get_node(newNodeObj); - if (newNode->doc != documentNode) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror); - goto err; - } + if (newNode->parent != NULL) { + xmlUnlinkNode(newNode); + } - if (newNode->parent != NULL) { - xmlUnlinkNode(newNode); - } + newNodeObj->document = document; + xmlSetTreeDoc(newNode, documentNode); - newNodeObj->document = document; - xmlSetTreeDoc(newNode, documentNode); + /* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild): + * "Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed)". + * So we must take a copy if this situation arises to prevent a use-after-free. */ + bool will_free = newNode->type == XML_TEXT_NODE && fragment->last && fragment->last->type == XML_TEXT_NODE; + if (will_free) { + newNode = xmlCopyNode(newNode, 1); + } - if (newNode->type == XML_ATTRIBUTE_NODE) { - goto hierarchy_request_err; + if (newNode->type == XML_DOCUMENT_FRAG_NODE) { + /* Unpack document fragment nodes, the behaviour differs for different libxml2 versions. */ + newNode = newNode->children; + while (newNode) { + xmlNodePtr next = newNode->next; + xmlUnlinkNode(newNode); + if (!xmlAddChild(fragment, newNode)) { + goto err; + } + newNode = next; } - - /* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild): - * "Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed)". - * So we must take a copy if this situation arises to prevent a use-after-free. */ - bool will_free = newNode->type == XML_TEXT_NODE && fragment->last && fragment->last->type == XML_TEXT_NODE; + } else if (!xmlAddChild(fragment, newNode)) { if (will_free) { - newNode = xmlCopyNode(newNode, 1); - } - - if (newNode->type == XML_DOCUMENT_FRAG_NODE) { - /* Unpack document fragment nodes, the behaviour differs for different libxml2 versions. */ - newNode = newNode->children; - while (newNode) { - xmlNodePtr next = newNode->next; - xmlUnlinkNode(newNode); - if (!xmlAddChild(fragment, newNode)) { - goto hierarchy_request_err; - } - newNode = next; - } - } else if (!xmlAddChild(fragment, newNode)) { - if (will_free) { - xmlFreeNode(newNode); - } - goto hierarchy_request_err; + xmlFreeNode(newNode); } - } else { - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_value_name(&nodes[i])); goto err; } - } else if (Z_TYPE(nodes[i]) == IS_STRING) { + } else { + ZEND_ASSERT(Z_TYPE(nodes[i]) == IS_STRING); + newNode = xmlNewDocText(documentNode, (xmlChar *) Z_STRVAL(nodes[i])); if (!xmlAddChild(fragment, newNode)) { xmlFreeNode(newNode); - goto hierarchy_request_err; + goto err; } - } else { - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_value_name(&nodes[i])); - goto err; } } return fragment; -hierarchy_request_err: - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); err: xmlFreeNode(fragment); return NULL; @@ -261,30 +234,78 @@ static void dom_fragment_assign_parent_node(xmlNodePtr parentNode, xmlNodePtr fr fragment->last = NULL; } -static zend_result dom_hierarchy_node_list(xmlNodePtr parentNode, zval *nodes, uint32_t nodesc) +static zend_result dom_sanity_check_node_list_for_insertion(php_libxml_ref_obj *document, xmlNodePtr parentNode, zval *nodes, int nodesc) { + if (UNEXPECTED(parentNode == NULL)) { + /* No error required, this must be a no-op per spec */ + return FAILURE; + } + + xmlDocPtr documentNode = dom_doc_from_context_node(parentNode); + for (uint32_t i = 0; i < nodesc; i++) { - if (Z_TYPE(nodes[i]) == IS_OBJECT) { + zend_uchar type = Z_TYPE(nodes[i]); + if (type == IS_OBJECT) { const zend_class_entry *ce = Z_OBJCE(nodes[i]); if (instanceof_function(ce, dom_node_class_entry)) { - if (dom_hierarchy(parentNode, dom_object_get_node(Z_DOMOBJ_P(nodes + i))) != SUCCESS) { + xmlNodePtr node = dom_object_get_node(Z_DOMOBJ_P(nodes + i)); + + if (node->doc != documentNode) { + php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(document)); + return FAILURE; + } + + if (node->type == XML_ATTRIBUTE_NODE || dom_hierarchy(parentNode, node) != SUCCESS) { + php_dom_throw_error(HIERARCHY_REQUEST_ERR, dom_get_strict_error(document)); return FAILURE; } + } else { + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); + return FAILURE; } + } else if (type != IS_STRING) { + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); + return FAILURE; } } return SUCCESS; } +static void dom_pre_insert(xmlNodePtr insertion_point, xmlNodePtr parentNode, xmlNodePtr newchild, xmlNodePtr fragment) +{ + if (!insertion_point) { + /* Place it as last node */ + if (parentNode->children) { + /* There are children */ + newchild->prev = parentNode->last; + parentNode->last->next = newchild; + } else { + /* No children, because they moved out when they became a fragment */ + parentNode->children = newchild; + } + parentNode->last = fragment->last; + } else { + /* Insert fragment before insertion_point */ + fragment->last->next = insertion_point; + if (insertion_point->prev) { + insertion_point->prev->next = newchild; + newchild->prev = insertion_point->prev; + } + insertion_point->prev = fragment->last; + if (parentNode->children == insertion_point) { + parentNode->children = newchild; + } + } +} + void dom_parent_node_append(dom_object *context, zval *nodes, uint32_t nodesc) { xmlNode *parentNode = dom_object_get_node(context); xmlNodePtr newchild, prevsib; - if (UNEXPECTED(dom_hierarchy_node_list(parentNode, nodes, nodesc) != SUCCESS)) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, dom_get_strict_error(context->document)); + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, parentNode, nodes, nodesc) != SUCCESS)) { return; } @@ -328,28 +349,24 @@ void dom_parent_node_prepend(dom_object *context, zval *nodes, uint32_t nodesc) return; } - if (UNEXPECTED(dom_hierarchy_node_list(parentNode, nodes, nodesc) != SUCCESS)) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, dom_get_strict_error(context->document)); + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, parentNode, nodes, nodesc) != SUCCESS)) { return; } php_libxml_invalidate_node_list_cache_from_doc(parentNode->doc); - xmlNodePtr newchild, nextsib; xmlNode *fragment = dom_zvals_to_fragment(context->document, parentNode, nodes, nodesc); if (fragment == NULL) { return; } - newchild = fragment->children; - nextsib = parentNode->children; + xmlNode *newchild = fragment->children; if (newchild) { xmlNodePtr last = fragment->last; - parentNode->children = newchild; - fragment->last->next = nextsib; - nextsib->prev = last; + + dom_pre_insert(parentNode->children, parentNode, newchild, fragment); dom_fragment_assign_parent_node(parentNode, fragment); @@ -359,33 +376,6 @@ void dom_parent_node_prepend(dom_object *context, zval *nodes, uint32_t nodesc) xmlFree(fragment); } -static void dom_pre_insert(xmlNodePtr insertion_point, xmlNodePtr parentNode, xmlNodePtr newchild, xmlNodePtr fragment) -{ - if (!insertion_point) { - /* Place it as last node */ - if (parentNode->children) { - /* There are children */ - newchild->prev = parentNode->last; - parentNode->last->next = newchild; - } else { - /* No children, because they moved out when they became a fragment */ - parentNode->children = newchild; - } - parentNode->last = fragment->last; - } else { - /* Insert fragment before insertion_point */ - fragment->last->next = insertion_point; - if (insertion_point->prev) { - insertion_point->prev->next = newchild; - newchild->prev = insertion_point->prev; - } - insertion_point->prev = fragment->last; - if (parentNode->children == insertion_point) { - parentNode->children = newchild; - } - } -} - void dom_parent_node_after(dom_object *context, zval *nodes, uint32_t nodesc) { /* Spec link: https://dom.spec.whatwg.org/#dom-childnode-after */ @@ -397,10 +387,9 @@ void dom_parent_node_after(dom_object *context, zval *nodes, uint32_t nodesc) /* Spec step 1 */ parentNode = prevsib->parent; - /* Spec step 2 */ - if (!parentNode) { - int stricterror = dom_get_strict_error(context->document); - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); + + /* Sanity check for fragment, includes spec step 2 */ + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, parentNode, nodes, nodesc) != SUCCESS)) { return; } @@ -450,10 +439,9 @@ void dom_parent_node_before(dom_object *context, zval *nodes, uint32_t nodesc) /* Spec step 1 */ parentNode = nextsib->parent; - /* Spec step 2 */ - if (!parentNode) { - int stricterror = dom_get_strict_error(context->document); - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); + + /* Sanity check for fragment, includes spec step 2 */ + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, parentNode, nodes, nodesc) != SUCCESS)) { return; } @@ -527,7 +515,6 @@ static zend_result dom_child_removal_preconditions(const xmlNodePtr child, int s void dom_child_node_remove(dom_object *context) { xmlNode *child = dom_object_get_node(context); - xmlNodePtr children; int stricterror; stricterror = dom_get_strict_error(context->document); @@ -536,42 +523,51 @@ void dom_child_node_remove(dom_object *context) return; } - children = child->parent->children; - - php_libxml_invalidate_node_list_cache_from_doc(context->document->ptr); - - while (children) { - if (children == child) { - xmlUnlinkNode(child); - return; - } - children = children->next; - } + php_libxml_invalidate_node_list_cache_from_doc(child->doc); - php_dom_throw_error(NOT_FOUND_ERR, stricterror); + xmlUnlinkNode(child); } void dom_child_replace_with(dom_object *context, zval *nodes, uint32_t nodesc) { + /* Spec link: https://dom.spec.whatwg.org/#dom-childnode-replacewith */ + xmlNodePtr child = dom_object_get_node(context); + + /* Spec step 1 */ xmlNodePtr parentNode = child->parent; + /* Sanity check for fragment, includes spec step 2 */ + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, parentNode, nodes, nodesc) != SUCCESS)) { + return; + } + int stricterror = dom_get_strict_error(context->document); if (UNEXPECTED(dom_child_removal_preconditions(child, stricterror) != SUCCESS)) { return; } - php_libxml_invalidate_node_list_cache_from_doc(context->document->ptr); + /* Spec step 3: find first following child not in nodes; otherwise null */ + xmlNodePtr viable_next_sibling = child->next; + while (viable_next_sibling) { + if (!dom_is_node_in_list(nodes, nodesc, viable_next_sibling)) { + break; + } + viable_next_sibling = viable_next_sibling->next; + } - xmlNodePtr insertion_point = child->next; + xmlDocPtr doc = parentNode->doc; + php_libxml_invalidate_node_list_cache_from_doc(doc); + /* Spec step 4: convert nodes into fragment */ xmlNodePtr fragment = dom_zvals_to_fragment(context->document, parentNode, nodes, nodesc); if (UNEXPECTED(fragment == NULL)) { return; } + /* Spec step 5: perform the replacement */ + xmlNodePtr newchild = fragment->children; - xmlDocPtr doc = parentNode->doc; /* Unlink it unless it became a part of the fragment. * Freeing will be taken care of by the lifetime of the returned dom object. */ @@ -582,7 +578,7 @@ void dom_child_replace_with(dom_object *context, zval *nodes, uint32_t nodesc) if (newchild) { xmlNodePtr last = fragment->last; - dom_pre_insert(insertion_point, parentNode, newchild, fragment); + dom_pre_insert(viable_next_sibling, parentNode, newchild, fragment); dom_fragment_assign_parent_node(parentNode, fragment); dom_reconcile_ns_list(doc, newchild, last); @@ -597,8 +593,7 @@ void dom_parent_node_replace_children(dom_object *context, zval *nodes, uint32_t xmlNodePtr thisp = dom_object_get_node(context); /* Note: Only rule 2 of pre-insertion validity can be broken */ - if (dom_hierarchy_node_list(thisp, nodes, nodesc)) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, dom_get_strict_error(context->document)); + if (UNEXPECTED(dom_sanity_check_node_list_for_insertion(context->document, thisp, nodes, nodesc) != SUCCESS)) { return; } @@ -607,7 +602,7 @@ void dom_parent_node_replace_children(dom_object *context, zval *nodes, uint32_t return; } - php_libxml_invalidate_node_list_cache_from_doc(context->document->ptr); + php_libxml_invalidate_node_list_cache_from_doc(thisp->doc); dom_remove_all_children(thisp); diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 29aaf07e4b17..7316f8426698 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -707,7 +707,7 @@ class DOMDocument extends DOMNode implements DOMParentNode * @readonly * @deprecated */ - public mixed $config = null; + public mixed $config; public bool $formatOutput; @@ -774,11 +774,11 @@ public function getElementsByTagNameNS(?string $namespace, string $localName): D /** @return DOMNode|false */ public function importNode(DOMNode $node, bool $deep = false) {} - /** @return DOMDocument|bool */ - public function load(string $filename, int $options = 0) {} // TODO return type shouldn't depend on the call scope + /** @tentative-return-type */ + public function load(string $filename, int $options = 0): bool {} - /** @return DOMDocument|bool */ - public function loadXML(string $source, int $options = 0) {} // TODO return type shouldn't depend on the call scope + /** @tentative-return-type */ + public function loadXML(string $source, int $options = 0): bool {} /** @tentative-return-type */ public function normalizeDocument(): void {} @@ -790,11 +790,11 @@ public function registerNodeClass(string $baseClass, ?string $extendedClass): bo public function save(string $filename, int $options = 0): int|false {} #ifdef LIBXML_HTML_ENABLED - /** @return DOMDocument|bool */ - public function loadHTML(string $source, int $options = 0) {} // TODO return type shouldn't depend on the call scope + /** @tentative-return-type */ + public function loadHTML(string $source, int $options = 0): bool {} - /** @return DOMDocument|bool */ - public function loadHTMLFile(string $filename, int $options = 0) {} // TODO return type shouldn't depend on the call scope + /** @tentative-return-type */ + public function loadHTMLFile(string $filename, int $options = 0): bool {} /** @tentative-return-type */ public function saveHTML(?DOMNode $node = null): string|false {} diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 28bc38296369..1878758671ec 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3a37adaf011606d10ae1fa12ce135a23b3e07cf4 */ + * Stub hash: ebe9bcbd185e1973b5447beb306bd9d93051f415 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 0) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) @@ -371,12 +371,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMDocument_importNode, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, deep, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMDocument_load, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_load, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMDocument_loadXML, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_loadXML, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -394,14 +394,14 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DOMDocument_save ZEND_END_ARG_INFO() #if defined(LIBXML_HTML_ENABLED) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMDocument_loadHTML, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_loadHTML, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #endif #if defined(LIBXML_HTML_ENABLED) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMDocument_loadHTMLFile, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMDocument_loadHTMLFile, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -1581,7 +1581,7 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr zend_string_release(property_documentURI_name); zval property_config_default_value; - ZVAL_NULL(&property_config_default_value); + ZVAL_UNDEF(&property_config_default_value); zend_string *property_config_name = zend_string_init("config", sizeof("config") - 1, 1); zend_declare_typed_property(class_entry, property_config_name, &property_config_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); zend_string_release(property_config_name); diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index 3fcd082aa229..afabab1d983b 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -59,7 +59,7 @@ PHP_METHOD(DOMProcessingInstruction, __construct) intern = Z_DOMOBJ_P(ZEND_THIS); oldnode = dom_object_get_node(intern); if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); } diff --git a/ext/dom/tests/DOMChildNode_methods_without_parent.phpt b/ext/dom/tests/DOMChildNode_methods_without_parent.phpt new file mode 100644 index 000000000000..2591105cc37f --- /dev/null +++ b/ext/dom/tests/DOMChildNode_methods_without_parent.phpt @@ -0,0 +1,44 @@ +--TEST-- +DOMChildNode methods without a parent +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + +XML); + +$container = $doc->documentElement; +$child = $container->firstElementChild; + +$test = $doc->createElement('foo'); +foreach (['before', 'after', 'replaceWith'] as $method) { + echo "--- $method ---\n"; + $test->$method($child); + echo $doc->saveXML(); + echo $doc->saveXML($test), "\n"; +} +?> +--EXPECT-- +--- before --- + + + + + +--- after --- + + + + + +--- replaceWith --- + + + + + diff --git a/ext/dom/tests/DOMDocumentFragment_construct_basic_002.phpt b/ext/dom/tests/DOMDocumentFragment_construct_basic_002.phpt deleted file mode 100644 index 36a0762c16f0..000000000000 --- a/ext/dom/tests/DOMDocumentFragment_construct_basic_002.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -DOMDocumentFragment::__construct() called twice. ---CREDITS-- -Eric Lee Stewart -# TestFest Atlanta 2009-05-24 ---EXTENSIONS-- -dom ---FILE-- -__construct(); -var_dump($fragment); -?> ---EXPECT-- -object(DOMDocumentFragment)#1 (0) { -} diff --git a/ext/dom/tests/DOMDocument_adoptNode.phpt b/ext/dom/tests/DOMDocument_adoptNode.phpt index fb99618d71ef..2382cabd5136 100644 --- a/ext/dom/tests/DOMDocument_adoptNode.phpt +++ b/ext/dom/tests/DOMDocument_adoptNode.phpt @@ -43,7 +43,7 @@ $adopted = $doc1->adoptNode($doc1->firstChild->firstChild); var_dump($adopted->textContent); var_dump($doc1->saveXML()); -echo "-- Adopt a document --\n"; +echo "-- Adopt a document (strict error on) --\n"; try { $doc1->adoptNode($doc1); @@ -51,6 +51,16 @@ try { echo $e->getMessage(), "\n"; } +echo "-- Adopt a document (strict error off) --\n"; + +$doc1->strictErrorChecking = false; +try { + $doc1->adoptNode($doc1); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} +$doc1->strictErrorChecking = true; + echo "-- Adopt an attribute --\n"; $doc3 = new DOMDocument(); @@ -102,7 +112,7 @@ unset($doc1); var_dump($child->nodeName); ?> ---EXPECT-- +--EXPECTF-- -- Owner document check before adopting -- bool(true) bool(false) @@ -127,8 +137,11 @@ string(5) "world" string(27) "

" --- Adopt a document -- +-- Adopt a document (strict error on) -- Not Supported Error +-- Adopt a document (strict error off) -- + +Warning: DOMDocument::adoptNode(): Not Supported Error in %s on line %d -- Adopt an attribute -- bool(true) bool(true) diff --git a/ext/dom/tests/DOMDocument_json_encode.phpt b/ext/dom/tests/DOMDocument_json_encode.phpt new file mode 100644 index 000000000000..ed85ab4f2109 --- /dev/null +++ b/ext/dom/tests/DOMDocument_json_encode.phpt @@ -0,0 +1,11 @@ +--TEST-- +JSON encoding a DOMDocument +--EXTENSIONS-- +dom +--FILE-- + +--EXPECT-- +{} diff --git a/ext/dom/tests/DOMDocument_saveXML_XML_SAVE_NO_DECL.phpt b/ext/dom/tests/DOMDocument_saveXML_XML_SAVE_NO_DECL.phpt new file mode 100644 index 000000000000..2a51b88cd59f --- /dev/null +++ b/ext/dom/tests/DOMDocument_saveXML_XML_SAVE_NO_DECL.phpt @@ -0,0 +1,28 @@ +--TEST-- +DOMDocument::saveXML(): XML_SAVE_NO_DECL +--EXTENSIONS-- +dom +--SKIPIF-- + +--FILE-- +loadXML('é'); + +echo $doc->saveXML(options: 0); +echo $doc->saveXML(options: LIBXML_NOXMLDECL); +$doc->encoding = "BIG5"; +echo $doc->saveXML(options: LIBXML_NOXMLDECL); + +// Edge case +$doc = new DOMDocument(); +var_dump($doc->saveXML(options: LIBXML_NOXMLDECL)); +?> +--EXPECT-- + +é +é +é +string(0) "" diff --git a/ext/dom/tests/bug79968.phpt b/ext/dom/tests/bug79968.phpt index bfd69e69c971..5ce1bcb7c6e9 100644 --- a/ext/dom/tests/bug79968.phpt +++ b/ext/dom/tests/bug79968.phpt @@ -7,11 +7,14 @@ dom $cdata = new DOMText; -try { - $cdata->before("string"); -} catch (DOMException $e) { - echo $e->getMessage(); -} +$cdata->before("string"); +$cdata->after("string"); +$cdata->replaceWith("string"); + +$dom = new DOMDocument(); +$dom->adoptNode($cdata); +var_dump($dom->saveXML($cdata)); + ?> --EXPECT-- -Hierarchy Request Error +string(0) "" diff --git a/ext/dom/tests/domobject_debug_handler.phpt b/ext/dom/tests/domobject_debug_handler.phpt index f951b9d4b49c..98a9a72315ac 100644 --- a/ext/dom/tests/domobject_debug_handler.phpt +++ b/ext/dom/tests/domobject_debug_handler.phpt @@ -12,56 +12,94 @@ XML; $d = new domdocument; $d->dynamicProperty = new stdclass; $d->loadXML($xml); -print_r($d); +var_dump($d); ?> --EXPECTF-- Deprecated: Creation of dynamic property DOMDocument::$dynamicProperty is deprecated in %s on line %d -DOMDocument Object -( - [config] => - [dynamicProperty] => stdClass Object - ( - ) - - [doctype] => - [implementation] => (object value omitted) - [documentElement] => (object value omitted) - [actualEncoding] => - [encoding] => - [xmlEncoding] => - [standalone] => 1 - [xmlStandalone] => 1 - [version] => 1.0 - [xmlVersion] => 1.0 - [strictErrorChecking] => 1 - [documentURI] => %s - [formatOutput] => - [validateOnParse] => - [resolveExternals] => - [preserveWhiteSpace] => 1 - [recover] => - [substituteEntities] => - [firstElementChild] => (object value omitted) - [lastElementChild] => (object value omitted) - [childElementCount] => 1 - [nodeName] => #document - [nodeValue] => - [nodeType] => 9 - [parentNode] => - [parentElement] => - [childNodes] => (object value omitted) - [firstChild] => (object value omitted) - [lastChild] => (object value omitted) - [previousSibling] => - [nextSibling] => - [attributes] => - [isConnected] => 1 - [ownerDocument] => - [namespaceURI] => - [prefix] => - [localName] => - [baseURI] => %s - [textContent] => +object(DOMDocument)#1 (41) { + ["dynamicProperty"]=> + object(stdClass)#2 (0) { + } + ["doctype"]=> + NULL + ["implementation"]=> + string(22) "(object value omitted)" + ["documentElement"]=> + string(22) "(object value omitted)" + ["actualEncoding"]=> + NULL + ["encoding"]=> + NULL + ["xmlEncoding"]=> + NULL + ["standalone"]=> + bool(false) + ["xmlStandalone"]=> + bool(false) + ["version"]=> + string(3) "1.0" + ["xmlVersion"]=> + string(3) "1.0" + ["strictErrorChecking"]=> + bool(true) + ["documentURI"]=> + string(%d) %s + ["config"]=> + NULL + ["formatOutput"]=> + bool(false) + ["validateOnParse"]=> + bool(false) + ["resolveExternals"]=> + bool(false) + ["preserveWhiteSpace"]=> + bool(true) + ["recover"]=> + bool(false) + ["substituteEntities"]=> + bool(false) + ["firstElementChild"]=> + string(22) "(object value omitted)" + ["lastElementChild"]=> + string(22) "(object value omitted)" + ["childElementCount"]=> + int(1) + ["nodeName"]=> + string(9) "#document" + ["nodeValue"]=> + NULL + ["nodeType"]=> + int(9) + ["parentNode"]=> + NULL + ["parentElement"]=> + NULL + ["childNodes"]=> + string(22) "(object value omitted)" + ["firstChild"]=> + string(22) "(object value omitted)" + ["lastChild"]=> + string(22) "(object value omitted)" + ["previousSibling"]=> + NULL + ["nextSibling"]=> + NULL + ["attributes"]=> + NULL + ["isConnected"]=> + bool(true) + ["ownerDocument"]=> + NULL + ["namespaceURI"]=> + NULL + ["prefix"]=> + string(0) "" + ["localName"]=> + NULL + ["baseURI"]=> + string(%d) %s + ["textContent"]=> + string(12) " foobar - -) +" +} diff --git a/ext/dom/tests/element_child_and_parent_node_without_document.phpt b/ext/dom/tests/element_child_and_parent_node_without_document.phpt new file mode 100644 index 000000000000..a849135f6699 --- /dev/null +++ b/ext/dom/tests/element_child_and_parent_node_without_document.phpt @@ -0,0 +1,21 @@ +--TEST-- +DOMElement: DOMChildNode, DOMParentNode modifications without a document +--EXTENSIONS-- +dom +--FILE-- +append("APPENDED"); +$element->prepend("PREPENDED"); +$element->after("AFTER"); +$element->before("BEFORE"); +$element->replaceWith("REPLACE"); + +$doc = new DOMDocument(); +$doc->adoptNode($element); +echo $doc->saveXML($element), "\n"; + +?> +--EXPECT-- +

PREPENDED Hello World! APPENDED

diff --git a/ext/dom/tests/gh11791.phpt b/ext/dom/tests/gh11791.phpt new file mode 100644 index 000000000000..22d94b51312a --- /dev/null +++ b/ext/dom/tests/gh11791.phpt @@ -0,0 +1,39 @@ +--TEST-- +GH-11791 (Wrong default value of DOMDocument.xmlStandalone) +--EXTENSIONS-- +dom +--FILE-- +loadXML(''); +var_dump($doc->xmlStandalone); +$doc->xmlStandalone = true; +var_dump($doc->xmlStandalone); + +$doc = new DOMDocument(); +$doc->loadXML(''); +var_dump($doc->xmlStandalone); +$doc->xmlStandalone = true; +var_dump($doc->xmlStandalone); + +$doc = new DOMDocument(); +$doc->loadXML(''); +var_dump($doc->xmlStandalone); +$doc->xmlStandalone = true; +var_dump($doc->xmlStandalone); + +$doc = new DOMDocument(); +$doc->loadXML(''); +var_dump($doc->xmlStandalone); +$doc->xmlStandalone = false; +var_dump($doc->xmlStandalone); +?> +--EXPECT-- +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(true) +bool(false) diff --git a/ext/dom/tests/gh11830/attribute_variation.phpt b/ext/dom/tests/gh11830/attribute_variation.phpt new file mode 100644 index 000000000000..34a6f094f58f --- /dev/null +++ b/ext/dom/tests/gh11830/attribute_variation.phpt @@ -0,0 +1,56 @@ +--TEST-- +GH-11830 (ParentNode methods should perform their checks upfront) - attribute variation +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + +XML); + +try { + $doc->documentElement->firstElementChild->prepend($doc->documentElement->attributes[0]); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->append($doc->documentElement->attributes[0]); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->before($doc->documentElement->attributes[0]); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->after($doc->documentElement->attributes[0]); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->replaceWith($doc->documentElement->attributes[0]); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +echo $doc->saveXML(); +?> +--EXPECT-- +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error + + + + diff --git a/ext/dom/tests/gh11830/document_variation.phpt b/ext/dom/tests/gh11830/document_variation.phpt new file mode 100644 index 000000000000..89eed3dff22c --- /dev/null +++ b/ext/dom/tests/gh11830/document_variation.phpt @@ -0,0 +1,71 @@ +--TEST-- +GH-11830 (ParentNode methods should perform their checks upfront) - document variation +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + +XML); + +$otherElement = $otherDoc->documentElement; + +$doc = new DOMDocument; +$doc->loadXML(<< + + + + +XML); + +$testElement = $doc->documentElement->firstElementChild->nextElementSibling->firstElementChild; + +try { + $doc->documentElement->firstElementChild->prepend($testElement, $otherElement); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->append($testElement, $otherElement); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->before($testElement, $otherElement); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->after($testElement, $otherElement); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->replaceWith($testElement, $otherElement); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +echo $otherDoc->saveXML(); +echo $doc->saveXML(); +?> +--EXPECT-- +Wrong Document Error +Wrong Document Error +Wrong Document Error +Wrong Document Error +Wrong Document Error + + + + + + + diff --git a/ext/dom/tests/gh11830/hierarchy_variation.phpt b/ext/dom/tests/gh11830/hierarchy_variation.phpt new file mode 100644 index 000000000000..bd6534ee71b1 --- /dev/null +++ b/ext/dom/tests/gh11830/hierarchy_variation.phpt @@ -0,0 +1,62 @@ +--TEST-- +GH-11830 (ParentNode methods should perform their checks upfront) - hierarchy variation +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + + +XML); + +$container = $doc->documentElement; +$alone = $container->firstElementChild; +$testElement = $alone->nextElementSibling->firstElementChild; + +try { + $testElement->prepend($alone, $container); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $testElement->append($alone, $container); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $testElement->before($alone, $container); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $testElement->after($alone, $container); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +try { + $testElement->replaceWith($alone, $container); +} catch (\DOMException $e) { + echo $e->getMessage(), "\n"; +} + +echo $doc->saveXML(); +?> +--EXPECT-- +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error +Hierarchy Request Error + + + + + diff --git a/ext/dom/tests/gh11830/type_variation.phpt b/ext/dom/tests/gh11830/type_variation.phpt new file mode 100644 index 000000000000..76732775e6db --- /dev/null +++ b/ext/dom/tests/gh11830/type_variation.phpt @@ -0,0 +1,60 @@ +--TEST-- +GH-11830 (ParentNode methods should perform their checks upfront) - type variation +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + + +XML); + +$testElement = $doc->documentElement->firstElementChild->nextElementSibling->firstElementChild; + +try { + $doc->documentElement->firstElementChild->prepend($testElement, 0); +} catch (\TypeError $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->append($testElement, true); +} catch (\TypeError $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->before($testElement, null); +} catch (\TypeError $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->after($testElement, new stdClass); +} catch (\TypeError $e) { + echo $e->getMessage(), "\n"; +} + +try { + $doc->documentElement->firstElementChild->replaceWith($testElement, []); +} catch (\TypeError $e) { + echo $e->getMessage(), "\n"; +} + +echo $doc->saveXML(); +?> +--EXPECT-- +DOMElement::prepend(): Argument #2 must be of type DOMNode|string, int given +DOMElement::append(): Argument #2 must be of type DOMNode|string, bool given +DOMElement::before(): Argument #2 must be of type DOMNode|string, null given +DOMElement::after(): Argument #2 must be of type DOMNode|string, stdClass given +DOMElement::replaceWith(): Argument #2 must be of type DOMNode|string, array given + + + + + diff --git a/ext/dom/tests/gh11906.phpt b/ext/dom/tests/gh11906.phpt new file mode 100644 index 000000000000..4298051e5806 --- /dev/null +++ b/ext/dom/tests/gh11906.phpt @@ -0,0 +1,45 @@ +--TEST-- +GH-11906 (prepend without children after creating fragment results in segfault) +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + +XML); + +$container = $doc->documentElement; +$child = $container->firstElementChild; + +$test = $doc->createElement('foo'); +$test->append($child); +echo "--- document output ---\n"; +echo $doc->saveXML(); +echo "--- \$test output ---\n"; +echo $doc->saveXML($test), "\n"; +$test->prepend($child); +echo "--- document output ---\n"; +echo $doc->saveXML(); +echo "--- \$test output ---\n"; +echo $doc->saveXML($test), "\n"; +$test->append($child); +?> +--EXPECT-- +--- document output --- + + + + +--- $test output --- + +--- document output --- + + + + +--- $test output --- + diff --git a/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt new file mode 100644 index 000000000000..7fc2a249ac77 --- /dev/null +++ b/ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt @@ -0,0 +1,37 @@ +--TEST-- +GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass) +--SKIPIF-- + +--FILE-- + %bork;]>"; + +libxml_use_internal_errors(true); + +function parseXML($xml) { + $doc = new DOMDocument(); + @$doc->loadXML($xml); + $doc->createDocumentFragment()->appendXML("&bork;"); + foreach (libxml_get_errors() as $error) { + var_dump(trim($error->message)); + } +} + +parseXML($xml); +zend_test_override_libxml_global_state(); +parseXML($xml); + +echo "Done\n"; + +?> +--EXPECT-- +string(25) "Entity 'bork' not defined" +string(25) "Entity 'bork' not defined" +string(25) "Entity 'bork' not defined" +Done diff --git a/ext/dom/tests/manually_call_constructor/attribute.phpt b/ext/dom/tests/manually_call_constructor/attribute.phpt new file mode 100644 index 000000000000..5e8be0abf747 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/attribute.phpt @@ -0,0 +1,34 @@ +--TEST-- +Manually call __construct() - attribute variation +--EXTENSIONS-- +dom +--FILE-- +nodeName, $attr->nodeValue); +$attr->__construct("newattribute", "my new value"); +var_dump($attr->nodeName, $attr->nodeValue); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->setAttributeNode($attr); +echo $doc->saveXML(); + +$attr->__construct("newnewattribute", "my even newer value"); +$doc->documentElement->setAttributeNode($attr); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(9) "attribute" +string(8) "my value" +string(12) "newattribute" +string(12) "my new value" + + + + diff --git a/ext/dom/tests/manually_call_constructor/cdatasection.phpt b/ext/dom/tests/manually_call_constructor/cdatasection.phpt new file mode 100644 index 000000000000..01b8ab7ebd42 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/cdatasection.phpt @@ -0,0 +1,32 @@ +--TEST-- +Manually call __construct() - CDATA section variation +--EXTENSIONS-- +dom +--FILE-- +nodeValue); +$cdata->__construct("my new value"); +var_dump($cdata->nodeValue); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($cdata); +echo $doc->saveXML(); + +$cdata->__construct("my even newer value"); +$doc->documentElement->appendChild($cdata); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(8) "my value" +string(12) "my new value" + + + + diff --git a/ext/dom/tests/manually_call_constructor/comment.phpt b/ext/dom/tests/manually_call_constructor/comment.phpt new file mode 100644 index 000000000000..0abf6bcf6c1c --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/comment.phpt @@ -0,0 +1,34 @@ +--TEST-- +Manually call __construct() - comment variation +--EXTENSIONS-- +dom +--FILE-- +nodeName, $comment->nodeValue); +$comment->__construct("my new value"); +var_dump($comment->nodeName, $comment->nodeValue); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($comment); +echo $doc->saveXML(); + +$comment->__construct("my even newer value"); +$doc->documentElement->appendChild($comment); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(8) "#comment" +string(8) "my value" +string(8) "#comment" +string(12) "my new value" + + + + diff --git a/ext/dom/tests/manually_call_constructor/document.phpt b/ext/dom/tests/manually_call_constructor/document.phpt new file mode 100644 index 000000000000..ce7aacc08b6e --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/document.phpt @@ -0,0 +1,15 @@ +--TEST-- +Manually call __construct() - document variation +--EXTENSIONS-- +dom +--FILE-- +loadXML(''); +$doc->__construct("1.1", "UTF-8"); +echo $doc->saveXML(); + +?> +--EXPECT-- + diff --git a/ext/dom/tests/manually_call_constructor/documentfragment.phpt b/ext/dom/tests/manually_call_constructor/documentfragment.phpt new file mode 100644 index 000000000000..8e6f40d99518 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/documentfragment.phpt @@ -0,0 +1,32 @@ +--TEST-- +Manually call __construct() - document fragment variation +--EXTENSIONS-- +dom +--FILE-- +textContent); +$fragment->__construct(); +var_dump($fragment->textContent); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +@$doc->documentElement->appendChild($fragment); +echo $doc->saveXML(); + +$fragment->__construct(); +@$doc->documentElement->appendChild($fragment); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(0) "" +string(0) "" + + + + diff --git a/ext/dom/tests/manually_call_constructor/element.phpt b/ext/dom/tests/manually_call_constructor/element.phpt new file mode 100644 index 000000000000..9187340a4618 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/element.phpt @@ -0,0 +1,34 @@ +--TEST-- +Manually call __construct() - element variation +--EXTENSIONS-- +dom +--FILE-- +nodeName, $element->textContent); +$element->__construct('foo2', 'my new value'); +var_dump($element->nodeName, $element->textContent); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($element); +echo $doc->saveXML(); + +$element->__construct('foo3', 'my new new value'); +$doc->documentElement->appendChild($element); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(3) "foo" +string(8) "my value" +string(4) "foo2" +string(12) "my new value" + +my new value + +my new valuemy new new value diff --git a/ext/dom/tests/manually_call_constructor/entityreference.phpt b/ext/dom/tests/manually_call_constructor/entityreference.phpt new file mode 100644 index 000000000000..5bffda5fd023 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/entityreference.phpt @@ -0,0 +1,34 @@ +--TEST-- +Manually call __construct() - entity reference variation +--EXTENSIONS-- +dom +--FILE-- +nodeName, $entityRef->textContent); +$entityRef->__construct('foo2'); +var_dump($entityRef->nodeName, $entityRef->textContent); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($entityRef); +echo $doc->saveXML(); + +$entityRef->__construct('foo3'); +$doc->documentElement->appendChild($entityRef); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(3) "foo" +string(0) "" +string(4) "foo2" +string(0) "" + +&foo2; + +&foo2;&foo3; diff --git a/ext/dom/tests/manually_call_constructor/processinginstruction.phpt b/ext/dom/tests/manually_call_constructor/processinginstruction.phpt new file mode 100644 index 000000000000..11e7ab1e28d9 --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/processinginstruction.phpt @@ -0,0 +1,34 @@ +--TEST-- +Manually call __construct() - processing instruction variation +--EXTENSIONS-- +dom +--FILE-- +target, $pi->data); +$pi->__construct('name2', 'value2'); +var_dump($pi->target, $pi->data); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($pi); +echo $doc->saveXML(); + +$pi->__construct('name3', 'value3'); +$doc->documentElement->appendChild($pi); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(5) "name1" +string(6) "value1" +string(5) "name2" +string(6) "value2" + + + + diff --git a/ext/dom/tests/manually_call_constructor/text.phpt b/ext/dom/tests/manually_call_constructor/text.phpt new file mode 100644 index 000000000000..b91b0f66e33d --- /dev/null +++ b/ext/dom/tests/manually_call_constructor/text.phpt @@ -0,0 +1,33 @@ +--TEST-- +Manually call __construct() - text variation +--EXTENSIONS-- +dom +--FILE-- +textContent); +$text->__construct('my new value'); +var_dump($text->textContent); + +$doc = new DOMDocument(); +$doc->loadXML(<< + +XML); +$doc->documentElement->appendChild($text); +echo $doc->saveXML(); + +$text->__construct("\nmy new new value"); +$doc->documentElement->appendChild($text); +echo $doc->saveXML(); + +?> +--EXPECT-- +string(8) "my value" +string(12) "my new value" + +my new value + +my new value +my new new value diff --git a/ext/dom/tests/replaceWith_non_viable_next_sibling.phpt b/ext/dom/tests/replaceWith_non_viable_next_sibling.phpt new file mode 100644 index 000000000000..f0ee54c78d85 --- /dev/null +++ b/ext/dom/tests/replaceWith_non_viable_next_sibling.phpt @@ -0,0 +1,36 @@ +--TEST-- +replaceWith() with a non-viable next sibling +--EXTENSIONS-- +dom +--FILE-- +loadXML(<< + + + + + +XML); + +$container = $doc->documentElement; +$child = $container->firstElementChild; +$alone = $child->firstElementChild; + +$child->after($alone); +echo $doc->saveXML(); +$child->replaceWith($alone); +echo $doc->saveXML(); +?> +--EXPECT-- + + + + + + + + + + diff --git a/ext/dom/text.c b/ext/dom/text.c index b33bcd98ecf1..ef5568b586e1 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -51,13 +51,11 @@ PHP_METHOD(DOMText, __construct) } intern = Z_DOMOBJ_P(ZEND_THIS); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode ); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); + oldnode = dom_object_get_node(intern); + if (oldnode != NULL) { + php_libxml_node_decrement_resource((php_libxml_node_object *)intern); } + php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern); } /* }}} end DOMText::__construct */ diff --git a/ext/intl/tests/calendar_clear_variation1.phpt b/ext/intl/tests/calendar_clear_variation1.phpt index 55f23cc446f6..75f026d0521c 100644 --- a/ext/intl/tests/calendar_clear_variation1.phpt +++ b/ext/intl/tests/calendar_clear_variation1.phpt @@ -4,9 +4,12 @@ IntlCalendar::clear() 1 arg variation date.timezone=Atlantic/Azores --EXTENSIONS-- intl ---XFAIL-- -May currently fail with ICU 73. -See https://github.com/php/php-src/issues/11128 +--SKIPIF-- += 0 && version_compare(INTL_ICU_VERSION, '74.1') < 0) { + die('skip Broken for ICU >= 73.1 and < 74.1, see https://github.com/php/php-src/issues/11128'); +} +?> --FILE-- _private != NULL) { - if (xmlHashLookup(table, name) == entity) { - xmlHashRemoveEntry(table, name, NULL); - } + xmlHashRemoveEntry(table, name, NULL); } } diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index 6ffb076c63da..3bd5202f5879 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -145,6 +145,42 @@ PHP_LIBXML_API void php_libxml_shutdown(void); ZEND_TSRMLS_CACHE_EXTERN() #endif +/* Other extension may override the global state options, these global options + * are copied initially to ctxt->options. Set the options to a known good value. + * See libxml2 globals.c and parserInternals.c. + * The unique_name argument allows multiple sanitizes and restores within the + * same function, even nested is necessary. */ +#define PHP_LIBXML_SANITIZE_GLOBALS(unique_name) \ + int xml_old_loadsubset_##unique_name = xmlLoadExtDtdDefaultValue; \ + xmlLoadExtDtdDefaultValue = 0; \ + int xml_old_validate_##unique_name = xmlDoValidityCheckingDefaultValue; \ + xmlDoValidityCheckingDefaultValue = 0; \ + int xml_old_pedantic_##unique_name = xmlPedanticParserDefault(0); \ + int xml_old_substitute_##unique_name = xmlSubstituteEntitiesDefault(0); \ + int xml_old_linenrs_##unique_name = xmlLineNumbersDefault(0); \ + int xml_old_blanks_##unique_name = xmlKeepBlanksDefault(1); + +#define PHP_LIBXML_RESTORE_GLOBALS(unique_name) \ + xmlLoadExtDtdDefaultValue = xml_old_loadsubset_##unique_name; \ + xmlDoValidityCheckingDefaultValue = xml_old_validate_##unique_name; \ + (void) xmlPedanticParserDefault(xml_old_pedantic_##unique_name); \ + (void) xmlSubstituteEntitiesDefault(xml_old_substitute_##unique_name); \ + (void) xmlLineNumbersDefault(xml_old_linenrs_##unique_name); \ + (void) xmlKeepBlanksDefault(xml_old_blanks_##unique_name); + +/* Alternative for above, working directly on the context and not setting globals. + * Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */ +static zend_always_inline void php_libxml_sanitize_parse_ctxt_options(xmlParserCtxtPtr ctxt) +{ + ctxt->loadsubset = 0; + ctxt->validate = 0; + ctxt->pedantic = 0; + ctxt->replaceEntities = 0; + ctxt->linenumbers = 0; + ctxt->keepBlanks = 1; + ctxt->options = 0; +} + #else /* HAVE_LIBXML */ #define libxml_module_ptr NULL #endif diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 13ad7952b986..3e59806b8675 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1159,8 +1159,7 @@ PHP_RSHUTDOWN_FUNCTION(mbstring) if (MBSTRG(all_encodings_list)) { GC_DELREF(MBSTRG(all_encodings_list)); - zend_hash_destroy(MBSTRG(all_encodings_list)); - efree(MBSTRG(all_encodings_list)); + zend_array_destroy(MBSTRG(all_encodings_list)); MBSTRG(all_encodings_list) = NULL; } diff --git a/ext/mbstring/tests/mb_list_encodings_gc_uaf.phpt b/ext/mbstring/tests/mb_list_encodings_gc_uaf.phpt new file mode 100644 index 000000000000..4a83372b1674 --- /dev/null +++ b/ext/mbstring/tests/mb_list_encodings_gc_uaf.phpt @@ -0,0 +1,9 @@ +--TEST-- +Use-after-free of MBSTRG(all_encodings_list) on shutdown +--EXTENSIONS-- +mbstring +--FILE-- + +--EXPECT-- diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt index b3c93a5c1f14..ec4cbc2c2d23 100644 --- a/ext/mysqli/tests/001.phpt +++ b/ext/mysqli/tests/001.phpt @@ -4,11 +4,11 @@ mysqli connect mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --EXPECT-- Num_of_rows=1 diff --git a/ext/mysqli/tests/015.phpt b/ext/mysqli/tests/015.phpt index 9726afe78023..5fef3f9250b9 100644 --- a/ext/mysqli/tests/015.phpt +++ b/ext/mysqli/tests/015.phpt @@ -4,7 +4,7 @@ mysqli autocommit/commit/rollback with innodb mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/016.phpt b/ext/mysqli/tests/016.phpt index 6d62b566a159..65414c34781e 100644 --- a/ext/mysqli/tests/016.phpt +++ b/ext/mysqli/tests/016.phpt @@ -4,11 +4,11 @@ mysqli fetch user variable mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- real_query("SELECT 'foo' FROM DUAL"); +$mysqli->real_query("SELECT 'foo' FROM DUAL"); - $myresult = new mysqli_result($mysql); +$myresult = new mysqli_result($mysqli); - $row = $myresult->fetch_row(); - $myresult->close(); - $mysql->close(); +$row = $myresult->fetch_row(); +$myresult->close(); +$mysqli->close(); - var_dump($row); - print "done!"; +var_dump($row); + +try { + new mysqli_result($mysqli); +} catch (Error $exception) { + echo $exception->getMessage() . "\n"; +} + +$mysqli = new mysqli(); +try { + new mysqli_result($mysqli); +} catch (Error $exception) { + echo $exception->getMessage() . "\n"; +} +print "done!"; ?> --EXPECT-- array(1) { [0]=> string(3) "foo" } +my_mysqli object is already closed +mysqli object is not fully initialized done! diff --git a/ext/mysqli/tests/063.phpt b/ext/mysqli/tests/063.phpt index 32166b287df3..54076897e844 100644 --- a/ext/mysqli/tests/063.phpt +++ b/ext/mysqli/tests/063.phpt @@ -4,11 +4,11 @@ resultset constructor mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --CLEAN-- --FILE-- multi_query('SELECT 1;SELECT 2'); diff --git a/ext/mysqli/tests/070.phpt b/ext/mysqli/tests/070.phpt index e849fe06f8c0..3f98cd46760c 100644 --- a/ext/mysqli/tests/070.phpt +++ b/ext/mysqli/tests/070.phpt @@ -4,11 +4,11 @@ mysqli ping mysqli --SKIPIF-- --FILE-- ping()); diff --git a/ext/mysqli/tests/071.phpt b/ext/mysqli/tests/071.phpt index 39d8ba775942..e1d36da47002 100644 --- a/ext/mysqli/tests/071.phpt +++ b/ext/mysqli/tests/071.phpt @@ -4,11 +4,11 @@ mysqli thread_id & kill mysqli --SKIPIF-- --FILE-- server_version; diff --git a/ext/mysqli/tests/072.phpt b/ext/mysqli/tests/072.phpt index 91f302335d94..d0c29b3be1f8 100644 --- a/ext/mysqli/tests/072.phpt +++ b/ext/mysqli/tests/072.phpt @@ -4,11 +4,11 @@ mysqli warning_count, get_warnings mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- multi_query('SELECT 1;SELECT 2'); diff --git a/ext/mysqli/tests/bug32405.phpt b/ext/mysqli/tests/bug32405.phpt index 51d3c19387fd..96e5130ea3dd 100644 --- a/ext/mysqli/tests/bug32405.phpt +++ b/ext/mysqli/tests/bug32405.phpt @@ -4,11 +4,11 @@ Bug #32405 (mysqli->fetch() is returning bad data) mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- query("DROP TABLE IF EXISTS test_bint"); @@ -54,7 +54,7 @@ EOSQL; ?> --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- - + --EXPECT-- done! diff --git a/ext/mysqli/tests/bug36420.phpt b/ext/mysqli/tests/bug36420.phpt index 5d0b52fefeb1..3b603d2bd653 100644 --- a/ext/mysqli/tests/bug36420.phpt +++ b/ext/mysqli/tests/bug36420.phpt @@ -4,12 +4,12 @@ Bug #36420 (segfault when access result->num_rows after calling result->close()) mysqli --SKIPIF-- --FILE-- query('select 1'); diff --git a/ext/mysqli/tests/bug36745.phpt b/ext/mysqli/tests/bug36745.phpt index bbe11789b539..6c993eee3859 100644 --- a/ext/mysqli/tests/bug36745.phpt +++ b/ext/mysqli/tests/bug36745.phpt @@ -4,13 +4,13 @@ Bug #36745 (LOAD DATA LOCAL INFILE doesn't return correct error message) mysqli --SKIPIF-- --INI-- mysqli.allow_local_infile=1 --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- stmt_init(); diff --git a/ext/mysqli/tests/bug39457.phpt b/ext/mysqli/tests/bug39457.phpt index 979a568ba07c..c72145fc4a40 100644 --- a/ext/mysqli/tests/bug39457.phpt +++ b/ext/mysqli/tests/bug39457.phpt @@ -4,11 +4,11 @@ Bug #39457 (Multiple invoked OO connections never close) mysqli --SKIPIF-- --FILE-- connect($host, $user, $passwd, $db, $port, $socket); diff --git a/ext/mysqli/tests/bug42378.phpt b/ext/mysqli/tests/bug42378.phpt index 75661c60b5af..67256859b484 100644 --- a/ext/mysqli/tests/bug42378.phpt +++ b/ext/mysqli/tests/bug42378.phpt @@ -4,13 +4,13 @@ Bug #42378 (bind_result memory exhaustion, SELECT column, FORMAT(...) AS _format mysqli --SKIPIF-- --INI-- memory_limit=83886080 --FILE-- --CLEAN-- --EXPECT-- FLOAT diff --git a/ext/mysqli/tests/bug42548.phpt b/ext/mysqli/tests/bug42548.phpt index dccfd5890415..6b1d2edd450b 100644 --- a/ext/mysqli/tests/bug42548.phpt +++ b/ext/mysqli/tests/bug42548.phpt @@ -52,7 +52,7 @@ print "done!"; ?> --CLEAN-- --FILE-- query('DROP PROCEDURE IF EXISTS p')) printf("[001] [%d] %s\n", $link->errno, $link->error); @@ -69,7 +69,7 @@ if (mysqli_get_server_version($link) <= 50000) { ?> --CLEAN-- --FILE-- --FILE-- close(); @@ -32,7 +32,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- [004] [%s diff --git a/ext/mysqli/tests/bug46109.phpt b/ext/mysqli/tests/bug46109.phpt index 62b40b962d94..47cb43bcbf9d 100644 --- a/ext/mysqli/tests/bug46109.phpt +++ b/ext/mysqli/tests/bug46109.phpt @@ -4,11 +4,11 @@ Bug #46109 (MySQLi::init - Memory leaks) mysqli --SKIPIF-- --FILE-- init(); diff --git a/ext/mysqli/tests/bug46614.phpt b/ext/mysqli/tests/bug46614.phpt index 34c03585dfbd..89392d969d5c 100644 --- a/ext/mysqli/tests/bug46614.phpt +++ b/ext/mysqli/tests/bug46614.phpt @@ -4,7 +4,7 @@ Bug #46614 (Extended MySQLi class gives incorrect empty() result) mysqli --SKIPIF-- isEmpty(); diff --git a/ext/mysqli/tests/bug47050.phpt b/ext/mysqli/tests/bug47050.phpt index 151cd750f2b7..35a3a23c9f09 100644 --- a/ext/mysqli/tests/bug47050.phpt +++ b/ext/mysqli/tests/bug47050.phpt @@ -4,14 +4,14 @@ Bug #47050 (mysqli_poll() modifies improper variables) mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- done diff --git a/ext/mysqli/tests/bug49027.phpt b/ext/mysqli/tests/bug49027.phpt index 7bef3004d800..fa02d3578a6f 100644 --- a/ext/mysqli/tests/bug49027.phpt +++ b/ext/mysqli/tests/bug49027.phpt @@ -4,11 +4,11 @@ Bug #49027 (mysqli_options() doesn't work when using mysqlnd) mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- array(1) { diff --git a/ext/mysqli/tests/bug49442.phpt b/ext/mysqli/tests/bug49442.phpt index e5741ead4d59..a5057c5028e1 100644 --- a/ext/mysqli/tests/bug49442.phpt +++ b/ext/mysqli/tests/bug49442.phpt @@ -23,7 +23,7 @@ mysqli.allow_persistent=1 mysqli.max_persistent=1 --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/bug50772.phpt b/ext/mysqli/tests/bug50772.phpt index 4351e2108c55..0c61f9237b19 100644 --- a/ext/mysqli/tests/bug50772.phpt +++ b/ext/mysqli/tests/bug50772.phpt @@ -4,11 +4,11 @@ Bug #50772 (mysqli constructor without parameters does not return a working mysq mysqli --SKIPIF-- --FILE-- --INI-- mysqli.max_links = 1 @@ -12,7 +12,7 @@ mysqli.allow_persistent = Off mysqli.max_persistent = 0 --FILE-- close(); ?> --FILE-- --FILE-- options(MYSQLI_SET_CHARSET_NAME, "latin2"); if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) { diff --git a/ext/mysqli/tests/bug52891.phpt b/ext/mysqli/tests/bug52891.phpt index fc76f89b703a..2d73ae70733b 100644 --- a/ext/mysqli/tests/bug52891.phpt +++ b/ext/mysqli/tests/bug52891.phpt @@ -4,11 +4,11 @@ Bug #52891 (Wrong data inserted with mysqli/mysqlnd when using bind_param,value mysqli --SKIPIF-- --FILE-- --CLEAN-- --INI-- mysqli.max_links = 1 @@ -12,7 +12,7 @@ mysqli.allow_persistent = Off mysqli.max_persistent = 0 --FILE-- --INI-- mysqli.max_links = 1 @@ -12,7 +12,7 @@ mysqli.allow_persistent = Off mysqli.max_persistent = 0 --FILE-- close(); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- Okey diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt index c0059e171438..521c17e8fb99 100644 --- a/ext/mysqli/tests/bug66124.phpt +++ b/ext/mysqli/tests/bug66124.phpt @@ -20,7 +20,7 @@ $table_delete = "DELETE FROM `test`"; $id = '1311200011005001566'; -require_once('connect.inc'); +require_once 'connect.inc'; if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", @@ -93,7 +93,7 @@ $link->close(); done --CLEAN-- --EXPECT-- Using 'i': diff --git a/ext/mysqli/tests/bug66762.phpt b/ext/mysqli/tests/bug66762.phpt index 2864793805bc..0176e12e1ccd 100644 --- a/ext/mysqli/tests/bug66762.phpt +++ b/ext/mysqli/tests/bug66762.phpt @@ -4,11 +4,11 @@ Bug #66762 mysqli@libmysql segfault in mysqli_stmt::bind_result() when link clo mysqli --SKIPIF-- --FILE-- --INI-- precision=5 --FILE-- --CLEAN-- --EXPECT-- 1: 9.9999: 9.9999 diff --git a/ext/mysqli/tests/bug67983.phpt b/ext/mysqli/tests/bug67983.phpt index d6aebc35fef6..7146689d64e0 100644 --- a/ext/mysqli/tests/bug67983.phpt +++ b/ext/mysqli/tests/bug67983.phpt @@ -4,12 +4,12 @@ Bug #67983: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit mysqli --SKIPIF-- --FILE-- --CLEAN-- server_version < 50709) { ?> --CLEAN-- --EXPECT-- OK diff --git a/ext/mysqli/tests/bug70949.phpt b/ext/mysqli/tests/bug70949.phpt index 15ae23dae2d0..e4bfb6b0641b 100644 --- a/ext/mysqli/tests/bug70949.phpt +++ b/ext/mysqli/tests/bug70949.phpt @@ -8,7 +8,7 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- query("DROP TABLE IF EXISTS bug70949"); @@ -43,7 +43,7 @@ if ($stmt = $mysql->prepare($sql)) ?> --CLEAN-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- query('SET @@global.max_allowed_packet = 67108864'); diff --git a/ext/mysqli/tests/bug73949.phpt b/ext/mysqli/tests/bug73949.phpt index 7c5364c27473..65633d3dc5ba 100644 --- a/ext/mysqli/tests/bug73949.phpt +++ b/ext/mysqli/tests/bug73949.phpt @@ -4,11 +4,11 @@ Bug #73949 (leak in mysqli_fetch_object) mysqli --SKIPIF-- --FILE-- --FILE-- query('SET @@global.max_allowed_packet = 67108864'); diff --git a/ext/mysqli/tests/bug74547.phpt b/ext/mysqli/tests/bug74547.phpt index 49d2bc8d3e6a..a4516ea1a879 100644 --- a/ext/mysqli/tests/bug74547.phpt +++ b/ext/mysqli/tests/bug74547.phpt @@ -4,13 +4,13 @@ Bug #74547 mysqli::change_user() doesn't accept null as $database argument w/str mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- fetch_assoc()) { ?> --CLEAN-- --EXPECT-- string(1) "0" diff --git a/ext/mysqli/tests/bug75448.phpt b/ext/mysqli/tests/bug75448.phpt index 1ecb81b20030..fedcd3fb399a 100644 --- a/ext/mysqli/tests/bug75448.phpt +++ b/ext/mysqli/tests/bug75448.phpt @@ -4,7 +4,7 @@ mysqli_prepare() called on a closed connection should return FALSE (bug #75448) mysqli --SKIPIF-- --FILE-- free_result(); } else { - echo('[FIRST][FAIL] mysqli::prepare returned false: ' . $link->error . PHP_EOL); + echo '[FIRST][FAIL] mysqli::prepare returned false: ' . $link->error . PHP_EOL; } $link->close(); @@ -74,7 +74,7 @@ if ($stmt) { } $stmt->free_result(); } else { - echo('[SECOND][FAIL] mysqli::prepare returned false: ' . $link->error . PHP_EOL); + echo '[SECOND][FAIL] mysqli::prepare returned false: ' . $link->error . PHP_EOL; } $link->close(); ?> diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt index ffc0ccf18976..bc9de640ea21 100644 --- a/ext/mysqli/tests/bug77597.phpt +++ b/ext/mysqli/tests/bug77597.phpt @@ -4,13 +4,13 @@ Bug #77597: mysqli_fetch_field hangs scripts mysqli --SKIPIF-- --FILE-- query('DROP TABLE IF EXISTS test'); @@ -27,7 +27,7 @@ var_dump($field->name); ?> --CLEAN-- --EXPECT-- string(1) "b" diff --git a/ext/mysqli/tests/bug77935.phpt b/ext/mysqli/tests/bug77935.phpt index 5ebf1e97e5f9..c2f2f9684b6d 100644 --- a/ext/mysqli/tests/bug77935.phpt +++ b/ext/mysqli/tests/bug77935.phpt @@ -4,11 +4,11 @@ Bug #77935: Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP with a cur mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- close(); ?> --CLEAN-- --EXPECTF-- Running query on first connection diff --git a/ext/mysqli/tests/bug80837.phpt b/ext/mysqli/tests/bug80837.phpt index d4b37a268b2c..b8ad59eea231 100644 --- a/ext/mysqli/tests/bug80837.phpt +++ b/ext/mysqli/tests/bug80837.phpt @@ -9,7 +9,7 @@ if (!defined('MYSQLI_STORE_RESULT_COPY_DATA')) die('skip requires mysqlnd'); ?> --FILE-- close(); ?> --CLEAN-- --EXPECT-- Commands out of sync; you can't run this command now diff --git a/ext/mysqli/tests/bug_bits.phpt b/ext/mysqli/tests/bug_bits.phpt index 97e6dbe39b2a..73bc95aa98d9 100644 --- a/ext/mysqli/tests/bug_bits.phpt +++ b/ext/mysqli/tests/bug_bits.phpt @@ -4,12 +4,12 @@ Bug (Incorrectly decoding bit values / Malformed server packet. Field length poi mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- report_mode; + $driver->report_mode = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT; - $flags = $enable_env_flags? $connect_flags:0; if ($flags !== 0) { - $link = mysqli_init(); - if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags)) - $link = false; + parent::__construct(); + $this->real_connect($host, $user, $passwd, $db, $port, $socket, $flags); } else { - $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); + parent::__construct($host, $user, $passwd, $db, $port, $socket); } - return $link; + // Restore error mode + $driver->report_mode = $report_mode; } + } - /** - * Whenever possible, please use this wrapper to make testing of MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible - * - * @param bool $enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS) - */ - function my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags = 0, $enable_env_flags = true) { - global $connect_flags; - - if ($enable_env_flags) - $flags = $flags | $connect_flags; - - return mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags); + function have_innodb($link) { + if (($res = $link->query("SHOW VARIABLES LIKE 'have_innodb'")) + && ($row = $res->fetch_row()) + && !empty($row) + ) { + return !($row[1] == 'DISABLED' || $row[1] == 'NO'); } - - class my_mysqli extends mysqli { - public function __construct($host, $user, $passwd, $db, $port, $socket, $enable_env_flags = true) { - global $connect_flags; - - $flags = ($enable_env_flags) ? $connect_flags : 0; - - if ($flags !== 0) { - parent::__construct(); - $this->real_connect($host, $user, $passwd, $db, $port, $socket, $flags); - } else { - parent::__construct($host, $user, $passwd, $db, $port, $socket); + // MySQL 5.6.1+ + if ($res = $link->query('SHOW ENGINES')) { + while ($row = $res->fetch_assoc()) { + if (!isset($row['Engine']) || !isset($row['Support'])) { + return false; } - } - } - - function have_innodb($link) { - if (($res = $link->query("SHOW VARIABLES LIKE 'have_innodb'")) - && ($row = $res->fetch_row()) - && !empty($row) - ) { - return !($row[1] == 'DISABLED' || $row[1] == 'NO'); - } - // MySQL 5.6.1+ - if ($res = $link->query('SHOW ENGINES')) { - while ($row = $res->fetch_assoc()) { - if (!isset($row['Engine']) || !isset($row['Support'])) { - return false; - } - if (($row['Engine'] == 'InnoDB') - && (($row['Support'] == 'YES') || ($row['Support'] == 'DEFAULT')) - ) { - return true; - } + if (($row['Engine'] == 'InnoDB') + && (($row['Support'] == 'YES') || ($row['Support'] == 'DEFAULT')) + ) { + return true; } } - return false; } - - } else { - printf("skip Eeeek/BUG/FIXME - connect.inc included twice! skipif bug?\n"); - } - - function handle_catchable_fatal($errno, $error, $file, $line) { - static $errcodes = array(); - if (empty($errcodes)) { - $constants = get_defined_constants(); - foreach ($constants as $name => $value) { - if (substr($name, 0, 2) == "E_") - $errcodes[$value] = $name; - } - } - printf("[%s] %s in %s on line %s\n", - (isset($errcodes[$errno])) ? $errcodes[$errno] : $errno, - $error, $file, $line); - - return true; + return false; } -?> diff --git a/ext/mysqli/tests/gh11438.phpt b/ext/mysqli/tests/gh11438.phpt new file mode 100644 index 000000000000..56356811fc1e --- /dev/null +++ b/ext/mysqli/tests/gh11438.phpt @@ -0,0 +1,88 @@ +--TEST-- +GH-11438 (mysqlnd fails to authenticate with sha256_password accounts using passwords longer than 19 characters) +--EXTENSIONS-- +mysqli +--SKIPIF-- +query("SHOW PLUGINS"))) { + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); +} + +$found = false; +while ($row = $res->fetch_assoc()) { + if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { + $found = true; + break; + } +} +if (!$found) + die("skip SHA-256 server plugin unavailable"); + +// Ignore errors because this variable exists only in MySQL 5.6 and 5.7 +$link->query("SET @@session.old_passwords=2"); + +$link->query('DROP USER shatest'); +$link->query("DROP USER shatest@localhost"); + +if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') || + !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { + die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); +} + +// Password of length 52, more than twice the length of the scramble data to ensure scramble is repeated correctly +if (!$link->query('SET PASSWORD FOR shatest@"%" = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"') || + !$link->query('SET PASSWORD FOR shatest@"localhost" = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"')) { + die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); +} + +echo "nocache"; +?> +--FILE-- +connect_errno) { + printf("[001] [%d] %s\n", $link->connect_errno, $link->connect_error); +} else { + if (!$res = $link->query("SELECT USER()")) + printf("[002] [%d] %s\n", $link->errno, $link->error); + + if (!$row = mysqli_fetch_assoc($res)) { + printf("[003] [%d] %s\n", $link->errno, $link->error); + } + + if (!is_string($row['USER()']) || !str_starts_with($row['USER()'], 'shatest')) { + printf("[004] Expecting 1 got %s/'%s'", gettype($row['USER()']), $row['USER()']); + } +} + +print "done!"; +?> +--CLEAN-- +query('DROP USER shatest'); +$link->query('DROP USER shatest@localhost'); +?> +--EXPECTF-- +done! diff --git a/ext/mysqli/tests/gh11550.phpt b/ext/mysqli/tests/gh11550.phpt new file mode 100644 index 000000000000..6ed02ec91d51 --- /dev/null +++ b/ext/mysqli/tests/gh11550.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug GH-11550 (MySQL Statement has a empty query result when the response field has changed, also Segmentation fault) +--EXTENSIONS-- +mysqli +--SKIPIF-- + +--FILE-- +query(<<<'SQL' +CREATE TABLE `test_gh11550` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `name`(`name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +SQL); +$link->query(<<<'SQL' +INSERT INTO `test_gh11550` (`name`) VALUES ('test1'); +SQL); + +$stmt = $link->prepare('select * from test_gh11550'); +var_dump('mysqli-1:', $stmt->execute(), $stmt->get_result()->fetch_all()); + +$link->query(<<<'SQL' +ALTER TABLE `test_gh11550` +ADD COLUMN `a` varchar(255) NOT NULL DEFAULT ''; +SQL); + +var_dump('mysqli-2:', $stmt->execute(), $stmt->get_result()->fetch_all()); +echo 'Done'; +?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_gh11550'); +?> +--EXPECT-- +string(9) "mysqli-1:" +bool(true) +array(1) { + [0]=> + array(2) { + [0]=> + int(1) + [1]=> + string(5) "test1" + } +} +string(9) "mysqli-2:" +bool(true) +array(1) { + [0]=> + array(3) { + [0]=> + int(1) + [1]=> + string(5) "test1" + [2]=> + string(0) "" + } +} +Done diff --git a/ext/mysqli/tests/gh7837.phpt b/ext/mysqli/tests/gh7837.phpt index 19787ced0edb..3ef6223f0fc9 100644 --- a/ext/mysqli/tests/gh7837.phpt +++ b/ext/mysqli/tests/gh7837.phpt @@ -8,7 +8,7 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true); @@ -22,7 +22,7 @@ var_dump($result->fetch_all()); ?> --CLEAN-- --EXPECT-- array(3) { diff --git a/ext/mysqli/tests/gh7932.phpt b/ext/mysqli/tests/gh7932.phpt index cc0317c314c4..ed6d2443608b 100644 --- a/ext/mysqli/tests/gh7932.phpt +++ b/ext/mysqli/tests/gh7932.phpt @@ -8,7 +8,7 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- --FILE-- --FILE-- query('SELECT 42'); diff --git a/ext/mysqli/tests/gh8267.phpt b/ext/mysqli/tests/gh8267.phpt index 805bd695a6f9..067d0beef2cf 100644 --- a/ext/mysqli/tests/gh8267.phpt +++ b/ext/mysqli/tests/gh8267.phpt @@ -4,11 +4,11 @@ Bug GH-8267 (MySQLi uses unsupported format specifier on Windows) mysqli --SKIPIF-- --FILE-- query("DROP TABLE IF EXISTS foo"); @@ -17,6 +17,7 @@ $mysqli->query("INSERT INTO foo VALUES (9223372036854775807)"); var_dump($mysqli->insert_id); $mysqli->query("INSERT INTO foo VALUES (0)"); var_dump($mysqli->insert_id); +$mysqli->query("DROP TABLE IF EXISTS foo"); ?> --EXPECT-- string(19) "9223372036854775807" diff --git a/ext/mysqli/tests/gh9590.phpt b/ext/mysqli/tests/gh9590.phpt index 79f44c5d7d4a..df373f7d3b31 100644 --- a/ext/mysqli/tests/gh9590.phpt +++ b/ext/mysqli/tests/gh9590.phpt @@ -5,7 +5,7 @@ mysqli posix --SKIPIF-- +require_once 'skipifconnectfailure.inc'; +?> --FILE-- multi_query("SELECT 1"); @@ -24,10 +28,6 @@ require_once('skipifconnectfailure.inc'); $link->close(); ?> ---CLEAN-- - --EXPECT-- bool(false) object(mysqli_result)#3 (5) { diff --git a/ext/mysqli/tests/mysqli_affected_rows.phpt b/ext/mysqli/tests/mysqli_affected_rows.phpt index ebd505cb0ed7..2547720b3146 100644 --- a/ext/mysqli/tests/mysqli_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows.phpt @@ -4,11 +4,11 @@ mysqli_affected_rows() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt index 8a82cb01a44a..311cef500e91 100644 --- a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt @@ -4,11 +4,11 @@ mysqli->affected_rows mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; } - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) { - printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); - } + $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); if (0 !== ($tmp = $mysqli->affected_rows)) printf("[002] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp); @@ -114,7 +111,7 @@ mysqli ?> --CLEAN-- --EXPECT-- Property access is not allowed yet diff --git a/ext/mysqli/tests/mysqli_allow_local_infile_overrides_local_infile_directory.phpt b/ext/mysqli/tests/mysqli_allow_local_infile_overrides_local_infile_directory.phpt index 627c76ec539c..8625be91e1da 100644 --- a/ext/mysqli/tests/mysqli_allow_local_infile_overrides_local_infile_directory.phpt +++ b/ext/mysqli/tests/mysqli_allow_local_infile_overrides_local_infile_directory.phpt @@ -22,7 +22,7 @@ mysqli.allow_local_infile=1 mysqli.local_infile_directory={PWD}/foo/bar --FILE-- --CLEAN-- --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_autocommit.phpt b/ext/mysqli/tests/mysqli_autocommit.phpt index 0da4e488e641..dae921c4140f 100644 --- a/ext/mysqli/tests/mysqli_autocommit.phpt +++ b/ext/mysqli/tests/mysqli_autocommit.phpt @@ -16,7 +16,7 @@ mysqli ?> --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_autocommit_oo.phpt b/ext/mysqli/tests/mysqli_autocommit_oo.phpt index 0c0dbee834f3..f6219688140f 100644 --- a/ext/mysqli/tests/mysqli_autocommit_oo.phpt +++ b/ext/mysqli/tests/mysqli_autocommit_oo.phpt @@ -15,12 +15,9 @@ mysqli ?> --FILE-- autocommit(true))) printf("[002] Expecting boolean/any, got %s/%s\n", gettype($tmp), $tmp); @@ -131,7 +128,7 @@ mysqli ?> --CLEAN-- --EXPECT-- my_mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_begin_transaction.phpt b/ext/mysqli/tests/mysqli_begin_transaction.phpt index 20eda35cb3d5..7a7d7e36fba4 100644 --- a/ext/mysqli/tests/mysqli_begin_transaction.phpt +++ b/ext/mysqli/tests/mysqli_begin_transaction.phpt @@ -4,9 +4,9 @@ mysqli_begin_transaction() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- NULL diff --git a/ext/mysqli/tests/mysqli_change_user.phpt b/ext/mysqli/tests/mysqli_change_user.phpt index 2e3a772a7ed1..9628770994f8 100644 --- a/ext/mysqli/tests/mysqli_change_user.phpt +++ b/ext/mysqli/tests/mysqli_change_user.phpt @@ -4,11 +4,11 @@ mysqli_change_user() mysqli --SKIPIF-- --FILE-- --INI-- max_execution_time=240 --FILE-- --CLEAN-- --EXPECTF-- Testing GET_LOCK()... diff --git a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt index e220878c5bab..c4a39b756c80 100644 --- a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt @@ -54,7 +54,7 @@ require_once 'skipifconnectfailure.inc'; ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt b/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt index 4c72190b9c7a..36f5ec0329ca 100644 --- a/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt +++ b/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt @@ -4,13 +4,13 @@ mysqli_change_user() - table locks, GET_LOCK(), temporary tables mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_change_user_old.phpt b/ext/mysqli/tests/mysqli_change_user_old.phpt index db9e7ca18318..1e2bfcc302f3 100644 --- a/ext/mysqli/tests/mysqli_change_user_old.phpt +++ b/ext/mysqli/tests/mysqli_change_user_old.phpt @@ -4,7 +4,7 @@ mysqli_change_user(), MySQL < 5.6 mysqli --SKIPIF-- = 50600 && mysqli_get_server_version($link ?> --FILE-- = 50600) ?> --FILE-- change_user($user . '_unknown_really', $passwd . 'non_empty', $db))) printf("[006] Expecting false, got %s/%s\n", gettype($tmp), $tmp); @@ -32,9 +30,7 @@ if (mysqli_get_server_version($link) >= 50600) printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp); // Reconnect because after 3 failed change_user attempts, the server blocks you off. - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); if (!$mysqli->query('SET @mysqli_change_user_test_var=1')) printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error); diff --git a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt index 1e4ec750fa13..bf9059b110f7 100644 --- a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt +++ b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt @@ -4,11 +4,11 @@ mysqli_change_user() - Prepared Statement mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index 8e9e943528d5..f2723b50155b 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -4,15 +4,11 @@ Fetching results from tables of different charsets. mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_character_set_name.phpt b/ext/mysqli/tests/mysqli_character_set_name.phpt index 364d9a0ea8a8..76e901c7975b 100644 --- a/ext/mysqli/tests/mysqli_character_set_name.phpt +++ b/ext/mysqli/tests/mysqli_character_set_name.phpt @@ -4,12 +4,12 @@ mysqli_character_set_name(), mysql_client_encoding() [alias] mysqli --SKIPIF-- --FILE-- --FILE-- query('SELECT version() AS server_version')) printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error); diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index 393321bd1d59..bada1d85a5ce 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -4,11 +4,11 @@ Interface of the class mysqli mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- - + --EXPECTF-- Without RS diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt index 946657d3ef8a..4e23de5cab54 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt @@ -4,12 +4,11 @@ Interface of the class mysqli_result mysqli --SKIPIF-- --FILE-- query('SELECT * FROM test'); diff --git a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt index c0101a8d9e41..09d08de7d295 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt @@ -4,12 +4,11 @@ Interface of the class mysqli_stmt mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- close(); if (true !== $tmp) diff --git a/ext/mysqli/tests/mysqli_commit.phpt b/ext/mysqli/tests/mysqli_commit.phpt index ec90ab6d7e15..f5b64e125117 100644 --- a/ext/mysqli/tests/mysqli_commit.phpt +++ b/ext/mysqli/tests/mysqli_commit.phpt @@ -13,7 +13,7 @@ if (!have_innodb($link)) ?> --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_commit_oo.phpt b/ext/mysqli/tests/mysqli_commit_oo.phpt index fd4c1bbf008c..d0ff739b8af3 100644 --- a/ext/mysqli/tests/mysqli_commit_oo.phpt +++ b/ext/mysqli/tests/mysqli_commit_oo.phpt @@ -15,9 +15,6 @@ if (!have_innodb($link)) commit(); @@ -25,10 +22,7 @@ if (!have_innodb($link)) echo $exception->getMessage() . "\n"; } - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) { - printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); - } + $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); if (true !== ($tmp = $mysqli->commit())) { printf("[002] Expecting boolean/true got %s/%s\n", gettype($tmp), $tmp); @@ -98,7 +92,7 @@ if (!have_innodb($link)) ?> --CLEAN-- --EXPECTF-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_connect.phpt b/ext/mysqli/tests/mysqli_connect.phpt index f229515f0de0..cf276d6886f6 100644 --- a/ext/mysqli/tests/mysqli_connect.phpt +++ b/ext/mysqli/tests/mysqli_connect.phpt @@ -4,11 +4,11 @@ mysqli_connect() mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- thread_id) printf("[008] Cannot determine thread id, test will fail, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); diff --git a/ext/mysqli/tests/mysqli_data_seek.phpt b/ext/mysqli/tests/mysqli_data_seek.phpt index 787b28079723..11ffef3abd25 100644 --- a/ext/mysqli/tests/mysqli_data_seek.phpt +++ b/ext/mysqli/tests/mysqli_data_seek.phpt @@ -4,13 +4,11 @@ mysqli_data_seek() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_data_seek(): Argument #2 ($offset) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_data_seek_oo.phpt b/ext/mysqli/tests/mysqli_data_seek_oo.phpt index 8801b7394eba..98bb6c714198 100644 --- a/ext/mysqli/tests/mysqli_data_seek_oo.phpt +++ b/ext/mysqli/tests/mysqli_data_seek_oo.phpt @@ -4,12 +4,11 @@ mysqli_result->data_seek() mysqli --SKIPIF-- --FILE-- --EXPECT-- mysqli_result object is already closed diff --git a/ext/mysqli/tests/mysqli_debug.phpt b/ext/mysqli/tests/mysqli_debug.phpt index 25cd8f2c8d6b..510de3dae00a 100644 --- a/ext/mysqli/tests/mysqli_debug.phpt +++ b/ext/mysqli/tests/mysqli_debug.phpt @@ -4,7 +4,7 @@ mysqli_debug() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- done%s diff --git a/ext/mysqli/tests/mysqli_debug_append.phpt b/ext/mysqli/tests/mysqli_debug_append.phpt index 1c26d469f51d..f3f24cb9e341 100644 --- a/ext/mysqli/tests/mysqli_debug_append.phpt +++ b/ext/mysqli/tests/mysqli_debug_append.phpt @@ -4,7 +4,7 @@ mysqli_debug() - append to trace file mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- done%s diff --git a/ext/mysqli/tests/mysqli_debug_control_string.phpt b/ext/mysqli/tests/mysqli_debug_control_string.phpt index eec3a669d2a9..b745ed2ebce8 100644 --- a/ext/mysqli/tests/mysqli_debug_control_string.phpt +++ b/ext/mysqli/tests/mysqli_debug_control_string.phpt @@ -4,7 +4,7 @@ mysqli_debug() - invalid debug control strings mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- string(32) "t:O,/tmp/mysqli_debug_phpt.trace" diff --git a/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt b/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt index 5c2f58e9f3d4..e46f4aed1984 100644 --- a/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt +++ b/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt @@ -4,7 +4,7 @@ mysqli_debug() - all control string options supported by both mysqlnd and libmys mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- [083][control string 'n:O,%smysqli_debug_phpt.trace'] Trace file has not been written. diff --git a/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt b/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt index 8d9058439752..ccee53b02cf9 100644 --- a/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt +++ b/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt @@ -121,7 +121,7 @@ if (defined('MYSQLI_DEBUG_TRACE_ENABLED') && !MYSQLI_DEBUG_TRACE_ENABLED) ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_driver.phpt b/ext/mysqli/tests/mysqli_driver.phpt index 79f62cc8685a..76ffb44080ea 100644 --- a/ext/mysqli/tests/mysqli_driver.phpt +++ b/ext/mysqli/tests/mysqli_driver.phpt @@ -4,11 +4,11 @@ mysqli_driver class mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- errno mysqli --SKIPIF-- --FILE-- --FILE-- error mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- [005] [1064] You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'some random gibberish' at line 1 diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt b/ext/mysqli/tests/mysqli_expire_password.phpt index fa1b9a94b0f5..8cfd8bd772dd 100644 --- a/ext/mysqli/tests/mysqli_expire_password.phpt +++ b/ext/mysqli/tests/mysqli_expire_password.phpt @@ -4,7 +4,7 @@ MySQL 5.6 / MariaDB 10.4.3 EXPIRE PASSWORD protocol change mysqli --SKIPIF-- --FILE-- --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_explain_metadata.phpt b/ext/mysqli/tests/mysqli_explain_metadata.phpt index af8d153bc759..320f2c712459 100644 --- a/ext/mysqli/tests/mysqli_explain_metadata.phpt +++ b/ext/mysqli/tests/mysqli_explain_metadata.phpt @@ -153,7 +153,7 @@ require_once 'skipifconnectfailure.inc'; ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_all.phpt b/ext/mysqli/tests/mysqli_fetch_all.phpt index cfd28261c080..75d26f617b45 100644 --- a/ext/mysqli/tests/mysqli_fetch_all.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all.phpt @@ -4,13 +4,12 @@ mysqli_fetch_all() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt index 8a5b5bfbd989..6bb2fd80bb12 100644 --- a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt @@ -4,22 +4,12 @@ $mysqli->fetch_all() (introduced with mysqlnd) mysqli --SKIPIF-- --FILE-- query("SELECT * FROM test ORDER BY id LIMIT 2")) { printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error); } @@ -305,7 +295,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_array.phpt b/ext/mysqli/tests/mysqli_fetch_array.phpt index 617ea91ff03a..ed1c76f3dedd 100644 --- a/ext/mysqli/tests/mysqli_fetch_array.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array.phpt @@ -4,13 +4,11 @@ mysqli_fetch_array() - all datatypes but BIT mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- [002] diff --git a/ext/mysqli/tests/mysqli_fetch_array_large.phpt b/ext/mysqli/tests/mysqli_fetch_array_large.phpt index 21b74e8ab7ae..fa8d33b76964 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_large.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_large.phpt @@ -5,7 +5,7 @@ mysqli --SKIPIF-- --CONFLICTS-- all @@ -13,7 +13,7 @@ all memory_limit=-1 --FILE-- --CLEAN-- --EXPECTF-- stop: %s diff --git a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt index a96e4f5d32d1..4650475e7333 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt @@ -4,11 +4,12 @@ mysqli_fetch_array() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt index 8695166338c1..23ae16cdd2e2 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt @@ -4,19 +4,12 @@ mysqli->fetch_array() mysqli --SKIPIF-- --FILE-- query("SELECT * FROM test ORDER BY id LIMIT 5")) { printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error); @@ -279,7 +272,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_assoc.phpt b/ext/mysqli/tests/mysqli_fetch_assoc.phpt index 80546ca19856..0048ba4dd1eb 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc.phpt @@ -4,15 +4,13 @@ mysqli_fetch_assoc() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt index 3e2bfea66aee..76b6e6fb1bc3 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt @@ -107,7 +107,7 @@ if (mysqli_get_server_version($link) < 50003) ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt index 7d48ff1193a2..418a22a223e2 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt @@ -4,11 +4,11 @@ mysqli_fetch_assoc() mysqli --SKIPIF-- --FILE-- --FILE-- ---CLEAN-- - --EXPECTF-- [003] array(3) { diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_oo.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_oo.phpt index bc3cf54d16f0..f330820045f3 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_oo.phpt @@ -4,27 +4,13 @@ mysqli_fetch_assoc() mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; - } - - require('table.inc'); - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + require 'table.inc'; + $mysqli = $link; if (!$res = $mysqli->query("SELECT id, label FROM test ORDER BY id LIMIT 1")) { printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error); @@ -58,10 +44,9 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- -mysqli object is not fully initialized [005] array(2) { ["id"]=> diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt index 147310ecc57a..ae136ec4a511 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt @@ -4,12 +4,12 @@ mysqli_fetch_assoc() - ZEROFILL mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_column.phpt b/ext/mysqli/tests/mysqli_fetch_column.phpt index fddb41687d8a..84ed9c3b966f 100644 --- a/ext/mysqli/tests/mysqli_fetch_column.phpt +++ b/ext/mysqli/tests/mysqli_fetch_column.phpt @@ -8,8 +8,6 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- --CLEAN-- --EXPECT-- [001] diff --git a/ext/mysqli/tests/mysqli_fetch_field.phpt b/ext/mysqli/tests/mysqli_fetch_field.phpt index 512ae27b8276..dacbd5349668 100644 --- a/ext/mysqli/tests/mysqli_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field.phpt @@ -4,15 +4,13 @@ mysqli_fetch_field() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_fetch_field_direct.phpt b/ext/mysqli/tests/mysqli_fetch_field_direct.phpt index 1bd5538afba2..584adbc7e339 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_direct.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_direct.phpt @@ -4,13 +4,11 @@ mysqli_fetch_field_direct() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_fetch_field_direct(): Argument #2 ($index) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt index 238eeb65e9c6..b4b835d97823 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt @@ -4,24 +4,12 @@ $res->fetch_field_direct(s) mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; - } - - require('table.inc'); - - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + require 'table.inc'; + $mysqli = $link; if (!$res = $mysqli->query("SELECT id AS ID, label FROM test AS TEST ORDER BY id LIMIT 1")) { printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -54,10 +42,9 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- -mysqli object is not fully initialized mysqli_result::fetch_field_direct(): Argument #1 ($index) must be greater than or equal to 0 object(stdClass)#%d (13) { ["name"]=> diff --git a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt index 9874fff49f8e..53eb3e691694 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt @@ -15,7 +15,7 @@ mysqli_close($link); ?> --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt index 6c43ea6bd5f1..1fa84f36fae9 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt @@ -4,25 +4,13 @@ mysqli_fetch_field() mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; - } - - require('table.inc'); - if (!$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + require 'table.inc'; + $mysqli = $link; // Make sure that client, connection and result charsets are all the // same. Not sure whether this is strictly necessary. @@ -63,10 +51,9 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- -mysqli object is not fully initialized object(stdClass)#%d (13) { ["name"]=> string(2) "ID" diff --git a/ext/mysqli/tests/mysqli_fetch_field_types.phpt b/ext/mysqli/tests/mysqli_fetch_field_types.phpt index 99e64ca45b47..041eb16694a7 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_types.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_types.phpt @@ -4,11 +4,11 @@ mysqli_fetch_field() - data types/field->type mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_fields.phpt b/ext/mysqli/tests/mysqli_fetch_fields.phpt index 47ed37e5889c..78df2ef75751 100644 --- a/ext/mysqli/tests/mysqli_fetch_fields.phpt +++ b/ext/mysqli/tests/mysqli_fetch_fields.phpt @@ -4,15 +4,13 @@ mysqli_fetch_fields() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_fetch_lengths.phpt b/ext/mysqli/tests/mysqli_fetch_lengths.phpt index dae6588319de..8a31ae25af3e 100644 --- a/ext/mysqli/tests/mysqli_fetch_lengths.phpt +++ b/ext/mysqli/tests/mysqli_fetch_lengths.phpt @@ -4,18 +4,12 @@ mysqli_fetch_lengths() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- bool(false) diff --git a/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt b/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt index 261860531613..980558e10829 100644 --- a/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt @@ -4,16 +4,12 @@ mysqli_result->lengths mysqli --SKIPIF-- --FILE-- query("SELECT id, label FROM test ORDER BY id LIMIT 1")) { printf("[002] [%d] %s\n", $mysqli->errno, $mysqli->error); } @@ -34,10 +30,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- NULL diff --git a/ext/mysqli/tests/mysqli_fetch_object.phpt b/ext/mysqli/tests/mysqli_fetch_object.phpt index 0bf393f5cdd5..e6ab9245152f 100644 --- a/ext/mysqli/tests/mysqli_fetch_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object.phpt @@ -4,15 +4,11 @@ mysqli_fetch_object() mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -68,7 +64,7 @@ require_once('skipifconnectfailure.inc'); var_dump($obj); } } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array('a', 'b')); @@ -104,8 +100,8 @@ require_once('skipifconnectfailure.inc'); try { if (false !== ($obj = @mysqli_fetch_object($res, 'mysqli_fetch_object_construct', 'a'))) printf("[011] Should have failed\n"); - } catch (Error $e) { - handle_catchable_fatal($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } mysqli_free_result($res); @@ -131,8 +127,8 @@ require_once('skipifconnectfailure.inc'); try { var_dump(mysqli_fetch_object($res, 'this_class_does_not_exist')); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -141,14 +137,14 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- ---EXPECTF-- -Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 0 passed and exactly 2 expected -Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected +--EXPECT-- +ArgumentCountError: Too few arguments to function mysqli_fetch_object_construct::__construct(), 0 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL NULL mysqli_result object is already closed -[0] mysqli_fetch_object(): Argument #3 ($constructor_args) must be of type array, string given in %s on line %d -mysqli_fetch_object(): Argument #2 ($class) must be a valid class name, this_class_does_not_exist given +TypeError: mysqli_fetch_object(): Argument #3 ($constructor_args) must be of type array, string given +TypeError: mysqli_fetch_object(): Argument #2 ($class) must be a valid class name, this_class_does_not_exist given done! diff --git a/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt b/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt index 371299808ce2..a507b40f071c 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt @@ -4,16 +4,11 @@ mysqli_fetch_object() - calling constructor on class wo constructor mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- No exception with PHP: diff --git a/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt b/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt index 204cd932e892..3622abfa27cf 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt @@ -4,11 +4,11 @@ mysqli_fetch_object() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- %s(6) "object" diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index 2ddba280f43a..b7b2c7812a96 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -4,24 +4,12 @@ mysqli_fetch_object() mysqli --SKIPIF-- --FILE-- getMessage() . "\n"; - } - - require('table.inc'); - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + require 'table.inc'; + $mysqli = $link; if (!$res = $mysqli->query("SELECT id AS ID, label FROM test AS TEST ORDER BY id LIMIT 5")) { printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error); @@ -30,16 +18,16 @@ require_once('skipifconnectfailure.inc'); try { if (!is_null($tmp = @$res->fetch_object($link, $link))) printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - } catch (Error $e) { - handle_catchable_fatal($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { if (!is_null($tmp = @$res->fetch_object($link, $link, $link))) printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - } catch (Error $e) { - handle_catchable_fatal($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = mysqli_fetch_object($res); @@ -76,8 +64,8 @@ require_once('skipifconnectfailure.inc'); try { $res->fetch_object('mysqli_fetch_object_construct', null); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; mysqli_fetch_object($res); } @@ -88,7 +76,7 @@ require_once('skipifconnectfailure.inc'); var_dump($obj); } } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = $res->fetch_object('mysqli_fetch_object_construct', array('a', 'b')); @@ -110,14 +98,14 @@ require_once('skipifconnectfailure.inc'); try { mysqli_fetch_object($res); - } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($res->fetch_object('this_class_does_not_exist')); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $mysqli->close(); @@ -125,16 +113,15 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- ---EXPECTF-- -mysqli object is not fully initialized -[0] Object of class mysqli could not be converted to string in %s on line %d -[0] mysqli_result::fetch_object() expects at most 2 arguments, 3 given in %s on line %d -mysqli_result::fetch_object(): Argument #2 ($constructor_args) must be of type array, null given -Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected +--EXPECT-- +Error: Object of class mysqli could not be converted to string +ArgumentCountError: mysqli_result::fetch_object() expects at most 2 arguments, 3 given +TypeError: mysqli_result::fetch_object(): Argument #2 ($constructor_args) must be of type array, null given +ArgumentCountError: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL NULL -mysqli_result object is already closed -mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, this_class_does_not_exist given +Error: mysqli_result object is already closed +TypeError: mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, this_class_does_not_exist given done! diff --git a/ext/mysqli/tests/mysqli_fetch_row.phpt b/ext/mysqli/tests/mysqli_fetch_row.phpt index a1f544dbbc33..a2669a099ab5 100644 --- a/ext/mysqli/tests/mysqli_fetch_row.phpt +++ b/ext/mysqli/tests/mysqli_fetch_row.phpt @@ -4,13 +4,11 @@ mysqli_fetch_row() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [004] diff --git a/ext/mysqli/tests/mysqli_field_count.phpt b/ext/mysqli/tests/mysqli_field_count.phpt index bcc0c6e21161..e6b521818f9c 100644 --- a/ext/mysqli/tests/mysqli_field_count.phpt +++ b/ext/mysqli/tests/mysqli_field_count.phpt @@ -4,13 +4,11 @@ mysqli_field_count() mysqli --SKIPIF-- --FILE-- --EXPECT-- int(0) diff --git a/ext/mysqli/tests/mysqli_field_seek.phpt b/ext/mysqli/tests/mysqli_field_seek.phpt index c4508fa5482d..1308db7d4f86 100644 --- a/ext/mysqli/tests/mysqli_field_seek.phpt +++ b/ext/mysqli/tests/mysqli_field_seek.phpt @@ -4,7 +4,7 @@ mysqli_field_seek() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_field_seek(): Argument #2 ($index) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_field_tell.phpt b/ext/mysqli/tests/mysqli_field_tell.phpt index cb1dcc3b98e8..cf388a509c56 100644 --- a/ext/mysqli/tests/mysqli_field_tell.phpt +++ b/ext/mysqli/tests/mysqli_field_tell.phpt @@ -4,13 +4,11 @@ mysqli_field_tell() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- int(0) diff --git a/ext/mysqli/tests/mysqli_fork.phpt b/ext/mysqli/tests/mysqli_fork.phpt index 411b12938753..f8ba36edafb4 100644 --- a/ext/mysqli/tests/mysqli_fork.phpt +++ b/ext/mysqli/tests/mysqli_fork.phpt @@ -20,7 +20,7 @@ if (!have_innodb($link)) ?> --FILE-- --CLEAN-- --FILE-- --CLEAN-- --EXPECT-- a diff --git a/ext/mysqli/tests/mysqli_get_charset.phpt b/ext/mysqli/tests/mysqli_get_charset.phpt index f902b11746b1..80338c76f1ec 100644 --- a/ext/mysqli/tests/mysqli_get_charset.phpt +++ b/ext/mysqli/tests/mysqli_get_charset.phpt @@ -4,15 +4,16 @@ mysqli_get_charset() mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index aea4d3c0a0be..141a39012716 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -4,7 +4,7 @@ mysqli_get_client_stats() mysqli --SKIPIF-- --CLEAN-- --CLEAN-- --EXPECTF-- BEGINNING: implicit_free_result = %d diff --git a/ext/mysqli/tests/mysqli_get_client_stats_off.phpt b/ext/mysqli/tests/mysqli_get_client_stats_off.phpt index 4faf1ffc204d..67459a8799c8 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_off.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_off.phpt @@ -4,7 +4,7 @@ mysqli_get_client_stats() - php_ini setting mysqli --SKIPIF-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt b/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt index a348c38290cd..bfa8cc370c28 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt @@ -4,7 +4,7 @@ mysqli_get_client_stats() - PS mysqli --SKIPIF-- --CLEAN-- --EXPECTF-- BEGINNING: rows_fetched_from_client_ps_unbuffered = %d diff --git a/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt b/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt index 7bd92e88e6dd..babf964fdaab 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt @@ -7,15 +7,15 @@ mysqlnd.collect_memory_statistics="1" mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt b/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt index 3cfa6400de6d..ca9642a1ef35 100644 --- a/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt +++ b/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt @@ -7,7 +7,7 @@ mysqlnd.collect_memory_statistics="0" mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_proto_info.phpt b/ext/mysqli/tests/mysqli_get_proto_info.phpt index e0c41c09d7bf..cf306a7e7cec 100644 --- a/ext/mysqli/tests/mysqli_get_proto_info.phpt +++ b/ext/mysqli/tests/mysqli_get_proto_info.phpt @@ -4,13 +4,17 @@ mysqli_get_proto_info() mysqli --SKIPIF-- --FILE-- --FILE-- ---CLEAN-- - --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_server_version.phpt b/ext/mysqli/tests/mysqli_get_server_version.phpt index 1a8958035466..f6411cbeac50 100644 --- a/ext/mysqli/tests/mysqli_get_server_version.phpt +++ b/ext/mysqli/tests/mysqli_get_server_version.phpt @@ -4,13 +4,17 @@ mysqli_get_server_version() mysqli --SKIPIF-- --FILE-- 50105 -- major_version*10000 + minor_version *100 + sub_version */ /* < 30000 = pre 3.2.3, very unlikely! */ if (!is_int($info = mysqli_get_server_version($link)) || ($info < (3 * 10000))) diff --git a/ext/mysqli/tests/mysqli_get_warnings.phpt b/ext/mysqli/tests/mysqli_get_warnings.phpt index 2d2a0042d83a..08831200648d 100644 --- a/ext/mysqli/tests/mysqli_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_get_warnings.phpt @@ -10,7 +10,7 @@ if (!$TEST_EXPERIMENTAL) ?> --FILE-- query("DROP TABLE IF EXISTS t1")) printf("[022] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -101,8 +100,7 @@ if (!$TEST_EXPERIMENTAL) printf("[026] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); /* Yes, I really want to check if the object property is empty */ - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[027] Cannot create mysqli object: [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); $warning = new mysqli_warning($mysqli); if (false !== ($tmp = $warning->next())) @@ -111,8 +109,7 @@ if (!$TEST_EXPERIMENTAL) if ('' != ($tmp = $warning->message)) printf("[029] Expecting string/empty, got %s/%s\n", gettype($tmp), $tmp); - if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[030] Cannot create mysqli object: [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); if (!$mysqli->query("DROP TABLE IF EXISTS t1")) printf("[031] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -140,7 +137,7 @@ if (!$TEST_EXPERIMENTAL) print "done!"; ?> --INI-- mysqli.allow_local_infile=1 --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_init.phpt b/ext/mysqli/tests/mysqli_init.phpt index 5bed5e4be793..94cce958c435 100644 --- a/ext/mysqli/tests/mysqli_init.phpt +++ b/ext/mysqli/tests/mysqli_init.phpt @@ -4,7 +4,7 @@ mysqli_init() mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_insert_id_variation.phpt b/ext/mysqli/tests/mysqli_insert_id_variation.phpt index d555ddedc205..593cf2ed9ebc 100644 --- a/ext/mysqli/tests/mysqli_insert_id_variation.phpt +++ b/ext/mysqli/tests/mysqli_insert_id_variation.phpt @@ -4,11 +4,11 @@ Checking last_insert_id after different operations mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_kill(): Argument #2 ($process_id) must be greater than 0 diff --git a/ext/mysqli/tests/mysqli_last_insert_id.phpt b/ext/mysqli/tests/mysqli_last_insert_id.phpt index 88a3702d2b2e..27814aebdf08 100644 --- a/ext/mysqli/tests/mysqli_last_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_last_insert_id.phpt @@ -4,7 +4,7 @@ API vs. SQL LAST_INSERT_ID() mysqli --SKIPIF-- --FILE-- query("SELECT LAST_INSERT_ID() AS _id"))) { @@ -177,7 +177,7 @@ mysqli ?> --CLEAN-- --EXPECTF-- API: %d, SQL: %d diff --git a/ext/mysqli/tests/mysqli_local_infile_default_off.phpt b/ext/mysqli/tests/mysqli_local_infile_default_off.phpt index 63784703acf1..8bf1ba67135c 100644 --- a/ext/mysqli/tests/mysqli_local_infile_default_off.phpt +++ b/ext/mysqli/tests/mysqli_local_infile_default_off.phpt @@ -4,11 +4,11 @@ ensure default for local infile is off mysqli --SKIPIF-- --FILE-- --CLEAN-- --INI-- mysqli.allow_local_infile=1 --FILE-- --INI-- mysqli.max_links=1 --FILE-- --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/mysqli/tests/mysqli_more_results.phpt b/ext/mysqli/tests/mysqli_more_results.phpt index ac0926d66fa6..5c1f453cb9b0 100644 --- a/ext/mysqli/tests/mysqli_more_results.phpt +++ b/ext/mysqli/tests/mysqli_more_results.phpt @@ -4,13 +4,11 @@ mysqli_more_results() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [004] diff --git a/ext/mysqli/tests/mysqli_multi_query.phpt b/ext/mysqli/tests/mysqli_multi_query.phpt index 76c3b598aa8f..618ffe2085e3 100644 --- a/ext/mysqli/tests/mysqli_multi_query.phpt +++ b/ext/mysqli/tests/mysqli_multi_query.phpt @@ -4,13 +4,11 @@ mysqli_multi_query() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [006] 3 diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt index 95e11db9a6dd..59a8719cbbe6 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt @@ -12,7 +12,7 @@ max_execution_time=60 mysqlnd.net_read_timeout=1 --FILE-- default_socket_timeout mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_next_result_error.phpt b/ext/mysqli/tests/mysqli_next_result_error.phpt index 84c39083494d..91ac2363177a 100644 --- a/ext/mysqli/tests/mysqli_next_result_error.phpt +++ b/ext/mysqli/tests/mysqli_next_result_error.phpt @@ -4,7 +4,7 @@ Error in multi query mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli_result object is already closed diff --git a/ext/mysqli/tests/mysqli_num_rows.phpt b/ext/mysqli/tests/mysqli_num_rows.phpt index 58202f12cd4c..a625669fb0e4 100644 --- a/ext/mysqli/tests/mysqli_num_rows.phpt +++ b/ext/mysqli/tests/mysqli_num_rows.phpt @@ -4,13 +4,11 @@ mysqli_num_rows() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_result object is already closed diff --git a/ext/mysqli/tests/mysqli_open_bug74432.phpt b/ext/mysqli/tests/mysqli_open_bug74432.phpt index 72800439da12..91b7a858718f 100644 --- a/ext/mysqli/tests/mysqli_open_bug74432.phpt +++ b/ext/mysqli/tests/mysqli_open_bug74432.phpt @@ -4,7 +4,7 @@ Bug #74432, BC issue on undocumented connect string mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- Warning: mysqli_real_connect(): (%s/%d): %s in %s on line %d diff --git a/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt b/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt index ecf8bc5cfbeb..c11e0deeb7d2 100644 --- a/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt +++ b/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt @@ -8,7 +8,7 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_options_openbasedir.phpt b/ext/mysqli/tests/mysqli_options_openbasedir.phpt index e27e85e731f1..823eca9ef0b3 100644 --- a/ext/mysqli/tests/mysqli_options_openbasedir.phpt +++ b/ext/mysqli/tests/mysqli_options_openbasedir.phpt @@ -4,11 +4,11 @@ mysqli_options() - MYSQLI_OPT_LOCAL_INFILE and open_basedir mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- query('DROP USER shatest'); $link->query('DROP USER shatest@localhost'); ?> diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt index 42a9640f1ea9..986c19f47690 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt @@ -91,7 +91,7 @@ echo "nocache"; mysqlnd.sha256_server_public_key="test_sha256_ini" --FILE-- --CLEAN-- query('DROP USER shatest'); $link->query('DROP USER shatest@localhost'); $file = "test_sha256_ini"; diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt index e0abe65e24e4..25c87565a13c 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt @@ -86,7 +86,7 @@ echo "nocache"; ?> --FILE-- --CLEAN-- query('DROP USER shatest'); $link->query('DROP USER shatest@localhost'); $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt index 5f13fa4f03f0..5c4a60cd0066 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt @@ -86,7 +86,7 @@ echo "nocache"; ?> --FILE-- --CLEAN-- query('DROP USER shatest'); $link->query('DROP USER shatest@localhost'); $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); diff --git a/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt b/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt index ae3f4cb2ec23..8c125054f881 100644 --- a/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt +++ b/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt @@ -4,7 +4,7 @@ Calling connect() on an open persistent connection to create a new persistent co mysqli --SKIPIF-- --INI-- mysqli.allow_persistent=1 @@ -12,7 +12,7 @@ mysqli.max_persistent=-1 mysqli.max_links=-1 --FILE-- thread_id) printf("[008] Cannot determine thread id, test will fail, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -103,9 +101,7 @@ mysqli.max_links=-1 mysqli_close($link); - if (!$link = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) - printf("[022] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + $link = new my_mysqli($host, $user, $passwd, $db, $port, $socket); if (!$thread_id = $link->thread_id) printf("[023] Cannot determine thread id, test will fail, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); diff --git a/ext/mysqli/tests/mysqli_pconn_disabled.phpt b/ext/mysqli/tests/mysqli_pconn_disabled.phpt index 08ab0e8778ff..23ff4331653c 100644 --- a/ext/mysqli/tests/mysqli_pconn_disabled.phpt +++ b/ext/mysqli/tests/mysqli_pconn_disabled.phpt @@ -4,7 +4,7 @@ mysqli_pconnect() - mysqli.allow_persistent = 0 mysqli --SKIPIF-- @@ -14,7 +14,7 @@ mysqli.max_persistent=2 mysqli.max_links=2 --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_pconn_limits.phpt b/ext/mysqli/tests/mysqli_pconn_limits.phpt index 4d9f8eed01ca..650e26261906 100644 --- a/ext/mysqli/tests/mysqli_pconn_limits.phpt +++ b/ext/mysqli/tests/mysqli_pconn_limits.phpt @@ -12,7 +12,7 @@ mysqli.max_persistent=-1 mysqli.max_links=-1 --FILE-- --CLEAN-- --EXPECT-- Regular connection 1 - 'works..' diff --git a/ext/mysqli/tests/mysqli_pconn_max_links.phpt b/ext/mysqli/tests/mysqli_pconn_max_links.phpt index e923fc71baac..4cf28f6819e0 100644 --- a/ext/mysqli/tests/mysqli_pconn_max_links.phpt +++ b/ext/mysqli/tests/mysqli_pconn_max_links.phpt @@ -4,8 +4,8 @@ Persistent connections and mysqli.max_links mysqli --SKIPIF-- --CLEAN-- --INI-- mysqli.allow_persistent=1 @@ -14,7 +14,7 @@ mysqli.max_persistent=2 mysqli.max_links=2 --FILE-- --INI-- @@ -13,7 +13,7 @@ mysqli.max_persistent=-1 mysqli.max_links=-1 --FILE-- real_connect($host, $user, $passwd, $db, $port, $socket))) printf("[009] Expecting boolean/true got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqli/tests/mysqli_pconnect.phpt b/ext/mysqli/tests/mysqli_pconnect.phpt index 2f4828958059..d8babff1fe11 100644 --- a/ext/mysqli/tests/mysqli_pconnect.phpt +++ b/ext/mysqli/tests/mysqli_pconnect.phpt @@ -4,11 +4,11 @@ mysqli_pconnect() mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- prepare(false))) printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), (is_object($tmp) ? var_dump($tmp, true) : $tmp)); @@ -36,7 +34,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- a) [1065] Query was empty diff --git a/ext/mysqli/tests/mysqli_ps_select_union.phpt b/ext/mysqli/tests/mysqli_ps_select_union.phpt index 46bb3115cafc..bd403c31e506 100644 --- a/ext/mysqli/tests/mysqli_ps_select_union.phpt +++ b/ext/mysqli/tests/mysqli_ps_select_union.phpt @@ -4,12 +4,12 @@ Prepared Statements and SELECT UNION mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --EXPECTF-- --- Testing default --- diff --git a/ext/mysqli/tests/mysqli_query_stored_proc.phpt b/ext/mysqli/tests/mysqli_query_stored_proc.phpt index 6f71ed0b9757..dbd22fbb38f4 100644 --- a/ext/mysqli/tests/mysqli_query_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_query_stored_proc.phpt @@ -151,7 +151,7 @@ END;')) { ?> --CLEAN-- --INI-- mysqli.allow_local_infile=1 --FILE-- ---CLEAN-- - --EXPECTF-- Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' %r(\(using password: \w+\) ){0,1}%rin %s on line %d object(mysqli)#%d (%d) { diff --git a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt index a72c1a74dbee..7a452d3a23cf 100644 --- a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt +++ b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt @@ -4,7 +4,7 @@ Bug #80107 mysqli_query() fails for ~16 MB long query when compression is enable mysqli --SKIPIF-- fetch_assoc()['Value'] < 0xffffff) { --FILE-- close(); ?> --CLEAN-- --EXPECT-- array(0) { diff --git a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt index b2bd61978e77..5aa6c14d4cd2 100644 --- a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt +++ b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt @@ -12,7 +12,7 @@ mysqli.allow_persistent=1 mysqli.max_persistent=10 --FILE-- --CLEAN-- --EXPECTF-- Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' %r(\(using password: \w+\) ){0,1}%rin %s on line %d diff --git a/ext/mysqli/tests/mysqli_real_escape_string.phpt b/ext/mysqli/tests/mysqli_real_escape_string.phpt index 38d9678c31e9..c92d48559afb 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string.phpt @@ -4,13 +4,11 @@ mysqli_real_escape_string() mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt b/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt index bea70cb3e5a9..7d0ad9f47660 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt @@ -5,8 +5,7 @@ mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt b/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt index b85b229aadd9..7ce40e7863a4 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt @@ -5,8 +5,7 @@ mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt b/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt index dcc645d8671a..3fc6225cdc2f 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt @@ -5,8 +5,7 @@ mysqli --SKIPIF-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt index 5b3f079de5c9..1a8d78276d97 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt @@ -4,8 +4,7 @@ mysqli_real_escape_string() - gbk mysqli --SKIPIF-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt b/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt index 853ace720dc7..b614fe720681 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt @@ -4,12 +4,11 @@ mysqli_real_escape_string() - SQL Mode NO_BACKSLASH_ESCAPE mysqli --SKIPIF-- --FILE-- --FILE-- --FILE-- ---CLEAN-- - --EXPECT-- mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_real_query.phpt b/ext/mysqli/tests/mysqli_real_query.phpt index 6601525b4755..897c07a464f1 100644 --- a/ext/mysqli/tests/mysqli_real_query.phpt +++ b/ext/mysqli/tests/mysqli_real_query.phpt @@ -4,13 +4,11 @@ mysqli_real_query() mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli_release_savepoint(): Argument #2 ($name) cannot be empty diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt index 91a88815fd44..b4998546d137 100644 --- a/ext/mysqli/tests/mysqli_report.phpt +++ b/ext/mysqli/tests/mysqli_report.phpt @@ -309,7 +309,7 @@ require_once 'skipifconnectfailure.inc'; ?> --CLEAN-- --EXPECTF-- Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d diff --git a/ext/mysqli/tests/mysqli_report_new.phpt b/ext/mysqli/tests/mysqli_report_new.phpt index e544bcb3664d..50be858eb17b 100644 --- a/ext/mysqli/tests/mysqli_report_new.phpt +++ b/ext/mysqli/tests/mysqli_report_new.phpt @@ -37,7 +37,7 @@ if (mysqli_get_server_version($link) < 50600) ?> --CLEAN-- --EXPECTF-- Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d diff --git a/ext/mysqli/tests/mysqli_report_wo_ps.phpt b/ext/mysqli/tests/mysqli_report_wo_ps.phpt index c757de773db5..681868ad9dc1 100644 --- a/ext/mysqli/tests/mysqli_report_wo_ps.phpt +++ b/ext/mysqli/tests/mysqli_report_wo_ps.phpt @@ -4,7 +4,7 @@ mysqli_report(), MySQL < 5.6 mysqli --SKIPIF-- = 50600) if (true !== ($tmp = mysqli_report(MYSQLI_REPORT_OFF))) printf("[008] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - require 'table.inc'; + require_once 'connect.inc'; + if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); + exit(1); + } /* Internal macro MYSQL_REPORT_ERROR @@ -99,10 +104,6 @@ if (mysqli_get_server_version($link) >= 50600) print "done!"; ?> ---CLEAN-- - --EXPECTF-- Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d diff --git a/ext/mysqli/tests/mysqli_result_invalid_mode.phpt b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt index 1a1677589d5c..f0799120742b 100644 --- a/ext/mysqli/tests/mysqli_result_invalid_mode.phpt +++ b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt @@ -4,12 +4,16 @@ mysqli_result(), invalid mode mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt index 0e2e2d98be02..a7345de0bfac 100644 --- a/ext/mysqli/tests/mysqli_result_references.phpt +++ b/ext/mysqli/tests/mysqli_result_references.phpt @@ -4,14 +4,14 @@ References to result sets mysqli --SKIPIF-- --INI-- opcache.enable=0 --FILE-- --CLEAN-- --EXPECTF-- array(7) refcount(2){ diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt index 9b7119ac21d9..4087d35055ea 100644 --- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt @@ -49,7 +49,7 @@ require_once 'skipifconnectfailure.inc'; ?> --CLEAN-- --EXPECTF-- array(1) refcount(%d){ diff --git a/ext/mysqli/tests/mysqli_result_unclonable.phpt b/ext/mysqli/tests/mysqli_result_unclonable.phpt index 0605e916a29c..b54c39f7a170 100644 --- a/ext/mysqli/tests/mysqli_result_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_result_unclonable.phpt @@ -4,11 +4,11 @@ Trying to clone mysqli_result object mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_savepoint.phpt b/ext/mysqli/tests/mysqli_savepoint.phpt index 71e0b2d21819..810a0842498e 100644 --- a/ext/mysqli/tests/mysqli_savepoint.phpt +++ b/ext/mysqli/tests/mysqli_savepoint.phpt @@ -13,7 +13,7 @@ if (!have_innodb($link)) ?> --FILE-- --CLEAN-- --EXPECT-- mysqli_savepoint(): Argument #2 ($name) cannot be empty diff --git a/ext/mysqli/tests/mysqli_select_db.phpt b/ext/mysqli/tests/mysqli_select_db.phpt index 76f64df743ca..33c55c12409c 100644 --- a/ext/mysqli/tests/mysqli_select_db.phpt +++ b/ext/mysqli/tests/mysqli_select_db.phpt @@ -4,12 +4,12 @@ mysqli_select_db() mysqli --SKIPIF-- --FILE-- --CLEAN-- - + --EXPECT-- mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_set_charset.phpt b/ext/mysqli/tests/mysqli_set_charset.phpt index 50da0c217e34..4cb7b54297bd 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -4,9 +4,6 @@ mysqli_set_charset() mysqli --SKIPIF-- --CLEAN-- --EXPECTF-- Exception: %s diff --git a/ext/mysqli/tests/mysqli_set_opt.phpt b/ext/mysqli/tests/mysqli_set_opt.phpt index c6868e2e4188..218e9f517786 100644 --- a/ext/mysqli/tests/mysqli_set_opt.phpt +++ b/ext/mysqli/tests/mysqli_set_opt.phpt @@ -4,11 +4,11 @@ mysqli_set_opt() mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- %s(5) "00000" diff --git a/ext/mysqli/tests/mysqli_ssl_set.phpt b/ext/mysqli/tests/mysqli_ssl_set.phpt index 5ea79b964987..fe692edede0c 100644 --- a/ext/mysqli/tests/mysqli_ssl_set.phpt +++ b/ext/mysqli/tests/mysqli_ssl_set.phpt @@ -12,7 +12,7 @@ if (!function_exists('mysqli_ssl_set')) ?> --FILE-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- [009] [%d] (error message varies with the MySQL Server version, check the error code) diff --git a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt index 6f6e011de101..942711faa141 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt @@ -4,13 +4,11 @@ mysqli_stmt_attr_get() mysqli --SKIPIF-- --FILE-- MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, @@ -50,7 +48,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt_attr_get(): Argument #2 ($attribute) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE diff --git a/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt b/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt index 320486f42db5..d125d5d1e891 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt @@ -4,12 +4,12 @@ mysqli_stmt_attr_get() - prefetch mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index 0b17edf7a1ab..304046919a1a 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -4,13 +4,11 @@ mysqli_stmt_attr_set() - mysqlnd does not check for invalid codes mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- Error: mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt index 04d0a3c0ebd7..32a9b1478ab8 100644 --- a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt +++ b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt @@ -4,11 +4,16 @@ mysqli_stmt_prepare() mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt b/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt index 03a980d929c6..f7e3213afde3 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt @@ -4,13 +4,14 @@ Bind limits mysqli --SKIPIF-- --CONFLICTS-- all --FILE-- --CLEAN-- --EXPECT-- Testing 273 columns with 240 rows... diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt index 009a089137e7..180de7cc43f2 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt @@ -4,7 +4,7 @@ mysqli_stmt_bind_param() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- The number of variables must match the number of parameters in the prepared statement diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt index f23433dcd721..40296ad63d2d 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt @@ -4,12 +4,12 @@ mysqli_stmt_bind_param used with call_user_func_array() (see also bug #43568) mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- Regular, procedural, using variables diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt index f33076d64e14..f9abc02e0640 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt @@ -4,11 +4,16 @@ mysqli_stmt_bind_param() - checking whether the parameters are modified (bug#443 mysqli --SKIPIF-- --FILE-- set_charset('latin1'); class foo { @@ -28,7 +33,7 @@ require_once('skipifconnectfailure.inc'); $stmt->execute(); $stmt->fetch(); $stmt->free_result(); - echo("$one\n\n"); + echo "$one\n\n"; // it is getting worse. Binding the same var twice with different // types you can get unexpected results e.g. binary trash for the @@ -47,7 +52,7 @@ require_once('skipifconnectfailure.inc'); $stmt->bind_result($one, $two); $stmt->fetch(); $stmt->free_result(); - echo("$one - $two\n\n"); + echo "$one - $two\n\n"; echo "Test 3:\n"; @@ -59,13 +64,9 @@ require_once('skipifconnectfailure.inc'); $stmt->execute(); $stmt->fetch(); $stmt->free_result(); - echo("$one - $two\n\n"); + echo "$one - $two\n\n"; echo "done!"; ?> ---CLEAN-- - --EXPECTF-- Test 1: object(foo)#%d (1) { diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt index 251bb546a31e..640690af4d25 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt @@ -4,7 +4,7 @@ mysqli_stmt_bind_param() - Binding with very high number of columns mysqli --SKIPIF-- --INI-- memory_limit=256M @@ -19,7 +19,7 @@ memory_limit=256M in this file and we test mysqli_stmt_bind_result() in the other test -- therefore the "duplicate" makes some sense to me. */ - require_once("connect.inc"); + require_once 'connect.inc'; if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", @@ -94,7 +94,7 @@ memory_limit=256M ?> --CLEAN-- --EXPECTF-- int(%d) diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt index 9c6a80a3a467..ac02db31d508 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt @@ -4,11 +4,11 @@ mysqli_stmt_bind_param() - playing with references mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt index e85a97a99443..887d557a078f 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt @@ -4,11 +4,11 @@ mysqli_stmt_bind_param() - binding variable twice mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt index 597b4f395a3c..11d8e64e9660 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt @@ -4,12 +4,11 @@ mysqli_stmt_bind_result() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt index 46a6f60da01e..8000336403a4 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt @@ -4,11 +4,11 @@ mysqli_stmt_bind_result() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt index b40f414b39e4..a379359b45a8 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt @@ -4,13 +4,13 @@ Playing with SELECT FORMAT(...) AS _format - see also bugs.php.net/42378 mysqli --SKIPIF-- --INI-- memory_limit=83886080 --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt index 138655ed2121..a7cef70a5308 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt @@ -4,11 +4,11 @@ mysqli_stmt_bind_result() - playing with references mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- plain vanilla... diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt index 1955290c2c5c..34b93ce0b3b2 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt @@ -4,12 +4,12 @@ mysqli_stmt_bind_result() - ZEROFILL mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_close.phpt b/ext/mysqli/tests/mysqli_stmt_close.phpt index 03788c0c0be2..208cfa784122 100644 --- a/ext/mysqli/tests/mysqli_stmt_close.phpt +++ b/ext/mysqli/tests/mysqli_stmt_close.phpt @@ -4,13 +4,11 @@ mysqli_stmt_close() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt index ba79b53ab5ba..21f8286cac08 100644 --- a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt +++ b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt @@ -4,13 +4,11 @@ mysqli_stmt_data_seek() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt b/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt index 3ab05504bbef..e98824a65db3 100644 --- a/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt +++ b/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt @@ -4,11 +4,11 @@ Playing with datatype change between prepare and execute mysqli --SKIPIF-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_error.phpt b/ext/mysqli/tests/mysqli_stmt_error.phpt index ce3b248622c2..758369594da1 100644 --- a/ext/mysqli/tests/mysqli_stmt_error.phpt +++ b/ext/mysqli/tests/mysqli_stmt_error.phpt @@ -4,13 +4,11 @@ mysqli_stmt_error() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_execute.phpt b/ext/mysqli/tests/mysqli_stmt_execute.phpt index 90de4a784337..2440b584376a 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute.phpt @@ -4,7 +4,7 @@ mysqli_stmt_execute() mysqli --SKIPIF-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_execute_bind.phpt b/ext/mysqli/tests/mysqli_stmt_execute_bind.phpt index 7921e51f75be..5005cbf5fb5d 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_bind.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_bind.phpt @@ -8,8 +8,6 @@ require_once 'skipifconnectfailure.inc'; ?> --FILE-- --CLEAN-- --EXPECT-- [001] mysqli_stmt::execute(): Argument #1 ($params) must consist of exactly 3 elements, 2 present diff --git a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt index 3af364dfb550..3d9795db4d6b 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt @@ -187,7 +187,7 @@ if (mysqli_get_server_version($link) <= 50000) { ?> --CLEAN-- --CLEAN-- --CLEAN-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt index 1c49f2a198e7..325314f50035 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt @@ -69,7 +69,7 @@ if (mysqli_get_server_version($link) < 50003) { ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt index 574a20f40de6..48e2e6f8dec6 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt @@ -4,12 +4,12 @@ mysqli_stmt_fetch_fields() unicode, win32 mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- OK: 1 diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt index 4055501c1152..9191df87ac7c 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt @@ -4,14 +4,14 @@ mysqli_stmt_fetch - geometry / spatial types mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_field_count.phpt index ee3d4072289b..6b4bd5d82252 100644 --- a/ext/mysqli/tests/mysqli_stmt_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_field_count.phpt @@ -4,13 +4,11 @@ mysqli_stmt_field_counts() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_free_result.phpt b/ext/mysqli/tests/mysqli_stmt_free_result.phpt index e14befed267f..e049e8410477 100644 --- a/ext/mysqli/tests/mysqli_stmt_free_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_free_result.phpt @@ -4,7 +4,7 @@ mysqli_stmt_free_result() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_get_result.phpt b/ext/mysqli/tests/mysqli_stmt_get_result.phpt index d63ee6b8f0ab..71a0b462a03a 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result.phpt @@ -4,7 +4,7 @@ mysqli_stmt_get_result() mysqli --SKIPIF-- --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_get_result2.phpt b/ext/mysqli/tests/mysqli_stmt_get_result2.phpt index fc0deef2c824..e116353bb8f4 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result2.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result2.phpt @@ -4,7 +4,7 @@ mysqli_stmt_get_result() mysqli --SKIPIF-- @@ -15,9 +15,7 @@ if (!function_exists('mysqli_stmt_get_result')) mysqli_stmt_bind_result.phpt already. Restrict this test case to the basics. */ - require_once("connect.inc"); - - require('table.inc'); + require 'table.inc'; if (!$stmt = mysqli_stmt_init($link)) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -142,7 +140,7 @@ if (!function_exists('mysqli_stmt_get_result')) ?> --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt index c3a68db0797d..a6bd7c55bb46 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt @@ -127,7 +127,7 @@ if (mysqli_get_server_version($link) < 50003) { ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt index 0c60fc61bde6..0e58eb63665e 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt @@ -4,14 +4,14 @@ mysqli_stmt_get_result() - meta data, field_count() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- 2 2 diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt index 6eac7978a43f..b2fe144dd37d 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt @@ -4,7 +4,7 @@ mysqli_stmt_get_result - geometry / spatial types mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt index e1c2be6cee32..37afd39d15e4 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt @@ -4,14 +4,14 @@ mysqli_stmt_get_result() - meta data mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt index 9f4b01b93ae5..c50c99b9eac6 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt @@ -4,14 +4,14 @@ mysqli_stmt_get_result() - meta data, field info mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt index d92177e7a300..b633f43d0cc4 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt @@ -4,7 +4,7 @@ mysqli_stmt_get_result() - SHOW, DESCRIBE, EXPLAIN mysqli --SKIPIF-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt index 65daea87137b..5ebdf7e0749f 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt @@ -4,14 +4,14 @@ mysqli_stmt_get_result() - seeking mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt index d1ac2080ebf8..dff2fa383c8d 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt @@ -4,14 +4,14 @@ mysqli_stmt_get_result - data types mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt index e372977844bb..86bd19da71ca 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt @@ -4,7 +4,7 @@ mysqli_stmt_get_warnings() - TODO mysqli --SKIPIF-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_init.phpt b/ext/mysqli/tests/mysqli_stmt_init.phpt index fca0cc522f63..38f5dcb25e4a 100644 --- a/ext/mysqli/tests/mysqli_stmt_init.phpt +++ b/ext/mysqli/tests/mysqli_stmt_init.phpt @@ -4,7 +4,7 @@ mysqli_stmt_init() mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- mysqli_stmt object is not fully initialized mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_insert_id.phpt b/ext/mysqli/tests/mysqli_stmt_insert_id.phpt index 61a1aeadb45b..044b2b1e5ead 100644 --- a/ext/mysqli/tests/mysqli_stmt_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_stmt_insert_id.phpt @@ -4,13 +4,11 @@ mysqli_stmt_insert_id() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_multires.phpt b/ext/mysqli/tests/mysqli_stmt_multires.phpt index 9d883ff3410e..0352a464e86f 100644 --- a/ext/mysqli/tests/mysqli_stmt_multires.phpt +++ b/ext/mysqli/tests/mysqli_stmt_multires.phpt @@ -4,7 +4,7 @@ Multiple result set with PS mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- run_tests.php don't fool me with your 'ungreedy' expression '.+?'! diff --git a/ext/mysqli/tests/mysqli_stmt_param_count.phpt b/ext/mysqli/tests/mysqli_stmt_param_count.phpt index e1f4c3424926..11d99addcb5a 100644 --- a/ext/mysqli/tests/mysqli_stmt_param_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_param_count.phpt @@ -4,13 +4,11 @@ mysqli_stmt_param_count() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_prepare.phpt index b3f4e69eb9b1..5c6db7ebf5c7 100644 --- a/ext/mysqli/tests/mysqli_stmt_prepare.phpt +++ b/ext/mysqli/tests/mysqli_stmt_prepare.phpt @@ -4,19 +4,17 @@ mysqli_stmt_prepare() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_reset.phpt b/ext/mysqli/tests/mysqli_stmt_reset.phpt index 38b57e17b495..d96c3114a160 100644 --- a/ext/mysqli/tests/mysqli_stmt_reset.phpt +++ b/ext/mysqli/tests/mysqli_stmt_reset.phpt @@ -4,19 +4,17 @@ mysqli_stmt_reset() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt index 0eb0f7822108..a29da62893fb 100644 --- a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt +++ b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt @@ -4,13 +4,11 @@ mysqli_stmt_result_metadata() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt b/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt index 5eac0ba5d20b..2fade6aabf17 100644 --- a/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt +++ b/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt @@ -4,13 +4,13 @@ mysqli_stmt_result_metadata() - non SELECT statements mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index 048d6f0fd9b6..cc4a92727091 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -4,13 +4,12 @@ mysqli_stmt_send_long_data() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt_send_long_data(): Argument #2 ($param_num) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt index eafdfd434b8d..5c7ffd9c6da4 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt @@ -4,11 +4,11 @@ mysqli_stmt_send_long_data() - exceed packet size, mysqlnd mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt index 34a6c28b12fa..a933ee6b3cdc 100644 --- a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt +++ b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt @@ -4,13 +4,11 @@ mysqli_stmt_sqlstate() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_store_result.phpt b/ext/mysqli/tests/mysqli_stmt_store_result.phpt index 10df777b9fac..6ebb10823566 100644 --- a/ext/mysqli/tests/mysqli_stmt_store_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_store_result.phpt @@ -4,13 +4,11 @@ mysqli_stmt_store_result() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_unclonable.phpt b/ext/mysqli/tests/mysqli_stmt_unclonable.phpt index 0db0f0a2baf8..29658bb25c66 100644 --- a/ext/mysqli/tests/mysqli_stmt_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_stmt_unclonable.phpt @@ -4,11 +4,11 @@ Trying to clone mysqli_stmt object mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt index 2c38f2159add..a1ee31823708 100644 --- a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt +++ b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt @@ -4,20 +4,14 @@ mysqli_store_result() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_store_result_copy.phpt b/ext/mysqli/tests/mysqli_store_result_copy.phpt index d48701caca11..637d0895a7bf 100644 --- a/ext/mysqli/tests/mysqli_store_result_copy.phpt +++ b/ext/mysqli/tests/mysqli_store_result_copy.phpt @@ -4,7 +4,7 @@ mysqli_store_result() mysqli --SKIPIF-- --INI-- mysqlnd.debug="d:t:O,{TMP}/mysqlnd.trace" @@ -13,12 +13,7 @@ mysqlnd.mempool_default_size=1 mysqlnd.fetch_data_copy=0 --FILE-- --CLEAN-- --EXPECTF-- array(2) { diff --git a/ext/mysqli/tests/mysqli_thread_id.phpt b/ext/mysqli/tests/mysqli_thread_id.phpt index 9862fadaa9cc..3208dd949c65 100644 --- a/ext/mysqli/tests/mysqli_thread_id.phpt +++ b/ext/mysqli/tests/mysqli_thread_id.phpt @@ -4,13 +4,16 @@ mysqli_thread_id() mysqli --SKIPIF-- --FILE-- ---CLEAN-- - --EXPECT-- mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_unclonable.phpt b/ext/mysqli/tests/mysqli_unclonable.phpt index d1686888c1f5..0772854ed96a 100644 --- a/ext/mysqli/tests/mysqli_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_unclonable.phpt @@ -4,11 +4,11 @@ Trying to clone mysqli object mysqli --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- mysqli_data_seek() cannot be used in MYSQLI_USE_RESULT mode diff --git a/ext/mysqli/tests/mysqli_warning_count.phpt b/ext/mysqli/tests/mysqli_warning_count.phpt index 0babf59593f4..c844d6f4d81f 100644 --- a/ext/mysqli/tests/mysqli_warning_count.phpt +++ b/ext/mysqli/tests/mysqli_warning_count.phpt @@ -4,13 +4,11 @@ mysqli_warning_count() mysqli --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_warning_unclonable.phpt b/ext/mysqli/tests/mysqli_warning_unclonable.phpt index 460334024b3e..c51747b51449 100644 --- a/ext/mysqli/tests/mysqli_warning_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_warning_unclonable.phpt @@ -10,7 +10,7 @@ if (!$TEST_EXPERIMENTAL) ?> --FILE-- --CLEAN-- --EXPECTF-- Fatal error: Trying to clone an uncloneable object of class mysqli_warning in %s on line %d diff --git a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt index d6956b7e6355..7b706ac434d3 100644 --- a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt +++ b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt @@ -4,11 +4,11 @@ PS using cursor and returning multiple result sets mysqli --SKIPIF-- --FILE-- vio->data->ssl) { DBG_INF("simple clear text under SSL"); /* clear text under SSL */ - *auth_data_len = passwd_len; - ret = malloc(passwd_len); + /* NUL termination byte required: https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods_clear_text_password.html + * (this is similar to bug #78680, but now as GH-11440) */ + *auth_data_len = passwd_len + 1; + ret = malloc(passwd_len + 1); memcpy(ret, passwd, passwd_len); + ret[passwd_len] = '\0'; } else { *auth_data_len = 0; server_public_key = mysqlnd_sha256_get_rsa_key(conn, session_options, pfc_data); @@ -924,7 +927,10 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self char *xor_str = do_alloca(passwd_len + 1, use_heap); memcpy(xor_str, passwd, passwd_len); xor_str[passwd_len] = '\0'; - mysqlnd_xor_string(xor_str, passwd_len, (char *) auth_plugin_data, auth_plugin_data_len); + /* https://dev.mysql.com/doc/dev/mysql-server/latest/page_caching_sha2_authentication_exchanges.html + * This tells us that the nonce is 20 (==SCRAMBLE_LENGTH) bytes long. + * In a 5.5+ server we might get additional scramble data in php_mysqlnd_greet_read, not used by this authentication method. */ + mysqlnd_xor_string(xor_str, passwd_len, (char *) auth_plugin_data, SCRAMBLE_LENGTH); ret = mysqlnd_sha256_public_encrypt(conn, server_public_key, passwd_len, auth_data_len, xor_str); free_alloca(xor_str, use_heap); } diff --git a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c index 1f989a4a989a..ba5a512194d4 100644 --- a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c +++ b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c @@ -202,6 +202,7 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v if (bytes_sent <= 0) { DBG_ERR_FMT("Can't %zu send bytes", count); SET_CLIENT_ERROR(error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); + bytes_sent = 0; // the return type is unsigned and 0 represents an error condition } DBG_RETURN(bytes_sent); } diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index d3314b366fec..e627820712a6 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -152,8 +152,6 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_ result->meta = NULL; DBG_RETURN(FAIL); } - /* COM_FIELD_LIST is broken and has premature EOF, thus we need to hack here and in mysqlnd_res_meta.c */ - result->field_count = result->meta->field_count; /* 2. Follows an EOF packet, which the client of mysqlnd_read_result_metadata() @@ -286,8 +284,12 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s) COM_STMT_EXECUTE (even if it is not necessary), so either this or previous branch always works. */ + if (rset_header.field_count != stmt->result->field_count) { + stmt->result->m.free_result(stmt->result, TRUE); + stmt->result = conn->m->result_init(rset_header.field_count); + } + result = stmt->result; } - result = stmt->result; } if (!result) { SET_OOM_ERROR(conn->error_info); diff --git a/ext/oci8/tests/array_bind_001.phpt b/ext/oci8/tests/array_bind_001.phpt index 9cece0d790d8..1404a1593f43 100644 --- a/ext/oci8/tests/array_bind_001.phpt +++ b/ext/oci8/tests/array_bind_001.phpt @@ -2,6 +2,10 @@ oci_bind_array_by_name() and invalid values 1 --EXTENSIONS-- oci8 +--SKIPIF-- + --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients'); ?> --FILE-- diff --git a/ext/oci8/tests/array_bind_bfloat.phpt b/ext/oci8/tests/array_bind_bfloat.phpt index 5498edb5f1b4..b00bd56328ab 100644 --- a/ext/oci8/tests/array_bind_bfloat.phpt +++ b/ext/oci8/tests/array_bind_bfloat.phpt @@ -4,8 +4,9 @@ Unsupported type: oci_bind_array_by_name() and SQLT_BFLOAT oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients'); ?> --FILE-- diff --git a/ext/oci8/tests/array_bind_date.phpt b/ext/oci8/tests/array_bind_date.phpt index 3969df376ea5..2e1aced15237 100644 --- a/ext/oci8/tests/array_bind_date.phpt +++ b/ext/oci8/tests/array_bind_date.phpt @@ -4,8 +4,9 @@ oci_bind_array_by_name() and SQLT_ODT oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- = 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -17,7 +18,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- = 12)) { @@ -16,7 +17,7 @@ NLS_LANG=.AL32UTF8 --FILE-- = 12)) { @@ -16,7 +17,7 @@ NLS_LANG=.AL32UTF8 --FILE-- = 12)) { @@ -16,7 +17,7 @@ NLS_LANG=.AL32UTF8 --FILE-- = 12)) { @@ -18,7 +19,7 @@ NLS_LANG=.AL32UTF8 // Same test as bind_char_3 but the PL/SQL function uses VARCHAR2 instead of CHAR -require(__DIR__.'/connect.inc'); +require __DIR__.'/connect.inc'; // Initialization diff --git a/ext/oci8/tests/bind_empty.phpt b/ext/oci8/tests/bind_empty.phpt index 62222edc5c30..9a6e39bcf2f4 100644 --- a/ext/oci8/tests/bind_empty.phpt +++ b/ext/oci8/tests/bind_empty.phpt @@ -2,6 +2,10 @@ binding empty values --EXTENSIONS-- oci8 +--SKIPIF-- + --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --INI-- precision = 14 --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- = 12)) { die("skip works only with Oracle 12c or greater version of Oracle client libraries"); @@ -12,7 +13,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- --FILE-- --FILE-- SQLT_BDOUBLE, diff --git a/ext/oci8/tests/bind_unsupported_3.phpt b/ext/oci8/tests/bind_unsupported_3.phpt index 48572f30dd68..21a181ef48c4 100644 --- a/ext/oci8/tests/bind_unsupported_3.phpt +++ b/ext/oci8/tests/bind_unsupported_3.phpt @@ -4,13 +4,14 @@ Bind with various bind types not supported by TimesTen oci8 --SKIPIF-- false, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- SQLT_CLOB, diff --git a/ext/oci8/tests/bug26133.phpt b/ext/oci8/tests/bug26133.phpt index a96bf1a7d2d9..ce74a41680b7 100644 --- a/ext/oci8/tests/bug26133.phpt +++ b/ext/oci8/tests/bug26133.phpt @@ -2,10 +2,14 @@ Bug #26133 (ocifreedesc() segfault) --EXTENSIONS-- oci8 +--SKIPIF-- + --FILE-- = 12)) { @@ -16,7 +17,7 @@ NLS_LANG= --FILE-- = 12)) { diff --git a/ext/oci8/tests/bug27303_3.phpt b/ext/oci8/tests/bug27303_3.phpt index e994033513a8..4454c95810a8 100644 --- a/ext/oci8/tests/bug27303_3.phpt +++ b/ext/oci8/tests/bug27303_3.phpt @@ -2,6 +2,10 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) --EXTENSIONS-- oci8 +--SKIPIF-- + --FILE-- = 12)) { diff --git a/ext/oci8/tests/bug32325.phpt b/ext/oci8/tests/bug32325.phpt index 8deb566dfc59..31f298ef6296 100644 --- a/ext/oci8/tests/bug32325.phpt +++ b/ext/oci8/tests/bug32325.phpt @@ -4,13 +4,14 @@ Bug #32325 (Cannot retrieve collection using OCI8) oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (empty($dbase)) die ("skip requires network connection alias for DB link loopback"); if ($test_drcp) die("skip DRCP does not support shared database links"); ?> @@ -14,7 +15,7 @@ oci8.default_prefetch=5 --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +require_once 'skipifconnectfailure.inc'; +$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +require_once 'skipifconnectfailure.inc'; +$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --INI-- oci8.statement_cache_size=20 diff --git a/ext/oci8/tests/bug43492.phpt b/ext/oci8/tests/bug43492.phpt index b0d8e77e2f57..b411db637430 100644 --- a/ext/oci8/tests/bug43492.phpt +++ b/ext/oci8/tests/bug43492.phpt @@ -4,8 +4,9 @@ Bug #43492 (Nested cursor leaks) oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); ?> --FILE-- diff --git a/ext/oci8/tests/bug44008.phpt b/ext/oci8/tests/bug44008.phpt index 6f1a860b8c03..36ade04951c2 100644 --- a/ext/oci8/tests/bug44008.phpt +++ b/ext/oci8/tests/bug44008.phpt @@ -4,8 +4,9 @@ Bug #44008 (Incorrect usage of OCILob->close crashes PHP) oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs: different error handling for this undefined behavior -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; // error3.phpt obsoletes this test for newer Oracle client versions // Assume runtime client version is >= compile time client version preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); @@ -20,7 +21,7 @@ NLS_LANG=.AL32UTF8 --FILE-- false, 'timesten' => true); // test runs on these DBs: shorter message length in TimesTen -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --ENV-- NLS_LANG=.AL32UTF8 --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --ENV-- NLS_LANG=.AL32UTF8 --FILE-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { die("skip needs to be run as a user with access to DBMS_LOCK"); } @@ -19,7 +20,7 @@ if (!(isset($matches[0]) && $matches[0] >= 18)) { --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- diff --git a/ext/oci8/tests/commit_002.phpt b/ext/oci8/tests/commit_002.phpt index 93b77a9ee91c..e04b80d08610 100644 --- a/ext/oci8/tests/commit_002.phpt +++ b/ext/oci8/tests/commit_002.phpt @@ -4,13 +4,14 @@ Test oci_commit failure oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- = 11)) { diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt index a711ab6ccde6..5c7ab61d999e 100644 --- a/ext/oci8/tests/conn_attr_1.phpt +++ b/ext/oci8/tests/conn_attr_1.phpt @@ -5,8 +5,9 @@ oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); @@ -23,7 +24,7 @@ if (!(isset($matches[0]) && $matches[1] >= 10)) { $testuser = 'testuser_attr_1'; // Used in conn_attr.inc $testpassword = 'testuser'; -require(__DIR__."/conn_attr.inc"); +require __DIR__."/conn_attr.inc"; $attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER'); diff --git a/ext/oci8/tests/conn_attr_2.phpt b/ext/oci8/tests/conn_attr_2.phpt index 2473eaefaa96..dce6270f92cf 100644 --- a/ext/oci8/tests/conn_attr_2.phpt +++ b/ext/oci8/tests/conn_attr_2.phpt @@ -5,8 +5,9 @@ oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip output might vary with DRCP"); @@ -24,7 +25,7 @@ oci8.privileged_connect = On $testuser = 'testuser_attr_2'; // Used in conn_attr.inc $testpassword = 'testuser'; -require(__DIR__."/conn_attr.inc"); +require __DIR__."/conn_attr.inc"; $attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER'); diff --git a/ext/oci8/tests/conn_attr_3.phpt b/ext/oci8/tests/conn_attr_3.phpt index 625f24002b97..c2e62bd3ff13 100644 --- a/ext/oci8/tests/conn_attr_3.phpt +++ b/ext/oci8/tests/conn_attr_3.phpt @@ -5,8 +5,9 @@ oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip output might vary with DRCP"); @@ -22,7 +23,7 @@ if (!(isset($matches[0]) && $matches[1] >= 10)) { $testuser = 'testuser_attr_3'; // Used in conn_attr.inc $testpassword = 'testuser'; -require(__DIR__."/conn_attr.inc"); +require __DIR__."/conn_attr.inc"; echo"**Test Set and get values for the attributes with oci_close() ************\n"; // With oci_connect ,oci_pconnect ,oci_new_connect diff --git a/ext/oci8/tests/conn_attr_4.phpt b/ext/oci8/tests/conn_attr_4.phpt index 6e92e85a9e7f..eccbc78c0e03 100644 --- a/ext/oci8/tests/conn_attr_4.phpt +++ b/ext/oci8/tests/conn_attr_4.phpt @@ -4,8 +4,9 @@ Set and get of connection attributes with errors. oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); @@ -28,7 +29,7 @@ error_reporting(E_ALL ^ E_DEPRECATED); $testuser = 'testuser_attr_4'; // Used in conn_attr.inc $testpassword = 'testuser'; -require(__DIR__."/conn_attr.inc"); +require __DIR__."/conn_attr.inc"; $attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER'); diff --git a/ext/oci8/tests/conn_attr_5.phpt b/ext/oci8/tests/conn_attr_5.phpt index 74ae75e301e0..6ea0796cd7c5 100644 --- a/ext/oci8/tests/conn_attr_5.phpt +++ b/ext/oci8/tests/conn_attr_5.phpt @@ -5,8 +5,9 @@ oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip output might vary with DRCP"); @@ -22,7 +23,7 @@ if (!(isset($matches[0]) && $matches[1] >= 10)) { $testuser = 'testuser_attr_5'; // Used in conn_attr.inc $testpassword = 'testuser'; -require(__DIR__."/conn_attr.inc"); +require __DIR__."/conn_attr.inc"; echo"**Test - Set and get values for the attributes with scope end ************\n"; diff --git a/ext/oci8/tests/connect.inc b/ext/oci8/tests/connect.inc index 06d134856860..febb49b90a0c 100644 --- a/ext/oci8/tests/connect.inc +++ b/ext/oci8/tests/connect.inc @@ -1,6 +1,6 @@ --FILE-- --FILE-- --FILE-- --FILE-- --INI-- oci8.old_oci_close_semantics=0 --FILE-- --INI-- oci8.old_oci_close_semantics=1 --FILE-- --INI-- oci8.old_oci_close_semantics=0 --FILE-- --INI-- oci8.old_oci_close_semantics=1 --FILE-- --INI-- oci8.old_oci_close_semantics=0 --FILE-- --INI-- oci8.old_oci_close_semantics=1 --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { die("skip needs to be run as a DBA user"); } @@ -21,7 +22,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (strcasecmp($user, "system") && strcasecmp($user, "sys")) { die("skip needs to be run as a DBA user"); } @@ -25,7 +26,7 @@ if (!function_exists('oci_set_db_operation')) --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --INI-- oci8.default_prefetch=20 --FILE-- --INI-- oci8.default_prefetch=100 --FILE-- --INI-- oci8.default_prefetch=100 --FILE-- --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- = 12) { --FILE-- --FILE-- --INI-- oci8.old_oci_close_semantics=1 oci8.connection_class=test diff --git a/ext/oci8/tests/drcp_conn_close2.phpt b/ext/oci8/tests/drcp_conn_close2.phpt index 8697905a433c..289c215dc2db 100644 --- a/ext/oci8/tests/drcp_conn_close2.phpt +++ b/ext/oci8/tests/drcp_conn_close2.phpt @@ -2,6 +2,10 @@ DRCP: oci_connect() with oci_close() and oci8.old_oci_close_semantics OFF --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=0 oci8.connection_class=test diff --git a/ext/oci8/tests/drcp_connect1.phpt b/ext/oci8/tests/drcp_connect1.phpt index f44aa8cc891d..3a40da9bf707 100644 --- a/ext/oci8/tests/drcp_connect1.phpt +++ b/ext/oci8/tests/drcp_connect1.phpt @@ -4,8 +4,9 @@ DRCP: oci_connect() oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs (Calling PL/SQL from SQL is not supported in TimesTen) -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --INI-- oci8.connection_class=test diff --git a/ext/oci8/tests/drcp_newconnect.phpt b/ext/oci8/tests/drcp_newconnect.phpt index 8b939beead44..7bdf7d785a95 100644 --- a/ext/oci8/tests/drcp_newconnect.phpt +++ b/ext/oci8/tests/drcp_newconnect.phpt @@ -2,6 +2,10 @@ DRCP: oci_new_connect() --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.connection_class=test oci8.old_oci_close_semantics=0 diff --git a/ext/oci8/tests/drcp_pconn_close1.phpt b/ext/oci8/tests/drcp_pconn_close1.phpt index c53a002b5cc8..8c81e4646301 100644 --- a/ext/oci8/tests/drcp_pconn_close1.phpt +++ b/ext/oci8/tests/drcp_pconn_close1.phpt @@ -2,6 +2,10 @@ DRCP: oci_pconnect() with oci_close() and oci8.old_oci_close_semantics ON --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=1 oci8.connection_class=test diff --git a/ext/oci8/tests/drcp_pconn_close2.phpt b/ext/oci8/tests/drcp_pconn_close2.phpt index bfbf383bac5a..dcc14c8cc99d 100644 --- a/ext/oci8/tests/drcp_pconn_close2.phpt +++ b/ext/oci8/tests/drcp_pconn_close2.phpt @@ -2,6 +2,10 @@ DRCP: oci_pconnect() with oci_close() and oci8.old_oci_close_semantics OFF --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=0 oci8.connection_class=test diff --git a/ext/oci8/tests/drcp_privileged.phpt b/ext/oci8/tests/drcp_privileged.phpt index 72d1f03bfd58..cb126605466c 100644 --- a/ext/oci8/tests/drcp_privileged.phpt +++ b/ext/oci8/tests/drcp_privileged.phpt @@ -4,7 +4,8 @@ DRCP: privileged connect oci8 --SKIPIF-- --INI-- oci8.old_oci_close_semantics=1 --FILE-- diff --git a/ext/oci8/tests/drcp_scope2.phpt b/ext/oci8/tests/drcp_scope2.phpt index 622ddb047223..8eece242d2fa 100644 --- a/ext/oci8/tests/drcp_scope2.phpt +++ b/ext/oci8/tests/drcp_scope2.phpt @@ -2,6 +2,10 @@ DRCP: oci_new_connect() and oci_connect with scope end when oci8.old_oci_close_semantics OFF --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=0 --FILE-- diff --git a/ext/oci8/tests/drcp_scope3.phpt b/ext/oci8/tests/drcp_scope3.phpt index 70cef8a88bdc..bf8a2729095a 100644 --- a/ext/oci8/tests/drcp_scope3.phpt +++ b/ext/oci8/tests/drcp_scope3.phpt @@ -2,6 +2,10 @@ DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=1 --FILE-- diff --git a/ext/oci8/tests/drcp_scope4.phpt b/ext/oci8/tests/drcp_scope4.phpt index d1d26f931ab0..15bd778bdf4f 100644 --- a/ext/oci8/tests/drcp_scope4.phpt +++ b/ext/oci8/tests/drcp_scope4.phpt @@ -2,6 +2,10 @@ DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics OFF --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=0 --FILE-- diff --git a/ext/oci8/tests/drcp_scope5.phpt b/ext/oci8/tests/drcp_scope5.phpt index 18f0dbd2fda2..733ac8a84756 100644 --- a/ext/oci8/tests/drcp_scope5.phpt +++ b/ext/oci8/tests/drcp_scope5.phpt @@ -2,6 +2,10 @@ DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=1 --FILE-- diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt index 32cb75a5dc0e..0e72c98f8c2b 100644 --- a/ext/oci8/tests/driver_name.phpt +++ b/ext/oci8/tests/driver_name.phpt @@ -3,7 +3,9 @@ Verify that the Driver Name attribute is set --EXTENSIONS-- oci8 --SKIPIF-- -= 2) || ($matches ?> --FILE-- = 2) || ($matches ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; // Assume runtime client version is >= compile time client version $cv = explode('.', oci_client_version()); if ($cv[0] < 11 || ($cv[0] == 11 && $cv[1] < 2) || ($cv[0] == 11 && $cv[1] == 2 && $cv[3] < 3)) { @@ -15,7 +16,7 @@ if ($cv[0] < 11 || ($cv[0] == 11 && $cv[1] < 2) || ($cv[0] == 11 && $cv[1] == 2 --FILE-- --FILE-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -20,7 +21,7 @@ oci8.statement_cache_size = 0 --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 12)) { die("skip expected output only valid when using Oracle Database 12c or greater"); @@ -18,7 +19,7 @@ if (!(isset($matches[0]) && $matches[0] >= 12)) { --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ob_start(); phpinfo(INFO_MODULES); $phpinfo = ob_get_clean(); @@ -18,7 +19,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip Test script not ported to Windows") --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- read(), LOB->seek() and LOB->tell() with nul bytes in data oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- write() for multiple inserts oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- getMessage(), "\n"; } -require(__DIR__.'/drop_table.inc'); +require __DIR__.'/drop_table.inc'; echo "Done\n"; diff --git a/ext/oci8/tests/lob_043.phpt b/ext/oci8/tests/lob_043.phpt index e85e56768f47..e138b5c1c025 100644 --- a/ext/oci8/tests/lob_043.phpt +++ b/ext/oci8/tests/lob_043.phpt @@ -4,14 +4,15 @@ Bug #49560 (LOB resource destructor and refcount test) oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); -?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --INI-- oci8.prefetch_lob_size=100000 diff --git a/ext/oci8/tests/lob_temp.phpt b/ext/oci8/tests/lob_temp.phpt index 5fc90257e9bd..be46cda6fbec 100644 --- a/ext/oci8/tests/lob_temp.phpt +++ b/ext/oci8/tests/lob_temp.phpt @@ -4,8 +4,9 @@ temporary lobs oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- @@ -15,7 +16,7 @@ display_errors = On // See http://news.php.net/php.internals/50202 // http://svn.php.net/viewvc?view=revision&revision=311870 -require(__DIR__.'/connect.inc'); +require __DIR__.'/connect.inc'; // Run Test diff --git a/ext/oci8/tests/null_byte_2.phpt b/ext/oci8/tests/null_byte_2.phpt index 2a5cf9047c2d..6f7b6b2c53fd 100644 --- a/ext/oci8/tests/null_byte_2.phpt +++ b/ext/oci8/tests/null_byte_2.phpt @@ -4,8 +4,9 @@ Null bytes in SQL statements oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --INI-- display_errors = On @@ -13,7 +14,7 @@ error_reporting = E_WARNING --FILE-- --INI-- display_errors = On error_reporting = E_WARNING --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --INI-- oci8.old_oci_close_semantics=1 --FILE-- diff --git a/ext/oci8/tests/old_oci_close1.phpt b/ext/oci8/tests/old_oci_close1.phpt index fa1cbba09e30..dab2380ea7dd 100644 --- a/ext/oci8/tests/old_oci_close1.phpt +++ b/ext/oci8/tests/old_oci_close1.phpt @@ -2,6 +2,10 @@ oci8.old_oci_close_semantics Off --EXTENSIONS-- oci8 +--SKIPIF-- + --INI-- oci8.old_oci_close_semantics=0 --FILE-- diff --git a/ext/oci8/tests/password.phpt b/ext/oci8/tests/password.phpt index 89b9296cb15c..322a4d7e47ab 100644 --- a/ext/oci8/tests/password.phpt +++ b/ext/oci8/tests/password.phpt @@ -4,15 +4,15 @@ oci_password_change() for non-persistent connections oci8 --SKIPIF-- --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); -require(__DIR__.'/connect.inc'); +require __DIR__.'/skipif.inc'; +require __DIR__.'/connect.inc'; if (empty($dbase)) die ("skip requires database connection string be set"); if ($test_drcp) die("skip password change not supported in DRCP Mode"); diff --git a/ext/oci8/tests/pecl_bug10194.phpt b/ext/oci8/tests/pecl_bug10194.phpt index 3c82247c1f52..5abe77da8d9f 100644 --- a/ext/oci8/tests/pecl_bug10194.phpt +++ b/ext/oci8/tests/pecl_bug10194.phpt @@ -4,8 +4,9 @@ PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (getenv("USE_ZEND_ALLOC") === "0") { die("skip Zend MM disabled"); diff --git a/ext/oci8/tests/pecl_bug10194_blob.phpt b/ext/oci8/tests/pecl_bug10194_blob.phpt index 7375d7b9c642..a6a08764f6aa 100644 --- a/ext/oci8/tests/pecl_bug10194_blob.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob.phpt @@ -4,8 +4,9 @@ PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (getenv("USE_ZEND_ALLOC") === "0") { @@ -19,8 +20,8 @@ memory_limit=3M // This test is dependent on the behavior of the memory manager -require(__DIR__.'/connect.inc'); -require(__DIR__.'/create_table.inc'); +require __DIR__.'/connect.inc'; +require __DIR__.'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob())"; diff --git a/ext/oci8/tests/pecl_bug10194_blob_64.phpt b/ext/oci8/tests/pecl_bug10194_blob_64.phpt index 051feb157f4a..8893570e20dc 100644 --- a/ext/oci8/tests/pecl_bug10194_blob_64.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob_64.phpt @@ -4,8 +4,9 @@ PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside oci8 --SKIPIF-- true, 'timesten' => false); // test runs on thes -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); if (getenv("USE_ZEND_ALLOC") === "0") { diff --git a/ext/oci8/tests/pecl_bug16842.phpt b/ext/oci8/tests/pecl_bug16842.phpt index b2c10ae710a3..1af369547ebc 100644 --- a/ext/oci8/tests/pecl_bug16842.phpt +++ b/ext/oci8/tests/pecl_bug16842.phpt @@ -4,15 +4,16 @@ PECL Bug #16842 (NO_DATA_FOUND exception is a warning) oci8 --SKIPIF-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --INI-- error_reporting = E_WARNING --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --FILE-- --FILE-- --INI-- diff --git a/ext/oci8/tests/refcur_prefetch_1.phpt b/ext/oci8/tests/refcur_prefetch_1.phpt index 29ba7aaa420f..787849a5ee66 100644 --- a/ext/oci8/tests/refcur_prefetch_1.phpt +++ b/ext/oci8/tests/refcur_prefetch_1.phpt @@ -3,7 +3,9 @@ Prefetch with REF cursor. Test different values for prefetch with oci_set_prefet --EXTENSIONS-- oci8 --SKIPIF-- -= 10))) { @@ -19,7 +21,7 @@ if (!(isset($matches[0]) && ?> --FILE-- = 10))) { diff --git a/ext/oci8/tests/refcur_prefetch_3.phpt b/ext/oci8/tests/refcur_prefetch_3.phpt index f8eddd46e141..007cf843b13f 100644 --- a/ext/oci8/tests/refcur_prefetch_3.phpt +++ b/ext/oci8/tests/refcur_prefetch_3.phpt @@ -5,7 +5,9 @@ oci8.default_prefetch=5 --EXTENSIONS-- oci8 --SKIPIF-- -= 2) || diff --git a/ext/oci8/tests/refcur_prefetch_4.phpt b/ext/oci8/tests/refcur_prefetch_4.phpt index 8e923e5a5309..9c481360d0bd 100644 --- a/ext/oci8/tests/refcur_prefetch_4.phpt +++ b/ext/oci8/tests/refcur_prefetch_4.phpt @@ -3,7 +3,9 @@ Prefetch with REF cursor. Test No 4 --EXTENSIONS-- oci8 --SKIPIF-- -= 10))) { diff --git a/ext/oci8/tests/select_null.phpt b/ext/oci8/tests/select_null.phpt index 4d9bee290081..d12acf829064 100644 --- a/ext/oci8/tests/select_null.phpt +++ b/ext/oci8/tests/select_null.phpt @@ -2,6 +2,10 @@ SELECTing NULL values --EXTENSIONS-- oci8 +--SKIPIF-- + --FILE-- --FILE-- "; + } + else { + $msg .= "\"$dbase\""; + } + $msg .= " as user \"$user\""; + $e = oci_error(); + $msg .= ": {$e['message']}"; + die($msg); +} + +?> diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt index 973eac689d30..82bdd9bf079c 100644 --- a/ext/oci8/tests/statement_cache.phpt +++ b/ext/oci8/tests/statement_cache.phpt @@ -4,8 +4,9 @@ statement cache oci8 --SKIPIF-- true, 'timesten' => true); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- --FILE-- --INI-- oci8.ping_interval=0 --FILE-- --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- true, 'timesten' => false); // test runs on these DBs -require(__DIR__.'/skipif.inc'); +require __DIR__.'/skipif.inc'; ?> --FILE-- 1) { + if (!pv_onoff_is_null) { rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT, pv_onoff ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { odbc_sql_error(conn, SQL_NULL_HSTMT, "Set autocommit"); RETURN_FALSE; } - RETVAL_TRUE; + RETURN_TRUE; } else { SQLINTEGER status; @@ -2577,7 +2578,7 @@ PHP_FUNCTION(odbc_autocommit) odbc_sql_error(conn, SQL_NULL_HSTMT, "Get commit status"); RETURN_FALSE; } - RETVAL_LONG((zend_long)status); + RETURN_LONG((zend_long)status); } } /* }}} */ diff --git a/ext/odbc/tests/bug44618.phpt b/ext/odbc/tests/bug44618.phpt index efead0e99518..5bb947a8bd06 100644 --- a/ext/odbc/tests/bug44618.phpt +++ b/ext/odbc/tests/bug44618.phpt @@ -3,7 +3,13 @@ Bug #44618 (Fetching may rely on uninitialized data) --EXTENSIONS-- odbc --SKIPIF-- - + --FILE-- +--XFAIL-- +Uses syntax incompatible with MS SQL (CREATE DATABASE ... ENCODING) --FILE-- string(3) "102" ["txt"]=> - string(12) "Müsliriegel" + string(17) "Lorem ipsum dolor" ["k"]=> string(2) "34" } diff --git a/ext/odbc/tests/odbc_autocommit_001.phpt b/ext/odbc/tests/odbc_autocommit_001.phpt new file mode 100644 index 000000000000..6ae09736555c --- /dev/null +++ b/ext/odbc/tests/odbc_autocommit_001.phpt @@ -0,0 +1,25 @@ +--TEST-- +odbc_autocommit(): Basic test +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true) +int(1) +bool(true) +int(0) diff --git a/ext/odbc/tests/odbc_close_all_001.phpt b/ext/odbc/tests/odbc_close_all_001.phpt new file mode 100644 index 000000000000..9641ac4bd7e4 --- /dev/null +++ b/ext/odbc/tests/odbc_close_all_001.phpt @@ -0,0 +1,38 @@ +--TEST-- +odbc_close_all(): Basic test +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +resource(5) of type (odbc link) +resource(7) of type (odbc link persistent) +resource(8) of type (odbc result) +resource(9) of type (odbc result) +resource(5) of type (Unknown) +resource(7) of type (Unknown) +resource(8) of type (Unknown) +resource(9) of type (Unknown) diff --git a/ext/odbc/tests/odbc_commit_001.phpt b/ext/odbc/tests/odbc_commit_001.phpt new file mode 100644 index 000000000000..5db0b0627e5b --- /dev/null +++ b/ext/odbc/tests/odbc_commit_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +odbc_commit(): Basic test for odbc_commit() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +bool(true) +string(1) "1" diff --git a/ext/odbc/tests/odbc_cursor_001.phpt b/ext/odbc/tests/odbc_cursor_001.phpt new file mode 100644 index 000000000000..b7111393d834 --- /dev/null +++ b/ext/odbc/tests/odbc_cursor_001.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test odbc_cursor() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +string(%d) "SQL_CUR%s" diff --git a/ext/odbc/tests/odbc_exec_001.phpt b/ext/odbc/tests/odbc_exec_001.phpt index 649d940060cb..284279eb3ce5 100644 --- a/ext/odbc/tests/odbc_exec_001.phpt +++ b/ext/odbc/tests/odbc_exec_001.phpt @@ -16,32 +16,14 @@ include 'config.inc'; $conn = odbc_connect($dsn, $user, $pass); -odbc_exec($conn, 'foo', 'bar'); odbc_exec($conn, 'foo'); -odbc_exec($conn, '', ''); odbc_exec($conn, ''); -odbc_exec($conn, 1, 1); odbc_exec($conn, 1); -odbc_exec($conn, NULL, NULL); -odbc_exec($conn, NULL); - ?> --EXPECTF-- -Warning: odbc_exec(): Argument #3 must be of type int, string given in %s on line %d - -Warning: odbc_exec(): SQL error: %s in %s on line %d - -Warning: odbc_exec(): Argument #3 must be of type int, string given in %s on line %d - -Warning: odbc_exec(): SQL error: %s in %s on line %d - -Warning: odbc_exec(): SQL error: %s in %s on line %d - -Warning: odbc_exec(): SQL error: %s in %s on line %d - Warning: odbc_exec(): SQL error: %s in %s on line %d Warning: odbc_exec(): SQL error: %s in %s on line %d diff --git a/ext/odbc/tests/odbc_fetch_array_001.phpt b/ext/odbc/tests/odbc_fetch_array_001.phpt new file mode 100644 index 000000000000..b212adcb1f49 --- /dev/null +++ b/ext/odbc/tests/odbc_fetch_array_001.phpt @@ -0,0 +1,46 @@ +--TEST-- +odbc_fetch_array(): Getting data from query +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +array(1) { + ["foo"]=> + string(1) "1" +} +array(1) { + ["foo"]=> + string(1) "2" +} +array(1) { + ["foo"]=> + string(1) "3" +} +bool(false) diff --git a/ext/odbc/tests/odbc_fetch_into_001.phpt b/ext/odbc/tests/odbc_fetch_into_001.phpt new file mode 100644 index 000000000000..5053552ce5da --- /dev/null +++ b/ext/odbc/tests/odbc_fetch_into_001.phpt @@ -0,0 +1,59 @@ +--TEST-- +odbc_fetch_into(): Getting data from query +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +int(1) +array(1) { + [0]=> + string(1) "1" +} +int(1) +array(1) { + [0]=> + string(1) "2" +} +int(1) +array(1) { + [0]=> + string(1) "3" +} +bool(false) +array(0) { +} diff --git a/ext/odbc/tests/odbc_fetch_object_001.phpt b/ext/odbc/tests/odbc_fetch_object_001.phpt new file mode 100644 index 000000000000..4ea407562eb7 --- /dev/null +++ b/ext/odbc/tests/odbc_fetch_object_001.phpt @@ -0,0 +1,46 @@ +--TEST-- +odbc_fetch_object(): Getting data from query +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +object(stdClass)#%d (%d) { + ["foo"]=> + string(1) "1" +} +object(stdClass)#%d (%d) { + ["foo"]=> + string(1) "2" +} +object(stdClass)#%d (%d) { + ["foo"]=> + string(1) "3" +} +bool(false) diff --git a/ext/odbc/tests/odbc_fetch_row_001.phpt b/ext/odbc/tests/odbc_fetch_row_001.phpt new file mode 100644 index 000000000000..4cecb513a067 --- /dev/null +++ b/ext/odbc/tests/odbc_fetch_row_001.phpt @@ -0,0 +1,52 @@ +--TEST-- +odbc_fetch_row(): Getting data from query +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +bool(false) +bool(true) +string(1) "1" +bool(true) +string(1) "2" +bool(true) +string(1) "3" +bool(false) diff --git a/ext/odbc/tests/odbc_field_len_001.phpt b/ext/odbc/tests/odbc_field_len_001.phpt new file mode 100644 index 000000000000..b4697fff75f2 --- /dev/null +++ b/ext/odbc/tests/odbc_field_len_001.phpt @@ -0,0 +1,43 @@ +--TEST-- +odbc_field_len(): Getting the length of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +var_dump(odbc_field_len($res, 1)); +var_dump(odbc_field_len($res, 2)); +var_dump(odbc_field_len($res, 3)); +var_dump(odbc_field_len($res, 4)); + +odbc_close($conn); +?> +--CLEAN-- + +--EXPECTF-- +odbc_field_len(): Argument #2 ($field) must be greater than 0 +int(10) +int(2147483647) +int(50) + +Warning: odbc_field_len(): Field index larger than number of fields in %s on line %d +bool(false) diff --git a/ext/odbc/tests/odbc_field_name_001.phpt b/ext/odbc/tests/odbc_field_name_001.phpt new file mode 100644 index 000000000000..da34da9e022e --- /dev/null +++ b/ext/odbc/tests/odbc_field_name_001.phpt @@ -0,0 +1,42 @@ +--TEST-- +odbc_field_name(): Getting the name of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +var_dump(odbc_field_name($res, 1)); +var_dump(odbc_field_name($res, 2)); +var_dump(odbc_field_name($res, 3)); +var_dump(odbc_field_name($res, 4)); + +?> +--CLEAN-- + +--EXPECTF-- +odbc_field_name(): Argument #2 ($field) must be greater than 0 +string(3) "foo" +string(3) "bar" +string(3) "baz" + +Warning: odbc_field_name(): Field index larger than number of fields in %s on line %d +bool(false) diff --git a/ext/odbc/tests/odbc_field_num_001.phpt b/ext/odbc/tests/odbc_field_num_001.phpt new file mode 100644 index 000000000000..ab4bbcc4d00b --- /dev/null +++ b/ext/odbc/tests/odbc_field_num_001.phpt @@ -0,0 +1,34 @@ +--TEST-- +odbc_field_scale(): Getting the scale of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +int(1) +int(2) +int(3) +bool(false) diff --git a/ext/odbc/tests/odbc_field_precision_001.phpt b/ext/odbc/tests/odbc_field_precision_001.phpt new file mode 100644 index 000000000000..609401ba263c --- /dev/null +++ b/ext/odbc/tests/odbc_field_precision_001.phpt @@ -0,0 +1,42 @@ +--TEST-- +odbc_field_precision(): Getting the precision of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +var_dump(odbc_field_precision($res, 1)); +var_dump(odbc_field_precision($res, 2)); +var_dump(odbc_field_precision($res, 3)); +var_dump(odbc_field_precision($res, 4)); + +?> +--CLEAN-- + +--EXPECTF-- +odbc_field_precision(): Argument #2 ($field) must be greater than 0 +int(10) +int(7) +int(50) + +Warning: odbc_field_precision(): Field index larger than number of fields in %s on line %d +bool(false) diff --git a/ext/odbc/tests/odbc_field_scale_001.phpt b/ext/odbc/tests/odbc_field_scale_001.phpt new file mode 100644 index 000000000000..3bb2da8e1c2c --- /dev/null +++ b/ext/odbc/tests/odbc_field_scale_001.phpt @@ -0,0 +1,42 @@ +--TEST-- +odbc_field_scale(): Getting the scale of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +var_dump(odbc_field_scale($res, 1)); +var_dump(odbc_field_scale($res, 2)); +var_dump(odbc_field_scale($res, 3)); +var_dump(odbc_field_scale($res, 4)); + +?> +--CLEAN-- + +--EXPECTF-- +odbc_field_scale(): Argument #2 ($field) must be greater than 0 +int(0) +int(0) +int(0) + +Warning: odbc_field_scale(): Field index larger than number of fields in %s on line %d +bool(false) diff --git a/ext/odbc/tests/odbc_field_type_001.phpt b/ext/odbc/tests/odbc_field_type_001.phpt new file mode 100644 index 000000000000..81774c7dbc0e --- /dev/null +++ b/ext/odbc/tests/odbc_field_type_001.phpt @@ -0,0 +1,42 @@ +--TEST-- +odbc_field_type(): Getting the type of the field +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +var_dump(odbc_field_type($res, 1)); +var_dump(odbc_field_type($res, 2)); +var_dump(odbc_field_type($res, 3)); +var_dump(odbc_field_type($res, 4)); + +?> +--CLEAN-- + +--EXPECTF-- +odbc_field_type(): Argument #2 ($field) must be greater than 0 +string(3) "int" +string(4) "text" +string(9) "varbinary" + +Warning: odbc_field_type(): Field index larger than number of fields in %s on line %d +bool(false) diff --git a/ext/odbc/tests/odbc_gettypeinfo_001.phpt b/ext/odbc/tests/odbc_gettypeinfo_001.phpt new file mode 100644 index 000000000000..76b06089181f --- /dev/null +++ b/ext/odbc/tests/odbc_gettypeinfo_001.phpt @@ -0,0 +1,154 @@ +--TEST-- +odbc_gettypeinfo(): Getting info about data types +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +array(20) { + ["TYPE_NAME"]=> + string(14) "datetimeoffset" + ["DATA_TYPE"]=> + string(4) "-155" + ["COLUMN_SIZE"]=> + string(2) "34" + ["LITERAL_PREFIX"]=> + string(1) "'" + ["LITERAL_SUFFIX"]=> + string(1) "'" + ["CREATE_PARAMS"]=> + string(5) "scale" + ["NULLABLE"]=> + string(1) "1" + ["CASE_SENSITIVE"]=> + string(1) "0" + ["SEARCHABLE"]=> + string(1) "3" + ["UNSIGNED_ATTRIBUTE"]=> + NULL + ["FIXED_PREC_SCALE"]=> + string(1) "0" + ["AUTO_UNIQUE_VALUE"]=> + NULL + ["LOCAL_TYPE_NAME"]=> + string(14) "datetimeoffset" + ["MINIMUM_SCALE"]=> + string(1) "0" + ["MAXIMUM_SCALE"]=> + string(1) "7" + ["SQL_DATA_TYPE"]=> + string(4) "-155" + ["SQL_DATETIME_SUB"]=> + string(1) "0" + ["NUM_PREC_RADIX"]=> + NULL + ["INTERVAL_PRECISION"]=> + NULL + ["USERTYPE"]=> + string(1) "0" +} +array(20) { + ["TYPE_NAME"]=> + string(4) "char" + ["DATA_TYPE"]=> + string(1) "1" + ["COLUMN_SIZE"]=> + string(4) "8000" + ["LITERAL_PREFIX"]=> + string(1) "'" + ["LITERAL_SUFFIX"]=> + string(1) "'" + ["CREATE_PARAMS"]=> + string(6) "length" + ["NULLABLE"]=> + string(1) "1" + ["CASE_SENSITIVE"]=> + string(1) "0" + ["SEARCHABLE"]=> + string(1) "3" + ["UNSIGNED_ATTRIBUTE"]=> + NULL + ["FIXED_PREC_SCALE"]=> + string(1) "0" + ["AUTO_UNIQUE_VALUE"]=> + NULL + ["LOCAL_TYPE_NAME"]=> + string(4) "char" + ["MINIMUM_SCALE"]=> + NULL + ["MAXIMUM_SCALE"]=> + NULL + ["SQL_DATA_TYPE"]=> + string(1) "1" + ["SQL_DATETIME_SUB"]=> + NULL + ["NUM_PREC_RADIX"]=> + NULL + ["INTERVAL_PRECISION"]=> + NULL + ["USERTYPE"]=> + string(1) "1" +} +array(20) { + ["TYPE_NAME"]=> + string(7) "numeric" + ["DATA_TYPE"]=> + string(1) "2" + ["COLUMN_SIZE"]=> + string(2) "38" + ["LITERAL_PREFIX"]=> + NULL + ["LITERAL_SUFFIX"]=> + NULL + ["CREATE_PARAMS"]=> + string(15) "precision,scale" + ["NULLABLE"]=> + string(1) "1" + ["CASE_SENSITIVE"]=> + string(1) "0" + ["SEARCHABLE"]=> + string(1) "2" + ["UNSIGNED_ATTRIBUTE"]=> + string(1) "0" + ["FIXED_PREC_SCALE"]=> + string(1) "0" + ["AUTO_UNIQUE_VALUE"]=> + string(1) "0" + ["LOCAL_TYPE_NAME"]=> + string(7) "numeric" + ["MINIMUM_SCALE"]=> + string(1) "0" + ["MAXIMUM_SCALE"]=> + string(2) "38" + ["SQL_DATA_TYPE"]=> + string(1) "2" + ["SQL_DATETIME_SUB"]=> + NULL + ["NUM_PREC_RADIX"]=> + string(2) "10" + ["INTERVAL_PRECISION"]=> + NULL + ["USERTYPE"]=> + string(2) "10" +} diff --git a/ext/odbc/tests/odbc_longreadlen_001.phpt b/ext/odbc/tests/odbc_longreadlen_001.phpt new file mode 100644 index 000000000000..d27fa8bf9581 --- /dev/null +++ b/ext/odbc/tests/odbc_longreadlen_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test odbc_longreadlen() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +string(4) "what" diff --git a/ext/odbc/tests/odbc_num_fields_001.phpt b/ext/odbc/tests/odbc_num_fields_001.phpt new file mode 100644 index 000000000000..b815c971e01c --- /dev/null +++ b/ext/odbc/tests/odbc_num_fields_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +odbc_num_rows(): Getting the number of fields +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(3) +int(3) diff --git a/ext/odbc/tests/odbc_num_rows_001.phpt b/ext/odbc/tests/odbc_num_rows_001.phpt new file mode 100644 index 000000000000..8c2af1a1f147 --- /dev/null +++ b/ext/odbc/tests/odbc_num_rows_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +odbc_num_rows(): Getting the number of rows +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(3) +int(0) diff --git a/ext/odbc/tests/odbc_primarykeys_001.phpt b/ext/odbc/tests/odbc_primarykeys_001.phpt new file mode 100644 index 000000000000..17b42c6ff51e --- /dev/null +++ b/ext/odbc/tests/odbc_primarykeys_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +odbc_primarykeys(): Basic test for odbc_primarykeys() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--XFAIL-- +Doesn't work with MS SQL +--FILE-- + +--CLEAN-- + +--EXPECT-- +bool(false) diff --git a/ext/odbc/tests/odbc_rollback_001.phpt b/ext/odbc/tests/odbc_rollback_001.phpt new file mode 100644 index 000000000000..6f4cf3d6926d --- /dev/null +++ b/ext/odbc/tests/odbc_rollback_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +odbc_rollback(): Basic test for odbc_rollback() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +bool(true) +bool(false) diff --git a/ext/odbc/tests/odbc_setoption_001.phpt b/ext/odbc/tests/odbc_setoption_001.phpt new file mode 100644 index 000000000000..3f2202100aa6 --- /dev/null +++ b/ext/odbc/tests/odbc_setoption_001.phpt @@ -0,0 +1,24 @@ +--TEST-- +odbc_setoption(): Basic test for odbc_setoption() +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +int(0) diff --git a/ext/odbc/tests/odbc_setoption_002.phpt b/ext/odbc/tests/odbc_setoption_002.phpt new file mode 100644 index 000000000000..e93d45b6fb41 --- /dev/null +++ b/ext/odbc/tests/odbc_setoption_002.phpt @@ -0,0 +1,25 @@ +--TEST-- +odbc_setoption(): Test for odbc_setoption() with persistent connection +--EXTENSIONS-- +odbc +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: odbc_setoption(): Unable to set option for persistent connection in %s on line %d +bool(false) +int(1) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 32cf51301329..0346a44e3dc0 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1538,8 +1538,6 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script (size_t)ZCG(mem)); } - new_persistent_script->dynamic_members.checksum = zend_accel_script_checksum(new_persistent_script); - zend_file_cache_script_store(new_persistent_script, /* is_shm */ false); return new_persistent_script; @@ -1653,8 +1651,6 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr (size_t)ZCG(mem)); } - new_persistent_script->dynamic_members.checksum = zend_accel_script_checksum(new_persistent_script); - /* store script structure in the hash table */ bucket = zend_accel_hash_update(&ZCSG(hash), new_persistent_script->script.filename, 0, new_persistent_script); if (bucket) { @@ -2131,20 +2127,6 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) } } - /* if turned on - check the compiled script ADLER32 checksum */ - if (persistent_script && ZCG(accel_directives).consistency_checks - && persistent_script->dynamic_members.hits % ZCG(accel_directives).consistency_checks == 0) { - - unsigned int checksum = zend_accel_script_checksum(persistent_script); - if (checksum != persistent_script->dynamic_members.checksum ) { - /* The checksum is wrong */ - zend_accel_error(ACCEL_LOG_INFO, "Checksum failed for '%s': expected=0x%08x, found=0x%08x", - ZSTR_VAL(persistent_script->script.filename), persistent_script->dynamic_members.checksum, checksum); - zend_accel_lock_discard_script(persistent_script); - persistent_script = NULL; - } - } - /* Check the second level cache */ if (!persistent_script && ZCG(accel_directives).file_cache) { persistent_script = zend_file_cache_script_load(file_handle); @@ -4280,8 +4262,6 @@ static zend_persistent_script* preload_script_in_shared_memory(zend_persistent_s (size_t)ZCG(mem)); } - new_persistent_script->dynamic_members.checksum = zend_accel_script_checksum(new_persistent_script); - /* store script structure in the hash table */ bucket = zend_accel_hash_update(&ZCSG(hash), new_persistent_script->script.filename, 0, new_persistent_script); if (bucket) { diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 568d8f497241..e958e8fd6506 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -132,14 +132,10 @@ typedef struct _zend_persistent_script { void *mem; /* shared memory area used by script structures */ size_t size; /* size of used shared memory */ - /* All entries that shouldn't be counted in the ADLER32 - * checksum must be declared in this struct - */ struct zend_persistent_script_dynamic_members { time_t last_used; zend_ulong hits; unsigned int memory_consumption; - unsigned int checksum; time_t revalidate; } dynamic_members; } zend_persistent_script; @@ -149,7 +145,6 @@ typedef struct _zend_accel_directives { zend_long max_accelerated_files; double max_wasted_percentage; char *user_blacklist_filename; - zend_long consistency_checks; zend_long force_restart_timeout; bool use_cwd; bool ignore_dups; @@ -266,6 +261,7 @@ typedef struct _zend_accel_shared_globals { LONGLONG restart_in; #endif bool restart_in_progress; + bool jit_counters_stopped; /* Preloading */ zend_persistent_script *preload_script; diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 6099730cd8db..ccff174c7df1 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -63,6 +63,7 @@ static int zend_jit_trace_startup(bool reattached) ZEND_JIT_EXIT_COUNTERS = 0; ZCSG(jit_traces) = zend_jit_traces; ZCSG(jit_exit_groups) = zend_jit_exit_groups; + ZCSG(jit_counters_stopped) = false; } else { zend_jit_traces = ZCSG(jit_traces); if (!zend_jit_traces) { @@ -7255,16 +7256,23 @@ static void zend_jit_stop_persistent_script(zend_persistent_script *script) /* Get all scripts which are accelerated by JIT */ static void zend_jit_stop_counter_handlers(void) { + if (ZCSG(jit_counters_stopped)) { + return; + } + zend_shared_alloc_lock(); /* mprotect has an extreme overhead, avoid calls to it for every function. */ SHM_UNPROTECT(); - for (uint32_t i = 0; i < ZCSG(hash).max_num_entries; i++) { - zend_accel_hash_entry *cache_entry; - for (cache_entry = ZCSG(hash).hash_table[i]; cache_entry; cache_entry = cache_entry->next) { - zend_persistent_script *script; - if (cache_entry->indirect) continue; - script = (zend_persistent_script *)cache_entry->data; - zend_jit_stop_persistent_script(script); + if (!ZCSG(jit_counters_stopped)) { + ZCSG(jit_counters_stopped) = true; + for (uint32_t i = 0; i < ZCSG(hash).max_num_entries; i++) { + zend_accel_hash_entry *cache_entry; + for (cache_entry = ZCSG(hash).hash_table[i]; cache_entry; cache_entry = cache_entry->next) { + zend_persistent_script *script; + if (cache_entry->indirect) continue; + script = (zend_persistent_script *)cache_entry->data; + zend_jit_stop_persistent_script(script); + } } } SHM_PROTECT(); @@ -8438,6 +8446,7 @@ static void zend_jit_trace_restart(void) ZEND_JIT_COUNTER_NUM = 0; ZEND_JIT_EXIT_NUM = 0; ZEND_JIT_EXIT_COUNTERS = 0; + ZCSG(jit_counters_stopped) = false; zend_jit_trace_init_caches(); } diff --git a/ext/opcache/tests/gh8065.phpt b/ext/opcache/tests/gh8065.phpt deleted file mode 100644 index db951a7b0917..000000000000 --- a/ext/opcache/tests/gh8065.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -GH-8065: opcache.consistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context ---EXTENSIONS-- -opcache ---INI-- -opcache.enable_cli=1 -opcache.consistency_checks=1 -opcache.log_verbosity_level=2 ---FILE-- - ---EXPECTF-- -%sWarning opcache.consistency_checks is reset back to 0 because it does not work properly (see GH-8065, GH-10624). - -string(1) "0" -%sWarning opcache.consistency_checks is reset back to 0 because it does not work properly (see GH-8065, GH-10624). - -bool(false) -%sWarning opcache.consistency_checks is reset back to 0 because it does not work properly (see GH-8065, GH-10624). - -bool(false) -string(1) "0" diff --git a/ext/opcache/tests/opt/block_pass_005.phpt b/ext/opcache/tests/opt/block_pass_005.phpt new file mode 100644 index 000000000000..d57fe22d71bf --- /dev/null +++ b/ext/opcache/tests/opt/block_pass_005.phpt @@ -0,0 +1,17 @@ +--TEST-- +Block Pass 005: Inorrect QM_ASSIGN elimination +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--EXTENSIONS-- +opcache +--FILE-- +y; +?> +--EXPECTF-- +Fatal error: Uncaught Error: Undefined constant "y" in %sblock_pass_005.php:2 +Stack trace: +#0 {main} + thrown in %sblock_pass_005.php on line 2 diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 5181af8d8c99..2c0ad63b48f3 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -129,19 +129,6 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage) return SUCCESS; } -static ZEND_INI_MH(OnUpdateConsistencyChecks) -{ - zend_long *p = (zend_long *) ZEND_INI_GET_ADDR(); - zend_long consistency_checks = atoi(ZSTR_VAL(new_value)); - - if (consistency_checks != 0) { - zend_accel_error(ACCEL_LOG_WARNING, "opcache.consistency_checks is reset back to 0 because it does not work properly (see GH-8065, GH-10624).\n"); - return FAILURE; - } - *p = 0; - return SUCCESS; -} - static ZEND_INI_MH(OnEnable) { if (stage == ZEND_INI_STAGE_STARTUP || @@ -289,7 +276,6 @@ ZEND_INI_BEGIN() STD_PHP_INI_ENTRY("opcache.interned_strings_buffer", "8" , PHP_INI_SYSTEM, OnUpdateInternedStringsBuffer, accel_directives.interned_strings_buffer, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.max_accelerated_files" , "10000", PHP_INI_SYSTEM, OnUpdateMaxAcceleratedFiles, accel_directives.max_accelerated_files, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.max_wasted_percentage" , "5" , PHP_INI_SYSTEM, OnUpdateMaxWastedPercentage, accel_directives.max_wasted_percentage, zend_accel_globals, accel_globals) - STD_PHP_INI_ENTRY("opcache.consistency_checks" , "0" , PHP_INI_ALL , OnUpdateConsistencyChecks, accel_directives.consistency_checks, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.force_restart_timeout" , "180" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.force_restart_timeout, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.revalidate_freq" , "2" , PHP_INI_ALL , OnUpdateLong, accel_directives.revalidate_freq, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.file_update_protection", "2" , PHP_INI_ALL , OnUpdateLong, accel_directives.file_update_protection, zend_accel_globals, accel_globals) @@ -630,6 +616,8 @@ static int accelerator_get_scripts(zval *return_value) timerclear(&exec_time); timerclear(&fetch_time); + add_assoc_long(&persistent_script_report, "revalidate", (zend_long)script->dynamic_members.revalidate); + zend_hash_update(Z_ARRVAL_P(return_value), cache_entry->key, &persistent_script_report); } } @@ -804,7 +792,6 @@ ZEND_FUNCTION(opcache_get_configuration) add_assoc_long(&directives, "opcache.interned_strings_buffer",ZCG(accel_directives).interned_strings_buffer); add_assoc_long(&directives, "opcache.max_accelerated_files", ZCG(accel_directives).max_accelerated_files); add_assoc_double(&directives, "opcache.max_wasted_percentage", ZCG(accel_directives).max_wasted_percentage); - add_assoc_long(&directives, "opcache.consistency_checks", ZCG(accel_directives).consistency_checks); add_assoc_long(&directives, "opcache.force_restart_timeout", ZCG(accel_directives).force_restart_timeout); add_assoc_long(&directives, "opcache.revalidate_freq", ZCG(accel_directives).revalidate_freq); add_assoc_string(&directives, "opcache.preferred_memory_model", STRING_NOT_NULL(ZCG(accel_directives).memory_model)); diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 864bc4aff202..a69c7be86018 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -1118,9 +1118,6 @@ int zend_file_cache_script_store(zend_persistent_script *script, bool in_shm) zend_string *const s = (zend_string*)ZCG(mem); - info.checksum = zend_adler32(ADLER32_INIT, buf, script->size); - info.checksum = zend_adler32(info.checksum, (unsigned char*)ZSTR_VAL(s), info.str_size); - #if __has_feature(memory_sanitizer) /* The buffer may contain uninitialized regions. However, the uninitialized parts will not be * used when reading the cache. We should probably still try to get things fully initialized @@ -1129,6 +1126,9 @@ int zend_file_cache_script_store(zend_persistent_script *script, bool in_shm) __msan_unpoison(buf, script->size); #endif + info.checksum = zend_adler32(ADLER32_INIT, buf, script->size); + info.checksum = zend_adler32(info.checksum, (unsigned char*)ZSTR_VAL(s), info.str_size); + if (!zend_file_cache_script_write(fd, script, &info, buf, s)) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot write to file '%s': %s\n", filename, strerror(errno)); zend_string_release_ex(s, 0); @@ -1868,6 +1868,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl if (!file_cache_only && !ZCSG(restart_in_progress) && + !ZCSG(restart_pending) && !ZSMMG(memory_exhausted) && accelerator_shm_read_lock() == SUCCESS) { /* exclusive lock */ @@ -1935,7 +1936,6 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl if (cache_it) { ZCSG(map_ptr_last) = CG(map_ptr_last); - script->dynamic_members.checksum = zend_accel_script_checksum(script); script->dynamic_members.last_used = ZCG(request_time); zend_accel_hash_update(&ZCSG(hash), script->script.filename, 0, script); diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 481949ce9301..19460ad8b53f 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1048,68 +1048,26 @@ static void pcntl_signal_handler(int signo, siginfo_t *siginfo, void *context) static void pcntl_signal_handler(int signo) #endif { - struct php_pcntl_pending_signal *psig_first = PCNTL_G(spares); - if (!psig_first) { + struct php_pcntl_pending_signal *psig = PCNTL_G(spares); + if (!psig) { /* oops, too many signals for us to track, so we'll forget about this one */ return; } + PCNTL_G(spares) = psig->next; - struct php_pcntl_pending_signal *psig = NULL; - - /* Standard signals may be merged into a single one. - * POSIX specifies that SIGCHLD has the si_pid field (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html), - * so we'll handle the merging for that signal. - * See also: https://www.gnu.org/software/libc/manual/html_node/Merged-Signals.html */ - if (signo == SIGCHLD) { - /* Note: The first waitpid result is not necessarily the pid that was passed above! - * We therefore cannot avoid the first waitpid() call. */ - int status; - pid_t pid; - while (true) { - do { - errno = 0; - /* Although Linux specifies that WNOHANG will never result in EINTR, POSIX doesn't say so: - * https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html */ - pid = waitpid(-1, &status, WNOHANG | WUNTRACED); - } while (pid <= 0 && errno == EINTR); - if (pid <= 0) { - if (UNEXPECTED(!psig)) { - /* The child might've been consumed by another thread and will be handled there. */ - return; - } - break; - } - - psig = psig ? psig->next : psig_first; - psig->signo = signo; - -#ifdef HAVE_STRUCT_SIGINFO_T - psig->siginfo = *siginfo; - psig->siginfo.si_pid = pid; -#endif - - if (UNEXPECTED(!psig->next)) { - break; - } - } - } else { - psig = psig_first; - psig->signo = signo; + psig->signo = signo; + psig->next = NULL; #ifdef HAVE_STRUCT_SIGINFO_T - psig->siginfo = *siginfo; + psig->siginfo = *siginfo; #endif - } - - PCNTL_G(spares) = psig->next; - psig->next = NULL; /* the head check is important, as the tick handler cannot atomically clear both * the head and tail */ if (PCNTL_G(head) && PCNTL_G(tail)) { - PCNTL_G(tail)->next = psig_first; + PCNTL_G(tail)->next = psig; } else { - PCNTL_G(head) = psig_first; + PCNTL_G(head) = psig; } PCNTL_G(tail) = psig; PCNTL_G(pending_signals) = 1; diff --git a/ext/pcntl/tests/gh11498.phpt b/ext/pcntl/tests/waiting_on_sigchild_pcntl_wait.phpt similarity index 79% rename from ext/pcntl/tests/gh11498.phpt rename to ext/pcntl/tests/waiting_on_sigchild_pcntl_wait.phpt index 4a9f87a94d82..482888cfadd9 100644 --- a/ext/pcntl/tests/gh11498.phpt +++ b/ext/pcntl/tests/waiting_on_sigchild_pcntl_wait.phpt @@ -1,5 +1,5 @@ --TEST-- -GH-11498 (SIGCHLD is not always returned from proc_open) +Waiting on SIGCHLD with a pcntl_wait() loop --EXTENSIONS-- pcntl --SKIPIF-- @@ -14,8 +14,10 @@ $processes = []; pcntl_async_signals(true); pcntl_signal(SIGCHLD, function($sig, $info) use (&$processes) { - echo "SIGCHLD\n"; - unset($processes[$info['pid']]); + while (($pid = pcntl_wait($status, WUNTRACED | WNOHANG)) > 0) { + echo "SIGCHLD\n"; + unset($processes[$pid]); + } }, false); for ($i = 0; $i <= 5; $i++) { diff --git a/ext/pdo_mysql/tests/gh11550.phpt b/ext/pdo_mysql/tests/gh11550.phpt new file mode 100644 index 000000000000..5bf0b26497ca --- /dev/null +++ b/ext/pdo_mysql/tests/gh11550.phpt @@ -0,0 +1,82 @@ +--TEST-- +Bug GH-11550 (MySQL Statement has a empty query result when the response field has changed, also Segmentation fault) +--EXTENSIONS-- +pdo +pdo_mysql +--SKIPIF-- + +--FILE-- +exec(<<<'SQL' +CREATE TABLE `test_gh11550` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `name`(`name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +SQL); +$pdo->exec(<<<'SQL' +INSERT INTO `test_gh11550` (`name`) VALUES ('test1'); +SQL); + +$stmt = $pdo->prepare('select * from test_gh11550'); +var_dump('PDO-1:', $stmt->execute(), $stmt->fetchAll()); + +$stmt->closeCursor(); // Optional. Segmentation fault (core dumped) + +$pdo->exec(<<<'SQL' +ALTER TABLE `test_gh11550` +ADD COLUMN `a` varchar(255) NOT NULL DEFAULT ''; +SQL); + +var_dump('PDO-2:', $stmt->execute(), $stmt->fetchAll()); +echo 'Done'; +?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_gh11550'); +?> +--EXPECT-- +string(6) "PDO-1:" +bool(true) +array(1) { + [0]=> + array(4) { + ["id"]=> + int(1) + [0]=> + int(1) + ["name"]=> + string(5) "test1" + [1]=> + string(5) "test1" + } +} +string(6) "PDO-2:" +bool(true) +array(1) { + [0]=> + array(6) { + ["id"]=> + int(1) + [0]=> + int(1) + ["name"]=> + string(5) "test1" + [1]=> + string(5) "test1" + ["a"]=> + string(0) "" + [2]=> + string(0) "" + } +} +Done diff --git a/ext/pdo_pgsql/tests/bug46274.phpt b/ext/pdo_pgsql/tests/bug46274.phpt index f35751f7a422..610db81a0451 100644 --- a/ext/pdo_pgsql/tests/bug46274.phpt +++ b/ext/pdo_pgsql/tests/bug46274.phpt @@ -21,9 +21,9 @@ try { } catch (Exception $e) { } -$db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); +$db->query('CREATE TABLE test_one_blob_46274_1 (id SERIAL NOT NULL, blob1 BYTEA)'); -$stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); +$stmt = $db->prepare("INSERT INTO test_one_blob_46274_1 (blob1) VALUES (:foo)"); $data = 'foo'; $blob = fopen('php://memory', 'a'); @@ -49,7 +49,7 @@ $blob = NULL; $stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); $stmt->execute(); -$res = $db->query("SELECT blob1 from test_one_blob"); +$res = $db->query("SELECT blob1 from test_one_blob_46274_1"); // Resource var_dump($res->fetch()); @@ -61,9 +61,12 @@ var_dump($res->fetch()); // NULL var_dump($res->fetch()); - -$db->query('DROP TABLE test_one_blob'); - +?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_one_blob_46274_1'); ?> --EXPECT-- array(2) { diff --git a/ext/pdo_pgsql/tests/bug46274_2.phpt b/ext/pdo_pgsql/tests/bug46274_2.phpt index 80e789773820..21dce8cbf409 100644 --- a/ext/pdo_pgsql/tests/bug46274_2.phpt +++ b/ext/pdo_pgsql/tests/bug46274_2.phpt @@ -21,9 +21,9 @@ try { } catch (Exception $e) { } -$db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); +$db->query('CREATE TABLE test_one_blob_46274_2 (id SERIAL NOT NULL, blob1 BYTEA)'); -$stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); +$stmt = $db->prepare("INSERT INTO test_one_blob_46274_2 (blob1) VALUES (:foo)"); $data = 'foo'; $blob = fopen('php://memory', 'a'); @@ -49,7 +49,7 @@ $blob = NULL; $stmt->bindparam(':foo', $blob, PDO::PARAM_LOB); $stmt->execute(); -$res = $db->query("SELECT blob1 from test_one_blob"); +$res = $db->query("SELECT blob1 from test_one_blob_46274_2"); // Resource var_dump($x = $res->fetch()); var_dump(fread($x['blob1'], 10)); @@ -64,9 +64,12 @@ var_dump(fread($x['blob1'], 10)); // NULL var_dump($res->fetch()); - -$db->query('DROP TABLE test_one_blob'); - +?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_one_blob_46274_2'); ?> --EXPECTF-- array(2) { diff --git a/ext/pdo_pgsql/tests/bug66584.phpt b/ext/pdo_pgsql/tests/bug66584.phpt index 010a1d229e96..1df28e037afa 100644 --- a/ext/pdo_pgsql/tests/bug66584.phpt +++ b/ext/pdo_pgsql/tests/bug66584.phpt @@ -56,6 +56,12 @@ function run($pdo, $data) var_dump($stmt->fetchColumn()); } +?> +--CLEAN-- +query("DROP TABLE IF EXISTS b66584"); ?> --EXPECTF-- int(3) diff --git a/ext/pdo_pgsql/tests/bug67462.phpt b/ext/pdo_pgsql/tests/bug67462.phpt index e9d7a40be01f..b3e85fee96df 100644 --- a/ext/pdo_pgsql/tests/bug67462.phpt +++ b/ext/pdo_pgsql/tests/bug67462.phpt @@ -29,6 +29,12 @@ try { var_dump($pdo->beginTransaction()); } +?> +--CLEAN-- +query("DROP TABLE IF EXISTS b67462"); ?> --EXPECT-- bool(true) diff --git a/ext/pdo_pgsql/tests/bug70861.phpt b/ext/pdo_pgsql/tests/bug70861.phpt index 678c3a464d62..e64c97f12c1e 100644 --- a/ext/pdo_pgsql/tests/bug70861.phpt +++ b/ext/pdo_pgsql/tests/bug70861.phpt @@ -21,8 +21,7 @@ try { } catch (Exception $e) { } -$db->query('DROP TABLE IF EXISTS test_blob_crash CASCADE'); -$db->query('CREATE TABLE test_blob_crash (id SERIAL NOT NULL, blob1 BYTEA)'); +$db->query('CREATE TABLE test_blob_crash_70861 (id SERIAL NOT NULL, blob1 BYTEA)'); class HelloWrapper { public function stream_open() { return true; } @@ -41,8 +40,16 @@ $stmt->execute(); fclose($f); +$db->exec('DROP TABLE test_blob_crash'); + ?> +++DONE+++ +--CLEAN-- +query('DROP TABLE IF EXISTS test_blob_crash_70861 CASCADE'); +?> --EXPECTF-- %a +++DONE+++ diff --git a/ext/pdo_pgsql/tests/bug72633.phpt b/ext/pdo_pgsql/tests/bug72633.phpt index 97ffc3715bbc..6f60577075e2 100644 --- a/ext/pdo_pgsql/tests/bug72633.phpt +++ b/ext/pdo_pgsql/tests/bug72633.phpt @@ -18,9 +18,9 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -$db->query('CREATE TABLE test_last_id (id SERIAL NOT NULL, field1 VARCHAR(10))'); +$db->query('CREATE TABLE test_last_id_72633 (id SERIAL NOT NULL, field1 VARCHAR(10))'); -$stmt = $db->prepare("INSERT INTO test_last_id (field1) VALUES ('test')"); +$stmt = $db->prepare("INSERT INTO test_last_id_72633 (field1) VALUES ('test')"); $stmt->execute(); @@ -31,10 +31,14 @@ var_dump($db->lastInsertId()); /** * Sequence name informed */ -var_dump($db->lastInsertId('test_last_id_id_seq')); - -$db->query('DROP TABLE test_last_id'); +var_dump($db->lastInsertId('test_last_id_72633_id_seq')); +?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_last_id_72633'); ?> --EXPECTREGEX-- string\([0-9]*\)\ \"[0-9]*\" diff --git a/ext/pdo_pgsql/tests/bug75402.phpt b/ext/pdo_pgsql/tests/bug75402.phpt index f09625a833c4..db0820e36513 100644 --- a/ext/pdo_pgsql/tests/bug75402.phpt +++ b/ext/pdo_pgsql/tests/bug75402.phpt @@ -17,7 +17,6 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $resp = new \stdClass(); $resp->entries = []; -$db->query('DROP TABLE IF EXISTS bug75402 CASCADE'); $db->query('CREATE TABLE bug75402 ( "id" character varying(64) NOT NULL, "group_id" character varying(64) NOT NULL, @@ -84,6 +83,12 @@ if ($db) { var_dump($resp); ?> +--CLEAN-- +exec('DROP TABLE IF EXISTS bug75402'); +?> --EXPECT-- object(stdClass)#2 (1) { ["entries"]=> diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt index f210b045f61b..6b062f6ceb16 100644 --- a/ext/pdo_pgsql/tests/bug_33876.phpt +++ b/ext/pdo_pgsql/tests/bug_33876.phpt @@ -16,11 +16,11 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); $db->exec("SET LC_MESSAGES='C'"); -$db->exec('CREATE TABLE test (foo varchar(5) NOT NULL, bar bool NOT NULL)'); -$db->exec("INSERT INTO test VALUES('false','f')"); -$db->exec("INSERT INTO test VALUES('true', 't')"); +$db->exec('CREATE TABLE b33876 (foo varchar(5) NOT NULL, bar bool NOT NULL)'); +$db->exec("INSERT INTO b33876 VALUES('false','f')"); +$db->exec("INSERT INTO b33876 VALUES('true', 't')"); -$res = $db->prepare('SELECT foo from test where bar = ?'); +$res = $db->prepare('SELECT foo from b33876 where bar = ?'); # this is the portable approach to binding a bool $res->bindValue(1, false, PDO::PARAM_BOOL); @@ -55,7 +55,7 @@ else echo "EMUL\n"; -$res = $db->prepare('SELECT foo from test where bar = ?', array( +$res = $db->prepare('SELECT foo from b33876 where bar = ?', array( PDO::ATTR_EMULATE_PREPARES => true)); # this is the portable approach to binding a bool @@ -94,6 +94,12 @@ function normalizeErrorInfo(array $err): array { return $err; } +?> +--CLEAN-- +query('DROP TABLE IF EXISTS b33876 CASCADE'); ?> --EXPECTF-- Array diff --git a/ext/pdo_pgsql/tests/bug_49985.phpt b/ext/pdo_pgsql/tests/bug_49985.phpt index 29d74b72e4c7..b1ba388655e0 100644 --- a/ext/pdo_pgsql/tests/bug_49985.phpt +++ b/ext/pdo_pgsql/tests/bug_49985.phpt @@ -15,12 +15,12 @@ require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -$db->exec("CREATE TABLE test (a int PRIMARY KEY)"); +$db->exec("CREATE TABLE b49985 (a int PRIMARY KEY)"); for ($i = 0; $i < 3; $i++) { try { $db->beginTransaction(); - $stmt = $db->prepare("INSERT INTO test (a) VALUES (?)"); + $stmt = $db->prepare("INSERT INTO b49985 (a) VALUES (?)"); var_dump($stmt->execute(array(1))); $db->commit(); } catch (Exception $e) { @@ -29,8 +29,14 @@ for ($i = 0; $i < 3; $i++) { } } +?> +--CLEAN-- +query('DROP TABLE IF EXISTS b49985 CASCADE'); ?> --EXPECTF-- bool(true) -SQLSTATE[23505]: %stest_pkey%s -SQLSTATE[23505]: %stest_pkey%s +SQLSTATE[23505]: %sb49985_pkey%s +SQLSTATE[23505]: %sb49985_pkey%s diff --git a/ext/pdo_pgsql/tests/copy_from.phpt b/ext/pdo_pgsql/tests/copy_from.phpt index 967d6319553a..5bb46531329a 100644 --- a/ext/pdo_pgsql/tests/copy_from.phpt +++ b/ext/pdo_pgsql/tests/copy_from.phpt @@ -16,7 +16,7 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -$db->exec('CREATE TABLE test (a integer not null primary key, b text, c integer)'); +$db->exec('CREATE TABLE test_copy_from (a integer not null primary key, b text, c integer)'); echo "Preparing test file and array for CopyFrom tests\n"; @@ -40,9 +40,9 @@ file_put_contents($filenameWithDifferentNullValuesAndSelectedFields, implode("\n echo "Testing pgsqlCopyFromArray() with default parameters\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromArray('test',$tableRows)); +var_dump($db->pgsqlCopyFromArray('test_copy_from',$tableRows)); -$stmt = $db->query("select * from test"); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -50,8 +50,8 @@ $db->rollback(); echo "Testing pgsqlCopyFromArray() with different field separator and not null indicator\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromArray('test',$tableRowsWithDifferentNullValues,";","NULL")); -$stmt = $db->query("select * from test"); +var_dump($db->pgsqlCopyFromArray('test_copy_from',$tableRowsWithDifferentNullValues,";","NULL")); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -59,8 +59,8 @@ $db->rollback(); echo "Testing pgsqlCopyFromArray() with only selected fields\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromArray('test',$tableRowsWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); -$stmt = $db->query("select * from test"); +var_dump($db->pgsqlCopyFromArray('test_copy_from',$tableRowsWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -77,9 +77,9 @@ $db->rollback(); echo "Testing pgsqlCopyFromFile() with default parameters\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromFile('test',$filename)); +var_dump($db->pgsqlCopyFromFile('test_copy_from',$filename)); -$stmt = $db->query("select * from test"); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -87,8 +87,8 @@ $db->rollback(); echo "Testing pgsqlCopyFromFile() with different field separator and not null indicator\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromFile('test',$filenameWithDifferentNullValues,";","NULL")); -$stmt = $db->query("select * from test"); +var_dump($db->pgsqlCopyFromFile('test_copy_from',$filenameWithDifferentNullValues,";","NULL")); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -96,8 +96,8 @@ $db->rollback(); echo "Testing pgsqlCopyFromFile() with only selected fields\n"; $db->beginTransaction(); -var_dump($db->pgsqlCopyFromFile('test',$filenameWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); -$stmt = $db->query("select * from test"); +var_dump($db->pgsqlCopyFromFile('test_copy_from',$filenameWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); +$stmt = $db->query("select * from test_copy_from"); foreach($stmt as $r) { var_dump($r); } @@ -115,7 +115,7 @@ $db->rollback(); echo "Testing pgsqlCopyFromFile() with non existing file\n"; $db->beginTransaction(); try { - var_dump($db->pgsqlCopyFromFile('test',"nonexisting/foo.csv",";","NULL",'a,c')); + var_dump($db->pgsqlCopyFromFile('test_copy_from',"nonexisting/foo.csv",";","NULL",'a,c')); } catch (Exception $e) { echo "Exception: {$e->getMessage()}\n"; } @@ -126,6 +126,12 @@ foreach (array($filename, $filenameWithDifferentNullValues, $filenameWithDiffere @unlink($f); } ?> +--CLEAN-- +query('DROP TABLE IF EXISTS test_copy_from CASCADE'); +?> --EXPECTF-- Preparing test file and array for CopyFrom tests Testing pgsqlCopyFromArray() with default parameters diff --git a/ext/pdo_pgsql/tests/copy_to.phpt b/ext/pdo_pgsql/tests/copy_to.phpt index 979aca586a5e..add5cdd3a08e 100644 --- a/ext/pdo_pgsql/tests/copy_to.phpt +++ b/ext/pdo_pgsql/tests/copy_to.phpt @@ -16,12 +16,12 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -$db->exec('CREATE TABLE test (a integer not null primary key, b text, c integer)'); +$db->exec('CREATE TABLE test_copy_to (a integer not null primary key, b text, c integer)'); $db->beginTransaction(); echo "Preparing test table for CopyTo tests\n"; -$stmt = $db->prepare("INSERT INTO test (a, b, c) values (?, ?, ?)"); +$stmt = $db->prepare("INSERT INTO test_copy_to (a, b, c) values (?, ?, ?)"); for($i=0;$i<3;$i++) { $firstParameter = $i; @@ -36,11 +36,11 @@ for($i=0;$i<3;$i++) { $db->commit(); echo "Testing pgsqlCopyToArray() with default parameters\n"; -var_dump($db->pgsqlCopyToArray('test')); +var_dump($db->pgsqlCopyToArray('test_copy_to')); echo "Testing pgsqlCopyToArray() with different field separator and not null indicator\n"; -var_dump($db->pgsqlCopyToArray('test',";","NULL")); +var_dump($db->pgsqlCopyToArray('test_copy_to',";","NULL")); echo "Testing pgsqlCopyToArray() with only selected fields\n"; -var_dump($db->pgsqlCopyToArray('test',";","NULL",'a,c')); +var_dump($db->pgsqlCopyToArray('test_copy_to',";","NULL",'a,c')); echo "Testing pgsqlCopyToArray() with error\n"; try { @@ -52,13 +52,13 @@ try { echo "Testing pgsqlCopyToFile() with default parameters\n"; $filename="test_pgsqlCopyToFile.csv"; -var_dump($db->pgsqlCopyToFile('test',$filename)); +var_dump($db->pgsqlCopyToFile('test_copy_to',$filename)); echo file_get_contents($filename); echo "Testing pgsqlCopyToFile() with different field separator and not null indicator\n"; -var_dump($db->pgsqlCopyToFile('test',$filename,";","NULL")); +var_dump($db->pgsqlCopyToFile('test_copy_to',$filename,";","NULL")); echo file_get_contents($filename); echo "Testing pgsqlCopyToFile() with only selected fields\n"; -var_dump($db->pgsqlCopyToFile('test',$filename,";","NULL",'a,c')); +var_dump($db->pgsqlCopyToFile('test_copy_to',$filename,";","NULL",'a,c')); echo file_get_contents($filename); echo "Testing pgsqlCopyToFile() with error\n"; @@ -70,7 +70,7 @@ try { echo "Testing pgsqlCopyToFile() to unwritable file\n"; try { - var_dump($db->pgsqlCopyToFile('test', 'nonexistent/foo.csv')); + var_dump($db->pgsqlCopyToFile('test_copy_to', 'nonexistent/foo.csv')); } catch (Exception $e) { echo "Exception: {$e->getMessage()}\n"; } @@ -79,6 +79,12 @@ if(isset($filename)) { @unlink($filename); } ?> +--CLEAN-- +exec('DROP TABLE test_copy_to'); +?> --EXPECTF-- Preparing test table for CopyTo tests Testing pgsqlCopyToArray() with default parameters diff --git a/ext/pdo_pgsql/tests/is_in_transaction.phpt b/ext/pdo_pgsql/tests/is_in_transaction.phpt index f243223e4529..8ff61ff1c8ea 100644 --- a/ext/pdo_pgsql/tests/is_in_transaction.phpt +++ b/ext/pdo_pgsql/tests/is_in_transaction.phpt @@ -16,14 +16,14 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -$db->exec('CREATE TABLE test (a integer not null primary key, b text)'); +$db->exec('CREATE TABLE test_is_in_transaction (a integer not null primary key, b text)'); $db->beginTransaction(); try { echo "Test PDO::PGSQL_TRANSACTION_INTRANS\n"; var_dump($db->inTransaction()); -$stmt = $db->prepare("INSERT INTO test (a, b) values (?, ?)"); +$stmt = $db->prepare("INSERT INTO test_is_in_transaction (a, b) values (?, ?)"); $stmt->bindValue(1, 1); $stmt->bindValue(2, "test insert"); $stmt->execute(); @@ -36,7 +36,7 @@ var_dump($db->inTransaction()); $db->beginTransaction(); try { -$stmt = $db->prepare("INSERT INTO test (a, b) values (?, ?)"); +$stmt = $db->prepare("INSERT INTO test_is_in_transaction (a, b) values (?, ?)"); $stmt->bindValue(1, "error"); $stmt->bindValue(2, "test insert"); $stmt->execute(); @@ -55,7 +55,12 @@ var_dump($db->inTransaction()); echo "Exception! at line ", $e->getLine(), "\n"; var_dump($e->getMessage()); } - +?> +--CLEAN-- +exec('DROP TABLE test_is_in_transaction'); ?> --EXPECT-- Test PDO::PGSQL_TRANSACTION_INTRANS diff --git a/ext/pdo_pgsql/tests/large_objects.phpt b/ext/pdo_pgsql/tests/large_objects.phpt index b475285c5f5b..401f53da8c07 100644 --- a/ext/pdo_pgsql/tests/large_objects.phpt +++ b/ext/pdo_pgsql/tests/large_objects.phpt @@ -16,7 +16,7 @@ $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -$db->exec('CREATE TABLE test (blobid integer not null primary key, bloboid OID)'); +$db->exec('CREATE TABLE test_large_objects (blobid integer not null primary key, bloboid OID)'); $db->beginTransaction(); $oid = $db->pgsqlLOBCreate(); @@ -24,7 +24,7 @@ try { $stm = $db->pgsqlLOBOpen($oid, 'w+b'); fwrite($stm, "Hello dude\n"); -$stmt = $db->prepare("INSERT INTO test (blobid, bloboid) values (?, ?)"); +$stmt = $db->prepare("INSERT INTO test_large_objects (blobid, bloboid) values (?, ?)"); $stmt->bindValue(1, 1); /* bind as LOB; the oid from the pgsql stream will be inserted instead * of the stream contents. Binding other streams will attempt to bind @@ -35,7 +35,7 @@ $stmt->execute(); $stm = null; /* Pull it out */ -$stmt = $db->prepare("SELECT * from test"); +$stmt = $db->prepare("SELECT * from test_large_objects"); $stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB); $stmt->execute(); echo "Fetching:\n"; @@ -46,7 +46,7 @@ while (($row = $stmt->fetch(PDO::FETCH_ASSOC))) { echo "Fetched!\n"; /* Try again, with late bind */ -$stmt = $db->prepare("SELECT * from test"); +$stmt = $db->prepare("SELECT * from test_large_objects"); $stmt->execute(); $stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB); echo "Fetching late bind:\n"; @@ -57,7 +57,7 @@ while (($row = $stmt->fetch(PDO::FETCH_ASSOC))) { echo "Fetched!\n"; /* Try again, with NO bind */ -$stmt = $db->prepare("SELECT * from test"); +$stmt = $db->prepare("SELECT * from test_large_objects"); $stmt->execute(); $stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB); echo "Fetching NO bind:\n"; @@ -77,7 +77,12 @@ echo "Fetched!\n"; /* Now to remove the large object from the database, so it doesn't * linger and clutter up the storage */ $db->pgsqlLOBUnlink($oid); - +?> +--CLEAN-- +exec('DROP TABLE test_large_objects'); ?> --EXPECT-- Fetching: diff --git a/ext/pdo_sqlite/tests/bug33841.phpt b/ext/pdo_sqlite/tests/bug33841.phpt index cacdb9910ca7..6f8cec57947f 100644 --- a/ext/pdo_sqlite/tests/bug33841.phpt +++ b/ext/pdo_sqlite/tests/bug33841.phpt @@ -7,18 +7,24 @@ pdo_sqlite require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); -$db->exec('CREATE TABLE test (text)'); +$db->exec('CREATE TABLE test_33841 (text)'); -$stmt = $db->prepare("INSERT INTO test VALUES ( :text )"); +$stmt = $db->prepare("INSERT INTO test_33841 VALUES ( :text )"); $stmt->bindParam(':text', $name); $name = 'test1'; var_dump($stmt->execute(), $stmt->rowCount()); -$stmt = $db->prepare("UPDATE test SET text = :text "); +$stmt = $db->prepare("UPDATE test_33841 SET text = :text "); $stmt->bindParam(':text', $name); $name = 'test2'; var_dump($stmt->execute(), $stmt->rowCount()); ?> +--CLEAN-- +exec('DROP TABLE IF EXISTS test_33841'); +?> --EXPECT-- bool(true) int(1) diff --git a/ext/pdo_sqlite/tests/bug35336.phpt b/ext/pdo_sqlite/tests/bug35336.phpt index 33bd6691dace..fb0495056325 100644 --- a/ext/pdo_sqlite/tests/bug35336.phpt +++ b/ext/pdo_sqlite/tests/bug35336.phpt @@ -11,10 +11,10 @@ class EEE { } $a = new PDO("sqlite::memory:");// pool ("sqlite::memory:"); -$a->query ("CREATE TABLE test (a integer primary key, b text)"); -$b = $a->prepare("insert into test (b) values (?)"); +$a->query ("CREATE TABLE test_35336 (a integer primary key, b text)"); +$b = $a->prepare("insert into test_35336 (b) values (?)"); $b->execute(array (5)); -$rez = $a->query ("SELECT * FROM test")->fetchAll(PDO::FETCH_CLASS, 'EEE'); +$rez = $a->query ("SELECT * FROM test_35336")->fetchAll(PDO::FETCH_CLASS, 'EEE'); echo "Done\n"; ?> diff --git a/ext/pdo_sqlite/tests/bug38334.phpt b/ext/pdo_sqlite/tests/bug38334.phpt index 92670f34c46e..b4e9a378d717 100644 --- a/ext/pdo_sqlite/tests/bug38334.phpt +++ b/ext/pdo_sqlite/tests/bug38334.phpt @@ -6,13 +6,13 @@ pdo_sqlite exec('CREATE TABLE test (i INTEGER , f DOUBLE, s VARCHAR(255))'); -$db->exec('INSERT INTO test VALUES (42, 46.7, "test")'); -var_dump($db->query('SELECT * FROM test')->fetch(PDO::FETCH_ASSOC)); +$db->exec('CREATE TABLE test_38334 (i INTEGER , f DOUBLE, s VARCHAR(255))'); +$db->exec('INSERT INTO test_38334 VALUES (42, 46.7, "test")'); +var_dump($db->query('SELECT * FROM test_38334')->fetch(PDO::FETCH_ASSOC)); // Check handling of integers larger than 32-bit. -$db->exec('INSERT INTO test VALUES (10000000000, 0.0, "")'); -$i = $db->query('SELECT i FROM test WHERE f = 0.0')->fetchColumn(0); +$db->exec('INSERT INTO test_38334 VALUES (10000000000, 0.0, "")'); +$i = $db->query('SELECT i FROM test_38334 WHERE f = 0.0')->fetchColumn(0); if (PHP_INT_SIZE >= 8) { var_dump($i === 10000000000); } else { @@ -20,8 +20,8 @@ if (PHP_INT_SIZE >= 8) { } // Check storing of strings into integer/float columns. -$db->exec('INSERT INTO test VALUES ("test", "test", "x")'); -var_dump($db->query('SELECT * FROM test WHERE s = "x"')->fetch(PDO::FETCH_ASSOC)); +$db->exec('INSERT INTO test_38334 VALUES ("test", "test", "x")'); +var_dump($db->query('SELECT * FROM test_38334 WHERE s = "x"')->fetch(PDO::FETCH_ASSOC)); ?> --EXPECT-- diff --git a/ext/pdo_sqlite/tests/bug70862.phpt b/ext/pdo_sqlite/tests/bug70862.phpt index 5becca7c7591..802f16ed58de 100644 --- a/ext/pdo_sqlite/tests/bug70862.phpt +++ b/ext/pdo_sqlite/tests/bug70862.phpt @@ -8,7 +8,7 @@ pdo_sqlite $db = new PDO('sqlite::memory:'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -$db->exec('CREATE TABLE test(field BLOB)'); +$db->exec('CREATE TABLE test_70862(field BLOB)'); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); @@ -24,7 +24,7 @@ stream_wrapper_register("hello", "HelloWrapper"); $f = fopen("hello://there", "r"); -$stmt = $db->prepare('INSERT INTO test(field) VALUES (:para)'); +$stmt = $db->prepare('INSERT INTO test_70862(field) VALUES (:para)'); $stmt->bindParam(":para", $f, PDO::PARAM_LOB); $stmt->execute(); diff --git a/ext/pdo_sqlite/tests/bug_42589.phpt b/ext/pdo_sqlite/tests/bug_42589.phpt index 45c1fa0a221c..46ded8d027a6 100644 --- a/ext/pdo_sqlite/tests/bug_42589.phpt +++ b/ext/pdo_sqlite/tests/bug_42589.phpt @@ -14,15 +14,15 @@ if(!in_array('ENABLE_COLUMN_METADATA', $options, true)) exec('CREATE TABLE test (field1 VARCHAR(10))'); -$db->exec('INSERT INTO test VALUES("test")'); +$db->exec('CREATE TABLE test_42589 (field1 VARCHAR(10))'); +$db->exec('INSERT INTO test_42589 VALUES("test")'); -$result = $db->query('SELECT * FROM test t1 LEFT JOIN test t2 ON t1.field1 = t2.field1'); +$result = $db->query('SELECT * FROM test_42589 t1 LEFT JOIN test_42589 t2 ON t1.field1 = t2.field1'); $meta1 = $result->getColumnMeta(0); $meta2 = $result->getColumnMeta(1); -var_dump(!empty($meta1['table']) && $meta1['table'] == 'test'); -var_dump(!empty($meta2['table']) && $meta2['table'] == 'test'); +var_dump(!empty($meta1['table']) && $meta1['table'] == 'test_42589'); +var_dump(!empty($meta2['table']) && $meta2['table'] == 'test_42589'); ?> --EXPECT-- bool(true) diff --git a/ext/pdo_sqlite/tests/pdo_035.phpt b/ext/pdo_sqlite/tests/pdo_035.phpt index ec723842f03b..3541b64ae9eb 100644 --- a/ext/pdo_sqlite/tests/pdo_035.phpt +++ b/ext/pdo_sqlite/tests/pdo_035.phpt @@ -5,10 +5,10 @@ pdo_sqlite --FILE-- exec('CREATE TABLE test (id int)'); -$db->exec('INSERT INTO test VALUES (23)'); +$db->exec('CREATE TABLE test_pdo_035 (id int)'); +$db->exec('INSERT INTO test_pdo_035 VALUES (23)'); -$stmt = $db->prepare('SELECT id FROM test'); +$stmt = $db->prepare('SELECT id FROM test_pdo_035'); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_LAZY); diff --git a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt index 5a5b728a5e62..e3373df8ac3b 100644 --- a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt +++ b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt @@ -8,46 +8,46 @@ pdo_sqlite $db = new PDO('sqlite::memory:'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); -$db->exec('CREATE TABLE testing (id INTEGER , name VARCHAR)'); -$db->exec('INSERT INTO testing VALUES(1, "php")'); -$db->exec('INSERT INTO testing VALUES(2, "")'); +$db->exec('CREATE TABLE test_fetch_func_001 (id INTEGER , name VARCHAR)'); +$db->exec('INSERT INTO test_fetch_func_001 VALUES(1, "php")'); +$db->exec('INSERT INTO test_fetch_func_001 VALUES(2, "")'); -$st = $db->query('SELECT * FROM testing'); +$st = $db->query('SELECT * FROM test_fetch_func_001'); $st->fetchAll(PDO::FETCH_FUNC, function($x, $y) use ($st) { var_dump($st); print "data: $x, $y\n"; }); -$st = $db->query('SELECT name FROM testing'); +$st = $db->query('SELECT name FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, 'strtoupper')); try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, 'nothing')); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, '')); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, NULL)); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, 1)); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('self', 'foo'))); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; @@ -60,7 +60,7 @@ class foo { } class bar extends foo { public function __construct($db) { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array($this, 'parent::method'))); } @@ -79,25 +79,25 @@ class bar extends foo { new bar($db); -$st = $db->query('SELECT * FROM testing'); +$st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test'))); try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test2'))); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test3'))); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; } try { - $st = $db->query('SELECT * FROM testing'); + $st = $db->query('SELECT * FROM test_fetch_func_001'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'inexistent'))); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; @@ -107,12 +107,12 @@ try { --EXPECTF-- object(PDOStatement)#%d (1) { ["queryString"]=> - string(21) "SELECT * FROM testing" + string(33) "SELECT * FROM test_fetch_func_001" } data: 1, php object(PDOStatement)#%d (1) { ["queryString"]=> - string(21) "SELECT * FROM testing" + string(33) "SELECT * FROM test_fetch_func_001" } data: 2, array(2) { diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_empty_filename.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_empty_filename.phpt index 8e474feabd30..ab56477939cc 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_empty_filename.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_empty_filename.phpt @@ -8,12 +8,12 @@ pdo_sqlite // create with empty filename $db = new PDO('sqlite:'); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_empty_filename (id INT);')); // create with empty URI $db = new PDO('sqlite:file:?cache=shared'); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_empty_filename (id INT);')); ?> --EXPECT-- int(0) diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_filename_uri.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_filename_uri.phpt index b972be27cfbf..97c1b30f8996 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_filename_uri.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_filename_uri.phpt @@ -8,26 +8,26 @@ pdo_sqlite // create with in-memory database using shared cached $db = new PDO('sqlite:file::memory:?cache=shared'); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_filename_uri (id INT);')); // create second connection to in-memory database $db = new PDO('sqlite:file::memory:?cache=shared'); -var_dump($db->exec('SELECT * from test1')); +var_dump($db->exec('SELECT * from test_sqlite_filename_uri')); // create with default read-write|create mode $filename = "file:" . __DIR__ . DIRECTORY_SEPARATOR . "pdo_sqlite_filename_uri.db"; $db = new PDO('sqlite:' . $filename); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_filename_uri (id INT);')); // create with readonly mode $filename = "file:" . __DIR__ . DIRECTORY_SEPARATOR . "pdo_sqlite_filename_uri.db?mode=ro"; $db = new PDO('sqlite:' . $filename); -var_dump($db->exec('CREATE TABLE test2 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_filename_uri_2 (id INT);')); ?> --CLEAN-- diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_open_basedir.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_open_basedir.phpt index 425d2190234b..906a41c0e580 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_open_basedir.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_open_basedir.phpt @@ -12,7 +12,7 @@ $filename = 'pdo_sqlite_filename.db'; $db = new PDO('sqlite:' . $filename); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_open_basedir (id INT);')); // create outside basedir $filename = '..' . DIRECTORY_SEPARATOR . 'pdo_sqlite_filename.db'; diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt index abec53796b62..772b1d9a76b0 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt @@ -10,11 +10,11 @@ $filename = __DIR__ . DIRECTORY_SEPARATOR . "pdo_sqlite_open_flags.db"; // Default open flag is read-write|create $db = new PDO('sqlite:' . $filename, null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); -var_dump($db->exec('CREATE TABLE test1 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_open_flags (id INT);')); $db = new PDO('sqlite:' . $filename, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); -var_dump($db->exec('CREATE TABLE test2 (id INT);')); +var_dump($db->exec('CREATE TABLE test_sqlite_open_flags_2 (id INT);')); ?> --CLEAN-- prepare('SELECT 1;'); var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT)); -$st = $db->prepare('CREATE TABLE test (a TEXT);'); +$st = $db->prepare('CREATE TABLE test_sqlite_stmt_getattribute (a TEXT);'); var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT)); ?> diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index a6cdd590aa59..31f15cbe6aca 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1693,7 +1693,7 @@ PHP_FUNCTION(pg_fetch_result) { zval *result; zend_string *field_name; - zend_long row, field_offset; + zend_long row, field_offset = 0; bool row_is_null = false; PGresult *pgsql_result; pgsql_result_handle *pg_result; @@ -2004,7 +2004,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type, bo { zval *result; zend_string *field_name; - zend_long row, field_offset; + zend_long row, field_offset = 0; bool row_is_null = false; PGresult *pgsql_result; pgsql_result_handle *pg_result; diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index d7fda32de042..ab6986c8ef2b 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -89,26 +89,28 @@ static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend */ static ssize_t phar_dir_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { - size_t to_read; HashTable *data = (HashTable *)stream->abstract; zend_string *str_key; zend_ulong unused; + if (count != sizeof(php_stream_dirent)) { + return -1; + } + if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(data, &str_key, &unused)) { return 0; } zend_hash_move_forward(data); - to_read = MIN(ZSTR_LEN(str_key), count); - if (to_read == 0 || count < ZSTR_LEN(str_key)) { + php_stream_dirent *dirent = (php_stream_dirent *) buf; + + if (sizeof(dirent->d_name) <= ZSTR_LEN(str_key)) { return 0; } - memset(buf, 0, sizeof(php_stream_dirent)); - memcpy(((php_stream_dirent *) buf)->d_name, ZSTR_VAL(str_key), to_read); - ((php_stream_dirent *) buf)->d_name[to_read + 1] = '\0'; - ((php_stream_dirent *) buf)->d_type = DT_UNKNOWN; + memset(dirent, 0, sizeof(php_stream_dirent)); + PHP_STRLCPY(dirent->d_name, ZSTR_VAL(str_key), sizeof(dirent->d_name), ZSTR_LEN(str_key)); return sizeof(php_stream_dirent); } diff --git a/ext/phar/tests/GHSA-jqcx-ccgc-xwhv.phpt b/ext/phar/tests/GHSA-jqcx-ccgc-xwhv.phpt new file mode 100644 index 000000000000..4e12f05fb62f --- /dev/null +++ b/ext/phar/tests/GHSA-jqcx-ccgc-xwhv.phpt @@ -0,0 +1,27 @@ +--TEST-- +GHSA-jqcx-ccgc-xwhv (Buffer overflow and overread in phar_dir_read()) +--SKIPIF-- + +--INI-- +phar.readonly=0 +--FILE-- +startBuffering(); +$phar->addFromString(str_repeat('A', PHP_MAXPATHLEN - 1), 'This is the content of file 1.'); +$phar->addFromString(str_repeat('B', PHP_MAXPATHLEN - 1).'C', 'This is the content of file 2.'); +$phar->stopBuffering(); + +$handle = opendir('phar://' . __DIR__ . '/GHSA-jqcx-ccgc-xwhv.phar'); +var_dump(strlen(readdir($handle))); +// Must not be a string of length PHP_MAXPATHLEN+1 +var_dump(readdir($handle)); +closedir($handle); +?> +--CLEAN-- + +--EXPECTF-- +int(%d) +bool(false) diff --git a/ext/phar/tests/cache_list/frontcontroller1.phpt b/ext/phar/tests/cache_list/frontcontroller1.phpt index e912362205d5..fc8ec38f127b 100644 --- a/ext/phar/tests/cache_list/frontcontroller1.phpt +++ b/ext/phar/tests/cache_list/frontcontroller1.phpt @@ -4,6 +4,10 @@ Phar front controller other phar.cache_list={PWD}/frontcontroller1.php [cache_list] --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller1.php REQUEST_URI=/frontcontroller1.php/a.jpg diff --git a/ext/phar/tests/cache_list/frontcontroller21.phpt b/ext/phar/tests/cache_list/frontcontroller21.phpt index c86e8a741e6f..5b212747fb75 100644 --- a/ext/phar/tests/cache_list/frontcontroller21.phpt +++ b/ext/phar/tests/cache_list/frontcontroller21.phpt @@ -6,6 +6,10 @@ phar.cache_list={PWD}/frontcontroller21.php cgi.fix_pathinfo=1 --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller21.php REQUEST_URI=/frontcontroller21.php/index.php?test=hi diff --git a/ext/phar/tests/cache_list/frontcontroller22.phpt b/ext/phar/tests/cache_list/frontcontroller22.phpt index 520ecb3c4afa..6747da6dc795 100644 --- a/ext/phar/tests/cache_list/frontcontroller22.phpt +++ b/ext/phar/tests/cache_list/frontcontroller22.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller22.phpt --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller22.php REQUEST_URI=/frontcontroller22.php/index.php diff --git a/ext/phar/tests/cache_list/frontcontroller23.phpt b/ext/phar/tests/cache_list/frontcontroller23.phpt index 5a6ce18f403c..85f78a49800d 100644 --- a/ext/phar/tests/cache_list/frontcontroller23.phpt +++ b/ext/phar/tests/cache_list/frontcontroller23.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller23.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller23.php REQUEST_URI=/frontcontroller23.php/hi/there diff --git a/ext/phar/tests/cache_list/frontcontroller31.phpt b/ext/phar/tests/cache_list/frontcontroller31.phpt index 106ad17db756..9feed05344ee 100644 --- a/ext/phar/tests/cache_list/frontcontroller31.phpt +++ b/ext/phar/tests/cache_list/frontcontroller31.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller31.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller31.php REQUEST_URI=/frontcontroller31.php diff --git a/ext/phar/tests/cache_list/frontcontroller32.phpt b/ext/phar/tests/cache_list/frontcontroller32.phpt index 6db3573041df..a61c91e1be29 100644 --- a/ext/phar/tests/cache_list/frontcontroller32.phpt +++ b/ext/phar/tests/cache_list/frontcontroller32.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller32.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller32.php REQUEST_URI=/frontcontroller32.php diff --git a/ext/phar/tests/cache_list/frontcontroller33.phpt b/ext/phar/tests/cache_list/frontcontroller33.phpt index 1036fc2c46a8..1b0684bc2fc4 100644 --- a/ext/phar/tests/cache_list/frontcontroller33.phpt +++ b/ext/phar/tests/cache_list/frontcontroller33.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller33.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller33.php REQUEST_URI=/frontcontroller33.php diff --git a/ext/phar/tests/cache_list/frontcontroller34.phpt b/ext/phar/tests/cache_list/frontcontroller34.phpt index b4916f176186..d3c02214b2e5 100644 --- a/ext/phar/tests/cache_list/frontcontroller34.phpt +++ b/ext/phar/tests/cache_list/frontcontroller34.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller34.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller34.php REQUEST_URI=/frontcontroller34.php/start/index.php diff --git a/ext/phar/tests/phar_buildfromiterator10.phpt b/ext/phar/tests/phar_buildfromiterator10.phpt index 3a57e7808ae7..495f177fabb2 100644 --- a/ext/phar/tests/phar_buildfromiterator10.phpt +++ b/ext/phar/tests/phar_buildfromiterator10.phpt @@ -2,6 +2,8 @@ Phar::buildFromIterator() RegexIterator(RecursiveIteratorIterator), SplFileInfo as current --EXTENSIONS-- phar +--CONFLICTS-- +all --INI-- phar.require_hash=0 phar.readonly=0 diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 6996474e49e1..052be0c5cc7f 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1819,7 +1819,6 @@ static zend_result cast_object(zval *object, int type, char *contents) convert_scalar_to_number(object); break; default: - zval_ptr_dtor_nogc(object); return FAILURE; } return SUCCESS; @@ -2256,7 +2255,9 @@ PHP_FUNCTION(simplexml_load_file) RETURN_THROWS(); } + PHP_LIBXML_SANITIZE_GLOBALS(read_file); docp = xmlReadFile(filename, NULL, (int)options); + PHP_LIBXML_RESTORE_GLOBALS(read_file); if (!docp) { RETURN_FALSE; @@ -2309,7 +2310,9 @@ PHP_FUNCTION(simplexml_load_string) RETURN_THROWS(); } + PHP_LIBXML_SANITIZE_GLOBALS(read_memory); docp = xmlReadMemory(data, (int)data_len, NULL, NULL, (int)options); + PHP_LIBXML_RESTORE_GLOBALS(read_memory); if (!docp) { RETURN_FALSE; @@ -2358,7 +2361,9 @@ PHP_METHOD(SimpleXMLElement, __construct) RETURN_THROWS(); } + PHP_LIBXML_SANITIZE_GLOBALS(read_file_or_memory); docp = is_url ? xmlReadFile(data, NULL, (int)options) : xmlReadMemory(data, (int)data_len, NULL, NULL, (int)options); + PHP_LIBXML_RESTORE_GLOBALS(read_file_or_memory); if (!docp) { ((php_libxml_node_object *)sxe)->document = NULL; diff --git a/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt new file mode 100644 index 000000000000..54f9d4941eb7 --- /dev/null +++ b/ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt @@ -0,0 +1,37 @@ +--TEST-- +GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass) +--SKIPIF-- + +--FILE-- + %bork;]>"; + +libxml_use_internal_errors(true); +zend_test_override_libxml_global_state(); + +echo "--- String test ---\n"; +simplexml_load_string($xml); +echo "--- Constructor test ---\n"; +new SimpleXMLElement($xml); +echo "--- File test ---\n"; +file_put_contents("libxml_global_state_entity_loader_bypass.tmp", $xml); +simplexml_load_file("libxml_global_state_entity_loader_bypass.tmp"); + +echo "Done\n"; + +?> +--CLEAN-- + +--EXPECT-- +--- String test --- +--- Constructor test --- +--- File test --- +Done diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index a847059cd40e..3ff7aa055fd3 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -91,6 +91,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename) if (ctxt) { bool old; + php_libxml_sanitize_parse_ctxt_options(ctxt); ctxt->keepBlanks = 0; ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; @@ -139,6 +140,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) if (ctxt) { bool old; + php_libxml_sanitize_parse_ctxt_options(ctxt); ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; diff --git a/ext/standard/array.c b/ext/standard/array.c index 235bdf79d5a4..eee260f22431 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4513,10 +4513,10 @@ PHP_FUNCTION(array_column) HashTable *input; zval *colval, *data, rv; zend_string *column_str = NULL; - zend_long column_long; + zend_long column_long = 0; bool column_is_null = 0; zend_string *index_str = NULL; - zend_long index_long; + zend_long index_long = 0; bool index_is_null = 1; ZEND_PARSE_PARAMETERS_START(2, 3) diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index 602ce3eeb6e2..d9a4a00d9cae 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -68,6 +68,8 @@ static inline int has_crc32_insn(void) { # if!defined(__clang__) # pragma GCC push_options # pragma GCC target ("+nothing+crc") +# elif defined(__APPLE__) +# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function) # else # pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function) # endif @@ -96,6 +98,8 @@ static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) { # if defined(__GNUC__) # if !defined(__clang__) # pragma GCC pop_options +# elif defined(__APPLE__) +# pragma clang attribute pop # else # pragma clang attribute pop # endif diff --git a/ext/standard/file.c b/ext/standard/file.c index f6076438f69d..5e835239a8cc 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -704,7 +704,7 @@ PHP_FUNCTION(tempnam) ZEND_PARSE_PARAMETERS_END(); p = php_basename(prefix, prefix_len, NULL, 0); - if (ZSTR_LEN(p) > 64) { + if (ZSTR_LEN(p) >= 64) { ZSTR_VAL(p)[63] = '\0'; } diff --git a/ext/standard/password.c b/ext/standard/password.c index af1b68af1082..c3f7f7382183 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -589,9 +589,9 @@ PHP_FUNCTION(password_needs_rehash) const php_password_algo *old_algo, *new_algo; zend_string *hash; zend_string *new_algo_str; - zend_long new_algo_long; + zend_long new_algo_long = 0; bool new_algo_is_null; - zend_array *options = 0; + zend_array *options = NULL; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(hash) @@ -637,7 +637,7 @@ PHP_FUNCTION(password_hash) { zend_string *password, *digest = NULL; zend_string *algo_str; - zend_long algo_long; + zend_long algo_long = 0; bool algo_is_null; const php_password_algo *algo; zend_array *options = NULL; diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index 49ac237f1ab6..c0369eef17ee 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #22414 (passthru() does not read data correctly) +--SKIPIF-- + --INI-- output_handler= --FILE-- diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 1a61d67c33dd..b28ea11d4ecd 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -44,25 +44,25 @@ zend_leak_variable(do_stuff("php://memory")); echo "\nDone.\n"; ?> ---EXPECTF-- -temp stream (close after): +--EXPECTREGEX-- +temp stream \(close after\): About to rewind! -* Couldn't open file /i_dont_exist/ -* Closing connection%A%d +(\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ +\* Closing connection( -?\d+)? -memory stream (close after): +memory stream \(close after\): About to rewind! -* Couldn't open file /i_dont_exist/ -* Closing connection%A%d +(\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ +\* Closing connection( -?\d+)? -temp stream (leak): +temp stream \(leak\): About to rewind! -* Couldn't open file /i_dont_exist/ -* Closing connection%A%d +(\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ +\* Closing connection( -?\d+)? -memory stream (leak): +memory stream \(leak\): About to rewind! -* Couldn't open file /i_dont_exist/ -* Closing connection%A%d +(\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ +\* Closing connection( -?\d+)? -Done. +Done\. diff --git a/ext/standard/tests/file/tempnam_variation9.phpt b/ext/standard/tests/file/tempnam_variation9.phpt new file mode 100644 index 000000000000..22f3ea109bf2 --- /dev/null +++ b/ext/standard/tests/file/tempnam_variation9.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test tempnam() function: usage variations - test prefix maximum size +--SKIPIF-- + +--FILE-- +$prefix) { + echo "-- Iteration $i --\n"; + try { + $file_name = tempnam("$file_path", $prefix); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + continue; + } + + $base_name = basename($file_name); + echo "File name is => ", $base_name, "\n"; + echo "File name length is => ", strlen($base_name), "\n"; + + if (file_exists($file_name)) { + unlink($file_name); + } +} +rmdir($file_path); + +?> +--CLEAN-- + +--EXPECTF-- +*** Testing tempnam() maximum prefix size *** +-- Iteration 0 -- +File name is => begin_%rx{7}%r_end%r.{6}%r +File name length is => 23 +-- Iteration 1 -- +File name is => begin_%rx{53}%r_end%r.{6}%r +File name length is => 69 +-- Iteration 2 -- +File name is => begin_%rx{54}%r_en%r.{6}%r +File name length is => 69 +-- Iteration 3 -- +File name is => begin_%rx{55}%r_e%r.{6}%r +File name length is => 69 +-- Iteration 4 -- +File name is => begin_%rx{57}%r%r.{6}%r +File name length is => 69 diff --git a/ext/xml/compat.c b/ext/xml/compat.c index d3b3f0bf3457..5c41e7d2f5dc 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -17,6 +17,7 @@ #include "php.h" #if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) #include "expat_compat.h" +#include "ext/libxml/php_libxml.h" typedef struct _php_xml_ns { xmlNsPtr nsptr; @@ -469,6 +470,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m return NULL; } + php_libxml_sanitize_parse_ctxt_options(parser->parser); xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX); parser->parser->replaceEntities = 1; diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index b10a849e59ae..137c12f7151a 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -283,6 +283,7 @@ static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, siz return NULL; } + PHP_LIBXML_SANITIZE_GLOBALS(parse); if (error_func || warn_func) { xmlRelaxNGSetParserErrors(parser, (xmlRelaxNGValidityErrorFunc) error_func, @@ -291,6 +292,7 @@ static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, siz } sptr = xmlRelaxNGParse(parser); xmlRelaxNGFreeParserCtxt(parser); + PHP_LIBXML_RESTORE_GLOBALS(parse); return sptr; } @@ -865,7 +867,9 @@ PHP_METHOD(XMLReader, open) valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN ); if (valid_file) { + PHP_LIBXML_SANITIZE_GLOBALS(reader_for_file); reader = xmlReaderForFile(valid_file, encoding, options); + PHP_LIBXML_RESTORE_GLOBALS(reader_for_file); } if (reader == NULL) { @@ -937,8 +941,10 @@ PHP_METHOD(XMLReader, setSchema) id = ZEND_THIS; intern = Z_XMLREADER_P(id); - if (intern->ptr) { + if (intern && intern->ptr) { + PHP_LIBXML_SANITIZE_GLOBALS(schema); retval = xmlTextReaderSchemaValidate(intern->ptr, source); + PHP_LIBXML_RESTORE_GLOBALS(schema); if (retval == 0) { RETURN_TRUE; @@ -1059,6 +1065,7 @@ PHP_METHOD(XMLReader, XML) } uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path); } + PHP_LIBXML_SANITIZE_GLOBALS(text_reader); reader = xmlNewTextReader(inputbfr, uri); if (reader != NULL) { @@ -1077,9 +1084,11 @@ PHP_METHOD(XMLReader, XML) xmlFree(uri); } + PHP_LIBXML_RESTORE_GLOBALS(text_reader); return; } } + PHP_LIBXML_RESTORE_GLOBALS(text_reader); } if (uri) { diff --git a/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt b/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt new file mode 100644 index 000000000000..cb0297b6b1bc --- /dev/null +++ b/ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt @@ -0,0 +1,36 @@ +--TEST-- +GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass) +--SKIPIF-- + +--FILE-- + %bork;]>"; + +libxml_use_internal_errors(true); +zend_test_override_libxml_global_state(); + +echo "--- String test ---\n"; +$reader = XMLReader::xml($xml); +$reader->read(); +echo "--- File test ---\n"; +file_put_contents("libxml_global_state_entity_loader_bypass.tmp", $xml); +$reader = XMLReader::open("libxml_global_state_entity_loader_bypass.tmp"); +$reader->read(); + +echo "Done\n"; + +?> +--CLEAN-- + +--EXPECT-- +--- String test --- +--- File test --- +Done diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 5f1482ea31b6..70223458a54b 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -320,7 +320,7 @@ PHP_METHOD(XSLTProcessor, importStylesheet) xmlDoc *doc = NULL, *newdoc = NULL; xsltStylesheetPtr sheetp, oldsheetp; xsl_object *intern; - int prevSubstValue, prevExtDtdValue, clone_docu = 0; + int clone_docu = 0; xmlNode *nodep = NULL; zval *cloneDocu, rv; zend_string *member; @@ -344,13 +344,12 @@ PHP_METHOD(XSLTProcessor, importStylesheet) stylesheet document otherwise the node proxies will be a mess */ newdoc = xmlCopyDoc(doc, 1); xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL); - prevSubstValue = xmlSubstituteEntitiesDefault(1); - prevExtDtdValue = xmlLoadExtDtdDefaultValue; + PHP_LIBXML_SANITIZE_GLOBALS(parse); + xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; sheetp = xsltParseStylesheetDoc(newdoc); - xmlSubstituteEntitiesDefault(prevSubstValue); - xmlLoadExtDtdDefaultValue = prevExtDtdValue; + PHP_LIBXML_RESTORE_GLOBALS(parse); if (!sheetp) { xmlFreeDoc(newdoc); diff --git a/ext/zend_test/config.m4 b/ext/zend_test/config.m4 index c33ad74f0c8a..916104b61270 100644 --- a/ext/zend_test/config.m4 +++ b/ext/zend_test/config.m4 @@ -4,5 +4,5 @@ PHP_ARG_ENABLE([zend-test], [Enable zend_test extension])]) if test "$PHP_ZEND_TEST" != "no"; then - PHP_NEW_EXTENSION(zend_test, test.c observer.c fiber.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) + PHP_NEW_EXTENSION(zend_test, test.c observer.c fiber.c object_handlers.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) fi diff --git a/ext/zend_test/config.w32 b/ext/zend_test/config.w32 index a44a7fc3d9d8..5a9700181ba7 100644 --- a/ext/zend_test/config.w32 +++ b/ext/zend_test/config.w32 @@ -3,6 +3,6 @@ ARG_ENABLE("zend-test", "enable zend_test extension", "no"); if (PHP_ZEND_TEST != "no") { - EXTENSION("zend_test", "test.c observer.c fiber.c", PHP_ZEND_TEST_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + EXTENSION("zend_test", "test.c observer.c fiber.c object_handlers.c", PHP_ZEND_TEST_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_FLAG("CFLAGS_ZEND_TEST", "/D PHP_ZEND_TEST_EXPORTS "); } diff --git a/ext/zend_test/object_handlers.c b/ext/zend_test/object_handlers.c new file mode 100644 index 000000000000..b590c3488c1b --- /dev/null +++ b/ext/zend_test/object_handlers.c @@ -0,0 +1,258 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: George Peter Banyard | + +----------------------------------------------------------------------+ +*/ + +#include "object_handlers.h" +#include "zend_API.h" +#include "object_handlers_arginfo.h" + +/* donc refers to DoOperationNoCast */ +static zend_class_entry *donc_ce; +static zend_object_handlers donc_object_handlers; + +static zend_object* donc_object_create_ex(zend_class_entry* ce, zend_long l) { + zend_object *obj = zend_objects_new(ce); + object_properties_init(obj, ce); + obj->handlers = &donc_object_handlers; + ZVAL_LONG(OBJ_PROP_NUM(obj, 0), l); + return obj; +} +static zend_object *donc_object_create(zend_class_entry *ce) /* {{{ */ +{ + return donc_object_create_ex(ce, 0); +} +/* }}} */ + +static inline void donc_create(zval *target, zend_long l) /* {{{ */ +{ + ZVAL_OBJ(target, donc_object_create_ex(donc_ce, l)); +} + +#define IS_DONC(zval) \ + (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), donc_ce)) + +static void donc_add(zval *result, zval *op1, zval *op2) +{ + zend_long val_1; + zend_long val_2; + if (IS_DONC(op1)) { + val_1 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op1), 0)); + } else { + val_1 = zval_get_long(op1); + } + if (IS_DONC(op2)) { + val_2 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op2), 0)); + } else { + val_2 = zval_get_long(op2); + } + + donc_create(result, val_1 + val_2); +} +static void donc_mul(zval *result, zval *op1, zval *op2) +{ + zend_long val_1; + zend_long val_2; + if (IS_DONC(op1)) { + val_1 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op1), 0)); + } else { + val_1 = zval_get_long(op1); + } + if (IS_DONC(op2)) { + val_2 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op2), 0)); + } else { + val_2 = zval_get_long(op2); + } + + donc_create(result, val_1 * val_2); +} + +static zend_result donc_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) +{ + zval op1_copy; + zend_result status; + + if (result == op1) { + ZVAL_COPY_VALUE(&op1_copy, op1); + op1 = &op1_copy; + } + + switch (opcode) { + case ZEND_ADD: + donc_add(result, op1, op2); + if (UNEXPECTED(EG(exception))) { status = FAILURE; } + status = SUCCESS; + break; + case ZEND_MUL: + donc_mul(result, op1, op2); + if (UNEXPECTED(EG(exception))) { status = FAILURE; } + status = SUCCESS; + break; + default: + status = FAILURE; + break; + } + + if (status == SUCCESS && op1 == &op1_copy) { + zval_ptr_dtor(op1); + } + + return status; +} + +ZEND_METHOD(DoOperationNoCast, __construct) +{ + zend_long l; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_LONG(l) + ZEND_PARSE_PARAMETERS_END(); + + ZVAL_LONG(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), l); +} + +static zend_class_entry *long_castable_no_operation_ce; +static zend_object_handlers long_castable_no_operation_object_handlers; + +static zend_object* long_castable_no_operation_object_create_ex(zend_class_entry* ce, zend_long l) { + zend_object *obj = zend_objects_new(ce); + object_properties_init(obj, ce); + obj->handlers = &long_castable_no_operation_object_handlers; + ZVAL_LONG(OBJ_PROP_NUM(obj, 0), l); + return obj; +} + +static zend_object *long_castable_no_operation_object_create(zend_class_entry *ce) +{ + return long_castable_no_operation_object_create_ex(ce, 0); +} + +static zend_result long_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) +{ + if (type == IS_LONG) { + ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); + return SUCCESS; + } + return FAILURE; +} + +ZEND_METHOD(LongCastableNoOperations, __construct) +{ + zend_long l; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_LONG(l) + ZEND_PARSE_PARAMETERS_END(); + + ZVAL_LONG(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), l); +} + +static zend_class_entry *float_castable_no_operation_ce; +static zend_object_handlers float_castable_no_operation_object_handlers; + +static zend_object* float_castable_no_operation_object_create_ex(zend_class_entry* ce, double d) { + zend_object *obj = zend_objects_new(ce); + object_properties_init(obj, ce); + obj->handlers = &float_castable_no_operation_object_handlers; + ZVAL_DOUBLE(OBJ_PROP_NUM(obj, 0), d); + return obj; +} + +static zend_object *float_castable_no_operation_object_create(zend_class_entry *ce) +{ + return float_castable_no_operation_object_create_ex(ce, 0.0); +} + +static zend_result float_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) +{ + if (type == IS_DOUBLE) { + ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); + return SUCCESS; + } + return FAILURE; +} + +ZEND_METHOD(FloatCastableNoOperations, __construct) +{ + double d; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_DOUBLE(d) + ZEND_PARSE_PARAMETERS_END(); + + ZVAL_DOUBLE(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), d); +} + +static zend_class_entry *numeric_castable_no_operation_ce; +static zend_object_handlers numeric_castable_no_operation_object_handlers; + +static zend_object* numeric_castable_no_operation_object_create_ex(zend_class_entry* ce, const zval *n) { + zend_object *obj = zend_objects_new(ce); + object_properties_init(obj, ce); + obj->handlers = &numeric_castable_no_operation_object_handlers; + ZVAL_COPY(OBJ_PROP_NUM(obj, 0), n); + return obj; +} + +static zend_object *numeric_castable_no_operation_object_create(zend_class_entry *ce) +{ + zval tmp; + ZVAL_LONG(&tmp, 0); + return numeric_castable_no_operation_object_create_ex(ce, &tmp); +} + +static zend_result numeric_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) +{ + if (type == _IS_NUMBER) { + ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); + return SUCCESS; + } + return FAILURE; +} + +ZEND_METHOD(NumericCastableNoOperations, __construct) +{ + zval *n; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_NUMBER(n) + ZEND_PARSE_PARAMETERS_END(); + + ZVAL_COPY(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), n); +} + +void zend_test_object_handlers_init(void) +{ + /* DoOperationNoCast class */ + donc_ce = register_class_DoOperationNoCast(); + donc_ce->create_object = donc_object_create; + memcpy(&donc_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + donc_object_handlers.do_operation = donc_do_operation; + + /* CastableNoOperation classes */ + long_castable_no_operation_ce = register_class_LongCastableNoOperations(); + long_castable_no_operation_ce->create_object = long_castable_no_operation_object_create; + memcpy(&long_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + long_castable_no_operation_object_handlers.cast_object = long_castable_no_operation_cast_object; + + float_castable_no_operation_ce = register_class_FloatCastableNoOperations(); + float_castable_no_operation_ce->create_object = float_castable_no_operation_object_create; + memcpy(&float_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + float_castable_no_operation_object_handlers.cast_object = float_castable_no_operation_cast_object; + + numeric_castable_no_operation_ce = register_class_NumericCastableNoOperations(); + numeric_castable_no_operation_ce->create_object = numeric_castable_no_operation_object_create; + memcpy(&numeric_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + numeric_castable_no_operation_object_handlers.cast_object = numeric_castable_no_operation_cast_object; +} diff --git a/ext/zend_test/object_handlers.h b/ext/zend_test/object_handlers.h new file mode 100644 index 000000000000..528e047360f9 --- /dev/null +++ b/ext/zend_test/object_handlers.h @@ -0,0 +1,22 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: George Peter Banyard | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_TEST_OBJECT_HANDLERS_H +#define ZEND_TEST_OBJECT_HANDLERS_H + +void zend_test_object_handlers_init(void); + +#endif diff --git a/ext/zend_test/object_handlers.stub.php b/ext/zend_test/object_handlers.stub.php new file mode 100644 index 000000000000..81830532689e --- /dev/null +++ b/ext/zend_test/object_handlers.stub.php @@ -0,0 +1,24 @@ +ce_flags |= ZEND_ACC_FINAL; + + zval property_val_default_value; + ZVAL_UNDEF(&property_val_default_value); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_val_name); + + return class_entry; +} + +static zend_class_entry *register_class_LongCastableNoOperations(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "LongCastableNoOperations", class_LongCastableNoOperations_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zval property_val_default_value; + ZVAL_UNDEF(&property_val_default_value); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_val_name); + + return class_entry; +} + +static zend_class_entry *register_class_FloatCastableNoOperations(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "FloatCastableNoOperations", class_FloatCastableNoOperations_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zval property_val_default_value; + ZVAL_UNDEF(&property_val_default_value); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_DOUBLE)); + zend_string_release(property_val_name); + + return class_entry; +} + +static zend_class_entry *register_class_NumericCastableNoOperations(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "NumericCastableNoOperations", class_NumericCastableNoOperations_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zval property_val_default_value; + ZVAL_UNDEF(&property_val_default_value); + zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); + zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_DOUBLE)); + zend_string_release(property_val_name); + + return class_entry; +} diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index cf6005ea083f..b4ea2b27c9e9 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -24,6 +24,7 @@ #include "php_test.h" #include "observer.h" #include "fiber.h" +#include "object_handlers.h" #include "zend_attributes.h" #include "zend_enum.h" #include "zend_interfaces.h" @@ -33,6 +34,11 @@ #include "zend_call_stack.h" #include "zend_exceptions.h" +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) +# include +# include +#endif + ZEND_DECLARE_MODULE_GLOBALS(zend_test) static zend_class_entry *zend_test_interface; @@ -353,6 +359,20 @@ static ZEND_FUNCTION(zend_get_current_func_name) RETURN_STR(function_name); } +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) +static ZEND_FUNCTION(zend_test_override_libxml_global_state) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + xmlLoadExtDtdDefaultValue = 1; + xmlDoValidityCheckingDefaultValue = 1; + (void) xmlPedanticParserDefault(1); + (void) xmlSubstituteEntitiesDefault(1); + (void) xmlLineNumbersDefault(1); + (void) xmlKeepBlanksDefault(0); +} +#endif + /* TESTS Z_PARAM_ITERABLE and Z_PARAM_ITERABLE_OR_NULL */ static ZEND_FUNCTION(zend_iterable) { @@ -841,220 +861,6 @@ static ZEND_METHOD(ZendTestForbidDynamicCall, callStatic) zend_forbid_dynamic_call(); } -/* donc refers to DoOperationNoCast */ -static zend_class_entry *donc_ce; -static zend_object_handlers donc_object_handlers; - -static zend_object* donc_object_create_ex(zend_class_entry* ce, zend_long l) { - zend_object *obj = zend_objects_new(ce); - object_properties_init(obj, ce); - obj->handlers = &donc_object_handlers; - ZVAL_LONG(OBJ_PROP_NUM(obj, 0), l); - return obj; -} -static zend_object *donc_object_create(zend_class_entry *ce) /* {{{ */ -{ - return donc_object_create_ex(ce, 0); -} -/* }}} */ - -static inline void donc_create(zval *target, zend_long l) /* {{{ */ -{ - ZVAL_OBJ(target, donc_object_create_ex(donc_ce, l)); -} - -#define IS_DONC(zval) \ - (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), donc_ce)) - -static void donc_add(zval *result, zval *op1, zval *op2) -{ - zend_long val_1; - zend_long val_2; - if (IS_DONC(op1)) { - val_1 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op1), 0)); - } else { - val_1 = zval_get_long(op1); - } - if (IS_DONC(op2)) { - val_2 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op2), 0)); - } else { - val_2 = zval_get_long(op2); - } - - donc_create(result, val_1 + val_2); -} -static void donc_mul(zval *result, zval *op1, zval *op2) -{ - zend_long val_1; - zend_long val_2; - if (IS_DONC(op1)) { - val_1 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op1), 0)); - } else { - val_1 = zval_get_long(op1); - } - if (IS_DONC(op2)) { - val_2 = Z_LVAL_P(OBJ_PROP_NUM(Z_OBJ_P(op2), 0)); - } else { - val_2 = zval_get_long(op2); - } - - donc_create(result, val_1 * val_2); -} - -static zend_result donc_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) -{ - zval op1_copy; - zend_result status; - - if (result == op1) { - ZVAL_COPY_VALUE(&op1_copy, op1); - op1 = &op1_copy; - } - - switch (opcode) { - case ZEND_ADD: - donc_add(result, op1, op2); - if (UNEXPECTED(EG(exception))) { status = FAILURE; } - status = SUCCESS; - break; - case ZEND_MUL: - donc_mul(result, op1, op2); - if (UNEXPECTED(EG(exception))) { status = FAILURE; } - status = SUCCESS; - break; - default: - status = FAILURE; - break; - } - - if (status == SUCCESS && op1 == &op1_copy) { - zval_ptr_dtor(op1); - } - - return status; -} - -PHP_METHOD(DoOperationNoCast, __construct) -{ - zend_long l; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(l) - ZEND_PARSE_PARAMETERS_END(); - - ZVAL_LONG(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), l); -} - -static zend_class_entry *long_castable_no_operation_ce; -static zend_object_handlers long_castable_no_operation_object_handlers; - -static zend_object* long_castable_no_operation_object_create_ex(zend_class_entry* ce, zend_long l) { - zend_object *obj = zend_objects_new(ce); - object_properties_init(obj, ce); - obj->handlers = &long_castable_no_operation_object_handlers; - ZVAL_LONG(OBJ_PROP_NUM(obj, 0), l); - return obj; -} - -static zend_object *long_castable_no_operation_object_create(zend_class_entry *ce) -{ - return long_castable_no_operation_object_create_ex(ce, 0); -} - -static zend_result long_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) -{ - if (type == IS_LONG) { - ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); - return SUCCESS; - } - return FAILURE; -} - -PHP_METHOD(LongCastableNoOperations, __construct) -{ - zend_long l; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(l) - ZEND_PARSE_PARAMETERS_END(); - - ZVAL_LONG(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), l); -} - -static zend_class_entry *float_castable_no_operation_ce; -static zend_object_handlers float_castable_no_operation_object_handlers; - -static zend_object* float_castable_no_operation_object_create_ex(zend_class_entry* ce, double d) { - zend_object *obj = zend_objects_new(ce); - object_properties_init(obj, ce); - obj->handlers = &float_castable_no_operation_object_handlers; - ZVAL_DOUBLE(OBJ_PROP_NUM(obj, 0), d); - return obj; -} - -static zend_object *float_castable_no_operation_object_create(zend_class_entry *ce) -{ - return float_castable_no_operation_object_create_ex(ce, 0.0); -} - -static zend_result float_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) -{ - if (type == IS_DOUBLE) { - ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); - return SUCCESS; - } - return FAILURE; -} - -PHP_METHOD(FloatCastableNoOperations, __construct) -{ - double d; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_DOUBLE(d) - ZEND_PARSE_PARAMETERS_END(); - - ZVAL_DOUBLE(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), d); -} - -static zend_class_entry *numeric_castable_no_operation_ce; -static zend_object_handlers numeric_castable_no_operation_object_handlers; - -static zend_object* numeric_castable_no_operation_object_create_ex(zend_class_entry* ce, const zval *n) { - zend_object *obj = zend_objects_new(ce); - object_properties_init(obj, ce); - obj->handlers = &numeric_castable_no_operation_object_handlers; - ZVAL_COPY(OBJ_PROP_NUM(obj, 0), n); - return obj; -} - -static zend_object *numeric_castable_no_operation_object_create(zend_class_entry *ce) -{ - zval tmp; - ZVAL_LONG(&tmp, 0); - return numeric_castable_no_operation_object_create_ex(ce, &tmp); -} - -static zend_result numeric_castable_no_operation_cast_object(zend_object *obj, zval *result, int type) -{ - if (type == _IS_NUMBER) { - ZVAL_COPY(result, OBJ_PROP_NUM(obj, 0)); - return SUCCESS; - } - return FAILURE; -} - -PHP_METHOD(NumericCastableNoOperations, __construct) -{ - zval *n; - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_NUMBER(n) - ZEND_PARSE_PARAMETERS_END(); - - ZVAL_COPY(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), n); -} - PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("zend_test.replace_zend_execute_ex", "0", PHP_INI_SYSTEM, OnUpdateBool, replace_zend_execute_ex, zend_zend_test_globals, zend_test_globals) STD_PHP_INI_BOOLEAN("zend_test.register_passes", "0", PHP_INI_SYSTEM, OnUpdateBool, register_passes, zend_zend_test_globals, zend_test_globals) @@ -1121,28 +927,6 @@ PHP_MINIT_FUNCTION(zend_test) zend_test_string_enum = register_class_ZendTestStringEnum(); zend_test_int_enum = register_class_ZendTestIntEnum(); - /* DoOperationNoCast class */ - donc_ce = register_class_DoOperationNoCast(); - donc_ce->create_object = donc_object_create; - memcpy(&donc_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - donc_object_handlers.do_operation = donc_do_operation; - - /* CastableNoOperation classes */ - long_castable_no_operation_ce = register_class_LongCastableNoOperations(); - long_castable_no_operation_ce->create_object = long_castable_no_operation_object_create; - memcpy(&long_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - long_castable_no_operation_object_handlers.cast_object = long_castable_no_operation_cast_object; - - float_castable_no_operation_ce = register_class_FloatCastableNoOperations(); - float_castable_no_operation_ce->create_object = float_castable_no_operation_object_create; - memcpy(&float_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - float_castable_no_operation_object_handlers.cast_object = float_castable_no_operation_cast_object; - - numeric_castable_no_operation_ce = register_class_NumericCastableNoOperations(); - numeric_castable_no_operation_ce->create_object = numeric_castable_no_operation_object_create; - memcpy(&numeric_castable_no_operation_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); - numeric_castable_no_operation_object_handlers.cast_object = numeric_castable_no_operation_cast_object; - zend_register_functions(NULL, ext_function_legacy, NULL, EG(current_module)->type); // Loading via dl() not supported with the observer API @@ -1164,6 +948,7 @@ PHP_MINIT_FUNCTION(zend_test) zend_test_observer_init(INIT_FUNC_ARGS_PASSTHRU); zend_test_fiber_init(); + zend_test_object_handlers_init(); le_throwing_resource = zend_register_list_destructors_ex(le_throwing_resource_dtor, NULL, "throwing resource", module_number); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index 6da31580d06d..e3905a99c72e 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -127,24 +127,6 @@ enum ZendTestIntEnum: int { case Baz = -1; } - final class DoOperationNoCast { - private int $val; - public function __construct(int $val) {} - } - - final class LongCastableNoOperations { - private int $val; - public function __construct(int $val) {} - } - final class FloatCastableNoOperations { - private float $val; - public function __construct(float $val) {} - } - final class NumericCastableNoOperations { - private int|float $val; - public function __construct(int|float $val) {} - } - function zend_test_array_return(): array {} function zend_test_nullable_array_return(): null|array {} @@ -226,6 +208,10 @@ function zend_test_fill_packed_array(array &$array): void {} function zend_test_create_throwing_resource() {} function get_open_basedir(): ?string {} + +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) +function zend_test_override_libxml_global_state(): void {} +#endif } namespace ZendTestNS { diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 575044bd2b4a..3a6a92798472 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 129cbff2439b78d38435088d97607fe9ed679b13 */ + * Stub hash: abd7a656256f9cf05466f09efcc78ef4c4c9f62b */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -136,6 +136,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_open_basedir, 0, 0, IS_STRING, 1) ZEND_END_ARG_INFO() +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_override_libxml_global_state, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ZendTestNS2_namespaced_func, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -188,20 +193,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ZendTestForbidDynamicCall_callStatic arginfo_zend_test_void_return -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DoOperationNoCast___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, val, IS_LONG, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_LongCastableNoOperations___construct arginfo_class_DoOperationNoCast___construct - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_FloatCastableNoOperations___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, val, IS_DOUBLE, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumericCastableNoOperations___construct, 0, 0, 1) - ZEND_ARG_TYPE_MASK(0, val, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) -ZEND_END_ARG_INFO() - #if (PHP_VERSION_ID >= 80100) ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZendTestNS_Foo_method, 0, 0, IS_LONG, 0) #else @@ -255,6 +246,9 @@ static ZEND_FUNCTION(zend_test_crash); static ZEND_FUNCTION(zend_test_fill_packed_array); static ZEND_FUNCTION(zend_test_create_throwing_resource); static ZEND_FUNCTION(get_open_basedir); +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) +static ZEND_FUNCTION(zend_test_override_libxml_global_state); +#endif static ZEND_FUNCTION(ZendTestNS2_namespaced_func); static ZEND_FUNCTION(ZendTestNS2_namespaced_deprecated_func); static ZEND_FUNCTION(ZendTestNS2_ZendSubNS_namespaced_func); @@ -273,10 +267,6 @@ static ZEND_METHOD(ZendTestClassWithMethodWithParameterAttribute, override); static ZEND_METHOD(ZendTestChildClassWithMethodWithParameterAttribute, override); static ZEND_METHOD(ZendTestForbidDynamicCall, call); static ZEND_METHOD(ZendTestForbidDynamicCall, callStatic); -static ZEND_METHOD(DoOperationNoCast, __construct); -static ZEND_METHOD(LongCastableNoOperations, __construct); -static ZEND_METHOD(FloatCastableNoOperations, __construct); -static ZEND_METHOD(NumericCastableNoOperations, __construct); static ZEND_METHOD(ZendTestNS_Foo, method); static ZEND_METHOD(ZendTestNS_UnlikelyCompileError, method); static ZEND_METHOD(ZendTestNS2_Foo, method); @@ -324,6 +314,9 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_test_fill_packed_array, arginfo_zend_test_fill_packed_array) ZEND_FE(zend_test_create_throwing_resource, arginfo_zend_test_create_throwing_resource) ZEND_FE(get_open_basedir, arginfo_get_open_basedir) +#if defined(HAVE_LIBXML) && !defined(PHP_WIN32) + ZEND_FE(zend_test_override_libxml_global_state, arginfo_zend_test_override_libxml_global_state) +#endif ZEND_NS_FALIAS("ZendTestNS2", namespaced_func, ZendTestNS2_namespaced_func, arginfo_ZendTestNS2_namespaced_func) ZEND_NS_DEP_FALIAS("ZendTestNS2", namespaced_deprecated_func, ZendTestNS2_namespaced_deprecated_func, arginfo_ZendTestNS2_namespaced_deprecated_func) ZEND_NS_FALIAS("ZendTestNS2", namespaced_aliased_func, zend_test_void_return, arginfo_ZendTestNS2_namespaced_aliased_func) @@ -415,30 +408,6 @@ static const zend_function_entry class_ZendTestIntEnum_methods[] = { }; -static const zend_function_entry class_DoOperationNoCast_methods[] = { - ZEND_ME(DoOperationNoCast, __construct, arginfo_class_DoOperationNoCast___construct, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - - -static const zend_function_entry class_LongCastableNoOperations_methods[] = { - ZEND_ME(LongCastableNoOperations, __construct, arginfo_class_LongCastableNoOperations___construct, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - - -static const zend_function_entry class_FloatCastableNoOperations_methods[] = { - ZEND_ME(FloatCastableNoOperations, __construct, arginfo_class_FloatCastableNoOperations___construct, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - - -static const zend_function_entry class_NumericCastableNoOperations_methods[] = { - ZEND_ME(NumericCastableNoOperations, __construct, arginfo_class_NumericCastableNoOperations___construct, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - - static const zend_function_entry class_ZendTestNS_Foo_methods[] = { ZEND_ME(ZendTestNS_Foo, method, arginfo_class_ZendTestNS_Foo_method, ZEND_ACC_PUBLIC) ZEND_FE_END @@ -811,74 +780,6 @@ static zend_class_entry *register_class_ZendTestIntEnum(void) } #endif -static zend_class_entry *register_class_DoOperationNoCast(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "DoOperationNoCast", class_DoOperationNoCast_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; - - zval property_val_default_value; - ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); - zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_val_name); - - return class_entry; -} - -static zend_class_entry *register_class_LongCastableNoOperations(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "LongCastableNoOperations", class_LongCastableNoOperations_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; - - zval property_val_default_value; - ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); - zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); - zend_string_release(property_val_name); - - return class_entry; -} - -static zend_class_entry *register_class_FloatCastableNoOperations(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "FloatCastableNoOperations", class_FloatCastableNoOperations_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; - - zval property_val_default_value; - ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); - zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_DOUBLE)); - zend_string_release(property_val_name); - - return class_entry; -} - -static zend_class_entry *register_class_NumericCastableNoOperations(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "NumericCastableNoOperations", class_NumericCastableNoOperations_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; - - zval property_val_default_value; - ZVAL_UNDEF(&property_val_default_value); - zend_string *property_val_name = zend_string_init("val", sizeof("val") - 1, 1); - zend_declare_typed_property(class_entry, property_val_name, &property_val_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG|MAY_BE_DOUBLE)); - zend_string_release(property_val_name); - - return class_entry; -} - static zend_class_entry *register_class_ZendTestNS_Foo(void) { zend_class_entry ce, *class_entry; diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index f7c7a739d366..f57006363917 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -31,6 +31,11 @@ extern zend_module_entry zip_module_entry; #define ZIP_OVERWRITE ZIP_TRUNCATE #endif +/* since 1.10.1 */ +#ifndef ZIP_LENGTH_TO_END +#define ZIP_LENGTH_TO_END 0 +#endif + /* Additionnal flags not from libzip */ #define ZIP_FL_OPEN_FILE_NOW (1u<<30) diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index b8807a4d56c5..bdd236faaa1a 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -67,659 +67,563 @@ function zip_entry_compressionmethod($zip_entry): string|false {} class ZipArchive implements Countable { /** - * @var int * @cvalue ZIP_CREATE */ - public const CREATE = UNKNOWN; + public const int CREATE = UNKNOWN; /** - * @var int * @cvalue ZIP_EXCL */ - public const EXCL = UNKNOWN; + public const int EXCL = UNKNOWN; /** - * @var int * @cvalue ZIP_CHECKCONS */ - public const CHECKCONS = UNKNOWN; + public const int CHECKCONS = UNKNOWN; /** - * @var int * @cvalue ZIP_OVERWRITE */ - public const OVERWRITE = UNKNOWN; + public const int OVERWRITE = UNKNOWN; #ifdef ZIP_RDONLY /** - * @var int * @cvalue ZIP_RDONLY */ - public const RDONLY = UNKNOWN; + public const int RDONLY = UNKNOWN; #endif /** - * @var int * @cvalue ZIP_FL_NOCASE */ - public const FL_NOCASE = UNKNOWN; + public const int FL_NOCASE = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_NODIR */ - public const FL_NODIR = UNKNOWN; + public const int FL_NODIR = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_COMPRESSED */ - public const FL_COMPRESSED = UNKNOWN; + public const int FL_COMPRESSED = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_UNCHANGED */ - public const FL_UNCHANGED = UNKNOWN; + public const int FL_UNCHANGED = UNKNOWN; /* deprecated in libzip 1.10.0 */ #ifdef ZIP_FL_RECOMPRESS /** - * @var int * @cvalue ZIP_FL_RECOMPRESS * @deprecated */ - public const FL_RECOMPRESS = UNKNOWN; + public const int FL_RECOMPRESS = UNKNOWN; #endif /** - * @var int * @cvalue ZIP_FL_ENCRYPTED */ - public const FL_ENCRYPTED = UNKNOWN; + public const int FL_ENCRYPTED = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_OVERWRITE */ - public const FL_OVERWRITE = UNKNOWN; + public const int FL_OVERWRITE = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_LOCAL */ - public const FL_LOCAL = UNKNOWN; + public const int FL_LOCAL = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_CENTRAL */ - public const FL_CENTRAL = UNKNOWN; + public const int FL_CENTRAL = UNKNOWN; /* Default filename encoding policy. */ /** - * @var int * @cvalue ZIP_FL_ENC_GUESS */ - public const FL_ENC_GUESS = UNKNOWN; + public const int FL_ENC_GUESS = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_ENC_RAW */ - public const FL_ENC_RAW = UNKNOWN; + public const int FL_ENC_RAW = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_ENC_STRICT */ - public const FL_ENC_STRICT = UNKNOWN; + public const int FL_ENC_STRICT = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_ENC_UTF_8 */ - public const FL_ENC_UTF_8 = UNKNOWN; + public const int FL_ENC_UTF_8 = UNKNOWN; /** - * @var int * @cvalue ZIP_FL_ENC_CP437 */ - public const FL_ENC_CP437 = UNKNOWN; + public const int FL_ENC_CP437 = UNKNOWN; /** * Additionnal flags not from libzip - * @var int * @cvalue ZIP_FL_OPEN_FILE_NOW */ - public const FL_OPEN_FILE_NOW = UNKNOWN; + public const int FL_OPEN_FILE_NOW = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_DEFAULT */ - public const CM_DEFAULT = UNKNOWN; + public const int CM_DEFAULT = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_STORE */ - public const CM_STORE = UNKNOWN; + public const int CM_STORE = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_SHRINK */ - public const CM_SHRINK = UNKNOWN; + public const int CM_SHRINK = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_REDUCE_1 */ - public const CM_REDUCE_1 = UNKNOWN; + public const int CM_REDUCE_1 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_REDUCE_2 */ - public const CM_REDUCE_2 = UNKNOWN; + public const int CM_REDUCE_2 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_REDUCE_3 */ - public const CM_REDUCE_3 = UNKNOWN; + public const int CM_REDUCE_3 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_REDUCE_4 */ - public const CM_REDUCE_4 = UNKNOWN; + public const int CM_REDUCE_4 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_IMPLODE */ - public const CM_IMPLODE = UNKNOWN; + public const int CM_IMPLODE = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_DEFLATE */ - public const CM_DEFLATE = UNKNOWN; + public const int CM_DEFLATE = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_DEFLATE64 */ - public const CM_DEFLATE64 = UNKNOWN; + public const int CM_DEFLATE64 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_PKWARE_IMPLODE */ - public const CM_PKWARE_IMPLODE = UNKNOWN; + public const int CM_PKWARE_IMPLODE = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_BZIP2 */ - public const CM_BZIP2 = UNKNOWN; + public const int CM_BZIP2 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_LZMA */ - public const CM_LZMA = UNKNOWN; + public const int CM_LZMA = UNKNOWN; #ifdef ZIP_CM_LZMA2 /** - * @var int * @cvalue ZIP_CM_LZMA2 */ - public const CM_LZMA2 = UNKNOWN; + public const int CM_LZMA2 = UNKNOWN; #endif #ifdef ZIP_CM_ZSTD /** - * @var int * @cvalue ZIP_CM_ZSTD */ - public const CM_ZSTD = UNKNOWN; + public const int CM_ZSTD = UNKNOWN; #endif #ifdef ZIP_CM_XZ /** - * @var int * @cvalue ZIP_CM_XZ */ - public const CM_XZ = UNKNOWN; + public const int CM_XZ = UNKNOWN; #endif /** - * @var int * @cvalue ZIP_CM_TERSE */ - public const CM_TERSE = UNKNOWN; + public const int CM_TERSE = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_LZ77 */ - public const CM_LZ77 = UNKNOWN; + public const int CM_LZ77 = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_WAVPACK */ - public const CM_WAVPACK = UNKNOWN; + public const int CM_WAVPACK = UNKNOWN; /** - * @var int * @cvalue ZIP_CM_PPMD */ - public const CM_PPMD = UNKNOWN; + public const int CM_PPMD = UNKNOWN; /* Error code */ /** * N No error - * @var int * @cvalue ZIP_ER_OK */ - public const ER_OK = UNKNOWN; + public const int ER_OK = UNKNOWN; /** * N Multi-disk zip archives not supported - * @var int * @cvalue ZIP_ER_MULTIDISK */ - public const ER_MULTIDISK = UNKNOWN; + public const int ER_MULTIDISK = UNKNOWN; /** * S Renaming temporary file failed - * @var int * @cvalue ZIP_ER_RENAME */ - public const ER_RENAME = UNKNOWN; + public const int ER_RENAME = UNKNOWN; /** * S Closing zip archive failed - * @var int * @cvalue ZIP_ER_CLOSE */ - public const ER_CLOSE = UNKNOWN; + public const int ER_CLOSE = UNKNOWN; /** * S Seek error - * @var int * @cvalue ZIP_ER_SEEK */ - public const ER_SEEK = UNKNOWN; + public const int ER_SEEK = UNKNOWN; /** * S Read error - * @var int * @cvalue ZIP_ER_READ */ - public const ER_READ = UNKNOWN; + public const int ER_READ = UNKNOWN; /** * S Write error - * @var int * @cvalue ZIP_ER_WRITE */ - public const ER_WRITE = UNKNOWN; + public const int ER_WRITE = UNKNOWN; /** * N CRC error - * @var int * @cvalue ZIP_ER_CRC */ - public const ER_CRC = UNKNOWN; + public const int ER_CRC = UNKNOWN; /** * N Containing zip archive was closed - * @var int * @cvalue ZIP_ER_ZIPCLOSED */ - public const ER_ZIPCLOSED = UNKNOWN; + public const int ER_ZIPCLOSED = UNKNOWN; /** * N No such file - * @var int * @cvalue ZIP_ER_NOENT */ - public const ER_NOENT = UNKNOWN; + public const int ER_NOENT = UNKNOWN; /** * N File already exists - * @var int * @cvalue ZIP_ER_EXISTS */ - public const ER_EXISTS = UNKNOWN; + public const int ER_EXISTS = UNKNOWN; /** * S Can't open file - * @var int * @cvalue ZIP_ER_OPEN */ - public const ER_OPEN = UNKNOWN; + public const int ER_OPEN = UNKNOWN; /** * S Failure to create temporary file - * @var int * @cvalue ZIP_ER_TMPOPEN */ - public const ER_TMPOPEN = UNKNOWN; + public const int ER_TMPOPEN = UNKNOWN; /** * Z Zlib error - * @var int * @cvalue ZIP_ER_ZLIB */ - public const ER_ZLIB = UNKNOWN; + public const int ER_ZLIB = UNKNOWN; /** * N Malloc failure - * @var int * @cvalue ZIP_ER_MEMORY */ - public const ER_MEMORY = UNKNOWN; + public const int ER_MEMORY = UNKNOWN; /** * N Entry has been changed - * @var int * @cvalue ZIP_ER_CHANGED */ - public const ER_CHANGED = UNKNOWN; + public const int ER_CHANGED = UNKNOWN; /** * N Compression method not supported - * @var int * @cvalue ZIP_ER_COMPNOTSUPP */ - public const ER_COMPNOTSUPP = UNKNOWN; + public const int ER_COMPNOTSUPP = UNKNOWN; /** * N Premature EOF - * @var int * @cvalue ZIP_ER_EOF */ - public const ER_EOF = UNKNOWN; + public const int ER_EOF = UNKNOWN; /** * N Invalid argument - * @var int * @cvalue ZIP_ER_INVAL */ - public const ER_INVAL = UNKNOWN; + public const int ER_INVAL = UNKNOWN; /** * N Not a zip archive - * @var int * @cvalue ZIP_ER_NOZIP */ - public const ER_NOZIP = UNKNOWN; + public const int ER_NOZIP = UNKNOWN; /** * N Internal error - * @var int * @cvalue ZIP_ER_INTERNAL */ - public const ER_INTERNAL = UNKNOWN; + public const int ER_INTERNAL = UNKNOWN; /** * N Zip archive inconsistent - * @var int * @cvalue ZIP_ER_INCONS */ - public const ER_INCONS = UNKNOWN; + public const int ER_INCONS = UNKNOWN; /** * S Can't remove file - * @var int * @cvalue ZIP_ER_REMOVE */ - public const ER_REMOVE = UNKNOWN; + public const int ER_REMOVE = UNKNOWN; /** * N Entry has been deleted - * @var int * @cvalue ZIP_ER_DELETED */ - public const ER_DELETED = UNKNOWN; + public const int ER_DELETED = UNKNOWN; /** * N Encryption method not supported - * @var int * @cvalue ZIP_ER_ENCRNOTSUPP */ - public const ER_ENCRNOTSUPP = UNKNOWN; + public const int ER_ENCRNOTSUPP = UNKNOWN; /** * N Read-only archive - * @var int * @cvalue ZIP_ER_RDONLY */ - public const ER_RDONLY = UNKNOWN; + public const int ER_RDONLY = UNKNOWN; /** * N Entry has been deleted - * @var int * @cvalue ZIP_ER_NOPASSWD */ - public const ER_NOPASSWD = UNKNOWN; + public const int ER_NOPASSWD = UNKNOWN; /** * N Wrong password provided - * @var int * @cvalue ZIP_ER_WRONGPASSWD */ - public const ER_WRONGPASSWD = UNKNOWN; + public const int ER_WRONGPASSWD = UNKNOWN; /* since 1.0.0 */ - #ifdef ZIP_ER_OPNOTSUPP /** * N Operation not supported - * @var int * @cvalue ZIP_ER_OPNOTSUPP */ - public const ER_OPNOTSUPP = UNKNOWN; + public const int ER_OPNOTSUPP = UNKNOWN; #endif #ifdef ZIP_ER_INUSE /** * N Resource still in use - * @var int * @cvalue ZIP_ER_INUSE */ - public const ER_INUSE = UNKNOWN; + public const int ER_INUSE = UNKNOWN; #endif #ifdef ZIP_ER_TELL /** * S Tell error - * @var int * @cvalue ZIP_ER_TELL */ - public const ER_TELL = UNKNOWN; + public const int ER_TELL = UNKNOWN; #endif /* since 1.6.0 */ #ifdef ZIP_ER_COMPRESSED_DATA /** * N Compressed data invalid - * @var int * @cvalue ZIP_ER_COMPRESSED_DATA */ - public const ER_COMPRESSED_DATA = UNKNOWN; + public const int ER_COMPRESSED_DATA = UNKNOWN; #endif #ifdef ZIP_ER_CANCELLED /** * N Operation cancelled - * @var int * @cvalue ZIP_ER_CANCELLED */ - public const ER_CANCELLED = UNKNOWN; + public const int ER_CANCELLED = UNKNOWN; #endif /* since 1.10.0 */ #ifdef ZIP_ER_DATA_LENGTH /** * N Unexpected length of data - * @var int * @cvalue ZIP_ER_DATA_LENGTH */ - public const ER_DATA_LENGTH = UNKNOWN; + public const int ER_DATA_LENGTH = UNKNOWN; #endif #ifdef ZIP_ER_NOT_ALLOWED /** * Not allowed in torrentzip - * @var int * @cvalue ZIP_ER_NOT_ALLOWED */ - public const ER_NOT_ALLOWED = UNKNOWN; + public const int ER_NOT_ALLOWED = UNKNOWN; #endif #ifdef ZIP_AFL_RDONLY /** * read only -- cannot be cleared - * @var int * @cvalue ZIP_AFL_RDONLY */ - public const AFL_RDONLY = UNKNOWN; + public const int AFL_RDONLY = UNKNOWN; #endif #ifdef ZIP_AFL_IS_TORRENTZIP /** * current archive is torrentzipped - * @var int * @cvalue ZIP_AFL_IS_TORRENTZIP */ - public const AFL_IS_TORRENTZIP = UNKNOWN; + public const int AFL_IS_TORRENTZIP = UNKNOWN; #endif #ifdef ZIP_AFL_WANT_TORRENTZIP /** * write archive in torrentzip format - * @var int * @cvalue ZIP_AFL_WANT_TORRENTZIP */ - public const AFL_WANT_TORRENTZIP = UNKNOWN; + public const int AFL_WANT_TORRENTZIP = UNKNOWN; #endif #ifdef ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE /** * don't remove file if archive is empty - * @var int * @cvalue ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE */ - public const AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE = UNKNOWN; + public const int AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE = UNKNOWN; #endif #ifdef ZIP_OPSYS_DEFAULT /** - * @var int * @cvalue ZIP_OPSYS_DOS * @link ziparchive.constants.opsys */ - public const OPSYS_DOS = UNKNOWN; + public const int OPSYS_DOS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_AMIGA * @link ziparchive.constants.opsys */ - public const OPSYS_AMIGA = UNKNOWN; + public const int OPSYS_AMIGA = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_OPENVMS * @link ziparchive.constants.opsys */ - public const OPSYS_OPENVMS = UNKNOWN; + public const int OPSYS_OPENVMS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_UNIX * @link ziparchive.constants.opsys */ - public const OPSYS_UNIX = UNKNOWN; + public const int OPSYS_UNIX = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_VM_CMS * @link ziparchive.constants.opsys */ - public const OPSYS_VM_CMS = UNKNOWN; + public const int OPSYS_VM_CMS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_ATARI_ST * @link ziparchive.constants.opsys */ - public const OPSYS_ATARI_ST = UNKNOWN; + public const int OPSYS_ATARI_ST = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_OS_2 * @link ziparchive.constants.opsys */ - public const OPSYS_OS_2 = UNKNOWN; + public const int OPSYS_OS_2 = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_MACINTOSH * @link ziparchive.constants.opsys */ - public const OPSYS_MACINTOSH = UNKNOWN; + public const int OPSYS_MACINTOSH = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_Z_SYSTEM * @link ziparchive.constants.opsys */ - public const OPSYS_Z_SYSTEM = UNKNOWN; + public const int OPSYS_Z_SYSTEM = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_CPM * @link ziparchive.constants.opsys */ - public const OPSYS_CPM = UNKNOWN; + public const int OPSYS_CPM = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_WINDOWS_NTFS * @link ziparchive.constants.opsys */ - public const OPSYS_WINDOWS_NTFS = UNKNOWN; + public const int OPSYS_WINDOWS_NTFS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_MVS * @link ziparchive.constants.opsys */ - public const OPSYS_MVS = UNKNOWN; + public const int OPSYS_MVS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_VSE * @link ziparchive.constants.opsys */ - public const OPSYS_VSE = UNKNOWN; + public const int OPSYS_VSE = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_ACORN_RISC * @link ziparchive.constants.opsys */ - public const OPSYS_ACORN_RISC = UNKNOWN; + public const int OPSYS_ACORN_RISC = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_VFAT * @link ziparchive.constants.opsys */ - public const OPSYS_VFAT = UNKNOWN; + public const int OPSYS_VFAT = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_ALTERNATE_MVS * @link ziparchive.constants.opsys */ - public const OPSYS_ALTERNATE_MVS = UNKNOWN; + public const int OPSYS_ALTERNATE_MVS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_BEOS * @link ziparchive.constants.opsys */ - public const OPSYS_BEOS = UNKNOWN; + public const int OPSYS_BEOS = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_TANDEM * @link ziparchive.constants.opsys */ - public const OPSYS_TANDEM = UNKNOWN; + public const int OPSYS_TANDEM = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_OS_400 * @link ziparchive.constants.opsys */ - public const OPSYS_OS_400 = UNKNOWN; + public const int OPSYS_OS_400 = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_OS_X * @link ziparchive.constants.opsys */ - public const OPSYS_OS_X = UNKNOWN; + public const int OPSYS_OS_X = UNKNOWN; /** - * @var int * @cvalue ZIP_OPSYS_DEFAULT * @link ziparchive.constants.opsys */ - public const OPSYS_DEFAULT = UNKNOWN; + public const int OPSYS_DEFAULT = UNKNOWN; #endif /** - * @var int * @cvalue ZIP_EM_NONE */ - public const EM_NONE = UNKNOWN; + public const int EM_NONE = UNKNOWN; /** - * @var int * @cvalue ZIP_EM_TRAD_PKWARE */ - public const EM_TRAD_PKWARE = UNKNOWN; + public const int EM_TRAD_PKWARE = UNKNOWN; #ifdef HAVE_ENCRYPTION /** - * @var int * @cvalue ZIP_EM_AES_128 */ - public const EM_AES_128 = UNKNOWN; + public const int EM_AES_128 = UNKNOWN; /** - * @var int * @cvalue ZIP_EM_AES_192 */ - public const EM_AES_192 = UNKNOWN; + public const int EM_AES_192 = UNKNOWN; /** - * @var int * @cvalue ZIP_EM_AES_256 */ - public const EM_AES_256 = UNKNOWN; + public const int EM_AES_256 = UNKNOWN; #endif /** - * @var int * @cvalue ZIP_EM_UNKNOWN */ - public const EM_UNKNOWN = UNKNOWN; + public const int EM_UNKNOWN = UNKNOWN; /** - * @var string * @cvalue LIBZIP_VERSION_STR */ - public const LIBZIP_VERSION = UNKNOWN; + public const string LIBZIP_VERSION = UNKNOWN; + + /** + * @cvalue ZIP_LENGTH_TO_END + */ + public const int LENGTH_TO_END = UNKNOWN; + /* since 1.10.1 */ +#ifdef ZIP_LENGTH_UNCHECKED + /** + * @cvalue ZIP_LENGTH_UNCHECKED + */ + public const int LENGTH_UNCHECKED = UNKNOWN; +#endif /** @readonly */ public int $lastId; @@ -760,10 +664,10 @@ public function addEmptyDir(string $dirname, int $flags = 0): bool {} public function addFromString(string $name, string $content, int $flags = ZipArchive::FL_OVERWRITE): bool {} /** @tentative-return-type */ - public function addFile(string $filepath, string $entryname = "", int $start = 0, int $length = 0, int $flags = ZipArchive::FL_OVERWRITE): bool {} + public function addFile(string $filepath, string $entryname = "", int $start = 0, int $length = ZipArchive::LENGTH_TO_END, int $flags = ZipArchive::FL_OVERWRITE): bool {} /** @tentative-return-type */ - public function replaceFile(string $filepath, int $index, int $start = 0, int $length = 0, int $flags = 0): bool {} + public function replaceFile(string $filepath, int $index, int $start = 0, int $length = ZipArchive::LENGTH_TO_END, int $flags = 0): bool {} /** @tentative-return-type */ public function addGlob(string $pattern, int $flags = 0, array $options = []): array|false {} diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index e0198435e0fe..c5869c5cc0f1 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: fb9b6fa0a8e3da62a85e13b455573ee876ea2d61 */ + * Stub hash: 95564c667a51a548f5d43025c90546b991970ddd */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -76,7 +76,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_addFi ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, entryname, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "ZipArchive::LENGTH_TO_END") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ZipArchive::FL_OVERWRITE") ZEND_END_ARG_INFO() @@ -84,7 +84,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_repla ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "ZipArchive::LENGTH_TO_END") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -511,210 +511,210 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_CREATE_value; ZVAL_LONG(&const_CREATE_value, ZIP_CREATE); zend_string *const_CREATE_name = zend_string_init_interned("CREATE", sizeof("CREATE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CREATE_name, &const_CREATE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CREATE_name, &const_CREATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CREATE_name); zval const_EXCL_value; ZVAL_LONG(&const_EXCL_value, ZIP_EXCL); zend_string *const_EXCL_name = zend_string_init_interned("EXCL", sizeof("EXCL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EXCL_name, &const_EXCL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EXCL_name, &const_EXCL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EXCL_name); zval const_CHECKCONS_value; ZVAL_LONG(&const_CHECKCONS_value, ZIP_CHECKCONS); zend_string *const_CHECKCONS_name = zend_string_init_interned("CHECKCONS", sizeof("CHECKCONS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CHECKCONS_name, &const_CHECKCONS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CHECKCONS_name, &const_CHECKCONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CHECKCONS_name); zval const_OVERWRITE_value; ZVAL_LONG(&const_OVERWRITE_value, ZIP_OVERWRITE); zend_string *const_OVERWRITE_name = zend_string_init_interned("OVERWRITE", sizeof("OVERWRITE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OVERWRITE_name, &const_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OVERWRITE_name, &const_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OVERWRITE_name); #if defined(ZIP_RDONLY) zval const_RDONLY_value; ZVAL_LONG(&const_RDONLY_value, ZIP_RDONLY); zend_string *const_RDONLY_name = zend_string_init_interned("RDONLY", sizeof("RDONLY") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_RDONLY_name, &const_RDONLY_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_RDONLY_name, &const_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_RDONLY_name); #endif zval const_FL_NOCASE_value; ZVAL_LONG(&const_FL_NOCASE_value, ZIP_FL_NOCASE); zend_string *const_FL_NOCASE_name = zend_string_init_interned("FL_NOCASE", sizeof("FL_NOCASE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_NOCASE_name, &const_FL_NOCASE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_NOCASE_name, &const_FL_NOCASE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_NOCASE_name); zval const_FL_NODIR_value; ZVAL_LONG(&const_FL_NODIR_value, ZIP_FL_NODIR); zend_string *const_FL_NODIR_name = zend_string_init_interned("FL_NODIR", sizeof("FL_NODIR") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_NODIR_name, &const_FL_NODIR_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_NODIR_name, &const_FL_NODIR_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_NODIR_name); zval const_FL_COMPRESSED_value; ZVAL_LONG(&const_FL_COMPRESSED_value, ZIP_FL_COMPRESSED); zend_string *const_FL_COMPRESSED_name = zend_string_init_interned("FL_COMPRESSED", sizeof("FL_COMPRESSED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_COMPRESSED_name, &const_FL_COMPRESSED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_COMPRESSED_name, &const_FL_COMPRESSED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_COMPRESSED_name); zval const_FL_UNCHANGED_value; ZVAL_LONG(&const_FL_UNCHANGED_value, ZIP_FL_UNCHANGED); zend_string *const_FL_UNCHANGED_name = zend_string_init_interned("FL_UNCHANGED", sizeof("FL_UNCHANGED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_UNCHANGED_name, &const_FL_UNCHANGED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_UNCHANGED_name, &const_FL_UNCHANGED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_UNCHANGED_name); #if defined(ZIP_FL_RECOMPRESS) zval const_FL_RECOMPRESS_value; ZVAL_LONG(&const_FL_RECOMPRESS_value, ZIP_FL_RECOMPRESS); zend_string *const_FL_RECOMPRESS_name = zend_string_init_interned("FL_RECOMPRESS", sizeof("FL_RECOMPRESS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_RECOMPRESS_name, &const_FL_RECOMPRESS_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_RECOMPRESS_name, &const_FL_RECOMPRESS_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_RECOMPRESS_name); #endif zval const_FL_ENCRYPTED_value; ZVAL_LONG(&const_FL_ENCRYPTED_value, ZIP_FL_ENCRYPTED); zend_string *const_FL_ENCRYPTED_name = zend_string_init_interned("FL_ENCRYPTED", sizeof("FL_ENCRYPTED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENCRYPTED_name, &const_FL_ENCRYPTED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENCRYPTED_name, &const_FL_ENCRYPTED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENCRYPTED_name); zval const_FL_OVERWRITE_value; ZVAL_LONG(&const_FL_OVERWRITE_value, ZIP_FL_OVERWRITE); zend_string *const_FL_OVERWRITE_name = zend_string_init_interned("FL_OVERWRITE", sizeof("FL_OVERWRITE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_OVERWRITE_name, &const_FL_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_OVERWRITE_name, &const_FL_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_OVERWRITE_name); zval const_FL_LOCAL_value; ZVAL_LONG(&const_FL_LOCAL_value, ZIP_FL_LOCAL); zend_string *const_FL_LOCAL_name = zend_string_init_interned("FL_LOCAL", sizeof("FL_LOCAL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_LOCAL_name, &const_FL_LOCAL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_LOCAL_name, &const_FL_LOCAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_LOCAL_name); zval const_FL_CENTRAL_value; ZVAL_LONG(&const_FL_CENTRAL_value, ZIP_FL_CENTRAL); zend_string *const_FL_CENTRAL_name = zend_string_init_interned("FL_CENTRAL", sizeof("FL_CENTRAL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_CENTRAL_name, &const_FL_CENTRAL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_CENTRAL_name, &const_FL_CENTRAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_CENTRAL_name); zval const_FL_ENC_GUESS_value; ZVAL_LONG(&const_FL_ENC_GUESS_value, ZIP_FL_ENC_GUESS); zend_string *const_FL_ENC_GUESS_name = zend_string_init_interned("FL_ENC_GUESS", sizeof("FL_ENC_GUESS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENC_GUESS_name, &const_FL_ENC_GUESS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENC_GUESS_name, &const_FL_ENC_GUESS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENC_GUESS_name); zval const_FL_ENC_RAW_value; ZVAL_LONG(&const_FL_ENC_RAW_value, ZIP_FL_ENC_RAW); zend_string *const_FL_ENC_RAW_name = zend_string_init_interned("FL_ENC_RAW", sizeof("FL_ENC_RAW") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENC_RAW_name, &const_FL_ENC_RAW_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENC_RAW_name, &const_FL_ENC_RAW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENC_RAW_name); zval const_FL_ENC_STRICT_value; ZVAL_LONG(&const_FL_ENC_STRICT_value, ZIP_FL_ENC_STRICT); zend_string *const_FL_ENC_STRICT_name = zend_string_init_interned("FL_ENC_STRICT", sizeof("FL_ENC_STRICT") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENC_STRICT_name, &const_FL_ENC_STRICT_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENC_STRICT_name, &const_FL_ENC_STRICT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENC_STRICT_name); zval const_FL_ENC_UTF_8_value; ZVAL_LONG(&const_FL_ENC_UTF_8_value, ZIP_FL_ENC_UTF_8); zend_string *const_FL_ENC_UTF_8_name = zend_string_init_interned("FL_ENC_UTF_8", sizeof("FL_ENC_UTF_8") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENC_UTF_8_name, &const_FL_ENC_UTF_8_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENC_UTF_8_name, &const_FL_ENC_UTF_8_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENC_UTF_8_name); zval const_FL_ENC_CP437_value; ZVAL_LONG(&const_FL_ENC_CP437_value, ZIP_FL_ENC_CP437); zend_string *const_FL_ENC_CP437_name = zend_string_init_interned("FL_ENC_CP437", sizeof("FL_ENC_CP437") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_ENC_CP437_name, &const_FL_ENC_CP437_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_ENC_CP437_name, &const_FL_ENC_CP437_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_ENC_CP437_name); zval const_FL_OPEN_FILE_NOW_value; ZVAL_LONG(&const_FL_OPEN_FILE_NOW_value, ZIP_FL_OPEN_FILE_NOW); zend_string *const_FL_OPEN_FILE_NOW_name = zend_string_init_interned("FL_OPEN_FILE_NOW", sizeof("FL_OPEN_FILE_NOW") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_OPEN_FILE_NOW_name, &const_FL_OPEN_FILE_NOW_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_FL_OPEN_FILE_NOW_name, &const_FL_OPEN_FILE_NOW_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_FL_OPEN_FILE_NOW_name); zval const_CM_DEFAULT_value; ZVAL_LONG(&const_CM_DEFAULT_value, ZIP_CM_DEFAULT); zend_string *const_CM_DEFAULT_name = zend_string_init_interned("CM_DEFAULT", sizeof("CM_DEFAULT") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_DEFAULT_name, &const_CM_DEFAULT_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_DEFAULT_name, &const_CM_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_DEFAULT_name); zval const_CM_STORE_value; ZVAL_LONG(&const_CM_STORE_value, ZIP_CM_STORE); zend_string *const_CM_STORE_name = zend_string_init_interned("CM_STORE", sizeof("CM_STORE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_STORE_name, &const_CM_STORE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_STORE_name, &const_CM_STORE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_STORE_name); zval const_CM_SHRINK_value; ZVAL_LONG(&const_CM_SHRINK_value, ZIP_CM_SHRINK); zend_string *const_CM_SHRINK_name = zend_string_init_interned("CM_SHRINK", sizeof("CM_SHRINK") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_SHRINK_name, &const_CM_SHRINK_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_SHRINK_name, &const_CM_SHRINK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_SHRINK_name); zval const_CM_REDUCE_1_value; ZVAL_LONG(&const_CM_REDUCE_1_value, ZIP_CM_REDUCE_1); zend_string *const_CM_REDUCE_1_name = zend_string_init_interned("CM_REDUCE_1", sizeof("CM_REDUCE_1") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_REDUCE_1_name, &const_CM_REDUCE_1_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_1_name, &const_CM_REDUCE_1_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_REDUCE_1_name); zval const_CM_REDUCE_2_value; ZVAL_LONG(&const_CM_REDUCE_2_value, ZIP_CM_REDUCE_2); zend_string *const_CM_REDUCE_2_name = zend_string_init_interned("CM_REDUCE_2", sizeof("CM_REDUCE_2") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_REDUCE_2_name, &const_CM_REDUCE_2_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_2_name, &const_CM_REDUCE_2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_REDUCE_2_name); zval const_CM_REDUCE_3_value; ZVAL_LONG(&const_CM_REDUCE_3_value, ZIP_CM_REDUCE_3); zend_string *const_CM_REDUCE_3_name = zend_string_init_interned("CM_REDUCE_3", sizeof("CM_REDUCE_3") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_REDUCE_3_name, &const_CM_REDUCE_3_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_3_name, &const_CM_REDUCE_3_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_REDUCE_3_name); zval const_CM_REDUCE_4_value; ZVAL_LONG(&const_CM_REDUCE_4_value, ZIP_CM_REDUCE_4); zend_string *const_CM_REDUCE_4_name = zend_string_init_interned("CM_REDUCE_4", sizeof("CM_REDUCE_4") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_REDUCE_4_name, &const_CM_REDUCE_4_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_REDUCE_4_name, &const_CM_REDUCE_4_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_REDUCE_4_name); zval const_CM_IMPLODE_value; ZVAL_LONG(&const_CM_IMPLODE_value, ZIP_CM_IMPLODE); zend_string *const_CM_IMPLODE_name = zend_string_init_interned("CM_IMPLODE", sizeof("CM_IMPLODE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_IMPLODE_name, &const_CM_IMPLODE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_IMPLODE_name, &const_CM_IMPLODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_IMPLODE_name); zval const_CM_DEFLATE_value; ZVAL_LONG(&const_CM_DEFLATE_value, ZIP_CM_DEFLATE); zend_string *const_CM_DEFLATE_name = zend_string_init_interned("CM_DEFLATE", sizeof("CM_DEFLATE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_DEFLATE_name, &const_CM_DEFLATE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_DEFLATE_name, &const_CM_DEFLATE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_DEFLATE_name); zval const_CM_DEFLATE64_value; ZVAL_LONG(&const_CM_DEFLATE64_value, ZIP_CM_DEFLATE64); zend_string *const_CM_DEFLATE64_name = zend_string_init_interned("CM_DEFLATE64", sizeof("CM_DEFLATE64") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_DEFLATE64_name, &const_CM_DEFLATE64_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_DEFLATE64_name, &const_CM_DEFLATE64_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_DEFLATE64_name); zval const_CM_PKWARE_IMPLODE_value; ZVAL_LONG(&const_CM_PKWARE_IMPLODE_value, ZIP_CM_PKWARE_IMPLODE); zend_string *const_CM_PKWARE_IMPLODE_name = zend_string_init_interned("CM_PKWARE_IMPLODE", sizeof("CM_PKWARE_IMPLODE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_PKWARE_IMPLODE_name, &const_CM_PKWARE_IMPLODE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_PKWARE_IMPLODE_name, &const_CM_PKWARE_IMPLODE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_PKWARE_IMPLODE_name); zval const_CM_BZIP2_value; ZVAL_LONG(&const_CM_BZIP2_value, ZIP_CM_BZIP2); zend_string *const_CM_BZIP2_name = zend_string_init_interned("CM_BZIP2", sizeof("CM_BZIP2") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_BZIP2_name, &const_CM_BZIP2_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_BZIP2_name, &const_CM_BZIP2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_BZIP2_name); zval const_CM_LZMA_value; ZVAL_LONG(&const_CM_LZMA_value, ZIP_CM_LZMA); zend_string *const_CM_LZMA_name = zend_string_init_interned("CM_LZMA", sizeof("CM_LZMA") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_LZMA_name, &const_CM_LZMA_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_LZMA_name, &const_CM_LZMA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_LZMA_name); #if defined(ZIP_CM_LZMA2) zval const_CM_LZMA2_value; ZVAL_LONG(&const_CM_LZMA2_value, ZIP_CM_LZMA2); zend_string *const_CM_LZMA2_name = zend_string_init_interned("CM_LZMA2", sizeof("CM_LZMA2") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_LZMA2_name, &const_CM_LZMA2_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_LZMA2_name, &const_CM_LZMA2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_LZMA2_name); #endif #if defined(ZIP_CM_ZSTD) @@ -722,7 +722,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_CM_ZSTD_value; ZVAL_LONG(&const_CM_ZSTD_value, ZIP_CM_ZSTD); zend_string *const_CM_ZSTD_name = zend_string_init_interned("CM_ZSTD", sizeof("CM_ZSTD") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_ZSTD_name, &const_CM_ZSTD_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_ZSTD_name, &const_CM_ZSTD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_ZSTD_name); #endif #if defined(ZIP_CM_XZ) @@ -730,207 +730,207 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_CM_XZ_value; ZVAL_LONG(&const_CM_XZ_value, ZIP_CM_XZ); zend_string *const_CM_XZ_name = zend_string_init_interned("CM_XZ", sizeof("CM_XZ") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_XZ_name, &const_CM_XZ_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_XZ_name, &const_CM_XZ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_XZ_name); #endif zval const_CM_TERSE_value; ZVAL_LONG(&const_CM_TERSE_value, ZIP_CM_TERSE); zend_string *const_CM_TERSE_name = zend_string_init_interned("CM_TERSE", sizeof("CM_TERSE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_TERSE_name, &const_CM_TERSE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_TERSE_name, &const_CM_TERSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_TERSE_name); zval const_CM_LZ77_value; ZVAL_LONG(&const_CM_LZ77_value, ZIP_CM_LZ77); zend_string *const_CM_LZ77_name = zend_string_init_interned("CM_LZ77", sizeof("CM_LZ77") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_LZ77_name, &const_CM_LZ77_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_LZ77_name, &const_CM_LZ77_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_LZ77_name); zval const_CM_WAVPACK_value; ZVAL_LONG(&const_CM_WAVPACK_value, ZIP_CM_WAVPACK); zend_string *const_CM_WAVPACK_name = zend_string_init_interned("CM_WAVPACK", sizeof("CM_WAVPACK") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_WAVPACK_name, &const_CM_WAVPACK_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_WAVPACK_name, &const_CM_WAVPACK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_WAVPACK_name); zval const_CM_PPMD_value; ZVAL_LONG(&const_CM_PPMD_value, ZIP_CM_PPMD); zend_string *const_CM_PPMD_name = zend_string_init_interned("CM_PPMD", sizeof("CM_PPMD") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_CM_PPMD_name, &const_CM_PPMD_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_CM_PPMD_name, &const_CM_PPMD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_CM_PPMD_name); zval const_ER_OK_value; ZVAL_LONG(&const_ER_OK_value, ZIP_ER_OK); zend_string *const_ER_OK_name = zend_string_init_interned("ER_OK", sizeof("ER_OK") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_OK_name, &const_ER_OK_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_OK_name, &const_ER_OK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_OK_name); zval const_ER_MULTIDISK_value; ZVAL_LONG(&const_ER_MULTIDISK_value, ZIP_ER_MULTIDISK); zend_string *const_ER_MULTIDISK_name = zend_string_init_interned("ER_MULTIDISK", sizeof("ER_MULTIDISK") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_MULTIDISK_name, &const_ER_MULTIDISK_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_MULTIDISK_name, &const_ER_MULTIDISK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_MULTIDISK_name); zval const_ER_RENAME_value; ZVAL_LONG(&const_ER_RENAME_value, ZIP_ER_RENAME); zend_string *const_ER_RENAME_name = zend_string_init_interned("ER_RENAME", sizeof("ER_RENAME") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_RENAME_name, &const_ER_RENAME_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_RENAME_name, &const_ER_RENAME_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_RENAME_name); zval const_ER_CLOSE_value; ZVAL_LONG(&const_ER_CLOSE_value, ZIP_ER_CLOSE); zend_string *const_ER_CLOSE_name = zend_string_init_interned("ER_CLOSE", sizeof("ER_CLOSE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_CLOSE_name, &const_ER_CLOSE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_CLOSE_name, &const_ER_CLOSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_CLOSE_name); zval const_ER_SEEK_value; ZVAL_LONG(&const_ER_SEEK_value, ZIP_ER_SEEK); zend_string *const_ER_SEEK_name = zend_string_init_interned("ER_SEEK", sizeof("ER_SEEK") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_SEEK_name, &const_ER_SEEK_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_SEEK_name, &const_ER_SEEK_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_SEEK_name); zval const_ER_READ_value; ZVAL_LONG(&const_ER_READ_value, ZIP_ER_READ); zend_string *const_ER_READ_name = zend_string_init_interned("ER_READ", sizeof("ER_READ") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_READ_name, &const_ER_READ_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_READ_name, &const_ER_READ_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_READ_name); zval const_ER_WRITE_value; ZVAL_LONG(&const_ER_WRITE_value, ZIP_ER_WRITE); zend_string *const_ER_WRITE_name = zend_string_init_interned("ER_WRITE", sizeof("ER_WRITE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_WRITE_name, &const_ER_WRITE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_WRITE_name, &const_ER_WRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_WRITE_name); zval const_ER_CRC_value; ZVAL_LONG(&const_ER_CRC_value, ZIP_ER_CRC); zend_string *const_ER_CRC_name = zend_string_init_interned("ER_CRC", sizeof("ER_CRC") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_CRC_name, &const_ER_CRC_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_CRC_name, &const_ER_CRC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_CRC_name); zval const_ER_ZIPCLOSED_value; ZVAL_LONG(&const_ER_ZIPCLOSED_value, ZIP_ER_ZIPCLOSED); zend_string *const_ER_ZIPCLOSED_name = zend_string_init_interned("ER_ZIPCLOSED", sizeof("ER_ZIPCLOSED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_ZIPCLOSED_name, &const_ER_ZIPCLOSED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_ZIPCLOSED_name, &const_ER_ZIPCLOSED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_ZIPCLOSED_name); zval const_ER_NOENT_value; ZVAL_LONG(&const_ER_NOENT_value, ZIP_ER_NOENT); zend_string *const_ER_NOENT_name = zend_string_init_interned("ER_NOENT", sizeof("ER_NOENT") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_NOENT_name, &const_ER_NOENT_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_NOENT_name, &const_ER_NOENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_NOENT_name); zval const_ER_EXISTS_value; ZVAL_LONG(&const_ER_EXISTS_value, ZIP_ER_EXISTS); zend_string *const_ER_EXISTS_name = zend_string_init_interned("ER_EXISTS", sizeof("ER_EXISTS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_EXISTS_name, &const_ER_EXISTS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_EXISTS_name, &const_ER_EXISTS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_EXISTS_name); zval const_ER_OPEN_value; ZVAL_LONG(&const_ER_OPEN_value, ZIP_ER_OPEN); zend_string *const_ER_OPEN_name = zend_string_init_interned("ER_OPEN", sizeof("ER_OPEN") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_OPEN_name, &const_ER_OPEN_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_OPEN_name, &const_ER_OPEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_OPEN_name); zval const_ER_TMPOPEN_value; ZVAL_LONG(&const_ER_TMPOPEN_value, ZIP_ER_TMPOPEN); zend_string *const_ER_TMPOPEN_name = zend_string_init_interned("ER_TMPOPEN", sizeof("ER_TMPOPEN") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_TMPOPEN_name, &const_ER_TMPOPEN_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_TMPOPEN_name, &const_ER_TMPOPEN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_TMPOPEN_name); zval const_ER_ZLIB_value; ZVAL_LONG(&const_ER_ZLIB_value, ZIP_ER_ZLIB); zend_string *const_ER_ZLIB_name = zend_string_init_interned("ER_ZLIB", sizeof("ER_ZLIB") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_ZLIB_name, &const_ER_ZLIB_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_ZLIB_name, &const_ER_ZLIB_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_ZLIB_name); zval const_ER_MEMORY_value; ZVAL_LONG(&const_ER_MEMORY_value, ZIP_ER_MEMORY); zend_string *const_ER_MEMORY_name = zend_string_init_interned("ER_MEMORY", sizeof("ER_MEMORY") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_MEMORY_name, &const_ER_MEMORY_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_MEMORY_name, &const_ER_MEMORY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_MEMORY_name); zval const_ER_CHANGED_value; ZVAL_LONG(&const_ER_CHANGED_value, ZIP_ER_CHANGED); zend_string *const_ER_CHANGED_name = zend_string_init_interned("ER_CHANGED", sizeof("ER_CHANGED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_CHANGED_name, &const_ER_CHANGED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_CHANGED_name, &const_ER_CHANGED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_CHANGED_name); zval const_ER_COMPNOTSUPP_value; ZVAL_LONG(&const_ER_COMPNOTSUPP_value, ZIP_ER_COMPNOTSUPP); zend_string *const_ER_COMPNOTSUPP_name = zend_string_init_interned("ER_COMPNOTSUPP", sizeof("ER_COMPNOTSUPP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_COMPNOTSUPP_name, &const_ER_COMPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_COMPNOTSUPP_name, &const_ER_COMPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_COMPNOTSUPP_name); zval const_ER_EOF_value; ZVAL_LONG(&const_ER_EOF_value, ZIP_ER_EOF); zend_string *const_ER_EOF_name = zend_string_init_interned("ER_EOF", sizeof("ER_EOF") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_EOF_name, &const_ER_EOF_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_EOF_name, &const_ER_EOF_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_EOF_name); zval const_ER_INVAL_value; ZVAL_LONG(&const_ER_INVAL_value, ZIP_ER_INVAL); zend_string *const_ER_INVAL_name = zend_string_init_interned("ER_INVAL", sizeof("ER_INVAL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_INVAL_name, &const_ER_INVAL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_INVAL_name, &const_ER_INVAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_INVAL_name); zval const_ER_NOZIP_value; ZVAL_LONG(&const_ER_NOZIP_value, ZIP_ER_NOZIP); zend_string *const_ER_NOZIP_name = zend_string_init_interned("ER_NOZIP", sizeof("ER_NOZIP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_NOZIP_name, &const_ER_NOZIP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_NOZIP_name, &const_ER_NOZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_NOZIP_name); zval const_ER_INTERNAL_value; ZVAL_LONG(&const_ER_INTERNAL_value, ZIP_ER_INTERNAL); zend_string *const_ER_INTERNAL_name = zend_string_init_interned("ER_INTERNAL", sizeof("ER_INTERNAL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_INTERNAL_name, &const_ER_INTERNAL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_INTERNAL_name, &const_ER_INTERNAL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_INTERNAL_name); zval const_ER_INCONS_value; ZVAL_LONG(&const_ER_INCONS_value, ZIP_ER_INCONS); zend_string *const_ER_INCONS_name = zend_string_init_interned("ER_INCONS", sizeof("ER_INCONS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_INCONS_name, &const_ER_INCONS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_INCONS_name, &const_ER_INCONS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_INCONS_name); zval const_ER_REMOVE_value; ZVAL_LONG(&const_ER_REMOVE_value, ZIP_ER_REMOVE); zend_string *const_ER_REMOVE_name = zend_string_init_interned("ER_REMOVE", sizeof("ER_REMOVE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_REMOVE_name, &const_ER_REMOVE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_REMOVE_name, &const_ER_REMOVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_REMOVE_name); zval const_ER_DELETED_value; ZVAL_LONG(&const_ER_DELETED_value, ZIP_ER_DELETED); zend_string *const_ER_DELETED_name = zend_string_init_interned("ER_DELETED", sizeof("ER_DELETED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_DELETED_name, &const_ER_DELETED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_DELETED_name, &const_ER_DELETED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_DELETED_name); zval const_ER_ENCRNOTSUPP_value; ZVAL_LONG(&const_ER_ENCRNOTSUPP_value, ZIP_ER_ENCRNOTSUPP); zend_string *const_ER_ENCRNOTSUPP_name = zend_string_init_interned("ER_ENCRNOTSUPP", sizeof("ER_ENCRNOTSUPP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_ENCRNOTSUPP_name, &const_ER_ENCRNOTSUPP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_ENCRNOTSUPP_name, &const_ER_ENCRNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_ENCRNOTSUPP_name); zval const_ER_RDONLY_value; ZVAL_LONG(&const_ER_RDONLY_value, ZIP_ER_RDONLY); zend_string *const_ER_RDONLY_name = zend_string_init_interned("ER_RDONLY", sizeof("ER_RDONLY") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_RDONLY_name, &const_ER_RDONLY_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_RDONLY_name, &const_ER_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_RDONLY_name); zval const_ER_NOPASSWD_value; ZVAL_LONG(&const_ER_NOPASSWD_value, ZIP_ER_NOPASSWD); zend_string *const_ER_NOPASSWD_name = zend_string_init_interned("ER_NOPASSWD", sizeof("ER_NOPASSWD") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_NOPASSWD_name, &const_ER_NOPASSWD_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_NOPASSWD_name, &const_ER_NOPASSWD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_NOPASSWD_name); zval const_ER_WRONGPASSWD_value; ZVAL_LONG(&const_ER_WRONGPASSWD_value, ZIP_ER_WRONGPASSWD); zend_string *const_ER_WRONGPASSWD_name = zend_string_init_interned("ER_WRONGPASSWD", sizeof("ER_WRONGPASSWD") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_WRONGPASSWD_name, &const_ER_WRONGPASSWD_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_WRONGPASSWD_name, &const_ER_WRONGPASSWD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_WRONGPASSWD_name); #if defined(ZIP_ER_OPNOTSUPP) zval const_ER_OPNOTSUPP_value; ZVAL_LONG(&const_ER_OPNOTSUPP_value, ZIP_ER_OPNOTSUPP); zend_string *const_ER_OPNOTSUPP_name = zend_string_init_interned("ER_OPNOTSUPP", sizeof("ER_OPNOTSUPP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_OPNOTSUPP_name, &const_ER_OPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_OPNOTSUPP_name, &const_ER_OPNOTSUPP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_OPNOTSUPP_name); #endif #if defined(ZIP_ER_INUSE) @@ -938,7 +938,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_INUSE_value; ZVAL_LONG(&const_ER_INUSE_value, ZIP_ER_INUSE); zend_string *const_ER_INUSE_name = zend_string_init_interned("ER_INUSE", sizeof("ER_INUSE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_INUSE_name, &const_ER_INUSE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_INUSE_name, &const_ER_INUSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_INUSE_name); #endif #if defined(ZIP_ER_TELL) @@ -946,7 +946,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_TELL_value; ZVAL_LONG(&const_ER_TELL_value, ZIP_ER_TELL); zend_string *const_ER_TELL_name = zend_string_init_interned("ER_TELL", sizeof("ER_TELL") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_TELL_name, &const_ER_TELL_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_TELL_name, &const_ER_TELL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_TELL_name); #endif #if defined(ZIP_ER_COMPRESSED_DATA) @@ -954,7 +954,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_COMPRESSED_DATA_value; ZVAL_LONG(&const_ER_COMPRESSED_DATA_value, ZIP_ER_COMPRESSED_DATA); zend_string *const_ER_COMPRESSED_DATA_name = zend_string_init_interned("ER_COMPRESSED_DATA", sizeof("ER_COMPRESSED_DATA") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_COMPRESSED_DATA_name, &const_ER_COMPRESSED_DATA_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_COMPRESSED_DATA_name, &const_ER_COMPRESSED_DATA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_COMPRESSED_DATA_name); #endif #if defined(ZIP_ER_CANCELLED) @@ -962,7 +962,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_CANCELLED_value; ZVAL_LONG(&const_ER_CANCELLED_value, ZIP_ER_CANCELLED); zend_string *const_ER_CANCELLED_name = zend_string_init_interned("ER_CANCELLED", sizeof("ER_CANCELLED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_CANCELLED_name, &const_ER_CANCELLED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_CANCELLED_name, &const_ER_CANCELLED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_CANCELLED_name); #endif #if defined(ZIP_ER_DATA_LENGTH) @@ -970,7 +970,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_DATA_LENGTH_value; ZVAL_LONG(&const_ER_DATA_LENGTH_value, ZIP_ER_DATA_LENGTH); zend_string *const_ER_DATA_LENGTH_name = zend_string_init_interned("ER_DATA_LENGTH", sizeof("ER_DATA_LENGTH") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_DATA_LENGTH_name, &const_ER_DATA_LENGTH_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_DATA_LENGTH_name, &const_ER_DATA_LENGTH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_DATA_LENGTH_name); #endif #if defined(ZIP_ER_NOT_ALLOWED) @@ -978,7 +978,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_ER_NOT_ALLOWED_value; ZVAL_LONG(&const_ER_NOT_ALLOWED_value, ZIP_ER_NOT_ALLOWED); zend_string *const_ER_NOT_ALLOWED_name = zend_string_init_interned("ER_NOT_ALLOWED", sizeof("ER_NOT_ALLOWED") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ER_NOT_ALLOWED_name, &const_ER_NOT_ALLOWED_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_ER_NOT_ALLOWED_name, &const_ER_NOT_ALLOWED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_ER_NOT_ALLOWED_name); #endif #if defined(ZIP_AFL_RDONLY) @@ -986,7 +986,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_AFL_RDONLY_value; ZVAL_LONG(&const_AFL_RDONLY_value, ZIP_AFL_RDONLY); zend_string *const_AFL_RDONLY_name = zend_string_init_interned("AFL_RDONLY", sizeof("AFL_RDONLY") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_AFL_RDONLY_name, &const_AFL_RDONLY_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_AFL_RDONLY_name, &const_AFL_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_AFL_RDONLY_name); #endif #if defined(ZIP_AFL_IS_TORRENTZIP) @@ -994,7 +994,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_AFL_IS_TORRENTZIP_value; ZVAL_LONG(&const_AFL_IS_TORRENTZIP_value, ZIP_AFL_IS_TORRENTZIP); zend_string *const_AFL_IS_TORRENTZIP_name = zend_string_init_interned("AFL_IS_TORRENTZIP", sizeof("AFL_IS_TORRENTZIP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_AFL_IS_TORRENTZIP_name, &const_AFL_IS_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_AFL_IS_TORRENTZIP_name, &const_AFL_IS_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_AFL_IS_TORRENTZIP_name); #endif #if defined(ZIP_AFL_WANT_TORRENTZIP) @@ -1002,7 +1002,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_AFL_WANT_TORRENTZIP_value; ZVAL_LONG(&const_AFL_WANT_TORRENTZIP_value, ZIP_AFL_WANT_TORRENTZIP); zend_string *const_AFL_WANT_TORRENTZIP_name = zend_string_init_interned("AFL_WANT_TORRENTZIP", sizeof("AFL_WANT_TORRENTZIP") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_AFL_WANT_TORRENTZIP_name, &const_AFL_WANT_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_AFL_WANT_TORRENTZIP_name, &const_AFL_WANT_TORRENTZIP_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_AFL_WANT_TORRENTZIP_name); #endif #if defined(ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE) @@ -1010,7 +1010,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value; ZVAL_LONG(&const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value, ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE); zend_string *const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name = zend_string_init_interned("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE", sizeof("AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name, &const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name, &const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1018,7 +1018,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_DOS_value; ZVAL_LONG(&const_OPSYS_DOS_value, ZIP_OPSYS_DOS); zend_string *const_OPSYS_DOS_name = zend_string_init_interned("OPSYS_DOS", sizeof("OPSYS_DOS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_DOS_name, &const_OPSYS_DOS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_DOS_name, &const_OPSYS_DOS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_DOS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1026,7 +1026,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_AMIGA_value; ZVAL_LONG(&const_OPSYS_AMIGA_value, ZIP_OPSYS_AMIGA); zend_string *const_OPSYS_AMIGA_name = zend_string_init_interned("OPSYS_AMIGA", sizeof("OPSYS_AMIGA") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_AMIGA_name, &const_OPSYS_AMIGA_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_AMIGA_name, &const_OPSYS_AMIGA_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_AMIGA_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1034,7 +1034,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_OPENVMS_value; ZVAL_LONG(&const_OPSYS_OPENVMS_value, ZIP_OPSYS_OPENVMS); zend_string *const_OPSYS_OPENVMS_name = zend_string_init_interned("OPSYS_OPENVMS", sizeof("OPSYS_OPENVMS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_OPENVMS_name, &const_OPSYS_OPENVMS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_OPENVMS_name, &const_OPSYS_OPENVMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_OPENVMS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1042,7 +1042,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_UNIX_value; ZVAL_LONG(&const_OPSYS_UNIX_value, ZIP_OPSYS_UNIX); zend_string *const_OPSYS_UNIX_name = zend_string_init_interned("OPSYS_UNIX", sizeof("OPSYS_UNIX") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_UNIX_name, &const_OPSYS_UNIX_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_UNIX_name, &const_OPSYS_UNIX_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_UNIX_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1050,7 +1050,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_VM_CMS_value; ZVAL_LONG(&const_OPSYS_VM_CMS_value, ZIP_OPSYS_VM_CMS); zend_string *const_OPSYS_VM_CMS_name = zend_string_init_interned("OPSYS_VM_CMS", sizeof("OPSYS_VM_CMS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_VM_CMS_name, &const_OPSYS_VM_CMS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_VM_CMS_name, &const_OPSYS_VM_CMS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_VM_CMS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1058,7 +1058,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_ATARI_ST_value; ZVAL_LONG(&const_OPSYS_ATARI_ST_value, ZIP_OPSYS_ATARI_ST); zend_string *const_OPSYS_ATARI_ST_name = zend_string_init_interned("OPSYS_ATARI_ST", sizeof("OPSYS_ATARI_ST") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_ATARI_ST_name, &const_OPSYS_ATARI_ST_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_ATARI_ST_name, &const_OPSYS_ATARI_ST_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_ATARI_ST_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1066,7 +1066,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_OS_2_value; ZVAL_LONG(&const_OPSYS_OS_2_value, ZIP_OPSYS_OS_2); zend_string *const_OPSYS_OS_2_name = zend_string_init_interned("OPSYS_OS_2", sizeof("OPSYS_OS_2") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_OS_2_name, &const_OPSYS_OS_2_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_2_name, &const_OPSYS_OS_2_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_OS_2_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1074,7 +1074,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_MACINTOSH_value; ZVAL_LONG(&const_OPSYS_MACINTOSH_value, ZIP_OPSYS_MACINTOSH); zend_string *const_OPSYS_MACINTOSH_name = zend_string_init_interned("OPSYS_MACINTOSH", sizeof("OPSYS_MACINTOSH") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_MACINTOSH_name, &const_OPSYS_MACINTOSH_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_MACINTOSH_name, &const_OPSYS_MACINTOSH_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_MACINTOSH_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1082,7 +1082,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_Z_SYSTEM_value; ZVAL_LONG(&const_OPSYS_Z_SYSTEM_value, ZIP_OPSYS_Z_SYSTEM); zend_string *const_OPSYS_Z_SYSTEM_name = zend_string_init_interned("OPSYS_Z_SYSTEM", sizeof("OPSYS_Z_SYSTEM") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_Z_SYSTEM_name, &const_OPSYS_Z_SYSTEM_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_Z_SYSTEM_name, &const_OPSYS_Z_SYSTEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_Z_SYSTEM_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1090,7 +1090,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_CPM_value; ZVAL_LONG(&const_OPSYS_CPM_value, ZIP_OPSYS_CPM); zend_string *const_OPSYS_CPM_name = zend_string_init_interned("OPSYS_CPM", sizeof("OPSYS_CPM") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_CPM_name, &const_OPSYS_CPM_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_CPM_name, &const_OPSYS_CPM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_CPM_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1098,7 +1098,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_WINDOWS_NTFS_value; ZVAL_LONG(&const_OPSYS_WINDOWS_NTFS_value, ZIP_OPSYS_WINDOWS_NTFS); zend_string *const_OPSYS_WINDOWS_NTFS_name = zend_string_init_interned("OPSYS_WINDOWS_NTFS", sizeof("OPSYS_WINDOWS_NTFS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_WINDOWS_NTFS_name, &const_OPSYS_WINDOWS_NTFS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_WINDOWS_NTFS_name, &const_OPSYS_WINDOWS_NTFS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_WINDOWS_NTFS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1106,7 +1106,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_MVS_value; ZVAL_LONG(&const_OPSYS_MVS_value, ZIP_OPSYS_MVS); zend_string *const_OPSYS_MVS_name = zend_string_init_interned("OPSYS_MVS", sizeof("OPSYS_MVS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_MVS_name, &const_OPSYS_MVS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_MVS_name, &const_OPSYS_MVS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_MVS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1114,7 +1114,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_VSE_value; ZVAL_LONG(&const_OPSYS_VSE_value, ZIP_OPSYS_VSE); zend_string *const_OPSYS_VSE_name = zend_string_init_interned("OPSYS_VSE", sizeof("OPSYS_VSE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_VSE_name, &const_OPSYS_VSE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_VSE_name, &const_OPSYS_VSE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_VSE_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1122,7 +1122,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_ACORN_RISC_value; ZVAL_LONG(&const_OPSYS_ACORN_RISC_value, ZIP_OPSYS_ACORN_RISC); zend_string *const_OPSYS_ACORN_RISC_name = zend_string_init_interned("OPSYS_ACORN_RISC", sizeof("OPSYS_ACORN_RISC") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_ACORN_RISC_name, &const_OPSYS_ACORN_RISC_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_ACORN_RISC_name, &const_OPSYS_ACORN_RISC_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_ACORN_RISC_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1130,7 +1130,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_VFAT_value; ZVAL_LONG(&const_OPSYS_VFAT_value, ZIP_OPSYS_VFAT); zend_string *const_OPSYS_VFAT_name = zend_string_init_interned("OPSYS_VFAT", sizeof("OPSYS_VFAT") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_VFAT_name, &const_OPSYS_VFAT_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_VFAT_name, &const_OPSYS_VFAT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_VFAT_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1138,7 +1138,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_ALTERNATE_MVS_value; ZVAL_LONG(&const_OPSYS_ALTERNATE_MVS_value, ZIP_OPSYS_ALTERNATE_MVS); zend_string *const_OPSYS_ALTERNATE_MVS_name = zend_string_init_interned("OPSYS_ALTERNATE_MVS", sizeof("OPSYS_ALTERNATE_MVS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_ALTERNATE_MVS_name, &const_OPSYS_ALTERNATE_MVS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_ALTERNATE_MVS_name, &const_OPSYS_ALTERNATE_MVS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_ALTERNATE_MVS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1146,7 +1146,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_BEOS_value; ZVAL_LONG(&const_OPSYS_BEOS_value, ZIP_OPSYS_BEOS); zend_string *const_OPSYS_BEOS_name = zend_string_init_interned("OPSYS_BEOS", sizeof("OPSYS_BEOS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_BEOS_name, &const_OPSYS_BEOS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_BEOS_name, &const_OPSYS_BEOS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_BEOS_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1154,7 +1154,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_TANDEM_value; ZVAL_LONG(&const_OPSYS_TANDEM_value, ZIP_OPSYS_TANDEM); zend_string *const_OPSYS_TANDEM_name = zend_string_init_interned("OPSYS_TANDEM", sizeof("OPSYS_TANDEM") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_TANDEM_name, &const_OPSYS_TANDEM_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_TANDEM_name, &const_OPSYS_TANDEM_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_TANDEM_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1162,7 +1162,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_OS_400_value; ZVAL_LONG(&const_OPSYS_OS_400_value, ZIP_OPSYS_OS_400); zend_string *const_OPSYS_OS_400_name = zend_string_init_interned("OPSYS_OS_400", sizeof("OPSYS_OS_400") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_OS_400_name, &const_OPSYS_OS_400_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_400_name, &const_OPSYS_OS_400_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_OS_400_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1170,7 +1170,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_OS_X_value; ZVAL_LONG(&const_OPSYS_OS_X_value, ZIP_OPSYS_OS_X); zend_string *const_OPSYS_OS_X_name = zend_string_init_interned("OPSYS_OS_X", sizeof("OPSYS_OS_X") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_OS_X_name, &const_OPSYS_OS_X_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_OS_X_name, &const_OPSYS_OS_X_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_OS_X_name); #endif #if defined(ZIP_OPSYS_DEFAULT) @@ -1178,27 +1178,27 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_OPSYS_DEFAULT_value; ZVAL_LONG(&const_OPSYS_DEFAULT_value, ZIP_OPSYS_DEFAULT); zend_string *const_OPSYS_DEFAULT_name = zend_string_init_interned("OPSYS_DEFAULT", sizeof("OPSYS_DEFAULT") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_OPSYS_DEFAULT_name, &const_OPSYS_DEFAULT_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_OPSYS_DEFAULT_name, &const_OPSYS_DEFAULT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_OPSYS_DEFAULT_name); #endif zval const_EM_NONE_value; ZVAL_LONG(&const_EM_NONE_value, ZIP_EM_NONE); zend_string *const_EM_NONE_name = zend_string_init_interned("EM_NONE", sizeof("EM_NONE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_NONE_name, &const_EM_NONE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_NONE_name, &const_EM_NONE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_NONE_name); zval const_EM_TRAD_PKWARE_value; ZVAL_LONG(&const_EM_TRAD_PKWARE_value, ZIP_EM_TRAD_PKWARE); zend_string *const_EM_TRAD_PKWARE_name = zend_string_init_interned("EM_TRAD_PKWARE", sizeof("EM_TRAD_PKWARE") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_TRAD_PKWARE_name, &const_EM_TRAD_PKWARE_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_TRAD_PKWARE_name, &const_EM_TRAD_PKWARE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_TRAD_PKWARE_name); #if defined(HAVE_ENCRYPTION) zval const_EM_AES_128_value; ZVAL_LONG(&const_EM_AES_128_value, ZIP_EM_AES_128); zend_string *const_EM_AES_128_name = zend_string_init_interned("EM_AES_128", sizeof("EM_AES_128") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_AES_128_name, &const_EM_AES_128_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_AES_128_name, &const_EM_AES_128_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_AES_128_name); #endif #if defined(HAVE_ENCRYPTION) @@ -1206,7 +1206,7 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_EM_AES_192_value; ZVAL_LONG(&const_EM_AES_192_value, ZIP_EM_AES_192); zend_string *const_EM_AES_192_name = zend_string_init_interned("EM_AES_192", sizeof("EM_AES_192") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_AES_192_name, &const_EM_AES_192_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_AES_192_name, &const_EM_AES_192_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_AES_192_name); #endif #if defined(HAVE_ENCRYPTION) @@ -1214,23 +1214,37 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zval const_EM_AES_256_value; ZVAL_LONG(&const_EM_AES_256_value, ZIP_EM_AES_256); zend_string *const_EM_AES_256_name = zend_string_init_interned("EM_AES_256", sizeof("EM_AES_256") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_AES_256_name, &const_EM_AES_256_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_AES_256_name, &const_EM_AES_256_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_AES_256_name); #endif zval const_EM_UNKNOWN_value; ZVAL_LONG(&const_EM_UNKNOWN_value, ZIP_EM_UNKNOWN); zend_string *const_EM_UNKNOWN_name = zend_string_init_interned("EM_UNKNOWN", sizeof("EM_UNKNOWN") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_EM_UNKNOWN_name, &const_EM_UNKNOWN_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_EM_UNKNOWN_name, &const_EM_UNKNOWN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release(const_EM_UNKNOWN_name); zval const_LIBZIP_VERSION_value; zend_string *const_LIBZIP_VERSION_value_str = zend_string_init(LIBZIP_VERSION_STR, strlen(LIBZIP_VERSION_STR), 1); ZVAL_STR(&const_LIBZIP_VERSION_value, const_LIBZIP_VERSION_value_str); zend_string *const_LIBZIP_VERSION_name = zend_string_init_interned("LIBZIP_VERSION", sizeof("LIBZIP_VERSION") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_LIBZIP_VERSION_name, &const_LIBZIP_VERSION_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_typed_class_constant(class_entry, const_LIBZIP_VERSION_name, &const_LIBZIP_VERSION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release(const_LIBZIP_VERSION_name); + zval const_LENGTH_TO_END_value; + ZVAL_LONG(&const_LENGTH_TO_END_value, ZIP_LENGTH_TO_END); + zend_string *const_LENGTH_TO_END_name = zend_string_init_interned("LENGTH_TO_END", sizeof("LENGTH_TO_END") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_LENGTH_TO_END_name, &const_LENGTH_TO_END_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_LENGTH_TO_END_name); +#if defined(ZIP_LENGTH_UNCHECKED) + + zval const_LENGTH_UNCHECKED_value; + ZVAL_LONG(&const_LENGTH_UNCHECKED_value, ZIP_LENGTH_UNCHECKED); + zend_string *const_LENGTH_UNCHECKED_name = zend_string_init_interned("LENGTH_UNCHECKED", sizeof("LENGTH_UNCHECKED") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_LENGTH_UNCHECKED_name, &const_LENGTH_UNCHECKED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_LENGTH_UNCHECKED_name); +#endif + zval property_lastId_default_value; ZVAL_UNDEF(&property_lastId_default_value); zend_string *property_lastId_name = zend_string_init("lastId", sizeof("lastId") - 1, 1); diff --git a/ext/zip/tests/oo_addfile.phpt b/ext/zip/tests/oo_addfile.phpt index 00f560e032ed..1564106c56bf 100644 --- a/ext/zip/tests/oo_addfile.phpt +++ b/ext/zip/tests/oo_addfile.phpt @@ -24,7 +24,7 @@ if (!$zip->addFile($dirname . 'utils.inc', 'mini.txt', 12, 34)) { echo "failed\n"; } var_dump($zip->lastId); -if (!$zip->addFile($dirname . 'utils.inc', 'other.txt', 0, 0, ZipArchive::FL_OPEN_FILE_NOW)) { +if (!$zip->addFile($dirname . 'utils.inc', 'other.txt', 0, ZipArchive::LENGTH_TO_END, ZipArchive::FL_OPEN_FILE_NOW)) { echo "failed\n"; } var_dump($zip->lastId); diff --git a/ext/zlib/tests/bug67724.phpt b/ext/zlib/tests/bug67724.phpt index 23e27ec6995e..7367cb615d8a 100644 --- a/ext/zlib/tests/bug67724.phpt +++ b/ext/zlib/tests/bug67724.phpt @@ -2,6 +2,10 @@ Bug #67724 (chained zlib filters silently fail with large amounts of data) --EXTENSIONS-- zlib +--SKIPIF-- + --FILE--