mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-19 23:16:38 +00:00
Compare commits
914
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54ffe6a3b7 | ||
|
|
aa5f19cffb | ||
|
|
4fe74f14c4 | ||
|
|
cd74b7d57e | ||
|
|
4cb25d25f1 | ||
|
|
c53058763a | ||
|
|
c50cef1dc5 | ||
|
|
93469a1d15 | ||
|
|
d64e8dd7a4 | ||
|
|
73eedaf6f7 | ||
|
|
013797588a | ||
|
|
fc2a9d6e47 | ||
|
|
f5fcb591cc | ||
|
|
0776337e28 | ||
|
|
de4fd8638b | ||
|
|
d4ad889824 | ||
|
|
4f46a40b9d | ||
|
|
4840ff0f05 | ||
|
|
646ebc2cb9 | ||
|
|
4828f7343b | ||
|
|
378a5f9bfe | ||
|
|
ed9a9b6144 | ||
|
|
70abac2b4e | ||
|
|
c79f162c37 | ||
|
|
0e99329e0a | ||
|
|
a2d6d27458 | ||
|
|
77fffff157 | ||
|
|
49c1a223d5 | ||
|
|
1124b0678f | ||
|
|
ac0aa5737e | ||
|
|
fb58e69a84 | ||
|
|
0f02c3aa29 | ||
|
|
7c66c502d0 | ||
|
|
2d7415a4af | ||
|
|
2d5695cbc5 | ||
|
|
40d5458eff | ||
|
|
b142e8825f | ||
|
|
aff65a0346 | ||
|
|
46b05bc57a | ||
|
|
3eb1745643 | ||
|
|
d565e8f0eb | ||
|
|
8dec06ea2a | ||
|
|
07bd1fac57 | ||
|
|
fda25c7ea6 | ||
|
|
d82704b677 | ||
|
|
9accfee55f | ||
|
|
bfb50d17cb | ||
|
|
09470ebf35 | ||
|
|
139e9824ad | ||
|
|
082ee90b9b | ||
|
|
077b575d51 | ||
|
|
de82e7edf7 | ||
|
|
86db5fb4c2 | ||
|
|
42a186e22d | ||
|
|
7ec2e5314e | ||
|
|
ba1af29805 | ||
|
|
1f97fde89e | ||
|
|
9d2dda9058 | ||
|
|
75ee1a6113 | ||
|
|
1a46a102d9 | ||
|
|
8c36156070 | ||
|
|
ad210f2c10 | ||
|
|
2626819d65 | ||
|
|
933e01bbac | ||
|
|
74555e7c26 | ||
|
|
362402d748 | ||
|
|
f37c54ab27 | ||
|
|
533e636a62 | ||
|
|
e191cb63ba | ||
|
|
156576fcce | ||
|
|
fe21accfb4 | ||
|
|
e44849b0f4 | ||
|
|
3fd39c13f9 | ||
|
|
2d8ce75f39 | ||
|
|
89159926ad | ||
|
|
dd188e9538 | ||
|
|
d6505acbf5 | ||
|
|
95ea1e7ca7 | ||
|
|
b3f6cc20e0 | ||
|
|
699dc04c55 | ||
|
|
98302ee3cc | ||
|
|
8687332e08 | ||
|
|
7b09e5fe35 | ||
|
|
4091e94660 | ||
|
|
288f04c430 | ||
|
|
e30dbcce77 | ||
|
|
9ef017af00 | ||
|
|
898ddcb9e1 | ||
|
|
1cc2162b83 | ||
|
|
36eee5b994 | ||
|
|
5b121eb04d | ||
|
|
de7415ea55 | ||
|
|
96a575123d | ||
|
|
9480de29db | ||
|
|
4cea61a0fa | ||
|
|
0cae9a15d7 | ||
|
|
9a48b6506c | ||
|
|
54d6f8b34e | ||
|
|
2ab270011d | ||
|
|
d981c191d4 | ||
|
|
00b097d2a3 | ||
|
|
2a2ac5f2be | ||
|
|
e6704501f8 | ||
|
|
5e9c6c3b64 | ||
|
|
8a90aad35b | ||
|
|
2fc17d83cb | ||
|
|
8a07908215 | ||
|
|
6aedadce0a | ||
|
|
9155d17fef | ||
|
|
b2ef8672c7 | ||
|
|
ec4388158d | ||
|
|
f1e5127e7a | ||
|
|
5c701d19ac | ||
|
|
67d83de11c | ||
|
|
8c3b8f39aa | ||
|
|
eff60f993c | ||
|
|
c34274acb8 | ||
|
|
3a413f216a | ||
|
|
f1269d80c5 | ||
|
|
1c8befe893 | ||
|
|
74ef9b6cea | ||
|
|
f7830e4f98 | ||
|
|
6d41711fd9 | ||
|
|
b1c24d1eac | ||
|
|
aa4762572e | ||
|
|
b1ea0b7a7a | ||
|
|
2c336c9cde | ||
|
|
c68f9d5503 | ||
|
|
e36adfe94a | ||
|
|
cbe2870b72 | ||
|
|
1ce836580d | ||
|
|
a39282b64d | ||
|
|
3828f6227b | ||
|
|
5f67584fd7 | ||
|
|
5af2c5d202 | ||
|
|
aa448adc83 | ||
|
|
432b09f238 | ||
|
|
3011208f1a | ||
|
|
9996c310d1 | ||
|
|
f087c53130 | ||
|
|
4a34d4a83c | ||
|
|
c9085837a9 | ||
|
|
3fd4b6be63 | ||
|
|
0549e55d82 | ||
|
|
6494faa844 | ||
|
|
b7b150b830 | ||
|
|
444e59eb20 | ||
|
|
a3e177b9fd | ||
|
|
08b72ac9f1 | ||
|
|
331540d20c | ||
|
|
eb53035a80 | ||
|
|
c374b80dda | ||
|
|
d0c40220d1 | ||
|
|
2f12769db0 | ||
|
|
78c48af2f2 | ||
|
|
8492bbefbb | ||
|
|
a7d6cb2360 | ||
|
|
d42ae32738 | ||
|
|
be3f7ba4fb | ||
|
|
ab117573cd | ||
|
|
e3aeb6c070 | ||
|
|
3f2f534a5c | ||
|
|
1656b337ce | ||
|
|
865cc3a800 | ||
|
|
514afd67b6 | ||
|
|
062519ed41 | ||
|
|
36b968ae96 | ||
|
|
fbff4ccf27 | ||
|
|
4a92ae3401 | ||
|
|
13de57c0f4 | ||
|
|
c782cf7fb3 | ||
|
|
83682d8833 | ||
|
|
1a335d20a8 | ||
|
|
4b83f4a011 | ||
|
|
a5b4eeb5f0 | ||
|
|
8a51bdd3ce | ||
|
|
4e773c1b92 | ||
|
|
86685aefab | ||
|
|
9877773438 | ||
|
|
25c9f34c9c | ||
|
|
e60638faca | ||
|
|
7b9eabaf51 | ||
|
|
15b554cd9b | ||
|
|
a56a95e58d | ||
|
|
1c07590ed7 | ||
|
|
8f5a534b21 | ||
|
|
d54432ed98 | ||
|
|
c7b8368ed5 | ||
|
|
ca148c030f | ||
|
|
e9b03c412b | ||
|
|
d72307f1ca | ||
|
|
cdc1a63790 | ||
|
|
cf5d7d9e73 | ||
|
|
b86c85723e | ||
|
|
3411fbbc51 | ||
|
|
bc50ba4bf9 | ||
|
|
75cec90d8c | ||
|
|
2809afa119 | ||
|
|
7bd20354a8 | ||
|
|
b0afef2d5e | ||
|
|
685a6d9aab | ||
|
|
7b06189702 | ||
|
|
3fffc78ed0 | ||
|
|
b5902b6c9d | ||
|
|
afe46d4d47 | ||
|
|
4941e3fe44 | ||
|
|
30802dbc55 | ||
|
|
7d0dd957eb | ||
|
|
5adf1be45d | ||
|
|
bf5506f511 | ||
|
|
6251706ea6 | ||
|
|
239ba8d58b | ||
|
|
63434524f8 | ||
|
|
671ef9fda7 | ||
|
|
4a52fe4755 | ||
|
|
51e3fabf10 | ||
|
|
e04baf692a | ||
|
|
182fef46a9 | ||
|
|
f42a257711 | ||
|
|
cf9db2154e | ||
|
|
a58a279d7b | ||
|
|
26bd2cba81 | ||
|
|
3a8ceed844 | ||
|
|
dd0399f5c6 | ||
|
|
7189cc5be8 | ||
|
|
eb4065b9e1 | ||
|
|
aa4b0af20f | ||
|
|
8d41f6dab6 | ||
|
|
ee65e6953f | ||
|
|
78c79a2d5b | ||
|
|
920c7ac16e | ||
|
|
84e5c8a0e2 | ||
|
|
1363626f11 | ||
|
|
5e24a6e74d | ||
|
|
2a15aed399 | ||
|
|
f87d2ab893 | ||
|
|
18fdab5a09 | ||
|
|
b79e65f268 | ||
|
|
758b666c0a | ||
|
|
43ab915b41 | ||
|
|
4cf0647399 | ||
|
|
2005a15caa | ||
|
|
9819d81ddf | ||
|
|
eb50789910 | ||
|
|
734e165d4e | ||
|
|
1a03bd5dee | ||
|
|
f63db963c4 | ||
|
|
b3aa3c2616 | ||
|
|
8febe2ad08 | ||
|
|
f082d6311b | ||
|
|
0b2c411323 | ||
|
|
70b67f2e50 | ||
|
|
7b34324f84 | ||
|
|
b119836765 | ||
|
|
f578bb0388 | ||
|
|
0720804e7c | ||
|
|
ec1678dd7c | ||
|
|
6889a0d1f5 | ||
|
|
13b039ff9a | ||
|
|
b02241b968 | ||
|
|
32490673b9 | ||
|
|
6b1928ba0b | ||
|
|
92bbe6be72 | ||
|
|
3cc81d151d | ||
|
|
14d9f3450b | ||
|
|
63d3ef4df0 | ||
|
|
6ed16753c1 | ||
|
|
c7cf9b68b6 | ||
|
|
7b7424c34c | ||
|
|
39cc08c7e9 | ||
|
|
0802961bd1 | ||
|
|
0704e4badb | ||
|
|
5a897009a8 | ||
|
|
2d9cbf720d | ||
|
|
c76cdb8067 | ||
|
|
ca425a67c4 | ||
|
|
ecf76e2da8 | ||
|
|
fb955a613c | ||
|
|
4fbe1173eb | ||
|
|
323fdb9879 | ||
|
|
a9271a8b0d | ||
|
|
e694d40963 | ||
|
|
adc17bff57 | ||
|
|
a5cfe57e08 | ||
|
|
ba292b037f | ||
|
|
e71b794569 | ||
|
|
6df1e8d3fe | ||
|
|
4475dbf11d | ||
|
|
684f4d5272 | ||
|
|
88e14d01bf | ||
|
|
193e1865ad | ||
|
|
7133eee5f2 | ||
|
|
b6d54faa92 | ||
|
|
56b028e590 | ||
|
|
fc658f442d | ||
|
|
0655ab7c26 | ||
|
|
782085bbfb | ||
|
|
ceb5b684e0 | ||
|
|
968ae4a56a | ||
|
|
6ea7e6da8b | ||
|
|
87f5d9aa1b | ||
|
|
c480bf3fb2 | ||
|
|
224a67fb9f | ||
|
|
af967de2af | ||
|
|
e27039630a | ||
|
|
2b3a4afcbf | ||
|
|
7845f49006 | ||
|
|
2e3e87029f | ||
|
|
442ff25187 | ||
|
|
146d786137 | ||
|
|
ecdf8bcc45 | ||
|
|
70668fd88a | ||
|
|
1c498e6e94 | ||
|
|
6426a002e7 | ||
|
|
2b28f29e53 | ||
|
|
e13d2c7c7f | ||
|
|
24f1045d55 | ||
|
|
aab5659357 | ||
|
|
88b3cdc4e9 | ||
|
|
1359eaa057 | ||
|
|
4d6c367177 | ||
|
|
10d62de4aa | ||
|
|
4d4adf47e0 | ||
|
|
4bf1f3801b | ||
|
|
4cf00c08bd | ||
|
|
d9c9e78369 | ||
|
|
83500123d0 | ||
|
|
ec136c219e | ||
|
|
85ad65ef40 | ||
|
|
a9f9ff68a2 | ||
|
|
a35d386612 | ||
|
|
b810878e7d | ||
|
|
9de5dcad1c | ||
|
|
a1f66c0b50 | ||
|
|
f3ca1155d6 | ||
|
|
9f0bfed435 | ||
|
|
28e26b0fad | ||
|
|
30fc3ac6aa | ||
|
|
b0b81c0a37 | ||
|
|
ee0df8c40a | ||
|
|
b12f79cafb | ||
|
|
10367fa7c6 | ||
|
|
e769025791 | ||
|
|
5ac8084e5f | ||
|
|
39bc1bd25f | ||
|
|
5c4d9123fa | ||
|
|
ce88a81111 | ||
|
|
f4d27a1557 | ||
|
|
1bcaf771dc | ||
|
|
c3a57fff5e | ||
|
|
569eddce0f | ||
|
|
1b60c189ad | ||
|
|
9587cf385e | ||
|
|
01ca2bf8c3 | ||
|
|
185e5e15ae | ||
|
|
aac43c9ee8 | ||
|
|
4f2acd8cde | ||
|
|
4d66b3b589 | ||
|
|
5f969c1d46 | ||
|
|
846d298f9b | ||
|
|
9883d8d3e5 | ||
|
|
934dfae4e1 | ||
|
|
34c5b80595 | ||
|
|
65e368debd | ||
|
|
82ac3106e0 | ||
|
|
f4f8b5a94b | ||
|
|
c96a5bc6be | ||
|
|
db3d629f05 | ||
|
|
7fc8077e4c | ||
|
|
1f34ccbe34 | ||
|
|
42f94aa978 | ||
|
|
bbb4a44f98 | ||
|
|
99ad08f9a5 | ||
|
|
e8d80b770b | ||
|
|
f5f3ab1b3f | ||
|
|
0495061a8f | ||
|
|
e34767d426 | ||
|
|
bb70176328 | ||
|
|
6ace9c646b | ||
|
|
78a9489f6a | ||
|
|
37b20a1bc2 | ||
|
|
d7f709a032 | ||
|
|
688f5fc889 | ||
|
|
c51e32860a | ||
|
|
44dbe6a815 | ||
|
|
731a5c5104 | ||
|
|
ce89bc8743 | ||
|
|
8e8a75444c | ||
|
|
6b4148bc97 | ||
|
|
23b44e7f39 | ||
|
|
d8a5f41a60 | ||
|
|
3b504a3717 | ||
|
|
7b07d05917 | ||
|
|
9456dac54e | ||
|
|
74f158fb9d | ||
|
|
586dc07a8a | ||
|
|
ad7c0b1928 | ||
|
|
72426a446d | ||
|
|
2f6b9b970c | ||
|
|
503760c913 | ||
|
|
b07ecb5501 | ||
|
|
84208d9dc5 | ||
|
|
58a8013e5f | ||
|
|
a4ca01cc2b | ||
|
|
a1ebd82a29 | ||
|
|
30d0ae42b5 | ||
|
|
5dd73b9e54 | ||
|
|
68a7fec7af | ||
|
|
61fff1fd8b | ||
|
|
1d4fcdff9f | ||
|
|
bed44e562e | ||
|
|
953f07503a | ||
|
|
b2a760fe45 | ||
|
|
00d961cf6a | ||
|
|
5bf6323e51 | ||
|
|
8aff7f0528 | ||
|
|
8345abcabb | ||
|
|
aa791a4d72 | ||
|
|
ac0b66f160 | ||
|
|
0e25e00ecf | ||
|
|
a5e606a2ba | ||
|
|
15994a14a4 | ||
|
|
92aa361bfc | ||
|
|
bbe9052ca3 | ||
|
|
fecce5a55f | ||
|
|
dcf0b71c98 | ||
|
|
b1a6a17039 | ||
|
|
127c78cb76 | ||
|
|
ef93a93ee2 | ||
|
|
e6ef89861e | ||
|
|
242d88c20c | ||
|
|
46ee57f2d7 | ||
|
|
f4daaf9250 | ||
|
|
124a867b6a | ||
|
|
86d301b232 | ||
|
|
3ae5c55596 | ||
|
|
037ea6f360 | ||
|
|
201128d39c | ||
|
|
640e72ce91 | ||
|
|
031553cd01 | ||
|
|
7dd661d0cd | ||
|
|
ab089611e0 | ||
|
|
ae71c1d9aa | ||
|
|
55341ac0a8 | ||
|
|
467cd6a60f | ||
|
|
5d535a007d | ||
|
|
f982aaafa7 | ||
|
|
210d43d7a2 | ||
|
|
25b3c94944 | ||
|
|
05016b7e96 | ||
|
|
6e8aa09696 | ||
|
|
85e5e60777 | ||
|
|
391a41e167 | ||
|
|
1556d5df8a | ||
|
|
f92a15864b | ||
|
|
ef6cdb85d9 | ||
|
|
2185746feb | ||
|
|
91ab11ed07 | ||
|
|
fc7efecda0 | ||
|
|
26f3ff25fe | ||
|
|
f139534694 | ||
|
|
e7d88a63fa | ||
|
|
f01a7e54d3 | ||
|
|
d0aa831614 | ||
|
|
f3ebb40ad6 | ||
|
|
4d73bb070e | ||
|
|
5ae6f582fb | ||
|
|
ed31582301 | ||
|
|
0496ad31ac | ||
|
|
1182a3356c | ||
|
|
62ec3893d2 | ||
|
|
5e9377ebd5 | ||
|
|
975d26667b | ||
|
|
c6e911e154 | ||
|
|
0171bcb9fa | ||
|
|
65afa3c044 | ||
|
|
96e5f5eb05 | ||
|
|
e9f996c00d | ||
|
|
878bef2a1d | ||
|
|
1c662dc303 | ||
|
|
c4686b4de9 | ||
|
|
6a7088fd18 | ||
|
|
f17156c2d1 | ||
|
|
0a00d29256 | ||
|
|
64b029af0d | ||
|
|
987dee9ca1 | ||
|
|
a3316ffe6a | ||
|
|
c20e4bbc96 | ||
|
|
016fbd9991 | ||
|
|
385d0e52cc | ||
|
|
504ef64c7b | ||
|
|
7c0bdb9a4f | ||
|
|
4394249881 | ||
|
|
1b34ab8ff8 | ||
|
|
c342c9b964 | ||
|
|
c08e1d2be9 | ||
|
|
d900382814 | ||
|
|
6f560b0487 | ||
|
|
de71f435d8 | ||
|
|
66682f5abe | ||
|
|
4633e07e29 | ||
|
|
be3e2bb295 | ||
|
|
585f71f497 | ||
|
|
ec7250fb64 | ||
|
|
aa2b54812f | ||
|
|
0179284bfb | ||
|
|
bb18fa448c | ||
|
|
ec26141f92 | ||
|
|
3af4896837 | ||
|
|
2b62226188 | ||
|
|
430c987716 | ||
|
|
c2893ab592 | ||
|
|
ec25e99193 | ||
|
|
04b492a5fe | ||
|
|
638c4b89b7 | ||
|
|
01583bdc36 | ||
|
|
9a56dce83f | ||
|
|
bda5c0b082 | ||
|
|
0cb868c042 | ||
|
|
2e00f7611c | ||
|
|
3654ff7366 | ||
|
|
b022e54bd1 | ||
|
|
defb08c705 | ||
|
|
6af1b08482 | ||
|
|
fd2b8df265 | ||
|
|
293d5defb4 | ||
|
|
534aec8a52 | ||
|
|
39a173b79b | ||
|
|
9d31c0de0c | ||
|
|
79925094c4 | ||
|
|
7dce0194c8 | ||
|
|
f2383dead6 | ||
|
|
08624ea90d | ||
|
|
b29a9fa75d | ||
|
|
0fd3572f4e | ||
|
|
da6916a770 | ||
|
|
6f17c6242f | ||
|
|
2258350450 | ||
|
|
7f2424bb1d | ||
|
|
52171aeaf4 | ||
|
|
66b4e5cdec | ||
|
|
0173c4bab0 | ||
|
|
1ec484d3c5 | ||
|
|
780c6e0a9c | ||
|
|
a46065ef71 | ||
|
|
bf8026aacf | ||
|
|
0125ec77d2 | ||
|
|
0881ff0466 | ||
|
|
06a526be3e | ||
|
|
bb935ff8dc | ||
|
|
a7a53d369b | ||
|
|
00a53ca817 | ||
|
|
22159fb7b7 | ||
|
|
5aaff8d634 | ||
|
|
f5bf1ba88f | ||
|
|
cb76420fe0 | ||
|
|
cfd096fd7c | ||
|
|
8d199c7c4f | ||
|
|
5e55c6d9fd | ||
|
|
60b36a6819 | ||
|
|
25b84546a8 | ||
|
|
b3d82845db | ||
|
|
c542e969f2 | ||
|
|
c6f6bf88d8 | ||
|
|
ce04268bb9 | ||
|
|
4257469079 | ||
|
|
6f0f5d5281 | ||
|
|
7687b8b81c | ||
|
|
4837bdb910 | ||
|
|
7b0993bfb4 | ||
|
|
960d5be528 | ||
|
|
984561cfa8 | ||
|
|
74e11fb14c | ||
|
|
84630a1109 | ||
|
|
4a6291508d | ||
|
|
ef8c8eaa95 | ||
|
|
e62bb03257 | ||
|
|
f621f0b8e7 | ||
|
|
a62ffb72f4 | ||
|
|
840c0d6091 | ||
|
|
5b0879e7c9 | ||
|
|
a9684532eb | ||
|
|
1fe43d0798 | ||
|
|
260007a303 | ||
|
|
e25b2d7ea5 | ||
|
|
87c8ea15f2 | ||
|
|
b893326e0d | ||
|
|
db4d473d53 | ||
|
|
ccf7d7cc93 | ||
|
|
fe384b3444 | ||
|
|
c5ba47ac59 | ||
|
|
85d9d85ce2 | ||
|
|
44197774c0 | ||
|
|
5d0826e9c3 | ||
|
|
b32405053f | ||
|
|
dcc927d3f2 | ||
|
|
e66c8681c7 | ||
|
|
0b8b6a727d | ||
|
|
930b272d70 | ||
|
|
07b1eaa609 | ||
|
|
fa3fc711d3 | ||
|
|
b46897941a | ||
|
|
5de1b08482 | ||
|
|
62364e6e01 | ||
|
|
c1cf7538f0 | ||
|
|
acd160530a | ||
|
|
e00b04a54f | ||
|
|
e9641141aa | ||
|
|
92430bcf5d | ||
|
|
ac05e68f55 | ||
|
|
9ef01ce698 | ||
|
|
34d3202eda | ||
|
|
f8b91d9acf | ||
|
|
b1dbfb7357 | ||
|
|
73c38eca5a | ||
|
|
f058942923 | ||
|
|
90c8f16c3b | ||
|
|
b903d2d6cd | ||
|
|
8d35170c5f | ||
|
|
0ee71557ff | ||
|
|
b7788c52f1 | ||
|
|
c765c81cf6 | ||
|
|
cc51729c00 | ||
|
|
30eff1a697 | ||
|
|
9350f45aca | ||
|
|
be020633f2 | ||
|
|
0ab356c8e5 | ||
|
|
61ac64b372 | ||
|
|
96388c78c9 | ||
|
|
5df8cf1975 | ||
|
|
e43c5a8395 | ||
|
|
dd1c358d1b | ||
|
|
c09652c289 | ||
|
|
7503a4b4a4 | ||
|
|
d77c865aff | ||
|
|
0777a18703 | ||
|
|
f1e2edff8b | ||
|
|
28634bf603 | ||
|
|
fcc6611de9 | ||
|
|
8436342d88 | ||
|
|
a328cc452e | ||
|
|
bdaafe3c7b | ||
|
|
e5c64c0bda | ||
|
|
98bb5f4798 | ||
|
|
50ad2af503 | ||
|
|
4c5517623c | ||
|
|
278c4097c6 | ||
|
|
8aaa09636a | ||
|
|
4573405c5d | ||
|
|
0444708c5c | ||
|
|
c7ad92fac7 | ||
|
|
cdacda720c | ||
|
|
9490118fdb | ||
|
|
a59b211b2d | ||
|
|
9d816ba1d3 | ||
|
|
1be745ce1b | ||
|
|
7197f0ffcc | ||
|
|
f52b2e6a65 | ||
|
|
af5ada3871 | ||
|
|
6fece94369 | ||
|
|
6824dc6b33 | ||
|
|
01049ca7ae | ||
|
|
5543035a70 | ||
|
|
ac73ca6db4 | ||
|
|
0c11cab919 | ||
|
|
a0a995cff3 | ||
|
|
e98271f588 | ||
|
|
d0ca2430da | ||
|
|
d2f9804e1f | ||
|
|
bc926f2fbb | ||
|
|
b543511343 | ||
|
|
4923bb579a | ||
|
|
b6ae7cba1e | ||
|
|
1143d3b1d0 | ||
|
|
8589dfb6cc | ||
|
|
b34e50cc78 | ||
|
|
371000a877 | ||
|
|
9ed7eab514 | ||
|
|
38847482c8 | ||
|
|
40ce4127f6 | ||
|
|
08bfdc75a4 | ||
|
|
be5369be59 | ||
|
|
bfb8b9153b | ||
|
|
c3c244af81 | ||
|
|
6ab1759369 | ||
|
|
fae0a738df | ||
|
|
082741814a | ||
|
|
e5d0dc24d2 | ||
|
|
32904c6043 | ||
|
|
9c5039eabb | ||
|
|
1978dae309 | ||
|
|
3f67d5ae43 | ||
|
|
3b78c87a36 | ||
|
|
8f991588b9 | ||
|
|
0404c38615 | ||
|
|
e9a2642c89 | ||
|
|
a293bd1c4a | ||
|
|
2c95834135 | ||
|
|
3b0da73d32 | ||
|
|
5001f40e82 | ||
|
|
2635408a0d | ||
|
|
4e46a87392 | ||
|
|
b6fdb60ecf | ||
|
|
2024ff3b61 | ||
|
|
b65d4d1cfc | ||
|
|
2578f7bcc0 | ||
|
|
656fcb67f1 | ||
|
|
a5b6a0a25b | ||
|
|
d95faef1a1 | ||
|
|
fe2612d71e | ||
|
|
555d584a40 | ||
|
|
b89c326578 | ||
|
|
00ecc12c0f | ||
|
|
faf14e9b2e | ||
|
|
e1023affc1 | ||
|
|
1e1de1554f | ||
|
|
1cda84a986 | ||
|
|
47ac3ec1f4 | ||
|
|
6c2564766f | ||
|
|
206cce0d8b | ||
|
|
b36df28dca | ||
|
|
ca4a3e6138 | ||
|
|
357ab3cbad | ||
|
|
c596850af6 | ||
|
|
a3f020a4be | ||
|
|
c134f2a1a5 | ||
|
|
0a55c4b1dd | ||
|
|
46e612ada4 | ||
|
|
fe5ce5cb91 | ||
|
|
9bda6a25a5 | ||
|
|
2413fa6fbb | ||
|
|
505c6ca486 | ||
|
|
f2246f352f | ||
|
|
68c265ce37 | ||
|
|
ecf0cbdf3b | ||
|
|
b6656d0ec9 | ||
|
|
7698bc5735 | ||
|
|
28cd079adb | ||
|
|
a91292c6e9 | ||
|
|
aa1e91b130 | ||
|
|
99b373da25 | ||
|
|
03dfa08da9 | ||
|
|
5c5bc7cf1b | ||
|
|
8f533d2dfd | ||
|
|
0a29c8de7a | ||
|
|
22aeb976e0 | ||
|
|
0c32a18d4c | ||
|
|
a991360344 | ||
|
|
171843a4e0 | ||
|
|
82765a0780 | ||
|
|
74983a45cc | ||
|
|
03d0bf633d | ||
|
|
34adce6c47 | ||
|
|
23daa95d10 | ||
|
|
0039f160f2 | ||
|
|
d39a49a534 | ||
|
|
e1fb6ce365 | ||
|
|
efffdb4d7f | ||
|
|
98e43de7c5 | ||
|
|
fa940a60de | ||
|
|
e6414140e6 | ||
|
|
af5bf879aa | ||
|
|
e26ea9df42 | ||
|
|
6a3623e199 | ||
|
|
246de922e6 | ||
|
|
0d65a85cc0 | ||
|
|
31a6f8b7f4 | ||
|
|
84b65cf7ab | ||
|
|
7ffb77d243 | ||
|
|
207d0ee08a | ||
|
|
7c08232509 | ||
|
|
61099f8585 | ||
|
|
a6e115e94e | ||
|
|
7a3933a93b | ||
|
|
52d1add0fe | ||
|
|
616214f929 | ||
|
|
443a177b34 | ||
|
|
a7a355c741 | ||
|
|
70f1cd9dc5 | ||
|
|
f463abc508 | ||
|
|
56baf17a17 | ||
|
|
cf102333a2 | ||
|
|
3da5b830c2 | ||
|
|
c58b899470 | ||
|
|
ce69b86927 | ||
|
|
0c220d6fb3 | ||
|
|
0d73c20d87 | ||
|
|
e75804c34e | ||
|
|
d24ac6953e | ||
|
|
1b58bd39a6 | ||
|
|
59ec22b370 | ||
|
|
189fbfd53b | ||
|
|
97f22702c4 | ||
|
|
fa3cb8608c | ||
|
|
12745594a4 | ||
|
|
8718755c9f | ||
|
|
a86fcfbc1d | ||
|
|
77566edbaf | ||
|
|
a1afc0a139 | ||
|
|
a9910f3ce2 | ||
|
|
4fe4b0d593 | ||
|
|
f2e8465017 | ||
|
|
64a2a8a753 | ||
|
|
1643d4ed56 | ||
|
|
56818541c7 | ||
|
|
f1b76342d8 | ||
|
|
cddc2c35d9 | ||
|
|
b479c2bffb | ||
|
|
064c62e4cf | ||
|
|
7b719235b3 | ||
|
|
1e9bc56775 | ||
|
|
fcd4b5335a | ||
|
|
8b7222e22f | ||
|
|
b5d267aa95 | ||
|
|
7b113d789d | ||
|
|
ead2e1708d | ||
|
|
c16d6befd4 | ||
|
|
bc55a8eb9f | ||
|
|
f39d12c821 | ||
|
|
9a44a9806c | ||
|
|
22ae9efe6e | ||
|
|
27f8944eaa | ||
|
|
5ec06a1e5a | ||
|
|
bae95bd9d4 | ||
|
|
07a13fd9fa | ||
|
|
76160319a5 | ||
|
|
d39554ac08 | ||
|
|
81e9aa6c8d | ||
|
|
3a06991ffd | ||
|
|
20c623c9be | ||
|
|
c737b89473 | ||
|
|
8e76d0404b | ||
|
|
280bbaf301 | ||
|
|
b157e05f57 | ||
|
|
021f57ef0e | ||
|
|
afc1debb2f | ||
|
|
b95964535c | ||
|
|
7e5f761e82 | ||
|
|
a4bcc15c3b | ||
|
|
1fcdd25e83 | ||
|
|
6ee2602317 | ||
|
|
4813a71174 | ||
|
|
3af305cc50 | ||
|
|
2d87dce1ed | ||
|
|
43664e656d | ||
|
|
cc34dfce16 | ||
|
|
558c5dbe65 | ||
|
|
dc6f073ce9 | ||
|
|
0c6d903ce7 | ||
|
|
511b33ccdf | ||
|
|
40107aa6da | ||
|
|
53d4abb16c | ||
|
|
f18678bbcf | ||
|
|
e708dce674 | ||
|
|
d9ba147e5c | ||
|
|
a120178520 | ||
|
|
6d999b4379 | ||
|
|
908fc9dcc4 | ||
|
|
996485e0b2 | ||
|
|
2b6eede1d3 | ||
|
|
6693f1854d | ||
|
|
bee06002d0 | ||
|
|
4c97b6c8cf | ||
|
|
d70ed26aaa | ||
|
|
bde294f8eb | ||
|
|
f579ef5abe | ||
|
|
4fec381b3a | ||
|
|
ddbe1b66ed | ||
|
|
aef92d22d5 | ||
|
|
5cd7c77545 | ||
|
|
d8b84d9f80 | ||
|
|
a84b588208 | ||
|
|
a9ff713a56 | ||
|
|
f0aa77a44d | ||
|
|
8eb38dacac | ||
|
|
ded12158cc | ||
|
|
91e775df1b | ||
|
|
071ab3cf37 | ||
|
|
92df8e208f | ||
|
|
d30b985015 | ||
|
|
afb43f5650 | ||
|
|
4bc28ae783 | ||
|
|
37de7567b1 | ||
|
|
30ea6e100e | ||
|
|
54a90b691f | ||
|
|
18904d18c7 | ||
|
|
abb7788093 | ||
|
|
dfcd77341d | ||
|
|
219decd8ec | ||
|
|
f74c938c95 | ||
|
|
44f892080d | ||
|
|
bfcbe7849b | ||
|
|
30c3a59668 | ||
|
|
8847f9107b | ||
|
|
54da28b015 | ||
|
|
7334835143 | ||
|
|
2ba47175cf | ||
|
|
7c0e3ccdb6 | ||
|
|
aafc1456b0 | ||
|
|
528006a3b4 | ||
|
|
3439a098a0 | ||
|
|
a1876b6846 | ||
|
|
5bc2854b37 | ||
|
|
94d5b2519a | ||
|
|
20ab30339d | ||
|
|
66a02eb25e | ||
|
|
5f6b20a44d | ||
|
|
e921d28ae3 | ||
|
|
10da6f00b8 | ||
|
|
6a27b890e6 | ||
|
|
dc4dfe8ae0 | ||
|
|
a811e5b6f7 | ||
|
|
9035a1ed24 | ||
|
|
3e94ce6a97 |
No files matched your search
@@ -23,6 +23,8 @@ sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
NEWS merge=NEWS
|
||||
UPGRADING merge=NEWS
|
||||
UPGRADING.INTERNALS merge=NEWS
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ notifications:
|
||||
email: false
|
||||
|
||||
env:
|
||||
- REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
@@ -21,4 +21,4 @@ before_script:
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script: ./sapi/cli/php run-tests.php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
|
||||
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff
|
||||
+2
-2
@@ -147,7 +147,7 @@ STATUS: Working
|
||||
COMMENT: Tested on phpts and isapi versions
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysql
|
||||
PRIMARY MAINTAINER: Zak Greant <zak@mysql.com>, Georg Richter <georg@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Zak Greant <zak@mysql.com>, Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -158,7 +158,7 @@ STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqlnd
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ php_lcov.info: lcov-test
|
||||
@rm -rf lcov_data/
|
||||
@$(mkinstalldirs) lcov_data/
|
||||
@echo
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
|
||||
for x in $$files; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
|
||||
@@ -1,5 +1,200 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
23 May 2013, PHP 5.5.0 Release Candidate 2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64660 (Segfault on memory exhaustion within function definition).
|
||||
(Stas, reported by Juha Kylmänen)
|
||||
. Fixed bug #64720 (SegFault on zend_deactivate). (Dmitry)
|
||||
. Fixed bug #64853 (Use of no longer available ini directives causes crash
|
||||
on TS build). (Anatol)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #64830 (mimetype detection segfaults on mp3 file). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Add --with-fpm-systemd option to report health to systemd, and
|
||||
systemd_interval option to configure this. The service can now use
|
||||
Type=notify in the systemd unit file. (Remi)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #64769 (mbstring PHPTs crash on Windows x64). (Anatol)
|
||||
|
||||
- mysqli:
|
||||
. Fixed bug #64394 (MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS undeclared when
|
||||
using Connector/C). (Andrey)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #64508 (Fails to build with --disable-ipv6). (Gustavo)
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #64821 (Custom Exceptions crash when internal properties overridden).
|
||||
(Anatol)
|
||||
|
||||
- DateTime
|
||||
. Fixed bug #64825 (Invalid free when unserializing DateTimeZone).
|
||||
(Anatol)
|
||||
|
||||
09 May 2013, PHP 5.5.0 Release Candidate 1
|
||||
|
||||
- FPM:
|
||||
. Ignore QUERY_STRING when sent in SCRIPT_FILENAME. (Remi)
|
||||
. Fixed some possible memory or resource leaks and possible null dereference
|
||||
detected by code coverity scan. (Remi)
|
||||
. Log a warning when a syscall fails. (Remi)
|
||||
|
||||
- GD:
|
||||
. Fix build with system libgd >= 2.1 which is now the minimal
|
||||
version required (as build with previous version is broken).
|
||||
No change when bundled libgd is used. (Ondrej Sury, Remi)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #64765 (Some IPv6 addresses get interpreted wrong).
|
||||
(Boris Lytochkin)
|
||||
. Fixed bug #64159 (Truncated snmpget). (Boris Lytochkin)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #64770 (stream_select() fails with pipes returned by proc_open()
|
||||
on Windows x64). (Anatol)
|
||||
|
||||
25 Apr 2013, PHP 5.5.0 Beta 4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64677 (execution operator `` stealing surrounding arguments).
|
||||
(Laruence)
|
||||
|
||||
- CURL:
|
||||
. Remove curl stream wrappers. (Pierrick)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
|
||||
pointer has closed). (Laruence)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #64342 (ZipArchive::addFile() has to check for file existence).
|
||||
(Anatol)
|
||||
|
||||
- SOAP:
|
||||
. Added SoapClient constructor option 'ssl_method' to specify ssl method.
|
||||
(Eric Iversen)
|
||||
|
||||
- Streams:
|
||||
. Fixed Windows x64 version of stream_socket_pair() and improved error
|
||||
handling. (Anatol Belski)
|
||||
|
||||
11 Apr 2013, PHP 5.5.0 Beta 3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
|
||||
segfault). (Laruence)
|
||||
. Fixed bug #64565 (copy doesn't report failure on partial copy). (Remi)
|
||||
. Fixed bug #64555 (foreach no longer copies keys if they are interned).
|
||||
(Nikita Popov)
|
||||
. Fixed bugs #47675 and #64577 (fd leak on Solaris)
|
||||
|
||||
- CURL:
|
||||
. Added CURL_WRAPPERS_ENABLED constant. (Laruence)
|
||||
|
||||
- DateTime
|
||||
. Fixed bug #54567 (DateTimeZone serialize/unserialize) (Lonny
|
||||
Kapelushnik, Derick)
|
||||
. Fixed bug #60774 (DateInterval::format("%a") is always zero when an
|
||||
interval is created using the createFromDateString method) (Lonny
|
||||
Kapelushnik, Derick)
|
||||
|
||||
- General improvements:
|
||||
. Drop support for bison < 2.4 when building PHP from GIT source.
|
||||
(Laruence)
|
||||
|
||||
- Fileinfo:
|
||||
. Upgraded libmagic to 5.14. (Anatol)
|
||||
|
||||
- OPcache
|
||||
. Added opcache_invalidate() function. (Dmitry)
|
||||
. Added ability to disable opcode cahing for current request by setting
|
||||
opcache.enable=0. (Dmitry)
|
||||
. Allowed comments in blacklist files started from ';'. (Remi)
|
||||
. Allowed wilcards in opcache.blacklist_filename. (Remi)
|
||||
. Fixed opcache reload condition. Now OPcache is not reloaded if it's full,
|
||||
but wasted memory is less than opcache.max_wasted_percentage. (Dmitry)
|
||||
. Fixed incorrect file path validation. (Dmitry).
|
||||
. Optimizer: Fixed Control Flow Graph construction. (Dmitry)
|
||||
. Optimizer: numeric string constants used as array indeces have to be
|
||||
converted to long at compile time. (Dmitry)
|
||||
. Optimizer: Fixed deltion of used literal. (Laruence, Dmitry)
|
||||
|
||||
28 Mar 2013, PHP 5.5.0 Beta 2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64544 (Valgrind warnings after using putenv). (Laruence)
|
||||
. Fixed bug #64515 (Memoryleak when using the same variablename 2times in
|
||||
function declaration). (Laruence)
|
||||
. Fixed bug #64503 (Compilation fails with error: conflicting types for
|
||||
'zendparse'). (Laruence)
|
||||
. Fixed bug #64239 (Debug backtrace changed behavior since 5.4.10 or 5.4.11).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #64523, allow XOR in php.ini. (Dejan Marjanovic, Lars)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug # 64490 (struct flock undefined on FreeBSD). (Joe Watkins)
|
||||
|
||||
21 Mar 2013, PHP 5.5.0 Beta 1
|
||||
|
||||
- Core:
|
||||
. Added Zend Opcache extension and enable building it by default.
|
||||
More details here: https://wiki.php.net/rfc/optimizerplus. (Dmitry)
|
||||
. Added array_column function which returns a column in a multidimensional
|
||||
array. https://wiki.php.net/rfc/array_column. (Ben Ramsey)
|
||||
. Fixed bug #64354 (Unserialize array of objects whose class can't
|
||||
be autoloaded fail). (Laruence)
|
||||
. Added support for changing the process's title in CLI/CLI-Server SAPIs.
|
||||
The implementation is more robust that the proctitle PECL module. More
|
||||
details here: https://wiki.php.net/rfc/cli_process_title. (Keyur)
|
||||
. Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).
|
||||
(Anatol)
|
||||
. Added support for non-scalar Iterator keys in foreach
|
||||
(https://wiki.php.net/rfc/foreach-non-scalar-keys). (Nikita Popov)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
|
||||
for stmt->param_bind). (Andrey)
|
||||
|
||||
- DateTime
|
||||
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
|
||||
(Gustavo, Derick, Anatol)
|
||||
. Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol)
|
||||
|
||||
- SPL:
|
||||
. Implement FR #48358 (Add SplDoublyLinkedList::add() to insert an element
|
||||
at a given offset). (Mark Baker, David Soria Parra)
|
||||
|
||||
- Zip:
|
||||
. Bug #64452 (Zip crash intermittently). (Anatol)
|
||||
|
||||
07 Mar 2013, PHP 5.5.0 Alpha 6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #61025 (__invoke() visibility not honored). (Laruence)
|
||||
. Fixed bug #49348 (Uninitialized ++$foo->bar; does not cause a notice).
|
||||
(Stas)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #64287 (sendmsg/recvmsg shutdown handler causes segfault).
|
||||
(Gustavo)
|
||||
|
||||
- PCRE:
|
||||
. Merged PCRE 8.32. (Anatol)
|
||||
|
||||
- DateTime:
|
||||
. Fixed bug #64359 (strftime crash with VS2012). (Anatol)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #61981 (OO API, walk: $suffix_as_key is not working correctly).
|
||||
(Boris Lytochkin)
|
||||
|
||||
21 Feb 2013, PHP 5.5.0 Alpha 5
|
||||
|
||||
- Core:
|
||||
@@ -8,12 +203,16 @@ PHP NEWS
|
||||
propagated). (Laruence)
|
||||
. Fixed bug #63830 (Segfault on undefined function call in nested generator).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #60833 (self, parent, static behave inconsistently
|
||||
. Fixed bug #60833 (self, parent, static behave inconsistently
|
||||
case-sensitive). (Stas, mario at include-once dot org)
|
||||
. Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik).
|
||||
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
|
||||
. Added ARMv7/v8 versions of various Zend arithmetic functions that are
|
||||
implemented using inline assembler (Ard Biesheuvel)
|
||||
. Fix undefined behavior when converting double variables to integers.
|
||||
The double is now always rounded towards zero, the remainder of its division
|
||||
by 2^32 or 2^64 (depending on sizeof(long)) is calculated and it's made
|
||||
signed assuming a two's complement representation. (Gustavo)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
|
||||
@@ -27,8 +226,8 @@ PHP NEWS
|
||||
to master.
|
||||
|
||||
- mysqli
|
||||
. Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented all
|
||||
options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT
|
||||
. Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented
|
||||
all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT
|
||||
and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their
|
||||
respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey)
|
||||
. Added mysqli_savepoint(), mysqli_release_savepoint(). (Andrey)
|
||||
@@ -46,6 +245,18 @@ PHP NEWS
|
||||
- Filter:
|
||||
. Implemented FR #49180 - added MAC address validation. (Martin)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
|
||||
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
|
||||
(patch by kriss@krizalys.com, Laruence)
|
||||
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
|
||||
(Mike Willbanks)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin)
|
||||
|
||||
@@ -72,8 +283,8 @@ PHP NEWS
|
||||
(marc-bennewitz at arcor dot de, Lars)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #64007 (There is an ability to create instance of Generator by hand).
|
||||
(Laruence)
|
||||
. Fixed bug #64007 (There is an ability to create instance of Generator by
|
||||
hand). (Laruence)
|
||||
|
||||
10 Jan 2013, PHP 5.5.0 Alpha 3
|
||||
|
||||
@@ -91,7 +302,7 @@ PHP NEWS
|
||||
|
||||
- cURL:
|
||||
. Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror
|
||||
curl_pause, curl_reset, curl_share_close, curl_share_init,
|
||||
curl_pause, curl_reset, curl_share_close, curl_share_init,
|
||||
curl_share_setopt curl_strerror and curl_unescape. (Pierrick)
|
||||
. Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION,
|
||||
CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE,
|
||||
@@ -164,22 +375,22 @@ PHP NEWS
|
||||
set_exception_handler. (Nikita Popov)
|
||||
|
||||
- cURL:
|
||||
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
|
||||
CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
|
||||
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
|
||||
CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
|
||||
CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
|
||||
CURLOPT_FTP_ACCOUNT, CURLOPT_COOKIELIST, CURLOPT_IGNORE_CONTENT_LENGTH,
|
||||
CURLOPT_CONNECT_ONLY, CURLOPT_LOCALPORT, CURLOPT_LOCALPORTRANGE,
|
||||
CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPT_SSL_SESSIONID_CACHE,
|
||||
CURLOPT_FTP_SSL_CCC, CURLOPT_HTTP_CONTENT_DECODING,
|
||||
CURLOPT_HTTP_TRANSFER_DECODING, CURLOPT_PROXY_TRANSFER_MODE,
|
||||
CURLOPT_ADDRESS_SCOPE, CURLOPT_CRLFILE, CURLOPT_ISSUERCERT,
|
||||
CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_PROXYUSERNAME,
|
||||
CURLOPT_PROXYPASSWORD, CURLOPT_NOPROXY, CURLOPT_SOCKS5_GSSAPI_NEC,
|
||||
CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPT_TFTP_BLKSIZE,
|
||||
CURLOPT_SSH_KNOWNHOSTS, CURLOPT_FTP_USE_PRET, CURLOPT_MAIL_FROM,
|
||||
CURLOPT_MAIL_RCPT, CURLOPT_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_SERVER_CSEQ,
|
||||
CURLOPT_CONNECT_ONLY, CURLOPT_LOCALPORT, CURLOPT_LOCALPORTRANGE,
|
||||
CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPT_SSL_SESSIONID_CACHE,
|
||||
CURLOPT_FTP_SSL_CCC, CURLOPT_HTTP_CONTENT_DECODING,
|
||||
CURLOPT_HTTP_TRANSFER_DECODING, CURLOPT_PROXY_TRANSFER_MODE,
|
||||
CURLOPT_ADDRESS_SCOPE, CURLOPT_CRLFILE, CURLOPT_ISSUERCERT,
|
||||
CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_PROXYUSERNAME,
|
||||
CURLOPT_PROXYPASSWORD, CURLOPT_NOPROXY, CURLOPT_SOCKS5_GSSAPI_NEC,
|
||||
CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPT_TFTP_BLKSIZE,
|
||||
CURLOPT_SSH_KNOWNHOSTS, CURLOPT_FTP_USE_PRET, CURLOPT_MAIL_FROM,
|
||||
CURLOPT_MAIL_RCPT, CURLOPT_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_SERVER_CSEQ,
|
||||
CURLOPT_RTSP_SESSION_ID, CURLOPT_RTSP_STREAM_URI, CURLOPT_RTSP_TRANSPORT,
|
||||
CURLOPT_RTSP_REQUEST, CURLOPT_RESOLVE, CURLOPT_ACCEPT_ENCODING,
|
||||
CURLOPT_RTSP_REQUEST, CURLOPT_RESOLVE, CURLOPT_ACCEPT_ENCODING,
|
||||
CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
|
||||
(Pierrick)
|
||||
. Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
|
||||
@@ -187,8 +398,8 @@ PHP NEWS
|
||||
. Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)
|
||||
|
||||
- Datetime
|
||||
. Fixed bug #61642 (modify("+5 weekdays") returns Sunday).
|
||||
(Dmitri Iouchtchenko)
|
||||
. Fixed bug #61642 (modify("+5 weekdays") returns Sunday).
|
||||
(Dmitri Iouchtchenko)
|
||||
|
||||
- Hash
|
||||
. Added support for PBKDF2 via hash_pbkdf2(). (Anthony Ferrara)
|
||||
@@ -283,7 +494,8 @@ PHP NEWS
|
||||
- MySQLi
|
||||
. Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql.
|
||||
Known for stability problems. (Andrey)
|
||||
. Added support for SHA256 authentication available with MySQL 5.6.6+. (Andrey)
|
||||
. Added support for SHA256 authentication available with MySQL 5.6.6+.
|
||||
(Andrey)
|
||||
|
||||
- PCRE:
|
||||
. Deprecated the /e modifier
|
||||
@@ -308,6 +520,7 @@ PHP NEWS
|
||||
(Anatoliy)
|
||||
|
||||
- General improvements:
|
||||
. Implemented FR #46487 (Dereferencing process-handles no longer waits on those processes). (Jille Timmermans)
|
||||
. Implemented FR #46487 (Dereferencing process-handles no longer waits on
|
||||
those processes). (Jille Timmermans)
|
||||
|
||||
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
|
||||
+11
-2
@@ -64,7 +64,8 @@ Do not use abbreviations for alpha and beta.
|
||||
``git push --tags origin HEAD``
|
||||
|
||||
8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz,bz2 and xz).
|
||||
and build three tarballs (gz,bz2 and xz). Make sure you use the same GNU Bison
|
||||
version as snaps. Recent bison version are known to break ZTS.
|
||||
|
||||
9. Copy those three tarballs to www.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
@@ -154,7 +155,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
|
||||
|
||||
@@ -30,38 +30,6 @@ PHP 5.5 UPGRADE NOTES
|
||||
zend_logo_guid() have been removed
|
||||
- Removal of Logo GUIDs
|
||||
|
||||
- extensions can't override zend_execute() any more, they should override
|
||||
zend_execute_ex() instead. The EG(current_execute_data) is already
|
||||
initialized in zend_execute_ex(), so for compatibility extensions
|
||||
may need to use EG(current_execute_data)->prev_execute_data instead.
|
||||
- removed EG(arg_types_stack), EX(fbc), EX(called_scope), EX(current_object)
|
||||
- added op_array->nested_calls. It's calculated at compile time.
|
||||
- added EX(call_slots). It is an array to store information about syntaticaly
|
||||
nested calls (e.g. foo(bar())). It's preallocated together with execute_data.
|
||||
- added EX(call) - pointer to a current calling function. Actually an
|
||||
element of EX(call_slots)
|
||||
- opcodes INIT_METHOD_CALL, ZEND_INIT_STATIC_METHOD_CALL,
|
||||
ZEND_INIT_FCALL_BY_NAME, ZEND_INIT_NS_FCALL_BY_NAME use result.num as
|
||||
an index in EX(call_slots)
|
||||
- opcode ZEND_NEW uses extended_vallue as an index in EX(call_slots)
|
||||
- opcoes ZEND_DO_FCALL and ZEND_DO_FCALL_BY_NAME use op2.num as
|
||||
an index in EX(call_slots)
|
||||
- added op_array->used_stack. It's calculated at compile time and the
|
||||
corresponding stack space is preallocated together with execute_data.
|
||||
ZEND_SEND* and ZEND_DO_FCALL* don't need to check for stack overflow
|
||||
anymore.
|
||||
- Removed execute_data->Ts field. The VM temporary variables always allocated
|
||||
immediately before execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->Ts). Compiler
|
||||
stores new offsets in op_array->opcodes[*].op?.num. You can use macros
|
||||
EX_TMP_VAR() and EX_TMP_VAR_NUM() to access temp_variable by offset or
|
||||
number. You can convert number to offset using EX_TMP_VAR_NUM(0, num) or
|
||||
offset to number (EX_TMP_VAR_NUM(0,0)-EX_TMP_VAR(0,offset)).
|
||||
- Removed execute_data->CVs field. The VM compiled variables always allocated
|
||||
immediately after execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->CVs). You can
|
||||
use macros EX_CV_NUM() to access compiled variables by number.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
@@ -79,11 +47,21 @@ PHP 5.5 UPGRADE NOTES
|
||||
(https://wiki.php.net/rfc/generators)
|
||||
- ClassName::class syntax returning full class name for a class as
|
||||
a string constant. (https://wiki.php.net/rfc/class_name_scalars)
|
||||
- Added support for non-scalar Iterator keys in foreach.
|
||||
(https://wiki.php.net/rfc/foreach-non-scalar-keys).
|
||||
- Bundled Zend OPcache extension
|
||||
(https://wiki.php.net/rfc/optimizerplus)
|
||||
|
||||
========================================
|
||||
2. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
- Support for changing the process's title in CLI/CLI-Server SAPIs. (Keyur)
|
||||
(https://wiki.php.net/rfc/cli_process_title)
|
||||
- Support for systemd in php-fpm:
|
||||
Add --with-fpm-systemd option to report health to systemd, and
|
||||
systemd_interval option to configure this. The service can now use
|
||||
Type=notify in the systemd unit file. (Remi)
|
||||
|
||||
========================================
|
||||
3. Deprecated Functionality
|
||||
@@ -165,6 +143,7 @@ PHP 5.5 UPGRADE NOTES
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
- array_column()
|
||||
- boolval()
|
||||
- password_get_info()
|
||||
- password_hash()
|
||||
@@ -174,6 +153,16 @@ PHP 5.5 UPGRADE NOTES
|
||||
- cURL:
|
||||
- curl_file_create
|
||||
|
||||
- GD
|
||||
- imageflip
|
||||
- imagecrop
|
||||
- imagecropauto
|
||||
- imagesetinterpolation
|
||||
- imageaffine
|
||||
- imageaffinematrixget
|
||||
- imageaffinematrixconcat
|
||||
- imagescale
|
||||
|
||||
- Hash:
|
||||
- hash_pbkdf2()
|
||||
|
||||
@@ -266,6 +255,12 @@ PHP 5.5 UPGRADE NOTES
|
||||
|
||||
- SPL:
|
||||
- SplFixedArray::__wakeup()
|
||||
- SplDoublyLinkedList::add()
|
||||
|
||||
- Zend OPcache
|
||||
- opcache_get_configuration()
|
||||
- opcache_get_status()
|
||||
- opcache_reset()
|
||||
|
||||
========================================
|
||||
6. New Classes and Interfaces
|
||||
@@ -304,13 +299,56 @@ PHP 5.5 UPGRADE NOTES
|
||||
|
||||
- cURL:
|
||||
- Added CURLOPT_SAFE_UPLOAD to be used with curl_setopt().
|
||||
- Added CURL_WRAPPERS_ENABLED to reflect --with-curlwrappers.
|
||||
|
||||
- GD
|
||||
- Added constants for imageflip:
|
||||
. IMG_FLIP_HORIZONTAL
|
||||
. IMG_FLIP_VERTICAL
|
||||
. IMG_FLIP_BOTH
|
||||
- Added constants for imagecrop
|
||||
. IMG_CROP_DEFAULT
|
||||
. IMG_CROP_TRANSPARENT
|
||||
. IMG_CROP_BLACK
|
||||
. IMG_CROP_WHITE
|
||||
. IMG_CROP_SIDES
|
||||
. IMG_CROP_THRESHOLD
|
||||
- Added constants for imagesetinterpolation, used by imagescale
|
||||
imagerotate and imageaffine:
|
||||
. IMG_BELL
|
||||
. IMG_BESSEL
|
||||
. IMG_BILINEAR_FIXED
|
||||
. IMG_BICUBIC
|
||||
. IMG_BICUBIC_FIXED
|
||||
. IMG_BLACKMAN
|
||||
. IMG_BOX
|
||||
. IMG_BSPLINE
|
||||
. IMG_CATMULLROM
|
||||
. IMG_GAUSSIAN
|
||||
. IMG_GENERALIZED_CUBIC
|
||||
. IMG_HERMITE
|
||||
. IMG_HAMMING
|
||||
. IMG_HANNING
|
||||
. IMG_MITCHELL
|
||||
. IMG_POWER
|
||||
. IMG_QUADRATIC
|
||||
. IMG_SINC
|
||||
. IMG_NEAREST_NEIGHBOUR
|
||||
. IMG_WEIGHTED4
|
||||
. IMG_TRIANGLE
|
||||
- Added constants for imageaffinematrixget
|
||||
. IMG_AFFINE_TRANSLATE
|
||||
. IMG_AFFINE_SCALE
|
||||
. IMG_AFFINE_ROTATE
|
||||
. IMG_AFFINE_SHEAR_HORIZONTAL
|
||||
. IMG_AFFINE_SHEAR_VERTICAL
|
||||
|
||||
========================================
|
||||
10. Changes to INI File Handling
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
- Added sys_temp_dir INI directive, for specifying temp firectory.
|
||||
- Added sys_temp_dir INI directive, for specifying temp directory.
|
||||
|
||||
- Intl:
|
||||
- Added intl.use_exceptions INI directive, which controls what happens when
|
||||
@@ -321,6 +359,33 @@ PHP 5.5 UPGRADE NOTES
|
||||
APIs which use(are built) for mysqlnd. This allows ext/mysqli to be used
|
||||
with the new auth protocol, although at coarser level.
|
||||
|
||||
- Zend OPcache (See ext/opcache/README for more details)
|
||||
- Added the following directives:
|
||||
- opcache.enable (default "1")
|
||||
- opcache.memory_consumption (default "64")
|
||||
- opcache.interned_strings_buffer (default "4")
|
||||
- opcache.max_accelerated_files (default "2000")
|
||||
- opcache.max_wasted_percentage (default "5")
|
||||
- opcache.use_cwd (default "1")
|
||||
- opcache.validate_timestamps (default "1")
|
||||
- opcache.revalidate_freq (default "2")
|
||||
- opcache.revalidate_path (default "0")
|
||||
- opcache.save_comments (default "1")
|
||||
- opcache.load_comments (default "1")
|
||||
- opcache.fast_shutdown (default "0")
|
||||
- opcache.enable_file_override (default "0")
|
||||
- opcache.optimization_level (default "0xffffffff")
|
||||
- opcache.inherited_hack (default "1")
|
||||
- opcache.blacklist_filename (default "")
|
||||
- opcache.max_file_size (default "0")
|
||||
- opcache.consistency_checks (default "0")
|
||||
- opcache.force_restart_timeout (default "180")
|
||||
- opcache.error_log (default "" which means stderr)
|
||||
- opcache.log_verbosity_level (default "1")
|
||||
- opcache.preferred_memory_model (default "")
|
||||
- opcache.protect_memory (default "0")
|
||||
- opcache.mmap_base (Windows-only)
|
||||
|
||||
========================================
|
||||
11. Windows Support
|
||||
========================================
|
||||
|
||||
+50
-6
@@ -3,9 +3,11 @@ $Id$
|
||||
UPGRADE NOTES - PHP X.Y
|
||||
|
||||
1. Internal API changes
|
||||
a. Streams pooling API
|
||||
b. Lowercasing and locales
|
||||
c. zend_qsort_r
|
||||
a. Executor changes
|
||||
b. Streams pooling API
|
||||
c. Lowercasing and locales
|
||||
d. zend_qsort_r
|
||||
e. get_current_key
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -16,7 +18,41 @@ UPGRADE NOTES - PHP X.Y
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Streams pooling API
|
||||
a. Executor changes
|
||||
|
||||
* extensions can't override zend_execute() any more, they should override
|
||||
zend_execute_ex() instead. The EG(current_execute_data) is already
|
||||
initialized in zend_execute_ex(), so for compatibility extensions
|
||||
may need to use EG(current_execute_data)->prev_execute_data instead.
|
||||
* removed EG(arg_types_stack), EX(fbc), EX(called_scope), EX(current_object)
|
||||
* added op_array->nested_calls. It's calculated at compile time.
|
||||
* added EX(call_slots). It is an array to store information about syntaticaly
|
||||
nested calls (e.g. foo(bar())). It's preallocated together with execute_data.
|
||||
* added EX(call) - pointer to a current calling function. Actually an
|
||||
element of EX(call_slots)
|
||||
* opcodes INIT_METHOD_CALL, ZEND_INIT_STATIC_METHOD_CALL,
|
||||
ZEND_INIT_FCALL_BY_NAME, ZEND_INIT_NS_FCALL_BY_NAME use result.num as
|
||||
an index in EX(call_slots)
|
||||
* opcode ZEND_NEW uses extended_vallue as an index in EX(call_slots)
|
||||
* opcoes ZEND_DO_FCALL and ZEND_DO_FCALL_BY_NAME use op2.num as
|
||||
an index in EX(call_slots)
|
||||
* added op_array->used_stack. It's calculated at compile time and the
|
||||
corresponding stack space is preallocated together with execute_data.
|
||||
ZEND_SEND* and ZEND_DO_FCALL* don't need to check for stack overflow
|
||||
anymore.
|
||||
* Removed execute_data->Ts field. The VM temporary variables always allocated
|
||||
immediately before execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->Ts). Compiler
|
||||
stores new offsets in op_array->opcodes[*].op?.num. You can use macros
|
||||
EX_TMP_VAR() and EX_TMP_VAR_NUM() to access temp_variable by offset or
|
||||
number. You can convert number to offset using EX_TMP_VAR_NUM(0, num) or
|
||||
offset to number (EX_TMP_VAR_NUM(0,0)-EX_TMP_VAR(0,offset)).
|
||||
* Removed execute_data->CVs field. The VM compiled variables always allocated
|
||||
immediately after execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->CVs). You can
|
||||
use macros EX_CV_NUM() to access compiled variables by number.
|
||||
|
||||
b. Streams pooling API
|
||||
|
||||
The streams pooling API has been removed. The following functions no longer
|
||||
exist:
|
||||
@@ -28,7 +64,7 @@ PHPAPI int php_stream_context_set_link(php_stream_context *context,
|
||||
PHPAPI int php_stream_context_del_link(php_stream_context *context,
|
||||
php_stream *stream);
|
||||
|
||||
b. Lowercasing and locales
|
||||
c. Lowercasing and locales
|
||||
|
||||
The lowercasing functions in zend_operators.c were split into those that do
|
||||
lowercasing according to locale rules and those that do ASCII lowercasing.
|
||||
@@ -54,7 +90,7 @@ such as strcasecmp, will be using locale rules.
|
||||
Two new functions - zend_binary_strncasecmp_l and zend_binary_strcasecmp_l - added as
|
||||
locale-based counterparts to zend_binary_strcasecmp and zend_binary_strncasecmp.
|
||||
|
||||
c. zend_qsort_r
|
||||
d. zend_qsort_r
|
||||
|
||||
Added the function zend_qsort_r():
|
||||
|
||||
@@ -64,6 +100,14 @@ void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare
|
||||
The extra argument it has (relatively to zend_qsort()) is passed to the
|
||||
comparison function.
|
||||
|
||||
e. get_current_key
|
||||
|
||||
The signature of the get_current_key iteration handler has been changed to:
|
||||
|
||||
void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
|
||||
|
||||
The key should be written into the zval* using the ZVAL_* macros.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
========================
|
||||
|
||||
+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="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.3 2.6.4 2.6.5 2.7"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -64,6 +64,8 @@ print "\nDone\n";
|
||||
--EXPECTF--
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: %s in %s on line 6
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
|
||||
@@ -35,18 +35,30 @@ Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 9
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined property: stdClass::$b in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 11
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 11
|
||||
|
||||
Notice: Undefined property: stdClass::$b in %sbug52041.php on line 11
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
--TEST--
|
||||
Bug #55156 (ReflectionClass::getDocComment() returns comment even though the class has none)
|
||||
--INI--
|
||||
opcache.save_comments=1
|
||||
opcache.load_comments=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@ Bug #60536 (Traits Segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait T { private $x = 0; }
|
||||
class X {
|
||||
class X {
|
||||
use T;
|
||||
}
|
||||
class Y extends X {
|
||||
use T;
|
||||
function x() {
|
||||
return ++$this->x;
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
class Z extends Y {
|
||||
function z() {
|
||||
return ++$this->x;
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
$a = new Z();
|
||||
@@ -22,4 +22,6 @@ $a->x();
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Notice: Undefined property: Z::$x in %s on line 14
|
||||
DONE
|
||||
@@ -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
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #61025 (__invoke() visibility not honored)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Interface InvokeAble {
|
||||
static function __invoke();
|
||||
}
|
||||
|
||||
class Bar {
|
||||
private function __invoke() {
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
|
||||
$b = new Bar;
|
||||
echo $b();
|
||||
|
||||
echo $b->__invoke();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
|
||||
|
||||
Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
|
||||
Bar
|
||||
Fatal error: Call to private method Bar::__invoke() from context '' in %sbug61025.php on line %d
|
||||
@@ -9,6 +9,8 @@ function add_points($player, $points) {
|
||||
add_points(NULL, 2);
|
||||
--EXPECTF--
|
||||
Warning: Creating default object from empty value in %sbug62005.php on line %d
|
||||
|
||||
Notice: Undefined property: stdClass::$energy in %sbug62005.php on line 3
|
||||
stdClass Object
|
||||
(
|
||||
[energy] => 2
|
||||
|
||||
@@ -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,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,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,42 @@
|
||||
--TEST--
|
||||
Bug #64555: Array key within interned string gets wrong hash value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
protected $unsetme = 1;
|
||||
protected $keepme = 2;
|
||||
|
||||
public function test() {
|
||||
$a = get_object_vars($this);
|
||||
|
||||
foreach ($a as $k => $v) {
|
||||
if ($k == 'unsetme') {
|
||||
echo "Unsetting: $k\n";
|
||||
unset($a[$k]);
|
||||
} else if ($k == 'keepme') {
|
||||
echo "Changing: $k\n";
|
||||
$a[$k] = 42;
|
||||
$a['keepme'] = 43;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump($a, array_keys($a));
|
||||
}
|
||||
}
|
||||
|
||||
$f = new Foo;
|
||||
$f->test();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Unsetting: unsetme
|
||||
Changing: keepme
|
||||
array(1) {
|
||||
["keepme"]=>
|
||||
int(43)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(6) "keepme"
|
||||
}
|
||||
@@ -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,21 @@
|
||||
--TEST--
|
||||
Bug #64677 (execution operator `` stealing surrounding arguments)
|
||||
--FILE--
|
||||
<?PHP
|
||||
class cat {
|
||||
public function show_output($prepend, $output = '') {
|
||||
}
|
||||
}
|
||||
$cat = new cat();
|
||||
$cat->show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec
|
||||
$cat->show_output('Files: ', `cd .`); // this causes a segmentation fault
|
||||
$cat->show_output(`cd .`); // this causes a segmentation fault
|
||||
|
||||
function show_outputa($prepend, $output) {
|
||||
echo "Okey";
|
||||
}
|
||||
show_outputa('Files: ', `cd .`); // this works as expected
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Okey
|
||||
@@ -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,32 @@
|
||||
--TEST--
|
||||
zend_dval_to_lval preserves low bits (32 bit long)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 4)
|
||||
die("skip for machines with 32-bit longs");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* test doubles around -4e21 */
|
||||
$values = [
|
||||
-4000000000000001048576.,
|
||||
-4000000000000000524288.,
|
||||
-4000000000000000000000.,
|
||||
-3999999999999999475712.,
|
||||
-3999999999999998951424.,
|
||||
];
|
||||
/* see if we're rounding negative numbers right */
|
||||
$values[] = -2147483649.8;
|
||||
|
||||
foreach ($values as $v) {
|
||||
var_dump((int)$v);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(-2056257536)
|
||||
int(-2055733248)
|
||||
int(-2055208960)
|
||||
int(-2054684672)
|
||||
int(-2054160384)
|
||||
int(2147483647)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
zend_dval_to_lval preserves low bits (64 bit long)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 8)
|
||||
die("skip for machines with 64-bit longs");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* test doubles around -4e21 */
|
||||
$values = [
|
||||
-4000000000000001048576.,
|
||||
-4000000000000000524288.,
|
||||
-4000000000000000000000.,
|
||||
-3999999999999999475712.,
|
||||
-3999999999999998951424.,
|
||||
];
|
||||
|
||||
foreach ($values as $v) {
|
||||
var_dump((int)$v);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2943463994971652096)
|
||||
int(2943463994972176384)
|
||||
int(2943463994972700672)
|
||||
int(2943463994973224960)
|
||||
int(2943463994973749248)
|
||||
@@ -1,32 +1,15 @@
|
||||
--TEST--
|
||||
Generators can be cloned
|
||||
Generators cannot be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function firstN($end) {
|
||||
for ($i = 0; $i < $end; ++$i) {
|
||||
yield $i;
|
||||
}
|
||||
function gen() {
|
||||
yield;
|
||||
}
|
||||
|
||||
$g1 = firstN(5);
|
||||
var_dump($g1->current());
|
||||
$g1->next();
|
||||
|
||||
$g2 = clone $g1;
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
|
||||
var_dump($g2->current());
|
||||
var_dump($g1->current());
|
||||
|
||||
$g1->next();
|
||||
var_dump($g1->current());
|
||||
$gen = gen();
|
||||
clone $gen;
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
int(2)
|
||||
--EXPECTF--
|
||||
Fatal error: Trying to clone an uncloneable object of class Generator in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator after an object method was called
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A { public function b() { } }
|
||||
|
||||
function gen() {
|
||||
$a = new A;
|
||||
$a->b();
|
||||
yield;
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
|
||||
echo "Done";
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator with a foreach loop properly adds a ref for the loop var
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
foreach ([1, 2, 3] as $i) {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
var_dump($g1->current());
|
||||
|
||||
$g2 = clone $g1;
|
||||
var_dump($g2->current());
|
||||
|
||||
$g1->next();
|
||||
$g2->next();
|
||||
var_dump($g1->current());
|
||||
var_dump($g2->current());
|
||||
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
var_dump($g2->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(2)
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Tests cloning a generator with properties
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$g1 = gen();
|
||||
$g1->prop = 'val';
|
||||
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
|
||||
var_dump($g2->prop);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "val"
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
A generator with an active stack can be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
var_dump(str_repeat("x", yield));
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->send(10);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(10) "xxxxxxxxxx"
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
A generator using a symbol table can be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
// force compiled variable for $foo
|
||||
$foo = 'foo';
|
||||
|
||||
// force symbol table
|
||||
extract(['foo' => 'bar']);
|
||||
|
||||
// interrupt
|
||||
yield;
|
||||
|
||||
var_dump($foo);
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator method (with $this)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
protected $foo;
|
||||
|
||||
public function gen() {
|
||||
$this->foo = 'bar';
|
||||
yield; // interrupt
|
||||
var_dump($this->foo);
|
||||
}
|
||||
}
|
||||
|
||||
$g1 = (new Test)->gen();
|
||||
$g1->rewind(); // goto yield
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -38,8 +38,6 @@ Stack trace:
|
||||
#1 %s(%d): unserialize('O:9:"Generator"...')
|
||||
#2 {main}
|
||||
|
||||
|
||||
Notice: unserialize(): Error at offset 19 of 20 bytes in %s on line %d
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unserialize('C:9:"Generator"...')
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
Generators can return non-scalar keys
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield [1, 2, 3] => [4, 5, 6];
|
||||
yield (object) ['a' => 'b'] => (object) ['b' => 'a'];
|
||||
yield 3.14 => 2.73;
|
||||
yield false => true;
|
||||
yield true => false;
|
||||
yield null => null;
|
||||
}
|
||||
|
||||
foreach (gen() as $k => $v) {
|
||||
var_dump($k, $v);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(6)
|
||||
}
|
||||
object(stdClass)#3 (1) {
|
||||
["a"]=>
|
||||
string(1) "b"
|
||||
}
|
||||
object(stdClass)#4 (1) {
|
||||
["b"]=>
|
||||
string(1) "a"
|
||||
}
|
||||
float(3.14)
|
||||
float(2.73)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
NULL
|
||||
NULL
|
||||
@@ -26,10 +26,7 @@ $g2 = gen(new B);
|
||||
$g2->current();
|
||||
|
||||
$g1->next();
|
||||
|
||||
$g3 = clone $g2;
|
||||
unset($g2);
|
||||
$g3->next();
|
||||
$g2->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -22,14 +22,6 @@ $gen = gen();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
|
||||
// test cloning
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->send('bar');
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
foo
|
||||
bar
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
026: Name ambiguity (class name & namespace name)
|
||||
--INI--
|
||||
opcache.optimization_level=0
|
||||
--FILE--
|
||||
<?php
|
||||
namespace Foo;
|
||||
|
||||
@@ -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
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
|
||||
+5
-2
@@ -299,7 +299,6 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
|
||||
/*
|
||||
* zval
|
||||
*/
|
||||
typedef struct _zval_struct zval;
|
||||
typedef struct _zend_class_entry zend_class_entry;
|
||||
|
||||
typedef struct _zend_guard {
|
||||
@@ -365,6 +364,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))
|
||||
@@ -373,7 +376,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
|
||||
@@ -381,6 +383,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)
|
||||
|
||||
+127
-2
@@ -1051,6 +1051,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)) {
|
||||
@@ -1063,7 +1098,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,7 +1139,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;
|
||||
@@ -1502,6 +1537,40 @@ ZEND_API int add_get_index_stringl(zval *arg, ulong index, const char *str, uint
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (Z_TYPE_P(key)) {
|
||||
case IS_STRING:
|
||||
result = zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &value, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_NULL:
|
||||
result = zend_symtable_update(ht, "", 1, &value, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(key), Z_LVAL_P(key));
|
||||
/* break missing intentionally */
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
result = zend_hash_index_update(ht, Z_LVAL_P(key), &value, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = zend_hash_index_update(ht, zend_dval_to_lval(Z_DVAL_P(key)), &value, sizeof(zval *), NULL);
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
result = FAILURE;
|
||||
}
|
||||
|
||||
if (result == SUCCESS) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *tmp;
|
||||
@@ -3907,6 +3976,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
|
||||
|
||||
+6
-1
@@ -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)
|
||||
@@ -426,6 +426,8 @@ ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
|
||||
ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
|
||||
ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
|
||||
|
||||
ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
|
||||
|
||||
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
|
||||
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
|
||||
ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
|
||||
@@ -519,6 +521,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);
|
||||
|
||||
+13
-4
@@ -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) : "cc");
|
||||
__asm__("bsr %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc");
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
@@ -700,12 +700,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) : "cc");
|
||||
__asm__("bsf %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc");
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
bsf eax, _size
|
||||
}
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||
return __builtin_ctzl(_size);
|
||||
#else
|
||||
@@ -2485,12 +2485,21 @@ 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 %1,%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;
|
||||
|
||||
@@ -1014,7 +1014,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) {
|
||||
if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING) {
|
||||
if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) {
|
||||
zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, &prop_len);
|
||||
zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, (int*) &prop_len);
|
||||
/* Not separating references */
|
||||
Z_ADDREF_PP(value);
|
||||
add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value);
|
||||
@@ -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);
|
||||
@@ -1625,7 +1644,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 *);
|
||||
@@ -1636,7 +1654,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;
|
||||
}
|
||||
@@ -2079,7 +2103,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) {
|
||||
@@ -2260,7 +2291,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);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
| 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 |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
@@ -88,7 +88,7 @@ ZEND_METHOD(Closure, bind)
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
closure = (zend_closure *)zend_object_store_get_object(zclosure TSRMLS_CC);
|
||||
closure = (zend_closure *)zend_object_store_get_object(zclosure TSRMLS_CC);
|
||||
|
||||
if ((newthis != NULL) && (closure->func.common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
|
||||
@@ -152,7 +152,7 @@ static int zend_closure_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
|
||||
|
||||
ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function));
|
||||
|
||||
invoke->common = closure->func.common;
|
||||
@@ -168,14 +168,14 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
|
||||
|
||||
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
return &closure->func;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
return closure->this_ptr;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -212,7 +212,7 @@ static void zend_closure_write_property(zval *object, zval *member, zval *value,
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
|
||||
static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
ZEND_CLOSURE_PROPERTY_ERROR();
|
||||
return NULL;
|
||||
@@ -291,7 +291,6 @@ static zend_object_value zend_closure_clone(zval *zobject TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure;
|
||||
@@ -378,7 +377,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
|
||||
|
||||
static HashTable *zend_closure_get_gc(zval *obj, zval ***table, int *n TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
|
||||
*table = closure->this_ptr ? &closure->this_ptr : NULL;
|
||||
*n = closure->this_ptr ? 1 : 0;
|
||||
@@ -474,7 +473,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", func->common.scope->name, func->common.function_name, scope->name);
|
||||
scope = NULL;
|
||||
}
|
||||
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
|
||||
!instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", func->common.scope->name, func->common.function_name, Z_OBJCE_P(this_ptr)->name);
|
||||
scope = NULL;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
#define ZEND_INVOKE_FUNC_NAME "__invoke"
|
||||
|
||||
void zend_register_closure_ce(TSRMLS_D);
|
||||
|
||||
extern ZEND_API zend_class_entry *zend_ce_closure;
|
||||
|
||||
+20
-6
@@ -288,7 +288,7 @@ ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */
|
||||
|
||||
static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */
|
||||
{
|
||||
return (zend_uint)EX_TMP_VAR_NUM(0, (op_array->T)++);
|
||||
return (zend_uint)(zend_uintptr_t)EX_TMP_VAR_NUM(0, (op_array->T)++);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1621,6 +1621,10 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
|
||||
zend_error(E_WARNING, "The magic method __toString() must have public visibility and cannot be static");
|
||||
}
|
||||
} else if ((name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1))) {
|
||||
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
|
||||
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
char *class_lcname;
|
||||
@@ -1677,6 +1681,10 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
zend_error(E_WARNING, "The magic method __toString() must have public visibility and cannot be static");
|
||||
}
|
||||
CG(active_class_entry)->__tostring = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1))) {
|
||||
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
|
||||
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
|
||||
}
|
||||
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
@@ -1801,7 +1809,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);
|
||||
@@ -2383,13 +2391,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);
|
||||
@@ -3823,7 +3832,7 @@ 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)
|
||||
&& ((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 */
|
||||
}
|
||||
@@ -4048,12 +4057,16 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
|
||||
{
|
||||
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, "Trait %s is not used", trait->name);
|
||||
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -5689,6 +5702,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
|
||||
GET_CACHE_SLOT(opline->op1.constant);
|
||||
opline->extended_value = 1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.num = CG(context).nested_calls;
|
||||
GET_NODE(result, opline->result);
|
||||
|
||||
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
|
||||
|
||||
+2
-1
@@ -643,7 +643,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
|
||||
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);
|
||||
|
||||
@@ -856,6 +856,7 @@ END_EXTERN_C()
|
||||
#define ZEND_CALLSTATIC_FUNC_NAME "__callstatic"
|
||||
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
|
||||
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
|
||||
#define ZEND_INVOKE_FUNC_NAME "__invoke"
|
||||
|
||||
/* The following constants may be combined in CG(compiler_options)
|
||||
* to change the default compiler behavior */
|
||||
|
||||
@@ -817,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;
|
||||
@@ -828,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);
|
||||
}
|
||||
|
||||
+11
-13
@@ -898,13 +898,10 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
|
||||
} else if (EXPECTED(!PZVAL_IS_REF(value))) {
|
||||
Z_ADDREF_P(value);
|
||||
*variable_ptr_ptr = value;
|
||||
if (EXPECTED(variable_ptr != &EG(uninitialized_zval))) {
|
||||
GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
|
||||
zval_dtor(variable_ptr);
|
||||
efree(variable_ptr);
|
||||
} else {
|
||||
Z_DELREF_P(variable_ptr);
|
||||
}
|
||||
ZEND_ASSERT(variable_ptr != &EG(uninitialized_zval));
|
||||
GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
|
||||
zval_dtor(variable_ptr);
|
||||
efree(variable_ptr);
|
||||
return value;
|
||||
} else {
|
||||
goto copy_value;
|
||||
@@ -1147,6 +1144,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)) {
|
||||
@@ -1175,9 +1176,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);
|
||||
@@ -1384,7 +1382,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
|
||||
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, key TSRMLS_CC);
|
||||
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, key TSRMLS_CC);
|
||||
if (NULL == ptr_ptr) {
|
||||
zval *ptr;
|
||||
|
||||
@@ -1523,9 +1521,9 @@ void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
/*
|
||||
* Stack Frame Layout (the whole stack frame is allocated at once)
|
||||
* ==================
|
||||
* ==================
|
||||
*
|
||||
* +========================================+
|
||||
* | zend_execute_data |<---+
|
||||
|
||||
@@ -1295,7 +1295,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);
|
||||
|
||||
+4
-2
@@ -65,11 +65,13 @@ extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
|
||||
|
||||
MS Visual C:
|
||||
- Since MSVC users tipically don't use autoconf or CMake, we will detect
|
||||
MSVC via compile time define.
|
||||
MSVC via compile time define. Floating point precision change isn't
|
||||
supported on 64 bit platforms, so it's NOP. See
|
||||
http://msdn.microsoft.com/en-us/library/c9676k6h(v=vs.110).aspx
|
||||
*/
|
||||
|
||||
/* MSVC detection (MSVC people usually don't use autoconf) */
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && !defined(_WIN64)
|
||||
# if _MSC_VER >= 1500
|
||||
/* Visual C++ 2008 or higher, supports _controlfp_s */
|
||||
# define HAVE__CONTROLFP_S
|
||||
|
||||
+6
-189
@@ -196,175 +196,6 @@ static void zend_generator_free_storage(zend_generator *generator TSRMLS_DC) /*
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_object_value zend_generator_clone(zval *object TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_generator *orig = zend_object_store_get_object(object TSRMLS_CC);
|
||||
zend_object_value clone_val = zend_generator_create(Z_OBJCE_P(object) TSRMLS_CC);
|
||||
zend_generator *clone = zend_object_store_get_object_by_handle(clone_val.handle TSRMLS_CC);
|
||||
|
||||
zend_objects_clone_members(
|
||||
&clone->std, clone_val, &orig->std, Z_OBJ_HANDLE_P(object) TSRMLS_CC
|
||||
);
|
||||
|
||||
clone->execute_data = orig->execute_data;
|
||||
clone->largest_used_integer_key = orig->largest_used_integer_key;
|
||||
clone->flags = orig->flags;
|
||||
|
||||
if (orig->execute_data) {
|
||||
/* Create a few shorter aliases to the old execution data */
|
||||
zend_execute_data *execute_data = orig->execute_data;
|
||||
zend_op_array *op_array = execute_data->op_array;
|
||||
HashTable *symbol_table = execute_data->symbol_table;
|
||||
zend_execute_data *current_execute_data;
|
||||
zend_op **opline_ptr;
|
||||
HashTable *current_symbol_table;
|
||||
zend_vm_stack current_stack;
|
||||
zval *current_this;
|
||||
void **stack_frame, **orig_stack_frame;
|
||||
|
||||
/* Create new execution context. We have to back up and restore
|
||||
* EG(current_execute_data), EG(opline_ptr), EG(active_symbol_table)
|
||||
* and EG(This) here because the function modifies or uses them */
|
||||
current_execute_data = EG(current_execute_data);
|
||||
EG(current_execute_data) = execute_data->prev_execute_data;
|
||||
opline_ptr = EG(opline_ptr);
|
||||
current_symbol_table = EG(active_symbol_table);
|
||||
EG(active_symbol_table) = execute_data->symbol_table;
|
||||
current_this = EG(This);
|
||||
EG(This) = NULL;
|
||||
current_stack = EG(argument_stack);
|
||||
clone->execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC);
|
||||
clone->stack = EG(argument_stack);
|
||||
EG(argument_stack) = current_stack;
|
||||
EG(This) = current_this;
|
||||
EG(active_symbol_table) = current_symbol_table;
|
||||
EG(current_execute_data) = current_execute_data;
|
||||
EG(opline_ptr) = opline_ptr;
|
||||
|
||||
/* copy */
|
||||
clone->execute_data->opline = execute_data->opline;
|
||||
clone->execute_data->function_state = execute_data->function_state;
|
||||
clone->execute_data->object = execute_data->object;
|
||||
clone->execute_data->current_scope = execute_data->current_scope;
|
||||
clone->execute_data->current_called_scope = execute_data->current_called_scope;
|
||||
clone->execute_data->fast_ret = execute_data->fast_ret;
|
||||
|
||||
if (!symbol_table) {
|
||||
int i;
|
||||
|
||||
/* Copy compiled variables */
|
||||
for (i = 0; i < op_array->last_var; i++) {
|
||||
if (*EX_CV_NUM(execute_data, i)) {
|
||||
*EX_CV_NUM(clone->execute_data, i) = (zval **) EX_CV_NUM(clone->execute_data, op_array->last_var + i);
|
||||
**EX_CV_NUM(clone->execute_data, i) = *(zval **) EX_CV_NUM(execute_data, op_array->last_var + i);
|
||||
Z_ADDREF_PP(*EX_CV_NUM(clone->execute_data, i));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Copy symbol table */
|
||||
ALLOC_HASHTABLE(clone->execute_data->symbol_table);
|
||||
zend_hash_init(clone->execute_data->symbol_table, zend_hash_num_elements(symbol_table), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(clone->execute_data->symbol_table, symbol_table, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
|
||||
|
||||
/* Update zval** pointers for compiled variables */
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < op_array->last_var; i++) {
|
||||
if (zend_hash_quick_find(clone->execute_data->symbol_table, op_array->vars[i].name, op_array->vars[i].name_len + 1, op_array->vars[i].hash_value, (void **) EX_CV_NUM(clone->execute_data, i)) == FAILURE) {
|
||||
*EX_CV_NUM(clone->execute_data, i) = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy nested-calls stack */
|
||||
if (execute_data->call) {
|
||||
clone->execute_data->call = clone->execute_data->call_slots +
|
||||
(execute_data->call - execute_data->call_slots);
|
||||
} else {
|
||||
clone->execute_data->call = NULL;
|
||||
}
|
||||
memcpy(clone->execute_data->call_slots, execute_data->call_slots, ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * op_array->nested_calls);
|
||||
if (clone->execute_data->call >= clone->execute_data->call_slots) {
|
||||
call_slot *call = clone->execute_data->call;
|
||||
|
||||
while (call >= clone->execute_data->call_slots) {
|
||||
if (call->object) {
|
||||
Z_ADDREF_P(call->object);
|
||||
}
|
||||
call--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy the temporary variables */
|
||||
memcpy(EX_TMP_VAR_NUM(clone->execute_data, op_array->T-1), EX_TMP_VAR_NUM(execute_data, op_array->T-1), ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T);
|
||||
|
||||
/* Copy arguments passed on stack */
|
||||
stack_frame = zend_vm_stack_frame_base(clone->execute_data);
|
||||
orig_stack_frame = zend_vm_stack_frame_base(execute_data);
|
||||
clone->stack->top = stack_frame + (orig->stack->top - orig_stack_frame);
|
||||
if (clone->stack->top != stack_frame) {
|
||||
memcpy(stack_frame, orig_stack_frame, ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * (orig->stack->top - orig_stack_frame));
|
||||
while (clone->stack->top != stack_frame) {
|
||||
Z_ADDREF_PP((zval**)stack_frame);
|
||||
stack_frame++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add references to loop variables */
|
||||
{
|
||||
zend_uint op_num = execute_data->opline - op_array->opcodes;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < op_array->last_brk_cont; ++i) {
|
||||
zend_brk_cont_element *brk_cont = op_array->brk_cont_array + i;
|
||||
|
||||
if (brk_cont->start < 0) {
|
||||
continue;
|
||||
} else if (brk_cont->start > op_num) {
|
||||
break;
|
||||
} else if (brk_cont->brk > op_num) {
|
||||
zend_op *brk_opline = op_array->opcodes + brk_cont->brk;
|
||||
|
||||
if (brk_opline->opcode == ZEND_SWITCH_FREE) {
|
||||
temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
|
||||
|
||||
Z_ADDREF_P(var->var.ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the send_target to use the temporary variable with the same
|
||||
* offset as the original generator, but in our temporary variable
|
||||
* memory segment. */
|
||||
if (orig->send_target) {
|
||||
size_t offset = (char *) orig->send_target - (char *)execute_data;
|
||||
clone->send_target = EX_TMP_VAR(clone->execute_data, offset);
|
||||
zval_copy_ctor(&clone->send_target->tmp_var);
|
||||
}
|
||||
|
||||
if (execute_data->current_this) {
|
||||
clone->execute_data->current_this = execute_data->current_this;
|
||||
Z_ADDREF_P(execute_data->current_this);
|
||||
}
|
||||
}
|
||||
|
||||
/* The value and key are known not to be references, so simply add refs */
|
||||
if (orig->value) {
|
||||
clone->value = orig->value;
|
||||
Z_ADDREF_P(orig->value);
|
||||
}
|
||||
|
||||
if (orig->key) {
|
||||
clone->key = orig->key;
|
||||
Z_ADDREF_P(orig->key);
|
||||
}
|
||||
|
||||
return clone_val;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_object_value zend_generator_create(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_generator *generator;
|
||||
@@ -755,31 +586,17 @@ static void zend_generator_iterator_get_data(zend_object_iterator *iterator, zva
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_generator_iterator_get_key(zend_object_iterator *iterator, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
|
||||
static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_generator *generator = (zend_generator *) iterator->data;
|
||||
|
||||
zend_generator_ensure_initialized(generator TSRMLS_CC);
|
||||
|
||||
if (!generator->key) {
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
if (generator->key) {
|
||||
ZVAL_ZVAL(key, generator->key, 1, 0);
|
||||
} else {
|
||||
ZVAL_NULL(key);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(generator->key) == IS_LONG) {
|
||||
*int_key = Z_LVAL_P(generator->key);
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(generator->key) == IS_STRING) {
|
||||
*str_key = estrndup(Z_STRVAL_P(generator->key), Z_STRLEN_P(generator->key));
|
||||
*str_key_len = Z_STRLEN_P(generator->key) + 1;
|
||||
return HASH_KEY_IS_STRING;
|
||||
}
|
||||
|
||||
/* Waiting for Etienne's patch to allow arbitrary zval keys. Until then
|
||||
* error out on non-int and non-string keys. */
|
||||
zend_error_noreturn(E_ERROR, "Currently only int and string keys can be yielded");
|
||||
return HASH_KEY_NON_EXISTANT; /* Nerver reached */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -881,7 +698,7 @@ void zend_register_generator_ce(TSRMLS_D) /* {{{ */
|
||||
|
||||
memcpy(&zend_generator_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
|
||||
zend_generator_handlers.clone_obj = zend_generator_clone;
|
||||
zend_generator_handlers.clone_obj = NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#define ZEND_GENERATORS_H
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
extern ZEND_API zend_class_entry *zend_ce_generator;
|
||||
END_EXTERN_C()
|
||||
|
||||
typedef struct _zend_generator_iterator {
|
||||
zend_object_iterator intern;
|
||||
@@ -66,6 +66,8 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC);
|
||||
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC);
|
||||
ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1171,6 +1171,24 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index,
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
}
|
||||
|
||||
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) {
|
||||
Bucket *p;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
p = pos ? (*pos) : ht->pInternalPointer;
|
||||
|
||||
if (!p) {
|
||||
Z_TYPE_P(key) = IS_NULL;
|
||||
} else if (p->nKeyLength) {
|
||||
Z_TYPE_P(key) = IS_STRING;
|
||||
Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1);
|
||||
Z_STRLEN_P(key) = p->nKeyLength - 1;
|
||||
} else {
|
||||
Z_TYPE_P(key) = IS_LONG;
|
||||
Z_LVAL_P(key) = p->h;
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
|
||||
{
|
||||
|
||||
+3
-1
@@ -170,13 +170,13 @@ ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint
|
||||
ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h);
|
||||
ZEND_API ulong zend_hash_next_free_element(const HashTable *ht);
|
||||
|
||||
|
||||
/* traversing */
|
||||
#define zend_hash_has_more_elements_ex(ht, pos) \
|
||||
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTANT ? FAILURE : SUCCESS)
|
||||
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
|
||||
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
|
||||
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
|
||||
@@ -199,6 +199,8 @@ ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
|
||||
zend_hash_move_backwards_ex(ht, NULL)
|
||||
#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
|
||||
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, duplicate, NULL)
|
||||
#define zend_hash_get_current_key_zval(ht, key) \
|
||||
zend_hash_get_current_key_zval_ex(ht, key, NULL)
|
||||
#define zend_hash_get_current_key_type(ht) \
|
||||
zend_hash_get_current_key_type_ex(ht, NULL)
|
||||
#define zend_hash_get_current_data(ht, pData) \
|
||||
|
||||
@@ -67,6 +67,9 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
case '&':
|
||||
i_result = i_op1 & i_op2;
|
||||
break;
|
||||
case '^':
|
||||
i_result = i_op1 ^ i_op2;
|
||||
break;
|
||||
case '~':
|
||||
i_result = ~i_op1;
|
||||
break;
|
||||
@@ -264,7 +267,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
|
||||
%token BOOL_FALSE
|
||||
%token END_OF_LINE
|
||||
%token '=' ':' ',' '.' '"' '\'' '^' '+' '-' '/' '*' '%' '$' '~' '<' '>' '?' '@' '{' '}'
|
||||
%left '|' '&'
|
||||
%left '|' '&' '^'
|
||||
%right '~' '!'
|
||||
|
||||
%%
|
||||
@@ -348,6 +351,7 @@ expr:
|
||||
var_string_list { $$ = $1; }
|
||||
| expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); }
|
||||
| expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); }
|
||||
| expr '^' expr { zend_ini_do_op('^', &$$, &$1, &$3); }
|
||||
| '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); }
|
||||
| '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
|
||||
+404
-357
File diff suppressed because it is too large.
Load diff
@@ -340,9 +340,9 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
TABS_AND_SPACES [ \t]
|
||||
WHITESPACE [ \t]+
|
||||
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
|
||||
LABEL [^=\n\r\t;|&$~(){}!"\[]+
|
||||
TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
|
||||
OPERATORS [&|~()!]
|
||||
LABEL [^=\n\r\t;&|^$~(){}!"\[]+
|
||||
TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
|
||||
OPERATORS [&|^~()!]
|
||||
DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
@@ -350,7 +350,7 @@ SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
VALUE_CHARS ([^$= \t\n\r;&|^~()!"'\000]|{LITERAL_DOLLAR})
|
||||
SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
|
||||
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
+7
-33
@@ -195,7 +195,7 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_user_it_get_current_key */
|
||||
ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
|
||||
ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC)
|
||||
{
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
zval *object = (zval*)iter->it.data;
|
||||
@@ -203,42 +203,16 @@ ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **st
|
||||
|
||||
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
|
||||
|
||||
if (!retval) {
|
||||
*int_key = 0;
|
||||
if (!EG(exception))
|
||||
{
|
||||
if (retval) {
|
||||
ZVAL_ZVAL(key, retval, 1, 1);
|
||||
} else {
|
||||
if (!EG(exception)) {
|
||||
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
|
||||
}
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
switch (Z_TYPE_P(retval)) {
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);
|
||||
case IS_NULL:
|
||||
*int_key = 0;
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_LONG;
|
||||
|
||||
case IS_STRING:
|
||||
*str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||
*str_key_len = Z_STRLEN_P(retval)+1;
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_STRING;
|
||||
|
||||
case IS_DOUBLE:
|
||||
*int_key = (long)Z_DVAL_P(retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_LONG;
|
||||
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
*int_key = (long)Z_LVAL_P(retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_LONG;
|
||||
ZVAL_LONG(key, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_user_it_move_forward */
|
||||
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
|
||||
@@ -452,7 +426,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
if (result == FAILURE) {
|
||||
if (result == FAILURE && !EG(exception)) {
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -51,7 +51,7 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
|
||||
|
||||
ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC);
|
||||
ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC);
|
||||
ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
|
||||
ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC);
|
||||
ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC);
|
||||
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC);
|
||||
ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC);
|
||||
|
||||
@@ -38,8 +38,11 @@ typedef struct _zend_object_iterator_funcs {
|
||||
/* fetch the item data for the current element */
|
||||
void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC);
|
||||
|
||||
/* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */
|
||||
int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
|
||||
/* fetch the key for the current element (optional, may be NULL). The key
|
||||
* should be written into the provided zval* using the ZVAL_* macros. If
|
||||
* this handler is not provided auto-incrementing integer keys will be
|
||||
* used. */
|
||||
void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
|
||||
|
||||
/* step forwards to next element */
|
||||
void (*move_forward)(zend_object_iterator *iter TSRMLS_DC);
|
||||
|
||||
@@ -41,17 +41,19 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 3
|
||||
|
||||
%code requires {
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
}
|
||||
|
||||
%token END 0 "end of file"
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%token T_INCLUDE "include (T_INCLUDE)"
|
||||
|
||||
@@ -587,7 +587,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
zend_do_return(&retval_znode, 0 TSRMLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
if (compiler_result != 0) { /* parser error */
|
||||
zend_bailout();
|
||||
}
|
||||
compilation_successful=1;
|
||||
@@ -597,7 +597,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
} else {
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
@@ -762,7 +762,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
SCNG(script_filtered) = NULL;
|
||||
}
|
||||
|
||||
if (compiler_result==1) {
|
||||
if (compiler_result != 0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
@@ -772,7 +772,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
zend_do_return(&retval_znode, 0 TSRMLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
if (compiler_result != 0) { /* parser error */
|
||||
zend_bailout();
|
||||
}
|
||||
compilation_successful=1;
|
||||
@@ -595,7 +595,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
} else {
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
@@ -760,7 +760,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
SCNG(script_filtered) = NULL;
|
||||
}
|
||||
|
||||
if (compiler_result==1) {
|
||||
if (compiler_result != 0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
@@ -770,7 +770,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __tmpvar; \
|
||||
__asm__ ("imulq %3,%0\n" \
|
||||
"adcq $0,%1" \
|
||||
__asm__ ("imul %3,%0\n" \
|
||||
"adc $0,%1" \
|
||||
: "=r"(__tmpvar),"=r"(usedval) \
|
||||
: "0"(a), "r"(b), "1"(0)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
|
||||
@@ -714,7 +714,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
|
||||
static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_object *zobj;
|
||||
zval tmp_member;
|
||||
@@ -754,7 +754,9 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, const ze
|
||||
/* we don't have access controls - will just add it */
|
||||
new_zval = &EG(uninitialized_zval);
|
||||
|
||||
/* zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); */
|
||||
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
|
||||
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
|
||||
}
|
||||
Z_ADDREF_P(new_zval);
|
||||
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
|
||||
property_info->offset >= 0) {
|
||||
@@ -1279,6 +1281,14 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
|
||||
}
|
||||
}
|
||||
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) ||
|
||||
UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) {
|
||||
if (!silent) {
|
||||
zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &CE_STATIC_MEMBERS(ce)[property_info->offset];
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *
|
||||
|
||||
|
||||
/* Used to create pointer to the property of the object, for future direct r/w access */
|
||||
typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
|
||||
typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
|
||||
|
||||
/* Used to set object value. Can be used to override assignments and scalar
|
||||
write ops (like ++, +=) on the object */
|
||||
|
||||
+2
-1
@@ -166,8 +166,9 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
|
||||
|
||||
for (i = 0; i < ce->default_static_members_count; i++) {
|
||||
if (ce->static_members_table[i]) {
|
||||
zval_ptr_dtor(&ce->static_members_table[i]);
|
||||
zval *p = ce->static_members_table[i];
|
||||
ce->static_members_table[i] = NULL;
|
||||
zval_ptr_dtor(&p);
|
||||
}
|
||||
}
|
||||
ce->static_members_table = NULL;
|
||||
|
||||
+29
-7
@@ -26,6 +26,10 @@
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
@@ -68,22 +72,40 @@ END_EXTERN_C()
|
||||
|
||||
#if ZEND_DVAL_TO_LVAL_CAST_OK
|
||||
# define zend_dval_to_lval(d) ((long) (d))
|
||||
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
|
||||
#elif SIZEOF_LONG == 4
|
||||
static zend_always_inline long zend_dval_to_lval(double d)
|
||||
{
|
||||
if (d > LONG_MAX || d < LONG_MIN) {
|
||||
return (long)(unsigned long)(zend_long64) d;
|
||||
double two_pow_32 = pow(2., 32.),
|
||||
dmod;
|
||||
|
||||
dmod = fmod(d, two_pow_32);
|
||||
if (dmod < 0) {
|
||||
/* we're going to make this number positive; call ceil()
|
||||
* to simulate rounding towards 0 of the negative number */
|
||||
dmod = ceil(dmod) + two_pow_32;
|
||||
}
|
||||
return (long)(unsigned long)dmod;
|
||||
}
|
||||
return (long) d;
|
||||
return (long)d;
|
||||
}
|
||||
#else
|
||||
static zend_always_inline long zend_dval_to_lval(double d)
|
||||
{
|
||||
/* >= as (double)LONG_MAX is outside signed range */
|
||||
if (d >= LONG_MAX) {
|
||||
return (long)(unsigned long) d;
|
||||
if (d >= LONG_MAX || d < LONG_MIN) {
|
||||
double two_pow_64 = pow(2., 64.),
|
||||
dmod;
|
||||
|
||||
dmod = fmod(d, two_pow_64);
|
||||
if (dmod < 0) {
|
||||
/* no need to call ceil; original double must have had no
|
||||
* fractional part, hence dmod does not have one either */
|
||||
dmod += two_pow_64;
|
||||
}
|
||||
return (long)(unsigned long)dmod;
|
||||
}
|
||||
return (long) d;
|
||||
return (long)d;
|
||||
}
|
||||
#endif
|
||||
/* }}} */
|
||||
@@ -479,7 +501,7 @@ ZEND_API void zend_update_current_locale(void);
|
||||
|
||||
/* The offset in bytes between the value and type fields of a zval */
|
||||
#define ZVAL_OFFSETOF_TYPE \
|
||||
(__builtin_offsetof(zval,type) - __builtin_offsetof(zval,value))
|
||||
(offsetof(zval,type) - offsetof(zval,value))
|
||||
|
||||
static zend_always_inline int fast_increment_function(zval *op1)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ typedef unsigned long zend_uintptr_t;
|
||||
|
||||
typedef unsigned int zend_object_handle;
|
||||
typedef struct _zend_object_handlers zend_object_handlers;
|
||||
typedef struct _zval_struct zval;
|
||||
|
||||
typedef struct _zend_object_value {
|
||||
zend_object_handle handle;
|
||||
|
||||
+62
-82
@@ -363,7 +363,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -625,7 +625,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -726,7 +726,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -1967,13 +1967,6 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
LOAD_OPLINE();
|
||||
|
||||
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (fbc->common.arg_info) {
|
||||
zend_uint i=0;
|
||||
zval **p = (zval**)EX(function_state).arguments;
|
||||
@@ -1985,15 +1978,24 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
}
|
||||
}
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -2839,17 +2841,17 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
|
||||
if (OP1_TYPE == IS_TMP_VAR) {
|
||||
FREE_OP1();
|
||||
}
|
||||
} else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
} else {
|
||||
if (OP1_TYPE == IS_CONST ||
|
||||
(PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
|
||||
OP1_TYPE == IS_TMP_VAR ||
|
||||
PZVAL_IS_REF(retval_ptr)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
if (OP1_TYPE != IS_TMP_VAR) {
|
||||
zval_copy_ctor(ret);
|
||||
}
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
@@ -2861,16 +2863,6 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
}
|
||||
} else {
|
||||
zval *ret;
|
||||
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
FREE_OP1_IF_VAR();
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
@@ -2886,10 +2878,6 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
|
||||
SAVE_OPLINE();
|
||||
|
||||
do {
|
||||
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
|
||||
/* Not supposed to happen, but we'll allow it */
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
@@ -3180,7 +3168,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
@@ -3274,7 +3264,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
|
||||
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
|
||||
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
|
||||
Z_DELREF_PP(var_ptr);
|
||||
zval_ptr_dtor(var_ptr);
|
||||
*var_ptr = assignment_value;
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -4245,13 +4235,13 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
zend_free_op free_op1;
|
||||
zval *array = EX_T(opline->op1.var).fe.ptr;
|
||||
zval **value;
|
||||
char *str_key;
|
||||
uint str_key_len;
|
||||
ulong int_key;
|
||||
HashTable *fe_ht;
|
||||
zend_object_iterator *iter = NULL;
|
||||
int key_type = 0;
|
||||
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
|
||||
|
||||
zval *key = NULL;
|
||||
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
|
||||
key = &EX_T((opline+1)->result.var).tmp_var;
|
||||
}
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -4262,8 +4252,11 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
|
||||
case ZEND_ITER_PLAIN_OBJECT: {
|
||||
const char *class_name, *prop_name;
|
||||
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
|
||||
int key_type;
|
||||
char *str_key;
|
||||
zend_uint str_key_len;
|
||||
zend_ulong int_key;
|
||||
|
||||
fe_ht = Z_OBJPROP_P(array);
|
||||
zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
@@ -4275,15 +4268,23 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
|
||||
zend_hash_move_forward(fe_ht);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT ||
|
||||
(key_type != HASH_KEY_IS_LONG &&
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
if (use_key && key_type != HASH_KEY_IS_LONG) {
|
||||
zend_unmangle_property_name_ex(str_key, str_key_len-1, &class_name, &prop_name, &str_key_len);
|
||||
str_key = estrndup(prop_name, str_key_len);
|
||||
str_key_len++;
|
||||
} while (key_type != HASH_KEY_IS_LONG &&
|
||||
zend_check_property_access(zobj, str_key, str_key_len - 1 TSRMLS_CC) != SUCCESS);
|
||||
|
||||
if (key) {
|
||||
if (key_type == HASH_KEY_IS_LONG) {
|
||||
ZVAL_LONG(key, int_key);
|
||||
} else {
|
||||
const char *class_name, *prop_name;
|
||||
int prop_name_len;
|
||||
zend_unmangle_property_name_ex(
|
||||
str_key, str_key_len - 1, &class_name, &prop_name, &prop_name_len
|
||||
);
|
||||
ZVAL_STRINGL(key, prop_name, prop_name_len, 1);
|
||||
}
|
||||
}
|
||||
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4294,8 +4295,8 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
/* reached end of iteration */
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
}
|
||||
if (use_key) {
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
|
||||
if (key) {
|
||||
zend_hash_get_current_key_zval(fe_ht, key);
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
@@ -4330,16 +4331,15 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
/* failure in get_current_data */
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
}
|
||||
if (use_key) {
|
||||
if (key) {
|
||||
if (iter->funcs->get_current_key) {
|
||||
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
|
||||
iter->funcs->get_current_key(iter, key TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zval_ptr_dtor(&array);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
key_type = HASH_KEY_IS_LONG;
|
||||
int_key = iter->index;
|
||||
ZVAL_LONG(key, iter->index);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4355,26 +4355,6 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
AI_SET_PTR(&EX_T(opline->result.var), *value);
|
||||
}
|
||||
|
||||
if (use_key) {
|
||||
zval *key = &EX_T((opline+1)->result.var).tmp_var;
|
||||
|
||||
switch (key_type) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
Z_STRVAL_P(key) = (char*)str_key;
|
||||
Z_STRLEN_P(key) = str_key_len-1;
|
||||
Z_TYPE_P(key) = IS_STRING;
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
Z_LVAL_P(key) = int_key;
|
||||
Z_TYPE_P(key) = IS_LONG;
|
||||
break;
|
||||
default:
|
||||
case HASH_KEY_NON_EXISTANT:
|
||||
ZVAL_NULL(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_INC_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -4961,7 +4941,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
@@ -5411,7 +5391,7 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value &&
|
||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||
/* in case of unhandled exception jump to catch block instead of finally */
|
||||
ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
|
||||
+118
-178
@@ -519,13 +519,6 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
LOAD_OPLINE();
|
||||
|
||||
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (fbc->common.arg_info) {
|
||||
zend_uint i=0;
|
||||
zval **p = (zval**)EX(function_state).arguments;
|
||||
@@ -537,15 +530,24 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -1404,7 +1406,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
|
||||
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
|
||||
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
|
||||
Z_DELREF_PP(var_ptr);
|
||||
zval_ptr_dtor(var_ptr);
|
||||
*var_ptr = assignment_value;
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -1477,7 +1479,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
@@ -2333,17 +2335,17 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
if (IS_CONST == IS_TMP_VAR) {
|
||||
|
||||
}
|
||||
} else if (!0) { /* Not a temp var */
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
} else {
|
||||
if (IS_CONST == IS_CONST ||
|
||||
(PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
|
||||
IS_CONST == IS_TMP_VAR ||
|
||||
PZVAL_IS_REF(retval_ptr)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
if (IS_CONST != IS_TMP_VAR) {
|
||||
zval_copy_ctor(ret);
|
||||
}
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
@@ -2355,16 +2357,6 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
}
|
||||
} else {
|
||||
zval *ret;
|
||||
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
@@ -2380,10 +2372,6 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
SAVE_OPLINE();
|
||||
|
||||
do {
|
||||
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
|
||||
/* Not supposed to happen, but we'll allow it */
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
@@ -7654,17 +7642,17 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (IS_TMP_VAR == IS_TMP_VAR) {
|
||||
zval_dtor(free_op1.var);
|
||||
}
|
||||
} else if (!1) { /* Not a temp var */
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
} else {
|
||||
if (IS_TMP_VAR == IS_CONST ||
|
||||
(PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
|
||||
IS_TMP_VAR == IS_TMP_VAR ||
|
||||
PZVAL_IS_REF(retval_ptr)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
if (IS_TMP_VAR != IS_TMP_VAR) {
|
||||
zval_copy_ctor(ret);
|
||||
}
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
@@ -7676,16 +7664,6 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
}
|
||||
} else {
|
||||
zval *ret;
|
||||
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
@@ -7701,10 +7679,6 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
SAVE_OPLINE();
|
||||
|
||||
do {
|
||||
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
|
||||
/* Not supposed to happen, but we'll allow it */
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
@@ -12888,17 +12862,17 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (IS_VAR == IS_TMP_VAR) {
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
} else if (!0) { /* Not a temp var */
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
} else {
|
||||
if (IS_VAR == IS_CONST ||
|
||||
(PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
|
||||
IS_VAR == IS_TMP_VAR ||
|
||||
PZVAL_IS_REF(retval_ptr)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
if (IS_VAR != IS_TMP_VAR) {
|
||||
zval_copy_ctor(ret);
|
||||
}
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
@@ -12910,16 +12884,6 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
}
|
||||
} else {
|
||||
zval *ret;
|
||||
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
@@ -12935,10 +12899,6 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
SAVE_OPLINE();
|
||||
|
||||
do {
|
||||
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
|
||||
/* Not supposed to happen, but we'll allow it */
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
@@ -13129,7 +13089,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -13588,13 +13550,13 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
|
||||
zval *array = EX_T(opline->op1.var).fe.ptr;
|
||||
zval **value;
|
||||
char *str_key;
|
||||
uint str_key_len;
|
||||
ulong int_key;
|
||||
HashTable *fe_ht;
|
||||
zend_object_iterator *iter = NULL;
|
||||
int key_type = 0;
|
||||
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
|
||||
|
||||
zval *key = NULL;
|
||||
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
|
||||
key = &EX_T((opline+1)->result.var).tmp_var;
|
||||
}
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
@@ -13605,8 +13567,11 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
|
||||
case ZEND_ITER_PLAIN_OBJECT: {
|
||||
const char *class_name, *prop_name;
|
||||
zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
|
||||
int key_type;
|
||||
char *str_key;
|
||||
zend_uint str_key_len;
|
||||
zend_ulong int_key;
|
||||
|
||||
fe_ht = Z_OBJPROP_P(array);
|
||||
zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
@@ -13618,15 +13583,23 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
|
||||
zend_hash_move_forward(fe_ht);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT ||
|
||||
(key_type != HASH_KEY_IS_LONG &&
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
if (use_key && key_type != HASH_KEY_IS_LONG) {
|
||||
zend_unmangle_property_name_ex(str_key, str_key_len-1, &class_name, &prop_name, &str_key_len);
|
||||
str_key = estrndup(prop_name, str_key_len);
|
||||
str_key_len++;
|
||||
} while (key_type != HASH_KEY_IS_LONG &&
|
||||
zend_check_property_access(zobj, str_key, str_key_len - 1 TSRMLS_CC) != SUCCESS);
|
||||
|
||||
if (key) {
|
||||
if (key_type == HASH_KEY_IS_LONG) {
|
||||
ZVAL_LONG(key, int_key);
|
||||
} else {
|
||||
const char *class_name, *prop_name;
|
||||
int prop_name_len;
|
||||
zend_unmangle_property_name_ex(
|
||||
str_key, str_key_len - 1, &class_name, &prop_name, &prop_name_len
|
||||
);
|
||||
ZVAL_STRINGL(key, prop_name, prop_name_len, 1);
|
||||
}
|
||||
}
|
||||
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -13637,8 +13610,8 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
/* reached end of iteration */
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
}
|
||||
if (use_key) {
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
|
||||
if (key) {
|
||||
zend_hash_get_current_key_zval(fe_ht, key);
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.var).fe.fe_pos);
|
||||
@@ -13673,16 +13646,15 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
/* failure in get_current_data */
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num);
|
||||
}
|
||||
if (use_key) {
|
||||
if (key) {
|
||||
if (iter->funcs->get_current_key) {
|
||||
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
|
||||
iter->funcs->get_current_key(iter, key TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zval_ptr_dtor(&array);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
key_type = HASH_KEY_IS_LONG;
|
||||
int_key = iter->index;
|
||||
ZVAL_LONG(key, iter->index);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -13698,26 +13670,6 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
AI_SET_PTR(&EX_T(opline->result.var), *value);
|
||||
}
|
||||
|
||||
if (use_key) {
|
||||
zval *key = &EX_T((opline+1)->result.var).tmp_var;
|
||||
|
||||
switch (key_type) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
Z_STRVAL_P(key) = (char*)str_key;
|
||||
Z_STRLEN_P(key) = str_key_len-1;
|
||||
Z_TYPE_P(key) = IS_STRING;
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
Z_LVAL_P(key) = int_key;
|
||||
Z_TYPE_P(key) = IS_LONG;
|
||||
break;
|
||||
default:
|
||||
case HASH_KEY_NON_EXISTANT:
|
||||
ZVAL_NULL(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_INC_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -14185,7 +14137,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -14446,7 +14398,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -14547,7 +14499,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -16698,7 +16650,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -16960,7 +16912,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -17061,7 +17013,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -18795,7 +18747,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -19057,7 +19009,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -19158,7 +19110,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -20997,7 +20949,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -22417,7 +22369,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -22678,7 +22630,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -22779,7 +22731,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -24375,7 +24327,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -24635,7 +24587,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -24736,7 +24688,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -25790,7 +25742,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -26051,7 +26003,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -26152,7 +26104,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -27111,7 +27063,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -27372,7 +27324,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -27473,7 +27425,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -28433,7 +28385,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -28855,7 +28807,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -29115,7 +29067,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -29216,7 +29168,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -30534,17 +30486,17 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (IS_CV == IS_TMP_VAR) {
|
||||
|
||||
}
|
||||
} else if (!0) { /* Not a temp var */
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
} else {
|
||||
if (IS_CV == IS_CONST ||
|
||||
(PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
|
||||
IS_CV == IS_TMP_VAR ||
|
||||
PZVAL_IS_REF(retval_ptr)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
if (IS_CV != IS_TMP_VAR) {
|
||||
zval_copy_ctor(ret);
|
||||
}
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
@@ -30556,16 +30508,6 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
}
|
||||
} else {
|
||||
zval *ret;
|
||||
|
||||
if (*EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
@@ -30581,10 +30523,6 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
SAVE_OPLINE();
|
||||
|
||||
do {
|
||||
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
|
||||
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
|
||||
/* Not supposed to happen, but we'll allow it */
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
@@ -30774,7 +30712,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -31673,7 +31613,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -31933,7 +31873,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -32034,7 +31974,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -33955,7 +33895,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -34216,7 +34156,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -34317,7 +34257,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -35916,7 +35856,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -36177,7 +36117,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -36278,7 +36218,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
@@ -37981,7 +37921,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -39255,7 +39195,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
|
||||
/* here property is a string */
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ
|
||||
&& Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -39515,7 +39455,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
@@ -39616,7 +39556,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (zptr != NULL) { /* NULL means no success in getting PTR */
|
||||
have_get_ptr = 1;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(zptr);
|
||||
|
||||
+3
-1
@@ -2342,8 +2342,10 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
|
||||
if test -n "$OPENSSL_LIBS"; then
|
||||
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
|
||||
fi
|
||||
if test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_INCLINE($OPENSSL_INCS)
|
||||
fi
|
||||
fi
|
||||
|
||||
Vendored
+1
-1
@@ -1011,7 +1011,7 @@ case $basic_machine in
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
|
||||
+2
-2
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=5
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="alpha5"
|
||||
PHP_EXTRA_VERSION="RC2"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -784,7 +784,7 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.5 1.6 1.7 1.9"
|
||||
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
@@ -272,6 +272,7 @@
|
||||
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
|
||||
|
||||
#define JEWISH_SDN_OFFSET 347997
|
||||
#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
|
||||
#define NEW_MOON_OF_CREATION 31524
|
||||
|
||||
#define SUNDAY 0
|
||||
@@ -559,7 +560,7 @@ void SdnToJewish(
|
||||
int tishri1After;
|
||||
int yearLength;
|
||||
|
||||
if (sdn <= JEWISH_SDN_OFFSET) {
|
||||
if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #64895: Integer overflow in SndToJewish
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
|
||||
|
||||
foreach ($a as $x) var_dump(jdtojewish($x));
|
||||
--EXPECTF--
|
||||
string(11) "2/22/103759"
|
||||
string(12) "12/13/887605"
|
||||
string(5) "0/0/0"
|
||||
string(5) "0/0/0"
|
||||
@@ -74,16 +74,15 @@ static void com_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC
|
||||
*data = &I->zdata;
|
||||
}
|
||||
|
||||
static int com_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
|
||||
ulong *int_key TSRMLS_DC)
|
||||
static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
|
||||
{
|
||||
struct php_com_iterator *I = (struct php_com_iterator*)iter->data;
|
||||
|
||||
if (I->key == (ulong)-1) {
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
ZVAL_NULL(key);
|
||||
} else {
|
||||
ZVAL_LONG(key, I->key);
|
||||
}
|
||||
*int_key = I->key;
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
|
||||
static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
|
||||
|
||||
@@ -519,16 +519,15 @@ static void saproxy_iter_get_data(zend_object_iterator *iter, zval ***data TSRML
|
||||
*data = ptr_ptr;
|
||||
}
|
||||
|
||||
static int saproxy_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
|
||||
ulong *int_key TSRMLS_DC)
|
||||
static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
|
||||
{
|
||||
php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data;
|
||||
|
||||
if (I->key == -1) {
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
ZVAL_NULL(key);
|
||||
} else {
|
||||
ZVAL_LONG(key, I->key);
|
||||
}
|
||||
*int_key = (ulong)I->key;
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
|
||||
static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
|
||||
|
||||
+1
-9
@@ -5,10 +5,6 @@ dnl
|
||||
PHP_ARG_WITH(curl, for cURL support,
|
||||
[ --with-curl[=DIR] Include cURL support])
|
||||
|
||||
dnl Temporary option while we develop this aspect of the extension
|
||||
PHP_ARG_WITH(curlwrappers, if we should use cURL for url streams,
|
||||
[ --with-curlwrappers EXPERIMENTAL: Use cURL for url streams], no, no)
|
||||
|
||||
if test "$PHP_CURL" != "no"; then
|
||||
if test -r $PHP_CURL/include/curl/easy.h; then
|
||||
CURL_DIR=$PHP_CURL
|
||||
@@ -145,10 +141,6 @@ int main(int argc, char *argv[])
|
||||
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
|
||||
])
|
||||
|
||||
if test "$PHP_CURLWRAPPERS" != "no" ; then
|
||||
AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
|
||||
fi
|
||||
|
||||
PHP_NEW_EXTENSION(curl, interface.c multi.c share.c streams.c curl_file.c, $ext_shared)
|
||||
PHP_NEW_EXTENSION(curl, interface.c multi.c share.c curl_file.c, $ext_shared)
|
||||
PHP_SUBST(CURL_SHARED_LIBADD)
|
||||
fi
|
||||
+1
-2
@@ -13,14 +13,13 @@ if (PHP_CURL != "no") {
|
||||
&& (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
|
||||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
|
||||
) {
|
||||
EXTENSION("curl", "interface.c multi.c share.c streams.c curl_file.c", true);
|
||||
EXTENSION("curl", "interface.c multi.c share.c curl_file.c", true);
|
||||
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
|
||||
AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL');
|
||||
AC_DEFINE('HAVE_CURL_EASY_STRERROR', 1, 'Have curl_easy_strerror in cURL');
|
||||
AC_DEFINE('HAVE_CURL_MULTI_STRERROR', 1, 'Have curl_multi_strerror in cURL');
|
||||
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
|
||||
// TODO: check for curl_version_info
|
||||
// AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL wrappers [experimental]');
|
||||
} else {
|
||||
WARNING("curl not enabled; libraries and headers not found");
|
||||
}
|
||||
|
||||
@@ -1221,22 +1221,6 @@ PHP_MINIT_FUNCTION(curl)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#ifdef PHP_CURL_URL_WRAPPERS
|
||||
{
|
||||
curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
|
||||
char **p = (char **)info->protocols;
|
||||
|
||||
while (*p != NULL) {
|
||||
/* Do not enable cURL "file" protocol and make sure cURL is always used when --with-curlwrappers is enabled */
|
||||
if (strncasecmp(*p, "file", sizeof("file")-1) != 0) {
|
||||
php_unregister_url_stream_wrapper(*p TSRMLS_CC);
|
||||
php_register_url_stream_wrapper(*p, &php_curl_wrapper TSRMLS_CC);
|
||||
}
|
||||
(void) *p++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
curlfile_register_class(TSRMLS_C);
|
||||
|
||||
return SUCCESS;
|
||||
@@ -1247,20 +1231,6 @@ PHP_MINIT_FUNCTION(curl)
|
||||
*/
|
||||
PHP_MSHUTDOWN_FUNCTION(curl)
|
||||
{
|
||||
#ifdef PHP_CURL_URL_WRAPPERS
|
||||
{
|
||||
curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
|
||||
char **p = (char **)info->protocols;
|
||||
|
||||
while (*p != NULL) {
|
||||
/* Do not enable cURL "file" protocol and make sure cURL is always used when --with-curlwrappers is enabled */
|
||||
if (strncasecmp(*p, "file", sizeof("file")-1) != 0) {
|
||||
php_unregister_url_stream_wrapper(*p TSRMLS_CC);
|
||||
}
|
||||
(void) *p++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
curl_global_cleanup();
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL
|
||||
if (php_curl_openssl_tsl) {
|
||||
|
||||
@@ -200,38 +200,6 @@ void _php_curl_cleanup_handle(php_curl *);
|
||||
void _php_curl_multi_cleanup_list(void *data);
|
||||
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
|
||||
|
||||
/* streams support */
|
||||
|
||||
extern php_stream_ops php_curl_stream_ops;
|
||||
#define PHP_STREAM_IS_CURL &php_curl_stream_ops
|
||||
|
||||
php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode,
|
||||
int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
|
||||
|
||||
extern php_stream_wrapper php_curl_wrapper;
|
||||
|
||||
struct php_curl_buffer {
|
||||
off_t readpos, writepos;
|
||||
php_stream *buf;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CURL *curl;
|
||||
CURLM *multi;
|
||||
char *url;
|
||||
struct php_curl_buffer readbuffer; /* holds downloaded data */
|
||||
struct php_curl_buffer writebuffer; /* holds data to upload */
|
||||
|
||||
fd_set readfds, writefds, excfds;
|
||||
int maxfd;
|
||||
|
||||
char errstr[CURL_ERROR_SIZE + 1];
|
||||
CURLMcode mcode;
|
||||
int pending;
|
||||
zval *headers;
|
||||
struct curl_slist *headers_slist; /* holds custom headers sent out in the request */
|
||||
} php_curl_stream;
|
||||
|
||||
void curlfile_register_class(TSRMLS_D);
|
||||
PHP_CURL_API extern zend_class_entry *curl_CURLFile_class;
|
||||
|
||||
|
||||
@@ -1,542 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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 |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Wez Furlong <wez@thebrainroom.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* This file implements cURL based wrappers.
|
||||
* NOTE: If you are implementing your own streams that are intended to
|
||||
* work independently of wrappers, this is not a good example to follow!
|
||||
**/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_memory_streams.h"
|
||||
|
||||
#if HAVE_CURL
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock2.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
#define SMART_STR_PREALLOC 4096
|
||||
|
||||
#include "ext/standard/php_smart_str.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/file.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
#include "php_curl.h"
|
||||
|
||||
static size_t on_data_available(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
{
|
||||
php_stream *stream = (php_stream *) ctx;
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
size_t wrote;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* TODO: I'd like to deprecate this.
|
||||
* This code is here because until we start getting real data, we don't know
|
||||
* if we have had all of the headers
|
||||
* */
|
||||
if (curlstream->readbuffer.writepos == 0) {
|
||||
zval *sym;
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
}
|
||||
MAKE_STD_ZVAL(sym);
|
||||
*sym = *curlstream->headers;
|
||||
zval_copy_ctor(sym);
|
||||
ZEND_SET_SYMBOL(EG(active_symbol_table), "http_response_header", sym);
|
||||
}
|
||||
|
||||
php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.writepos, SEEK_SET);
|
||||
wrote = php_stream_write(curlstream->readbuffer.buf, data, size * nmemb);
|
||||
curlstream->readbuffer.writepos = php_stream_tell(curlstream->readbuffer.buf);
|
||||
|
||||
return wrote;
|
||||
}
|
||||
|
||||
/* cURL guarantees that headers are written as complete lines, with this function
|
||||
* called once for each header */
|
||||
static size_t on_header_available(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
{
|
||||
size_t length = size * nmemb;
|
||||
zval *header;
|
||||
php_stream *stream = (php_stream *) ctx;
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (length < 2) {
|
||||
/* invalid header ? */
|
||||
return length;
|
||||
}
|
||||
|
||||
if (!(length == 2 && data[0] == '\r' && data[1] == '\n')) {
|
||||
MAKE_STD_ZVAL(header);
|
||||
Z_STRLEN_P(header) = length;
|
||||
Z_STRVAL_P(header) = estrndup(data, length);
|
||||
if (Z_STRVAL_P(header)[length-1] == '\n') {
|
||||
Z_STRVAL_P(header)[length-1] = '\0';
|
||||
Z_STRLEN_P(header)--;
|
||||
|
||||
if (Z_STRVAL_P(header)[length-2] == '\r') {
|
||||
Z_STRVAL_P(header)[length-2] = '\0';
|
||||
Z_STRLEN_P(header)--;
|
||||
}
|
||||
}
|
||||
Z_TYPE_P(header) = IS_STRING;
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(curlstream->headers), &header, sizeof(zval *), NULL);
|
||||
|
||||
/* based on the header, we might need to trigger a notification */
|
||||
if (!strncasecmp(data, "Location: ", 10)) {
|
||||
php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_REDIRECTED, data + 10, 0);
|
||||
} else if (!strncasecmp(data, "Content-Type: ", 14)) {
|
||||
php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_MIME_TYPE_IS, data + 14, 0);
|
||||
} else if (!strncasecmp(data, "Context-Length: ", 16)) {
|
||||
php_stream_notify_file_size(stream->context, atoi(data + 16), data, 0);
|
||||
php_stream_notify_progress_init(stream->context, 0, 0);
|
||||
}
|
||||
}
|
||||
return length;
|
||||
|
||||
}
|
||||
|
||||
static int on_progress_avail(php_stream *stream, double dltotal, double dlnow, double ultotal, double ulnow)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* our notification system only works in a single direction; we should detect which
|
||||
* direction is important and use the correct values in this call */
|
||||
php_stream_notify_progress(stream->context, (size_t) dlnow, (size_t) dltotal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t php_curl_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
|
||||
if (curlstream->writebuffer.buf) {
|
||||
return php_stream_write(curlstream->writebuffer.buf, buf, count);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
size_t didread = 0;
|
||||
|
||||
if (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending) {
|
||||
/* we need to read some more data */
|
||||
struct timeval tv;
|
||||
|
||||
/* fire up the connection */
|
||||
if (curlstream->readbuffer.writepos == 0) {
|
||||
while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(curlstream->multi, &curlstream->pending));
|
||||
}
|
||||
|
||||
do {
|
||||
FD_ZERO(&curlstream->readfds);
|
||||
FD_ZERO(&curlstream->writefds);
|
||||
FD_ZERO(&curlstream->excfds);
|
||||
|
||||
/* get the descriptors from curl */
|
||||
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
|
||||
|
||||
/* if we are in blocking mode, set a timeout */
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = 15; /* TODO: allow this to be configured from the script */
|
||||
|
||||
/* wait for data */
|
||||
switch ((curlstream->maxfd < 0) ? 1 :
|
||||
select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) {
|
||||
case -1:
|
||||
/* error */
|
||||
return 0;
|
||||
case 0:
|
||||
/* no data yet: timed-out */
|
||||
return 0;
|
||||
default:
|
||||
/* fetch the data */
|
||||
do {
|
||||
curlstream->mcode = curl_multi_perform(curlstream->multi, &curlstream->pending);
|
||||
} while (curlstream->mcode == CURLM_CALL_MULTI_PERFORM);
|
||||
}
|
||||
} while (curlstream->maxfd >= 0 &&
|
||||
curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0);
|
||||
|
||||
}
|
||||
|
||||
/* if there is data in the buffer, try and read it */
|
||||
if (curlstream->readbuffer.writepos > 0 && curlstream->readbuffer.readpos < curlstream->readbuffer.writepos) {
|
||||
php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.readpos, SEEK_SET);
|
||||
didread = php_stream_read(curlstream->readbuffer.buf, buf, count);
|
||||
curlstream->readbuffer.readpos = php_stream_tell(curlstream->readbuffer.buf);
|
||||
}
|
||||
|
||||
if (didread == 0) {
|
||||
stream->eof = 1;
|
||||
}
|
||||
|
||||
return didread;
|
||||
}
|
||||
|
||||
static int php_curl_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
|
||||
{
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
|
||||
/* TODO: respect the close_handle flag here, so that casting to a FILE* on
|
||||
* systems without fopencookie will work properly */
|
||||
|
||||
curl_multi_remove_handle(curlstream->multi, curlstream->curl);
|
||||
curl_easy_cleanup(curlstream->curl);
|
||||
curl_multi_cleanup(curlstream->multi);
|
||||
|
||||
if (curlstream->headers_slist) {
|
||||
curl_slist_free_all(curlstream->headers_slist);
|
||||
}
|
||||
|
||||
/* we are not closing curlstream->readbuf here, because we export
|
||||
* it as a zval with the wrapperdata - the engine will garbage collect it */
|
||||
|
||||
efree(curlstream->url);
|
||||
efree(curlstream);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int php_curl_stream_flush(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
#ifdef ilia_0
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int php_curl_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
|
||||
{
|
||||
/* TODO: fill in details based on Data: and Content-Length: headers, and/or data
|
||||
* from curl_easy_getinfo().
|
||||
* For now, return -1 to indicate that it doesn't make sense to stat this stream */
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int php_curl_stream_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
|
||||
{
|
||||
php_curl_stream *curlstream = (php_curl_stream *) stream->abstract;
|
||||
/* delegate to the readbuffer stream */
|
||||
return php_stream_cast(curlstream->readbuffer.buf, castas, ret, 0);
|
||||
}
|
||||
|
||||
php_stream_ops php_curl_stream_ops = {
|
||||
php_curl_stream_write,
|
||||
php_curl_stream_read,
|
||||
php_curl_stream_close,
|
||||
php_curl_stream_flush,
|
||||
"cURL",
|
||||
NULL, /* seek */
|
||||
php_curl_stream_cast, /* cast */
|
||||
php_curl_stream_stat /* stat */
|
||||
};
|
||||
|
||||
|
||||
php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode,
|
||||
int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
|
||||
{
|
||||
php_stream *stream;
|
||||
php_curl_stream *curlstream;
|
||||
zval *tmp, **ctx_opt = NULL;
|
||||
|
||||
curlstream = emalloc(sizeof(php_curl_stream));
|
||||
memset(curlstream, 0, sizeof(php_curl_stream));
|
||||
|
||||
stream = php_stream_alloc(&php_curl_stream_ops, curlstream, 0, mode);
|
||||
php_stream_context_set(stream, context);
|
||||
|
||||
curlstream->curl = curl_easy_init();
|
||||
curlstream->multi = curl_multi_init();
|
||||
curlstream->pending = 1;
|
||||
curlstream->headers_slist = NULL;
|
||||
|
||||
/* if opening for an include statement, ensure that the local storage will
|
||||
* have a FILE* associated with it.
|
||||
* Otherwise, use the "smart" memory stream that will turn itself into a file
|
||||
* when it gets large */
|
||||
#ifndef HAVE_FOPENCOOKIE
|
||||
if (options & STREAM_WILL_CAST) {
|
||||
curlstream->readbuffer.buf = php_stream_fopen_tmpfile();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
curlstream->readbuffer.buf = php_stream_temp_new();
|
||||
}
|
||||
|
||||
/* curl requires the URL to be valid throughout it's operation, so dup it */
|
||||
curlstream->url = estrdup(filename);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_URL, curlstream->url);
|
||||
|
||||
/* feed curl data into our read buffer */
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_WRITEFUNCTION, on_data_available);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FILE, stream);
|
||||
|
||||
/* feed headers */
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_HEADERFUNCTION, on_header_available);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream);
|
||||
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_ERRORBUFFER, curlstream->errstr);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_VERBOSE, 0);
|
||||
|
||||
/* enable progress notification */
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSFUNCTION, on_progress_avail);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0);
|
||||
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
|
||||
|
||||
/* TODO: read cookies and options from context */
|
||||
if (context && !strncasecmp(filename, "http", sizeof("http")-1)) {
|
||||
/* Protocol version */
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "protocol_version", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_DOUBLE) {
|
||||
if (Z_DVAL_PP(ctx_opt) == 1.1) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
}
|
||||
|
||||
/* HTTP(S) */
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, Z_STRVAL_PP(ctx_opt));
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "header", &ctx_opt)) {
|
||||
if (Z_TYPE_PP(ctx_opt) == IS_ARRAY) {
|
||||
HashPosition pos;
|
||||
zval **header = NULL;
|
||||
|
||||
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(ctx_opt), &pos);
|
||||
SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(ctx_opt), (void *)&header, &pos);
|
||||
zend_hash_move_forward_ex(Z_ARRVAL_PP(ctx_opt), &pos)
|
||||
) {
|
||||
if (Z_TYPE_PP(header) == IS_STRING) {
|
||||
curlstream->headers_slist = curl_slist_append(curlstream->headers_slist, Z_STRVAL_PP(header));
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_PP(ctx_opt) == IS_STRING && Z_STRLEN_PP(ctx_opt)) {
|
||||
char *p, *token, *trimmed, *copy_ctx_opt;
|
||||
|
||||
copy_ctx_opt = php_trim(Z_STRVAL_PP(ctx_opt), Z_STRLEN_PP(ctx_opt), NULL, 0, NULL, 3 TSRMLS_CC);
|
||||
p = php_strtok_r(copy_ctx_opt, "\r\n", &token);
|
||||
while (p) {
|
||||
trimmed = php_trim(p, strlen(p), NULL, 0, NULL, 3 TSRMLS_CC);
|
||||
curlstream->headers_slist = curl_slist_append(curlstream->headers_slist, trimmed);
|
||||
efree(trimmed);
|
||||
p = php_strtok_r(NULL, "\r\n", &token);
|
||||
}
|
||||
efree(copy_ctx_opt);
|
||||
}
|
||||
if (curlstream->headers_slist) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_HTTPHEADER, curlstream->headers_slist);
|
||||
}
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "method", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
|
||||
if (strcasecmp(Z_STRVAL_PP(ctx_opt), "get")) {
|
||||
if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "head")) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_NOBODY, 1);
|
||||
} else {
|
||||
if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "post")) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_POST, 1);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_CUSTOMREQUEST, Z_STRVAL_PP(ctx_opt));
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "content", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDS, Z_STRVAL_PP(ctx_opt));
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDSIZE, (long)Z_STRLEN_PP(ctx_opt));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "proxy", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_PROXY, Z_STRVAL_PP(ctx_opt));
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "http", "max_redirects", &ctx_opt)) {
|
||||
long mr = 20;
|
||||
if (Z_TYPE_PP(ctx_opt) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(ctx_opt), Z_STRLEN_PP(ctx_opt), &mr, NULL, 1)) {
|
||||
if (Z_TYPE_PP(ctx_opt) == IS_LONG) {
|
||||
mr = Z_LVAL_PP(ctx_opt);
|
||||
}
|
||||
}
|
||||
if (mr > 1) {
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
}
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, mr);
|
||||
}
|
||||
} else {
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
}
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, 20L);
|
||||
}
|
||||
} else if (context && !strncasecmp(filename, "ftps", sizeof("ftps")-1)) {
|
||||
if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* prepare for "pull" mode */
|
||||
curl_multi_add_handle(curlstream->multi, curlstream->curl);
|
||||
|
||||
/* Prepare stuff for file_get_wrapper_data: the data is an array:
|
||||
*
|
||||
* data = array(
|
||||
* "headers" => array("Content-Type: text/html", "Xxx: Yyy"),
|
||||
* "readbuf" => resource (equivalent to curlstream->readbuffer)
|
||||
* );
|
||||
* */
|
||||
MAKE_STD_ZVAL(stream->wrapperdata);
|
||||
array_init(stream->wrapperdata);
|
||||
|
||||
MAKE_STD_ZVAL(curlstream->headers);
|
||||
array_init(curlstream->headers);
|
||||
|
||||
add_assoc_zval(stream->wrapperdata, "headers", curlstream->headers);
|
||||
|
||||
MAKE_STD_ZVAL(tmp);
|
||||
php_stream_to_zval(curlstream->readbuffer.buf, tmp);
|
||||
add_assoc_zval(stream->wrapperdata, "readbuf", tmp);
|
||||
|
||||
#ifndef HAVE_FOPENCOOKIE
|
||||
if (options & STREAM_WILL_CAST) {
|
||||
/* we will need to download the whole resource now,
|
||||
* since we cannot get the actual FD for the download,
|
||||
* so we won't be able to drive curl via stdio. */
|
||||
|
||||
/* TODO: this needs finishing */
|
||||
|
||||
curl_easy_perform(curlstream->curl);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* fire up the connection; we need to detect a connection error here,
|
||||
* otherwise the curlstream we return ends up doing nothing useful. */
|
||||
CURLMcode m;
|
||||
CURLMsg *msg;
|
||||
int msgs_left, msg_found = 0;
|
||||
|
||||
while (CURLM_CALL_MULTI_PERFORM == (m = curl_multi_perform(curlstream->multi, &curlstream->pending))) {
|
||||
; /* spin */
|
||||
}
|
||||
|
||||
if (m != CURLM_OK) {
|
||||
#if HAVE_CURL_MULTI_STRERROR
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_multi_strerror(m));
|
||||
#else
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m);
|
||||
#endif
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
/* we have only one curl handle here, even though we use multi syntax,
|
||||
* so it's ok to fail on any error */
|
||||
while ((msg = curl_multi_info_read(curlstream->multi, &msgs_left))) {
|
||||
if (msg->data.result == CURLE_OK) {
|
||||
continue;
|
||||
} else {
|
||||
#if HAVE_CURL_EASY_STRERROR
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_easy_strerror(msg->data.result));
|
||||
#else
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", msg->data.result);
|
||||
#endif
|
||||
msg_found++;
|
||||
}
|
||||
}
|
||||
if (msg_found) {
|
||||
goto exit_fail;
|
||||
}
|
||||
}
|
||||
|
||||
return stream;
|
||||
|
||||
exit_fail:
|
||||
php_stream_close(stream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static php_stream_wrapper_ops php_curl_wrapper_ops = {
|
||||
php_curl_stream_opener,
|
||||
NULL, /* stream_close: curl streams know how to clean themselves up */
|
||||
NULL, /* stream_stat: curl streams know how to stat themselves */
|
||||
NULL, /* stat url */
|
||||
NULL, /* opendir */
|
||||
"cURL", /* label */
|
||||
NULL, /* unlink */
|
||||
NULL, /* rename */
|
||||
NULL, /* mkdir */
|
||||
NULL /* rmdir */
|
||||
};
|
||||
|
||||
php_stream_wrapper php_curl_wrapper = {
|
||||
&php_curl_wrapper_ops,
|
||||
NULL,
|
||||
1 /* is_url */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: noet sw=4 ts=4 fdm=marker
|
||||
* vim<600: noet sw=4 ts=4
|
||||
*/
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Check libcurl config on windows
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
die('skip - curl extension not available in this build');
|
||||
}
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip for windows only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start();
|
||||
phpinfo();
|
||||
$s = ob_get_contents();
|
||||
ob_end_clean();
|
||||
preg_match('/curl\n\n(.+)\n\n/siU', $s, $m);
|
||||
|
||||
echo $m[1], "\n";
|
||||
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
cURL support => enabled
|
||||
cURL Information => %s
|
||||
Age => %d
|
||||
Features
|
||||
AsynchDNS => Yes
|
||||
CharConv => No
|
||||
Debug => No
|
||||
GSS-Negotiate => Yes
|
||||
IDN => Yes
|
||||
IPv6 => Yes
|
||||
krb4 => No
|
||||
Largefile => Yes
|
||||
libz => Yes
|
||||
NTLM => Yes
|
||||
NTLMWB => No
|
||||
SPNEGO => Yes
|
||||
SSL => Yes
|
||||
SSPI => Yes
|
||||
TLS-SRP => No
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
|
||||
Host => %s-pc-win32
|
||||
SSL Version => OpenSSL/%s
|
||||
ZLib Version => %s
|
||||
libSSH Version => libssh2/%s
|
||||
DONE
|
||||
Loaded 100 of 497 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user