mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Compare commits
268 commits
php-8.5.0a
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e5f81bd74c | ||
![]() |
b73d8b373a | ||
![]() |
fd4db3e178 | ||
![]() |
987a3a5c8e | ||
![]() |
dcd3ef33b3 | ||
![]() |
1bba07ecc0 | ||
![]() |
f9d95c649e | ||
![]() |
cab46b27b9 | ||
![]() |
6009b8a100 | ||
![]() |
fb87b14b6c | ||
![]() |
9c754baa99 | ||
![]() |
708d8e9cfd | ||
![]() |
a3de2ce9ba | ||
![]() |
359f4420a4 | ||
![]() |
391d8132b6 | ||
![]() |
fdd27472de | ||
![]() |
aa992f36d3 | ||
![]() |
2650248a92 | ||
![]() |
222f7517a1 | ||
![]() |
cbb9ee8f5b | ||
![]() |
fd8dfe1bfd | ||
![]() |
7e01cf59bb | ||
![]() |
c8774f9e61 | ||
![]() |
bf64dfcd99 | ||
![]() |
290c9aef56 | ||
![]() |
60047025db | ||
![]() |
77dace78c3 | ||
![]() |
841f0b1515 | ||
![]() |
ba97d8636a | ||
![]() |
c8a4207400 | ||
![]() |
2b415e416e | ||
![]() |
b9ae9845ad | ||
![]() |
4aa43e2cd3 | ||
![]() |
a0bd2c9fcf | ||
![]() |
2f9e1adbdd | ||
![]() |
b7c26eb16c | ||
![]() |
fb7db498fb | ||
![]() |
20c8c12d9e | ||
![]() |
38beb44176 | ||
![]() |
c3bee21256 | ||
![]() |
57a88b216c | ||
![]() |
ffdc1044c9 | ||
![]() |
a68f3d6374 | ||
![]() |
699e5632b1 | ||
![]() |
9b13bb1ae4 | ||
![]() |
4de2ec3895 | ||
![]() |
65c961436d | ||
![]() |
571bded46e | ||
![]() |
347723af05 | ||
![]() |
0c044b35b7 | ||
![]() |
abb7f2879e | ||
![]() |
2b5d978a85 | ||
![]() |
25cbc15719 | ||
![]() |
dfa1307a64 | ||
![]() |
3dc962b9f7 | ||
![]() |
3d9d68e1ca | ||
![]() |
4d6dde595c | ||
![]() |
07a9c25c71 | ||
![]() |
47f9f3a3f6 | ||
![]() |
4d74dd0395 | ||
![]() |
8b5231388c | ||
![]() |
9b86533ce4 | ||
![]() |
10834d1572 | ||
![]() |
c5f79b8cf9 | ||
![]() |
6280dfc025 | ||
![]() |
c416191a00 | ||
![]() |
5f8d648af6 | ||
![]() |
d01aa02ef5 | ||
![]() |
702d18de99 | ||
![]() |
8f1a627e79 | ||
![]() |
91665eaa63 | ||
![]() |
33d38d059e | ||
![]() |
19ffe572bb | ||
![]() |
b57578f3b1 | ||
![]() |
fc86c249dc | ||
![]() |
aecf2a6e62 | ||
![]() |
e990b691c5 | ||
![]() |
284e622506 | ||
![]() |
731d36ac61 | ||
![]() |
066a977840 | ||
![]() |
c8d7318daf | ||
![]() |
bc475ada13 | ||
![]() |
dc0962c243 | ||
![]() |
ba21ab4ea0 | ||
![]() |
c064fc4fe8 | ||
![]() |
75931a2ce3 | ||
![]() |
f52a59ff4f | ||
![]() |
9e2aa658a8 | ||
![]() |
69f67f990d | ||
![]() |
2bb98cd8c8 | ||
![]() |
74c006fbab | ||
![]() |
d65025b53d | ||
![]() |
16872310d5 | ||
![]() |
1e108e9ab2 | ||
![]() |
8c5c03e33a | ||
![]() |
94a15cc92f | ||
![]() |
f64c6248b5 | ||
![]() |
7bf79ab666 | ||
![]() |
7b44bfd812 | ||
![]() |
ccb716dcad | ||
![]() |
922c225fbf | ||
![]() |
732069d98b | ||
![]() |
21625006e5 | ||
![]() |
5d86515772 | ||
![]() |
3bf21a0d43 | ||
![]() |
43a91089ca | ||
![]() |
be2889411a | ||
![]() |
db3f6d0bf0 | ||
![]() |
cc93bbb765 | ||
![]() |
99e6b0ecc8 | ||
![]() |
9673079903 | ||
![]() |
e4078a6a70 | ||
![]() |
fe88711b14 | ||
![]() |
140fc69b4a | ||
![]() |
c5143c0b22 | ||
![]() |
1f131e3ae6 | ||
![]() |
a3f34043de | ||
![]() |
11e6655624 | ||
![]() |
5cf45ba5ab | ||
![]() |
43420599f7 | ||
![]() |
ca5667bc14 | ||
![]() |
abe75ca850 | ||
![]() |
db5a3956f5 | ||
![]() |
aae35f3617 | ||
![]() |
080ba20d49 | ||
![]() |
2cd9233e42 | ||
![]() |
17826d31c6 | ||
![]() |
58501bd136 | ||
![]() |
bd2766ce79 | ||
![]() |
d1fceeec30 | ||
![]() |
c42e6d62d8 | ||
![]() |
3fc0149325 | ||
![]() |
77eac5ec82 | ||
![]() |
0c303b2043 | ||
![]() |
44618752f9 | ||
![]() |
c69f04dbab | ||
![]() |
aa9694bdd0 | ||
![]() |
7af4709d38 | ||
![]() |
c105571052 | ||
![]() |
b7ac56822d | ||
![]() |
32290b3529 | ||
![]() |
3088d64068 | ||
![]() |
3ddbad9589 | ||
![]() |
5583273906 | ||
![]() |
61790eb8a0 | ||
![]() |
9af00b174a | ||
![]() |
53fde8b5a8 | ||
![]() |
b5fb9555e1 | ||
![]() |
1c820750da | ||
![]() |
2e53aef1e8 | ||
![]() |
e30a8a883f | ||
![]() |
c3467bd173 | ||
![]() |
3aa4209ef6 | ||
![]() |
a8cea0c09b | ||
![]() |
0ac37fb74d | ||
![]() |
81c0aeaf5d | ||
![]() |
0b1aa86c71 | ||
![]() |
5be04e25fd | ||
![]() |
63cb81ff2c | ||
![]() |
d628ed5963 | ||
![]() |
1e0c8baf05 | ||
![]() |
bf6a74d2f9 | ||
![]() |
9cbc09d189 | ||
![]() |
a63e97667e | ||
![]() |
14034ad734 | ||
![]() |
e7c8361089 | ||
![]() |
c286cb8a1e | ||
![]() |
4a934005b4 | ||
![]() |
a9ab62d54d | ||
![]() |
0c82801384 | ||
![]() |
1820dd9b61 | ||
![]() |
6147be32fc | ||
![]() |
f08ac4f1c9 | ||
![]() |
871de14ceb | ||
![]() |
8199cad99f | ||
![]() |
d801a4634f | ||
![]() |
9ccd2ba9ff | ||
![]() |
5b3d0e4c09 | ||
![]() |
17328ef86b | ||
![]() |
d9000b3094 | ||
![]() |
0596135d20 | ||
![]() |
fbc705c3bd | ||
![]() |
cdfd663266 | ||
![]() |
dde094a442 | ||
![]() |
1c65cc3998 | ||
![]() |
d0274e74f8 | ||
![]() |
8512514a0f | ||
![]() |
36ec3370fb | ||
![]() |
d8e014dfbe | ||
![]() |
9f800aedfe | ||
![]() |
bfd42b060d | ||
![]() |
f077c9d233 | ||
![]() |
541a1e69d5 | ||
![]() |
44d63a8ac0 | ||
![]() |
234159d911 | ||
![]() |
7ba4453f8f | ||
![]() |
e9e432a35d | ||
![]() |
0d15bca041 | ||
![]() |
bd7ffc911d | ||
![]() |
9d29283392 | ||
![]() |
4d5bdef21a | ||
![]() |
9e334af6e4 | ||
![]() |
a02b2b8eb6 | ||
![]() |
051414bec6 | ||
![]() |
93ec0ac0f3 | ||
![]() |
fa85b38560 | ||
![]() |
cd13ba73e2 | ||
![]() |
b46c5e6186 | ||
![]() |
c50a715a5c | ||
![]() |
0d0f774a6a | ||
![]() |
fb2585f4e2 | ||
![]() |
4b6ebcc6e9 | ||
![]() |
02af9acfca | ||
![]() |
67d6160462 | ||
![]() |
c9836b03ce | ||
![]() |
841afdc486 | ||
![]() |
b3551cc31f | ||
![]() |
b35dbe474e | ||
![]() |
17b8706bf6 | ||
![]() |
ef98a6e723 | ||
![]() |
ac1cd9c26e | ||
![]() |
433c00b348 | ||
![]() |
cd80ed6f7b | ||
![]() |
4e21924271 | ||
![]() |
9aa8e8825f | ||
![]() |
98e0dbcefe | ||
![]() |
a66b631bce | ||
![]() |
961412d6f2 | ||
![]() |
345e04b619 | ||
![]() |
55a3e33bb1 | ||
![]() |
776d6f8660 | ||
![]() |
e8f88e746b | ||
![]() |
6f630a882d | ||
![]() |
63f9e4945d | ||
![]() |
105c1e9896 | ||
![]() |
2c4d4a6f18 | ||
![]() |
18dee43e02 | ||
![]() |
a262419398 | ||
![]() |
b3f4863373 | ||
![]() |
d0fad34230 | ||
![]() |
65b9cf1db3 | ||
![]() |
ada10741b4 | ||
![]() |
15990de89e | ||
![]() |
0afa04a474 | ||
![]() |
5d40592fe2 | ||
![]() |
e43074a1d8 | ||
![]() |
dad28a30f3 | ||
![]() |
0591defd6f | ||
![]() |
771bfaf34d | ||
![]() |
9ce51dad8b | ||
![]() |
cee8ed235a | ||
![]() |
b82c8ba7fe | ||
![]() |
a96b05e63f | ||
![]() |
659f55a617 | ||
![]() |
781d77ac54 | ||
![]() |
6fa8a25a40 | ||
![]() |
9db21e18ad | ||
![]() |
049651dccc | ||
![]() |
bdffded054 | ||
![]() |
37a59e55e8 | ||
![]() |
a430ee2dd2 | ||
![]() |
0406a55c92 | ||
![]() |
e1cf66b6cb | ||
![]() |
0fc62310b1 | ||
![]() |
246e8e53ba | ||
![]() |
a5219c1ecc | ||
![]() |
a08df32f18 | ||
![]() |
5bd5f352e5 |
1024 changed files with 12439 additions and 9333 deletions
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@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Install dependencies
|
||||
run: pip install -r docs/requirements.txt
|
||||
- name: Check formatting
|
||||
|
|
59
.github/workflows/nightly.yml
vendored
59
.github/workflows/nightly.yml
vendored
|
@ -54,7 +54,7 @@ jobs:
|
|||
runs-on: [self-hosted, gentoo, ppc64]
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: System info
|
||||
|
@ -95,7 +95,7 @@ jobs:
|
|||
image: 'alpine:3.20.1'
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apk
|
||||
|
@ -206,7 +206,7 @@ jobs:
|
|||
runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Create MSSQL container
|
||||
|
@ -306,7 +306,7 @@ jobs:
|
|||
FIREBIRD_PASSWORD: test
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -374,7 +374,7 @@ jobs:
|
|||
runs-on: macos-${{ matrix.os }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: brew
|
||||
|
@ -449,7 +449,7 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Create MSSQL container
|
||||
|
@ -502,7 +502,7 @@ jobs:
|
|||
USE_TRACKED_ALLOC: 1
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -553,14 +553,17 @@ 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
|
||||
printf "Testing amp/%s\n" "$repository"
|
||||
echo "::group::$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
|
||||
|
@ -584,14 +587,17 @@ jobs:
|
|||
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
|
||||
X=0
|
||||
for repository in $repositories; do
|
||||
printf "Testing reactphp/%s\n" "$repository"
|
||||
echo "::group::$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
|
||||
|
@ -616,15 +622,19 @@ 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()", "/** @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()", "#[\\PHPUnit\\Framework\\Attributes\\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()", "/** @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()", "#[\\PHPUnit\\Framework\\Attributes\\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
|
||||
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
|
||||
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::"
|
||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||
X=1;
|
||||
echo "Failed"
|
||||
fi
|
||||
done
|
||||
exit $X
|
||||
|
@ -695,7 +705,7 @@ jobs:
|
|||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Create MSSQL container
|
||||
|
@ -758,7 +768,7 @@ jobs:
|
|||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -849,7 +859,7 @@ jobs:
|
|||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: apt
|
||||
|
@ -899,38 +909,38 @@ jobs:
|
|||
CXX: ccache g++
|
||||
steps:
|
||||
- name: git checkout PHP
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
path: php
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: git checkout apcu
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: krakjoe/apcu
|
||||
path: apcu
|
||||
- name: git checkout imagick
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: Imagick/imagick
|
||||
path: imagick
|
||||
- name: git checkout memcached
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: php-memcached-dev/php-memcached
|
||||
path: memcached
|
||||
- name: git checkout redis
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: phpredis/phpredis
|
||||
path: redis
|
||||
- name: git checkout xdebug
|
||||
if: false
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: xdebug/xdebug
|
||||
path: xdebug
|
||||
- name: git checkout yaml
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: php/pecl-file_formats-yaml
|
||||
path: yaml
|
||||
|
@ -1040,7 +1050,7 @@ jobs:
|
|||
- name: git config
|
||||
run: git config --global core.autocrlf false && git config --global core.eol lf
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Setup
|
||||
|
@ -1058,9 +1068,10 @@ 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@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: FreeBSD
|
||||
|
|
15
.github/workflows/push.yml
vendored
15
.github/workflows/push.yml
vendored
|
@ -82,7 +82,7 @@ jobs:
|
|||
timeout-minutes: 50
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: apt
|
||||
uses: ./.github/actions/apt-x64
|
||||
- name: System info
|
||||
|
@ -166,7 +166,7 @@ jobs:
|
|||
FIREBIRD_PASSWORD: test
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: apt
|
||||
uses: ./.github/actions/apt-x32
|
||||
- name: ccache
|
||||
|
@ -203,7 +203,7 @@ jobs:
|
|||
timeout-minutes: 50
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: brew
|
||||
uses: ./.github/actions/brew
|
||||
- name: ccache
|
||||
|
@ -250,7 +250,7 @@ jobs:
|
|||
- name: git config
|
||||
run: git config --global core.autocrlf false && git config --global core.eol lf
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Setup
|
||||
uses: ./.github/actions/setup-windows
|
||||
- name: Build
|
||||
|
@ -264,7 +264,7 @@ jobs:
|
|||
timeout-minutes: 50
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# ASLR can cause a lot of noise due to missed sse opportunities for memcpy
|
||||
|
@ -326,7 +326,7 @@ jobs:
|
|||
mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
|
||||
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
|
||||
- name: git checkout benchmarking-data
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: php/benchmarking-data
|
||||
ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
|
||||
|
@ -366,8 +366,9 @@ 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@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: FreeBSD
|
||||
uses: ./.github/actions/freebsd
|
||||
|
|
238
.github/workflows/real-time-benchmark.yml
vendored
238
.github/workflows/real-time-benchmark.yml
vendored
|
@ -2,14 +2,94 @@ 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'
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
|
||||
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
|
||||
|
@ -23,79 +103,149 @@ jobs:
|
|||
sudo apt-get update -y
|
||||
sudo apt-get install -y terraform=1.5.7-*
|
||||
- name: Checkout benchmark suite
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: 'kocsismate/php-version-benchmarks'
|
||||
ref: 'main'
|
||||
fetch-depth: 1
|
||||
path: 'php-version-benchmarks'
|
||||
- name: Checkout php-src
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout php-src (benchmarked version)
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: 'php/php-src'
|
||||
ref: '${{ github.sha }}'
|
||||
repository: '${{ env.REPOSITORY }}'
|
||||
ref: '${{ env.COMMIT }}'
|
||||
fetch-depth: 100
|
||||
path: 'php-version-benchmarks/tmp/php_master'
|
||||
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'
|
||||
- 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
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: php/real-time-benchmark-data
|
||||
ssh-key: ${{ secrets.PHP_VERSION_BENCHMARK_RESULTS_DEPLOY_KEY }}
|
||||
path: 'php-version-benchmarks/docs/results'
|
||||
- name: Set benchmark config
|
||||
- name: Setup infra 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
|
||||
|
||||
YEAR="$(date '+%Y')"
|
||||
DATABASE="./php-version-benchmarks/docs/results/$YEAR/database.tsv"
|
||||
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"
|
||||
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_master/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
|
||||
LAST_RESULT_SHA="$(cd ./php-version-benchmarks/tmp/php_${{ env.ID }}/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
|
||||
fi
|
||||
|
||||
BASELINE_SHA="d5f6e56610c729710073350af318c4ea1b292cfe"
|
||||
BASELINE_SHORT_SHA="$(echo "$BASELINE_SHA" | cut -c1-4)"
|
||||
cat << EOF > ./php-version-benchmarks/config/php/previous.ini
|
||||
PHP_NAME="PHP - previous ${{ env.BRANCH }}"
|
||||
PHP_ID=php_previous
|
||||
|
||||
# Set config for the baseline PHP version
|
||||
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_baseline.ini
|
||||
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - baseline@'"$BASELINE_SHORT_SHA"'"/g' ./php-version-benchmarks/config/php/master_baseline.ini
|
||||
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_baseline/g" ./php-version-benchmarks/config/php/master_baseline.ini
|
||||
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$BASELINE_SHA/g" ./php-version-benchmarks/config/php/master_baseline.ini
|
||||
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_baseline.ini
|
||||
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
|
||||
PHP_BRANCH=${{ env.BRANCH }}
|
||||
PHP_COMMIT=$LAST_RESULT_SHA
|
||||
|
||||
# Set config for the previous PHP version
|
||||
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_last.ini
|
||||
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - previous master"/g' ./php-version-benchmarks/config/php/master_last.ini
|
||||
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_previous/g" ./php-version-benchmarks/config/php/master_last.ini
|
||||
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$LAST_RESULT_SHA/g" ./php-version-benchmarks/config/php/master_last.ini
|
||||
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_last.ini
|
||||
PHP_OPCACHE=1
|
||||
PHP_JIT=0
|
||||
EOF
|
||||
- name: Setup PHP config - benchmarked PHP version
|
||||
run: |
|
||||
set -e
|
||||
|
||||
# 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
|
||||
cat << EOF > ./php-version-benchmarks/config/php/this.ini
|
||||
PHP_NAME="PHP - ${{ env.BRANCH }}"
|
||||
PHP_ID=php_${{ env.ID }}
|
||||
|
||||
# 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
|
||||
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 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
|
||||
|
@ -104,6 +254,7 @@ 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
|
||||
|
||||
|
@ -119,6 +270,21 @@ 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@v4
|
||||
- uses: actions/checkout@v5
|
||||
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,6 +131,7 @@ config.h.in
|
|||
/sapi/cgi/php-cgi
|
||||
/sapi/fpm/php-fpm
|
||||
/sapi/phpdbg/phpdbg
|
||||
/sapi/fuzzer/php-fuzz-*
|
||||
/scripts/php-config
|
||||
/scripts/phpize
|
||||
php
|
||||
|
|
135
NEWS
135
NEWS
|
@ -1,23 +1,130 @@
|
|||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 8.5.0beta1
|
||||
?? ??? ????, PHP 8.5.0beta2
|
||||
|
||||
- Core:
|
||||
. Fixed bug GH-19305 (Operands may be being released during comparison).
|
||||
(Arnaud)
|
||||
. Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler()
|
||||
triggers "Constant already defined" warning). (ilutov)
|
||||
. Fixed bug GH-19476 (pipe operator fails to correctly handle returning
|
||||
by reference). (alexandre-daubois)
|
||||
|
||||
- ODBC:
|
||||
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
|
||||
|
||||
- OpenSSL:
|
||||
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- Session:
|
||||
. Added support for partitioned cookies. (nielsdos)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
|
||||
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||
(Girgias)
|
||||
. Added support for partitioned cookies. (nielsdos)
|
||||
|
||||
14 Aug 2025, PHP 8.5.0beta1
|
||||
|
||||
- Core:
|
||||
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
|
||||
been deprecated. (Girgias)
|
||||
. The $exclude_disabled parameter of the get_defined_functions() function has
|
||||
been deprecated, as it no longer has any effect since PHP 8.0. (Girgias)
|
||||
. Terminating case statements with a semicolon instead of a colon has
|
||||
been deprecated. (theodorejb)
|
||||
. The backtick operator as an alias for shell_exec() has been deprecated.
|
||||
(timwolla)
|
||||
. Returning null from __debugInfo() has been deprecated. (DanielEScherzer)
|
||||
. Support #[\Override] on properties. (Jiří Pudil)
|
||||
|
||||
- Curl:
|
||||
. The curl_close() function has been deprecated. (DanielEScherzer)
|
||||
. The curl_share_close() function has been deprecated. (DanielEScherzer)
|
||||
|
||||
- Date:
|
||||
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
|
||||
deprecated. (jorgsowa)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the
|
||||
first when using ~ and :has). (nielsdos, lexborisov)
|
||||
|
||||
- FileInfo
|
||||
. The finfo_close() function has been deprecated. (timwolla)
|
||||
. The $context parameter of the finfo_buffer() function has been deprecated
|
||||
as it is ignored. (Girgias)
|
||||
|
||||
- GD:
|
||||
. The imagedestroy() function has been deprecated. (DanielEScherzer)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
|
||||
. 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)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug GH-19301 (opcache build failure). (Remi)
|
||||
- MySQLi:
|
||||
. The mysqli_execute() alias function has been deprecated. (timwolla)
|
||||
|
||||
31 Jul 2025, PHP 8.5.0alpha3
|
||||
- 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)
|
||||
|
@ -32,6 +139,7 @@ PHP NEWS
|
|||
|
||||
- Intl:
|
||||
. Fix return value on failure for resourcebundle count handler. (Girgias)
|
||||
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Disallow changing opcache.memory_consumption when SHM is already set up.
|
||||
|
@ -41,6 +149,7 @@ PHP NEWS
|
|||
. Make OPcache non-optional (Arnaud, timwolla)
|
||||
. Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for
|
||||
deprecations). (Arnaud, timwolla)
|
||||
. Fixed bug GH-19301 (opcache build failure). (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Add $digest_algo parameter to openssl_public_encrypt() and
|
||||
|
@ -124,7 +233,7 @@ PHP NEWS
|
|||
|
||||
- CURL:
|
||||
. Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY
|
||||
values for CURLOPT_FOLLOLOCATION curl_easy_setopt option. (David Carlier)
|
||||
values for CURLOPT_FOLLOWLOCATION curl_easy_setopt option. (David Carlier)
|
||||
|
||||
- COM:
|
||||
. Fixed property access of PHP objects wrapped in variant. (cmb)
|
||||
|
@ -243,7 +352,7 @@ PHP NEWS
|
|||
|
||||
- OpenSSL:
|
||||
. Added openssl.libctx INI that allows to select the OpenSSL library context
|
||||
type and convert verious parts of the extension to use the custom libctx.
|
||||
type and convert various parts of the extension to use the custom libctx.
|
||||
(Jakub Zelenka)
|
||||
|
||||
- Output:
|
||||
|
@ -253,7 +362,7 @@ PHP NEWS
|
|||
. Extend pcntl_waitid with rusage parameter. (vrza)
|
||||
|
||||
- PCRE:
|
||||
. Upgraded to pre2lib from 10.44 to 10.45. (nielsdos)
|
||||
. Upgraded to pcre2lib from 10.44 to 10.45. (nielsdos)
|
||||
. Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
|
||||
(mvorisek)
|
||||
|
||||
|
@ -299,7 +408,7 @@ PHP NEWS
|
|||
(DanielEScherzer)
|
||||
. Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF
|
||||
zval for uninitialized typed properties). (nielsdos)
|
||||
. Fixed bug GH-15766 (ReflectionClass::toString() should have better output
|
||||
. Fixed bug GH-15766 (ReflectionClass::__toString() should have better output
|
||||
for enums). (DanielEScherzer)
|
||||
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
|
||||
|
||||
|
@ -362,7 +471,7 @@ PHP NEWS
|
|||
(David Carlier)
|
||||
|
||||
- Sodium:
|
||||
. Fix overall theorical overflows on zend_string buffer allocations.
|
||||
. Fix overall theoretical overflows on zend_string buffer allocations.
|
||||
(David Carlier/nielsdos)
|
||||
|
||||
- Sqlite:
|
||||
|
@ -391,7 +500,7 @@ PHP NEWS
|
|||
(cmb)
|
||||
|
||||
- Tests:
|
||||
. Allow to shuffle tests even in non-parallell mode. (dhuang00)
|
||||
. Allow to shuffle tests even in non-parallel mode. (dhuang00)
|
||||
|
||||
- Tidy:
|
||||
. tidy::__construct/parseFile/parseString methods throw an exception if
|
||||
|
|
163
UPGRADING
163
UPGRADING
|
@ -50,6 +50,9 @@ PHP 8.5 UPGRADE NOTES
|
|||
immediately, without calling user-defined error handlers.
|
||||
. Exceptions thrown by user-defined error handlers when handling class linking
|
||||
errors are not promoted to fatal errors anymore and do not prevent linking.
|
||||
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
|
||||
an error during compilation. Previously, the attribute could be added, but when
|
||||
ReflectionAttribute::newInstance() was called an error would be thrown.
|
||||
|
||||
- DOM:
|
||||
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
|
||||
|
@ -77,6 +80,10 @@ 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
|
||||
|
@ -175,6 +182,8 @@ 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
|
||||
|
@ -244,6 +253,11 @@ 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:
|
||||
|
@ -263,15 +277,15 @@ PHP 8.5 UPGRADE NOTES
|
|||
and the function returns false. Previously, these errors were silently
|
||||
ignored. This change affects only the sendmail transport.
|
||||
. getimagesize() now supports HEIF/HEIC images.
|
||||
|
||||
- Standard:
|
||||
. getimagesize() now supports SVG images when ext-libxml is also loaded.
|
||||
Similarly, image_type_to_extension() and image_type_to_extension()
|
||||
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(),
|
||||
|
@ -316,12 +330,115 @@ PHP 8.5 UPGRADE NOTES
|
|||
one will still be used. If a user output handler returns a non-string and
|
||||
produces output, the warning about producing an output is emitted first.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
|
||||
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
|
||||
been deprecated, use (bool), (int), (float), and (string) respectively.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names
|
||||
. The $exclude_disabled parameter of the get_defined_functions() function has
|
||||
been deprecated, as it no longer has any effect since PHP 8.0.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
|
||||
. Terminating case statements with a semicolon instead of a colon has
|
||||
been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement
|
||||
. The backtick operator as an alias for shell_exec() has been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
|
||||
. Returning null from __debugInfo() has been deprecated.
|
||||
Return an empty array instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
|
||||
|
||||
- Curl:
|
||||
. The curl_close() function has been deprecated, as CurlHandle objects are
|
||||
freed automatically.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close
|
||||
. The curl_share_close() function has been deprecated, as CurlShareHandle
|
||||
objects are freed automatically.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close
|
||||
|
||||
- Date:
|
||||
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
|
||||
deprecated. This is because the associated timezone is ignored and always
|
||||
uses GMT.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
|
||||
|
||||
- FileInfo:
|
||||
. The finfo_close() function has been deprecated.
|
||||
As finfo objects are freed automatically.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
|
||||
. The $context parameter of the finfo_buffer() function has been deprecated
|
||||
as it is ignored.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
|
||||
|
||||
- GD:
|
||||
. The imagedestroy() function has been deprecated, as GdImage objects are
|
||||
freed automatically.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy
|
||||
|
||||
- Hash:
|
||||
. The MHASH_* constants have been deprecated. These have been overlooked
|
||||
when the mhash*() function family has been deprecated per
|
||||
https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
|
||||
|
||||
- Intl:
|
||||
. The intl.error_level INI setting has been deprecated.
|
||||
Errors should either be checked manually or exceptions should be enabled
|
||||
by using the intl.use_exceptions INI setting.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting
|
||||
|
||||
- MySQLi:
|
||||
. The mysqli_execute() alias function has been deprecated.
|
||||
Use mysqli_stmt_execute() instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
|
||||
|
||||
- OpenSSL:
|
||||
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
|
||||
This is because it is either ignored, or truncates the key, which can be
|
||||
a vulnerability.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
|
||||
|
||||
- PDO:
|
||||
. The "uri:" DSN scheme has been deprecated due to security concerns with
|
||||
DSNs coming from remote URIs.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
|
||||
|
||||
- Reflection:
|
||||
. The setAccessible() methods of various Reflection objects have been
|
||||
deprecated, as those no longer have an effect.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
|
||||
. Calling ReflectionClass::getConstant() for constants that do not exist has
|
||||
been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants
|
||||
. Calling ReflectionProperty::getDefaultValue() for properties without default
|
||||
values has been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values
|
||||
|
||||
- SPL:
|
||||
. Unregistering all autoloaders by passing the spl_autoload_call() function
|
||||
as a callback argument to spl_autoload_unregister() has been deprecated.
|
||||
Instead if this is needed, one should iterate over the return value of
|
||||
spl_autoload_functions() and call spl_autoload_unregister() on each value.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister
|
||||
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
|
||||
SplObjectStorage::detach() methods have been deprecated in favour of
|
||||
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
|
||||
SplObjectStorage::offsetUnset() respectively.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
|
||||
|
||||
- Standard:
|
||||
. The socket_set_timeout() alias function has been deprecated.
|
||||
Use stream_set_timeout() instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
|
||||
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
|
||||
opened directory has been deprecated. Provide the last opened directory
|
||||
explicitly instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
|
||||
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||
This is because a byte can only hold a value within this interval.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
|
||||
|
||||
- XML:
|
||||
. The xml_parser_free() function has been deprecated, as XMLParser objects
|
||||
are freed automatically.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free
|
||||
|
||||
========================================
|
||||
5. Changed Functions
|
||||
========================================
|
||||
|
@ -348,7 +465,12 @@ PHP 8.5 UPGRADE NOTES
|
|||
|
||||
- OpenSSL:
|
||||
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
|
||||
$digest_algo that allows specifying hash digest algorith for OEAP padding.
|
||||
$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.
|
||||
|
@ -391,14 +513,19 @@ PHP 8.5 UPGRADE NOTES
|
|||
argument are lower than -1 or if soft_limit is greater than hard_limit.
|
||||
|
||||
- Reflection:
|
||||
. The output of ReflectionClass::toString() for enums has changed to
|
||||
. The output of ReflectionClass::__toString() for enums has changed to
|
||||
better indicate that the class is an enum, and that the enum cases
|
||||
are enum cases rather than normal class constants.
|
||||
. The output of ReflectionProperty::__toString() for properties with
|
||||
hooks has changed to indicate what hooks the property has, whether those
|
||||
hooks are final, and whether the property is virtual. This also affects
|
||||
the output of ReflectionClass::__toString() when a class contains hooked
|
||||
properties.
|
||||
|
||||
- Session:
|
||||
. session_start is stricter in regard to the option argument.
|
||||
It throws a ValueError if the whole is not a hashmap or
|
||||
a TypeError if read_on_close value is not a valid type
|
||||
a TypeError if read_and_close value is not a valid type
|
||||
compatible with int.
|
||||
|
||||
- SNMP:
|
||||
|
@ -541,6 +668,12 @@ PHP 8.5 UPGRADE NOTES
|
|||
. The return type of finfo_close() has been changed to true, rather
|
||||
than bool.
|
||||
|
||||
- Intl:
|
||||
. Intl's internal error mechanism has been modernized so that it
|
||||
indicates more accurately which call site caused what error.
|
||||
Moreover, some ext/date exceptions have been wrapped inside a
|
||||
IntlException now.
|
||||
|
||||
- Lexbor:
|
||||
. An always enabled lexbor extension is added. It contains the lexbor
|
||||
library that was separated from ext/dom for being reused among other
|
||||
|
@ -590,6 +723,13 @@ 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.
|
||||
|
||||
|
@ -624,6 +764,11 @@ 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
|
||||
|
@ -643,9 +788,9 @@ PHP 8.5 UPGRADE NOTES
|
|||
showing misleading values in PHPInfo.
|
||||
|
||||
- OpenSSL:
|
||||
Added openssl.libctx to select the OpenSSL library context type. Either
|
||||
custom libctx for each thread can be used or a single global (default)
|
||||
libctx is used.
|
||||
. Added openssl.libctx to select the OpenSSL library context type. Either
|
||||
custom libctx for each thread can be used or a single global (default)
|
||||
libctx is used.
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
|
|
|
@ -29,6 +29,10 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
be heap-allocated and stored in the pointer as a minimal change to keep
|
||||
compatibility.
|
||||
|
||||
- Hash
|
||||
. Hash functions now use proper hash_spec_result enum for return values
|
||||
instead of using SUCCESS and FAILURE.
|
||||
|
||||
- Zend
|
||||
. Added zend_safe_assign_to_variable_noref() function to safely assign
|
||||
a value to a non-reference zval.
|
||||
|
@ -75,6 +79,7 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
delayed. Before, errors would be recorded but not delayed.
|
||||
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
|
||||
from the parent process after a fork().
|
||||
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
|
||||
|
||||
- standard
|
||||
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
|
||||
|
@ -96,11 +101,12 @@ 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).
|
||||
|
|
|
@ -420,6 +420,14 @@ 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,6 +98,10 @@ 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,7 +128,4 @@ 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,6 +22,7 @@
|
|||
#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) {
|
||||
|
@ -816,7 +817,7 @@ ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *op
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
|
||||
static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
|
||||
{
|
||||
zend_basic_block *blocks = ssa->cfg.blocks;
|
||||
zend_ssa_block *ssa_blocks = ssa->blocks;
|
||||
|
@ -824,15 +825,6 @@ static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build
|
|||
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;
|
||||
|
@ -916,22 +908,90 @@ static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build
|
|||
}
|
||||
|
||||
ssa->vars_count = ssa_vars_count;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
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;
|
||||
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--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp) {
|
||||
free_alloca(tmp, use_heap);
|
||||
}
|
||||
free_alloca(save_vars, save_vars_use_heap);
|
||||
ZEND_WORKLIST_STACK_FREE_ALLOCA(&work, work_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,28 +193,21 @@ AS_VAR_IF([GCC], [yes],
|
|||
|
||||
dnl Check if compiler supports -Wno-clobbered (only GCC).
|
||||
AX_CHECK_COMPILE_FLAG([-Wno-clobbered],
|
||||
[CFLAGS="-Wno-clobbered $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-Wno-clobbered $CFLAGS"])
|
||||
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"],,
|
||||
[-Werror])
|
||||
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],
|
||||
[CFLAGS="-Wduplicated-cond $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-Wduplicated-cond $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wlogical-op],
|
||||
[CFLAGS="-Wlogical-op $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-Wlogical-op $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wformat-truncation],
|
||||
[CFLAGS="-Wformat-truncation $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-Wformat-truncation $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],
|
||||
[CFLAGS="-Wstrict-prototypes $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-Wstrict-prototypes $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-fno-common],
|
||||
[CFLAGS="-fno-common $CFLAGS"],,
|
||||
[-Werror])
|
||||
[CFLAGS="-fno-common $CFLAGS"])
|
||||
|
||||
ZEND_CHECK_ALIGNMENT
|
||||
ZEND_CHECK_SIGNALS
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<?php
|
||||
/* dummy file for 014.phpt */
|
||||
?>
|
11
Zend/tests/array_unpack/gh19303.phpt
Normal file
11
Zend/tests/array_unpack/gh19303.phpt
Normal file
|
@ -0,0 +1,11 @@
|
|||
--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((integer)ini_get("zend.assertions"));
|
||||
var_dump((int)ini_get("zend.assertions"));
|
||||
ini_set("zend.assertions", 0);
|
||||
var_dump((integer)ini_get("zend.assertions"));
|
||||
var_dump((int)ini_get("zend.assertions"));
|
||||
assert(false);
|
||||
ini_set("zend.assertions", 1);
|
||||
var_dump((integer)ini_get("zend.assertions"));
|
||||
var_dump((int)ini_get("zend.assertions"));
|
||||
assert(true);
|
||||
var_dump(true);
|
||||
?>
|
||||
|
|
12
Zend/tests/attributes/Attribute/Attribute_on_abstract.phpt
Normal file
12
Zend/tests/attributes/Attribute/Attribute_on_abstract.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--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
|
12
Zend/tests/attributes/Attribute/Attribute_on_enum.phpt
Normal file
12
Zend/tests/attributes/Attribute/Attribute_on_enum.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--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
|
12
Zend/tests/attributes/Attribute/Attribute_on_interface.phpt
Normal file
12
Zend/tests/attributes/Attribute/Attribute_on_interface.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--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
|
12
Zend/tests/attributes/Attribute/Attribute_on_trait.phpt
Normal file
12
Zend/tests/attributes/Attribute/Attribute_on_trait.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--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
|
||||
|
|
39
Zend/tests/attributes/override/properties_01.phpt
Normal file
39
Zend/tests/attributes/override/properties_01.phpt
Normal file
|
@ -0,0 +1,39 @@
|
|||
--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
|
15
Zend/tests/attributes/override/properties_02.phpt
Normal file
15
Zend/tests/attributes/override/properties_02.phpt
Normal file
|
@ -0,0 +1,15 @@
|
|||
--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
|
21
Zend/tests/attributes/override/properties_03.phpt
Normal file
21
Zend/tests/attributes/override/properties_03.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--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
|
21
Zend/tests/attributes/override/properties_04.phpt
Normal file
21
Zend/tests/attributes/override/properties_04.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--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
|
26
Zend/tests/attributes/override/properties_05.phpt
Normal file
26
Zend/tests/attributes/override/properties_05.phpt
Normal file
|
@ -0,0 +1,26 @@
|
|||
--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
|
15
Zend/tests/attributes/override/properties_06.phpt
Normal file
15
Zend/tests/attributes/override/properties_06.phpt
Normal file
|
@ -0,0 +1,15 @@
|
|||
--TEST--
|
||||
#[\Override]: Properties: On trait.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
#[\Override]
|
||||
public mixed $t;
|
||||
}
|
||||
|
||||
echo "Done";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
19
Zend/tests/attributes/override/properties_07.phpt
Normal file
19
Zend/tests/attributes/override/properties_07.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
23
Zend/tests/attributes/override/properties_08.phpt
Normal file
23
Zend/tests/attributes/override/properties_08.phpt
Normal file
|
@ -0,0 +1,23 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_09.phpt
Normal file
19
Zend/tests/attributes/override/properties_09.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_10.phpt
Normal file
19
Zend/tests/attributes/override/properties_10.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_11.phpt
Normal file
19
Zend/tests/attributes/override/properties_11.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_12.phpt
Normal file
19
Zend/tests/attributes/override/properties_12.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
21
Zend/tests/attributes/override/properties_13.phpt
Normal file
21
Zend/tests/attributes/override/properties_13.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--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
|
25
Zend/tests/attributes/override/properties_14.phpt
Normal file
25
Zend/tests/attributes/override/properties_14.phpt
Normal file
|
@ -0,0 +1,25 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_15.phpt
Normal file
19
Zend/tests/attributes/override/properties_15.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
21
Zend/tests/attributes/override/properties_16.phpt
Normal file
21
Zend/tests/attributes/override/properties_16.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--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
|
16
Zend/tests/attributes/override/properties_17.phpt
Normal file
16
Zend/tests/attributes/override/properties_17.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--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
|
19
Zend/tests/attributes/override/properties_18.phpt
Normal file
19
Zend/tests/attributes/override/properties_18.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--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
|
21
Zend/tests/attributes/override/properties_19.phpt
Normal file
21
Zend/tests/attributes/override/properties_19.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--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
|
17
Zend/tests/attributes/override/properties_20.phpt
Normal file
17
Zend/tests/attributes/override/properties_20.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--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
|
|
@ -11,7 +11,6 @@ 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 `$cmd`;
|
||||
echo shell_exec($cmd);
|
||||
?>
|
||||
--EXPECT--
|
||||
Interactive shell (-a) requires the readline extension.
|
||||
|
|
|
@ -28,7 +28,7 @@ if (PHP_OS == 'Linux') {
|
|||
}
|
||||
}
|
||||
elseif (PHP_OS == 'FreeBSD') {
|
||||
$lines = explode("\n",`sysctl -a`);
|
||||
$lines = explode("\n", shell_exec("sysctl -a"));
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
if (!$line){
|
||||
|
|
|
@ -17,5 +17,12 @@ function show_outputa($prepend, $output) {
|
|||
show_outputa('Files: ', `cd .`); // this works as expected
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--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
|
||||
Okey
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
--TEST--
|
||||
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
|
||||
--INI--
|
||||
report_memleaks=1
|
||||
--FILE--
|
||||
<?php
|
||||
class FooBar {
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
--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,7 +2,6 @@
|
|||
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]
|
||||
|
|
5
Zend/tests/constants/gh18850.inc
Normal file
5
Zend/tests/constants/gh18850.inc
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
var_dump(__COMPILER_HALT_OFFSET__);
|
||||
|
||||
__halt_compiler();
|
12
Zend/tests/constants/gh18850.phpt
Normal file
12
Zend/tests/constants/gh18850.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--TEST--
|
||||
GH-18850: Repeated inclusion of file with __halt_compiler() triggers "Constant already defined" warning
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/gh18850.inc';
|
||||
require __DIR__ . '/gh18850.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(62)
|
||||
int(62)
|
|
@ -36,5 +36,7 @@ object(Foo)#%d (3) {
|
|||
["c":"Foo":private]=>
|
||||
int(3)
|
||||
}
|
||||
|
||||
Deprecated: Returning null from Bar::__debugInfo() is deprecated, return an empty array instead in %s on line %d
|
||||
object(Bar)#%d (0) {
|
||||
}
|
||||
|
|
31
Zend/tests/debug_info/recursion_return_null.phpt
Normal file
31
Zend/tests/debug_info/recursion_return_null.phpt
Normal file
|
@ -0,0 +1,31 @@
|
|||
--TEST--
|
||||
Testing __debugInfo() magic method
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(
|
||||
static function () {
|
||||
echo "in handler\n";
|
||||
$f = new Foo();
|
||||
var_dump($f);
|
||||
}
|
||||
);
|
||||
|
||||
class Foo {
|
||||
public function __debugInfo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$f = new Foo;
|
||||
var_dump($f);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
in handler
|
||||
|
||||
Deprecated: Returning null from Foo::__debugInfo() is deprecated, return an empty array instead in %s on line %d
|
||||
object(Foo)#3 (0) {
|
||||
}
|
||||
object(Foo)#2 (0) {
|
||||
}
|
|
@ -16,8 +16,8 @@ $storage[Foo::Baz] = 'Baz';
|
|||
var_dump($storage[Foo::Bar]);
|
||||
var_dump($storage[Foo::Baz]);
|
||||
|
||||
var_dump($storage->contains(Foo::Bar));
|
||||
var_dump($storage->contains(Foo::Qux));
|
||||
var_dump($storage->offsetExists(Foo::Bar));
|
||||
var_dump($storage->offsetExists(Foo::Qux));
|
||||
|
||||
$serialized = serialize($storage);
|
||||
var_dump($serialized);
|
||||
|
|
|
@ -3,8 +3,6 @@ Bug #26698 (Thrown exceptions while evaluating argument to pass as parameter cra
|
|||
--FILE--
|
||||
<?php
|
||||
|
||||
ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
|
||||
|
||||
class ObjectOne
|
||||
{
|
||||
function getNone()
|
||||
|
|
|
@ -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 %s002.php on line %d and exactly 1 expected
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s 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 %s003.php on line %d and exactly 1 expected
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s 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 %s003.php on line %d and exactly 2 expected
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
|
@ -20,5 +20,6 @@ $action->filter();
|
|||
$action->filter();
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
|
||||
DONE
|
||||
|
|
3
Zend/tests/get_included_files_basic.inc
Normal file
3
Zend/tests/get_included_files_basic.inc
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
/* dummy file for get_included_files_basic.phpt */
|
||||
?>
|
|
@ -5,13 +5,13 @@ get_included_files() tests
|
|||
|
||||
var_dump(get_included_files());
|
||||
|
||||
include(__DIR__."/014.inc");
|
||||
include(__DIR__."/get_included_files_basic.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
include_once(__DIR__."/014.inc");
|
||||
include_once(__DIR__."/get_included_files_basic.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
include(__DIR__."/014.inc");
|
||||
include(__DIR__."/get_included_files_basic.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
echo "Done\n";
|
24
Zend/tests/gh18736.phpt
Normal file
24
Zend/tests/gh18736.phpt
Normal file
|
@ -0,0 +1,24 @@
|
|||
--TEST--
|
||||
GH-18736: Circumvented type check with return by ref + finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &test(): int {
|
||||
$x = 0;
|
||||
try {
|
||||
return $x;
|
||||
} finally {
|
||||
$x = 'test';
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$x = &test();
|
||||
var_dump($x);
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test(): Return value must be of type int, string returned
|
81
Zend/tests/gh19280.phpt
Normal file
81
Zend/tests/gh19280.phpt
Normal file
|
@ -0,0 +1,81 @@
|
|||
--TEST--
|
||||
GH-19280: Stale nInternalPosition on rehashing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function rehash_packed() {
|
||||
$a = range(0, 63);
|
||||
for ($i = 0; $i <= 47; $i++) {
|
||||
next($a);
|
||||
}
|
||||
for ($i = 16; $i < 62; $i++) {
|
||||
unset($a[$i]);
|
||||
}
|
||||
var_dump(key($a));
|
||||
$a[64] = 64;
|
||||
var_dump(key($a));
|
||||
}
|
||||
|
||||
function rehash_packed_iterated() {
|
||||
$a = range(0, 63);
|
||||
for ($i = 0; $i <= 47; $i++) {
|
||||
next($a);
|
||||
}
|
||||
for ($i = 16; $i < 62; $i++) {
|
||||
unset($a[$i]);
|
||||
}
|
||||
var_dump(key($a));
|
||||
foreach ($a as &$_) {
|
||||
$a[64] = 64;
|
||||
break;
|
||||
}
|
||||
var_dump(key($a));
|
||||
}
|
||||
|
||||
function rehash_string() {
|
||||
$a = [];
|
||||
for ($i = 0; $i < 64; $i++) {
|
||||
$a[md5($i)] = $i;
|
||||
}
|
||||
for ($i = 0; $i <= 47; $i++) {
|
||||
next($a);
|
||||
}
|
||||
for ($i = 16; $i < 62; $i++) {
|
||||
unset($a[md5($i)]);
|
||||
}
|
||||
var_dump(key($a));
|
||||
$a[md5(64)] = 64;
|
||||
var_dump(key($a));
|
||||
}
|
||||
|
||||
function rehash_int() {
|
||||
$a = [];
|
||||
for ($i = 63; $i >= 0; $i--) {
|
||||
$a[$i] = $i;
|
||||
}
|
||||
for ($i = 0; $i <= 47; $i++) {
|
||||
next($a);
|
||||
}
|
||||
for ($i = 48; $i >= 2; $i--) {
|
||||
unset($a[$i]);
|
||||
}
|
||||
var_dump(key($a));
|
||||
$a[64] = 64;
|
||||
var_dump(key($a));
|
||||
}
|
||||
|
||||
rehash_packed();
|
||||
rehash_packed_iterated();
|
||||
rehash_string();
|
||||
rehash_int();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(62)
|
||||
int(62)
|
||||
int(62)
|
||||
int(62)
|
||||
string(32) "44f683a84163b3523afe57c2e008bc8c"
|
||||
string(32) "44f683a84163b3523afe57c2e008bc8c"
|
||||
int(1)
|
||||
int(1)
|
18
Zend/tests/gh19304.phpt
Normal file
18
Zend/tests/gh19304.phpt
Normal file
|
@ -0,0 +1,18 @@
|
|||
--TEST--
|
||||
GH-19304: Incorrect anonymous class type name assertion
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = new class {
|
||||
public self $v;
|
||||
};
|
||||
|
||||
try {
|
||||
$foo->v = 0;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot assign int to property class@anonymous::$v of type class@anonymous
|
40
Zend/tests/gh19306.phpt
Normal file
40
Zend/tests/gh19306.phpt
Normal file
|
@ -0,0 +1,40 @@
|
|||
--TEST--
|
||||
GH-19306: Generator suspended in yield from may be resumed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class It implements IteratorAggregate
|
||||
{
|
||||
public function getIterator(): Generator
|
||||
{
|
||||
yield "";
|
||||
Fiber::suspend();
|
||||
}
|
||||
}
|
||||
function g()
|
||||
{
|
||||
yield from new It();
|
||||
}
|
||||
$a = g();
|
||||
$fiber = new Fiber(function () use ($a) {
|
||||
echo "Fiber start\n";
|
||||
$a->next();
|
||||
echo "Fiber return\n";
|
||||
});
|
||||
$fiber->start();
|
||||
echo "Fiber suspended\n";
|
||||
try {
|
||||
$a->next();
|
||||
} catch (Throwable $t) {
|
||||
echo $t->getMessage(), "\n";
|
||||
}
|
||||
echo "Destroying fiber\n";
|
||||
$fiber = null;
|
||||
echo "Shutdown\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Fiber start
|
||||
Fiber suspended
|
||||
Cannot resume an already running generator
|
||||
Destroying fiber
|
||||
Shutdown
|
36
Zend/tests/gh19326.phpt
Normal file
36
Zend/tests/gh19326.phpt
Normal file
|
@ -0,0 +1,36 @@
|
|||
--TEST--
|
||||
GH-19326: Calling Generator::throw() on a running generator with a non-Generator delegate crashes
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class It implements IteratorAggregate {
|
||||
public function getIterator(): Generator {
|
||||
yield "";
|
||||
Fiber::suspend();
|
||||
}
|
||||
}
|
||||
|
||||
function g() {
|
||||
yield from new It();
|
||||
}
|
||||
|
||||
$b = g();
|
||||
$b->rewind();
|
||||
|
||||
$fiber = new Fiber(function () use ($b) {
|
||||
$b->next();
|
||||
});
|
||||
|
||||
$fiber->start();
|
||||
|
||||
try {
|
||||
$b->throw(new Exception('test'));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
$fiber->resume();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot resume an already running generator
|
|
@ -227,7 +227,7 @@ getValue(): NULL
|
|||
setRawValueWithoutLazyInitialization():
|
||||
getValue(): string(5) "value"
|
||||
|
||||
## Property [ public $hooked = NULL ]
|
||||
## Property [ public $hooked = NULL { get; set; } ]
|
||||
|
||||
skipInitializerForProperty():
|
||||
getValue(): NULL
|
||||
|
@ -235,7 +235,7 @@ getValue(): NULL
|
|||
setRawValueWithoutLazyInitialization():
|
||||
getValue(): string(5) "value"
|
||||
|
||||
## Property [ public $virtual ]
|
||||
## Property [ public virtual $virtual { get; set; } ]
|
||||
|
||||
skipInitializerForProperty():
|
||||
ReflectionException: Can not use skipLazyInitialization on virtual property A::$virtual
|
||||
|
@ -324,7 +324,7 @@ getValue(): NULL
|
|||
setRawValueWithoutLazyInitialization():
|
||||
getValue(): string(5) "value"
|
||||
|
||||
## Property [ public $hooked = NULL ]
|
||||
## Property [ public $hooked = NULL { get; set; } ]
|
||||
|
||||
skipInitializerForProperty():
|
||||
getValue(): NULL
|
||||
|
@ -332,7 +332,7 @@ getValue(): NULL
|
|||
setRawValueWithoutLazyInitialization():
|
||||
getValue(): string(5) "value"
|
||||
|
||||
## Property [ public $virtual ]
|
||||
## Property [ public virtual $virtual { get; set; } ]
|
||||
|
||||
skipInitializerForProperty():
|
||||
ReflectionException: Can not use skipLazyInitialization on virtual property A::$virtual
|
||||
|
|
|
@ -5,7 +5,7 @@ precision=14
|
|||
--FILE--
|
||||
<?php
|
||||
|
||||
$doubles = array(
|
||||
$floats = array(
|
||||
076545676543223,
|
||||
032325463734,
|
||||
0777777,
|
||||
|
@ -13,8 +13,8 @@ $doubles = array(
|
|||
033333333333333,
|
||||
);
|
||||
|
||||
foreach ($doubles as $d) {
|
||||
$l = (double)$d;
|
||||
foreach ($floats as $d) {
|
||||
$l = (float)$d;
|
||||
var_dump($l);
|
||||
}
|
||||
|
||||
|
|
26
Zend/tests/pipe_operator_reference_context.phpt
Normal file
26
Zend/tests/pipe_operator_reference_context.phpt
Normal file
|
@ -0,0 +1,26 @@
|
|||
--TEST--
|
||||
Fix GH-19476: Pipe operator with function returning by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &get_ref($_): string {
|
||||
static $a = "original";
|
||||
|
||||
$a .= " ".$_;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
function &test_pipe_ref(): string {
|
||||
return "input" |> get_ref(...);
|
||||
}
|
||||
|
||||
$ref = &test_pipe_ref();
|
||||
echo "Before: " . $ref . "\n";
|
||||
$ref = "changed";
|
||||
echo "After: " . test_pipe_ref() . "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Before: original input
|
||||
After: changed input
|
|
@ -24,11 +24,13 @@ var_dump($r->hasDefaultValue());
|
|||
var_dump($r->getDefaultValue());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Pre-test
|
||||
Setting
|
||||
Constructor
|
||||
Getting
|
||||
Setting
|
||||
bool(false)
|
||||
|
||||
Deprecated: ReflectionProperty::getDefaultValue() for a property without a default value is deprecated, use ReflectionProperty::hasDefaultValue() to check if the default value exists in %s on line %d
|
||||
NULL
|
||||
|
|
|
@ -12,4 +12,4 @@ $readonly_anon = new #[AllowDynamicProperties] readonly class {
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
|
||||
|
|
|
@ -10,4 +10,4 @@ readonly class Foo
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class Foo in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class Foo in %s on line %d
|
||||
|
|
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