mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-22 16:35:43 +00:00
Compare commits
801
Commits
php-5.4.9
...
php-5.4.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a5e202bf | ||
|
|
fe475fc8b7 | ||
|
|
910980b8a8 | ||
|
|
66606b8462 | ||
|
|
0780256c19 | ||
|
|
aa1fe1b480 | ||
|
|
76af988fec | ||
|
|
10b84a9015 | ||
|
|
874c727c55 | ||
|
|
338469f596 | ||
|
|
c74bc8360c | ||
|
|
eb8c15b573 | ||
|
|
bb6d74918e | ||
|
|
135f81c5ae | ||
|
|
d3a4af4db8 | ||
|
|
bcb39d9c6a | ||
|
|
9561e598a0 | ||
|
|
e617679c0b | ||
|
|
76775a3aa7 | ||
|
|
2c73ce4363 | ||
|
|
e9a95d78ef | ||
|
|
b79b13b4ef | ||
|
|
bb64106f64 | ||
|
|
2bad01e61b | ||
|
|
a51b50000d | ||
|
|
f4b9b20b35 | ||
|
|
bcef0ebc2d | ||
|
|
07501dc1a2 | ||
|
|
6e3134610c | ||
|
|
add0833681 | ||
|
|
67c03eac62 | ||
|
|
d012bdca03 | ||
|
|
6e32a871a4 | ||
|
|
ebad5178c4 | ||
|
|
eab076020d | ||
|
|
0863a0d6a0 | ||
|
|
281936b295 | ||
|
|
0ddb3d97de | ||
|
|
d2a83efe5b | ||
|
|
b2fbb4cc40 | ||
|
|
5b01b0904f | ||
|
|
2acc386270 | ||
|
|
96f77f845a | ||
|
|
e2e002d4ea | ||
|
|
4c6c048e3e | ||
|
|
9c4ef50146 | ||
|
|
4204e2cb5b | ||
|
|
710eee5555 | ||
|
|
29ac511b8a | ||
|
|
c7ee677f2f | ||
|
|
79df8cf9c2 | ||
|
|
2c3f6dcdb6 | ||
|
|
9fc38183b7 | ||
|
|
e4a28b7b7b | ||
|
|
7d163e8a08 | ||
|
|
e964817b24 | ||
|
|
c652cc93ec | ||
|
|
7549beb102 | ||
|
|
5bc7e597d9 | ||
|
|
0265c2d961 | ||
|
|
74d434c091 | ||
|
|
50ac53e1b1 | ||
|
|
67817a199c | ||
|
|
f4ce5e7fb6 | ||
|
|
4bc11af193 | ||
|
|
c940aab789 | ||
|
|
743c4864eb | ||
|
|
06418aca28 | ||
|
|
46214a23b8 | ||
|
|
87dda666c7 | ||
|
|
ef63334fa6 | ||
|
|
103cf4c060 | ||
|
|
e46beabe8f | ||
|
|
3becd3879f | ||
|
|
8cb782bbce | ||
|
|
e00ed6bc3f | ||
|
|
ce8c023910 | ||
|
|
fa8611c81e | ||
|
|
76866e0a2e | ||
|
|
60dcc5851f | ||
|
|
02682f4169 | ||
|
|
891bd46f3d | ||
|
|
cd176e0452 | ||
|
|
7e33b5d2fa | ||
|
|
f477ad22c2 | ||
|
|
b34e8d2e3e | ||
|
|
8922c50ca4 | ||
|
|
6c8cef3ca4 | ||
|
|
12b75e3d3e | ||
|
|
e15ca39708 | ||
|
|
4289696828 | ||
|
|
12fdf8fb95 | ||
|
|
111b385afe | ||
|
|
a689fde2bf | ||
|
|
04db57066d | ||
|
|
40c3601947 | ||
|
|
2ab53f4b5e | ||
|
|
41b73e4cee | ||
|
|
5d0094e5f9 | ||
|
|
5ae1983b33 | ||
|
|
6ba93a4bae | ||
|
|
a52258ae17 | ||
|
|
423b132a7a | ||
|
|
38eb909d06 | ||
|
|
982c11573d | ||
|
|
d43a2f0ffb | ||
|
|
8776555d7a | ||
|
|
9cf3e65391 | ||
|
|
e3d625bc4e | ||
|
|
a0d48e01ed | ||
|
|
8aba119f55 | ||
|
|
860a5c4b01 | ||
|
|
a0b4348abc | ||
|
|
f1e37d03c1 | ||
|
|
61fb822d1a | ||
|
|
2531307be6 | ||
|
|
8623562b02 | ||
|
|
f5c7fe9202 | ||
|
|
283f56af66 | ||
|
|
b5978e239e | ||
|
|
e4ee921b7e | ||
|
|
9be591bdb5 | ||
|
|
0e55d3a12a | ||
|
|
f0eaa02f6f | ||
|
|
67bde2f8ac | ||
|
|
c666239265 | ||
|
|
25e9aa6b0a | ||
|
|
5edd530511 | ||
|
|
e2bb74ab4f | ||
|
|
dda3f404ec | ||
|
|
2ce4bd7f2d | ||
|
|
6b896fa57f | ||
|
|
5ac0ee30ce | ||
|
|
95cc763a14 | ||
|
|
248414f132 | ||
|
|
272c5edea4 | ||
|
|
ca3e0862db | ||
|
|
cfb1ffb4fa | ||
|
|
ebef8c4176 | ||
|
|
ee01af7df1 | ||
|
|
2a93fd1347 | ||
|
|
7bb052ee3e | ||
|
|
0dc98208ee | ||
|
|
d9c034ee5e | ||
|
|
b5b0a53b09 | ||
|
|
600d6deef9 | ||
|
|
2208447d42 | ||
|
|
088c183639 | ||
|
|
b6dd1ec60d | ||
|
|
49e57a3165 | ||
|
|
7457867ba8 | ||
|
|
8acfa0b3f8 | ||
|
|
02f552ceca | ||
|
|
6238dd6f32 | ||
|
|
10b9579395 | ||
|
|
ed2690477c | ||
|
|
cd1b44c4b6 | ||
|
|
1cc750493f | ||
|
|
eccc05fc44 | ||
|
|
251ec84a97 | ||
|
|
f16143f5ac | ||
|
|
760b7d00c3 | ||
|
|
ac40c0b562 | ||
|
|
04145dc2aa | ||
|
|
ed2e84e239 | ||
|
|
7a1e670d76 | ||
|
|
18403e496d | ||
|
|
0f9cf35315 | ||
|
|
e1e07cb431 | ||
|
|
88c2dbe5fc | ||
|
|
d8792d87cf | ||
|
|
53c39e2b4e | ||
|
|
f68b8a5e74 | ||
|
|
f5f6404260 | ||
|
|
8a8bef1b73 | ||
|
|
f4e3c7ab7c | ||
|
|
336a8e1943 | ||
|
|
fdd7379686 | ||
|
|
f338510c94 | ||
|
|
75c57122e3 | ||
|
|
e14800dd46 | ||
|
|
3cc891bf3a | ||
|
|
ab22fda7e5 | ||
|
|
e8f004d542 | ||
|
|
a7e25bdd48 | ||
|
|
4b96b8f909 | ||
|
|
25cae37b13 | ||
|
|
1aee7ad636 | ||
|
|
5ee047b486 | ||
|
|
ec3bcbcb5a | ||
|
|
3c93402f86 | ||
|
|
f597f5561e | ||
|
|
3c87945c95 | ||
|
|
efdeec3c0e | ||
|
|
93e0d78ec6 | ||
|
|
90bb28726b | ||
|
|
5a04ab9a54 | ||
|
|
7360f0f1e6 | ||
|
|
2463e89794 | ||
|
|
a98359b7b9 | ||
|
|
cbf90b1a90 | ||
|
|
51c065f611 | ||
|
|
25aae37229 | ||
|
|
de42833115 | ||
|
|
79803bebde | ||
|
|
a3b5b42e77 | ||
|
|
598e2690b8 | ||
|
|
bf4a034e3e | ||
|
|
510498947e | ||
|
|
df6ca450ce | ||
|
|
65d233f06c | ||
|
|
0c9f11758f | ||
|
|
2dd67abb7d | ||
|
|
1c623e3b07 | ||
|
|
8b515fa00a | ||
|
|
13e5c97ffd | ||
|
|
bcdac7526d | ||
|
|
2d386db878 | ||
|
|
9f6ca9bc64 | ||
|
|
cd74b7d57e | ||
|
|
4cb25d25f1 | ||
|
|
c53058763a | ||
|
|
c50cef1dc5 | ||
|
|
73eedaf6f7 | ||
|
|
013797588a | ||
|
|
fc2a9d6e47 | ||
|
|
0776337e28 | ||
|
|
de4fd8638b | ||
|
|
d4ad889824 | ||
|
|
2d7415a4af | ||
|
|
646ebc2cb9 | ||
|
|
4828f7343b | ||
|
|
0e99329e0a | ||
|
|
77fffff157 | ||
|
|
1124b0678f | ||
|
|
fb58e69a84 | ||
|
|
7c66c502d0 | ||
|
|
2d5695cbc5 | ||
|
|
b142e8825f | ||
|
|
aff65a0346 | ||
|
|
46b05bc57a | ||
|
|
3eb1745643 | ||
|
|
8dec06ea2a | ||
|
|
d82704b677 | ||
|
|
09470ebf35 | ||
|
|
de82e7edf7 | ||
|
|
86db5fb4c2 | ||
|
|
7ec2e5314e | ||
|
|
ba1af29805 | ||
|
|
1a46a102d9 | ||
|
|
8c36156070 | ||
|
|
74555e7c26 | ||
|
|
f37c54ab27 | ||
|
|
533e636a62 | ||
|
|
156576fcce | ||
|
|
fe21accfb4 | ||
|
|
89159926ad | ||
|
|
dd188e9538 | ||
|
|
d6505acbf5 | ||
|
|
699dc04c55 | ||
|
|
898ddcb9e1 | ||
|
|
1cc2162b83 | ||
|
|
ec4388158d | ||
|
|
f1e5127e7a | ||
|
|
5c701d19ac | ||
|
|
8c3b8f39aa | ||
|
|
c34274acb8 | ||
|
|
3a413f216a | ||
|
|
f1269d80c5 | ||
|
|
b1c24d1eac | ||
|
|
aa4762572e | ||
|
|
b1ea0b7a7a | ||
|
|
e36adfe94a | ||
|
|
a39282b64d | ||
|
|
3828f6227b | ||
|
|
5af2c5d202 | ||
|
|
aa448adc83 | ||
|
|
9996c310d1 | ||
|
|
f087c53130 | ||
|
|
4a34d4a83c | ||
|
|
3fd4b6be63 | ||
|
|
0549e55d82 | ||
|
|
b7b150b830 | ||
|
|
444e59eb20 | ||
|
|
08b72ac9f1 | ||
|
|
331540d20c | ||
|
|
c374b80dda | ||
|
|
d0c40220d1 | ||
|
|
78c48af2f2 | ||
|
|
8492bbefbb | ||
|
|
a7d6cb2360 | ||
|
|
be3f7ba4fb | ||
|
|
ab117573cd | ||
|
|
3f2f534a5c | ||
|
|
1656b337ce | ||
|
|
514afd67b6 | ||
|
|
4a92ae3401 | ||
|
|
4e773c1b92 | ||
|
|
7b9eabaf51 | ||
|
|
15b554cd9b | ||
|
|
8f5a534b21 | ||
|
|
d54432ed98 | ||
|
|
c7b8368ed5 | ||
|
|
e9b03c412b | ||
|
|
cdc1a63790 | ||
|
|
5adf1be45d | ||
|
|
bf5506f511 | ||
|
|
239ba8d58b | ||
|
|
63434524f8 | ||
|
|
671ef9fda7 | ||
|
|
a58a279d7b | ||
|
|
84e5c8a0e2 | ||
|
|
5e24a6e74d | ||
|
|
18fdab5a09 | ||
|
|
43ab915b41 | ||
|
|
4cf0647399 | ||
|
|
b3aa3c2616 | ||
|
|
8febe2ad08 | ||
|
|
f082d6311b | ||
|
|
0b2c411323 | ||
|
|
70b67f2e50 | ||
|
|
b02241b968 | ||
|
|
92bbe6be72 | ||
|
|
39cc08c7e9 | ||
|
|
0802961bd1 | ||
|
|
ecf76e2da8 | ||
|
|
fb955a613c | ||
|
|
4fbe1173eb | ||
|
|
323fdb9879 | ||
|
|
a9271a8b0d | ||
|
|
e694d40963 | ||
|
|
ba292b037f | ||
|
|
4475dbf11d | ||
|
|
684f4d5272 | ||
|
|
b6d54faa92 | ||
|
|
56b028e590 | ||
|
|
782085bbfb | ||
|
|
ceb5b684e0 | ||
|
|
968ae4a56a | ||
|
|
c480bf3fb2 | ||
|
|
224a67fb9f | ||
|
|
442ff25187 | ||
|
|
146d786137 | ||
|
|
ecdf8bcc45 | ||
|
|
aab5659357 | ||
|
|
88b3cdc4e9 | ||
|
|
10d62de4aa | ||
|
|
4d4adf47e0 | ||
|
|
a35d386612 | ||
|
|
9de5dcad1c | ||
|
|
f3ca1155d6 | ||
|
|
28e26b0fad | ||
|
|
b0b81c0a37 | ||
|
|
10367fa7c6 | ||
|
|
39bc1bd25f | ||
|
|
1bcaf771dc | ||
|
|
569eddce0f | ||
|
|
1b60c189ad | ||
|
|
185e5e15ae | ||
|
|
4f2acd8cde | ||
|
|
846d298f9b | ||
|
|
9883d8d3e5 | ||
|
|
934dfae4e1 | ||
|
|
82ac3106e0 | ||
|
|
f4f8b5a94b | ||
|
|
c96a5bc6be | ||
|
|
db3d629f05 | ||
|
|
7fc8077e4c | ||
|
|
99ad08f9a5 | ||
|
|
e8d80b770b | ||
|
|
e34767d426 | ||
|
|
78a9489f6a | ||
|
|
37b20a1bc2 | ||
|
|
d7f709a032 | ||
|
|
c51e32860a | ||
|
|
731a5c5104 | ||
|
|
8e8a75444c | ||
|
|
6b4148bc97 | ||
|
|
7b07d05917 | ||
|
|
9456dac54e | ||
|
|
72426a446d | ||
|
|
1d4fcdff9f | ||
|
|
92aa361bfc | ||
|
|
bbe9052ca3 | ||
|
|
fecce5a55f | ||
|
|
ef93a93ee2 | ||
|
|
242d88c20c | ||
|
|
46ee57f2d7 | ||
|
|
124a867b6a | ||
|
|
640e72ce91 | ||
|
|
ab089611e0 | ||
|
|
55341ac0a8 | ||
|
|
467cd6a60f | ||
|
|
f982aaafa7 | ||
|
|
210d43d7a2 | ||
|
|
85e5e60777 | ||
|
|
1182a3356c | ||
|
|
5e9377ebd5 | ||
|
|
e9f996c00d | ||
|
|
c4686b4de9 | ||
|
|
6f560b0487 | ||
|
|
de71f435d8 | ||
|
|
66682f5abe | ||
|
|
bb18fa448c | ||
|
|
3af4896837 | ||
|
|
04b492a5fe | ||
|
|
638c4b89b7 | ||
|
|
3654ff7366 | ||
|
|
b022e54bd1 | ||
|
|
39a173b79b | ||
|
|
7dce0194c8 | ||
|
|
08624ea90d | ||
|
|
0fd3572f4e | ||
|
|
0881ff0466 | ||
|
|
06a526be3e | ||
|
|
bb935ff8dc | ||
|
|
cfd096fd7c | ||
|
|
8d199c7c4f | ||
|
|
c6f6bf88d8 | ||
|
|
7687b8b81c | ||
|
|
7b0993bfb4 | ||
|
|
984561cfa8 | ||
|
|
84630a1109 | ||
|
|
4a6291508d | ||
|
|
e62bb03257 | ||
|
|
e25b2d7ea5 | ||
|
|
87c8ea15f2 | ||
|
|
db4d473d53 | ||
|
|
85d9d85ce2 | ||
|
|
44197774c0 | ||
|
|
b32405053f | ||
|
|
5de1b08482 | ||
|
|
62364e6e01 | ||
|
|
73c38eca5a | ||
|
|
90c8f16c3b | ||
|
|
b903d2d6cd | ||
|
|
30eff1a697 | ||
|
|
9350f45aca | ||
|
|
5df8cf1975 | ||
|
|
e43c5a8395 | ||
|
|
0777a18703 | ||
|
|
f1e2edff8b | ||
|
|
a328cc452e | ||
|
|
bdaafe3c7b | ||
|
|
98bb5f4798 | ||
|
|
50ad2af503 | ||
|
|
0444708c5c | ||
|
|
7197f0ffcc | ||
|
|
f52b2e6a65 | ||
|
|
6fece94369 | ||
|
|
38847482c8 | ||
|
|
4e46a87392 | ||
|
|
b6fdb60ecf | ||
|
|
2578f7bcc0 | ||
|
|
656fcb67f1 | ||
|
|
d95faef1a1 | ||
|
|
fe2612d71e | ||
|
|
00ecc12c0f | ||
|
|
faf14e9b2e | ||
|
|
e1023affc1 | ||
|
|
6c2564766f | ||
|
|
206cce0d8b | ||
|
|
b36df28dca | ||
|
|
ca4a3e6138 | ||
|
|
357ab3cbad | ||
|
|
a3f020a4be | ||
|
|
c134f2a1a5 | ||
|
|
fe5ce5cb91 | ||
|
|
9bda6a25a5 | ||
|
|
ecf0cbdf3b | ||
|
|
b6656d0ec9 | ||
|
|
03dfa08da9 | ||
|
|
5c5bc7cf1b | ||
|
|
8f533d2dfd | ||
|
|
31a6f8b7f4 | ||
|
|
7ffb77d243 | ||
|
|
7c08232509 | ||
|
|
61099f8585 | ||
|
|
52d1add0fe | ||
|
|
d24ac6953e | ||
|
|
1b58bd39a6 | ||
|
|
064c62e4cf | ||
|
|
1e9bc56775 | ||
|
|
fcd4b5335a | ||
|
|
b5d267aa95 | ||
|
|
7b113d789d | ||
|
|
c16d6befd4 | ||
|
|
bc55a8eb9f | ||
|
|
9a44a9806c | ||
|
|
bae95bd9d4 | ||
|
|
07a13fd9fa | ||
|
|
81e9aa6c8d | ||
|
|
c737b89473 | ||
|
|
8e76d0404b | ||
|
|
021f57ef0e | ||
|
|
afc1debb2f | ||
|
|
cc34dfce16 | ||
|
|
558c5dbe65 | ||
|
|
42437dd870 | ||
|
|
7b0107cc5d | ||
|
|
92b1cb3ca0 | ||
|
|
59b016192d | ||
|
|
263accb626 | ||
|
|
01ae5c3c2f | ||
|
|
375e3c273b | ||
|
|
68fa6a3eb7 | ||
|
|
4b900f4831 | ||
|
|
188c196d4d | ||
|
|
050aae2860 | ||
|
|
e67a2b9e47 | ||
|
|
bfdb889d4f | ||
|
|
0ea83ff847 | ||
|
|
92a7924c1a | ||
|
|
1a18e84822 | ||
|
|
afe98b7829 | ||
|
|
ed6763420c | ||
|
|
702b436ef4 | ||
|
|
cc4c318b0c | ||
|
|
e7ce002c01 | ||
|
|
6533094d9e | ||
|
|
740b823be8 | ||
|
|
643ce95b5b | ||
|
|
0110662ae9 | ||
|
|
73de4d8c68 | ||
|
|
ac6342bbc0 | ||
|
|
40663ede83 | ||
|
|
24e380f970 | ||
|
|
9283b8aea4 | ||
|
|
97d656fc82 | ||
|
|
a100c25ea4 | ||
|
|
0cea9e6843 | ||
|
|
f45a85c386 | ||
|
|
b09f5a4f56 | ||
|
|
9d75bf35e9 | ||
|
|
f7362232f4 | ||
|
|
9d6636364d | ||
|
|
a80fdc47b3 | ||
|
|
836a2b1131 | ||
|
|
4a01ddfb55 | ||
|
|
bb4d11b405 | ||
|
|
321f4f18e5 | ||
|
|
31468401b7 | ||
|
|
09b6e33b40 | ||
|
|
7a6e76fd2f | ||
|
|
1433854681 | ||
|
|
264279439b | ||
|
|
ec53b60072 | ||
|
|
93fd9c704b | ||
|
|
5382e156f9 | ||
|
|
3e6d633a0d | ||
|
|
122570443b | ||
|
|
38bf6951b3 | ||
|
|
b8b3bb08b2 | ||
|
|
aa0adce47d | ||
|
|
86c1a26169 | ||
|
|
9e7c2e5906 | ||
|
|
33b104c778 | ||
|
|
b69fd9c9b8 | ||
|
|
77ee200097 | ||
|
|
a85ae16e74 | ||
|
|
be2f547497 | ||
|
|
94a4e0f823 | ||
|
|
142c40f32c | ||
|
|
f63a9f6c11 | ||
|
|
9498cf6194 | ||
|
|
4c38003dbd | ||
|
|
93e35137aa | ||
|
|
930ef9ddd6 | ||
|
|
83864b470b | ||
|
|
b1bf524140 | ||
|
|
c077074c13 | ||
|
|
374ebc8741 | ||
|
|
0510701474 | ||
|
|
3bc7490370 | ||
|
|
4fcf4e0845 | ||
|
|
a4191b0aad | ||
|
|
9b5cb0e805 | ||
|
|
6a065876b9 | ||
|
|
bf9ad4e661 | ||
|
|
1e9a3ed234 | ||
|
|
99d087e5d4 | ||
|
|
d7bac4f5ba | ||
|
|
e5029ac40b | ||
|
|
93d1171c47 | ||
|
|
cddbb98ada | ||
|
|
2111ee3df5 | ||
|
|
ccf15cf2dc | ||
|
|
1a96fe0b32 | ||
|
|
c6203da6c2 | ||
|
|
a06313fe5a | ||
|
|
046ae2f77c | ||
|
|
e1410b5a70 | ||
|
|
36e88d78e6 | ||
|
|
f659ec108f | ||
|
|
dc9f0e70b7 | ||
|
|
d430b5a4eb | ||
|
|
258c76eb41 | ||
|
|
bcd278ad7f | ||
|
|
6a6ec195ac | ||
|
|
12e759c2ea | ||
|
|
625000ab44 | ||
|
|
d4650c5d69 | ||
|
|
f9e8678dd3 | ||
|
|
f3b1b85169 | ||
|
|
15aaa9c660 | ||
|
|
c05ee74e7f | ||
|
|
6e684e6a6c | ||
|
|
9c52d09ebc | ||
|
|
0de5fb4165 | ||
|
|
67c662a0a2 | ||
|
|
ba35ae32b7 | ||
|
|
bdc1e2302c | ||
|
|
ff9c1b12ff | ||
|
|
d7da1aa694 | ||
|
|
a426e0b050 | ||
|
|
a3a699e090 | ||
|
|
c2f8e90504 | ||
|
|
bc11e6fdbb | ||
|
|
8e5460ad86 | ||
|
|
67557fcfce | ||
|
|
2feea39a33 | ||
|
|
aff5d084a5 | ||
|
|
c3e6de2227 | ||
|
|
5894aa0950 | ||
|
|
aaecb99c6b | ||
|
|
712710bfec | ||
|
|
7ed2fdbf99 | ||
|
|
86c46b96b6 | ||
|
|
36e19c9cab | ||
|
|
dd288f93e1 | ||
|
|
0a7395e009 | ||
|
|
58dabff8ed | ||
|
|
831fbcf385 | ||
|
|
38150cbd7a | ||
|
|
a2045ff332 | ||
|
|
ee258fe87d | ||
|
|
dcd99c4b19 | ||
|
|
3990641e62 | ||
|
|
ac3d227e28 | ||
|
|
663434cd76 | ||
|
|
b35ffdeae1 | ||
|
|
c12ab5c306 | ||
|
|
fad960a404 | ||
|
|
7e2629635b | ||
|
|
f0b459b7c4 | ||
|
|
3f8c729e69 | ||
|
|
3f0dcc08e0 | ||
|
|
b10a3b9466 | ||
|
|
a2b6d9c104 | ||
|
|
5499c7d201 | ||
|
|
1c553eba19 | ||
|
|
af10e698a2 | ||
|
|
517f800277 | ||
|
|
59a4514dc0 | ||
|
|
63659ce526 | ||
|
|
763bce0303 | ||
|
|
56d9edbbb9 | ||
|
|
180b9e150b | ||
|
|
66b88c92bb | ||
|
|
c46e1cdcae | ||
|
|
59692de77f | ||
|
|
e01fe5315c | ||
|
|
ae9ba081c8 | ||
|
|
3732fa95c5 | ||
|
|
1f7c46b579 | ||
|
|
05deaf1706 | ||
|
|
06739a1b72 | ||
|
|
2f7f57a407 | ||
|
|
d2cc097049 | ||
|
|
36a5eca89c | ||
|
|
c3b480323f | ||
|
|
d813af0618 | ||
|
|
e5b1ebc082 | ||
|
|
77c4b84ac8 | ||
|
|
7a49e09fd8 | ||
|
|
d845549257 | ||
|
|
9d1bc1b622 | ||
|
|
538d8338c0 | ||
|
|
eecdb4c254 | ||
|
|
6566ea6173 | ||
|
|
ef37055c34 | ||
|
|
a11606b18f | ||
|
|
0d458ae89f | ||
|
|
35f86d24d8 | ||
|
|
1f516510b7 | ||
|
|
39a3007ab2 | ||
|
|
2d1694d4eb | ||
|
|
95fd52ff3d | ||
|
|
a2cf4f1932 | ||
|
|
bd36d4901c | ||
|
|
795e3f1c0f | ||
|
|
3d86e6d881 | ||
|
|
8b8fb649dc | ||
|
|
ad553a7af2 | ||
|
|
a1e401fb34 | ||
|
|
db6d8e2724 | ||
|
|
2a75f59355 | ||
|
|
d86decd7b4 | ||
|
|
fa7e230c76 | ||
|
|
811cd765a9 | ||
|
|
22fe268ad4 | ||
|
|
df97c3aa0d | ||
|
|
881416cda6 | ||
|
|
73e66ff1bd | ||
|
|
94cbd6374a | ||
|
|
c3b6f6feed | ||
|
|
d398456e48 | ||
|
|
fd650ec93e | ||
|
|
b8553d8494 | ||
|
|
89e547ce7f | ||
|
|
627eb9e3d9 | ||
|
|
12f451c771 | ||
|
|
1377942b69 | ||
|
|
12de2e91d0 | ||
|
|
ec2a132f9c | ||
|
|
7552a7eb19 | ||
|
|
e9c1a45daa | ||
|
|
31ab57e052 | ||
|
|
92a5e4def0 | ||
|
|
c2554b4bb4 | ||
|
|
35f636019d | ||
|
|
ff6c9e2726 | ||
|
|
96300f551a | ||
|
|
dc36933181 | ||
|
|
00d86afedf | ||
|
|
b689819567 | ||
|
|
40fabf68ed | ||
|
|
7f7cff0bbb | ||
|
|
dc2192c087 | ||
|
|
1a09bf8023 | ||
|
|
f877d7fee6 | ||
|
|
92e2f29381 | ||
|
|
c37d7a9456 | ||
|
|
487b7c7f32 | ||
|
|
bc492007da | ||
|
|
0f4772d12f | ||
|
|
f08060a48f | ||
|
|
1e6baa2673 | ||
|
|
be1e5b9c54 | ||
|
|
575790e842 | ||
|
|
d88017e992 | ||
|
|
e6b727d3b7 | ||
|
|
e0ad33c24a | ||
|
|
eff12e56b6 | ||
|
|
070239a194 | ||
|
|
df3b9a1e07 | ||
|
|
7751a68824 | ||
|
|
289bb339c9 | ||
|
|
8d2c44b59d | ||
|
|
137503dd6f | ||
|
|
c08e2c8c17 | ||
|
|
7262bf67a2 | ||
|
|
67e67c254d | ||
|
|
88d2b8c5fd | ||
|
|
92147243bf | ||
|
|
90d2561a9c | ||
|
|
7cd2f4b6a6 | ||
|
|
f55bed9dad | ||
|
|
9d8ed21bd5 | ||
|
|
8a84b1b5d9 | ||
|
|
dc862f4fd4 | ||
|
|
1702024073 | ||
|
|
6bd0a92a35 | ||
|
|
cc315e79e1 | ||
|
|
e54970aaf1 | ||
|
|
111aa9fd2e | ||
|
|
396c1e990a | ||
|
|
75746d60b6 | ||
|
|
d412152f31 | ||
|
|
99edb55e41 | ||
|
|
c886691100 | ||
|
|
15ab75be8a | ||
|
|
6dff07aa8c | ||
|
|
975fb4e3ea | ||
|
|
16f9f46935 | ||
|
|
2a59f1d06c | ||
|
|
7468fc0e37 | ||
|
|
3d82f16c7d | ||
|
|
f99befadbd | ||
|
|
65585b3aa2 | ||
|
|
5a1d2fe415 | ||
|
|
55a4da7f53 | ||
|
|
f5d8b638c7 | ||
|
|
117d2dd688 | ||
|
|
019bdff395 | ||
|
|
4f36aeb120 | ||
|
|
00ad4c0e6a | ||
|
|
1e081a825e | ||
|
|
d9aea7cd4d | ||
|
|
6b9df7a454 | ||
|
|
bca8ff723d | ||
|
|
5b82fb52fd | ||
|
|
bb60122c2f | ||
|
|
065862a750 | ||
|
|
964acdaa35 | ||
|
|
44a6fe8411 | ||
|
|
9d95f7d286 | ||
|
|
417b1b238f | ||
|
|
db0f623490 | ||
|
|
1784279be0 | ||
|
|
3e94ce6a97 |
No files matched your search
+4
-5
@@ -1,10 +1,9 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
branches:
|
||||
except:
|
||||
- /^PHP-5\.3.*/
|
||||
- /^PHP-5\.4.*/
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
+9
-6
@@ -45,14 +45,17 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
|
||||
changes now.
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
PHP-5.1 This branch is closed.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ resources cannot be auto-converted.
|
||||
Type specifiers
|
||||
---------------
|
||||
The following list shows the type specifier, its meaning and the parameter
|
||||
types that need to be passed by address. All passed paramaters are set
|
||||
types that need to be passed by address. All passed parameters are set
|
||||
if the PHP parameter is non optional and untouched if optional and the
|
||||
parameter is not present. The only exception is O where the zend_class_entry*
|
||||
has to be provided on input and is used to verify the PHP parameter is an
|
||||
|
||||
@@ -154,7 +154,15 @@ origin <branch>``".
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
12. Commit those two tarballs to Git (php-distributions.git)
|
||||
12. Commit those two tarballs to web/php-distributions.git, then update the git
|
||||
submodule reference in web/php.git:
|
||||
git submodule init;
|
||||
git submodule update;
|
||||
cd distributions;
|
||||
git pull origin master;
|
||||
cd ..;
|
||||
git commit distributions;
|
||||
git push;
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -525,6 +525,8 @@ b. Extensions with changed behavior
|
||||
must be activated manually with the "extension = php_com_dotnet.dll" directive
|
||||
in php.ini.
|
||||
|
||||
- Apache 2.4 handler is supported as of PHP 5.4.9
|
||||
|
||||
==================
|
||||
12. New in PHP 5.4
|
||||
==================
|
||||
@@ -638,6 +640,9 @@ c. New functions
|
||||
- SPL
|
||||
- class_uses()
|
||||
|
||||
- SplFixedArray
|
||||
- SplFixedArray::__wakeup() (5.4.18)
|
||||
|
||||
d. New global constants
|
||||
|
||||
- CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading
|
||||
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
|
||||
code execution (with specialized executor and direct threading execution
|
||||
method). As in most PHP applications raw execution speed isn't the limiting
|
||||
factor but system calls and database callls are, your mileage with this patch
|
||||
factor but system calls and database calls are, your mileage with this patch
|
||||
will vary.
|
||||
|
||||
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can
|
||||
|
||||
+3
-3
@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
|
||||
that of other object-oriented languages, such as Java: When the
|
||||
last reference to an object is destroyed the object's
|
||||
destructor, which is a class method name __destruct() that
|
||||
recieves no parameters, is called before the object is freed
|
||||
receives no parameters, is called before the object is freed
|
||||
from memory.
|
||||
|
||||
Example:
|
||||
@@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0
|
||||
(supports breakpoints, expression evaluation, step-in/over,
|
||||
function call backtrace, and more).
|
||||
|
||||
The Zend Engine claims 100% compatability with the engine of PHP
|
||||
The Zend Engine claims 100% compatibility with the engine of PHP
|
||||
3.0, and is shamelessly lying about it. Here's why:
|
||||
|
||||
* Static variable initializers only accept scalar values
|
||||
@@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0
|
||||
printed the letter { and the contents of the variable $somevar in
|
||||
PHP 3.0), it will result in a parse error with the Zend Engine.
|
||||
In this case, you would have to change the code to print
|
||||
"\{$somevar"; This incompatability is due to the full variable
|
||||
"\{$somevar"; This incompatibility is due to the full variable
|
||||
reference within quoted strings feature added in the Zend
|
||||
Engine.
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ var_dump($global_var);
|
||||
test_unset3();
|
||||
var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
//Note: No error conditions relating to passing arguments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
|
||||
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
|
||||
|
||||
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
|
||||
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32428 (The @ warning error supression operator is broken)
|
||||
Bug #32428 (The @ warning error suppression operator is broken)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = @$not_exists;
|
||||
|
||||
@@ -4,6 +4,7 @@ test of larger than 8kb text file being parsed by require statement
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #62343 (Show class_alias In get_declared_classes())
|
||||
--FILE--
|
||||
<?php
|
||||
class a { }
|
||||
class_alias("a", "b");
|
||||
$c = get_declared_classes();
|
||||
var_dump(end($c));
|
||||
var_dump(prev($c));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "b"
|
||||
string(1) "a"
|
||||
@@ -0,0 +1,74 @@
|
||||
--TEST--
|
||||
Test script to verify that magic methods should be called only once when accessing an unset property.
|
||||
--CREDITS--
|
||||
Marco Pivetta <ocramius@gmail.com>
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public $publicProperty;
|
||||
protected $protectedProperty;
|
||||
private $privateProperty;
|
||||
|
||||
public function __construct() {
|
||||
unset(
|
||||
$this->publicProperty,
|
||||
$this->protectedProperty,
|
||||
$this->privateProperty
|
||||
);
|
||||
}
|
||||
|
||||
function __get($name) {
|
||||
echo '__get ' . $name . "\n";
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
function __set($name, $value) {
|
||||
echo '__set ' . $name . "\n";
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
function __isset($name) {
|
||||
echo '__isset ' . $name . "\n";
|
||||
return isset($this->$name);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
$test->nonExisting;
|
||||
$test->publicProperty;
|
||||
$test->protectedProperty;
|
||||
$test->privateProperty;
|
||||
isset($test->nonExisting);
|
||||
isset($test->publicProperty);
|
||||
isset($test->protectedProperty);
|
||||
isset($test->privateProperty);
|
||||
$test->nonExisting = 'value';
|
||||
$test->publicProperty = 'value';
|
||||
$test->protectedProperty = 'value';
|
||||
$test->privateProperty = 'value';
|
||||
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
__get nonExisting
|
||||
|
||||
Notice: Undefined property: Test::$nonExisting in %s on line %d
|
||||
__get publicProperty
|
||||
|
||||
Notice: Undefined property: Test::$publicProperty in %s on line %d
|
||||
__get protectedProperty
|
||||
|
||||
Notice: Undefined property: Test::$protectedProperty in %s on line %d
|
||||
__get privateProperty
|
||||
|
||||
Notice: Undefined property: Test::$privateProperty in %s on line %d
|
||||
__isset nonExisting
|
||||
__isset publicProperty
|
||||
__isset protectedProperty
|
||||
__isset privateProperty
|
||||
__set nonExisting
|
||||
__set publicProperty
|
||||
__set protectedProperty
|
||||
__set privateProperty
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #63468 (wrong called method as callback with inheritance)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
return call_user_func(array('Bar', 'getValue'));
|
||||
}
|
||||
|
||||
private static function getValue()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public static function getValue()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
}
|
||||
|
||||
$x = new Bar;
|
||||
var_dump($x->run());
|
||||
--EXPECT--
|
||||
string(3) "Bar"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #63635 (Segfault in gc_collect_cycles)
|
||||
--FILE--
|
||||
<?php
|
||||
class Node {
|
||||
public $parent = NULL;
|
||||
public $childs = array();
|
||||
|
||||
function __construct(Node $parent=NULL) {
|
||||
if ($parent) {
|
||||
$parent->childs[] = $this;
|
||||
}
|
||||
$this->childs[] = $this;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
$this->childs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
define("MAX", 16);
|
||||
|
||||
for ($n = 0; $n < 20; $n++) {
|
||||
$top = new Node();
|
||||
for ($i=0 ; $i<MAX ; $i++) {
|
||||
$ci = new Node($top);
|
||||
for ($j=0 ; $j<MAX ; $j++) {
|
||||
$cj = new Node($ci);
|
||||
for ($k=0 ; $k<MAX ; $k++) {
|
||||
$ck = new Node($cj);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "$n\n";
|
||||
}
|
||||
echo "ok\n";
|
||||
--EXPECT--
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
ok
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #63762 - Sigsegv when Exception::$trace is changed by user
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new Exception();
|
||||
|
||||
$ref = new ReflectionProperty($e, 'trace');
|
||||
$ref->setAccessible(TRUE);
|
||||
|
||||
echo "Array of NULL:\n";
|
||||
$ref->setValue($e, array(NULL));
|
||||
|
||||
var_dump($e->getTraceAsString());
|
||||
|
||||
echo "\nArray of empty array:\n";
|
||||
$ref->setValue($e, array(array()));
|
||||
var_dump($e->getTraceAsString());
|
||||
|
||||
echo "\nArray of array of NULL values:\n";
|
||||
$ref->setValue($e, array(array(
|
||||
'file' => NULL,
|
||||
'line' => NULL,
|
||||
'class' => NULL,
|
||||
'type' => NULL,
|
||||
'function' => NULL,
|
||||
'args' => NULL
|
||||
)));
|
||||
var_dump($e->getTraceAsString());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array of NULL:
|
||||
|
||||
Warning: Expected array for frame 0 in %s on line %d
|
||||
string(9) "#0 {main}"
|
||||
|
||||
Array of empty array:
|
||||
string(36) "#0 [internal function]: ()
|
||||
#1 {main}"
|
||||
|
||||
Array of array of NULL values:
|
||||
|
||||
Warning: Function name is no string in %s on line %d
|
||||
|
||||
Warning: Value for class is no string in %s on line %d
|
||||
|
||||
Warning: Value for type is no string in %s on line %d
|
||||
|
||||
Warning: Value for function is no string in %s on line %d
|
||||
|
||||
Warning: args element is no array in %s on line %d
|
||||
string(60) "#0 [unknown function][unknown][unknown][unknown]()
|
||||
#1 {main}"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #63882 (zend_std_compare_objects crash on recursion)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test { public $x = 5; }
|
||||
|
||||
$testobj1 = new Test;
|
||||
$testobj2 = new Test;
|
||||
$testobj1->x = $testobj1;
|
||||
$testobj2->x = $testobj2;
|
||||
|
||||
var_dump($testobj1 == $testobj2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #63976 (Parent class incorrectly using child constant in class property)
|
||||
--FILE--
|
||||
<?php
|
||||
if (1) {
|
||||
class Foo {
|
||||
const TABLE = "foo";
|
||||
public $table = self::TABLE;
|
||||
}
|
||||
}
|
||||
if (1) {
|
||||
class Bar extends Foo {
|
||||
const TABLE = "bar";
|
||||
}
|
||||
}
|
||||
$bar = new Bar();
|
||||
var_dump($bar->table);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
protected $protectedProperty;
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
var_dump(isset($test->protectedProperty));
|
||||
var_dump(isset($test->protectedProperty->foo));
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #64239 (get_class_methods() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
}
|
||||
}
|
||||
print_r(get_class_methods("A"));
|
||||
print_r(get_class_methods("B"));
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T1;
|
||||
public function test() { $this->backtrace(); }
|
||||
}
|
||||
|
||||
class B {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
}
|
||||
|
||||
trait T1 {
|
||||
protected function backtrace() {
|
||||
$b = new B();
|
||||
$b->Bmethod();
|
||||
}
|
||||
}
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
|
||||
}
|
||||
}
|
||||
$a = new A();
|
||||
$a->test();
|
||||
|
||||
$c = new C();
|
||||
$c->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->Bmethod();
|
||||
$a->t2method();
|
||||
|
||||
$c = new C();
|
||||
$c->Bmethod();
|
||||
$c->t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
#0 C->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public static function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public static function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
A::Bmethod();
|
||||
A::t2method();
|
||||
|
||||
C::Bmethod();
|
||||
C::t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
#0 C::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
|
||||
--FILE--
|
||||
<?php
|
||||
class B implements Serializable {
|
||||
public function serialize() {
|
||||
throw new Exception("serialize");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function unserialize($data) {
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(new B);
|
||||
|
||||
try {
|
||||
serialize($data);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(9) "serialize"
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
Bug #64417 (BC break: ArrayAccess::&offsetGet() in a trait causes fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait aa {
|
||||
private $container = array();
|
||||
public function offsetSet($offset, $value) {
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
public function &offsetGet($offset) {
|
||||
$result = null;
|
||||
if (isset($this->container[$offset])) {
|
||||
$result = &$this->container[$offset];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
class obj implements ArrayAccess {
|
||||
use aa;
|
||||
}
|
||||
|
||||
$o = new obj;
|
||||
$o['x'] = 1;
|
||||
++$o['x'];
|
||||
echo $o['x'], "\n";
|
||||
--EXPECT--
|
||||
2
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($unused = null, $unused = null, $arg = array()) {
|
||||
return 1;
|
||||
}
|
||||
foo();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $err) { var_dump($err); });
|
||||
|
||||
function x($s) { $s['a'] = 1; };
|
||||
$y = '1';
|
||||
x($y);
|
||||
print_r($y);
|
||||
--EXPECTF--
|
||||
string(25) "Illegal string offset 'a'"
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #64660 (Segfault on memory exhaustion within function definition)
|
||||
--FILE--
|
||||
<?php
|
||||
function a() {
|
||||
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[Line truncated
|
||||
}
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
|
||||
Parse error: memory exhausted in %s on line %d
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #64720 (SegFault on zend_deactivate)
|
||||
--FILE--
|
||||
<?php
|
||||
class Stat {
|
||||
private static $requests;
|
||||
public static function getInstance() {
|
||||
if (!isset(self::$requests[1])) {
|
||||
self::$requests[1] = new self();
|
||||
}
|
||||
return self::$requests[1];
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
unset(self::$requests[1]);
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
Stat::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Error {
|
||||
private $trace;
|
||||
public function __construct() {
|
||||
$this->trace = debug_backtrace(1);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function __destruct() {
|
||||
Stat::getInstance();
|
||||
new Error();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
new Error();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$bar->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->message = NULL;
|
||||
$this->string = NULL;
|
||||
$this->code = array();
|
||||
$this->line = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
$this->file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #64960 (Segfault in gc_zval_possible_root)
|
||||
--FILE--
|
||||
<?php
|
||||
// this makes ob_end_clean raise an error
|
||||
ob_end_flush();
|
||||
|
||||
class ExceptionHandler {
|
||||
public function __invoke (Exception $e)
|
||||
{
|
||||
// this triggers the custom error handler
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
// this must be a class, closure does not trigger segfault
|
||||
set_exception_handler(new ExceptionHandler());
|
||||
|
||||
// exception must be throwed from error handler.
|
||||
set_error_handler(function()
|
||||
{
|
||||
$e = new Exception;
|
||||
$e->_trace = debug_backtrace();
|
||||
|
||||
throw $e;
|
||||
});
|
||||
|
||||
// trigger error handler
|
||||
$a['waa'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
|
||||
#1 %sbug64960.php(9): ob_end_clean()
|
||||
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
|
||||
#3 {main}
|
||||
thrown in %sbug64960.php on line 19
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
|
||||
|
||||
function test($func) {
|
||||
$a = $func("");
|
||||
return true;
|
||||
}
|
||||
class A {
|
||||
public function b() {
|
||||
test("strlen");
|
||||
test("iterator_apply");
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->b();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
|
||||
#1 %sbug64966.php(6): iterator_apply('')
|
||||
#2 %sbug64966.php(12): test('iterator_apply')
|
||||
#3 %sbug64966.php(17): A->b()
|
||||
#4 {main}
|
||||
thrown in %sbug64966.php on line 3
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64988 (Class loading order affects E_STRICT warning)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Base1 {
|
||||
public function insert(array $data){
|
||||
return array_reverse($data);
|
||||
}
|
||||
}
|
||||
|
||||
class Noisy1 extends Base1 {
|
||||
public function insert(array $data, $option1 = Null) {
|
||||
if (!empty($option1)) {
|
||||
$data['option1'] = $option1;
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
class Smooth1 extends Noisy1 {
|
||||
public function insert(array $data) {
|
||||
return parent::insert($data, count($data));
|
||||
}
|
||||
}
|
||||
|
||||
$o = new Smooth1();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
|
||||
okey
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #65108 (is_callable() triggers Fatal Error)
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private function f() {}
|
||||
static function __callStatic($name, $args) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
public function B() {
|
||||
$isCallable = is_callable(array(new C, 'f'));
|
||||
var_dump($isCallable);
|
||||
}
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
Class E {
|
||||
private function f() {}
|
||||
function __call($name, $args) {}
|
||||
}
|
||||
$isCallable = is_callable(array('E', 'f'));
|
||||
var_dump($isCallable);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
eval("namespace ns_test; class test {}");
|
||||
|
||||
throw new \Exception('abcd');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
\ns_test\test::go();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo 'caught';
|
||||
}
|
||||
--EXPECT--
|
||||
caught
|
||||
@@ -3,7 +3,7 @@ Closure 044: Scope/bounding combination invariants; non static closures
|
||||
--FILE--
|
||||
<?php
|
||||
/* A non-static closure has a bound instance if it has a scope
|
||||
* and does't have an instance if it has no scope */
|
||||
* and doesn't have an instance if it has no scope */
|
||||
|
||||
$nonstaticUnscoped = function () { var_dump(isset(A::$priv)); var_dump(isset($this)); };
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 007: Unreferensed array cycle
|
||||
GC 007: Unreferenced array cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 008: Unreferensed object cycle
|
||||
GC 008: Unreferenced object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 009: Unreferensed array-object cycle
|
||||
GC 009: Unreferenced array-object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -16,4 +16,4 @@ class C implements IFoo {
|
||||
}
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
|
||||
Fatal error: Declaration of TFoo::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
|
||||
@@ -23,4 +23,4 @@ $o = new CBroken;
|
||||
$o->foo(1);
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of TBroken1::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s on line %d
|
||||
Fatal error: Declaration of TBroken2::foo($a, $b = 0) must be compatible with TBroken1::foo($a) in %s on line %d
|
||||
@@ -23,4 +23,4 @@ $o = new CBroken;
|
||||
$o->foo(1);
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of TBroken1::foo($a, $b = 0) must be compatible with TBroken2::foo($a) in %s on line %d
|
||||
Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #64070 (Inheritance with Traits failed with error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait first_trait
|
||||
{
|
||||
function first_function()
|
||||
{
|
||||
echo "From First Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait second_trait
|
||||
{
|
||||
use first_trait {
|
||||
first_trait::first_function as second_function;
|
||||
}
|
||||
|
||||
function first_function()
|
||||
{
|
||||
echo "From Second Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
class first_class
|
||||
{
|
||||
use second_trait;
|
||||
}
|
||||
|
||||
$obj = new first_class();
|
||||
$obj->first_function();
|
||||
$obj->second_function();
|
||||
?>
|
||||
--EXPECT--
|
||||
From Second Trait
|
||||
From First Trait
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method insteadof TestTrait;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235.php on line %d
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method as TestParent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
|
||||
@@ -22,4 +22,4 @@ class TraitsTest1 {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
|
||||
Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d
|
||||
@@ -23,4 +23,4 @@ class TraitsTest1 {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d
|
||||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
|
||||
@@ -10,13 +10,9 @@ trait c {
|
||||
public function test() { return 2; }
|
||||
}
|
||||
|
||||
trait b {
|
||||
public function test() { return 1; }
|
||||
}
|
||||
|
||||
class bar {
|
||||
use foo, c { c::test insteadof foo, b; }
|
||||
use foo, c { c::test insteadof foo, b; }
|
||||
use foo, c { c::test insteadof foo; }
|
||||
use foo, c { c::test insteadof foo; }
|
||||
}
|
||||
|
||||
$x = new bar;
|
||||
|
||||
@@ -35,4 +35,4 @@ $o->sayHello(array());
|
||||
--EXPECTF--
|
||||
World!
|
||||
|
||||
Fatal error: Declaration of MyHelloWorld::sayHello() must be compatible with Base::sayHello(array $a) in %s on line %d
|
||||
Fatal error: Declaration of SayWorld::sayHello(Base $d) must be compatible with Base::sayHello(array $a) in %s on line %d
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Aliasing leading to conflict should result in error message
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
trait Hello {
|
||||
public function hello() {
|
||||
echo 'Hello';
|
||||
}
|
||||
}
|
||||
|
||||
trait World {
|
||||
public function world() {
|
||||
echo ' World!';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyClass {
|
||||
use Hello, World { world as hello; }
|
||||
}
|
||||
|
||||
$o = new MyClass();
|
||||
$o->hello();
|
||||
$o->world();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as lhs of "insteadof")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T2::foo insteadof T1;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as rhs of "insteadof")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T1::foo insteadof T2;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as lhs of "as")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T2::foo as private;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
abstract alias
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {}
|
||||
}
|
||||
class C1 {
|
||||
use T1 {
|
||||
T1::foo as abstract;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use 'abstract' as method modifier in %s on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
final alias
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {}
|
||||
}
|
||||
class C1 {
|
||||
use T1 {
|
||||
T1::foo as final;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use 'final' as method modifier in %s on line %d
|
||||
+9
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -131,7 +131,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
static uint zend_version_info_length;
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2012 Zend Technologies\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2013 Zend Technologies\n"
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
|
||||
@@ -1238,7 +1238,13 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
va_end(args);
|
||||
|
||||
if (type == E_PARSE) {
|
||||
EG(exit_status) = 255;
|
||||
/* eval() errors do not affect exit_status */
|
||||
if (!(EG(current_execute_data) &&
|
||||
EG(current_execute_data)->opline &&
|
||||
EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
|
||||
EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) {
|
||||
EG(exit_status) = 255;
|
||||
}
|
||||
zend_init_compiler_data_structures(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -350,6 +350,10 @@ struct _zval_struct {
|
||||
#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
|
||||
#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#if __GNUC__ >= 3
|
||||
#define zend_always_inline inline __attribute__((always_inline))
|
||||
@@ -358,7 +362,6 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
#define zend_always_inline __forceinline
|
||||
#define zend_never_inline
|
||||
@@ -366,6 +369,7 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
#endif /* ZEND_DEBUG */
|
||||
|
||||
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
|
||||
# define EXPECTED(condition) __builtin_expect(condition, 1)
|
||||
@@ -437,7 +441,7 @@ struct _zend_trait_precedence {
|
||||
|
||||
zend_class_entry** exclude_from_classes;
|
||||
|
||||
union _zend_function* function;
|
||||
union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
|
||||
};
|
||||
typedef struct _zend_trait_precedence zend_trait_precedence;
|
||||
|
||||
@@ -455,7 +459,7 @@ struct _zend_trait_alias {
|
||||
*/
|
||||
zend_uint modifiers;
|
||||
|
||||
union _zend_function* function;
|
||||
union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
|
||||
};
|
||||
typedef struct _zend_trait_alias zend_trait_alias;
|
||||
|
||||
|
||||
+100
-7
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1022,6 +1022,41 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zval_update_class_constant(zval **pp, int is_static, int offset TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
|
||||
(Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
|
||||
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
|
||||
|
||||
if ((*scope)->parent) {
|
||||
zend_class_entry *ce = *scope;
|
||||
HashPosition pos;
|
||||
zend_property_info *prop_info;
|
||||
|
||||
do {
|
||||
for (zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
|
||||
zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop_info, &pos) == SUCCESS;
|
||||
zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
|
||||
if (is_static == ((prop_info->flags & ZEND_ACC_STATIC) != 0) &&
|
||||
offset == prop_info->offset) {
|
||||
int ret;
|
||||
zend_class_entry *old_scope = *scope;
|
||||
*scope = prop_info->ce;
|
||||
ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
*scope = old_scope;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
ce = ce->parent;
|
||||
} while (ce);
|
||||
|
||||
}
|
||||
return zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED) == 0 || (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count)) {
|
||||
@@ -1034,7 +1069,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
|
||||
for (i = 0; i < class_type->default_properties_count; i++) {
|
||||
if (class_type->default_properties_table[i]) {
|
||||
zval_update_constant(&class_type->default_properties_table[i], (void**)1 TSRMLS_CC);
|
||||
zval_update_class_constant(&class_type->default_properties_table[i], 0, i TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1075,7 +1110,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
}
|
||||
|
||||
for (i = 0; i < class_type->default_static_members_count; i++) {
|
||||
zval_update_constant(&CE_STATIC_MEMBERS(class_type)[i], (void**)1 TSRMLS_CC);
|
||||
zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i TSRMLS_CC);
|
||||
}
|
||||
|
||||
*scope = old_scope;
|
||||
@@ -1108,7 +1143,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
|
||||
|
||||
/* This function requires 'properties' to contain all props declared in the
|
||||
* 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 seperately by
|
||||
* 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 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
@@ -2732,7 +2767,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
} else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) {
|
||||
retval = 1;
|
||||
if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) &&
|
||||
EG(scope) &&
|
||||
!strict_class && EG(scope) &&
|
||||
instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) {
|
||||
zend_function *priv_fbc;
|
||||
|
||||
@@ -2744,8 +2779,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 &&
|
||||
(fcc->calling_scope &&
|
||||
(fcc->calling_scope->__call ||
|
||||
fcc->calling_scope->__callstatic))) {
|
||||
((fcc->object_ptr && fcc->calling_scope->__call) ||
|
||||
(!fcc->object_ptr && fcc->calling_scope->__callstatic)))) {
|
||||
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) {
|
||||
retval = 0;
|
||||
@@ -3708,6 +3743,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
|
||||
(*property)->value = value->value;
|
||||
if (Z_REFCOUNT_P(value) > 0) {
|
||||
zval_copy_ctor(*property);
|
||||
} else {
|
||||
efree(value);
|
||||
}
|
||||
} else {
|
||||
zval *garbage = *property;
|
||||
@@ -3876,6 +3913,62 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f) /* {{{ */
|
||||
{
|
||||
zend_function *func;
|
||||
HashPosition iterator;
|
||||
HashTable *function_table;
|
||||
|
||||
if (f->common.type != ZEND_USER_FUNCTION ||
|
||||
*(f->op_array.refcount) < 2 ||
|
||||
!f->common.scope ||
|
||||
!f->common.scope->trait_aliases) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
|
||||
function_table = &ce->function_table;
|
||||
zend_hash_internal_pointer_reset_ex(function_table, &iterator);
|
||||
while (zend_hash_get_current_data_ex(function_table, (void **)&func, &iterator) == SUCCESS) {
|
||||
if (func == f) {
|
||||
char *name;
|
||||
uint len;
|
||||
ulong idx;
|
||||
|
||||
if (zend_hash_get_current_key_ex(function_table, &name, &len, &idx, 0, &iterator) != HASH_KEY_IS_STRING) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
--len;
|
||||
if (len == strlen(f->common.function_name) &&
|
||||
!strncasecmp(name, f->common.function_name, len)) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
return zend_find_alias_name(f->common.scope, name, len);
|
||||
}
|
||||
zend_hash_move_forward_ex(function_table, &iterator);
|
||||
}
|
||||
return f->common.function_name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+10
-7
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -60,7 +60,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
zval *object_ptr;
|
||||
} zend_fcall_info_cache;
|
||||
|
||||
#define ZEND_NS_NAME(ns, name) ns"\\"name
|
||||
#define ZEND_NS_NAME(ns, name) ns "\\" name
|
||||
|
||||
#define ZEND_FN(name) zif_##name
|
||||
#define ZEND_MN(name) zim_##name
|
||||
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
|
||||
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
@@ -279,9 +279,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
|
||||
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
|
||||
|
||||
#define zend_register_class_alias(name, ce) \
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
|
||||
#define zend_register_ns_class_alias(ns, name, ce) \
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
|
||||
@@ -461,7 +461,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
|
||||
|
||||
/** Clear argumens connected with zend_fcall_info *fci
|
||||
/** Clear arguments connected with zend_fcall_info *fci
|
||||
* If free_mem is not zero then the params array gets free'd as well
|
||||
*/
|
||||
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
|
||||
@@ -499,7 +499,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
|
||||
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
|
||||
|
||||
/** Call a function using information created by zend_fcall_info_init()/args().
|
||||
* If args is given then those replace the arguement info in fci is temporarily.
|
||||
* If args is given then those replace the argument info in fci is temporarily.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
|
||||
|
||||
@@ -517,6 +517,9 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_rebuild_symbol_table(TSRMLS_D);
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len);
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
|
||||
|
||||
#define add_method(arg, key, method) add_assoc_function((arg), (key), (method))
|
||||
|
||||
ZEND_API ZEND_FUNCTION(display_disabled_function);
|
||||
|
||||
+16
-6
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -672,7 +672,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsrq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsr %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
@@ -698,12 +698,12 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsfq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsf %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
bsf eax, _size
|
||||
}
|
||||
}
|
||||
#else
|
||||
static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
|
||||
unsigned int n;
|
||||
@@ -2461,7 +2461,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
@@ -2481,12 +2481,22 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1"
|
||||
#ifdef __ILP32__ /* x32 */
|
||||
# define LP_SUFF "l"
|
||||
#else /* amd64 */
|
||||
# define LP_SUFF "q"
|
||||
#endif
|
||||
|
||||
__asm__ ("mul" LP_SUFF " %3\n\t"
|
||||
"add %4,%0\n\t"
|
||||
"adc $0,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
"rm"(offset));
|
||||
|
||||
#undef LP_SUFF
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1025,6 +1025,13 @@ ZEND_FUNCTION(get_object_vars)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int same_name(const char *key, const char *name, zend_uint name_len)
|
||||
{
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret = memcmp(lcname, key, name_len) == 0;
|
||||
efree(lcname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* {{{ proto array get_class_methods(mixed class)
|
||||
Returns an array of method names for class or class instance. */
|
||||
@@ -1072,14 +1079,26 @@ ZEND_FUNCTION(get_class_methods)
|
||||
uint len = strlen(mptr->common.function_name);
|
||||
|
||||
/* Do not display old-style inherited constructors */
|
||||
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
if (zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
if (mptr->type == ZEND_USER_FUNCTION &&
|
||||
*mptr->op_array.refcount > 1 &&
|
||||
(len != key_len - 1 ||
|
||||
!same_name(key, mptr->common.function_name, len))) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, zend_find_alias_name(mptr->common.scope, key, key_len - 1), key_len - 1, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
zend_hash_move_forward_ex(&ce->function_table, &pos);
|
||||
@@ -1640,7 +1659,6 @@ ZEND_FUNCTION(restore_exception_handler)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
zval *array = va_arg(args, zval *);
|
||||
@@ -1651,7 +1669,13 @@ static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int nu
|
||||
|
||||
if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0)
|
||||
&& (comply_mask == (ce->ce_flags & mask))) {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
if (ce->refcount > 1 &&
|
||||
(ce->name_length != hash_key->nKeyLength - 1 ||
|
||||
!same_name(hash_key->arKey, ce->name, ce->name_length))) {
|
||||
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength - 1, 1);
|
||||
} else {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
@@ -2094,7 +2118,14 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
lineno = 0;
|
||||
}
|
||||
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
if (ptr->object) {
|
||||
@@ -2275,7 +2306,14 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
filename = NULL;
|
||||
}
|
||||
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), (char*)function_name, 1);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+228
-394
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -219,6 +219,7 @@ ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
|
||||
void init_compiler(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
CG(active_op_array) = NULL;
|
||||
memset(&CG(context), 0, sizeof(CG(context)));
|
||||
zend_init_compiler_data_structures(TSRMLS_C);
|
||||
zend_init_rsrc_list(TSRMLS_C);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
|
||||
@@ -1797,7 +1798,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
|
||||
pass_two(CG(active_op_array) TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC);
|
||||
@@ -2319,13 +2320,14 @@ void zend_do_goto(const znode *label TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_release_labels(TSRMLS_D) /* {{{ */
|
||||
void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (CG(context).labels) {
|
||||
zend_hash_destroy(CG(context).labels);
|
||||
FREE_HASHTABLE(CG(context).labels);
|
||||
CG(context).labels = NULL;
|
||||
}
|
||||
if (!zend_stack_is_empty(&CG(context_stack))) {
|
||||
if (!temporary && !zend_stack_is_empty(&CG(context_stack))) {
|
||||
zend_compiler_context *ctx;
|
||||
|
||||
zend_stack_top(&CG(context_stack), (void**)&ctx);
|
||||
@@ -3265,11 +3267,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
|
||||
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
|
||||
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
|
||||
efree(method_prototype);
|
||||
}
|
||||
@@ -3332,7 +3334,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
|
||||
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
|
||||
Z_DELREF_P(ce->default_properties_table[parent_info->offset]);
|
||||
zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
|
||||
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
|
||||
ce->default_properties_table[child_info->offset] = NULL;
|
||||
child_info->offset = parent_info->offset;
|
||||
@@ -3526,8 +3528,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
|
||||
ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
|
||||
} else if (!(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES)
|
||||
&& !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
} else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
|
||||
/* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
@@ -3624,7 +3625,6 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
|
||||
}
|
||||
}
|
||||
ce->traits[ce->num_traits++] = trait;
|
||||
trait->refcount++;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3635,93 +3635,9 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_
|
||||
zend_uint other_flags = other_fn->common.scope->ce_flags;
|
||||
|
||||
return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
|
||||
&& zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)
|
||||
&& ((fn_flags & ZEND_ACC_FINAL) == (other_flags & ZEND_ACC_FINAL)) /* equal final qualifier */
|
||||
&& ((fn_flags & ZEND_ACC_STATIC)== (other_flags & ZEND_ACC_STATIC)); /* equal static qualifier */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
{
|
||||
size_t current;
|
||||
size_t i;
|
||||
size_t count;
|
||||
HashTable* resulting_table;
|
||||
HashTable** function_tables;
|
||||
zend_class_entry *ce;
|
||||
size_t collision = 0;
|
||||
size_t abstract_solved = 0;
|
||||
zend_function* other_trait_fn;
|
||||
|
||||
current = va_arg(args, size_t); /* index of current trait */
|
||||
count = va_arg(args, size_t);
|
||||
resulting_table = va_arg(args, HashTable*);
|
||||
function_tables = va_arg(args, HashTable**);
|
||||
ce = va_arg(args, zend_class_entry*);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (i == current) {
|
||||
continue; /* just skip this, cause its the table this function is applied on */
|
||||
}
|
||||
|
||||
if (zend_hash_quick_find(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&other_trait_fn) == SUCCESS) {
|
||||
/* if it is an abstract method, there is no collision */
|
||||
if (other_trait_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure they are compatible */
|
||||
/* In case both are abstract, just check prototype, but need to do that in both directions */
|
||||
if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(other_trait_fn TSRMLS_CC));
|
||||
}
|
||||
|
||||
/* we can savely free and remove it from other table */
|
||||
zend_function_dtor(other_trait_fn);
|
||||
zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
} else {
|
||||
/* if it is not an abstract method, there is still no collision */
|
||||
/* if fn is an abstract method */
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure they are compatible.
|
||||
Here, we already know other_trait_fn cannot be abstract, full check ok. */
|
||||
if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(other_trait_fn TSRMLS_CC));
|
||||
}
|
||||
|
||||
/* just mark as solved, will be added if its own trait is processed */
|
||||
abstract_solved = 1;
|
||||
} else {
|
||||
/* but else, we have a collision of non-abstract methods */
|
||||
collision++;
|
||||
zend_function_dtor(other_trait_fn);
|
||||
zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (collision) {
|
||||
zend_function* class_fn;
|
||||
|
||||
/* make sure method is not already overridden in class */
|
||||
if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&class_fn) == FAILURE
|
||||
|| class_fn->common.scope != ce) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", fn->common.function_name, ce->name);
|
||||
}
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else if (abstract_solved) {
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
/* Add it to result function table */
|
||||
if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name);
|
||||
}
|
||||
}
|
||||
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
&& ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
|
||||
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
|
||||
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3766,66 +3682,84 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
static void zend_add_trait_method(zend_class_entry *ce, const char *name, const char *arKey, uint nKeyLength, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = va_arg(args, zend_class_entry*);
|
||||
zend_function* existing_fn = NULL;
|
||||
zend_function fn_copy, *fn_copy_p;
|
||||
zend_function* prototype = NULL; /* is used to determine the prototype according to the inheritance chain */
|
||||
zend_function *existing_fn = NULL;
|
||||
ulong h = zend_hash_func(arKey, nKeyLength);
|
||||
|
||||
if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &existing_fn) == FAILURE ||
|
||||
existing_fn->common.scope != ce) {
|
||||
/* not found or inherited from other class or interface */
|
||||
zend_function* parent_function;
|
||||
|
||||
if (ce->parent && zend_hash_quick_find(&ce->parent->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &parent_function) != FAILURE) {
|
||||
prototype = parent_function; /* ->common.fn_flags |= ZEND_ACC_ABSTRACT; */
|
||||
|
||||
/* we got that method in the parent class, and are going to override it,
|
||||
except, if the trait is just asking to have an abstract method implemented. */
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* then we clean up an skip this method */
|
||||
zend_function_dtor(fn);
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
if (zend_hash_quick_find(&ce->function_table, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) {
|
||||
if (existing_fn->common.scope == ce) {
|
||||
/* members from the current class override trait methods */
|
||||
/* use temporary *overriden HashTable to detect hidden conflict */
|
||||
if (*overriden) {
|
||||
if (zend_hash_quick_find(*overriden, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) {
|
||||
if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the trait method is compatible with previosly declared abstract method */
|
||||
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the abstract declaration is compatible with previous declaration */
|
||||
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ALLOC_HASHTABLE(*overriden);
|
||||
zend_hash_init_ex(*overriden, 2, NULL, NULL, 0, 0);
|
||||
}
|
||||
zend_hash_quick_update(*overriden, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
|
||||
return;
|
||||
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the trait method is compatible with previosly declared abstract method */
|
||||
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the abstract declaration is compatible with previous declaration */
|
||||
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
return;
|
||||
} else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
/* two trais can't define the same non-abstract method */
|
||||
#if 1
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
|
||||
name, ce->name);
|
||||
#else /* TODO: better errot message */
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
|
||||
fn->common.scope->name, fn->common.function_name,
|
||||
ce->name, name,
|
||||
existing_fn->common.scope->name, existing_fn->common.function_name);
|
||||
#endif
|
||||
} else {
|
||||
/* inherited members are overridden by members inserted by traits */
|
||||
/* check whether the trait method fulfills the inheritance requirements */
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
function_add_ref(fn);
|
||||
zend_hash_quick_update(&ce->function_table, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
|
||||
zend_add_magic_methods(ce, arKey, nKeyLength, fn TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
|
||||
fn->common.scope = ce;
|
||||
fn->common.prototype = prototype;
|
||||
|
||||
if (prototype
|
||||
&& (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT
|
||||
|| prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
fn->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT) {
|
||||
/* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */
|
||||
fn->common.fn_flags = fn->common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
}
|
||||
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
if (prototype) {
|
||||
do_inheritance_check_on_method(fn, prototype TSRMLS_CC);
|
||||
}
|
||||
|
||||
/* one more thing: make sure we properly implement an abstract method */
|
||||
if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
prototype = fn->common.prototype;
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
fn->common.prototype = prototype;
|
||||
}
|
||||
|
||||
/* delete inherited fn if the function to be added is not abstract */
|
||||
if (existing_fn
|
||||
&& existing_fn->common.scope != ce
|
||||
&& (fn->common.fn_flags & ZEND_ACC_ABSTRACT) == 0) {
|
||||
/* it is just a reference which was added to the subclass while doing
|
||||
the inheritance, so we can deleted now, and will add the overriding
|
||||
method afterwards.
|
||||
Except, if we try to add an abstract function, then we should not
|
||||
delete the inherited one */
|
||||
zend_hash_quick_del(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
}
|
||||
|
||||
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
||||
@@ -3833,130 +3767,109 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
if (fn->op_array.static_variables) {
|
||||
ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
|
||||
}
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
|
||||
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
|
||||
}
|
||||
|
||||
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
zend_function_dtor(fn);
|
||||
}
|
||||
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
{
|
||||
HashTable* target;
|
||||
zend_trait_alias** aliases;
|
||||
HashTable* exclude_table;
|
||||
char* lcname;
|
||||
unsigned int fnname_len;
|
||||
zend_function fn_copy;
|
||||
void* dummy;
|
||||
size_t i = 0;
|
||||
zend_class_entry *ce;
|
||||
HashTable **overriden;
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
HashTable *exclude_table;
|
||||
char *lcname;
|
||||
unsigned int fnname_len;
|
||||
zend_function fn_copy;
|
||||
void *dummy;
|
||||
|
||||
target = va_arg(args, HashTable*);
|
||||
aliases = va_arg(args, zend_trait_alias**);
|
||||
ce = va_arg(args, zend_class_entry*);
|
||||
overriden = va_arg(args, HashTable**);
|
||||
exclude_table = va_arg(args, HashTable*);
|
||||
|
||||
fnname_len = strlen(fn->common.function_name);
|
||||
|
||||
fnname_len = hash_key->nKeyLength - 1;
|
||||
|
||||
/* apply aliases which are qualified with a class name, there should not be any ambiguity */
|
||||
if (aliases) {
|
||||
while (aliases[i]) {
|
||||
if (ce->trait_aliases) {
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
/* Scope unset or equal to the function we compare to, and the alias applies to fn */
|
||||
if (aliases[i]->alias != NULL
|
||||
&& (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce)
|
||||
&& aliases[i]->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
if (alias->alias != NULL
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& alias->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
/* this function_name is never destroyed, because ZEND_ACC_ALIAS
|
||||
flag is set */
|
||||
fn_copy.common.function_name = aliases[i]->alias;
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
if (aliases[i]->modifiers) {
|
||||
fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS;
|
||||
if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) {
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC;
|
||||
}
|
||||
fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK);
|
||||
if (alias->modifiers) {
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
}
|
||||
|
||||
lcname = zend_str_tolower_dup(aliases[i]->alias, aliases[i]->alias_len);
|
||||
|
||||
if (zend_hash_add(target, lcname, aliases[i]->alias_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Failed to add aliased trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name);
|
||||
}
|
||||
lcname = zend_str_tolower_dup(alias->alias, alias->alias_len);
|
||||
zend_add_trait_method(ce, alias->alias, lcname, alias->alias_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
efree(lcname);
|
||||
|
||||
/** Record the trait from which this alias was resolved. */
|
||||
if (!aliases[i]->trait_method->ce) {
|
||||
aliases[i]->trait_method->ce = fn->common.scope;
|
||||
/* Record the trait from which this alias was resolved. */
|
||||
if (!alias->trait_method->ce) {
|
||||
alias->trait_method->ce = fn->common.scope;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len);
|
||||
lcname = hash_key->arKey;
|
||||
|
||||
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* apply aliases which are not qualified by a class name, or which have not
|
||||
* alias name, just setting visibility */
|
||||
if (aliases) {
|
||||
i = 0;
|
||||
while (aliases[i]) {
|
||||
/* apply aliases which have not alias name, just setting visibility */
|
||||
if (ce->trait_aliases) {
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
/* Scope unset or equal to the function we compare to, and the alias applies to fn */
|
||||
if (aliases[i]->alias == NULL && aliases[i]->modifiers != 0
|
||||
&& (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce)
|
||||
&& (aliases[i]->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS;
|
||||
if (alias->alias == NULL && alias->modifiers != 0
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& (alias->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) {
|
||||
|
||||
if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) {
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC;
|
||||
}
|
||||
fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK);
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
|
||||
/** Record the trait from which this alias was resolved. */
|
||||
if (!aliases[i]->trait_method->ce) {
|
||||
aliases[i]->trait_method->ce = fn->common.scope;
|
||||
if (!alias->trait_method->ce) {
|
||||
alias->trait_method->ce = fn->common.scope;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (zend_hash_add(target, lcname, fnname_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Failed to add trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name);
|
||||
}
|
||||
zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Copies function table entries to target function table with applied aliasing */
|
||||
static void zend_traits_copy_trait_function_table(HashTable *target, HashTable *source, zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) /* {{{ */
|
||||
static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_hash_apply_with_arguments(source TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, target, aliases, exclude_table);
|
||||
zend_uint i;
|
||||
|
||||
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
|
||||
}
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->traits[i] == trait) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3979,6 +3892,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
|
||||
|
||||
/** Ensure that the prefered method is actually available. */
|
||||
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
|
||||
@@ -3997,7 +3911,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
/** With the other traits, we are more permissive.
|
||||
We do not give errors for those. This allows to be more
|
||||
defensive in such definitions.
|
||||
However, we want to make sure that the insteadof declartion
|
||||
However, we want to make sure that the insteadof declaration
|
||||
is consistent in itself.
|
||||
*/
|
||||
j = 0;
|
||||
@@ -4007,8 +3921,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
|
||||
if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name);
|
||||
}
|
||||
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC);
|
||||
|
||||
/* make sure that the trait method is not from a class mentioned in
|
||||
exclude_from_classes, for consistency */
|
||||
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) {
|
||||
@@ -4037,6 +3952,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
|
||||
|
||||
/** And, ensure that the referenced method is resolvable, too. */
|
||||
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
|
||||
@@ -4086,70 +4002,45 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra
|
||||
|
||||
static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
HashTable** function_tables;
|
||||
HashTable* resulting_table;
|
||||
HashTable exclude_table;
|
||||
size_t i;
|
||||
zend_uint i;
|
||||
HashTable *overriden = NULL;
|
||||
|
||||
/* prepare copies of trait function tables for combination */
|
||||
function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
|
||||
resulting_table = (HashTable *)emalloc(sizeof(HashTable));
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
|
||||
|
||||
if (ce->trait_precedences) {
|
||||
HashTable exclude_table;
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0);
|
||||
|
||||
zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
|
||||
|
||||
/* copies functions, applies defined aliasing, and excludes unused trait methods */
|
||||
zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, &exclude_table TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table);
|
||||
|
||||
zend_hash_destroy(&exclude_table);
|
||||
} else {
|
||||
zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, NULL TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* now merge trait methods */
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
zend_hash_apply_with_arguments(function_tables[i] TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions, 5, i, ce->num_traits, resulting_table, function_tables, ce);
|
||||
}
|
||||
|
||||
/* Now the resulting_table contains all trait methods we would have to
|
||||
* add to the class in the following step the methods are inserted into the method table
|
||||
* if there is already a method with the same name it is replaced iff ce != fn.scope
|
||||
* --> all inherited methods are overridden, methods defined in the class are left untouched
|
||||
*/
|
||||
zend_hash_apply_with_arguments(resulting_table TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions_to_class, 1, ce);
|
||||
|
||||
/* free temporary function tables */
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
/* zend_hash_destroy(function_tables[i]); */
|
||||
zend_hash_graceful_destroy(function_tables[i]);
|
||||
efree(function_tables[i]);
|
||||
}
|
||||
efree(function_tables);
|
||||
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC);
|
||||
|
||||
/* free temporary resulting table */
|
||||
/* zend_hash_destroy(resulting_table); */
|
||||
zend_hash_graceful_destroy(resulting_table);
|
||||
efree(resulting_table);
|
||||
if (overriden) {
|
||||
zend_hash_destroy(overriden);
|
||||
FREE_HASHTABLE(overriden);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, const char* prop_name, int prop_name_length, ulong prop_hash, zend_class_entry *coliding_ce) /* {{{ */
|
||||
{
|
||||
size_t i;
|
||||
zend_property_info *coliding_prop;
|
||||
for (i = 0; (i < current_trait) && (i < ce->num_traits); i++) {
|
||||
if (zend_hash_quick_find(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) {
|
||||
return ce->traits[i];
|
||||
|
||||
if (coliding_ce == ce) {
|
||||
for (i = 0; i < current_trait; i++) {
|
||||
if (zend_hash_quick_exists(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash)) {
|
||||
return ce->traits[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4157,54 +4048,6 @@ static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t curr
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_traits_register_private_property(zend_class_entry *ce, const char *name, int name_len, zend_property_info *old_info, zval *property TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *priv_name;
|
||||
int priv_name_length;
|
||||
const char *interned_name;
|
||||
zend_property_info property_info;
|
||||
ulong h = zend_get_hash_value(name, name_len+1);
|
||||
property_info = *old_info;
|
||||
|
||||
if (old_info->flags & ZEND_ACC_STATIC) {
|
||||
property_info.offset = ce->default_static_members_count++;
|
||||
ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval*) * ce->default_static_members_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_static_members_table[property_info.offset] = property;
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
ce->static_members_table = ce->default_static_members_table;
|
||||
}
|
||||
} else {
|
||||
property_info.offset = ce->default_properties_count++;
|
||||
ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval*) * ce->default_properties_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_properties_table[property_info.offset] = property;
|
||||
}
|
||||
|
||||
zend_mangle_property_name(&priv_name, &priv_name_length, ce->name, ce->name_length, name, name_len, ce->type & ZEND_INTERNAL_CLASS);
|
||||
property_info.name = priv_name;
|
||||
property_info.name_length = priv_name_length;
|
||||
|
||||
interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC);
|
||||
if (interned_name != property_info.name) {
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
efree((char*)property_info.name);
|
||||
} else {
|
||||
free((char*)property_info.name);
|
||||
}
|
||||
property_info.name = interned_name;
|
||||
}
|
||||
|
||||
property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1);
|
||||
|
||||
property_info.ce = ce;
|
||||
|
||||
if (property_info.doc_comment) {
|
||||
property_info.doc_comment = estrndup(property_info.doc_comment, property_info.doc_comment_len);
|
||||
}
|
||||
|
||||
zend_hash_quick_update(&ce->properties_info, name, name_len+1, h, &property_info, sizeof(zend_property_info), NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t i;
|
||||
@@ -4218,7 +4061,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
zend_bool not_compatible;
|
||||
zval* prop_value;
|
||||
char* doc_comment;
|
||||
|
||||
zend_uint flags;
|
||||
|
||||
/* In the following steps the properties are inserted into the property table
|
||||
* for that, a very strict approach is applied:
|
||||
* - check for compatibility, if not compatible with any property in class -> fatal
|
||||
@@ -4231,7 +4075,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
/* first get the unmangeld name if necessary,
|
||||
* then check whether the property is already there
|
||||
*/
|
||||
if ((property_info->flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
|
||||
flags = property_info->flags;
|
||||
if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
|
||||
prop_hash = property_info->h;
|
||||
prop_name = property_info->name;
|
||||
prop_name_length = property_info->name_length;
|
||||
@@ -4245,61 +4090,50 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
|
||||
/* next: check for conflicts with current class */
|
||||
if (zend_hash_quick_find(&ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
/* this one is inherited, lets look it up in its own class */
|
||||
zend_hash_quick_find(&coliding_prop->ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop);
|
||||
if (coliding_prop->flags & ZEND_ACC_PRIVATE) {
|
||||
/* private property, make the property_info.offset indenpended */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
prop_value = ce->traits[i]->default_static_members_table[property_info->offset];
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
zend_hash_quick_del(&ce->properties_info, prop_name, prop_name_length+1, prop_hash);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
prop_value = ce->traits[i]->default_properties_table[property_info->offset];
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
}
|
||||
Z_ADDREF_P(prop_value);
|
||||
|
||||
zend_traits_register_private_property(ce, prop_name, prop_name_length, property_info, prop_value TSRMLS_CC);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (property_info->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
} else {
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* property not found, so lets add it */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
if (flags & ZEND_ACC_STATIC) {
|
||||
prop_value = ce->traits[i]->default_static_members_table[property_info->offset];
|
||||
} else {
|
||||
prop_value = ce->traits[i]->default_properties_table[property_info->offset];
|
||||
@@ -4308,7 +4142,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
|
||||
doc_comment = property_info->doc_comment ? estrndup(property_info->doc_comment, property_info->doc_comment_len) : NULL;
|
||||
zend_declare_property_ex(ce, prop_name, prop_name_length,
|
||||
prop_value, property_info->flags,
|
||||
prop_value, flags,
|
||||
doc_comment, property_info->doc_comment_len TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -4432,20 +4266,6 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, Ha
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_add_to_list(&ce->trait_precedences, precedence_znode->u.op.ptr TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_add_trait_alias(znode *alias_znode TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_add_to_list(&ce->trait_aliases, alias_znode->u.op.ptr TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_trait_method_reference *method_ref = emalloc(sizeof(zend_trait_method_reference));
|
||||
@@ -4470,18 +4290,25 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */
|
||||
void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *trait_alias = emalloc(sizeof(zend_trait_alias));
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_trait_alias *trait_alias;
|
||||
|
||||
trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
trait_alias->modifiers = Z_LVAL(modifiers->u.constant);
|
||||
|
||||
if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'static' as method modifier");
|
||||
return;
|
||||
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_ABSTRACT) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier");
|
||||
return;
|
||||
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier");
|
||||
return;
|
||||
}
|
||||
|
||||
trait_alias = emalloc(sizeof(zend_trait_alias));
|
||||
trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
trait_alias->modifiers = Z_LVAL(modifiers->u.constant);
|
||||
if (alias) {
|
||||
trait_alias->alias = Z_STRVAL(alias->u.constant);
|
||||
trait_alias->alias_len = Z_STRLEN(alias->u.constant);
|
||||
@@ -4490,12 +4317,13 @@ void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *mod
|
||||
}
|
||||
trait_alias->function = NULL;
|
||||
|
||||
result->u.op.ptr = trait_alias;
|
||||
zend_add_to_list(&ce->trait_aliases, trait_alias TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */
|
||||
void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_trait_precedence *trait_precedence = emalloc(sizeof(zend_trait_precedence));
|
||||
|
||||
trait_precedence->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
@@ -4503,7 +4331,7 @@ void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode
|
||||
|
||||
trait_precedence->function = NULL;
|
||||
|
||||
result->u.op.ptr = trait_precedence;
|
||||
zend_add_to_list(&ce->trait_precedences, trait_precedence TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4538,7 +4366,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
|
||||
}
|
||||
return NULL;
|
||||
} else {
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES))) {
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
return ce;
|
||||
@@ -4970,10 +4798,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
|
||||
/* Prefix class name with name of current namespace */
|
||||
znode tmp;
|
||||
|
||||
tmp.op_type = IS_CONST;
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
|
||||
class_name = &tmp;
|
||||
*class_name = tmp;
|
||||
efree(lcname);
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
|
||||
}
|
||||
@@ -5106,9 +4935,9 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
|
||||
}
|
||||
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
&& (parent_token || (ce->num_interfaces > 0))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
if (ce->num_interfaces) {
|
||||
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
do_verify_abstract_class(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
@@ -5158,9 +4987,10 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_implements_trait(znode *trait_name TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"Cannot use traits inside of interfaces. %s is used in %s",
|
||||
@@ -5649,7 +5479,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
|
||||
break;
|
||||
}
|
||||
SET_NODE(opline->op1, cmd);
|
||||
opline->op2.opline_num = 0;
|
||||
opline->op2.opline_num = 1;
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
@@ -5890,7 +5720,11 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */
|
||||
void** list = *(void**)result;
|
||||
size_t n = 0;
|
||||
|
||||
while (list && list[n]) { n++; }
|
||||
if (list) {
|
||||
while (list[n]) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
list = erealloc(list, sizeof(void*) * (n+2));
|
||||
|
||||
@@ -7109,7 +6943,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
* Find the first occurence of : from the left
|
||||
* Find the first occurrence of : from the left
|
||||
* move the path pointer to the position just after :
|
||||
* increment the len_adjust to the length of path till colon character(inclusive)
|
||||
* If there is no character beyond : simple return len
|
||||
|
||||
+6
-11
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -207,8 +207,6 @@ typedef struct _zend_try_catch_element {
|
||||
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
|
||||
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
|
||||
|
||||
#define ZEND_ACC_ALIAS 0x10000000
|
||||
|
||||
char *zend_visibility_string(zend_uint fn_flags);
|
||||
|
||||
|
||||
@@ -509,16 +507,13 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
|
||||
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC);
|
||||
|
||||
/* Trait related functions */
|
||||
void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC);
|
||||
void zend_add_trait_alias(znode *alias_znode TSRMLS_DC);
|
||||
void zend_do_use_trait(znode *trait_znode TSRMLS_DC);
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC);
|
||||
void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC);
|
||||
|
||||
|
||||
void zend_do_implements_trait(znode *interface_znode /*, znode* aliases */ TSRMLS_DC);
|
||||
ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC);
|
||||
ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC);
|
||||
void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC);
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
|
||||
void zend_do_early_binding(TSRMLS_D);
|
||||
@@ -621,7 +616,7 @@ void zend_do_end_compilation(TSRMLS_D);
|
||||
void zend_do_label(znode *label TSRMLS_DC);
|
||||
void zend_do_goto(const znode *label TSRMLS_DC);
|
||||
void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
|
||||
void zend_release_labels(TSRMLS_D);
|
||||
void zend_release_labels(int temporary TSRMLS_DC);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+49
-17
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -350,9 +350,14 @@ ZEND_METHOD(error_exception, getSeverity)
|
||||
#define TRACE_APPEND_STR(val) \
|
||||
TRACE_APPEND_STRL(val, sizeof(val)-1)
|
||||
|
||||
#define TRACE_APPEND_KEY(key) \
|
||||
if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \
|
||||
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
|
||||
#define TRACE_APPEND_KEY(key) \
|
||||
if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \
|
||||
if (Z_TYPE_PP(tmp) != IS_STRING) { \
|
||||
zend_error(E_WARNING, "Value for %s is no string", key); \
|
||||
TRACE_APPEND_STR("[unknown]"); \
|
||||
} else { \
|
||||
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
@@ -461,6 +466,11 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
HashTable *ht = Z_ARRVAL_PP(frame);
|
||||
zval **file, **tmp;
|
||||
|
||||
if (Z_TYPE_PP(frame) != IS_ARRAY) {
|
||||
zend_error(E_WARNING, "Expected array for frame %lu", hash_key->h);
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
|
||||
str = va_arg(args, char**);
|
||||
len = va_arg(args, int*);
|
||||
num = va_arg(args, int*);
|
||||
@@ -470,15 +480,25 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) {
|
||||
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
|
||||
line = Z_LVAL_PP(tmp);
|
||||
} else {
|
||||
line = 0;
|
||||
if (Z_TYPE_PP(file) != IS_STRING) {
|
||||
zend_error(E_WARNING, "Function name is no string");
|
||||
TRACE_APPEND_STR("[unknown function]");
|
||||
} else{
|
||||
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
|
||||
if (Z_TYPE_PP(tmp) == IS_LONG) {
|
||||
line = Z_LVAL_PP(tmp);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Line is no long");
|
||||
line = 0;
|
||||
}
|
||||
} else {
|
||||
line = 0;
|
||||
}
|
||||
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
|
||||
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
}
|
||||
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
|
||||
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
} else {
|
||||
TRACE_APPEND_STR("[internal function]: ");
|
||||
}
|
||||
@@ -487,10 +507,14 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
TRACE_APPEND_KEY("function");
|
||||
TRACE_APPEND_CHR('(');
|
||||
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
||||
int last_len = *len;
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||
if (last_len != *len) {
|
||||
*len -= 2; /* remove last ', ' */
|
||||
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
|
||||
int last_len = *len;
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||
if (last_len != *len) {
|
||||
*len -= 2; /* remove last ', ' */
|
||||
}
|
||||
} else {
|
||||
zend_error(E_WARNING, "args element is no array");
|
||||
}
|
||||
}
|
||||
TRACE_APPEND_STR(")\n");
|
||||
@@ -793,6 +817,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
|
||||
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
convert_to_string(file);
|
||||
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
|
||||
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
|
||||
} else {
|
||||
file = NULL;
|
||||
line = NULL;
|
||||
@@ -804,7 +832,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
convert_to_string(str);
|
||||
convert_to_string(file);
|
||||
convert_to_long(line);
|
||||
|
||||
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
} else {
|
||||
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+5
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1145,6 +1145,10 @@ convert_to_array:
|
||||
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
|
||||
}
|
||||
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(dim) != IS_LONG) {
|
||||
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
@@ -1173,9 +1177,6 @@ convert_to_array:
|
||||
convert_to_long(&tmp);
|
||||
dim = &tmp;
|
||||
}
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
container = *container_ptr;
|
||||
result->str_offset.str = container;
|
||||
PZVAL_LOCK(container);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -254,15 +254,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
|
||||
if (EG(user_error_handler)) {
|
||||
zeh = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
zval_ptr_dtor(&zeh);
|
||||
}
|
||||
|
||||
if (EG(user_exception_handler)) {
|
||||
zeh = EG(user_exception_handler);
|
||||
EG(user_exception_handler) = NULL;
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
zval_ptr_dtor(&zeh);
|
||||
}
|
||||
|
||||
zend_stack_destroy(&EG(user_error_handlers_error_reporting));
|
||||
@@ -1313,7 +1311,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
opline++;
|
||||
}
|
||||
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(1 TSRMLS_CC);
|
||||
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+5
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -644,7 +644,8 @@ tail_call:
|
||||
struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj;
|
||||
|
||||
if (obj->buffered == (gc_root_buffer*)GC_WHITE) {
|
||||
GC_SET_BLACK(obj->buffered);
|
||||
/* PURPLE instead of BLACK to prevent buffering in nested gc calls */
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
|
||||
if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid &&
|
||||
(get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) {
|
||||
@@ -715,7 +716,8 @@ static void zobj_collect_white(zval *pz TSRMLS_DC)
|
||||
struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj;
|
||||
|
||||
if (obj->buffered == (gc_root_buffer*)GC_WHITE) {
|
||||
GC_SET_BLACK(obj->buffered);
|
||||
/* PURPLE instead of BLACK to prevent buffering in nested gc calls */
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
|
||||
if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid &&
|
||||
(get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) {
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
|
||||
gc_root_buffer *first_unused; /* pointer to first unused buffer */
|
||||
gc_root_buffer *last_unused; /* pointer to last unused buffer */
|
||||
|
||||
zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
|
||||
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
|
||||
zval_gc_info *free_list;
|
||||
zval_gc_info *next_to_free;
|
||||
|
||||
@@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
|
||||
GC_ZVAL_INIT(z); \
|
||||
} while (0)
|
||||
|
||||
/* The following macroses override macroses from zend_alloc.h */
|
||||
/* The following macros override macros from zend_alloc.h */
|
||||
#undef ALLOC_ZVAL
|
||||
#define ALLOC_ZVAL(z) \
|
||||
do { \
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
Loaded 100 of 1502 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user