mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Compare commits
1 commit
master
...
php-8.5.0a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
24b32f6a89 |
1398 changed files with 13613 additions and 23331 deletions
|
@ -90,6 +90,7 @@ jobs:
|
|||
--prefix=/usr \
|
||||
--enable-phpdbg \
|
||||
--enable-fpm \
|
||||
--enable-opcache \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
--with-pgsql \
|
||||
|
@ -167,6 +168,7 @@ jobs:
|
|||
no_output_timeout: 30m
|
||||
command: |
|
||||
sapi/cli/php run-tests.php \
|
||||
-d zend_extension=opcache.so \
|
||||
-d opcache.enable_cli=1 \
|
||||
-d opcache.jit_buffer_size=64M \
|
||||
-d opcache.jit=tracing \
|
||||
|
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -16,7 +16,7 @@
|
|||
|
||||
/.github @TimWolla
|
||||
/build/gen_stub.php @kocsismate
|
||||
/ext/bcmath @nielsdos @SakiTakamachi
|
||||
/ext/bcmath @Girgias @nielsdos @SakiTakamachi
|
||||
/ext/curl @adoy
|
||||
/ext/date @derickr
|
||||
/ext/dba @Girgias
|
||||
|
|
5
.github/actions/apk/action.yml
vendored
5
.github/actions/apk/action.yml
vendored
|
@ -6,8 +6,6 @@ runs:
|
|||
run: |
|
||||
set -x
|
||||
|
||||
OPCACHE_TLS_TESTS_DEPS="clang gcc binutils-gold lld"
|
||||
|
||||
apk update -q
|
||||
apk add \
|
||||
util-linux \
|
||||
|
@ -55,5 +53,4 @@ runs:
|
|||
postgresql14-dev \
|
||||
tzdata \
|
||||
musl-locales \
|
||||
musl-locales-lang \
|
||||
$OPCACHE_TLS_TESTS_DEPS
|
||||
musl-locales-lang
|
||||
|
|
6
.github/actions/apt-x32/action.yml
vendored
6
.github/actions/apt-x32/action.yml
vendored
|
@ -6,8 +6,6 @@ runs:
|
|||
run: |
|
||||
set -x
|
||||
|
||||
OPCACHE_TLS_TESTS_DEPS="gcc clang lld"
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
dpkg --add-architecture i386
|
||||
apt-get update -y | true
|
||||
|
@ -37,6 +35,7 @@ runs:
|
|||
libssl-dev:i386 \
|
||||
libwebp-dev:i386 \
|
||||
libxml2-dev:i386 \
|
||||
libxml2-dev:i386 \
|
||||
libxpm-dev:i386 \
|
||||
libxslt1-dev:i386 \
|
||||
firebird-dev:i386 \
|
||||
|
@ -46,5 +45,4 @@ runs:
|
|||
re2c \
|
||||
unzip \
|
||||
wget \
|
||||
zlib1g-dev:i386 \
|
||||
$OPCACHE_TLS_TESTS_DEPS
|
||||
zlib1g-dev:i386
|
||||
|
|
5
.github/actions/apt-x64/action.yml
vendored
5
.github/actions/apt-x64/action.yml
vendored
|
@ -10,8 +10,6 @@ runs:
|
|||
run: |
|
||||
set -x
|
||||
|
||||
OPCACHE_TLS_TESTS_DEPS="gcc clang lld"
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install sudo in Docker for consistent actions
|
||||
|
@ -76,5 +74,4 @@ runs:
|
|||
libqdbm-dev \
|
||||
libjpeg-dev \
|
||||
libpng-dev \
|
||||
libfreetype6-dev \
|
||||
$OPCACHE_TLS_TESTS_DEPS
|
||||
libfreetype6-dev
|
||||
|
|
7
.github/actions/extra-tests/action.yml
vendored
7
.github/actions/extra-tests/action.yml
vendored
|
@ -1,7 +0,0 @@
|
|||
name: Extra tests
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: sh
|
||||
run: |
|
||||
sapi/cli/php run-extra-tests.php
|
18
.github/actions/freebsd/action.yml
vendored
18
.github/actions/freebsd/action.yml
vendored
|
@ -3,16 +3,13 @@ inputs:
|
|||
configurationParameters:
|
||||
default: ''
|
||||
required: false
|
||||
runExtraTests:
|
||||
default: false
|
||||
required: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: FreeBSD
|
||||
uses: vmactions/freebsd-vm@v1
|
||||
with:
|
||||
release: '13.5'
|
||||
release: '13.3'
|
||||
usesh: true
|
||||
copyback: false
|
||||
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.
|
||||
|
@ -20,8 +17,6 @@ runs:
|
|||
prepare: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
|
||||
OPCACHE_TLS_TESTS_DEPS="gcc"
|
||||
|
||||
kldload accf_http
|
||||
pkg install -y \
|
||||
autoconf \
|
||||
|
@ -46,11 +41,9 @@ runs:
|
|||
webp \
|
||||
libavif \
|
||||
`#sqlite3` \
|
||||
curl \
|
||||
$OPCACHE_TLS_TESTS_DEPS
|
||||
curl
|
||||
|
||||
./buildconf -f
|
||||
CC=clang CXX=clang++ \
|
||||
./configure \
|
||||
--prefix=/usr/local \
|
||||
--enable-debug \
|
||||
|
@ -113,8 +106,5 @@ runs:
|
|||
--offline \
|
||||
--show-diff \
|
||||
--show-slow 1000 \
|
||||
--set-timeout 120
|
||||
|
||||
if test "${{ inputs.runExtraTests }}" = "true"; then
|
||||
sapi/cli/php run-extra-tests.php
|
||||
fi
|
||||
--set-timeout 120 \
|
||||
-d zend_extension=opcache.so
|
||||
|
|
3
.github/scripts/setup-slapd.sh
vendored
3
.github/scripts/setup-slapd.sh
vendored
|
@ -72,9 +72,6 @@ olcTLSCertificateKeyFile: /etc/ldap/ssl/server.key
|
|||
add: olcTLSVerifyClient
|
||||
olcTLSVerifyClient: never
|
||||
-
|
||||
add: olcTLSProtocolMin
|
||||
olcTLSProtocolMin: 3.3
|
||||
-
|
||||
add: olcAuthzRegexp
|
||||
olcAuthzRegexp: uid=usera,cn=digest-md5,cn=auth cn=usera,dc=my-domain,dc=com
|
||||
-
|
||||
|
|
2
.github/scripts/windows/test_task.bat
vendored
2
.github/scripts/windows/test_task.bat
vendored
|
@ -128,7 +128,7 @@ mkdir %PHP_BUILD_DIR%\test_file_cache
|
|||
rem generate php.ini
|
||||
echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini
|
||||
echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini
|
||||
echo opcache.record_warnings=1 >> %PHP_BUILD_DIR%\php.ini
|
||||
if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
rem work-around for some spawned PHP processes requiring OpenSSL and sockets
|
||||
echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
echo extension=php_sockets.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
|
|
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
|
@ -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
|
||||
|
|
88
.github/workflows/nightly.yml
vendored
88
.github/workflows/nightly.yml
vendored
|
@ -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
|
||||
|
@ -85,8 +85,6 @@ jobs:
|
|||
with:
|
||||
runTestsParameters: >-
|
||||
--asan -x
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
ALPINE:
|
||||
if: inputs.run_alpine
|
||||
name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS
|
||||
|
@ -95,7 +93,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
|
||||
|
@ -134,9 +132,8 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
--asan -x
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
- name: Notify Slack
|
||||
if: failure()
|
||||
uses: ./.github/actions/notify-slack
|
||||
|
@ -206,7 +203,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
|
||||
|
@ -249,12 +246,14 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
# ASAN frequently timeouts. Each test run takes ~90 minutes, we can
|
||||
|
@ -265,9 +264,8 @@ jobs:
|
|||
jitType: function
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
- name: Notify Slack
|
||||
|
@ -306,7 +304,7 @@ jobs:
|
|||
FIREBIRD_PASSWORD: test
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -340,12 +338,14 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
uses: ./.github/actions/test-linux
|
||||
|
@ -353,9 +353,8 @@ jobs:
|
|||
jitType: function
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
- name: Notify Slack
|
||||
if: failure()
|
||||
uses: ./.github/actions/notify-slack
|
||||
|
@ -374,7 +373,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
|
||||
|
@ -399,11 +398,13 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-macos
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
if: matrix.os != '14' || !matrix.zts
|
||||
|
@ -411,9 +412,8 @@ jobs:
|
|||
with:
|
||||
jitType: function
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
- name: Notify Slack
|
||||
|
@ -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
|
||||
|
@ -474,6 +474,7 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- uses: codecov/codecov-action@v4
|
||||
if: ${{ !cancelled() }}
|
||||
|
@ -502,7 +503,7 @@ jobs:
|
|||
USE_TRACKED_ALLOC: 1
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -527,6 +528,7 @@ jobs:
|
|||
- name: Enable Opcache
|
||||
run: |
|
||||
echo memory_limit=-1 >> /etc/php.d/opcache.ini
|
||||
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
|
||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
||||
|
@ -553,17 +555,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 +586,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 +618,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 +697,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
|
||||
|
@ -727,18 +719,21 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-prime
|
||||
- name: Test File Cache (prime shm, use shm)
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
- name: Test File Cache (prime shm, use file)
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -746,6 +741,7 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-prime
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -753,6 +749,7 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -768,7 +765,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
|
||||
|
@ -846,6 +843,7 @@ jobs:
|
|||
with:
|
||||
runTestsParameters: >-
|
||||
--msan
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
|
@ -859,7 +857,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 +907,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 +1048,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 +1066,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
|
||||
|
@ -1079,4 +1076,3 @@ jobs:
|
|||
with:
|
||||
configurationParameters: >-
|
||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||
runExtraTests: true
|
||||
|
|
23
.github/workflows/push.yml
vendored
23
.github/workflows/push.yml
vendored
|
@ -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
|
||||
|
@ -112,7 +112,6 @@ jobs:
|
|||
with:
|
||||
configurationParameters: >-
|
||||
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
||||
${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }}
|
||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }}
|
||||
skipSlow: ${{ matrix.asan }}
|
||||
|
@ -131,6 +130,7 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
${{ matrix.asan && '--asan -x' || '' }}
|
||||
- name: Verify generated files are up to date
|
||||
|
@ -167,7 +167,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
|
||||
|
@ -190,6 +190,7 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
MACOS_DEBUG_NTS:
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
||||
|
@ -197,14 +198,14 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: 15
|
||||
- os: 14
|
||||
arch: ARM64
|
||||
name: MACOS_${{ matrix.arch }}_DEBUG_NTS
|
||||
runs-on: macos-${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
- name: brew
|
||||
uses: ./.github/actions/brew
|
||||
- name: ccache
|
||||
|
@ -228,6 +229,7 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
|
@ -251,7 +253,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
|
||||
|
@ -265,7 +267,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
|
||||
|
@ -297,6 +299,7 @@ jobs:
|
|||
./configure \
|
||||
--disable-debug \
|
||||
--enable-mbstring \
|
||||
--enable-opcache \
|
||||
--enable-option-checking=fatal \
|
||||
--enable-sockets \
|
||||
--enable-werror \
|
||||
|
@ -316,6 +319,7 @@ jobs:
|
|||
sudo mkdir -p /etc/php.d
|
||||
sudo chmod 777 /etc/php.d
|
||||
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
|
||||
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||
- name: Setup
|
||||
|
@ -327,7 +331,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 }}
|
||||
|
@ -367,9 +371,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
|
||||
|
|
236
.github/workflows/real-time-benchmark.yml
vendored
236
.github/workflows/real-time-benchmark.yml
vendored
|
@ -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,77 @@ 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
|
||||
|
||||
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
|
||||
|
||||
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 +102,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 +117,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: |
|
||||
|
|
2
.github/workflows/root.yml
vendored
2
.github/workflows/root.yml
vendored
|
@ -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
1
.gitignore
vendored
|
@ -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
|
||||
|
|
215
NEWS
215
NEWS
|
@ -1,203 +1,5 @@
|
|||
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)
|
||||
. The report_memleaks INI directive has been deprecated. (alexandre-daubois)
|
||||
. Constant redeclaration is deprecated and this behavior will trigger an
|
||||
error in PHP 9. (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)
|
||||
|
||||
- SPL:
|
||||
. Deprecate ArrayObject and ArrayIterator with objects. (Girgias)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
|
||||
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||
(Girgias)
|
||||
. Added support for partitioned cookies. (nielsdos)
|
||||
|
||||
14 Aug 2025, PHP 8.5.0beta1
|
||||
|
||||
- Core:
|
||||
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
|
||||
been deprecated. (Girgias)
|
||||
. The $exclude_disabled parameter of the get_defined_functions() function has
|
||||
been deprecated, as it no longer has any effect since PHP 8.0. (Girgias)
|
||||
. Terminating case statements with a semicolon instead of a colon has
|
||||
been deprecated. (theodorejb)
|
||||
. The backtick operator as an alias for shell_exec() has been deprecated.
|
||||
(timwolla)
|
||||
. Returning null from __debugInfo() has been deprecated. (DanielEScherzer)
|
||||
. Support #[\Override] on properties. (Jiří Pudil)
|
||||
|
||||
- Curl:
|
||||
. The curl_close() function has been deprecated. (DanielEScherzer)
|
||||
. The curl_share_close() function has been deprecated. (DanielEScherzer)
|
||||
|
||||
- Date:
|
||||
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
|
||||
deprecated. (jorgsowa)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the
|
||||
first when using ~ and :has). (nielsdos, lexborisov)
|
||||
|
||||
- FileInfo
|
||||
. The finfo_close() function has been deprecated. (timwolla)
|
||||
. The $context parameter of the finfo_buffer() function has been deprecated
|
||||
as it is ignored. (Girgias)
|
||||
|
||||
- GD:
|
||||
. The imagedestroy() function has been deprecated. (DanielEScherzer)
|
||||
|
||||
- Intl:
|
||||
. Intl's internal error mechanism has been modernized so that it
|
||||
indicates more accurately which call site caused what error.
|
||||
Moreover, some ext/date exceptions have been wrapped inside a
|
||||
IntlException now. (Girgias)
|
||||
. The intl.error_level INI setting has been deprecated. (Girgias)
|
||||
|
||||
- MySQLi:
|
||||
. The mysqli_execute() alias function has been deprecated. (timwolla)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias
|
||||
algorithms appears to be broken). (Jakub Zelenka)
|
||||
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
|
||||
(Girgias)
|
||||
. Implement #80495 (Enable to set padding in openssl_(sign|verify).
|
||||
(Jakub Zelenka)
|
||||
. Implement #47728 (openssl_pkcs7_sign ignores new openssl flags).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. The "uri:" DSN scheme has been deprecated due to security concerns with
|
||||
DSNs coming from remote URIs. (timwolla)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug GH-17927 (Reflection: have some indication of property hooks in
|
||||
`_property_string()`). (DanielEScherzer)
|
||||
. The setAccessible() methods of various Reflection objects have been
|
||||
deprecated, as those no longer have an effect. (timwolla)
|
||||
. ReflectionClass::getConstant() for constants that do not exist has been
|
||||
deprecated. (DanielEScherzer)
|
||||
. ReflectionProperty::getDefaultValue() for properties without default values
|
||||
has been deprecated. (DanielEScherzer)
|
||||
|
||||
- SPL:
|
||||
. Unregistering all autoloaders by passing the spl_autoload_call() function
|
||||
as a callback argument to spl_autoload_unregister() has been deprecated.
|
||||
Instead if this is needed, one should iterate over the return value of
|
||||
spl_autoload_functions() and call spl_autoload_unregister() on each
|
||||
value. (Girgias)
|
||||
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
|
||||
SplObjectStorage::detach() methods have been deprecated in favour of
|
||||
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
|
||||
SplObjectStorage::offsetUnset() respectively. (Girgias)
|
||||
|
||||
- Standard:
|
||||
. The socket_set_timeout() alias function has been deprecated. (timwolla)
|
||||
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
|
||||
opened directory has been deprecated. (Girgias)
|
||||
. Fixed bug GH-19153 (#[\Attribute] validation should error on
|
||||
trait/interface/enum/abstract class). (DanielEScherzer)
|
||||
|
||||
- XML:
|
||||
. The xml_parser_free() function has been deprecated. (DanielEScherzer)
|
||||
|
||||
31 Jul 2025, PHP 8.5.0alpha4
|
||||
|
||||
- Core:
|
||||
. Add clone-with support to the clone() function. (timwolla, edorian)
|
||||
. Fix support for non-userland stream notifiers. (timwolla)
|
||||
. Added PHP_BUILD_PROVIDER constant. (timwolla)
|
||||
. Fixed bug GH-19305 (Operands may be being released during comparison).
|
||||
(Arnaud)
|
||||
. Fixed bug GH-19306 (Generator can be resumed while fetching next value from
|
||||
delegated Generator). (Arnaud)
|
||||
. Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
|
||||
a non-Generator delegate crashes). (Arnaud)
|
||||
|
||||
- Curl:
|
||||
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
|
||||
. Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (thecaliskan)
|
||||
. Add support for CURLOPT_SSL_SIGNATURE_ALGORITHMS. (Ayesh Karunaratne)
|
||||
|
||||
- FPM:
|
||||
. Make FPM access log limit configurable using log_limit. (Jakub Zelenka)
|
||||
|
||||
- GD:
|
||||
. Fix incorrect comparison with result of php_stream_can_cast(). (Girgias)
|
||||
|
||||
- Intl:
|
||||
. Fix return value on failure for resourcebundle count handler. (Girgias)
|
||||
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Disallow changing opcache.memory_consumption when SHM is already set up.
|
||||
(timwolla)
|
||||
. Fixed bug GH-15074 (Compiling opcache statically into ZTS PHP fails).
|
||||
(Arnaud)
|
||||
. Make OPcache non-optional (Arnaud, timwolla)
|
||||
. Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for
|
||||
deprecations). (Arnaud, timwolla)
|
||||
. Fixed bug GH-19301 (opcache build failure). (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Add $digest_algo parameter to openssl_public_encrypt() and
|
||||
openssl_private_decrypt() functions. (Jakub Zelenka)
|
||||
|
||||
- POSIX:
|
||||
. posix_kill and posix_setpgid throws a ValueError on invalid process_id.
|
||||
(David Carlier)
|
||||
. posix_setpgid throws a ValueError on invalid process_group_id,
|
||||
posix_setrlimit throws a ValueError on invalid soft_limit and hard_limit
|
||||
arguments. (David Carlier)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when
|
||||
retrieved from ReflectionProperty::getSettableType()). (ilutov)
|
||||
|
||||
- Session:
|
||||
. Fixed GH-19197: build broken with ZEND_STRL usage with memcpy
|
||||
when implemented as macro. (David Carlier)
|
||||
|
||||
- Soap:
|
||||
. Fixed bug GH-19226 (Segfault when spawning new thread in soap extension).
|
||||
(Florian Engelhardt)
|
||||
|
||||
- Sockets:
|
||||
. socket_set_option for multicast context throws a ValueError
|
||||
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
|
||||
|
||||
- Standard:
|
||||
. Add HEIF/HEIC support to getimagesize. (Benstone Zhang)
|
||||
. Implement #71517 (Implement SVG support for getimagesize() and friends).
|
||||
(nielsdos)
|
||||
. Optimized PHP html_entity_decode function. (Artem Ukrainskiy)
|
||||
. Minor optimization to array_chunk(). (nielsdos)
|
||||
|
||||
- URI:
|
||||
. Empty host handling is fixed. (Máté Kocsis)
|
||||
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
|
||||
contains a port. Now, it triggers an exception; previously, the error
|
||||
was silently swallowed. (Máté Kocsis)
|
||||
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
|
||||
|
||||
17 Jul 2025, PHP 8.5.0alpha2
|
||||
|
||||
- Core:
|
||||
|
@ -239,7 +41,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)
|
||||
|
@ -333,8 +135,8 @@ PHP NEWS
|
|||
. Added grapheme_levenshtein() function. (Yuya Hamada)
|
||||
. Added Locale::addLikelySubtags/Locale::minimizeSubtags to handle
|
||||
adding/removing likely subtags to a locale. (David Carlier)
|
||||
. Added IntlListFormatter class to format a list of items with a locale,
|
||||
operands types and units. (BogdanUngureanu)
|
||||
. Added IntlListFormatter class to format a list of items with a locale
|
||||
, operands types and units. (BogdanUngureanu)
|
||||
. Fixed bug GH-18566 ([intl] Weird numeric sort in Collator). (nielsdos)
|
||||
|
||||
- LDAP:
|
||||
|
@ -358,7 +160,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:
|
||||
|
@ -368,7 +170,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)
|
||||
|
||||
|
@ -414,9 +216,8 @@ 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)
|
||||
|
||||
- Session:
|
||||
. session_start() throws a ValueError on option argument if not a hashmap
|
||||
|
@ -477,7 +278,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:
|
||||
|
@ -506,7 +307,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
|
||||
|
|
263
UPGRADING
263
UPGRADING
|
@ -44,15 +44,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. Traits are now bound before the parent class. This is a subtle behavioral
|
||||
change, but should more closely match user expectations, demonstrated by
|
||||
GH-15753 and GH-16198.
|
||||
. Errors emitted during compilation and class linking are now always delayed
|
||||
and handled after compilation or class linking. Fatal errors emitted during
|
||||
compilation or class linking cause any delayed errors to be handled
|
||||
immediately, without calling user-defined error handlers.
|
||||
. Exceptions thrown by user-defined error handlers when handling class linking
|
||||
errors are not promoted to fatal errors anymore and do not prevent linking.
|
||||
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
|
||||
an error during compilation. Previously, the attribute could be added, but when
|
||||
ReflectionAttribute::newInstance() was called an error would be thrown.
|
||||
|
||||
- DOM:
|
||||
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
|
||||
|
@ -80,20 +71,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
|
||||
honored.
|
||||
The --enable-opcache/--disable-opcache configure flags have been removed,
|
||||
and the build does not produce opcache.so or php_opcache.dll objects
|
||||
anymore.
|
||||
Using zend_extension=opcache.so or zend_extension=php_opcache.dll INI
|
||||
directives will emit a warning.
|
||||
|
||||
- PCNTL:
|
||||
. pcntl_exec() now throws ValueErrors when entries of the $args parameter
|
||||
contain null bytes.
|
||||
|
@ -182,8 +159,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
|
||||
|
@ -213,18 +188,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
first redirect thus if there is any follow up redirect, it won't go
|
||||
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
|
||||
to true.
|
||||
. Added support for CURLINFO_CONN_ID (libcurl >= 8.2.0) to the curl_getinfo()
|
||||
function. This constant allows retrieving the unique ID of the connection
|
||||
used by a cURL transfer. It is primarily useful when connection reuse or
|
||||
connection pooling logic is needed in PHP-level applications. When
|
||||
curl_getinfo() returns an array, this value is available as the "conn_id" key.
|
||||
. Added support for CURLINFO_QUEUE_TIME_T (libcurl >= 8.6.0) to the curl_getinfo()
|
||||
function. This constant allows retrieving the time (in microseconds) that the
|
||||
request spent in libcurl’s connection queue before it was sent.
|
||||
This value can also be retrieved by passing CURLINFO_QUEUE_TIME_T to the
|
||||
curl_getinfo() $option parameter.
|
||||
. Added support for CURLOPT_SSL_SIGNATURE_ALGORITHMS to specify the signature
|
||||
algorithms to use for TLS.
|
||||
|
||||
- DOM:
|
||||
. Added Dom\Element::$outerHTML.
|
||||
|
@ -253,11 +216,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:
|
||||
|
@ -276,16 +234,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
process was terminated unexpectedly. In such cases, a warning is emitted
|
||||
and the function returns false. Previously, these errors were silently
|
||||
ignored. This change affects only the sendmail transport.
|
||||
. getimagesize() now supports HEIF/HEIC images.
|
||||
. getimagesize() now supports SVG images when ext-libxml is also loaded.
|
||||
Similarly, image_type_to_extension() and image_type_to_mime_type()
|
||||
now also handle IMAGETYPE_SVG.
|
||||
. The array returned by getimagesize() now has two additional entries:
|
||||
"width_unit" and "height_unit" to indicate in which units the dimensions
|
||||
are expressed. These units are px by default. They are not necessarily
|
||||
the same (just to give one example: one may be cm and the other may be px).
|
||||
. setcookie() and setrawcookie() now support the "partitioned" key.
|
||||
RFC: https://wiki.php.net/rfc/CHIPS
|
||||
|
||||
- XSL:
|
||||
. The $namespace argument of XSLTProcessor::getParameter(),
|
||||
|
@ -312,7 +260,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
- FPM:
|
||||
. FPM with httpd ProxyPass decodes the full script path. Added
|
||||
fastcgi.script_path_encoded INI setting to prevent this new behavior.
|
||||
. FPM access log limit now respects log_limit value.
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
|
@ -330,122 +277,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
|
||||
. The report_memleaks INI directive has been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive
|
||||
. Constant redeclaration is deprecated and that behavior will trigger an
|
||||
error in PHP 9.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration
|
||||
|
||||
- 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
|
||||
. Using ArrayObject and ArrayIterator with objects has been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects
|
||||
|
||||
- Standard:
|
||||
. The socket_set_timeout() alias function has been deprecated.
|
||||
Use stream_set_timeout() instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
|
||||
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
|
||||
opened directory has been deprecated. Provide the last opened directory
|
||||
explicitly instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
|
||||
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||
This is because a byte can only hold a value within this interval.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
|
||||
|
||||
- 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
|
||||
========================================
|
||||
|
@ -470,15 +307,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
- libxml:
|
||||
. libxml_set_external_entity_loader() now has a formal return type of true.
|
||||
|
||||
- OpenSSL:
|
||||
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
|
||||
$digest_algo that allows specifying hash digest algorithm for OEAP padding.
|
||||
. openssl_sign() and openssl_verify() have new parameter $padding to allow
|
||||
using more secure RSA PSS padding.
|
||||
. openssl_cms_encrypt() $cipher_algo parameter can be a string with the
|
||||
cipher name. That allows to use more algorithms including AES GCM cipher
|
||||
algorithms for auth enveloped data.
|
||||
|
||||
- PCNTL:
|
||||
. pcntl_exec() now has a formal return type of false.
|
||||
. pcntl_waitid() takes an additional resource_usage argument to
|
||||
|
@ -511,28 +339,16 @@ PHP 8.5 UPGRADE NOTES
|
|||
an invalid file descriptor.
|
||||
. posix_fpathconf checks invalid file descriptors and sets
|
||||
last_error to EBADF and raises an E_WARNING message.
|
||||
. posix_kill throws a ValueError when the process_id argument is lower
|
||||
or greater than what supports the platform (signed integer or long
|
||||
range), posix_setpgid throws a ValueError when the process_id or
|
||||
the process_group_id is lower than zero or greater than
|
||||
what supports the platform.
|
||||
. posix_setrlimit throws a ValueError when the hard_limit of soft_limit
|
||||
argument are lower than -1 or if soft_limit is greater than hard_limit.
|
||||
|
||||
- Reflection:
|
||||
. The output of ReflectionClass::__toString() for enums has changed to
|
||||
. 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:
|
||||
|
@ -545,7 +361,7 @@ PHP 8.5 UPGRADE NOTES
|
|||
- Sockets:
|
||||
. socket_create_listen, socket_bind and socket_sendto throw a
|
||||
ValueError if the port is lower than 0 or greater than 65535,
|
||||
and also if any of the hints array entries are indexed numerically.
|
||||
also if any of the hints array entry is indexes numerically.
|
||||
. socket_addrinfo_lookup throws a TypeError if any of the hints
|
||||
values cannot be cast to int and can throw a ValueError if
|
||||
any of these values overflow.
|
||||
|
@ -555,8 +371,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. socket_create/socket_bind can create AF_PACKET family sockets.
|
||||
. socket_getsockname gets the interface index and its string
|
||||
representation with AF_PACKET socket.
|
||||
. socket_set_option with multicast context throws a ValueError
|
||||
when the created socket is not of AF_INET/AF_INET6 family.
|
||||
|
||||
- Tidy:
|
||||
. tidy::__construct/parseFile/parseString now throws a ValueError
|
||||
|
@ -582,10 +396,8 @@ PHP 8.5 UPGRADE NOTES
|
|||
. get_exception_handler() allows retrieving the current user-defined exception
|
||||
handler function.
|
||||
RFC: https://wiki.php.net/rfc/get-error-exception-handler
|
||||
. The clone language construct is now a function and supports reassigning
|
||||
(readonly) properties during cloning via the new $withProperties parameter.
|
||||
. The clone language construct is now a function.
|
||||
RFC: https://wiki.php.net/rfc/clone_with_v2
|
||||
. Added Closure::getCurrent() to receive currently executing closure.
|
||||
|
||||
- Curl:
|
||||
. curl_multi_get_handles() allows retrieving all CurlHandles current
|
||||
|
@ -611,9 +423,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. Added grapheme_levenshtein() function.
|
||||
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
|
||||
|
||||
- Opcache:
|
||||
. Added opcache_is_script_cached_in_file_cache().
|
||||
|
||||
- Pdo\Sqlite:
|
||||
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
|
||||
SQLite3::setAuthorizer(). The only interface difference is that the
|
||||
|
@ -631,7 +440,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
ReflectionConstant::getExtensionName() were introduced.
|
||||
. ReflectionConstant::getAttributes() was introduced.
|
||||
RFC: https://wiki.php.net/rfc/attributes-on-constants
|
||||
. ReflectionProperty::getMangledName() was introduced.
|
||||
|
||||
- Sqlite:
|
||||
. Sqlite3Stmt::busy to check if a statement had been fetched
|
||||
|
@ -645,22 +453,11 @@ 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.
|
||||
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
|
||||
|
||||
- URI:
|
||||
. Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode,
|
||||
Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException,
|
||||
Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError,
|
||||
and Uri\WhatWg\Url are added.
|
||||
RFC: https://wiki.php.net/rfc/url_parsing_api
|
||||
|
||||
========================================
|
||||
8. Removed Extensions and SAPIs
|
||||
========================================
|
||||
|
@ -675,33 +472,17 @@ PHP 8.5 UPGRADE NOTES
|
|||
CURLFOLLOW_FIRSTONLY.
|
||||
|
||||
- Fileinfo:
|
||||
. Upgraded file from 5.45 to 5.46.
|
||||
. Upgraded to file 5.46.
|
||||
. The return type of finfo_close() has been changed to true, rather
|
||||
than bool.
|
||||
|
||||
- Intl:
|
||||
. Intl's internal error mechanism has been modernized so that it
|
||||
indicates more accurately which call site caused what error.
|
||||
Moreover, some ext/date exceptions have been wrapped inside a
|
||||
IntlException now.
|
||||
|
||||
- Lexbor:
|
||||
. An always enabled lexbor extension is added. It contains the lexbor
|
||||
library that was separated from ext/dom for being reused among other
|
||||
extensions. The new extension is not directly exposed to userland.
|
||||
|
||||
- Opcache:
|
||||
. The Opcache extension is now always built into the PHP binary and is always
|
||||
loaded. The INI directives opcache.enable and opcache.enable_cli are still
|
||||
honored.
|
||||
|
||||
- URI:
|
||||
. An always enabled uri extension is added that can be used for handling
|
||||
URIs and URLs according to RFC 3986 and WHATWG URL.
|
||||
RFC: https://wiki.php.net/rfc/url_parsing_api
|
||||
|
||||
- PCRE:
|
||||
. Upgraded pcre2lib from 10.44 to 10.45.
|
||||
. Upgraded to pcre2lib from 10.44 to 10.45.
|
||||
|
||||
- PDO_Sqlite:
|
||||
. Increased minimum release version support from 3.7.7 to 3.7.17.
|
||||
|
@ -717,14 +498,11 @@ PHP 8.5 UPGRADE NOTES
|
|||
|
||||
- Core:
|
||||
. PHP_BUILD_DATE.
|
||||
. PHP_BUILD_PROVIDER.
|
||||
|
||||
- Curl:
|
||||
. CURLINFO_USED_PROXY.
|
||||
. CURLINFO_HTTPAUTH_USED.
|
||||
. CURLINFO_PROXYAUTH_USED.
|
||||
. CURLINFO_CONN_ID.
|
||||
. CURLINFO_QUEUE_TIME_T.
|
||||
. CURLOPT_INFILESIZE_LARGE.
|
||||
. CURLFOLLOW_ALL.
|
||||
. CURLFOLLOW_OBEYCODE.
|
||||
|
@ -734,13 +512,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.
|
||||
|
||||
|
@ -764,9 +535,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. T_VOID_CAST.
|
||||
. T_PIPE.
|
||||
|
||||
- Standard:
|
||||
. IMAGETYPE_SVG when libxml is loaded.
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
|
@ -775,11 +543,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
|
||||
|
@ -794,14 +557,11 @@ PHP 8.5 UPGRADE NOTES
|
|||
. The default value of opcache.jit_hot_loop is now 61 (a prime) to prevent it
|
||||
from being a multiple of loop iteration counts.
|
||||
It is recommended that this parameter is set to a prime number.
|
||||
. Changing opcache.memory_consumption when OPcache SHM is already set up
|
||||
will now correctly report a failure instead of silently doing nothing and
|
||||
showing misleading values in PHPInfo.
|
||||
|
||||
- OpenSSL:
|
||||
. Added openssl.libctx to select the OpenSSL library context type. Either
|
||||
custom libctx for each thread can be used or a single global (default)
|
||||
libctx is used.
|
||||
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
|
||||
|
@ -878,10 +638,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. The parts of the code that used SSE2 have been adapted to use SIMD
|
||||
with ARM NEON as well.
|
||||
|
||||
- Opcache:
|
||||
. Improved performance of fetching TLS variables in JIT'ed code in non-Glibc
|
||||
builds.
|
||||
|
||||
- ReflectionProperty:
|
||||
. Improved performance of the following methods: getValue(), getRawValue(),
|
||||
isInitialized(), setValue(), setRawValue().
|
||||
|
@ -896,7 +652,6 @@ PHP 8.5 UPGRADE NOTES
|
|||
. Improved unpack() performance with nameless repetitions by avoiding
|
||||
creating temporary strings and reparsing them.
|
||||
. Improved pack() performance.
|
||||
. Minor improvements in array_chunk() performance.
|
||||
|
||||
- XMLReader:
|
||||
. Improved property access performance.
|
||||
|
|
|
@ -23,15 +23,6 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
|
||||
instead of dlopen.
|
||||
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
|
||||
. The ptr field of the php_stream_notifier struct is now a void* instead
|
||||
of a zval. If the zval was used to store IS_PTR values only, the
|
||||
extra layer of indirection can be removed. In other cases a zval can
|
||||
be heap-allocated and stored in the pointer as a minimal change to keep
|
||||
compatibility.
|
||||
|
||||
- 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
|
||||
|
@ -75,15 +66,6 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
* zend_register_string_constant()
|
||||
* zend_register_stringl_constant()
|
||||
. EG(fake_scope) now is a _const_ zend_class_entry*.
|
||||
. zend_begin_record_errors() or EG(record_errors)=true cause errors to be
|
||||
delayed. Before, errors would be recorded but not delayed.
|
||||
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
|
||||
from the parent process after a fork().
|
||||
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
|
||||
|
||||
- standard
|
||||
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
|
||||
were removed. Use the corresponding headers in Zend/ instead.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
|
@ -101,12 +83,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).
|
||||
|
@ -148,24 +129,11 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
. The php_std_date() function has been removed. Use php_format_date() with
|
||||
the "D, d M Y H:i:s \\G\\M\\T" format instead.
|
||||
. Added php_url_encode_to_smart_str() to encode a URL to a smart_str buffer.
|
||||
. The functionality of getimagesize(), image_type_to_mime_type(),
|
||||
and image_type_to_extension() is now extensible using the internal APIs
|
||||
php_image_register_handler() and php_image_unregister_handler() in
|
||||
php_image.h.
|
||||
|
||||
========================
|
||||
4. OpCode changes
|
||||
========================
|
||||
|
||||
* New ZEND_DECLARE_ATTRIBUTED_CONST is used when a global constant is declared
|
||||
with `const` and has attributes; this opcode is used *instead* of the
|
||||
ZEND_DECLARE_CONST, and in addition to the name of the constant and the
|
||||
value to use, has a ZEND_OP_DATA with a pointer to the compiled attributes.
|
||||
|
||||
========================
|
||||
5. SAPI changes
|
||||
========================
|
||||
|
||||
- SAPIs must now call php_child_init() after a fork. If php-src code was
|
||||
executed in other threads than the one initiating the fork,
|
||||
refresh_memory_manager() must be called in every such thread.
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) /* {{{ */
|
||||
{
|
||||
|
|
21
Zend/Zend.m4
21
Zend/Zend.m4
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
3
Zend/tests/014.inc
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
/* dummy file for 014.phpt */
|
||||
?>
|
|
@ -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";
|
|
@ -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'
|
||||
|
|
|
@ -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) {
|
||||
}
|
|
@ -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);
|
||||
?>
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
--TEST--
|
||||
GH-19044: Protected properties must be scoped according to their prototype (protected(set) on non-hooked property)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class P {
|
||||
public mixed $foo { get => 42; }
|
||||
}
|
||||
|
||||
class C1 extends P {
|
||||
public protected(set) mixed $foo = 1;
|
||||
}
|
||||
|
||||
class C2 extends P {
|
||||
public protected(set) mixed $foo;
|
||||
|
||||
static function foo($c) { return $c->foo += 1; }
|
||||
}
|
||||
|
||||
var_dump(C2::foo(new C1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(43)
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||
Warning: Constant MY_CONST already defined in %s on line %d
|
||||
No attributes
|
||||
array(0) {
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ var_dump($reflection->getAttributes())
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||
Warning: Constant MY_CONST already defined in %s on line %d
|
||||
Has attributes (1)
|
||||
array(1) {
|
||||
[0]=>
|
||||
|
|
|
@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||
Warning: Constant MY_CONST already defined in %s on line %d
|
||||
Has attributes
|
||||
array(1) {
|
||||
[0]=>
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -1,15 +0,0 @@
|
|||
--TEST--
|
||||
#[\Override]: Properties: On trait.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
#[\Override]
|
||||
public mixed $t;
|
||||
}
|
||||
|
||||
echo "Done";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -20,4 +20,4 @@ define("TEST",3);
|
|||
|
||||
?>
|
||||
--EXPECT--
|
||||
error :Constant TEST already defined, this will be an error in PHP 9
|
||||
error :Constant TEST already defined
|
||||
|
|
|
@ -11,6 +11,7 @@ function boom()
|
|||
$thing = new Thing();
|
||||
xml_set_object($reader, $thing);
|
||||
die("ok\n");
|
||||
xml_parser_free($reader);
|
||||
}
|
||||
boom();
|
||||
?>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
16
Zend/tests/bug79668.phpt
Normal 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)
|
|
@ -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]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue