mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
737
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0eda1aeca3 | ||
|
|
584ffa5f6e | ||
|
|
7353dae815 | ||
|
|
014b1b3aad | ||
|
|
4d6b0b5031 | ||
|
|
20849b0b0f | ||
|
|
efb86aef12 | ||
|
|
b5afc99afb | ||
|
|
314b8ecf8b | ||
|
|
e29c946c29 | ||
|
|
065eee16b5 | ||
|
|
7e176ddb57 | ||
|
|
8754d44167 | ||
|
|
50fec3be0e | ||
|
|
6922cae4ae | ||
|
|
6e1980e152 | ||
|
|
eb03290754 | ||
|
|
692e5d5c88 | ||
|
|
fcf4088d3f | ||
|
|
f15fc8ea1e | ||
|
|
8f43ec1e83 | ||
|
|
b9bf9ddce6 | ||
|
|
5fe8e49baa | ||
|
|
1c3d5659bd | ||
|
|
6644bd005f | ||
|
|
3278b3347c | ||
|
|
36946f5c45 | ||
|
|
32a728d351 | ||
|
|
6cf382b667 | ||
|
|
10661e28d1 | ||
|
|
5fb01a3a42 | ||
|
|
9ace33b9c5 | ||
|
|
02b0bc8bb1 | ||
|
|
1de17428f6 | ||
|
|
cdd9eb8c4a | ||
|
|
dd07f17f97 | ||
|
|
70b2fca220 | ||
|
|
2527a0fcfd | ||
|
|
138671f2f4 | ||
|
|
7ad0595712 | ||
|
|
cf2fc66b02 | ||
|
|
446b5b15d3 | ||
|
|
8d95f561e4 | ||
|
|
0f68ff5c92 | ||
|
|
5e5311e0ba | ||
|
|
16a9dd74f4 | ||
|
|
b8828926f2 | ||
|
|
1621f1739d | ||
|
|
efbf846fd2 | ||
|
|
52ea129efb | ||
|
|
73a8f72617 | ||
|
|
4c542e6c13 | ||
|
|
9708083779 | ||
|
|
b0da1745be | ||
|
|
be2447fb7c | ||
|
|
41d2102c77 | ||
|
|
4c448334bd | ||
|
|
3257d22fea | ||
|
|
990a404c2d | ||
|
|
0414fff205 | ||
|
|
aa7777d36c | ||
|
|
4aa5065bb0 | ||
|
|
837ed71c65 | ||
|
|
a097f926c8 | ||
|
|
0c2327b472 | ||
|
|
ddd73d4fa8 | ||
|
|
10d724d82d | ||
|
|
2072d377d3 | ||
|
|
5c1a2d8375 | ||
|
|
0a16af043e | ||
|
|
751bbaa41f | ||
|
|
d61ff37f45 | ||
|
|
2aa3733daa | ||
|
|
3131ebcea8 | ||
|
|
acd4264f7b | ||
|
|
ca103b415e | ||
|
|
04c4854fdf | ||
|
|
fd463a9a60 | ||
|
|
ae926d8961 | ||
|
|
a158fb958f | ||
|
|
64c88c1e16 | ||
|
|
6e7b381270 | ||
|
|
1ea2395712 | ||
|
|
eb7fca9546 | ||
|
|
a879f4dd22 | ||
|
|
8c92442b49 | ||
|
|
32477dea70 | ||
|
|
2cdde35d0f | ||
|
|
1f2f2c6b96 | ||
|
|
e4276aeb98 | ||
|
|
66a4362914 | ||
|
|
819cf5283b | ||
|
|
78d823d9c3 | ||
|
|
dcd4b32185 | ||
|
|
8270c7d947 | ||
|
|
56abfd2798 | ||
|
|
e20baee136 | ||
|
|
fdaa540fd8 | ||
|
|
9eb51ce364 | ||
|
|
4a3fccb0f5 | ||
|
|
dd0fb4fd9b | ||
|
|
dc3f4f7342 | ||
|
|
859f7fce1f | ||
|
|
a16aee6cee | ||
|
|
326d3d480c | ||
|
|
e0fe667421 | ||
|
|
3cef5a2476 | ||
|
|
9cc74ba229 | ||
|
|
45a05f3841 | ||
|
|
d22ddd8cf1 | ||
|
|
887235773d | ||
|
|
2b1d79ce66 | ||
|
|
b053beee7e | ||
|
|
3082600326 | ||
|
|
35cb353dd5 | ||
|
|
1c1567c9bc | ||
|
|
a6ab19375a | ||
|
|
0b9a540dd7 | ||
|
|
f4777c6a51 | ||
|
|
935625f1b8 | ||
|
|
fefaeae49c | ||
|
|
fab7d9f577 | ||
|
|
a3e3d914ed | ||
|
|
2c72673986 | ||
|
|
51d3896fd7 | ||
|
|
fa07b8bbb7 | ||
|
|
86e9965c87 | ||
|
|
4d5edcb4ac | ||
|
|
523cf6e2e7 | ||
|
|
eceecb6900 | ||
|
|
c8a90606c1 | ||
|
|
ee2d2f78c4 | ||
|
|
8cbb381068 | ||
|
|
6b092bcaae | ||
|
|
b4b14d2106 | ||
|
|
c9ff518665 | ||
|
|
68ab719baa | ||
|
|
45a3c0e596 | ||
|
|
d4053cee6b | ||
|
|
9b462f332e | ||
|
|
86d472e249 | ||
|
|
f9d9c5ebd9 | ||
|
|
1012416a1c | ||
|
|
f9c8a003dc | ||
|
|
6680d5f875 | ||
|
|
b9c3c1441a | ||
|
|
169a98319a | ||
|
|
024232e94d | ||
|
|
8d91e82871 | ||
|
|
0f557756dd | ||
|
|
a003af5b62 | ||
|
|
70ecb6e50b | ||
|
|
99020cc085 | ||
|
|
e1af7a794a | ||
|
|
655658bbfa | ||
|
|
827abb843f | ||
|
|
889df3087b | ||
|
|
18db1ce211 | ||
|
|
fd0fc20d35 | ||
|
|
5dc74d9e70 | ||
|
|
81ebe930f3 | ||
|
|
db8bcdba80 | ||
|
|
c00f5e6531 | ||
|
|
bb92808794 | ||
|
|
ad0f73cbfd | ||
|
|
ffae3fb25d | ||
|
|
7b2af47236 | ||
|
|
fa59dc550d | ||
|
|
b71a503844 | ||
|
|
0f57a7f259 | ||
|
|
9286681bac | ||
|
|
91996e7ee5 | ||
|
|
2ea7222440 | ||
|
|
4faf135d90 | ||
|
|
7aca2bdbb1 | ||
|
|
4bb44e0f44 | ||
|
|
0872e80dd8 | ||
|
|
41c69766a4 | ||
|
|
cd07fa48ba | ||
|
|
91a0a10f71 | ||
|
|
19592519c2 | ||
|
|
9d7c510893 | ||
|
|
ba1a90ea89 | ||
|
|
0ba49597b9 | ||
|
|
196e5f0e06 | ||
|
|
d53978bd59 | ||
|
|
642bb9f376 | ||
|
|
36857ab52b | ||
|
|
b1d2a89ac1 | ||
|
|
74988eed99 | ||
|
|
f6ee308143 | ||
|
|
144e8d1f83 | ||
|
|
bf5cf79456 | ||
|
|
974abd8b43 | ||
|
|
2b58ab23c6 | ||
|
|
08b9310e6d | ||
|
|
3ccd985478 | ||
|
|
57527455eb | ||
|
|
c42f0ba4f7 | ||
|
|
7c1e0930c4 | ||
|
|
b719aa41f4 | ||
|
|
160353688b | ||
|
|
b49891aa90 | ||
|
|
095a30e11b | ||
|
|
e111ef5626 | ||
|
|
2870178720 | ||
|
|
093cb1d7c6 | ||
|
|
d207d6a57f | ||
|
|
cc69950b15 | ||
|
|
5674cf888d | ||
|
|
909f943fe5 | ||
|
|
9c8b3ae43f | ||
|
|
4a1336de7c | ||
|
|
745f6627bd | ||
|
|
be805f146c | ||
|
|
3ced766da9 | ||
|
|
f2e4de8b56 | ||
|
|
6399fa1eea | ||
|
|
d88bbcea82 | ||
|
|
4371945b8b | ||
|
|
aac5cdc7d7 | ||
|
|
72551dd89e | ||
|
|
1461f8ef0d | ||
|
|
f2b5ac7963 | ||
|
|
a61756252a | ||
|
|
17de277a2f | ||
|
|
daaf706df0 | ||
|
|
7394879adf | ||
|
|
ab702e4fde | ||
|
|
209f05a878 | ||
|
|
d2184efb7b | ||
|
|
d7ad4babe0 | ||
|
|
03b717d4cc | ||
|
|
255e29f3bc | ||
|
|
b12cece8d5 | ||
|
|
0a01eae039 | ||
|
|
cf3b852109 | ||
|
|
b60d8ab2e2 | ||
|
|
cf8ef08e20 | ||
|
|
0eabd5231b | ||
|
|
1359ff8052 | ||
|
|
a588b825d6 | ||
|
|
a7746d10a5 | ||
|
|
7ec64a831d | ||
|
|
d035bc2bfe | ||
|
|
ba8f0615e1 | ||
|
|
6059ecee3a | ||
|
|
ce66492a13 | ||
|
|
ed7e3bc70a | ||
|
|
f374e93762 | ||
|
|
562150906a | ||
|
|
ab8094c666 | ||
|
|
7a41e4c0d0 | ||
|
|
fb966b9825 | ||
|
|
9e4d590b19 | ||
|
|
8d18d631b6 | ||
|
|
57c4ae393c | ||
|
|
f950128cd6 | ||
|
|
a5e80b22e1 | ||
|
|
a29a800cb0 | ||
|
|
aed3de1bc5 | ||
|
|
df6bd506d4 | ||
|
|
8d3f8ca12a | ||
|
|
dcd6a6ff36 | ||
|
|
a96ca13963 | ||
|
|
40bd84d3e3 | ||
|
|
d775fe33d1 | ||
|
|
1638a6e118 | ||
|
|
4aada3993c | ||
|
|
d31d4d1392 | ||
|
|
3ca9aaf24e | ||
|
|
033dac7a6f | ||
|
|
2a181b5ea0 | ||
|
|
38d97557da | ||
|
|
4799cde613 | ||
|
|
0b7686584e | ||
|
|
ba138a3746 | ||
|
|
7ef8e3f87f | ||
|
|
d4e60a1ffd | ||
|
|
b1864b0178 | ||
|
|
08f10ef47a | ||
|
|
b121405960 | ||
|
|
ebd1f5af3e | ||
|
|
afc82e243c | ||
|
|
850c67e957 | ||
|
|
c20a97df6d | ||
|
|
2139c2c2de | ||
|
|
c93aba042f | ||
|
|
8ca1f47a7a | ||
|
|
26cd84d19f | ||
|
|
89e2202cb5 | ||
|
|
33eb30274f | ||
|
|
99fdf5916e | ||
|
|
e5a9956336 | ||
|
|
c85504386d | ||
|
|
2010c02e5c | ||
|
|
4a528d46f5 | ||
|
|
fb0e8c65b9 | ||
|
|
4a5b2101e5 | ||
|
|
d9acfa45b8 | ||
|
|
5c4047b339 | ||
|
|
f4a9da389b | ||
|
|
e6016ab20d | ||
|
|
fef2029614 | ||
|
|
ee561ff2a2 | ||
|
|
6e2c54d3e7 | ||
|
|
fb0faf0208 | ||
|
|
6ac48425a8 | ||
|
|
8d041e171b | ||
|
|
2073e96ec5 | ||
|
|
9e54d9d692 | ||
|
|
5345ddee99 | ||
|
|
ca618a4f10 | ||
|
|
0510b47894 | ||
|
|
e5b27b9916 | ||
|
|
1ba3314335 | ||
|
|
5be44312f8 | ||
|
|
54ebebd686 | ||
|
|
b81d712961 | ||
|
|
d77aa8fa6d | ||
|
|
a76661a4a2 | ||
|
|
1820f2f2f3 | ||
|
|
29f942b3d0 | ||
|
|
5d60651165 | ||
|
|
e8a04b387e | ||
|
|
412dd75e05 | ||
|
|
583616deb1 | ||
|
|
0c3561892b | ||
|
|
3b6e1ee4ee | ||
|
|
7db988cc30 | ||
|
|
1a078117b5 | ||
|
|
53ef61bcae | ||
|
|
b494d94f16 | ||
|
|
dfc2e3a2ac | ||
|
|
d011da9d1a | ||
|
|
df60566671 | ||
|
|
ca50aa9ca8 | ||
|
|
b1f4f5c80c | ||
|
|
c4106d4569 | ||
|
|
88dd38ee81 | ||
|
|
1127163996 | ||
|
|
b52c4fcbcd | ||
|
|
9f957fd303 | ||
|
|
50516a6e1f | ||
|
|
79a27ccf3f | ||
|
|
c0407d95f7 | ||
|
|
ffa41787d5 | ||
|
|
e069b0beba | ||
|
|
2abdcae886 | ||
|
|
ebd5f56442 | ||
|
|
28d8b8de71 | ||
|
|
a536d6d61b | ||
|
|
4e92cd172a | ||
|
|
bddf8140e4 | ||
|
|
f151e048ed | ||
|
|
b73a108543 | ||
|
|
289cb0f77c | ||
|
|
3462efa386 | ||
|
|
1baeae4270 | ||
|
|
3588d8af12 | ||
|
|
a632ecd224 | ||
|
|
70d0175a13 | ||
|
|
5cf6474277 | ||
|
|
49c193eeb3 | ||
|
|
59456974f2 | ||
|
|
cf5f26b260 | ||
|
|
9c2b4985b1 | ||
|
|
8efd3c3387 | ||
|
|
0f8c1ee76d | ||
|
|
96f83e40c8 | ||
|
|
c7d1c14b5c | ||
|
|
233cbb53b3 | ||
|
|
bf8b5b2269 | ||
|
|
f6440c3aa6 | ||
|
|
b9963969fd | ||
|
|
dee191ee07 | ||
|
|
141072a838 | ||
|
|
dbabb35ff9 | ||
|
|
1bcc2fcb4e | ||
|
|
54f920d661 | ||
|
|
644ab58d0f | ||
|
|
f28aeaee05 | ||
|
|
99fe18503a | ||
|
|
571dac8c8f | ||
|
|
5e8977bd62 | ||
|
|
432c4e77a8 | ||
|
|
6c630eefcb | ||
|
|
5f5cf8cb94 | ||
|
|
77ced46dea | ||
|
|
236ae06e0b | ||
|
|
e4e9cd8355 | ||
|
|
7d4e18b05d | ||
|
|
0834679e40 | ||
|
|
9443c61928 | ||
|
|
cc7b000d2c | ||
|
|
129c5c1181 | ||
|
|
81eb8e7507 | ||
|
|
85ee47eda0 | ||
|
|
2367e649bc | ||
|
|
9ac133a0b3 | ||
|
|
871d0aa5cd | ||
|
|
cc266045a5 | ||
|
|
98102648cb | ||
|
|
14db98825a | ||
|
|
956ac5cbf5 | ||
|
|
2aff1cb226 | ||
|
|
0896a3abd1 | ||
|
|
091c0a8a59 | ||
|
|
271ae3eb2b | ||
|
|
4182b0855f | ||
|
|
bf5a81364c | ||
|
|
a5cb84c82e | ||
|
|
a766f65ca3 | ||
|
|
c23736216d | ||
|
|
9026562c79 | ||
|
|
d82cb24e19 | ||
|
|
ebb590b625 | ||
|
|
08f08858f3 | ||
|
|
7da042cbd8 | ||
|
|
0db8c974a5 | ||
|
|
62b3464871 | ||
|
|
6c61f15408 | ||
|
|
90edf754c5 | ||
|
|
474292c3e4 | ||
|
|
a820aab9da | ||
|
|
cce87471b1 | ||
|
|
dbb9867b3e | ||
|
|
e4be6ce0fa | ||
|
|
797e87060c | ||
|
|
117c37da76 | ||
|
|
a6e8c73c43 | ||
|
|
2c43fb49d6 | ||
|
|
a34fedb723 | ||
|
|
c90f1964f9 | ||
|
|
3e1e3ab728 | ||
|
|
40551e0255 | ||
|
|
ad2719cf9c | ||
|
|
67b4c3379a | ||
|
|
094c2aaf83 | ||
|
|
529baa9a3d | ||
|
|
a8dce31957 | ||
|
|
1c01b1ab48 | ||
|
|
d664d1e959 | ||
|
|
545a29d0cb | ||
|
|
ad790bea2e | ||
|
|
e4a2cdb564 | ||
|
|
77a841db48 | ||
|
|
0fbbdd3aa1 | ||
|
|
3b10e9ccf1 | ||
|
|
3e5afbf0a8 | ||
|
|
2a78006adb | ||
|
|
f86f3edeef | ||
|
|
140def4ac7 | ||
|
|
b585f043cb | ||
|
|
956446bdfa | ||
|
|
491f1477be | ||
|
|
9aeeecc47c | ||
|
|
5d0d812a53 | ||
|
|
47fb17b108 | ||
|
|
95013042bf | ||
|
|
67352cb2c0 | ||
|
|
04e3523b7d | ||
|
|
41a6625c09 | ||
|
|
8f1782678e | ||
|
|
212f56b7ca | ||
|
|
69a49af0d3 | ||
|
|
b37dafcc23 | ||
|
|
1870a61a91 | ||
|
|
9da4e30c75 | ||
|
|
0b94534e93 | ||
|
|
903f41aef7 | ||
|
|
d207fd449c | ||
|
|
1ae888d984 | ||
|
|
ea24847620 | ||
|
|
ed23cea9de | ||
|
|
d85651d58d | ||
|
|
246cb03e26 | ||
|
|
3847a6fcb6 | ||
|
|
b0ca997405 | ||
|
|
137f22ad36 | ||
|
|
268e801cb1 | ||
|
|
4c67f7e012 | ||
|
|
9d1e9b73c5 | ||
|
|
f9297387f4 | ||
|
|
e3355ac5ec | ||
|
|
a362ae6b12 | ||
|
|
9a21aa77af | ||
|
|
bd8e76761f | ||
|
|
6a4e1e8b8e | ||
|
|
41db5f73ce | ||
|
|
dcf7592076 | ||
|
|
ca40664ad6 | ||
|
|
85b2bc38e1 | ||
|
|
8361c0a9a7 | ||
|
|
606de9e4a9 | ||
|
|
a057384113 | ||
|
|
f3dc67b255 | ||
|
|
0c4ab798de | ||
|
|
0504594a28 | ||
|
|
791f07e4f0 | ||
|
|
0630e3bc03 | ||
|
|
169d454593 | ||
|
|
43d5a3665d | ||
|
|
d0a6b1009f | ||
|
|
5f83904a5d | ||
|
|
918a9f09f8 | ||
|
|
3780b027dd | ||
|
|
91fc0d1a41 | ||
|
|
83f6f8563c | ||
|
|
273e194df5 | ||
|
|
77c6ca7b62 | ||
|
|
b01d9e826c | ||
|
|
b6fb584505 | ||
|
|
5bbe6080b4 | ||
|
|
0d235517a3 | ||
|
|
b6cc4d2009 | ||
|
|
265c3ed6cf | ||
|
|
587ab00698 | ||
|
|
0ea4013f10 | ||
|
|
6c0ddcda47 | ||
|
|
5898583e94 | ||
|
|
3a8f26060c | ||
|
|
6337af09dc | ||
|
|
4a475a4976 | ||
|
|
d798fd491b | ||
|
|
af341213f7 | ||
|
|
5f19816f53 | ||
|
|
d84ef96742 | ||
|
|
a6467af8a5 | ||
|
|
36f05a80d7 | ||
|
|
c49f0fd9ac | ||
|
|
2edf94a637 | ||
|
|
7eb045d31a | ||
|
|
e080fb6d92 | ||
|
|
2af3234a09 | ||
|
|
b7368fe0d0 | ||
|
|
eb41eba3fe | ||
|
|
682ca5fccd | ||
|
|
78f23a6dd4 | ||
|
|
e51b364a50 | ||
|
|
29000091b2 | ||
|
|
14e6c0cb8c | ||
|
|
7cdd732aca | ||
|
|
e5ef7cbe87 | ||
|
|
a0b9f8d411 | ||
|
|
cb52bbfdfa | ||
|
|
8bf21adb8c | ||
|
|
004a0568f4 | ||
|
|
177c7e3a72 | ||
|
|
3fd97a5b1f | ||
|
|
28b03f9605 | ||
|
|
23ae6ca405 | ||
|
|
826e403d2c | ||
|
|
57af94c8b9 | ||
|
|
04824aa263 | ||
|
|
9bbb9e537c | ||
|
|
c97b8bbf82 | ||
|
|
1b66ba17ad | ||
|
|
76f1d98a0c | ||
|
|
2cc6922cbf | ||
|
|
3a236d0587 | ||
|
|
787593b708 | ||
|
|
a57b5e82a9 | ||
|
|
09bb2527e9 | ||
|
|
c793885b76 | ||
|
|
30156d588c | ||
|
|
6d61814d0e | ||
|
|
091d77f28a | ||
|
|
43aca3118a | ||
|
|
a63e834b66 | ||
|
|
26a33a96fa | ||
|
|
f8258325b4 | ||
|
|
d404b5e255 | ||
|
|
ce0721bee5 | ||
|
|
2475337bd8 | ||
|
|
0c4f4481f5 | ||
|
|
39d668e927 | ||
|
|
a72bab1b9a | ||
|
|
1b61c3b210 | ||
|
|
ae163d9a36 | ||
|
|
1118fca75d | ||
|
|
8faa6ef30e | ||
|
|
7909d4532c | ||
|
|
0f1726e45d | ||
|
|
9b0df97a42 | ||
|
|
5d7be2c2bc | ||
|
|
34deda13a8 | ||
|
|
2eb6a541a9 | ||
|
|
abbc1e683c | ||
|
|
e2285eb542 | ||
|
|
ae04110032 | ||
|
|
7c04219098 | ||
|
|
8bc2163c8a | ||
|
|
43c533d799 | ||
|
|
deb1bad80f | ||
|
|
962706d16c | ||
|
|
7ac06d66d4 | ||
|
|
813b6fc950 | ||
|
|
10b484e624 | ||
|
|
7a6dc29605 | ||
|
|
efdf4a83b1 | ||
|
|
15ad5d31d1 | ||
|
|
ef274e0b60 | ||
|
|
fb09f1341f | ||
|
|
ff8f2710f6 | ||
|
|
4ff6c0cb44 | ||
|
|
486f18f09e | ||
|
|
cb97fd3097 | ||
|
|
6e77a60a75 | ||
|
|
d6ab163be8 | ||
|
|
dd932f7e63 | ||
|
|
a7101415cb | ||
|
|
00c0d7702c | ||
|
|
bf5a802f5a | ||
|
|
db7ead0768 | ||
|
|
e1e0176e68 | ||
|
|
c5276ad380 | ||
|
|
f6430e3fe2 | ||
|
|
95a71caab1 | ||
|
|
e835916f65 | ||
|
|
88b5df91f6 | ||
|
|
2ff26bdf73 | ||
|
|
3ab920a911 | ||
|
|
a1ae9d5f9e | ||
|
|
eeab21b6d7 | ||
|
|
b35f45ded2 | ||
|
|
19b4fa17d3 | ||
|
|
ef9ed19ec7 | ||
|
|
f1c0500fda | ||
|
|
8e940654e1 | ||
|
|
809a7b5f8f | ||
|
|
5d7f9dcca7 | ||
|
|
1f6b842af4 | ||
|
|
bddb085a68 | ||
|
|
ce7fc2e308 | ||
|
|
78f2a1b81d | ||
|
|
9b02ee0bba | ||
|
|
3f241f3caa | ||
|
|
17afe6430f | ||
|
|
716bbd3480 | ||
|
|
56450c6e65 | ||
|
|
32489322a1 | ||
|
|
6dc0cd868d | ||
|
|
1231b49271 | ||
|
|
a394e1554c | ||
|
|
3d8c82c353 | ||
|
|
7b98d056d3 | ||
|
|
3521661bd1 | ||
|
|
d1b1866a3a | ||
|
|
76827e39ba | ||
|
|
1b80de93b8 | ||
|
|
ff97ba253f | ||
|
|
54f171cdc0 | ||
|
|
8c22d3e729 | ||
|
|
f2c4f06f84 | ||
|
|
49a4e69584 | ||
|
|
b89ce98129 | ||
|
|
7f67513ca3 | ||
|
|
30f7997762 | ||
|
|
c8f355b12c | ||
|
|
73f07738b9 | ||
|
|
2543e61aed | ||
|
|
102bcb5c05 | ||
|
|
490a49d0bb | ||
|
|
a0a4232ae3 | ||
|
|
ecce21169e | ||
|
|
7793bc8ee6 | ||
|
|
0778359223 | ||
|
|
2458dab466 | ||
|
|
6b5597f7d8 | ||
|
|
d169d06d30 | ||
|
|
836f329114 | ||
|
|
096fd88dcb | ||
|
|
5af0db88fa | ||
|
|
61d00a6cf3 | ||
|
|
da82719f20 | ||
|
|
19b42bd6b3 | ||
|
|
4abf423d75 | ||
|
|
14b22704c7 | ||
|
|
701460ba84 | ||
|
|
66cf76ee54 | ||
|
|
e03739d4ab | ||
|
|
8c92318677 | ||
|
|
aa92d42018 | ||
|
|
b592cd7b98 | ||
|
|
ed9d1b708b | ||
|
|
8b58b2aac6 | ||
|
|
3b9ecb2d65 | ||
|
|
684ce24eec | ||
|
|
34e58a6447 | ||
|
|
3c600e2d61 | ||
|
|
9b2d708f21 | ||
|
|
bb2f1a6830 | ||
|
|
71e18471f2 | ||
|
|
4a4c72a82a | ||
|
|
1f726c9925 | ||
|
|
73b675a988 | ||
|
|
23ca95aa3e | ||
|
|
71d16feebb | ||
|
|
c2a3ab070b | ||
|
|
d95ee27551 | ||
|
|
5f349b728e | ||
|
|
77bd405959 | ||
|
|
b20bcbc363 | ||
|
|
3c42f64e6e | ||
|
|
55277a6684 | ||
|
|
3f96f01e9e | ||
|
|
4418d61ca3 | ||
|
|
f87cc89f4d | ||
|
|
4bd6be8a5f | ||
|
|
8b2f40724b | ||
|
|
e62c6e7dbe | ||
|
|
939e1095f2 | ||
|
|
6531719da5 | ||
|
|
3f53b02a53 | ||
|
|
011be49dda | ||
|
|
bcf2e10ae7 | ||
|
|
22ce955b95 | ||
|
|
e357f67faf | ||
|
|
8e2f0824f7 | ||
|
|
44f4d2be01 | ||
|
|
69dee5c732 | ||
|
|
2825c82076 | ||
|
|
3346659f2a | ||
|
|
f61e1d28fe | ||
|
|
30bdc09129 | ||
|
|
1108b5a19b | ||
|
|
963998f0ab | ||
|
|
80bb649ad1 | ||
|
|
4ac531afb3 | ||
|
|
97f2ce4031 | ||
|
|
3c3ef6dd26 | ||
|
|
1b767ac26b | ||
|
|
e5043d06c9 | ||
|
|
a91d5a8194 | ||
|
|
57e72dc198 | ||
|
|
48c954ca46 |
No files matched your search
+1
-7
@@ -8,12 +8,6 @@ branches:
|
||||
- PHP-5.6
|
||||
- PHP-7.0
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- NEWS
|
||||
- UPGRADING*
|
||||
- README.*
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
cache:
|
||||
@@ -23,7 +17,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.8
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
+1
-17
@@ -114,6 +114,7 @@ sapi/fpm/www.conf
|
||||
sapi/phpdbg/phpdbg_parser.c
|
||||
sapi/phpdbg/phpdbg_parser.h
|
||||
sapi/phpdbg/phpdbg
|
||||
sapi/phpdbg/phpdbg.1
|
||||
sapi/phpdbg/build
|
||||
sapi/phpdbg/*.output
|
||||
scripts/php-config
|
||||
@@ -156,22 +157,6 @@ ext/iconv/php_have_iconv.h
|
||||
ext/iconv/php_iconv_supports_errno.h
|
||||
ext/iconv/php_iconv_broken_ignore.h
|
||||
ext/iconv/php_iconv_aliased_libiconv.h
|
||||
ext/mbstring/libmbfl/Makefile.in
|
||||
ext/mbstring/libmbfl/autoscan.log
|
||||
ext/mbstring/libmbfl/config.sub
|
||||
ext/mbstring/libmbfl/depcomp
|
||||
ext/mbstring/libmbfl/ltmain.sh
|
||||
ext/mbstring/libmbfl/stamp-h1
|
||||
ext/mbstring/libmbfl/*.dll
|
||||
ext/mbstring/libmbfl/*.lib
|
||||
ext/mbstring/libmbfl/*.RES
|
||||
ext/mbstring/libmbfl/*.res
|
||||
ext/mbstring/libmbfl/*.obj
|
||||
ext/mbstring/libmbfl/*.tds
|
||||
ext/mbstring/libmbfl/filters/Makefile.in
|
||||
ext/mbstring/libmbfl/mbfl/Makefile.in
|
||||
ext/mbstring/libmbfl/mbfl/EastAsianWidth.txt
|
||||
ext/mbstring/libmbfl/nls/Makefile.in
|
||||
ext/mbstring/oniguruma/oniguruma.h
|
||||
ext/oci8/tests/*.vglog
|
||||
ext/pdo/conftest*
|
||||
@@ -223,5 +208,4 @@ ext/sqlite3/tests/phpsql*
|
||||
# Special cases to invert previous ignore rules
|
||||
!ext/fileinfo/libmagic.patch
|
||||
!ext/mbstring/oniguruma.patch
|
||||
!scripts/dev/generate-phpt/tests/*.php
|
||||
!ext/pcre/pcre2lib/config.h
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
||||
+27
-7
@@ -150,19 +150,39 @@ User Functions/Methods Naming Conventions
|
||||
'buildsomewidget'
|
||||
'getI()'
|
||||
|
||||
7. Classes should be given descriptive names. Avoid using abbreviations where
|
||||
7. Class names should be descriptive nouns in PascalCase and as short as
|
||||
possible. Each word in the class name should start with a capital letter,
|
||||
without underscore delimiters (CamelCaps starting with a capital letter).
|
||||
The class name should be prefixed with the name of the 'parent set' (e.g.
|
||||
the name of the extension)::
|
||||
without underscore delimiters. The class name should be prefixed with the
|
||||
name of the "parent set" (e.g. the name of the extension) if no namespaces
|
||||
are used. Abbreviations and acronyms as well as initialisms should be
|
||||
avoided wherever possible, unless they are much more widely used than the
|
||||
long form (e.g. HTTP or URL). Abbreviations start with a capital letter
|
||||
followed by lowercase letters, whereas acronyms and initialisms are written
|
||||
according to their standard notation. Usage of acronyms and initialisms is
|
||||
not allowed if they are not widely adopted and recognized as such.
|
||||
|
||||
Good:
|
||||
'Curl'
|
||||
'FooBar'
|
||||
'CurlResponse'
|
||||
'HTTPStatusCode'
|
||||
'URL'
|
||||
'BTreeMap' (B-tree Map)
|
||||
'Id' (Identifier)
|
||||
'ID' (Identity Document)
|
||||
'Char' (Character)
|
||||
'Intl' (Internationalization)
|
||||
'Radar' (Radio Detecting and Ranging)
|
||||
|
||||
Bad:
|
||||
'foobar'
|
||||
'foo_bar'
|
||||
'curl'
|
||||
'curl_response'
|
||||
'HttpStatusCode'
|
||||
'Url'
|
||||
'BtreeMap'
|
||||
'ID' (Identifier)
|
||||
'CHAR'
|
||||
'INTL'
|
||||
'RADAR' (Radio Detecting and Ranging)
|
||||
|
||||
Internal Function Naming Conventions
|
||||
----------------------
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
For the list of people who've put work into PHP, please see
|
||||
http://www.php.net/credits.php
|
||||
|
||||
https://www.php.net/credits.php
|
||||
+108
-63
@@ -3,7 +3,6 @@
|
||||
|
||||
Maintenance legend
|
||||
------------------
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below.
|
||||
@@ -68,59 +67,71 @@ STATUS: 5.6
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>,Christopher Jones <sixd@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2002 - 2007)
|
||||
Christopher Jones <sixd@php.net> (2008 - 2013)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2011 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: DBM abstraction for db2, db3, db4, dbm, ndbm, gdbm, ini
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu>
|
||||
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu> (2003 - 2005)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqli
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net> (2003 - 2006)
|
||||
Andrey Hristov <andrey@php.net> (2003 - 2016)
|
||||
Johannes Schlüter <johannes@php.net> (2008 - 2014)
|
||||
Ulf Wendel <uw@php.net> (2007 - 2013)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqlnd
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net> (2007 - 2017)
|
||||
Johannes Schlüter <johannes@php.net> (2008 - 2018)
|
||||
Ulf Wendel <uw@php.net> (2009 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>, Antony Dovgal <tony2001@php.net>
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net> (2007 - 2017)
|
||||
Antony Dovgal <tony2001@php.net> (2003 - 2009)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
|
||||
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net> (2000 - 2004)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Wez Furlong <wez@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2011)
|
||||
Wez Furlong <wez@php.net> (2004 - 2006)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net> (2016 - 2017)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_firebird
|
||||
PRIMARY MAINTAINER: Lars Westermann <lwe@php.net>
|
||||
PRIMARY MAINTAINER: Lars Westermann <lwe@php.net> (2007 - 2007)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_mysql
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Johannes Schlüter <johannes@php.net>, Andrey Hristov <andrey@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2010)
|
||||
Johannes Schlüter <johannes@php.net> (2008 - 2014)
|
||||
Andrey Hristov <andrey@php.net> (2005 - 2015)
|
||||
Ulf Wendel <uw@php.net> (2008 - 2012)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
@@ -132,31 +143,32 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net> (2007 - 2017)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_pgsql
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2011)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_sqlite
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2005 - 2011)
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2002 - 2007)
|
||||
Yasuo Ohgaki <yohgaki@php.net> (2001 - 2015)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug.
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sqlite3
|
||||
PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net>
|
||||
PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net> (2008 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
@@ -168,34 +180,38 @@ COMMENT: Integrates SQLite 3 embeddable SQL database engine.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dom
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Börger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net> (2003 - 2011)
|
||||
Rob Richards <rrichards@php.net> (2003 - 2012)
|
||||
Marcus Börger <helly@php.net> (2003 - 2006)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: simplexml
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2008)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: soap
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2004 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (1999 - 2003)
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>, Rob Richards <rrichards@php.net>
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net> (1999 - 2002)
|
||||
Rob Richards <rrichards@php.net> (2003 - 2013)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: libxml
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2003 - 2009)
|
||||
Christian Stocker <chregu@php.net> (2004 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -205,17 +221,19 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlrpc
|
||||
PRIMARY MAINTAINER: Dan Libby
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xmlwriter
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2004 - 2010)
|
||||
Christian Stocker <chregu@php.net> (2004 - 2004)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xsl
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net> (2003 - 2011)
|
||||
Rob Richards <rrichards@php.net> (2003 - 2010)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
@@ -226,39 +244,41 @@ SINCE: 5.0
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bcmath
|
||||
MAINTENANCE: Andi Gutmans <andi@zend.com>
|
||||
MAINTENANCE: Andi Gutmans <andi@zend.com> (2000 - 2004)
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bz2
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2004 - 2004)
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: calendar
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2000 - 2004)
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: com_dotnet
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net> (2003 - 2005)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Windows
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ctype
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2000 - 2004)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: curl
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>, Ilia Alshanetsky <iliaa@php.net>, Pierrick Charron <pierrick@php.net>
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net> (2000 - 2004)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2002 - 2011)
|
||||
Pierrick Charron <pierrick@php.net> (2010 - 2016)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: date
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2005 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -269,19 +289,22 @@ STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net>
|
||||
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net> (2010 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fileinfo
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2004 - 2008)
|
||||
Anatol Belski <ab@php.net> (2012 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filter
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>, Pierre-Alain Joye <pajoye@php.net>, Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2006 - 2006)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2006 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.2
|
||||
@@ -292,7 +315,8 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net> (2002 - 2016)
|
||||
Christoph M. Becker <cmb@php.net> (2015 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -301,84 +325,98 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gmp
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net>, Antony Dovgal <tony2001@php.net>
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2000 - 2018)
|
||||
Antony Dovgal <tony2001@php.net> (2005 - 2010)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hash
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net> (2005 - 2017)
|
||||
Mike Wallner <mike@php.net> (2005 - 2013)
|
||||
Anatol Belski <ab@php.net> (2014 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net> (2002 - 2010)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: intl
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net>
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2008 - 2018)
|
||||
Anatol Belski <ab@php.net> (2017 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: imap
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>, Ilia Alshanetsky <iliaa@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org> (1999 - 2004)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2002 - 2010)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2008 - 2010)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: json
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net> (2014 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>, Douglas Goldstein <cardoe@php.net>, Pierre-Alain Joye <pajoye@php.net>, Côme Bernigaud <mcmic@php.net>
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net> (2000 - 2002)
|
||||
Douglas Goldstein <cardoe@php.net> (2007 - 2007)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2008 - 2010)
|
||||
Côme Bernigaud <mcmic@php.net> (2015 - 2017)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mbstring
|
||||
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net>
|
||||
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net> (2001 - 2013)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2013 - 2018)
|
||||
Xinchen Hui <laruence@php.net> (2013 - 2018)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net> (2001 - 2006)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcntl
|
||||
PRIMARY MAINTAINER: Arnaud Le Blanc <lbarnaud@php.net>
|
||||
PRIMARY MAINTAINER: Arnaud Le Blanc <lbarnaud@php.net> (2008 - 2010)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>, Nuno Lopes <nlopess@php.net>
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (1999 - 2006)
|
||||
Nuno Lopes <nlopess@php.net> (2006 - 2009)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phar
|
||||
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net>, Marcus Börger <helly@php.net>, Steph Fox <sfox@php.net>
|
||||
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net> (2008 - 2009)
|
||||
Marcus Börger <helly@php.net> (2008 - 2008)
|
||||
Steph Fox <sfox@php.net> (2008 - 2008)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de> (2000 - 2000)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pspell
|
||||
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com>
|
||||
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com> (2000 - 2004)
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
@@ -388,45 +426,50 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de> (2000 - 2000)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: reflection
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2009)
|
||||
Johannes Schlüter <johannes@php.net> (2006 - 2014)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx> (1999 - 2004)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2002 - 2012)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: shmop
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2002 - 2008)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net>, Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net> (2011 - 2013)
|
||||
Rasmus Lerdorf <rasmus@php.net> (1999 - 2002)
|
||||
Pierre-Alain Joye <pajoye@php.net> (2010 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sockets
|
||||
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
|
||||
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org> (2000 - 2000)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sodium
|
||||
PRIMARY MAINTAINER: Frank Denis <jedisct1@php.net>
|
||||
PRIMARY MAINTAINER: Frank Denis <jedisct1@php.net> (2017 - 2017)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 7.2.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: spl
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Etienne Kneuss <colder@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2009)
|
||||
Etienne Kneuss <colder@php.net> (2008 - 2014)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0.0
|
||||
@@ -444,22 +487,24 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tidy
|
||||
PRIMARY MAINTAINER: John Coggeshall <john@php.net>, Ilia Alshanetsky <iliaa@php.net>, Nuno Lopes <nlopess@php.net>
|
||||
PRIMARY MAINTAINER: John Coggeshall <john@php.net> (2003 - 2006)
|
||||
Ilia Alshanetsky <iliaa@php.net> (2003 - 2009)
|
||||
Nuno Lopes <nlopess@php.net> (2006 - 2012)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tokenizer
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (2002 - 2002)
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zip
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de> (1999 - 2003)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -1,3 +1,3 @@
|
||||
For installation of PHP, please refer to the online documentation available at:
|
||||
|
||||
http://php.net/install
|
||||
https://php.net/install
|
||||
+1
-1
@@ -121,7 +121,7 @@ distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
|
||||
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
|
||||
rm -f ext/phar/phar.phar ext/phar/phar.php
|
||||
|
||||
@@ -1,5 +1,240 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
30 Aug 2018, PHP 7.3.0beta3
|
||||
|
||||
- Core:
|
||||
. Fixed #76773 (Traits used on the parent are ignored for child classes).
|
||||
(daverandom)
|
||||
. Fixed #76767 (‘asm’ operand has impossible constraints in zend_operators.h).
|
||||
(ondrej)
|
||||
. Fixed bug #76754 (parent private constant in extends class memory leak).
|
||||
(Laruence)
|
||||
. Fixed bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in
|
||||
_get_zval_ptr_tmp failed). (Laruence)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #76285 (DOMDocument::formatOutput attribute sometimes ignored).
|
||||
(Andrew Nester, Laruence, Anatol)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #68180 (iconv_mime_decode can return extra characters in a
|
||||
header). (cmb)
|
||||
. Fixed bug #63839 (iconv_mime_decode_headers function is skipping headers).
|
||||
(cmb)
|
||||
. Fixed bug #60494 (iconv_mime_decode does ignore special characters). (cmb)
|
||||
. Fixed bug #55146 (iconv_mime_decode_headers() skips some headers). (cmb)
|
||||
. Fixed bug #53891 (iconv_mime_encode() fails to Q-encode UTF-8 string). (cmb)
|
||||
|
||||
- libxml:
|
||||
. Fixed bug #76777 ("public id" parameter of libxml_set_external_entity_loader
|
||||
callback undefined). (Ville Hukkamäki)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
|
||||
file). (Laruence)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #76712 (Assignment of empty string creates extraneous text node).
|
||||
(cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #68825 (Exception in DirectoryIterator::getLinkTarget()). (cmb)
|
||||
. Fixed bug #68175 (RegexIterator pregFlags are NULL instead of 0). (Tim
|
||||
Siebels)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76778 (array_reduce leaks memory if callback throws exception).
|
||||
(cmb)
|
||||
. Fixed bug #76755 (setcookie does not accept "double" type for expire time).
|
||||
(Laruence)
|
||||
. Fixed bug #76674 (improve array_* failure messages exposing what was passed
|
||||
instead of an array). (carusogabriel)
|
||||
|
||||
16 Aug 2018, PHP 7.3.0beta2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76030 (RE2C_FLAGS rarely honoured) (Cristian Rodríguez)
|
||||
. Fixed broken zend_read_static_property (Laruence)
|
||||
|
||||
- Bz2:
|
||||
. Fixed arginfo for bzcompress. (Tyson Andre)
|
||||
|
||||
- DOM:
|
||||
. Reverted fix for bug #76285 (DOMDocument::formatOutput attribute sometimes
|
||||
ignored). (cmb)
|
||||
|
||||
- gettext:
|
||||
. Fixed bug #76517 (incorrect restoring of LDFLAGS). (sji)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74484 (MessageFormatter::formatMessage memory corruption with
|
||||
11+ named placeholders). (Anatol)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76704 (mb_detect_order return value varies based on argument
|
||||
type). (cmb)
|
||||
. Fixed bug #76706 (mbstring.http_output_conv_mimetypes is ignored). (cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #76705 (unusable ssl => peer_fingerprint in
|
||||
stream_context_create()). (Jakub Zelenka)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76595 (phpdbg man page contains outdated information).
|
||||
(Kevin Abel)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76688 (Disallow excessive parameters after options array).
|
||||
(pmmaga)
|
||||
. Fixed bug #76713 (Segmentation fault caused by property corruption).
|
||||
(Laruence)
|
||||
|
||||
- Tidy:
|
||||
. Fixed arginfo for tidy::__construct(). (Tyson Andre)
|
||||
|
||||
- zlib:
|
||||
. Fixed bug #65988 (Zlib version check fails when an include/zlib/ style dir
|
||||
is passed to the --with-zlib configure option). (Jay Bonci)
|
||||
. Fixed bug #76709 (Minimal required zlib library is 1.2.0.4). (petk)
|
||||
|
||||
02 Aug 2018, PHP 7.3.0beta1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76667 (Segfault with divide-assign op and __get + __set).
|
||||
(Laruence)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #75402 (Possible Memory Leak using PDO::CURSOR_SCROLL option).
|
||||
(Anatol)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #68553 (array_column: null values in $index_key become incrementing
|
||||
keys in result). (Laruence)
|
||||
. Fixed bug #76643 (Segmentation fault when using `output_add_rewrite_var`).
|
||||
(cmb)
|
||||
. Added support for the SameSite cookie directive, including an alternative
|
||||
signature for setcookie(), setrawcookie() and session_set_cookie_params().
|
||||
(Frederik Bosch, pmmaga)
|
||||
|
||||
19 Jul 2018, PHP 7.3.0alpha4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #33502 (Some nullary functions don't check the number of
|
||||
arguments). (cmb)
|
||||
. Fixed bug #76392 (Error relocating sapi/cli/php: unsupported relocation
|
||||
type 37). (Peter Kokot)
|
||||
. The declaration and use of case-insensitive constants has been deprecated.
|
||||
(Nikita)
|
||||
. Added syslog.filter INI entry for syslog filtering. (Philip Prindeville)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #52974 (jewish.c: compile error under Windows with GBK charset).
|
||||
(cmb)
|
||||
|
||||
- Filter:
|
||||
. Added the 'add_slashes' sanitization mode (FILTER_SANITIZE_ADD_SLASHES).
|
||||
(Kalle)
|
||||
. Fixed bug #76366 (References in sub-array for filtering breaks the filter).
|
||||
(ZiHang Gao)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #62596 (getallheaders() missing with PHP-FPM). (Remi)
|
||||
. Added fpm_get_status function. (Till Backhaus)
|
||||
. Fixed bug #69031 (Long messages into stdout/stderr are truncated
|
||||
incorrectly) - added new log related FPM configuration options:
|
||||
log_limit, log_buffering and decorate_workers_output. (Jakub Zelenka)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76574 (use of undeclared identifiers INT_MAX and LONG_MAX). (cmb)
|
||||
. Fixed bug #76594 (Bus Error due to unaligned access in zend_ini.c
|
||||
OnUpdateLong). (cmb, Nikita)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Fixed bug #74462 (PDO_Firebird returns only NULLs for results with boolean
|
||||
for FIREBIRD >= 3.0). (Dorin Marcoci)
|
||||
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
|
||||
. Fixed bug #76136 (stream_socket_get_name should enclose IPv6 in brackets).
|
||||
(seliver)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
|
||||
(Timur Ibragimov)
|
||||
|
||||
05 Jul 2018, PHP 7.3.0alpha3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76534 (PHP hangs on 'illegal string offset on string references
|
||||
with an error handler). (Laruence)
|
||||
. Fixed bug #76520 (Object creation leaks memory when executed over HTTP).
|
||||
(Nikita)
|
||||
. Fixed bug #76502 (Chain of mixed exceptions and errors does not serialize
|
||||
properly). (Nikita)
|
||||
. Fixed bug #76509 (Inherited static properties can be desynchronized from
|
||||
their parent by ref). (Nikita)
|
||||
. Fixed bug #76439 (Changed behaviour in unclosed HereDoc). (Nikita, tpunt)
|
||||
. Added syslog.facility and syslog.ident INI entries for customizing syslog
|
||||
logging. (Philip Prindeville)
|
||||
. Fixed bug #63217 (Constant numeric strings become integers when used as
|
||||
ArrayAccess offset). (Rudi Theunissen, Dmitry)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #76285 (DOMDocument::formatOutput attribute sometimes ignored).
|
||||
(Andrew Nester)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
|
||||
non-blocking). (Nikita)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #74670 (Integer Underflow when unserializing GMP and possible
|
||||
other classes). (Nikita)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76556 (get_debug_info handler for BreakIterator shows wrong
|
||||
type). (cmb)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76532 (Integer overflow and excessive memory usage
|
||||
in mb_strimwidth). (MarcusSchwarz)
|
||||
|
||||
- OpenSSL:
|
||||
. Add min_proto_version and max_proto_version ssl stream options as well as
|
||||
related constants for possible TLS protocol values. (Jakub Zelenka)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #76512 (\w no longer includes unicode characters). (cmb)
|
||||
. Fixed bug #76514 (Regression in preg_match makes it fail with
|
||||
PREG_JIT_STACKLIMIT_ERROR). (Anatol)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #76548 (pg_fetch_result did not fetch the next row). (Anatol)
|
||||
|
||||
- phpdbg:
|
||||
. Fix arginfo wrt. optional/required parameters. (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #76536 (PHP crashes with core dump when throwing exception in
|
||||
error handler). (Laruence)
|
||||
. Fixed bug #75231 (ReflectionProperty#getValue() incorrectly works with
|
||||
inherited classes). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys).
|
||||
(Laruence)
|
||||
. Fixed bug #71848 (getimagesize with $imageinfo returns false). (cmb)
|
||||
. Fixed bug #48016 (stdClass::__setState is not defined although var_export() uses it). (Andrea)
|
||||
|
||||
- Tokenizer:
|
||||
. Fixed bug #76538 (token_get_all with TOKEN_PARSE flag fails to recognise
|
||||
close tag with newline). (Nikita)
|
||||
|
||||
21 Jun 2018, PHP 7.3.0alpha2
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -28,6 +28,13 @@ Both functions return SUCCESS or FAILURE depending on the result.
|
||||
The auto-conversions are performed as necessary. Arrays, objects, and
|
||||
resources cannot be auto-converted.
|
||||
|
||||
PHP 5.3 includes a new function (actually implemented as macro):
|
||||
|
||||
int zend_parse_parameters_none();
|
||||
|
||||
This returns SUCCESS if no argument has been passed to the function,
|
||||
FAILURE otherwise.
|
||||
|
||||
PHP 5.5 includes a new function:
|
||||
|
||||
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
|
||||
@@ -221,3 +228,8 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs
|
||||
for (i = 0; i < num_varargs; i++) {
|
||||
/* do something with varargs[i] */
|
||||
}
|
||||
|
||||
/* Function that doesn't accept any arguments */
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -140,14 +140,14 @@ to upgrade.
|
||||
|
||||
*Wait for web and qa sites to update with new information before sending announce*
|
||||
|
||||
5. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
5. Send **separate** emails **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
lists pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release". Include in this information the verification
|
||||
information output by ``gen_verify_stub``.
|
||||
|
||||
6. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
6. Send **separate** emails (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
This email is to notify the selected projects about a new release so that they
|
||||
These emails are to notify the selected projects about a new release so that they
|
||||
can make sure their projects keep working. Make sure that you have been setup
|
||||
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
|
||||
Derick) run the following commands for you:
|
||||
@@ -156,9 +156,6 @@ Derick) run the following commands for you:
|
||||
|
||||
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
|
||||
|
||||
7. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
$Id$
|
||||
=============================================================================
|
||||
|
||||
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||
|
||||
A self-contained extension can be distributed independently of
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
An Overview of the PHP Streams abstraction
|
||||
==========================================
|
||||
$Id$
|
||||
|
||||
WARNING: some prototypes in this file are out of date.
|
||||
The information contained here is being integrated into
|
||||
|
||||
@@ -2,7 +2,7 @@ The PHP Interpreter
|
||||
===================
|
||||
|
||||
This is the github mirror of the official PHP repository located at
|
||||
http://git.php.net.
|
||||
https://git.php.net.
|
||||
|
||||
[](http://travis-ci.org/php/php-src)
|
||||
[](https://ci.appveyor.com/project/php/php-src)
|
||||
@@ -28,7 +28,7 @@ open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
time. The patch removes this warning
|
||||
|
||||
We do not merge pull requests directly on github. All PRs will be
|
||||
pulled and pushed through http://git.php.net.
|
||||
pulled and pushed through https://git.php.net.
|
||||
|
||||
|
||||
Guidelines for contributors
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
# make -f build.mk
|
||||
#
|
||||
# Written by Sascha Schumann
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
LT_TARGETS = ltmain.sh ltconfig
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// vim:ft=javascript
|
||||
// $Id$
|
||||
|
||||
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
|
||||
ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||
|
||||
+4
-4
@@ -1,4 +1,3 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Minimalistic configure.ac for TSRM.
|
||||
dnl
|
||||
@@ -12,10 +11,10 @@ AH_TOP([
|
||||
])
|
||||
|
||||
sinclude(tsrm.m4)
|
||||
|
||||
|
||||
TSRM_BASIC_CHECKS
|
||||
TSRM_THREADS_CHECKS
|
||||
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
@@ -32,4 +31,5 @@ unistd.h \
|
||||
limits.h
|
||||
)
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
@@ -1,6 +1,6 @@
|
||||
# =================================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
|
||||
# =================================================================================
|
||||
# ==================================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
|
||||
# ==================================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
@@ -46,7 +46,7 @@
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
@@ -61,7 +61,7 @@
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 7
|
||||
#serial 8
|
||||
|
||||
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
|
||||
|
||||
@@ -194,4 +194,3 @@ esac
|
||||
AC_LANG_POP
|
||||
|
||||
]) dnl end AC_DEFUN
|
||||
|
||||
+3
-25
@@ -1,26 +1,4 @@
|
||||
m4_include([TSRM/m4/gethostbyname.m4])
|
||||
|
||||
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
||||
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
|
||||
gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
|
||||
AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
|
||||
echo 'void somefunc() { };' > conftest.c
|
||||
cmd='$CC $1 -c conftest.c'
|
||||
if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
|
||||
ac_result=no
|
||||
else
|
||||
ac_result=yes
|
||||
fi
|
||||
eval $gcc_arg_name=$ac_result
|
||||
rm -f conftest.*
|
||||
])
|
||||
if eval test "\$$gcc_arg_name" = "yes"; then
|
||||
$2
|
||||
else
|
||||
:
|
||||
$3
|
||||
fi
|
||||
])
|
||||
m4_include([TSRM/m4/ax_func_which_gethostbyname_r.m4])
|
||||
|
||||
AC_DEFUN([TSRM_BASIC_CHECKS],[
|
||||
|
||||
@@ -75,9 +53,9 @@ AC_DEFUN([TSRM_CHECK_ST],[
|
||||
sinclude(threads.m4)
|
||||
|
||||
AC_DEFUN([TSRM_CHECK_PTHREADS],[
|
||||
|
||||
|
||||
PTHREADS_CHECK
|
||||
|
||||
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
|
||||
fi
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef TSRM_WIN32_H
|
||||
#define TSRM_WIN32_H
|
||||
|
||||
|
||||
@@ -44,6 +44,67 @@ Core:
|
||||
the following "FOO;" will cause a syntax error. This issue can always be
|
||||
resolved by choosing an ending label that does not occur within the contents
|
||||
of the string.
|
||||
. "continue" statements targeting "switch" control flow structures will now
|
||||
generate a warning. In PHP such "continue" statements are equivalent to
|
||||
"break", while they behave as "continue 2" in other languages.
|
||||
|
||||
while ($foo) {
|
||||
switch ($bar) {
|
||||
case "baz":
|
||||
continue;
|
||||
// Warning: "continue" targeting switch is equivalent to
|
||||
"break". Did you mean to use "continue 2"?
|
||||
}
|
||||
}
|
||||
|
||||
. Array accesses of type $obj["123"], where $obj implements ArrayAccess and
|
||||
"123" is an integral string literal will no longer result in an implicit
|
||||
conversion to integer, i.e., $obj->offsetGet("123") will be called instead
|
||||
of $obj->offsetGet(123). This matches existing behavior for non-literals.
|
||||
The behavior of arrays is not affected in any way, they continue to
|
||||
implicitly convert integeral string keys to integers.
|
||||
. In PHP, static properties are shared between inheriting classes, unless the
|
||||
static property is explicitly overridden in a child class. However, due to
|
||||
an implementation artifact it was possible to separate the static properties
|
||||
by assigning a reference. This loophole has been fixed.
|
||||
|
||||
class Test {
|
||||
public static $x = 0;
|
||||
}
|
||||
class Test2 extends Test { }
|
||||
|
||||
Test2::$x = &$x;
|
||||
$x = 1;
|
||||
|
||||
var_dump(Test::$x, Test2::$x);
|
||||
// Previously: int(0), int(1)
|
||||
// Now: int(1), int(1)
|
||||
|
||||
. References returned by array and property accesses are now unwrapped as
|
||||
part of the access. This means that it is no longer possible to modify the
|
||||
reference between the access and the use of the accessed value:
|
||||
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
// Previously: int(4), Now: int(3)
|
||||
|
||||
This makes the behavior of references and non-references consistent. Please
|
||||
note that reading and writing a value inside a single expression remains
|
||||
undefined behavior and may change again in the future.
|
||||
|
||||
. Argument unpacking stopped working with Traversables with non-integer keys.
|
||||
The following code worked in PHP 7.0-7.2 by accident.
|
||||
|
||||
function foo(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
function gen() {
|
||||
yield 1.23 => 123;
|
||||
}
|
||||
foo(...gen());
|
||||
|
||||
Now it generates an exception.
|
||||
|
||||
BCMath:
|
||||
. All warnings thrown by BCMath functions are now using PHP's error handling.
|
||||
@@ -51,6 +112,12 @@ BCMath:
|
||||
. bcmul() and bcpow() now return numbers with the requested scale. Formerly,
|
||||
the returned numbers may have omitted trailing decimal zeroes.
|
||||
|
||||
MBString:
|
||||
. Due to added support for named captures, mb_ereg_*() patterns using named
|
||||
captures will behave differently. In particular named captures will be part
|
||||
of matches and mb_ereg_replace() will interpret additional syntax. See
|
||||
"New Features" section for more information.
|
||||
|
||||
mysqli:
|
||||
. Prepared statements now properly report the fractional seconds for DATETIME/
|
||||
TIME/TIMESTAMP columns with decimals specifier (e.g. TIMESTAMP(6) when using
|
||||
@@ -85,8 +152,10 @@ SimpleXML:
|
||||
Standard:
|
||||
. Undefined variables passed to compact() will now be reported as a notice.
|
||||
. getimagesize() and related functions now report the mime type of BMP images
|
||||
as image/bmp instead of image/x-ms-bmp, since the former has been registered
|
||||
with the IANA (see RFC 7903).
|
||||
as image/bmp instead of image/x-ms-bmp, since the former has been registered
|
||||
with the IANA (see RFC 7903).
|
||||
. stream_socket_get_name() will now return IPv6 addresses wrapped in brackets.
|
||||
For example "[::1]:1337" will be returned instead of "::1:1337".
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
@@ -108,6 +177,8 @@ Core:
|
||||
of generating a fatal error. Currently this only affects compilation errors
|
||||
that may be thrown by token_get_all() in TOKEN_PARSE mode, but more errors
|
||||
may be converted in the future.
|
||||
. Trailing commas in function and method calls are now allowed.
|
||||
(RFC: https://wiki.php.net/rfc/trailing-comma-function-calls)
|
||||
|
||||
BCMath:
|
||||
. bcscale() can now also be used as getter to retrieve the current scale in use.
|
||||
@@ -144,25 +215,112 @@ MBString:
|
||||
. Mbstring now correctly supports strings larger than 2GB.
|
||||
. Performance of the mbstring extension has been significantly improved
|
||||
across the board. The largest improvements are in case conversion functions.
|
||||
. mb_ereg_*() functions now support named captures. Matching functions like
|
||||
mb_ereg() will now return named captures both using their group number and
|
||||
their name, similar to PCRE:
|
||||
|
||||
mb_ereg('(?<word>\w+)', '国', $matches);
|
||||
// => [0 => "国", 1 => "国", "word" => "国"];
|
||||
|
||||
Additionally, mb_ereg_replace() now supports the \k<> and \k'' notations
|
||||
to reference named captures in the replacement string:
|
||||
|
||||
mb_ereg_replace('\s*(?<word>\w+)\s*', "_\k<word>_\k'word'_", ' foo ');
|
||||
// => "_foo_foo_"
|
||||
|
||||
\k<> and \k'' can also be used for numbered references, which also works
|
||||
with group numbers greater than 9.
|
||||
|
||||
readline:
|
||||
. Support for the completion_append_character and completion_suppress_append
|
||||
options has been added to readline_info(). These options are only available
|
||||
if PHP is linked against libreadline (rather than libedit).
|
||||
|
||||
Standard:
|
||||
. The --with-password-argon2[=dir] configure argument now provides support for
|
||||
both Argon2i and Argon2id hashes in the password_hash(), password_verify(),
|
||||
password_get_info(), and password_needs_rehash() functions. Passwords may be
|
||||
hashed and verified using the PASSWORD_ARGON2ID constant.
|
||||
Support for both Argon2i and Argon2id in the password_* functions now requires
|
||||
PHP be linked against libargon2 reference library >= 20161029.
|
||||
(RFC: https://wiki.php.net/rfc/argon2_password_hash_enhancements).
|
||||
|
||||
========================================
|
||||
3. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
phpdbg:
|
||||
. The unused constants PHPDBG_FILE, PHPDBG_METHOD, PHPDBG_LINENO and
|
||||
PHPDBG_FUNC have been removed.
|
||||
|
||||
FPM:
|
||||
. The getallheaders function is now also available.
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
========================================
|
||||
|
||||
Core:
|
||||
. The declaration of case-insensitive constants has been deprecated. Passing
|
||||
true as the third argument to define() will now generate a deprecation
|
||||
warning. The use of case-insensitive constants with a case that differs from
|
||||
the declaration is also deprecated.
|
||||
(RFC: https://wiki.php.net/rfc/case_insensitive_constant_deprecation)
|
||||
. Declaring a function called assert() inside a namespace is deprecated.
|
||||
The assert() function is subject to special handling by the engine, which
|
||||
may lead to inconsistent behavior when defining a namespaced function with
|
||||
the same name.
|
||||
|
||||
Filter:
|
||||
. The explicit usage of the constants FILTER_FLAG_SCHEME_REQUIRED and
|
||||
FILTER_FLAG_HOST_REQUIRED is now deprecated; both are implied for
|
||||
FILTER_VALIDATE_URL anyway.
|
||||
|
||||
GD:
|
||||
. image2wbmp() has been deprecated.
|
||||
|
||||
Intl:
|
||||
. Usage of the Normalizer::NONE form throws a deprecation warning, if PHP is linked with ICU >= 56.
|
||||
. Usage of the Normalizer::NONE form throws a deprecation warning, if PHP is
|
||||
linked with ICU >= 56.
|
||||
|
||||
Mbstring:
|
||||
. The following undocumented mbereg_*() aliases have been deprecated. Use the
|
||||
corresponding mb_ereg_*() variants instead.
|
||||
. mbregex_encoding()
|
||||
. mbereg()
|
||||
. mberegi()
|
||||
. mbereg_replace()
|
||||
. mberegi_replace()
|
||||
. mbsplit()
|
||||
. mbereg_match()
|
||||
. mbereg_search()
|
||||
. mbereg_search_pos()
|
||||
. mbereg_search_regs()
|
||||
. mbereg_search_init()
|
||||
. mbereg_search_getregs()
|
||||
. mbereg_search_getpos()
|
||||
. mbereg_search_setpos()
|
||||
|
||||
PDO ODBC:
|
||||
. The pdo_odbc.db2_instance_name ini setting has been formally deprecated. It
|
||||
has already been deprecated in the documentation since PHP 5.1.1.
|
||||
|
||||
Standard:
|
||||
. Passing a non-string needle to string search functions is deprecated. In the
|
||||
future the needle will be interpreted as a string instead of an ASCII codepoint.
|
||||
Depending on the intended behavior, you should either explicitly cast the
|
||||
needle to string or perform an explicit call to ord(). The following functions
|
||||
are affected:
|
||||
. strpos()
|
||||
. strrpos()
|
||||
. stripos()
|
||||
. strripos()
|
||||
. strstr()
|
||||
. strchr()
|
||||
. strrchr()
|
||||
. stristr()
|
||||
. The fgetss() function and the string.strip_tags stream filter have been deprecated.
|
||||
This also affects the SplFileObject::fgetss() method and gzgetss() function.
|
||||
|
||||
========================================
|
||||
5. Changed Functions
|
||||
@@ -176,11 +334,23 @@ JSON:
|
||||
precedence over JSON_THROW_ON_ERROR.
|
||||
(RFC: https://wiki.php.net/rfc/json_throw_on_error)
|
||||
|
||||
Session:
|
||||
. session_set_cookie_params() now also supports the following signature:
|
||||
session_set_cookie_params(array $options)
|
||||
where $options is an associative array which may have any of the keys
|
||||
"lifetime", "path", "domain", "secure", "httponly" and "samesite".
|
||||
Accordingly, the return value of session_get_cookie_params() now also has an
|
||||
element with the key "samesite".
|
||||
|
||||
Standard:
|
||||
. debug_zval_dump() was changed to display recursive arrays and objects
|
||||
in the same way as var_dump(). Now, it doesn't display them twice.
|
||||
. array_push() and array_unshift() can now also be called with a single
|
||||
argument, which is particularly convenient wrt. the spread operator.
|
||||
. setcookie() and setrawcookie() now also support the following signature:
|
||||
set(raw)cookie(string $name, [string $value, [array $options]])
|
||||
where $options is an associative array which may have any of the keys
|
||||
"expires", "path", "domain", "secure", "httponly" and "samesite".
|
||||
|
||||
PCRE:
|
||||
. preg_quote() now also escapes the '#' character.
|
||||
@@ -204,6 +374,9 @@ Date:
|
||||
. Added the DateTime::createFromImmutable() method, which mirrors
|
||||
DateTimeImmutable::createFromMutable().
|
||||
|
||||
FPM:
|
||||
. Added fpm_get_status() function which returns FPM status info array.
|
||||
|
||||
GMP:
|
||||
. Added gmp_binomial(n, k) for calculating binomial coefficients.
|
||||
. Added gmp_lcm(a, b) for calculating the least common multiple.
|
||||
@@ -248,6 +421,9 @@ Standard:
|
||||
. Added is_countable() function, to check whether a value may be passed to
|
||||
count().
|
||||
(RFC: https://wiki.php.net/rfc/is-countable)
|
||||
. Added array_key_first() and array_key_last() which retrieve the first and
|
||||
last key of an array, respectively.
|
||||
(RFC: <https://wiki.php.net/rfc/array_key_first_last>)
|
||||
|
||||
========================================
|
||||
7. New Classes and Interfaces
|
||||
@@ -271,6 +447,9 @@ JSON:
|
||||
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
|
||||
defines the set of allowed thousand separator chars. The default (`"',."`)
|
||||
is fully backward compatible with former PHP versions.
|
||||
. FILTER_SANITIZE_ADD_SLASHES has been added as an alias of the 'magic_quotes'
|
||||
filter (FILTER_SANITIZE_MAGIC_QUOTES). The 'magic_quotes' filter is subject
|
||||
to removal in future versions of PHP.
|
||||
|
||||
FTP:
|
||||
. Set default transfer mode to binary
|
||||
@@ -287,6 +466,16 @@ JSON:
|
||||
. Support for ODBCRouter has been removed.
|
||||
. Support for Birdstep has been removed.
|
||||
|
||||
PCRE:
|
||||
. The PCRE extension has been upgraded to PCRE2, which may cause minor
|
||||
behavioral changes, and augments the existing regular expression syntax.
|
||||
See <https://wiki.php.net/rfc/pcre2-migration> for details.
|
||||
|
||||
Standard:
|
||||
. var_export() now exports stdClass objects as an array casted to an object
|
||||
(`(object) array( ... )`), rather than using the nonexistent method
|
||||
stdClass::__setState().
|
||||
|
||||
ZIP:
|
||||
. Bundled libzip has been dropped,
|
||||
system library is now required.
|
||||
@@ -301,6 +490,13 @@ Curl:
|
||||
JSON:
|
||||
. JSON_THROW_ON_ERROR
|
||||
|
||||
MBString:
|
||||
. MB_CASE_FOLD
|
||||
. MB_CASE_LOWER_SIMPLE
|
||||
. MB_CASE_UPPER_SIMPLE
|
||||
. MB_CASE_TITLE_SIMPLE
|
||||
. MB_CASE_FOLD_SIMPLE
|
||||
|
||||
PGSQL:
|
||||
. Requires Postgres 9.3
|
||||
- PGSQL_DIAG_SCHEMA_NAME
|
||||
@@ -311,6 +507,9 @@ PGSQL:
|
||||
. Requires Postgres 9.6
|
||||
- PGSQL_DIAG_SEVERITY_NONLOCALIZED
|
||||
|
||||
Standard:
|
||||
. PASSWORD_ARGON2ID
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
@@ -322,6 +521,24 @@ PGSQL:
|
||||
. This INI directive has been removed. The value has already been ignored
|
||||
since PHP 5.3.0.
|
||||
|
||||
- session.cookie_samesite
|
||||
. New INI option to allow to set the SameSite directive for cookies. Defaults
|
||||
to "" (empty string), so no SameSite directive is set. Can be set to "Lax"
|
||||
or "Strict", which sets the respective SameSite directive.
|
||||
|
||||
- syslog.facility
|
||||
- New INI to set syslog facility which specifies what type of program is
|
||||
logging the message. It is used only when error_log is set to syslog.
|
||||
|
||||
- syslog.filter
|
||||
. New INI to set syslog filter type to filter the logged messages. There are
|
||||
3 supported filter types - all, no-ctrl and ascii. It is used only when
|
||||
error_log is set to syslog.
|
||||
|
||||
- syslog.ident
|
||||
. New INI to set syslog ident string which is prepended to every message. It
|
||||
is used only when error_log is set syslog.
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
========================================
|
||||
|
||||
+61
-4
@@ -18,6 +18,17 @@ PHP 7.3 INTERNALS UPGRADE NOTES
|
||||
o. IS_UNUSED
|
||||
p. VM instruction operands (FETCH_CLASS, FETCH_CONSTANT, CATCH)
|
||||
q. sapi_cli_single_write()
|
||||
r. php_url
|
||||
s. zend_function.reserved[]
|
||||
t. zif_handler
|
||||
u. GC_G
|
||||
v. php_add[c]slashes
|
||||
w. zend_class_entry.iterator_funcs
|
||||
x. Class declaration opcodes (DECLARE_INHERITED_CLASS ...)
|
||||
y. zend_constant
|
||||
z. HAVE_ST_BLKSIZE and HAVE_ST_RDEV
|
||||
aa. RETSIGTYPE
|
||||
bb. php_setcookie
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -46,8 +57,8 @@ PHP 7.3 INTERNALS UPGRADE NOTES
|
||||
As result some related macros were removed (ZEND_EX_USE_LITERALS,
|
||||
EX_LOAD_LITERALS, EX_LITERALS, RT_CONSTANT_EX, EX_CONSTANT) or changed
|
||||
(RT_CONSTANT, ZEND_PASS_TWO_UPDATE_CONSTANT, ZEND_PASS_TWO_UNDO_CONSTANT).
|
||||
This change way affect only some "system" extensions. EX_LITERALS,
|
||||
RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT than now
|
||||
This change may affect only some "system" extensions. EX_LITERALS,
|
||||
RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT, and now
|
||||
use "opline" (instead of "op_array") as first argument.
|
||||
|
||||
c. Protection from recursion during processing circular data structures was
|
||||
@@ -61,7 +72,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
|
||||
HASH_FLAG_APPLY_PROTECTION flag and ZEND_HASH_APPLY_PROTECTION() macro
|
||||
are removed. All mutable arrays should use recursion protection.
|
||||
Corresponding checks should be replaced by Z_REFCOUNTED() or
|
||||
!(GC_GLAGS(p) & GC_IMMUTABLE).
|
||||
!(GC_FLAGS(p) & GC_IMMUTABLE).
|
||||
|
||||
d. HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into
|
||||
GC_FLAGS (to be consistent with IS_STR_PERSISTENT).
|
||||
@@ -91,7 +102,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
|
||||
zend_register_persistent_resource_ex() should beused to register
|
||||
persistent resources, instead of manual insertion into EG(persistent_list).
|
||||
|
||||
i. The RANGE_RANGE() macro has been removed. php_mt_rand_range() should be
|
||||
i. The RAND_RANGE() macro has been removed. php_mt_rand_range() should be
|
||||
used instead.
|
||||
|
||||
j. The cast_object() object handler now also accepts the _IS_NUMBER type. The
|
||||
@@ -126,11 +137,57 @@ PHP 7.3 INTERNALS UPGRADE NOTES
|
||||
|
||||
q. sapi_cli_single_write() now returns ssize_t instead of size_t.
|
||||
|
||||
r. fields of php_url struct change from char * to zend_string *
|
||||
|
||||
s. Special purpose zend_functions marked by ZEND_ACC_CALL_VIA_TRAMPOLINE or
|
||||
ZEND_ACC_FAKE_CLOSURE flags use reserved[0] for internal purpose.
|
||||
Third party extensions must not modify reserved[] fields of these functions.
|
||||
|
||||
t. For internal functions the typedef zif_handler has been introduced. It is
|
||||
recommended to use this from now on, instead of defining own handler types.
|
||||
|
||||
u. The GC globals (GC_G) are now private. Use the new zend_gc_get_status() to
|
||||
retrieve status information of the GC.
|
||||
|
||||
v. The should_free argument of the php_add[c]slashes functions has been
|
||||
removed. It is now always the caller's responsibility to free the passed
|
||||
string.
|
||||
|
||||
w. zend_class_entry.iterator_funcs have been replaced by iterator_funcs_ptr.
|
||||
You don't have to set its value, setting parent.funcs in the get_iterator
|
||||
function is enough.
|
||||
|
||||
x. Class declaration opcode formats were changed
|
||||
- DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS now encode parent
|
||||
class name in second operand directly (as IS_CONST operand). Previously,
|
||||
parent class was fetched by the prior FETCH_CLASS opcode.
|
||||
- ADD_INTERFACE and ADD_TRAIT don't use run-time cache to keep interface or
|
||||
trait. These instructions are executed once, and caching is useless.
|
||||
|
||||
y. zend_constant.flags and zend_constant.module_number are packed into
|
||||
reserved space inside zend_constant.value. They should be accessed using
|
||||
ZEND_CONTANT_FLAGS(), ZEND_CONSTANTS_MODULE_NUMBER() and
|
||||
ZEND_CONTANT_SET_FLAGS() macros.
|
||||
|
||||
z. HAVE_ST_BLKSIZE must be replaced with HAVE_STRUCT_STAT_ST_BLKSIZE and
|
||||
HAVE_ST_RDEV must be replaced with HAVE_STRUCT_STAT_ST_RDEV.
|
||||
|
||||
aa. RETSIGTYPE has been removed from the generated php_config.h and should be
|
||||
replaced with void.
|
||||
|
||||
bb. php_setcookie() now expects an additional samesite argument, and the
|
||||
url_encode parameter has been moved to the end. The signature is now:
|
||||
int php_setcookie(zend_string *name, zend_string *value, time_t expires,
|
||||
zend_string *path, zend_string *domain, int secure,
|
||||
int httponly, zend_string *samesite, int url_encode);
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
========================
|
||||
|
||||
a. Unix build system changes
|
||||
- PHP_PROG_LEX, TSRM_CHECK_GCC_ARG, and LIBZEND_CPLUSPLUS_CHECKS Autoconf
|
||||
macros have been removed.
|
||||
|
||||
b. Windows build system changes
|
||||
- ZEND_WIN32_FORCE_INLINE doesn't affect C++ anymore. zend_always_inline is
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
Creating an object
|
||||
------------------
|
||||
|
||||
Object can be created in the following ways:
|
||||
|
||||
1. As a result of a function call. E.g.:
|
||||
|
||||
$foo = create_new_foo("parameter");
|
||||
$foo->run();
|
||||
|
||||
The function should create a new zval, create new object and get the
|
||||
handle for it, set handle and handler table as needed. Note that the
|
||||
handle is the only ID of the object, so it should be enough to
|
||||
identify it.
|
||||
|
||||
2. Overriding create_object handler for class. E.g.:
|
||||
|
||||
$foo = new Java("some.Class.here", "parameter");
|
||||
$foo->run();
|
||||
|
||||
The create_object handler function should create a new zval, create
|
||||
new object and get the handle for it, set handle and handler table as
|
||||
needed, and also provide constructor method that would handle
|
||||
constructor call. The get_constructor handler table entry should be
|
||||
used for that. Do not rely class entry's constructor, unless you refer
|
||||
to it from get_constructor handler.
|
||||
|
||||
Object maintenance
|
||||
------------------
|
||||
|
||||
The handlers add_ref and del_ref are called when a new zval referring
|
||||
to the object is created. This does not create a new object - both
|
||||
zvals still refer to the same object.
|
||||
|
||||
clone_obj handler should create a new object, identical to an old one,
|
||||
but being a separate entity.
|
||||
|
||||
delete_obj should destroy an object, all references to it become
|
||||
invalid.
|
||||
|
||||
Object access - read
|
||||
--------------------
|
||||
|
||||
read_property is used to read object's property. This value is not
|
||||
meant to be changed. The handler returns zval * with the value.
|
||||
|
||||
Object access - write
|
||||
---------------------
|
||||
|
||||
write_property is used to directly write object's property by
|
||||
name. This handler is used to assign property variables or to change them
|
||||
in operations like += or ++ (unless get_property_zval_ptr is also set).
|
||||
|
||||
get_property_zval_ptr is used to obtain pointer to modifiable zval for
|
||||
operations like += or ++. This should be used only if your object model
|
||||
stores properties as real zval's that can be modified from outside.
|
||||
Otherwise this handler should be NULL and the engine will use
|
||||
read_property and write_property instead.
|
||||
|
||||
get_property_ptr is used to obtain zval ** for future writing to
|
||||
it. If your object properties are stored as zval*, return real place
|
||||
where the property is stored. If the aren't, the best way is to create
|
||||
proxy object and handle it via get and set methods (see below).
|
||||
This method is meant to be used for send-by-reference and assign-by-reference
|
||||
use of object properties. If you don;t want to implement property
|
||||
referencing for your objects, you can set this handler to NULL.
|
||||
|
||||
get and set handlers are used when engine needs to access the object
|
||||
as a value. E.g., in the following situation:
|
||||
|
||||
$foo =& $obj->bar;
|
||||
$foo = 1;
|
||||
|
||||
if $foo is an object (e.g., proxy object from get_property_ptr) it
|
||||
would be accessed using write handler.
|
||||
|
||||
Object access - method call
|
||||
---------------------------
|
||||
|
||||
get_method handler is used to find method description by name. It
|
||||
should set right type, function name and parameter mask for the
|
||||
method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be
|
||||
called via call_method handler, otherwise it would be called with
|
||||
standard Zend means.
|
||||
|
||||
get_constructor performs the same function as get_method, but for the
|
||||
object constructor.
|
||||
|
||||
call_method handler is used to perform method call. Parameters are
|
||||
passed like to any other Zend internal function.
|
||||
|
||||
Object - comparison
|
||||
-------------------
|
||||
|
||||
Objects can be compared via compare_objects handler. This is used with
|
||||
== operation, === compares objects by handles, i.e., return true if
|
||||
and only if it's really the same object. Note that objects from
|
||||
different object types (i.e., having different handlers) can not be
|
||||
compared.
|
||||
|
||||
Objects - reflection
|
||||
--------------------
|
||||
|
||||
get_class_name is used to retrieve class name of the object.
|
||||
get_class_entry returns class entry (zend_class_entry) for the object,
|
||||
in case there exists PHP class for it.
|
||||
No other reflection functions are currently implemented.
|
||||
|
||||
Objects - data structures and handlers
|
||||
---------------------------------------
|
||||
|
||||
The object is represented by the following structure:
|
||||
|
||||
struct _zend_object_value {
|
||||
zend_object_handle handle;
|
||||
zend_object_handlers *handlers;
|
||||
};
|
||||
|
||||
handle is an ID of the object among the objects of the same type (not
|
||||
class!). The type of the object and how it behaves is determined by
|
||||
the handler table.
|
||||
|
||||
typedef struct _zend_object_handlers {
|
||||
zend_object_add_ref_t add_ref;
|
||||
zend_object_del_ref_t del_ref;
|
||||
zend_object_delete_obj_t delete_obj;
|
||||
zend_object_clone_obj_t clone_obj;
|
||||
zend_object_read_property_t read_property;
|
||||
zend_object_write_property_t write_property;
|
||||
zend_object_get_property_ptr_t get_property_ptr;
|
||||
zend_object_get_property_zval_ptr_t get_property_zval_ptr;
|
||||
zend_object_get_t get;
|
||||
zend_object_set_t set;
|
||||
zend_object_has_property_t has_property;
|
||||
zend_object_unset_property_t unset_property;
|
||||
zend_object_get_properties_t get_properties;
|
||||
zend_object_get_method_t get_method;
|
||||
zend_object_call_method_t call_method;
|
||||
zend_object_get_constructor_t get_constructor;
|
||||
zend_object_get_class_entry_t get_class_entry;
|
||||
zend_object_get_class_name_t get_class_name;
|
||||
zend_object_compare_t compare_objects;
|
||||
} zend_object_handlers;
|
||||
|
||||
See zend_object_handlers.h for prototypes. All objects are passed as zval's.
|
||||
|
||||
Handlers explained:
|
||||
|
||||
add_ref - called when a copy of the object handle is created.
|
||||
|
||||
del_ref - called when a copy of the object handle is destroyed.
|
||||
|
||||
delete_obj - called when an object needs to be destroyed.
|
||||
|
||||
clone_obj - called when a new object identical to an old one should be
|
||||
created (unlike Zend Engine 1, this never happens unless explicitly
|
||||
asked for).
|
||||
|
||||
read_property - returns zval *, containing the value of the
|
||||
property. Is used when value of the property should be retrieved for
|
||||
reading.
|
||||
|
||||
write_property - assigns value to certain property of the object.
|
||||
|
||||
get_property_zval_ptr - retrieves zval** for being directly modified by
|
||||
the engine. If your properties are not zval's, don't define it.
|
||||
|
||||
get_property_ptr - retrieves zval** for the property of the value, to
|
||||
be used for read and write. If object properties are not zval's
|
||||
natively, this method should create and return proxy object for use
|
||||
with get and set methods.
|
||||
|
||||
get - retrieves zval* for object contents. To be used mainly with
|
||||
proxy objects from get_property_ptr, but also may be used for
|
||||
convert_to_* functions.
|
||||
|
||||
set - sets value for object contents. To be used mainly with
|
||||
proxy objects from get_property_ptr.
|
||||
|
||||
has_property - checks if the object has certain property set.
|
||||
|
||||
unset_property - removes value for the property of the object
|
||||
|
||||
get_method - retrieves description of the method
|
||||
|
||||
call_method - calls the method (parameters should be put on stack like
|
||||
for any other PHP internal function).
|
||||
|
||||
get_constructor - get description for the object constructor method
|
||||
|
||||
get_class_entry - should return the class entry for the object
|
||||
|
||||
get_class_name - get the name of the class the object belongs to
|
||||
|
||||
compare_objects - compares if two objects are equal
|
||||
+47
-55
@@ -1,29 +1,27 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl This file contains Zend specific autoconf functions.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
|
||||
AC_MSG_CHECKING(for $1)
|
||||
AC_TRY_COMPILE([
|
||||
#if HAVE_SYS_TYPES_H
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H
|
||||
#if HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#elif HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif],
|
||||
[if (($1 *) 0)
|
||||
#endif]],
|
||||
[[if (($1 *) 0)
|
||||
return 0;
|
||||
if (sizeof ($1))
|
||||
return 0;
|
||||
],[
|
||||
]])],[
|
||||
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
|
||||
AC_MSG_RESULT(yes)
|
||||
], AC_MSG_RESULT(no)
|
||||
)dnl
|
||||
], [AC_MSG_RESULT(no)
|
||||
])dnl
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
|
||||
@@ -63,7 +61,6 @@ stdlib.h \
|
||||
dlfcn.h)
|
||||
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_DEFUN([LIBZEND_LIBDL_CHECKS],[
|
||||
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
|
||||
@@ -109,7 +106,7 @@ ZEND_CHECK_FLOAT_PRECISION
|
||||
dnl test whether double cast to long preserves least significant bits
|
||||
AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
|
||||
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <limits.h>
|
||||
|
||||
int main()
|
||||
@@ -129,7 +126,7 @@ int main()
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
], [
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
@@ -137,7 +134,7 @@ int main()
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_ENABLE_DEBUG],[
|
||||
@@ -147,7 +144,7 @@ AC_ARG_ENABLE(debug,
|
||||
ZEND_DEBUG=$enableval
|
||||
],[
|
||||
ZEND_DEBUG=no
|
||||
])
|
||||
])
|
||||
|
||||
])
|
||||
|
||||
@@ -158,10 +155,10 @@ AC_ARG_ENABLE(maintainer-zts,
|
||||
ZEND_MAINTAINER_ZTS=$enableval
|
||||
],[
|
||||
ZEND_MAINTAINER_ZTS=no
|
||||
])
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(inline-optimization,
|
||||
[ --disable-inline-optimization
|
||||
[ --disable-inline-optimization
|
||||
If building zend_execute.lo fails, try this switch],[
|
||||
ZEND_INLINE_OPTIMIZATION=$enableval
|
||||
],[
|
||||
@@ -195,8 +192,7 @@ test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
CFLAGS="$CFLAGS -DZTS"
|
||||
LIBZEND_CPLUSPLUS_CHECKS
|
||||
fi
|
||||
fi
|
||||
|
||||
changequote({,})
|
||||
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
|
||||
@@ -222,7 +218,7 @@ dnl test and set the alignment define for ZEND_MM
|
||||
dnl this also does the logarithmic test for ZEND_MM.
|
||||
AC_MSG_CHECKING(for MM alignment and log values)
|
||||
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
|
||||
typedef union _mm_align_test {
|
||||
@@ -249,16 +245,16 @@ int main()
|
||||
}
|
||||
|
||||
fp = fopen("conftest.zend", "w");
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
LIBZEND_MM_ALIGN_LOG2=`cat conftest.zend | cut -d ' ' -f 2`
|
||||
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
|
||||
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
|
||||
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
|
||||
], [], [
|
||||
dnl cross-compile needs something here
|
||||
LIBZEND_MM_ALIGN=8
|
||||
@@ -269,7 +265,7 @@ AC_MSG_RESULT(done)
|
||||
dnl test for memory allocation using mmap(MAP_ANON)
|
||||
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
|
||||
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -301,7 +297,7 @@ int main()
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
@@ -314,7 +310,7 @@ int main()
|
||||
dnl test for memory allocation using mmap("/dev/zero")
|
||||
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
|
||||
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -356,7 +352,7 @@ int main()
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
@@ -374,7 +370,7 @@ AC_ARG_ENABLE(zend-signals,
|
||||
ZEND_SIGNALS=$enableval
|
||||
],[
|
||||
ZEND_SIGNALS=yes
|
||||
])
|
||||
])
|
||||
|
||||
AC_CHECK_FUNC(sigaction, [
|
||||
AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
|
||||
@@ -391,28 +387,24 @@ AC_MSG_RESULT($ZEND_SIGNALS)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_CPLUSPLUS_CHECKS],[
|
||||
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether /dev/urandom exists)
|
||||
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
||||
AC_MSG_CHECKING(whether /dev/urandom exists)
|
||||
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
||||
AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define if the target system has /dev/urandom device])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether /dev/arandom exists)
|
||||
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
|
||||
AC_MSG_CHECKING(whether /dev/arandom exists)
|
||||
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
|
||||
AC_DEFINE([HAVE_DEV_ARANDOM], 1, [Define if the target system has /dev/arandom device])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(gcc-global-regs,
|
||||
[ --disable-gcc-global-regs
|
||||
[ --disable-gcc-global-regs
|
||||
whether to enable GCC global register variables],[
|
||||
ZEND_GCC_GLOBAL_REGS=$enableval
|
||||
],[
|
||||
@@ -420,7 +412,7 @@ AC_ARG_ENABLE(gcc-global-regs,
|
||||
])
|
||||
AC_MSG_CHECKING(for global register variables support)
|
||||
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#if defined(__GNUC__)
|
||||
# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#else
|
||||
@@ -453,8 +445,8 @@ int emu(const opcode_handler_t *ip, void *fp) {
|
||||
FP = orig_fp;
|
||||
IP = orig_ip;
|
||||
}
|
||||
], [
|
||||
], [
|
||||
]], [[
|
||||
]])], [
|
||||
ZEND_GCC_GLOBAL_REGS=yes
|
||||
], [
|
||||
ZEND_GCC_GLOBAL_REGS=no
|
||||
@@ -471,7 +463,7 @@ dnl
|
||||
dnl Check if atof() accepts NAN
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -487,7 +479,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isnan(atof("NAN")) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_atof_accept_nan=yes
|
||||
],[
|
||||
ac_cv_atof_accept_nan=no
|
||||
@@ -502,7 +494,7 @@ dnl
|
||||
dnl Check if atof() accepts INF
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -521,7 +513,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_atof_accept_inf=yes
|
||||
],[
|
||||
ac_cv_atof_accept_inf=no
|
||||
@@ -536,7 +528,7 @@ dnl
|
||||
dnl Check if HUGE_VAL == INF
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -555,7 +547,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
return zend_isinf(HUGE_VAL) ? 0 : 1;
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_huge_val_inf=yes
|
||||
],[
|
||||
ac_cv_huge_val_inf=no
|
||||
@@ -571,7 +563,7 @@ dnl
|
||||
dnl Check if HUGE_VAL + -HUGEVAL == NAN
|
||||
dnl
|
||||
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
|
||||
AC_TRY_RUN([
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -592,7 +584,7 @@ int main(int argc, char** argv)
|
||||
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
|
||||
#endif
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_huge_val_nan=yes
|
||||
],[
|
||||
ac_cv_huge_val_nan=no
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by ZendCore.mak
|
||||
|
||||
.\zend_alloc.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\alloca.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_compile.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_modules.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_API.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
|
||||
|
||||
.\zend_constants.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_execute.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_modules.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_API.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
|
||||
|
||||
.\zend_highlight.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_highlight.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_language_parser.tab.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_llist.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_opcode.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_modules.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_API.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
|
||||
|
||||
.\zend_operators.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_ptr_stack.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_stack.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_variables.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_modules.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_API.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
".\zend_list.h"\
|
||||
|
||||
|
||||
.\zend.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_API.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_modules.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
".\zend_API.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
".\zend_list.h"\
|
||||
|
||||
|
||||
.\zend_hash.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
|
||||
.\zend_ini.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
".\zend_ini.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
+23
-28
@@ -1,5 +1,3 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
@@ -7,7 +5,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# min: 2.4 (i.e. 204, major * 100 + minor for easier comparison)
|
||||
bison_version_min="204"
|
||||
# non-working versions, e.g. "3.0 3.2";
|
||||
# remove "none" when introducing the first incompatible bison version an
|
||||
# remove "none" when introducing the first incompatible bison version an
|
||||
# separate any following additions by spaces
|
||||
bison_version_exclude=""
|
||||
|
||||
@@ -46,16 +44,14 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
|
||||
AC_DEFUN([ZEND_FP_EXCEPT],[
|
||||
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <floatingpoint.h>
|
||||
],[
|
||||
]],[[
|
||||
fp_except x = (fp_except) 0;
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_type_fp_except=yes
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
])])
|
||||
if test "$ac_cv_type_fp_except" = "yes"; then
|
||||
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
|
||||
@@ -67,7 +63,7 @@ dnl Check for broken sprintf()
|
||||
dnl
|
||||
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
|
||||
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
|
||||
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
|
||||
ac_cv_broken_sprintf=no
|
||||
],[
|
||||
ac_cv_broken_sprintf=yes
|
||||
@@ -91,8 +87,7 @@ AC_DEFUN([AC_ZEND_C_BIGENDIAN],
|
||||
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
|
||||
[
|
||||
ac_cv_c_bigendian_php=unknown
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
int main(void)
|
||||
{
|
||||
short one = 1;
|
||||
@@ -104,7 +99,7 @@ int main(void)
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
])
|
||||
if test $ac_cv_c_bigendian_php = yes; then
|
||||
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
|
||||
@@ -119,9 +114,9 @@ dnl x87 floating point internal precision control checks
|
||||
dnl See: http://wiki.php.net/rfc/rounding
|
||||
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
AC_MSG_CHECKING([for usable _FPU_SETCW])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <fpu_control.h>
|
||||
],[
|
||||
]],[[
|
||||
fpu_control_t fpu_oldcw, fpu_cw;
|
||||
volatile double result;
|
||||
double a = 2877.0;
|
||||
@@ -132,18 +127,18 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
_FPU_SETCW(fpu_cw);
|
||||
result = a / b;
|
||||
_FPU_SETCW(fpu_oldcw);
|
||||
], [ac_cfp_have__fpu_setcw=yes], [ac_cfp_have__fpu_setcw=no])
|
||||
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
|
||||
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
|
||||
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING([for usable fpsetprec])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <machine/ieeefp.h>
|
||||
],[
|
||||
]],[[
|
||||
fp_prec_t fpu_oldprec;
|
||||
volatile double result;
|
||||
double a = 2877.0;
|
||||
@@ -153,7 +148,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
fpsetprec(FP_PD);
|
||||
result = a / b;
|
||||
fpsetprec(fpu_oldprec);
|
||||
], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
|
||||
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
|
||||
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
|
||||
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -162,9 +157,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for usable _controlfp])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <float.h>
|
||||
],[
|
||||
]],[[
|
||||
unsigned int fpu_oldcw;
|
||||
volatile double result;
|
||||
double a = 2877.0;
|
||||
@@ -174,7 +169,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
_controlfp(_PC_53, _MCW_PC);
|
||||
result = a / b;
|
||||
_controlfp(fpu_oldcw, _MCW_PC);
|
||||
], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
|
||||
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
|
||||
if test "$ac_cfp_have__controlfp" = "yes" ; then
|
||||
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -183,9 +178,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for usable _controlfp_s])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <float.h>
|
||||
],[
|
||||
]],[[
|
||||
unsigned int fpu_oldcw, fpu_cw;
|
||||
volatile double result;
|
||||
double a = 2877.0;
|
||||
@@ -196,7 +191,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
|
||||
result = a / b;
|
||||
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
|
||||
], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
|
||||
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
|
||||
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
|
||||
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -205,9 +200,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
/* nothing */
|
||||
],[
|
||||
]],[[
|
||||
unsigned int oldcw, cw;
|
||||
volatile double result;
|
||||
double a = 2877.0;
|
||||
@@ -220,7 +215,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
|
||||
result = a / b;
|
||||
|
||||
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
|
||||
], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
|
||||
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
|
||||
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
|
||||
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
# make -f build.mk
|
||||
#
|
||||
# Written by Sascha Schumann
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
LT_TARGETS = ltmain.sh ltconfig
|
||||
|
||||
+5
-5
@@ -1,4 +1,3 @@
|
||||
dnl $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(zend.c)
|
||||
@@ -60,7 +59,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#include <math.h>
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
@@ -69,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
@@ -80,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
@@ -126,7 +125,8 @@ LIBZEND_OTHER_CHECKS
|
||||
ZEND_EXTRA_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SUBST(ZEND_EXTRA_LIBS)
|
||||
AC_OUTPUT(Makefile)
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
|
||||
@@ -15,5 +15,3 @@
|
||||
| Authors: |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Argument unpacking does not work with non-integer keys
|
||||
--FILE--
|
||||
<?php
|
||||
function foo(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
function gen() {
|
||||
yield 1.23 => 123;
|
||||
yield "2.34" => 234;
|
||||
}
|
||||
|
||||
try {
|
||||
foo(...gen());
|
||||
} catch (Error $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Exception: Cannot unpack Traversable with non-integer keys
|
||||
@@ -20,7 +20,7 @@ assert(0 && ($a = function () {
|
||||
yield from $x;
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = "aaa";
|
||||
@@ -161,7 +161,7 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
yield from $x;
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = 'aaa';
|
||||
|
||||
@@ -3,7 +3,7 @@ Empty statement in assert() shouldn't segfault
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert((function () { return true;; })());
|
||||
assert((function () { return true; })());
|
||||
echo "ok";
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
'break' error (non positive numbers)
|
||||
'break' error (non positive integers)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
@@ -7,4 +7,4 @@ function foo () {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: 'break' operator accepts only positive numbers in %sbreak_error_001.php on line 3
|
||||
Fatal error: 'break' operator accepts only positive integers in %sbreak_error_001.php on line 3
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
'break' error (operator with non-constant operand)
|
||||
'break' error (operator with non-integer operand)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
@@ -7,4 +7,4 @@ function foo () {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: 'break' operator with non-constant operand is no longer supported in %sbreak_error_002.php on line 3
|
||||
Fatal error: 'break' operator with non-integer operand is no longer supported in %sbreak_error_002.php on line 3
|
||||
@@ -1,9 +1,5 @@
|
||||
--TEST--
|
||||
Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class debugfilter extends php_user_filter {
|
||||
|
||||
@@ -4,10 +4,18 @@ Bug #29883 (isset gives invalid values on strings)
|
||||
<?php
|
||||
$x = "bug";
|
||||
var_dump(isset($x[-10]));
|
||||
var_dump(isset($x[1]));
|
||||
var_dump(isset($x["1"]));
|
||||
echo $x["1"]."\n";
|
||||
var_dump($x[-10])."\n";
|
||||
var_dump($x[1])."\n";
|
||||
var_dump($x["1"])."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(true)
|
||||
u
|
||||
bool(true)
|
||||
|
||||
Notice: Uninitialized string offset: -10 in %s on line 6
|
||||
string(0) ""
|
||||
string(1) "u"
|
||||
string(1) "u"
|
||||
@@ -1,9 +1,5 @@
|
||||
--TEST--
|
||||
Bug #36568 (memory_limit has no effect)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('memory_get_usage')) die('skip PHP is configured without memory_limit');
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=16M
|
||||
--FILE--
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists('memory_get_usage')) die('skip memory_get_usage() not installed'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
|
||||
@@ -40,6 +40,11 @@ print ns1\ns2\coNSt6 . "\n";
|
||||
print NS1\ns2\coNSt1 . "\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 6
|
||||
|
||||
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 7
|
||||
|
||||
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 8
|
||||
value1
|
||||
value1
|
||||
value1
|
||||
@@ -52,13 +57,23 @@ value3
|
||||
value4
|
||||
value4
|
||||
value4
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS1\ns2\const4" in %s on line 25
|
||||
value4
|
||||
value5
|
||||
value5
|
||||
value5
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\ns2\const5" in %s on line 30
|
||||
value5
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 32
|
||||
value6
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 33
|
||||
value6
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 34
|
||||
value6
|
||||
value6
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ unset($array[1]);
|
||||
print_r($array);
|
||||
|
||||
$array = array(1 => 2);
|
||||
$a = 1;
|
||||
|
||||
unset($array["1"]);
|
||||
print_r($array);
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
--TEST--
|
||||
Bug #63217 (Constant numeric strings become integers when used as ArrayAccess offset)
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.enable=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($offset) {
|
||||
echo "offsetExists given ";
|
||||
var_dump($offset);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
echo "offsetUnset given ";
|
||||
var_dump($offset);
|
||||
}
|
||||
public function offsetSet($offset, $value) {
|
||||
echo "offsetSet given ";
|
||||
var_dump($offset);
|
||||
}
|
||||
public function offsetGet($offset) {
|
||||
echo "offsetGet given ";
|
||||
var_dump($offset);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
|
||||
/* These should all produce string(...) "..." output and not int(...) */
|
||||
isset($test['0']);
|
||||
isset($test['123']);
|
||||
unset($test['0']);
|
||||
unset($test['123']);
|
||||
$test['0'] = true;
|
||||
$test['123'] = true;
|
||||
$foo = $test['0'];
|
||||
$foo = $test['123'];
|
||||
|
||||
/* These caused the same bug, but in opcache rather than the compiler */
|
||||
isset($test[(string)'0']);
|
||||
isset($test[(string)'123']);
|
||||
unset($test[(string)'0']);
|
||||
unset($test[(string)'123']);
|
||||
$test[(string)'0'] = true;
|
||||
$test[(string)'123'] = true;
|
||||
$foo = $test[(string)'0'];
|
||||
$foo = $test[(string)'123'];
|
||||
|
||||
/**
|
||||
* @see https://github.com/php/php-src/pull/2607#issuecomment-313781748
|
||||
*/
|
||||
function test(): string {
|
||||
$array["10"] = 42;
|
||||
foreach ($array as $key => $value) {
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(test());
|
||||
|
||||
/**
|
||||
* Make sure we don't break arrays.
|
||||
*/
|
||||
$array = [];
|
||||
|
||||
$key = '123';
|
||||
|
||||
$array[$key] = 1;
|
||||
$array['321'] = 2;
|
||||
$array['abc'] = 3;
|
||||
|
||||
var_dump($array);
|
||||
|
||||
/**
|
||||
* Make sure that we haven't broken ArrayObject
|
||||
*/
|
||||
$ao = new ArrayObject();
|
||||
|
||||
$key = '123';
|
||||
|
||||
$ao = [];
|
||||
$ao[$key] = 1;
|
||||
$ao['321'] = 2;
|
||||
$ao['abc'] = 3;
|
||||
|
||||
var_dump($ao);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
offsetExists given string(1) "0"
|
||||
offsetExists given string(3) "123"
|
||||
offsetUnset given string(1) "0"
|
||||
offsetUnset given string(3) "123"
|
||||
offsetSet given string(1) "0"
|
||||
offsetSet given string(3) "123"
|
||||
offsetGet given string(1) "0"
|
||||
offsetGet given string(3) "123"
|
||||
offsetExists given string(1) "0"
|
||||
offsetExists given string(3) "123"
|
||||
offsetUnset given string(1) "0"
|
||||
offsetUnset given string(3) "123"
|
||||
offsetSet given string(1) "0"
|
||||
offsetSet given string(3) "123"
|
||||
offsetGet given string(1) "0"
|
||||
offsetGet given string(3) "123"
|
||||
string(2) "10"
|
||||
array(3) {
|
||||
[123]=>
|
||||
int(1)
|
||||
[321]=>
|
||||
int(2)
|
||||
["abc"]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[123]=>
|
||||
int(1)
|
||||
[321]=>
|
||||
int(2)
|
||||
["abc"]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -5,6 +5,13 @@ Bug #72543.5 (different references behavior comparing to PHP 5)
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->prop = 1;
|
||||
$ref =& $obj->prop;
|
||||
var_dump($obj->prop + ($obj->prop = 2));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
int(3)
|
||||
int(3)
|
||||
@@ -1,9 +1,5 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
--TEST--
|
||||
Bug #76439: Don't always strip leading whitespace from heredoc T_ENCAPSED_AND_WHITESPACE tokens
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
[$one, $two, $three, $four, $five, $six, $seven, $eight, $nine] = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
|
||||
var_dump(<<<BAR
|
||||
$one-
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$two -
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$three -
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$four-$four
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$five-$five-
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$six-$six-$six
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$seven
|
||||
-
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$eight
|
||||
-
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
$nine
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
-
|
||||
BAR);
|
||||
|
||||
var_dump(<<<BAR
|
||||
-
|
||||
BAR);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "1-"
|
||||
string(3) "2 -"
|
||||
string(3) "3 -"
|
||||
string(3) "4-4"
|
||||
string(4) "5-5-"
|
||||
string(5) "6-6-6"
|
||||
string(3) "7
|
||||
-"
|
||||
string(4) "8
|
||||
-"
|
||||
string(1) "9"
|
||||
string(1) "-"
|
||||
string(2) " -"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #76439: Don't always strip leading whitespace from heredoc T_ENCAPSED_AND_WHITESPACE tokens (error case)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = 1;
|
||||
|
||||
var_dump(<<<BAR
|
||||
$foo
|
||||
$foo
|
||||
BAR);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: Invalid body indentation level (expecting an indentation level of at least 1) in %s on line 7
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #76502: Chain of mixed exceptions and errors does not serialize properly
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$examples = [
|
||||
"Exception(Exception())" => new Exception("outer", 0, new Exception("inner")),
|
||||
"Error(Error())" => new Error("outer", 0, new Error("inner")),
|
||||
"Error(Exception())" => new Error("outer", 0, new Exception("inner")),
|
||||
"Exception(Error())" => new Exception("outer", 0, new Error("inner"))
|
||||
];
|
||||
|
||||
foreach ($examples as $name => $example) {
|
||||
$processed = unserialize(serialize($example));
|
||||
$processedPrev = $processed->getPrevious();
|
||||
echo "---- $name ----\n";
|
||||
echo "before: ", get_class($example), ".previous == ",
|
||||
get_class($example->getPrevious()), "\n";
|
||||
echo "after : ", get_class($processed), ".previous == ",
|
||||
$processedPrev ? get_class($processedPrev) : "null", "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
---- Exception(Exception()) ----
|
||||
before: Exception.previous == Exception
|
||||
after : Exception.previous == Exception
|
||||
---- Error(Error()) ----
|
||||
before: Error.previous == Error
|
||||
after : Error.previous == Error
|
||||
---- Error(Exception()) ----
|
||||
before: Error.previous == Exception
|
||||
after : Error.previous == Exception
|
||||
---- Exception(Error()) ----
|
||||
before: Exception.previous == Error
|
||||
after : Exception.previous == Error
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function ($severity, $message, $file, $line) {
|
||||
throw new \Exception($message);
|
||||
});
|
||||
|
||||
$x = "foo";
|
||||
$y = &$x["bar"];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug76534.php on line %d
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #76667 (Segfault with divide-assign op and __get + __set)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class T {
|
||||
public function __get($k)
|
||||
{
|
||||
return $undefined->$k;
|
||||
}
|
||||
|
||||
public function __set($k, $v)
|
||||
{
|
||||
return $this->$v /= 0;
|
||||
}
|
||||
};
|
||||
|
||||
$x = new T;
|
||||
$x->x = 1;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undefined in %sbug76667.php on line %d
|
||||
|
||||
Notice: Trying to get property '1' of non-object in %sbug76667.php on line %d
|
||||
|
||||
Warning: Division by zero in %sbug76667.php on line %d
|
||||
|
||||
Notice: Undefined variable: undefined in %sbug76667.php on line %d
|
||||
|
||||
Notice: Trying to get property 'NAN' of non-object in %sbug76667.php on line %d
|
||||
|
||||
Warning: Division by zero in %sbug76667.php on line %d
|
||||
|
||||
Notice: Undefined variable: undefined in %sbug76667.php on line %d
|
||||
|
||||
Notice: Trying to get property 'NAN' of non-object in %sbug76667.php on line %d
|
||||
|
||||
Warning: Division by zero in %sbug76667.php on line %d
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in _get_zval_ptr_tmp failed)
|
||||
--FILE--
|
||||
<?php
|
||||
$obj = new stdClass;
|
||||
$val = 'foo';
|
||||
$obj->prop = &$val;
|
||||
var_dump($obj->prop ?? []);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76754 (parent private constant in extends class memory leak)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FOO
|
||||
{
|
||||
private const FOO = 'BAR';
|
||||
}
|
||||
|
||||
class BAR extends FOO { }
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,127 @@
|
||||
--TEST--
|
||||
Case-insensitive constants are deprecated
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace {
|
||||
define('FOO', 42, true); // Deprecated
|
||||
define('NS\FOO', 24, true); // Deprecated
|
||||
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
|
||||
var_dump(NS\FOO); // Ok
|
||||
var_dump(ns\FOO); // Ok
|
||||
var_dump(ns\foo); // Deprecated
|
||||
|
||||
var_dump(defined('FOO')); // Ok
|
||||
var_dump(defined('foo')); // Ok
|
||||
var_dump(defined('NS\FOO')); // Ok
|
||||
var_dump(defined('ns\FOO')); // Ok
|
||||
var_dump(defined('ns\foo')); // Ok
|
||||
|
||||
var_dump(constant('FOO')); // Ok
|
||||
var_dump(constant('foo')); // Deprecated
|
||||
var_dump(constant('NS\FOO')); // Ok
|
||||
var_dump(constant('ns\FOO')); // Ok
|
||||
var_dump(constant('ns\foo')); // Deprecated
|
||||
}
|
||||
|
||||
namespace NS {
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
}
|
||||
|
||||
namespace ns {
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
}
|
||||
|
||||
namespace Other {
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
|
||||
var_dump(defined('FOO')); // Ok
|
||||
var_dump(defined('foo')); // Ok
|
||||
var_dump(defined('NS\FOO')); // Ok
|
||||
var_dump(defined('ns\FOO')); // Ok
|
||||
var_dump(defined('ns\foo')); // Ok
|
||||
|
||||
var_dump(constant('FOO')); // Ok
|
||||
var_dump(constant('foo')); // Deprecated
|
||||
var_dump(constant('NS\FOO')); // Ok
|
||||
var_dump(constant('ns\FOO')); // Ok
|
||||
var_dump(constant('ns\foo')); // Deprecated
|
||||
|
||||
const C1 = FOO; // Ok
|
||||
var_dump(C1);
|
||||
const C2 = foo; // Deprecated
|
||||
var_dump(C2);
|
||||
const C3 = 1 + FOO; // Ok
|
||||
var_dump(C3);
|
||||
const C4 = 1 + foo; // Deprecated
|
||||
var_dump(C4);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 4
|
||||
|
||||
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 5
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 8
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 12
|
||||
int(24)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 21
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 24
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 29
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 34
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 39
|
||||
int(42)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 48
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 51
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 55
|
||||
int(42)
|
||||
int(43)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 59
|
||||
int(43)
|
||||
@@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Warning on continue targeting switch
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
switch ($foo) {
|
||||
case 0:
|
||||
continue; // INVALID
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
|
||||
while ($foo) {
|
||||
switch ($bar) {
|
||||
case 0:
|
||||
continue; // INVALID
|
||||
case 1:
|
||||
continue 2;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while ($foo) {
|
||||
switch ($bar) {
|
||||
case 0:
|
||||
while ($xyz) {
|
||||
continue 2; // INVALID
|
||||
}
|
||||
case 1:
|
||||
while ($xyz) {
|
||||
continue 3;
|
||||
}
|
||||
case 2:
|
||||
while ($xyz) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 6
|
||||
|
||||
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 14
|
||||
|
||||
Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 26
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Defining a free-standing assert() function is deprecated
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace FooBar;
|
||||
|
||||
function assert() {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Defining a custom assert() function is deprecated, as the function has special semantics in %s on line %d
|
||||
@@ -17,16 +17,24 @@ var_dump(empty($str[5])); // 1
|
||||
var_dump(empty($str[8]));
|
||||
var_dump(empty($str[10000]));
|
||||
// non-numeric offsets
|
||||
print "- string ---\n";
|
||||
var_dump(empty($str['-1']));
|
||||
print "- string literal ---\n";
|
||||
var_dump(empty($str['-1'])); // 3
|
||||
var_dump(empty($str['-10']));
|
||||
var_dump(empty($str['-4'])); // 0
|
||||
var_dump(empty($str['0']));
|
||||
var_dump(empty($str['1']));
|
||||
var_dump(empty($str['4'])); // 0
|
||||
var_dump(empty($str['1.5']));
|
||||
var_dump(empty($str['good']));
|
||||
var_dump(empty($str['3 and a half']));
|
||||
print "- string variable ---\n";
|
||||
var_dump(empty($str[$key = '-1'])); // 3
|
||||
var_dump(empty($str[$key = '-10']));
|
||||
var_dump(empty($str[$key = '0']));
|
||||
var_dump(empty($str[$key = '1']));
|
||||
var_dump(empty($str[$key = '4'])); // 0
|
||||
var_dump(empty($str[$key = '1.5']));
|
||||
var_dump(empty($str[$key = 'good']));
|
||||
var_dump(empty($str[$key = '3 and a half']));
|
||||
print "- bool ---\n";
|
||||
var_dump(empty($str[true]));
|
||||
var_dump(empty($str[false]));
|
||||
@@ -54,7 +62,7 @@ var_dump(empty($str[$f]));
|
||||
print "done\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
- empty ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -65,9 +73,17 @@ bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
- string ---
|
||||
- string literal ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
- string variable ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
--TEST--
|
||||
GC 038: Garbage created by compound assignment operators (e.g. +=)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
function test_add() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x += 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "+=\t$n\n";
|
||||
}
|
||||
test_add();
|
||||
|
||||
function test_sub() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x -= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "-=\t$n\n";
|
||||
}
|
||||
test_sub();
|
||||
|
||||
function test_mul() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x *= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "*=\t$n\n";
|
||||
}
|
||||
test_mul();
|
||||
|
||||
function test_div() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x /= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "/=\t$n\n";
|
||||
}
|
||||
test_div();
|
||||
|
||||
function test_mod() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x %= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "%=\t$n\n";
|
||||
}
|
||||
test_mod();
|
||||
|
||||
function test_sl() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x <<= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo "<<=\t$n\n";
|
||||
}
|
||||
test_sl();
|
||||
|
||||
function test_sr() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x >>= 5;
|
||||
$n = gc_collect_cycles();
|
||||
echo ">>=\t$n\n";
|
||||
}
|
||||
test_sr();
|
||||
|
||||
function test_or() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x |= 1;
|
||||
$n = gc_collect_cycles();
|
||||
echo "|=\t$n\n";
|
||||
}
|
||||
test_or();
|
||||
|
||||
function test_and() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x &= 1;
|
||||
$n = gc_collect_cycles();
|
||||
echo "&=\t$n\n";
|
||||
}
|
||||
test_and();
|
||||
|
||||
function test_xor() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x ^= 1;
|
||||
$n = gc_collect_cycles();
|
||||
echo "^=\t$n\n";
|
||||
}
|
||||
test_xor();
|
||||
|
||||
function test_pow() {
|
||||
$x = new stdClass;
|
||||
$x->x= $x;
|
||||
@$x **= 1;
|
||||
$n = gc_collect_cycles();
|
||||
echo "**=\t$n\n";
|
||||
}
|
||||
test_pow();
|
||||
|
||||
class Y {
|
||||
function __toString() {
|
||||
return "y";
|
||||
}
|
||||
}
|
||||
function test_concat() {
|
||||
$x = new Y;
|
||||
$x->x= $x;
|
||||
@$x .= "x";
|
||||
$n = gc_collect_cycles();
|
||||
echo ".=\t$n\n";
|
||||
}
|
||||
test_concat();
|
||||
?>
|
||||
--EXPECT--
|
||||
+= 1
|
||||
-= 1
|
||||
*= 1
|
||||
/= 1
|
||||
%= 1
|
||||
<<= 1
|
||||
>>= 1
|
||||
|= 1
|
||||
&= 1
|
||||
^= 1
|
||||
**= 1
|
||||
.= 1
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
GC 039: Garbage created by replacing argument send by reference
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$out = new stdClass;
|
||||
$out->x = $out;
|
||||
mb_parse_str("a=b", $out);
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -16,8 +16,8 @@ var_dump(isset($str[5])); // 1
|
||||
var_dump(isset($str[8]));
|
||||
var_dump(isset($str[10000]));
|
||||
// non-numeric offsets
|
||||
print "- string ---\n";
|
||||
var_dump(isset($str['-1']));
|
||||
print "- string literal ---\n";
|
||||
var_dump(isset($str['-1'])); // 3
|
||||
var_dump(isset($str['-10']));
|
||||
var_dump(isset($str['0']));
|
||||
var_dump(isset($str['1']));
|
||||
@@ -25,6 +25,15 @@ var_dump(isset($str['4'])); // 0
|
||||
var_dump(isset($str['1.5']));
|
||||
var_dump(isset($str['good']));
|
||||
var_dump(isset($str['3 and a half']));
|
||||
print "- string variable ---\n";
|
||||
var_dump(isset($str[$key = '-1'])); // 3
|
||||
var_dump(isset($str[$key = '-10']));
|
||||
var_dump(isset($str[$key = '0']));
|
||||
var_dump(isset($str[$key = '1']));
|
||||
var_dump(isset($str[$key = '4'])); // 0
|
||||
var_dump(isset($str[$key = '1.5']));
|
||||
var_dump(isset($str[$key = 'good']));
|
||||
var_dump(isset($str[$key = '3 and a half']));
|
||||
print "- bool ---\n";
|
||||
var_dump(isset($str[true]));
|
||||
var_dump(isset($str[false]));
|
||||
@@ -51,7 +60,7 @@ var_dump(isset($str[$f]));
|
||||
print "done\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
- isset ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -61,7 +70,16 @@ bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
- string ---
|
||||
- string literal ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
- string variable ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
testing integer overflow (32bit)
|
||||
--INI--
|
||||
precision=14
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Overloaded function 001
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function");
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Overloaded function 002
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function");
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Return type for internal functions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('zend_test_array_return')) die('skip');
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
// Internal function return types are only checked in debug builds
|
||||
if (!PHP_DEBUG) die('skip requires debug build');
|
||||
?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Return type for internal functions 2
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('zend_test_nullable_array_return')) die('skip');
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
--FILE--
|
||||
<?php
|
||||
zend_test_nullable_array_return();
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Return type for internal functions 3: Void return type
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(zend_test_void_return());
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
@@ -3,15 +3,17 @@ $this re-assign in extract()
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
extract(["this"=>42]);
|
||||
var_dump($this);
|
||||
try {
|
||||
extract(["this"=>42, "a"=>24]);
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
var_dump($a);
|
||||
}
|
||||
foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_extract.php:3
|
||||
Stack trace:
|
||||
#0 %sthis_in_extract.php(3): extract(Array)
|
||||
#1 %sthis_in_extract.php(6): foo()
|
||||
#2 {main}
|
||||
thrown in %sthis_in_extract.php on line 3
|
||||
Cannot re-assign $this
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
NULL
|
||||
@@ -2,7 +2,7 @@
|
||||
Bug #69579 (Internal trait double-free)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!trait_exists('_ZendTestTrait')) die("skip requires internal trait");
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #76539 (Trait attribute is set incorrectly when using self::class with another string)
|
||||
--FILE--
|
||||
<?php
|
||||
trait MyTrait {
|
||||
protected $attr = self::class . 'Test';
|
||||
|
||||
public function test() {
|
||||
echo $this->attr, PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
use MyTrait;
|
||||
}
|
||||
|
||||
class B {
|
||||
use MyTrait;
|
||||
}
|
||||
|
||||
(new A())->test();
|
||||
(new B())->test();
|
||||
?>
|
||||
--EXPECT--
|
||||
ATest
|
||||
BTest
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #76700 (false-positive "Error: Call to protected method" when using trait aliases)
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1
|
||||
{
|
||||
protected function aa() { echo 123; }
|
||||
}
|
||||
|
||||
trait T2
|
||||
{
|
||||
use T1 {
|
||||
aa as public;
|
||||
}
|
||||
}
|
||||
|
||||
class A
|
||||
{
|
||||
use T1;
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
use T2;
|
||||
}
|
||||
|
||||
$b = new B();
|
||||
$b->aa();
|
||||
|
||||
--EXPECT--
|
||||
123
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #76773 (Traits used on the parent are ignored for child classes)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait MyTrait
|
||||
{
|
||||
public function hello()
|
||||
{
|
||||
echo __CLASS__, "\n";
|
||||
|
||||
if (\is_callable(array('parent', __FUNCTION__))) {
|
||||
parent::hello();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ParentClass
|
||||
{
|
||||
use MyTrait;
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClass
|
||||
{
|
||||
use MyTrait;
|
||||
}
|
||||
|
||||
$c = new ChildClass();
|
||||
$c->hello();
|
||||
|
||||
--EXPECT--
|
||||
ChildClass
|
||||
ParentClass
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Operator precedence
|
||||
--FILE--
|
||||
<?php /* $Id$ */
|
||||
<?php
|
||||
|
||||
var_dump((object)1 instanceof stdClass);
|
||||
var_dump(! (object)1 instanceof Exception);
|
||||
|
||||
+1
-3
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_modules.h"
|
||||
@@ -415,7 +413,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
|
||||
zend_print_flat_zval_r(Z_REFVAL_P(expr));
|
||||
break;
|
||||
default:
|
||||
zend_print_variable(expr);
|
||||
zend_print_zval(expr, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-12
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
@@ -86,20 +84,17 @@ typedef struct _zend_unserialize_data zend_unserialize_data;
|
||||
|
||||
typedef struct _zend_trait_method_reference {
|
||||
zend_string *method_name;
|
||||
zend_class_entry *ce;
|
||||
zend_string *class_name;
|
||||
} zend_trait_method_reference;
|
||||
|
||||
typedef struct _zend_trait_precedence {
|
||||
zend_trait_method_reference *trait_method;
|
||||
union {
|
||||
zend_class_entry *ce;
|
||||
zend_string *class_name;
|
||||
} *exclude_from_classes;
|
||||
zend_trait_method_reference trait_method;
|
||||
uint32_t num_excludes;
|
||||
zend_string *exclude_class_names[1];
|
||||
} zend_trait_precedence;
|
||||
|
||||
typedef struct _zend_trait_alias {
|
||||
zend_trait_method_reference *trait_method;
|
||||
zend_trait_method_reference trait_method;
|
||||
|
||||
/**
|
||||
* name for method to be added
|
||||
@@ -142,12 +137,15 @@ struct _zend_class_entry {
|
||||
union _zend_function *serialize_func;
|
||||
union _zend_function *unserialize_func;
|
||||
|
||||
zend_class_iterator_funcs iterator_funcs;
|
||||
/* allocated only if class implements Iterator or IteratorAggregate interface */
|
||||
zend_class_iterator_funcs *iterator_funcs_ptr;
|
||||
|
||||
/* handlers */
|
||||
zend_object* (*create_object)(zend_class_entry *class_type);
|
||||
union {
|
||||
zend_object* (*create_object)(zend_class_entry *class_type);
|
||||
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
|
||||
};
|
||||
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref);
|
||||
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
|
||||
union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method);
|
||||
|
||||
/* serializer callbacks */
|
||||
@@ -243,6 +241,10 @@ ZEND_API size_t zend_print_zval(zval *expr, int indent);
|
||||
ZEND_API void zend_print_zval_r(zval *expr, int indent);
|
||||
ZEND_API zend_string *zend_print_zval_r_to_str(zval *expr, int indent);
|
||||
ZEND_API void zend_print_flat_zval_r(zval *expr);
|
||||
|
||||
#define zend_print_variable(var) \
|
||||
zend_print_zval((var), 0)
|
||||
|
||||
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
|
||||
ZEND_API void zend_activate(void);
|
||||
|
||||
+96
-129
@@ -19,8 +19,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_execute.h"
|
||||
#include "zend_API.h"
|
||||
@@ -531,12 +529,13 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest
|
||||
zval rv;
|
||||
zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);
|
||||
|
||||
Z_ADDREF_P(z);
|
||||
if (Z_TYPE_P(z) != IS_OBJECT) {
|
||||
zval_dtor(arg);
|
||||
ZVAL_NULL(arg);
|
||||
if (!zend_make_printable_zval(z, arg)) {
|
||||
zval_ptr_dtor(arg);
|
||||
if (Z_TYPE_P(z) == IS_STRING) {
|
||||
ZVAL_COPY_VALUE(arg, z);
|
||||
} else {
|
||||
ZVAL_STR(arg, zval_get_string_func(z));
|
||||
zval_ptr_dtor(z);
|
||||
}
|
||||
*dest = Z_STR_P(arg);
|
||||
return 1;
|
||||
@@ -1146,76 +1145,46 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
|
||||
ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
{
|
||||
if (!(class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
|
||||
zend_class_entry *ce;
|
||||
zend_class_constant *c;
|
||||
zval *val;
|
||||
zend_property_info *prop_info;
|
||||
|
||||
if (class_type->parent) {
|
||||
if (UNEXPECTED(zend_update_class_constants(class_type->parent) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count) {
|
||||
/* initialize static members of internal class */
|
||||
int i;
|
||||
zval *p;
|
||||
|
||||
#if ZTS
|
||||
CG(static_members_table)[(zend_intptr_t)(class_type->static_members_table)] = emalloc(sizeof(zval) * class_type->default_static_members_count);
|
||||
#else
|
||||
class_type->static_members_table = emalloc(sizeof(zval) * class_type->default_static_members_count);
|
||||
#endif
|
||||
for (i = 0; i < class_type->default_static_members_count; i++) {
|
||||
p = &class_type->default_static_members_table[i];
|
||||
if (Z_ISREF_P(p)) {
|
||||
if (class_type->parent &&
|
||||
i < class_type->parent->default_static_members_count &&
|
||||
p == &class_type->parent->default_static_members_table[i] &&
|
||||
Z_TYPE(CE_STATIC_MEMBERS(class_type->parent)[i]) != IS_UNDEF
|
||||
) {
|
||||
zval *q = &CE_STATIC_MEMBERS(class_type->parent)[i];
|
||||
|
||||
ZVAL_NEW_REF(q, q);
|
||||
ZVAL_COPY(&CE_STATIC_MEMBERS(class_type)[i], q);
|
||||
} else {
|
||||
ZVAL_COPY_OR_DUP(&CE_STATIC_MEMBERS(class_type)[i], Z_REFVAL_P(p));
|
||||
}
|
||||
} else {
|
||||
ZVAL_COPY_OR_DUP(&CE_STATIC_MEMBERS(class_type)[i], p);
|
||||
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
|
||||
val = &c->value;
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
zend_class_entry *ce;
|
||||
zend_class_constant *c;
|
||||
zval *val;
|
||||
zend_property_info *prop_info;
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
|
||||
val = &c->value;
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
ce = class_type;
|
||||
while (ce) {
|
||||
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
|
||||
if (prop_info->ce == ce) {
|
||||
if (prop_info->flags & ZEND_ACC_STATIC) {
|
||||
val = CE_STATIC_MEMBERS(class_type) + prop_info->offset;
|
||||
} else {
|
||||
val = (zval*)((char*)class_type->default_properties_table + prop_info->offset - OBJ_PROP_TO_OFFSET(0));
|
||||
}
|
||||
ZVAL_DEREF(val);
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, ce) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
ce = class_type;
|
||||
while (ce) {
|
||||
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
|
||||
if (prop_info->ce == ce) {
|
||||
if (prop_info->flags & ZEND_ACC_STATIC) {
|
||||
val = CE_STATIC_MEMBERS(class_type) + prop_info->offset;
|
||||
} else {
|
||||
val = (zval*)((char*)class_type->default_properties_table + prop_info->offset - OBJ_PROP_TO_OFFSET(0));
|
||||
}
|
||||
ZVAL_DEREF(val);
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, ce) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
ce = ce->parent;
|
||||
}
|
||||
ce = ce->parent;
|
||||
}
|
||||
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
}
|
||||
|
||||
@@ -1332,7 +1301,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
|
||||
* class and all props being public. If only a subset is given or the class
|
||||
* has protected members then you need to merge the properties separately by
|
||||
* calling zend_merge_properties(). */
|
||||
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC) /* {{{ */
|
||||
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */
|
||||
{
|
||||
if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
|
||||
if (class_type->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
@@ -1369,15 +1338,16 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC) /* {{{ */
|
||||
ZEND_API int object_init_ex(zval *arg, zend_class_entry *class_type) /* {{{ */
|
||||
{
|
||||
return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC);
|
||||
return object_and_properties_init(arg, class_type, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC) /* {{{ */
|
||||
ZEND_API int object_init(zval *arg) /* {{{ */
|
||||
{
|
||||
return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC);
|
||||
ZVAL_OBJ(arg, zend_objects_new(zend_standard_class_def));
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2120,6 +2090,11 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
|
||||
char lcname[16];
|
||||
size_t name_len;
|
||||
|
||||
if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
|
||||
|| ZSTR_VAL(fptr->common.function_name)[1] != '_') {
|
||||
return;
|
||||
}
|
||||
|
||||
/* we don't care if the function name is longer, in fact lowercasing only
|
||||
* the beginning of the name speeds up the check process */
|
||||
name_len = ZSTR_LEN(fptr->common.function_name);
|
||||
@@ -2363,6 +2338,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
|
||||
*/
|
||||
if ((fname_len == class_name_len) && !ctor && !memcmp(ZSTR_VAL(lowercase_name), lc_class_name, class_name_len+1)) {
|
||||
ctor = reg_function;
|
||||
} else if (ZSTR_VAL(lowercase_name)[0] != '_' || ZSTR_VAL(lowercase_name)[1] != '_') {
|
||||
reg_function = NULL;
|
||||
} else if (zend_string_equals_literal(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME)) {
|
||||
ctor = reg_function;
|
||||
} else if (zend_string_equals_literal(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME)) {
|
||||
@@ -2908,7 +2885,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {
|
||||
if (!disabled_class) {
|
||||
return FAILURE;
|
||||
}
|
||||
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
|
||||
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new);
|
||||
disabled_class->create_object = display_disabled_class;
|
||||
zend_hash_clean(&disabled_class->function_table);
|
||||
return SUCCESS;
|
||||
@@ -3016,39 +2993,30 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
|
||||
fcc->calling_scope = NULL;
|
||||
|
||||
if (!ce_org) {
|
||||
zend_function *func;
|
||||
zend_string *lmname;
|
||||
|
||||
/* Skip leading \ */
|
||||
if (UNEXPECTED(Z_STRVAL_P(callable)[0] == '\\')) {
|
||||
ZSTR_ALLOCA_INIT(lmname, Z_STRVAL_P(callable) + 1, Z_STRLEN_P(callable) - 1, use_heap);
|
||||
} else {
|
||||
lmname = Z_STR_P(callable);
|
||||
}
|
||||
/* Check if function with given name exists.
|
||||
* This may be a compound name that includes namespace name */
|
||||
zv = zend_hash_find(EG(function_table), lmname);
|
||||
if (EXPECTED(zv != NULL)) {
|
||||
fcc->function_handler = Z_PTR_P(zv);
|
||||
if (lmname != Z_STR_P(callable)) {
|
||||
ZSTR_ALLOCA_FREE(lmname, use_heap);
|
||||
}
|
||||
return 1;
|
||||
if (UNEXPECTED(Z_STRVAL_P(callable)[0] == '\\')) {
|
||||
/* Skip leading \ */
|
||||
ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable) - 1, use_heap);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable) + 1, Z_STRLEN_P(callable) - 1);
|
||||
func = zend_fetch_function(lmname);
|
||||
ZSTR_ALLOCA_FREE(lmname, use_heap);
|
||||
} else {
|
||||
if (lmname == Z_STR_P(callable)) {
|
||||
ZSTR_ALLOCA_INIT(lmname, Z_STRVAL_P(callable), Z_STRLEN_P(callable), use_heap);
|
||||
} else {
|
||||
zend_string_forget_hash_val(lmname);
|
||||
}
|
||||
zend_str_tolower(ZSTR_VAL(lmname), ZSTR_LEN(lmname));
|
||||
zv = zend_hash_find(EG(function_table), lmname);
|
||||
if (zv != NULL) {
|
||||
fcc->function_handler = Z_PTR_P(zv);
|
||||
lmname = Z_STR_P(callable);
|
||||
func = zend_fetch_function(lmname);
|
||||
if (!func) {
|
||||
ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable), use_heap);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable), Z_STRLEN_P(callable));
|
||||
func = zend_fetch_function(lmname);
|
||||
ZSTR_ALLOCA_FREE(lmname, use_heap);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (lmname != Z_STR_P(callable)) {
|
||||
ZSTR_ALLOCA_FREE(lmname, use_heap);
|
||||
if (EXPECTED(func != NULL)) {
|
||||
fcc->function_handler = func;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3497,7 +3465,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_nam
|
||||
|
||||
if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_STRICT, callable_name, &fcc, NULL)) {
|
||||
if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) {
|
||||
zval_dtor(callable);
|
||||
zval_ptr_dtor_str(callable);
|
||||
array_init(callable);
|
||||
add_next_index_str(callable, zend_string_copy(fcc.calling_scope->name));
|
||||
add_next_index_str(callable, zend_string_copy(fcc.function_handler->common.function_name));
|
||||
@@ -3723,9 +3691,6 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
|
||||
|
||||
if (ce->type == ZEND_INTERNAL_CLASS) {
|
||||
property_info = pemalloc(sizeof(zend_property_info), 1);
|
||||
if ((access_type & ZEND_ACC_STATIC) || Z_TYPE_P(property) == IS_CONSTANT_AST) {
|
||||
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
|
||||
}
|
||||
} else {
|
||||
property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
|
||||
if (Z_TYPE_P(property) == IS_CONSTANT_AST) {
|
||||
@@ -4091,42 +4056,37 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
|
||||
ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value) /* {{{ */
|
||||
{
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
zend_string *key = zend_string_init(name, name_length, 0);
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, key, 0);
|
||||
property = zend_std_get_static_property(scope, name, 0);
|
||||
EG(fake_scope) = old_scope;
|
||||
zend_string_efree(key);
|
||||
|
||||
if (!property) {
|
||||
return FAILURE;
|
||||
} else {
|
||||
if (property != value) {
|
||||
if (Z_ISREF_P(property)) {
|
||||
zval_dtor(property);
|
||||
ZVAL_COPY_VALUE(property, value);
|
||||
if (Z_REFCOUNTED_P(value) && Z_REFCOUNT_P(value) > 0) {
|
||||
zval_opt_copy_ctor(property);
|
||||
}
|
||||
} else {
|
||||
zval garbage;
|
||||
|
||||
ZVAL_COPY_VALUE(&garbage, property);
|
||||
if (Z_REFCOUNTED_P(value)) {
|
||||
Z_ADDREF_P(value);
|
||||
if (Z_ISREF_P(value)) {
|
||||
SEPARATE_ZVAL(value);
|
||||
}
|
||||
}
|
||||
ZVAL_COPY_VALUE(property, value);
|
||||
zval_ptr_dtor(&garbage);
|
||||
}
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (property != value) {
|
||||
zval garbage;
|
||||
ZVAL_DEREF(property);
|
||||
ZVAL_DEREF(value);
|
||||
ZVAL_COPY_VALUE(&garbage, property);
|
||||
ZVAL_COPY(property, value);
|
||||
zval_ptr_dtor(&garbage);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
|
||||
{
|
||||
zend_string *key = zend_string_init(name, name_length, 0);
|
||||
int retval = zend_update_static_property_ex(scope, key, value);
|
||||
zend_string_efree(key);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4217,21 +4177,28 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
|
||||
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
|
||||
{
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
zend_string *key = zend_string_init(name, name_length, 0);
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, key, silent);
|
||||
property = zend_std_get_static_property(scope, name, silent);
|
||||
EG(fake_scope) = old_scope;
|
||||
zend_string_efree(key);
|
||||
|
||||
return property;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
|
||||
{
|
||||
zend_string *key = zend_string_init(name, name_length, 0);
|
||||
zval *property = zend_read_static_property_ex(scope, key, silent);
|
||||
zend_string_efree(key);
|
||||
return property;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */
|
||||
{
|
||||
current->handling = EG(error_handling);
|
||||
|
||||
+16
-28
@@ -19,8 +19,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_API_H
|
||||
#define ZEND_API_H
|
||||
|
||||
@@ -185,18 +183,16 @@ typedef struct _zend_fcall_info_cache {
|
||||
#endif
|
||||
|
||||
#define INIT_CLASS_ENTRY(class_container, class_name, functions) \
|
||||
INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
|
||||
INIT_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions)
|
||||
|
||||
#define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \
|
||||
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, NULL, NULL, NULL, NULL, NULL)
|
||||
|
||||
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
{ \
|
||||
memset(&class_container, 0, sizeof(zend_class_entry)); \
|
||||
class_container.name = zend_string_init_interned(class_name, class_name_len, 1); \
|
||||
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
class_container.info.internal.builtin_functions = functions; \
|
||||
}
|
||||
|
||||
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions) \
|
||||
{ \
|
||||
class_container.constructor = NULL; \
|
||||
class_container.destructor = NULL; \
|
||||
@@ -204,16 +200,15 @@ typedef struct _zend_fcall_info_cache {
|
||||
class_container.serialize = NULL; \
|
||||
class_container.unserialize = NULL; \
|
||||
class_container.create_object = NULL; \
|
||||
class_container.interface_gets_implemented = NULL; \
|
||||
class_container.get_static_method = NULL; \
|
||||
class_container.__call = handle_fcall; \
|
||||
class_container.__call = NULL; \
|
||||
class_container.__callstatic = NULL; \
|
||||
class_container.__tostring = NULL; \
|
||||
class_container.__get = handle_propget; \
|
||||
class_container.__set = handle_propset; \
|
||||
class_container.__unset = handle_propunset; \
|
||||
class_container.__isset = handle_propisset; \
|
||||
class_container.__debugInfo = NULL; \
|
||||
class_container.__get = NULL; \
|
||||
class_container.__set = NULL; \
|
||||
class_container.__unset = NULL; \
|
||||
class_container.__isset = NULL; \
|
||||
class_container.__debugInfo = NULL; \
|
||||
class_container.serialize_func = NULL; \
|
||||
class_container.unserialize_func = NULL; \
|
||||
class_container.parent = NULL; \
|
||||
@@ -224,20 +219,14 @@ typedef struct _zend_fcall_info_cache {
|
||||
class_container.trait_precedences = NULL; \
|
||||
class_container.interfaces = NULL; \
|
||||
class_container.get_iterator = NULL; \
|
||||
class_container.iterator_funcs.funcs = NULL; \
|
||||
class_container.iterator_funcs_ptr = NULL; \
|
||||
class_container.info.internal.module = NULL; \
|
||||
class_container.info.internal.builtin_functions = functions; \
|
||||
}
|
||||
|
||||
#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
|
||||
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL)
|
||||
|
||||
#define INIT_NS_CLASS_ENTRY(class_container, ns, class_name, functions) \
|
||||
INIT_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions)
|
||||
#define INIT_OVERLOADED_NS_CLASS_ENTRY_EX(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, ZEND_NS_NAME(ns, class_name), sizeof(ZEND_NS_NAME(ns, class_name))-1, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset)
|
||||
#define INIT_OVERLOADED_NS_CLASS_ENTRY(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset) \
|
||||
INIT_OVERLOADED_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions, handle_fcall, handle_propget, handle_propset)
|
||||
|
||||
#ifdef ZTS
|
||||
# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members_table:CG(static_members_table)[(zend_intptr_t)(ce)->static_members_table])
|
||||
@@ -354,6 +343,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
|
||||
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
|
||||
|
||||
ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value);
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
|
||||
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
|
||||
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value);
|
||||
@@ -365,6 +355,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const
|
||||
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zend_bool silent, zval *rv);
|
||||
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
|
||||
|
||||
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent);
|
||||
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent);
|
||||
|
||||
ZEND_API char *zend_get_type_by_const(int type);
|
||||
@@ -385,12 +376,9 @@ ZEND_API char *zend_get_type_by_const(int type);
|
||||
|
||||
#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
|
||||
#define array_init_size(arg, size) ZVAL_ARR((arg), zend_new_array(size))
|
||||
#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
|
||||
#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
|
||||
#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC)
|
||||
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC);
|
||||
ZEND_API int object_init(zval *arg);
|
||||
ZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
|
||||
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties);
|
||||
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type);
|
||||
ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties);
|
||||
ZEND_API void object_properties_load(zend_object *object, HashTable *properties);
|
||||
|
||||
+8
-5
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* zend_alloc is designed to be a modern CPU cache friendly memory manager
|
||||
* for PHP. Most ideas are taken from jemalloc and tcmalloc implementations.
|
||||
@@ -425,11 +423,16 @@ static void *zend_mm_mmap_fixed(void *addr, size_t size)
|
||||
#ifdef _WIN32
|
||||
return VirtualAlloc(addr, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
||||
#else
|
||||
/* MAP_FIXED leads to discarding of the old mapping, so it can't be used. */
|
||||
void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON /*| MAP_POPULATE | MAP_HUGETLB*/, -1, 0);
|
||||
int flags = MAP_PRIVATE | MAP_ANON;
|
||||
#ifdef MAP_FIXED_NOREPLACE
|
||||
flags |= MAP_FIXED_NOREPLACE;
|
||||
#elif defined MAP_EXCL
|
||||
flags |= MAP_FIXED | MAP_EXCL;
|
||||
#endif
|
||||
void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, flags /*| MAP_POPULATE | MAP_HUGETLB*/, -1, 0);
|
||||
|
||||
if (ptr == MAP_FAILED) {
|
||||
#if ZEND_MM_ERROR
|
||||
#if ZEND_MM_ERROR && !defined(MAP_FIXED_NOREPLACE) && !defined(MAP_EXCL)
|
||||
fprintf(stderr, "\nmmap() failed: [%d] %s\n", errno, strerror(errno));
|
||||
#endif
|
||||
return NULL;
|
||||
|
||||
+8
-3
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_ALLOC_H
|
||||
#define ZEND_ALLOC_H
|
||||
|
||||
@@ -195,7 +193,14 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
|
||||
#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
|
||||
#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset))
|
||||
#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr))
|
||||
#define pefree_size(ptr, size, persistent) ((persistent)?free(ptr):efree_size(ptr, size))
|
||||
#define pefree_size(ptr, size, persistent) do { \
|
||||
if (persistent) { \
|
||||
free(ptr); \
|
||||
} else { \
|
||||
efree_size(ptr, size);\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
|
||||
#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size)))
|
||||
#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size)))
|
||||
|
||||
+38
-34
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend_ast.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_operators.h"
|
||||
@@ -405,12 +403,12 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
|
||||
zend_error(E_WARNING,
|
||||
"Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr);
|
||||
zval_ptr_dtor_nogc(expr);
|
||||
}
|
||||
break;
|
||||
case IS_STRING:
|
||||
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
|
||||
zval_dtor(offset);
|
||||
zval_ptr_dtor_str(offset);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_symtable_update(Z_ARRVAL_P(result), ZSTR_EMPTY_ALLOC(), expr);
|
||||
@@ -448,13 +446,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
} else {
|
||||
binary_op_type op = get_binary_op(ast->attr);
|
||||
ret = op(result, &op1, &op2);
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_GREATER:
|
||||
@@ -462,15 +460,15 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
} else {
|
||||
/* op1 > op2 is the same as op2 < op1 */
|
||||
binary_op_type op = ast->kind == ZEND_AST_GREATER
|
||||
? is_smaller_function : is_smaller_or_equal_function;
|
||||
ret = op(result, &op2, &op1);
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_UNARY_OP:
|
||||
@@ -479,7 +477,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
} else {
|
||||
unary_op_type op = get_unary_op(ast->attr);
|
||||
ret = op(result, &op1);
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_ZVAL:
|
||||
@@ -517,16 +515,16 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
}
|
||||
if (zend_is_true(&op1)) {
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
ZVAL_BOOL(result, zend_is_true(&op2));
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
} else {
|
||||
ZVAL_FALSE(result);
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
break;
|
||||
case ZEND_AST_OR:
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
@@ -537,14 +535,14 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
ZVAL_TRUE(result);
|
||||
} else {
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
ZVAL_BOOL(result, zend_is_true(&op2));
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
break;
|
||||
case ZEND_AST_CONDITIONAL:
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
@@ -556,19 +554,19 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
*result = op1;
|
||||
} else {
|
||||
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
}
|
||||
} else {
|
||||
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[2], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_COALESCE:
|
||||
@@ -580,11 +578,11 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
*result = op1;
|
||||
} else {
|
||||
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_UNARY_PLUS:
|
||||
@@ -593,7 +591,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
} else {
|
||||
ZVAL_LONG(&op1, 0);
|
||||
ret = add_function(result, &op1, &op2);
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_UNARY_MINUS:
|
||||
@@ -602,7 +600,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
} else {
|
||||
ZVAL_LONG(&op1, 0);
|
||||
ret = sub_function(result, &op1, &op2);
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_ARRAY:
|
||||
@@ -619,21 +617,21 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
zend_ast *elem = list->child[i];
|
||||
if (elem->child[1]) {
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, elem->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(result);
|
||||
zval_ptr_dtor_nogc(result);
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(&op1);
|
||||
}
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op2, elem->child[0], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(result);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
zval_ptr_dtor_nogc(result);
|
||||
return FAILURE;
|
||||
}
|
||||
if (UNEXPECTED(zend_ast_add_array_element(result, &op1, &op2) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
zval_dtor(result);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
zval_ptr_dtor_nogc(result);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -647,13 +645,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
ret = FAILURE;
|
||||
} else {
|
||||
zend_fetch_dimension_const(result, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R);
|
||||
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
zval_ptr_dtor_nogc(&op1);
|
||||
zval_ptr_dtor_nogc(&op2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1347,6 +1345,9 @@ tail_call:
|
||||
zend_ast_export_ex(str, decl->child[1], 0, indent);
|
||||
if (decl->child[3]) {
|
||||
smart_str_appends(str, ": ");
|
||||
if (decl->child[3]->attr & ZEND_TYPE_NULLABLE) {
|
||||
smart_str_appendc(str, '?');
|
||||
}
|
||||
zend_ast_export_ns_name(str, decl->child[3], 0, indent);
|
||||
}
|
||||
if (decl->child[2]) {
|
||||
@@ -1881,6 +1882,9 @@ simple_list:
|
||||
break;
|
||||
case ZEND_AST_PARAM:
|
||||
if (ast->child[0]) {
|
||||
if (ast->child[0]->attr & ZEND_TYPE_NULLABLE) {
|
||||
smart_str_appendc(str, '?');
|
||||
}
|
||||
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
|
||||
smart_str_appendc(str, ' ');
|
||||
}
|
||||
|
||||
+4
-21
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_AST_H
|
||||
#define ZEND_AST_H
|
||||
|
||||
@@ -204,27 +202,12 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_from_long(zend_long lval)
|
||||
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_constant(zend_string *name, zend_ast_attr attr);
|
||||
|
||||
#if ZEND_AST_SPEC
|
||||
# ifdef ZEND_WIN32
|
||||
# define ZEND_AST_EXPAND_VA(a) a
|
||||
# endif
|
||||
|
||||
# ifdef ZEND_WIN32
|
||||
# define ZEND_AST_SPEC_CALL(name, ...) \
|
||||
ZEND_AST_EXPAND_VA(ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
|
||||
# else
|
||||
# define ZEND_AST_SPEC_CALL(name, ...) \
|
||||
ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__)
|
||||
# endif
|
||||
# define ZEND_AST_SPEC_CALL(name, ...) \
|
||||
ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
|
||||
# define ZEND_AST_SPEC_CALL_(name, _, _4, _3, _2, _1, suffix, ...) \
|
||||
name ## suffix
|
||||
|
||||
# ifdef ZEND_WIN32
|
||||
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
|
||||
ZEND_AST_EXPAND_VA(ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
|
||||
# else
|
||||
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
|
||||
ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__)
|
||||
# endif
|
||||
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
|
||||
ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
|
||||
# define ZEND_AST_SPEC_CALL_EX_(name, _, _5, _4, _3, _2, _1, suffix, ...) \
|
||||
name ## suffix
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_gc.h"
|
||||
@@ -338,6 +336,10 @@ int zend_startup_builtin_functions(void) /* {{{ */
|
||||
Get the version of the Zend Engine */
|
||||
ZEND_FUNCTION(zend_version)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -347,6 +349,10 @@ ZEND_FUNCTION(zend_version)
|
||||
Returns number of freed bytes */
|
||||
ZEND_FUNCTION(gc_mem_caches)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(zend_mm_gc(zend_mm_get_heap()));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -356,6 +362,10 @@ ZEND_FUNCTION(gc_mem_caches)
|
||||
Returns number of freed zvals */
|
||||
ZEND_FUNCTION(gc_collect_cycles)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(gc_collect_cycles());
|
||||
}
|
||||
/* }}} */
|
||||
@@ -364,6 +374,10 @@ ZEND_FUNCTION(gc_collect_cycles)
|
||||
Returns status of the circular reference collector */
|
||||
ZEND_FUNCTION(gc_enabled)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_BOOL(gc_enabled());
|
||||
}
|
||||
/* }}} */
|
||||
@@ -372,7 +386,13 @@ ZEND_FUNCTION(gc_enabled)
|
||||
Activates the circular reference collector */
|
||||
ZEND_FUNCTION(gc_enable)
|
||||
{
|
||||
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
|
||||
zend_string *key;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
|
||||
zend_alter_ini_entry_chars(key, "1", sizeof("1")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zend_string_release_ex(key, 0);
|
||||
}
|
||||
@@ -382,7 +402,13 @@ ZEND_FUNCTION(gc_enable)
|
||||
Deactivates the circular reference collector */
|
||||
ZEND_FUNCTION(gc_disable)
|
||||
{
|
||||
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
|
||||
zend_string *key;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
|
||||
zend_alter_ini_entry_chars(key, "0", sizeof("0")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zend_string_release_ex(key, 0);
|
||||
}
|
||||
@@ -394,6 +420,10 @@ ZEND_FUNCTION(gc_status)
|
||||
{
|
||||
zend_gc_status status;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
zend_gc_get_status(&status);
|
||||
|
||||
array_init_size(return_value, 3);
|
||||
@@ -411,6 +441,10 @@ ZEND_FUNCTION(func_num_args)
|
||||
{
|
||||
zend_execute_data *ex = EX(prev_execute_data);
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
|
||||
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
|
||||
RETURN_LONG(-1);
|
||||
@@ -466,8 +500,7 @@ ZEND_FUNCTION(func_get_arg)
|
||||
arg = ZEND_CALL_ARG(ex, requested_offset + 1);
|
||||
}
|
||||
if (EXPECTED(!Z_ISUNDEF_P(arg))) {
|
||||
ZVAL_DEREF(arg);
|
||||
ZVAL_COPY(return_value, arg);
|
||||
ZVAL_COPY_DEREF(return_value, arg);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -819,7 +852,6 @@ ZEND_FUNCTION(define)
|
||||
case_sensitive = 0;
|
||||
}
|
||||
|
||||
/* class constant, check if there is name and make sure class is valid & exists */
|
||||
if (zend_memnstr(ZSTR_VAL(name), "::", sizeof("::") - 1, ZSTR_VAL(name) + ZSTR_LEN(name))) {
|
||||
zend_error(E_WARNING, "Class constants cannot be defined or redefined");
|
||||
RETURN_FALSE;
|
||||
@@ -870,10 +902,16 @@ repeat:
|
||||
|
||||
ZVAL_COPY(&c.value, val);
|
||||
zval_ptr_dtor(&val_free);
|
||||
|
||||
register_constant:
|
||||
c.flags = case_sensitive; /* non persistent */
|
||||
if (non_cs) {
|
||||
zend_error(E_DEPRECATED,
|
||||
"define(): Declaration of case-insensitive constants is deprecated");
|
||||
}
|
||||
|
||||
/* non persistent */
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, case_sensitive, PHP_USER_CONSTANT);
|
||||
c.name = zend_string_copy(name);
|
||||
c.module_number = PHP_USER_CONSTANT;
|
||||
if (zend_register_constant(&c) == SUCCESS) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
@@ -893,7 +931,7 @@ ZEND_FUNCTION(defined)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT)) {
|
||||
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT | ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK)) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
@@ -1071,6 +1109,7 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, int st
|
||||
prop = NULL;
|
||||
if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
|
||||
prop = &ce->default_static_members_table[prop_info->offset];
|
||||
ZVAL_DEINDIRECT(prop);
|
||||
} else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
|
||||
prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)];
|
||||
}
|
||||
@@ -2106,13 +2145,13 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (val->module_number == PHP_USER_CONSTANT) {
|
||||
if (ZEND_CONSTANT_MODULE_NUMBER(val) == PHP_USER_CONSTANT) {
|
||||
module_number = i;
|
||||
} else if (val->module_number > i || val->module_number < 0) {
|
||||
} else if (ZEND_CONSTANT_MODULE_NUMBER(val) > i) {
|
||||
/* should not happen */
|
||||
continue;
|
||||
} else {
|
||||
module_number = val->module_number;
|
||||
module_number = ZEND_CONSTANT_MODULE_NUMBER(val);
|
||||
}
|
||||
|
||||
if (Z_TYPE(modules[module_number]) == IS_UNDEF) {
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define ZEND_BUILTIN_FUNCTIONS_H
|
||||
|
||||
|
||||
+14
-5
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_closures.h"
|
||||
@@ -236,7 +234,8 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
|
||||
fci.size = sizeof(zend_fcall_info);
|
||||
fci.retval = return_value;
|
||||
|
||||
fcc.function_handler = (zend_function *) EX(func)->common.arg_info;
|
||||
fcc.function_handler = (EX(func)->internal_function.fn_flags & ZEND_ACC_STATIC) ?
|
||||
EX(func)->internal_function.scope->__callstatic : EX(func)->internal_function.scope->__call;
|
||||
fci.params = params;
|
||||
fci.param_count = 2;
|
||||
ZVAL_STR(&fci.params[0], EX(func)->common.function_name);
|
||||
@@ -272,9 +271,9 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
|
||||
memset(&call, 0, sizeof(zend_internal_function));
|
||||
|
||||
call.type = ZEND_INTERNAL_FUNCTION;
|
||||
call.fn_flags = mptr->common.fn_flags & ZEND_ACC_STATIC;
|
||||
call.handler = zend_closure_call_magic;
|
||||
call.function_name = mptr->common.function_name;
|
||||
call.arg_info = (zend_internal_arg_info *) mptr->common.prototype;
|
||||
call.scope = mptr->common.scope;
|
||||
|
||||
zend_free_trampoline(mptr);
|
||||
@@ -412,7 +411,7 @@ static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int t
|
||||
|
||||
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
|
||||
{
|
||||
if (has_set_exists != 2) {
|
||||
if (has_set_exists != ZEND_PROPERTY_EXISTS) {
|
||||
ZEND_CLOSURE_PROPERTY_ERROR();
|
||||
}
|
||||
return 0;
|
||||
@@ -731,6 +730,16 @@ void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var) /
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *) Z_OBJ_P(closure_zv);
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
zval *var = (zval*)((char*)static_variables->arData + offset);
|
||||
zval_ptr_dtor(var);
|
||||
ZVAL_COPY_VALUE(var, val);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_CLOSURES_H
|
||||
#define ZEND_CLOSURES_H
|
||||
|
||||
@@ -30,6 +28,7 @@ BEGIN_EXTERN_C()
|
||||
|
||||
void zend_register_closure_ce(void);
|
||||
void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var);
|
||||
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val);
|
||||
|
||||
extern ZEND_API zend_class_entry *zend_ce_closure;
|
||||
|
||||
|
||||
+171
-136
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <zend_language_parser.h>
|
||||
#include "zend.h"
|
||||
#include "zend_compile.h"
|
||||
@@ -460,7 +458,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string *name) /* {{{ */{
|
||||
|
||||
void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
|
||||
{
|
||||
zval_dtor(CT_CONSTANT_EX(op_array, n));
|
||||
zval_ptr_dtor_nogc(CT_CONSTANT_EX(op_array, n));
|
||||
if (n + 1 == op_array->last_literal) {
|
||||
op_array->last_literal--;
|
||||
} else {
|
||||
@@ -649,7 +647,8 @@ static void zend_end_live_range(zend_op_array *op_array, uint32_t offset, uint32
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline void zend_begin_loop(zend_uchar free_opcode, const znode *loop_var) /* {{{ */
|
||||
static inline void zend_begin_loop(
|
||||
zend_uchar free_opcode, const znode *loop_var, zend_bool is_switch) /* {{{ */
|
||||
{
|
||||
zend_brk_cont_element *brk_cont_element;
|
||||
int parent = CG(context).current_brk_cont;
|
||||
@@ -658,6 +657,7 @@ static inline void zend_begin_loop(zend_uchar free_opcode, const znode *loop_var
|
||||
CG(context).current_brk_cont = CG(context).last_brk_cont;
|
||||
brk_cont_element = get_next_brk_cont_element();
|
||||
brk_cont_element->parent = parent;
|
||||
brk_cont_element->is_switch = is_switch;
|
||||
|
||||
if (loop_var && (loop_var->op_type & (IS_VAR|IS_TMP_VAR))) {
|
||||
uint32_t start = get_next_op_number(CG(active_op_array));
|
||||
@@ -723,15 +723,7 @@ void zend_do_free(znode *op1) /* {{{ */
|
||||
}
|
||||
if (opline->result_type == IS_VAR
|
||||
&& opline->result.var == op1->u.op.var) {
|
||||
if (opline->opcode == ZEND_FETCH_R ||
|
||||
opline->opcode == ZEND_FETCH_DIM_R ||
|
||||
opline->opcode == ZEND_FETCH_OBJ_R ||
|
||||
opline->opcode == ZEND_FETCH_STATIC_PROP_R) {
|
||||
/* It's very rare and useless case. It's better to use
|
||||
additional FREE opcode and simplify the FETCH handlers
|
||||
their selves */
|
||||
zend_emit_op(NULL, ZEND_FREE, op1, NULL);
|
||||
} else if (opline->opcode == ZEND_FETCH_THIS) {
|
||||
if (opline->opcode == ZEND_FETCH_THIS) {
|
||||
opline->opcode = ZEND_NOP;
|
||||
opline->result_type = IS_UNUSED;
|
||||
} else {
|
||||
@@ -1077,7 +1069,9 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opli
|
||||
if (function->op_array.refcount) {
|
||||
(*function->op_array.refcount)++;
|
||||
}
|
||||
function->op_array.static_variables = NULL; /* NULL out the unbound function */
|
||||
if (!(function->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
|
||||
function->op_array.static_variables = NULL; /* NULL out the unbound function */
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -1188,11 +1182,10 @@ void zend_do_early_binding(void) /* {{{ */
|
||||
break;
|
||||
case ZEND_DECLARE_INHERITED_CLASS:
|
||||
{
|
||||
zend_op *fetch_class_opline = opline-1;
|
||||
zval *parent_name;
|
||||
zend_class_entry *ce;
|
||||
|
||||
parent_name = CT_CONSTANT(fetch_class_opline->op2);
|
||||
parent_name = CT_CONSTANT(opline->op2);
|
||||
if (((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) == NULL) ||
|
||||
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
|
||||
(ce->type == ZEND_INTERNAL_CLASS))) {
|
||||
@@ -1207,9 +1200,8 @@ void zend_do_early_binding(void) /* {{{ */
|
||||
if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1) == NULL) {
|
||||
return;
|
||||
}
|
||||
/* clear unnecessary ZEND_FETCH_CLASS opcode */
|
||||
zend_del_literal(CG(active_op_array), fetch_class_opline->op2.constant);
|
||||
MAKE_NOP(fetch_class_opline);
|
||||
zend_del_literal(CG(active_op_array), opline->op2.constant+1);
|
||||
zend_del_literal(CG(active_op_array), opline->op2.constant);
|
||||
|
||||
table = CG(class_table);
|
||||
break;
|
||||
@@ -1293,7 +1285,7 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array, uint3
|
||||
|
||||
CG(in_compilation) = 1;
|
||||
while (opline_num != (uint32_t)-1) {
|
||||
const zend_op *opline = &op_array->opcodes[opline_num-1];
|
||||
const zend_op *opline = &op_array->opcodes[opline_num];
|
||||
zval *parent_name = RT_CONSTANT(opline, opline->op2);
|
||||
if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) {
|
||||
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
|
||||
@@ -1374,7 +1366,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
|
||||
static zend_constant *zend_lookup_reserved_const(const char *name, size_t len) /* {{{ */
|
||||
{
|
||||
zend_constant *c = zend_hash_find_ptr_lc(EG(zend_constants), name, len);
|
||||
if (c && !(c->flags & CONST_CS) && (c->flags & CONST_CT_SUBST)) {
|
||||
if (c && !(ZEND_CONSTANT_FLAGS(c) & CONST_CS) && (ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST)) {
|
||||
return c;
|
||||
}
|
||||
return NULL;
|
||||
@@ -1388,9 +1380,9 @@ static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool i
|
||||
/* Substitute case-sensitive (or lowercase) constants */
|
||||
c = zend_hash_find_ptr(EG(zend_constants), name);
|
||||
if (c && (
|
||||
((c->flags & CONST_PERSISTENT)
|
||||
((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)
|
||||
&& !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION)
|
||||
&& (!(c->flags & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
|
||||
&& (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
|
||||
|| (Z_TYPE(c->value) < IS_OBJECT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION))
|
||||
)) {
|
||||
ZVAL_COPY_OR_DUP(zv, &c->value);
|
||||
@@ -1754,8 +1746,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
|
||||
ce->__tostring = NULL;
|
||||
ce->create_object = NULL;
|
||||
ce->get_iterator = NULL;
|
||||
ce->iterator_funcs.funcs = NULL;
|
||||
ce->interface_gets_implemented = NULL;
|
||||
ce->iterator_funcs_ptr = NULL;
|
||||
ce->get_static_method = NULL;
|
||||
ce->parent = NULL;
|
||||
ce->num_interfaces = 0;
|
||||
@@ -1901,12 +1892,14 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
|
||||
static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
|
||||
{
|
||||
zend_uchar factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
|
||||
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
opline->result_type = IS_TMP_VAR;
|
||||
result->op_type = IS_TMP_VAR;
|
||||
return;
|
||||
case BP_VAR_W:
|
||||
opline->opcode += 1 * factor;
|
||||
@@ -1915,6 +1908,8 @@ static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
|
||||
opline->opcode += 2 * factor;
|
||||
return;
|
||||
case BP_VAR_IS:
|
||||
opline->result_type = IS_TMP_VAR;
|
||||
result->op_type = IS_TMP_VAR;
|
||||
opline->opcode += 3 * factor;
|
||||
return;
|
||||
case BP_VAR_FUNC_ARG:
|
||||
@@ -2433,6 +2428,26 @@ static inline void zend_handle_numeric_op(znode *node) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline void zend_handle_numeric_dim(zend_op *opline, znode *dim_node) /* {{{ */
|
||||
{
|
||||
if (Z_TYPE(dim_node->u.constant) == IS_STRING) {
|
||||
zend_ulong index;
|
||||
|
||||
if (ZEND_HANDLE_NUMERIC(Z_STR(dim_node->u.constant), index)) {
|
||||
/* For numeric indexs we also keep the original value to use by ArrayAccess
|
||||
* See bug #63217
|
||||
*/
|
||||
int c = zend_add_literal(CG(active_op_array), &dim_node->u.constant);
|
||||
ZEND_ASSERT(opline->op2.constant + 1 == c);
|
||||
ZVAL_LONG(CT_CONSTANT(opline->op2), index);
|
||||
Z_EXTRA_P(CT_CONSTANT(opline->op2)) = ZEND_EXTRA_VALUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
Z_EXTRA_P(CT_CONSTANT(opline->op2)) = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /* {{{ */
|
||||
{
|
||||
if (class_node->op_type == IS_CONST) {
|
||||
@@ -2445,46 +2460,6 @@ static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int throw_exception) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
znode name_node;
|
||||
zend_compile_expr(&name_node, name_ast);
|
||||
|
||||
if (name_node.op_type == IS_CONST) {
|
||||
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->op1.num = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
|
||||
|
||||
if (fetch_type == ZEND_FETCH_CLASS_DEFAULT) {
|
||||
uint32_t type = name_ast->kind == ZEND_AST_ZVAL ? name_ast->attr : ZEND_NAME_FQ;
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name(name, type));
|
||||
opline->extended_value = zend_alloc_cache_slot();
|
||||
} else {
|
||||
zend_ensure_valid_class_fetch_type(fetch_type);
|
||||
}
|
||||
|
||||
zend_string_release_ex(name, 0);
|
||||
} else {
|
||||
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node);
|
||||
opline->op1.num = ZEND_FETCH_CLASS_DEFAULT | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
|
||||
}
|
||||
|
||||
return opline;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_compile_class_ref_ex(znode *result, zend_ast *name_ast, uint32_t fetch_flags) /* {{{ */
|
||||
{
|
||||
uint32_t fetch_type;
|
||||
@@ -2596,7 +2571,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
|
||||
opline->extended_value = ZEND_FETCH_LOCAL;
|
||||
}
|
||||
|
||||
zend_adjust_for_fetch_type(opline, type);
|
||||
zend_adjust_for_fetch_type(opline, result, type);
|
||||
return opline;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2615,7 +2590,11 @@ static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
|
||||
static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
|
||||
{
|
||||
if (is_this_fetch(ast)) {
|
||||
zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
|
||||
zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
|
||||
if ((type == BP_VAR_R) || (type == BP_VAR_IS)) {
|
||||
opline->result_type = IS_TMP_VAR;
|
||||
result->op_type = IS_TMP_VAR;
|
||||
}
|
||||
} else if (zend_try_compile_cv(result, ast) == FAILURE) {
|
||||
zend_compile_simple_var_no_cv(result, ast, type, delayed);
|
||||
}
|
||||
@@ -2670,11 +2649,14 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
|
||||
dim_node.op_type = IS_UNUSED;
|
||||
} else {
|
||||
zend_compile_expr(&dim_node, dim_ast);
|
||||
zend_handle_numeric_op(&dim_node);
|
||||
}
|
||||
|
||||
opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
|
||||
zend_adjust_for_fetch_type(opline, type);
|
||||
zend_adjust_for_fetch_type(opline, result, type);
|
||||
|
||||
if (dim_node.op_type == IS_CONST) {
|
||||
zend_handle_numeric_dim(opline, &dim_node);
|
||||
}
|
||||
return opline;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2709,7 +2691,7 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
|
||||
opline->extended_value = zend_alloc_polymorphic_cache_slot();
|
||||
}
|
||||
|
||||
zend_adjust_for_fetch_type(opline, type);
|
||||
zend_adjust_for_fetch_type(opline, result, type);
|
||||
return opline;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2754,7 +2736,7 @@ zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, i
|
||||
SET_NODE(opline->op2, &class_node);
|
||||
}
|
||||
|
||||
zend_adjust_for_fetch_type(opline, type);
|
||||
zend_adjust_for_fetch_type(opline, result, type);
|
||||
return opline;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2814,6 +2796,7 @@ static void zend_compile_list_assign(
|
||||
zend_ast *elem_ast = list->child[i];
|
||||
zend_ast *var_ast, *key_ast;
|
||||
znode fetch_result, dim_node;
|
||||
zend_op *opline;
|
||||
|
||||
if (elem_ast == NULL) {
|
||||
if (is_keyed) {
|
||||
@@ -2851,8 +2834,12 @@ static void zend_compile_list_assign(
|
||||
|
||||
zend_verify_list_assign_target(var_ast, old_style);
|
||||
|
||||
zend_emit_op(&fetch_result,
|
||||
elem_ast->attr ? ZEND_FETCH_LIST_W : ZEND_FETCH_LIST_R, expr_node, &dim_node);
|
||||
opline = zend_emit_op(&fetch_result,
|
||||
elem_ast->attr ? (expr_node->op_type == IS_CV ? ZEND_FETCH_DIM_W : ZEND_FETCH_LIST_W) : ZEND_FETCH_LIST_R, expr_node, &dim_node);
|
||||
|
||||
if (dim_node.op_type == IS_CONST) {
|
||||
zend_handle_numeric_dim(opline, &dim_node);
|
||||
}
|
||||
|
||||
if (var_ast->kind == ZEND_AST_ARRAY) {
|
||||
if (elem_ast->attr) {
|
||||
@@ -3214,7 +3201,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */
|
||||
opcode = ZEND_SEND_REF;
|
||||
} else {
|
||||
zend_compile_var(&arg_node, arg, BP_VAR_R);
|
||||
opcode = ZEND_SEND_VAR;
|
||||
opcode = (arg_node.op_type == IS_TMP_VAR) ? ZEND_SEND_VAL : ZEND_SEND_VAR;
|
||||
}
|
||||
} else {
|
||||
do {
|
||||
@@ -3419,7 +3406,7 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */
|
||||
if (arg_node.op_type == IS_CONST && Z_TYPE(arg_node.u.constant) == IS_STRING) {
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_LONG(&result->u.constant, Z_STRLEN(arg_node.u.constant));
|
||||
zval_dtor(&arg_node.u.constant);
|
||||
zval_ptr_dtor_str(&arg_node.u.constant);
|
||||
} else {
|
||||
zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL);
|
||||
}
|
||||
@@ -4260,7 +4247,7 @@ void zend_compile_global_var(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_bool by_ref) /* {{{ */
|
||||
static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, uint32_t by_ref) /* {{{ */
|
||||
{
|
||||
znode var_node;
|
||||
zend_op *opline;
|
||||
@@ -4287,7 +4274,7 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
|
||||
}
|
||||
CG(active_op_array)->static_variables = zend_array_dup(CG(active_op_array)->static_variables);
|
||||
}
|
||||
zend_hash_update(CG(active_op_array)->static_variables, var_name, value);
|
||||
value = zend_hash_update(CG(active_op_array)->static_variables, var_name, value);
|
||||
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as static variable");
|
||||
@@ -4296,7 +4283,7 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
|
||||
opline = zend_emit_op(NULL, ZEND_BIND_STATIC, NULL, &var_node);
|
||||
opline->op1_type = IS_CV;
|
||||
opline->op1.var = lookup_cv(CG(active_op_array), var_name);
|
||||
opline->extended_value = by_ref;
|
||||
opline->extended_value = (uint32_t)((char*)value - (char*)CG(active_op_array)->static_variables->arData) | by_ref;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4312,7 +4299,7 @@ void zend_compile_static_var(zend_ast *ast) /* {{{ */
|
||||
ZVAL_NULL(&value_zv);
|
||||
}
|
||||
|
||||
zend_compile_static_var_common(var_ast, &value_zv, 1);
|
||||
zend_compile_static_var_common(var_ast, &value_zv, ZEND_BIND_REF);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4530,13 +4517,13 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
if (depth_ast) {
|
||||
zval *depth_zv;
|
||||
if (depth_ast->kind != ZEND_AST_ZVAL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand "
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand "
|
||||
"is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue");
|
||||
}
|
||||
|
||||
depth_zv = zend_ast_get_zval(depth_ast);
|
||||
if (Z_TYPE_P(depth_zv) != IS_LONG || Z_LVAL_P(depth_zv) < 1) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers",
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive integers",
|
||||
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
|
||||
}
|
||||
|
||||
@@ -4555,6 +4542,29 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
depth, depth == 1 ? "" : "s");
|
||||
}
|
||||
}
|
||||
|
||||
if (ast->kind == ZEND_AST_CONTINUE) {
|
||||
int d, cur = CG(context).current_brk_cont;
|
||||
for (d = depth - 1; d > 0; d--) {
|
||||
cur = CG(context).brk_cont_array[cur].parent;
|
||||
ZEND_ASSERT(cur != -1);
|
||||
}
|
||||
|
||||
if (CG(context).brk_cont_array[cur].is_switch) {
|
||||
if (depth == 1) {
|
||||
zend_error(E_WARNING,
|
||||
"\"continue\" targeting switch is equivalent to \"break\". " \
|
||||
"Did you mean to use \"continue %d\"?",
|
||||
depth + 1);
|
||||
} else {
|
||||
zend_error(E_WARNING,
|
||||
"\"continue %d\" targeting switch is equivalent to \"break %d\". " \
|
||||
"Did you mean to use \"continue %d\"?",
|
||||
depth, depth, depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
opline = zend_emit_op(NULL, ast->kind == ZEND_AST_BREAK ? ZEND_BRK : ZEND_CONT, NULL, NULL);
|
||||
opline->op1.num = CG(context).current_brk_cont;
|
||||
opline->op2.num = depth;
|
||||
@@ -4578,7 +4588,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
|
||||
}
|
||||
|
||||
zval_dtor(label);
|
||||
zval_ptr_dtor_str(label);
|
||||
ZVAL_NULL(label);
|
||||
|
||||
current = opline->extended_value;
|
||||
@@ -4667,7 +4677,7 @@ void zend_compile_while(zend_ast *ast) /* {{{ */
|
||||
|
||||
opnum_jmp = zend_emit_jump(0);
|
||||
|
||||
zend_begin_loop(ZEND_NOP, NULL);
|
||||
zend_begin_loop(ZEND_NOP, NULL, 0);
|
||||
|
||||
opnum_start = get_next_op_number(CG(active_op_array));
|
||||
zend_compile_stmt(stmt_ast);
|
||||
@@ -4690,7 +4700,7 @@ void zend_compile_do_while(zend_ast *ast) /* {{{ */
|
||||
znode cond_node;
|
||||
uint32_t opnum_start, opnum_cond;
|
||||
|
||||
zend_begin_loop(ZEND_NOP, NULL);
|
||||
zend_begin_loop(ZEND_NOP, NULL, 0);
|
||||
|
||||
opnum_start = get_next_op_number(CG(active_op_array));
|
||||
zend_compile_stmt(stmt_ast);
|
||||
@@ -4741,7 +4751,7 @@ void zend_compile_for(zend_ast *ast) /* {{{ */
|
||||
|
||||
opnum_jmp = zend_emit_jump(0);
|
||||
|
||||
zend_begin_loop(ZEND_NOP, NULL);
|
||||
zend_begin_loop(ZEND_NOP, NULL, 0);
|
||||
|
||||
opnum_start = get_next_op_number(CG(active_op_array));
|
||||
zend_compile_stmt(stmt_ast);
|
||||
@@ -4804,7 +4814,7 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
|
||||
opnum_reset = get_next_op_number(CG(active_op_array));
|
||||
opline = zend_emit_op(&reset_node, by_ref ? ZEND_FE_RESET_RW : ZEND_FE_RESET_R, &expr_node, NULL);
|
||||
|
||||
zend_begin_loop(ZEND_FE_FREE, &reset_node);
|
||||
zend_begin_loop(ZEND_FE_FREE, &reset_node, 0);
|
||||
|
||||
opnum_fetch = get_next_op_number(CG(active_op_array));
|
||||
opline = zend_emit_op(NULL, by_ref ? ZEND_FE_FETCH_RW : ZEND_FE_FETCH_R, &reset_node, NULL);
|
||||
@@ -4959,7 +4969,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
|
||||
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
|
||||
zend_begin_loop(ZEND_FREE, &expr_node);
|
||||
zend_begin_loop(ZEND_FREE, &expr_node, 1);
|
||||
|
||||
case_node.op_type = IS_TMP_VAR;
|
||||
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
|
||||
@@ -5071,7 +5081,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
|
||||
opline->opcode = ZEND_FREE;
|
||||
SET_NODE(opline->op1, &expr_node);
|
||||
} else if (expr_node.op_type == IS_CONST) {
|
||||
zval_dtor(&expr_node.u.constant);
|
||||
zval_ptr_dtor_nogc(&expr_node.u.constant);
|
||||
}
|
||||
|
||||
efree(jmpnz_opnums);
|
||||
@@ -5347,7 +5357,7 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
|
||||
zval value_zv;
|
||||
zend_const_expr_to_zval(&value_zv, value_ast);
|
||||
FC(declarables).ticks = zval_get_long(&value_zv);
|
||||
zval_dtor(&value_zv);
|
||||
zval_ptr_dtor_nogc(&value_zv);
|
||||
} else if (zend_string_equals_literal_ci(name, "encoding")) {
|
||||
|
||||
if (FAILURE == zend_declare_is_first_statement(ast)) {
|
||||
@@ -5662,16 +5672,32 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_compile_closure_binding(znode *closure, zend_ast *uses_ast) /* {{{ */
|
||||
static void zend_compile_closure_binding(znode *closure, zend_op_array *op_array, zend_ast *uses_ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(uses_ast);
|
||||
uint32_t i;
|
||||
|
||||
if (!list->children) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!op_array->static_variables) {
|
||||
op_array->static_variables = zend_new_array(8);
|
||||
}
|
||||
|
||||
if (GC_REFCOUNT(op_array->static_variables) > 1) {
|
||||
if (!(GC_FLAGS(op_array->static_variables) & IS_ARRAY_IMMUTABLE)) {
|
||||
GC_DELREF(op_array->static_variables);
|
||||
}
|
||||
op_array->static_variables = zend_array_dup(op_array->static_variables);
|
||||
}
|
||||
|
||||
for (i = 0; i < list->children; ++i) {
|
||||
zend_ast *var_name_ast = list->child[i];
|
||||
zend_string *var_name = zval_make_interned_string(zend_ast_get_zval(var_name_ast));
|
||||
zend_bool by_ref = var_name_ast->attr;
|
||||
uint32_t by_ref = var_name_ast->attr;
|
||||
zend_op *opline;
|
||||
zval *value;
|
||||
|
||||
if (zend_string_equals_literal(var_name, "this")) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable");
|
||||
@@ -5681,10 +5707,16 @@ static void zend_compile_closure_binding(znode *closure, zend_ast *uses_ast) /*
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use auto-global as lexical variable");
|
||||
}
|
||||
|
||||
value = zend_hash_add(op_array->static_variables, var_name, &EG(uninitialized_zval));
|
||||
if (!value) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use variable $%s twice", ZSTR_VAL(var_name));
|
||||
}
|
||||
|
||||
opline = zend_emit_op(NULL, ZEND_BIND_LEXICAL, closure, NULL);
|
||||
opline->op2_type = IS_CV;
|
||||
opline->op2.var = lookup_cv(CG(active_op_array), var_name);
|
||||
opline->extended_value = by_ref;
|
||||
opline->extended_value = (uint32_t)((char*)value - (char*)op_array->static_variables->arData) | by_ref;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -5698,16 +5730,10 @@ void zend_compile_closure_uses(zend_ast *ast) /* {{{ */
|
||||
for (i = 0; i < list->children; ++i) {
|
||||
zend_ast *var_ast = list->child[i];
|
||||
zend_string *var_name = zend_ast_get_str(var_ast);
|
||||
zend_bool by_ref = var_ast->attr;
|
||||
uint32_t by_ref = var_ast->attr;
|
||||
zval zv;
|
||||
ZVAL_NULL(&zv);
|
||||
|
||||
if (op_array->static_variables
|
||||
&& zend_hash_exists(op_array->static_variables, var_name)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use variable $%s twice", ZSTR_VAL(var_name));
|
||||
}
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < op_array->last_var; i++) {
|
||||
@@ -5770,7 +5796,9 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
|
||||
}
|
||||
|
||||
if (in_interface) {
|
||||
if (zend_string_equals_literal(lcname, ZEND_CALL_FUNC_NAME)) {
|
||||
if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') {
|
||||
/* pass */
|
||||
} else if (zend_string_equals_literal(lcname, ZEND_CALL_FUNC_NAME)) {
|
||||
if (!is_public || is_static) {
|
||||
zend_error(E_WARNING, "The magic method __call() must have "
|
||||
"public visibility and cannot be static");
|
||||
@@ -5821,6 +5849,10 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
|
||||
if (!ce->constructor) {
|
||||
ce->constructor = (zend_function *) op_array;
|
||||
}
|
||||
} else if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') {
|
||||
if (!is_static) {
|
||||
op_array->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
} else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
|
||||
ce->constructor = (zend_function *) op_array;
|
||||
} else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) {
|
||||
@@ -5921,6 +5953,12 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
|
||||
zend_error(E_DEPRECATED, "__autoload() is deprecated, use spl_autoload_register() instead");
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal_ci(unqualified_name, "assert")) {
|
||||
zend_error(E_DEPRECATED,
|
||||
"Defining a custom assert() function is deprecated, "
|
||||
"as the function has special semantics");
|
||||
}
|
||||
|
||||
key = zend_build_runtime_definition_key(lcname, decl->lex_pos);
|
||||
zend_hash_update_ptr(CG(function_table), key, op_array);
|
||||
zend_register_seen_symbol(lcname, ZEND_SYMBOL_FUNCTION);
|
||||
@@ -5974,7 +6012,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast) /* {{{ */
|
||||
} else {
|
||||
zend_begin_func_decl(result, op_array, decl);
|
||||
if (uses_ast) {
|
||||
zend_compile_closure_binding(result, uses_ast);
|
||||
zend_compile_closure_binding(result, op_array, uses_ast);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6113,13 +6151,11 @@ void zend_compile_class_const_decl(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast) /* {{{ */
|
||||
static void zend_compile_method_ref(zend_ast *ast, zend_trait_method_reference *method_ref) /* {{{ */
|
||||
{
|
||||
zend_ast *class_ast = ast->child[0];
|
||||
zend_ast *method_ast = ast->child[1];
|
||||
|
||||
zend_trait_method_reference *method_ref = emalloc(sizeof(zend_trait_method_reference));
|
||||
method_ref->ce = NULL;
|
||||
method_ref->method_name = zend_string_copy(zend_ast_get_str(method_ast));
|
||||
|
||||
if (class_ast) {
|
||||
@@ -6127,25 +6163,6 @@ static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast) /* {{
|
||||
} else {
|
||||
method_ref->class_name = NULL;
|
||||
}
|
||||
|
||||
return method_ref;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_string **zend_compile_name_list(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
zend_string **names = safe_emalloc(sizeof(zend_string *), list->children + 1, 0);
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < list->children; ++i) {
|
||||
zend_ast *name_ast = list->child[i];
|
||||
names[i] = zend_resolve_class_name_ast(name_ast);
|
||||
}
|
||||
|
||||
names[list->children] = NULL;
|
||||
|
||||
return names;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -6153,11 +6170,17 @@ static void zend_compile_trait_precedence(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast *method_ref_ast = ast->child[0];
|
||||
zend_ast *insteadof_ast = ast->child[1];
|
||||
zend_ast_list *insteadof_list = zend_ast_get_list(insteadof_ast);
|
||||
uint32_t i;
|
||||
|
||||
zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence));
|
||||
precedence->trait_method = zend_compile_method_ref(method_ref_ast);
|
||||
precedence->exclude_from_classes
|
||||
= (void *) zend_compile_name_list(insteadof_ast);
|
||||
zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence) + (insteadof_list->children - 1) * sizeof(zend_string*));
|
||||
zend_compile_method_ref(method_ref_ast, &precedence->trait_method);
|
||||
precedence->num_excludes = insteadof_list->children;
|
||||
|
||||
for (i = 0; i < insteadof_list->children; ++i) {
|
||||
zend_ast *name_ast = insteadof_list->child[i];
|
||||
precedence->exclude_class_names[i] = zend_resolve_class_name_ast(name_ast);
|
||||
}
|
||||
|
||||
zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence);
|
||||
}
|
||||
@@ -6180,7 +6203,7 @@ static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
|
||||
alias = emalloc(sizeof(zend_trait_alias));
|
||||
alias->trait_method = zend_compile_method_ref(method_ref_ast);
|
||||
zend_compile_method_ref(method_ref_ast, &alias->trait_method);
|
||||
alias->modifiers = modifiers;
|
||||
|
||||
if (alias_ast) {
|
||||
@@ -6225,7 +6248,6 @@ void zend_compile_use_trait(zend_ast *ast) /* {{{ */
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name_ast(trait_ast));
|
||||
opline->extended_value = zend_alloc_cache_slot();
|
||||
|
||||
ce->num_traits++;
|
||||
}
|
||||
@@ -6268,7 +6290,6 @@ void zend_compile_implements(znode *class_node, zend_ast *ast) /* {{{ */
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name_ast(class_ast));
|
||||
opline->extended_value = zend_alloc_cache_slot();
|
||||
|
||||
CG(active_class_entry)->num_interfaces++;
|
||||
}
|
||||
@@ -6298,7 +6319,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
zend_string *name, *lcname;
|
||||
zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
|
||||
zend_op *opline;
|
||||
znode declare_node, extends_node;
|
||||
znode declare_node;
|
||||
int extends_const;
|
||||
|
||||
zend_class_entry *original_ce = CG(active_class_entry);
|
||||
znode original_implementing_class = FC(implementing_class);
|
||||
@@ -6351,13 +6373,24 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
|
||||
if (extends_ast) {
|
||||
znode extends_node;
|
||||
zend_string *extends_name;
|
||||
|
||||
if (!zend_is_const_default_class_ref(extends_ast)) {
|
||||
zend_string *extends_name = zend_ast_get_str(extends_ast);
|
||||
extends_name = zend_ast_get_str(extends_ast);
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use '%s' as class name as it is reserved", ZSTR_VAL(extends_name));
|
||||
}
|
||||
|
||||
zend_compile_class_ref(&extends_node, extends_ast, 1);
|
||||
zend_compile_expr(&extends_node, extends_ast);
|
||||
if (extends_node.op_type != IS_CONST || Z_TYPE(extends_node.u.constant) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
extends_name = Z_STR(extends_node.u.constant);
|
||||
extends_const = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name(extends_name,
|
||||
extends_ast->kind == ZEND_AST_ZVAL ? extends_ast->attr : ZEND_NAME_FQ));
|
||||
zend_string_release_ex(extends_name, 0);
|
||||
ce->ce_flags |= ZEND_ACC_INHERITED;
|
||||
}
|
||||
|
||||
@@ -6372,7 +6405,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
if (decl->flags & ZEND_ACC_ANON_CLASS) {
|
||||
if (extends_ast) {
|
||||
opline->opcode = ZEND_DECLARE_ANON_INHERITED_CLASS;
|
||||
SET_NODE(opline->op2, &extends_node);
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = extends_const;
|
||||
} else {
|
||||
opline->opcode = ZEND_DECLARE_ANON_CLASS;
|
||||
}
|
||||
@@ -6391,7 +6425,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
|
||||
if (extends_ast) {
|
||||
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
|
||||
SET_NODE(opline->op2, &extends_node);
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = extends_const;
|
||||
} else {
|
||||
opline->opcode = ZEND_DECLARE_CLASS;
|
||||
}
|
||||
|
||||
+138
-107
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_COMPILE_H
|
||||
#define ZEND_COMPILE_H
|
||||
|
||||
@@ -158,6 +156,7 @@ typedef struct _zend_brk_cont_element {
|
||||
int cont;
|
||||
int brk;
|
||||
int parent;
|
||||
zend_bool is_switch;
|
||||
} zend_brk_cont_element;
|
||||
|
||||
typedef struct _zend_label {
|
||||
@@ -198,115 +197,143 @@ typedef struct _zend_oparray_context {
|
||||
HashTable *labels;
|
||||
} zend_oparray_context;
|
||||
|
||||
/*
|
||||
* Function and method flags
|
||||
*
|
||||
* Free flags:
|
||||
* 0x10
|
||||
* 0x20
|
||||
* 0x2000000
|
||||
*/
|
||||
/* Class, property and method flags class|meth.|prop.|const*/
|
||||
/* | | | */
|
||||
/* Common flags | | | */
|
||||
/* ============ | | | */
|
||||
/* | | | */
|
||||
/* Staic method or property | | | */
|
||||
#define ZEND_ACC_STATIC (1 << 0) /* | X | X | */
|
||||
/* | | | */
|
||||
/* Final class or method | | | */
|
||||
#define ZEND_ACC_FINAL (1 << 2) /* X | X | | */
|
||||
/* | | | */
|
||||
/* Visibility flags (public < protected < private) | | | */
|
||||
#define ZEND_ACC_PUBLIC (1 << 8) /* | X | X | X */
|
||||
#define ZEND_ACC_PROTECTED (1 << 9) /* | X | X | X */
|
||||
#define ZEND_ACC_PRIVATE (1 << 10) /* | X | X | X */
|
||||
/* | | | */
|
||||
/* TODO: explain the name ??? | | | */
|
||||
#define ZEND_ACC_CHANGED (1 << 11) /* | X | X | */
|
||||
/* | | | */
|
||||
/* TODO: used only by ext/reflection ??? | | | */
|
||||
#define ZEND_ACC_IMPLICIT_PUBLIC (1 << 12) /* | ? | ? | ? */
|
||||
/* | | | */
|
||||
/* Shadow of parent's private method/property | | | */
|
||||
#define ZEND_ACC_SHADOW (1 << 17) /* | ? | X | */
|
||||
/* | | | */
|
||||
/* Class Flags (unused: 0, 1, 3, 11-18, 21, 25...) | | | */
|
||||
/* =========== | | | */
|
||||
/* | | | */
|
||||
/* class is abstarct, since it is set by any | | | */
|
||||
/* abstract method | | | */
|
||||
#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS (1 << 4) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class is explicitly defined as abstract by using | | | */
|
||||
/* the keyword. | | | */
|
||||
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS (1 << 5) /* X | | | */
|
||||
/* | | | */
|
||||
/* Special class types | | | */
|
||||
#define ZEND_ACC_INTERFACE (1 << 6) /* X | | | */
|
||||
#define ZEND_ACC_TRAIT (1 << 7) /* X | | | */
|
||||
#define ZEND_ACC_ANON_CLASS (1 << 8) /* X | | | */
|
||||
/* | | | */
|
||||
/* Bound anonymous class | | | */
|
||||
#define ZEND_ACC_ANON_BOUND (1 << 9) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class extends another class | | | */
|
||||
#define ZEND_ACC_INHERITED (1 << 10) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class implements interface(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 19) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class constants updated | | | */
|
||||
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 20) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class uses trait(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 22) /* X | | | */
|
||||
/* | | | */
|
||||
/* User class has methods with static variables | | | */
|
||||
#define ZEND_HAS_STATIC_IN_METHODS (1 << 23) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class has magic methods __get/__set/__unset/ | | | */
|
||||
/* __isset that use guards | | | */
|
||||
#define ZEND_ACC_USE_GUARDS (1 << 24) /* X | | | */
|
||||
/* | | | */
|
||||
/* Function Flags (unused: 4, 5, 17?) | | | */
|
||||
/* ============== | | | */
|
||||
/* | | | */
|
||||
/* Abstarct method | | | */
|
||||
#define ZEND_ACC_ABSTRACT (1 << 1) /* | X | | */
|
||||
/* | | | */
|
||||
/* TODO: used only during inheritance ??? | | | */
|
||||
#define ZEND_ACC_IMPLEMENTED_ABSTRACT (1 << 3) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_FAKE_CLOSURE (1 << 6) /* | X | | */
|
||||
/* | | | */
|
||||
/* method flag used by Closure::__invoke() | | | */
|
||||
#define ZEND_ACC_USER_ARG_INFO (1 << 7) /* | X | | */
|
||||
/* | | | */
|
||||
/* method flags (special method detection) | | | */
|
||||
#define ZEND_ACC_CTOR (1 << 13) /* | X | | */
|
||||
#define ZEND_ACC_DTOR (1 << 14) /* | X | | */
|
||||
/* | | | */
|
||||
/* "main" op_array with | | | */
|
||||
/* ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes | | | */
|
||||
#define ZEND_ACC_EARLY_BINDING (1 << 15) /* | X | | */
|
||||
/* | | | */
|
||||
/* method flag (bc only), any method that has this | | | */
|
||||
/* flag can be used statically and non statically. | | | */
|
||||
#define ZEND_ACC_ALLOW_STATIC (1 << 16) /* | X | | */
|
||||
/* | | | */
|
||||
/* deprecation flag | | | */
|
||||
#define ZEND_ACC_DEPRECATED (1 << 18) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_NO_RT_ARENA (1 << 19) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_CLOSURE (1 << 20) /* | X | | */
|
||||
/* | | | */
|
||||
/* call through user function trampoline. e.g. | | | */
|
||||
/* __call, __callstatic | | | */
|
||||
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 21) /* | X | | */
|
||||
/* | | | */
|
||||
/* disable inline caching | | | */
|
||||
#define ZEND_ACC_NEVER_CACHE (1 << 22) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_GENERATOR (1 << 23) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function with varable number of arguments | | | */
|
||||
#define ZEND_ACC_VARIADIC (1 << 24) /* | X | | */
|
||||
/* | | | */
|
||||
/* Immutable op_array (lazy loading) | | | */
|
||||
#define ZEND_ACC_IMMUTABLE (1 << 25) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function returning by reference | | | */
|
||||
#define ZEND_ACC_RETURN_REFERENCE (1 << 26) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_DONE_PASS_TWO (1 << 27) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function has typed arguments | | | */
|
||||
#define ZEND_ACC_HAS_TYPE_HINTS (1 << 28) /* | X | | */
|
||||
/* | | | */
|
||||
/* op_array has finally blocks (user only) | | | */
|
||||
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 29) /* | X | | */
|
||||
/* | | | */
|
||||
/* internal function is allocated at arena (int only) | | | */
|
||||
#define ZEND_ACC_ARENA_ALLOCATED (1 << 29) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function has a return type | | | */
|
||||
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 30) /* | X | | */
|
||||
/* | | | */
|
||||
/* op_array uses strict mode types | | | */
|
||||
#define ZEND_ACC_STRICT_TYPES (1 << 31) /* | X | | */
|
||||
|
||||
/* method flags (types) */
|
||||
#define ZEND_ACC_STATIC 0x01
|
||||
#define ZEND_ACC_ABSTRACT 0x02
|
||||
#define ZEND_ACC_FINAL 0x04
|
||||
#define ZEND_ACC_IMPLEMENTED_ABSTRACT 0x08
|
||||
|
||||
/* method flags (visibility) */
|
||||
/* The order of those must be kept - public < protected < private */
|
||||
#define ZEND_ACC_PUBLIC 0x100
|
||||
#define ZEND_ACC_PROTECTED 0x200
|
||||
#define ZEND_ACC_PRIVATE 0x400
|
||||
#define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE)
|
||||
|
||||
#define ZEND_ACC_CHANGED 0x800
|
||||
#define ZEND_ACC_IMPLICIT_PUBLIC 0x1000
|
||||
|
||||
/* method flags (special method detection) */
|
||||
#define ZEND_ACC_CTOR 0x2000
|
||||
#define ZEND_ACC_DTOR 0x4000
|
||||
|
||||
/* "main" op_array with ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes */
|
||||
#define ZEND_ACC_EARLY_BINDING 0x8000
|
||||
|
||||
/* method flag used by Closure::__invoke() */
|
||||
#define ZEND_ACC_USER_ARG_INFO 0x80
|
||||
|
||||
/* method flag (bc only), any method that has this flag can be used statically and non statically. */
|
||||
#define ZEND_ACC_ALLOW_STATIC 0x10000
|
||||
|
||||
/* shadow of parent's private method/property */
|
||||
#define ZEND_ACC_SHADOW 0x20000
|
||||
|
||||
/* deprecation flag */
|
||||
#define ZEND_ACC_DEPRECATED 0x40000
|
||||
|
||||
#define ZEND_ACC_CLOSURE 0x100000
|
||||
#define ZEND_ACC_FAKE_CLOSURE 0x40
|
||||
#define ZEND_ACC_GENERATOR 0x800000
|
||||
|
||||
#define ZEND_ACC_NO_RT_ARENA 0x80000
|
||||
|
||||
/* call through user function trampoline. e.g. __call, __callstatic */
|
||||
#define ZEND_ACC_CALL_VIA_TRAMPOLINE 0x200000
|
||||
|
||||
/* call through internal function handler. e.g. Closure::invoke() */
|
||||
#define ZEND_ACC_CALL_VIA_HANDLER ZEND_ACC_CALL_VIA_TRAMPOLINE
|
||||
|
||||
/* disable inline caching */
|
||||
#define ZEND_ACC_NEVER_CACHE 0x400000
|
||||
|
||||
#define ZEND_ACC_VARIADIC 0x1000000
|
||||
|
||||
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
|
||||
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
|
||||
|
||||
/* class has magic methods __get/__set/__unset/__isset that use guards */
|
||||
#define ZEND_ACC_USE_GUARDS 0x1000000
|
||||
|
||||
/* function has typed arguments */
|
||||
#define ZEND_ACC_HAS_TYPE_HINTS 0x10000000
|
||||
|
||||
/* op_array has finally blocks */
|
||||
#define ZEND_ACC_HAS_FINALLY_BLOCK 0x20000000
|
||||
|
||||
/* internal function is allocated at arena */
|
||||
#define ZEND_ACC_ARENA_ALLOCATED 0x20000000
|
||||
|
||||
/* Function has a return type (or class has such non-private function) */
|
||||
#define ZEND_ACC_HAS_RETURN_TYPE 0x40000000
|
||||
|
||||
/* op_array uses strict mode types */
|
||||
#define ZEND_ACC_STRICT_TYPES 0x80000000
|
||||
|
||||
/*
|
||||
* Class flags
|
||||
*
|
||||
* Classes also use the ZEND_ACC_FINAL (0x04) flag, otherwise there is no overlap.
|
||||
*/
|
||||
|
||||
/* class flags (types) */
|
||||
/* ZEND_ACC_IMPLICIT_ABSTRACT_CLASS is used for abstract classes (since it is set by any abstract method even interfaces MAY have it set, too). */
|
||||
/* ZEND_ACC_EXPLICIT_ABSTRACT_CLASS denotes that a class was explicitly defined as abstract by using the keyword. */
|
||||
#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS 0x10
|
||||
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS 0x20
|
||||
#define ZEND_ACC_INTERFACE 0x40
|
||||
#define ZEND_ACC_TRAIT 0x80
|
||||
#define ZEND_ACC_ANON_CLASS 0x100
|
||||
#define ZEND_ACC_ANON_BOUND 0x200
|
||||
#define ZEND_ACC_INHERITED 0x400
|
||||
|
||||
/* class implement interface(s) flag */
|
||||
#define ZEND_ACC_IMPLEMENT_INTERFACES 0x80000
|
||||
#define ZEND_ACC_IMPLEMENT_TRAITS 0x400000
|
||||
|
||||
/* class constants updated */
|
||||
#define ZEND_ACC_CONSTANTS_UPDATED 0x100000
|
||||
|
||||
/* user class has methods with static variables */
|
||||
#define ZEND_HAS_STATIC_IN_METHODS 0x800000
|
||||
|
||||
char *zend_visibility_string(uint32_t fn_flags);
|
||||
|
||||
typedef struct _zend_property_info {
|
||||
@@ -376,7 +403,7 @@ struct _zend_op_array {
|
||||
|
||||
int cache_size; /* number of run_time_cache_slots * sizeof(void*) */
|
||||
int last_var; /* number of CV variables */
|
||||
uint32_t T; /* numner of temporary variables */
|
||||
uint32_t T; /* number of temporary variables */
|
||||
uint32_t last; /* number of opcodes */
|
||||
|
||||
zend_op *opcodes;
|
||||
@@ -676,6 +703,8 @@ struct _zend_execute_data {
|
||||
#define IS_VAR (1<<2)
|
||||
#define IS_CV (1<<3) /* Compiled variable */
|
||||
|
||||
#define ZEND_EXTRA_VALUE 1
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
@@ -941,9 +970,11 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
|
||||
#define ZEND_RETURN_VAL 0
|
||||
#define ZEND_RETURN_REF 1
|
||||
|
||||
#define ZEND_BIND_VAL 0
|
||||
#define ZEND_BIND_REF 1
|
||||
|
||||
#define ZEND_RETURNS_FUNCTION 1<<0
|
||||
#define ZEND_RETURNS_VALUE 1<<1
|
||||
#define ZEND_RETURNS_FUNCTION (1<<0)
|
||||
#define ZEND_RETURNS_VALUE (1<<1)
|
||||
|
||||
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
|
||||
#define ZEND_ARRAY_NOT_PACKED (1<<1)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_CONFIG_NW_H
|
||||
#define ZEND_CONFIG_NW_H
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_CONFIG_W32_H
|
||||
#define ZEND_CONFIG_W32_H
|
||||
|
||||
|
||||
+78
-71
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_exceptions.h"
|
||||
@@ -39,14 +37,14 @@ void free_zend_constant(zval *zv)
|
||||
{
|
||||
zend_constant *c = Z_PTR_P(zv);
|
||||
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_ptr_dtor(&c->value);
|
||||
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
|
||||
zval_ptr_dtor_nogc(&c->value);
|
||||
if (c->name) {
|
||||
zend_string_release_ex(c->name, 0);
|
||||
}
|
||||
efree(c);
|
||||
} else {
|
||||
zval_internal_dtor(&c->value);
|
||||
zval_internal_ptr_dtor(&c->value);
|
||||
if (c->name) {
|
||||
zend_string_release_ex(c->name, 1);
|
||||
}
|
||||
@@ -60,7 +58,7 @@ static void copy_zend_constant(zval *zv)
|
||||
{
|
||||
zend_constant *c = Z_PTR_P(zv);
|
||||
|
||||
ZEND_ASSERT(c->flags & CONST_PERSISTENT);
|
||||
ZEND_ASSERT(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
|
||||
Z_PTR_P(zv) = pemalloc(sizeof(zend_constant), 1);
|
||||
memcpy(Z_PTR_P(zv), c, sizeof(zend_constant));
|
||||
|
||||
@@ -84,7 +82,7 @@ static int clean_module_constant(zval *el, void *arg)
|
||||
zend_constant *c = (zend_constant *)Z_PTR_P(el);
|
||||
int module_number = *(int *)arg;
|
||||
|
||||
if (c->module_number == module_number) {
|
||||
if (ZEND_CONSTANT_MODULE_NUMBER(c) == module_number) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -153,9 +151,8 @@ ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int
|
||||
zend_constant c;
|
||||
|
||||
ZVAL_NULL(&c.value);
|
||||
c.flags = flags;
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
|
||||
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
|
||||
c.module_number = module_number;
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
@@ -164,9 +161,8 @@ ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zen
|
||||
zend_constant c;
|
||||
|
||||
ZVAL_BOOL(&c.value, bval);
|
||||
c.flags = flags;
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
|
||||
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
|
||||
c.module_number = module_number;
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
@@ -175,9 +171,8 @@ ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zen
|
||||
zend_constant c;
|
||||
|
||||
ZVAL_LONG(&c.value, lval);
|
||||
c.flags = flags;
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
|
||||
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
|
||||
c.module_number = module_number;
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
@@ -187,9 +182,8 @@ ZEND_API void zend_register_double_constant(const char *name, size_t name_len, d
|
||||
zend_constant c;
|
||||
|
||||
ZVAL_DOUBLE(&c.value, dval);
|
||||
c.flags = flags;
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
|
||||
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
|
||||
c.module_number = module_number;
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
@@ -199,9 +193,8 @@ ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len,
|
||||
zend_constant c;
|
||||
|
||||
ZVAL_STR(&c.value, zend_string_init_interned(strval, strlen, flags & CONST_PERSISTENT));
|
||||
c.flags = flags;
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
|
||||
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
|
||||
c.module_number = module_number;
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
@@ -250,7 +243,7 @@ ZEND_API int zend_verify_const_access(zend_class_constant *c, zend_class_entry *
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
|
||||
static inline zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len)
|
||||
{
|
||||
zend_constant *c;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
@@ -259,7 +252,7 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
|
||||
char *lcname = do_alloca(name_len + 1, use_heap);
|
||||
zend_str_tolower_copy(lcname, name, name_len);
|
||||
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, name_len)) != NULL) {
|
||||
if (c->flags & CONST_CS) {
|
||||
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
|
||||
c = NULL;
|
||||
}
|
||||
} else {
|
||||
@@ -268,10 +261,16 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
|
||||
free_alloca(lcname, use_heap);
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
|
||||
{
|
||||
zend_constant *c = zend_get_constant_str_impl(name, name_len);
|
||||
return c ? &c->value : NULL;
|
||||
}
|
||||
|
||||
ZEND_API zval *zend_get_constant(zend_string *name)
|
||||
static inline zend_constant *zend_get_constant_impl(zend_string *name)
|
||||
{
|
||||
zval *zv;
|
||||
zend_constant *c;
|
||||
@@ -284,16 +283,39 @@ ZEND_API zval *zend_get_constant(zend_string *name)
|
||||
zv = zend_hash_str_find(EG(zend_constants), lcname, ZSTR_LEN(name));
|
||||
if (zv != NULL) {
|
||||
c = Z_PTR_P(zv);
|
||||
if (c->flags & CONST_CS) {
|
||||
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
|
||||
c = NULL;
|
||||
}
|
||||
} else {
|
||||
c = zend_get_special_constant(ZSTR_VAL(name), ZSTR_LEN(name));
|
||||
}
|
||||
free_alloca(lcname, use_heap);
|
||||
return c ? &c->value : NULL;
|
||||
return c;
|
||||
} else {
|
||||
return &((zend_constant*)Z_PTR_P(zv))->value;
|
||||
return (zend_constant *) Z_PTR_P(zv);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API zval *zend_get_constant(zend_string *name)
|
||||
{
|
||||
zend_constant *c = zend_get_constant_impl(name);
|
||||
return c ? &c->value : NULL;
|
||||
}
|
||||
|
||||
static zend_bool is_access_deprecated(const zend_constant *c, const char *access_name) {
|
||||
const char *ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name));
|
||||
if (ns_sep) {
|
||||
/* Namespaces are always case-insensitive. Only compare shortname. */
|
||||
size_t shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
|
||||
size_t shortname_len = ZSTR_LEN(c->name) - shortname_offset;
|
||||
return memcmp(
|
||||
access_name + shortname_offset,
|
||||
ZSTR_VAL(c->name) + shortname_offset,
|
||||
shortname_len
|
||||
) != 0;
|
||||
} else {
|
||||
/* No namespace, compare whole name */
|
||||
return memcmp(access_name, ZSTR_VAL(c->name), ZSTR_LEN(c->name)) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,70 +431,55 @@ failure:
|
||||
/* try lowercase */
|
||||
zend_str_tolower(lcname + prefix_len + 1, const_name_len);
|
||||
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, lcname_len)) != NULL) {
|
||||
if ((c->flags & CONST_CS) != 0) {
|
||||
if ((ZEND_CONSTANT_FLAGS(c) & CONST_CS) != 0) {
|
||||
c = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
free_alloca(lcname, use_heap);
|
||||
if (c) {
|
||||
return &c->value;
|
||||
|
||||
if (!c) {
|
||||
if (!(flags & IS_CONSTANT_UNQUALIFIED)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* name requires runtime resolution, need to check non-namespaced name */
|
||||
c = zend_get_constant_str_impl(constant_name, const_name_len);
|
||||
name = constant_name;
|
||||
}
|
||||
/* name requires runtime resolution, need to check non-namespaced name */
|
||||
if ((flags & IS_CONSTANT_UNQUALIFIED) != 0) {
|
||||
return zend_get_constant_str(constant_name, const_name_len);
|
||||
} else {
|
||||
if (cname) {
|
||||
c = zend_get_constant_impl(cname);
|
||||
} else {
|
||||
c = zend_get_constant_str_impl(name, name_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (!c) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cname) {
|
||||
return zend_get_constant(cname);
|
||||
} else {
|
||||
return zend_get_constant_str(name, name_len);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API zend_constant* ZEND_FASTCALL zend_quick_get_constant(const zval *key, uint32_t flags)
|
||||
{
|
||||
zval *zv;
|
||||
zend_constant *c = NULL;
|
||||
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(flags & ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK)) {
|
||||
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST)) && is_access_deprecated(c, name)) {
|
||||
zend_error(E_DEPRECATED,
|
||||
"Case-insensitive constants are deprecated. "
|
||||
"The correct casing for this constant is \"%s\"",
|
||||
ZSTR_VAL(c->name));
|
||||
}
|
||||
}
|
||||
return c;
|
||||
|
||||
return &c->value;
|
||||
}
|
||||
|
||||
static void* zend_hash_add_constant(HashTable *ht, zend_string *key, zend_constant *c)
|
||||
{
|
||||
void *ret;
|
||||
zend_constant *copy = pemalloc(sizeof(zend_constant), c->flags & CONST_PERSISTENT);
|
||||
zend_constant *copy = pemalloc(sizeof(zend_constant), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
|
||||
|
||||
memcpy(copy, c, sizeof(zend_constant));
|
||||
ret = zend_hash_add_ptr(ht, key, copy);
|
||||
if (!ret) {
|
||||
pefree(copy, c->flags & CONST_PERSISTENT);
|
||||
pefree(copy, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -487,14 +494,14 @@ ZEND_API int zend_register_constant(zend_constant *c)
|
||||
printf("Registering constant for module %d\n", c->module_number);
|
||||
#endif
|
||||
|
||||
if (!(c->flags & CONST_CS)) {
|
||||
lowercase_name = zend_string_tolower_ex(c->name, c->flags & CONST_PERSISTENT);
|
||||
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CS)) {
|
||||
lowercase_name = zend_string_tolower_ex(c->name, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
|
||||
lowercase_name = zend_new_interned_string(lowercase_name);
|
||||
name = lowercase_name;
|
||||
} else {
|
||||
char *slash = strrchr(ZSTR_VAL(c->name), '\\');
|
||||
if (slash) {
|
||||
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT);
|
||||
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
|
||||
zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name));
|
||||
lowercase_name = zend_new_interned_string(lowercase_name);
|
||||
name = lowercase_name;
|
||||
@@ -513,8 +520,8 @@ ZEND_API int zend_register_constant(zend_constant *c)
|
||||
}
|
||||
zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name));
|
||||
zend_string_release(c->name);
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_dtor(&c->value);
|
||||
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
|
||||
zval_ptr_dtor_nogc(&c->value);
|
||||
}
|
||||
ret = FAILURE;
|
||||
}
|
||||
|
||||
+15
-6
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_CONSTANTS_H
|
||||
#define ZEND_CONSTANTS_H
|
||||
|
||||
@@ -29,15 +27,27 @@
|
||||
#define CONST_CT_SUBST (1<<2) /* Allow compile-time substitution */
|
||||
#define CONST_NO_FILE_CACHE (1<<3) /* Can't be saved in file cache */
|
||||
|
||||
#define PHP_USER_CONSTANT INT_MAX /* a constant defined in user space */
|
||||
#define PHP_USER_CONSTANT 0x7fffff /* a constant defined in user space */
|
||||
|
||||
/* Flag for zend_get_constant_ex(). Must not class with ZEND_FETCH_CLASS_* flags. */
|
||||
#define ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK 0x1000
|
||||
|
||||
typedef struct _zend_constant {
|
||||
zval value;
|
||||
zend_string *name;
|
||||
int flags;
|
||||
int module_number;
|
||||
} zend_constant;
|
||||
|
||||
#define ZEND_CONSTANT_FLAGS(c) \
|
||||
(Z_CONSTANT_FLAGS((c)->value) & 0xff)
|
||||
|
||||
#define ZEND_CONSTANT_MODULE_NUMBER(c) \
|
||||
(Z_CONSTANT_FLAGS((c)->value) >> 8)
|
||||
|
||||
#define ZEND_CONSTANT_SET_FLAGS(c, _flags, _module_number) do { \
|
||||
Z_CONSTANT_FLAGS((c)->value) = \
|
||||
((_flags) & 0xff) | ((_module_number) << 8); \
|
||||
} while (0)
|
||||
|
||||
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number)
|
||||
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number)
|
||||
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
|
||||
@@ -79,7 +89,6 @@ ZEND_API int zend_register_constant(zend_constant *c);
|
||||
#ifdef ZTS
|
||||
void zend_copy_constants(HashTable *target, HashTable *sourc);
|
||||
#endif
|
||||
ZEND_API zend_constant* ZEND_FASTCALL zend_quick_get_constant(const zval *key, uint32_t flags);
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_CONSTANT_DTOR free_zend_constant
|
||||
|
||||
+3
-6
@@ -29,14 +29,11 @@ typedef struct _zend_cpu_info {
|
||||
static zend_cpu_info cpuinfo = {0};
|
||||
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
#include <cpuid.h>
|
||||
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
|
||||
__asm__ __volatile__ (
|
||||
"cpuid"
|
||||
: "=a"(cpuinfo->eax), "=b"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
|
||||
: "a"(func), "c"(subfunc)
|
||||
);
|
||||
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);
|
||||
}
|
||||
#elif defined(ZEND_WIN32)
|
||||
#elif defined(ZEND_WIN32) && !defined(__clang__)
|
||||
# include <intrin.h>
|
||||
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
|
||||
int regs[4];
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_builtin_functions.h"
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_ERRORS_H
|
||||
#define ZEND_ERRORS_H
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_builtin_functions.h"
|
||||
@@ -325,7 +323,7 @@ ZEND_METHOD(exception, __wakeup)
|
||||
CHECK_EXC_TYPE(ZEND_STR_TRACE, IS_ARRAY);
|
||||
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
|
||||
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), zend_ce_throwable) ||
|
||||
pvalue == object)) {
|
||||
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
|
||||
}
|
||||
@@ -984,7 +982,7 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
|
||||
zend_string *str, *file = NULL;
|
||||
zend_long line = 0;
|
||||
|
||||
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &tmp);
|
||||
zend_call_method_with_0_params(&exception, ce_exception, &ex->ce->__tostring, "__tostring", &tmp);
|
||||
if (!EG(exception)) {
|
||||
if (Z_TYPE(tmp) != IS_STRING) {
|
||||
zend_error(E_WARNING, "%s::__toString() must return a string", ZSTR_VAL(ce_exception->name));
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_EXCEPTIONS_H
|
||||
#define ZEND_EXCEPTIONS_H
|
||||
|
||||
|
||||
+236
-86
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define ZEND_INTENSIVE_DEBUGGING 0
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -146,7 +144,7 @@ ZEND_API const zend_internal_function zend_pass_function = {
|
||||
if (EXPECTED(Z_TYPE_P(__zv) == IS_INDIRECT)) { \
|
||||
ZVAL_COPY(__zv, Z_INDIRECT_P(__zv)); \
|
||||
} \
|
||||
zval_dtor_func(__ref); \
|
||||
rc_dtor_func(__ref); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
@@ -262,7 +260,7 @@ static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var EXECUTE_D
|
||||
}
|
||||
}
|
||||
|
||||
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
|
||||
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
|
||||
{
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
@@ -282,52 +280,50 @@ static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
zval_undefined_cv(var EXECUTE_DATA_CC);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
zval_undefined_cv(var EXECUTE_DATA_CC);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
ZVAL_NULL(ptr);
|
||||
zval_undefined_cv(var EXECUTE_DATA_CC);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
ZVAL_NULL(ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv(uint32_t var, int type EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *ret = EX_VAR(var);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
|
||||
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
|
||||
if (type == BP_VAR_W) {
|
||||
ZVAL_NULL(ret);
|
||||
} else {
|
||||
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_undef(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
return EX_VAR(var);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_deref(uint32_t var, int type EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *ret = EX_VAR(var);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
|
||||
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
|
||||
if (type == BP_VAR_W) {
|
||||
ZVAL_NULL(ret);
|
||||
return ret;
|
||||
} else {
|
||||
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
|
||||
}
|
||||
}
|
||||
ZVAL_DEREF(ret);
|
||||
return ret;
|
||||
@@ -416,32 +412,18 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(uint32_t var EXECUTE_D
|
||||
zval *ret = EX_VAR(var);
|
||||
|
||||
if (Z_TYPE_P(ret) == IS_UNDEF) {
|
||||
return _get_zval_cv_lookup_BP_VAR_W(ret, var EXECUTE_DATA_CC);
|
||||
ZVAL_NULL(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
return EX_VAR(var);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_RW(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
return EX_VAR(var);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_UNSET(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
return EX_VAR(var);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(uint32_t var EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *ret = EX_VAR(var);
|
||||
|
||||
if (Z_TYPE_P(ret) == IS_UNDEF) {
|
||||
return _get_zval_cv_lookup_BP_VAR_W(ret, var EXECUTE_DATA_CC);
|
||||
ZVAL_NULL(ret);
|
||||
return ret;
|
||||
}
|
||||
ZVAL_DEREF(ret);
|
||||
return ret;
|
||||
@@ -545,7 +527,7 @@ static zend_always_inline zval *_get_zval_ptr_undef(int op_type, znode_op node,
|
||||
if (op_type == IS_CONST) {
|
||||
return RT_CONSTANT(opline, node);
|
||||
} else if (op_type == IS_CV) {
|
||||
return _get_zval_ptr_cv_undef(node.var EXECUTE_DATA_CC);
|
||||
return EX_VAR(node.var);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
@@ -576,11 +558,6 @@ static inline zval *_get_zval_ptr_ptr(int op_type, znode_op node, zend_free_op *
|
||||
}
|
||||
}
|
||||
|
||||
static zend_always_inline zval *_get_obj_zval_ptr_unused(EXECUTE_DATA_D)
|
||||
{
|
||||
return &EX(This);
|
||||
}
|
||||
|
||||
static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
|
||||
{
|
||||
if (op_type == IS_UNUSED) {
|
||||
@@ -625,7 +602,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
|
||||
|
||||
if (GC_DELREF(garbage) == 0) {
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
zval_dtor_func(garbage);
|
||||
rc_dtor_func(garbage);
|
||||
return;
|
||||
} else {
|
||||
gc_check_possible_root(garbage);
|
||||
@@ -654,7 +631,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_assign
|
||||
zend_string *tmp_property_name;
|
||||
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
|
||||
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
}
|
||||
@@ -682,7 +659,7 @@ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object(zval *obje
|
||||
} else {
|
||||
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
}
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
}
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
@@ -716,7 +693,7 @@ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object_rw(zval *o
|
||||
zend_string *tmp_property_name;
|
||||
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
|
||||
zend_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1075,9 +1052,12 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
|
||||
zend_class_entry *ce = NULL;
|
||||
void *dummy_cache_slot = NULL;
|
||||
|
||||
if (UNEXPECTED(ZEND_TYPE_CODE(ret_info->type) == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
|
||||
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
|
||||
return 0;
|
||||
if (ZEND_TYPE_CODE(ret_info->type) == IS_VOID) {
|
||||
if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) {
|
||||
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!zend_check_type(ret_info->type, ret, &ce, &dummy_cache_slot, NULL, NULL, 1))) {
|
||||
@@ -1175,7 +1155,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval *
|
||||
}
|
||||
zval_ptr_dtor(&res);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
zend_use_object_as_array();
|
||||
if (retval) {
|
||||
ZVAL_NULL(retval);
|
||||
}
|
||||
@@ -1228,6 +1208,10 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
|
||||
const zend_op *end;
|
||||
uint32_t var;
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (opline->opcode) {
|
||||
case ZEND_ASSIGN_ADD:
|
||||
case ZEND_ASSIGN_SUB:
|
||||
@@ -1348,7 +1332,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(z
|
||||
zend_string *tmp_property_name;
|
||||
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
|
||||
zend_error(E_NOTICE, "Trying to get property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(zval *property)
|
||||
@@ -1356,7 +1340,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(
|
||||
zend_string *tmp_property_name;
|
||||
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
|
||||
zend_error(E_NOTICE, "Trying to unset property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(zval *property)
|
||||
@@ -1364,7 +1348,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(
|
||||
zend_string *tmp_property_name;
|
||||
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
|
||||
zend_error(E_NOTICE, "Trying to check property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_tmp_string_release(property_name);
|
||||
zend_tmp_string_release(tmp_property_name);
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc)
|
||||
@@ -1464,12 +1448,8 @@ static zend_never_inline void zend_post_incdec_overloaded_property(zval *object,
|
||||
ZVAL_COPY_VALUE(z, value);
|
||||
}
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_REFERENCE)) {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(z));
|
||||
} else {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), z);
|
||||
}
|
||||
ZVAL_COPY(&z_copy, EX_VAR(opline->result.var));
|
||||
ZVAL_COPY_DEREF(&z_copy, z);
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), &z_copy);
|
||||
if (inc) {
|
||||
increment_function(&z_copy);
|
||||
} else {
|
||||
@@ -1513,11 +1493,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
|
||||
}
|
||||
ZVAL_COPY_VALUE(z, value);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_REFERENCE)) {
|
||||
ZVAL_COPY(&z_copy, Z_REFVAL_P(z));
|
||||
} else {
|
||||
ZVAL_COPY(&z_copy, z);
|
||||
}
|
||||
ZVAL_COPY_DEREF(&z_copy, z);
|
||||
if (inc) {
|
||||
increment_function(&z_copy);
|
||||
} else {
|
||||
@@ -1871,6 +1847,9 @@ fetch_from_array:
|
||||
zend_use_object_as_array();
|
||||
ZVAL_ERROR(result);
|
||||
} else {
|
||||
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
|
||||
dim++;
|
||||
}
|
||||
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
|
||||
|
||||
if (UNEXPECTED(retval == &EG(uninitialized_zval))) {
|
||||
@@ -1953,7 +1932,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
|
||||
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
|
||||
try_array:
|
||||
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type EXECUTE_DATA_CC);
|
||||
ZVAL_COPY(result, retval);
|
||||
ZVAL_COPY_DEREF(result, retval);
|
||||
return;
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
|
||||
container = Z_REFVAL_P(container);
|
||||
@@ -2028,12 +2007,17 @@ try_string_offset:
|
||||
zend_use_object_as_array();
|
||||
ZVAL_NULL(result);
|
||||
} else {
|
||||
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
|
||||
dim++;
|
||||
}
|
||||
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
|
||||
|
||||
ZEND_ASSERT(result != NULL);
|
||||
if (retval) {
|
||||
if (result != retval) {
|
||||
ZVAL_COPY(result, retval);
|
||||
ZVAL_COPY_DEREF(result, retval);
|
||||
} else if (UNEXPECTED(Z_ISREF_P(retval))) {
|
||||
zend_unwrap_reference(result);
|
||||
}
|
||||
} else {
|
||||
ZVAL_NULL(result);
|
||||
@@ -2068,16 +2052,10 @@ static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_IS
|
||||
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS, 1, 0 EXECUTE_DATA_CC);
|
||||
}
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_w(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC)
|
||||
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *result = EX_VAR(opline->result.var);
|
||||
zend_fetch_dimension_address(result, container, dim, IS_TMP_VAR, BP_VAR_W EXECUTE_DATA_CC);
|
||||
}
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *result = EX_VAR(opline->result.var);
|
||||
zend_fetch_dimension_address_read(result, container, dim, IS_TMP_VAR, BP_VAR_R, 0, 0 EXECUTE_DATA_CC);
|
||||
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R, 0, 0 EXECUTE_DATA_CC);
|
||||
}
|
||||
|
||||
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type)
|
||||
@@ -2125,7 +2103,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isset_dim_slow(zval *container,
|
||||
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
|
||||
return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0);
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Trying to check element of non-array");
|
||||
zend_use_object_as_array();
|
||||
return 0;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */
|
||||
@@ -2170,7 +2148,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isempty_dim_slow(zval *container
|
||||
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
|
||||
return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1);
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Trying to check element of non-array");
|
||||
zend_use_object_as_array();
|
||||
return 1;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */
|
||||
@@ -2372,7 +2350,7 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
|
||||
zend_refcounted *r = Z_COUNTED_P(cv);
|
||||
if (!GC_DELREF(r)) {
|
||||
ZVAL_NULL(cv);
|
||||
zval_dtor_func(r);
|
||||
rc_dtor_func(r);
|
||||
} else {
|
||||
gc_check_possible_root(r);
|
||||
}
|
||||
@@ -2529,6 +2507,64 @@ static zend_never_inline void ZEND_FASTCALL init_func_run_time_cache(zend_op_arr
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline zend_function* ZEND_FASTCALL init_func_run_time_cache_i(zval *zv) /* {{{ */
|
||||
{
|
||||
zend_op_array *op_array = Z_PTR_P(zv);
|
||||
|
||||
ZEND_ASSERT(op_array->run_time_cache == NULL);
|
||||
if (op_array->fn_flags & ZEND_ACC_IMMUTABLE) {
|
||||
zend_op_array *new_op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array) + op_array->cache_size);
|
||||
|
||||
Z_PTR_P(zv) = new_op_array;
|
||||
memcpy(new_op_array, op_array, sizeof(zend_op_array));
|
||||
new_op_array->fn_flags &= ~ZEND_ACC_IMMUTABLE;
|
||||
new_op_array->run_time_cache = (void**)(new_op_array + 1);
|
||||
memset(new_op_array->run_time_cache, 0, new_op_array->cache_size);
|
||||
return (zend_function*)new_op_array;
|
||||
} else {
|
||||
op_array->run_time_cache = zend_arena_alloc(&CG(arena), op_array->cache_size);
|
||||
memset(op_array->run_time_cache, 0, op_array->cache_size);
|
||||
return (zend_function*)op_array;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_never_inline zend_function* init_func_run_time_cache_ex(zval *zv) /* {{{ */
|
||||
{
|
||||
return init_func_run_time_cache_i(zv);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name) /* {{{ */
|
||||
{
|
||||
zval *zv = zend_hash_find(EG(function_table), name);
|
||||
|
||||
if (EXPECTED(zv != NULL)) {
|
||||
zend_function *fbc = Z_FUNC_P(zv);
|
||||
|
||||
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
|
||||
fbc = (zend_function*)init_func_run_time_cache_i(zv);
|
||||
}
|
||||
return fbc;
|
||||
}
|
||||
return NULL;
|
||||
} /* }}} */
|
||||
|
||||
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len) /* {{{ */
|
||||
{
|
||||
zval *zv = zend_hash_str_find(EG(function_table), name, len);
|
||||
|
||||
if (EXPECTED(zv != NULL)) {
|
||||
zend_function *fbc = Z_FUNC_P(zv);
|
||||
|
||||
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
|
||||
fbc = (zend_function*)init_func_run_time_cache_i(zv);
|
||||
}
|
||||
return fbc;
|
||||
}
|
||||
return NULL;
|
||||
} /* }}} */
|
||||
|
||||
static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
|
||||
{
|
||||
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
|
||||
@@ -2561,8 +2597,7 @@ ZEND_API void zend_init_func_execute_data(zend_execute_data *ex, zend_op_array *
|
||||
|
||||
EX(prev_execute_data) = EG(current_execute_data);
|
||||
if (!op_array->run_time_cache) {
|
||||
op_array->run_time_cache = zend_arena_alloc(&CG(arena), op_array->cache_size);
|
||||
memset(op_array->run_time_cache, 0, op_array->cache_size);
|
||||
init_func_run_time_cache(op_array);
|
||||
}
|
||||
i_init_func_execute_data(op_array, return_value, 1 EXECUTE_DATA_CC);
|
||||
|
||||
@@ -2922,6 +2957,9 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_s
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
|
||||
init_func_run_time_cache(&fbc->op_array);
|
||||
}
|
||||
} else {
|
||||
if (ZSTR_VAL(function)[0] == '\\') {
|
||||
lcname = zend_string_alloc(ZSTR_LEN(function) - 1, 0);
|
||||
@@ -2937,13 +2975,12 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_s
|
||||
zend_string_release_ex(lcname, 0);
|
||||
|
||||
fbc = Z_FUNC_P(func);
|
||||
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
|
||||
fbc = init_func_run_time_cache_ex(func);
|
||||
}
|
||||
called_scope = NULL;
|
||||
}
|
||||
|
||||
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
|
||||
init_func_run_time_cache(&fbc->op_array);
|
||||
}
|
||||
|
||||
return zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC,
|
||||
fbc, num_args, called_scope, NULL);
|
||||
}
|
||||
@@ -3116,7 +3153,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
|
||||
zend_destroy_file_handle(&file_handle);
|
||||
zend_string_release_ex(resolved_path, 0);
|
||||
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
|
||||
zend_string_release_ex(Z_STR(tmp_inc_filename), 0);
|
||||
zval_ptr_dtor_str(&tmp_inc_filename);
|
||||
}
|
||||
return op_array;
|
||||
} else {
|
||||
@@ -3154,7 +3191,7 @@ already_compiled:
|
||||
}
|
||||
|
||||
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
|
||||
zend_string_release_ex(Z_STR(tmp_inc_filename), 0);
|
||||
zval_ptr_dtor_str(&tmp_inc_filename);
|
||||
}
|
||||
return new_op_array;
|
||||
}
|
||||
@@ -3240,6 +3277,119 @@ static zend_never_inline zend_bool ZEND_FASTCALL zend_fe_reset_iterator(zval *ar
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline int _zend_quick_get_constant(
|
||||
const zval *key, uint32_t flags, int check_defined_only OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
|
||||
{
|
||||
zval *zv;
|
||||
const zval *orig_key = key;
|
||||
zend_constant *c = NULL;
|
||||
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
} else {
|
||||
key++;
|
||||
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
|
||||
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
|
||||
c = (zend_constant*)Z_PTR_P(zv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!c) {
|
||||
if (!check_defined_only) {
|
||||
if ((opline->op1.num & IS_CONSTANT_UNQUALIFIED) != 0) {
|
||||
char *actual = (char *)zend_memrchr(Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)), '\\', Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)));
|
||||
if (!actual) {
|
||||
ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
|
||||
} else {
|
||||
actual++;
|
||||
ZVAL_STRINGL(EX_VAR(opline->result.var),
|
||||
actual, Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)) - (actual - Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))));
|
||||
}
|
||||
/* non-qualified constant - allow text substitution */
|
||||
zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
|
||||
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
|
||||
} else {
|
||||
zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
|
||||
ZVAL_UNDEF(EX_VAR(opline->result.var));
|
||||
}
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!check_defined_only) {
|
||||
ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value);
|
||||
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST))) {
|
||||
const char *ns_sep;
|
||||
size_t shortname_offset;
|
||||
size_t shortname_len;
|
||||
zend_bool is_deprecated;
|
||||
|
||||
if (flags & IS_CONSTANT_UNQUALIFIED) {
|
||||
const zval *access_key;
|
||||
|
||||
if (!(flags & IS_CONSTANT_IN_NAMESPACE)) {
|
||||
access_key = orig_key - 1;
|
||||
} else {
|
||||
if (key < orig_key + 2) {
|
||||
goto check_short_name;
|
||||
} else {
|
||||
access_key = orig_key + 2;
|
||||
}
|
||||
}
|
||||
is_deprecated = !zend_string_equals(c->name, Z_STR_P(access_key));
|
||||
} else {
|
||||
check_short_name:
|
||||
ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name));
|
||||
ZEND_ASSERT(ns_sep);
|
||||
/* Namespaces are always case-insensitive. Only compare shortname. */
|
||||
shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
|
||||
shortname_len = ZSTR_LEN(c->name) - shortname_offset;
|
||||
|
||||
is_deprecated = memcmp(ZSTR_VAL(c->name) + shortname_offset, Z_STRVAL_P(orig_key - 1) + shortname_offset, shortname_len) != 0;
|
||||
}
|
||||
|
||||
if (is_deprecated) {
|
||||
zend_error(E_DEPRECATED,
|
||||
"Case-insensitive constants are deprecated. "
|
||||
"The correct casing for this constant is \"%s\"",
|
||||
ZSTR_VAL(c->name));
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CACHE_PTR(opline->extended_value, c);
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL zend_quick_get_constant(
|
||||
const zval *key, uint32_t flags OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
|
||||
{
|
||||
_zend_quick_get_constant(key, flags, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
} /* }}} */
|
||||
|
||||
static zend_never_inline int ZEND_FASTCALL zend_quick_check_constant(
|
||||
const zval *key OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
|
||||
{
|
||||
return _zend_quick_get_constant(key, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
} /* }}} */
|
||||
|
||||
#ifdef ZEND_VM_TRACE_HANDLERS
|
||||
# include "zend_vm_trace_handlers.h"
|
||||
#elif defined(ZEND_VM_TRACE_MAP)
|
||||
|
||||
+6
-5
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_EXECUTE_H
|
||||
#define ZEND_EXECUTE_H
|
||||
|
||||
@@ -107,7 +105,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
|
||||
Z_ADDREF_P(variable_ptr);
|
||||
}
|
||||
}
|
||||
zval_dtor_func(garbage);
|
||||
rc_dtor_func(garbage);
|
||||
return variable_ptr;
|
||||
} else { /* we need to split */
|
||||
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
|
||||
@@ -232,7 +230,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_in
|
||||
zend_refcounted *r = Z_COUNTED_P(p);
|
||||
if (!GC_DELREF(r)) {
|
||||
ZVAL_NULL(p);
|
||||
zval_dtor_func(r);
|
||||
rc_dtor_func(r);
|
||||
} else {
|
||||
gc_check_possible_root(r);
|
||||
}
|
||||
@@ -259,7 +257,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
|
||||
zend_refcounted *r = Z_COUNTED_P(p);
|
||||
if (!GC_DELREF(r)) {
|
||||
ZVAL_NULL(p);
|
||||
zval_dtor_func(r);
|
||||
rc_dtor_func(r);
|
||||
}
|
||||
}
|
||||
p++;
|
||||
@@ -308,6 +306,9 @@ ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_t
|
||||
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type);
|
||||
void zend_verify_abstract_class(zend_class_entry *ce);
|
||||
|
||||
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name);
|
||||
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len);
|
||||
|
||||
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type);
|
||||
|
||||
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
|
||||
|
||||
+16
-45
@@ -18,8 +18,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -103,7 +101,7 @@ static void zend_extension_deactivator(zend_extension *extension) /* {{{ */
|
||||
static int clean_non_persistent_constant_full(zval *zv) /* {{{ */
|
||||
{
|
||||
zend_constant *c = Z_PTR_P(zv);
|
||||
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
return (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -142,6 +140,7 @@ void init_executor(void) /* {{{ */
|
||||
EG(in_autoload) = NULL;
|
||||
EG(autoload_func) = NULL;
|
||||
EG(error_handling) = EH_NORMAL;
|
||||
EG(flags) = EG_FLAGS_INITIAL;
|
||||
|
||||
zend_vm_stack_init();
|
||||
|
||||
@@ -180,6 +179,10 @@ void init_executor(void) /* {{{ */
|
||||
|
||||
EG(each_deprecation_thrown) = 0;
|
||||
|
||||
EG(persistent_constants_count) = EG(zend_constants)->nNumUsed;
|
||||
EG(persistent_functions_count) = EG(function_table)->nNumUsed;
|
||||
EG(persistent_classes_count) = EG(class_table)->nNumUsed;
|
||||
|
||||
EG(active) = 1;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -278,25 +281,9 @@ void shutdown_executor(void) /* {{{ */
|
||||
* Zend Memory Manager frees memory by its own. We don't have to free
|
||||
* each allocated block separately.
|
||||
*/
|
||||
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
|
||||
zend_constant *c = Z_PTR_P(zv);
|
||||
if (c->flags & CONST_PERSISTENT) {
|
||||
break;
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END_DEL();
|
||||
ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) {
|
||||
zend_function *func = Z_PTR_P(zv);
|
||||
if (func->type == ZEND_INTERNAL_FUNCTION) {
|
||||
break;
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END_DEL();
|
||||
ZEND_HASH_REVERSE_FOREACH_VAL(EG(class_table), zv) {
|
||||
zend_class_entry *ce = Z_PTR_P(zv);
|
||||
if (ce->type == ZEND_INTERNAL_CLASS) {
|
||||
break;
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END_DEL();
|
||||
|
||||
zend_hash_discard(EG(zend_constants), EG(persistent_constants_count));
|
||||
zend_hash_discard(EG(function_table), EG(persistent_functions_count));
|
||||
zend_hash_discard(EG(class_table), EG(persistent_classes_count));
|
||||
zend_cleanup_internal_classes();
|
||||
} else {
|
||||
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
|
||||
@@ -332,7 +319,7 @@ void shutdown_executor(void) /* {{{ */
|
||||
} else {
|
||||
ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(EG(zend_constants), key, zv) {
|
||||
zend_constant *c = Z_PTR_P(zv);
|
||||
if (c->flags & CONST_PERSISTENT) {
|
||||
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
|
||||
break;
|
||||
}
|
||||
zval_ptr_dtor_nogc(&c->value);
|
||||
@@ -527,23 +514,6 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
|
||||
{
|
||||
i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
|
||||
{
|
||||
if (Z_REFCOUNTED_P(zval_ptr)) {
|
||||
Z_DELREF_P(zval_ptr);
|
||||
if (Z_REFCOUNT_P(zval_ptr) == 0) {
|
||||
_zval_internal_dtor_for_ptr(zval_ptr ZEND_FILE_LINE_CC);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
|
||||
{
|
||||
char *colon;
|
||||
@@ -901,9 +871,10 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
}
|
||||
|
||||
if (!EG(autoload_func)) {
|
||||
zval *zv = zend_hash_find_ex(EG(function_table), ZSTR_KNOWN(ZEND_STR_MAGIC_AUTOLOAD), 1);
|
||||
if (zv) {
|
||||
EG(autoload_func) = (zend_function*)Z_PTR_P(zv);
|
||||
zend_function *func = zend_fetch_function(ZSTR_KNOWN(ZEND_STR_MAGIC_AUTOLOAD));
|
||||
|
||||
if (func) {
|
||||
EG(autoload_func) = func;
|
||||
} else {
|
||||
if (!key) {
|
||||
zend_string_release_ex(lc_name, 0);
|
||||
@@ -958,7 +929,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
zend_exception_restore();
|
||||
|
||||
zval_ptr_dtor(&args[0]);
|
||||
zval_dtor(&fcall_info.function_name);
|
||||
zval_ptr_dtor_str(&fcall_info.function_name);
|
||||
|
||||
zend_hash_del(EG(in_autoload), lc_name);
|
||||
|
||||
@@ -1070,7 +1041,7 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
|
||||
} else {
|
||||
retval = FAILURE;
|
||||
}
|
||||
zval_dtor(&pv);
|
||||
zval_ptr_dtor_str(&pv);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend_extensions.h"
|
||||
|
||||
ZEND_API zend_llist zend_extensions;
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_EXTENSIONS_H
|
||||
#define ZEND_EXTENSIONS_H
|
||||
|
||||
@@ -46,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi
|
||||
|
||||
/* 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 320180606
|
||||
#define ZEND_EXTENSION_API_NO 320180731
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_float.h"
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_FLOAT_H
|
||||
#define ZEND_FLOAT_H
|
||||
|
||||
|
||||
Loaded 100 of 1705 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user