Compare commits

..

1 commit

Author SHA1 Message Date
Daniel Scherzer
ae73654909
Update versions for PHP 8.5.0alpha3 2025-07-29 13:52:18 -07:00
1127 changed files with 10621 additions and 14123 deletions

View file

@ -17,7 +17,7 @@ jobs:
if: github.repository == 'php/php-src'
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Install dependencies
run: pip install -r docs/requirements.txt
- name: Check formatting

View file

@ -54,7 +54,7 @@ jobs:
runs-on: [self-hosted, gentoo, ppc64]
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: System info
@ -95,7 +95,7 @@ jobs:
image: 'alpine:3.20.1'
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: apk
@ -206,7 +206,7 @@ jobs:
runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -306,7 +306,7 @@ jobs:
FIREBIRD_PASSWORD: test
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: apt
@ -374,7 +374,7 @@ jobs:
runs-on: macos-${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: brew
@ -449,7 +449,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -502,7 +502,7 @@ jobs:
USE_TRACKED_ALLOC: 1
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: apt
@ -553,17 +553,14 @@ jobs:
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
X=0
for repository in $repositories; do
echo "::group::$repository"
printf "Testing amp/%s\n" "$repository"
git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1
cd "amphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
EXIT_CODE=0
vendor/bin/phpunit || EXIT_CODE=$?
echo -e "\n::endgroup::"
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
cd ..
done
@ -587,17 +584,14 @@ jobs:
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
X=0
for repository in $repositories; do
echo "::group::$repository"
printf "Testing reactphp/%s\n" "$repository"
git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1
cd "reactphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
EXIT_CODE=0
vendor/bin/phpunit || EXIT_CODE=$?
echo -e "\n::endgroup::"
if [ $[EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
cd ..
done
@ -622,19 +616,15 @@ jobs:
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
php ./phpunit install
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "/** @group skip */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
X=0
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
echo "::group::$component"
EXIT_CODE=0
php ./phpunit $component --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group transient --exclude-group skip || EXIT_CODE=$?
echo -e "\n::endgroup::"
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
done
exit $X
@ -705,7 +695,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -768,7 +758,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: apt
@ -859,7 +849,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: apt
@ -909,38 +899,38 @@ jobs:
CXX: ccache g++
steps:
- name: git checkout PHP
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
path: php
ref: ${{ inputs.branch }}
- name: git checkout apcu
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: krakjoe/apcu
path: apcu
- name: git checkout imagick
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: Imagick/imagick
path: imagick
- name: git checkout memcached
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: php-memcached-dev/php-memcached
path: memcached
- name: git checkout redis
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: phpredis/phpredis
path: redis
- name: git checkout xdebug
if: false
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: xdebug/xdebug
path: xdebug
- name: git checkout yaml
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: php/pecl-file_formats-yaml
path: yaml
@ -1050,7 +1040,7 @@ jobs:
- name: git config
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup
@ -1068,10 +1058,9 @@ jobs:
- zts: ${{ !inputs.run_freebsd_zts && true || '*never*' }}
name: "FREEBSD_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: FreeBSD

View file

@ -82,7 +82,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: apt
uses: ./.github/actions/apt-x64
- name: System info
@ -166,7 +166,7 @@ jobs:
FIREBIRD_PASSWORD: test
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: apt
uses: ./.github/actions/apt-x32
- name: ccache
@ -203,7 +203,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: brew
uses: ./.github/actions/brew
- name: ccache
@ -250,7 +250,7 @@ jobs:
- name: git config
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build
@ -264,7 +264,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
fetch-depth: 0
# ASLR can cause a lot of noise due to missed sse opportunities for memcpy
@ -326,7 +326,7 @@ jobs:
mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
- name: git checkout benchmarking-data
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: php/benchmarking-data
ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
@ -366,9 +366,8 @@ jobs:
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
name: FREEBSD
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: FreeBSD
uses: ./.github/actions/freebsd

View file

@ -2,94 +2,14 @@ name: Real-time Benchmark
on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
inputs:
pull_request:
description: 'PR number that is going to be benchmarked (e.g. "1234")'
required: true
type: number
jit:
description: 'Whether JIT is benchmarked'
required: false
default: "0"
type: choice
options:
- "0"
- "1"
instruction_count:
description: 'Whether Valgrind instruction count should be measured'
required: true
default: "0"
type: choice
options:
- "0"
- "1"
opcache:
description: 'Whether opcache is enabled for the benchmarked commit'
required: true
default: "1"
type: choice
options:
- "0"
- "1"
- "2"
baseline_opcache:
description: 'Whether opcache is enabled for the baseline commit'
required: true
default: "1"
type: choice
options:
- "0"
- "1"
- "2"
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
REAL_TIME_BENCHMARK:
name: REAL_TIME_BENCHMARK
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
if: github.repository == 'php/php-src'
runs-on: ubuntu-22.04
env:
REPOSITORY: ${{ github.repository }}
BRANCH: "master"
COMMIT: ${{ github.sha }}
BASELINE_COMMIT: "d5f6e56610c729710073350af318c4ea1b292cfe"
ID: "master"
OPCACHE: ${{ inputs.opcache || '1' }}
BASELINE_OPCACHE: ${{ inputs.baseline_opcache || '2' }}
JIT: ${{ inputs.jit || '1' }}
INSTRUCTION_COUNT: ${{ inputs.instruction_count || '0' }}
YEAR: ""
steps:
- name: Setup benchmark environment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
YEAR="$(date '+%Y')"
echo "YEAR=$YEAR" >> $GITHUB_ENV
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
PR_INFO=$(gh pr view ${{ inputs.pull_request }} --json headRepositoryOwner,headRepository,headRefName,headRefOid,baseRefOid --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login, .headRepository.name, .headRefName, .headRefOid, .baseRefOid')
REPOSITORY="$(echo "$PR_INFO" | sed -n '1p')/$(echo "$PR_INFO" | sed -n '2p')"
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
BRANCH=$(echo "$PR_INFO" | sed -n '3p')
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
COMMIT=$(echo "$PR_INFO" | sed -n '4p')
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
BASELINE_COMMIT=$(echo "$PR_INFO" | sed -n '5p')
echo "BASELINE_COMMIT=$BASELINE_COMMIT" >> $GITHUB_ENV
echo "ID=benchmarked" >> $GITHUB_ENV
fi
- name: Install dependencies
run: |
set -ex
@ -103,149 +23,79 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y terraform=1.5.7-*
- name: Checkout benchmark suite
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: 'kocsismate/php-version-benchmarks'
ref: 'main'
fetch-depth: 1
path: 'php-version-benchmarks'
- name: Checkout php-src (benchmarked version)
uses: actions/checkout@v5
- name: Checkout php-src
uses: actions/checkout@v4
with:
repository: '${{ env.REPOSITORY }}'
ref: '${{ env.COMMIT }}'
repository: 'php/php-src'
ref: '${{ github.sha }}'
fetch-depth: 100
path: 'php-version-benchmarks/tmp/php_${{ env.ID }}'
- name: Checkout php-src (baseline version)
uses: actions/checkout@v5
with:
repository: '${{ env.REPOSITORY }}'
ref: '${{ env.BASELINE_COMMIT }}'
fetch-depth: 100
path: 'php-version-benchmarks/tmp/php_baseline'
path: 'php-version-benchmarks/tmp/php_master'
- name: Setup benchmark results
run: |
git config --global user.name "Benchmark"
git config --global user.email "benchmark@php.net"
rm -rf ./php-version-benchmarks/docs/results
- name: Checkout benchmark data
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
repository: php/real-time-benchmark-data
ssh-key: ${{ secrets.PHP_VERSION_BENCHMARK_RESULTS_DEPLOY_KEY }}
path: 'php-version-benchmarks/docs/results'
- name: Setup infra config
- name: Set benchmark config
run: |
set -e
# Set infrastructure config
cp ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini.dist ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
ESCAPED_DOCKER_REGISTRY=$(printf '%s\n' "${{ secrets.PHP_VERSION_BENCHMARK_DOCKER_REGISTRY }}" | sed -e 's/[\/&]/\\&/g')
sed -i "s/INFRA_DOCKER_REGISTRY=public.ecr.aws\/abcdefgh/INFRA_DOCKER_REGISTRY=$ESCAPED_DOCKER_REGISTRY/g" ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
sed -i "s/INFRA_MEASURE_INSTRUCTION_COUNT=0/INFRA_MEASURE_INSTRUCTION_COUNT=${{ env.INSTRUCTION_COUNT }}/g" ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
cp ./php-version-benchmarks/build/infrastructure/config/aws.tfvars.dist ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/access_key = ""/access_key = "${{ secrets.PHP_VERSION_BENCHMARK_AWS_ACCESS_KEY }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/secret_key = ""/secret_key = "${{ secrets.PHP_VERSION_BENCHMARK_AWS_SECRET_KEY }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/github_token = ""/github_token = "${{ secrets.GITHUB_TOKEN }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
- name: Setup PHP config - baseline PHP version
run: |
set -e
BASELINE_SHORT_SHA="$(echo "${{ env.BASELINE_COMMIT }}" | cut -c1-4)"
cat << EOF > ./php-version-benchmarks/config/php/baseline.ini
PHP_NAME="PHP - baseline@$BASELINE_SHORT_SHA"
PHP_ID=php_baseline
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.BASELINE_COMMIT }}
PHP_OPCACHE=${{ env.BASELINE_OPCACHE }}
PHP_JIT=0
EOF
- name: Setup PHP config - baseline PHP version with JIT
if: github.event_name == 'workflow_dispatch' && inputs.jit == '1'
run: |
set -e
BASELINE_SHORT_SHA="$(echo "${{ env.BASELINE_COMMIT }}" | cut -c1-4)"
cat << EOF > ./php-version-benchmarks/config/php/baseline_jit.ini
PHP_NAME="PHP - baseline@$BASELINE_SHORT_SHA (JIT)"
PHP_ID=php_baseline_jit
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.BASELINE_COMMIT }}
PHP_OPCACHE=${{ env.BASELINE_OPCACHE }}
PHP_JIT=${{ env.JIT }}
EOF
git clone ./php-version-benchmarks/tmp/php_baseline/ ./php-version-benchmarks/tmp/php_baseline_jit
- name: Setup PHP config - previous PHP version
if: github.event_name != 'workflow_dispatch'
run: |
set -e
DATABASE="./php-version-benchmarks/docs/results/${{ env.YEAR }}/database.tsv"
YEAR="$(date '+%Y')"
DATABASE="./php-version-benchmarks/docs/results/$YEAR/database.tsv"
if [ -f "$DATABASE" ]; then
LAST_RESULT_SHA="$(tail -n 2 "$DATABASE" | head -n 1 | cut -f 6)"
else
YESTERDAY="$(date -d "-2 day 23:59:59" '+%Y-%m-%d %H:%M:%S')"
LAST_RESULT_SHA="$(cd ./php-version-benchmarks/tmp/php_${{ env.ID }}/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
LAST_RESULT_SHA="$(cd ./php-version-benchmarks/tmp/php_master/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
fi
cat << EOF > ./php-version-benchmarks/config/php/previous.ini
PHP_NAME="PHP - previous ${{ env.BRANCH }}"
PHP_ID=php_previous
BASELINE_SHA="d5f6e56610c729710073350af318c4ea1b292cfe"
BASELINE_SHORT_SHA="$(echo "$BASELINE_SHA" | cut -c1-4)"
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=$LAST_RESULT_SHA
# Set config for the baseline PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_baseline.ini
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - baseline@'"$BASELINE_SHORT_SHA"'"/g' ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_baseline/g" ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$BASELINE_SHA/g" ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_baseline.ini
PHP_OPCACHE=1
PHP_JIT=0
EOF
- name: Setup PHP config - benchmarked PHP version
run: |
set -e
# Set config for the previous PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_last.ini
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - previous master"/g' ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_previous/g" ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$LAST_RESULT_SHA/g" ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_last.ini
cat << EOF > ./php-version-benchmarks/config/php/this.ini
PHP_NAME="PHP - ${{ env.BRANCH }}"
PHP_ID=php_${{ env.ID }}
# Set config for the current PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_now.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now.ini
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.COMMIT }}
PHP_OPCACHE=${{ env.OPCACHE }}
PHP_JIT=0
EOF
- name: Setup PHP config - benchmarked PHP version with JIT
if: env.JIT == '1'
run: |
set -e
cat << EOF > ./php-version-benchmarks/config/php/this_jit.ini
PHP_NAME="PHP - ${{ env.BRANCH }} (JIT)"
PHP_ID=php_${{ env.ID }}_jit
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.COMMIT }}
PHP_OPCACHE=${{ env.OPCACHE }}
PHP_JIT=${{ env.JIT }}
EOF
git clone ./php-version-benchmarks/tmp/php_${{ env.ID }}/ ./php-version-benchmarks/tmp/php_${{ env.ID }}_jit
- name: Setup test config
run: |
set -e
# Set config for current PHP version with JIT
git clone ./php-version-benchmarks/tmp/php_master/ ./php-version-benchmarks/tmp/php_master_jit
cp ./php-version-benchmarks/config/php/master_jit.ini.dist ./php-version-benchmarks/config/php/master_now_jit.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now_jit.ini
# Set test configs
cp ./php-version-benchmarks/config/test/1_laravel.ini.dist ./php-version-benchmarks/config/test/1_laravel.ini
cp ./php-version-benchmarks/config/test/2_symfony_main.ini.dist ./php-version-benchmarks/config/test/2_symfony_main.ini
cp ./php-version-benchmarks/config/test/4_wordpress.ini.dist ./php-version-benchmarks/config/test/4_wordpress.ini
@ -254,7 +104,6 @@ jobs:
- name: Run benchmark
run: ./php-version-benchmarks/benchmark.sh run aws
- name: Store results
if: github.repository == 'php/php-src' && github.event_name != 'workflow_dispatch'
run: |
set -ex
@ -270,21 +119,6 @@ jobs:
fi
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
git push
- name: Upload artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: results
path: ./php-version-benchmarks/docs/results/${{ env.YEAR }}
retention-days: 30
- name: Comment results
if: github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./php-version-benchmarks/tmp/php_${{ env.ID }}
NEWEST_RESULT_DIRECTORY=$(ls -td ${{ github.workspace }}/php-version-benchmarks/docs/results/${{ env.YEAR }}/*/ | head -1)
gh pr comment ${{ inputs.pull_request }} --body-file "${NEWEST_RESULT_DIRECTORY}result.md" --repo ${{ github.repository }}
- name: Cleanup
if: always()
run: |

View file

@ -13,7 +13,7 @@ jobs:
outputs:
branches: ${{ steps.set-matrix.outputs.branches }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
# Set fetch-depth to 0 to clone the full repository
# including all branches. This is required to find

1
.gitignore vendored
View file

@ -131,7 +131,6 @@ config.h.in
/sapi/cgi/php-cgi
/sapi/fpm/php-fpm
/sapi/phpdbg/phpdbg
/sapi/fuzzer/php-fuzz-*
/scripts/php-config
/scripts/phpize
php

135
NEWS
View file

@ -1,130 +1,11 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.5.0beta2
- Core:
. Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler()
triggers "Constant already defined" warning). (ilutov)
. Fixed bug GH-19476 (pipe operator fails to correctly handle returning
by reference). (alexandre-daubois)
- ODBC:
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
- OpenSSL:
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
(Jakub Zelenka)
- Session:
. Added support for partitioned cookies. (nielsdos)
- Standard:
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
(Girgias)
. Added support for partitioned cookies. (nielsdos)
14 Aug 2025, PHP 8.5.0beta1
- Core:
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
been deprecated. (Girgias)
. The $exclude_disabled parameter of the get_defined_functions() function has
been deprecated, as it no longer has any effect since PHP 8.0. (Girgias)
. Terminating case statements with a semicolon instead of a colon has
been deprecated. (theodorejb)
. The backtick operator as an alias for shell_exec() has been deprecated.
(timwolla)
. Returning null from __debugInfo() has been deprecated. (DanielEScherzer)
. Support #[\Override] on properties. (Jiří Pudil)
- Curl:
. The curl_close() function has been deprecated. (DanielEScherzer)
. The curl_share_close() function has been deprecated. (DanielEScherzer)
- Date:
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
deprecated. (jorgsowa)
- DOM:
. Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the
first when using ~ and :has). (nielsdos, lexborisov)
- FileInfo
. The finfo_close() function has been deprecated. (timwolla)
. The $context parameter of the finfo_buffer() function has been deprecated
as it is ignored. (Girgias)
- GD:
. The imagedestroy() function has been deprecated. (DanielEScherzer)
- Intl:
. Intl's internal error mechanism has been modernized so that it
indicates more accurately which call site caused what error.
Moreover, some ext/date exceptions have been wrapped inside a
IntlException now. (Girgias)
. The intl.error_level INI setting has been deprecated. (Girgias)
- MySQLi:
. The mysqli_execute() alias function has been deprecated. (timwolla)
- OpenSSL:
. Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias
algorithms appears to be broken). (Jakub Zelenka)
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
(Girgias)
. Implement #80495 (Enable to set padding in openssl_(sign|verify).
(Jakub Zelenka)
. Implement #47728 (openssl_pkcs7_sign ignores new openssl flags).
(Jakub Zelenka)
- PDO:
. The "uri:" DSN scheme has been deprecated due to security concerns with
DSNs coming from remote URIs. (timwolla)
- Reflection:
. Fixed bug GH-17927 (Reflection: have some indication of property hooks in
`_property_string()`). (DanielEScherzer)
. The setAccessible() methods of various Reflection objects have been
deprecated, as those no longer have an effect. (timwolla)
. ReflectionClass::getConstant() for constants that do not exist has been
deprecated. (DanielEScherzer)
. ReflectionProperty::getDefaultValue() for properties without default values
has been deprecated. (DanielEScherzer)
- SPL:
. Unregistering all autoloaders by passing the spl_autoload_call() function
as a callback argument to spl_autoload_unregister() has been deprecated.
Instead if this is needed, one should iterate over the return value of
spl_autoload_functions() and call spl_autoload_unregister() on each
value. (Girgias)
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
SplObjectStorage::detach() methods have been deprecated in favour of
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
SplObjectStorage::offsetUnset() respectively. (Girgias)
- Standard:
. The socket_set_timeout() alias function has been deprecated. (timwolla)
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
opened directory has been deprecated. (Girgias)
. Fixed bug GH-19153 (#[\Attribute] validation should error on
trait/interface/enum/abstract class). (DanielEScherzer)
- XML:
. The xml_parser_free() function has been deprecated. (DanielEScherzer)
31 Jul 2025, PHP 8.5.0alpha4
31 Jul 2025, PHP 8.5.0alpha3
- Core:
. Add clone-with support to the clone() function. (timwolla, edorian)
. Fix support for non-userland stream notifiers. (timwolla)
. Added PHP_BUILD_PROVIDER constant. (timwolla)
. Fixed bug GH-19305 (Operands may be being released during comparison).
(Arnaud)
. Fixed bug GH-19306 (Generator can be resumed while fetching next value from
delegated Generator). (Arnaud)
. Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
a non-Generator delegate crashes). (Arnaud)
- Curl:
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
@ -139,7 +20,6 @@ PHP NEWS
- Intl:
. Fix return value on failure for resourcebundle count handler. (Girgias)
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
- OPcache:
. Disallow changing opcache.memory_consumption when SHM is already set up.
@ -149,7 +29,6 @@ PHP NEWS
. Make OPcache non-optional (Arnaud, timwolla)
. Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for
deprecations). (Arnaud, timwolla)
. Fixed bug GH-19301 (opcache build failure). (Remi)
- OpenSSL:
. Add $digest_algo parameter to openssl_public_encrypt() and
@ -233,7 +112,7 @@ PHP NEWS
- CURL:
. Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY
values for CURLOPT_FOLLOWLOCATION curl_easy_setopt option. (David Carlier)
values for CURLOPT_FOLLOLOCATION curl_easy_setopt option. (David Carlier)
- COM:
. Fixed property access of PHP objects wrapped in variant. (cmb)
@ -352,7 +231,7 @@ PHP NEWS
- OpenSSL:
. Added openssl.libctx INI that allows to select the OpenSSL library context
type and convert various parts of the extension to use the custom libctx.
type and convert verious parts of the extension to use the custom libctx.
(Jakub Zelenka)
- Output:
@ -362,7 +241,7 @@ PHP NEWS
. Extend pcntl_waitid with rusage parameter. (vrza)
- PCRE:
. Upgraded to pcre2lib from 10.44 to 10.45. (nielsdos)
. Upgraded to pre2lib from 10.44 to 10.45. (nielsdos)
. Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
(mvorisek)
@ -408,7 +287,7 @@ PHP NEWS
(DanielEScherzer)
. Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF
zval for uninitialized typed properties). (nielsdos)
. Fixed bug GH-15766 (ReflectionClass::__toString() should have better output
. Fixed bug GH-15766 (ReflectionClass::toString() should have better output
for enums). (DanielEScherzer)
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
@ -471,7 +350,7 @@ PHP NEWS
(David Carlier)
- Sodium:
. Fix overall theoretical overflows on zend_string buffer allocations.
. Fix overall theorical overflows on zend_string buffer allocations.
(David Carlier/nielsdos)
- Sqlite:
@ -500,7 +379,7 @@ PHP NEWS
(cmb)
- Tests:
. Allow to shuffle tests even in non-parallel mode. (dhuang00)
. Allow to shuffle tests even in non-parallell mode. (dhuang00)
- Tidy:
. tidy::__construct/parseFile/parseString methods throw an exception if

167
UPGRADING
View file

@ -50,9 +50,6 @@ PHP 8.5 UPGRADE NOTES
immediately, without calling user-defined error handlers.
. Exceptions thrown by user-defined error handlers when handling class linking
errors are not promoted to fatal errors anymore and do not prevent linking.
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
an error during compilation. Previously, the attribute could be added, but when
ReflectionAttribute::newInstance() was called an error would be thrown.
- DOM:
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
@ -80,10 +77,6 @@ PHP 8.5 UPGRADE NOTES
. Calling the mysqli constructor on an already-constructed object
is now no longer possible and throws an Error.
- ODBC:
. ODBC now assumes that at least ODBC 3.5 functionality is available. The
ODBCVER definition and build system flags to control it have been removed.
- Opcache:
. The Opcache extension is now always built into the PHP binary and is always
loaded. The INI directives opcache.enable and opcache.enable_cli are still
@ -182,8 +175,6 @@ PHP 8.5 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/pipe-operator-v3
. Constructor property promotion can now be used for final properties.
RFC: https://wiki.php.net/rfc/final_promotion
. #[\Override] can now be applied to properties.
RFC: https://wiki.php.net/rfc/override_properties
- Curl:
. Added support for share handles that are persisted across multiple PHP
@ -253,11 +244,6 @@ PHP 8.5 UPGRADE NOTES
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
- Session:
. session_set_cookie_params(), session_get_cookie_params(), and session_start()
now support partitioned cookies via the "partitioned" key.
RFC: https://wiki.php.net/rfc/CHIPS
- SOAP:
. Enumeration cases are now dumped in __getTypes().
. Implemented request #61105:
@ -277,15 +263,15 @@ PHP 8.5 UPGRADE NOTES
and the function returns false. Previously, these errors were silently
ignored. This change affects only the sendmail transport.
. getimagesize() now supports HEIF/HEIC images.
- Standard:
. getimagesize() now supports SVG images when ext-libxml is also loaded.
Similarly, image_type_to_extension() and image_type_to_mime_type()
Similarly, image_type_to_extension() and image_type_to_extension()
now also handle IMAGETYPE_SVG.
. The array returned by getimagesize() now has two additional entries:
"width_unit" and "height_unit" to indicate in which units the dimensions
are expressed. These units are px by default. They are not necessarily
the same (just to give one example: one may be cm and the other may be px).
. setcookie() and setrawcookie() now support the "partitioned" key.
RFC: https://wiki.php.net/rfc/CHIPS
- XSL:
. The $namespace argument of XSLTProcessor::getParameter(),
@ -330,115 +316,12 @@ PHP 8.5 UPGRADE NOTES
one will still be used. If a user output handler returns a non-string and
produces output, the warning about producing an output is emitted first.
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
been deprecated, use (bool), (int), (float), and (string) respectively.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names
. The $exclude_disabled parameter of the get_defined_functions() function has
been deprecated, as it no longer has any effect since PHP 8.0.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
. Terminating case statements with a semicolon instead of a colon has
been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement
. The backtick operator as an alias for shell_exec() has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
. Returning null from __debugInfo() has been deprecated.
Return an empty array instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
- Curl:
. The curl_close() function has been deprecated, as CurlHandle objects are
freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close
. The curl_share_close() function has been deprecated, as CurlShareHandle
objects are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close
- Date:
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
deprecated. This is because the associated timezone is ignored and always
uses GMT.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
- FileInfo:
. The finfo_close() function has been deprecated.
As finfo objects are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
. The $context parameter of the finfo_buffer() function has been deprecated
as it is ignored.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
- GD:
. The imagedestroy() function has been deprecated, as GdImage objects are
freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy
- Hash:
. The MHASH_* constants have been deprecated. These have been overlooked
when the mhash*() function family has been deprecated per
https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
- Intl:
. The intl.error_level INI setting has been deprecated.
Errors should either be checked manually or exceptions should be enabled
by using the intl.use_exceptions INI setting.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting
- MySQLi:
. The mysqli_execute() alias function has been deprecated.
Use mysqli_stmt_execute() instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
- OpenSSL:
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
This is because it is either ignored, or truncates the key, which can be
a vulnerability.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
- PDO:
. The "uri:" DSN scheme has been deprecated due to security concerns with
DSNs coming from remote URIs.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
- Reflection:
. The setAccessible() methods of various Reflection objects have been
deprecated, as those no longer have an effect.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
. Calling ReflectionClass::getConstant() for constants that do not exist has
been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants
. Calling ReflectionProperty::getDefaultValue() for properties without default
values has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values
- SPL:
. Unregistering all autoloaders by passing the spl_autoload_call() function
as a callback argument to spl_autoload_unregister() has been deprecated.
Instead if this is needed, one should iterate over the return value of
spl_autoload_functions() and call spl_autoload_unregister() on each value.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
SplObjectStorage::detach() methods have been deprecated in favour of
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
SplObjectStorage::offsetUnset() respectively.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
- Standard:
. The socket_set_timeout() alias function has been deprecated.
Use stream_set_timeout() instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
opened directory has been deprecated. Provide the last opened directory
explicitly instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
This is because a byte can only hold a value within this interval.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
- XML:
. The xml_parser_free() function has been deprecated, as XMLParser objects
are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free
========================================
5. Changed Functions
========================================
@ -465,12 +348,7 @@ PHP 8.5 UPGRADE NOTES
- OpenSSL:
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
$digest_algo that allows specifying hash digest algorithm for OEAP padding.
. openssl_sign() and openssl_verify() have new parameter $padding to allow
using more secure RSA PSS padding.
. openssl_cms_encrypt() $cipher_algo parameter can be a string with the
cipher name. That allows to use more algorithms including AES GCM cipher
algorithms for auth enveloped data.
$digest_algo that allows specifying hash digest algorith for OEAP padding.
- PCNTL:
. pcntl_exec() now has a formal return type of false.
@ -513,19 +391,14 @@ PHP 8.5 UPGRADE NOTES
argument are lower than -1 or if soft_limit is greater than hard_limit.
- Reflection:
. The output of ReflectionClass::__toString() for enums has changed to
. The output of ReflectionClass::toString() for enums has changed to
better indicate that the class is an enum, and that the enum cases
are enum cases rather than normal class constants.
. The output of ReflectionProperty::__toString() for properties with
hooks has changed to indicate what hooks the property has, whether those
hooks are final, and whether the property is virtual. This also affects
the output of ReflectionClass::__toString() when a class contains hooked
properties.
- Session:
. session_start is stricter in regard to the option argument.
It throws a ValueError if the whole is not a hashmap or
a TypeError if read_and_close value is not a valid type
a TypeError if read_on_close value is not a valid type
compatible with int.
- SNMP:
@ -638,10 +511,6 @@ PHP 8.5 UPGRADE NOTES
7. New Classes and Interfaces
========================================
- Core:
. NoDiscard attribute was added.
RFC: https://wiki.php.net/rfc/marking_return_value_as_important
- Curl:
. CurlSharePersistentHandle representing a share handle that is persisted
across multiple PHP requests.
@ -672,12 +541,6 @@ PHP 8.5 UPGRADE NOTES
. The return type of finfo_close() has been changed to true, rather
than bool.
- Intl:
. Intl's internal error mechanism has been modernized so that it
indicates more accurately which call site caused what error.
Moreover, some ext/date exceptions have been wrapped inside a
IntlException now.
- Lexbor:
. An always enabled lexbor extension is added. It contains the lexbor
library that was separated from ext/dom for being reused among other
@ -727,13 +590,6 @@ PHP 8.5 UPGRADE NOTES
. DECIMAL_COMPACT_SHORT.
. DECIMAL_COMPACT_LONG.
- OpenSSL:
. OPENSSL_PKCS1_PSS_PADDING
. PKCS7_NOSMIMECAP
. PKCS7_CRLFEOL
. PKCS7_NOCRL
. PKCS7_NO_DUAL_CONTENT
- POSIX:
. POSIX_SC_OPEN_MAX.
@ -768,11 +624,6 @@ PHP 8.5 UPGRADE NOTES
. Added fatal_error_backtraces to control whether fatal errors should include
a backtrace.
RFC: https://wiki.php.net/rfc/error_backtraces_v2
. Added startup-only max_memory_limit INI setting to control the maximum
memory_limit that may be configured at startup or runtime. Exceeding this
value emits a warning, unless set to -1, and sets memory_limit to the
current max_memory_limit instead.
ML discussion: https://externals.io/message/127108
- Opcache:
. Added opcache.file_cache_read_only to support a read-only
@ -792,9 +643,9 @@ PHP 8.5 UPGRADE NOTES
showing misleading values in PHPInfo.
- OpenSSL:
. Added openssl.libctx to select the OpenSSL library context type. Either
custom libctx for each thread can be used or a single global (default)
libctx is used.
Added openssl.libctx to select the OpenSSL library context type. Either
custom libctx for each thread can be used or a single global (default)
libctx is used.
========================================
12. Windows Support

View file

@ -29,10 +29,6 @@ PHP 8.5 INTERNALS UPGRADE NOTES
be heap-allocated and stored in the pointer as a minimal change to keep
compatibility.
- Hash
. Hash functions now use proper hash_spec_result enum for return values
instead of using SUCCESS and FAILURE.
- Zend
. Added zend_safe_assign_to_variable_noref() function to safely assign
a value to a non-reference zval.
@ -79,7 +75,6 @@ PHP 8.5 INTERNALS UPGRADE NOTES
delayed. Before, errors would be recorded but not delayed.
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
from the parent process after a fork().
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
- standard
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
@ -101,12 +96,11 @@ PHP 8.5 INTERNALS UPGRADE NOTES
that appropriate build rules are created.
- Unix build system changes
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex: lib64)
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex lib64)
configure options are used to ${libdir}/php (ex: /usr/lib64/php)
. PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor
macros defined by ext/odbc are now defined in php_config.h instead of the
build-defs.h header.
. Autoconf macro AX_CHECK_COMPILE_FLAG updated to serial 11.
. Autoconf macro PHP_AP_EXTRACT_VERSION has been removed.
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
manually).

View file

@ -420,14 +420,6 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
}
break;
case ZEND_EXT_STMT:
if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
/* Variable will be deleted later by FREE, so we can't optimize it */
Tsource[VAR_NUM(opline->op1.var)] = NULL;
break;
}
break;
case ZEND_CASE:
case ZEND_CASE_STRICT:
case ZEND_COPY_TMP:

