mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Compare commits
510 commits
php-8.5.0a
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
096938fd4a | ||
![]() |
1299376b8f | ||
![]() |
0fc3a2e624 | ||
![]() |
a97717d23e | ||
![]() |
010fe2bb42 | ||
![]() |
dbf0102b15 | ||
![]() |
9b30788f8c | ||
![]() |
092127cf25 | ||
![]() |
a84a82ed88 | ||
![]() |
7ca21d2e07 | ||
![]() |
4d3ccc21d0 | ||
![]() |
1c67b060c4 | ||
![]() |
0992265611 | ||
![]() |
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 | ||
![]() |
9999d66bce | ||
![]() |
4754d302bf | ||
![]() |
8538e2fe6b | ||
![]() |
28ed4e6ec0 | ||
![]() |
bc4b6ce7a8 | ||
![]() |
6600d0e00f | ||
![]() |
03e2613ddd | ||
![]() |
138ebf481b | ||
![]() |
80022c035b | ||
![]() |
7bac9de94a | ||
![]() |
fc6c49cbf4 | ||
![]() |
a9f3e3c44e | ||
![]() |
16b2fc41a3 | ||
![]() |
6fda0a5617 | ||
![]() |
be9f1d3d56 | ||
![]() |
7016ad558b | ||
![]() |
3aaa8d3526 | ||
![]() |
bc2d02e3a9 | ||
![]() |
c1b129bd18 | ||
![]() |
a95a81000d | ||
![]() |
c9e91bfbab | ||
![]() |
abee5c138f | ||
![]() |
e8b5bcfe19 | ||
![]() |
4c576a2b02 | ||
![]() |
ec0ec47bbf | ||
![]() |
61415942c2 | ||
![]() |
d23e4ba538 | ||
![]() |
54863f4930 | ||
![]() |
712508fdb2 | ||
![]() |
ce6e7a2786 | ||
![]() |
f72105be81 | ||
![]() |
c561f7da85 | ||
![]() |
8e38f6d1c6 | ||
![]() |
cecf9b02e5 | ||
![]() |
cfb3e98c84 | ||
![]() |
35a4656a59 | ||
![]() |
e48099a03c | ||
![]() |
b30ccf9158 | ||
![]() |
5295fc07d5 | ||
![]() |
6b0a80903b | ||
![]() |
f63a35d944 | ||
![]() |
87d83d162d | ||
![]() |
bac158c80d | ||
![]() |
6154fac64d | ||
![]() |
4844c7a92f | ||
![]() |
e897621be9 | ||
![]() |
3b4f2b0798 | ||
![]() |
eaf24ba4e2 | ||
![]() |
19c84e2687 | ||
![]() |
83b8d2c290 | ||
![]() |
b75c2dcb02 | ||
![]() |
5947fedbbd | ||
![]() |
ff810d5e36 | ||
![]() |
068aaed196 | ||
![]() |
191290e194 | ||
![]() |
4a0ad9bd91 | ||
![]() |
63e40b1b29 | ||
![]() |
3da9478d78 | ||
![]() |
17df11e3f7 | ||
![]() |
f4ad6ea287 | ||
![]() |
87b4030503 | ||
![]() |
e1c4a0ae51 | ||
![]() |
f7ca8138e7 | ||
![]() |
279589c3af | ||
![]() |
e16df981bf | ||
![]() |
7b3e68ff69 | ||
![]() |
9b777b3c35 | ||
![]() |
1c74a1a889 | ||
![]() |
5dd965117a | ||
![]() |
d3ebf97d77 | ||
![]() |
7b4c14dc10 | ||
![]() |
6f3bc59950 | ||
![]() |
73b1ebfa20 | ||
![]() |
04feb452ba | ||
![]() |
120a5ebb66 | ||
![]() |
a7cdf0b172 | ||
![]() |
5fa27e25b3 | ||
![]() |
b633720585 | ||
![]() |
7f7b3cdb90 | ||
![]() |
747ecce51f | ||
![]() |
74f7ecbe04 | ||
![]() |
5ae87ffef4 | ||
![]() |
ecc403a8fa | ||
![]() |
2ed5472f06 | ||
![]() |
0b01640b58 | ||
![]() |
49f1685cde | ||
![]() |
988da4c951 | ||
![]() |
9dfee95dae | ||
![]() |
e5d4d656ab | ||
![]() |
8bd8223bad | ||
![]() |
15547a2eb1 | ||
![]() |
30c8480a39 | ||
![]() |
24d94197fd | ||
![]() |
0d221c5b70 | ||
![]() |
1218e39b07 | ||
![]() |
a2d8ee27f2 | ||
![]() |
b428bc934a | ||
![]() |
7c1e461032 | ||
![]() |
b1fce8a98c | ||
![]() |
93b9808004 | ||
![]() |
802e348b49 | ||
![]() |
f94c11fff8 | ||
![]() |
beeeee2978 | ||
![]() |
ad2143f3b0 | ||
![]() |
7777eaa8e1 | ||
![]() |
da7d2e14ac | ||
![]() |
29b38a1ced | ||
![]() |
2645663d9b | ||
![]() |
719419a6e5 | ||
![]() |
d292968f7c | ||
![]() |
745e81bfd0 | ||
![]() |
aba6b89399 | ||
![]() |
4bc5aa3531 | ||
![]() |
5b8ee009d6 | ||
![]() |
23ec35bf4a | ||
![]() |
b13347be38 | ||
![]() |
5a06842bf8 | ||
![]() |
441e55790f | ||
![]() |
4e1d3f8772 | ||
![]() |
7efbb2e4e0 | ||
![]() |
d9d412645d | ||
![]() |
be88192594 | ||
![]() |
99b5b20479 | ||
![]() |
79368ed8f3 | ||
![]() |
a48d620c26 | ||
![]() |
5b05d429f2 | ||
![]() |
f0baf3dc11 | ||
![]() |
5d1636e40b | ||
![]() |
ef5ca80a47 | ||
![]() |
c04f2d2d88 | ||
![]() |
13c781f04d | ||
![]() |
a7fef37657 | ||
![]() |
113eb203b0 | ||
![]() |
e572e899bd | ||
![]() |
7ab37e81e0 | ||
![]() |
27f24bd9bc | ||
![]() |
605ee05491 | ||
![]() |
95f1350ca8 | ||
![]() |
1b169bf28e | ||
![]() |
4762d46427 | ||
![]() |
1eadf553f1 | ||
![]() |
c55f142c6c | ||
![]() |
e0c3f46496 | ||
![]() |
eb65ec41b7 | ||
![]() |
d20f4fca69 | ||
![]() |
c8cc23336d | ||
![]() |
ff6c1c7a30 | ||
![]() |
bd886d21e7 | ||
![]() |
30f03021d1 | ||
![]() |
7f1b3606a8 | ||
![]() |
e91d2c719f | ||
![]() |
d7f9caf37c | ||
![]() |
f8196a5db5 | ||
![]() |
6cc4ae1f1d | ||
![]() |
541620cf78 | ||
![]() |
cb73155945 | ||
![]() |
312869381a | ||
![]() |
999d29dc2b | ||
![]() |
726516b8c1 | ||
![]() |
0962c325fa | ||
![]() |
8db883c540 | ||
![]() |
05bb051243 | ||
![]() |
03a9f03822 | ||
![]() |
68fdb43573 | ||
![]() |
dfac2da7fb | ||
![]() |
dd3a098a9b | ||
![]() |
189b933dd4 | ||
![]() |
6ca6d569ff | ||
![]() |
2c42479890 | ||
![]() |
f1a77c0198 | ||
![]() |
be09985c87 | ||
![]() |
b48faee850 | ||
![]() |
5fdc02282f | ||
![]() |
063d795599 | ||
![]() |
419f6750c0 | ||
![]() |
4433986e40 | ||
![]() |
0a130caf58 | ||
![]() |
01dbee83e1 | ||
![]() |
aadd724362 | ||
![]() |
6b3f302132 | ||
![]() |
78d96e94fa | ||
![]() |
04eadc803d | ||
![]() |
d9602e4362 | ||
![]() |
86aaded7e5 | ||
![]() |
d11099ae32 | ||
![]() |
bdca73cc14 | ||
![]() |
7f4076bae0 | ||
![]() |
8629256dc7 | ||
![]() |
56308f6490 | ||
![]() |
a8a3c81528 | ||
![]() |
7fb6afbe9f | ||
![]() |
0e80be83b3 | ||
![]() |
a59caa3c33 | ||
![]() |
554ae518a2 | ||
![]() |
8516ae86d7 | ||
![]() |
2e0c011fb8 | ||
![]() |
62742996f8 | ||
![]() |
826fa36ba3 | ||
![]() |
034c3f2270 | ||
![]() |
9eee4dd92b | ||
![]() |
a5df26691d | ||
![]() |
6f1501a601 | ||
![]() |
b9844b545f | ||
![]() |
a57f58253a | ||
![]() |
eade5c17ea | ||
![]() |
2afab21ffb | ||
![]() |
4647dfc988 | ||
![]() |
faf833bffc | ||
![]() |
e84320ad75 | ||
![]() |
2ecafd41ba | ||
![]() |
484d4351c2 | ||
![]() |
02b94556cf | ||
![]() |
967377369b | ||
![]() |
889f38135d | ||
![]() |
a22dc67a21 | ||
![]() |
478a520900 | ||
![]() |
a22eb4d3e5 | ||
![]() |
0f731b455c | ||
![]() |
cd8722304c | ||
![]() |
b495ce0371 | ||
![]() |
1089896b8c | ||
![]() |
f938f356cb | ||
![]() |
a8086be81c | ||
![]() |
7232c15b3e | ||
![]() |
3d468a181a | ||
![]() |
ea9a7b2523 | ||
![]() |
b08753eef0 | ||
![]() |
fec641d27a | ||
![]() |
64852b44b5 |
1396 changed files with 23377 additions and 13659 deletions
|
@ -90,7 +90,6 @@ jobs:
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--enable-phpdbg \
|
--enable-phpdbg \
|
||||||
--enable-fpm \
|
--enable-fpm \
|
||||||
--enable-opcache \
|
|
||||||
--with-pdo-mysql=mysqlnd \
|
--with-pdo-mysql=mysqlnd \
|
||||||
--with-mysqli=mysqlnd \
|
--with-mysqli=mysqlnd \
|
||||||
--with-pgsql \
|
--with-pgsql \
|
||||||
|
@ -168,7 +167,6 @@ jobs:
|
||||||
no_output_timeout: 30m
|
no_output_timeout: 30m
|
||||||
command: |
|
command: |
|
||||||
sapi/cli/php run-tests.php \
|
sapi/cli/php run-tests.php \
|
||||||
-d zend_extension=opcache.so \
|
|
||||||
-d opcache.enable_cli=1 \
|
-d opcache.enable_cli=1 \
|
||||||
-d opcache.jit_buffer_size=64M \
|
-d opcache.jit_buffer_size=64M \
|
||||||
-d opcache.jit=tracing \
|
-d opcache.jit=tracing \
|
||||||
|
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/.github @TimWolla
|
/.github @TimWolla
|
||||||
/build/gen_stub.php @kocsismate
|
/build/gen_stub.php @kocsismate
|
||||||
/ext/bcmath @Girgias @nielsdos @SakiTakamachi
|
/ext/bcmath @nielsdos @SakiTakamachi
|
||||||
/ext/curl @adoy
|
/ext/curl @adoy
|
||||||
/ext/date @derickr
|
/ext/date @derickr
|
||||||
/ext/dba @Girgias
|
/ext/dba @Girgias
|
||||||
|
|
5
.github/actions/apk/action.yml
vendored
5
.github/actions/apk/action.yml
vendored
|
@ -6,6 +6,8 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
OPCACHE_TLS_TESTS_DEPS="clang gcc binutils-gold lld"
|
||||||
|
|
||||||
apk update -q
|
apk update -q
|
||||||
apk add \
|
apk add \
|
||||||
util-linux \
|
util-linux \
|
||||||
|
@ -53,4 +55,5 @@ runs:
|
||||||
postgresql14-dev \
|
postgresql14-dev \
|
||||||
tzdata \
|
tzdata \
|
||||||
musl-locales \
|
musl-locales \
|
||||||
musl-locales-lang
|
musl-locales-lang \
|
||||||
|
$OPCACHE_TLS_TESTS_DEPS
|
||||||
|
|
6
.github/actions/apt-x32/action.yml
vendored
6
.github/actions/apt-x32/action.yml
vendored
|
@ -6,6 +6,8 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
OPCACHE_TLS_TESTS_DEPS="gcc clang lld"
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
dpkg --add-architecture i386
|
dpkg --add-architecture i386
|
||||||
apt-get update -y | true
|
apt-get update -y | true
|
||||||
|
@ -35,7 +37,6 @@ runs:
|
||||||
libssl-dev:i386 \
|
libssl-dev:i386 \
|
||||||
libwebp-dev:i386 \
|
libwebp-dev:i386 \
|
||||||
libxml2-dev:i386 \
|
libxml2-dev:i386 \
|
||||||
libxml2-dev:i386 \
|
|
||||||
libxpm-dev:i386 \
|
libxpm-dev:i386 \
|
||||||
libxslt1-dev:i386 \
|
libxslt1-dev:i386 \
|
||||||
firebird-dev:i386 \
|
firebird-dev:i386 \
|
||||||
|
@ -45,4 +46,5 @@ runs:
|
||||||
re2c \
|
re2c \
|
||||||
unzip \
|
unzip \
|
||||||
wget \
|
wget \
|
||||||
zlib1g-dev:i386
|
zlib1g-dev:i386 \
|
||||||
|
$OPCACHE_TLS_TESTS_DEPS
|
||||||
|
|
5
.github/actions/apt-x64/action.yml
vendored
5
.github/actions/apt-x64/action.yml
vendored
|
@ -10,6 +10,8 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
OPCACHE_TLS_TESTS_DEPS="gcc clang lld"
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Install sudo in Docker for consistent actions
|
# Install sudo in Docker for consistent actions
|
||||||
|
@ -74,4 +76,5 @@ runs:
|
||||||
libqdbm-dev \
|
libqdbm-dev \
|
||||||
libjpeg-dev \
|
libjpeg-dev \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libfreetype6-dev
|
libfreetype6-dev \
|
||||||
|
$OPCACHE_TLS_TESTS_DEPS
|
||||||
|
|
7
.github/actions/extra-tests/action.yml
vendored
Normal file
7
.github/actions/extra-tests/action.yml
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
name: Extra tests
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- shell: sh
|
||||||
|
run: |
|
||||||
|
sapi/cli/php run-extra-tests.php
|
18
.github/actions/freebsd/action.yml
vendored
18
.github/actions/freebsd/action.yml
vendored
|
@ -3,13 +3,16 @@ inputs:
|
||||||
configurationParameters:
|
configurationParameters:
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
runExtraTests:
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: FreeBSD
|
- name: FreeBSD
|
||||||
uses: vmactions/freebsd-vm@v1
|
uses: vmactions/freebsd-vm@v1
|
||||||
with:
|
with:
|
||||||
release: '13.3'
|
release: '13.5'
|
||||||
usesh: true
|
usesh: true
|
||||||
copyback: false
|
copyback: false
|
||||||
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.
|
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.
|
||||||
|
@ -17,6 +20,8 @@ runs:
|
||||||
prepare: |
|
prepare: |
|
||||||
cd $GITHUB_WORKSPACE
|
cd $GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
OPCACHE_TLS_TESTS_DEPS="gcc"
|
||||||
|
|
||||||
kldload accf_http
|
kldload accf_http
|
||||||
pkg install -y \
|
pkg install -y \
|
||||||
autoconf \
|
autoconf \
|
||||||
|
@ -41,9 +46,11 @@ runs:
|
||||||
webp \
|
webp \
|
||||||
libavif \
|
libavif \
|
||||||
`#sqlite3` \
|
`#sqlite3` \
|
||||||
curl
|
curl \
|
||||||
|
$OPCACHE_TLS_TESTS_DEPS
|
||||||
|
|
||||||
./buildconf -f
|
./buildconf -f
|
||||||
|
CC=clang CXX=clang++ \
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr/local \
|
--prefix=/usr/local \
|
||||||
--enable-debug \
|
--enable-debug \
|
||||||
|
@ -106,5 +113,8 @@ runs:
|
||||||
--offline \
|
--offline \
|
||||||
--show-diff \
|
--show-diff \
|
||||||
--show-slow 1000 \
|
--show-slow 1000 \
|
||||||
--set-timeout 120 \
|
--set-timeout 120
|
||||||
-d zend_extension=opcache.so
|
|
||||||
|
if test "${{ inputs.runExtraTests }}" = "true"; then
|
||||||
|
sapi/cli/php run-extra-tests.php
|
||||||
|
fi
|
||||||
|
|
3
.github/scripts/setup-slapd.sh
vendored
3
.github/scripts/setup-slapd.sh
vendored
|
@ -72,6 +72,9 @@ olcTLSCertificateKeyFile: /etc/ldap/ssl/server.key
|
||||||
add: olcTLSVerifyClient
|
add: olcTLSVerifyClient
|
||||||
olcTLSVerifyClient: never
|
olcTLSVerifyClient: never
|
||||||
-
|
-
|
||||||
|
add: olcTLSProtocolMin
|
||||||
|
olcTLSProtocolMin: 3.3
|
||||||
|
-
|
||||||
add: olcAuthzRegexp
|
add: olcAuthzRegexp
|
||||||
olcAuthzRegexp: uid=usera,cn=digest-md5,cn=auth cn=usera,dc=my-domain,dc=com
|
olcAuthzRegexp: uid=usera,cn=digest-md5,cn=auth cn=usera,dc=my-domain,dc=com
|
||||||
-
|
-
|
||||||
|
|
2
.github/scripts/windows/test_task.bat
vendored
2
.github/scripts/windows/test_task.bat
vendored
|
@ -128,7 +128,7 @@ mkdir %PHP_BUILD_DIR%\test_file_cache
|
||||||
rem generate php.ini
|
rem generate php.ini
|
||||||
echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini
|
echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini
|
||||||
echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini
|
echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini
|
||||||
if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini
|
echo opcache.record_warnings=1 >> %PHP_BUILD_DIR%\php.ini
|
||||||
rem work-around for some spawned PHP processes requiring OpenSSL and sockets
|
rem work-around for some spawned PHP processes requiring OpenSSL and sockets
|
||||||
echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini
|
echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini
|
||||||
echo extension=php_sockets.dll >> %PHP_BUILD_DIR%\php.ini
|
echo extension=php_sockets.dll >> %PHP_BUILD_DIR%\php.ini
|
||||||
|
|
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
||||||
if: github.repository == 'php/php-src'
|
if: github.repository == 'php/php-src'
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install -r docs/requirements.txt
|
run: pip install -r docs/requirements.txt
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
|
|
88
.github/workflows/nightly.yml
vendored
88
.github/workflows/nightly.yml
vendored
|
@ -54,7 +54,7 @@ jobs:
|
||||||
runs-on: [self-hosted, gentoo, ppc64]
|
runs-on: [self-hosted, gentoo, ppc64]
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: System info
|
- name: System info
|
||||||
|
@ -85,6 +85,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
--asan -x
|
--asan -x
|
||||||
|
- name: Extra tests
|
||||||
|
uses: ./.github/actions/extra-tests
|
||||||
ALPINE:
|
ALPINE:
|
||||||
if: inputs.run_alpine
|
if: inputs.run_alpine
|
||||||
name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS
|
name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS
|
||||||
|
@ -93,7 +95,7 @@ jobs:
|
||||||
image: 'alpine:3.20.1'
|
image: 'alpine:3.20.1'
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: apk
|
- name: apk
|
||||||
|
@ -132,8 +134,9 @@ jobs:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
--asan -x
|
--asan -x
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
|
- name: Extra tests
|
||||||
|
uses: ./.github/actions/extra-tests
|
||||||
- name: Notify Slack
|
- name: Notify Slack
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: ./.github/actions/notify-slack
|
uses: ./.github/actions/notify-slack
|
||||||
|
@ -203,7 +206,7 @@ jobs:
|
||||||
runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }}
|
runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: Create MSSQL container
|
- name: Create MSSQL container
|
||||||
|
@ -246,14 +249,12 @@ jobs:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test OpCache
|
- name: Test OpCache
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test Function JIT
|
- name: Test Function JIT
|
||||||
# ASAN frequently timeouts. Each test run takes ~90 minutes, we can
|
# ASAN frequently timeouts. Each test run takes ~90 minutes, we can
|
||||||
|
@ -264,8 +265,9 @@ jobs:
|
||||||
jitType: function
|
jitType: function
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
|
- name: Extra tests
|
||||||
|
uses: ./.github/actions/extra-tests
|
||||||
- name: Verify generated files are up to date
|
- name: Verify generated files are up to date
|
||||||
uses: ./.github/actions/verify-generated-files
|
uses: ./.github/actions/verify-generated-files
|
||||||
- name: Notify Slack
|
- name: Notify Slack
|
||||||
|
@ -304,7 +306,7 @@ jobs:
|
||||||
FIREBIRD_PASSWORD: test
|
FIREBIRD_PASSWORD: test
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: apt
|
- name: apt
|
||||||
|
@ -338,14 +340,12 @@ jobs:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test OpCache
|
- name: Test OpCache
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test Function JIT
|
- name: Test Function JIT
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
|
@ -353,8 +353,9 @@ jobs:
|
||||||
jitType: function
|
jitType: function
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
${{ matrix.run_tests_parameters }}
|
${{ matrix.run_tests_parameters }}
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
|
- name: Extra tests
|
||||||
|
uses: ./.github/actions/extra-tests
|
||||||
- name: Notify Slack
|
- name: Notify Slack
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: ./.github/actions/notify-slack
|
uses: ./.github/actions/notify-slack
|
||||||
|
@ -373,7 +374,7 @@ jobs:
|
||||||
runs-on: macos-${{ matrix.os }}
|
runs-on: macos-${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: brew
|
- name: brew
|
||||||
|
@ -398,13 +399,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test OpCache
|
- name: Test OpCache
|
||||||
uses: ./.github/actions/test-macos
|
uses: ./.github/actions/test-macos
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Test Function JIT
|
- name: Test Function JIT
|
||||||
if: matrix.os != '14' || !matrix.zts
|
if: matrix.os != '14' || !matrix.zts
|
||||||
|
@ -412,8 +411,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: function
|
jitType: function
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
|
- name: Extra tests
|
||||||
|
uses: ./.github/actions/extra-tests
|
||||||
- name: Verify generated files are up to date
|
- name: Verify generated files are up to date
|
||||||
uses: ./.github/actions/verify-generated-files
|
uses: ./.github/actions/verify-generated-files
|
||||||
- name: Notify Slack
|
- name: Notify Slack
|
||||||
|
@ -449,7 +449,7 @@ jobs:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: Create MSSQL container
|
- name: Create MSSQL container
|
||||||
|
@ -474,7 +474,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- uses: codecov/codecov-action@v4
|
- uses: codecov/codecov-action@v4
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
@ -503,7 +502,7 @@ jobs:
|
||||||
USE_TRACKED_ALLOC: 1
|
USE_TRACKED_ALLOC: 1
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: apt
|
- name: apt
|
||||||
|
@ -528,7 +527,6 @@ jobs:
|
||||||
- name: Enable Opcache
|
- name: Enable Opcache
|
||||||
run: |
|
run: |
|
||||||
echo memory_limit=-1 >> /etc/php.d/opcache.ini
|
echo memory_limit=-1 >> /etc/php.d/opcache.ini
|
||||||
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
|
|
||||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
||||||
|
@ -555,14 +553,17 @@ jobs:
|
||||||
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
|
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
|
||||||
X=0
|
X=0
|
||||||
for repository in $repositories; do
|
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
|
git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1
|
||||||
cd "amphp-$repository"
|
cd "amphp-$repository"
|
||||||
git rev-parse HEAD
|
git rev-parse HEAD
|
||||||
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
||||||
|
EXIT_CODE=0
|
||||||
vendor/bin/phpunit || EXIT_CODE=$?
|
vendor/bin/phpunit || EXIT_CODE=$?
|
||||||
|
echo -e "\n::endgroup::"
|
||||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||||
X=1;
|
X=1;
|
||||||
|
echo "Failed"
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
@ -586,14 +587,17 @@ jobs:
|
||||||
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
|
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
|
||||||
X=0
|
X=0
|
||||||
for repository in $repositories; do
|
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
|
git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1
|
||||||
cd "reactphp-$repository"
|
cd "reactphp-$repository"
|
||||||
git rev-parse HEAD
|
git rev-parse HEAD
|
||||||
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
||||||
|
EXIT_CODE=0
|
||||||
vendor/bin/phpunit || EXIT_CODE=$?
|
vendor/bin/phpunit || EXIT_CODE=$?
|
||||||
|
echo -e "\n::endgroup::"
|
||||||
if [ $[EXIT_CODE:-0} -gt 128 ]; then
|
if [ $[EXIT_CODE:-0} -gt 128 ]; then
|
||||||
X=1;
|
X=1;
|
||||||
|
echo "Failed"
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
@ -618,15 +622,19 @@ jobs:
|
||||||
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
|
||||||
php ./phpunit install
|
php ./phpunit install
|
||||||
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
|
# 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
|
# 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
|
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
|
||||||
X=0
|
X=0
|
||||||
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
|
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
|
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||||
X=1;
|
X=1;
|
||||||
|
echo "Failed"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
exit $X
|
exit $X
|
||||||
|
@ -697,7 +705,7 @@ jobs:
|
||||||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: Create MSSQL container
|
- name: Create MSSQL container
|
||||||
|
@ -719,21 +727,18 @@ jobs:
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
--file-cache-prime
|
--file-cache-prime
|
||||||
- name: Test File Cache (prime shm, use shm)
|
- name: Test File Cache (prime shm, use shm)
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
--file-cache-use
|
--file-cache-use
|
||||||
- name: Test File Cache (prime shm, use file)
|
- name: Test File Cache (prime shm, use file)
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
--file-cache-use
|
--file-cache-use
|
||||||
-d opcache.file_cache_only=1
|
-d opcache.file_cache_only=1
|
||||||
|
@ -741,7 +746,6 @@ jobs:
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
--file-cache-prime
|
--file-cache-prime
|
||||||
-d opcache.file_cache_only=1
|
-d opcache.file_cache_only=1
|
||||||
|
@ -749,7 +753,6 @@ jobs:
|
||||||
uses: ./.github/actions/test-linux
|
uses: ./.github/actions/test-linux
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
--file-cache-use
|
--file-cache-use
|
||||||
-d opcache.file_cache_only=1
|
-d opcache.file_cache_only=1
|
||||||
|
@ -765,7 +768,7 @@ jobs:
|
||||||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: apt
|
- name: apt
|
||||||
|
@ -843,7 +846,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
--msan
|
--msan
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Verify generated files are up to date
|
- name: Verify generated files are up to date
|
||||||
uses: ./.github/actions/verify-generated-files
|
uses: ./.github/actions/verify-generated-files
|
||||||
|
@ -857,7 +859,7 @@ jobs:
|
||||||
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
runs-on: ubuntu-${{ inputs.ubuntu_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: apt
|
- name: apt
|
||||||
|
@ -907,38 +909,38 @@ jobs:
|
||||||
CXX: ccache g++
|
CXX: ccache g++
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout PHP
|
- name: git checkout PHP
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
path: php
|
path: php
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: git checkout apcu
|
- name: git checkout apcu
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: krakjoe/apcu
|
repository: krakjoe/apcu
|
||||||
path: apcu
|
path: apcu
|
||||||
- name: git checkout imagick
|
- name: git checkout imagick
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: Imagick/imagick
|
repository: Imagick/imagick
|
||||||
path: imagick
|
path: imagick
|
||||||
- name: git checkout memcached
|
- name: git checkout memcached
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: php-memcached-dev/php-memcached
|
repository: php-memcached-dev/php-memcached
|
||||||
path: memcached
|
path: memcached
|
||||||
- name: git checkout redis
|
- name: git checkout redis
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: phpredis/phpredis
|
repository: phpredis/phpredis
|
||||||
path: redis
|
path: redis
|
||||||
- name: git checkout xdebug
|
- name: git checkout xdebug
|
||||||
if: false
|
if: false
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: xdebug/xdebug
|
repository: xdebug/xdebug
|
||||||
path: xdebug
|
path: xdebug
|
||||||
- name: git checkout yaml
|
- name: git checkout yaml
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: php/pecl-file_formats-yaml
|
repository: php/pecl-file_formats-yaml
|
||||||
path: yaml
|
path: yaml
|
||||||
|
@ -1048,7 +1050,7 @@ jobs:
|
||||||
- name: git config
|
- name: git config
|
||||||
run: git config --global core.autocrlf false && git config --global core.eol lf
|
run: git config --global core.autocrlf false && git config --global core.eol lf
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: Setup
|
- name: Setup
|
||||||
|
@ -1066,9 +1068,10 @@ jobs:
|
||||||
- zts: ${{ !inputs.run_freebsd_zts && true || '*never*' }}
|
- zts: ${{ !inputs.run_freebsd_zts && true || '*never*' }}
|
||||||
name: "FREEBSD_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
name: "FREEBSD_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 50
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
- name: FreeBSD
|
- name: FreeBSD
|
||||||
|
@ -1076,3 +1079,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
configurationParameters: >-
|
configurationParameters: >-
|
||||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||||
|
runExtraTests: true
|
||||||
|
|
23
.github/workflows/push.yml
vendored
23
.github/workflows/push.yml
vendored
|
@ -82,7 +82,7 @@ jobs:
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: apt
|
- name: apt
|
||||||
uses: ./.github/actions/apt-x64
|
uses: ./.github/actions/apt-x64
|
||||||
- name: System info
|
- name: System info
|
||||||
|
@ -112,6 +112,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
configurationParameters: >-
|
configurationParameters: >-
|
||||||
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
||||||
|
${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }}
|
||||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||||
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }}
|
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }}
|
||||||
skipSlow: ${{ matrix.asan }}
|
skipSlow: ${{ matrix.asan }}
|
||||||
|
@ -130,7 +131,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
${{ matrix.asan && '--asan -x' || '' }}
|
${{ matrix.asan && '--asan -x' || '' }}
|
||||||
- name: Verify generated files are up to date
|
- name: Verify generated files are up to date
|
||||||
|
@ -167,7 +167,7 @@ jobs:
|
||||||
FIREBIRD_PASSWORD: test
|
FIREBIRD_PASSWORD: test
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: apt
|
- name: apt
|
||||||
uses: ./.github/actions/apt-x32
|
uses: ./.github/actions/apt-x32
|
||||||
- name: ccache
|
- name: ccache
|
||||||
|
@ -190,7 +190,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
MACOS_DEBUG_NTS:
|
MACOS_DEBUG_NTS:
|
||||||
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
||||||
|
@ -198,14 +197,14 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: 14
|
- os: 15
|
||||||
arch: ARM64
|
arch: ARM64
|
||||||
name: MACOS_${{ matrix.arch }}_DEBUG_NTS
|
name: MACOS_${{ matrix.arch }}_DEBUG_NTS
|
||||||
runs-on: macos-${{ matrix.os }}
|
runs-on: macos-${{ matrix.os }}
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: brew
|
- name: brew
|
||||||
uses: ./.github/actions/brew
|
uses: ./.github/actions/brew
|
||||||
- name: ccache
|
- name: ccache
|
||||||
|
@ -229,7 +228,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
jitType: tracing
|
jitType: tracing
|
||||||
runTestsParameters: >-
|
runTestsParameters: >-
|
||||||
-d zend_extension=opcache.so
|
|
||||||
-d opcache.enable_cli=1
|
-d opcache.enable_cli=1
|
||||||
- name: Verify generated files are up to date
|
- name: Verify generated files are up to date
|
||||||
uses: ./.github/actions/verify-generated-files
|
uses: ./.github/actions/verify-generated-files
|
||||||
|
@ -253,7 +251,7 @@ jobs:
|
||||||
- name: git config
|
- name: git config
|
||||||
run: git config --global core.autocrlf false && git config --global core.eol lf
|
run: git config --global core.autocrlf false && git config --global core.eol lf
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./.github/actions/setup-windows
|
uses: ./.github/actions/setup-windows
|
||||||
- name: Build
|
- name: Build
|
||||||
|
@ -267,7 +265,7 @@ jobs:
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# ASLR can cause a lot of noise due to missed sse opportunities for memcpy
|
# ASLR can cause a lot of noise due to missed sse opportunities for memcpy
|
||||||
|
@ -299,7 +297,6 @@ jobs:
|
||||||
./configure \
|
./configure \
|
||||||
--disable-debug \
|
--disable-debug \
|
||||||
--enable-mbstring \
|
--enable-mbstring \
|
||||||
--enable-opcache \
|
|
||||||
--enable-option-checking=fatal \
|
--enable-option-checking=fatal \
|
||||||
--enable-sockets \
|
--enable-sockets \
|
||||||
--enable-werror \
|
--enable-werror \
|
||||||
|
@ -319,7 +316,6 @@ jobs:
|
||||||
sudo mkdir -p /etc/php.d
|
sudo mkdir -p /etc/php.d
|
||||||
sudo chmod 777 /etc/php.d
|
sudo chmod 777 /etc/php.d
|
||||||
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
|
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
|
||||||
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
|
|
||||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||||
- name: Setup
|
- name: Setup
|
||||||
|
@ -331,7 +327,7 @@ jobs:
|
||||||
mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
|
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;"
|
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
|
||||||
- name: git checkout benchmarking-data
|
- name: git checkout benchmarking-data
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: php/benchmarking-data
|
repository: php/benchmarking-data
|
||||||
ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
|
ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
|
||||||
|
@ -371,8 +367,9 @@ jobs:
|
||||||
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
||||||
name: FREEBSD
|
name: FREEBSD
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 50
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: FreeBSD
|
- name: FreeBSD
|
||||||
uses: ./.github/actions/freebsd
|
uses: ./.github/actions/freebsd
|
||||||
|
|
234
.github/workflows/real-time-benchmark.yml
vendored
234
.github/workflows/real-time-benchmark.yml
vendored
|
@ -2,14 +2,94 @@ name: Real-time Benchmark
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "30 0 * * *"
|
- 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:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}
|
||||||
|
cancel-in-progress: false
|
||||||
jobs:
|
jobs:
|
||||||
REAL_TIME_BENCHMARK:
|
REAL_TIME_BENCHMARK:
|
||||||
name: 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
|
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:
|
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
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
|
@ -23,19 +103,26 @@ jobs:
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y terraform=1.5.7-*
|
sudo apt-get install -y terraform=1.5.7-*
|
||||||
- name: Checkout benchmark suite
|
- name: Checkout benchmark suite
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: 'kocsismate/php-version-benchmarks'
|
repository: 'kocsismate/php-version-benchmarks'
|
||||||
ref: 'main'
|
ref: 'main'
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
path: 'php-version-benchmarks'
|
path: 'php-version-benchmarks'
|
||||||
- name: Checkout php-src
|
- name: Checkout php-src (benchmarked version)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: 'php/php-src'
|
repository: '${{ env.REPOSITORY }}'
|
||||||
ref: '${{ github.sha }}'
|
ref: '${{ env.COMMIT }}'
|
||||||
fetch-depth: 100
|
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
|
- name: Setup benchmark results
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "Benchmark"
|
git config --global user.name "Benchmark"
|
||||||
|
@ -43,57 +130,122 @@ jobs:
|
||||||
|
|
||||||
rm -rf ./php-version-benchmarks/docs/results
|
rm -rf ./php-version-benchmarks/docs/results
|
||||||
- name: Checkout benchmark data
|
- name: Checkout benchmark data
|
||||||
uses: actions/checkout@v4
|
if: github.event_name != 'workflow_dispatch'
|
||||||
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: php/real-time-benchmark-data
|
repository: php/real-time-benchmark-data
|
||||||
ssh-key: ${{ secrets.PHP_VERSION_BENCHMARK_RESULTS_DEPLOY_KEY }}
|
ssh-key: ${{ secrets.PHP_VERSION_BENCHMARK_RESULTS_DEPLOY_KEY }}
|
||||||
path: 'php-version-benchmarks/docs/results'
|
path: 'php-version-benchmarks/docs/results'
|
||||||
- name: Set benchmark config
|
- name: Setup infra config
|
||||||
run: |
|
run: |
|
||||||
set -e
|
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
|
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')
|
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_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
|
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/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/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')"
|
BASELINE_SHORT_SHA="$(echo "${{ env.BASELINE_COMMIT }}" | cut -c1-4)"
|
||||||
DATABASE="./php-version-benchmarks/docs/results/$YEAR/database.tsv"
|
|
||||||
|
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
|
if [ -f "$DATABASE" ]; then
|
||||||
LAST_RESULT_SHA="$(tail -n 2 "$DATABASE" | head -n 1 | cut -f 6)"
|
LAST_RESULT_SHA="$(tail -n 2 "$DATABASE" | head -n 1 | cut -f 6)"
|
||||||
else
|
else
|
||||||
YESTERDAY="$(date -d "-2 day 23:59:59" '+%Y-%m-%d %H:%M:%S')"
|
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
|
fi
|
||||||
|
|
||||||
BASELINE_SHA="d5f6e56610c729710073350af318c4ea1b292cfe"
|
cat << EOF > ./php-version-benchmarks/config/php/previous.ini
|
||||||
BASELINE_SHORT_SHA="$(echo "$BASELINE_SHA" | cut -c1-4)"
|
PHP_NAME="PHP - previous ${{ env.BRANCH }}"
|
||||||
|
PHP_ID=php_previous
|
||||||
|
|
||||||
# Set config for the baseline PHP version
|
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
|
||||||
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_baseline.ini
|
PHP_BRANCH=${{ env.BRANCH }}
|
||||||
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - baseline@'"$BASELINE_SHORT_SHA"'"/g' ./php-version-benchmarks/config/php/master_baseline.ini
|
PHP_COMMIT=$LAST_RESULT_SHA
|
||||||
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
|
|
||||||
|
|
||||||
# Set config for the previous PHP version
|
PHP_OPCACHE=1
|
||||||
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_last.ini
|
PHP_JIT=0
|
||||||
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - previous master"/g' ./php-version-benchmarks/config/php/master_last.ini
|
EOF
|
||||||
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_previous/g" ./php-version-benchmarks/config/php/master_last.ini
|
- name: Setup PHP config - benchmarked PHP version
|
||||||
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$LAST_RESULT_SHA/g" ./php-version-benchmarks/config/php/master_last.ini
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
# Set config for the current PHP version
|
cat << EOF > ./php-version-benchmarks/config/php/this.ini
|
||||||
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_now.ini
|
PHP_NAME="PHP - ${{ env.BRANCH }}"
|
||||||
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now.ini
|
PHP_ID=php_${{ env.ID }}
|
||||||
|
|
||||||
# Set config for current PHP version with JIT
|
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
|
||||||
git clone ./php-version-benchmarks/tmp/php_master/ ./php-version-benchmarks/tmp/php_master_jit
|
PHP_BRANCH=${{ env.BRANCH }}
|
||||||
cp ./php-version-benchmarks/config/php/master_jit.ini.dist ./php-version-benchmarks/config/php/master_now_jit.ini
|
PHP_COMMIT=${{ env.COMMIT }}
|
||||||
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now_jit.ini
|
|
||||||
|
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/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/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
|
cp ./php-version-benchmarks/config/test/4_wordpress.ini.dist ./php-version-benchmarks/config/test/4_wordpress.ini
|
||||||
|
@ -102,6 +254,7 @@ jobs:
|
||||||
- name: Run benchmark
|
- name: Run benchmark
|
||||||
run: ./php-version-benchmarks/benchmark.sh run aws
|
run: ./php-version-benchmarks/benchmark.sh run aws
|
||||||
- name: Store results
|
- name: Store results
|
||||||
|
if: github.repository == 'php/php-src' && github.event_name != 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
@ -117,6 +270,21 @@ jobs:
|
||||||
fi
|
fi
|
||||||
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
|
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
|
||||||
git push
|
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
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
|
2
.github/workflows/root.yml
vendored
2
.github/workflows/root.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
branches: ${{ steps.set-matrix.outputs.branches }}
|
branches: ${{ steps.set-matrix.outputs.branches }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
# Set fetch-depth to 0 to clone the full repository
|
# Set fetch-depth to 0 to clone the full repository
|
||||||
# including all branches. This is required to find
|
# 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/cgi/php-cgi
|
||||||
/sapi/fpm/php-fpm
|
/sapi/fpm/php-fpm
|
||||||
/sapi/phpdbg/phpdbg
|
/sapi/phpdbg/phpdbg
|
||||||
|
/sapi/fuzzer/php-fuzz-*
|
||||||
/scripts/php-config
|
/scripts/php-config
|
||||||
/scripts/phpize
|
/scripts/phpize
|
||||||
php
|
php
|
||||||
|
|
217
NEWS
217
NEWS
|
@ -1,6 +1,204 @@
|
||||||
PHP NEWS
|
PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? ????, PHP 8.5.0alpha2
|
?? ??? ????, PHP 8.5.0beta2
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler()
|
||||||
|
triggers "Constant already defined" warning). (ilutov)
|
||||||
|
. Fixed bug GH-19476 (pipe operator fails to correctly handle returning
|
||||||
|
by reference). (alexandre-daubois)
|
||||||
|
. The report_memleaks INI directive has been deprecated. (alexandre-daubois)
|
||||||
|
. Constant redeclaration is deprecated and this behavior will trigger an
|
||||||
|
error in PHP 9. (alexandre-daubois)
|
||||||
|
|
||||||
|
- ODBC:
|
||||||
|
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
|
||||||
|
(Jakub Zelenka)
|
||||||
|
|
||||||
|
- Session:
|
||||||
|
. Added support for partitioned cookies. (nielsdos)
|
||||||
|
|
||||||
|
- SPL:
|
||||||
|
. Deprecate ArrayObject and ArrayIterator with objects. (Girgias)
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
|
||||||
|
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||||
|
(Girgias)
|
||||||
|
. Added support for partitioned cookies. (nielsdos)
|
||||||
|
|
||||||
|
14 Aug 2025, PHP 8.5.0beta1
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
|
||||||
|
been deprecated. (Girgias)
|
||||||
|
. The $exclude_disabled parameter of the get_defined_functions() function has
|
||||||
|
been deprecated, as it no longer has any effect since PHP 8.0. (Girgias)
|
||||||
|
. Terminating case statements with a semicolon instead of a colon has
|
||||||
|
been deprecated. (theodorejb)
|
||||||
|
. The backtick operator as an alias for shell_exec() has been deprecated.
|
||||||
|
(timwolla)
|
||||||
|
. Returning null from __debugInfo() has been deprecated. (DanielEScherzer)
|
||||||
|
. Support #[\Override] on properties. (Jiří Pudil)
|
||||||
|
|
||||||
|
- Curl:
|
||||||
|
. The curl_close() function has been deprecated. (DanielEScherzer)
|
||||||
|
. The curl_share_close() function has been deprecated. (DanielEScherzer)
|
||||||
|
|
||||||
|
- Date:
|
||||||
|
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
|
||||||
|
deprecated. (jorgsowa)
|
||||||
|
|
||||||
|
- DOM:
|
||||||
|
. Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the
|
||||||
|
first when using ~ and :has). (nielsdos, lexborisov)
|
||||||
|
|
||||||
|
- FileInfo
|
||||||
|
. The finfo_close() function has been deprecated. (timwolla)
|
||||||
|
. The $context parameter of the finfo_buffer() function has been deprecated
|
||||||
|
as it is ignored. (Girgias)
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. The imagedestroy() function has been deprecated. (DanielEScherzer)
|
||||||
|
|
||||||
|
- Intl:
|
||||||
|
. Intl's internal error mechanism has been modernized so that it
|
||||||
|
indicates more accurately which call site caused what error.
|
||||||
|
Moreover, some ext/date exceptions have been wrapped inside a
|
||||||
|
IntlException now. (Girgias)
|
||||||
|
. The intl.error_level INI setting has been deprecated. (Girgias)
|
||||||
|
|
||||||
|
- MySQLi:
|
||||||
|
. The mysqli_execute() alias function has been deprecated. (timwolla)
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias
|
||||||
|
algorithms appears to be broken). (Jakub Zelenka)
|
||||||
|
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
|
||||||
|
(Girgias)
|
||||||
|
. Implement #80495 (Enable to set padding in openssl_(sign|verify).
|
||||||
|
(Jakub Zelenka)
|
||||||
|
. Implement #47728 (openssl_pkcs7_sign ignores new openssl flags).
|
||||||
|
(Jakub Zelenka)
|
||||||
|
|
||||||
|
- PDO:
|
||||||
|
. The "uri:" DSN scheme has been deprecated due to security concerns with
|
||||||
|
DSNs coming from remote URIs. (timwolla)
|
||||||
|
|
||||||
|
- Reflection:
|
||||||
|
. Fixed bug GH-17927 (Reflection: have some indication of property hooks in
|
||||||
|
`_property_string()`). (DanielEScherzer)
|
||||||
|
. The setAccessible() methods of various Reflection objects have been
|
||||||
|
deprecated, as those no longer have an effect. (timwolla)
|
||||||
|
. ReflectionClass::getConstant() for constants that do not exist has been
|
||||||
|
deprecated. (DanielEScherzer)
|
||||||
|
. ReflectionProperty::getDefaultValue() for properties without default values
|
||||||
|
has been deprecated. (DanielEScherzer)
|
||||||
|
|
||||||
|
- SPL:
|
||||||
|
. Unregistering all autoloaders by passing the spl_autoload_call() function
|
||||||
|
as a callback argument to spl_autoload_unregister() has been deprecated.
|
||||||
|
Instead if this is needed, one should iterate over the return value of
|
||||||
|
spl_autoload_functions() and call spl_autoload_unregister() on each
|
||||||
|
value. (Girgias)
|
||||||
|
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
|
||||||
|
SplObjectStorage::detach() methods have been deprecated in favour of
|
||||||
|
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
|
||||||
|
SplObjectStorage::offsetUnset() respectively. (Girgias)
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. The socket_set_timeout() alias function has been deprecated. (timwolla)
|
||||||
|
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
|
||||||
|
opened directory has been deprecated. (Girgias)
|
||||||
|
. Fixed bug GH-19153 (#[\Attribute] validation should error on
|
||||||
|
trait/interface/enum/abstract class). (DanielEScherzer)
|
||||||
|
|
||||||
|
- XML:
|
||||||
|
. The xml_parser_free() function has been deprecated. (DanielEScherzer)
|
||||||
|
|
||||||
|
31 Jul 2025, PHP 8.5.0alpha4
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Add clone-with support to the clone() function. (timwolla, edorian)
|
||||||
|
. Fix support for non-userland stream notifiers. (timwolla)
|
||||||
|
. Added PHP_BUILD_PROVIDER constant. (timwolla)
|
||||||
|
. Fixed bug GH-19305 (Operands may be being released during comparison).
|
||||||
|
(Arnaud)
|
||||||
|
. Fixed bug GH-19306 (Generator can be resumed while fetching next value from
|
||||||
|
delegated Generator). (Arnaud)
|
||||||
|
. Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
|
||||||
|
a non-Generator delegate crashes). (Arnaud)
|
||||||
|
|
||||||
|
- Curl:
|
||||||
|
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
|
||||||
|
. Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (thecaliskan)
|
||||||
|
. Add support for CURLOPT_SSL_SIGNATURE_ALGORITHMS. (Ayesh Karunaratne)
|
||||||
|
|
||||||
|
- FPM:
|
||||||
|
. Make FPM access log limit configurable using log_limit. (Jakub Zelenka)
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. Fix incorrect comparison with result of php_stream_can_cast(). (Girgias)
|
||||||
|
|
||||||
|
- Intl:
|
||||||
|
. Fix return value on failure for resourcebundle count handler. (Girgias)
|
||||||
|
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
|
||||||
|
|
||||||
|
- OPcache:
|
||||||
|
. Disallow changing opcache.memory_consumption when SHM is already set up.
|
||||||
|
(timwolla)
|
||||||
|
. Fixed bug GH-15074 (Compiling opcache statically into ZTS PHP fails).
|
||||||
|
(Arnaud)
|
||||||
|
. Make OPcache non-optional (Arnaud, timwolla)
|
||||||
|
. Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for
|
||||||
|
deprecations). (Arnaud, timwolla)
|
||||||
|
. Fixed bug GH-19301 (opcache build failure). (Remi)
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. Add $digest_algo parameter to openssl_public_encrypt() and
|
||||||
|
openssl_private_decrypt() functions. (Jakub Zelenka)
|
||||||
|
|
||||||
|
- POSIX:
|
||||||
|
. posix_kill and posix_setpgid throws a ValueError on invalid process_id.
|
||||||
|
(David Carlier)
|
||||||
|
. posix_setpgid throws a ValueError on invalid process_group_id,
|
||||||
|
posix_setrlimit throws a ValueError on invalid soft_limit and hard_limit
|
||||||
|
arguments. (David Carlier)
|
||||||
|
|
||||||
|
- Reflection:
|
||||||
|
. Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when
|
||||||
|
retrieved from ReflectionProperty::getSettableType()). (ilutov)
|
||||||
|
|
||||||
|
- Session:
|
||||||
|
. Fixed GH-19197: build broken with ZEND_STRL usage with memcpy
|
||||||
|
when implemented as macro. (David Carlier)
|
||||||
|
|
||||||
|
- Soap:
|
||||||
|
. Fixed bug GH-19226 (Segfault when spawning new thread in soap extension).
|
||||||
|
(Florian Engelhardt)
|
||||||
|
|
||||||
|
- Sockets:
|
||||||
|
. socket_set_option for multicast context throws a ValueError
|
||||||
|
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. Add HEIF/HEIC support to getimagesize. (Benstone Zhang)
|
||||||
|
. Implement #71517 (Implement SVG support for getimagesize() and friends).
|
||||||
|
(nielsdos)
|
||||||
|
. Optimized PHP html_entity_decode function. (Artem Ukrainskiy)
|
||||||
|
. Minor optimization to array_chunk(). (nielsdos)
|
||||||
|
|
||||||
|
- URI:
|
||||||
|
. Empty host handling is fixed. (Máté Kocsis)
|
||||||
|
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
|
||||||
|
contains a port. Now, it triggers an exception; previously, the error
|
||||||
|
was silently swallowed. (Máté Kocsis)
|
||||||
|
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
|
||||||
|
|
||||||
|
17 Jul 2025, PHP 8.5.0alpha2
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
. Fix OSS-Fuzz #427814452 (pipe compilation fails with assert).
|
. Fix OSS-Fuzz #427814452 (pipe compilation fails with assert).
|
||||||
|
@ -41,7 +239,7 @@ PHP NEWS
|
||||||
|
|
||||||
- CURL:
|
- CURL:
|
||||||
. Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY
|
. 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:
|
- COM:
|
||||||
. Fixed property access of PHP objects wrapped in variant. (cmb)
|
. Fixed property access of PHP objects wrapped in variant. (cmb)
|
||||||
|
@ -135,8 +333,8 @@ PHP NEWS
|
||||||
. Added grapheme_levenshtein() function. (Yuya Hamada)
|
. Added grapheme_levenshtein() function. (Yuya Hamada)
|
||||||
. Added Locale::addLikelySubtags/Locale::minimizeSubtags to handle
|
. Added Locale::addLikelySubtags/Locale::minimizeSubtags to handle
|
||||||
adding/removing likely subtags to a locale. (David Carlier)
|
adding/removing likely subtags to a locale. (David Carlier)
|
||||||
. Added IntlListFormatter class to format a list of items with a locale
|
. Added IntlListFormatter class to format a list of items with a locale,
|
||||||
, operands types and units. (BogdanUngureanu)
|
operands types and units. (BogdanUngureanu)
|
||||||
. Fixed bug GH-18566 ([intl] Weird numeric sort in Collator). (nielsdos)
|
. Fixed bug GH-18566 ([intl] Weird numeric sort in Collator). (nielsdos)
|
||||||
|
|
||||||
- LDAP:
|
- LDAP:
|
||||||
|
@ -160,7 +358,7 @@ PHP NEWS
|
||||||
|
|
||||||
- OpenSSL:
|
- OpenSSL:
|
||||||
. Added openssl.libctx INI that allows to select the OpenSSL library context
|
. 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)
|
(Jakub Zelenka)
|
||||||
|
|
||||||
- Output:
|
- Output:
|
||||||
|
@ -170,7 +368,7 @@ PHP NEWS
|
||||||
. Extend pcntl_waitid with rusage parameter. (vrza)
|
. Extend pcntl_waitid with rusage parameter. (vrza)
|
||||||
|
|
||||||
- PCRE:
|
- 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.
|
. Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
|
||||||
(mvorisek)
|
(mvorisek)
|
||||||
|
|
||||||
|
@ -216,8 +414,9 @@ PHP NEWS
|
||||||
(DanielEScherzer)
|
(DanielEScherzer)
|
||||||
. Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF
|
. Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF
|
||||||
zval for uninitialized typed properties). (nielsdos)
|
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)
|
for enums). (DanielEScherzer)
|
||||||
|
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
|
||||||
|
|
||||||
- Session:
|
- Session:
|
||||||
. session_start() throws a ValueError on option argument if not a hashmap
|
. session_start() throws a ValueError on option argument if not a hashmap
|
||||||
|
@ -278,7 +477,7 @@ PHP NEWS
|
||||||
(David Carlier)
|
(David Carlier)
|
||||||
|
|
||||||
- Sodium:
|
- Sodium:
|
||||||
. Fix overall theorical overflows on zend_string buffer allocations.
|
. Fix overall theoretical overflows on zend_string buffer allocations.
|
||||||
(David Carlier/nielsdos)
|
(David Carlier/nielsdos)
|
||||||
|
|
||||||
- Sqlite:
|
- Sqlite:
|
||||||
|
@ -307,7 +506,7 @@ PHP NEWS
|
||||||
(cmb)
|
(cmb)
|
||||||
|
|
||||||
- Tests:
|
- Tests:
|
||||||
. Allow to shuffle tests even in non-parallell mode. (dhuang00)
|
. Allow to shuffle tests even in non-parallel mode. (dhuang00)
|
||||||
|
|
||||||
- Tidy:
|
- Tidy:
|
||||||
. tidy::__construct/parseFile/parseString methods throw an exception if
|
. tidy::__construct/parseFile/parseString methods throw an exception if
|
||||||
|
|
263
UPGRADING
263
UPGRADING
|
@ -44,6 +44,15 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. Traits are now bound before the parent class. This is a subtle behavioral
|
. Traits are now bound before the parent class. This is a subtle behavioral
|
||||||
change, but should more closely match user expectations, demonstrated by
|
change, but should more closely match user expectations, demonstrated by
|
||||||
GH-15753 and GH-16198.
|
GH-15753 and GH-16198.
|
||||||
|
. Errors emitted during compilation and class linking are now always delayed
|
||||||
|
and handled after compilation or class linking. Fatal errors emitted during
|
||||||
|
compilation or class linking cause any delayed errors to be handled
|
||||||
|
immediately, without calling user-defined error handlers.
|
||||||
|
. Exceptions thrown by user-defined error handlers when handling class linking
|
||||||
|
errors are not promoted to fatal errors anymore and do not prevent linking.
|
||||||
|
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
|
||||||
|
an error during compilation. Previously, the attribute could be added, but when
|
||||||
|
ReflectionAttribute::newInstance() was called an error would be thrown.
|
||||||
|
|
||||||
- DOM:
|
- DOM:
|
||||||
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
|
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
|
||||||
|
@ -71,6 +80,20 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. Calling the mysqli constructor on an already-constructed object
|
. Calling the mysqli constructor on an already-constructed object
|
||||||
is now no longer possible and throws an Error.
|
is now no longer possible and throws an Error.
|
||||||
|
|
||||||
|
- ODBC:
|
||||||
|
. ODBC now assumes that at least ODBC 3.5 functionality is available. The
|
||||||
|
ODBCVER definition and build system flags to control it have been removed.
|
||||||
|
|
||||||
|
- Opcache:
|
||||||
|
. The Opcache extension is now always built into the PHP binary and is always
|
||||||
|
loaded. The INI directives opcache.enable and opcache.enable_cli are still
|
||||||
|
honored.
|
||||||
|
The --enable-opcache/--disable-opcache configure flags have been removed,
|
||||||
|
and the build does not produce opcache.so or php_opcache.dll objects
|
||||||
|
anymore.
|
||||||
|
Using zend_extension=opcache.so or zend_extension=php_opcache.dll INI
|
||||||
|
directives will emit a warning.
|
||||||
|
|
||||||
- PCNTL:
|
- PCNTL:
|
||||||
. pcntl_exec() now throws ValueErrors when entries of the $args parameter
|
. pcntl_exec() now throws ValueErrors when entries of the $args parameter
|
||||||
contain null bytes.
|
contain null bytes.
|
||||||
|
@ -159,6 +182,8 @@ PHP 8.5 UPGRADE NOTES
|
||||||
RFC: https://wiki.php.net/rfc/pipe-operator-v3
|
RFC: https://wiki.php.net/rfc/pipe-operator-v3
|
||||||
. Constructor property promotion can now be used for final properties.
|
. Constructor property promotion can now be used for final properties.
|
||||||
RFC: https://wiki.php.net/rfc/final_promotion
|
RFC: https://wiki.php.net/rfc/final_promotion
|
||||||
|
. #[\Override] can now be applied to properties.
|
||||||
|
RFC: https://wiki.php.net/rfc/override_properties
|
||||||
|
|
||||||
- Curl:
|
- Curl:
|
||||||
. Added support for share handles that are persisted across multiple PHP
|
. Added support for share handles that are persisted across multiple PHP
|
||||||
|
@ -188,6 +213,18 @@ PHP 8.5 UPGRADE NOTES
|
||||||
first redirect thus if there is any follow up redirect, it won't go
|
first redirect thus if there is any follow up redirect, it won't go
|
||||||
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
|
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
|
||||||
to true.
|
to true.
|
||||||
|
. Added support for CURLINFO_CONN_ID (libcurl >= 8.2.0) to the curl_getinfo()
|
||||||
|
function. This constant allows retrieving the unique ID of the connection
|
||||||
|
used by a cURL transfer. It is primarily useful when connection reuse or
|
||||||
|
connection pooling logic is needed in PHP-level applications. When
|
||||||
|
curl_getinfo() returns an array, this value is available as the "conn_id" key.
|
||||||
|
. Added support for CURLINFO_QUEUE_TIME_T (libcurl >= 8.6.0) to the curl_getinfo()
|
||||||
|
function. This constant allows retrieving the time (in microseconds) that the
|
||||||
|
request spent in libcurl’s connection queue before it was sent.
|
||||||
|
This value can also be retrieved by passing CURLINFO_QUEUE_TIME_T to the
|
||||||
|
curl_getinfo() $option parameter.
|
||||||
|
. Added support for CURLOPT_SSL_SIGNATURE_ALGORITHMS to specify the signature
|
||||||
|
algorithms to use for TLS.
|
||||||
|
|
||||||
- DOM:
|
- DOM:
|
||||||
. Added Dom\Element::$outerHTML.
|
. Added Dom\Element::$outerHTML.
|
||||||
|
@ -216,6 +253,11 @@ PHP 8.5 UPGRADE NOTES
|
||||||
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
|
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
|
||||||
Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
|
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:
|
- SOAP:
|
||||||
. Enumeration cases are now dumped in __getTypes().
|
. Enumeration cases are now dumped in __getTypes().
|
||||||
. Implemented request #61105:
|
. Implemented request #61105:
|
||||||
|
@ -234,6 +276,16 @@ PHP 8.5 UPGRADE NOTES
|
||||||
process was terminated unexpectedly. In such cases, a warning is emitted
|
process was terminated unexpectedly. In such cases, a warning is emitted
|
||||||
and the function returns false. Previously, these errors were silently
|
and the function returns false. Previously, these errors were silently
|
||||||
ignored. This change affects only the sendmail transport.
|
ignored. This change affects only the sendmail transport.
|
||||||
|
. getimagesize() now supports HEIF/HEIC images.
|
||||||
|
. getimagesize() now supports SVG images when ext-libxml is also loaded.
|
||||||
|
Similarly, image_type_to_extension() and image_type_to_mime_type()
|
||||||
|
now also handle IMAGETYPE_SVG.
|
||||||
|
. The array returned by getimagesize() now has two additional entries:
|
||||||
|
"width_unit" and "height_unit" to indicate in which units the dimensions
|
||||||
|
are expressed. These units are px by default. They are not necessarily
|
||||||
|
the same (just to give one example: one may be cm and the other may be px).
|
||||||
|
. setcookie() and setrawcookie() now support the "partitioned" key.
|
||||||
|
RFC: https://wiki.php.net/rfc/CHIPS
|
||||||
|
|
||||||
- XSL:
|
- XSL:
|
||||||
. The $namespace argument of XSLTProcessor::getParameter(),
|
. The $namespace argument of XSLTProcessor::getParameter(),
|
||||||
|
@ -260,6 +312,7 @@ PHP 8.5 UPGRADE NOTES
|
||||||
- FPM:
|
- FPM:
|
||||||
. FPM with httpd ProxyPass decodes the full script path. Added
|
. FPM with httpd ProxyPass decodes the full script path. Added
|
||||||
fastcgi.script_path_encoded INI setting to prevent this new behavior.
|
fastcgi.script_path_encoded INI setting to prevent this new behavior.
|
||||||
|
. FPM access log limit now respects log_limit value.
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
4. Deprecated Functionality
|
4. Deprecated Functionality
|
||||||
|
@ -277,12 +330,122 @@ PHP 8.5 UPGRADE NOTES
|
||||||
one will still be used. If a user output handler returns a non-string and
|
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.
|
produces output, the warning about producing an output is emitted first.
|
||||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
|
||||||
|
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
|
||||||
|
been deprecated, use (bool), (int), (float), and (string) respectively.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names
|
||||||
|
. The $exclude_disabled parameter of the get_defined_functions() function has
|
||||||
|
been deprecated, as it no longer has any effect since PHP 8.0.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
|
||||||
|
. Terminating case statements with a semicolon instead of a colon has
|
||||||
|
been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement
|
||||||
|
. The backtick operator as an alias for shell_exec() has been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
|
||||||
|
. Returning null from __debugInfo() has been deprecated.
|
||||||
|
Return an empty array instead.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
|
||||||
|
. The report_memleaks INI directive has been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive
|
||||||
|
. Constant redeclaration is deprecated and that behavior will trigger an
|
||||||
|
error in PHP 9.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration
|
||||||
|
|
||||||
|
- Curl:
|
||||||
|
. The curl_close() function has been deprecated, as CurlHandle objects are
|
||||||
|
freed automatically.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close
|
||||||
|
. The curl_share_close() function has been deprecated, as CurlShareHandle
|
||||||
|
objects are freed automatically.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close
|
||||||
|
|
||||||
|
- Date:
|
||||||
|
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
|
||||||
|
deprecated. This is because the associated timezone is ignored and always
|
||||||
|
uses GMT.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
|
||||||
|
|
||||||
|
- FileInfo:
|
||||||
|
. The finfo_close() function has been deprecated.
|
||||||
|
As finfo objects are freed automatically.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
|
||||||
|
. The $context parameter of the finfo_buffer() function has been deprecated
|
||||||
|
as it is ignored.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. The imagedestroy() function has been deprecated, as GdImage objects are
|
||||||
|
freed automatically.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy
|
||||||
|
|
||||||
- Hash:
|
- Hash:
|
||||||
. The MHASH_* constants have been deprecated. These have been overlooked
|
. The MHASH_* constants have been deprecated. These have been overlooked
|
||||||
when the mhash*() function family has been deprecated per
|
when the mhash*() function family has been deprecated per
|
||||||
https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
|
https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
|
||||||
|
|
||||||
|
- Intl:
|
||||||
|
. The intl.error_level INI setting has been deprecated.
|
||||||
|
Errors should either be checked manually or exceptions should be enabled
|
||||||
|
by using the intl.use_exceptions INI setting.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting
|
||||||
|
|
||||||
|
- MySQLi:
|
||||||
|
. The mysqli_execute() alias function has been deprecated.
|
||||||
|
Use mysqli_stmt_execute() instead.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
|
||||||
|
This is because it is either ignored, or truncates the key, which can be
|
||||||
|
a vulnerability.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
|
||||||
|
|
||||||
|
- PDO:
|
||||||
|
. The "uri:" DSN scheme has been deprecated due to security concerns with
|
||||||
|
DSNs coming from remote URIs.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
|
||||||
|
|
||||||
|
- Reflection:
|
||||||
|
. The setAccessible() methods of various Reflection objects have been
|
||||||
|
deprecated, as those no longer have an effect.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
|
||||||
|
. Calling ReflectionClass::getConstant() for constants that do not exist has
|
||||||
|
been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants
|
||||||
|
. Calling ReflectionProperty::getDefaultValue() for properties without default
|
||||||
|
values has been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values
|
||||||
|
|
||||||
|
- SPL:
|
||||||
|
. Unregistering all autoloaders by passing the spl_autoload_call() function
|
||||||
|
as a callback argument to spl_autoload_unregister() has been deprecated.
|
||||||
|
Instead if this is needed, one should iterate over the return value of
|
||||||
|
spl_autoload_functions() and call spl_autoload_unregister() on each value.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister
|
||||||
|
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
|
||||||
|
SplObjectStorage::detach() methods have been deprecated in favour of
|
||||||
|
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
|
||||||
|
SplObjectStorage::offsetUnset() respectively.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
|
||||||
|
. Using ArrayObject and ArrayIterator with objects has been deprecated.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. The socket_set_timeout() alias function has been deprecated.
|
||||||
|
Use stream_set_timeout() instead.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
|
||||||
|
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
|
||||||
|
opened directory has been deprecated. Provide the last opened directory
|
||||||
|
explicitly instead.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
|
||||||
|
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
|
||||||
|
This is because a byte can only hold a value within this interval.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
|
||||||
|
|
||||||
|
- XML:
|
||||||
|
. The xml_parser_free() function has been deprecated, as XMLParser objects
|
||||||
|
are freed automatically.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
5. Changed Functions
|
5. Changed Functions
|
||||||
========================================
|
========================================
|
||||||
|
@ -307,6 +470,15 @@ PHP 8.5 UPGRADE NOTES
|
||||||
- libxml:
|
- libxml:
|
||||||
. libxml_set_external_entity_loader() now has a formal return type of true.
|
. libxml_set_external_entity_loader() now has a formal return type of true.
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
|
||||||
|
$digest_algo that allows specifying hash digest algorithm for OEAP padding.
|
||||||
|
. openssl_sign() and openssl_verify() have new parameter $padding to allow
|
||||||
|
using more secure RSA PSS padding.
|
||||||
|
. openssl_cms_encrypt() $cipher_algo parameter can be a string with the
|
||||||
|
cipher name. That allows to use more algorithms including AES GCM cipher
|
||||||
|
algorithms for auth enveloped data.
|
||||||
|
|
||||||
- PCNTL:
|
- PCNTL:
|
||||||
. pcntl_exec() now has a formal return type of false.
|
. pcntl_exec() now has a formal return type of false.
|
||||||
. pcntl_waitid() takes an additional resource_usage argument to
|
. pcntl_waitid() takes an additional resource_usage argument to
|
||||||
|
@ -339,16 +511,28 @@ PHP 8.5 UPGRADE NOTES
|
||||||
an invalid file descriptor.
|
an invalid file descriptor.
|
||||||
. posix_fpathconf checks invalid file descriptors and sets
|
. posix_fpathconf checks invalid file descriptors and sets
|
||||||
last_error to EBADF and raises an E_WARNING message.
|
last_error to EBADF and raises an E_WARNING message.
|
||||||
|
. posix_kill throws a ValueError when the process_id argument is lower
|
||||||
|
or greater than what supports the platform (signed integer or long
|
||||||
|
range), posix_setpgid throws a ValueError when the process_id or
|
||||||
|
the process_group_id is lower than zero or greater than
|
||||||
|
what supports the platform.
|
||||||
|
. posix_setrlimit throws a ValueError when the hard_limit of soft_limit
|
||||||
|
argument are lower than -1 or if soft_limit is greater than hard_limit.
|
||||||
|
|
||||||
- Reflection:
|
- 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
|
better indicate that the class is an enum, and that the enum cases
|
||||||
are enum cases rather than normal class constants.
|
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:
|
||||||
. session_start is stricter in regard to the option argument.
|
. session_start is stricter in regard to the option argument.
|
||||||
It throws a ValueError if the whole is not a hashmap or
|
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.
|
compatible with int.
|
||||||
|
|
||||||
- SNMP:
|
- SNMP:
|
||||||
|
@ -361,7 +545,7 @@ PHP 8.5 UPGRADE NOTES
|
||||||
- Sockets:
|
- Sockets:
|
||||||
. socket_create_listen, socket_bind and socket_sendto throw a
|
. socket_create_listen, socket_bind and socket_sendto throw a
|
||||||
ValueError if the port is lower than 0 or greater than 65535,
|
ValueError if the port is lower than 0 or greater than 65535,
|
||||||
also if any of the hints array entry is indexes numerically.
|
and also if any of the hints array entries are indexed numerically.
|
||||||
. socket_addrinfo_lookup throws a TypeError if any of the hints
|
. socket_addrinfo_lookup throws a TypeError if any of the hints
|
||||||
values cannot be cast to int and can throw a ValueError if
|
values cannot be cast to int and can throw a ValueError if
|
||||||
any of these values overflow.
|
any of these values overflow.
|
||||||
|
@ -371,6 +555,8 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. socket_create/socket_bind can create AF_PACKET family sockets.
|
. socket_create/socket_bind can create AF_PACKET family sockets.
|
||||||
. socket_getsockname gets the interface index and its string
|
. socket_getsockname gets the interface index and its string
|
||||||
representation with AF_PACKET socket.
|
representation with AF_PACKET socket.
|
||||||
|
. socket_set_option with multicast context throws a ValueError
|
||||||
|
when the created socket is not of AF_INET/AF_INET6 family.
|
||||||
|
|
||||||
- Tidy:
|
- Tidy:
|
||||||
. tidy::__construct/parseFile/parseString now throws a ValueError
|
. tidy::__construct/parseFile/parseString now throws a ValueError
|
||||||
|
@ -396,8 +582,10 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. get_exception_handler() allows retrieving the current user-defined exception
|
. get_exception_handler() allows retrieving the current user-defined exception
|
||||||
handler function.
|
handler function.
|
||||||
RFC: https://wiki.php.net/rfc/get-error-exception-handler
|
RFC: https://wiki.php.net/rfc/get-error-exception-handler
|
||||||
. The clone language construct is now a function.
|
. The clone language construct is now a function and supports reassigning
|
||||||
|
(readonly) properties during cloning via the new $withProperties parameter.
|
||||||
RFC: https://wiki.php.net/rfc/clone_with_v2
|
RFC: https://wiki.php.net/rfc/clone_with_v2
|
||||||
|
. Added Closure::getCurrent() to receive currently executing closure.
|
||||||
|
|
||||||
- Curl:
|
- Curl:
|
||||||
. curl_multi_get_handles() allows retrieving all CurlHandles current
|
. curl_multi_get_handles() allows retrieving all CurlHandles current
|
||||||
|
@ -423,6 +611,9 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. Added grapheme_levenshtein() function.
|
. Added grapheme_levenshtein() function.
|
||||||
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
|
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
|
||||||
|
|
||||||
|
- Opcache:
|
||||||
|
. Added opcache_is_script_cached_in_file_cache().
|
||||||
|
|
||||||
- Pdo\Sqlite:
|
- Pdo\Sqlite:
|
||||||
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
|
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
|
||||||
SQLite3::setAuthorizer(). The only interface difference is that the
|
SQLite3::setAuthorizer(). The only interface difference is that the
|
||||||
|
@ -440,6 +631,7 @@ PHP 8.5 UPGRADE NOTES
|
||||||
ReflectionConstant::getExtensionName() were introduced.
|
ReflectionConstant::getExtensionName() were introduced.
|
||||||
. ReflectionConstant::getAttributes() was introduced.
|
. ReflectionConstant::getAttributes() was introduced.
|
||||||
RFC: https://wiki.php.net/rfc/attributes-on-constants
|
RFC: https://wiki.php.net/rfc/attributes-on-constants
|
||||||
|
. ReflectionProperty::getMangledName() was introduced.
|
||||||
|
|
||||||
- Sqlite:
|
- Sqlite:
|
||||||
. Sqlite3Stmt::busy to check if a statement had been fetched
|
. Sqlite3Stmt::busy to check if a statement had been fetched
|
||||||
|
@ -453,11 +645,22 @@ PHP 8.5 UPGRADE NOTES
|
||||||
7. New Classes and Interfaces
|
7. New Classes and Interfaces
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. NoDiscard attribute was added.
|
||||||
|
RFC: https://wiki.php.net/rfc/marking_return_value_as_important
|
||||||
|
|
||||||
- Curl:
|
- Curl:
|
||||||
. CurlSharePersistentHandle representing a share handle that is persisted
|
. CurlSharePersistentHandle representing a share handle that is persisted
|
||||||
across multiple PHP requests.
|
across multiple PHP requests.
|
||||||
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
|
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
|
||||||
|
|
||||||
|
- URI:
|
||||||
|
. Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode,
|
||||||
|
Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException,
|
||||||
|
Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError,
|
||||||
|
and Uri\WhatWg\Url are added.
|
||||||
|
RFC: https://wiki.php.net/rfc/url_parsing_api
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
8. Removed Extensions and SAPIs
|
8. Removed Extensions and SAPIs
|
||||||
========================================
|
========================================
|
||||||
|
@ -472,17 +675,33 @@ PHP 8.5 UPGRADE NOTES
|
||||||
CURLFOLLOW_FIRSTONLY.
|
CURLFOLLOW_FIRSTONLY.
|
||||||
|
|
||||||
- Fileinfo:
|
- Fileinfo:
|
||||||
. Upgraded to file 5.46.
|
. Upgraded file from 5.45 to 5.46.
|
||||||
. The return type of finfo_close() has been changed to true, rather
|
. The return type of finfo_close() has been changed to true, rather
|
||||||
than bool.
|
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:
|
- Lexbor:
|
||||||
. An always enabled lexbor extension is added. It contains the lexbor
|
. An always enabled lexbor extension is added. It contains the lexbor
|
||||||
library that was separated from ext/dom for being reused among other
|
library that was separated from ext/dom for being reused among other
|
||||||
extensions. The new extension is not directly exposed to userland.
|
extensions. The new extension is not directly exposed to userland.
|
||||||
|
|
||||||
|
- Opcache:
|
||||||
|
. The Opcache extension is now always built into the PHP binary and is always
|
||||||
|
loaded. The INI directives opcache.enable and opcache.enable_cli are still
|
||||||
|
honored.
|
||||||
|
|
||||||
|
- URI:
|
||||||
|
. An always enabled uri extension is added that can be used for handling
|
||||||
|
URIs and URLs according to RFC 3986 and WHATWG URL.
|
||||||
|
RFC: https://wiki.php.net/rfc/url_parsing_api
|
||||||
|
|
||||||
- PCRE:
|
- PCRE:
|
||||||
. Upgraded to pcre2lib from 10.44 to 10.45.
|
. Upgraded pcre2lib from 10.44 to 10.45.
|
||||||
|
|
||||||
- PDO_Sqlite:
|
- PDO_Sqlite:
|
||||||
. Increased minimum release version support from 3.7.7 to 3.7.17.
|
. Increased minimum release version support from 3.7.7 to 3.7.17.
|
||||||
|
@ -498,11 +717,14 @@ PHP 8.5 UPGRADE NOTES
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
. PHP_BUILD_DATE.
|
. PHP_BUILD_DATE.
|
||||||
|
. PHP_BUILD_PROVIDER.
|
||||||
|
|
||||||
- Curl:
|
- Curl:
|
||||||
. CURLINFO_USED_PROXY.
|
. CURLINFO_USED_PROXY.
|
||||||
. CURLINFO_HTTPAUTH_USED.
|
. CURLINFO_HTTPAUTH_USED.
|
||||||
. CURLINFO_PROXYAUTH_USED.
|
. CURLINFO_PROXYAUTH_USED.
|
||||||
|
. CURLINFO_CONN_ID.
|
||||||
|
. CURLINFO_QUEUE_TIME_T.
|
||||||
. CURLOPT_INFILESIZE_LARGE.
|
. CURLOPT_INFILESIZE_LARGE.
|
||||||
. CURLFOLLOW_ALL.
|
. CURLFOLLOW_ALL.
|
||||||
. CURLFOLLOW_OBEYCODE.
|
. CURLFOLLOW_OBEYCODE.
|
||||||
|
@ -512,6 +734,13 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. DECIMAL_COMPACT_SHORT.
|
. DECIMAL_COMPACT_SHORT.
|
||||||
. DECIMAL_COMPACT_LONG.
|
. DECIMAL_COMPACT_LONG.
|
||||||
|
|
||||||
|
- OpenSSL:
|
||||||
|
. OPENSSL_PKCS1_PSS_PADDING
|
||||||
|
. PKCS7_NOSMIMECAP
|
||||||
|
. PKCS7_CRLFEOL
|
||||||
|
. PKCS7_NOCRL
|
||||||
|
. PKCS7_NO_DUAL_CONTENT
|
||||||
|
|
||||||
- POSIX:
|
- POSIX:
|
||||||
. POSIX_SC_OPEN_MAX.
|
. POSIX_SC_OPEN_MAX.
|
||||||
|
|
||||||
|
@ -535,6 +764,9 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. T_VOID_CAST.
|
. T_VOID_CAST.
|
||||||
. T_PIPE.
|
. T_PIPE.
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. IMAGETYPE_SVG when libxml is loaded.
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
11. Changes to INI File Handling
|
11. Changes to INI File Handling
|
||||||
========================================
|
========================================
|
||||||
|
@ -543,6 +775,11 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. Added fatal_error_backtraces to control whether fatal errors should include
|
. Added fatal_error_backtraces to control whether fatal errors should include
|
||||||
a backtrace.
|
a backtrace.
|
||||||
RFC: https://wiki.php.net/rfc/error_backtraces_v2
|
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:
|
- Opcache:
|
||||||
. Added opcache.file_cache_read_only to support a read-only
|
. Added opcache.file_cache_read_only to support a read-only
|
||||||
|
@ -557,11 +794,14 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. The default value of opcache.jit_hot_loop is now 61 (a prime) to prevent it
|
. The default value of opcache.jit_hot_loop is now 61 (a prime) to prevent it
|
||||||
from being a multiple of loop iteration counts.
|
from being a multiple of loop iteration counts.
|
||||||
It is recommended that this parameter is set to a prime number.
|
It is recommended that this parameter is set to a prime number.
|
||||||
|
. Changing opcache.memory_consumption when OPcache SHM is already set up
|
||||||
|
will now correctly report a failure instead of silently doing nothing and
|
||||||
|
showing misleading values in PHPInfo.
|
||||||
|
|
||||||
- OpenSSL:
|
- OpenSSL:
|
||||||
Added openssl.libctx to select the OpenSSL library context type. Either
|
. Added openssl.libctx to select the OpenSSL library context type. Either
|
||||||
custom libctx for each thread can be used or a single global (default)
|
custom libctx for each thread can be used or a single global (default)
|
||||||
libctx is used.
|
libctx is used.
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
12. Windows Support
|
12. Windows Support
|
||||||
|
@ -638,6 +878,10 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. The parts of the code that used SSE2 have been adapted to use SIMD
|
. The parts of the code that used SSE2 have been adapted to use SIMD
|
||||||
with ARM NEON as well.
|
with ARM NEON as well.
|
||||||
|
|
||||||
|
- Opcache:
|
||||||
|
. Improved performance of fetching TLS variables in JIT'ed code in non-Glibc
|
||||||
|
builds.
|
||||||
|
|
||||||
- ReflectionProperty:
|
- ReflectionProperty:
|
||||||
. Improved performance of the following methods: getValue(), getRawValue(),
|
. Improved performance of the following methods: getValue(), getRawValue(),
|
||||||
isInitialized(), setValue(), setRawValue().
|
isInitialized(), setValue(), setRawValue().
|
||||||
|
@ -652,6 +896,7 @@ PHP 8.5 UPGRADE NOTES
|
||||||
. Improved unpack() performance with nameless repetitions by avoiding
|
. Improved unpack() performance with nameless repetitions by avoiding
|
||||||
creating temporary strings and reparsing them.
|
creating temporary strings and reparsing them.
|
||||||
. Improved pack() performance.
|
. Improved pack() performance.
|
||||||
|
. Minor improvements in array_chunk() performance.
|
||||||
|
|
||||||
- XMLReader:
|
- XMLReader:
|
||||||
. Improved property access performance.
|
. Improved property access performance.
|
||||||
|
|
|
@ -23,6 +23,15 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
||||||
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
|
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
|
||||||
instead of dlopen.
|
instead of dlopen.
|
||||||
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
|
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
|
||||||
|
. The ptr field of the php_stream_notifier struct is now a void* instead
|
||||||
|
of a zval. If the zval was used to store IS_PTR values only, the
|
||||||
|
extra layer of indirection can be removed. In other cases a zval can
|
||||||
|
be heap-allocated and stored in the pointer as a minimal change to keep
|
||||||
|
compatibility.
|
||||||
|
|
||||||
|
- Hash
|
||||||
|
. Hash functions now use proper hash_spec_result enum for return values
|
||||||
|
instead of using SUCCESS and FAILURE.
|
||||||
|
|
||||||
- Zend
|
- Zend
|
||||||
. Added zend_safe_assign_to_variable_noref() function to safely assign
|
. Added zend_safe_assign_to_variable_noref() function to safely assign
|
||||||
|
@ -66,6 +75,15 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
||||||
* zend_register_string_constant()
|
* zend_register_string_constant()
|
||||||
* zend_register_stringl_constant()
|
* zend_register_stringl_constant()
|
||||||
. EG(fake_scope) now is a _const_ zend_class_entry*.
|
. EG(fake_scope) now is a _const_ zend_class_entry*.
|
||||||
|
. zend_begin_record_errors() or EG(record_errors)=true cause errors to be
|
||||||
|
delayed. Before, errors would be recorded but not delayed.
|
||||||
|
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
|
||||||
|
from the parent process after a fork().
|
||||||
|
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
|
||||||
|
|
||||||
|
- standard
|
||||||
|
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
|
||||||
|
were removed. Use the corresponding headers in Zend/ instead.
|
||||||
|
|
||||||
========================
|
========================
|
||||||
2. Build system changes
|
2. Build system changes
|
||||||
|
@ -83,11 +101,12 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
||||||
that appropriate build rules are created.
|
that appropriate build rules are created.
|
||||||
|
|
||||||
- Unix build system changes
|
- 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)
|
configure options are used to ${libdir}/php (ex: /usr/lib64/php)
|
||||||
. PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor
|
. 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
|
macros defined by ext/odbc are now defined in php_config.h instead of the
|
||||||
build-defs.h header.
|
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_AP_EXTRACT_VERSION has been removed.
|
||||||
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
|
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
|
||||||
manually).
|
manually).
|
||||||
|
@ -129,11 +148,24 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
||||||
. The php_std_date() function has been removed. Use php_format_date() with
|
. The php_std_date() function has been removed. Use php_format_date() with
|
||||||
the "D, d M Y H:i:s \\G\\M\\T" format instead.
|
the "D, d M Y H:i:s \\G\\M\\T" format instead.
|
||||||
. Added php_url_encode_to_smart_str() to encode a URL to a smart_str buffer.
|
. Added php_url_encode_to_smart_str() to encode a URL to a smart_str buffer.
|
||||||
|
. The functionality of getimagesize(), image_type_to_mime_type(),
|
||||||
|
and image_type_to_extension() is now extensible using the internal APIs
|
||||||
|
php_image_register_handler() and php_image_unregister_handler() in
|
||||||
|
php_image.h.
|
||||||
|
|
||||||
========================
|
========================
|
||||||
4. OpCode changes
|
4. OpCode changes
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
* New ZEND_DECLARE_ATTRIBUTED_CONST is used when a global constant is declared
|
||||||
|
with `const` and has attributes; this opcode is used *instead* of the
|
||||||
|
ZEND_DECLARE_CONST, and in addition to the name of the constant and the
|
||||||
|
value to use, has a ZEND_OP_DATA with a pointer to the compiled attributes.
|
||||||
|
|
||||||
========================
|
========================
|
||||||
5. SAPI changes
|
5. SAPI changes
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
- SAPIs must now call php_child_init() after a fork. If php-src code was
|
||||||
|
executed in other threads than the one initiating the fork,
|
||||||
|
refresh_memory_manager() must be called in every such thread.
|
||||||
|
|
|
@ -420,6 +420,14 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
|
||||||
}
|
}
|
||||||
break;
|
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:
|
||||||
case ZEND_CASE_STRICT:
|
case ZEND_CASE_STRICT:
|
||||||
case ZEND_COPY_TMP:
|
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_API void zend_optimizer_unregister_pass(int idx);
|
||||||
zend_result zend_optimizer_startup(void);
|
zend_result zend_optimizer_startup(void);
|
||||||
zend_result zend_optimizer_shutdown(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()
|
END_EXTERN_C()
|
||||||
|
|
||||||
#endif
|
#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);
|
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);
|
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
|
#endif
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "zend_ssa.h"
|
#include "zend_ssa.h"
|
||||||
#include "zend_dump.h"
|
#include "zend_dump.h"
|
||||||
#include "zend_inference.h"
|
#include "zend_inference.h"
|
||||||
|
#include "zend_worklist.h"
|
||||||
#include "Optimizer/zend_optimizer_internal.h"
|
#include "Optimizer/zend_optimizer_internal.h"
|
||||||
|
|
||||||
static bool dominates(const zend_basic_block *blocks, int a, int b) {
|
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_basic_block *blocks = ssa->cfg.blocks;
|
||||||
zend_ssa_block *ssa_blocks = ssa->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 ssa_vars_count = ssa->vars_count;
|
||||||
int i, j;
|
int i, j;
|
||||||
zend_op *opline, *end;
|
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) {
|
if (ssa_blocks[n].phis) {
|
||||||
zend_ssa_phi *phi = 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;
|
ssa->vars_count = ssa_vars_count;
|
||||||
|
}
|
||||||
|
/* }}} */
|
||||||
|
|
||||||
j = blocks[n].children;
|
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n)
|
||||||
while (j >= 0) {
|
{
|
||||||
// FIXME: Tail call optimization?
|
/* The worklist contains block numbers, encoded as positive or negative value.
|
||||||
if (zend_ssa_rename(op_array, build_flags, ssa, var, j) == FAILURE)
|
* Positive values indicate that the variable rename still needs to happen for the block.
|
||||||
return FAILURE;
|
* Negative values indicate the variable rename was done and all children were handled too.
|
||||||
j = blocks[j].next_child;
|
* 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(save_vars, save_vars_use_heap);
|
||||||
free_alloca(tmp, use_heap);
|
ZEND_WORKLIST_STACK_FREE_ALLOCA(&work, work_use_heap);
|
||||||
}
|
|
||||||
|
|
||||||
return SUCCESS;
|
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) /* {{{ */
|
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).
|
dnl Check if compiler supports -Wno-clobbered (only GCC).
|
||||||
AX_CHECK_COMPILE_FLAG([-Wno-clobbered],
|
AX_CHECK_COMPILE_FLAG([-Wno-clobbered],
|
||||||
[CFLAGS="-Wno-clobbered $CFLAGS"],,
|
[CFLAGS="-Wno-clobbered $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
dnl Check for support for implicit fallthrough level 1, also add after previous
|
dnl Check for support for implicit fallthrough level 1, also add after previous
|
||||||
dnl CFLAGS as level 3 is enabled in -Wextra.
|
dnl CFLAGS as level 3 is enabled in -Wextra.
|
||||||
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=1],
|
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=1],
|
||||||
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"],,
|
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"])
|
||||||
[-Werror])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],
|
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],
|
||||||
[CFLAGS="-Wduplicated-cond $CFLAGS"],,
|
[CFLAGS="-Wduplicated-cond $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-Wlogical-op],
|
AX_CHECK_COMPILE_FLAG([-Wlogical-op],
|
||||||
[CFLAGS="-Wlogical-op $CFLAGS"],,
|
[CFLAGS="-Wlogical-op $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-Wformat-truncation],
|
AX_CHECK_COMPILE_FLAG([-Wformat-truncation],
|
||||||
[CFLAGS="-Wformat-truncation $CFLAGS"],,
|
[CFLAGS="-Wformat-truncation $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],
|
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],
|
||||||
[CFLAGS="-Wstrict-prototypes $CFLAGS"],,
|
[CFLAGS="-Wstrict-prototypes $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-fno-common],
|
AX_CHECK_COMPILE_FLAG([-fno-common],
|
||||||
[CFLAGS="-fno-common $CFLAGS"],,
|
[CFLAGS="-fno-common $CFLAGS"])
|
||||||
[-Werror])
|
|
||||||
|
|
||||||
ZEND_CHECK_ALIGNMENT
|
ZEND_CHECK_ALIGNMENT
|
||||||
ZEND_CHECK_SIGNALS
|
ZEND_CHECK_SIGNALS
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<?php
|
|
||||||
/* dummy file for 014.phpt */
|
|
||||||
?>
|
|
|
@ -9,6 +9,7 @@ function skipFunction($function): bool {
|
||||||
/* terminates script */
|
/* terminates script */
|
||||||
|| $function === 'exit'
|
|| $function === 'exit'
|
||||||
|| $function === 'die'
|
|| $function === 'die'
|
||||||
|
|| $function === 'zend_trigger_bailout'
|
||||||
/* intentionally violate invariants */
|
/* intentionally violate invariants */
|
||||||
|| $function === 'zend_create_unterminated_string'
|
|| $function === 'zend_create_unterminated_string'
|
||||||
|| $function === 'zend_test_array_return'
|
|| $function === 'zend_test_array_return'
|
||||||
|
|
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
|
assert.exception=1
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
var_dump((integer)ini_get("zend.assertions"));
|
var_dump((int)ini_get("zend.assertions"));
|
||||||
ini_set("zend.assertions", 0);
|
ini_set("zend.assertions", 0);
|
||||||
var_dump((integer)ini_get("zend.assertions"));
|
var_dump((int)ini_get("zend.assertions"));
|
||||||
assert(false);
|
assert(false);
|
||||||
ini_set("zend.assertions", 1);
|
ini_set("zend.assertions", 1);
|
||||||
var_dump((integer)ini_get("zend.assertions"));
|
var_dump((int)ini_get("zend.assertions"));
|
||||||
assert(true);
|
assert(true);
|
||||||
var_dump(true);
|
var_dump(true);
|
||||||
?>
|
?>
|
||||||
|
|
24
Zend/tests/asymmetric_visibility/gh19044.phpt
Normal file
24
Zend/tests/asymmetric_visibility/gh19044.phpt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
GH-19044: Protected properties must be scoped according to their prototype (protected(set) on non-hooked property)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class P {
|
||||||
|
public mixed $foo { get => 42; }
|
||||||
|
}
|
||||||
|
|
||||||
|
class C1 extends P {
|
||||||
|
public protected(set) mixed $foo = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
class C2 extends P {
|
||||||
|
public protected(set) mixed $foo;
|
||||||
|
|
||||||
|
static function foo($c) { return $c->foo += 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
var_dump(C2::foo(new C1));
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(43)
|
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--
|
--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--
|
--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--
|
--EXPECTF--
|
||||||
Fatal error: Cannot apply #[AllowDynamicProperties] to trait Test in %s on line %d
|
Fatal error: Cannot apply #[\AllowDynamicProperties] to trait Test in %s on line %d
|
||||||
|
|
|
@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant MY_CONST already defined in %s on line %d
|
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
No attributes
|
No attributes
|
||||||
array(0) {
|
array(0) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ var_dump($reflection->getAttributes())
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant MY_CONST already defined in %s on line %d
|
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
Has attributes (1)
|
Has attributes (1)
|
||||||
array(1) {
|
array(1) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
|
@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant MY_CONST already defined in %s on line %d
|
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
Has attributes
|
Has attributes
|
||||||
array(1) {
|
array(1) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
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
|
|
@ -20,4 +20,4 @@ define("TEST",3);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
error :Constant TEST already defined
|
error :Constant TEST already defined, this will be an error in PHP 9
|
||||||
|
|
|
@ -11,7 +11,6 @@ function boom()
|
||||||
$thing = new Thing();
|
$thing = new Thing();
|
||||||
xml_set_object($reader, $thing);
|
xml_set_object($reader, $thing);
|
||||||
die("ok\n");
|
die("ok\n");
|
||||||
xml_parser_free($reader);
|
|
||||||
}
|
}
|
||||||
boom();
|
boom();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
|
||||||
<?php
|
<?php
|
||||||
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
|
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
|
||||||
$cmd = "$php -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
|
$cmd = "$php -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
|
||||||
echo `$cmd`;
|
echo shell_exec($cmd);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
Interactive shell (-a) requires the readline extension.
|
Interactive shell (-a) requires the readline extension.
|
||||||
|
|
|
@ -9,22 +9,19 @@ class wrapper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function stream_eof() {
|
function stream_eof() {
|
||||||
throw new exception();
|
throw new Exception('cannot eof');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_wrapper_register("wrap", "wrapper");
|
stream_wrapper_register("wrap", "wrapper");
|
||||||
$fp = fopen("wrap://...", "r");
|
$fp = fopen("wrap://...", "r");
|
||||||
feof($fp);
|
|
||||||
|
|
||||||
echo "Done\n";
|
try {
|
||||||
|
feof($fp);
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECT--
|
||||||
Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
|
Exception: cannot eof
|
||||||
|
|
||||||
Fatal error: Uncaught Exception in %s:%d
|
|
||||||
Stack trace:
|
|
||||||
#0 [internal function]: wrapper->stream_eof()
|
|
||||||
#1 %s(%d): feof(Resource id #%d)
|
|
||||||
#2 {main}
|
|
||||||
thrown in %s on line %d
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ if (PHP_OS == 'Linux') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (PHP_OS == 'FreeBSD') {
|
elseif (PHP_OS == 'FreeBSD') {
|
||||||
$lines = explode("\n",`sysctl -a`);
|
$lines = explode("\n", shell_exec("sysctl -a"));
|
||||||
$infos = array();
|
$infos = array();
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
if (!$line){
|
if (!$line){
|
||||||
|
|
|
@ -17,5 +17,12 @@ function show_outputa($prepend, $output) {
|
||||||
show_outputa('Files: ', `cd .`); // this works as expected
|
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
|
Okey
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
|
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
|
||||||
--INI--
|
|
||||||
report_memleaks=1
|
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class FooBar {
|
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
|
Bug #81104: Warning: "Failed to set memory limit to ... bytes" emitted after exit in debug
|
||||||
--INI--
|
--INI--
|
||||||
memory_limit=5M
|
memory_limit=5M
|
||||||
report_memleaks=0
|
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
#[AllowDynamicProperties]
|
#[AllowDynamicProperties]
|
||||||
|
|
71
Zend/tests/clone/clone_with_001.phpt
Normal file
71
Zend/tests/clone/clone_with_001.phpt
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with basic
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Dummy { }
|
||||||
|
|
||||||
|
$x = new stdClass();
|
||||||
|
|
||||||
|
$foo = 'FOO';
|
||||||
|
$bar = new Dummy();
|
||||||
|
$array = [
|
||||||
|
'baz' => 'BAZ',
|
||||||
|
'array' => [1, 2, 3],
|
||||||
|
];
|
||||||
|
|
||||||
|
var_dump(clone $x);
|
||||||
|
var_dump(clone($x));
|
||||||
|
var_dump(clone($x, [ 'foo' => $foo, 'bar' => $bar ]));
|
||||||
|
var_dump(clone($x, $array));
|
||||||
|
var_dump(clone($x, [ 'obj' => $x ]));
|
||||||
|
|
||||||
|
var_dump(clone($x, [
|
||||||
|
'abc',
|
||||||
|
'def',
|
||||||
|
new Dummy(),
|
||||||
|
'named' => 'value',
|
||||||
|
]));
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(stdClass)#%d (0) {
|
||||||
|
}
|
||||||
|
object(stdClass)#%d (0) {
|
||||||
|
}
|
||||||
|
object(stdClass)#%d (2) {
|
||||||
|
["foo"]=>
|
||||||
|
string(3) "FOO"
|
||||||
|
["bar"]=>
|
||||||
|
object(Dummy)#%d (0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
object(stdClass)#%d (2) {
|
||||||
|
["baz"]=>
|
||||||
|
string(3) "BAZ"
|
||||||
|
["array"]=>
|
||||||
|
array(3) {
|
||||||
|
[0]=>
|
||||||
|
int(1)
|
||||||
|
[1]=>
|
||||||
|
int(2)
|
||||||
|
[2]=>
|
||||||
|
int(3)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
object(stdClass)#%d (1) {
|
||||||
|
["obj"]=>
|
||||||
|
object(stdClass)#%d (0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
object(stdClass)#%d (4) {
|
||||||
|
["0"]=>
|
||||||
|
string(3) "abc"
|
||||||
|
["1"]=>
|
||||||
|
string(3) "def"
|
||||||
|
["2"]=>
|
||||||
|
object(Dummy)#%d (0) {
|
||||||
|
}
|
||||||
|
["named"]=>
|
||||||
|
string(5) "value"
|
||||||
|
}
|
114
Zend/tests/clone/clone_with_002.phpt
Normal file
114
Zend/tests/clone/clone_with_002.phpt
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with respects visiblity
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class P {
|
||||||
|
public $a = 'default';
|
||||||
|
protected $b = 'default';
|
||||||
|
private $c = 'default';
|
||||||
|
public private(set) string $d = 'default';
|
||||||
|
|
||||||
|
public function m1() {
|
||||||
|
return clone($this, [ 'a' => 'updated A', 'b' => 'updated B', 'c' => 'updated C', 'd' => 'updated D' ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class C extends P {
|
||||||
|
public function m2() {
|
||||||
|
return clone($this, [ 'a' => 'updated A', 'b' => 'updated B', 'c' => 'dynamic C' ]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function m3() {
|
||||||
|
return clone($this, [ 'd' => 'inaccessible' ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Unrelated {
|
||||||
|
public function m3(P $p) {
|
||||||
|
return clone($p, [ 'b' => 'inaccessible' ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$p = new P();
|
||||||
|
|
||||||
|
var_dump(clone($p, [ 'a' => 'updated A' ]));
|
||||||
|
var_dump($p->m1());
|
||||||
|
|
||||||
|
$c = new C();
|
||||||
|
var_dump($c->m1());
|
||||||
|
var_dump($c->m2());
|
||||||
|
try {
|
||||||
|
var_dump($c->m3());
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($p, [ 'b' => 'inaccessible' ]));
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($p, [ 'd' => 'inaccessible' ]));
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump((new Unrelated())->m3($p));
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(P)#%d (4) {
|
||||||
|
["a"]=>
|
||||||
|
string(9) "updated A"
|
||||||
|
["b":protected]=>
|
||||||
|
string(7) "default"
|
||||||
|
["c":"P":private]=>
|
||||||
|
string(7) "default"
|
||||||
|
["d"]=>
|
||||||
|
string(7) "default"
|
||||||
|
}
|
||||||
|
object(P)#%d (4) {
|
||||||
|
["a"]=>
|
||||||
|
string(9) "updated A"
|
||||||
|
["b":protected]=>
|
||||||
|
string(9) "updated B"
|
||||||
|
["c":"P":private]=>
|
||||||
|
string(9) "updated C"
|
||||||
|
["d"]=>
|
||||||
|
string(9) "updated D"
|
||||||
|
}
|
||||||
|
object(C)#%d (4) {
|
||||||
|
["a"]=>
|
||||||
|
string(9) "updated A"
|
||||||
|
["b":protected]=>
|
||||||
|
string(9) "updated B"
|
||||||
|
["c":"P":private]=>
|
||||||
|
string(9) "updated C"
|
||||||
|
["d"]=>
|
||||||
|
string(9) "updated D"
|
||||||
|
}
|
||||||
|
|
||||||
|
Deprecated: Creation of dynamic property C::$c is deprecated in %s on line %d
|
||||||
|
object(C)#%d (5) {
|
||||||
|
["a"]=>
|
||||||
|
string(9) "updated A"
|
||||||
|
["b":protected]=>
|
||||||
|
string(9) "updated B"
|
||||||
|
["c":"P":private]=>
|
||||||
|
string(7) "default"
|
||||||
|
["d"]=>
|
||||||
|
string(7) "default"
|
||||||
|
["c"]=>
|
||||||
|
string(9) "dynamic C"
|
||||||
|
}
|
||||||
|
Error: Cannot modify private(set) property P::$d from scope C
|
||||||
|
Error: Cannot access protected property P::$b
|
||||||
|
Error: Cannot modify private(set) property P::$d from global scope
|
||||||
|
Error: Cannot access protected property P::$b
|
23
Zend/tests/clone/clone_with_003.phpt
Normal file
23
Zend/tests/clone/clone_with_003.phpt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with supports property hooks
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Clazz {
|
||||||
|
public string $hooked = 'default' {
|
||||||
|
set {
|
||||||
|
$this->hooked = strtoupper($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = new Clazz();
|
||||||
|
|
||||||
|
var_dump(clone($c, [ 'hooked' => 'updated' ]));
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(Clazz)#%d (1) {
|
||||||
|
["hooked"]=>
|
||||||
|
string(7) "UPDATED"
|
||||||
|
}
|
82
Zend/tests/clone/clone_with_004.phpt
Normal file
82
Zend/tests/clone/clone_with_004.phpt
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with evaluation order
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Clazz {
|
||||||
|
public string $hooked = 'default' {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
$this->hooked = strtoupper($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string $maxLength {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
if (strlen($value) > 5) {
|
||||||
|
throw new \Exception('Length exceeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->maxLength = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string $minLength {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
if (strlen($value) < 5) {
|
||||||
|
throw new \Exception('Length unsufficient');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->minLength = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = new Clazz();
|
||||||
|
|
||||||
|
var_dump(clone($c, [ 'hooked' => 'updated' ]));
|
||||||
|
echo PHP_EOL;
|
||||||
|
var_dump(clone($c, [ 'hooked' => 'updated', 'maxLength' => 'abc', 'minLength' => 'abcdef' ]));
|
||||||
|
echo PHP_EOL;
|
||||||
|
var_dump(clone($c, [ 'minLength' => 'abcdef', 'hooked' => 'updated', 'maxLength' => 'abc' ]));
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
$hooked::set
|
||||||
|
object(Clazz)#%d (1) {
|
||||||
|
["hooked"]=>
|
||||||
|
string(7) "UPDATED"
|
||||||
|
["maxLength"]=>
|
||||||
|
uninitialized(string)
|
||||||
|
["minLength"]=>
|
||||||
|
uninitialized(string)
|
||||||
|
}
|
||||||
|
|
||||||
|
$hooked::set
|
||||||
|
$maxLength::set
|
||||||
|
$minLength::set
|
||||||
|
object(Clazz)#%d (3) {
|
||||||
|
["hooked"]=>
|
||||||
|
string(7) "UPDATED"
|
||||||
|
["maxLength"]=>
|
||||||
|
string(3) "abc"
|
||||||
|
["minLength"]=>
|
||||||
|
string(6) "abcdef"
|
||||||
|
}
|
||||||
|
|
||||||
|
$minLength::set
|
||||||
|
$hooked::set
|
||||||
|
$maxLength::set
|
||||||
|
object(Clazz)#%d (3) {
|
||||||
|
["hooked"]=>
|
||||||
|
string(7) "UPDATED"
|
||||||
|
["maxLength"]=>
|
||||||
|
string(3) "abc"
|
||||||
|
["minLength"]=>
|
||||||
|
string(6) "abcdef"
|
||||||
|
}
|
64
Zend/tests/clone/clone_with_005.phpt
Normal file
64
Zend/tests/clone/clone_with_005.phpt
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with error handling
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Clazz {
|
||||||
|
public string $hooked = 'default' {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
$this->hooked = strtoupper($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string $maxLength {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
if (strlen($value) > 5) {
|
||||||
|
throw new \Exception('Length exceeded');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->maxLength = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string $minLength {
|
||||||
|
set {
|
||||||
|
echo __FUNCTION__, PHP_EOL;
|
||||||
|
|
||||||
|
if (strlen($value) < 5) {
|
||||||
|
throw new \Exception('Length insufficient');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->minLength = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = new Clazz();
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($c, [ 'hooked' => 'updated', 'maxLength' => 'abcdef', 'minLength' => 'abc' ]));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo PHP_EOL;
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($c, [ 'hooked' => 'updated', 'minLength' => 'abc', 'maxLength' => 'abcdef' ]));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
$hooked::set
|
||||||
|
$maxLength::set
|
||||||
|
Exception: Length exceeded
|
||||||
|
|
||||||
|
$hooked::set
|
||||||
|
$minLength::set
|
||||||
|
Exception: Length insufficient
|
16
Zend/tests/clone/clone_with_006.phpt
Normal file
16
Zend/tests/clone/clone_with_006.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with error cases
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$x = new stdClass();
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($x, 1));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
TypeError: clone(): Argument #2 ($withProperties) must be of type array, int given
|
29
Zend/tests/clone/clone_with_007.phpt
Normal file
29
Zend/tests/clone/clone_with_007.phpt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with supports __clone
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Clazz {
|
||||||
|
public function __construct(
|
||||||
|
public string $foo,
|
||||||
|
public string $bar,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
public function __clone() {
|
||||||
|
$this->foo = 'foo updated in __clone';
|
||||||
|
$this->bar = 'bar updated in __clone';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = new Clazz('foo', 'bar');
|
||||||
|
|
||||||
|
var_dump(clone($c, [ 'foo' => 'foo updated in clone-with' ]));
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(Clazz)#%d (2) {
|
||||||
|
["foo"]=>
|
||||||
|
string(25) "foo updated in clone-with"
|
||||||
|
["bar"]=>
|
||||||
|
string(22) "bar updated in __clone"
|
||||||
|
}
|
40
Zend/tests/clone/clone_with_008.phpt
Normal file
40
Zend/tests/clone/clone_with_008.phpt
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with readonly
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
readonly class Clazz {
|
||||||
|
public function __construct(
|
||||||
|
public public(set) string $a,
|
||||||
|
public public(set) string $b,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
public function __clone() {
|
||||||
|
$this->b = '__clone';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = new Clazz('default', 'default');
|
||||||
|
|
||||||
|
var_dump(clone($c, [ 'a' => "with" ]));
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($c, [ 'b' => "with" ]));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(Clazz)#%d (2) {
|
||||||
|
["a"]=>
|
||||||
|
string(4) "with"
|
||||||
|
["b"]=>
|
||||||
|
string(7) "__clone"
|
||||||
|
}
|
||||||
|
object(Clazz)#%d (2) {
|
||||||
|
["a"]=>
|
||||||
|
string(7) "default"
|
||||||
|
["b"]=>
|
||||||
|
string(4) "with"
|
||||||
|
}
|
72
Zend/tests/clone/clone_with_009.phpt
Normal file
72
Zend/tests/clone/clone_with_009.phpt
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with lazy objects
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class C {
|
||||||
|
public $a = 1;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function test(string $name, object $obj) {
|
||||||
|
printf("# %s:\n", $name);
|
||||||
|
|
||||||
|
$reflector = new ReflectionClass($obj::class);
|
||||||
|
$clone = clone($obj, [ 'a' => 2 ]);
|
||||||
|
|
||||||
|
var_dump($reflector->isUninitializedLazyObject($obj));
|
||||||
|
var_dump($obj);
|
||||||
|
var_dump($reflector->isUninitializedLazyObject($clone));
|
||||||
|
var_dump($clone);
|
||||||
|
}
|
||||||
|
|
||||||
|
$reflector = new ReflectionClass(C::class);
|
||||||
|
|
||||||
|
$obj = $reflector->newLazyGhost(function ($obj) {
|
||||||
|
var_dump("initializer");
|
||||||
|
$obj->__construct();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Ghost', $obj);
|
||||||
|
|
||||||
|
$obj = $reflector->newLazyProxy(function ($obj) {
|
||||||
|
var_dump("initializer");
|
||||||
|
return new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Proxy', $obj);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
# Ghost:
|
||||||
|
string(11) "initializer"
|
||||||
|
bool(false)
|
||||||
|
object(C)#%d (1) {
|
||||||
|
["a"]=>
|
||||||
|
int(1)
|
||||||
|
}
|
||||||
|
bool(false)
|
||||||
|
object(C)#%d (1) {
|
||||||
|
["a"]=>
|
||||||
|
int(2)
|
||||||
|
}
|
||||||
|
# Proxy:
|
||||||
|
string(11) "initializer"
|
||||||
|
bool(false)
|
||||||
|
lazy proxy object(C)#%d (1) {
|
||||||
|
["instance"]=>
|
||||||
|
object(C)#%d (1) {
|
||||||
|
["a"]=>
|
||||||
|
int(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool(false)
|
||||||
|
lazy proxy object(C)#%d (1) {
|
||||||
|
["instance"]=>
|
||||||
|
object(C)#%d (1) {
|
||||||
|
["a"]=>
|
||||||
|
int(2)
|
||||||
|
}
|
||||||
|
}
|
21
Zend/tests/clone/clone_with_010.phpt
Normal file
21
Zend/tests/clone/clone_with_010.phpt
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with native classes
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone(new \Random\Engine\Secure(), [ 'with' => "something" ]));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone(new \Random\Engine\Xoshiro256StarStar(), [ 'with' => "something" ]));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Error: Trying to clone an uncloneable object of class Random\Engine\Secure
|
||||||
|
Error: Cannot create dynamic property Random\Engine\Xoshiro256StarStar::$with
|
18
Zend/tests/clone/clone_with_011.phpt
Normal file
18
Zend/tests/clone/clone_with_011.phpt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with name mangling
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
private string $bar = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone(new Foo(), ["\0Foo\0bar" => 'updated']));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Error: Cannot access property starting with "\0"
|
35
Zend/tests/clone/clone_with_012.phpt
Normal file
35
Zend/tests/clone/clone_with_012.phpt
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with property hook updating readonly property
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Clazz {
|
||||||
|
public string $foo {
|
||||||
|
set {
|
||||||
|
$this->foo = $value;
|
||||||
|
$this->bar = 'bar updated in hook';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public public(set) readonly string $bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
$f = new Clazz();
|
||||||
|
|
||||||
|
var_dump(clone($f, ['foo' => 'foo updated in clone-with']));
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($f, ['foo' => 'foo updated in clone-with', 'bar' => 'bar updated in clone-with']));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
object(Clazz)#%d (2) {
|
||||||
|
["foo"]=>
|
||||||
|
string(25) "foo updated in clone-with"
|
||||||
|
["bar"]=>
|
||||||
|
string(19) "bar updated in hook"
|
||||||
|
}
|
||||||
|
Error: Cannot modify readonly property Clazz::$bar
|
31
Zend/tests/clone/clone_with_013.phpt
Normal file
31
Zend/tests/clone/clone_with_013.phpt
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
--TEST--
|
||||||
|
Clone with references
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$x = new stdClass();
|
||||||
|
|
||||||
|
$ref = 'reference';
|
||||||
|
$with = ['x' => &$ref];
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($x, $with));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($ref);
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(clone($x, $with));
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Error: Cannot assign by reference when cloning with updated properties
|
||||||
|
object(stdClass)#%d (1) {
|
||||||
|
["x"]=>
|
||||||
|
string(9) "reference"
|
||||||
|
}
|
64
Zend/tests/closures/closure_get_current.phpt
Normal file
64
Zend/tests/closures/closure_get_current.phpt
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
--TEST--
|
||||||
|
Closure::getCurrent()
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
|
$c = function ($p) use (&$i) {
|
||||||
|
$self = Closure::getCurrent();
|
||||||
|
var_dump($p, $i);
|
||||||
|
$i++;
|
||||||
|
if ($p < 10) {
|
||||||
|
$self($p + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$c(1);
|
||||||
|
var_dump($i);
|
||||||
|
|
||||||
|
function fail() {
|
||||||
|
Closure::getCurrent();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fail();
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
function foo() {
|
||||||
|
var_dump(Closure::getCurrent());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
foo(...)();
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(1)
|
||||||
|
int(1)
|
||||||
|
int(2)
|
||||||
|
int(2)
|
||||||
|
int(3)
|
||||||
|
int(3)
|
||||||
|
int(4)
|
||||||
|
int(4)
|
||||||
|
int(5)
|
||||||
|
int(5)
|
||||||
|
int(6)
|
||||||
|
int(6)
|
||||||
|
int(7)
|
||||||
|
int(7)
|
||||||
|
int(8)
|
||||||
|
int(8)
|
||||||
|
int(9)
|
||||||
|
int(9)
|
||||||
|
int(10)
|
||||||
|
int(10)
|
||||||
|
int(11)
|
||||||
|
Current function is not a closure
|
||||||
|
Current function is not a closure
|
|
@ -27,13 +27,13 @@ echo "Done\n";
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given
|
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given
|
||||||
|
|
||||||
Warning: Constant TRUE already defined in %s on line %d
|
Warning: Constant TRUE already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
||||||
Warning: Constant test const already defined in %s on line %d
|
Warning: Constant test const already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
|
@ -17,7 +17,7 @@ var_dump(constant('1foo'));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant 1 already defined in %s on line %d
|
Warning: Constant 1 already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
int(2)
|
int(2)
|
||||||
int(2)
|
int(2)
|
||||||
int(2)
|
int(2)
|
||||||
|
|
|
@ -10,4 +10,4 @@ const foo = 2;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant foo\foo already defined in %s on line %d
|
Warning: Constant foo\foo already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
|
|
|
@ -13,5 +13,5 @@ if (defined('a')) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant a already defined in %s on line %d
|
Warning: Constant a already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
2
|
2
|
||||||
|
|
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)
|
|
@ -14,6 +14,6 @@ var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0)));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
|
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
int(1)
|
int(1)
|
||||||
int(4)
|
int(4)
|
||||||
|
|
|
@ -5,4 +5,4 @@ __HALT_COMPILER(); bad define() of __COMPILER_HALT_OFFSET__ 1
|
||||||
define ('__COMPILER_HALT_OFFSET__', 1);
|
define ('__COMPILER_HALT_OFFSET__', 1);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
|
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 in %s on line %d
|
||||||
|
|
|
@ -7,4 +7,4 @@ __HALT_COMPILER();
|
||||||
?>
|
?>
|
||||||
==DONE==
|
==DONE==
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
|
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 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