mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-18 14:36:38 +00:00
Compare commits
966
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a964242f19 | ||
|
|
ce20287810 | ||
|
|
0a73853798 | ||
|
|
75640d0d85 | ||
|
|
95325e5c5d | ||
|
|
d27b76a779 | ||
|
|
5d13b7f191 | ||
|
|
3ad8616aff | ||
|
|
a67d4d33c2 | ||
|
|
3da5ef47ca | ||
|
|
0842200501 | ||
|
|
b14b8dfc10 | ||
|
|
ef7821506a | ||
|
|
5ba657ce89 | ||
|
|
1c13ad7c0e | ||
|
|
f090ddeac7 | ||
|
|
42fbb952d7 | ||
|
|
b79301d11f | ||
|
|
aaad7ead55 | ||
|
|
407612083f | ||
|
|
54fee59598 | ||
|
|
98fcee48f9 | ||
|
|
220e0d4a55 | ||
|
|
82ecdcdb63 | ||
|
|
c397fcc35f | ||
|
|
770fcdab90 | ||
|
|
35ceea928b | ||
|
|
ea1d42641c | ||
|
|
4cad8fcad2 | ||
|
|
35d213c9ce | ||
|
|
6d20c5bea8 | ||
|
|
3023257ff0 | ||
|
|
3fbacdc6e8 | ||
|
|
b22f33afe2 | ||
|
|
2d625b5f81 | ||
|
|
aa1c4fd0be | ||
|
|
6de915205c | ||
|
|
0edf1d4fe6 | ||
|
|
a827fa9cd8 | ||
|
|
bb422cb60e | ||
|
|
dbcd6304bb | ||
|
|
c18ae51aeb | ||
|
|
3842417289 | ||
|
|
b576cbbf05 | ||
|
|
3b6bf6eec8 | ||
|
|
4aa80db758 | ||
|
|
a10dc3aa4f | ||
|
|
c8617d82cc | ||
|
|
cdb775906d | ||
|
|
70fdb21d93 | ||
|
|
1c7f4d2b4b | ||
|
|
d3dcd61623 | ||
|
|
38248e445d | ||
|
|
6448916535 | ||
|
|
46344b11b4 | ||
|
|
cc9f02751b | ||
|
|
c1aa9baf29 | ||
|
|
5ddee799d2 | ||
|
|
1bad4aa355 | ||
|
|
81098de41c | ||
|
|
f6841d250a | ||
|
|
03c703b8bd | ||
|
|
a328803803 | ||
|
|
5c34146104 | ||
|
|
305c025cdd | ||
|
|
db960e82b4 | ||
|
|
8f43032ea4 | ||
|
|
d7bb09cc1d | ||
|
|
0c381e19ad | ||
|
|
74ce9da5dc | ||
|
|
03fa5501a8 | ||
|
|
4350c89428 | ||
|
|
cd2641973c | ||
|
|
3e6a387454 | ||
|
|
165994043a | ||
|
|
5da403264f | ||
|
|
9280e25534 | ||
|
|
acfed1c4c7 | ||
|
|
03be983398 | ||
|
|
f1493e0069 | ||
|
|
ab8065e4ec | ||
|
|
aca526a13b | ||
|
|
61499bf282 | ||
|
|
742f4704a9 | ||
|
|
4784d99866 | ||
|
|
708af5fd8e | ||
|
|
447ec05f31 | ||
|
|
c1e12316f1 | ||
|
|
e9668d4ce8 | ||
|
|
bb0f0347dd | ||
|
|
0873f2bfb4 | ||
|
|
32d5f269a0 | ||
|
|
dafb2af705 | ||
|
|
ea4cee93c8 | ||
|
|
186ffcb72c | ||
|
|
5272d6c896 | ||
|
|
8b903f24d5 | ||
|
|
68283c9f4a | ||
|
|
0df431482f | ||
|
|
6bad228b4e | ||
|
|
49341e992a | ||
|
|
774f16318b | ||
|
|
5addf223d5 | ||
|
|
a18cec1b86 | ||
|
|
577c6ed0ce | ||
|
|
422dc49c0d | ||
|
|
f96feea00c | ||
|
|
373b9ecd05 | ||
|
|
56293fc0dd | ||
|
|
e097919f16 | ||
|
|
d21d5c98a5 | ||
|
|
5a7497904e | ||
|
|
508c379428 | ||
|
|
fd74024a49 | ||
|
|
89868dd4d9 | ||
|
|
11c707d836 | ||
|
|
1bca3ecacc | ||
|
|
620d7207ef | ||
|
|
b93d040dc5 | ||
|
|
f09f7f22d8 | ||
|
|
3586d14b61 | ||
|
|
fae4f64865 | ||
|
|
53c68811ba | ||
|
|
cfd20c90a5 | ||
|
|
d963cf94a5 | ||
|
|
7c400dc867 | ||
|
|
c2acdbdd3d | ||
|
|
ce4c78dd07 | ||
|
|
5e988a888a | ||
|
|
c02003e6b8 | ||
|
|
0ec122b804 | ||
|
|
6e1e98d7b8 | ||
|
|
00bef4b1c7 | ||
|
|
f9a1eab435 | ||
|
|
de6f297e7c | ||
|
|
dc407c2402 | ||
|
|
5328d42899 | ||
|
|
a0ee96289b | ||
|
|
58c3f7e699 | ||
|
|
2ab2b74af3 | ||
|
|
542a7aceb1 | ||
|
|
05dac1d0a5 | ||
|
|
ba03830241 | ||
|
|
9d39177943 | ||
|
|
947b20bc67 | ||
|
|
7a5f1663c6 | ||
|
|
e74a03fa43 | ||
|
|
801d312507 | ||
|
|
228a3537d3 | ||
|
|
444690eca8 | ||
|
|
5224614f23 | ||
|
|
b1a22ae6dc | ||
|
|
7ab1c07a51 | ||
|
|
d0e10dbde0 | ||
|
|
b4c238c8cf | ||
|
|
9eb726b3ab | ||
|
|
ea8370c29a | ||
|
|
6bf7c10b20 | ||
|
|
1d34d82231 | ||
|
|
aaf197180a | ||
|
|
a981e3a1d2 | ||
|
|
b8d029435d | ||
|
|
0e8637441c | ||
|
|
bfbb409b32 | ||
|
|
173cd183c9 | ||
|
|
b727934591 | ||
|
|
eea75e7146 | ||
|
|
634e6b61d9 | ||
|
|
793f67e852 | ||
|
|
24b72e7a27 | ||
|
|
6adc84a701 | ||
|
|
f413a77b3d | ||
|
|
99b01fb3d7 | ||
|
|
8bc82718ae | ||
|
|
a186312832 | ||
|
|
56f9727305 | ||
|
|
22acea99ff | ||
|
|
84fcc44083 | ||
|
|
1bd3841132 | ||
|
|
59900dd37f | ||
|
|
41569b1029 | ||
|
|
5b8c4b8de5 | ||
|
|
ed4de188dd | ||
|
|
7f43aeb167 | ||
|
|
ad1b9eef98 | ||
|
|
40a9316dff | ||
|
|
9b05f5d132 | ||
|
|
9e76e87ca9 | ||
|
|
ce99f292de | ||
|
|
2b28fd9ab0 | ||
|
|
dae70a2ff7 | ||
|
|
f6db1057fd | ||
|
|
4268504084 | ||
|
|
2dad85ae61 | ||
|
|
8c22352e88 | ||
|
|
d483e1daca | ||
|
|
fdd9bc2050 | ||
|
|
e3abcf7826 | ||
|
|
57d657987d | ||
|
|
95c57bb646 | ||
|
|
cfe24a7be2 | ||
|
|
6e81f80a1e | ||
|
|
b80243aece | ||
|
|
7c9209a0d1 | ||
|
|
9bba219c75 | ||
|
|
5e66ce9293 | ||
|
|
0d4c28f2e1 | ||
|
|
30ec1c0051 | ||
|
|
b05c088a3a | ||
|
|
1ef0bd2633 | ||
|
|
f1206aef70 | ||
|
|
5558d0db9b | ||
|
|
c1d5937f7f | ||
|
|
5811610d71 | ||
|
|
636adf251c | ||
|
|
04a11b850a | ||
|
|
df8e34bcc1 | ||
|
|
3a2660b302 | ||
|
|
d3c4292db7 | ||
|
|
733b09442d | ||
|
|
8c88b6e81c | ||
|
|
1be29a404a | ||
|
|
c5275b4a92 | ||
|
|
442264ffd6 | ||
|
|
3aab84c100 | ||
|
|
fe72caa6e5 | ||
|
|
1010200da5 | ||
|
|
a93e734f81 | ||
|
|
0e023e9784 | ||
|
|
bf3edbada6 | ||
|
|
beda5093b4 | ||
|
|
3636a91adc | ||
|
|
191d9fc227 | ||
|
|
f07e37c96d | ||
|
|
2f3056fecc | ||
|
|
fb99409f89 | ||
|
|
eca0644e0a | ||
|
|
1a4a9eede5 | ||
|
|
774a879e65 | ||
|
|
2f54e68ade | ||
|
|
f53e438933 | ||
|
|
eae91d9de7 | ||
|
|
ce7097fb60 | ||
|
|
286dd4dc71 | ||
|
|
faa7e3264e | ||
|
|
5c69f3dd8b | ||
|
|
c2c4a5bd25 | ||
|
|
1b2f12159b | ||
|
|
42355fb9bf | ||
|
|
a3eafe535f | ||
|
|
fb5d5d9700 | ||
|
|
57b88ba6ea | ||
|
|
20036525e2 | ||
|
|
b8a4a4c700 | ||
|
|
0dc9be6f1e | ||
|
|
8c23b038cd | ||
|
|
4387723ef7 | ||
|
|
65984df220 | ||
|
|
ef86b57f3b | ||
|
|
2fde2ada50 | ||
|
|
7fd9898a2d | ||
|
|
aefc8f22b3 | ||
|
|
51cbb85ea9 | ||
|
|
2876bde634 | ||
|
|
5a0da281e5 | ||
|
|
3db29ee439 | ||
|
|
53b1dce587 | ||
|
|
9302be3754 | ||
|
|
edd90e5ae3 | ||
|
|
86a7731763 | ||
|
|
48bcaf2e72 | ||
|
|
096e40a027 | ||
|
|
99d1a1bb3f | ||
|
|
35b895fdf0 | ||
|
|
920c5508ef | ||
|
|
ee2a7c7d41 | ||
|
|
ad05d3898e | ||
|
|
5c87ed058b | ||
|
|
4c32c8d549 | ||
|
|
c5181ef6c2 | ||
|
|
e08172e0d5 | ||
|
|
f7ac308950 | ||
|
|
f614fc6898 | ||
|
|
d3f390a268 | ||
|
|
e02fdcf3f7 | ||
|
|
af5fa00c97 | ||
|
|
4048872317 | ||
|
|
1a0b80fe90 | ||
|
|
1c3ed86211 | ||
|
|
090c3e87c0 | ||
|
|
63791d055a | ||
|
|
11d102ebbc | ||
|
|
3204ad5858 | ||
|
|
5cc93aa9a6 | ||
|
|
b78d1b901c | ||
|
|
49d46ad29e | ||
|
|
9540ced221 | ||
|
|
eb44463e35 | ||
|
|
b3b1c0b63d | ||
|
|
8871aa912f | ||
|
|
08faf19d09 | ||
|
|
ec6a0966bc | ||
|
|
cbcce72308 | ||
|
|
e00e4b9334 | ||
|
|
2c8aeda6dc | ||
|
|
16ae472769 | ||
|
|
287790d5c8 | ||
|
|
ad2ef3d97e | ||
|
|
f485c84a14 | ||
|
|
22d3eb3117 | ||
|
|
1aa8719e32 | ||
|
|
eaf44ec397 | ||
|
|
6006a3ed51 | ||
|
|
a95a6e93ee | ||
|
|
e8d6c6587d | ||
|
|
2cdf38b7a0 | ||
|
|
2aba2494f5 | ||
|
|
032921d80c | ||
|
|
002c8e8356 | ||
|
|
4141ceb795 | ||
|
|
0ea731fc83 | ||
|
|
cc20351134 | ||
|
|
ff5896a04c | ||
|
|
7a71f5d112 | ||
|
|
964f65484c | ||
|
|
040194d6a0 | ||
|
|
0e273217cf | ||
|
|
7446766dab | ||
|
|
63e7b84593 | ||
|
|
ee1b807219 | ||
|
|
8b0d133b13 | ||
|
|
cf910f351a | ||
|
|
12e222ee91 | ||
|
|
a094f6d255 | ||
|
|
a3d6f28312 | ||
|
|
bbfda90d72 | ||
|
|
a0beddf5e9 | ||
|
|
38e084d312 | ||
|
|
c1f273908e | ||
|
|
7e5de3a1ce | ||
|
|
9d72a84f06 | ||
|
|
fcacee0595 | ||
|
|
b628c36a85 | ||
|
|
55005c8638 | ||
|
|
60ef357ffc | ||
|
|
bbd25ca01f | ||
|
|
d08b4dbf23 | ||
|
|
1c2bcec68a | ||
|
|
5d42ce838c | ||
|
|
f17fe2cabc | ||
|
|
ba4fddd2da | ||
|
|
7ab5c593f7 | ||
|
|
06e6d42ee3 | ||
|
|
68c57f8149 | ||
|
|
9eb0c634d4 | ||
|
|
f453917f62 | ||
|
|
1ec83d44a1 | ||
|
|
c4a3f67708 | ||
|
|
80d58ca8cd | ||
|
|
68556f3384 | ||
|
|
669459da8c | ||
|
|
af147ac9b7 | ||
|
|
91a9d24aa3 | ||
|
|
88a44b15d7 | ||
|
|
ef6538875f | ||
|
|
8e238148f9 | ||
|
|
eb84d5d0a6 | ||
|
|
f244513fc0 | ||
|
|
fca1501ed6 | ||
|
|
3cb056f523 | ||
|
|
e265df460d | ||
|
|
3f6073602b | ||
|
|
62305edc5b | ||
|
|
60fb57d4f6 | ||
|
|
178eac6c98 | ||
|
|
fca331cae9 | ||
|
|
2c204a55af | ||
|
|
5f54cecde9 | ||
|
|
972c451c73 | ||
|
|
1283722589 | ||
|
|
a84e5dc37d | ||
|
|
7ccbfb2e84 | ||
|
|
84cd0f9911 | ||
|
|
89ea2650a1 | ||
|
|
dcc0644cde | ||
|
|
039cb10fa3 | ||
|
|
170cf3ec00 | ||
|
|
5f0428e8cc | ||
|
|
98163c7d1b | ||
|
|
5dee3c11fe | ||
|
|
c5f6d1ab29 | ||
|
|
64d7dd55d3 | ||
|
|
8b7b67a21b | ||
|
|
84b0ab6d8f | ||
|
|
3616db6d38 | ||
|
|
4374a52e9d | ||
|
|
1df558c6a0 | ||
|
|
655f2973eb | ||
|
|
7477f5b387 | ||
|
|
59dcf9879b | ||
|
|
223f7d9a44 | ||
|
|
6612e1ba6a | ||
|
|
caba0203e8 | ||
|
|
275b2c420d | ||
|
|
e55bbd47af | ||
|
|
26f7051cf4 | ||
|
|
13e8486550 | ||
|
|
8558640a6a | ||
|
|
76066b304c | ||
|
|
5efda763be | ||
|
|
17a57ad980 | ||
|
|
c86ba551ac | ||
|
|
30fab784dc | ||
|
|
bd2305f1d2 | ||
|
|
7b0219212d | ||
|
|
9d4001f1c8 | ||
|
|
61103cc25c | ||
|
|
f331ed1414 | ||
|
|
4e7e301dda | ||
|
|
4efa58dd59 | ||
|
|
c3a317117a | ||
|
|
994fcfcff9 | ||
|
|
113f22550a | ||
|
|
d2ab74588e | ||
|
|
41b4b84dda | ||
|
|
7f7c84d64f | ||
|
|
e52334fdbe | ||
|
|
059bc99d94 | ||
|
|
e1fe76f28a | ||
|
|
d0e3173016 | ||
|
|
014c5706a8 | ||
|
|
6c20b07190 | ||
|
|
8bdf272758 | ||
|
|
62ab3af12f | ||
|
|
b86595a37c | ||
|
|
44fb74fad1 | ||
|
|
01c2ec03bc | ||
|
|
d63ed101ee | ||
|
|
d613b0acc2 | ||
|
|
c4145619be | ||
|
|
3ce980cf97 | ||
|
|
babaa43762 | ||
|
|
c1765d7ffe | ||
|
|
1ff28cd0ec | ||
|
|
9b88bc494e | ||
|
|
ec11530620 | ||
|
|
62f6c5853f | ||
|
|
a6f7fca637 | ||
|
|
415233d26d | ||
|
|
2dfb8fbdf4 | ||
|
|
b30304fb78 | ||
|
|
39c53031e0 | ||
|
|
2b811a5aec | ||
|
|
6c259625c4 | ||
|
|
888f467d63 | ||
|
|
ccae70b765 | ||
|
|
156cc39e21 | ||
|
|
497b918e62 | ||
|
|
46566b78c9 | ||
|
|
a28389b2ab | ||
|
|
42562ee913 | ||
|
|
c4c97d878d | ||
|
|
33c7976dfc | ||
|
|
098b4e8f5a | ||
|
|
2ee4c987e6 | ||
|
|
1401314a1b | ||
|
|
2148a88b3d | ||
|
|
2499b6518c | ||
|
|
66bf216c66 | ||
|
|
f887960f9b | ||
|
|
98025a40b8 | ||
|
|
3fcdd6ab0f | ||
|
|
7c904c6cbd | ||
|
|
f5ebea91b0 | ||
|
|
8cde747336 | ||
|
|
89dc5924c9 | ||
|
|
80fa2ff646 | ||
|
|
e1d8c0a051 | ||
|
|
87a87c6682 | ||
|
|
17f6391bf8 | ||
|
|
db6c33875c | ||
|
|
f120463efe | ||
|
|
356c442558 | ||
|
|
737c187013 | ||
|
|
f0634b5be5 | ||
|
|
f7b9c12ed9 | ||
|
|
973f379efc | ||
|
|
96d25b4b76 | ||
|
|
6f0ad9ea12 | ||
|
|
7dec5789fe | ||
|
|
0bf5bce6ad | ||
|
|
3f049bcff2 | ||
|
|
75486555c2 | ||
|
|
78cee12561 | ||
|
|
44c0581e0c | ||
|
|
495d5335f9 | ||
|
|
862c006da1 | ||
|
|
4a1efa350a | ||
|
|
5bd13c5231 | ||
|
|
f2d5b2b6c6 | ||
|
|
5e93a213f6 | ||
|
|
e617dfbdf3 | ||
|
|
06bbb657ad | ||
|
|
0bccd48d3f | ||
|
|
a912fb498e | ||
|
|
68f318a422 | ||
|
|
081e2b9928 | ||
|
|
c8c1205d84 | ||
|
|
119821a452 | ||
|
|
dada2f550f | ||
|
|
f0da85b492 | ||
|
|
ca927bb47e | ||
|
|
1241a63931 | ||
|
|
e378348a31 | ||
|
|
d72621ab9e | ||
|
|
b1ffea3ccc | ||
|
|
1a14eb53c4 | ||
|
|
f8252aa537 | ||
|
|
adca4c355c | ||
|
|
7a9e3e422f | ||
|
|
fd5fbba98c | ||
|
|
a117e6b937 | ||
|
|
03e9878c78 | ||
|
|
ffc0f8a16f | ||
|
|
cb5178a450 | ||
|
|
ddd7ed9b24 | ||
|
|
54a18f3be6 | ||
|
|
72050af855 | ||
|
|
1a624e27a6 | ||
|
|
008842c7fa | ||
|
|
f0ec533573 | ||
|
|
3a8282ed0f | ||
|
|
4dc8610d34 | ||
|
|
601367ee75 | ||
|
|
c946d7f086 | ||
|
|
dc87c208fd | ||
|
|
73b3f58bcd | ||
|
|
73f03a47d0 | ||
|
|
16043b261f | ||
|
|
8391277fb8 | ||
|
|
a92240e209 | ||
|
|
52a44a736b | ||
|
|
990f9c8f3f | ||
|
|
8bda4c685a | ||
|
|
6dd80946a2 | ||
|
|
c17fd65165 | ||
|
|
b9d494a33b | ||
|
|
b033c4fa28 | ||
|
|
eef2978afc | ||
|
|
cf7e73cf26 | ||
|
|
d2e42d5372 | ||
|
|
28fa31d6e5 | ||
|
|
af41914e15 | ||
|
|
cedc718f73 | ||
|
|
c8033ac207 | ||
|
|
3a76cb2d95 | ||
|
|
aa23d754a9 | ||
|
|
a930e04792 | ||
|
|
6e16cc3528 | ||
|
|
ba79c45174 | ||
|
|
1fdca8208f | ||
|
|
8e3c2015dc | ||
|
|
0c74d5ef08 | ||
|
|
7d0493219c | ||
|
|
2dd378df36 | ||
|
|
61db86bff3 | ||
|
|
37ca791a91 | ||
|
|
7946c5a235 | ||
|
|
ff3c6931c0 | ||
|
|
8d3f4b647b | ||
|
|
972935cd95 | ||
|
|
25d355bdb7 | ||
|
|
64906cdc38 | ||
|
|
091b7f841b | ||
|
|
3c673fed34 | ||
|
|
f76d5b3104 | ||
|
|
be8a4474d9 | ||
|
|
3d1fa4cb17 | ||
|
|
d32e180f20 | ||
|
|
b88387d341 | ||
|
|
200c97829d | ||
|
|
ecf7570072 | ||
|
|
e2fc6b52f0 | ||
|
|
eb8dfc85ce | ||
|
|
9989af2e9b | ||
|
|
2cf9560921 | ||
|
|
a8121ca0e1 | ||
|
|
70dd3f1731 | ||
|
|
9acdf71194 | ||
|
|
cab1894b81 | ||
|
|
b31a9cd4da | ||
|
|
518a6ed95b | ||
|
|
7d5c11c235 | ||
|
|
721b9a7c8d | ||
|
|
a9cdf2e2e3 | ||
|
|
fad14e3180 | ||
|
|
020e161966 | ||
|
|
27849c998a | ||
|
|
36d3c83abd | ||
|
|
d595502d0a | ||
|
|
d8ed84e4c4 | ||
|
|
eb0eac75ef | ||
|
|
e5738d3bc9 | ||
|
|
b9737aa08e | ||
|
|
e4876ecbfb | ||
|
|
32333abe3e | ||
|
|
a861a3a93d | ||
|
|
25d801f97e | ||
|
|
c4b7cdb41e | ||
|
|
6b804b96b8 | ||
|
|
1b922895fc | ||
|
|
cf89ff3d24 | ||
|
|
515c103a08 | ||
|
|
af09d8b96a | ||
|
|
b084157d3d | ||
|
|
e590aceb5a | ||
|
|
9a9add6b73 | ||
|
|
014b95a0a7 | ||
|
|
5d08cae346 | ||
|
|
c2a9f73c99 | ||
|
|
a33759fd27 | ||
|
|
834b719cf5 | ||
|
|
bc0b6e02e4 | ||
|
|
731013ee8e | ||
|
|
f7e381eef6 | ||
|
|
fed56fbae8 | ||
|
|
330ffe2e24 | ||
|
|
c34f26a938 | ||
|
|
bbd0781b39 | ||
|
|
1533f98afd | ||
|
|
e73c05b75e | ||
|
|
574f230d3c | ||
|
|
b8d75cc464 | ||
|
|
3eb8102348 | ||
|
|
c126c16479 | ||
|
|
e8995c8cb0 | ||
|
|
9d4adf4fe1 | ||
|
|
cf90bd92bf | ||
|
|
0bbacd8678 | ||
|
|
db9d911093 | ||
|
|
7c60a09cae | ||
|
|
6b6b2149af | ||
|
|
c9680697ec | ||
|
|
362b70a32c | ||
|
|
af545ead97 | ||
|
|
36c445970e | ||
|
|
e424049840 | ||
|
|
2e459be237 | ||
|
|
43ac0ab673 | ||
|
|
d022c8565d | ||
|
|
eca13f7909 | ||
|
|
79b3c2a744 | ||
|
|
cbb2dc0788 | ||
|
|
9443fb999d | ||
|
|
488e64dbe4 | ||
|
|
1cb4398ac1 | ||
|
|
a2d7e336e6 | ||
|
|
06feb15a16 | ||
|
|
5fc7382a57 | ||
|
|
b1df743b7a | ||
|
|
c73b0543f1 | ||
|
|
623888adc0 | ||
|
|
2c1385b7f5 | ||
|
|
5abaf7cc87 | ||
|
|
8bb84693b3 | ||
|
|
bfbdc032b6 | ||
|
|
561843c973 | ||
|
|
703154321f | ||
|
|
603ebc70ff | ||
|
|
ccd4bf5147 | ||
|
|
6ed83d37af | ||
|
|
fa01db3466 | ||
|
|
cb0e6124d4 | ||
|
|
82e92c99a6 | ||
|
|
33d372a45f | ||
|
|
816a5d2072 | ||
|
|
9137acc7ec | ||
|
|
dae8ff251c | ||
|
|
79bfef5ba3 | ||
|
|
42a43d4531 | ||
|
|
fd20278fa5 | ||
|
|
bd961f3e87 | ||
|
|
afb0675e3b | ||
|
|
1d51c43287 | ||
|
|
1b8679401c | ||
|
|
cb9ce48d02 | ||
|
|
95e0de7cfa | ||
|
|
b59831bc30 | ||
|
|
38797e598b | ||
|
|
4b06e0a2d0 | ||
|
|
d0a6f8c68e | ||
|
|
afc24da436 | ||
|
|
96d0bb7bca | ||
|
|
95c73f99d3 | ||
|
|
d3b484df82 | ||
|
|
2eae187949 | ||
|
|
cefa7f8d08 | ||
|
|
44053a9dae | ||
|
|
da4c7af358 | ||
|
|
2f5ba1ef69 | ||
|
|
d18089d621 | ||
|
|
2b3483249c | ||
|
|
9ab73c52ab | ||
|
|
bcff8d1b26 | ||
|
|
56cbe04381 | ||
|
|
82a98f6e52 | ||
|
|
2bc0dbab44 | ||
|
|
781d0b9ee3 | ||
|
|
bab017ddfd | ||
|
|
bd95716b8e | ||
|
|
f8fe09dcef | ||
|
|
a4c7ab8399 | ||
|
|
a031dc06d9 | ||
|
|
47b5873c5d | ||
|
|
d6fb7b8f2e | ||
|
|
480e4f8541 | ||
|
|
aad7b72472 | ||
|
|
e1b1ef0d79 | ||
|
|
4d9c556b5d | ||
|
|
eb6941e902 | ||
|
|
6e15afd1be | ||
|
|
a59ec5d1b0 | ||
|
|
ee7671afb5 | ||
|
|
593505f266 | ||
|
|
8cdefd3d10 | ||
|
|
d8ed537cd4 | ||
|
|
4bab2d2f90 | ||
|
|
043bfd6e2c | ||
|
|
85b5907e85 | ||
|
|
60ed3f78bd | ||
|
|
bca0e5edd5 | ||
|
|
c6a4a7cad6 | ||
|
|
a97ae8bc06 | ||
|
|
5c8a0c92d1 | ||
|
|
2198bbce86 | ||
|
|
3f258e6b46 | ||
|
|
756ee95605 | ||
|
|
4b738cee2b | ||
|
|
5b6ef90bc0 | ||
|
|
ee6cc5ba60 | ||
|
|
e37144f44b | ||
|
|
1b92ce9a1b | ||
|
|
865a41a6a3 | ||
|
|
bab960069c | ||
|
|
c3d76441d5 | ||
|
|
1c5f8ca7e1 | ||
|
|
28debb4717 | ||
|
|
58e3fcf54f | ||
|
|
d1b02fe2fe | ||
|
|
f13fdbe9a0 | ||
|
|
c3a897bf3d | ||
|
|
a6eee49326 | ||
|
|
b82ad53b29 | ||
|
|
fde1e44d62 | ||
|
|
5389d0963c | ||
|
|
78e8690dee | ||
|
|
5db16dd989 | ||
|
|
b6edbd5897 | ||
|
|
f51555ca58 | ||
|
|
31f5515059 | ||
|
|
851f362882 | ||
|
|
aebfc519ea | ||
|
|
f06b3432c8 | ||
|
|
b9a87a5079 | ||
|
|
884bbcd537 | ||
|
|
dcf27a1f6f | ||
|
|
9f94e0b51c | ||
|
|
3a9829af20 | ||
|
|
d0c9207cff | ||
|
|
742fc5fb35 | ||
|
|
081c8e9d92 | ||
|
|
b98b093d73 | ||
|
|
b9ba011c0f | ||
|
|
df6bfe3be2 | ||
|
|
258d04df5c | ||
|
|
225f534b1a | ||
|
|
5d0d88d1f2 | ||
|
|
14c08ea362 | ||
|
|
b67c8b8603 | ||
|
|
0746e6af08 | ||
|
|
e244e2245b | ||
|
|
ce1fd72776 | ||
|
|
67d281f093 | ||
|
|
6d4d4155d2 | ||
|
|
10eb007070 | ||
|
|
fe3c8de9d5 | ||
|
|
ca313caa4b | ||
|
|
afa03a470e | ||
|
|
c0d26bb138 | ||
|
|
3fa164c24b | ||
|
|
47204c6341 | ||
|
|
143bb29c1a | ||
|
|
e2fcc870e3 | ||
|
|
e272225e2a | ||
|
|
d9036d14f7 | ||
|
|
a7d3606650 | ||
|
|
633f898f15 | ||
|
|
3e82ff615f | ||
|
|
6b5c9f6c5a | ||
|
|
fdaf3996af | ||
|
|
6d2cf0f2a4 | ||
|
|
4019531748 | ||
|
|
967a6771d3 | ||
|
|
996182993d | ||
|
|
e2e93ac259 | ||
|
|
366bf38b4f | ||
|
|
1952750af6 | ||
|
|
e392e730ea | ||
|
|
e95a2925fc | ||
|
|
8dd99dd2dc | ||
|
|
a289b37f48 | ||
|
|
54b1829f75 | ||
|
|
1cc5d1009f | ||
|
|
ee4b3892f8 | ||
|
|
0afcbb0ba9 | ||
|
|
be354936b7 | ||
|
|
aa84d906d8 | ||
|
|
bd8cd98d6d | ||
|
|
a6ad3a558a | ||
|
|
bdd65b578c | ||
|
|
9f449df1e4 | ||
|
|
89f864c547 | ||
|
|
29e74ebf65 | ||
|
|
8da9b7e3a2 | ||
|
|
07dafa8940 | ||
|
|
791828d00c | ||
|
|
0634f176a8 | ||
|
|
0b19b9dd0c | ||
|
|
cadc909bb7 | ||
|
|
140769a9d9 | ||
|
|
58b7f21c3f | ||
|
|
c612440e0f | ||
|
|
b79d2285df | ||
|
|
1e752ce9c5 | ||
|
|
4e4d319e62 | ||
|
|
bd9aa181dc | ||
|
|
a80cec1190 | ||
|
|
d980101803 | ||
|
|
3e59f041da | ||
|
|
b2cd56c3cb | ||
|
|
0bc96ef3cc | ||
|
|
e19e266ae1 | ||
|
|
66f76ec1f9 | ||
|
|
641a0c86d9 | ||
|
|
b04159eed4 | ||
|
|
8a1d248d4e | ||
|
|
baafdad150 | ||
|
|
786234d351 | ||
|
|
6877af3f71 | ||
|
|
1641d2afbe | ||
|
|
1fce0887a3 | ||
|
|
796bfb0bd0 | ||
|
|
1f3af9cd21 | ||
|
|
e5ec5fc9cc | ||
|
|
3cabee71ab | ||
|
|
4af3e39147 | ||
|
|
ff95046b76 | ||
|
|
c3bf5dc904 | ||
|
|
d392de0ff7 | ||
|
|
a9e0202a5d | ||
|
|
d8aa130296 | ||
|
|
5fd6365c77 | ||
|
|
c744605dc7 | ||
|
|
f89f66d762 | ||
|
|
2a83295b14 | ||
|
|
a9c0d319eb | ||
|
|
7b44890ac4 | ||
|
|
c7220dc6c5 | ||
|
|
170db1c577 | ||
|
|
4a2b39269f | ||
|
|
d4bc18bbe8 | ||
|
|
a59559a173 | ||
|
|
56854511d8 | ||
|
|
53daf94f28 | ||
|
|
3f4134c00c | ||
|
|
f7f524aada | ||
|
|
3fcdecf658 | ||
|
|
f275fdcf00 | ||
|
|
5f89934686 | ||
|
|
7d5f806e77 | ||
|
|
417dbfbacc | ||
|
|
a32f1b4654 | ||
|
|
a12c896dba | ||
|
|
f9537c2a0b | ||
|
|
6f14b5ab41 | ||
|
|
53f34bca76 | ||
|
|
8c9fd8fb53 | ||
|
|
9f251548ae | ||
|
|
cdf1dcc497 | ||
|
|
a01853de78 | ||
|
|
1fd53fd2ae | ||
|
|
8cec20a565 | ||
|
|
a65a546640 | ||
|
|
9d84f6c06e | ||
|
|
fbb1827da8 | ||
|
|
7ce88b2d8a | ||
|
|
5ff9089aeb | ||
|
|
6e0b8b4288 | ||
|
|
832c21cabf | ||
|
|
5778e010b7 | ||
|
|
2976f7dae7 | ||
|
|
cf0741fd5b | ||
|
|
5cc851e83e | ||
|
|
b60cb2b88a | ||
|
|
65adb74984 | ||
|
|
19524fc6fe | ||
|
|
734d887b40 | ||
|
|
ce8dc0ede2 | ||
|
|
f073588e75 | ||
|
|
81c29af865 | ||
|
|
8582353700 | ||
|
|
a7ec000f35 | ||
|
|
23d952ed60 | ||
|
|
f9829690d4 | ||
|
|
c09bd9def0 | ||
|
|
35101e9ef4 | ||
|
|
71b8f59ebb | ||
|
|
91fecd7673 | ||
|
|
2537fdf0c8 | ||
|
|
0dc1072a19 | ||
|
|
cbd108abf1 | ||
|
|
6188674f1e | ||
|
|
21c973d3de | ||
|
|
b0273e749c | ||
|
|
ebdfef807a | ||
|
|
88bd558a73 | ||
|
|
891477dc1c | ||
|
|
f88ff6c661 | ||
|
|
0c94f8a893 | ||
|
|
e55bd70643 | ||
|
|
261a5305c6 | ||
|
|
c768abd420 | ||
|
|
1c0fccfc9a | ||
|
|
2e4aed3673 | ||
|
|
ab16299355 | ||
|
|
3714352cb1 | ||
|
|
f27be2fded | ||
|
|
992a8d0411 | ||
|
|
b12286461d | ||
|
|
a1f5925652 | ||
|
|
f4a7e50156 | ||
|
|
66e93a7820 | ||
|
|
78e274af31 | ||
|
|
f4eeda9a9b | ||
|
|
c64d692f49 | ||
|
|
433bc142a6 | ||
|
|
a1a57827e1 | ||
|
|
6ee1da1f55 | ||
|
|
e2172ba39c | ||
|
|
3f70e9f8bd | ||
|
|
5e351695b6 | ||
|
|
0dbc5c2087 | ||
|
|
0a8c20e740 | ||
|
|
a7b0dfb7b1 | ||
|
|
d3c8d76e5b | ||
|
|
9ce9f48fb6 | ||
|
|
75b4b4676b | ||
|
|
0ca7f72130 | ||
|
|
f312f6bad2 | ||
|
|
85b97c0f70 | ||
|
|
2e5d78192e | ||
|
|
488dd317fe | ||
|
|
fb3e21fbcc | ||
|
|
07b9db3def | ||
|
|
9b54901ffb | ||
|
|
82a4f1a1a2 |
No files matched your search
@@ -246,6 +246,8 @@ sapi/fpm/php-fpm.1
|
||||
sapi/fpm/init.d.php-fpm
|
||||
sapi/fpm/php-fpm.conf
|
||||
sapi/fpm/fpm/php-cgi
|
||||
sapi/phpdbg/phpdbg_parser.c
|
||||
sapi/phpdbg/phpdbg_parser.h
|
||||
sapi/phpdbg/phpdbg
|
||||
scripts/php-config
|
||||
scripts/phpize
|
||||
|
||||
+5
-1
@@ -15,8 +15,12 @@ env:
|
||||
- PDO_MYSQL_TEST_USER=travis
|
||||
- PDO_MYSQL_TEST_PASS=
|
||||
- PDO_MYSQL_TEST_HOST=127.0.0.1
|
||||
matrix:
|
||||
- REPORT_EXIT_STATUS=1
|
||||
matrix:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=1
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
|
||||
@@ -115,7 +115,6 @@ clean:
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
find . -name \*.1 | xargs rm -f
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
|
||||
@@ -1,6 +1,332 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2014, PHP 5.6.0 Alpha 3
|
||||
01 May 2014, PHP 5.6.0 Beta 2
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65701 (copy() doesn't work when destination filename is created
|
||||
by tempnam()). (Boro Sitnikovski)
|
||||
. Fixed bug #66015 (Unexpected array indexing in class's static property). (Bob)
|
||||
. Added (constant) string/array dereferencing to static scalar expressions
|
||||
to complete the set; now possible thanks to bug #66015 being fixed. (Bob)
|
||||
. Fixed bug #66568 (Update reflection information for unserialize() function).
|
||||
(Ferenc)
|
||||
. Fixed bug #66660 (Composer.phar install/update fails). (Ferenc)
|
||||
. Fixed bug #67024 (getimagesize should recognize BMP files with negative
|
||||
height). (Gabor Buella)
|
||||
. Fixed bug #67064 (Countable interface prevents using 2nd parameter
|
||||
($mode) of count() function). (Bob)
|
||||
. Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
|
||||
. Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #64247 (CURLOPT_INFILE doesn't allow reset). (Mike)
|
||||
. Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
|
||||
(Freek Lijten)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66721 (__wakeup of DateTime segfaults when invalid object data is
|
||||
supplied). (Boro Sitnikovski)
|
||||
. Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag,
|
||||
not only the subset). (Anatol)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #66907 (Solaris 10 is missing strcasestr and needs substitute).
|
||||
(Anatol)
|
||||
. Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
|
||||
. Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
|
||||
(Julio Pintos)
|
||||
. Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
|
||||
default configuration) (CVE-2014-0185). (Stas)
|
||||
|
||||
- GMP:
|
||||
. Fixed crashes in serialize/unserialize. (Stas)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #66021 (Blank line inside empty array/object when
|
||||
JSON_PRETTY_PRINT is set). (Kevin Israel)
|
||||
|
||||
- LDAP:
|
||||
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
|
||||
|
||||
- litespeed
|
||||
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
|
||||
(George Wang)
|
||||
|
||||
- mysqlnd:
|
||||
. Added a new fetching mode to mysqlnd. (Andrey)
|
||||
|
||||
- OpenSSL:
|
||||
. Fix bug #66942 (memory leak in openssl_seal()). (Chuan Ma)
|
||||
. Fix bug #66952 (memory leak in openssl_open()). (Chuan Ma)
|
||||
. Fix bug #66840 (Fix broken build when extension built separately).
|
||||
(Daniel Lowrey)
|
||||
|
||||
- phpdbg:
|
||||
. Added watchpoints (watch command). (Bob)
|
||||
. Renamed some commands (next => continue and how to step). (Joe)
|
||||
. Fixed issue #85 (https://github.com/krakjoe/phpdbg/issues/85). (Bob)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
|
||||
(Matteo)
|
||||
|
||||
- PDO-ODBC:
|
||||
. Fixed bug #50444 (PDO-ODBC changes for 64-bit).
|
||||
|
||||
- Phar:
|
||||
. Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
|
||||
in its name). (PR #588)
|
||||
|
||||
- SQLite:
|
||||
. Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol)
|
||||
|
||||
- Apache2 Handler SAPI:
|
||||
. Fixed Apache log issue caused by APR's lack of support for %zu
|
||||
(APR issue https://issues.apache.org/bugzilla/show_bug.cgi?id=56120).
|
||||
(Jeff Trawick)
|
||||
|
||||
10 Apr 2014, PHP 5.6.0 Beta 1
|
||||
|
||||
- Core:
|
||||
. Allow zero length comparison in substr_compare() (Tjerk)
|
||||
. Fixed bug #60602 (proc_open() changes environment array) (Tjerk)
|
||||
. Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
|
||||
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
|
||||
UNIX sockets). (Mike)
|
||||
. Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
|
||||
. Fixed bug #66736 (fpassthru broken). (Mike)
|
||||
. Fixed bug #66822 (Cannot use T_POW in const expression) (Tjerk)
|
||||
. Fixed bug #67043 (substr_compare broke by previous change) (Tjerk)
|
||||
|
||||
- SPL:
|
||||
. Added feature #65545 (SplFileObject::fread()) (Tjerk)
|
||||
. Fixed bug #66834 (empty() does not work on classes that extend ArrayObject) (Tjerk)
|
||||
. Fixed bug #66702 (RegexIterator::INVERT_MATCH does not invert). (Joshua
|
||||
Thijssen)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #66109 (Can't reset CURLOPT_CUSTOMREQUEST to default behaviour)
|
||||
(Tjerk)
|
||||
. Fix compilation on libcurl versions between 7.10.5 and 7.12.2, inclusive.
|
||||
(Adam)
|
||||
|
||||
- Date:
|
||||
. Added DateTimeImmutable::createFromMutable to create a DateTimeImmutable
|
||||
object from an existing DateTime (mutable) object (Derick)
|
||||
|
||||
- Embed:
|
||||
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol).
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #66820 (out-of-bounds memory access in fileinfo)
|
||||
(CVE-2014-2270). (Remi)
|
||||
. Fixed bug #66946i (fileinfo: extensive backtracking in awk rule regular
|
||||
expression). (CVE-2013-7345) (Remi)
|
||||
. Fixed bug #66987 (Memory corruption in fileinfo ext / bigendian).
|
||||
(Remi)
|
||||
|
||||
|
||||
- GD:
|
||||
. Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer
|
||||
CVE-2013-7327). (Tomas Hoger, Remi).
|
||||
. Fixed #66869 (Invalid 2nd argument crashes imageaffinematrixget) (Pierre)
|
||||
. Fixed bug #66887 (imagescale - poor quality of scaled image). (Remi)
|
||||
. Fixed bug #66890 (imagescale segfault). (Remi)
|
||||
. Fixed bug #66893 (imagescale ignore method argument). (Remi)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #66872 (invalid argument crashes gmp_testbit) (Pierre)
|
||||
|
||||
- Hash:
|
||||
. Fixed bug #66698 (Missing FNV1a32 and FNV1a64 hash functions).
|
||||
(Michael M Slusarz).
|
||||
. Implemented timing attack safe string comparison function
|
||||
(RFC: https://wiki.php.net/rfc/timing_attack). (Rouven Weßling)
|
||||
. hash_pbkdf2() now works correctly if the $length argument is not specified.
|
||||
(Nikita)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #66873 (A reproductible crash in UConverter when given invalid
|
||||
encoding) (Stas)
|
||||
|
||||
- Mail:
|
||||
. Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk)
|
||||
|
||||
- Mbstring:
|
||||
. Upgraded to oniguruma 5.9.5 (Anatol)
|
||||
|
||||
- Mcrypt:
|
||||
. No longer allow invalid key sizes, invalid IV sizes or missing required IV
|
||||
in mcrypt_encrypt, mcrypt_decrypt and the deprecated mode functions.
|
||||
(Nikita)
|
||||
. Use /dev/urandom as the default source for mcrypt_create_iv(). (Nikita)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #66762 (Segfault in mysqli_stmt::bind_result() when link closed)
|
||||
(Remi)
|
||||
|
||||
- OCI8
|
||||
. Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
|
||||
(Perrier, Chris Jones)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed memory leak in windows cert verification on verify failure.
|
||||
(Chris Wright)
|
||||
. Peer certificate capturing via SSL context options now functions even if
|
||||
peer verification fails. (Daniel Lowrey)
|
||||
. Encrypted TLS servers now support the server name indication TLS extension
|
||||
via the new "SNI_server_certs" SSL context option. (Daniel Lowrey)
|
||||
. Fixed bug #66833 (Default disgest algo is still MD5, switch to SHA1). (Remi)
|
||||
|
||||
- PCRE:
|
||||
. Added support for (*MARK) backtracking verbs. (Nikita)
|
||||
|
||||
- PDO_firebird:
|
||||
. Fixed Bug #66071 (memory corruption in error handling) (Popa)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Cleaned up code by increasing the requirements to libpq versions providing
|
||||
PQexecParams, PQprepare, PQescapeStringConn, PQescapeByteaConn. According
|
||||
to the release notes that means 8.0.8+ or 8.1.4+. (Matteo)
|
||||
. Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
|
||||
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
|
||||
(Matteo)
|
||||
. Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
|
||||
without preparing them, while still passing parameters separately from
|
||||
the command text using PQexecParams. (Matteo)
|
||||
|
||||
- Pgsql:
|
||||
. Read-only access to the socket stream underlying database connections is
|
||||
exposed via a new pg_socket() function to allow read/write polling when
|
||||
establishing asynchronous connections and executing queries in non-blocking
|
||||
applications. (Daniel Lowrey)
|
||||
. Asynchronous connections are now possible using the PGSQL_CONNECT_ASYNC
|
||||
flag in conjunction with a new pg_connect_poll() function and connection
|
||||
polling status constants. (Daniel Lowrey)
|
||||
. New pg_flush() and pg_consume_input() functions added to manually complete
|
||||
non-blocking reads/writes to underlying connection sockets. (Daniel Lowrey)
|
||||
|
||||
- Session
|
||||
. Remove session_gc() and session_serializer_name() wich were introduced in the first 5.6.0 alpha.
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #66084 (simplexml_load_string() mangles empty node name)
|
||||
(Anatol)
|
||||
|
||||
- SQLite:
|
||||
. Updated the bundled libsqlite to the version 3.8.3.1 (Anatol)
|
||||
|
||||
- XSL:
|
||||
. Fixed bug #53965 (<xsl:include> cannot find files with relative paths
|
||||
when loaded with "file://"). (Anatol)
|
||||
|
||||
27 Feb 2014, PHP 5.6.0 Alpha 3
|
||||
|
||||
- Core
|
||||
. Expose get_debug_info class hook as __debugInfo() magic method. (Sara)
|
||||
. Implemented unified default encoding
|
||||
(RFC: https://wiki.php.net/rfc/default_encoding). (Yasuo Ohgaki)
|
||||
|
||||
- Curl
|
||||
. Check for openssl.cafile ini directive when loading CA certs. (Daniel Lowrey)
|
||||
. Remove cURL close policy related constants as these have no effect and are
|
||||
no longer used in libcurl. (Chris Wright)
|
||||
|
||||
- Fileinfo
|
||||
. Upgraded to libmagic-5.17 (Anatol)
|
||||
. Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi)
|
||||
|
||||
- FPM:
|
||||
. Added clear_env configuration directive to disable clearenv() call.
|
||||
(Github PR# 598, Paul Annesley)
|
||||
|
||||
- GD:
|
||||
. Fixed imagettftext to load the correct character map rather than the last one.
|
||||
(Scott)
|
||||
. Fixed bug #66714 ( imageconvolution breakage). (Brad Daily)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #65753 (JsonSerializeable couldn't implement on module extension)
|
||||
(chobieeee@php.net)
|
||||
|
||||
- OPCache
|
||||
. Added function opcache_is_script_cached(). (Danack)
|
||||
. Added information about interned strings usage. (Terry, Julien, Dmitry)
|
||||
|
||||
- OpenSSL
|
||||
. Fallback to Windows CA cert store for peer verification if no openssl.cafile
|
||||
ini directive or "cafile" SSL context option specified in Windows.
|
||||
(Chris Wright)
|
||||
. The openssl.cafile and openssl.capath ini directives introduced in alpha2
|
||||
now have PHP_INI_PERDIR accessibility (was PHP_INI_ALL). (Daniel Lowrey)
|
||||
. New "peer_name" SSL context option replaces "CN_match" (which still works
|
||||
as before but triggers E_DEPRECATED). (Daniel Lowrey)
|
||||
. Fixed segfault when accessing non-existent context for client SNI use
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #66501 (Add EC key support to php_openssl_is_private_key).
|
||||
(Mark Zedwood)
|
||||
. Fixed Bug #47030 (add new boolean "verify_peer_name" SSL context option
|
||||
allowing clients to verify cert names separately from the cert itself).
|
||||
"verify_peer_name" is enabled by default for client streams.
|
||||
(Daniel Lowrey)
|
||||
. Fixed Bug #65538 ("cafile" SSL context option now supports stream
|
||||
wrappers). (Daniel Lowrey)
|
||||
. New openssl_get_cert_locations() function to aid CA file and peer
|
||||
verification debugging. (Daniel Lowrey)
|
||||
. Encrypted stream wrappers now disable TLS compression by default.
|
||||
(Daniel Lowrey)
|
||||
. New "capture_session_meta" SSL context option allows encrypted client and
|
||||
server streams access to negotiated protocol/cipher information.
|
||||
(Daniel Lowrey)
|
||||
. New "honor_cipher_order" SSL context option allows servers to prioritize
|
||||
cipher suites of their choosing when negotiating SSL/TLS handshakes.
|
||||
(Daniel Lowrey)
|
||||
. New "single_ecdh_use" and "single_dh_use" SSL context options allow for
|
||||
improved forward secrecy in encrypted stream servers. (Daniel Lowrey)
|
||||
. New "dh_param" SSL context option allows stream servers control over
|
||||
the parameters when negotiating DHE cipher suites. (Daniel Lowrey)
|
||||
. New "ecdh_curve" SSL context option allowing stream servers to specify
|
||||
the curve to use when negotiating ephemeral ECDHE ciphers (defaults to
|
||||
NIST P-256). (Daniel Lowrey)
|
||||
. New "rsa_key_size" SSL context option gives stream servers control
|
||||
over the key size (in bits) used for RSA key agreements. (Daniel Lowrey)
|
||||
. Crypto methods for encrypted client and server streams now use
|
||||
bitwise flags for fine-grained protocol support. (Daniel Lowrey)
|
||||
. Added new tlsv1.0 stream wrapper to specify TLSv1 client/server method.
|
||||
tls wrapper now negotiates TLSv1, TLSv1.1 or TLSv1.2. (Daniel Lowrey)
|
||||
. Encrypted client streams now enable SNI by default. (Daniel Lowrey)
|
||||
. Encrypted streams now prioritize ephemeral key agreement and high strength
|
||||
ciphers by default. (Daniel Lowrey)
|
||||
. New OPENSSL_DEFAULT_STREAM_CIPHERS constant exposes default cipher
|
||||
list. (Daniel Lowrey)
|
||||
. New STREAM_CRYPTO_METHOD_* constants for enhanced control over the crypto
|
||||
methods negotiated encrypted server/client sessions. (Daniel Lowrey)
|
||||
. Encrypted stream servers now automatically mitigate potential DoS vector
|
||||
arising from client-initiated TLS renegotiation. New "reneg_limit",
|
||||
"reneg_window" and "reneg_limit_callback" SSL context options for custom
|
||||
renegotiation limiting control. (Daniel Lowrey)
|
||||
|
||||
- Pgsql:
|
||||
. pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
|
||||
(Yasuo)
|
||||
. Impremented FR #25854 Return value for pg_insert should be resource instead of bool.
|
||||
(Yasuo)
|
||||
. Implemented FR #41146 - Add "description" with exteneded flag pg_meta_data().
|
||||
pg_meta_data(resource $conn, string $table [, bool extended])
|
||||
It also made pg_meta_data() return "is enum" always.
|
||||
(Yasuo)
|
||||
|
||||
13 Feb 2014, PHP 5.6.0 Alpha 2
|
||||
- Core:
|
||||
@@ -14,6 +340,13 @@ PHP NEWS
|
||||
- PCRE:
|
||||
. Upgraded to PCRE 8.34. (Anatol)
|
||||
|
||||
- ldap
|
||||
. Added new function ldap_modify_batch(). (Ondrej Hosek)
|
||||
|
||||
- OpenSSL
|
||||
. Peer certificates now verified by default in client socket operations
|
||||
(RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
|
||||
. New openssl.cafile and openssl.capath ini directives. (Daniel Lowrey)
|
||||
|
||||
23 Jan 2014, PHP 5.6.0 Alpha 1
|
||||
- CLI server:
|
||||
@@ -47,6 +380,10 @@ PHP NEWS
|
||||
. Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
|
||||
or safe_mode). (Adam)
|
||||
|
||||
- FPM
|
||||
. Included apparmor support in fpm
|
||||
(RFC: https://wiki.php.net/rfc/fpm_change_hat). (Gernot Vormayr)
|
||||
|
||||
- GMP:
|
||||
. Moved GMP to use object as the underlying structure and implemented various
|
||||
improvements based on this.
|
||||
@@ -74,7 +411,7 @@ PHP NEWS
|
||||
cache_slots) in op_array->literals table. (Laruence, Dmitry)
|
||||
. Added script level constant replacement optimization pass. (Dmitry)
|
||||
|
||||
- Openssl:
|
||||
- OpenSSL:
|
||||
. Added crypto_method option for the ssl stream context. (Martin Jansen)
|
||||
. Added certificate fingerprint support. (Tjerk Meesters)
|
||||
. Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
|
||||
@@ -82,8 +419,6 @@ PHP NEWS
|
||||
. Peer name verification matches SAN DNS names for certs using
|
||||
the Subject Alternative Name x509 extension. (Daniel Lowrey)
|
||||
. Fixed segfault when built against OpenSSL>=1.0.1 (Daniel Lowrey)
|
||||
. Peer certificates now verified by default in client socket operations
|
||||
(RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
|
||||
. Added SPKAC support. (Jason Gerfen)
|
||||
|
||||
- PDO_pgsql:
|
||||
@@ -104,11 +439,9 @@ PHP NEWS
|
||||
- Session:
|
||||
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
|
||||
(Yasuo)
|
||||
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
|
||||
. Implemented Request #17860 (Session write short circuit). (Yasuo)
|
||||
. Implemented Request #20421 (session_abort() and session_reset() function).
|
||||
(Yasuo)
|
||||
. Implemented Request #11100 (session_gc() function). (Yasuo)
|
||||
|
||||
- Standard:
|
||||
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
|
||||
|
||||
@@ -139,7 +139,7 @@ Rolling a stable release
|
||||
1. Checkout your release branch, you should have created when releasing previous RC
|
||||
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
|
||||
2. If a CVE commit needs to be merged to the release, then have it commited to
|
||||
2. If a CVE commit needs to be merged to the release, then have it committed to
|
||||
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
|
||||
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
|
||||
Don't forget to update NEWS manually in an extra commit then.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define TSRM_CONFIG_COMMON_H
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
# if WINNT|WIN32
|
||||
# ifdef _WIN32
|
||||
# define TSRM_WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -1,25 +1,40 @@
|
||||
$Id$
|
||||
|
||||
PHP X.Y UPGRADE NOTES
|
||||
PHP 5.6 UPGRADE NOTES
|
||||
|
||||
1. Backward Incompatible Changes
|
||||
2. New Features
|
||||
2. Changes in SAPI modules
|
||||
3. Deprecated Functionality
|
||||
4. Changed Functions
|
||||
5. New Functions
|
||||
6. New Classes and Interfaces
|
||||
7. Removed Extensions
|
||||
8. Other Changes to Extensions
|
||||
9. New Global Constants
|
||||
10. Changes to INI File Handling
|
||||
11. Other Changes
|
||||
3. Changes in SAPI modules
|
||||
4. Deprecated Functionality
|
||||
5. Changed Functions
|
||||
6. New Functions
|
||||
7. New Classes and Interfaces
|
||||
8. Removed Extensions
|
||||
9. Other Changes to Extensions
|
||||
10. New Global Constants
|
||||
11. Changes to INI File Handling
|
||||
12. Other Changes
|
||||
|
||||
|
||||
========================================
|
||||
1. Backward Incompatible Changes
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
By fixing bug #66015 it is no longer possible to overwrite keys in static scalar
|
||||
arrays. Quick example to illustrate:
|
||||
class Test {
|
||||
const FIRST = 1;
|
||||
public $array = array(
|
||||
self::FIRST => 'first',
|
||||
'second',
|
||||
'third'
|
||||
);
|
||||
}
|
||||
Test::$array will have as expected three array keys (1, 2, 3) and no longer
|
||||
two (0, 1). self::FIRST will no longer overwrite 'third' having key 1 then,
|
||||
but will mark the beginning of indexing.
|
||||
|
||||
- JSON:
|
||||
json_decode() no longer accepts non-lowercase variants of lone JSON true,
|
||||
false or null values. For example, True or FALSE will now cause json_decode to
|
||||
@@ -28,16 +43,23 @@ PHP X.Y UPGRADE NOTES
|
||||
containing non-lowercase values inside JSON arrays or objects has never been
|
||||
accepted.
|
||||
|
||||
- openssl:
|
||||
To prevent Man-in-the-Middle attacks against encrypted transfers client
|
||||
- OpenSSL:
|
||||
To prevent man-in-the-middle attacks against encrypted transfers client
|
||||
streams now verify peer certificates by default. Previous versions
|
||||
required users to manually enable peer verification. As a result of this
|
||||
change, existing code using ssl:// or tls:// stream wrappers (e.g.
|
||||
file_get_contents(), fsockopen(), stream_socket_client()) may no longer
|
||||
connect successfully without manually disabling peer verification via the
|
||||
stream context's "verify_peer" setting. Encrypted transfers delegate to
|
||||
operating system certificate stores by default, so many/most users *should*
|
||||
be unaffected by this transparent security enhancement.
|
||||
operating system certificate stores by default if not overridden via the
|
||||
new openssl.cafile and openssl.cafile ini directives or via call-time SSL
|
||||
context options, so most users should be unaffected by this transparent
|
||||
security enhancement. (https://wiki.php.net/rfc/tls-peer-verification)
|
||||
|
||||
- Mcrypt:
|
||||
The mcrypt_encrypt(), mcrypt_decrypt() and mcrypt_{MODE}() functions no
|
||||
longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
|
||||
required if the used block cipher mode requires it.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
@@ -52,89 +74,234 @@ PHP X.Y UPGRADE NOTES
|
||||
- Added support for argument unpacking to complement the variadic syntax.
|
||||
(https://wiki.php.net/rfc/argument_unpacking)
|
||||
|
||||
- Added T_POW (**) operator.
|
||||
- Added an exponentiation operator (**).
|
||||
(https://wiki.php.net/rfc/pow-operator)
|
||||
|
||||
- The php://input stream is now re-usable and can be used concurrently with
|
||||
- Added unified default encoding. default_charset=UTF-8 and functions/extensions
|
||||
use encoding settings honor default_charset.
|
||||
|
||||
- The php://input stream is now re-usable and can be used concurrently with
|
||||
enable_post_data_reading=0.
|
||||
|
||||
- Added gost-crypto (CryptoPro S-box) hash algo.
|
||||
|
||||
- Added openssl certificate fingerprint support (inclusive stream context
|
||||
option).
|
||||
|
||||
- Added openssl crypto method stream context option.
|
||||
|
||||
- Added openssl peer verification support for SAN x509 extension
|
||||
|
||||
- Added use function and use const.
|
||||
(https://wiki.php.net/rfc/use_function)
|
||||
|
||||
- Added a function for timing attack safe string comparison
|
||||
(https://wiki.php.net/rfc/timing_attack)
|
||||
|
||||
- Added gost-crypto (CryptoPro S-box) hash algorithm.
|
||||
|
||||
- Stream wrappers verify peer certificates and host names by default in
|
||||
encrypted client streams.
|
||||
|
||||
- Added openssl certificate fingerprint support (inclusive stream context
|
||||
option).
|
||||
|
||||
- Added support for SAN x509 extension matching when verifing host names in
|
||||
encrypted streams.
|
||||
|
||||
- Added a range of new SSL context options for improved encrypted stream
|
||||
server security (https://wiki.php.net/rfc/improved-tls-defaults):
|
||||
|
||||
. "honor_cipher_order" allows servers to prioritize cipher suites of their
|
||||
choosing when negotiating SSL/TLS handshakes.
|
||||
. "single_ecdh_use" and "single_dh_use" allow for improved forward
|
||||
secrecy in encrypted stream servers.
|
||||
. "dh_param" allows specification of pre-generated key generation
|
||||
parameters when negotiating ephemeral DHE ciphers in stream servers.
|
||||
. "ecdh_curve" allows stream servers to specify which curve to use when
|
||||
negotiating ephemeral ECDHE ciphers (defaults to NIST P-256).
|
||||
. "rsa_key_size" SSL context option gives stream servers control
|
||||
over the key size (in bits) used when negotiating RSA ciphers.
|
||||
. "capture_session_meta" if specified stores an array of data describing
|
||||
the TLS session's protocol/cipher in the "session_meta" SSL context key.
|
||||
|
||||
- Added automatic mitigation against client-initated TLS renegotiation DoS
|
||||
attacks in encrypted server streams. Renegotiation limiting may be
|
||||
customized via three new SSL context options:
|
||||
|
||||
. "reneg_limit" (number of allowed renegotiations per time window)
|
||||
. "reneg_window" (renegotiation time window in seconds)
|
||||
. "reneg_limit_callback" (optional notification callback on limiting)
|
||||
|
||||
- Encrypted TLS servers now support the server name indication (SNI) TLS
|
||||
extension via the new "SNI_server_certs" SSL context option.
|
||||
|
||||
- Added "crypto_method" SSL context option for use in encrypted streams.
|
||||
|
||||
- Added "peer_name" SSL context option to better reflect peer certificate
|
||||
name matching using SAN extension (replaces deprecated "CN_match").
|
||||
|
||||
- Added stream wrapper support when specifying "cafile" SSL context paths.
|
||||
|
||||
- Independent peer cert and peer name validation is now available via a new
|
||||
boolean "verify_peer_name" SSL context option. This option is enabled by
|
||||
default in encrypted client streams.
|
||||
|
||||
- Added protocol-specific tlsv1.0://, tlsv1.1:// and tlsv1.2:// encryption
|
||||
stream wrappers. tls:// wrapper now supports TLSv1.1 and TLSv1.2 (previously
|
||||
only supported TLSv1).
|
||||
|
||||
- Stream crypto method specification now accepts flags instead of values
|
||||
allowing support for multiple discrete protocols in a given stream.
|
||||
|
||||
- PostgreSQL database connections may now be established asynchronously using
|
||||
new constants and polling functions in ext/pgsql.
|
||||
|
||||
- Non-blocking read/write query behavior now optionally available in database
|
||||
operations using the ext/pgsql extension.
|
||||
|
||||
========================================
|
||||
2. Changes in SAPI modules
|
||||
3. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
- Added phpdbg sapi.
|
||||
- Added phpdbg SAPI.
|
||||
(https://wiki.php.net/rfc/phpdbg)
|
||||
|
||||
- Support for FPM workers changing the apparmor profile through the pool configuration.
|
||||
(https://wiki.php.net/rfc/fpm_change_hat)
|
||||
|
||||
- Support for several XML MIME types in the built-in CLI server. For static
|
||||
files with extensions .xml, .xsl, .xsd the Content-Type header
|
||||
application/xml is now sent automatically.
|
||||
|
||||
========================================
|
||||
3. Deprecated Functionality
|
||||
4. Deprecated Functionality
|
||||
========================================
|
||||
|
||||
- Incompatible context calls:
|
||||
Instance calls from an incompatible context are now deprecated and issue
|
||||
E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx
|
||||
|
||||
- The "CN_match" and "SNI_server_name" SSL context options are deprecated in
|
||||
favor of the new "peer_name" option. Name verification now checks certificate
|
||||
SAN names as well as the CN field and the specific name fields are deprecated
|
||||
to avoid confusion. Their use triggers E_DEPRECATED but continues to work as
|
||||
before. If specified, the specific values take precedence over the general
|
||||
"peer_name" value.
|
||||
|
||||
- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
|
||||
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
|
||||
|
||||
- Deprecated INIs: Following INIs are deprecated in favour of new
|
||||
internal_encoding/input_encoding/output_encoding. Refer to "Changes to
|
||||
encodings in PHP 5.6" in "11. Other Changes" section for more details.
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
mbstring.http_input
|
||||
mbstring.http_output
|
||||
mbstring.internal_encoding
|
||||
|
||||
========================================
|
||||
4. Changed Functions
|
||||
5. Changed Functions
|
||||
========================================
|
||||
|
||||
- cURL:
|
||||
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
|
||||
do not work unless it is explicitly set to false.
|
||||
|
||||
curl_setopt() now supports the following nullable settings (>= 5.5.11):
|
||||
. CURLOPT_CUSTOMREQUEST
|
||||
. CURLOPT_FTPPORT
|
||||
. CURLOPT_RANGE
|
||||
. CURLOPT_FTP_ACCOUNT
|
||||
. CURLOPT_RTSP_SESSION_ID
|
||||
. CURLOPT_KRBLEVEL
|
||||
. CURLOPT_KRB4LEVEL
|
||||
|
||||
- Strings:
|
||||
substr_compare() now allows $length to be zero.
|
||||
|
||||
- Crypt:
|
||||
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
|
||||
See: https://wiki.php.net/rfc/crypt_function_salt
|
||||
|
||||
- Mcrypt:
|
||||
The $source parameter of mcrypt_create_iv() now defaults to
|
||||
MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
|
||||
|
||||
- XMLReader:
|
||||
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
|
||||
the attribute could not be found, just like XMLReader::getAttribute.
|
||||
|
||||
- Pgsql:
|
||||
pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
|
||||
The following functions no longer block until query write completion if the
|
||||
socket stream underlying a database connection is set to non-blocking mode:
|
||||
. pg_send_execute()
|
||||
. pg_send_prepare()
|
||||
. pg_send_query()
|
||||
. pg_send_query_params()
|
||||
|
||||
- unserialize:
|
||||
Manipulated serialization strings for objects implementing Serializable by
|
||||
replacing "C:" with "O:" at the start will now produce an error.
|
||||
|
||||
========================================
|
||||
5. New Functions
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- GMP:
|
||||
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
|
||||
|
||||
- Openssl:
|
||||
- Hash
|
||||
Added hash_equals($known_string, $user_string)
|
||||
|
||||
- OpenSSL:
|
||||
Added string openssl_x509_fingerprint($x509, $type, $binary).
|
||||
Added string openssl_spki_new($private_key, $challenge, $algorithm)
|
||||
Added bool openssl_spki_verify($spkac)
|
||||
Added string openssl_spki_export($spkac)
|
||||
Added string openssl_spki_export_challenge($spkac)
|
||||
Added array openssl_get_cert_locations()
|
||||
|
||||
- LDAP:
|
||||
Added ldap_escape($value, $ignore = "", $flags = 0).
|
||||
Added ldap_modify_batch($link_identifier, $dn, $modifications) described in
|
||||
https://wiki.php.net/rfc/ldap_modify_batch.
|
||||
|
||||
- Pgsql:
|
||||
Added pg_socket($connection) to allow async connections and non-blocking IO
|
||||
Added pg_connect_poll($connection) for establishing async connections
|
||||
Added pg_consume_input($connection) for non-blocking query result consumption
|
||||
Added pg_flush($connection) for non-blocking query write completion
|
||||
|
||||
- PDO_pgsql
|
||||
Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
|
||||
Added PDO::pgsqlGetPid()
|
||||
|
||||
- Zip:
|
||||
Added ZipArchive::setPassword($password)
|
||||
|
||||
- SPL
|
||||
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
|
||||
|
||||
========================================
|
||||
6. New Classes and Interfaces
|
||||
7. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
7. Removed Extensions
|
||||
8. Removed Extensions
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
8. Other Changes to Extensions
|
||||
9. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
- cURL:
|
||||
- The following constants have been removed as they are now marked "obsolete"
|
||||
in the underlying library and never had any effect to begin with:
|
||||
. CURLOPT_CLOSEPOLICY
|
||||
. CURLCLOSEPOLICY_CALLBACK
|
||||
. CURLCLOSEPOLICY_LEAST_RECENTLY_USED
|
||||
. CURLCLOSEPOLICY_LEAST_TRAFFIC
|
||||
. CURLCLOSEPOLICY_OLDEST
|
||||
. CURLCLOSEPOLICY_SLOWEST
|
||||
|
||||
- GMP:
|
||||
The GMP extension now uses objects as the underlying data structure, rather
|
||||
than resources. GMP instances now support dumping, serialization, cloning,
|
||||
@@ -147,29 +314,105 @@ PHP X.Y UPGRADE NOTES
|
||||
- Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer
|
||||
unnecessarily initiates an internal ROLLBACK during connection
|
||||
close.
|
||||
- Multi-row OCI_RETURN_LOB queries require fewer "round trips" to the database.
|
||||
- Added DTrace probes enabled with PHP's generic --enable-dtrace
|
||||
- The oci_internal_debug() function is now a no-op.
|
||||
- The phpinfo() output format for OCI8 has changed.
|
||||
|
||||
- OpenSSL:
|
||||
- The "SNI_enabled" SSL stream context option is now set to TRUE by default
|
||||
if supported by the underlying openssl library.
|
||||
|
||||
- PCRE:
|
||||
- The information collected by the (*MARK) backtracking control verb is now
|
||||
collected into the "MARK" index of the $matches array for preg_match(),
|
||||
preg_match_all() and preg_replace_callback().
|
||||
|
||||
- Pgsql:
|
||||
- pg_insert()/pg_select()/pg_update()/pg_delete()/pg_meta_data()/pg_convert()
|
||||
are no longer EXPERIMENTAL
|
||||
- Added PGSQL_DML_ESCAPE option for pg_insert()/pg_select()/pg_update()/pg_delete()
|
||||
that simply escapes all supplied parameters. These functions can be as fast as
|
||||
native query. Unvalidated data(Unknown data types) is passed as string.
|
||||
JSON/Array/etc are supported both PGSQL_DML_ESCAPE and pg_convert() as string.
|
||||
- pg_select() returns PostgreSQL query resource when query is executed.
|
||||
- Added extended flag parameter for pg_meta_data(). pg_meta_data() always
|
||||
returns "is enum" attribute.
|
||||
- The new pg_socket() function returns a socket stream with no behavior other
|
||||
than to allow IO-readiness polling on a DB connection socket. Calling
|
||||
stream_set_blocking() on its result enables non-blocking behavior.
|
||||
- Passing the new PGSQL_CONNECT_ASYNC flag to pg_connect() allows applications
|
||||
to poll for IO readiness via pg_connect_poll() and establish connections
|
||||
asynchronously.
|
||||
|
||||
- PDO_pgsql:
|
||||
- Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
|
||||
without preparing them, while still passing parameters separately from
|
||||
the command text using PQexecParams.
|
||||
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
|
||||
as described in https://bugs.php.net/bug.php?id=42614.
|
||||
|
||||
========================================
|
||||
9. New Global Constants
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
- LDAP:
|
||||
LDAP_ESCAPE_FILTER int(1)
|
||||
LDAP_ESCAPE_DN int(2)
|
||||
|
||||
- Pgsql:
|
||||
PGSQL_DML_ESCAPE int(4096)
|
||||
PGSQL_CONNECT_ASYNC
|
||||
PGSQL_CONNECTION_STARTED
|
||||
PGSQL_CONNECTION_MADE
|
||||
PGSQL_CONNECTION_AWAITING_RESPONSE
|
||||
PGSQL_CONNECTION_AUTH_OK
|
||||
PGSQL_CONNECTION_SSL_STARTUP
|
||||
PGSQL_CONNECTION_SETENV
|
||||
PGSQL_POLLING_FAILED
|
||||
PGSQL_POLLING_READING
|
||||
PGSQL_POLLING_WRITING
|
||||
PGSQL_POLLING_OK
|
||||
PGSQL_POLLING_ACTIVE
|
||||
|
||||
- OpenSSL:
|
||||
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT int(9)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT int(17)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT int(33)
|
||||
STREAM_CRYPTO_METHOD_ANY_CLIENT int(63)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_0_SERVER int(8)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_1_SERVER int(16)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_2_SERVER int(32)
|
||||
STREAM_CRYPTO_METHOD_ANY_SERVER int(62)
|
||||
OPENSSL_DEFAULT_STREAM_CIPHERS string
|
||||
|
||||
========================================
|
||||
10. Changes to INI File Handling
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
Changed always_populate_raw_post_data to throw a deprecation warning when
|
||||
enabled and to recognize ohe value -1 for never populating the global
|
||||
enabled and to recognize the value -1 for never populating the global
|
||||
$HTTP_RAW_POST_DATA variable, which will be default in future PHP versions.
|
||||
|
||||
default_charset is set to UTF-8. It was empty previously. default_charset
|
||||
is used where it is applicable. Iconv/Mbstring/htmlentities/htmlspecialchars/
|
||||
html_entity_decode use default_charset as default encoding.
|
||||
|
||||
internal_encoding/input_encoding/output_encoding is added for encoding
|
||||
handling modules. Refer to "Changes to encodings in PHP 5.6" in "11. Other Changes"
|
||||
section for more details.
|
||||
|
||||
- cURL:
|
||||
If the new openssl.cafile ini directive is specified ext/curl will give the
|
||||
openssl path precedence over its own curl.cainfo directive.
|
||||
|
||||
- OpenSSL:
|
||||
openssl.cafile and openssl.capath ini directives have been added to allow
|
||||
global CA default specification as necessary.
|
||||
|
||||
========================================
|
||||
11. Other Changes
|
||||
12. Other Changes
|
||||
========================================
|
||||
|
||||
- File upload:
|
||||
@@ -179,6 +422,51 @@ PHP X.Y UPGRADE NOTES
|
||||
HTTP 1.1 requests now include a Connection: close header unless explicitly
|
||||
overridden by setting a Connection header via the header context option.
|
||||
|
||||
- PDO_pgsql
|
||||
A libpq version providing PQexecParams, PQprepare, PQescapeStringConn,
|
||||
PQescapeByteaConn is now required. According to the release notes that means
|
||||
8.0.8+ or 8.1.4+.
|
||||
|
||||
- Zip:
|
||||
New --with-libzip option allow to use system libzip. Version > 0.11 required,
|
||||
Version >= 0.11.2 recommended for all features.
|
||||
|
||||
- Changes to encodings in PHP 5.6
|
||||
The default value of default_charset is now UTF-8 when it is not
|
||||
explicitly set in php.ini
|
||||
|
||||
The following php.ini parameters were added:
|
||||
internal_encoding
|
||||
input_encoding
|
||||
output_encoding
|
||||
|
||||
The values of the following php.ini parameters have become empty in
|
||||
PHP 5.6 (previously they were all ISO-8859-1)
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
|
||||
Changes were made to character set handling in:
|
||||
- the iconv and mbstring extensions,
|
||||
- and htmlentities(), htmlspecialchars(), html_entity_decode() functions
|
||||
|
||||
The precedence for these is now:
|
||||
|
||||
default_charset < internal/input/output_encoding < (mbstring.* || iconv.*) < function parameter
|
||||
|
||||
For example, the easiest way to use the UTF-8 encoding is to set
|
||||
default_charset=UTF-8 and leave the following php.ini parameters
|
||||
|
||||
empty:
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
mbstring.http_input
|
||||
mbstring.http_output
|
||||
mbstring.internal_encoding
|
||||
internal_encoding
|
||||
input_encoding
|
||||
output_encoding
|
||||
|
||||
+111
-2
@@ -7,6 +7,14 @@ UPGRADE NOTES - PHP X.Y
|
||||
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
|
||||
c. POST data handling
|
||||
d. Arginfo changes
|
||||
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
|
||||
f. empty strings are interned
|
||||
g. Additional str_* APIs
|
||||
h. Addition of zend_hash_reindex
|
||||
i. Addition of zend_hash_splice
|
||||
j. An additional parameter is sent to Countable::count()
|
||||
k. Unserialization of manipulated object strings
|
||||
l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -110,6 +118,104 @@ UPGRADE NOTES - PHP X.Y
|
||||
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
|
||||
that the argument passed to them is a zend_function* and that it is non-NULL.
|
||||
|
||||
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
|
||||
|
||||
Memory allocation is now managed by emalloc/efree instead of malloc/free.
|
||||
|
||||
f. empty strings are interned
|
||||
|
||||
String created using STR_EMPTY_ALLOC() are now interned.
|
||||
convert_to_string use STR_EMPTY_ALLOC() for zval when IS_NULL.
|
||||
str_efree() shoud be preferred as efree() on such strings can cause memory
|
||||
corruption.
|
||||
|
||||
g. Additional str_* APIs
|
||||
|
||||
In addition to the previously existing str_free() and str_efree() macros, the
|
||||
following macros have been introduced to simplify dealing with potentially
|
||||
interned strings:
|
||||
|
||||
str_efree_rel(str) - efree_rel() if not interned
|
||||
str_erealloc(str, new_len) - erealloc() or emalloc+memcpy if interned
|
||||
str_estrndup(str, len) - estrndup() if not interned
|
||||
str_strndup(str, len) - zend_strndup() if not interned
|
||||
str_hash(str, len) - INTERNED_HASH(str) if interned,
|
||||
zend_hash_func(str, len+1) otherwise
|
||||
|
||||
h. Addition of zend_hash_reindex
|
||||
|
||||
A zend_hash_reindex() function with the following prototype has been added:
|
||||
|
||||
void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
|
||||
|
||||
If only_integer_keys==0, this function will change all keys to be continuous,
|
||||
zero-based integers in hash order. If only_integer_keys==1 the same will be
|
||||
done only for keys that were already integers previously, while leaving
|
||||
string keys alone.
|
||||
|
||||
i. Addition of zend_hash_splice
|
||||
|
||||
A zend_hash_splice() macro with the following prototype has been added:
|
||||
|
||||
void zend_hash_splice(
|
||||
HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
|
||||
uint offset, uint length,
|
||||
void **list, uint list_count, HashTable *removed
|
||||
);
|
||||
|
||||
This function performs an in-place splice operation on a hashtable:
|
||||
|
||||
The elements between offset and offset+length are removed and the elements in
|
||||
list[list_count] are inserted in their place. The removed elements can be
|
||||
optionally collected into a hashtable.
|
||||
|
||||
This operation reindexes the hashtable, i.e. integer keys will be zero-based
|
||||
and sequential, while string keys stay intact. The same applies to the
|
||||
elements inserted into the removed HT.
|
||||
|
||||
As a side-effect of this addition the signature of the php_splice() function
|
||||
changed:
|
||||
|
||||
void php_splice(
|
||||
HashTable *ht, zend_uint offset, zend_uint length,
|
||||
zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
|
||||
)
|
||||
|
||||
This function now directly forwards to zend_hash_splice(), resets the
|
||||
IAP of ht (for compatibility with the previous implementation) and resets
|
||||
CVs if the passed hashtable is the global symbol table.
|
||||
|
||||
j. An additional parameter is sent to Countable::count()
|
||||
|
||||
That parameter denotes the $mode passed to count; it shouldn't affect any
|
||||
userland code, but any zend_parse_parameters() used with no arguments should
|
||||
fail. Extensions which implement Countable internally, need to accept one
|
||||
optional long as parameter.
|
||||
|
||||
k. Unserialization of manipulated object strings
|
||||
|
||||
Strings requiring unserialization of objects are now explicitly checked
|
||||
whether the object they contain implements the Serializable interface.
|
||||
This solves the situation where manipulated strings could be passed for
|
||||
objects using Serializable to disallow serialization. An object
|
||||
implementing Serializable will always start with "C:" in the serialized
|
||||
string, all other objects are represented with starting "O:". Objects
|
||||
implementing Serializable to disable serialization using
|
||||
zend_class_unserialize_deny and zend_class_serialize_deny, when
|
||||
instantiated from the serializer with a manipulated "O:" string at the
|
||||
start, will most likely be defectively initialized. This is now
|
||||
fixed at the appropriate place by checking for the presence of the
|
||||
serialize callback in the class entry.
|
||||
|
||||
l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
|
||||
|
||||
These two #defines disappeared. Instead we have now IS_CONSTANT_AST which
|
||||
covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the
|
||||
hack for marking zvals as constant index with IS_CONSTANT_INDEX is now
|
||||
superfluous and so removed.
|
||||
Please note that IS_CONSTANT_AST now has the same value than
|
||||
IS_CONSTANT_ARRAY had.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
========================
|
||||
@@ -120,5 +226,8 @@ UPGRADE NOTES - PHP X.Y
|
||||
variable. Previously `bison` was assumed to be in $PATH.
|
||||
|
||||
b. Windows build system changes
|
||||
-
|
||||
|
||||
- The configure option --enable-static-analyze isn't available anymore.
|
||||
The new option was introduced --with-analyzer.
|
||||
- It is possible to disable PGO for single extensions, to do that
|
||||
define a global variable PHP_MYMODULE_PGO evaluating to false
|
||||
inside config.w32
|
||||
@@ -30,12 +30,12 @@ test(...getArray([1, 2, 3]));
|
||||
test(...arrayGen([]));
|
||||
test(...arrayGen([1, 2, 3]));
|
||||
|
||||
test(1, ...[2, 3], ...[4, 5], 6);
|
||||
test(1, ...getArray([2, 3]), ...arrayGen([4, 5]), 6);
|
||||
test(1, ...[2, 3], ...[4, 5]);
|
||||
test(1, ...getArray([2, 3]), ...arrayGen([4, 5]));
|
||||
|
||||
test2(...[1, 2]);
|
||||
test2(...[1, 2, 3]);
|
||||
test2(...[1], ...[], ...[], ...[2, 3], 4, ...[5, 6]);
|
||||
test2(...[1], ...[], ...[], ...[2, 3], ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -75,7 +75,7 @@ array(3) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(6) {
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
@@ -86,10 +86,8 @@ array(6) {
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
array(6) {
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
@@ -100,8 +98,6 @@ array(6) {
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
@@ -17,46 +17,37 @@ $array = [1, 2, 3];
|
||||
test1(...$array);
|
||||
var_dump($array);
|
||||
|
||||
$array1 = [1, 2]; $val2 = 3; $array2 = [4, 5];
|
||||
test1(...$array1, $val2, ...$array2);
|
||||
var_dump($array1, $val2, $array2);
|
||||
$array1 = [1, 2]; $array2 = [3, 4];
|
||||
test1(...$array1, ...$array2);
|
||||
var_dump($array1, $array2);
|
||||
|
||||
function test2($val1, &$ref1, $val2, &$ref2) {
|
||||
$ref1++;
|
||||
$ref2++;
|
||||
}
|
||||
|
||||
$array = [1, 2, 3, 4];
|
||||
$array = [0, 0, 0, 0];
|
||||
test2(...$array);
|
||||
var_dump($array);
|
||||
|
||||
$array1 = [1, 2]; $array2 = [4, 5];
|
||||
test1(...$array1, ...$array2);
|
||||
var_dump($array1, $array2);
|
||||
|
||||
$a = $b = $c = $d = 0;
|
||||
$array = [0, 0, 0, 0];
|
||||
|
||||
$array = [];
|
||||
test2(...$array, $a, $b, $c, $d);
|
||||
var_dump($array, $a, $b, $c, $d);
|
||||
test2($a, ...$array);
|
||||
var_dump($a, $array);
|
||||
|
||||
$array = [1];
|
||||
test2(...$array, $a, $b, $c, $d);
|
||||
var_dump($array, $a, $b, $c, $d);
|
||||
test2($a, $b, ...$array);
|
||||
var_dump($a, $b, $array);
|
||||
|
||||
$array = [1, 2];
|
||||
test2(...$array, $a, $b, $c, $d);
|
||||
var_dump($array, $a, $b, $c, $d);
|
||||
test2($a, $b, $c, ...$array);
|
||||
var_dump($a, $b, $c, $array);
|
||||
|
||||
$array = [1, 2, 3];
|
||||
test2(...$array, $a, $b, $c, $d);
|
||||
var_dump($array, $a, $b, $c, $d);
|
||||
|
||||
$vars = [];
|
||||
$array = [];
|
||||
test2(...$array, $vars['a'], $vars['b'], $vars['c'], $vars['d']);
|
||||
var_dump($vars);
|
||||
|
||||
$vars = [];
|
||||
$array = [1];
|
||||
test2(...$array, $vars['a'], $vars['b'], $vars['c'], $vars['d']);
|
||||
var_dump($vars);
|
||||
test2($a, $b, $c, $d, ...$array);
|
||||
var_dump($a, $b, $c, $d, $array);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
@@ -74,76 +65,81 @@ array(2) {
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
int(4)
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(0)
|
||||
[3]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
int(0)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(3)
|
||||
int(0)
|
||||
[2]=>
|
||||
int(3)
|
||||
int(1)
|
||||
[3]=>
|
||||
int(5)
|
||||
}
|
||||
array(0) {
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(1)
|
||||
int(0)
|
||||
int(1)
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
array(2) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
int(1)
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(3)
|
||||
[2]=>
|
||||
int(3)
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(2)
|
||||
int(2)
|
||||
int(1)
|
||||
int(1)
|
||||
|
||||
Notice: Undefined index: a in %s on line %d
|
||||
|
||||
Notice: Undefined index: c in %s on line %d
|
||||
array(2) {
|
||||
["b"]=>
|
||||
int(0)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(1)
|
||||
["d"]=>
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
|
||||
Notice: Undefined index: b in %s on line %d
|
||||
|
||||
Notice: Undefined index: d in %s on line %d
|
||||
array(2) {
|
||||
["a"]=>
|
||||
int(0)
|
||||
int(3)
|
||||
int(0)
|
||||
int(1)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(1)
|
||||
["c"]=>
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ $fn = function(...$args) {
|
||||
|
||||
$fn(...[]);
|
||||
$fn(...[1, 2, 3]);
|
||||
$fn(1, ...[2, 3], ...[], 4, 5);
|
||||
$fn(1, ...[2, 3], ...[], ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -12,7 +12,7 @@ test(...42);
|
||||
test(...new stdClass);
|
||||
|
||||
test(1, 2, 3, ..."foo", ...[4, 5]);
|
||||
test(1, 2, ...new StdClass, 3, ...3.14, ...[4, 5]);
|
||||
test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
@@ -14,8 +14,7 @@ class Foo {
|
||||
}
|
||||
|
||||
$foo = new Foo;
|
||||
$foo->test(...[1, 2], 3, 4, ...[], 5);
|
||||
Foo::test2(1, 2, ...[3, 4], ...[], 5);
|
||||
Foo::test2(1, 2, ...[3, 4], ...[], ...[5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -31,15 +30,3 @@ array(5) {
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class Foo {
|
||||
|
||||
new Foo(...[]);
|
||||
new Foo(...[1, 2, 3]);
|
||||
new Foo(...[1], 2, ...[], ...[3, 4], 5);
|
||||
new Foo(...[1], ...[], ...[2, 3]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -25,15 +25,11 @@ array(3) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(5) {
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Positional arguments cannot be used after argument unpacking
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(...[1, 2, 3], 4);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use positional argument after argument unpacking in %s on line %d
|
||||
@@ -20,11 +20,11 @@ function gen() {
|
||||
}
|
||||
|
||||
try {
|
||||
test(1, 2, ...new Foo, 3, 4);
|
||||
test(1, 2, ...new Foo, ...[3, 4]);
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
try {
|
||||
test(1, 2, ...gen(), 3, 4);
|
||||
test(1, 2, ...gen(), ...[3, 4]);
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
?>
|
||||
|
||||
@@ -13,8 +13,6 @@ function gen($array) {
|
||||
}
|
||||
}
|
||||
|
||||
test(...gen([1, 2, 3]), $a);
|
||||
var_dump($a);
|
||||
test(1, 2, 3, $b, ...gen([4, 5, 6]));
|
||||
var_dump($b);
|
||||
|
||||
@@ -25,7 +23,6 @@ test(...gen([1, 2]), ...gen([3, 4]));
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(42)
|
||||
int(42)
|
||||
|
||||
Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #66015 (wrong array indexing in class's static property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
const FIRST = 1;
|
||||
const SECOND = 2;
|
||||
const THIRD = 3;
|
||||
|
||||
protected static $array = [
|
||||
self::FIRST => 'first',
|
||||
'second',
|
||||
'third'
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
var_export(self::$array);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
array (
|
||||
1 => 'first',
|
||||
2 => 'second',
|
||||
3 => 'third',
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #66660 (Composer.phar install/update fails)
|
||||
--STDIN--
|
||||
<?php __CLASS__ ?>
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents(__DIR__."/bug66660.tmp.php", "<?php __CLASS__ ?>");
|
||||
echo php_strip_whitespace(__DIR__."/bug66660.tmp.php");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php unlink(__DIR__."/bug66660.tmp.php"); ?>
|
||||
--EXPECT--
|
||||
<?php __CLASS__ ?>
|
||||
@@ -35,6 +35,9 @@ const T_25 = 1 + 2 * 3;
|
||||
// Test for memory leaks
|
||||
const T_26 = "1" + 2 + "3";
|
||||
|
||||
// Allow T_POW
|
||||
const T_27 = 2 ** 3;
|
||||
|
||||
var_dump(T_1);
|
||||
var_dump(T_2);
|
||||
var_dump(T_3);
|
||||
@@ -61,6 +64,7 @@ var_dump(T_23);
|
||||
var_dump(T_24);
|
||||
var_dump(T_25);
|
||||
var_dump(T_26);
|
||||
var_dump(T_27);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -89,3 +93,4 @@ bool(false)
|
||||
bool(true)
|
||||
int(7)
|
||||
int(6)
|
||||
int(8)
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns ZERO (float)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(0.0);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.0.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns ZERO
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(0);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns ONE (float)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(1.0);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.0.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns ONE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(1);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns EMPTY STRING
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C("");
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-empty_str.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns FALSE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(false);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-false.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns OBJECT
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(new stdClass);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-object.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns RESOURCE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(fopen("data:text/plain,Foo", 'r'));
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-resource.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns STRING
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C("foo");
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-str.php on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns TRUE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class C {
|
||||
public $val;
|
||||
public function __debugInfo() {
|
||||
return $this->val;
|
||||
}
|
||||
public function __construct($val) {
|
||||
$this->val = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C(true);
|
||||
var_dump($c);
|
||||
--EXPECTF--
|
||||
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-true.php on line %d
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public $d = 4;
|
||||
protected $e = 5;
|
||||
private $f = 6;
|
||||
|
||||
public function __debugInfo() {
|
||||
return ['a'=>1, "\0*\0b"=>2, "\0Foo\0c"=>3];
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public $val = 123;
|
||||
|
||||
public function __debugInfo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$f = new Foo;
|
||||
var_dump($f);
|
||||
|
||||
$b = new Bar;
|
||||
var_dump($b);
|
||||
--EXPECTF--
|
||||
object(Foo)#%d (3) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b":protected]=>
|
||||
int(2)
|
||||
["c":"Foo":private]=>
|
||||
int(3)
|
||||
}
|
||||
object(Bar)#%d (0) {
|
||||
}
|
||||
@@ -7,7 +7,9 @@ class test {
|
||||
const TEST = array(1,2,3);
|
||||
}
|
||||
|
||||
var_dump(test::TEST);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Arrays are not allowed in class constants in %s on line %d
|
||||
Fatal error: Arrays are not allowed in constants at run-time in %s on line %d
|
||||
@@ -32,12 +32,11 @@ Stack trace:
|
||||
#0 %s(%d): serialize(Object(Generator))
|
||||
#1 {main}
|
||||
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: Generator->__wakeup()
|
||||
#1 %s(%d): unserialize('O:9:"Generator"...')
|
||||
#2 {main}
|
||||
|
||||
Warning: Erroneous data format for unserializing 'Generator' in %sserialize_unserialize_error.php on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 19 of 20 bytes in %sserialize_unserialize_error.php on line %s
|
||||
bool(false)
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unserialize('C:9:"Generator"...')
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
--FILE--
|
||||
<?php
|
||||
const C = array();
|
||||
|
||||
var_dump(C);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Arrays are not allowed as constants in %sns_059.php on line 2
|
||||
Fatal error: Arrays are not allowed in constants at run-time in %sns_059.php on line 4
|
||||
|
||||
+3
-5
@@ -502,6 +502,7 @@ struct _zend_class_entry {
|
||||
union _zend_function *__call;
|
||||
union _zend_function *__callstatic;
|
||||
union _zend_function *__tostring;
|
||||
union _zend_function *__debugInfo;
|
||||
union _zend_function *serialize_func;
|
||||
union _zend_function *unserialize_func;
|
||||
|
||||
@@ -588,14 +589,11 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define IS_STRING 6
|
||||
#define IS_RESOURCE 7
|
||||
#define IS_CONSTANT 8
|
||||
#define IS_CONSTANT_ARRAY 9
|
||||
#define IS_CONSTANT_AST 10
|
||||
#define IS_CALLABLE 11
|
||||
#define IS_CONSTANT_AST 9
|
||||
#define IS_CALLABLE 10
|
||||
|
||||
/* Ugly hack to support constants as static array indices */
|
||||
#define IS_CONSTANT_TYPE_MASK 0x00f
|
||||
#define IS_CONSTANT_UNQUALIFIED 0x010
|
||||
#define IS_CONSTANT_INDEX 0x080
|
||||
#define IS_LEXICAL_VAR 0x020
|
||||
#define IS_LEXICAL_REF 0x040
|
||||
#define IS_CONSTANT_IN_NAMESPACE 0x100
|
||||
|
||||
+15
-5
@@ -1070,7 +1070,7 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML
|
||||
int ret;
|
||||
zend_class_entry *old_scope = *scope;
|
||||
*scope = prop_info->ce;
|
||||
ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
ret = zval_update_constant(pp, 1 TSRMLS_CC);
|
||||
*scope = old_scope;
|
||||
return ret;
|
||||
}
|
||||
@@ -1079,7 +1079,7 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML
|
||||
} while (ce);
|
||||
|
||||
}
|
||||
return zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
return zval_update_constant(pp, 1 TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
int i;
|
||||
|
||||
*scope = class_type;
|
||||
zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
|
||||
zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void *)1 TSRMLS_CC);
|
||||
|
||||
for (i = 0; i < class_type->default_properties_count; i++) {
|
||||
if (class_type->default_properties_table[i]) {
|
||||
@@ -2018,6 +2018,9 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
|
||||
!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0
|
||||
) {
|
||||
zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_TOSTRING_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1 &&
|
||||
!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && fptr->common.num_args != 0) {
|
||||
zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_DEBUGINFO_FUNC_NAME);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2031,7 +2034,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
|
||||
int count=0, unload=0;
|
||||
HashTable *target_function_table = function_table;
|
||||
int error_type;
|
||||
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL;
|
||||
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL, *__debugInfo = NULL;
|
||||
const char *lowercase_name;
|
||||
int fname_len;
|
||||
const char *lc_class_name = NULL;
|
||||
@@ -2180,6 +2183,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
|
||||
__unset = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME) - 1)) {
|
||||
__isset = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1)) {
|
||||
__debugInfo = reg_function;
|
||||
} else {
|
||||
reg_function = NULL;
|
||||
}
|
||||
@@ -2218,6 +2223,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
|
||||
scope->__set = __set;
|
||||
scope->__unset = __unset;
|
||||
scope->__isset = __isset;
|
||||
scope->__debugInfo = __debugInfo;
|
||||
if (ctor) {
|
||||
ctor->common.fn_flags |= ZEND_ACC_CTOR;
|
||||
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
@@ -2281,6 +2287,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
|
||||
}
|
||||
__isset->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (__debugInfo) {
|
||||
if (__debugInfo->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __debugInfo->common.function_name);
|
||||
}
|
||||
}
|
||||
efree((char*)lc_class_name);
|
||||
}
|
||||
return SUCCESS;
|
||||
@@ -3452,7 +3463,6 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, in
|
||||
if (ce->type & ZEND_INTERNAL_CLASS) {
|
||||
switch(Z_TYPE_P(property)) {
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY:
|
||||
case IS_OBJECT:
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
|
||||
|
||||
@@ -197,6 +197,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
class_container.__set = handle_propset; \
|
||||
class_container.__unset = handle_propunset; \
|
||||
class_container.__isset = handle_propisset; \
|
||||
class_container.__debugInfo = NULL; \
|
||||
class_container.serialize_func = NULL; \
|
||||
class_container.unserialize_func = NULL; \
|
||||
class_container.serialize = NULL; \
|
||||
|
||||
+67
-19
@@ -63,6 +63,27 @@ ZEND_API zend_ast* zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *o
|
||||
return ast;
|
||||
}
|
||||
|
||||
ZEND_API zend_ast* zend_ast_create_dynamic(uint kind)
|
||||
{
|
||||
zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * 3); /* use 4 children as deafult */
|
||||
ast->kind = kind;
|
||||
ast->children = 0;
|
||||
return ast;
|
||||
}
|
||||
|
||||
ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op)
|
||||
{
|
||||
if ((*ast)->children >= 4 && (*ast)->children == ((*ast)->children & -(*ast)->children)) {
|
||||
*ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children * 2 + 1));
|
||||
}
|
||||
(&(*ast)->u.child)[(*ast)->children++] = op;
|
||||
}
|
||||
|
||||
ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast)
|
||||
{
|
||||
*ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children - 1));
|
||||
}
|
||||
|
||||
ZEND_API int zend_ast_is_ct_constant(zend_ast *ast)
|
||||
{
|
||||
int i;
|
||||
@@ -107,6 +128,13 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
break;
|
||||
case ZEND_POW:
|
||||
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
|
||||
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
|
||||
pow_function(result, &op1, &op2 TSRMLS_CC);
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
break;
|
||||
case ZEND_DIV:
|
||||
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
|
||||
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
|
||||
@@ -226,7 +254,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
|
||||
*result = *ast->u.val;
|
||||
zval_copy_ctor(result);
|
||||
if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
|
||||
zval_update_constant_ex(&result, (void *) 1, scope TSRMLS_CC);
|
||||
zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
case ZEND_BOOL_AND:
|
||||
@@ -277,6 +305,35 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
|
||||
sub_function(result, &op1, &op2 TSRMLS_CC);
|
||||
zval_dtor(&op2);
|
||||
break;
|
||||
case ZEND_INIT_ARRAY:
|
||||
INIT_PZVAL(result);
|
||||
array_init(result);
|
||||
{
|
||||
int i;
|
||||
zend_bool has_key;
|
||||
for (i = 0; i < ast->children; i+=2) {
|
||||
zval *expr;
|
||||
MAKE_STD_ZVAL(expr);
|
||||
if ((has_key = !!(&ast->u.child)[i])) {
|
||||
zend_ast_evaluate(&op1, (&ast->u.child)[i], scope TSRMLS_CC);
|
||||
}
|
||||
zend_ast_evaluate(expr, (&ast->u.child)[i+1], scope TSRMLS_CC);
|
||||
zend_do_add_static_array_element(result, has_key?&op1:NULL, expr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_FETCH_DIM_R:
|
||||
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
|
||||
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
|
||||
{
|
||||
zval *tmp;
|
||||
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
|
||||
*result = *tmp;
|
||||
efree(tmp);
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
break;
|
||||
default:
|
||||
zend_error(E_ERROR, "Unsupported constant expression");
|
||||
}
|
||||
@@ -290,26 +347,17 @@ ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
|
||||
zend_ast *copy = zend_ast_create_constant(ast->u.val);
|
||||
zval_copy_ctor(copy->u.val);
|
||||
return copy;
|
||||
} else {
|
||||
switch (ast->children) {
|
||||
case 1:
|
||||
return zend_ast_create_unary(
|
||||
ast->kind,
|
||||
zend_ast_copy((&ast->u.child)[0]));
|
||||
case 2:
|
||||
return zend_ast_create_binary(
|
||||
ast->kind,
|
||||
zend_ast_copy((&ast->u.child)[0]),
|
||||
zend_ast_copy((&ast->u.child)[1]));
|
||||
case 3:
|
||||
return zend_ast_create_ternary(
|
||||
ast->kind,
|
||||
zend_ast_copy((&ast->u.child)[0]),
|
||||
zend_ast_copy((&ast->u.child)[1]),
|
||||
zend_ast_copy((&ast->u.child)[2]));
|
||||
} else if (ast->children) {
|
||||
zend_ast *new = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * (ast->children - 1));
|
||||
int i;
|
||||
new->kind = ast->kind;
|
||||
new->children = ast->children;
|
||||
for (i = 0; i < ast->children; i++) {
|
||||
(&new->u.child)[i] = zend_ast_copy((&ast->u.child)[i]);
|
||||
}
|
||||
return new;
|
||||
}
|
||||
return NULL;
|
||||
return zend_ast_create_dynamic(ast->kind);
|
||||
}
|
||||
|
||||
ZEND_API void zend_ast_destroy(zend_ast *ast)
|
||||
|
||||
@@ -50,6 +50,9 @@ ZEND_API zend_ast *zend_ast_create_constant(zval *zv);
|
||||
ZEND_API zend_ast *zend_ast_create_unary(uint kind, zend_ast *op0);
|
||||
ZEND_API zend_ast *zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1);
|
||||
ZEND_API zend_ast *zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2);
|
||||
ZEND_API zend_ast* zend_ast_create_dynamic(uint kind);
|
||||
ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op);
|
||||
ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast);
|
||||
|
||||
ZEND_API int zend_ast_is_ct_constant(zend_ast *ast);
|
||||
|
||||
|
||||
+74
-83
@@ -102,6 +102,13 @@ ZEND_API zend_compiler_globals compiler_globals;
|
||||
ZEND_API zend_executor_globals executor_globals;
|
||||
#endif
|
||||
|
||||
static void zend_push_function_call_entry(zend_function *fbc TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_function_call_entry fcall = { fbc };
|
||||
zend_stack_push(&CG(function_call_stack), &fcall, sizeof(zend_function_call_entry));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
|
||||
{
|
||||
property_info->name = str_estrndup(property_info->name, property_info->name_length);
|
||||
@@ -1622,6 +1629,11 @@ 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 __invoke() must have public visibility and cannot be static");
|
||||
}
|
||||
|
||||
} else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
|
||||
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
|
||||
zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
char *class_lcname;
|
||||
@@ -1682,6 +1694,11 @@ 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 __invoke() must have public visibility and cannot be static");
|
||||
}
|
||||
} else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
|
||||
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
|
||||
zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
|
||||
}
|
||||
CG(active_class_entry)->__debugInfo = (zend_function *) CG(active_op_array);
|
||||
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
@@ -1916,7 +1933,7 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
|
||||
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
|
||||
}
|
||||
}
|
||||
@@ -1979,7 +1996,7 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace
|
||||
efree(Z_STRVAL(function_name->u.constant));
|
||||
Z_STRVAL(function_name->u.constant) = lcname;
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *));
|
||||
zend_push_function_call_entry(function TSRMLS_CC);
|
||||
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
|
||||
CG(active_op_array)->nested_calls = CG(context).nested_calls + 1;
|
||||
}
|
||||
@@ -1992,7 +2009,6 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *last_op;
|
||||
int last_op_number;
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
zend_do_end_variable_parse(left_bracket, BP_VAR_R, 0 TSRMLS_CC);
|
||||
zend_do_begin_variable_parse(TSRMLS_C);
|
||||
@@ -2036,7 +2052,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
}
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_push_function_call_entry(NULL TSRMLS_CC);
|
||||
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
|
||||
CG(active_op_array)->nested_calls = CG(context).nested_calls;
|
||||
}
|
||||
@@ -2059,7 +2075,6 @@ void zend_do_clone(znode *result, const znode *expr TSRMLS_DC) /* {{{ */
|
||||
|
||||
void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
zend_op *opline;
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
@@ -2085,7 +2100,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML
|
||||
}
|
||||
}
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_push_function_call_entry(NULL TSRMLS_CC);
|
||||
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
|
||||
CG(active_op_array)->nested_calls = CG(context).nested_calls;
|
||||
}
|
||||
@@ -2480,7 +2495,6 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c
|
||||
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
znode class_node;
|
||||
unsigned char *ptr = NULL;
|
||||
zend_op *opline;
|
||||
|
||||
if (method_name->op_type == IS_CONST) {
|
||||
@@ -2529,7 +2543,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
|
||||
SET_NODE(opline->op2, method_name);
|
||||
}
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_push_function_call_entry(NULL TSRMLS_CC);
|
||||
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
|
||||
CG(active_op_array)->nested_calls = CG(context).nested_calls;
|
||||
}
|
||||
@@ -2538,22 +2552,21 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_function_call_entry *fcall;
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
|
||||
|
||||
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
|
||||
/* clone */
|
||||
if (Z_LVAL(argument_list->u.constant) != 0) {
|
||||
if (fcall->arg_num != 0) {
|
||||
zend_error(E_WARNING, "Clone method does not require arguments");
|
||||
}
|
||||
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
|
||||
} else {
|
||||
zend_function **function_ptr_ptr;
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
if (*function_ptr_ptr) {
|
||||
if (fcall->fbc) {
|
||||
opline->opcode = ZEND_DO_FCALL;
|
||||
SET_NODE(opline->op1, function_name);
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -2578,33 +2591,39 @@ void zend_do_end_function_call(znode *function_name, znode *result, const znode
|
||||
opline->result.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result_type = IS_VAR;
|
||||
GET_NODE(result, opline->result);
|
||||
|
||||
zend_stack_del_top(&CG(function_call_stack));
|
||||
opline->extended_value = Z_LVAL(argument_list->u.constant);
|
||||
opline->extended_value = fcall->arg_num;
|
||||
|
||||
if (CG(context).used_stack + 1 > CG(active_op_array)->used_stack) {
|
||||
CG(active_op_array)->used_stack = CG(context).used_stack + 1;
|
||||
}
|
||||
CG(context).used_stack -= Z_LVAL(argument_list->u.constant);
|
||||
CG(context).used_stack -= fcall->arg_num;
|
||||
zend_stack_del_top(&CG(function_call_stack));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{{ */
|
||||
void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
int original_op = op;
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
zend_function_call_entry *fcall;
|
||||
zend_function *function_ptr;
|
||||
int send_by_reference = 0;
|
||||
int send_function = 0;
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
function_ptr = *function_ptr_ptr;
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
|
||||
function_ptr = fcall->fbc;
|
||||
fcall->arg_num++;
|
||||
|
||||
if (fcall->uses_argument_unpacking) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use positional argument after argument unpacking");
|
||||
}
|
||||
|
||||
if (original_op == ZEND_SEND_REF) {
|
||||
if (function_ptr &&
|
||||
function_ptr->common.function_name &&
|
||||
function_ptr->common.type == ZEND_USER_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Call-time pass-by-reference has been removed; "
|
||||
"If you would like to pass argument by reference, modify the declaration of %s().",
|
||||
@@ -2616,7 +2635,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
|
||||
}
|
||||
|
||||
if (function_ptr) {
|
||||
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
|
||||
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
|
||||
if (op == ZEND_SEND_VAR && param->op_type & (IS_VAR|IS_CV)) {
|
||||
send_by_reference = ZEND_ARG_SEND_BY_REF;
|
||||
if (zend_is_function_or_method_call(param)) {
|
||||
@@ -2627,7 +2646,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
|
||||
} else {
|
||||
op = ZEND_SEND_VAL;
|
||||
}
|
||||
} else if (ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
|
||||
} else if (ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
|
||||
send_by_reference = ZEND_ARG_SEND_BY_REF;
|
||||
}
|
||||
}
|
||||
@@ -2662,7 +2681,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
|
||||
if (function_ptr) {
|
||||
zend_do_end_variable_parse(param, BP_VAR_R, 0 TSRMLS_CC);
|
||||
} else {
|
||||
zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, offset TSRMLS_CC);
|
||||
zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, fcall->arg_num TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
case ZEND_SEND_REF:
|
||||
@@ -2688,7 +2707,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
|
||||
}
|
||||
opline->opcode = op;
|
||||
SET_NODE(opline->op1, param);
|
||||
opline->op2.opline_num = offset;
|
||||
opline->op2.opline_num = fcall->arg_num;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
if (++CG(context).used_stack > CG(active_op_array)->used_stack) {
|
||||
@@ -2697,18 +2716,20 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_unpack_params(znode *params, int offset TSRMLS_DC) /* {{{ */
|
||||
void zend_do_unpack_params(znode *params TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_function **function_ptr_ptr;
|
||||
zend_function_call_entry *fcall;
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
if (*function_ptr_ptr) {
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
|
||||
fcall->uses_argument_unpacking = 1;
|
||||
|
||||
if (fcall->fbc) {
|
||||
/* If argument unpacking is used argument numbers and sending modes can no longer be
|
||||
* computed at compile time, thus we need access to EX(call). In order to have it we
|
||||
* retroactively emit a ZEND_INIT_FCALL_BY_NAME opcode. */
|
||||
zval func_name;
|
||||
ZVAL_STRING(&func_name, (*function_ptr_ptr)->common.function_name, 1);
|
||||
ZVAL_STRING(&func_name, fcall->fbc->common.function_name, 1);
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
@@ -2719,14 +2740,14 @@ void zend_do_unpack_params(znode *params, int offset TSRMLS_DC) /* {{{ */
|
||||
GET_CACHE_SLOT(opline->op2.constant);
|
||||
|
||||
++CG(context).nested_calls;
|
||||
*function_ptr_ptr = NULL;
|
||||
fcall->fbc = NULL;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_SEND_UNPACK;
|
||||
SET_NODE(opline->op1, params);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.num = (zend_uint) offset;
|
||||
opline->op2.num = fcall->arg_num;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3123,6 +3144,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
|
||||
if (!ce->destructor) {
|
||||
ce->destructor = ce->parent->destructor;
|
||||
}
|
||||
if (!ce->__debugInfo) {
|
||||
ce->__debugInfo = ce->parent->__debugInfo;
|
||||
}
|
||||
if (ce->constructor) {
|
||||
if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
|
||||
zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
|
||||
@@ -3437,7 +3461,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
*zv = *precv->op2.zv;
|
||||
zval_copy_ctor(zv);
|
||||
INIT_PZVAL(zv);
|
||||
zval_update_constant_ex(&zv, (void*)1, fptr->common.scope TSRMLS_CC);
|
||||
zval_update_constant_ex(&zv, 1, fptr->common.scope TSRMLS_CC);
|
||||
if (Z_TYPE_P(zv) == IS_BOOL) {
|
||||
if (Z_LVAL_P(zv)) {
|
||||
memcpy(offset, "true", 4);
|
||||
@@ -3954,6 +3978,8 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
|
||||
ce->__callstatic = fe;
|
||||
} else if (!strncmp(mname, ZEND_TOSTRING_FUNC_NAME, mname_len)) {
|
||||
ce->__tostring = fe;
|
||||
} else if (!strncmp(mname, ZEND_DEBUGINFO_FUNC_NAME, mname_len)) {
|
||||
ce->__debugInfo = fe;
|
||||
} else if (ce->name_length + 1 == mname_len) {
|
||||
char *lowercase_name = emalloc(ce->name_length + 1);
|
||||
zend_str_tolower_copy(lowercase_name, ce->name, ce->name_length);
|
||||
@@ -5416,10 +5442,6 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
|
||||
const char *cname = NULL;
|
||||
zend_ulong hash;
|
||||
|
||||
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
|
||||
return;
|
||||
}
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants");
|
||||
return;
|
||||
@@ -5562,7 +5584,6 @@ void zend_do_pop_object(znode *object TSRMLS_DC) /* {{{ */
|
||||
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
new_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
@@ -5573,18 +5594,18 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /*
|
||||
SET_NODE(opline->op1, class_type);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
|
||||
zend_push_function_call_entry(NULL TSRMLS_CC);
|
||||
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
|
||||
CG(active_op_array)->nested_calls = CG(context).nested_calls;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC) /* {{{ */
|
||||
void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
znode ctor_result;
|
||||
|
||||
zend_do_end_function_call(NULL, &ctor_result, argument_list, 1, 0 TSRMLS_CC);
|
||||
zend_do_end_function_call(NULL, &ctor_result, 1, 0 TSRMLS_CC);
|
||||
zend_do_free(&ctor_result TSRMLS_CC);
|
||||
|
||||
CG(active_op_array)->opcodes[new_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
|
||||
@@ -5862,57 +5883,30 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
|
||||
void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr) /* {{{ */
|
||||
{
|
||||
zval *element;
|
||||
|
||||
ALLOC_ZVAL(element);
|
||||
*element = expr->u.constant;
|
||||
if (offset) {
|
||||
switch (Z_TYPE(offset->u.constant) & IS_CONSTANT_TYPE_MASK) {
|
||||
case IS_CONSTANT:
|
||||
/* Ugly hack to denote that this value has a constant index */
|
||||
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
|
||||
Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3);
|
||||
Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
|
||||
Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0;
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL);
|
||||
zval_dtor(&offset->u.constant);
|
||||
break;
|
||||
case IS_CONSTANT_AST: {
|
||||
/* Another ugly hack to store the data about the AST in the array */
|
||||
char* key;
|
||||
int len = sizeof(zend_ast *);
|
||||
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
|
||||
|
||||
key = emalloc(len + 2);
|
||||
*(zend_ast **)key = Z_AST(offset->u.constant);
|
||||
key[len] = Z_TYPE(offset->u.constant);
|
||||
key[len + 1] = 0;
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), key, len + 2, &element, sizeof(zval *), NULL);
|
||||
efree(key);
|
||||
break;
|
||||
}
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_STRING:
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+1, &element, sizeof(zval *), NULL);
|
||||
zval_dtor(&offset->u.constant);
|
||||
zend_symtable_update(Z_ARRVAL_P(result), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr, sizeof(zval *), NULL);
|
||||
zval_dtor(offset);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
|
||||
zend_symtable_update(Z_ARRVAL_P(result), "", 1, &expr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(offset), &expr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(Z_ARRVAL(result->u.constant), zend_dval_to_lval(Z_DVAL(offset->u.constant)), &element, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), &expr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_CONSTANT_ARRAY:
|
||||
case IS_ARRAY:
|
||||
zend_error(E_ERROR, "Illegal offset type");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(result), &expr, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -6946,6 +6940,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
|
||||
ce->unserialize = NULL;
|
||||
ce->serialize_func = NULL;
|
||||
ce->unserialize_func = NULL;
|
||||
ce->__debugInfo = NULL;
|
||||
if (ce->type == ZEND_INTERNAL_CLASS) {
|
||||
ce->info.internal.module = NULL;
|
||||
ce->info.internal.builtin_functions = NULL;
|
||||
@@ -7292,10 +7287,6 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
|
||||
zend_op *opline;
|
||||
zval **ns_name;
|
||||
|
||||
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed as constants");
|
||||
}
|
||||
|
||||
if (zend_get_ct_const(&name->u.constant, 0 TSRMLS_CC)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant));
|
||||
}
|
||||
|
||||
+11
-5
@@ -363,6 +363,11 @@ typedef struct _zend_function_state {
|
||||
void **arguments;
|
||||
} zend_function_state;
|
||||
|
||||
typedef struct _zend_function_call_entry {
|
||||
zend_function *fbc;
|
||||
zend_uint arg_num;
|
||||
zend_bool uses_argument_unpacking;
|
||||
} zend_function_call_entry;
|
||||
|
||||
typedef struct _zend_switch_entry {
|
||||
znode cond;
|
||||
@@ -518,7 +523,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int prefix_len TS
|
||||
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
|
||||
void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_class_member TSRMLS_DC);
|
||||
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC);
|
||||
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
|
||||
void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_variable TSRMLS_DC);
|
||||
void zend_do_handle_exception(TSRMLS_D);
|
||||
@@ -554,8 +559,8 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
void zend_do_early_binding(TSRMLS_D);
|
||||
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
|
||||
|
||||
void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC);
|
||||
void zend_do_unpack_params(znode *params, int offset TSRMLS_DC);
|
||||
void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC);
|
||||
void zend_do_unpack_params(znode *params TSRMLS_DC);
|
||||
|
||||
|
||||
void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC);
|
||||
@@ -585,7 +590,7 @@ void zend_do_pop_object(znode *object TSRMLS_DC);
|
||||
|
||||
|
||||
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC);
|
||||
void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC);
|
||||
void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC);
|
||||
|
||||
void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode, zend_bool check_namespace TSRMLS_DC);
|
||||
|
||||
@@ -593,7 +598,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
|
||||
|
||||
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
|
||||
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
|
||||
void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
|
||||
void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr);
|
||||
void zend_do_list_init(TSRMLS_D);
|
||||
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
|
||||
void zend_do_add_list_element(const znode *element TSRMLS_DC);
|
||||
@@ -873,6 +878,7 @@ END_EXTERN_C()
|
||||
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
|
||||
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
|
||||
#define ZEND_INVOKE_FUNC_NAME "__invoke"
|
||||
#define ZEND_DEBUGINFO_FUNC_NAME "__debuginfo"
|
||||
|
||||
/* The following constants may be combined in CG(compiler_options)
|
||||
* to change the default compiler behavior */
|
||||
|
||||
@@ -408,7 +408,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
|
||||
efree(lcname);
|
||||
if(found_const) {
|
||||
*result = c->value;
|
||||
zval_update_constant_ex(&result, (void*)1, NULL TSRMLS_CC);
|
||||
zval_update_constant_ex(&result, 1, NULL TSRMLS_CC);
|
||||
zval_copy_ctor(result);
|
||||
Z_SET_REFCOUNT_P(result, 1);
|
||||
Z_UNSET_ISREF_P(result);
|
||||
@@ -423,7 +423,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
|
||||
retval = 0;
|
||||
finish:
|
||||
if (retval) {
|
||||
zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
|
||||
zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
|
||||
*result = **ret_constant;
|
||||
zval_copy_ctor(result);
|
||||
INIT_PZVAL(result);
|
||||
|
||||
+58
-3
@@ -360,6 +360,11 @@ ZEND_METHOD(error_exception, getSeverity)
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define TRACE_ARG_APPEND(vallen) \
|
||||
*str = (char*)erealloc(*str, *len + 1 + vallen); \
|
||||
memmove((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
|
||||
|
||||
/* }}} */
|
||||
|
||||
static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
@@ -371,7 +376,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
|
||||
len = va_arg(args, int*);
|
||||
|
||||
/* the trivial way would be to do:
|
||||
* conver_to_string_ex(arg);
|
||||
* convert_to_string_ex(arg);
|
||||
* append it and kill the now tmp arg.
|
||||
* but that could cause some E_NOTICE and also damn long lines.
|
||||
*/
|
||||
@@ -394,8 +399,58 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
|
||||
l_added += 3 + 1;
|
||||
}
|
||||
while (--l_added) {
|
||||
if ((*str)[*len - l_added] < 32) {
|
||||
(*str)[*len - l_added] = '?';
|
||||
unsigned char chr = (*str)[*len - l_added];
|
||||
if (chr < 32 || chr == '\\' || chr > 126) {
|
||||
(*str)[*len - l_added] = '\\';
|
||||
|
||||
switch (chr) {
|
||||
case '\n':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 'n';
|
||||
break;
|
||||
case '\r':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 'r';
|
||||
break;
|
||||
case '\t':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 't';
|
||||
break;
|
||||
case '\f':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 'f';
|
||||
break;
|
||||
case '\v':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 'v';
|
||||
break;
|
||||
#ifndef PHP_WIN32
|
||||
case '\e':
|
||||
#else
|
||||
case VK_ESCAPE:
|
||||
#endif
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = 'e';
|
||||
break;
|
||||
case '\\':
|
||||
TRACE_ARG_APPEND(1);
|
||||
(*str)[++(*len) - l_added] = '\\';
|
||||
break;
|
||||
default:
|
||||
TRACE_ARG_APPEND(3);
|
||||
(*str)[*len - l_added + 1] = 'x';
|
||||
if ((chr >> 4) < 10) {
|
||||
(*str)[*len - l_added + 2] = (chr >> 4) + '0';
|
||||
} else {
|
||||
(*str)[*len - l_added + 2] = (chr >> 4) + 'A' - 10;
|
||||
}
|
||||
if (chr % 16 < 10) {
|
||||
(*str)[*len - l_added + 3] = chr % 16 + '0';
|
||||
} else {
|
||||
(*str)[*len - l_added + 3] = chr % 16 + 'A' - 10;
|
||||
}
|
||||
*len += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+8
-2
@@ -1352,9 +1352,15 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC) {
|
||||
temp_variable tmp;
|
||||
zend_fetch_dimension_address_read(&tmp, container, dim, IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
|
||||
*result = tmp.var.ptr;
|
||||
}
|
||||
|
||||
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, const zend_literal *key, int type TSRMLS_DC)
|
||||
{
|
||||
zval *container = *container_ptr;;
|
||||
zval *container = *container_ptr;
|
||||
|
||||
if (Z_TYPE_P(container) != IS_OBJECT) {
|
||||
if (container == &EG(error_zval)) {
|
||||
@@ -1686,7 +1692,7 @@ ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array
|
||||
|
||||
static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(zend_op *opline, call_slot *call TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_uint arg_num = (opline->extended_value & ZEND_FETCH_ARG_MASK) + call->num_additional_args;
|
||||
zend_uint arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;
|
||||
return ARG_SHOULD_BE_SENT_BY_REF(call->fbc, arg_num);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+6
-4
@@ -158,10 +158,10 @@ static zend_always_inline int i_zend_is_true(zval *op)
|
||||
return result;
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
|
||||
|
||||
/* dedicated Zend executor functions - do not use! */
|
||||
#define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
|
||||
@@ -362,6 +362,8 @@ ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_n
|
||||
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
|
||||
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
void zend_init_timeout_thread(void);
|
||||
void zend_shutdown_timeout_thread(void);
|
||||
|
||||
+8
-126
@@ -451,28 +451,14 @@ ZEND_API int zend_is_true(zval *op) /* {{{ */
|
||||
|
||||
#include "../TSRM/tsrm_strtok_r.h"
|
||||
|
||||
#define IS_VISITED_CONSTANT IS_CONSTANT_INDEX
|
||||
#define IS_VISITED_CONSTANT 0x80
|
||||
#define IS_CONSTANT_VISITED(p) (Z_TYPE_P(p) & IS_VISITED_CONSTANT)
|
||||
#define Z_REAL_TYPE_P(p) (Z_TYPE_P(p) & ~IS_VISITED_CONSTANT)
|
||||
#define MARK_CONSTANT_VISITED(p) Z_TYPE_P(p) |= IS_VISITED_CONSTANT
|
||||
|
||||
static void zval_deep_copy(zval **p)
|
||||
{
|
||||
zval *value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
*value = **p;
|
||||
Z_TYPE_P(value) &= ~IS_CONSTANT_INDEX;
|
||||
zval_copy_ctor(value);
|
||||
Z_TYPE_P(value) = Z_TYPE_PP(p);
|
||||
INIT_PZVAL(value);
|
||||
*p = value;
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *p = *pp;
|
||||
zend_bool inline_change = (zend_bool) (zend_uintptr_t) arg;
|
||||
zval const_value;
|
||||
char *colon;
|
||||
|
||||
@@ -559,110 +545,6 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
|
||||
|
||||
Z_SET_REFCOUNT_P(p, refcount);
|
||||
Z_SET_ISREF_TO_P(p, is_ref);
|
||||
} else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) {
|
||||
zval **element, *new_val;
|
||||
char *str_index;
|
||||
uint str_index_len;
|
||||
ulong num_index;
|
||||
int ret;
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(pp);
|
||||
p = *pp;
|
||||
Z_TYPE_P(p) = IS_ARRAY;
|
||||
|
||||
if (!inline_change) {
|
||||
zval *tmp;
|
||||
HashTable *tmp_ht = NULL;
|
||||
|
||||
ALLOC_HASHTABLE(tmp_ht);
|
||||
zend_hash_init(tmp_ht, zend_hash_num_elements(Z_ARRVAL_P(p)), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(tmp_ht, Z_ARRVAL_P(p), (copy_ctor_func_t) zval_deep_copy, (void *) &tmp, sizeof(zval *));
|
||||
Z_ARRVAL_P(p) = tmp_ht;
|
||||
}
|
||||
|
||||
/* First go over the array and see if there are any constant indices */
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
|
||||
while (zend_hash_get_current_data(Z_ARRVAL_P(p), (void **) &element) == SUCCESS) {
|
||||
if (!(Z_TYPE_PP(element) & IS_CONSTANT_INDEX)) {
|
||||
zend_hash_move_forward(Z_ARRVAL_P(p));
|
||||
continue;
|
||||
}
|
||||
Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX;
|
||||
if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL) != HASH_KEY_IS_STRING) {
|
||||
zend_hash_move_forward(Z_ARRVAL_P(p));
|
||||
continue;
|
||||
}
|
||||
if (str_index[str_index_len - 2] == IS_CONSTANT_AST) {
|
||||
zend_ast_evaluate(&const_value, *(zend_ast **)str_index, scope TSRMLS_CC);
|
||||
zend_ast_destroy(*(zend_ast **)str_index);
|
||||
} else if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) {
|
||||
char *actual;
|
||||
const char *save = str_index;
|
||||
if ((colon = (char*)zend_memrchr(str_index, ':', str_index_len - 3))) {
|
||||
zend_error(E_ERROR, "Undefined class constant '%s'", str_index);
|
||||
str_index_len -= ((colon - str_index) + 1);
|
||||
str_index = colon;
|
||||
} else {
|
||||
if (str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
|
||||
if ((actual = (char *)zend_memrchr(str_index, '\\', str_index_len - 3))) {
|
||||
actual++;
|
||||
str_index_len -= (actual - str_index);
|
||||
str_index = actual;
|
||||
}
|
||||
}
|
||||
if (str_index[0] == '\\') {
|
||||
++str_index;
|
||||
--str_index_len;
|
||||
}
|
||||
if (save[0] == '\\') {
|
||||
++save;
|
||||
}
|
||||
if ((str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
|
||||
zend_error(E_ERROR, "Undefined constant '%s'", save);
|
||||
}
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index);
|
||||
}
|
||||
ZVAL_STRINGL(&const_value, str_index, str_index_len-3, 1);
|
||||
}
|
||||
|
||||
if (Z_REFCOUNT_PP(element) > 1) {
|
||||
ALLOC_ZVAL(new_val);
|
||||
*new_val = **element;
|
||||
zval_copy_ctor(new_val);
|
||||
Z_SET_REFCOUNT_P(new_val, 1);
|
||||
Z_UNSET_ISREF_P(new_val);
|
||||
|
||||
/* preserve this bit for inheritance */
|
||||
Z_TYPE_PP(element) |= IS_CONSTANT_INDEX;
|
||||
zval_ptr_dtor(element);
|
||||
*element = new_val;
|
||||
}
|
||||
|
||||
switch (Z_TYPE(const_value)) {
|
||||
case IS_STRING:
|
||||
ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRLEN(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE);
|
||||
break;
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, Z_LVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL);
|
||||
break;
|
||||
case IS_NULL:
|
||||
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL);
|
||||
break;
|
||||
default:
|
||||
ret = SUCCESS;
|
||||
break;
|
||||
}
|
||||
if (ret == SUCCESS) {
|
||||
zend_hash_move_forward(Z_ARRVAL_P(p));
|
||||
}
|
||||
zval_dtor(&const_value);
|
||||
}
|
||||
zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC);
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
|
||||
} else if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(pp);
|
||||
p = *pp;
|
||||
@@ -677,21 +559,21 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zval_update_constant_ex(pp, (void*)1, scope TSRMLS_CC);
|
||||
return zval_update_constant_ex(pp, 1, scope TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zval_update_constant_ex(pp, (void*)0, scope TSRMLS_CC);
|
||||
return zval_update_constant_ex(pp, 0, scope TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zval_update_constant_ex(pp, arg, NULL TSRMLS_CC);
|
||||
return zval_update_constant_ex(pp, inline_change, NULL TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+193
-220
@@ -29,18 +29,24 @@
|
||||
(element)->pNext->pLast = (element); \
|
||||
}
|
||||
|
||||
#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
|
||||
(element)->pListLast = (ht)->pListTail; \
|
||||
(ht)->pListTail = (element); \
|
||||
(element)->pListNext = NULL; \
|
||||
if ((element)->pListLast != NULL) { \
|
||||
(element)->pListLast->pListNext = (element); \
|
||||
} \
|
||||
if (!(ht)->pListHead) { \
|
||||
#define CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, last, next)\
|
||||
(element)->pListLast = (last); \
|
||||
(element)->pListNext = (next); \
|
||||
if ((last) != NULL) { \
|
||||
(last)->pListNext = (element); \
|
||||
} else { \
|
||||
(ht)->pListHead = (element); \
|
||||
} \
|
||||
if ((ht)->pInternalPointer == NULL) { \
|
||||
(ht)->pInternalPointer = (element); \
|
||||
if ((next) != NULL) { \
|
||||
(next)->pListLast = (element); \
|
||||
} else { \
|
||||
(ht)->pListTail = (element); \
|
||||
} \
|
||||
|
||||
#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
|
||||
CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, (ht)->pListTail, (Bucket *) NULL); \
|
||||
if ((ht)->pInternalPointer == NULL) { \
|
||||
(ht)->pInternalPointer = (element); \
|
||||
}
|
||||
|
||||
#if ZEND_DEBUG
|
||||
@@ -122,13 +128,13 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
|
||||
memcpy((p)->pData, pData, nDataSize); \
|
||||
}
|
||||
|
||||
#define INIT_DATA(ht, p, pData, nDataSize); \
|
||||
#define INIT_DATA(ht, p, _pData, nDataSize); \
|
||||
if (nDataSize == sizeof(void*)) { \
|
||||
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
|
||||
memcpy(&(p)->pDataPtr, (_pData), sizeof(void *)); \
|
||||
(p)->pData = &(p)->pDataPtr; \
|
||||
} else { \
|
||||
(p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\
|
||||
memcpy((p)->pData, pData, nDataSize); \
|
||||
memcpy((p)->pData, (_pData), nDataSize); \
|
||||
(p)->pDataPtr=NULL; \
|
||||
}
|
||||
|
||||
@@ -141,6 +147,51 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
|
||||
|
||||
static const Bucket *uninitialized_bucket = NULL;
|
||||
|
||||
static zend_always_inline void i_zend_hash_bucket_delete(HashTable *ht, Bucket *p)
|
||||
{
|
||||
#ifdef ZEND_SIGNALS
|
||||
TSRMLS_FETCH();
|
||||
#endif
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
if (p->pLast) {
|
||||
p->pLast->pNext = p->pNext;
|
||||
} else {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
/* Deleting the tail of the list */
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
ht->nNumOfElements--;
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
pefree(p, ht->persistent);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
}
|
||||
|
||||
static void zend_hash_bucket_delete(HashTable *ht, Bucket *p) {
|
||||
i_zend_hash_bucket_delete(ht, p);
|
||||
}
|
||||
|
||||
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
|
||||
{
|
||||
uint i = 3;
|
||||
@@ -358,9 +409,6 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
|
||||
}
|
||||
UPDATE_DATA(ht, p, pData, nDataSize);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
if ((long)h >= (long)ht->nNextFreeElement) {
|
||||
ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
|
||||
}
|
||||
if (pDest) {
|
||||
*pDest = p->pData;
|
||||
}
|
||||
@@ -424,23 +472,42 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
|
||||
}
|
||||
|
||||
memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
for (p = ht->pListHead; p != NULL; p = p->pListNext) {
|
||||
nIndex = p->h & ht->nTableMask;
|
||||
CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
|
||||
ht->arBuckets[nIndex] = p;
|
||||
p = p->pListNext;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
|
||||
Bucket *p;
|
||||
uint nIndex;
|
||||
ulong offset = 0;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
if (UNEXPECTED(ht->nNumOfElements == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
|
||||
for (p = ht->pListHead; p != NULL; p = p->pListNext) {
|
||||
if (!only_integer_keys || p->nKeyLength == 0) {
|
||||
p->h = offset++;
|
||||
p->nKeyLength = 0;
|
||||
}
|
||||
|
||||
nIndex = p->h & ht->nTableMask;
|
||||
CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
|
||||
ht->arBuckets[nIndex] = p;
|
||||
}
|
||||
ht->nNextFreeElement = offset;
|
||||
}
|
||||
|
||||
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag)
|
||||
{
|
||||
uint nIndex;
|
||||
Bucket *p;
|
||||
#ifdef ZEND_SIGNALS
|
||||
TSRMLS_FETCH();
|
||||
#endif
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
@@ -455,38 +522,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
|
||||
&& (p->nKeyLength == nKeyLength)
|
||||
&& ((p->nKeyLength == 0) /* Numeric index (short circuits the memcmp() check) */
|
||||
|| !memcmp(p->arKey, arKey, nKeyLength))) { /* String index */
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
if (p == ht->arBuckets[nIndex]) {
|
||||
ht->arBuckets[nIndex] = p->pNext;
|
||||
} else {
|
||||
p->pLast->pNext = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
ht->nNumOfElements--;
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
pefree(p, ht->persistent);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
i_zend_hash_bucket_delete(ht, p);
|
||||
return SUCCESS;
|
||||
}
|
||||
p = p->pNext;
|
||||
@@ -553,73 +589,14 @@ ZEND_API void zend_hash_clean(HashTable *ht)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is used by the various apply() functions.
|
||||
* It deletes the passed bucket, and returns the address of the
|
||||
* next bucket. The hash *may* be altered during that time, the
|
||||
* returned value will still be valid.
|
||||
*/
|
||||
static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p)
|
||||
{
|
||||
Bucket *retval;
|
||||
#ifdef ZEND_SIGNALS
|
||||
TSRMLS_FETCH();
|
||||
#endif
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
if (p->pLast) {
|
||||
p->pLast->pNext = p->pNext;
|
||||
} else {
|
||||
uint nIndex;
|
||||
|
||||
nIndex = p->h & ht->nTableMask;
|
||||
ht->arBuckets[nIndex] = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
} else {
|
||||
/* Nothing to do as this list doesn't have a tail */
|
||||
}
|
||||
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
ht->nNumOfElements--;
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
retval = p->pListNext;
|
||||
pefree(p, ht->persistent);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
|
||||
{
|
||||
Bucket *p;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
p = zend_hash_apply_deleter(ht, p);
|
||||
while (ht->pListHead != NULL) {
|
||||
zend_hash_bucket_delete(ht, ht->pListHead);
|
||||
}
|
||||
|
||||
if (ht->nTableMask) {
|
||||
pefree(ht->arBuckets, ht->persistent);
|
||||
}
|
||||
@@ -629,14 +606,10 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
|
||||
|
||||
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
|
||||
{
|
||||
Bucket *p;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
p = ht->pListTail;
|
||||
while (p != NULL) {
|
||||
zend_hash_apply_deleter(ht, p);
|
||||
p = ht->pListTail;
|
||||
while (ht->pListTail != NULL) {
|
||||
zend_hash_bucket_delete(ht, ht->pListTail);
|
||||
}
|
||||
|
||||
if (ht->nTableMask) {
|
||||
@@ -665,12 +638,13 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
int result = apply_func(p->pData TSRMLS_CC);
|
||||
|
||||
|
||||
Bucket *p_next = p->pListNext;
|
||||
if (result & ZEND_HASH_APPLY_REMOVE) {
|
||||
p = zend_hash_apply_deleter(ht, p);
|
||||
} else {
|
||||
p = p->pListNext;
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
}
|
||||
p = p_next;
|
||||
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
break;
|
||||
}
|
||||
@@ -690,11 +664,12 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
|
||||
while (p != NULL) {
|
||||
int result = apply_func(p->pData, argument TSRMLS_CC);
|
||||
|
||||
Bucket *p_next = p->pListNext;
|
||||
if (result & ZEND_HASH_APPLY_REMOVE) {
|
||||
p = zend_hash_apply_deleter(ht, p);
|
||||
} else {
|
||||
p = p->pListNext;
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
}
|
||||
p = p_next;
|
||||
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
break;
|
||||
}
|
||||
@@ -716,17 +691,20 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
int result;
|
||||
Bucket *p_next;
|
||||
|
||||
va_start(args, num_args);
|
||||
hash_key.arKey = p->arKey;
|
||||
hash_key.nKeyLength = p->nKeyLength;
|
||||
hash_key.h = p->h;
|
||||
result = apply_func(p->pData TSRMLS_CC, num_args, args, &hash_key);
|
||||
|
||||
p_next = p->pListNext;
|
||||
if (result & ZEND_HASH_APPLY_REMOVE) {
|
||||
p = zend_hash_apply_deleter(ht, p);
|
||||
} else {
|
||||
p = p->pListNext;
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
}
|
||||
p = p_next;
|
||||
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
va_end(args);
|
||||
break;
|
||||
@@ -740,7 +718,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
|
||||
|
||||
ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
|
||||
{
|
||||
Bucket *p, *q;
|
||||
Bucket *p;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
@@ -749,11 +727,12 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
|
||||
while (p != NULL) {
|
||||
int result = apply_func(p->pData TSRMLS_CC);
|
||||
|
||||
q = p;
|
||||
p = p->pListLast;
|
||||
Bucket *p_last = p->pListLast;
|
||||
if (result & ZEND_HASH_APPLY_REMOVE) {
|
||||
zend_hash_apply_deleter(ht, q);
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
}
|
||||
p = p_last;
|
||||
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
break;
|
||||
}
|
||||
@@ -1223,8 +1202,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
if (q) {
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
Bucket *r = p->pListLast;
|
||||
@@ -1239,73 +1216,17 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
}
|
||||
if (mode & found) {
|
||||
/* delete current bucket */
|
||||
if (p == ht->arBuckets[p->h & ht->nTableMask]) {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
} else {
|
||||
p->pLast->pNext = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
ht->nNumOfElements--;
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
pefree(p, ht->persistent);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/* delete another bucket with the same key */
|
||||
if (q == ht->arBuckets[q->h & ht->nTableMask]) {
|
||||
ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
|
||||
} else {
|
||||
q->pLast->pNext = q->pNext;
|
||||
}
|
||||
if (q->pNext) {
|
||||
q->pNext->pLast = q->pLast;
|
||||
}
|
||||
if (q->pListLast != NULL) {
|
||||
q->pListLast->pListNext = q->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = q->pListNext;
|
||||
}
|
||||
if (q->pListNext != NULL) {
|
||||
q->pListNext->pListLast = q->pListLast;
|
||||
} else {
|
||||
ht->pListTail = q->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == q) {
|
||||
ht->pInternalPointer = q->pListNext;
|
||||
}
|
||||
ht->nNumOfElements--;
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(q->pData);
|
||||
}
|
||||
if (q->pData != &q->pDataPtr) {
|
||||
pefree(q->pData, ht->persistent);
|
||||
}
|
||||
pefree(q, ht->persistent);
|
||||
zend_hash_bucket_delete(ht, q);
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
@@ -1332,21 +1253,12 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
q->pData = p->pData;
|
||||
}
|
||||
q->pDataPtr = p->pDataPtr;
|
||||
q->pListNext = p->pListNext;
|
||||
q->pListLast = p->pListLast;
|
||||
if (q->pListNext) {
|
||||
p->pListNext->pListLast = q;
|
||||
} else {
|
||||
ht->pListTail = q;
|
||||
}
|
||||
if (q->pListLast) {
|
||||
p->pListLast->pListNext = q;
|
||||
} else {
|
||||
ht->pListHead = q;
|
||||
}
|
||||
|
||||
CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p->pListLast, p->pListNext);
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = q;
|
||||
}
|
||||
|
||||
if (pos) {
|
||||
*pos = q;
|
||||
}
|
||||
@@ -1377,6 +1289,75 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
}
|
||||
}
|
||||
|
||||
/* Performs an in-place splice operation on a hashtable:
|
||||
* The elements between offset and offset+length are removed and the elements in list[list_count]
|
||||
* are inserted in their place. The removed elements can be optionally collected into a hashtable.
|
||||
* This operation reindexes the hashtable, i.e. integer keys will be zero-based and sequential,
|
||||
* while string keys stay intact. The same applies to the elements inserted into the removed HT. */
|
||||
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC) /* {{{ */
|
||||
{
|
||||
int pos;
|
||||
Bucket *p;
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
CHECK_INIT(ht);
|
||||
|
||||
/* Skip all elements until offset */
|
||||
for (pos = 0, p = ht->pListHead; pos < offset && p; pos++, p = p->pListNext);
|
||||
|
||||
while (pos < offset + length && p) {
|
||||
/* Copy removed element into HT, if it was specified */
|
||||
if (removed != NULL) {
|
||||
void *new_entry;
|
||||
|
||||
if (p->nKeyLength == 0) {
|
||||
zend_hash_next_index_insert(removed, p->pData, sizeof(zval *), &new_entry);
|
||||
} else {
|
||||
zend_hash_quick_update(removed, p->arKey, p->nKeyLength, p->h, p->pData, sizeof(zval *), &new_entry);
|
||||
}
|
||||
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(new_entry);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove element */
|
||||
{
|
||||
Bucket *p_next = p->pListNext;
|
||||
zend_hash_bucket_delete(ht, p);
|
||||
p = p_next;
|
||||
}
|
||||
|
||||
pos++;
|
||||
}
|
||||
|
||||
if (list != NULL) {
|
||||
int i;
|
||||
for (i = 0; i < list_count; i++) {
|
||||
/* Add new element only to the global linked list, not the bucket list.
|
||||
* Also use key 0 for everything, as we'll reindex the hashtable anyways. */
|
||||
Bucket *q = pemalloc_rel(sizeof(Bucket), ht->persistent);
|
||||
q->arKey = NULL;
|
||||
q->nKeyLength = 0;
|
||||
q->h = 0;
|
||||
INIT_DATA(ht, q, list[i], nDataSize);
|
||||
|
||||
CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p ? p->pListLast : ht->pListTail, p);
|
||||
|
||||
ht->nNumOfElements++;
|
||||
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(q->pData);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
|
||||
}
|
||||
|
||||
zend_hash_reindex(ht, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
|
||||
compare_func_t compar, int renumber TSRMLS_DC)
|
||||
{
|
||||
@@ -1423,15 +1404,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
|
||||
if (renumber) {
|
||||
p = ht->pListHead;
|
||||
i=0;
|
||||
while (p != NULL) {
|
||||
p->nKeyLength = 0;
|
||||
p->h = i++;
|
||||
p = p->pListNext;
|
||||
}
|
||||
ht->nNextFreeElement = i;
|
||||
zend_hash_rehash(ht);
|
||||
zend_hash_reindex(ht, 0);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -227,6 +227,11 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
|
||||
ZEND_API int zend_hash_num_elements(const HashTable *ht);
|
||||
|
||||
ZEND_API int zend_hash_rehash(HashTable *ht);
|
||||
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
|
||||
|
||||
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC);
|
||||
#define zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed) \
|
||||
_zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed ZEND_FILE_LINE_CC)
|
||||
|
||||
/*
|
||||
* DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
|
||||
|
||||
@@ -57,7 +57,7 @@ ZEND_API void zend_html_putc(char c)
|
||||
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
|
||||
{
|
||||
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
|
||||
unsigned char *filtered;
|
||||
unsigned char *filtered = NULL;
|
||||
size_t filtered_len;
|
||||
|
||||
if (LANG_SCNG(output_filter)) {
|
||||
@@ -211,7 +211,7 @@ ZEND_API void zend_strip(TSRMLS_D)
|
||||
break;
|
||||
|
||||
default:
|
||||
efree(token.value.str.val);
|
||||
STR_FREE(token.value.str.val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+4663
-4663
File diff suppressed because it is too large.
Load diff
@@ -1,13 +1,13 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycINITIAL,
|
||||
yycST_OFFSET,
|
||||
yycST_SECTION_VALUE,
|
||||
yycST_VALUE,
|
||||
yycST_SECTION_RAW,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_VARNAME,
|
||||
yycST_RAW,
|
||||
};
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycINITIAL,
|
||||
yycST_OFFSET,
|
||||
yycST_SECTION_VALUE,
|
||||
yycST_VALUE,
|
||||
yycST_SECTION_RAW,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_VARNAME,
|
||||
yycST_RAW,
|
||||
};
|
||||
+33
-30
@@ -580,19 +580,20 @@ optional_class_type:
|
||||
function_call_parameter_list:
|
||||
'(' ')' { Z_LVAL($$.u.constant) = 0; }
|
||||
| '(' non_empty_function_call_parameter_list ')' { $$ = $2; }
|
||||
| '(' yield_expr ')' { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| '(' yield_expr ')' { zend_do_pass_param(&$2, ZEND_SEND_VAL TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
non_empty_function_call_parameter_list:
|
||||
expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| T_ELLIPSIS expr { Z_LVAL($$.u.constant) = 0; zend_do_unpack_params(&$2, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' T_ELLIPSIS expr { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant); zend_do_unpack_params(&$4, Z_LVAL($$.u.constant) TSRMLS_CC); }
|
||||
function_call_parameter
|
||||
| non_empty_function_call_parameter_list ',' function_call_parameter
|
||||
;
|
||||
|
||||
function_call_parameter:
|
||||
expr_without_variable { zend_do_pass_param(&$1, ZEND_SEND_VAL TSRMLS_CC); }
|
||||
| variable { zend_do_pass_param(&$1, ZEND_SEND_VAR TSRMLS_CC); }
|
||||
| '&' w_variable { zend_do_pass_param(&$2, ZEND_SEND_REF TSRMLS_CC); }
|
||||
| T_ELLIPSIS expr { zend_do_unpack_params(&$2 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
global_var_list:
|
||||
@@ -769,14 +770,14 @@ instance_call:
|
||||
;
|
||||
|
||||
new_expr:
|
||||
T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
;
|
||||
|
||||
expr_without_variable:
|
||||
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
|
||||
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$4, BP_VAR_W, 1 TSRMLS_CC); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
|
||||
| variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
|
||||
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
|
||||
| variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); }
|
||||
@@ -890,21 +891,21 @@ lexical_var_list:
|
||||
|
||||
function_call:
|
||||
namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$1, 1 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $1.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$1.u.constant); zend_do_build_namespace_name(&$1, &$1, &$3 TSRMLS_CC); $$.u.op.opline_num = zend_do_begin_function_call(&$1, 0 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$5, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
| T_NS_SEPARATOR namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$2, 0 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$2, &$$, &$4, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$2, &$$, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { $$.u.op.opline_num = zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, &$5, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
| variable_without_objects { zend_do_end_variable_parse(&$1, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1, 0 TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
;
|
||||
|
||||
class_name:
|
||||
@@ -985,9 +986,7 @@ static_class_constant:
|
||||
;
|
||||
|
||||
static_scalar: /* compile-time evaluated scalars */
|
||||
static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
|
||||
| '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
|
||||
static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); }
|
||||
;
|
||||
|
||||
static_scalar_value:
|
||||
@@ -996,15 +995,19 @@ static_scalar_value:
|
||||
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
|
||||
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
|
||||
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
|
||||
| '[' static_array_pair_list ']' { $$ = $2; }
|
||||
| static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
|
||||
| T_CLASS_C { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
|
||||
| static_operation { $$ = $1; }
|
||||
;
|
||||
|
||||
static_operation:
|
||||
static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); }
|
||||
static_scalar_value '[' static_scalar_value ']' { $$.u.ast = zend_ast_create_binary(ZEND_FETCH_DIM_R, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value '-' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SUB, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value '*' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MUL, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value T_POW static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_POW, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value '/' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_DIV, $1.u.ast, $3.u.ast); }
|
||||
| static_scalar_value '%' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MOD, $1.u.ast, $3.u.ast); }
|
||||
| '!' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BOOL_NOT, $2.u.ast); }
|
||||
@@ -1051,8 +1054,8 @@ scalar:
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { zend_ast_dynamic_shrink(&$1.u.ast); $$ = $1; }
|
||||
;
|
||||
|
||||
possible_comma:
|
||||
@@ -1061,10 +1064,10 @@ possible_comma:
|
||||
;
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
|
||||
non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); zend_ast_dynamic_add(&$$.u.ast, $5.u.ast); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
|
||||
| static_scalar_value T_DOUBLE_ARROW static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
|
||||
| static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); }
|
||||
;
|
||||
|
||||
expr:
|
||||
@@ -1117,7 +1120,7 @@ array_method_dereference:
|
||||
|
||||
method:
|
||||
{ zend_do_pop_object(&$$ TSRMLS_CC); zend_do_begin_method_call(&$$ TSRMLS_CC); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$2, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
;
|
||||
|
||||
method_or_not:
|
||||
|
||||
+7857
-7857
File diff suppressed because it is too large.
Load diff
@@ -1,15 +1,15 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycST_IN_SCRIPTING,
|
||||
yycST_LOOKING_FOR_PROPERTY,
|
||||
yycST_BACKQUOTE,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_HEREDOC,
|
||||
yycST_LOOKING_FOR_VARNAME,
|
||||
yycST_VAR_OFFSET,
|
||||
yycINITIAL,
|
||||
yycST_END_HEREDOC,
|
||||
yycST_NOWDOC,
|
||||
};
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycST_IN_SCRIPTING,
|
||||
yycST_LOOKING_FOR_PROPERTY,
|
||||
yycST_BACKQUOTE,
|
||||
yycST_DOUBLE_QUOTES,
|
||||
yycST_HEREDOC,
|
||||
yycST_LOOKING_FOR_VARNAME,
|
||||
yycST_VAR_OFFSET,
|
||||
yycINITIAL,
|
||||
yycST_END_HEREDOC,
|
||||
yycST_NOWDOC,
|
||||
};
|
||||
@@ -137,8 +137,40 @@ ZEND_API HashTable *zend_std_get_gc(zval *object, zval ***table, int *n TSRMLS_D
|
||||
|
||||
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
*is_temp = 0;
|
||||
return zend_std_get_properties(object TSRMLS_CC);
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval *retval = NULL;
|
||||
|
||||
if (!ce->__debugInfo) {
|
||||
*is_temp = 0;
|
||||
return Z_OBJ_HANDLER_P(object, get_properties)
|
||||
? Z_OBJ_HANDLER_P(object, get_properties)(object TSRMLS_CC)
|
||||
: NULL;
|
||||
}
|
||||
|
||||
zend_call_method_with_0_params(&object, ce, &ce->__debugInfo, ZEND_DEBUGINFO_FUNC_NAME, &retval);
|
||||
if (retval && Z_TYPE_P(retval) == IS_ARRAY) {
|
||||
HashTable *ht = Z_ARRVAL_P(retval);
|
||||
if (Z_REFCOUNT_P(retval) <= 1) {
|
||||
*is_temp = 1;
|
||||
efree(retval);
|
||||
return ht;
|
||||
} else {
|
||||
*is_temp = 0;
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
return ht;
|
||||
}
|
||||
if (retval && Z_TYPE_P(retval) == IS_NULL) {
|
||||
zval ret;
|
||||
array_init(&ret);
|
||||
*is_temp = 1;
|
||||
zval_ptr_dtor(&retval);
|
||||
return Z_ARRVAL(ret);
|
||||
}
|
||||
|
||||
zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array");
|
||||
|
||||
return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1638,7 +1670,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
|
||||
zend_std_compare_objects, /* compare_objects */
|
||||
zend_std_cast_object_tostring, /* cast_object */
|
||||
NULL, /* count_elements */
|
||||
NULL, /* get_debug_info */
|
||||
zend_std_get_debug_info, /* get_debug_info */
|
||||
zend_std_get_closure, /* get_closure */
|
||||
zend_std_get_gc, /* get_gc */
|
||||
NULL, /* do_operation */
|
||||
|
||||
@@ -36,8 +36,7 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
CHECK_ZVAL_STRING_REL(zvalue);
|
||||
str_efree_rel(zvalue->value.str.val);
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
case IS_ARRAY: {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
|
||||
@@ -86,7 +85,6 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
str_free(zvalue->value.str.val);
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY:
|
||||
case IS_CONSTANT_AST:
|
||||
case IS_OBJECT:
|
||||
case IS_RESOURCE:
|
||||
@@ -128,8 +126,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
case IS_ARRAY: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.ht;
|
||||
HashTable *tmp_ht = NULL;
|
||||
|
||||
+17
-26
@@ -1081,7 +1081,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
|
||||
FREE_OP1();
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (OP1_TYPE == IS_VAR && !free_op1.var) {
|
||||
@@ -3063,9 +3063,8 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3126,7 +3125,6 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval *varptr;
|
||||
int arg_num;
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
|
||||
@@ -3134,8 +3132,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
} else {
|
||||
arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
}
|
||||
@@ -3155,7 +3152,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -3193,8 +3190,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
}
|
||||
@@ -3214,8 +3210,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
|
||||
}
|
||||
}
|
||||
@@ -3715,8 +3710,6 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
retval = &EX_T(opline->result.var).tmp_var;
|
||||
ZVAL_COPY_VALUE(retval, &c->value);
|
||||
zval_copy_ctor(retval);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
/* class constant */
|
||||
zend_class_entry *ce;
|
||||
@@ -3727,8 +3720,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
value = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
@@ -3746,8 +3738,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3756,7 +3747,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = ce;
|
||||
zval_update_constant(value, (void *) 1 TSRMLS_CC);
|
||||
zval_update_constant(value, 1 TSRMLS_CC);
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
@@ -3772,10 +3763,13 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
constant_fetch_end:
|
||||
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
|
||||
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV)
|
||||
@@ -5381,11 +5375,8 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
|
||||
zval *tmp_ptr = &tmp;
|
||||
|
||||
ZVAL_COPY_VALUE(&tmp, val);
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
|
||||
zval_copy_ctor(&tmp);
|
||||
}
|
||||
INIT_PZVAL(&tmp);
|
||||
zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
|
||||
zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
|
||||
c.value = *tmp_ptr;
|
||||
} else {
|
||||
INIT_PZVAL_COPY(&c.value, val);
|
||||
|
||||
+52
-68
@@ -2736,9 +2736,8 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3685,7 +3684,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CONST == IS_VAR && !free_op1.var) {
|
||||
@@ -3972,8 +3971,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
retval = &EX_T(opline->result.var).tmp_var;
|
||||
ZVAL_COPY_VALUE(retval, &c->value);
|
||||
zval_copy_ctor(retval);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
/* class constant */
|
||||
zend_class_entry *ce;
|
||||
@@ -3984,8 +3981,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
value = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
@@ -4003,8 +3999,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4013,7 +4008,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = ce;
|
||||
zval_update_constant(value, (void *) 1 TSRMLS_CC);
|
||||
zval_update_constant(value, 1 TSRMLS_CC);
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
if (IS_CONST == IS_CONST) {
|
||||
@@ -4029,10 +4024,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
constant_fetch_end:
|
||||
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
|
||||
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -4310,11 +4308,8 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
|
||||
zval *tmp_ptr = &tmp;
|
||||
|
||||
ZVAL_COPY_VALUE(&tmp, val);
|
||||
if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
|
||||
zval_copy_ctor(&tmp);
|
||||
}
|
||||
INIT_PZVAL(&tmp);
|
||||
zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
|
||||
zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
|
||||
c.value = *tmp_ptr;
|
||||
} else {
|
||||
INIT_PZVAL_COPY(&c.value, val);
|
||||
@@ -5573,7 +5568,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CONST == IS_VAR && !free_op1.var) {
|
||||
@@ -6325,7 +6320,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CONST == IS_VAR && !free_op1.var) {
|
||||
@@ -8094,9 +8089,8 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
|
||||
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9096,7 +9090,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
|
||||
zval_dtor(free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -10852,7 +10846,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
|
||||
zval_dtor(free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -11606,7 +11600,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
|
||||
zval_dtor(free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -13385,7 +13379,6 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval *varptr;
|
||||
int arg_num;
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
|
||||
@@ -13393,8 +13386,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
} else {
|
||||
arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -13414,7 +13406,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -13452,8 +13444,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -13473,8 +13464,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -15030,7 +15020,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
|
||||
zval_ptr_dtor_nogc(&free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -15930,8 +15920,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
retval = &EX_T(opline->result.var).tmp_var;
|
||||
ZVAL_COPY_VALUE(retval, &c->value);
|
||||
zval_copy_ctor(retval);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
/* class constant */
|
||||
zend_class_entry *ce;
|
||||
@@ -15942,8 +15930,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
value = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
@@ -15961,8 +15948,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15971,7 +15957,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = ce;
|
||||
zval_update_constant(value, (void *) 1 TSRMLS_CC);
|
||||
zval_update_constant(value, 1 TSRMLS_CC);
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
if (IS_VAR == IS_CONST) {
|
||||
@@ -15987,10 +15973,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
constant_fetch_end:
|
||||
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
|
||||
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19628,7 +19617,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
|
||||
zval_ptr_dtor_nogc(&free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -21616,7 +21605,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
|
||||
zval_ptr_dtor_nogc(&free_op1.var);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_VAR == IS_VAR && !free_op1.var) {
|
||||
@@ -25543,8 +25532,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
retval = &EX_T(opline->result.var).tmp_var;
|
||||
ZVAL_COPY_VALUE(retval, &c->value);
|
||||
zval_copy_ctor(retval);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
/* class constant */
|
||||
zend_class_entry *ce;
|
||||
@@ -25555,8 +25542,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
value = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
@@ -25574,8 +25560,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
|
||||
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
|
||||
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
goto constant_fetch_end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25584,7 +25569,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = ce;
|
||||
zval_update_constant(value, (void *) 1 TSRMLS_CC);
|
||||
zval_update_constant(value, 1 TSRMLS_CC);
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
if (IS_UNUSED == IS_CONST) {
|
||||
@@ -25600,10 +25585,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
constant_fetch_end:
|
||||
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
|
||||
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -31000,7 +30988,6 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
USE_OPLINE
|
||||
|
||||
zval *varptr;
|
||||
int arg_num;
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
|
||||
@@ -31008,8 +30995,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
} else {
|
||||
arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -31029,7 +31015,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -31067,8 +31053,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -31087,8 +31072,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
|
||||
int arg_num = opline->op2.num + EX(call)->num_additional_args;
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
|
||||
return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
}
|
||||
@@ -32498,7 +32482,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CV == IS_VAR && !free_op1.var) {
|
||||
@@ -36722,7 +36706,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CV == IS_VAR && !free_op1.var) {
|
||||
@@ -38570,7 +38554,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
|
||||
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
|
||||
zval_update_constant(retval, 1 TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_FETCH_GLOBAL_LOCK:
|
||||
if (IS_CV == IS_VAR && !free_op1.var) {
|
||||
|
||||
@@ -1264,7 +1264,7 @@ function gen_vm($def, $skel) {
|
||||
out($f, "# pragma warning(once : 6285)\n");
|
||||
// Suppress (<non-zero constant> || <expression>) warnings on windows
|
||||
out($f, "# pragma warning(once : 6286)\n");
|
||||
// Suppress constant with constant comparsion warnings on windows
|
||||
// Suppress constant with constant comparison warnings on windows
|
||||
out($f, "# pragma warning(once : 6326)\n");
|
||||
}
|
||||
out($f, "#endif\n");
|
||||
|
||||
+2
-2
@@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.59 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
echo " to build PHP from Git."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $ac_version; IFS=' '
|
||||
if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version 2.59 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
echo " to build PHP from Git."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=6
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="alpha2"
|
||||
PHP_EXTRA_VERSION="beta2"
|
||||
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`
|
||||
|
||||
|
||||
+3
-2
@@ -31,6 +31,7 @@
|
||||
#include "ext/standard/file.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
#include "main/php_network.h"
|
||||
|
||||
/* for fileno() */
|
||||
#include <stdio.h>
|
||||
@@ -245,7 +246,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
|
||||
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path);
|
||||
|
||||
if (stream) {
|
||||
int fd;
|
||||
php_socket_t fd;
|
||||
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
|
||||
bz_file = BZ2_bzdopen(fd, mode);
|
||||
}
|
||||
@@ -394,7 +395,7 @@ static PHP_FUNCTION(bzopen)
|
||||
NULL);
|
||||
} else if (Z_TYPE_PP(file) == IS_RESOURCE) {
|
||||
/* If it is a resource, than its a stream resource */
|
||||
int fd;
|
||||
php_socket_t fd;
|
||||
int stream_mode_len;
|
||||
|
||||
php_stream_from_zval(stream, file);
|
||||
|
||||
@@ -46,7 +46,13 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
|
||||
|
||||
if (string_len > 0) {
|
||||
olestring = (OLECHAR*)safe_emalloc(string_len, sizeof(OLECHAR), 0);
|
||||
/* XXX if that's a real multibyte string, olestring is obviously allocated excessively.
|
||||
This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't
|
||||
matter much. */
|
||||
ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len);
|
||||
if (ok > 0 && ok < string_len) {
|
||||
olestring[ok] = '\0';
|
||||
}
|
||||
} else {
|
||||
ok = FALSE;
|
||||
olestring = (OLECHAR*)emalloc(sizeof(OLECHAR));
|
||||
|
||||
@@ -154,13 +154,17 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
|
||||
case IS_STRING:
|
||||
V_VT(v) = VT_BSTR;
|
||||
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
|
||||
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
|
||||
if (CP_UTF8 == codepage) {
|
||||
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
|
||||
} else {
|
||||
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
|
||||
}
|
||||
efree(olestring);
|
||||
break;
|
||||
|
||||
case IS_RESOURCE:
|
||||
case IS_CONSTANT:
|
||||
case IS_CONSTANT_ARRAY:
|
||||
case IS_CONSTANT_AST:
|
||||
default:
|
||||
V_VT(v) = VT_NULL;
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Bug #66431 Special Character via COM Interface (CP_UTF8), Scripting.FileSystemObject
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$text= "Xin chào cộng đồng PHP";
|
||||
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
|
||||
|
||||
$fso = new COM("Scripting.FileSystemObject");
|
||||
$fh = $fso->OpenTextFile($fpath, 2, true);
|
||||
$fh->Write($text);
|
||||
$fh->Close();
|
||||
|
||||
$check_text = file_get_contents($fpath);
|
||||
|
||||
$result = ($check_text == $text);
|
||||
|
||||
var_dump($result);
|
||||
|
||||
if (!$result) {
|
||||
echo "Expected: '$check_text'\n";
|
||||
echo "Have: '$text'\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
|
||||
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
|
||||
|
||||
if (file_exists($fpath)) {
|
||||
unlink($fpath);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,60 @@
|
||||
--TEST--
|
||||
Bug #66431 Special Character via COM Interface (CP_UTF8), Application.Word
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
|
||||
|
||||
try {
|
||||
new COM("word.application", NULL, CP_UTF8);
|
||||
} catch (Exception $e) {
|
||||
die('skip ' . $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$text= "Xin chào cộng đồng PHP";
|
||||
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
|
||||
|
||||
com_load_typelib('Word.Application');
|
||||
|
||||
$Wrd = new COM("word.application", NULL, CP_UTF8);
|
||||
$Wrd->Documents->Add();
|
||||
$Wrd->Selection->TypeText($text);
|
||||
$Wrd->ActiveDocument->SaveAs($fpath);
|
||||
$Wrd->ActiveDocument->Close(false);
|
||||
$Wrd->Application->Quit();
|
||||
unset($Wrd);
|
||||
|
||||
$Wrd = new COM("word.application", NULL, CP_UTF8);
|
||||
$Wrd->Documents->Open($fpath, NULL, false);
|
||||
$check_text = $Wrd->ActiveDocument->Range($Wrd->ActiveDocument->Sentences(1)->Start, $Wrd->ActiveDocument->Sentences(1)->End)->Text;
|
||||
$Wrd->ActiveDocument->Close(false);
|
||||
$Wrd->Application->Quit();
|
||||
unset($Wrd);
|
||||
|
||||
/* trim the returned text as we'll get windows eol from a word doc. */
|
||||
$result = (trim($check_text) == $text);
|
||||
|
||||
var_dump($result);
|
||||
|
||||
if (!$result) {
|
||||
echo "Expected: '$check_text'\n";
|
||||
echo "Have: '$text'\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
|
||||
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
|
||||
|
||||
if (file_exists($fpath)) {
|
||||
unlink($fpath);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
===DONE===
|
||||
+133
-124
@@ -165,50 +165,62 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
||||
# define php_curl_ret(__ret) RETVAL_FALSE; return;
|
||||
#endif
|
||||
|
||||
static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
|
||||
static int php_curl_option_str(php_curl *ch, long option, const char *str, const int len, zend_bool make_copy TSRMLS_DC)
|
||||
{
|
||||
CURLcode error = CURLE_OK;
|
||||
#if LIBCURL_VERSION_NUM < 0x071100
|
||||
char *copystr = NULL;
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
if (make_copy) {
|
||||
#endif
|
||||
char *copystr;
|
||||
|
||||
/* Strings passed to libcurl as 'char *' arguments, are copied by the library since 7.17.0 */
|
||||
copystr = estrndup(str, len);
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
} else {
|
||||
error = curl_easy_setopt(ch->cp, option, str);
|
||||
}
|
||||
#endif
|
||||
|
||||
SAVE_CURL_ERROR(ch, error)
|
||||
|
||||
return error == CURLE_OK ? SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
/* Disable file:// if open_basedir are used */
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE);
|
||||
#else
|
||||
php_url *uri;
|
||||
|
||||
if (!(uri = php_url_parse_ex(url, len))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", url);
|
||||
return 0;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
|
||||
php_url_free(uri);
|
||||
return 0;
|
||||
return FAILURE;
|
||||
}
|
||||
php_url_free(uri);
|
||||
#endif
|
||||
}
|
||||
/* Strings passed to libcurl as 'char *' arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_URL, url);
|
||||
#else
|
||||
copystr = estrndup(url, len);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_URL, copystr);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
#endif
|
||||
|
||||
return (error == CURLE_OK ? 1 : 0);
|
||||
return php_curl_option_str(ch, CURLOPT_URL, url, len, 0 TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
|
||||
void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_stream *stream;
|
||||
if (!ch || !ch->handlers) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch->handlers->std_err) {
|
||||
@@ -265,7 +277,7 @@ int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
|
||||
curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
return ;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -621,7 +633,6 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_BUFFERSIZE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CAINFO);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CAPATH);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_COOKIE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE);
|
||||
@@ -711,13 +722,6 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER);
|
||||
|
||||
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK);
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST);
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST);
|
||||
|
||||
/* */
|
||||
REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK);
|
||||
REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER);
|
||||
@@ -1895,7 +1899,10 @@ static void _php_curl_set_default_options(php_curl *ch)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
|
||||
|
||||
cainfo = INI_STR("curl.cainfo");
|
||||
cainfo = INI_STR("openssl.cafile");
|
||||
if (!(cainfo && strlen(cainfo) > 0)) {
|
||||
cainfo = INI_STR("curl.cainfo");
|
||||
}
|
||||
if (cainfo && strlen(cainfo) > 0) {
|
||||
curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
|
||||
}
|
||||
@@ -1941,7 +1948,7 @@ PHP_FUNCTION(curl_init)
|
||||
_php_curl_set_default_options(ch);
|
||||
|
||||
if (url) {
|
||||
if (!php_curl_option_url(ch, url, url_len TSRMLS_CC)) {
|
||||
if (php_curl_option_url(ch, url, url_len TSRMLS_CC) == FAILURE) {
|
||||
_php_curl_close_ex(ch TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -2058,7 +2065,7 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *return_value TSRMLS_DC) /* {{{ */
|
||||
static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
CURLcode error=CURLE_OK;
|
||||
|
||||
@@ -2076,7 +2083,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
}
|
||||
case CURLOPT_AUTOREFERER:
|
||||
case CURLOPT_BUFFERSIZE:
|
||||
case CURLOPT_CLOSEPOLICY:
|
||||
case CURLOPT_CONNECTTIMEOUT:
|
||||
case CURLOPT_COOKIESESSION:
|
||||
case CURLOPT_CRLF:
|
||||
@@ -2225,7 +2231,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
|
||||
(PG(open_basedir) && *PG(open_basedir)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@@ -2240,14 +2245,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
case CURLOPT_CAINFO:
|
||||
case CURLOPT_CAPATH:
|
||||
case CURLOPT_COOKIE:
|
||||
case CURLOPT_CUSTOMREQUEST:
|
||||
case CURLOPT_EGDSOCKET:
|
||||
case CURLOPT_FTPPORT:
|
||||
case CURLOPT_INTERFACE:
|
||||
case CURLOPT_PRIVATE:
|
||||
case CURLOPT_PROXY:
|
||||
case CURLOPT_PROXYUSERPWD:
|
||||
case CURLOPT_RANGE:
|
||||
case CURLOPT_REFERER:
|
||||
case CURLOPT_SSLCERTTYPE:
|
||||
case CURLOPT_SSLENGINE:
|
||||
@@ -2256,23 +2257,14 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLKEYTYPE:
|
||||
case CURLOPT_SSL_CIPHER_LIST:
|
||||
case CURLOPT_URL:
|
||||
case CURLOPT_USERAGENT:
|
||||
case CURLOPT_USERPWD:
|
||||
#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
|
||||
case CURLOPT_FTP_ACCOUNT:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
|
||||
case CURLOPT_COOKIELIST:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x070f05 /* Available since 7.15.5 */
|
||||
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
|
||||
case CURLOPT_KRBLEVEL:
|
||||
#else
|
||||
case CURLOPT_KRB4LEVEL:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071101 /* Available since 7.17.1 */
|
||||
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
|
||||
#endif
|
||||
@@ -2287,7 +2279,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
|
||||
case CURLOPT_MAIL_FROM:
|
||||
case CURLOPT_RTSP_SESSION_ID:
|
||||
case CURLOPT_RTSP_STREAM_URI:
|
||||
case CURLOPT_RTSP_TRANSPORT:
|
||||
#endif
|
||||
@@ -2309,32 +2300,44 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
#endif
|
||||
{
|
||||
convert_to_string_ex(zvalue);
|
||||
if (option == CURLOPT_URL) {
|
||||
if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC)) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (option == CURLOPT_PRIVATE) {
|
||||
char *copystr;
|
||||
#if LIBCURL_VERSION_NUM < 0x071100
|
||||
string_copy:
|
||||
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
/* Curl nullable string options */
|
||||
case CURLOPT_CUSTOMREQUEST:
|
||||
case CURLOPT_FTPPORT:
|
||||
case CURLOPT_RANGE:
|
||||
#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
|
||||
case CURLOPT_FTP_ACCOUNT:
|
||||
#endif
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
/* Strings passed to libcurl as ’char *’ arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
|
||||
error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue));
|
||||
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
|
||||
case CURLOPT_RTSP_SESSION_ID:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
|
||||
case CURLOPT_KRBLEVEL:
|
||||
#else
|
||||
goto string_copy;
|
||||
case CURLOPT_KRB4LEVEL:
|
||||
#endif
|
||||
}
|
||||
{
|
||||
if (Z_TYPE_PP(zvalue) == IS_NULL) {
|
||||
error = curl_easy_setopt(ch->cp, option, NULL);
|
||||
} else {
|
||||
convert_to_string_ex(zvalue);
|
||||
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Curl private option */
|
||||
case CURLOPT_PRIVATE:
|
||||
convert_to_string_ex(zvalue);
|
||||
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 1 TSRMLS_CC);
|
||||
|
||||
/* Curl url option */
|
||||
case CURLOPT_URL:
|
||||
convert_to_string_ex(zvalue);
|
||||
return php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC);
|
||||
|
||||
/* Curl file handle options */
|
||||
case CURLOPT_FILE:
|
||||
case CURLOPT_INFILE:
|
||||
@@ -2342,28 +2345,34 @@ string_copy:
|
||||
case CURLOPT_WRITEHEADER: {
|
||||
FILE *fp = NULL;
|
||||
int type;
|
||||
void * what;
|
||||
void *what = NULL;
|
||||
|
||||
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
|
||||
if (!what) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
if (Z_TYPE_PP(zvalue) != IS_NULL) {
|
||||
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
|
||||
if (!what) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!fp) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
if (!fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
error = CURLE_OK;
|
||||
switch (option) {
|
||||
case CURLOPT_FILE:
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (!what) {
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_DELREF_P(ch->handlers->write->stream);
|
||||
ch->handlers->write->stream = NULL;
|
||||
}
|
||||
ch->handlers->write->fp = NULL;
|
||||
ch->handlers->write->method = PHP_CURL_STDOUT;
|
||||
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_DELREF_P(ch->handlers->write->stream);
|
||||
}
|
||||
@@ -2373,12 +2382,18 @@ string_copy:
|
||||
ch->handlers->write->stream = *zvalue;
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_WRITEHEADER:
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (!what) {
|
||||
if (ch->handlers->write_header->stream) {
|
||||
Z_DELREF_P(ch->handlers->write_header->stream);
|
||||
ch->handlers->write_header->stream = NULL;
|
||||
}
|
||||
ch->handlers->write_header->fp = NULL;
|
||||
ch->handlers->write_header->method = PHP_CURL_IGNORE;
|
||||
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->write_header->stream) {
|
||||
Z_DELREF_P(ch->handlers->write_header->stream);
|
||||
}
|
||||
@@ -2388,21 +2403,34 @@ string_copy:
|
||||
ch->handlers->write_header->stream = *zvalue;
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
break;
|
||||
case CURLOPT_INFILE:
|
||||
if (ch->handlers->read->stream) {
|
||||
Z_DELREF_P(ch->handlers->read->stream);
|
||||
if (!what) {
|
||||
if (ch->handlers->read->stream) {
|
||||
Z_DELREF_P(ch->handlers->read->stream);
|
||||
ch->handlers->read->stream = NULL;
|
||||
}
|
||||
ch->handlers->read->fp = NULL;
|
||||
ch->handlers->read->fd = 0;
|
||||
} else {
|
||||
if (ch->handlers->read->stream) {
|
||||
Z_DELREF_P(ch->handlers->read->stream);
|
||||
}
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->read->fp = fp;
|
||||
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
|
||||
ch->handlers->read->stream = *zvalue;
|
||||
}
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->read->fp = fp;
|
||||
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
|
||||
ch->handlers->read->stream = *zvalue;
|
||||
break;
|
||||
case CURLOPT_STDERR:
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (!what) {
|
||||
if (ch->handlers->std_err) {
|
||||
zval_ptr_dtor(&ch->handlers->std_err);
|
||||
ch->handlers->std_err = NULL;
|
||||
}
|
||||
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->std_err) {
|
||||
zval_ptr_dtor(&ch->handlers->std_err);
|
||||
}
|
||||
@@ -2410,8 +2438,7 @@ string_copy:
|
||||
ch->handlers->std_err = *zvalue;
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
/* break omitted intentionally */
|
||||
default:
|
||||
@@ -2473,8 +2500,7 @@ string_copy:
|
||||
#endif
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the %s argument", name);
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
for (zend_hash_internal_pointer_reset(ph);
|
||||
@@ -2487,7 +2513,6 @@ string_copy:
|
||||
slist = curl_slist_append(slist, Z_STRVAL_PP(current));
|
||||
if (!slist) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -2508,8 +2533,7 @@ string_copy:
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
if (Z_LVAL_PP(zvalue) != 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2536,8 +2560,7 @@ string_copy:
|
||||
postfields = HASH_OF(*zvalue);
|
||||
if (!postfields) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
for (zend_hash_internal_pointer_reset(postfields);
|
||||
@@ -2573,7 +2596,6 @@ string_copy:
|
||||
postval = Z_STRVAL_P(prop);
|
||||
|
||||
if (php_check_open_basedir(postval TSRMLS_CC)) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2622,8 +2644,7 @@ string_copy:
|
||||
}
|
||||
/* open_basedir check */
|
||||
if (php_check_open_basedir(postval TSRMLS_CC)) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
@@ -2654,8 +2675,7 @@ string_copy:
|
||||
|
||||
SAVE_CURL_ERROR(ch, error);
|
||||
if (error != CURLE_OK) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (Z_REFCOUNT_P(ch->clone) <= 1) {
|
||||
@@ -2677,7 +2697,7 @@ string_copy:
|
||||
post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
zend_llist_add_element(&ch->to_free->str, &post);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue));
|
||||
#endif
|
||||
}
|
||||
@@ -2775,26 +2795,13 @@ string_copy:
|
||||
case CURLOPT_SSH_KNOWNHOSTS:
|
||||
#endif
|
||||
{
|
||||
#if LIBCURL_VERSION_NUM < 0x071100
|
||||
char *copystr = NULL;
|
||||
#endif
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
|
||||
if (Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue));
|
||||
#else
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
#endif
|
||||
break;
|
||||
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
case CURLINFO_HEADER_OUT:
|
||||
@@ -2839,9 +2846,9 @@ string_copy:
|
||||
|
||||
SAVE_CURL_ERROR(ch, error);
|
||||
if (error != CURLE_OK) {
|
||||
return 1;
|
||||
return FAILURE;
|
||||
} else {
|
||||
return 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2865,7 +2872,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!_php_curl_setopt(ch, options, zvalue, return_value TSRMLS_CC)) {
|
||||
if (_php_curl_setopt(ch, options, zvalue TSRMLS_CC) == SUCCESS) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
@@ -2896,7 +2903,7 @@ PHP_FUNCTION(curl_setopt_array)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array keys must be CURLOPT constants or equivalent integer values");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (_php_curl_setopt(ch, (long) option, entry, return_value TSRMLS_CC)) {
|
||||
if (_php_curl_setopt(ch, (long) option, entry TSRMLS_CC) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
|
||||
@@ -3161,6 +3168,7 @@ PHP_FUNCTION(curl_getinfo)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if LIBCURL_VERSION_NUM >= 0x070c03 /* Available since 7.12.3 */
|
||||
case CURLINFO_SLIST:
|
||||
{
|
||||
struct curl_slist *slist;
|
||||
@@ -3176,6 +3184,7 @@ PHP_FUNCTION(curl_getinfo)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -248,6 +248,8 @@ PHP_FUNCTION(curl_multi_getcontent)
|
||||
smart_str_0(&ch->handlers->write->buf);
|
||||
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
|
||||
}
|
||||
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ typedef struct {
|
||||
|
||||
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);
|
||||
void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
|
||||
|
||||
void curlfile_register_class(TSRMLS_D);
|
||||
PHP_CURL_API extern zend_class_entry *curl_CURLFile_class;
|
||||
|
||||
@@ -81,8 +81,7 @@ Ok for CURLOPT_WRITEHEADER
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
%A
|
||||
Ok for CURLOPT_FILE
|
||||
%AOk for CURLOPT_FILE
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
|
||||
|
||||
@@ -53,20 +53,13 @@ foreach($options_to_check as $option) {
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug54798.php on line %d
|
||||
* About to connect() %a
|
||||
* Closing connection #%d
|
||||
Ok for CURLOPT_STDERR
|
||||
|
||||
Warning: curl_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug54798.php on line 24
|
||||
Ok for CURLOPT_WRITEHEADER
|
||||
|
||||
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug54798.php on line 24
|
||||
%a
|
||||
Ok for CURLOPT_FILE
|
||||
|
||||
Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug54798.php on line %d
|
||||
Ok for CURLOPT_INFILE
|
||||
%aOk for CURLOPT_STDERR
|
||||
%aOk for CURLOPT_WRITEHEADER
|
||||
%aOk for CURLOPT_FILE
|
||||
%aOk for CURLOPT_INFILE
|
||||
===DONE===
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #64267 (CURLOPT_INFILE doesn't allow reset)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("curl") or die("skip need ext/curl");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "TEST\n";
|
||||
|
||||
$c = curl_init("http://google.com");
|
||||
$f = fopen(__FILE__,"r");
|
||||
var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_UPLOAD => true,
|
||||
CURLOPT_INFILE => $f,
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__)
|
||||
]));
|
||||
fclose($f);
|
||||
var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_UPLOAD => false,
|
||||
CURLOPT_INFILE => null,
|
||||
CURLOPT_INFILESIZE => 0,
|
||||
]));
|
||||
curl_exec($c);
|
||||
var_dump(curl_getinfo($c, CURLINFO_RESPONSE_CODE));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
TEST
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(30%d)
|
||||
===DONE===
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #66109 (Option CURLOPT_CUSTOMREQUEST can't be reset to default.)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=method");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, NULL);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(6) "DELETE"
|
||||
string(3) "GET"
|
||||
@@ -25,5 +25,5 @@ curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(%d) "%r(Couldn't resolve host|Could not resolve host:)%r %Swww.%s"
|
||||
%s resolve%s
|
||||
int(6)
|
||||
@@ -26,5 +26,5 @@ curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:)%r %s"
|
||||
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
|
||||
int(5)
|
||||
@@ -33,6 +33,5 @@ echo "Closed correctly\n";
|
||||
<?php
|
||||
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp');
|
||||
?>
|
||||
--EXPECTF--
|
||||
* Closing connection #%d
|
||||
--EXPECT--
|
||||
Closed correctly
|
||||
@@ -36,5 +36,8 @@ unlink($test_file);
|
||||
unlink($log_file);
|
||||
|
||||
?>
|
||||
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
testtest
|
||||
===DONE===
|
||||
@@ -48,5 +48,4 @@ curl_close($ch);
|
||||
*** Testing curl_setopt with CURLOPT_STDERR
|
||||
string(%d) "%S"
|
||||
string(%d) "%S"
|
||||
* Closing connection #%d
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
|
||||
}
|
||||
break;
|
||||
case 'method':
|
||||
echo $_SERVER['REQUEST_METHOD'];
|
||||
break;
|
||||
default:
|
||||
echo "Hello World!\n";
|
||||
echo "Hello World!";
|
||||
|
||||
+467
-448
File diff suppressed because it is too large.
Load diff
+11
-12
@@ -28,7 +28,7 @@ static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 24
|
||||
static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
|
||||
static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
|
||||
{
|
||||
if (*a < start) {
|
||||
*b -= (start - *a - 1) / adj + 1;
|
||||
@@ -38,7 +38,6 @@ static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, t
|
||||
*b += *a / adj;
|
||||
*a -= adj * (*a / adj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void inc_month(timelib_sll *y, timelib_sll *m)
|
||||
@@ -170,24 +169,24 @@ static void do_adjust_for_weekday(timelib_time* time)
|
||||
|
||||
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
|
||||
{
|
||||
do {} while (do_range_limit(0, 60, 60, &rt->s, &rt->i));
|
||||
do {} while (do_range_limit(0, 60, 60, &rt->i, &rt->h));
|
||||
do {} while (do_range_limit(0, 24, 24, &rt->h, &rt->d));
|
||||
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
|
||||
do_range_limit(0, 60, 60, &rt->s, &rt->i);
|
||||
do_range_limit(0, 60, 60, &rt->i, &rt->h);
|
||||
do_range_limit(0, 24, 24, &rt->h, &rt->d);
|
||||
do_range_limit(0, 12, 12, &rt->m, &rt->y);
|
||||
|
||||
do_range_limit_days_relative(&base->y, &base->m, &rt->y, &rt->m, &rt->d, rt->invert);
|
||||
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
|
||||
do_range_limit(0, 12, 12, &rt->m, &rt->y);
|
||||
}
|
||||
|
||||
void timelib_do_normalize(timelib_time* time)
|
||||
{
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
|
||||
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->s, &time->i);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->i, &time->h);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 24, 24, &time->h, &time->d);
|
||||
do_range_limit(1, 13, 12, &time->m, &time->y);
|
||||
|
||||
do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
|
||||
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
|
||||
do_range_limit(1, 13, 12, &time->m, &time->y);
|
||||
}
|
||||
|
||||
static void do_adjust_relative(timelib_time* time)
|
||||
|
||||
+40
-1
@@ -299,6 +299,10 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_date_method_timestamp_get, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_mutable, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, DateTime)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_open, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, timezone)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -495,6 +499,7 @@ const zend_function_entry date_funcs_immutable[] = {
|
||||
PHP_ME(DateTimeImmutable, setDate, arginfo_date_method_date_set, 0)
|
||||
PHP_ME(DateTimeImmutable, setISODate, arginfo_date_method_isodate_set, 0)
|
||||
PHP_ME(DateTimeImmutable, setTimestamp, arginfo_date_method_timestamp_set, 0)
|
||||
PHP_ME(DateTimeImmutable, createFromMutable, arginfo_date_method_create_from_mutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
@@ -2724,7 +2729,9 @@ PHP_METHOD(DateTime, __construct)
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
|
||||
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
|
||||
ZVAL_NULL(getThis());
|
||||
}
|
||||
}
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
}
|
||||
@@ -2748,6 +2755,34 @@ PHP_METHOD(DateTimeImmutable, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto DateTimeImmutable::createFromMutable(DateTimeZone object)
|
||||
Creates new DateTimeImmutable object from an existing mutable DateTime object.
|
||||
*/
|
||||
PHP_METHOD(DateTimeImmutable, createFromMutable)
|
||||
{
|
||||
zval *datetime_object = NULL;
|
||||
php_date_obj *new_obj = NULL;
|
||||
php_date_obj *old_obj = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
old_obj = (php_date_obj *) zend_object_store_get_object(datetime_object TSRMLS_CC);
|
||||
new_obj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
|
||||
new_obj->time = timelib_time_ctor();
|
||||
*new_obj->time = *old_obj->time;
|
||||
if (old_obj->time->tz_abbr) {
|
||||
new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
|
||||
}
|
||||
if (old_obj->time->tz_info) {
|
||||
new_obj->time->tz_info = old_obj->time->tz_info;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
zval **z_date = NULL;
|
||||
@@ -2781,6 +2816,10 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
|
||||
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
|
||||
|
||||
if (tzi == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ALLOC_INIT_ZVAL(tmp_obj);
|
||||
tzobj = zend_object_store_get_object(php_date_instantiate(date_ce_timezone, tmp_obj TSRMLS_CC) TSRMLS_CC);
|
||||
tzobj->type = TIMELIB_ZONETYPE_ID;
|
||||
|
||||
@@ -82,6 +82,7 @@ PHP_METHOD(DateTimeImmutable, setTime);
|
||||
PHP_METHOD(DateTimeImmutable, setDate);
|
||||
PHP_METHOD(DateTimeImmutable, setISODate);
|
||||
PHP_METHOD(DateTimeImmutable, setTimestamp);
|
||||
PHP_METHOD(DateTimeImmutable, createFromMutable);
|
||||
|
||||
PHP_METHOD(DateTimeZone, __construct);
|
||||
PHP_METHOD(DateTimeZone, __wakeup);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Tests for DateTimeImmutable::createFromMutable.
|
||||
--INI--
|
||||
date.timezone=Europe/London
|
||||
--FILE--
|
||||
<?php
|
||||
$current = "2014-03-02 16:24:08";
|
||||
|
||||
$i = DateTimeImmutable::createFromMutable( date_create( $current ) );
|
||||
var_dump( $i );
|
||||
|
||||
$i = DateTimeImmutable::createFromMutable( date_create_immutable( $current ) );
|
||||
var_dump( $i );
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateTimeImmutable)#%d (3) {
|
||||
["date"]=>
|
||||
string(19) "2014-03-02 16:24:08"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in %stests%eDateTimeImmutable_createFromMutable.php on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Test for bug #66721: __wakeup of DateTime segfaults when invalid object data is supplied
|
||||
--CREDITS--
|
||||
Boro Sitnikovski <buritomath@yahoo.com>
|
||||
--FILE--
|
||||
<?php
|
||||
$y = 'O:8:"DateTime":3:{s:4:"date";s:19:"2014-02-15 02:00:51";s:13:"timezone_type";i:3;s:8:"timezone";s:10:"1234567890";}';
|
||||
var_dump(unserialize($y));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Invalid serialization data for DateTime object in %s on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #67118 php-cgi crashes regularly on IIS 7
|
||||
--INI--
|
||||
date.timezone=Europe/Berlin
|
||||
--FILE--
|
||||
<?php
|
||||
class mydt extends datetime
|
||||
{
|
||||
public function __construct($time = 'now', $tz = NULL, $format = NULL)
|
||||
{
|
||||
if (!empty($tz) && !is_object($tz)) {
|
||||
$tz = new DateTimeZone($tz);
|
||||
}
|
||||
|
||||
@parent::__construct($time, $tz);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rådgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone))
|
||||
#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC')
|
||||
#2 {main}
|
||||
thrown in %sbug67118.php on line %d
|
||||
+2
-2
@@ -57,14 +57,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, path)
|
||||
ZEND_ARG_INFO(0, mode)
|
||||
ZEND_ARG_INFO(0, handlername)
|
||||
ZEND_ARG_INFO(0, ...)
|
||||
ZEND_ARG_VARIADIC_INFO(0, handler_parameters)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_open, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, path)
|
||||
ZEND_ARG_INFO(0, mode)
|
||||
ZEND_ARG_INFO(0, handlername)
|
||||
ZEND_ARG_INFO(0, ...)
|
||||
ZEND_ARG_VARIADIC_INFO(0, handler_parameters)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_dba_close, 0)
|
||||
|
||||
@@ -1509,6 +1509,12 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
|
||||
|
||||
if (uri->scheme != NULL) {
|
||||
/* absolute file uris - libxml only supports localhost or empty host */
|
||||
#ifdef PHP_WIN32
|
||||
if (strncasecmp(source, "file://",7) == 0 && ':' == source[8]) {
|
||||
isFileUri = 1;
|
||||
source += 7;
|
||||
} else
|
||||
#endif
|
||||
if (strncasecmp(source, "file:///",8) == 0) {
|
||||
isFileUri = 1;
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
+25
-11
@@ -188,8 +188,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
|
||||
{
|
||||
|
||||
xmlDtdPtr dtdptr;
|
||||
xmlDtd *intsubset;
|
||||
xmlOutputBuffer *buff = NULL;
|
||||
xmlDtdPtr intsubset;
|
||||
|
||||
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
|
||||
|
||||
@@ -200,22 +199,37 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
|
||||
|
||||
ALLOC_ZVAL(*retval);
|
||||
|
||||
if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) {
|
||||
buff = xmlAllocOutputBuffer(NULL);
|
||||
if (buff != NULL) {
|
||||
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
|
||||
xmlOutputBufferFlush(buff);
|
||||
if (dtdptr->doc != NULL && ((intsubset = xmlGetIntSubset(dtdptr->doc)) != NULL) && intsubset->children != NULL) {
|
||||
smart_str ret_buf = {0};
|
||||
xmlNodePtr cur = intsubset->children;
|
||||
|
||||
while (cur != NULL) {
|
||||
xmlOutputBuffer *buff = xmlAllocOutputBuffer(NULL);
|
||||
|
||||
if (buff != NULL) {
|
||||
xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL);
|
||||
xmlOutputBufferFlush(buff);
|
||||
|
||||
#ifdef LIBXML2_NEW_BUFFER
|
||||
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
|
||||
smart_str_appendl(&ret_buf, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff));
|
||||
#else
|
||||
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
|
||||
smart_str_appendl(&ret_buf, buff->buffer->content, buff->buffer->use);
|
||||
#endif
|
||||
(void)xmlOutputBufferClose(buff);
|
||||
|
||||
(void)xmlOutputBufferClose(buff);
|
||||
}
|
||||
|
||||
cur = cur->next;
|
||||
}
|
||||
|
||||
if (ret_buf.len) {
|
||||
ZVAL_STRINGL(*retval, ret_buf.c, ret_buf.len, 1);
|
||||
smart_str_free(&ret_buf);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
ZVAL_EMPTY_STRING(*retval);
|
||||
ZVAL_NULL(*retval);
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
|
||||
@@ -43,6 +43,6 @@ print 'notation: '.$notation->nodeName."\n";
|
||||
publicId: -//OASIS//DTD DocBook XML//EN
|
||||
systemId: docbookx.dtd
|
||||
name: chapter
|
||||
internalSubset: <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML//EN" "docbookx.dtd">
|
||||
internalSubset:
|
||||
entity: logo
|
||||
notation: gif
|
||||
notation: gif
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$domDocument = new DOMDocument();
|
||||
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_0.xml");
|
||||
var_dump($domDocument->doctype->internalSubset);
|
||||
|
||||
$domDocument = new DOMDocument();
|
||||
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_1.xml");
|
||||
var_dump($domDocument->doctype->internalSubset);
|
||||
|
||||
$domDocument = new DOMDocument();
|
||||
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_2.xml");
|
||||
var_dump($domDocument->doctype->internalSubset);
|
||||
|
||||
$domDocument = new DOMDocument();
|
||||
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "dom.xml");
|
||||
var_dump($domDocument->doctype->internalSubset);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(19) "<!ELEMENT a EMPTY>
|
||||
"
|
||||
string(38) "<!ELEMENT a EMPTY>
|
||||
<!ELEMENT b EMPTY>
|
||||
"
|
||||
NULL
|
||||
string(277) "<!ENTITY % incent SYSTEM "dom.ent">
|
||||
<!ENTITY amp "&#38;">
|
||||
<!ENTITY gt ">">
|
||||
<!ENTITY % coreattrs "title CDATA #IMPLIED">
|
||||
<!ENTITY % attrs "%coreattrs;">
|
||||
<!ATTLIST foo bar CDATA #IMPLIED>
|
||||
<!ELEMENT foo (#PCDATA)>
|
||||
<!ELEMENT root (foo)+>
|
||||
<!ATTLIST th title CDATA #IMPLIED>
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE a [
|
||||
<!ELEMENT a EMPTY>
|
||||
]>
|
||||
<a></a>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE a [
|
||||
<!ELEMENT a EMPTY>
|
||||
<!ELEMENT b EMPTY>
|
||||
]>
|
||||
<a></a>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<a></a>
|
||||
|
||||
@@ -13,6 +13,41 @@ if test "$PHP_FILEINFO" != "no"; then
|
||||
libmagic/is_tar.c libmagic/magic.c libmagic/print.c \
|
||||
libmagic/readcdf.c libmagic/readelf.c libmagic/softmagic.c"
|
||||
|
||||
AC_MSG_CHECKING([for strcasestr])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char *s0, *s1, *ret;
|
||||
|
||||
s0 = (char *) malloc(42);
|
||||
s1 = (char *) malloc(8);
|
||||
|
||||
memset(s0, 'X', 42);
|
||||
s0[24] = 'Y';
|
||||
s0[26] = 'Z';
|
||||
s0[41] = '\0';
|
||||
memset(s1, 'x', 8);
|
||||
s1[0] = 'y';
|
||||
s1[2] = 'Z';
|
||||
s1[7] = '\0';
|
||||
|
||||
ret = strcasestr(s0, s1);
|
||||
|
||||
return !(NULL != ret);
|
||||
}
|
||||
],[
|
||||
dnl using the platform implementation
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_NOTICE(using libmagic strcasestr implementation)
|
||||
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
|
||||
])
|
||||
|
||||
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
|
||||
|
||||
|
||||
+70882
-58544
File diff suppressed because it is too large.
Load diff
@@ -269,9 +269,15 @@ ZEND_GET_MODULE(fileinfo)
|
||||
*/
|
||||
PHP_MINFO_FUNCTION(fileinfo)
|
||||
{
|
||||
char magic_ver[5];
|
||||
|
||||
(void)snprintf(magic_ver, 4, "%d", magic_version());
|
||||
magic_ver[4] = '\0';
|
||||
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "fileinfo support", "enabled");
|
||||
php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION);
|
||||
php_info_print_table_row(2, "libmagic", magic_ver);
|
||||
php_info_print_table_end();
|
||||
}
|
||||
/* }}} */
|
||||
@@ -315,11 +321,7 @@ PHP_FUNCTION(finfo_open)
|
||||
file = NULL;
|
||||
} else if (file && *file) { /* user specified file, perform open_basedir checks */
|
||||
|
||||
#if PHP_API_VERSION < 20100412
|
||||
if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) {
|
||||
#else
|
||||
if (php_check_open_basedir(file TSRMLS_CC)) {
|
||||
#endif
|
||||
FILEINFO_DESTROY_OBJECT(object);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+398
-506
File diff suppressed because it is too large.
Load diff
@@ -34,7 +34,7 @@
|
||||
#include "file.h"
|
||||
|
||||
#ifndef lint
|
||||
FILE_RCSID("@(#)$File: apprentice.c,v 1.191 2013/02/26 21:02:48 christos Exp $")
|
||||
FILE_RCSID("@(#)$File: apprentice.c,v 1.196 2013/11/19 21:01:12 christos Exp $")
|
||||
#endif /* lint */
|
||||
|
||||
#include "magic.h"
|
||||
@@ -94,6 +94,12 @@ struct magic_entry {
|
||||
uint32_t max_count;
|
||||
};
|
||||
|
||||
struct magic_entry_set {
|
||||
struct magic_entry *me;
|
||||
uint32_t count;
|
||||
uint32_t max;
|
||||
};
|
||||
|
||||
struct magic_map {
|
||||
void *p;
|
||||
size_t len;
|
||||
@@ -139,7 +145,6 @@ private int parse_strength(struct magic_set *, struct magic_entry *, const char
|
||||
private int parse_apple(struct magic_set *, struct magic_entry *, const char *);
|
||||
|
||||
|
||||
private size_t maxmagic[MAGIC_SETS] = { 0 };
|
||||
private size_t magicsize = sizeof(struct magic);
|
||||
|
||||
private const char usg_hdr[] = "cont\toffset\ttype\topcode\tmask\tvalue\tdesc";
|
||||
@@ -179,7 +184,7 @@ static const struct type_tbl_s type_tbl[] = {
|
||||
{ XX("invalid"), FILE_INVALID, FILE_FMT_NONE },
|
||||
{ XX("byte"), FILE_BYTE, FILE_FMT_NUM },
|
||||
{ XX("short"), FILE_SHORT, FILE_FMT_NUM },
|
||||
{ XX("default"), FILE_DEFAULT, FILE_FMT_STR },
|
||||
{ XX("default"), FILE_DEFAULT, FILE_FMT_NONE },
|
||||
{ XX("long"), FILE_LONG, FILE_FMT_NUM },
|
||||
{ XX("string"), FILE_STRING, FILE_FMT_STR },
|
||||
{ XX("date"), FILE_DATE, FILE_FMT_STR },
|
||||
@@ -223,6 +228,7 @@ static const struct type_tbl_s type_tbl[] = {
|
||||
{ XX("beqwdate"), FILE_BEQWDATE, FILE_FMT_STR },
|
||||
{ XX("name"), FILE_NAME, FILE_FMT_NONE },
|
||||
{ XX("use"), FILE_USE, FILE_FMT_NONE },
|
||||
{ XX("clear"), FILE_CLEAR, FILE_FMT_NONE },
|
||||
{ XX_NULL, FILE_INVALID, FILE_FMT_NONE },
|
||||
};
|
||||
|
||||
@@ -493,12 +499,14 @@ apprentice_unmap(struct magic_map *map)
|
||||
if (map == NULL)
|
||||
return;
|
||||
if (map->p != php_magic_database) {
|
||||
int j;
|
||||
for (j = 0; j < MAGIC_SETS; j++) {
|
||||
if (map->magic[j])
|
||||
efree(map->magic[j]);
|
||||
}
|
||||
if (map->p != NULL) {
|
||||
if (map->p == NULL) {
|
||||
int j;
|
||||
for (j = 0; j < MAGIC_SETS; j++) {
|
||||
if (map->magic[j]) {
|
||||
efree(map->magic[j]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
efree(map->p);
|
||||
}
|
||||
}
|
||||
@@ -541,6 +549,9 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
|
||||
char *p, *mfn;
|
||||
int file_err, errs = -1;
|
||||
size_t i;
|
||||
|
||||
file_reset(ms);
|
||||
|
||||
/* XXX disabling default magic loading so the compiled in data is used */
|
||||
#if 0
|
||||
if ((fn = magic_getpath(fn, action)) == NULL)
|
||||
@@ -605,6 +616,10 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Always leave the database loaded
|
||||
*/
|
||||
if (action == FILE_LOAD)
|
||||
return 0;
|
||||
|
||||
@@ -612,8 +627,10 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
|
||||
mlist_free(ms->mlist[i]);
|
||||
ms->mlist[i] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (action) {
|
||||
case FILE_LOAD:
|
||||
case FILE_COMPILE:
|
||||
case FILE_CHECK:
|
||||
case FILE_LIST:
|
||||
@@ -906,24 +923,24 @@ set_test_type(struct magic *mstart, struct magic *m)
|
||||
|
||||
private int
|
||||
addentry(struct magic_set *ms, struct magic_entry *me,
|
||||
struct magic_entry **mentry, uint32_t *mentrycount)
|
||||
struct magic_entry_set *mset)
|
||||
{
|
||||
size_t i = me->mp->type == FILE_NAME ? 1 : 0;
|
||||
if (mentrycount[i] == maxmagic[i]) {
|
||||
if (mset[i].count == mset[i].max) {
|
||||
struct magic_entry *mp;
|
||||
|
||||
maxmagic[i] += ALLOC_INCR;
|
||||
mset[i].max += ALLOC_INCR;
|
||||
if ((mp = CAST(struct magic_entry *,
|
||||
erealloc(mentry[i], sizeof(*mp) * maxmagic[i]))) ==
|
||||
erealloc(mset[i].me, sizeof(*mp) * mset[i].max))) ==
|
||||
NULL) {
|
||||
file_oomem(ms, sizeof(*mp) * maxmagic[i]);
|
||||
file_oomem(ms, sizeof(*mp) * mset[i].max);
|
||||
return -1;
|
||||
}
|
||||
(void)memset(&mp[mentrycount[i]], 0, sizeof(*mp) *
|
||||
(void)memset(&mp[mset[i].count], 0, sizeof(*mp) *
|
||||
ALLOC_INCR);
|
||||
mentry[i] = mp;
|
||||
mset[i].me = mp;
|
||||
}
|
||||
mentry[i][mentrycount[i]++] = *me;
|
||||
mset[i].me[mset[i].count++] = *me;
|
||||
memset(me, 0, sizeof(*me));
|
||||
return 0;
|
||||
}
|
||||
@@ -933,7 +950,7 @@ addentry(struct magic_set *ms, struct magic_entry *me,
|
||||
*/
|
||||
private void
|
||||
load_1(struct magic_set *ms, int action, const char *fn, int *errs,
|
||||
struct magic_entry **mentry, uint32_t *mentrycount)
|
||||
struct magic_entry_set *mset)
|
||||
{
|
||||
char buffer[BUFSIZ + 1];
|
||||
char *line = NULL;
|
||||
@@ -946,11 +963,7 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
|
||||
TSRMLS_FETCH();
|
||||
|
||||
ms->file = fn;
|
||||
#if PHP_API_VERSION < 20100412
|
||||
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
|
||||
#else
|
||||
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
|
||||
#endif
|
||||
|
||||
if (stream == NULL) {
|
||||
if (errno != ENOENT)
|
||||
@@ -1010,16 +1023,16 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
|
||||
case 0:
|
||||
continue;
|
||||
case 1:
|
||||
(void)addentry(ms, &me, mentry, mentrycount);
|
||||
(void)addentry(ms, &me, mset);
|
||||
goto again;
|
||||
default:
|
||||
(*errs)++;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (me.mp)
|
||||
(void)addentry(ms, &me, mentry, mentrycount);
|
||||
(void)addentry(ms, &me, mset);
|
||||
php_stream_close(stream);
|
||||
}
|
||||
|
||||
@@ -1128,22 +1141,24 @@ magic_entry_free(struct magic_entry *me, uint32_t nme)
|
||||
private struct magic_map *
|
||||
apprentice_load(struct magic_set *ms, const char *fn, int action)
|
||||
{
|
||||
int errs = 0;
|
||||
struct magic_entry *mentry[MAGIC_SETS] = { NULL };
|
||||
uint32_t mentrycount[MAGIC_SETS] = { 0 };
|
||||
int errs = 0;
|
||||
uint32_t i, j;
|
||||
size_t files = 0, maxfiles = 0;
|
||||
char **filearr = NULL;
|
||||
struct stat st;
|
||||
struct magic_map *map;
|
||||
struct magic_entry_set mset[MAGIC_SETS];
|
||||
php_stream *dir;
|
||||
php_stream_dirent d;
|
||||
|
||||
|
||||
TSRMLS_FETCH();
|
||||
|
||||
memset(mset, 0, sizeof(mset));
|
||||
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
|
||||
|
||||
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
|
||||
|
||||
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
|
||||
{
|
||||
file_oomem(ms, sizeof(*map));
|
||||
return NULL;
|
||||
}
|
||||
@@ -1152,16 +1167,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
|
||||
if (action == FILE_CHECK)
|
||||
(void)fprintf(stderr, "%s\n", usg_hdr);
|
||||
|
||||
{
|
||||
/* XXX the maxmagic has to be reset each time we load some new magic file.
|
||||
Where file commando is used it's not essential as the CLI process
|
||||
ends, multiple loading within the same process wouldn't work. */
|
||||
int k;
|
||||
for (k = 0; k < MAGIC_SETS; k++) {
|
||||
maxmagic[k] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* load directory or file */
|
||||
/* FIXME: Read file names and sort them to prevent
|
||||
non-determinism. See Debian bug #488562. */
|
||||
@@ -1192,6 +1197,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
|
||||
if ((filearr = CAST(char **,
|
||||
erealloc(filearr, mlen))) == NULL) {
|
||||
file_oomem(ms, mlen);
|
||||
efree(mfn);
|
||||
php_stream_closedir(dir);
|
||||
errs++;
|
||||
goto out;
|
||||
@@ -1202,36 +1208,35 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
|
||||
php_stream_closedir(dir);
|
||||
qsort(filearr, files, sizeof(*filearr), cmpstrp);
|
||||
for (i = 0; i < files; i++) {
|
||||
load_1(ms, action, filearr[i], &errs, mentry,
|
||||
mentrycount);
|
||||
load_1(ms, action, filearr[i], &errs, mset);
|
||||
efree(filearr[i]);
|
||||
}
|
||||
efree(filearr);
|
||||
} else
|
||||
load_1(ms, action, fn, &errs, mentry, mentrycount);
|
||||
load_1(ms, action, fn, &errs, mset);
|
||||
if (errs)
|
||||
goto out;
|
||||
|
||||
for (j = 0; j < MAGIC_SETS; j++) {
|
||||
/* Set types of tests */
|
||||
for (i = 0; i < mentrycount[j]; ) {
|
||||
if (mentry[j][i].mp->cont_level != 0) {
|
||||
for (i = 0; i < mset[j].count; ) {
|
||||
if (mset[j].me[i].mp->cont_level != 0) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
i = set_text_binary(ms, mentry[j], mentrycount[j], i);
|
||||
i = set_text_binary(ms, mset[j].me, mset[j].count, i);
|
||||
}
|
||||
qsort(mentry[j], mentrycount[j], sizeof(*mentry[j]),
|
||||
qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me),
|
||||
apprentice_sort);
|
||||
|
||||
/*
|
||||
* Make sure that any level 0 "default" line is last
|
||||
* (if one exists).
|
||||
*/
|
||||
set_last_default(ms, mentry[j], mentrycount[j]);
|
||||
set_last_default(ms, mset[j].me, mset[j].count);
|
||||
|
||||
/* coalesce per file arrays into a single one */
|
||||
if (coalesce_entries(ms, mentry[j], mentrycount[j],
|
||||
if (coalesce_entries(ms, mset[j].me, mset[j].count,
|
||||
&map->magic[j], &map->nmagic[j]) == -1) {
|
||||
errs++;
|
||||
goto out;
|
||||
@@ -1240,7 +1245,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
|
||||
|
||||
out:
|
||||
for (j = 0; j < MAGIC_SETS; j++)
|
||||
magic_entry_free(mentry[j], mentrycount[j]);
|
||||
magic_entry_free(mset[j].me, mset[j].count);
|
||||
|
||||
if (errs) {
|
||||
for (j = 0; j < MAGIC_SETS; j++) {
|
||||
@@ -1318,6 +1323,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
|
||||
case FILE_INDIRECT:
|
||||
case FILE_NAME:
|
||||
case FILE_USE:
|
||||
case FILE_CLEAR:
|
||||
break;
|
||||
default:
|
||||
if (ms->flags & MAGIC_CHECK)
|
||||
@@ -1735,10 +1741,10 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
|
||||
if (m->type == FILE_INVALID) {
|
||||
if (ms->flags & MAGIC_CHECK)
|
||||
file_magwarn(ms, "type `%s' invalid", l);
|
||||
if (me->mp) {
|
||||
/*if (me->mp) {
|
||||
efree(me->mp);
|
||||
me->mp = NULL;
|
||||
}
|
||||
}*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1969,6 +1975,11 @@ parse_strength(struct magic_set *ms, struct magic_entry *me, const char *line)
|
||||
m->factor_op, m->factor);
|
||||
return -1;
|
||||
}
|
||||
if (m->type == FILE_NAME) {
|
||||
file_magwarn(ms, "%s: Strength setting is not supported in "
|
||||
"\"name\" magic entries", m->value.s);
|
||||
return -1;
|
||||
}
|
||||
EATAB;
|
||||
switch (*l) {
|
||||
case FILE_FACTOR_OP_NONE:
|
||||
@@ -2624,11 +2635,7 @@ apprentice_map(struct magic_set *ms, const char *fn)
|
||||
if (dbname == NULL)
|
||||
goto error;
|
||||
|
||||
#if PHP_API_VERSION < 20100412
|
||||
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
|
||||
#else
|
||||
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
|
||||
#endif
|
||||
|
||||
if (!stream) {
|
||||
goto error;
|
||||
@@ -2761,12 +2768,8 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
|
||||
if (dbname == NULL)
|
||||
goto out;
|
||||
|
||||
/* wb+ == O_WRONLY|O_CREAT|O_TRUNC|O_BINARY */
|
||||
#if PHP_API_VERSION < 20100412
|
||||
stream = php_stream_open_wrapper((char *)fn, "wb+", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
|
||||
#else
|
||||
/* wb+ == O_WRONLY|O_CREAT|O_TRUNC|O_BINARY */
|
||||
stream = php_stream_open_wrapper((char *)fn, "wb+", REPORT_ERRORS, NULL);
|
||||
#endif
|
||||
|
||||
if (!stream) {
|
||||
file_error(ms, errno, "cannot open `%s'", dbname);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "file.h"
|
||||
|
||||
#ifndef lint
|
||||
FILE_RCSID("@(#)$File: ascmagic.c,v 1.85 2012/08/09 16:33:15 christos Exp $")
|
||||
FILE_RCSID("@(#)$File: ascmagic.c,v 1.88 2014/02/12 23:20:53 christos Exp $")
|
||||
#endif /* lint */
|
||||
|
||||
#include "magic.h"
|
||||
@@ -72,7 +72,7 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
|
||||
int text)
|
||||
{
|
||||
unichar *ubuf = NULL;
|
||||
size_t ulen;
|
||||
size_t ulen = 0;
|
||||
int rv = 1;
|
||||
|
||||
const char *code = NULL;
|
||||
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
|
||||
== NULL)
|
||||
goto done;
|
||||
if ((rv = file_softmagic(ms, utf8_buf,
|
||||
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
|
||||
(size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 609 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user