View file

@ -98,10 +98,6 @@ ZEND_API int zend_optimizer_register_pass(zend_optimizer_pass_t pass);
ZEND_API void zend_optimizer_unregister_pass(int idx);
zend_result zend_optimizer_startup(void);
zend_result zend_optimizer_shutdown(void);
typedef void (*zend_op_array_func_t)(zend_op_array *, void *context);
void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void *context);
END_EXTERN_C()
#endif

View file

@ -128,4 +128,7 @@ int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zen
int dce_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *optimizer_ctx, zend_ssa *ssa, bool reorder_dtor_effects);
zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
typedef void (*zend_op_array_func_t)(zend_op_array *, void *context);
void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void *context);
#endif

View file

@ -22,7 +22,6 @@
#include "zend_ssa.h"
#include "zend_dump.h"
#include "zend_inference.h"
#include "zend_worklist.h"
#include "Optimizer/zend_optimizer_internal.h"
static bool dominates(const zend_basic_block *blocks, int a, int b) {
@ -817,7 +816,7 @@ ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *op
}
/* }}} */
static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
{
zend_basic_block *blocks = ssa->cfg.blocks;
zend_ssa_block *ssa_blocks = ssa->blocks;
@ -825,6 +824,15 @@ static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t bui
int ssa_vars_count = ssa->vars_count;
int i, j;
zend_op *opline, *end;
int *tmp = NULL;
ALLOCA_FLAG(use_heap = 0);
// FIXME: Can we optimize this copying out in some cases?
if (blocks[n].next_child >= 0) {
tmp = do_alloca(sizeof(int) * (op_array->last_var + op_array->T), use_heap);
memcpy(tmp, var, sizeof(int) * (op_array->last_var + op_array->T));
var = tmp;
}
if (ssa_blocks[n].phis) {
zend_ssa_phi *phi = ssa_blocks[n].phis;
@ -908,90 +916,22 @@ static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t bui
}
ssa->vars_count = ssa_vars_count;
}
/* }}} */
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n)
{
/* The worklist contains block numbers, encoded as positive or negative value.
* Positive values indicate that the variable rename still needs to happen for the block.
* Negative values indicate the variable rename was done and all children were handled too.
* In that case, we will clean up.
* Because block 0 is valid, we bias the block numbers by adding 1 such that we can distinguish
* positive and negative values in all cases. */
zend_worklist_stack work;
ALLOCA_FLAG(work_use_heap);
ZEND_WORKLIST_STACK_ALLOCA(&work, ssa->cfg.blocks_count, work_use_heap);
zend_worklist_stack_push(&work, n + 1);
/* This is used to backtrack the right version of the renamed variables to use. */
ALLOCA_FLAG(save_vars_use_heap);
unsigned int save_vars_top = 0;
int **save_vars = do_alloca(sizeof(int *) * (ssa->cfg.blocks_count + 1), save_vars_use_heap);
save_vars[0] = var;
while (work.len) {
n = zend_worklist_stack_pop(&work);
/* Enter state: perform SSA variable rename */
if (n > 0) {
n--;
// FIXME: Can we optimize this copying out in some cases?
int *new_var;
if (ssa->cfg.blocks[n].next_child >= 0) {
new_var = emalloc(sizeof(int) * (op_array->last_var + op_array->T));
memcpy(new_var, save_vars[save_vars_top], sizeof(int) * (op_array->last_var + op_array->T));
save_vars[++save_vars_top] = new_var;
} else {
new_var = save_vars[save_vars_top];
}
zend_ssa_rename_in_block(op_array, build_flags, ssa, new_var, n);
int j = ssa->cfg.blocks[n].children;
if (j >= 0) {
/* Push backtrack state */
zend_worklist_stack_push(&work, -(n + 1));
/* Push children in enter state */
unsigned int child_count = 0;
int len_prior = work.len;
do {
zend_worklist_stack_push(&work, j + 1);
j = ssa->cfg.blocks[j].next_child;
child_count++;
} while (j >= 0);
/* Reverse block order to maintain SSA variable number order given in previous PHP versions,
* but the data structure doesn't allow reverse dominator tree traversal. */
for (unsigned int i = 0; i < child_count / 2; i++) {
int tmp = work.buf[len_prior + i];
work.buf[len_prior + i] = work.buf[work.len - 1 - i];
work.buf[work.len - 1 - i] = tmp;
}
} else {
/* Leafs jump directly to backtracking */
goto backtrack;
}
}
/* Leave state: backtrack */
else {
n = -n;
n--;
backtrack:;
if (ssa->cfg.blocks[n].next_child >= 0) {
efree(save_vars[save_vars_top]);
save_vars_top--;
}
}
j = blocks[n].children;
while (j >= 0) {
// FIXME: Tail call optimization?
if (zend_ssa_rename(op_array, build_flags, ssa, var, j) == FAILURE)
return FAILURE;
j = blocks[j].next_child;
}
free_alloca(save_vars, save_vars_use_heap);
ZEND_WORKLIST_STACK_FREE_ALLOCA(&work, work_use_heap);
if (tmp) {
free_alloca(tmp, use_heap);
}
return SUCCESS;
}
/* }}} */
ZEND_API zend_result zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa) /* {{{ */
{

View file

@ -193,21 +193,28 @@ AS_VAR_IF([GCC], [yes],
dnl Check if compiler supports -Wno-clobbered (only GCC).
AX_CHECK_COMPILE_FLAG([-Wno-clobbered],
[CFLAGS="-Wno-clobbered $CFLAGS"])
[CFLAGS="-Wno-clobbered $CFLAGS"],,
[-Werror])
dnl Check for support for implicit fallthrough level 1, also add after previous
dnl CFLAGS as level 3 is enabled in -Wextra.
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=1],
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"])
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"],,
[-Werror])
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],
[CFLAGS="-Wduplicated-cond $CFLAGS"])
[CFLAGS="-Wduplicated-cond $CFLAGS"],,
[-Werror])
AX_CHECK_COMPILE_FLAG([-Wlogical-op],
[CFLAGS="-Wlogical-op $CFLAGS"])
[CFLAGS="-Wlogical-op $CFLAGS"],,
[-Werror])
AX_CHECK_COMPILE_FLAG([-Wformat-truncation],
[CFLAGS="-Wformat-truncation $CFLAGS"])
[CFLAGS="-Wformat-truncation $CFLAGS"],,
[-Werror])
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],
[CFLAGS="-Wstrict-prototypes $CFLAGS"])
[CFLAGS="-Wstrict-prototypes $CFLAGS"],,
[-Werror])
AX_CHECK_COMPILE_FLAG([-fno-common],
[CFLAGS="-fno-common $CFLAGS"])
[CFLAGS="-fno-common $CFLAGS"],,
[-Werror])
ZEND_CHECK_ALIGNMENT
ZEND_CHECK_SIGNALS

View file

@ -104,7 +104,7 @@ int(10)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
int(1)
int(2)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function

View file

@ -59,7 +59,7 @@ array(1) {
[0]=>
int(1)
}
Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
array(2) {
[0]=>
int(1)
@ -68,7 +68,7 @@ array(2) {
}
array(0) {
}
Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
array(2) {
[0]=>
int(1)

3
Zend/tests/014.inc Normal file
View file

@ -0,0 +1,3 @@
<?php
/* dummy file for 014.phpt */
?>

View file

@ -5,13 +5,13 @@ get_included_files() tests
var_dump(get_included_files());
include(__DIR__."/get_included_files_basic.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
include_once(__DIR__."/get_included_files_basic.inc");
include_once(__DIR__."/014.inc");
var_dump(get_included_files());
include(__DIR__."/get_included_files_basic.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
echo "Done\n";

View file

@ -9,7 +9,6 @@ function skipFunction($function): bool {
/* terminates script */
|| $function === 'exit'
|| $function === 'die'
|| $function === 'zend_trigger_bailout'
/* intentionally violate invariants */
|| $function === 'zend_create_unterminated_string'
|| $function === 'zend_test_array_return'

View file

@ -1,11 +0,0 @@
--TEST--
GH-19303 (Unpacking empty packed array into uninitialized array causes assertion failure)
--FILE--
<?php
$a = [0];
unset($a[0]);
var_dump([...$a]);
?>
--EXPECT--
array(0) {
}

View file

@ -5,12 +5,12 @@ zend.assertions=1
assert.exception=1
--FILE--
<?php
var_dump((int)ini_get("zend.assertions"));
var_dump((integer)ini_get("zend.assertions"));
ini_set("zend.assertions", 0);
var_dump((int)ini_get("zend.assertions"));
var_dump((integer)ini_get("zend.assertions"));
assert(false);
ini_set("zend.assertions", 1);
var_dump((int)ini_get("zend.assertions"));
var_dump((integer)ini_get("zend.assertions"));
assert(true);
var_dump(true);
?>

View file

@ -1,12 +0,0 @@
--TEST--
#[Attribute] on an abstract class
--FILE--
<?php
#[Attribute]
abstract class Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to abstract class Demo in %s on line %d

View file

@ -1,12 +0,0 @@
--TEST--
#[Attribute] on an enum
--FILE--
<?php
#[Attribute]
enum Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to enum Demo in %s on line %d

View file

@ -1,12 +0,0 @@
--TEST--
#[Attribute] on an interface
--FILE--
<?php
#[Attribute]
interface Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to interface Demo in %s on line %d

View file

@ -1,12 +0,0 @@
--TEST--
#[Attribute] on a trait
--FILE--
<?php
#[Attribute]
trait Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to trait Demo in %s on line %d

View file

@ -8,4 +8,4 @@ enum Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[\AllowDynamicProperties] to enum Test in %s on line %d
Fatal error: Cannot apply #[AllowDynamicProperties] to enum Test in %s on line %d

View file

@ -8,4 +8,4 @@ interface Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[\AllowDynamicProperties] to interface Test in %s on line %d
Fatal error: Cannot apply #[AllowDynamicProperties] to interface Test in %s on line %d

View file

@ -8,4 +8,4 @@ trait Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[\AllowDynamicProperties] to trait Test in %s on line %d
Fatal error: Cannot apply #[AllowDynamicProperties] to trait Test in %s on line %d

View file

@ -1,39 +0,0 @@
--TEST--
#[\Override]: Properties
--FILE--
<?php
interface I {
public mixed $i { get; }
}
interface II extends I {
#[\Override]
public mixed $i { get; }
}
class P {
public mixed $p1;
public mixed $p2;
}
class PP extends P {
#[\Override]
public mixed $p1;
public mixed $p2;
}
class C extends PP implements I {
#[\Override]
public mixed $i;
#[\Override]
public mixed $p1;
public mixed $p2;
public mixed $c;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,15 +0,0 @@
--TEST--
#[\Override]: Properties: No parent class.
--FILE--
<?php
class C {
#[\Override]
public mixed $c;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,21 +0,0 @@
--TEST--
#[\Override]: Properties: No parent class, but child implements matching interface.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class P {
#[\Override]
public mixed $i;
}
class C extends P implements I {}
echo "Done";
?>
--EXPECTF--
Fatal error: P::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,21 +0,0 @@
--TEST--
#[\Override]: Properties: No parent class, but child implements matching interface (2).
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class C extends P implements I {}
class P {
#[\Override]
public mixed $i;
}
echo "Done";
?>
--EXPECTF--
Fatal error: P::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,26 +0,0 @@
--TEST--
#[\Override]: Properties: No parent interface.
--FILE--
<?php
interface I {
#[\Override]
public mixed $i { get; }
}
interface II extends I {}
class C implements II {
public mixed $i;
}
class C2 implements I {
public mixed $i;
}
echo "Done";
?>
--EXPECTF--
Fatal error: I::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,15 +0,0 @@
--TEST--
#[\Override]: Properties: On trait.
--FILE--
<?php
trait T {
#[\Override]
public mixed $t;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: On used trait without parent property.
--FILE--
<?php
trait T {
#[\Override]
public mixed $t;
}
class Foo {
use T;
}
echo "Done";
?>
--EXPECTF--
Fatal error: Foo::$t has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,23 +0,0 @@
--TEST--
#[\Override]: Properties: On used trait with interface property.
--FILE--
<?php
trait T {
#[\Override]
public mixed $i;
}
interface I {
public mixed $i { get; }
}
class Foo implements I {
use T;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Parent property is private, child property is public.
--FILE--
<?php
class P {
private mixed $p;
}
class C extends P {
#[\Override]
public mixed $p;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$p has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Parent property is private, child property is private.
--FILE--
<?php
class P {
private mixed $p;
}
class C extends P {
#[\Override]
private mixed $p;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$p has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Parent property is protected, child property is public.
--FILE--
<?php
class P {
protected mixed $p;
}
class C extends P {
#[\Override]
public mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Parent property is protected, child property is protected.
--FILE--
<?php
class P {
protected mixed $p;
}
class C extends P {
#[\Override]
protected mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,21 +0,0 @@
--TEST--
#[\Override]: Properties: Redeclared trait property.
--FILE--
<?php
trait T {
public mixed $t;
}
class C {
use T;
#[\Override]
public mixed $t;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$t has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,25 +0,0 @@
--TEST--
#[\Override]: Properties: Redeclared trait property with interface.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
trait T {
public mixed $i;
}
class C implements I {
use T;
#[\Override]
public mixed $i;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Valid anonymous class.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
new class () implements I {
#[\Override]
public mixed $i;
};
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,21 +0,0 @@
--TEST--
#[\Override]: Properties: Invalid anonymous class.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
new class () implements I {
public mixed $i;
#[\Override]
public mixed $c;
};
echo "Done";
?>
--EXPECTF--
Fatal error: I@anonymous::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,16 +0,0 @@
--TEST--
#[\Override]: Properties: Static property no parent class.
--FILE--
<?php
class C
{
#[\Override]
public static mixed $c;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -1,19 +0,0 @@
--TEST--
#[\Override]: Properties: Static property.
--FILE--
<?php
class P {
public static mixed $p;
}
class C extends P {
#[\Override]
public static mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,21 +0,0 @@
--TEST--
#[\Override]: Properties: valid promoted property
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class C implements I {
public function __construct(
#[\Override]
public mixed $i,
) {}
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -1,17 +0,0 @@
--TEST--
#[\Override]: Properties: invalid promoted property
--FILE--
<?php
class C {
public function __construct(
#[\Override]
public mixed $c,
) {}
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -11,6 +11,7 @@ function boom()
$thing = new Thing();
xml_set_object($reader, $thing);
die("ok\n");
xml_parser_free($reader);
}
boom();
?>

View file

@ -8,7 +8,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
<?php
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
$cmd = "$php -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
echo shell_exec($cmd);
echo `$cmd`;
?>
--EXPECT--
Interactive shell (-a) requires the readline extension.

View file

@ -9,19 +9,22 @@ class wrapper {
return true;
}
function stream_eof() {
throw new Exception('cannot eof');
throw new exception();
}
}
stream_wrapper_register("wrap", "wrapper");
$fp = fopen("wrap://...", "r");
feof($fp);
try {
feof($fp);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "Done\n";
?>
--EXPECT--
Exception: cannot eof
--EXPECTF--
Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
Fatal error: Uncaught Exception in %s:%d
Stack trace:
#0 [internal function]: wrapper->stream_eof()
#1 %s(%d): feof(Resource id #%d)
#2 {main}
thrown in %s on line %d

View file

@ -28,7 +28,7 @@ if (PHP_OS == 'Linux') {
}
}
elseif (PHP_OS == 'FreeBSD') {
$lines = explode("\n", shell_exec("sysctl -a"));
$lines = explode("\n",`sysctl -a`);
$infos = array();
foreach ($lines as $line) {
if (!$line){

View file

@ -17,12 +17,5 @@ function show_outputa($prepend, $output) {
show_outputa('Files: ', `cd .`); // this works as expected
?>
--EXPECTF--
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
--EXPECT--
Okey

View file

@ -1,5 +1,7 @@
--TEST--
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
--INI--
report_memleaks=1
--FILE--
<?php
class FooBar {

16
Zend/tests/bug79668.phpt Normal file
View file

@ -0,0 +1,16 @@
--TEST--
Bug #79668 (get_defined_functions(true) may miss functions)
--INI--
disable_functions=sha1_file,password_hash
--FILE--
<?php
$df = get_defined_functions(true);
foreach (['sha1', 'sha1_file', 'hash', 'password_hash'] as $funcname) {
var_dump(in_array($funcname, $df['internal'], true));
}
?>
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(false)

View file

@ -2,6 +2,7 @@
Bug #81104: Warning: "Failed to set memory limit to ... bytes" emitted after exit in debug
--INI--
memory_limit=5M
report_memleaks=0
--FILE--
<?php
#[AllowDynamicProperties]

View file

@ -1,5 +0,0 @@
<?php
var_dump(__COMPILER_HALT_OFFSET__);
__halt_compiler();

View file

@ -1,12 +0,0 @@
--TEST--
GH-18850: Repeated inclusion of file with __halt_compiler() triggers "Constant already defined" warning
--FILE--
<?php
require __DIR__ . '/gh18850.inc';
require __DIR__ . '/gh18850.inc';
?>
--EXPECT--
int(62)
int(62)

View file

@ -36,7 +36,5 @@ object(Foo)#%d (3) {
["c":"Foo":private]=>
int(3)
}
Deprecated: Returning null from Bar::__debugInfo() is deprecated, return an empty array instead in %s on line %d
object(Bar)#%d (0) {
}

View file

@ -1,31 +0,0 @@
--TEST--
Testing __debugInfo() magic method
--FILE--
<?php
set_error_handler(
static function () {
echo "in handler\n";
$f = new Foo();
var_dump($f);
}
);
class Foo {
public function __debugInfo() {
return null;
}
}
$f = new Foo;
var_dump($f);
?>
--EXPECTF--
in handler
Deprecated: Returning null from Foo::__debugInfo() is deprecated, return an empty array instead in %s on line %d
object(Foo)#3 (0) {
}
object(Foo)#2 (0) {
}

View file

@ -16,8 +16,8 @@ $storage[Foo::Baz] = 'Baz';
var_dump($storage[Foo::Bar]);
var_dump($storage[Foo::Baz]);
var_dump($storage->offsetExists(Foo::Bar));
var_dump($storage->offsetExists(Foo::Qux));
var_dump($storage->contains(Foo::Bar));
var_dump($storage->contains(Foo::Qux));
$serialized = serialize($storage);
var_dump($serialized);

View file

@ -3,6 +3,8 @@ Bug #26698 (Thrown exceptions while evaluating argument to pass as parameter cra
--FILE--
<?php
ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
class ObjectOne
{
function getNone()

View file

@ -20,6 +20,5 @@ $action->filter();
$action->filter();
?>
DONE
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
--EXPECT--
DONE

View file

@ -1,3 +0,0 @@
<?php
/* dummy file for get_included_files_basic.phpt */
?>

View file

@ -1,24 +0,0 @@
--TEST--
GH-18736: Circumvented type check with return by ref + finally
--FILE--
<?php
function &test(): int {
$x = 0;
try {
return $x;
} finally {
$x = 'test';
}
}
try {
$x = &test();
var_dump($x);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
test(): Return value must be of type int, string returned

View file

@ -1,81 +0,0 @@
--TEST--
GH-19280: Stale nInternalPosition on rehashing
--FILE--
<?php
function rehash_packed() {
$a = range(0, 63);
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[$i]);
}
var_dump(key($a));
$a[64] = 64;
var_dump(key($a));
}
function rehash_packed_iterated() {
$a = range(0, 63);
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[$i]);
}
var_dump(key($a));
foreach ($a as &$_) {
$a[64] = 64;
break;
}
var_dump(key($a));
}
function rehash_string() {
$a = [];
for ($i = 0; $i < 64; $i++) {
$a[md5($i)] = $i;
}
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[md5($i)]);
}
var_dump(key($a));
$a[md5(64)] = 64;
var_dump(key($a));
}
function rehash_int() {
$a = [];
for ($i = 63; $i >= 0; $i--) {
$a[$i] = $i;
}
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 48; $i >= 2; $i--) {
unset($a[$i]);
}
var_dump(key($a));
$a[64] = 64;
var_dump(key($a));
}
rehash_packed();
rehash_packed_iterated();
rehash_string();
rehash_int();
?>
--EXPECT--
int(62)
int(62)
int(62)
int(62)
string(32) "44f683a84163b3523afe57c2e008bc8c"
string(32) "44f683a84163b3523afe57c2e008bc8c"
int(1)
int(1)

View file

@ -1,18 +0,0 @@
--TEST--
GH-19304: Incorrect anonymous class type name assertion
--FILE--
<?php
$foo = new class {
public self $v;
};
try {
$foo->v = 0;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot assign int to property class@anonymous::$v of type class@anonymous

View file

@ -1,27 +0,0 @@
--TEST--
GH-19305 001: Operands may be released during comparison
--FILE--
<?php
$a = (object)[
'foo' => 'test',
'bar' => 2,
];
$b = (object)[
'foo' => new class {
public function __toString() {
global $a, $b;
$a = $b = null;
return '';
}
},
'bar' => 2,
];
// Comparison of $a->foo and $b->foo calls __toString(), which releases
// both $a and $b.
var_dump($a > $b);
?>
--EXPECT--
bool(true)

View file

@ -1,27 +0,0 @@
--TEST--
GH-19305 002: Operands may be released during comparison
--FILE--
<?php
$a = [
'foo' => 'test',
'bar' => 2,
];
$b = [
'foo' => new class {
public function __toString() {
global $a, $b;
$a = $b = null;
return '';
}
},
'bar' => 2,
];
// Comparison of $a['foo'] and $b['foo'] calls __toString(), which releases
// both $a and $b.
var_dump($a > $b);
?>
--EXPECT--
bool(true)

View file

@ -1,28 +0,0 @@
--TEST--
GH-19305 003: Operands may be released during comparison
--SKIPIF--
<?php
if (!method_exists('ReflectionClass', 'newLazyGhost')) {
die('skip No lazy objects');
}
?>
--FILE--
<?php
class C
{
public $s;
}
$r = new ReflectionClass(C::class);
$o = $r->newLazyProxy(function () { return new C; });
// Comparison calls initializers, which releases $o
var_dump($o >
$r->newLazyGhost(function () {
global $o;
$o = null;
}));
?>
--EXPECT--
bool(false)

Some files were not shown because too many files have changed in this diff Show more