mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-24 17:35:41 +00:00
Compare commits
484
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f4400d7e5 | ||
|
|
2629ad65a4 | ||
|
|
c0ce2281bc | ||
|
|
908f67b1d4 | ||
|
|
0495bf5650 | ||
|
|
920c088082 | ||
|
|
7c981192eb | ||
|
|
250430acdc | ||
|
|
6ac12f1337 | ||
|
|
e48988311d | ||
|
|
03a43d50e1 | ||
|
|
713ad54fec | ||
|
|
2ea924fffc | ||
|
|
aa8cac578e | ||
|
|
559ede17e1 | ||
|
|
1d5744027e | ||
|
|
311eb2b11e | ||
|
|
7ac24aa661 | ||
|
|
3ae3341533 | ||
|
|
5b9267c4c0 | ||
|
|
a154410597 | ||
|
|
9ddfd49063 | ||
|
|
8da5752311 | ||
|
|
337fd3ad64 | ||
|
|
1745ead668 | ||
|
|
4173a667fa | ||
|
|
3d6dd2a27b | ||
|
|
59424bb7bd | ||
|
|
2fabcbfedb | ||
|
|
e322fb0015 | ||
|
|
2f62ad16a4 | ||
|
|
91bad929aa | ||
|
|
ed4b887cf6 | ||
|
|
00e3b7614e | ||
|
|
1b27754888 | ||
|
|
25c5d185fc | ||
|
|
5df6f9f20e | ||
|
|
e6e77d9e27 | ||
|
|
4424cbf757 | ||
|
|
1f65006fce | ||
|
|
9397f52724 | ||
|
|
5af61aa1cc | ||
|
|
58fbe7a838 | ||
|
|
e9a8d7ff1d | ||
|
|
8907da99b8 | ||
|
|
a347b0be48 | ||
|
|
b0f472b3b2 | ||
|
|
6cb6c04499 | ||
|
|
99dd7ee80b | ||
|
|
0e91e5fb90 | ||
|
|
2de8915dea | ||
|
|
071247713f | ||
|
|
f96175750a | ||
|
|
4a7e83f54a | ||
|
|
0394c04144 | ||
|
|
9376e8213c | ||
|
|
1b6873b4e6 | ||
|
|
d6f39a1011 | ||
|
|
3cdbe347ae | ||
|
|
05738eb71a | ||
|
|
73a92964ff | ||
|
|
2bae178b35 | ||
|
|
0134de7cff | ||
|
|
00865ae22f | ||
|
|
541631253a | ||
|
|
7be30eb78c | ||
|
|
d10ee1eef1 | ||
|
|
80d9dcafe0 | ||
|
|
569763cb1a | ||
|
|
d978e92d3d | ||
|
|
e637ead6ed | ||
|
|
e6b46dc2ff | ||
|
|
fd545f4f44 | ||
|
|
3e0b2ba5d8 | ||
|
|
31b4581c45 | ||
|
|
91fb1edbbf | ||
|
|
e6759644ec | ||
|
|
5a8bcf73ba | ||
|
|
a8bd182ccd | ||
|
|
818bffc534 | ||
|
|
9642710a09 | ||
|
|
1c72e5b299 | ||
|
|
c1189eccae | ||
|
|
532912d8ab | ||
|
|
d6b78a3511 | ||
|
|
7e9f416218 | ||
|
|
f8bf1f33a5 | ||
|
|
801e46d8c0 | ||
|
|
6313e16a04 | ||
|
|
8c51578c81 | ||
|
|
b9845e5006 | ||
|
|
45c5e27183 | ||
|
|
51ccc88b87 | ||
|
|
397be4ff54 | ||
|
|
a2b85ddecf | ||
|
|
1b16c2f41c | ||
|
|
ab17840d33 | ||
|
|
eada2aa91a | ||
|
|
31d93fcf4b | ||
|
|
c6961cb41b | ||
|
|
205e0ba81d | ||
|
|
cbc71995a8 | ||
|
|
7b195c9875 | ||
|
|
4674f18a4b | ||
|
|
519f9bc675 | ||
|
|
2a9fc35e51 | ||
|
|
a2e4e64682 | ||
|
|
a1c887964e | ||
|
|
64a90a6b98 | ||
|
|
b42eb16cf4 | ||
|
|
7e68d6e735 | ||
|
|
c8d6673b59 | ||
|
|
f66e25a82b | ||
|
|
8b32fe80ae | ||
|
|
77e9f2d6b1 | ||
|
|
1bd22e8e65 | ||
|
|
6680c2b22e | ||
|
|
4dee0c4a14 | ||
|
|
4f0a05ab3e | ||
|
|
66c1f966f0 | ||
|
|
fba3985f23 | ||
|
|
96406f0842 | ||
|
|
822400ef3b | ||
|
|
9134f9e98f | ||
|
|
25439e939e | ||
|
|
be6fd4ba89 | ||
|
|
15876e85e5 | ||
|
|
0dce4bef79 | ||
|
|
3c32019989 | ||
|
|
e5abc53701 | ||
|
|
7819fef345 | ||
|
|
c856b6e0ff | ||
|
|
04c3fbac37 | ||
|
|
1934d6d9ab | ||
|
|
e3d19e81a2 | ||
|
|
617698dfe0 | ||
|
|
c2773ea02f | ||
|
|
fce44a5a13 | ||
|
|
25de928df7 | ||
|
|
a03786f773 | ||
|
|
310fc87c2d | ||
|
|
04526093e4 | ||
|
|
f8bf9bd86b | ||
|
|
cc10da474d | ||
|
|
9c4fd36783 | ||
|
|
c2de445f79 | ||
|
|
2b494ecc9c | ||
|
|
53c03115cf | ||
|
|
2bed2152e6 | ||
|
|
c245fd7d91 | ||
|
|
75f85288f4 | ||
|
|
fc611a134b | ||
|
|
e4e54f33ce | ||
|
|
391087ed28 | ||
|
|
a1e8b74827 | ||
|
|
93240102e0 | ||
|
|
8eef11d317 | ||
|
|
a2e59e72bc | ||
|
|
2777d0a1d9 | ||
|
|
f72c7edfa4 | ||
|
|
88fb6d90c4 | ||
|
|
3517f85e47 | ||
|
|
b89f451694 | ||
|
|
3cdc438e53 | ||
|
|
1f39665083 | ||
|
|
b22636c838 | ||
|
|
82f503f587 | ||
|
|
c3260b66c9 | ||
|
|
d6c527830e | ||
|
|
ccf8b54b89 | ||
|
|
3cb3979de3 | ||
|
|
6fa9b76342 | ||
|
|
4803914ae6 | ||
|
|
d66d1b97aa | ||
|
|
795af791b0 | ||
|
|
37b64de20f | ||
|
|
a3f1154b3d | ||
|
|
2e38918ba4 | ||
|
|
c9eacb181c | ||
|
|
e029a86aad | ||
|
|
570cdc05d7 | ||
|
|
1a12403002 | ||
|
|
dae37661d9 | ||
|
|
d70aa14f2c | ||
|
|
0a1e199682 | ||
|
|
12f1cfa86a | ||
|
|
6ff014b31c | ||
|
|
fe12492480 | ||
|
|
83de5364b7 | ||
|
|
269674f79d | ||
|
|
bb55ac6279 | ||
|
|
55abf6dfb2 | ||
|
|
bc3512c1d6 | ||
|
|
9da456655c | ||
|
|
de8bfb32bd | ||
|
|
e9fd8ad446 | ||
|
|
148bb622fa | ||
|
|
2d8d97cee2 | ||
|
|
c524f43e4f | ||
|
|
e4c1e90536 | ||
|
|
0bf3ebb4ba | ||
|
|
99d818f1e9 | ||
|
|
00b37e718d | ||
|
|
632bee4abb | ||
|
|
c263dcee2f | ||
|
|
fd61666d96 | ||
|
|
f2853386b1 | ||
|
|
0cbf3afe17 | ||
|
|
d59eb9fcc3 | ||
|
|
8155ecba61 | ||
|
|
6897c1116a | ||
|
|
855bb36fd0 | ||
|
|
049325ca96 | ||
|
|
089ca134fb | ||
|
|
a57b205383 | ||
|
|
f88a9a9643 | ||
|
|
3060dfd92e | ||
|
|
27aef97f65 | ||
|
|
283b6275df | ||
|
|
aa0d441ede | ||
|
|
01c844a01d | ||
|
|
2283551cfa | ||
|
|
c1f893d894 | ||
|
|
cff9e16a12 | ||
|
|
1406f80135 | ||
|
|
7b32b8f4e1 | ||
|
|
1184f0aca5 | ||
|
|
1fcadf67e6 | ||
|
|
f189353178 | ||
|
|
5ac288bcc6 | ||
|
|
9385eb6ff8 | ||
|
|
a80545992b | ||
|
|
5c96a91d77 | ||
|
|
9968129831 | ||
|
|
dea14fc707 | ||
|
|
435565a54f | ||
|
|
1c0622a472 | ||
|
|
51218b3b9d | ||
|
|
e4ac4e75b5 | ||
|
|
fe0af271c6 | ||
|
|
2f2653aa77 | ||
|
|
d7ff107654 | ||
|
|
8dd5e1c2b5 | ||
|
|
8d443d4626 | ||
|
|
227c898cd9 | ||
|
|
63c601b631 | ||
|
|
a23a88b3e7 | ||
|
|
37ed0dafe4 | ||
|
|
e62db72111 | ||
|
|
06c6b51e7d | ||
|
|
6d51b7b2e3 | ||
|
|
008d8b6789 | ||
|
|
31553f07f2 | ||
|
|
3ef96c2cc6 | ||
|
|
faf835be2b | ||
|
|
c4297a5a29 | ||
|
|
68b431e37d | ||
|
|
3c5a3e77d4 | ||
|
|
41de89f61b | ||
|
|
c67fc6bb09 | ||
|
|
241e340f78 | ||
|
|
661798ad34 | ||
|
|
179fba3f38 | ||
|
|
eb59dd7d81 | ||
|
|
2b23ba97f3 | ||
|
|
5dd59cc90d | ||
|
|
ac4601eadd | ||
|
|
eb32da13cd | ||
|
|
0e50a4c008 | ||
|
|
c133515811 | ||
|
|
a53510239f | ||
|
|
fff11a1e07 | ||
|
|
2f7a8515ca | ||
|
|
83bfefeccb | ||
|
|
0172f198e3 | ||
|
|
5767f2b648 | ||
|
|
2ee99f8954 | ||
|
|
ac58d21aa3 | ||
|
|
36311ee4fd | ||
|
|
a0665f3a18 | ||
|
|
0e069fa57d | ||
|
|
87498c5c39 | ||
|
|
b9cc3176eb | ||
|
|
aae108c1ce | ||
|
|
22af88274b | ||
|
|
448d1ce428 | ||
|
|
5ba763413b | ||
|
|
95446b4416 | ||
|
|
bbaf6daa9d | ||
|
|
3dc0bf7428 | ||
|
|
afd31489d0 | ||
|
|
8f9b2b68ee | ||
|
|
8292260515 | ||
|
|
efd2b3f5f2 | ||
|
|
2ef327caed | ||
|
|
1149833a58 | ||
|
|
ccc95bf9df | ||
|
|
6ad2c3eb33 | ||
|
|
673ad62eed | ||
|
|
a5a5c3e09a | ||
|
|
c7cb40353c | ||
|
|
d5f76caf6c | ||
|
|
131a348d37 | ||
|
|
fa0ffa4777 | ||
|
|
03e1e88db1 | ||
|
|
395ef4efb7 | ||
|
|
f3838a9c35 | ||
|
|
26e5429f72 | ||
|
|
0b35e0c5a1 | ||
|
|
73384728ca | ||
|
|
307c1f6bf0 | ||
|
|
c7c6df6cec | ||
|
|
c76fd640e6 | ||
|
|
5f759b04b8 | ||
|
|
b94f67885c | ||
|
|
6a4803026d | ||
|
|
718445b096 | ||
|
|
39a2514643 | ||
|
|
f231ddddaf | ||
|
|
daddb7a832 | ||
|
|
dc241566aa | ||
|
|
9501293de7 | ||
|
|
af8937c056 | ||
|
|
7f33ab834d | ||
|
|
2b5af600e3 | ||
|
|
5c19355095 | ||
|
|
4c8f064d7d | ||
|
|
acb2368976 | ||
|
|
c100a742dc | ||
|
|
49d6336fae | ||
|
|
51953423ee | ||
|
|
e2d6090043 | ||
|
|
d4df6641c8 | ||
|
|
20a384dfa9 | ||
|
|
e3e92e96c1 | ||
|
|
06f38d36a8 | ||
|
|
88a69ffa58 | ||
|
|
a2005cec5c | ||
|
|
a2cfcdfbe9 | ||
|
|
b610d740fd | ||
|
|
22cbf68344 | ||
|
|
60b4355168 | ||
|
|
5649b0ccba | ||
|
|
534856c98a | ||
|
|
010509355d | ||
|
|
d398cc9d10 | ||
|
|
6efbfc4caf | ||
|
|
d949c3b6e5 | ||
|
|
d1b67af3ab | ||
|
|
a8ae88162f | ||
|
|
e85a0aba9b | ||
|
|
4d8e284cce | ||
|
|
afdbd8f95b | ||
|
|
7597a06562 | ||
|
|
23b372d358 | ||
|
|
dcbbf7c38d | ||
|
|
5492fe9f25 | ||
|
|
aea420c7cf | ||
|
|
3fb6f0014a | ||
|
|
474a2e01eb | ||
|
|
d160e98feb | ||
|
|
8732ead953 | ||
|
|
4224907864 | ||
|
|
fe67696867 | ||
|
|
c85ad5d0be | ||
|
|
d7d01fc9a3 | ||
|
|
4b821f0fc6 | ||
|
|
ffb5d0aca3 | ||
|
|
d677b25b1c | ||
|
|
e19423f3cb | ||
|
|
f6ae19f158 | ||
|
|
bbae7ddf29 | ||
|
|
be09d1c262 | ||
|
|
d468390353 | ||
|
|
505c9c3742 | ||
|
|
0847681b1a | ||
|
|
c6af0aa33f | ||
|
|
93748bf9dd | ||
|
|
05bd331c6a | ||
|
|
91fb3a7b27 | ||
|
|
fa23bebe94 | ||
|
|
3815e97136 | ||
|
|
9af07e7119 | ||
|
|
cc3c425af8 | ||
|
|
ddb6d7801e | ||
|
|
f9e3461c02 | ||
|
|
5d2813edce | ||
|
|
19e461b07d | ||
|
|
4a57f1821b | ||
|
|
ccb677ece8 | ||
|
|
c0ca731d7a | ||
|
|
b8b335c492 | ||
|
|
91588a98be | ||
|
|
abf3c2f796 | ||
|
|
424a26d5d4 | ||
|
|
2c92f33b1d | ||
|
|
cd2b0a7bb8 | ||
|
|
e0b3b3c752 | ||
|
|
0a3c1fb4c2 | ||
|
|
e193d35c1e | ||
|
|
24e88348f3 | ||
|
|
524d00e005 | ||
|
|
3c0348056a | ||
|
|
5a49ac77aa | ||
|
|
1198c5d8bb | ||
|
|
a2082b7c97 | ||
|
|
fb2c890c2c | ||
|
|
60bb51c0d3 | ||
|
|
63617a678f | ||
|
|
d5bd999a8f | ||
|
|
3331d870aa | ||
|
|
0fbd3e5fe7 | ||
|
|
8c33bdb976 | ||
|
|
35d0405c47 | ||
|
|
a6be0f3fd6 | ||
|
|
881c502520 | ||
|
|
a549a3ac17 | ||
|
|
c97198e181 | ||
|
|
052dd3005b | ||
|
|
ba4a85b012 | ||
|
|
2a54b02257 | ||
|
|
2fb8bb1157 | ||
|
|
6876112c89 | ||
|
|
4744eec753 | ||
|
|
925412ee1c | ||
|
|
c147d90dbf | ||
|
|
517b553625 | ||
|
|
62c74ac634 | ||
|
|
4cb6342426 | ||
|
|
96fe3be7f2 | ||
|
|
83bef0ef83 | ||
|
|
e892e2e253 | ||
|
|
fe1933aae2 | ||
|
|
b2988714aa | ||
|
|
6f895a29c9 | ||
|
|
a2f5619303 | ||
|
|
60b5487897 | ||
|
|
c08824fd72 | ||
|
|
d6c9dc719e | ||
|
|
83fea9461e | ||
|
|
c98ea8465b | ||
|
|
8285731362 | ||
|
|
4f90e2ec9d | ||
|
|
0c03ba0ad0 | ||
|
|
32337d35cc | ||
|
|
6c61286da4 | ||
|
|
1287c48082 | ||
|
|
1a39b6e3c0 | ||
|
|
5c1b627458 | ||
|
|
06dde16a6a | ||
|
|
8557e8323a | ||
|
|
c25e81ab7b | ||
|
|
8039063d95 | ||
|
|
99d5634079 | ||
|
|
64a79817ce | ||
|
|
a60105d7a4 | ||
|
|
0fd71d1184 | ||
|
|
d7fb43e30d | ||
|
|
3f08fc0466 | ||
|
|
ba6d193b4c | ||
|
|
3e74df74f9 | ||
|
|
59541795e2 | ||
|
|
e80306cbe8 | ||
|
|
353d996c9f | ||
|
|
07a8e5ce37 | ||
|
|
df1a99d9a4 | ||
|
|
7b787ebbb6 | ||
|
|
64990642cf | ||
|
|
11baa1b672 | ||
|
|
45cb42f49f | ||
|
|
70e6bf03bf | ||
|
|
0c10e10ee8 | ||
|
|
6d9f12d0b3 | ||
|
|
f8ec1d922e | ||
|
|
264f33a23f | ||
|
|
62ff2d0bfe | ||
|
|
932f707177 | ||
|
|
df2ff75116 | ||
|
|
84452dba8e | ||
|
|
368d3ff0d9 | ||
|
|
95a0b11d0a | ||
|
|
e93d7953df | ||
|
|
941bbf2067 | ||
|
|
85d34c3264 |
No files matched your search
+18
-8
@@ -1,4 +1,22 @@
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- locales
|
||||
- language-pack-de
|
||||
- re2c
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libmcrypt-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
- libpspell-dev
|
||||
- librecode-dev
|
||||
- libsasl2-dev
|
||||
- libxpm-dev
|
||||
- libt1-dev
|
||||
|
||||
notifications:
|
||||
email:
|
||||
@@ -27,13 +45,6 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
@@ -43,7 +54,6 @@ before_script:
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
- . ./travis/ext/imap/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
|
||||
+10
-4
@@ -599,8 +599,8 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key);
|
||||
sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
@@ -612,6 +612,12 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
created = TRUE;
|
||||
}
|
||||
if (!shm_handle || !info_handle) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
@@ -622,8 +628,8 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
|
||||
shm = shm_get(key, NULL);
|
||||
if (!shm) {
|
||||
UnmapViewOfFile(shm_handle);
|
||||
UnmapViewOfFile(info_handle);
|
||||
CloseHandle(shm_handle);
|
||||
CloseHandle(info_handle);
|
||||
return -1;
|
||||
}
|
||||
shm->segment = shm_handle;
|
||||
|
||||
@@ -352,7 +352,7 @@ Relevant RFCs:
|
||||
Other language changes
|
||||
----------------------
|
||||
|
||||
* Removed support for static calls to non-static calls form an incompatible
|
||||
* Removed support for static calls to non-static methods from an incompatible
|
||||
$this context. In this case $this will not be defined, but the call will be
|
||||
allowed with a deprecation notice. An example:
|
||||
|
||||
@@ -556,6 +556,10 @@ Other
|
||||
. Added ability to move PHP code pages (PHP TEXT segment) into HUGE pages.
|
||||
It's possible to enable/disable this feature in php.ini through
|
||||
opcache.huge_code_pages=0/1. OS should be configured to provide huge pages.
|
||||
. Added Windows only opcache.file_cache_fallback=1 ini option, which implies
|
||||
the implemented fallback mechanism. When OPcache was not able to reattach
|
||||
the shared memory segment to the desired address and opcache.file_cache
|
||||
is on, opcache.file_cache_only=1 will be automatically enforced.
|
||||
|
||||
- OpenSSL
|
||||
. Added "alpn_protocols" SSL context option allowing encrypted client/server
|
||||
@@ -604,9 +608,6 @@ Other
|
||||
5. Changed Functions
|
||||
========================================
|
||||
|
||||
- parse_ini_file():
|
||||
- parse_ini_string():
|
||||
. Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
|
||||
- unserialize():
|
||||
. Added second parameter for unserialize function
|
||||
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
|
||||
@@ -643,6 +644,7 @@ Other
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- GMP
|
||||
. Added gmp_random_seed().
|
||||
|
||||
@@ -666,6 +668,8 @@ Other
|
||||
7. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
- ReflectionGenerator
|
||||
- ReflectionType
|
||||
|
||||
========================================
|
||||
8. Removed Extensions and SAPIs
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
|
||||
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
||||
they can use the implemenations available on the system, not the PHP one. With snprintf the
|
||||
macros ZEND_INT_FMT and ZEND_UINT_FMT should be used.
|
||||
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
|
||||
|
||||
h. HashTable API
|
||||
|
||||
@@ -248,7 +248,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
|
||||
w. Tick functions internal API change
|
||||
Tick functions have different declaration now. They expect a single
|
||||
single parameter while before they were parameterless. When registering the
|
||||
parameter while before they were parameterless. When registering the
|
||||
tick function a value for this parameter must be passed. This value will be
|
||||
provided to the tick function on every execution.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_016.php on line 6
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %sexpect_016.php on line 8
|
||||
@@ -25,9 +25,9 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 10
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 12
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -68,7 +68,7 @@ catch (Exception $e) {
|
||||
--EXPECTF--
|
||||
Hello World!
|
||||
===NONE===
|
||||
string(56) "Method NoneTest::__toString() must return a string value"
|
||||
string(%d) "Method NoneTest::__toString() must return a string value"
|
||||
===THROW===
|
||||
|
||||
Fatal error: Method ErrorTest::__toString() must not throw an exception in %sbug26166.php on line %d
|
||||
Fatal error: Method ErrorTest::__toString() must not throw an exception, caught Exception: This is an error! in %sbug26166.php on line %d
|
||||
@@ -14,7 +14,7 @@ class Bad {
|
||||
$bad = new Bad();
|
||||
echo "$bad";
|
||||
--EXPECTF--
|
||||
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
|
||||
Fatal error: Method Bad::__toString() must not throw an exception, caught Exception: Oops, I cannot do this in %sbug60909_2.php on line %d
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70430: Stack buffer overflow in zend_language_parser()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$"*** Testing function() : ***\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '"*** Testing function() : ***' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '{' or '$' in %s on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())
|
||||
--FILE--
|
||||
<?php
|
||||
class a {}
|
||||
$x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #70662: Duplicate array key via undefined index error handler
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = [];
|
||||
set_error_handler(function() use(&$a) {
|
||||
$a['b'] = 2;
|
||||
});
|
||||
$a['b'] += 1;
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["b"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #70681: Segfault when binding $this of internal instance method to null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(null);
|
||||
|
||||
$c = (new ReflectionFunction('strlen'))->getClosure();
|
||||
$c = $c->bindTo(null);
|
||||
var_dump($c("foo"));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot unbind $this of internal method in %s on line %d
|
||||
int(3)
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70685: Segfault for getClosure() internal method rebind with invalid $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class cls {}
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(new cls);
|
||||
var_dump($c);
|
||||
|
||||
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
|
||||
$c = $c->bindTo(new SplStack, 'cls');
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70689 (Exception handler does not work as expected)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo($foo) {
|
||||
echo "Executing foo\n";
|
||||
}
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
throw new Exception($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
foo();
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
|
||||
--FILE--
|
||||
<?php
|
||||
$ini = '[${ ';
|
||||
|
||||
$ini_file = __DIR__ . "/bug70748.ini";
|
||||
|
||||
file_put_contents($ini_file, $ini);
|
||||
|
||||
var_dump(parse_ini_file($ini_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "bug70748.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
|
||||
in %sbug70748.php on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70782: null ptr deref and segfault (zend_get_class_fetch_type)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
(-0)::$prop;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Illegal class name in %s on line %d
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #70785 (Infinite loop due to exception during identical comparison)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $msg) {
|
||||
throw new Exception($msg);
|
||||
});
|
||||
|
||||
try {
|
||||
if ($a === null) { // ZEND_VM_SMART_BRANCH
|
||||
undefined_function('Null');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
try {
|
||||
$c === 3; // ZEND_VM_NEXT_OPCODE
|
||||
undefined_function();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["array"]);
|
||||
unset($GLOBALS["a"]); // this will be called in gc_colloct_roots and put $a into gc roots buf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
$c = new A;
|
||||
$array = array($c); //This is used to leave a room for $GLOBALS["a"]
|
||||
unset($c);
|
||||
|
||||
while ($i++ < 9997) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t); // This is used to trigger C::__destruct while doing gc_colloct_roots
|
||||
|
||||
$e = $a;
|
||||
unset($a); // This one can not be putted into roots buf because it's full, thus gc_colloct_roots will be called,
|
||||
// but C::__destructor which is called in gc_colloct_roots will put $a into buf
|
||||
// which will make $a be putted into gc roots buf twice
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["array"]);
|
||||
unset($GLOBALS["a"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
$c = new A;
|
||||
$array = array($c);
|
||||
unset($c);
|
||||
|
||||
while ($i++ < 9997) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
unset($a);
|
||||
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["a"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i++ < 9998) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
|
||||
unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #70873 (Regression on private static properties access)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private static $x = 1;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
function bar() {
|
||||
var_dump(self::$x);
|
||||
}
|
||||
};
|
||||
|
||||
class C extends A {
|
||||
function bar() {
|
||||
var_dump(A::$x);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$a = new B;
|
||||
$a->bar();
|
||||
|
||||
$b = new C;
|
||||
$b->bar();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property B::$x in %sbug70873.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug70873.php(%d): B->bar()
|
||||
#1 {main}
|
||||
thrown in %sbug70873.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #70895 null ptr deref and segfault with crafted callable
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
array_map("%n", 0);
|
||||
array_map("%n %i", 0);
|
||||
array_map("%n %i aoeu %f aoeu %p", 0);
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+
|
||||
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+
|
||||
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70895 null ptr deref and segfault with crafted callable
|
||||
--FILE--
|
||||
<?php
|
||||
function m($f,$a){
|
||||
return array_map($f,0);
|
||||
}
|
||||
|
||||
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: implode(): Argument must be an array in %sbug70898.php on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70912 (Null ptr dereference when class property is initialised to a dereferenced value)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $a=[][];
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use [] for reading in %sbug70912.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70914 zend_throw_or_error() format string vulnerability
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("pdo_sqlite")) {
|
||||
die("skip pdo_sqlite required");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$db = new PDO('sqlite::memory:');
|
||||
$st = $db->query('SELECT 1');
|
||||
$re = $st->fetchObject('%Z');
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Fatal error: Class '%Z' not found in .+bug70914.php on line \d+
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw $e;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw new Exception("Dummy", 0, $e);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "Exception: Foo in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
string(%d) "Exception: Foo in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
Next Exception: Dummy in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70957 (self::class can not be resolved with reflection for abstract class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class Foo
|
||||
{
|
||||
function bar($a = self::class) {}
|
||||
}
|
||||
|
||||
trait T {
|
||||
public function bar() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends Foo
|
||||
{
|
||||
use T;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
|
||||
--FILE--
|
||||
<?php
|
||||
trait Foo
|
||||
{
|
||||
function bar($a = self::class) {
|
||||
var_dump($a);
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
use Foo;
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
|
||||
$b->bar();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #70967 (Weird error handling for __toString when Error is thrown)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __toString() {
|
||||
undefined_function();
|
||||
}
|
||||
}
|
||||
|
||||
echo (new A);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Method A::__toString() must not throw an exception, caught Error: Call to undefined function undefined_function() in %sbug70967.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #70987 (static::class within Closure::call() causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {}
|
||||
$bar = function () {
|
||||
return static::class;
|
||||
};
|
||||
|
||||
var_dump($bar->call(new foo));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #70997 (When using parentClass:: instead of parent::, static context changed)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
const TEST = false;
|
||||
|
||||
public function test()
|
||||
{
|
||||
var_dump(static::TEST);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
const TEST = true;
|
||||
|
||||
public function test()
|
||||
{
|
||||
A::test();
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
$b->test();
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -53,9 +53,9 @@ $d = $nonstaticScoped->bindTo(null); $d(); echo "\n";
|
||||
$d->bindTo($d);
|
||||
|
||||
echo "After binding, with same-class instance for the bound ones", "\n";
|
||||
$d = $staticUnscoped->bindTo(new A); $d(); echo "\n";
|
||||
$d = $staticUnscoped->bindTo(new A);
|
||||
$d = $nonstaticUnscoped->bindTo(new A); $d(); echo " (should be scoped to dummy class)\n";
|
||||
$d = $staticScoped->bindTo(new A); $d(); echo "\n";
|
||||
$d = $staticScoped->bindTo(new A);
|
||||
$d = $nonstaticScoped->bindTo(new A); $d(); echo "\n";
|
||||
|
||||
echo "After binding, with different instance for the bound ones", "\n";
|
||||
@@ -87,14 +87,10 @@ After binding, with same-class instance for the bound ones
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
scoped to A: bool(false)
|
||||
bound: no
|
||||
scoped to A: bool(false)
|
||||
bound: A (should be scoped to dummy class)
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
scoped to A: bool(true)
|
||||
bound: no
|
||||
scoped to A: bool(true)
|
||||
bound: A
|
||||
After binding, with different instance for the bound ones
|
||||
scoped to A: bool(false)
|
||||
|
||||
@@ -26,16 +26,16 @@ $d = $staticUnscoped->bindTo(null, null); $d(); echo "\n";
|
||||
$d = $staticScoped->bindTo(null, null); $d(); echo "\n";
|
||||
|
||||
echo "After binding, null scope, with instance", "\n";
|
||||
$d = $staticUnscoped->bindTo(new A, null); $d(); echo "\n";
|
||||
$d = $staticScoped->bindTo(new A, null); $d(); echo "\n";
|
||||
$d = $staticUnscoped->bindTo(new A, null);
|
||||
$d = $staticScoped->bindTo(new A, null);
|
||||
|
||||
echo "After binding, with scope, no instance", "\n";
|
||||
$d = $staticUnscoped->bindTo(null, 'A'); $d(); echo "\n";
|
||||
$d = $staticScoped->bindTo(null, 'A'); $d(); echo "\n";
|
||||
|
||||
echo "After binding, with scope, with instance", "\n";
|
||||
$d = $staticUnscoped->bindTo(new A, 'A'); $d(); echo "\n";
|
||||
$d = $staticScoped->bindTo(new A, 'A'); $d(); echo "\n";
|
||||
$d = $staticUnscoped->bindTo(new A, 'A');
|
||||
$d = $staticScoped->bindTo(new A, 'A');
|
||||
|
||||
echo "Done.\n";
|
||||
|
||||
@@ -57,14 +57,8 @@ bool(false)
|
||||
After binding, null scope, with instance
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
After binding, with scope, no instance
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -75,12 +69,6 @@ bool(false)
|
||||
After binding, with scope, with instance
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
|
||||
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
Done.
|
||||
@@ -0,0 +1,241 @@
|
||||
--TEST--
|
||||
Rebinding of ::getClosure()s
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
use SplDoublyLinkedList as DLL;
|
||||
|
||||
function func($arg) { }
|
||||
|
||||
class Cls {
|
||||
public function method() {}
|
||||
public static function staticMethod($arg) {}
|
||||
}
|
||||
|
||||
class ClsChild extends Cls {}
|
||||
|
||||
class ClsUnrelated {}
|
||||
|
||||
/* Format: [Function, [Obj, Scope]] */
|
||||
$tests = [
|
||||
['func', [
|
||||
[null, null],
|
||||
[new Cls, null],
|
||||
[new Cls, 'Cls'],
|
||||
[null, 'Cls'],
|
||||
[null, 'stdClass'],
|
||||
[new stdClass, null],
|
||||
]],
|
||||
|
||||
['strlen', [
|
||||
[null, null],
|
||||
[new Cls, null],
|
||||
[new Cls, 'Cls'],
|
||||
[null, 'Cls'],
|
||||
[null, 'stdClass'],
|
||||
[new stdClass, null],
|
||||
]],
|
||||
|
||||
[['Cls', 'staticMethod'], [
|
||||
[null, 'Cls'],
|
||||
[new Cls, null],
|
||||
[new Cls, 'Cls'],
|
||||
[null, null],
|
||||
[null, 'ClsChild'],
|
||||
[null, 'ClsUnrelated'],
|
||||
]],
|
||||
|
||||
[[new Cls, 'method'], [
|
||||
[null, 'Cls'],
|
||||
[new Cls, 'Cls'],
|
||||
[new ClsChild, 'Cls'],
|
||||
[new ClsUnrelated, 'Cls'],
|
||||
[new Cls, null],
|
||||
[new Cls, 'ClsUnrelated'],
|
||||
[new Cls, 'ClsChild'],
|
||||
]],
|
||||
|
||||
[[new DLL, 'count'], [
|
||||
[new DLL, DLL::class],
|
||||
[new SplStack, DLL::class],
|
||||
[new ClsUnrelated, DLL::class],
|
||||
[null, null],
|
||||
[null, DLL::class],
|
||||
[new DLL, null],
|
||||
[new DLL, ClsUnrelated::class],
|
||||
]],
|
||||
|
||||
[function() {}, [
|
||||
[null, null],
|
||||
[new Cls, null],
|
||||
[new Cls, 'Cls'],
|
||||
[null, 'Cls'],
|
||||
[null, 'stdClass'],
|
||||
[new stdClass, null],
|
||||
]],
|
||||
];
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
echo "$errstr\n\n";
|
||||
});
|
||||
|
||||
foreach ($tests as list($fn, $bindings)) {
|
||||
if (is_array($fn)) {
|
||||
$r = new ReflectionMethod($fn[0], $fn[1]);
|
||||
$c = $r->getClosure(is_object($fn[0]) ? $fn[0] : null);
|
||||
$fnStr = is_object($fn[0]) ? "(new " . get_class($fn[0]) . ")->$fn[1]" : "$fn[0]::$fn[1]";
|
||||
} else {
|
||||
$c = (new ReflectionFunction($fn))->getClosure();
|
||||
$fnStr = $fn;
|
||||
}
|
||||
if ($fn instanceof Closure) {
|
||||
$fnStr = "(function() {})";
|
||||
}
|
||||
|
||||
echo "$fnStr()\n" . str_repeat('-', strlen($fnStr) + 2), "\n\n";
|
||||
|
||||
foreach ($bindings as list($obj, $scope)) {
|
||||
$objStr = $obj ? "new " . get_class($obj) : "null";
|
||||
$scopeStr = $scope ? "$scope::class" : "null";
|
||||
echo "bindTo($objStr, $scopeStr):\n";
|
||||
|
||||
$ret = $c->bindTo($obj, $scope);
|
||||
if ($ret !== null) {
|
||||
echo "Success!\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
func()
|
||||
------
|
||||
|
||||
bindTo(null, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
|
||||
bindTo(new stdClass, null):
|
||||
Success!
|
||||
|
||||
strlen()
|
||||
--------
|
||||
|
||||
bindTo(null, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
|
||||
bindTo(new stdClass, null):
|
||||
Success!
|
||||
|
||||
Cls::staticMethod()
|
||||
-------------------
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Cannot bind an instance to a static closure
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot bind an instance to a static closure
|
||||
|
||||
bindTo(null, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new Cls)->method()
|
||||
-------------------
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(new ClsChild, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(new ClsUnrelated, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new SplDoublyLinkedList)->count()
|
||||
----------------------------------
|
||||
|
||||
bindTo(new SplDoublyLinkedList, SplDoublyLinkedList::class):
|
||||
Success!
|
||||
|
||||
bindTo(new SplStack, SplDoublyLinkedList::class):
|
||||
Success!
|
||||
|
||||
bindTo(new ClsUnrelated, SplDoublyLinkedList::class):
|
||||
Cannot bind internal method SplDoublyLinkedList::count() to object of class ClsUnrelated
|
||||
|
||||
bindTo(null, null):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(null, SplDoublyLinkedList::class):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
bindTo(null, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
|
||||
bindTo(new stdClass, null):
|
||||
Success!
|
||||
@@ -61,7 +61,7 @@ int(0)
|
||||
int(0)
|
||||
int(3)
|
||||
|
||||
Warning: Cannot bind closure to object of internal class stdClass in %s line %d
|
||||
Warning: Cannot bind closure to scope of internal class stdClass in %s line %d
|
||||
NULL
|
||||
int(21)
|
||||
int(3)
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
Concatenating many small strings should not slowdown allocations
|
||||
--SKIPIF--
|
||||
<?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
|
||||
--INI--
|
||||
memory_limit=256m
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* To note is that memory usage can vary depending on whether opcache is on. The actual
|
||||
measuring that matters is timing here. */
|
||||
|
||||
$time = microtime(TRUE);
|
||||
|
||||
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
|
||||
$t0_max = 0.1;
|
||||
$t1_max = 0.4;
|
||||
|
||||
$datas = [];
|
||||
for ($i = 0; $i < 220000; $i++)
|
||||
{
|
||||
$datas[] = [
|
||||
'000.000.000.000',
|
||||
'000.255.255.255',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
];
|
||||
}
|
||||
|
||||
$t0 = microtime(TRUE) - $time;
|
||||
var_dump($t0 < $t0_max);
|
||||
|
||||
|
||||
$texts = '';
|
||||
foreach ($datas AS $data)
|
||||
{
|
||||
$texts .= implode("\t", $data) . "\r\n";
|
||||
}
|
||||
|
||||
$t1 = microtime(TRUE) - $time;
|
||||
var_dump($t1 < $t1_max);
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
+++DONE+++
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #70904 (yield from incorrectly marks valid generator as finished)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function g1() {
|
||||
yield 1;
|
||||
}
|
||||
|
||||
function g2($g1) {
|
||||
yield from $g1;
|
||||
echo "reached!\n";
|
||||
yield 2;
|
||||
}
|
||||
|
||||
$g1 = g1();
|
||||
$g2 = g2($g1);
|
||||
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g1->next();
|
||||
var_dump($g1->valid());
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
int(1)
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(1)
|
||||
reached!
|
||||
bool(true)
|
||||
int(2)
|
||||
bool(false)
|
||||
NULL
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #70965 (yield from with a common iterator primes too much)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function it() {
|
||||
yield from [1, 2, 3, 4, 5];
|
||||
}
|
||||
|
||||
function bar($g) {
|
||||
yield from $g;
|
||||
}
|
||||
|
||||
$gen = it();
|
||||
$gens[] = bar($gen);
|
||||
$gens[] = bar($gen);
|
||||
|
||||
do {
|
||||
foreach($gens as $g) {
|
||||
var_dump($g->current());
|
||||
$gen->next();
|
||||
}
|
||||
} while ($gen->valid());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(5)
|
||||
int(5)
|
||||
@@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Bug #71013 (Incorrect exception handler with yield from)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FooBar implements Iterator {
|
||||
function __construct() { echo "Constructing new FooBar\n"; }
|
||||
function __destruct() { echo "Destructing FooBar\n"; }
|
||||
function current () { throw new Exception; }
|
||||
function key () { return 0; }
|
||||
function next () {}
|
||||
function rewind () {}
|
||||
function valid () { return true; }
|
||||
}
|
||||
|
||||
function foo() {
|
||||
try {
|
||||
$f = new FooBar;
|
||||
yield from $f;
|
||||
} catch (Exception $e) {
|
||||
echo "[foo()] Caught Exception\n";
|
||||
}
|
||||
}
|
||||
|
||||
function bar() {
|
||||
echo "Starting bar()\n";
|
||||
$x = foo();
|
||||
try {
|
||||
var_dump($x->current());
|
||||
} catch (Exception $e) {
|
||||
echo "[bar()] Caught Exception\n";
|
||||
}
|
||||
echo "Unsetting \$x\n";
|
||||
unset($x);
|
||||
echo "Finishing bar()\n";
|
||||
}
|
||||
|
||||
bar();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Starting bar()
|
||||
Constructing new FooBar
|
||||
[foo()] Caught Exception
|
||||
Destructing FooBar
|
||||
NULL
|
||||
Unsetting $x
|
||||
Finishing bar()
|
||||
|
||||
@@ -37,5 +37,8 @@ int(4)
|
||||
int(6)
|
||||
int(3)
|
||||
int(5)
|
||||
int(3)
|
||||
int(5)
|
||||
NULL
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Throwing into a generator yielding from an array/iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$data = [1, 2, 3];
|
||||
|
||||
function yielditer($arr) {
|
||||
foreach($arr as $val) {
|
||||
yield $val;
|
||||
}
|
||||
}
|
||||
|
||||
function yf($in) {
|
||||
yield from $in;
|
||||
}
|
||||
|
||||
function test($g) {
|
||||
var_dump($g->current());
|
||||
try {
|
||||
$g->throw(new Exception("Exception!"));
|
||||
} catch (Exception $e) {
|
||||
echo "{$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($g->current());
|
||||
}
|
||||
|
||||
$yfiter = yf($data);
|
||||
$yfgen = yf(yielditer($data));
|
||||
|
||||
test(yf($data));
|
||||
echo "\n";
|
||||
test(yf(yielditer($data)));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
Exception!
|
||||
NULL
|
||||
|
||||
int(1)
|
||||
Exception!
|
||||
NULL
|
||||
@@ -11,4 +11,4 @@ echo __NAMESPACE__ . "\n";
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Namespace declaration statement has to be the very first statement in the script in %sns_068.php on line %d
|
||||
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_068.php on line %d
|
||||
@@ -11,4 +11,4 @@ echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Namespace declaration statement has to be the very first statement in the script in %s on line %d
|
||||
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_083.php on line %d
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Combination of foreach, finally and goto (call order)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $n = 0;
|
||||
function __construct($n) {
|
||||
$this->n = $n;
|
||||
}
|
||||
function __destruct() {
|
||||
echo "destruct" . $this->n . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([new A(1)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(2)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(3)] as $a) {
|
||||
$a = null;
|
||||
goto out;
|
||||
}
|
||||
} finally {
|
||||
echo "finally1\n";
|
||||
}
|
||||
out: ;
|
||||
}
|
||||
} finally {
|
||||
echo "finally2\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
destruct3
|
||||
finally1
|
||||
destruct2
|
||||
finally2
|
||||
destruct1
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Combination of foreach, finally and exception (call order)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $n = 0;
|
||||
function __construct($n) {
|
||||
$this->n = $n;
|
||||
}
|
||||
function __destruct() {
|
||||
echo "destruct" . $this->n . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([new A(1)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(2)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(3)] as $a) {
|
||||
$a = null;
|
||||
throw new Exception();
|
||||
}
|
||||
} finally {
|
||||
echo "finally1\n";
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "catch\n";
|
||||
} finally {
|
||||
echo "finally2\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
destruct3
|
||||
finally1
|
||||
destruct2
|
||||
catch
|
||||
finally2
|
||||
destruct1
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Fully qualified (leading backslash) type names must fail
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(\int $foo) {
|
||||
var_dump($foo);
|
||||
}
|
||||
foo(1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
namespace\int is not a valid type hint
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(namespace\int $i) {}
|
||||
test(0);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Accessing a static property on a statically evaluable class expression
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public static $b = 42;
|
||||
}
|
||||
var_dump(('A' . (string) '')::$b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Static property on constexpr class with leading backslash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public static $b = 42;
|
||||
}
|
||||
var_dump(('\A' . (string) '')::$b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Static property access on constexpr class evaluating to integer
|
||||
--FILE--
|
||||
<?php
|
||||
((int)1)::$b;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
+3
-3
@@ -129,7 +129,7 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
|
||||
|
||||
ZEND_INI_BEGIN()
|
||||
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
|
||||
STD_ZEND_INI_BOOLEAN("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
|
||||
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
|
||||
STD_ZEND_INI_BOOLEAN("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, gc_enabled, zend_gc_globals, gc_globals)
|
||||
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
|
||||
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
|
||||
@@ -1316,7 +1316,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception(exception_ce, message, 0);
|
||||
} else {
|
||||
zend_error(E_ERROR, message);
|
||||
zend_error(E_ERROR, "%s", message);
|
||||
}
|
||||
|
||||
efree(message);
|
||||
@@ -1346,7 +1346,7 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
|
||||
if (throw_exception) {
|
||||
zend_throw_exception(zend_ce_type_error, message, 0);
|
||||
} else {
|
||||
zend_error(E_WARNING, message);
|
||||
zend_error(E_WARNING, "%s", message);
|
||||
}
|
||||
efree(message);
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.0.0-dev"
|
||||
#define ZEND_VERSION "3.0.0"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
+14
-2
@@ -1219,8 +1219,20 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
|
||||
zend_property_info *property_info;
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) {
|
||||
if(key) {
|
||||
property_info = zend_get_property_info(object->ce, key, 1);
|
||||
if (key) {
|
||||
if (ZSTR_VAL(key)[0] == '\0') {
|
||||
const char *class_name, *prop_name;
|
||||
size_t prop_name_len;
|
||||
if (zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len) == SUCCESS) {
|
||||
zend_string *pname = zend_string_init(prop_name, prop_name_len, 0);
|
||||
property_info = zend_get_property_info(object->ce, pname, 1);
|
||||
zend_string_release(pname);
|
||||
} else {
|
||||
property_info = ZEND_WRONG_PROPERTY_INFO;
|
||||
}
|
||||
} else {
|
||||
property_info = zend_get_property_info(object->ce, key, 1);
|
||||
}
|
||||
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
|
||||
property_info &&
|
||||
(property_info->flags & ZEND_ACC_STATIC) == 0) {
|
||||
|
||||
+33
-5
@@ -506,9 +506,9 @@ static void zend_mm_munmap(void *addr, size_t size)
|
||||
/* number of trailing set (1) bits */
|
||||
static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
|
||||
{
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
|
||||
return __builtin_ctzl(~bitset);
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
|
||||
return __builtin_ctzll(~bitset);
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -545,9 +545,9 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
|
||||
/* number of trailing zero bits (0x01 -> 1; 0x40 -> 6; 0x00 -> LEN) */
|
||||
static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset)
|
||||
{
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
|
||||
return __builtin_ctzl(bitset);
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
|
||||
return __builtin_ctzll(bitset);
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -1161,7 +1161,7 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch
|
||||
/* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
|
||||
static zend_always_inline int zend_mm_small_size_to_bit(int size)
|
||||
{
|
||||
#if defined(__GNUC__) || __has_builtin(__builtin_clz)
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
|
||||
return (__builtin_clz(size) ^ 0x1f) + 1;
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -1462,7 +1462,15 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
#if ZEND_DEBUG
|
||||
size = real_size;
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
#else
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
#endif
|
||||
if (new_size == old_size) {
|
||||
#if ZEND_DEBUG
|
||||
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
@@ -1507,7 +1515,9 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
heap->real_size += new_size - old_size;
|
||||
#endif
|
||||
#if ZEND_MM_STAT
|
||||
heap->real_peak = MAX(heap->real_peak, heap->real_size);
|
||||
heap->size += new_size - old_size;
|
||||
heap->peak = MAX(heap->peak, heap->size);
|
||||
#endif
|
||||
#if ZEND_DEBUG
|
||||
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
@@ -1618,9 +1628,19 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
}
|
||||
|
||||
/* Naive reallocation */
|
||||
#if ZEND_MM_STAT
|
||||
do {
|
||||
size_t orig_peak = heap->peak;
|
||||
size_t orig_real_peak = heap->real_peak;
|
||||
#endif
|
||||
ret = zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
memcpy(ret, ptr, MIN(old_size, copy_size));
|
||||
zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
#if ZEND_MM_STAT
|
||||
heap->peak = MAX(orig_peak, heap->size);
|
||||
heap->real_peak = MAX(orig_real_peak, heap->real_size);
|
||||
} while (0);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1710,7 +1730,15 @@ static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t
|
||||
|
||||
static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
#else
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
#endif
|
||||
void *ptr;
|
||||
|
||||
#if ZEND_MM_LIMIT
|
||||
|
||||
+1
-1
@@ -124,7 +124,6 @@ enum _zend_ast_kind {
|
||||
ZEND_AST_SWITCH,
|
||||
ZEND_AST_SWITCH_CASE,
|
||||
ZEND_AST_DECLARE,
|
||||
ZEND_AST_PROP_ELEM,
|
||||
ZEND_AST_CONST_ELEM,
|
||||
ZEND_AST_USE_TRAIT,
|
||||
ZEND_AST_TRAIT_PRECEDENCE,
|
||||
@@ -142,6 +141,7 @@ enum _zend_ast_kind {
|
||||
ZEND_AST_TRY,
|
||||
ZEND_AST_CATCH,
|
||||
ZEND_AST_PARAM,
|
||||
ZEND_AST_PROP_ELEM,
|
||||
|
||||
/* 4 child nodes */
|
||||
ZEND_AST_FOR = 4 << ZEND_AST_NUM_CHILDREN_SHIFT,
|
||||
|
||||
@@ -2481,7 +2481,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
|
||||
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit) /* {{{ */
|
||||
{
|
||||
zend_execute_data *call, *ptr, *skip;
|
||||
zend_execute_data *ptr, *skip, *call = NULL;
|
||||
zend_object *object;
|
||||
int lineno, frameno = 0;
|
||||
zend_function *func;
|
||||
@@ -2490,8 +2490,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
zend_string *include_filename = NULL;
|
||||
zval stack_frame;
|
||||
|
||||
call = NULL;
|
||||
ptr = EG(current_execute_data);
|
||||
array_init(return_value);
|
||||
|
||||
if (!(ptr = EG(current_execute_data))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type)) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
@@ -2509,13 +2513,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
}
|
||||
if (!call) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
}
|
||||
if (!call) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
while (ptr && (limit == 0 || frameno < limit)) {
|
||||
frameno++;
|
||||
|
||||
+89
-44
@@ -34,11 +34,15 @@
|
||||
#define ZEND_CLOSURE_PROPERTY_ERROR() \
|
||||
zend_throw_error(NULL, "Closure object cannot have properties")
|
||||
|
||||
/* reuse bit to mark "fake" closures (it wasn't used for functions before) */
|
||||
#define ZEND_ACC_FAKE_CLOSURE ZEND_ACC_INTERFACE
|
||||
|
||||
typedef struct _zend_closure {
|
||||
zend_object std;
|
||||
zend_function func;
|
||||
zval this_ptr;
|
||||
zend_class_entry *called_scope;
|
||||
void (*orig_internal_handler)(INTERNAL_FUNCTION_PARAMETERS);
|
||||
} zend_closure;
|
||||
|
||||
/* non-static since it needs to be referenced */
|
||||
@@ -69,6 +73,47 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_bool zend_valid_closure_binding(
|
||||
zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */
|
||||
{
|
||||
zend_function *func = &closure->func;
|
||||
if (newthis) {
|
||||
if (func->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (func->type == ZEND_INTERNAL_FUNCTION && func->common.scope &&
|
||||
!instanceof_function(Z_OBJCE_P(newthis), func->common.scope)) {
|
||||
/* Binding incompatible $this to an internal method is not supported. */
|
||||
zend_error(E_WARNING, "Cannot bind internal method %s::%s() to object of class %s",
|
||||
ZSTR_VAL(func->common.scope->name),
|
||||
ZSTR_VAL(func->common.function_name),
|
||||
ZSTR_VAL(Z_OBJCE_P(newthis)->name));
|
||||
return 0;
|
||||
}
|
||||
} else if (!(func->common.fn_flags & ZEND_ACC_STATIC) && func->common.scope
|
||||
&& func->type == ZEND_INTERNAL_FUNCTION) {
|
||||
zend_error(E_WARNING, "Cannot unbind $this of internal method");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) {
|
||||
/* rebinding to internal class is not allowed */
|
||||
zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s",
|
||||
ZSTR_VAL(scope->name));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) && scope != func->common.scope) {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed Closure::call(object to [, mixed parameter] [, mixed ...] )
|
||||
Call closure, binding to a given object with its class as the scope */
|
||||
ZEND_METHOD(Closure, call)
|
||||
@@ -89,25 +134,9 @@ ZEND_METHOD(Closure, call)
|
||||
zclosure = getThis();
|
||||
closure = (zend_closure *) Z_OBJ_P(zclosure);
|
||||
|
||||
if (closure->func.common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
|
||||
return;
|
||||
}
|
||||
|
||||
if (closure->func.type == ZEND_INTERNAL_FUNCTION) {
|
||||
/* verify that we aren't binding internal function to a wrong object */
|
||||
if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
!instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", ZSTR_VAL(closure->func.common.scope->name), ZSTR_VAL(closure->func.common.function_name), ZSTR_VAL(Z_OBJCE_P(newthis)->name));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
newobj = Z_OBJ_P(newthis);
|
||||
|
||||
if (newobj->ce != closure->func.common.scope && newobj->ce->type == ZEND_INTERNAL_CLASS) {
|
||||
/* rebinding to internal class is not allowed */
|
||||
zend_error(E_WARNING, "Cannot bind closure to object of internal class %s", ZSTR_VAL(newobj->ce->name));
|
||||
if (!zend_valid_closure_binding(closure, newthis, Z_OBJCE_P(newthis))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,6 +150,7 @@ ZEND_METHOD(Closure, call)
|
||||
fci.param_count = my_param_count;
|
||||
fci.object = fci_cache.object = newobj;
|
||||
fci_cache.initialized = 1;
|
||||
fci_cache.called_scope = Z_OBJCE_P(newthis);
|
||||
|
||||
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
|
||||
zval new_closure;
|
||||
@@ -162,15 +192,11 @@ ZEND_METHOD(Closure, bind)
|
||||
zend_class_entry *ce, *called_scope;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
return;
|
||||
}
|
||||
|
||||
closure = (zend_closure *)Z_OBJ_P(zclosure);
|
||||
|
||||
if ((newthis != NULL) && (closure->func.common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
|
||||
}
|
||||
|
||||
if (scope_arg != NULL) { /* scope argument was given */
|
||||
if (Z_TYPE_P(scope_arg) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(scope_arg);
|
||||
@@ -187,15 +213,14 @@ ZEND_METHOD(Closure, bind)
|
||||
}
|
||||
zend_string_release(class_name);
|
||||
}
|
||||
if(ce && ce != closure->func.common.scope && ce->type == ZEND_INTERNAL_CLASS) {
|
||||
/* rebinding to internal class is not allowed */
|
||||
zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
} else { /* scope argument not given; do not change the scope by default */
|
||||
ce = closure->func.common.scope;
|
||||
}
|
||||
|
||||
if (!zend_valid_closure_binding(closure, newthis, ce)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newthis) {
|
||||
called_scope = Z_OBJCE_P(newthis);
|
||||
} else {
|
||||
@@ -517,6 +542,15 @@ void zend_register_closure_ce(void) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_closure_internal_handler(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure*)EX(func)->common.prototype;
|
||||
closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
OBJ_RELEASE((zend_object*)closure);
|
||||
EX(func) = NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */
|
||||
{
|
||||
zend_closure *closure;
|
||||
@@ -525,17 +559,16 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
|
||||
closure = (zend_closure *)Z_OBJ_P(res);
|
||||
|
||||
memcpy(&closure->func, func, func->type == ZEND_USER_FUNCTION ? sizeof(zend_op_array) : sizeof(zend_internal_function));
|
||||
closure->func.common.prototype = (zend_function*)closure;
|
||||
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
|
||||
|
||||
if ((scope == NULL) && this_ptr && (Z_TYPE_P(this_ptr) != IS_UNDEF)) {
|
||||
/* use dummy scope if we're binding an object without specifying a scope */
|
||||
/* maybe it would be better to create one for this purpose */
|
||||
scope = zend_ce_closure;
|
||||
}
|
||||
|
||||
if (closure->func.type == ZEND_USER_FUNCTION) {
|
||||
if (func->type == ZEND_USER_FUNCTION) {
|
||||
memcpy(&closure->func, func, sizeof(zend_op_array));
|
||||
closure->func.common.prototype = (zend_function*)closure;
|
||||
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
|
||||
if (closure->func.op_array.static_variables) {
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
|
||||
@@ -551,19 +584,20 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
(*closure->func.op_array.refcount)++;
|
||||
}
|
||||
} else {
|
||||
/* verify that we aren't binding internal function to a wrong scope */
|
||||
if(func->common.scope != NULL) {
|
||||
if(scope && !instanceof_function(scope, func->common.scope)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name), ZSTR_VAL(scope->name));
|
||||
scope = NULL;
|
||||
}
|
||||
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
!instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name), ZSTR_VAL(Z_OBJCE_P(this_ptr)->name));
|
||||
scope = NULL;
|
||||
this_ptr = NULL;
|
||||
}
|
||||
memcpy(&closure->func, func, sizeof(zend_internal_function));
|
||||
closure->func.common.prototype = (zend_function*)closure;
|
||||
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
|
||||
/* wrap internal function handler to avoid memory leak */
|
||||
if (UNEXPECTED(closure->func.internal_function.handler == zend_closure_internal_handler)) {
|
||||
/* avoid infinity recursion, by taking handler from nested closure */
|
||||
zend_closure *nested = (zend_closure*)((char*)func - XtOffsetOf(zend_closure, func));
|
||||
ZEND_ASSERT(nested->std.ce == zend_ce_closure);
|
||||
closure->orig_internal_handler = nested->orig_internal_handler;
|
||||
} else {
|
||||
closure->orig_internal_handler = closure->func.internal_function.handler;
|
||||
}
|
||||
closure->func.internal_function.handler = zend_closure_internal_handler;
|
||||
if (!func->common.scope) {
|
||||
/* if it's a free function, we won't set scope & this since they're meaningless */
|
||||
this_ptr = NULL;
|
||||
scope = NULL;
|
||||
@@ -584,6 +618,17 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */
|
||||
{
|
||||
zend_closure *closure;
|
||||
|
||||
zend_create_closure(res, func, scope, called_scope, this_ptr);
|
||||
|
||||
closure = (zend_closure *)Z_OBJ_P(res);
|
||||
closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
@@ -29,6 +29,7 @@ void zend_register_closure_ce(void);
|
||||
extern ZEND_API zend_class_entry *zend_ce_closure;
|
||||
|
||||
ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr);
|
||||
ZEND_API void zend_create_fake_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr);
|
||||
ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj);
|
||||
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj);
|
||||
ZEND_API zval* zend_get_closure_this_ptr(zval *obj);
|
||||
|
||||
+45
-36
@@ -190,10 +190,10 @@ typedef struct _builtin_type_info {
|
||||
} builtin_type_info;
|
||||
|
||||
static const builtin_type_info builtin_types[] = {
|
||||
{"int", sizeof("int") - 1, IS_LONG},
|
||||
{"float", sizeof("float") - 1, IS_DOUBLE},
|
||||
{"string", sizeof("string") - 1, IS_STRING},
|
||||
{"bool", sizeof("bool") - 1, _IS_BOOL},
|
||||
{ZEND_STRL("int"), IS_LONG},
|
||||
{ZEND_STRL("float"), IS_DOUBLE},
|
||||
{ZEND_STRL("string"), IS_STRING},
|
||||
{ZEND_STRL("bool"), _IS_BOOL},
|
||||
{NULL, 0, IS_UNDEF}
|
||||
};
|
||||
|
||||
@@ -1703,18 +1703,6 @@ zend_ast *zend_ast_append_str(zend_ast *left_ast, zend_ast *right_ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* A hacky way that is used to store the doc comment for properties */
|
||||
zend_ast *zend_ast_append_doc_comment(zend_ast *list) /* {{{ */
|
||||
{
|
||||
if (CG(doc_comment)) {
|
||||
list = zend_ast_list_add(list, zend_ast_create_zval_from_str(CG(doc_comment)));
|
||||
CG(doc_comment) = NULL;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_verify_namespace(void) /* {{{ */
|
||||
{
|
||||
if (FC(has_bracketed_namespaces) && !FC(in_namespace)) {
|
||||
@@ -2042,6 +2030,7 @@ static void zend_emit_return_type_check(znode *expr, zend_arg_info *return_info)
|
||||
void zend_emit_final_return(zval *zv) /* {{{ */
|
||||
{
|
||||
znode zn;
|
||||
zend_op *ret;
|
||||
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
|
||||
@@ -2055,7 +2044,8 @@ void zend_emit_final_return(zval *zv) /* {{{ */
|
||||
ZVAL_NULL(&zn.u.constant);
|
||||
}
|
||||
|
||||
zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
|
||||
ret = zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
|
||||
ret->extended_value = -1;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2136,8 +2126,15 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int th
|
||||
zend_compile_expr(&name_node, name_ast);
|
||||
|
||||
if (name_node.op_type == IS_CONST) {
|
||||
zend_string *name = Z_STR(name_node.u.constant);
|
||||
uint32_t fetch_type = zend_get_class_fetch_type(name);
|
||||
zend_string *name;
|
||||
uint32_t fetch_type;
|
||||
|
||||
if (Z_TYPE(name_node.u.constant) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
|
||||
name = Z_STR(name_node.u.constant);
|
||||
fetch_type = zend_get_class_fetch_type(name);
|
||||
|
||||
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
|
||||
opline->extended_value = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
|
||||
@@ -3612,12 +3609,14 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
|
||||
|
||||
void zend_compile_echo(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_ast *expr_ast = ast->child[0];
|
||||
|
||||
znode expr_node;
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
|
||||
zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
|
||||
opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4384,6 +4383,11 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
|
||||
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
|
||||
|
||||
if (type != 0) {
|
||||
if (ast->attr != ZEND_NAME_NOT_FQ) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Scalar type declaration '%s' must be unqualified",
|
||||
ZSTR_VAL(zend_string_tolower(class_name)));
|
||||
}
|
||||
arg_info->type_hint = type;
|
||||
} else {
|
||||
uint32_t fetch_type = zend_get_class_fetch_type_ast(ast);
|
||||
@@ -4910,7 +4914,6 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
|
||||
uint32_t flags = list->attr;
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
uint32_t i, children = list->children;
|
||||
zend_string *doc_comment = NULL;
|
||||
|
||||
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables");
|
||||
@@ -4920,19 +4923,20 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract");
|
||||
}
|
||||
|
||||
/* Doc comment has been appended as last element in property list */
|
||||
if (list->child[children - 1]->kind == ZEND_AST_ZVAL) {
|
||||
doc_comment = zend_string_copy(zend_ast_get_str(list->child[children - 1]));
|
||||
children -= 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < children; ++i) {
|
||||
zend_ast *prop_ast = list->child[i];
|
||||
zend_ast *name_ast = prop_ast->child[0];
|
||||
zend_ast *value_ast = prop_ast->child[1];
|
||||
zend_ast *doc_comment_ast = prop_ast->child[2];
|
||||
zend_string *name = zend_ast_get_str(name_ast);
|
||||
zend_string *doc_comment = NULL;
|
||||
zval value_zv;
|
||||
|
||||
/* Doc comment has been appended as last element in ZEND_AST_PROP_ELEM ast */
|
||||
if (doc_comment_ast) {
|
||||
doc_comment = zend_string_copy(zend_ast_get_str(doc_comment_ast));
|
||||
}
|
||||
|
||||
if (flags & ZEND_ACC_FINAL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, "
|
||||
"the final modifier is allowed only for methods and classes",
|
||||
@@ -4952,9 +4956,6 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
|
||||
|
||||
name = zend_new_interned_string_safe(name);
|
||||
zend_declare_property_ex(ce, name, &value_zv, flags, doc_comment);
|
||||
|
||||
/* Doc comment is only assigned to first property */
|
||||
doc_comment = NULL;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -5634,7 +5635,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
if (num > 0) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
|
||||
"the very first statement in the script");
|
||||
"the very first statement or after any declare call in the script");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6214,12 +6215,14 @@ void zend_compile_coalesce(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
void zend_compile_print(znode *result, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_ast *expr_ast = ast->child[0];
|
||||
|
||||
znode expr_node;
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
|
||||
zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
|
||||
opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
|
||||
opline->extended_value = 1;
|
||||
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_LONG(&result->u.constant, 1);
|
||||
@@ -7383,12 +7386,15 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
case ZEND_AST_DIM:
|
||||
{
|
||||
/* constant expression should be always read context ... */
|
||||
|
||||
zval *container, *dim;
|
||||
|
||||
if (ast->child[1] == NULL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (!ast->child[0] || !ast->child[1] || ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7471,10 +7477,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
|
||||
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
|
||||
if (Z_TYPE(result) == IS_NULL) {
|
||||
if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
|
||||
zend_ast_destroy(ast);
|
||||
*ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&class_ast);
|
||||
|
||||
+11
-12
@@ -431,17 +431,17 @@ struct _zend_execute_data {
|
||||
const zend_op *opline; /* executed opline */
|
||||
zend_execute_data *call; /* current call */
|
||||
zval *return_value;
|
||||
zend_function *func; /* executed op_array */
|
||||
zval This;
|
||||
#if ZEND_EX_USE_RUN_TIME_CACHE
|
||||
void **run_time_cache;
|
||||
#endif
|
||||
#if ZEND_EX_USE_LITERALS
|
||||
zval *literals;
|
||||
#endif
|
||||
zend_function *func; /* executed funcrion */
|
||||
zval This; /* this + call_info + num_args */
|
||||
zend_class_entry *called_scope;
|
||||
zend_execute_data *prev_execute_data;
|
||||
zend_array *symbol_table;
|
||||
#if ZEND_EX_USE_RUN_TIME_CACHE
|
||||
void **run_time_cache; /* cache op_array->run_time_cache */
|
||||
#endif
|
||||
#if ZEND_EX_USE_LITERALS
|
||||
zval *literals; /* cache op_array->literals */
|
||||
#endif
|
||||
};
|
||||
|
||||
#define ZEND_CALL_FUNCTION (0 << 0)
|
||||
@@ -698,7 +698,6 @@ void zend_emit_final_return(zval *zv);
|
||||
zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right);
|
||||
uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag);
|
||||
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag);
|
||||
zend_ast *zend_ast_append_doc_comment(zend_ast *list);
|
||||
void zend_handle_encoding_declaration(zend_ast *ast);
|
||||
|
||||
/* parser-driven code generators */
|
||||
@@ -954,9 +953,9 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
|
||||
#define ZEND_ARRAY_SIZE_SHIFT 2
|
||||
|
||||
/* Pseudo-opcodes that are used only temporarily during compilation */
|
||||
#define ZEND_GOTO 253
|
||||
#define ZEND_BRK 254
|
||||
#define ZEND_CONT 255
|
||||
#define ZEND_GOTO 253
|
||||
#define ZEND_BRK 254
|
||||
#define ZEND_CONT 255
|
||||
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
+18
-9
@@ -70,29 +70,38 @@ ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
|
||||
|
||||
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)
|
||||
{
|
||||
zval tmp, *previous, zv, *pzv, rv;
|
||||
zval *previous, *ancestor, *ex;
|
||||
zval pv, zv, rv;
|
||||
zend_class_entry *base_ce;
|
||||
|
||||
if (exception == add_previous || !add_previous || !exception) {
|
||||
return;
|
||||
}
|
||||
ZVAL_OBJ(&tmp, add_previous);
|
||||
if (!instanceof_function(Z_OBJCE(tmp), zend_ce_throwable)) {
|
||||
ZVAL_OBJ(&pv, add_previous);
|
||||
if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
|
||||
return;
|
||||
}
|
||||
ZVAL_OBJ(&zv, exception);
|
||||
pzv = &zv;
|
||||
ex = &zv;
|
||||
do {
|
||||
base_ce = i_get_exception_base(pzv);
|
||||
previous = zend_read_property(base_ce, pzv, "previous", sizeof("previous")-1, 1, &rv);
|
||||
ancestor = zend_read_property(i_get_exception_base(&pv), &pv, "previous", sizeof("previous")-1, 1, &rv);
|
||||
while (Z_TYPE_P(ancestor) == IS_OBJECT) {
|
||||
if (Z_OBJ_P(ancestor) == Z_OBJ_P(ex)) {
|
||||
OBJ_RELEASE(add_previous);
|
||||
return;
|
||||
}
|
||||
ancestor = zend_read_property(i_get_exception_base(ancestor), ancestor, "previous", sizeof("previous")-1, 1, &rv);
|
||||
}
|
||||
base_ce = i_get_exception_base(ex);
|
||||
previous = zend_read_property(base_ce, ex, "previous", sizeof("previous")-1, 1, &rv);
|
||||
if (Z_TYPE_P(previous) == IS_NULL) {
|
||||
zend_update_property(base_ce, pzv, "previous", sizeof("previous")-1, &tmp);
|
||||
zend_update_property(base_ce, ex, "previous", sizeof("previous")-1, &pv);
|
||||
GC_REFCOUNT(add_previous)--;
|
||||
return;
|
||||
}
|
||||
pzv = previous;
|
||||
} while (pzv && Z_OBJ_P(pzv) != add_previous);
|
||||
ex = previous;
|
||||
} while (Z_OBJ_P(ex) != add_previous);
|
||||
}
|
||||
|
||||
void zend_exception_save(void) /* {{{ */
|
||||
|
||||
+20
-14
@@ -893,7 +893,7 @@ static zend_always_inline int zend_verify_missing_arg_type(zend_function *zf, ui
|
||||
return 1;
|
||||
}
|
||||
|
||||
static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
static ZEND_COLD void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
{
|
||||
if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
|
||||
UNEXPECTED(zend_verify_missing_arg_type(EX(func), arg_num, cache_slot))) {
|
||||
@@ -907,9 +907,7 @@ static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, ui
|
||||
} else {
|
||||
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
|
||||
@@ -1451,8 +1449,8 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object, z
|
||||
|
||||
ZVAL_OBJ(&obj, Z_OBJ_P(object));
|
||||
Z_ADDREF(obj);
|
||||
if (Z_OBJ_HT(obj)->read_property &&
|
||||
(z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv)) != NULL) {
|
||||
if (EXPECTED(Z_OBJ_HT(obj)->read_property)) {
|
||||
z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
OBJ_RELEASE(Z_OBJ(obj));
|
||||
return;
|
||||
@@ -1557,7 +1555,8 @@ num_index:
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined offset: " ZEND_LONG_FMT, hval);
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_index_update(ht, hval, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -1605,7 +1604,8 @@ str_index:
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined index: %s", ZSTR_VAL(offset_key));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(ht, offset_key, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(ht, offset_key, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -1964,8 +1964,8 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
||||
if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) {
|
||||
zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot);
|
||||
if (NULL == ptr) {
|
||||
if (Z_OBJ_HT_P(container)->read_property &&
|
||||
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result)) != NULL) {
|
||||
if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
|
||||
ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result);
|
||||
if (ptr != result) {
|
||||
ZVAL_INDIRECT(result, ptr);
|
||||
} else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) {
|
||||
@@ -2418,9 +2418,8 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
|
||||
static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t op_num) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
if (UNEXPECTED(EX(call))) {
|
||||
zend_execute_data *call = EX(call);
|
||||
zend_op *opline = EX(func)->op_array.opcodes + op_num;
|
||||
@@ -2543,6 +2542,12 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
|
||||
call = EX(call);
|
||||
} while (call);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < EX(func)->op_array.last_brk_cont; i++) {
|
||||
const zend_brk_cont_element *brk_cont = &EX(func)->op_array.brk_cont_array[i];
|
||||
@@ -2592,7 +2597,8 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
|
||||
/* }}} */
|
||||
|
||||
void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) {
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GCC_GLOBAL_REGS
|
||||
@@ -2734,9 +2740,9 @@ ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_n
|
||||
return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot);
|
||||
}
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
{
|
||||
return zend_verify_missing_arg(execute_data, arg_num, cache_slot);
|
||||
zend_verify_missing_arg(execute_data, arg_num, cache_slot);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
|
||||
|
||||
ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg);
|
||||
ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot);
|
||||
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
|
||||
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
|
||||
|
||||
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce,
|
||||
if (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) {
|
||||
zend_throw_error(exception_ce, message);
|
||||
} else {
|
||||
zend_error(E_ERROR, message);
|
||||
zend_error(E_ERROR, "%s", message);
|
||||
}
|
||||
|
||||
efree(message);
|
||||
@@ -839,15 +839,16 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
}
|
||||
Z_OBJ(call->This) = fci->object;
|
||||
|
||||
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
|
||||
ZEND_ASSERT(GC_TYPE((zend_object*)func->op_array.prototype) == IS_OBJECT);
|
||||
GC_REFCOUNT((zend_object*)func->op_array.prototype)++;
|
||||
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE);
|
||||
}
|
||||
|
||||
if (func->type == ZEND_USER_FUNCTION) {
|
||||
int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0;
|
||||
EG(scope) = func->common.scope;
|
||||
call->symbol_table = fci->symbol_table;
|
||||
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
|
||||
ZEND_ASSERT(GC_TYPE((zend_object*)func->op_array.prototype) == IS_OBJECT);
|
||||
GC_REFCOUNT((zend_object*)func->op_array.prototype)++;
|
||||
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE);
|
||||
}
|
||||
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
|
||||
zend_init_execute_data(call, &func->op_array, fci->retval);
|
||||
zend_execute_ex(call);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/* The first number is the engine version and the rest is the date (YYYYMMDD).
|
||||
* This way engine 2/3 API no. is always greater than engine 1 API no..
|
||||
*/
|
||||
#define ZEND_EXTENSION_API_NO 320140815
|
||||
#define ZEND_EXTENSION_API_NO 320151012
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
|
||||
@@ -242,6 +242,13 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
|
||||
GC_REFCOUNT(ref)++;
|
||||
gc_collect_cycles();
|
||||
GC_REFCOUNT(ref)--;
|
||||
if (UNEXPECTED(GC_REFCOUNT(ref)) == 0) {
|
||||
zval_dtor_func_for_ptr(ref);
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(GC_INFO(ref))) {
|
||||
return;
|
||||
}
|
||||
newRoot = GC_G(unused);
|
||||
if (!newRoot) {
|
||||
#if ZEND_GC_DEBUG
|
||||
|
||||
+35
-25
@@ -65,12 +65,6 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
|
||||
|
||||
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
|
||||
{
|
||||
zval_ptr_dtor(&generator->value);
|
||||
ZVAL_UNDEF(&generator->value);
|
||||
|
||||
zval_ptr_dtor(&generator->key);
|
||||
ZVAL_UNDEF(&generator->key);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
@@ -170,6 +164,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
|
||||
|
||||
zend_generator_close(generator, 0);
|
||||
|
||||
/* we can't immediately free them in zend_generator_close() else yield from won't be able to fetch it */
|
||||
zval_ptr_dtor(&generator->value);
|
||||
zval_ptr_dtor(&generator->key);
|
||||
|
||||
if (EXPECTED(!Z_ISUNDEF(generator->retval))) {
|
||||
zval_ptr_dtor(&generator->retval);
|
||||
}
|
||||
@@ -289,6 +287,12 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
|
||||
|
||||
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
|
||||
{
|
||||
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
|
||||
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
}
|
||||
|
||||
/* Throw the exception in the context of the generator. Decrementing the opline
|
||||
* to pretend the exception happened during the YIELD opcode. */
|
||||
zend_execute_data *original_execute_data = EG(current_execute_data);
|
||||
@@ -508,6 +512,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
|
||||
|
||||
EG(current_execute_data) = original_execute_data;
|
||||
} else {
|
||||
ZVAL_COPY(&root->value, &root->node.parent->value);
|
||||
ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
|
||||
}
|
||||
}
|
||||
@@ -568,7 +573,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
if (iter->index++ > 0) {
|
||||
iter->funcs->move_forward(iter);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
goto failure;
|
||||
goto exception;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +583,9 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
}
|
||||
|
||||
value = iter->funcs->get_current_data(iter);
|
||||
if (UNEXPECTED(EG(exception) != NULL || !value)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
goto exception;
|
||||
} else if (UNEXPECTED(!value)) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -590,7 +597,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
iter->funcs->get_current_key(iter, &generator->key);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZVAL_UNDEF(&generator->key);
|
||||
goto failure;
|
||||
goto exception;
|
||||
}
|
||||
} else {
|
||||
ZVAL_LONG(&generator->key, iter->index);
|
||||
@@ -598,6 +605,13 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
exception: {
|
||||
zend_execute_data *ex = EG(current_execute_data);
|
||||
EG(current_execute_data) = generator->execute_data;
|
||||
zend_throw_exception_internal(NULL);
|
||||
EG(current_execute_data) = ex;
|
||||
}
|
||||
|
||||
failure:
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
@@ -622,6 +636,11 @@ try_again:
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0 && !Z_ISUNDEF(generator->value))) {
|
||||
/* We must not advance Generator if we yield from a Generator being currently run */
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!Z_ISUNDEF(generator->values))) {
|
||||
if (EXPECTED(zend_generator_get_next_delegated_value(generator) == SUCCESS)) {
|
||||
return;
|
||||
@@ -630,11 +649,6 @@ try_again:
|
||||
* after the "yield from" expression. */
|
||||
}
|
||||
|
||||
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0) && !Z_ISUNDEF(generator->value)) {
|
||||
/* We must not advance Generator if we yield from a Generator being currently run */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Drop the AT_FIRST_YIELD flag */
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
|
||||
|
||||
@@ -708,7 +722,7 @@ try_again:
|
||||
|
||||
static void inline zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
|
||||
{
|
||||
if (EXPECTED(generator->execute_data) && UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->node.parent == NULL)) {
|
||||
if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) {
|
||||
generator->flags |= ZEND_GENERATOR_DO_INIT;
|
||||
zend_generator_resume(generator);
|
||||
generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
@@ -759,7 +773,7 @@ ZEND_METHOD(Generator, valid)
|
||||
|
||||
zend_generator_get_current(generator);
|
||||
|
||||
RETURN_BOOL(EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL));
|
||||
RETURN_BOOL(EXPECTED(generator->execute_data != NULL));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -778,7 +792,7 @@ ZEND_METHOD(Generator, current)
|
||||
zend_generator_ensure_initialized(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -802,7 +816,7 @@ ZEND_METHOD(Generator, key)
|
||||
zend_generator_ensure_initialized(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->key) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->key) != IS_UNDEF)) {
|
||||
zval *key = &root->key;
|
||||
|
||||
ZVAL_DEREF(key);
|
||||
@@ -865,7 +879,7 @@ ZEND_METHOD(Generator, send)
|
||||
zend_generator_resume(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data)) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -905,7 +919,7 @@ ZEND_METHOD(Generator, throw)
|
||||
zend_generator_resume(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (Z_TYPE(root->value) != IS_UNDEF) {
|
||||
if (generator->execute_data) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -982,11 +996,7 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{
|
||||
|
||||
zend_generator_get_current(generator);
|
||||
|
||||
if (EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL)) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
return generator->execute_data ? SUCCESS : FAILURE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+50
-11
@@ -112,7 +112,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize)
|
||||
rather than using an undefined bis scan result. */
|
||||
return nSize;
|
||||
}
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_clz)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
|
||||
return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f);
|
||||
#else
|
||||
nSize -= 1;
|
||||
@@ -283,6 +283,40 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t zend_array_recalc_elements(HashTable *ht)
|
||||
{
|
||||
zval *val;
|
||||
uint32_t num = ht->nNumOfElements;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(ht, val) {
|
||||
if (Z_TYPE_P(val) == IS_UNDEF) continue;
|
||||
if (Z_TYPE_P(val) == IS_INDIRECT) {
|
||||
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
|
||||
num--;
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
return num;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API uint32_t zend_array_count(HashTable *ht)
|
||||
{
|
||||
uint32_t num;
|
||||
if (UNEXPECTED(ht->u.v.flags & HASH_FLAG_HAS_EMPTY_IND)) {
|
||||
num = zend_array_recalc_elements(ht);
|
||||
if (UNEXPECTED(ht->nNumOfElements == num)) {
|
||||
ht->u.v.flags &= ~HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else if (UNEXPECTED(ht == &EG(symbol_table))) {
|
||||
num = zend_array_recalc_elements(ht);
|
||||
} else {
|
||||
num = zend_hash_num_elements(ht);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
|
||||
{
|
||||
if (bApplyProtection) {
|
||||
@@ -1049,9 +1083,14 @@ ZEND_API int ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key)
|
||||
return FAILURE;
|
||||
} else {
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(data);
|
||||
zval tmp;
|
||||
ZVAL_COPY_VALUE(&tmp, data);
|
||||
ZVAL_UNDEF(data);
|
||||
ht->pDestructor(&tmp);
|
||||
} else {
|
||||
ZVAL_UNDEF(data);
|
||||
}
|
||||
ZVAL_UNDEF(data);
|
||||
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else {
|
||||
_zend_hash_del_el_ex(ht, idx, p, prev);
|
||||
@@ -1095,6 +1134,7 @@ ZEND_API int ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *str,
|
||||
ht->pDestructor(data);
|
||||
}
|
||||
ZVAL_UNDEF(data);
|
||||
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else {
|
||||
_zend_hash_del_el_ex(ht, idx, p, prev);
|
||||
@@ -1454,8 +1494,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
|
||||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val);
|
||||
|
||||
@@ -1480,8 +1520,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
|
||||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val, argument);
|
||||
|
||||
@@ -1509,8 +1549,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
va_start(args, num_args);
|
||||
hash_key.h = p->h;
|
||||
@@ -1543,10 +1583,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
idx = ht->nNumUsed;
|
||||
p = ht->arData + idx;
|
||||
while (idx > 0) {
|
||||
idx--;
|
||||
p--;
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
|
||||
result = apply_func(&p->val);
|
||||
|
||||
@@ -216,6 +216,7 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
|
||||
|
||||
ZEND_API uint32_t zend_array_count(HashTable *ht);
|
||||
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
|
||||
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
|
||||
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
|
||||
|
||||
@@ -106,16 +106,19 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (Z_TYPE_P(op1) != IS_STRING) {
|
||||
zend_string *str = zval_get_string(op1);
|
||||
ZVAL_PSTRINGL(op1, str->val, str->len);
|
||||
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
|
||||
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
|
||||
zend_string_release(str);
|
||||
}
|
||||
|
||||
op1_len = (int)Z_STRLEN_P(op1);
|
||||
|
||||
if (Z_TYPE_P(op2) != IS_STRING) {
|
||||
convert_to_string(op2);
|
||||
}
|
||||
length = op1_len + (int)Z_STRLEN_P(op2);
|
||||
|
||||
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
|
||||
memcpy(Z_STRVAL_P(result)+op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
Z_STRVAL_P(result)[length] = 0;
|
||||
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
while (yyleng) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
@@ -125,7 +125,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
while (yyleng && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
|
||||
@@ -112,7 +112,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
while (yyleng) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
@@ -123,7 +123,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
while (yyleng && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
|
||||
+49
-32
@@ -700,7 +700,7 @@ class_statement_list:
|
||||
|
||||
class_statement:
|
||||
variable_modifiers property_list ';'
|
||||
{ $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
|
||||
{ $$ = $2; $$->attr = $1; }
|
||||
| T_CONST class_const_list ';'
|
||||
{ $$ = $2; RESET_DOC_COMMENT(); }
|
||||
| T_USE name_list trait_adaptations
|
||||
@@ -798,9 +798,10 @@ property_list:
|
||||
;
|
||||
|
||||
property:
|
||||
T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
|
||||
| T_VARIABLE '=' expr
|
||||
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
|
||||
T_VARIABLE backup_doc_comment
|
||||
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL, ($2 ? zend_ast_create_zval_from_str($2) : NULL)); }
|
||||
| T_VARIABLE '=' expr backup_doc_comment
|
||||
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3, ($4 ? zend_ast_create_zval_from_str($4) : NULL)); }
|
||||
;
|
||||
|
||||
class_const_list:
|
||||
@@ -1277,50 +1278,66 @@ isset_variable:
|
||||
would have been. */
|
||||
static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
|
||||
{
|
||||
if (!yyres) {
|
||||
return yystrlen(yystr);
|
||||
/* CG(parse_error) states:
|
||||
* 0 => yyres = NULL, yystr is the unexpected token
|
||||
* 1 => yyres = NULL, yystr is one of the expected tokens
|
||||
* 2 => yyres != NULL, yystr is the unexpected token
|
||||
* 3 => yyres != NULL, yystr is one of the expected tokens
|
||||
*/
|
||||
if (yyres && CG(parse_error) < 2) {
|
||||
CG(parse_error) = 2;
|
||||
}
|
||||
{
|
||||
if (CG(parse_error) == 0) {
|
||||
char buffer[120];
|
||||
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
|
||||
unsigned int len = 0, toklen = 0, yystr_len;
|
||||
|
||||
CG(parse_error) = 1;
|
||||
if (CG(parse_error) % 2 == 0) {
|
||||
/* The unexpected token */
|
||||
char buffer[120];
|
||||
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
|
||||
unsigned int len = 0, toklen = 0, yystr_len;
|
||||
|
||||
if (LANG_SCNG(yy_text)[0] == 0 &&
|
||||
LANG_SCNG(yy_leng) == 1 &&
|
||||
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
|
||||
CG(parse_error)++;
|
||||
|
||||
if (LANG_SCNG(yy_text)[0] == 0 &&
|
||||
LANG_SCNG(yy_leng) == 1 &&
|
||||
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
|
||||
if (yyres) {
|
||||
yystpcpy(yyres, "end of file");
|
||||
return sizeof("end of file")-1;
|
||||
}
|
||||
return sizeof("end of file")-1;
|
||||
}
|
||||
|
||||
str = LANG_SCNG(yy_text);
|
||||
end = memchr(str, '\n', LANG_SCNG(yy_leng));
|
||||
yystr_len = (unsigned int)yystrlen(yystr);
|
||||
str = LANG_SCNG(yy_text);
|
||||
end = memchr(str, '\n', LANG_SCNG(yy_leng));
|
||||
yystr_len = (unsigned int)yystrlen(yystr);
|
||||
|
||||
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
|
||||
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
|
||||
toklen = (tok2 - tok1) + 1;
|
||||
} else {
|
||||
tok1 = tok2 = NULL;
|
||||
toklen = 0;
|
||||
}
|
||||
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
|
||||
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
|
||||
toklen = (tok2 - tok1) + 1;
|
||||
} else {
|
||||
tok1 = tok2 = NULL;
|
||||
toklen = 0;
|
||||
}
|
||||
|
||||
if (end == NULL) {
|
||||
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
|
||||
} else {
|
||||
len = (end - str) > 30 ? 30 : (end - str);
|
||||
}
|
||||
if (end == NULL) {
|
||||
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
|
||||
} else {
|
||||
len = (end - str) > 30 ? 30 : (end - str);
|
||||
}
|
||||
if (yyres) {
|
||||
if (toklen) {
|
||||
snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
|
||||
} else {
|
||||
snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
|
||||
}
|
||||
yystpcpy(yyres, buffer);
|
||||
return len + (toklen ? toklen + 1 : 0) + 2;
|
||||
}
|
||||
return len + (toklen ? toklen + 1 : 0) + 2;
|
||||
}
|
||||
|
||||
/* One of the expected tokens */
|
||||
if (!yyres) {
|
||||
return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
|
||||
}
|
||||
|
||||
if (*yystr == '"') {
|
||||
YYSIZE_T yyn = 0;
|
||||
const char *yyp = yystr;
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ static void zend_resource_dtor(zend_resource *res)
|
||||
ZEND_API int zend_list_close(zend_resource *res)
|
||||
{
|
||||
if (GC_REFCOUNT(res) <= 0) {
|
||||
return zend_list_delete(res);
|
||||
return zend_list_free(res);
|
||||
} else if (res->type >= 0) {
|
||||
zend_resource_dtor(res);
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
|
||||
|
||||
#define ZEND_MODULE_API_NO 20141001
|
||||
#define ZEND_MODULE_API_NO 20151012
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
@@ -275,10 +275,10 @@ static zend_always_inline int zend_verify_property_access(zend_property_info *pr
|
||||
return 1;
|
||||
} else if (property_info->flags & ZEND_ACC_PRIVATE) {
|
||||
return (ce == EG(scope) || property_info->ce == EG(scope));
|
||||
} else {
|
||||
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
|
||||
} else if (property_info->flags & ZEND_ACC_PROTECTED) {
|
||||
return zend_check_protected(property_info->ce, EG(scope));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -494,7 +494,6 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
|
||||
{
|
||||
HashTable *guards;
|
||||
zend_long stub, *guard;
|
||||
zval tmp;
|
||||
|
||||
ZEND_ASSERT(GC_FLAGS(zobj) & IS_OBJ_USE_GUARDS);
|
||||
if (GC_FLAGS(zobj) & IS_OBJ_HAS_GUARDS) {
|
||||
@@ -506,7 +505,6 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
|
||||
} else {
|
||||
ALLOC_HASHTABLE(guards);
|
||||
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
|
||||
ZVAL_PTR(&tmp, guards);
|
||||
Z_PTR(zobj->properties_table[zobj->ce->default_properties_count]) = guards;
|
||||
GC_FLAGS(zobj) |= IS_OBJ_HAS_GUARDS;
|
||||
}
|
||||
@@ -1528,9 +1526,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
|
||||
if (ce->__tostring &&
|
||||
(zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zval *msg, ex, rv;
|
||||
zval_ptr_dtor(&retval);
|
||||
ZVAL_OBJ(&ex, EG(exception));
|
||||
EG(exception) = NULL;
|
||||
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ZSTR_VAL(ce->name));
|
||||
msg = zend_read_property(Z_OBJCE(ex), &ex, "message", sizeof("message") - 1, 1, &rv);
|
||||
if (UNEXPECTED(Z_TYPE_P(msg) != IS_STRING)) {
|
||||
ZVAL_EMPTY_STRING(&rv);
|
||||
msg = &rv;
|
||||
}
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"Method %s::__toString() must not throw an exception, caught %s: %s",
|
||||
ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg));
|
||||
return FAILURE;
|
||||
}
|
||||
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
|
||||
|
||||
+11
-3
@@ -492,7 +492,15 @@ try_again:
|
||||
|
||||
ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
|
||||
{
|
||||
_convert_to_string(op ZEND_FILE_LINE_CC);
|
||||
if (Z_TYPE_P(op) == IS_DOUBLE) {
|
||||
zend_string *str;
|
||||
double dval = Z_DVAL_P(op);
|
||||
|
||||
str = zend_strpprintf(0, "%.*H", (int) EG(precision), dval);
|
||||
ZVAL_NEW_STR(op, str);
|
||||
} else {
|
||||
_convert_to_string(op ZEND_FILE_LINE_CC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2269,7 +2277,7 @@ try_again:
|
||||
zval *val;
|
||||
|
||||
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
|
||||
Z_ADDREF_P(val);
|
||||
Z_TRY_ADDREF_P(val);
|
||||
increment_function(val);
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, val);
|
||||
zval_ptr_dtor(val);
|
||||
@@ -2337,7 +2345,7 @@ try_again:
|
||||
zval *val;
|
||||
|
||||
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
|
||||
Z_ADDREF_P(val);
|
||||
Z_TRY_ADDREF_P(val);
|
||||
decrement_function(val);
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, val);
|
||||
zval_ptr_dtor(val);
|
||||
|
||||
@@ -757,7 +757,7 @@ static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op
|
||||
int ret; \
|
||||
zval rv; \
|
||||
zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv); \
|
||||
Z_ADDREF_P(objval); \
|
||||
Z_TRY_ADDREF_P(objval); \
|
||||
ret = binary_op(objval, objval, op2); \
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, objval); \
|
||||
zval_ptr_dtor(objval); \
|
||||
|
||||
@@ -459,6 +459,9 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
}
|
||||
}
|
||||
#else
|
||||
#ifdef ZEND_WIN32
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
@@ -1563,6 +1566,20 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
{
|
||||
mode_t _tmp = mode;
|
||||
|
||||
mode = 0;
|
||||
|
||||
if (_tmp & _S_IREAD) {
|
||||
mode |= _S_IREAD;
|
||||
}
|
||||
if (_tmp & _S_IWRITE) {
|
||||
mode |= _S_IWRITE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ret = chmod(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
|
||||
+32
-32
@@ -328,12 +328,9 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
@@ -349,12 +346,9 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
|
||||
@@ -1565,7 +1559,8 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -3107,8 +3102,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -4713,9 +4708,8 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
|
||||
|
||||
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
|
||||
|
||||
@@ -5519,8 +5513,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -7124,11 +7124,12 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
}
|
||||
}
|
||||
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
|
||||
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
|
||||
cleanup_live_vars(execute_data, op_num, finally_op_num);
|
||||
if (in_finally && Z_OBJ_P(fast_call)) {
|
||||
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
|
||||
}
|
||||
@@ -7138,6 +7139,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
if (in_finally) {
|
||||
/* we are going out of current finally scope */
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
@@ -7176,14 +7178,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
opline = EX(opline);
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@@ -7196,13 +7194,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
@@ -7564,20 +7559,25 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
EG(exception) = Z_OBJ_P(fast_call);
|
||||
Z_OBJ_P(fast_call) = NULL;
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+186
-220
@@ -1204,9 +1204,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_
|
||||
|
||||
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
|
||||
|
||||
@@ -1515,11 +1514,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
|
||||
}
|
||||
}
|
||||
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
|
||||
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
|
||||
cleanup_live_vars(execute_data, op_num, finally_op_num);
|
||||
if (in_finally && Z_OBJ_P(fast_call)) {
|
||||
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
|
||||
}
|
||||
@@ -1529,6 +1529,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
if (in_finally) {
|
||||
/* we are going out of current finally scope */
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
@@ -1567,14 +1568,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
opline = EX(opline);
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@@ -1587,13 +1584,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
@@ -1647,20 +1641,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
EG(exception) = Z_OBJ_P(fast_call);
|
||||
Z_OBJ_P(fast_call) = NULL;
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4596,12 +4595,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -4617,12 +4613,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CO
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -5024,7 +5017,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -5698,8 +5692,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -6118,8 +6112,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HAN
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -6645,12 +6645,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6666,12 +6663,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TM
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6828,12 +6822,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6849,12 +6840,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VA
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -6945,7 +6933,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -7058,8 +7047,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDL
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -7441,7 +7436,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -7671,8 +7667,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -7917,8 +7913,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -8537,12 +8539,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HAN
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -8558,12 +8557,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -9414,8 +9410,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -11222,8 +11218,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -12570,12 +12566,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -12591,12 +12584,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13125,12 +13115,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13146,12 +13133,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13308,12 +13292,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13329,12 +13310,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13861,12 +13839,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13882,12 +13857,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -16411,12 +16383,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -16432,12 +16401,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -17581,8 +17547,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -18153,12 +18119,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18174,12 +18137,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18365,12 +18325,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18386,12 +18343,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19221,8 +19175,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -19619,12 +19573,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19640,12 +19591,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -20848,8 +20796,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -22418,8 +22366,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -30097,12 +30045,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -30118,12 +30063,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -31092,7 +31034,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -32210,8 +32153,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLE
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -32977,12 +32926,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -32998,12 +32944,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -33188,12 +33131,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -33209,12 +33149,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -33305,7 +33242,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -33505,8 +33443,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -34242,7 +34186,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -34734,8 +34679,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDL
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -35332,12 +35283,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLE
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -35353,12 +35301,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HA
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -41434,7 +41379,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -41944,8 +41890,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HA
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -42415,7 +42367,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -42528,8 +42481,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HAND
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -42816,7 +42775,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
|
||||
/* break missing intentionally */
|
||||
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -42929,8 +42889,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_H
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
|
||||
@@ -3050,3 +3050,57 @@ AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CLZ
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
|
||||
AC_MSG_CHECKING([for __builtin_clz])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_clz(1) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_clz=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_clz=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CTZL
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
|
||||
AC_MSG_CHECKING([for __builtin_ctzl])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_ctzl(2L) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_ctzl=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_ctzl=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CTZLL
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
|
||||
AC_MSG_CHECKING([for __builtin_ctzll])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_ctzll(2LL) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_ctzll=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_ctzll=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
|
||||
|
||||
])
|
||||
+4
-2
@@ -4,7 +4,9 @@
|
||||
|
||||
dir=$1; shift
|
||||
for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do
|
||||
echo "config_m4_src=$stubfile
|
||||
config_m4_dir=`dirname $stubfile`
|
||||
echo "dnl Define where extension directories are located in the configure context
|
||||
AC_DEFUN([PHP_EXT_BUILDDIR], [`dirname $stubfile`])
|
||||
AC_DEFUN([PHP_EXT_DIR], [`dirname $stubfile`])
|
||||
AC_DEFUN([PHP_EXT_SRCDIR], [\$abs_srcdir/`dirname $stubfile`])
|
||||
sinclude($stubfile)"
|
||||
done
|
||||
+8
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="RC4"
|
||||
PHP_RELEASE_VERSION=1
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -577,6 +577,12 @@ PHP_CHECK_STDINT_TYPES
|
||||
|
||||
dnl Check __builtin_expect
|
||||
PHP_CHECK_BUILTIN_EXPECT
|
||||
dnl Check __builtin_clz
|
||||
PHP_CHECK_BUILTIN_CLZ
|
||||
dnl Check __builtin_ctzl
|
||||
PHP_CHECK_BUILTIN_CTZL
|
||||
dnl Check __builtin_ctzll
|
||||
PHP_CHECK_BUILTIN_CTZLL
|
||||
|
||||
dnl Check for members of the stat structure
|
||||
AC_STRUCT_ST_BLKSIZE
|
||||
|
||||
@@ -9,6 +9,8 @@ if (!extension_loaded('curl')) exit("skip curl extension not loaded");
|
||||
$curl = curl_init("http://www.google.com");
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_PRIVATE, "123");
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
|
||||
curl_exec($curl);
|
||||
|
||||
var_dump(curl_getinfo($curl, CURLINFO_PRIVATE));
|
||||
|
||||
@@ -15,7 +15,9 @@ var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_UPLOAD => true,
|
||||
CURLOPT_INFILE => $f,
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__)
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__),
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1,
|
||||
]));
|
||||
fclose($f);
|
||||
var_dump(curl_setopt_array($c, [
|
||||
|
||||
@@ -17,7 +17,9 @@ curl_setopt_array($ch, array(
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Length: 1',
|
||||
),
|
||||
CURLOPT_READFUNCTION => 'curl_read'
|
||||
CURLOPT_READFUNCTION => 'curl_read',
|
||||
CURLOPT_CONNECTTIMEOUT=> 1,
|
||||
CURLOPT_TIMEOUT=>1
|
||||
));
|
||||
|
||||
function curl_read($ch, $fp, $len) {
|
||||
|
||||
@@ -18,7 +18,9 @@ curl_setopt_array($ch, array(
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Length: 1',
|
||||
),
|
||||
CURLOPT_READFUNCTION => 'curl_read'
|
||||
CURLOPT_READFUNCTION => 'curl_read',
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1
|
||||
));
|
||||
|
||||
function curl_read($ch, $fp, $len) {
|
||||
|
||||
+98
-98
@@ -1,5 +1,5 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Aug 13 10:30:11 2015 */
|
||||
#line 1 "parse_date.re"
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@@ -820,11 +820,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 946 "parse_date.re"
|
||||
#line 946 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 828 "<stdout>"
|
||||
#line 828 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -964,7 +964,7 @@ yy2:
|
||||
}
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
#line 1626 "parse_date.re"
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -977,7 +977,7 @@ yy3:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 981 "<stdout>"
|
||||
#line 981 "ext/date/lib/parse_date.c"
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1288,12 +1288,12 @@ yy11:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy12:
|
||||
YYDEBUG(12, *YYCURSOR);
|
||||
#line 1721 "parse_date.re"
|
||||
#line 1721 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1297 "<stdout>"
|
||||
#line 1297 "ext/date/lib/parse_date.c"
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2350,11 +2350,11 @@ yy48:
|
||||
if (yych <= '9') goto yy54;
|
||||
yy49:
|
||||
YYDEBUG(49, *YYCURSOR);
|
||||
#line 1710 "parse_date.re"
|
||||
#line 1710 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2358 "<stdout>"
|
||||
#line 2358 "ext/date/lib/parse_date.c"
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2363,12 +2363,12 @@ yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
#line 1715 "parse_date.re"
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2372 "<stdout>"
|
||||
#line 2372 "ext/date/lib/parse_date.c"
|
||||
yy53:
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2755,7 +2755,7 @@ yy71:
|
||||
if (yych == 's') goto yy73;
|
||||
yy72:
|
||||
YYDEBUG(72, *YYCURSOR);
|
||||
#line 1694 "parse_date.re"
|
||||
#line 1694 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2770,7 +2770,7 @@ yy72:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2774 "<stdout>"
|
||||
#line 2774 "ext/date/lib/parse_date.c"
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3532,7 +3532,7 @@ yy165:
|
||||
}
|
||||
yy166:
|
||||
YYDEBUG(166, *YYCURSOR);
|
||||
#line 1557 "parse_date.re"
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3549,7 +3549,7 @@ yy166:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3553 "<stdout>"
|
||||
#line 3553 "ext/date/lib/parse_date.c"
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4069,7 +4069,7 @@ yy192:
|
||||
}
|
||||
yy193:
|
||||
YYDEBUG(193, *YYCURSOR);
|
||||
#line 1616 "parse_date.re"
|
||||
#line 1616 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4078,7 +4078,7 @@ yy193:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4082 "<stdout>"
|
||||
#line 4082 "ext/date/lib/parse_date.c"
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4129,7 +4129,7 @@ yy197:
|
||||
}
|
||||
yy198:
|
||||
YYDEBUG(198, *YYCURSOR);
|
||||
#line 1362 "parse_date.re"
|
||||
#line 1362 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4142,7 +4142,7 @@ yy198:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4146 "<stdout>"
|
||||
#line 4146 "ext/date/lib/parse_date.c"
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4411,7 +4411,7 @@ yy221:
|
||||
}
|
||||
yy222:
|
||||
YYDEBUG(222, *YYCURSOR);
|
||||
#line 1664 "parse_date.re"
|
||||
#line 1664 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4440,7 +4440,7 @@ yy222:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4444 "<stdout>"
|
||||
#line 4444 "ext/date/lib/parse_date.c"
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5138,7 +5138,7 @@ yy277:
|
||||
YYDEBUG(277, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
#line 1640 "parse_date.re"
|
||||
#line 1640 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5161,7 +5161,7 @@ yy277:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5165 "<stdout>"
|
||||
#line 5165 "ext/date/lib/parse_date.c"
|
||||
yy279:
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5339,7 +5339,7 @@ yy293:
|
||||
++YYCURSOR;
|
||||
yy294:
|
||||
YYDEBUG(294, *YYCURSOR);
|
||||
#line 1334 "parse_date.re"
|
||||
#line 1334 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5352,7 +5352,7 @@ yy294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5356 "<stdout>"
|
||||
#line 5356 "ext/date/lib/parse_date.c"
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6572,7 +6572,7 @@ yy361:
|
||||
if (yych <= '9') goto yy364;
|
||||
yy363:
|
||||
YYDEBUG(363, *YYCURSOR);
|
||||
#line 1478 "parse_date.re"
|
||||
#line 1478 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6585,7 +6585,7 @@ yy363:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6589 "<stdout>"
|
||||
#line 6589 "ext/date/lib/parse_date.c"
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7223,7 +7223,7 @@ yy391:
|
||||
}
|
||||
yy392:
|
||||
YYDEBUG(392, *YYCURSOR);
|
||||
#line 1536 "parse_date.re"
|
||||
#line 1536 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7243,7 +7243,7 @@ yy392:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7247 "<stdout>"
|
||||
#line 7247 "ext/date/lib/parse_date.c"
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -8993,7 +8993,7 @@ yy453:
|
||||
++YYCURSOR;
|
||||
yy454:
|
||||
YYDEBUG(454, *YYCURSOR);
|
||||
#line 1239 "parse_date.re"
|
||||
#line 1239 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9004,7 +9004,7 @@ yy454:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9008 "<stdout>"
|
||||
#line 9008 "ext/date/lib/parse_date.c"
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9564,7 +9564,7 @@ yy474:
|
||||
}
|
||||
yy475:
|
||||
YYDEBUG(475, *YYCURSOR);
|
||||
#line 1376 "parse_date.re"
|
||||
#line 1376 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9575,7 +9575,7 @@ yy475:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9579 "<stdout>"
|
||||
#line 9579 "ext/date/lib/parse_date.c"
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9716,7 +9716,7 @@ yy487:
|
||||
YYDEBUG(487, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
#line 1094 "parse_date.re"
|
||||
#line 1094 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9732,7 +9732,7 @@ yy487:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9736 "<stdout>"
|
||||
#line 9736 "ext/date/lib/parse_date.c"
|
||||
yy489:
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9745,7 +9745,7 @@ yy489:
|
||||
}
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
#line 1131 "parse_date.re"
|
||||
#line 1131 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9770,7 +9770,7 @@ yy490:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9774 "<stdout>"
|
||||
#line 9774 "ext/date/lib/parse_date.c"
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10080,7 +10080,7 @@ yy522:
|
||||
YYDEBUG(522, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
#line 1111 "parse_date.re"
|
||||
#line 1111 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10099,7 +10099,7 @@ yy522:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10103 "<stdout>"
|
||||
#line 10103 "ext/date/lib/parse_date.c"
|
||||
yy524:
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10205,7 +10205,7 @@ yy533:
|
||||
if (yych <= '9') goto yy540;
|
||||
yy534:
|
||||
YYDEBUG(534, *YYCURSOR);
|
||||
#line 1293 "parse_date.re"
|
||||
#line 1293 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -10219,7 +10219,7 @@ yy534:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10223 "<stdout>"
|
||||
#line 10223 "ext/date/lib/parse_date.c"
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -10956,7 +10956,7 @@ yy604:
|
||||
YYDEBUG(605, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
#line 1308 "parse_date.re"
|
||||
#line 1308 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -10967,7 +10967,7 @@ yy604:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 10971 "<stdout>"
|
||||
#line 10971 "ext/date/lib/parse_date.c"
|
||||
yy607:
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11003,7 +11003,7 @@ yy610:
|
||||
if (yych <= '9') goto yy604;
|
||||
yy611:
|
||||
YYDEBUG(611, *YYCURSOR);
|
||||
#line 1320 "parse_date.re"
|
||||
#line 1320 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11016,7 +11016,7 @@ yy611:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11020 "<stdout>"
|
||||
#line 11020 "ext/date/lib/parse_date.c"
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11657,7 +11657,7 @@ yy655:
|
||||
}
|
||||
yy656:
|
||||
YYDEBUG(656, *YYCURSOR);
|
||||
#line 1279 "parse_date.re"
|
||||
#line 1279 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11670,7 +11670,7 @@ yy656:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11674 "<stdout>"
|
||||
#line 11674 "ext/date/lib/parse_date.c"
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11776,7 +11776,7 @@ yy665:
|
||||
}
|
||||
yy666:
|
||||
YYDEBUG(666, *YYCURSOR);
|
||||
#line 1223 "parse_date.re"
|
||||
#line 1223 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11791,7 +11791,7 @@ yy666:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11795 "<stdout>"
|
||||
#line 11795 "ext/date/lib/parse_date.c"
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12024,7 +12024,7 @@ yy699:
|
||||
if (yych <= ':') goto yy703;
|
||||
yy700:
|
||||
YYDEBUG(700, *YYCURSOR);
|
||||
#line 1506 "parse_date.re"
|
||||
#line 1506 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12044,7 +12044,7 @@ yy700:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12048 "<stdout>"
|
||||
#line 12048 "ext/date/lib/parse_date.c"
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12596,7 +12596,7 @@ yy762:
|
||||
}
|
||||
yy763:
|
||||
YYDEBUG(763, *YYCURSOR);
|
||||
#line 1251 "parse_date.re"
|
||||
#line 1251 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12609,7 +12609,7 @@ yy763:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12613 "<stdout>"
|
||||
#line 12613 "ext/date/lib/parse_date.c"
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12648,7 +12648,7 @@ yy770:
|
||||
YYDEBUG(770, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
#line 1492 "parse_date.re"
|
||||
#line 1492 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12661,7 +12661,7 @@ yy770:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12665 "<stdout>"
|
||||
#line 12665 "ext/date/lib/parse_date.c"
|
||||
yy772:
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12799,7 +12799,7 @@ yy782:
|
||||
}
|
||||
yy783:
|
||||
YYDEBUG(783, *YYCURSOR);
|
||||
#line 1527 "parse_date.re"
|
||||
#line 1527 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12807,7 +12807,7 @@ yy783:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12811 "<stdout>"
|
||||
#line 12811 "ext/date/lib/parse_date.c"
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12958,7 +12958,7 @@ yy792:
|
||||
}
|
||||
yy793:
|
||||
YYDEBUG(793, *YYCURSOR);
|
||||
#line 1348 "parse_date.re"
|
||||
#line 1348 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -12971,7 +12971,7 @@ yy793:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 12975 "<stdout>"
|
||||
#line 12975 "ext/date/lib/parse_date.c"
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13186,7 +13186,7 @@ yy813:
|
||||
if (yych <= '7') goto yy816;
|
||||
yy814:
|
||||
YYDEBUG(814, *YYCURSOR);
|
||||
#line 1459 "parse_date.re"
|
||||
#line 1459 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13204,7 +13204,7 @@ yy814:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13208 "<stdout>"
|
||||
#line 13208 "ext/date/lib/parse_date.c"
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13214,7 +13214,7 @@ yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
#line 1440 "parse_date.re"
|
||||
#line 1440 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13232,7 +13232,7 @@ yy816:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13236 "<stdout>"
|
||||
#line 13236 "ext/date/lib/parse_date.c"
|
||||
yy818:
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13296,7 +13296,7 @@ yy820:
|
||||
}
|
||||
yy821:
|
||||
YYDEBUG(821, *YYCURSOR);
|
||||
#line 1426 "parse_date.re"
|
||||
#line 1426 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13309,7 +13309,7 @@ yy821:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13313 "<stdout>"
|
||||
#line 13313 "ext/date/lib/parse_date.c"
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13412,7 +13412,7 @@ yy841:
|
||||
++YYCURSOR;
|
||||
yy842:
|
||||
YYDEBUG(842, *YYCURSOR);
|
||||
#line 1400 "parse_date.re"
|
||||
#line 1400 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13437,7 +13437,7 @@ yy842:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13441 "<stdout>"
|
||||
#line 13441 "ext/date/lib/parse_date.c"
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13699,7 +13699,7 @@ yy847:
|
||||
}
|
||||
yy848:
|
||||
YYDEBUG(848, *YYCURSOR);
|
||||
#line 1388 "parse_date.re"
|
||||
#line 1388 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13710,7 +13710,7 @@ yy848:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13714 "<stdout>"
|
||||
#line 13714 "ext/date/lib/parse_date.c"
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14630,7 +14630,7 @@ yy972:
|
||||
if (yych <= '9') goto yy995;
|
||||
yy973:
|
||||
YYDEBUG(973, *YYCURSOR);
|
||||
#line 1265 "parse_date.re"
|
||||
#line 1265 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -14643,7 +14643,7 @@ yy973:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14647 "<stdout>"
|
||||
#line 14647 "ext/date/lib/parse_date.c"
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15652,7 +15652,7 @@ yy1065:
|
||||
}
|
||||
yy1067:
|
||||
YYDEBUG(1067, *YYCURSOR);
|
||||
#line 1157 "parse_date.re"
|
||||
#line 1157 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15674,7 +15674,7 @@ yy1067:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15678 "<stdout>"
|
||||
#line 15678 "ext/date/lib/parse_date.c"
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15766,7 +15766,7 @@ yy1074:
|
||||
}
|
||||
yy1075:
|
||||
YYDEBUG(1075, *YYCURSOR);
|
||||
#line 1203 "parse_date.re"
|
||||
#line 1203 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15785,7 +15785,7 @@ yy1075:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15789 "<stdout>"
|
||||
#line 15789 "ext/date/lib/parse_date.c"
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16683,7 +16683,7 @@ yy1116:
|
||||
}
|
||||
yy1117:
|
||||
YYDEBUG(1117, *YYCURSOR);
|
||||
#line 1599 "parse_date.re"
|
||||
#line 1599 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16699,7 +16699,7 @@ yy1117:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16703 "<stdout>"
|
||||
#line 16703 "ext/date/lib/parse_date.c"
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16750,7 +16750,7 @@ yy1125:
|
||||
YYDEBUG(1125, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
#line 1072 "parse_date.re"
|
||||
#line 1072 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16771,7 +16771,7 @@ yy1125:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16775 "<stdout>"
|
||||
#line 16775 "ext/date/lib/parse_date.c"
|
||||
yy1127:
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16879,7 +16879,7 @@ yy1140:
|
||||
}
|
||||
yy1141:
|
||||
YYDEBUG(1141, *YYCURSOR);
|
||||
#line 1575 "parse_date.re"
|
||||
#line 1575 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16902,7 +16902,7 @@ yy1141:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16906 "<stdout>"
|
||||
#line 16906 "ext/date/lib/parse_date.c"
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19579,7 +19579,7 @@ yy1293:
|
||||
goto yy1297;
|
||||
yy1294:
|
||||
YYDEBUG(1294, *YYCURSOR);
|
||||
#line 1049 "parse_date.re"
|
||||
#line 1049 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19601,7 +19601,7 @@ yy1294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19605 "<stdout>"
|
||||
#line 19605 "ext/date/lib/parse_date.c"
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -19862,7 +19862,7 @@ yy1315:
|
||||
YYDEBUG(1315, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1316, *YYCURSOR);
|
||||
#line 1032 "parse_date.re"
|
||||
#line 1032 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19878,7 +19878,7 @@ yy1315:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19882 "<stdout>"
|
||||
#line 19882 "ext/date/lib/parse_date.c"
|
||||
yy1317:
|
||||
YYDEBUG(1317, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -21309,7 +21309,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1006 "parse_date.re"
|
||||
#line 1006 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21334,7 +21334,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21338 "<stdout>"
|
||||
#line 21338 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21770,7 +21770,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 994 "parse_date.re"
|
||||
#line 994 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21781,7 +21781,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21785 "<stdout>"
|
||||
#line 21785 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21816,7 +21816,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 984 "parse_date.re"
|
||||
#line 984 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21825,7 +21825,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21829 "<stdout>"
|
||||
#line 21829 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23837,7 +23837,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 963 "parse_date.re"
|
||||
#line 963 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23845,7 +23845,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23849 "<stdout>"
|
||||
#line 23849 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23984,7 +23984,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 972 "parse_date.re"
|
||||
#line 972 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -23995,7 +23995,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23999 "<stdout>"
|
||||
#line 23999 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24528,7 +24528,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 951 "parse_date.re"
|
||||
#line 951 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24539,7 +24539,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24543 "<stdout>"
|
||||
#line 24543 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24712,7 +24712,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1725 "parse_date.re"
|
||||
#line 1725 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Aug 13 10:30:12 2015 */
|
||||
#line 1 "parse_iso_intervals.re"
|
||||
#line 1 "ext/date/lib/parse_iso_intervals.re"
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@@ -254,11 +254,11 @@ static int scan(Scanner *s)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 282 "parse_iso_intervals.re"
|
||||
#line 282 "ext/date/lib/parse_iso_intervals.re"
|
||||
|
||||
|
||||
|
||||
#line 262 "<stdout>"
|
||||
#line 262 "ext/date/lib/parse_iso_intervals.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -325,12 +325,12 @@ std:
|
||||
if ((yych = *YYCURSOR) <= '/') goto yy3;
|
||||
if (yych <= '9') goto yy98;
|
||||
yy3:
|
||||
#line 395 "parse_iso_intervals.re"
|
||||
#line 395 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 334 "<stdout>"
|
||||
#line 334 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy4:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -344,7 +344,7 @@ yy5:
|
||||
if (yych <= '9') goto yy12;
|
||||
if (yych == 'T') goto yy14;
|
||||
yy6:
|
||||
#line 322 "parse_iso_intervals.re"
|
||||
#line 322 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
timelib_sll nr;
|
||||
int in_time = 0;
|
||||
@@ -385,22 +385,22 @@ yy6:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PERIOD;
|
||||
}
|
||||
#line 389 "<stdout>"
|
||||
#line 389 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy7:
|
||||
++YYCURSOR;
|
||||
#line 384 "parse_iso_intervals.re"
|
||||
#line 384 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 396 "<stdout>"
|
||||
#line 396 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy9:
|
||||
++YYCURSOR;
|
||||
#line 389 "parse_iso_intervals.re"
|
||||
#line 389 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 404 "<stdout>"
|
||||
#line 404 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy11:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy3;
|
||||
@@ -682,7 +682,7 @@ yy51:
|
||||
if (yych <= '/') goto yy13;
|
||||
if (yych >= ':') goto yy13;
|
||||
++YYCURSOR;
|
||||
#line 364 "parse_iso_intervals.re"
|
||||
#line 364 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
DEBUG_OUTPUT("combinedrep");
|
||||
TIMELIB_INIT;
|
||||
@@ -701,7 +701,7 @@ yy51:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PERIOD;
|
||||
}
|
||||
#line 705 "<stdout>"
|
||||
#line 705 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy59:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
@@ -804,7 +804,7 @@ yy76:
|
||||
if (yych != 'Z') goto yy13;
|
||||
yy83:
|
||||
++YYCURSOR;
|
||||
#line 298 "parse_iso_intervals.re"
|
||||
#line 298 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
timelib_time *current;
|
||||
|
||||
@@ -827,7 +827,7 @@ yy83:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 831 "<stdout>"
|
||||
#line 831 "ext/date/lib/parse_iso_intervals.c"
|
||||
yy85:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy13;
|
||||
@@ -889,7 +889,7 @@ yy98:
|
||||
if (yych <= '/') goto yy100;
|
||||
if (yych <= '9') goto yy98;
|
||||
yy100:
|
||||
#line 287 "parse_iso_intervals.re"
|
||||
#line 287 "ext/date/lib/parse_iso_intervals.re"
|
||||
{
|
||||
DEBUG_OUTPUT("recurrences");
|
||||
TIMELIB_INIT;
|
||||
@@ -899,9 +899,9 @@ yy100:
|
||||
s->have_recurrences = 1;
|
||||
return TIMELIB_PERIOD;
|
||||
}
|
||||
#line 903 "<stdout>"
|
||||
#line 903 "ext/date/lib/parse_iso_intervals.c"
|
||||
}
|
||||
#line 399 "parse_iso_intervals.re"
|
||||
#line 399 "ext/date/lib/parse_iso_intervals.re"
|
||||
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
+666
-510
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,8 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#else
|
||||
#include "php_config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GD_PNG
|
||||
/* needs to be first */
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
--TEST--
|
||||
gmp_random_seed() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// zero int
|
||||
var_dump(gmp_random_seed(0));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// zero gmp
|
||||
var_dump(gmp_random_seed(gmp_init(0)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// negative int
|
||||
var_dump(gmp_random_seed(-100));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// negative gmp
|
||||
var_dump(gmp_random_seed(gmp_init(-100)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// positive int
|
||||
var_dump(gmp_random_seed(100));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// positive gmp
|
||||
var_dump(gmp_random_seed(100));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
$seed = gmp_init(1);
|
||||
$seed <<= 512;
|
||||
|
||||
// large negative gmp
|
||||
var_dump(gmp_random_seed($seed * -1));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// large positive gmp
|
||||
var_dump(gmp_random_seed($seed));
|
||||
|
||||
var_dump(gmp_strval(gmp_random()));
|
||||
var_dump(gmp_strval(gmp_random(1)));
|
||||
var_dump(gmp_strval(gmp_random(10)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_bits(10)));
|
||||
var_dump(gmp_strval(gmp_random_bits(100)));
|
||||
var_dump(gmp_strval(gmp_random_bits(1000)));
|
||||
|
||||
var_dump(gmp_strval(gmp_random_range(0, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
|
||||
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
|
||||
|
||||
|
||||
// standard non conversion error
|
||||
var_dump(gmp_random_seed('not a number'));
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
string(193) "2000022451473107283132031190545479155678097978829612864726689673263990484954900429188146529905019042225609517482723730948135765344007937183893986134210303199345433818579954244943136664096571499"
|
||||
string(10) "3792281639"
|
||||
string(97) "1281406676617847191505318987040099388645126071814252743902229506206669580396236451813261179688680"
|
||||
string(2) "86"
|
||||
string(30) "539590049119295715487546581833"
|
||||
string(301) "1421393257467327495225454368915273750356127352353055226245692071178379257048985726109650766437957017507708821700349355658110489309871463201057688894986035545794429493563972043777521547094922637182497036750765553664196591958728194711096442220858890056073974348364544481270013556644174056049511198143353"
|
||||
string(4) "8971"
|
||||
string(4) "7838"
|
||||
string(5) "-7823"
|
||||
NULL
|
||||
string(193) "2000022451473107283132031190545479155678097978829612864726689673263990484954900429188146529905019042225609517482723730948135765344007937183893986134210303199345433818579954244943136664096571499"
|
||||
string(10) "3792281639"
|
||||
string(97) "1281406676617847191505318987040099388645126071814252743902229506206669580396236451813261179688680"
|
||||
string(2) "86"
|
||||
string(30) "539590049119295715487546581833"
|
||||
string(301) "1421393257467327495225454368915273750356127352353055226245692071178379257048985726109650766437957017507708821700349355658110489309871463201057688894986035545794429493563972043777521547094922637182497036750765553664196591958728194711096442220858890056073974348364544481270013556644174056049511198143353"
|
||||
string(4) "8971"
|
||||
string(4) "7838"
|
||||
string(5) "-7823"
|
||||
NULL
|
||||
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
|
||||
string(9) "513032517"
|
||||
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
|
||||
string(3) "111"
|
||||
string(31) "1007352579363975542750518386428"
|
||||
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
|
||||
string(4) "2362"
|
||||
string(5) "-9377"
|
||||
string(5) "-8435"
|
||||
NULL
|
||||
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
|
||||
string(9) "513032517"
|
||||
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
|
||||
string(3) "111"
|
||||
string(31) "1007352579363975542750518386428"
|
||||
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
|
||||
string(4) "2362"
|
||||
string(5) "-9377"
|
||||
string(5) "-8435"
|
||||
NULL
|
||||
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
|
||||
string(9) "513032517"
|
||||
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
|
||||
string(3) "111"
|
||||
string(31) "1007352579363975542750518386428"
|
||||
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
|
||||
string(4) "2362"
|
||||
string(5) "-9377"
|
||||
string(5) "-8435"
|
||||
NULL
|
||||
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
|
||||
string(9) "513032517"
|
||||
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
|
||||
string(3) "111"
|
||||
string(31) "1007352579363975542750518386428"
|
||||
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
|
||||
string(4) "2362"
|
||||
string(5) "-9377"
|
||||
string(5) "-8435"
|
||||
NULL
|
||||
string(193) "4314861641594785951065006537821497084129700255567731661104366342587560122488351847486220156468888511744226746306538524023190734733433083354034308520246964938498767672539252131810891590624763642"
|
||||
string(10) "3301287097"
|
||||
string(97) "1532710025135934106005683287301200805525218110207399702226596673360222079570223526337866801028045"
|
||||
string(3) "317"
|
||||
string(30) "949682013136255600092941702271"
|
||||
string(302) "10419061168407861659407303769436775291881708415032871985692089124472434944956010985892897595466043265819000974537553172663152640727594826474137173310039809413311432062725623183603946900548710858191078057179743726366436832870919212340219523613153893742764101120396858424887711932475871305848021245801132"
|
||||
string(4) "2417"
|
||||
string(5) "-7975"
|
||||
string(4) "-378"
|
||||
NULL
|
||||
string(193) "4314861641594785951065006537821497084129700255567731661104366342587560122488351847486220156468888511744226746306538524023190734733433083354034308520246964938498767672539252131810891590624763642"
|
||||
string(10) "3301287097"
|
||||
string(97) "1532710025135934106005683287301200805525218110207399702226596673360222079570223526337866801028045"
|
||||
string(3) "317"
|
||||
string(30) "949682013136255600092941702271"
|
||||
string(302) "10419061168407861659407303769436775291881708415032871985692089124472434944956010985892897595466043265819000974537553172663152640727594826474137173310039809413311432062725623183603946900548710858191078057179743726366436832870919212340219523613153893742764101120396858424887711932475871305848021245801132"
|
||||
string(4) "2417"
|
||||
string(5) "-7975"
|
||||
string(4) "-378"
|
||||
|
||||
Warning: gmp_random_seed(): Unable to convert variable to GMP - string is not an integer in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -2,6 +2,7 @@
|
||||
gmp_random_seed() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ PHP_FUNCTION(ibase_blob_add)
|
||||
PHP_FUNCTION(ibase_blob_get)
|
||||
{
|
||||
zval *blob_arg;
|
||||
unsigned long len_arg;
|
||||
zend_ulong len_arg;
|
||||
ibase_blob *ib_blob;
|
||||
|
||||
RESET_ERRMSG;
|
||||
|
||||
@@ -1061,7 +1061,8 @@ PHP_FUNCTION(ibase_query)
|
||||
{
|
||||
zval *zlink, *ztrans, *bind_args = NULL;
|
||||
char *query;
|
||||
int bind_i, query_len, bind_num;
|
||||
size_t query_len;
|
||||
int bind_i, bind_num;
|
||||
long trans_res_id = 0;
|
||||
ibase_db_link *ib_link = NULL;
|
||||
ibase_trans *trans = NULL;
|
||||
@@ -1073,7 +1074,7 @@ PHP_FUNCTION(ibase_query)
|
||||
RETVAL_FALSE;
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
long l;
|
||||
zend_long l;
|
||||
|
||||
default:
|
||||
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3, "rrs",
|
||||
@@ -1472,7 +1473,8 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
|
||||
static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) /* {{{ */
|
||||
{
|
||||
zval *result_arg;
|
||||
long i, array_cnt = 0, flag = 0;
|
||||
zend_long flag = 0;
|
||||
long i, array_cnt = 0;
|
||||
ibase_result *ib_result;
|
||||
|
||||
RESET_ERRMSG;
|
||||
@@ -1684,7 +1686,7 @@ PHP_FUNCTION(ibase_name_result)
|
||||
{
|
||||
zval *result_arg;
|
||||
char *name_arg;
|
||||
int name_arg_len;
|
||||
size_t name_arg_len;
|
||||
ibase_result *ib_result;
|
||||
|
||||
RESET_ERRMSG;
|
||||
@@ -1998,7 +2000,7 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */
|
||||
PHP_FUNCTION(ibase_field_info)
|
||||
{
|
||||
zval *result_arg;
|
||||
long field_arg;
|
||||
zend_long field_arg;
|
||||
int type;
|
||||
XSQLDA *sqlda;
|
||||
|
||||
@@ -2062,7 +2064,7 @@ PHP_FUNCTION(ibase_num_params)
|
||||
PHP_FUNCTION(ibase_param_info)
|
||||
{
|
||||
zval *result_arg;
|
||||
long field_arg;
|
||||
zend_long field_arg;
|
||||
ibase_query *ib_query;
|
||||
|
||||
RESET_ERRMSG;
|
||||
|
||||
@@ -425,7 +425,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
|
||||
zval *res;
|
||||
char *db, *bk, buf[200];
|
||||
size_t dblen, bklen, spb_len;
|
||||
long opts = 0;
|
||||
zend_long opts = 0;
|
||||
zend_bool verbose = 0;
|
||||
ibase_service *svm;
|
||||
|
||||
@@ -488,8 +488,9 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
|
||||
{
|
||||
zval *res;
|
||||
char buf[128], *db;
|
||||
int dblen, spb_len;
|
||||
long action, argument = 0;
|
||||
size_t dblen;
|
||||
int spb_len;
|
||||
zend_long action, argument = 0;
|
||||
ibase_service *svm;
|
||||
|
||||
RESET_ERRMSG;
|
||||
@@ -596,7 +597,7 @@ PHP_FUNCTION(ibase_db_info)
|
||||
PHP_FUNCTION(ibase_server_info)
|
||||
{
|
||||
zval *res;
|
||||
long action;
|
||||
zend_long action;
|
||||
ibase_service *svm;
|
||||
|
||||
RESET_ERRMSG;
|
||||
|
||||
@@ -1421,7 +1421,7 @@ PHP_FUNCTION(ibase_gen_id)
|
||||
zval *link = NULL;
|
||||
char query[128], *generator;
|
||||
size_t gen_len;
|
||||
long inc = 1;
|
||||
zend_long inc = 1;
|
||||
ibase_db_link *ib_link;
|
||||
ibase_trans *trans = NULL;
|
||||
XSQLDA out_sqlda;
|
||||
|
||||
Loaded 100 of 368 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user