mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 02:30:50 +00:00
Compare commits
700
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d2731bb32 | ||
|
|
5e24aedf46 | ||
|
|
6cf345f571 | ||
|
|
8474838a9a | ||
|
|
d0f2f6cd04 | ||
|
|
519ed8e13b | ||
|
|
53d297a7ea | ||
|
|
664d102aa6 | ||
|
|
467e129ce5 | ||
|
|
b9ba07f7a0 | ||
|
|
3b7386acea | ||
|
|
a49e04477f | ||
|
|
60b2f49762 | ||
|
|
1a8d655fec | ||
|
|
25f06142c2 | ||
|
|
93c0ddb2f3 | ||
|
|
261beb0326 | ||
|
|
43fa4e015b | ||
|
|
bb430b3737 | ||
|
|
d827c76379 | ||
|
|
cfac29e20e | ||
|
|
2b8ad5a0af | ||
|
|
40e08311e5 | ||
|
|
ff591e2cf0 | ||
|
|
5e7efb5ec9 | ||
|
|
4219fe6c66 | ||
|
|
083b13335e | ||
|
|
3ce212ccae | ||
|
|
0714c1a3d5 | ||
|
|
697f4e1f08 | ||
|
|
1223119155 | ||
|
|
a6f8252f9b | ||
|
|
6a738f6b5b | ||
|
|
85963e6300 | ||
|
|
33a1a4d39a | ||
|
|
9a98904ddd | ||
|
|
45d09c71ba | ||
|
|
6fb763c4f9 | ||
|
|
163e1fd41c | ||
|
|
3e1c05170e | ||
|
|
150d058008 | ||
|
|
e95f9a0eeb | ||
|
|
d6c2c283ed | ||
|
|
f59a139f61 | ||
|
|
68ae270793 | ||
|
|
34ae4eafd0 | ||
|
|
479055a85b | ||
|
|
3003cd2473 | ||
|
|
60720d285f | ||
|
|
ad8445a828 | ||
|
|
3e308d3a6b | ||
|
|
0b97d2bd60 | ||
|
|
074feedc2b | ||
|
|
926961192f | ||
|
|
efe0314db6 | ||
|
|
92b6f24241 | ||
|
|
221ac1b9e5 | ||
|
|
cdfe00b801 | ||
|
|
a90c48fb48 | ||
|
|
92f080a0a3 | ||
|
|
46f21b8a32 | ||
|
|
f7c99da2fe | ||
|
|
e8241e59ac | ||
|
|
28c9afe35d | ||
|
|
4e8a4a4235 | ||
|
|
f61572e645 | ||
|
|
ca7875ab83 | ||
|
|
480104a456 | ||
|
|
c204ff0258 | ||
|
|
a390c84dc5 | ||
|
|
9e905c3de7 | ||
|
|
9ccbb28696 | ||
|
|
b45268a07a | ||
|
|
29ed52ffa4 | ||
|
|
7f9a43653c | ||
|
|
7a089a43af | ||
|
|
fea4eeb845 | ||
|
|
34cfec2536 | ||
|
|
c0fcaa7acb | ||
|
|
2a06ce8518 | ||
|
|
cb41a19f28 | ||
|
|
46c036cd4d | ||
|
|
7a38509835 | ||
|
|
0433d29020 | ||
|
|
7c24d8fbee | ||
|
|
d68797945a | ||
|
|
f3f44275f4 | ||
|
|
1d6182a907 | ||
|
|
cd0e0124c9 | ||
|
|
109c89c848 | ||
|
|
f2623f0b50 | ||
|
|
55f0596fab | ||
|
|
bf4c9ef686 | ||
|
|
717ca4ef55 | ||
|
|
bd760162e6 | ||
|
|
2dbcfcb8cb | ||
|
|
e79591b081 | ||
|
|
dc8ba6f475 | ||
|
|
17f6ae66ce | ||
|
|
dc571fa9e2 | ||
|
|
f03f2c5eae | ||
|
|
9c30e20bd6 | ||
|
|
bb3c702162 | ||
|
|
31a8d6a6b3 | ||
|
|
87c64280b0 | ||
|
|
54dba635a3 | ||
|
|
3876158e8f | ||
|
|
19a9052d6e | ||
|
|
ab6d4d411a | ||
|
|
9c125eeb27 | ||
|
|
4902fc6c25 | ||
|
|
1784db8087 | ||
|
|
a9469060e5 | ||
|
|
9d57621235 | ||
|
|
33dbaff1ed | ||
|
|
f9070e626a | ||
|
|
69d6fe45c8 | ||
|
|
3cce465528 | ||
|
|
8a35e9d014 | ||
|
|
1f09c0b9d5 | ||
|
|
c48a2e38f4 | ||
|
|
3fe315c652 | ||
|
|
b6d2c54059 | ||
|
|
8bb047ee97 | ||
|
|
39a4078b8c | ||
|
|
e796974f6f | ||
|
|
aca6460346 | ||
|
|
ae749049f5 | ||
|
|
61e9783154 | ||
|
|
3e099a5983 | ||
|
|
d21628f993 | ||
|
|
7ff8061d0a | ||
|
|
40b87ec99f | ||
|
|
24d3381b10 | ||
|
|
a602a3eef5 | ||
|
|
ee1dc90d1e | ||
|
|
b491930ef6 | ||
|
|
5e93a7df9a | ||
|
|
3aaf62d159 | ||
|
|
631a00a0a0 | ||
|
|
190c186fb8 | ||
|
|
c1b67d83cc | ||
|
|
fbd3ef09ed | ||
|
|
836e74ebee | ||
|
|
83ac79600e | ||
|
|
d9d23050d1 | ||
|
|
26c7981ccf | ||
|
|
3113fa9440 | ||
|
|
26499be68f | ||
|
|
690e86fdb2 | ||
|
|
795a482a48 | ||
|
|
098d3d2b02 | ||
|
|
1cfb8af265 | ||
|
|
c389a653f7 | ||
|
|
f66cd50510 | ||
|
|
704eced26b | ||
|
|
71efa5b435 | ||
|
|
c5ff44688a | ||
|
|
ff08705591 | ||
|
|
d6b489fb32 | ||
|
|
21858220b2 | ||
|
|
ec11b44e84 | ||
|
|
dd5cbcd24c | ||
|
|
c514ee0c9b | ||
|
|
2f0e80afac | ||
|
|
e9be807267 | ||
|
|
fa57959f47 | ||
|
|
d5811fc08a | ||
|
|
d26b539c61 | ||
|
|
5fee10735f | ||
|
|
0fd2b96204 | ||
|
|
c26991a9eb | ||
|
|
8b139b654d | ||
|
|
147840dd93 | ||
|
|
89635eb158 | ||
|
|
91f9af4360 | ||
|
|
86bbbbdce4 | ||
|
|
278dc574f2 | ||
|
|
d90263437c | ||
|
|
0c05e6da00 | ||
|
|
058b529ae7 | ||
|
|
4c26ed263d | ||
|
|
0f8f945418 | ||
|
|
c4c96c042e | ||
|
|
859ab9a4cf | ||
|
|
e84a7de005 | ||
|
|
1b0a789ab9 | ||
|
|
f0178f71ee | ||
|
|
d060a6e8a2 | ||
|
|
612e75442f | ||
|
|
1d6e7e3d93 | ||
|
|
d550c270ce | ||
|
|
acb1e07980 | ||
|
|
a32fb32781 | ||
|
|
4a0d670f43 | ||
|
|
42c462c755 | ||
|
|
3a0791c99b | ||
|
|
87bc74ea7a | ||
|
|
919d737505 | ||
|
|
9990b3f431 | ||
|
|
1b2cc459c6 | ||
|
|
7af33194e5 | ||
|
|
b7311e9173 | ||
|
|
7961207d6b | ||
|
|
6910275d51 | ||
|
|
bdd4183fba | ||
|
|
a518b450fd | ||
|
|
9048ae292c | ||
|
|
6c37c9fa0a | ||
|
|
70f2bcf763 | ||
|
|
1c530aa7cb | ||
|
|
3fd28953c6 | ||
|
|
77b307021d | ||
|
|
7a6fe06e4b | ||
|
|
bcd06ef1b6 | ||
|
|
b8f97db580 | ||
|
|
6a43f6805c | ||
|
|
24ac7931cd | ||
|
|
5ca11825d1 | ||
|
|
0212ec6c71 | ||
|
|
e8a3530d50 | ||
|
|
58c82af64d | ||
|
|
38e47dd0bb | ||
|
|
297a3d8e4c | ||
|
|
52fd069ff4 | ||
|
|
41ada4ba9b | ||
|
|
29b0798cc8 | ||
|
|
badf27fb2a | ||
|
|
5c97837ca2 | ||
|
|
7dec2a7354 | ||
|
|
5f024dcc16 | ||
|
|
ac4f8071c5 | ||
|
|
6c52ec1319 | ||
|
|
aaa1d62614 | ||
|
|
000957818e | ||
|
|
8058f9fd11 | ||
|
|
e24fe395a2 | ||
|
|
3d97f45bc4 | ||
|
|
fd1679e7f0 | ||
|
|
e06665c961 | ||
|
|
c9c2c0e1f8 | ||
|
|
3d63ca3edc | ||
|
|
5d2d2fd5a3 | ||
|
|
ec420c3df8 | ||
|
|
5326a8b2bc | ||
|
|
223d122cae | ||
|
|
d258bcd951 | ||
|
|
ae1ec65637 | ||
|
|
de85c9cd70 | ||
|
|
862c4d2345 | ||
|
|
563c920c24 | ||
|
|
0b073cd34c | ||
|
|
a5d56bb9f5 | ||
|
|
d836ff68c8 | ||
|
|
7b6bf33b03 | ||
|
|
97062cade9 | ||
|
|
87dd729187 | ||
|
|
f1d09682fb | ||
|
|
1fdd8d7b2a | ||
|
|
68421695ac | ||
|
|
1757bf8822 | ||
|
|
6ccc1d1fb5 | ||
|
|
47b41a5d6c | ||
|
|
0d708dc358 | ||
|
|
4b674fb7b0 | ||
|
|
8c30a7f8a6 | ||
|
|
e7439fa200 | ||
|
|
f496f5014a | ||
|
|
b7bca610dd | ||
|
|
437494ddf7 | ||
|
|
748b589925 | ||
|
|
1332a14cfc | ||
|
|
959af2a28d | ||
|
|
3674994be5 | ||
|
|
c4154145df | ||
|
|
c14ba0f124 | ||
|
|
5ffbb85103 | ||
|
|
3ff986ecf7 | ||
|
|
eaf4ea2e74 | ||
|
|
44005b7986 | ||
|
|
8df36aaf32 | ||
|
|
20a379fa7d | ||
|
|
0406556da4 | ||
|
|
ba8f17e483 | ||
|
|
33616195b9 | ||
|
|
c458d1347b | ||
|
|
8b99387569 | ||
|
|
3ce8ccb6f2 | ||
|
|
f4106441cb | ||
|
|
20ee84dea6 | ||
|
|
cd7d7039ac | ||
|
|
3b7be889d8 | ||
|
|
aae5df3ffd | ||
|
|
c6080567e2 | ||
|
|
6509311ebb | ||
|
|
aa48814378 | ||
|
|
ca6e1bbcda | ||
|
|
ee23aba678 | ||
|
|
6bfeea9eb9 | ||
|
|
6320ee11cf | ||
|
|
6c310f9c0a | ||
|
|
4793980a8f | ||
|
|
8ab6f3fd39 | ||
|
|
12022014fa | ||
|
|
1dbaae2795 | ||
|
|
c3ed91477a | ||
|
|
954acfe261 | ||
|
|
60328ea7c3 | ||
|
|
ada4e506a7 | ||
|
|
d3c3a54b4e | ||
|
|
f0d98ad3de | ||
|
|
a943d234f5 | ||
|
|
a7bc286638 | ||
|
|
7406f3771a | ||
|
|
45a2bdaf73 | ||
|
|
18870e3afc | ||
|
|
d7fd19b7ff | ||
|
|
e607e2ab9a | ||
|
|
c93dc5d873 | ||
|
|
9660548a22 | ||
|
|
b8bee35259 | ||
|
|
eb8c558966 | ||
|
|
5a73f8f13f | ||
|
|
7bbf35320d | ||
|
|
3ff5fb0631 | ||
|
|
d74f9ff550 | ||
|
|
66141bd5d1 | ||
|
|
dd2c03ca48 | ||
|
|
21b0f60332 | ||
|
|
f1fb77d1aa | ||
|
|
f876b800a2 | ||
|
|
3104233019 | ||
|
|
50de3fd1ce | ||
|
|
37d88ca5a0 | ||
|
|
13fe33c2df | ||
|
|
50cc487b21 | ||
|
|
76838bcd54 | ||
|
|
96724797c8 | ||
|
|
2e9ec84ce2 | ||
|
|
6654a07e73 | ||
|
|
ddd8fd3e3d | ||
|
|
2a7d16f8fd | ||
|
|
6e24feb80d | ||
|
|
44ba014c5f | ||
|
|
76bff5194c | ||
|
|
658762a0b5 | ||
|
|
402de0146e | ||
|
|
8d4bb9ca74 | ||
|
|
9123bee257 | ||
|
|
e0844e09bd | ||
|
|
64c353ab79 | ||
|
|
1f93575c88 | ||
|
|
de39078f7b | ||
|
|
5cdefd07cd | ||
|
|
a9c6e4be1e | ||
|
|
e5c8f8c59b | ||
|
|
a07500042d | ||
|
|
d6212d96f4 | ||
|
|
928c20942b | ||
|
|
f6a400bd9f | ||
|
|
2f26d8d7ae | ||
|
|
704ed9625c | ||
|
|
d6a526d66b | ||
|
|
e8d568ea8d | ||
|
|
8204511d71 | ||
|
|
6ab23efb3a | ||
|
|
073ee1397a | ||
|
|
8b764bd08c | ||
|
|
1b602e85d1 | ||
|
|
66b90c7052 | ||
|
|
b1683ea891 | ||
|
|
51d495850a | ||
|
|
163f0da75a | ||
|
|
1ebb0590bd | ||
|
|
a588f2dc60 | ||
|
|
0c518a03a9 | ||
|
|
63a658ee7a | ||
|
|
ac2a29913c | ||
|
|
37f5474ce9 | ||
|
|
6c0f166794 | ||
|
|
dfd2295849 | ||
|
|
2f418134ff | ||
|
|
5735927d86 | ||
|
|
a86232d9bb | ||
|
|
6c61aeb012 | ||
|
|
5b5e7a4de9 | ||
|
|
6e2ff39e3e | ||
|
|
57cdfc58d2 | ||
|
|
c0505439c3 | ||
|
|
17ad6e2ebf | ||
|
|
fbeb246a3a | ||
|
|
112f263591 | ||
|
|
0675e5eabb | ||
|
|
48098f0774 | ||
|
|
210335909a | ||
|
|
ff59351416 | ||
|
|
29be5946f9 | ||
|
|
378d5d4e34 | ||
|
|
b8ebfce9af | ||
|
|
d5be48711a | ||
|
|
c116ecf207 | ||
|
|
c188ec09eb | ||
|
|
1f04ac91b0 | ||
|
|
8f78a2727b | ||
|
|
8df40bdb31 | ||
|
|
51e52e20ef | ||
|
|
47edd8a303 | ||
|
|
42f32bfa4b | ||
|
|
4703e96853 | ||
|
|
d87de86823 | ||
|
|
9246ba2a82 | ||
|
|
c1272d8972 | ||
|
|
2817ddccf5 | ||
|
|
bc5b8eabea | ||
|
|
2d7d2aebe6 | ||
|
|
79b21ec4cf | ||
|
|
258351c30a | ||
|
|
c314888c29 | ||
|
|
731584c076 | ||
|
|
42aadabfcb | ||
|
|
7314771a35 | ||
|
|
91dd8376bd | ||
|
|
91d4ef33ef | ||
|
|
5186ee9c59 | ||
|
|
61fc424321 | ||
|
|
bb4c7ff0e9 | ||
|
|
9a9cd86f38 | ||
|
|
fb92e33b5d | ||
|
|
e4a3732c91 | ||
|
|
a400d8908d | ||
|
|
43b660b6ea | ||
|
|
82d326bdea | ||
|
|
70c643f5f0 | ||
|
|
fb696afd10 | ||
|
|
8ca3826a28 | ||
|
|
aa40595644 | ||
|
|
1b172b1371 | ||
|
|
9e1b944989 | ||
|
|
3b407d143b | ||
|
|
aed81da3fa | ||
|
|
be0fc2b801 | ||
|
|
ec68882101 | ||
|
|
be0b8c71bc | ||
|
|
1a63feffd1 | ||
|
|
10ed7a1e0a | ||
|
|
7ac96de039 | ||
|
|
d724f9cfb1 | ||
|
|
1ad21d9b12 | ||
|
|
5f63b5c4ee | ||
|
|
ca6a202160 | ||
|
|
493f39da2d | ||
|
|
ccfc0d9d99 | ||
|
|
26145c2e0c | ||
|
|
a7aa62ded1 | ||
|
|
10371b034a | ||
|
|
1d5f721fd9 | ||
|
|
59ddb74938 | ||
|
|
b882f9f37e | ||
|
|
58962c7371 | ||
|
|
3dcef1b9be | ||
|
|
99e13c50f9 | ||
|
|
7110650668 | ||
|
|
a681fcb006 | ||
|
|
9dd24c6d87 | ||
|
|
ec79dd793d | ||
|
|
93851ebf11 | ||
|
|
26ccde4da9 | ||
|
|
43c79a616e | ||
|
|
630def46f7 | ||
|
|
53988d8cf5 | ||
|
|
755caecfc9 | ||
|
|
f2a48add80 | ||
|
|
740d39454b | ||
|
|
c53dbdbe75 | ||
|
|
4cb3d18276 | ||
|
|
fb32c077a2 | ||
|
|
a953a1abda | ||
|
|
6fe36adf0c | ||
|
|
07b8d051fa | ||
|
|
1448086b22 | ||
|
|
cd8c7a3e09 | ||
|
|
59d2ce8258 | ||
|
|
200c627aeb | ||
|
|
f88a172959 | ||
|
|
64701cf42b | ||
|
|
8d4eea74d5 | ||
|
|
3e7df40852 | ||
|
|
c1b749f491 | ||
|
|
c384b34ae9 | ||
|
|
3997d6663b | ||
|
|
e2c6d3edae | ||
|
|
302c53fc5d | ||
|
|
52cb01a933 | ||
|
|
095162c3d4 | ||
|
|
e3f89f116a | ||
|
|
7577130156 | ||
|
|
1be624e7ba | ||
|
|
24f3d55f3c | ||
|
|
38d7ea305c | ||
|
|
e145343b57 | ||
|
|
abcee63635 | ||
|
|
290ed55060 | ||
|
|
96916c95e8 | ||
|
|
25eca319fa | ||
|
|
10ab729e88 | ||
|
|
cd4ab2f6fe | ||
|
|
397c88ae74 | ||
|
|
cdb0ed7587 | ||
|
|
ab8329ec31 | ||
|
|
bea595aef9 | ||
|
|
ab9429900a | ||
|
|
6557578657 | ||
|
|
c13ba99551 | ||
|
|
14f6b9149d | ||
|
|
95875d9966 | ||
|
|
55041d6f3d | ||
|
|
69079a7537 | ||
|
|
aa0172a4da | ||
|
|
5e5327a7e0 | ||
|
|
51ed0ebad8 | ||
|
|
e33afedd96 | ||
|
|
52566bba75 | ||
|
|
20ac90bac8 | ||
|
|
7d79686f45 | ||
|
|
80d7ac0e9e | ||
|
|
749f4ac2ab | ||
|
|
557b7fbec5 | ||
|
|
9c8b47d15e | ||
|
|
0b3b1448d0 | ||
|
|
6f95fa95cc | ||
|
|
aebc5833a9 | ||
|
|
6783be767a | ||
|
|
4fd736fbe9 | ||
|
|
21724432de | ||
|
|
e2afb33e87 | ||
|
|
09b741ff47 | ||
|
|
216049bb27 | ||
|
|
1f02fad528 | ||
|
|
ccad354535 | ||
|
|
1feef82dc4 | ||
|
|
3a830a30f4 | ||
|
|
26a67b8925 | ||
|
|
cccb406ee8 | ||
|
|
be4c37919b | ||
|
|
c412cfe311 | ||
|
|
a70d189c04 | ||
|
|
d7138e1e5d | ||
|
|
dd5b835147 | ||
|
|
963c7fa016 | ||
|
|
14cad8fdc3 | ||
|
|
b5cd968ffc | ||
|
|
7975b4eb0e | ||
|
|
bb82fb0530 | ||
|
|
da438af187 | ||
|
|
8886be7041 | ||
|
|
9249d05bdd | ||
|
|
5d43fe49f7 | ||
|
|
0c40fb7ef2 | ||
|
|
3fd2c5e217 | ||
|
|
3577115118 | ||
|
|
74dfa9f0ba | ||
|
|
4ab6eb3d19 | ||
|
|
ad16c0a375 | ||
|
|
653d895ecb | ||
|
|
5b44266a5f | ||
|
|
0c09d4cb63 | ||
|
|
fc06fb4a07 | ||
|
|
6fb0bf80ea | ||
|
|
2100a86198 | ||
|
|
a4af2a9d16 | ||
|
|
d45250a058 | ||
|
|
8d1427dd98 | ||
|
|
aa19f65f56 | ||
|
|
07d0f0cf01 | ||
|
|
046b34955c | ||
|
|
ec7b8e2b1c | ||
|
|
b3c3c6de14 | ||
|
|
a5f8d2899c | ||
|
|
7bbab02633 | ||
|
|
7412202c43 | ||
|
|
ca923a2cae | ||
|
|
bf9f762b4d | ||
|
|
1f41b288e9 | ||
|
|
b8c7ecc061 | ||
|
|
bbf97549b8 | ||
|
|
7a5240e846 | ||
|
|
b636a534c1 | ||
|
|
05273a73d8 | ||
|
|
8ee1c45a3b | ||
|
|
085e0fc51f | ||
|
|
9b05e15e8a | ||
|
|
bc4e9efef7 | ||
|
|
38ff4bba17 | ||
|
|
ac3c882bb6 | ||
|
|
f7776502b5 | ||
|
|
ed7ed1189b | ||
|
|
37ed02b199 | ||
|
|
288da2242e | ||
|
|
23b97b2530 | ||
|
|
de9fa58e0b | ||
|
|
3746ccb627 | ||
|
|
9745215cf8 | ||
|
|
4df7ab403c | ||
|
|
d76c516176 | ||
|
|
f16bdce284 | ||
|
|
cbb11e018a | ||
|
|
5efe53c596 | ||
|
|
0dacd6d5c0 | ||
|
|
1048c9cd52 | ||
|
|
848c5c7695 | ||
|
|
168c0ead9e | ||
|
|
815d3169ba | ||
|
|
9e0e89c5cf | ||
|
|
f064d19f40 | ||
|
|
f7eec29f84 | ||
|
|
8a03fc5ef3 | ||
|
|
0f93228cb7 | ||
|
|
4f37b2f354 | ||
|
|
91bd50d1b0 | ||
|
|
aa38b5572e | ||
|
|
ac97b77ed9 | ||
|
|
0881dbd101 | ||
|
|
83310cba5b | ||
|
|
ee68b99571 | ||
|
|
edfe649c6b | ||
|
|
43217a3225 | ||
|
|
3a3e310e2e | ||
|
|
982822be93 | ||
|
|
9afb3e041b | ||
|
|
77c1b56cd7 | ||
|
|
11f26c2c2a | ||
|
|
0de69fe97d | ||
|
|
637a40423c | ||
|
|
57184454e9 | ||
|
|
5a8b4e72ce | ||
|
|
f9de2cc142 | ||
|
|
d2dd99ded5 | ||
|
|
0ca7a98800 | ||
|
|
d94467f7e8 | ||
|
|
39441f79e6 | ||
|
|
818d2b7aee | ||
|
|
79ebfe382b | ||
|
|
3bad805e35 | ||
|
|
4428076eae | ||
|
|
570511c9b2 | ||
|
|
65de977ea0 | ||
|
|
52619b8427 | ||
|
|
0423be06b5 | ||
|
|
c018b83003 | ||
|
|
18eb480dd2 | ||
|
|
12a5d2b547 | ||
|
|
ff27860a66 | ||
|
|
7e8409de8c | ||
|
|
89e3ac9531 | ||
|
|
608baa409a | ||
|
|
55f0daf65d | ||
|
|
78d11cbc70 | ||
|
|
b096a5de17 | ||
|
|
25de341259 | ||
|
|
ef0d7e3f58 | ||
|
|
7e6beb9f28 | ||
|
|
5649f24524 | ||
|
|
87583528c6 | ||
|
|
3c831fef01 | ||
|
|
91999f1175 | ||
|
|
3a7aee2472 | ||
|
|
1192667679 | ||
|
|
9e4283227d | ||
|
|
24f0701867 | ||
|
|
43db0fce03 | ||
|
|
f03fe1c09d | ||
|
|
c10762e967 | ||
|
|
fd2726641b | ||
|
|
0c6f5f5810 | ||
|
|
79fd560e5e | ||
|
|
efad37874b | ||
|
|
dbf2a5c65c | ||
|
|
ed33d232e0 | ||
|
|
f57c75112d | ||
|
|
a34755e9cf | ||
|
|
7941dcf544 | ||
|
|
ab5a8b2ae3 | ||
|
|
e95addcbfa | ||
|
|
8d1cc50067 | ||
|
|
30f98ae77b | ||
|
|
7614368f8a | ||
|
|
c1555236c9 | ||
|
|
6f1a0f67ff | ||
|
|
299fe2554f | ||
|
|
8f87235107 | ||
|
|
f3a123a9db | ||
|
|
ea2037a2d3 | ||
|
|
07e11dcc4d | ||
|
|
aa5dbc8c92 | ||
|
|
fa94d911df | ||
|
|
6ba807db50 | ||
|
|
ff452441e2 | ||
|
|
522ce80071 | ||
|
|
e0beb7fc71 | ||
|
|
0c54f6f72b |
No files matched your search
@@ -119,7 +119,8 @@ define ____printzv_contents
|
||||
set $type = 0
|
||||
end
|
||||
if $type == 6
|
||||
printf "string(%d): \"%s\"", $zvalue->value.str.len, $zvalue->value.str.val
|
||||
printf "string(%d): ", $zvalue->value.str.len
|
||||
____print_str $zvalue->value.str.val $zvalue->value.str.len
|
||||
end
|
||||
if $type == 7
|
||||
printf "resource: #%d", $zvalue->value.lval
|
||||
@@ -167,8 +168,9 @@ define ____print_const_table
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", $p->arKey
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
@@ -198,8 +200,9 @@ define ____print_ht
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", $p->arKey
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
@@ -233,8 +236,9 @@ define ____print_ft
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", (char*)$p->arKey
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
@@ -255,6 +259,113 @@ document print_ft
|
||||
dumps a function table (HashTable)
|
||||
end
|
||||
|
||||
define ____print_inh_class
|
||||
set $ce = $arg0
|
||||
if $ce->ce_flags & 0x10 || $ce->ce_flags & 0x20
|
||||
printf "abstract "
|
||||
else
|
||||
if $ce->ce_flags & 0x40
|
||||
printf "final "
|
||||
end
|
||||
end
|
||||
printf "class %s", $ce->name
|
||||
if $ce->parent != 0
|
||||
printf " extends %s", $ce->parent->name
|
||||
end
|
||||
if $ce->num_interfaces != 0
|
||||
printf " implements"
|
||||
set $tmp = 0
|
||||
while $tmp < $ce->num_interfaces
|
||||
printf " %s", $ce->interfaces[$tmp]->name
|
||||
set $tmp = $tmp + 1
|
||||
if $tmp < $ce->num_interfaces
|
||||
printf ","
|
||||
end
|
||||
end
|
||||
end
|
||||
set $ce = $ce->parent
|
||||
end
|
||||
|
||||
define ____print_inh_iface
|
||||
set $ce = $arg0
|
||||
printf "interface %s", $ce->name
|
||||
if $ce->num_interfaces != 0
|
||||
set $ce = $ce->interfaces[0]
|
||||
printf " extends %s", $ce->name
|
||||
else
|
||||
set $ce = 0
|
||||
end
|
||||
end
|
||||
|
||||
define print_inh
|
||||
set $ce = $arg0
|
||||
set $depth = 0
|
||||
while $ce != 0
|
||||
set $tmp = $depth
|
||||
while $tmp != 0
|
||||
printf " "
|
||||
set $tmp = $tmp - 1
|
||||
end
|
||||
set $depth = $depth + 1
|
||||
if $ce->ce_flags & 0x80
|
||||
____print_inh_iface $ce
|
||||
else
|
||||
____print_inh_class $ce
|
||||
end
|
||||
printf " {\n"
|
||||
end
|
||||
while $depth != 0
|
||||
set $tmp = $depth
|
||||
while $tmp != 1
|
||||
printf " "
|
||||
set $tmp = $tmp - 1
|
||||
end
|
||||
printf "}\n"
|
||||
set $depth = $depth - 1
|
||||
end
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
printf "[0x%08x] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
else
|
||||
if $pi->flags & 0x200
|
||||
printf "ZEND_ACC_PROTECTED"
|
||||
else
|
||||
if $pi->flags & 0x400
|
||||
printf "ZEND_ACC_PRIVATE"
|
||||
else
|
||||
if $pi->flags & 0x800
|
||||
printf "ZEND_ACC_CHANGED"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
printf "\""
|
||||
while $tmp < $arg1
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
end
|
||||
set $tmp = $tmp + 1
|
||||
end
|
||||
printf "\""
|
||||
end
|
||||
|
||||
define printzn
|
||||
____executor_globals
|
||||
set $ind = 0
|
||||
|
||||
+6
-1
@@ -229,7 +229,7 @@ STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: simplexml
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.0
|
||||
@@ -464,6 +464,11 @@ PRIMARY MAINTAINER: Kristian K
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: reflection
|
||||
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -37,6 +37,9 @@ php_lcov.info: lcov-test
|
||||
if test -f "$(top_srcdir)/$$y.c"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
|
||||
fi; \
|
||||
if test -f "$(top_srcdir)/$$y.h"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
|
||||
fi; \
|
||||
if test -f "$(top_srcdir)/$$y.re"; then \
|
||||
ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
|
||||
fi; \
|
||||
|
||||
@@ -1,6 +1,239 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
27 Apr 2006, PHP 5.1.3
|
||||
24 Jul 2006, PHP 5.2.0RC1
|
||||
- Updated bundled MySQL client library to version 5.0.22 in the Windows
|
||||
distribution. (Edin)
|
||||
- Updated timezonedb to version 2006.7. (Derick)
|
||||
|
||||
- Changed priority of PHPRC environment variable on win32 to be higher then
|
||||
value from registry. (Dmitry)
|
||||
- Changed __toString() to be called wherever applicable. (Marcus)
|
||||
- Changed E_ALL error reporting mode to include E_RECOVERABLE_ERROR. (Marcus)
|
||||
- Changed realpath cache to be disabled when "open_basedir" or "safe_mode"
|
||||
are enabled on per-request basis. (Ilia)
|
||||
|
||||
- Improved the Zend memory manager: (Dmitry)
|
||||
. Removed unnecessary "--disable-zend-memory-manager" configure option.
|
||||
. Added "--enable-malloc-mm" configure option which is enabled by default
|
||||
in debug builds to allow using internal and external memory debuggers.
|
||||
. Allow tweaking the memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE
|
||||
environment variables.
|
||||
. For more information: Zend/README.ZEND_MM
|
||||
- Improved safe_mode check for the error_log() function. (Ilia)
|
||||
- Improved the error reporting in SOAP extension on request failure. (Ilia)
|
||||
- Improved crypt() on win32 to be about 10 times faster and to have friendlier
|
||||
license. (Frank, Dmitry)
|
||||
- Improved performance of the implode() function on associated arrays. (Ilia)
|
||||
- Improved performance of str_replace() when doing 1 char to 1 char or 1 char
|
||||
to many chars replacement. (Ilia)
|
||||
- Improved apache2filter SAPI:
|
||||
. Allowed PHP to be an arbitrary filter in the chain and read the script
|
||||
from the Apache stream. (John)
|
||||
. Added support for apache2filter in the Windows build including binary
|
||||
support for both Apache 2.0.x (php5apache2_filter.dll) and Apache 2.2.x
|
||||
(php5apache2_2_filter.dll). (Edin)
|
||||
- Improved apache2handler SAPI:
|
||||
. Changed ap_set_content_type() to be called only once. (Mike)
|
||||
. Added support for Apache 2.2 handler in the Windows distribution. (Edin)
|
||||
- Improved FastCGI SAPI: (Dmitry)
|
||||
. Removed source compatibility with libfcgi.
|
||||
. Optimized access to FastCGI environment variables by using HashTable
|
||||
instead of linear search.
|
||||
. Allowed PHP_FCGI_MAX_REQUESTS=0 that assumes no limit.
|
||||
. Allowed PHP_FCGI_CHILDREN=0 that assumes no worker children. (FastCGI
|
||||
requests are handled by main process itself)
|
||||
- Improved CURL:
|
||||
. Added control character checks for "open_basedir" and "safe_mode" checks.
|
||||
(Ilia)
|
||||
. Added implementation of curl_multi_info_read(). (Brian)
|
||||
- Improved PCRE: (Andrei)
|
||||
. Added run-time configurable backtracking/recursion limits.
|
||||
. Added preg_last_error(). (Andrei)
|
||||
- Improved PDO:
|
||||
. Added new attribute ATTR_DEFAULT_FETCH_MODE. (Pierre)
|
||||
. Added FETCH_PROPS_LATE. (Marcus)
|
||||
- Improved SPL: (Marcus)
|
||||
. Made most iterator code exception safe.
|
||||
. Added RegExIterator and RecursiveRegExIterator.
|
||||
. Added full caching support and ArrayAccess to CachingIterator.
|
||||
. Added array functions to ArrayObject/ArrayIterator and made them faster.
|
||||
. Added support for reading csv and skipping empty lines in SplFileObject.
|
||||
. Added CachingIterator::TOSTRING_USE_INNER, calls inner iterator __toString.
|
||||
. Added ability to set the CSV separator per SplFileObject.
|
||||
- Improved xmlReader: (Rob)
|
||||
. Added readInnerXml(), xmlReader::setSchema().
|
||||
. Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+)
|
||||
. Changed to passing libxml options when loading reader.
|
||||
|
||||
- Added Zip Archive extension. (Pierre)
|
||||
- Added RFC1867 fileupload processing hook. (Stefan E.)
|
||||
- Added JSON and Filter extensions. (Derick, Rasmus)
|
||||
- Added error messages to disk_free_space() and disk_total_space()
|
||||
functions. FR #37971 (Tony)
|
||||
- Added PATHINFO_FILENAME option to pathinfo() to get the filename. (Toby S.
|
||||
and Christian S.)
|
||||
- Added array_fill_keys() function. (Marcus, Matthew Wilmas)
|
||||
- Added posix_initgroups() function. (Ilia)
|
||||
- Added an optional parameter to parse_url() to allow retrieval of distinct URL
|
||||
components. (Ilia)
|
||||
- Added optional parameter to http_build_query() to allow specification of
|
||||
string separator. (Ilia)
|
||||
- Added image_type_to_extension() function. (Hannes, Ilia)
|
||||
- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
|
||||
- Added automatic module globals management. (Dmitry)
|
||||
- Added RFC2397 (data: stream) support. (Marcus)
|
||||
- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
|
||||
- Added support for getenv() input filtering. (Rasmus)
|
||||
- Added support for constructors in interfaces to force constructor signature
|
||||
checks in implementations. (Marcus)
|
||||
- Added memory_get_peak_usage() function for retrieving peak memory usage of
|
||||
a PHP script. (Ilia)
|
||||
- Added pg_field_table() function. (Edin)
|
||||
- Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML().
|
||||
(Hannes)
|
||||
- Added DOMNode::getNodePath() for getting an XPath for a node. (Christian)
|
||||
- Added gmp_nextprime() function. (ants dot aasma at gmail dot com, Tony)
|
||||
- Added error_get_last() function. (Mike)
|
||||
|
||||
- Optimized zend_try/zend_catch macros by eliminating memcpy(3). (Dmitry)
|
||||
- Optimized require_once() and include_once() by eliminating fopen(3)
|
||||
on second usage. (Dmitry)
|
||||
- Optimized request shutdown sequence. Restoring ini directives now iterates
|
||||
only over modified directives instead of all. (Dmitry)
|
||||
|
||||
- Fixed memory leaks in openssl streams context options. (Pierre)
|
||||
- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
|
||||
- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
|
||||
called Foo). (Jani)
|
||||
- Fixed bug #38179 (imagecopy from a palette to a truecolor image loose
|
||||
alpha channel) (Pierre)
|
||||
- Fixed bug #38146 (Cannot use array returned from foo::__get('bar') in write
|
||||
context). (Dmitry)
|
||||
- Fixed bug #38125 (undefined reference to spl_dual_it_free_storage). (Marcus)
|
||||
- Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger
|
||||
than the actual length). (Tony)
|
||||
- Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on
|
||||
Solaris). (Tony)
|
||||
- Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding
|
||||
option). (Dmitry)
|
||||
- Fixed bug #38055 (Wrong interpretation of boolean parameters). (Dmitry)
|
||||
- Fixed bug #38019 (segfault extending mysqli class). (Dmitry)
|
||||
- Fixed bug #38005 (SoapFault faultstring doesn't follow encoding rules).
|
||||
(Dmitry)
|
||||
- Fixed bug #38004 (Parameters in SoapServer are decoded twice). (Dmitry)
|
||||
- Fixed bug #38003 (in classes inherited from MySQLi it's possible to call
|
||||
private constructors from invalid context). (Tony)
|
||||
- Fixed bug #37987 (invalid return of file_exists() in safe mode). (Ilia)
|
||||
- Fixed bug #37947 (zend_ptr_stack reallocation problem). (Dmitry)
|
||||
- Fixed bug #37945 (pathinfo() cannot handle argument with special characters
|
||||
like german "Umlaute"). (Mike)
|
||||
- Fixed bug #37931 (possible crash in OCI8 after database restart
|
||||
when using persistent connections). (Tony)
|
||||
- Fixed bug #37920 (compilation problems on z/OS). (Tony)
|
||||
- Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes)
|
||||
- Fixed bug #37862 (Integer pointer comparison to numeric value).
|
||||
(bugs-php at thewrittenword dot com)
|
||||
- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing
|
||||
protected attribute). (Marcus)
|
||||
- Fixed bug #37811 (define not using toString on objects). (Marcus)
|
||||
- Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony)
|
||||
- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus)
|
||||
- Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)).
|
||||
(Mike)
|
||||
- Fixed bug #37747 (strtotime segfaults when given "nextyear"). (Derick)
|
||||
- Fixed bug #37720 (merge_php_config scrambles values). (Mike,
|
||||
pumuckel at metropolis dot de)
|
||||
- Fixed bug #37709 (Possible crash in PDO::errorCode()). (Ilia)
|
||||
- Fixed bug #37707 (clone without assigning leaks memory). (Ilia, Nuno, Dmitri)
|
||||
- Fixed bug #37705 (Semaphore constants not available). (Ilia)
|
||||
- Fixed bug #37671 (MySQLi extension fails to recognize BIT column). (Ilia)
|
||||
- Fixed bug #37667 (Object is not added into array returned by __get). (Marcus)
|
||||
- Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike)
|
||||
- Fixed bug #37632 (Protected method access problem). (Marcus)
|
||||
- Fixed bug #37630 (MySQL extensions should link against thread safe client
|
||||
libs if built with ZTS). (Mike)
|
||||
- Fixed bug #37620 (mysqli_ssl_set validation is inappropriate). (Georg)
|
||||
- Fixed bug #37616 (DATE_RFC822 does not product RFC 822 dates).
|
||||
(Hannes Magnusson, Derick)
|
||||
- Fixed bug #37614 (Class name lowercased in error message). (Johannes)
|
||||
- Fixed bug #37587 (var without attribute causes segfault). (Marcus)
|
||||
- Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recursion
|
||||
limit support). (Ilia)
|
||||
- Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters). (Ilia)
|
||||
- Fixed bug #37565 (Using reflection::export with simplexml causing a crash).
|
||||
(Marcus)
|
||||
- Fixed bug #37563 (array_key_exists performance is poor for &$array). (Ilia)
|
||||
- Fixed bug #37558 (timeout functionality doesn't work after a second PHP
|
||||
startup on the same thread). (p dot desarnaud at wanadoo dot fr)
|
||||
- Fixed bug #37531 (oci8 persistent connection corruption). (Tony)
|
||||
- Fixed bug #37523 (namespaces added too late, leads to missing xsi:type
|
||||
attributes. incompatibility with libxml2-2.6.24). (Dmitry)
|
||||
- Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick)
|
||||
- Fixed bug #37510 (session_regenerate_id changes session_id() even on
|
||||
failure). (Hannes)
|
||||
- Fixed bug #37505 (touch() truncates large files). (Ilia)
|
||||
- Fixed bug #37499 (CLI segmentation faults during cleanup with sybase-ct
|
||||
extension enabled). (Tony)
|
||||
- Fixed bug #37496 (FastCGI output buffer overrun). (Piotr, Dmitry)
|
||||
- Fixed bug #37487 (oci_fetch_array() array-type should always default to
|
||||
OCI_BOTH). (Tony)
|
||||
- Fixed bug #37457 (Crash when an exception is thrown in accept() method of
|
||||
FilterIterator). (Marcus)
|
||||
- Fixed bug #37456 (DOMElement->setAttribute() loops forever). (Rob)
|
||||
- Fixed bug #37428 (PHP crashes on windows if there are startup errors
|
||||
and event log is used for logging them). (Edin)
|
||||
- Fixed bug #37418 (tidy module crashes on shutdown). (Tony)
|
||||
- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
|
||||
method). (Tony)
|
||||
- Fixed bug #37413 (Rejected versions of flex that don't work). (Ilia)
|
||||
- Fixed bug #37395 (recursive mkdir() fails to create nonexistent directories
|
||||
in root dir). (Tony)
|
||||
- Fixed bug #37394 (substr_compare() returns an error when offset equals
|
||||
string length). (Ilia)
|
||||
- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
|
||||
request). (Tony)
|
||||
- Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). (Ilia)
|
||||
- Fixed bug #37368 (Incorrect timestamp returned for strtotime()). (Derick)
|
||||
- Fixed bug #37363 (PDO_MYSQL does not build if no other mysql extension is
|
||||
enabled). (Mike)
|
||||
- Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
|
||||
- Fixed bug #37341 ($_SERVER in included file is shortened to two entries,
|
||||
if $_ENV gets used). (Dmitry)
|
||||
- Fixed bug #37313 (sigemptyset() used without including <signal.h>).
|
||||
(jdolecek)
|
||||
- Fixed bug #37306 (max_execution_time = max_input_time). (Dmitry)
|
||||
- Fixed Bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry)
|
||||
- Fixed bug #37256 (php-fastcgi doesn't handle connection abort). (Dmitry)
|
||||
- Fixed bug #37244 (Added strict flag to base64_decode() that enforces
|
||||
RFC3548 compliance). (Ilia)
|
||||
- Fixed bug #37144 (PHP crashes trying to assign into property of dead object).
|
||||
(Dmitry)
|
||||
- Fixed bug #36949 (invalid internal mysqli objects dtor). (Mike)
|
||||
- Fixed bug #36759 (Objects destructors are invoked in wrong order when script
|
||||
is finished). (Dmitry)
|
||||
- Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
|
||||
- Fixed bug #35886 (file_get_contents() fails with some
|
||||
combinations of offset & maxlen). (Nuno)
|
||||
- Fixed bug #35512 (Lack of read permission on main script results in
|
||||
E_WARNING rather then E_ERROR). (Ilia)
|
||||
- Fixed bug #34180 (--with-curlwrappers causes PHP to disregard some HTTP
|
||||
stream context options). (Mike)
|
||||
- Fixed bug #34005 (oci_password_change() fails).
|
||||
(pholdaway at technocom-wireless dot com, Tony)
|
||||
- Fixed bug #29538 (number_format and problem with 0). (Matthew Wilmas)
|
||||
|
||||
04 May 2006, PHP 5.1.4
|
||||
- Added "capture_peer_cert" and "capture_peer_cert_chain" context options
|
||||
for SSL streams. (Wez).
|
||||
- Added PDO::PARAM_EVT_* family of constants. (Sara)
|
||||
- Fixed possible crash in highlight_string(). (Dmitry)
|
||||
- Fixed bug #37291 (FastCGI now longer works with isapi_fcgi.dll). (Dmitry)
|
||||
- Fixed bug #37277 (cloning Dom Documents or Nodes does not work). (Rob)
|
||||
- Fixed bug #37276 (problems with $_POST array). (Dmitry)
|
||||
- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
|
||||
- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).
|
||||
|
||||
28 Apr 2006, PHP 5.1.3
|
||||
- Updated bundled PCRE library to version 6.6. (Andrei)
|
||||
- Moved extensions to PECL:
|
||||
. ext/msession (Derick)
|
||||
|
||||
+12
-4
@@ -29,14 +29,22 @@ Having said that, here are the organizational rules:
|
||||
5. If you don't know how to do something, ask first!
|
||||
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
To do so use "make test".
|
||||
|
||||
7. For development use the --enable-maintainer-zts switch to ensure your
|
||||
code handles TSRM correctly and doesn't break for thos who need that.
|
||||
|
||||
Currently we have the following branches in use:
|
||||
HEAD Will become PHP 6.0. This CVS branch is for active development.
|
||||
PHP_5_1 Is used to release the PHP 5.1.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_5_0 This branch is closed.
|
||||
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
|
||||
on this branch.
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_4_3 This branch is closed.
|
||||
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
|
||||
@@ -31,14 +31,17 @@ resources cannot be auto-converted.
|
||||
|
||||
Type specifiers
|
||||
---------------
|
||||
l - long
|
||||
d - double
|
||||
s - string (with possible null bytes) and its length
|
||||
b - boolean, stored in zend_bool
|
||||
r - resource (stored in zval)
|
||||
a - array
|
||||
b - boolean, stored in zend_bool
|
||||
d - double
|
||||
f - function or array containing php method call info (returned as
|
||||
zend_fcall_info* and zend_fcall_info_cache*)
|
||||
h - array (returned as HashTable*)
|
||||
l - long
|
||||
o - object (of any type)
|
||||
O - object (of specific type, specified by class entry)
|
||||
r - resource (stored in zval)
|
||||
s - string (with possible null bytes) and its length
|
||||
z - the actual zval
|
||||
|
||||
The following characters also have a meaning in the specifier string:
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
PHP 5.2 Update info or NEWS explained
|
||||
|
||||
- Changed E_ALL error reporting mode to includes E_RECOVERABLE_ERROR. (Marcus)
|
||||
|
||||
This changes means that the value of the E_ALL constant had changed to 6143
|
||||
from its previous value of 2047. If you are setting your error reporting mode
|
||||
inside the Apache config file or the .htaccess files you will need to adjust
|
||||
the value of error_reporting INI setting accordingly.
|
||||
|
||||
- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
|
||||
|
||||
This changes a few E_ERROR conditions to something that you can now catch
|
||||
using a user error handler. If the user error handler does not grab these
|
||||
kind of error they behave as fatal errors just like in any PHP version prior
|
||||
to 5.2. Errors of this type are logged as 'Catchable fatal error'.
|
||||
|
||||
- Added support for constructors in interfaces to force constructor signature
|
||||
checks in implementations. (Marcus)
|
||||
|
||||
Starting with PHP 5.2 interfaces can have constructors. If you use this
|
||||
feature then all implementing classes must implement constructors with a
|
||||
matching signature, while normally constructors do not need to follow any
|
||||
base class or interface constructor signature. (Signature is the name for
|
||||
the parameter and return type definition which captures count, reference or
|
||||
not and any type hints).
|
||||
|
||||
- Changed __toString to be called whereever applicable. (Marcus)
|
||||
|
||||
The magic object method __toString() is now called whenever an object is used
|
||||
as a string. The function must not throw an exception or the script will be
|
||||
terminated. The PHP 5.0/%51 fallback to return a string containing the object
|
||||
idetifier has been dropped. Note that the object identifier is never unique.
|
||||
That measn that if you have used this feature your application has been
|
||||
flawed. Nonetheless it will now be a catchable fatal error (see above).
|
||||
|
||||
- Added RFC2397 (data: stream) support. (Marcus)
|
||||
|
||||
Under windows this can mean a very rare change of behavior. If you are using
|
||||
NTFS filesystem and making use of meta streams in your application this does
|
||||
no longer work for a file with the name 'data' accessed without any path. IF
|
||||
you need to do so you have to prefix the filename with the "file:" protocol.
|
||||
For the functionality itself look here http://www.faqs.org/rfcs/rfc2397.html.
|
||||
|
||||
- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
|
||||
|
||||
With this option one can now distinguish between standard file operations on
|
||||
remote files and inclusion of remote files. While the former is usually
|
||||
desired, the latter implies security risks if used naivly. Starting with
|
||||
PHP-5.2 it is now possible to allow standard file operations while
|
||||
dissalowing inclusion of remote files, which will also be the default
|
||||
configuration.
|
||||
@@ -0,0 +1,13 @@
|
||||
The goal of the new memory manager (PHP 5.2 and later) is reducing memory allocation overhead and speedup memory management.
|
||||
|
||||
The new manager's "configure" has no "--disable-zend-memory-manager" option, but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG build and disabled by default in RELEASE built. It allows select malloc/emalloc at runtime. So you can use internal and external memory debuggers without recompilation.
|
||||
|
||||
$ sapi/cli/php -r 'leak();'
|
||||
|
||||
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();'
|
||||
|
||||
The patch allows tweaking memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment variables. Default values are "malloc" and "256K". Dependent on target system you can also use "mmap_anon", "mmap_zero"
|
||||
and "win32" storage managers.
|
||||
|
||||
$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php
|
||||
|
||||
+106
-6
@@ -129,13 +129,11 @@ AC_ARG_WITH(zend-vm,
|
||||
PHP_ZEND_VM=CALL
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(zend-memory-manager,
|
||||
[ --disable-zend-memory-manager
|
||||
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
|
||||
AC_ARG_ENABLE(malloc-mm,
|
||||
[ --enable-malloc-mm Use environment variable for run-time malloc/emalloc
|
||||
selection - FOR DEVELOPERS ONLY!!],
|
||||
[
|
||||
ZEND_USE_ZEND_ALLOC=$enableval
|
||||
], [
|
||||
ZEND_USE_ZEND_ALLOC=yes
|
||||
ZEND_USE_MALLOC_MM=$enableval
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(maintainer-zts,
|
||||
@@ -306,6 +304,108 @@ int main()
|
||||
|
||||
AC_MSG_RESULT(done)
|
||||
|
||||
dnl test for memory allocation using mmap(MAP_ANON)
|
||||
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef MAP_ANON
|
||||
# ifdef MAP_ANONYMOUS
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MREMAP_MAYMOVE
|
||||
# define MREMAP_MAYMOVE 0
|
||||
#endif
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void*)-1)
|
||||
#endif
|
||||
|
||||
#define SEG_SIZE (256*1024)
|
||||
|
||||
int main()
|
||||
{
|
||||
void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
if (seg == MAP_FAILED) {
|
||||
return 1;
|
||||
}
|
||||
if (munmap(seg, SEG_SIZE) != 0) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [
|
||||
dnl cross-compile needs something here
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl test for memory allocation using mmap("/dev/zero")
|
||||
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef MAP_ANON
|
||||
# ifdef MAP_ANONYMOUS
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MREMAP_MAYMOVE
|
||||
# define MREMAP_MAYMOVE 0
|
||||
#endif
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void*)-1)
|
||||
#endif
|
||||
|
||||
#define SEG_SIZE (256*1024)
|
||||
|
||||
int main()
|
||||
{
|
||||
int fd;
|
||||
void *seg;
|
||||
|
||||
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0) {
|
||||
return 1;
|
||||
}
|
||||
seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||
if (seg == MAP_FAILED) {
|
||||
return 2;
|
||||
}
|
||||
if (munmap(seg, SEG_SIZE) != 0) {
|
||||
return 3;
|
||||
}
|
||||
if (close(fd) != 0) {
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
], [
|
||||
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [
|
||||
dnl cross-compile needs something here
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS(mremap)
|
||||
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ SOURCE=.\zend_exceptions.c
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# ADD CPP /I "..\TSRM"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
--TEST--
|
||||
func_num_args() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
|
||||
test1();
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_num_args());
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_num_args());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(1)
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
Warning: func_num_args(): Called from the global scope - no function context in %s on line %d
|
||||
int(-1)
|
||||
Done
|
||||
@@ -0,0 +1,108 @@
|
||||
--TEST--
|
||||
func_get_arg() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_get_arg(-10));
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
var_dump(func_get_arg(2));
|
||||
}
|
||||
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_get_arg(0));
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_get_arg(1));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
int(10)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -0,0 +1,81 @@
|
||||
--TEST--
|
||||
func_get_args() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test1() {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
function test2($a) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
function test3($a, $b) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
static function test1($a) {
|
||||
var_dump(func_get_args());
|
||||
}
|
||||
}
|
||||
|
||||
test::test1(1);
|
||||
var_dump(func_get_args());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(10)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: Missing argument 2 for test3() in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Warning: func_get_args(): Called from the global scope - no function context in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
strncmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strncmp("", ""));
|
||||
var_dump(strncmp("", "", 100));
|
||||
var_dump(strncmp("aef", "dfsgbdf", -1));
|
||||
var_dump(strncmp("fghjkl", "qwer", 0));
|
||||
var_dump(strncmp("qwerty", "qwerty123", 6));
|
||||
var_dump(strncmp("qwerty", "qwerty123", 7));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strncmp() in %s on line %d
|
||||
NULL
|
||||
int(0)
|
||||
|
||||
Warning: Length must be greater than or equal to 0 in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(0)
|
||||
int(-1)
|
||||
Done
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
strcasecmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strcasecmp(""));
|
||||
var_dump(strcasecmp("", ""));
|
||||
var_dump(strcasecmp("aef", "dfsgbdf"));
|
||||
var_dump(strcasecmp("qwe", "qwer"));
|
||||
var_dump(strcasecmp("qwerty", "QweRty"));
|
||||
var_dump(strcasecmp("qwErtY", "qwerty"));
|
||||
var_dump(strcasecmp("q123", "Q123"));
|
||||
var_dump(strcasecmp("01", "01"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strcasecmp() in %s on line %d
|
||||
NULL
|
||||
int(0)
|
||||
int(-3)
|
||||
int(-1)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
Done
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
strncasecmp() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(strncasecmp(""));
|
||||
var_dump(strncasecmp("", "", -1));
|
||||
var_dump(strncasecmp("aef", "dfsgbdf", 0));
|
||||
var_dump(strncasecmp("aef", "dfsgbdf", 10));
|
||||
var_dump(strncasecmp("qwe", "qwer", 3));
|
||||
var_dump(strncasecmp("qwerty", "QweRty", 6));
|
||||
var_dump(strncasecmp("qwErtY", "qwer", 7));
|
||||
var_dump(strncasecmp("q123", "Q123", 3));
|
||||
var_dump(strncasecmp("01", "01", 1000));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for strncasecmp() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Length must be greater than or equal to 0 in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(-3)
|
||||
int(0)
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
int(0)
|
||||
Done
|
||||
@@ -0,0 +1,63 @@
|
||||
--TEST--
|
||||
each() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(each());
|
||||
$var = 1;
|
||||
var_dump(each($var));
|
||||
$var = "string";
|
||||
var_dump(each($var));
|
||||
$var = array(1,2,3);
|
||||
var_dump(each($var));
|
||||
$var = array("a"=>1,"b"=>2,"c"=>3);
|
||||
var_dump(each($var));
|
||||
|
||||
$a = array(1);
|
||||
$a [] =&$a[0];
|
||||
|
||||
var_dump(each($a));
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for each() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Variable passed to each() is not an array or object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Variable passed to each() is not an array or object in %s on line %d
|
||||
NULL
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
int(0)
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
["key"]=>
|
||||
string(1) "a"
|
||||
}
|
||||
array(4) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["value"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
int(0)
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
Done
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
define() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(define());
|
||||
var_dump(define("TRUE"));
|
||||
var_dump(define("TRUE", 1));
|
||||
var_dump(define("TRUE", 1, array(1)));
|
||||
|
||||
var_dump(define(array(1,2,3,4,5), 1));
|
||||
var_dump(define(" ", 1));
|
||||
var_dump(define("[[[", 2));
|
||||
var_dump(define("test const", 3));
|
||||
var_dump(define("test const", 3));
|
||||
var_dump(define("test", array(1)));
|
||||
var_dump(define("test1", new stdclass));
|
||||
|
||||
var_dump(constant(" "));
|
||||
var_dump(constant("[[["));
|
||||
var_dump(constant("test const"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for define() in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
|
||||
Notice: Constant true already defined in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Notice: Constant test const already defined in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
Done
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
get_class() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
function bar () {
|
||||
var_dump(get_class());
|
||||
}
|
||||
}
|
||||
|
||||
class foo2 extends foo {
|
||||
}
|
||||
|
||||
foo::bar();
|
||||
foo2::bar();
|
||||
|
||||
$f1 = new foo;
|
||||
$f2 = new foo2;
|
||||
|
||||
$f1->bar();
|
||||
$f2->bar();
|
||||
|
||||
var_dump(get_class());
|
||||
var_dump(get_class("qwerty"));
|
||||
|
||||
var_dump(get_class($f1));
|
||||
var_dump(get_class($f2));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
|
||||
string(3) "foo"
|
||||
|
||||
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
|
||||
Warning: get_class() called without object from outside a class in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
string(4) "foo2"
|
||||
Done
|
||||
@@ -0,0 +1,59 @@
|
||||
--TEST--
|
||||
get_parent_class() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface i {
|
||||
function test();
|
||||
}
|
||||
|
||||
class foo implements i {
|
||||
function test() {
|
||||
var_dump(get_parent_class());
|
||||
}
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
function test_bar() {
|
||||
var_dump(get_parent_class());
|
||||
}
|
||||
}
|
||||
|
||||
$bar = new bar;
|
||||
$foo = new foo;
|
||||
|
||||
$foo->test();
|
||||
$bar->test();
|
||||
$bar->test_bar();
|
||||
|
||||
var_dump(get_parent_class($bar));
|
||||
var_dump(get_parent_class($foo));
|
||||
var_dump(get_parent_class("bar"));
|
||||
var_dump(get_parent_class("foo"));
|
||||
var_dump(get_parent_class("i"));
|
||||
|
||||
var_dump(get_parent_class(""));
|
||||
var_dump(get_parent_class("[[[["));
|
||||
var_dump(get_parent_class(" "));
|
||||
var_dump(get_parent_class(new stdclass));
|
||||
var_dump(get_parent_class(array()));
|
||||
var_dump(get_parent_class(1));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
Done
|
||||
@@ -0,0 +1,89 @@
|
||||
--TEST--
|
||||
property_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
public $pp1 = 1;
|
||||
private $pp2 = 2;
|
||||
protected $pp3 = 3;
|
||||
|
||||
function bar() {
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
}
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
function test() {
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(property_exists());
|
||||
var_dump(property_exists(""));
|
||||
var_dump(property_exists("foo","pp1"));
|
||||
var_dump(property_exists("foo","pp2"));
|
||||
var_dump(property_exists("foo","pp3"));
|
||||
var_dump(property_exists("foo","nonexistent"));
|
||||
var_dump(property_exists("fo","nonexistent"));
|
||||
var_dump(property_exists("foo",""));
|
||||
var_dump(property_exists("","test"));
|
||||
var_dump(property_exists("",""));
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
var_dump(property_exists($foo,"pp1"));
|
||||
var_dump(property_exists($foo,"pp2"));
|
||||
var_dump(property_exists($foo,"pp3"));
|
||||
var_dump(property_exists($foo,"nonexistent"));
|
||||
var_dump(property_exists($foo,""));
|
||||
var_dump(property_exists(array(),"test"));
|
||||
var_dump(property_exists(1,"test"));
|
||||
var_dump(property_exists(true,"test"));
|
||||
|
||||
$foo->bar();
|
||||
|
||||
$bar = new bar;
|
||||
$bar->test();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for property_exists() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for property_exists() in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
|
||||
NULL
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
Done
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
class_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
}
|
||||
|
||||
var_dump(class_exists());
|
||||
var_dump(class_exists("qwerty"));
|
||||
var_dump(class_exists(""));
|
||||
var_dump(class_exists(array()));
|
||||
var_dump(class_exists("test", false));
|
||||
var_dump(class_exists("foo", false));
|
||||
var_dump(class_exists("foo"));
|
||||
var_dump(class_exists("stdClass", false));
|
||||
var_dump(class_exists("stdClass"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
Done
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
interface_exists() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface foo {
|
||||
}
|
||||
|
||||
var_dump(interface_exists());
|
||||
var_dump(interface_exists("qwerty"));
|
||||
var_dump(interface_exists(""));
|
||||
var_dump(interface_exists(array()));
|
||||
var_dump(interface_exists("test", false));
|
||||
var_dump(interface_exists("foo", false));
|
||||
var_dump(interface_exists("foo"));
|
||||
var_dump(interface_exists("stdClass", false));
|
||||
var_dump(interface_exists("stdClass"));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
Done
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
/* dummy file for 014.phpt */
|
||||
?>
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
get_included_files() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(get_included_files());
|
||||
|
||||
include(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
var_dump(get_included_files(1,1));
|
||||
|
||||
include_once(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
var_dump(get_included_files(1));
|
||||
|
||||
include(dirname(__FILE__)."/014.inc");
|
||||
var_dump(get_included_files());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
|
||||
Warning: Wrong parameter count for get_included_files() in %s on line %d
|
||||
NULL
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
|
||||
Warning: Wrong parameter count for get_included_files() in %s on line %d
|
||||
NULL
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(%d) "%s"
|
||||
[1]=>
|
||||
string(%d) "%s"
|
||||
}
|
||||
Done
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
trigger_error() tests
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(trigger_error());
|
||||
var_dump(trigger_error("error"));
|
||||
var_dump(trigger_error(array()));
|
||||
var_dump(trigger_error("error", -1));
|
||||
var_dump(trigger_error("error", 0));
|
||||
var_dump(trigger_error("error", E_USER_WARNING));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for trigger_error() in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: error in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
|
||||
Notice: Array in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Warning: Invalid error type specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Invalid error type specified in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: error in %s on line %d
|
||||
bool(true)
|
||||
Done
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
isset() with object properties when operating on non-object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = NULL;
|
||||
isset($foo->bar->bar);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Test for abstract static classes
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class TestClass
|
||||
{
|
||||
abstract static public function getName();
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Static function TestClass::getName() cannot be abstract in %sabstract-static.php on line %d
|
||||
@@ -12,4 +12,4 @@ foo(123);
|
||||
--EXPECTF--
|
||||
3
|
||||
|
||||
Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
+21
-14
@@ -2,6 +2,7 @@
|
||||
Bug #26166 (__toString() crash when no values returned)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo
|
||||
{
|
||||
function __toString()
|
||||
@@ -28,6 +29,23 @@ class Bar
|
||||
$o = new Bar;
|
||||
echo $o;
|
||||
|
||||
echo "===NONE===\n";
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class None
|
||||
{
|
||||
function __toString() {
|
||||
}
|
||||
}
|
||||
|
||||
$o = new None;
|
||||
echo $o;
|
||||
|
||||
echo "===THROW===\n";
|
||||
|
||||
class Error
|
||||
@@ -45,23 +63,12 @@ catch (Exception $e) {
|
||||
echo "Got the exception\n";
|
||||
}
|
||||
|
||||
echo "===NONE===\n";
|
||||
|
||||
class None
|
||||
{
|
||||
function __toString() {
|
||||
}
|
||||
}
|
||||
|
||||
$o = new None;
|
||||
echo $o;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Hello World!
|
||||
===THROW===
|
||||
Got the exception
|
||||
===NONE===
|
||||
string(52) "Method None::__toString() must return a string value"
|
||||
===THROW===
|
||||
|
||||
Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
|
||||
Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $a = "Default for A";
|
||||
public $b = "Default for B";
|
||||
|
||||
function __construct($a, $b) {
|
||||
$this->a = $a;
|
||||
$this->b = $b;
|
||||
}
|
||||
function A() {
|
||||
$args = func_get_args();
|
||||
call_user_func_array(Array(&$this, '__construct'), $args);
|
||||
}
|
||||
}
|
||||
|
||||
$t = new A("New A", "New B");
|
||||
print_r($t);
|
||||
print_r(get_class_vars(get_class($t)));
|
||||
print_r(get_object_vars($t));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
|
||||
A Object
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => Default for A
|
||||
[b] => Default for B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
@@ -3,6 +3,12 @@ Bug #28444 (Cannot access undefined property for object with overloaded property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class Object
|
||||
{
|
||||
public $x;
|
||||
@@ -60,7 +66,8 @@ Overloaded::__set(y,3)
|
||||
int(3)
|
||||
Overloaded::__get(y)
|
||||
int(3)
|
||||
Overloaded::__set(z,Object id #3)
|
||||
string(55) "Object of class Object could not be converted to string"
|
||||
Overloaded::__set(z,)
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(4)
|
||||
|
||||
@@ -2,21 +2,33 @@
|
||||
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
|
||||
function my_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
var_dump($errstr);
|
||||
}
|
||||
|
||||
set_error_handler('my_error_handler');
|
||||
|
||||
class a
|
||||
{
|
||||
public $a = 4;
|
||||
function __call($a,$b) {
|
||||
return "unknown method";
|
||||
}
|
||||
}
|
||||
|
||||
$b = new a;
|
||||
echo $b,"\n";
|
||||
$c = unserialize(serialize($b));
|
||||
echo $c,"\n";
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Object id #1
|
||||
Object id #2
|
||||
string(50) "Object of class a could not be converted to string"
|
||||
|
||||
string(50) "Object of class a could not be converted to string"
|
||||
|
||||
object(a)#2 (1) {
|
||||
["a"]=>
|
||||
int(4)
|
||||
|
||||
@@ -28,9 +28,12 @@ $b = "much longer";
|
||||
print_r($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20
|
||||
A Object
|
||||
(
|
||||
[q] => long
|
||||
[q] => 3
|
||||
)
|
||||
|
||||
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23
|
||||
|
||||
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
|
||||
@@ -27,7 +27,7 @@ interface iB2 extends iA2 {
|
||||
class A2 implements iA2 {
|
||||
}
|
||||
|
||||
class B2 extends A2 implements iB2 {
|
||||
class B2 extends A2 implements iA2 {
|
||||
}
|
||||
|
||||
echo iA2::cA;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
|
||||
Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -14,7 +14,7 @@ function make_exception()
|
||||
|
||||
function make_exception_and_change_err_reporting()
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(4095)
|
||||
int(4095)
|
||||
int(2047)
|
||||
int(8191)
|
||||
int(8191)
|
||||
int(6143)
|
||||
Done
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
@@ -24,6 +24,6 @@ FooTest();
|
||||
FooTest(new Foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Hi!
|
||||
Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
|
||||
Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #36759 (Objects destructors are invoked in wrong order when script is finished)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
private $bar;
|
||||
function __construct($bar) {
|
||||
$this->bar = $bar;
|
||||
}
|
||||
function __destruct() {
|
||||
echo __METHOD__,"\n";
|
||||
unset($this->bar);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
function __destruct() {
|
||||
echo __METHOD__,"\n";
|
||||
unset($this->bar);
|
||||
}
|
||||
}
|
||||
$y = new Bar();
|
||||
$x = new Foo($y);
|
||||
?>
|
||||
--EXPECT--
|
||||
Foo::__destruct
|
||||
Bar::__destruct
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #37144 (PHP crashes trying to assign into property of dead object)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
$x = new stdClass();
|
||||
$x->bar = array(1);
|
||||
return $x;
|
||||
}
|
||||
foo()->bar[1] = "123";
|
||||
foo()->bar[0]++;
|
||||
unset(foo()->bar[0]);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
Bug #3721 (Access to protected property of common base class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
protected $value;
|
||||
|
||||
public function __construct($val)
|
||||
{
|
||||
$this->value = $val;
|
||||
}
|
||||
|
||||
protected function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
public function copyValue($obj)
|
||||
{
|
||||
$this->value = $obj->getValue();
|
||||
$this->value = $obj->value; // value defined in common base class
|
||||
}
|
||||
}
|
||||
class C extends A {}
|
||||
|
||||
$B = new B("B");
|
||||
var_dump($B);
|
||||
$C = new C("C");
|
||||
var_dump($C);
|
||||
|
||||
$B->copyValue($C);
|
||||
|
||||
var_dump($B);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(B)#%d (1) {
|
||||
["value:protected"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
object(C)#%d (1) {
|
||||
["value:protected"]=>
|
||||
string(1) "C"
|
||||
}
|
||||
object(B)#%d (1) {
|
||||
["value:protected"]=>
|
||||
string(1) "C"
|
||||
}
|
||||
===DONE===
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
--TEST--
|
||||
Bug #37632 (Protected method access problem)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A1
|
||||
{
|
||||
protected function test()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B1 extends A1
|
||||
{
|
||||
public function doTest(A1 $obj)
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
$obj->test();
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends A1
|
||||
{
|
||||
protected function test()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B1;
|
||||
$b->doTest(new C1);
|
||||
|
||||
class A2
|
||||
{
|
||||
static protected function test()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B2 extends A2
|
||||
{
|
||||
static public function doTest(A2 $obj)
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
$obj->test();
|
||||
}
|
||||
}
|
||||
|
||||
class C2 extends A2
|
||||
{
|
||||
static protected function test()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
B2::doTest(new C2);
|
||||
|
||||
/* Right now Ctor's cannot be made protected when defined in a ctor. That is
|
||||
* we cannot decrease visibility.
|
||||
*
|
||||
|
||||
interface Ctor
|
||||
{
|
||||
function __construct($x);
|
||||
}
|
||||
|
||||
class A3 implements Ctor
|
||||
{
|
||||
protected function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B3 extends A3
|
||||
{
|
||||
static public function doTest()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
new C3;
|
||||
}
|
||||
}
|
||||
|
||||
class C3 extends A3
|
||||
{
|
||||
protected function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
B3::doTest();
|
||||
|
||||
*/
|
||||
|
||||
class A4
|
||||
{
|
||||
protected function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B4 extends A4
|
||||
{
|
||||
static public function doTest()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
new C4;
|
||||
}
|
||||
}
|
||||
|
||||
class C4 extends A4
|
||||
{
|
||||
protected function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
B4::doTest();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
B1::doTest
|
||||
C1::test
|
||||
B2::doTest
|
||||
C2::test
|
||||
B4::doTest
|
||||
|
||||
Fatal error: Call to protected C4::__construct() from context 'B4' in %sbug37632.php on line %d
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #37667 (Object is not added into array returned by __get)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test
|
||||
{
|
||||
protected $property = array('foo' => 'bar');
|
||||
|
||||
function __get($name)
|
||||
{
|
||||
return $this->property;
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
|
||||
var_dump($obj->property['foo']);
|
||||
var_dump($obj->property[2]);
|
||||
|
||||
var_dump($obj);
|
||||
|
||||
$obj->property[] = 1;
|
||||
$obj->property[] = 2;
|
||||
|
||||
var_dump($obj);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
string(3) "bar"
|
||||
|
||||
Notice: Undefined offset: 2 in %sbug37667.php on line 16
|
||||
NULL
|
||||
object(Test)#%d (1) {
|
||||
["property:protected"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
}
|
||||
|
||||
Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20
|
||||
|
||||
Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
|
||||
object(Test)#%d (1) {
|
||||
["property:protected"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #37707 (clone without assigning leaks memory)
|
||||
--FILE--
|
||||
<?php
|
||||
class testme {
|
||||
function __clone() {
|
||||
echo "clonned\n";
|
||||
}
|
||||
}
|
||||
clone new testme();
|
||||
echo "NO LEAK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
clonned
|
||||
NO LEAK
|
||||
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #37811 define not using toString on objects
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestClass
|
||||
{
|
||||
function __toString()
|
||||
{
|
||||
return "Foo";
|
||||
}
|
||||
}
|
||||
|
||||
define("Bar",new TestClass);
|
||||
var_dump(Bar);
|
||||
define("Baz",new stdClass);
|
||||
var_dump(Baz);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
string(3) "Foo"
|
||||
|
||||
Warning: Constants may only evaluate to scalar values in %sbug37811.php on line %d
|
||||
|
||||
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
|
||||
string(3) "Baz"
|
||||
===DONE===
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
public function __get($member) {
|
||||
$f = array("foo"=>"bar","bar"=>"foo");
|
||||
return $f;
|
||||
}
|
||||
}
|
||||
|
||||
$f = new foo();
|
||||
foreach($f->bar as $key => $value) {
|
||||
print "$key => $value\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
foo => bar
|
||||
bar => foo
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Catching an exception in a constructor
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyObject
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
throw new Exception();
|
||||
echo __METHOD__ . "() Must not be reached\n";
|
||||
}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
echo __METHOD__ . "() Must not be called\n";
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
new MyObject();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Caught\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught
|
||||
===DONE===
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Catching an exception in a constructor fired form a static method
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyObject
|
||||
{
|
||||
function fail()
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function __construct()
|
||||
{
|
||||
self::fail();
|
||||
echo __METHOD__ . "() Must not be reached\n";
|
||||
}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
echo __METHOD__ . "() Must not be called\n";
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
new MyObject();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Caught\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught
|
||||
===DONE===
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Catching an exception in a constructor inside a static method
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyObject
|
||||
{
|
||||
function fail()
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function __construct()
|
||||
{
|
||||
self::fail();
|
||||
echo __METHOD__ . "() Must not be reached\n";
|
||||
}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
echo __METHOD__ . "() Must not be called\n";
|
||||
}
|
||||
|
||||
static function test()
|
||||
{
|
||||
try
|
||||
{
|
||||
new MyObject();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Caught\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MyObject::test();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught
|
||||
===DONE===
|
||||
@@ -22,5 +22,5 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2047)
|
||||
int(6143)
|
||||
Done
|
||||
@@ -23,5 +23,5 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4095)
|
||||
int(8191)
|
||||
Done
|
||||
@@ -31,5 +31,5 @@ echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef2 in %s on line %d
|
||||
int(4095)
|
||||
int(8191)
|
||||
Done
|
||||
@@ -19,5 +19,5 @@ echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef in %s on line %d
|
||||
int(4095)
|
||||
int(8191)
|
||||
Done
|
||||
@@ -30,5 +30,5 @@ echo "Done\n";
|
||||
Notice: Undefined variable: undef_value in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef_name in %s on line %d
|
||||
int(2047)
|
||||
int(6143)
|
||||
Done
|
||||
@@ -26,5 +26,5 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2047)
|
||||
int(6143)
|
||||
Done
|
||||
@@ -26,5 +26,5 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2047)
|
||||
int(6143)
|
||||
Done
|
||||
@@ -28,5 +28,5 @@ echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef3 in %s on line %d
|
||||
int(4095)
|
||||
int(8191)
|
||||
Done
|
||||
@@ -27,5 +27,5 @@ echo "Done\n";
|
||||
Notice: Undefined variable: blah in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef2 in %s on line %d
|
||||
int(4095)
|
||||
int(8191)
|
||||
Done
|
||||
@@ -30,6 +30,6 @@ var_dump(error_reporting());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2047)
|
||||
int(2039)
|
||||
int(6143)
|
||||
int(6135)
|
||||
Done
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test whether an object is NULL or not.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Bla
|
||||
{
|
||||
}
|
||||
|
||||
$b = new Bla;
|
||||
|
||||
var_dump($b != null);
|
||||
var_dump($b == null);
|
||||
var_dump($b !== null);
|
||||
var_dump($b === null);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -0,0 +1,60 @@
|
||||
--TEST--
|
||||
comparing objects to other types
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Bar {
|
||||
}
|
||||
|
||||
$b = new Bar;
|
||||
|
||||
var_dump($b == NULL);
|
||||
var_dump($b != NULL);
|
||||
var_dump($b == true);
|
||||
var_dump($b != true);
|
||||
var_dump($b == false);
|
||||
var_dump($b != false);
|
||||
var_dump($b == "");
|
||||
var_dump($b != "");
|
||||
var_dump($b == 0);
|
||||
var_dump($b != 0);
|
||||
var_dump($b == 1);
|
||||
var_dump($b != 1);
|
||||
var_dump($b == 1.0);
|
||||
var_dump($b != 1.0);
|
||||
var_dump($b == 1);
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Notice: Object of class Bar could not be converted to int in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: Object of class Bar could not be converted to int in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Object of class Bar could not be converted to int in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Object of class Bar could not be converted to int in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: Object of class Bar could not be converted to double in %s on line %d
|
||||
bool(true)
|
||||
|
||||
Notice: Object of class Bar could not be converted to double in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: Object of class Bar could not be converted to int in %s on line %d
|
||||
bool(true)
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo() {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo() {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo($arg, $arg2) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo(&$arg) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function &foo() {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function &foo() {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo() {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo($arg, $arg2 = NULL) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo($arg, $arg2 = NULL) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo($arg, $arg2) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo($arg, &$arg2 = NULL) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo($arg, &$arg2 = NULL) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo($arg, &$arg2) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo(Test $arg) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo(Test $arg) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo(Test3 $arg) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
method overloading with different method signature
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function foo(Test $arg) {}
|
||||
}
|
||||
|
||||
class test2 extends test {
|
||||
function foo(Test $arg) {}
|
||||
}
|
||||
|
||||
class test3 extends test {
|
||||
function foo($arg) {}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
redefining constructor (__construct second)
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function test() {
|
||||
}
|
||||
function __construct() {
|
||||
}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class test in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
redefining constructor (__construct first)
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
function __construct() {
|
||||
}
|
||||
function test() {
|
||||
}
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class test in %s on line %d
|
||||
Done
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
implementing a class
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
}
|
||||
|
||||
interface bar extends foo {
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: bar cannot implement foo - it is not an interface in %s on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
implementing the same interface twice
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface foo {
|
||||
}
|
||||
|
||||
class bar implements foo, foo {
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
extending the same interface twice
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface foo {
|
||||
}
|
||||
|
||||
interface bar extends foo, foo {
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
comparing objects with strings/NULL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$o=new stdClass;
|
||||
|
||||
var_dump($o == "");
|
||||
var_dump($o != "");
|
||||
var_dump($o < "");
|
||||
var_dump("" < $o);
|
||||
var_dump("" > $o);
|
||||
var_dump($o != null);
|
||||
var_dump(is_null($o));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
using different variables to access array offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arr = array(1,2,3,4,5,6,7,8);
|
||||
|
||||
var_dump($arr[1]);
|
||||
var_dump($arr[0.0836]);
|
||||
var_dump($arr[NULL]);
|
||||
var_dump($arr["run away"]);
|
||||
|
||||
var_dump($arr[TRUE]);
|
||||
var_dump($arr[FALSE]);
|
||||
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump($arr[$fp]);
|
||||
|
||||
$obj = new stdClass;
|
||||
var_dump($arr[$obj]);
|
||||
|
||||
$arr1 = Array(1,2,3);
|
||||
var_dump($arr[$arr1]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
Notice: Undefined index: in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined index: run away in %s on line %d
|
||||
NULL
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
||||
int(%d)
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
using different variables to access boolean offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$bool = TRUE;
|
||||
|
||||
var_dump($bool[1]);
|
||||
var_dump($bool[0.0836]);
|
||||
var_dump($bool[NULL]);
|
||||
var_dump($bool["run away"]);
|
||||
|
||||
var_dump($bool[TRUE]);
|
||||
var_dump($bool[FALSE]);
|
||||
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump($bool[$fp]);
|
||||
|
||||
$obj = new stdClass;
|
||||
var_dump($bool[$obj]);
|
||||
|
||||
$arr = Array(1,2,3);
|
||||
var_dump($bool[$arr]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
Done
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
using different variables to access long offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$long = 1;
|
||||
|
||||
var_dump($long[1]);
|
||||
var_dump($long[0.0836]);
|
||||
var_dump($long[NULL]);
|
||||
var_dump($long["run away"]);
|
||||
|
||||
var_dump($long[TRUE]);
|
||||
var_dump($long[FALSE]);
|
||||
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump($long[$fp]);
|
||||
|
||||
$obj = new stdClass;
|
||||
var_dump($long[$obj]);
|
||||
|
||||
$arr = Array(1,2,3);
|
||||
var_dump($long[$arr]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
Done
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
using different variables to access null offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$null = NULL;
|
||||
|
||||
var_dump($null[1]);
|
||||
var_dump($null[0.0836]);
|
||||
var_dump($null[NULL]);
|
||||
var_dump($null["run away"]);
|
||||
|
||||
var_dump($null[TRUE]);
|
||||
var_dump($null[FALSE]);
|
||||
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump($null[$fp]);
|
||||
|
||||
$obj = new stdClass;
|
||||
var_dump($null[$obj]);
|
||||
|
||||
$arr = Array(1,2,3);
|
||||
var_dump($null[$arr]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
Done
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
accessing object dimension
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$object = new stdClass;
|
||||
var_dump($object[1]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use object of type stdClass as array in %s on line %d
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
using different variables to access string offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "Sitting on a corner all alone, staring from the bottom of his soul";
|
||||
|
||||
var_dump($str[1]);
|
||||
var_dump($str[0.0836]);
|
||||
var_dump($str[NULL]);
|
||||
var_dump($str["run away"]);
|
||||
|
||||
var_dump($str[TRUE]);
|
||||
var_dump($str[FALSE]);
|
||||
|
||||
$fp = fopen(__FILE__, "r");
|
||||
var_dump($str[$fp]);
|
||||
|
||||
$obj = new stdClass;
|
||||
var_dump($str[$obj]);
|
||||
|
||||
$arr = Array(1,2,3);
|
||||
var_dump($str[$arr]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "i"
|
||||
string(1) "S"
|
||||
string(1) "S"
|
||||
string(1) "S"
|
||||
string(1) "i"
|
||||
string(1) "S"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
string(1) "%s"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
string(1) "%s"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
string(1) "i"
|
||||
Done
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
using resource as array offset
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$fp = fopen(__FILE__, 'r');
|
||||
|
||||
$array = array(1,2,3,4,5,6,7);
|
||||
|
||||
var_dump($array[$fp]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
||||
int(%d)
|
||||
Done
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
assigning static property as non static
|
||||
--INI--
|
||||
error_reporting=8191
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class test {
|
||||
static $foo = 1;
|
||||
}
|
||||
|
||||
$t = new test;
|
||||
$t->foo = 5;
|
||||
|
||||
$fp = fopen(__FILE__, 'r');
|
||||
|
||||
var_dump($t);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Accessing static property test::$foo as non static in %s on line %d
|
||||
object(test)#%d (1) {
|
||||
["foo"]=>
|
||||
int(5)
|
||||
}
|
||||
Done
|
||||
+66
-80
@@ -87,7 +87,6 @@ ZEND_INI_END()
|
||||
#ifdef ZTS
|
||||
ZEND_API int compiler_globals_id;
|
||||
ZEND_API int executor_globals_id;
|
||||
ZEND_API int alloc_globals_id;
|
||||
HashTable *global_function_table;
|
||||
HashTable *global_class_table;
|
||||
HashTable *global_constants_table;
|
||||
@@ -107,7 +106,7 @@ static uint zend_version_info_length;
|
||||
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
|
||||
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
|
||||
{
|
||||
zval **tmp;
|
||||
char *string_key;
|
||||
@@ -117,48 +116,52 @@ static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
|
||||
int i;
|
||||
|
||||
for (i=0; i<indent; i++) {
|
||||
ZEND_PUTS(" ");
|
||||
ZEND_PUTS_EX(" ");
|
||||
}
|
||||
ZEND_PUTS("(\n");
|
||||
ZEND_PUTS_EX("(\n");
|
||||
indent += PRINT_ZVAL_INDENT;
|
||||
zend_hash_internal_pointer_reset_ex(ht, &iterator);
|
||||
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
|
||||
for (i=0; i<indent; i++) {
|
||||
ZEND_PUTS(" ");
|
||||
ZEND_PUTS_EX(" ");
|
||||
}
|
||||
ZEND_PUTS("[");
|
||||
ZEND_PUTS_EX("[");
|
||||
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
if (is_object) {
|
||||
char *prop_name, *class_name;
|
||||
|
||||
zend_unmangle_property_name_ex(string_key, str_len, &class_name, &prop_name);
|
||||
ZEND_PUTS(prop_name);
|
||||
zend_unmangle_property_name(string_key, str_len-1, &class_name, &prop_name);
|
||||
ZEND_PUTS_EX(prop_name);
|
||||
if (class_name) {
|
||||
if (class_name[0]=='*') {
|
||||
ZEND_PUTS(":protected");
|
||||
ZEND_PUTS_EX(":protected");
|
||||
} else {
|
||||
ZEND_PUTS(":private");
|
||||
ZEND_PUTS_EX(":private");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZEND_WRITE(string_key, str_len-1);
|
||||
ZEND_WRITE_EX(string_key, str_len-1);
|
||||
}
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
zend_printf("%ld", num_key);
|
||||
{
|
||||
char key[25];
|
||||
sprintf(key, "%ld", num_key);
|
||||
ZEND_PUTS_EX(key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
ZEND_PUTS("] => ");
|
||||
zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
|
||||
ZEND_PUTS("\n");
|
||||
ZEND_PUTS_EX("] => ");
|
||||
zend_print_zval_r_ex(zend_write, *tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
|
||||
ZEND_PUTS_EX("\n");
|
||||
zend_hash_move_forward_ex(ht, &iterator);
|
||||
}
|
||||
indent -= PRINT_ZVAL_INDENT;
|
||||
for (i=0; i<indent; i++) {
|
||||
ZEND_PUTS(" ");
|
||||
ZEND_PUTS_EX(" ");
|
||||
}
|
||||
ZEND_PUTS(")\n");
|
||||
ZEND_PUTS_EX(")\n");
|
||||
}
|
||||
|
||||
static void print_flat_hash(HashTable *ht TSRMLS_DC)
|
||||
@@ -221,46 +224,36 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
case IS_OBJECT:
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
#if 0
|
||||
/* Standard PHP objects */
|
||||
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HT_P(expr)->cast_object) {
|
||||
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
|
||||
}
|
||||
#endif
|
||||
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
|
||||
if(Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if(Z_OBJ_HANDLER_P(expr, get)) {
|
||||
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
|
||||
|
||||
z->refcount++;
|
||||
if(Z_TYPE_P(z) != IS_OBJECT) {
|
||||
zend_make_printable_zval(z, expr_copy, use_copy);
|
||||
if (*use_copy) {
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
ZVAL_ZVAL(expr_copy, z, 0, 1);
|
||||
*use_copy = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
zval_ptr_dtor(&z);
|
||||
}
|
||||
}
|
||||
if (EG(exception)) {
|
||||
zval_dtor(expr_copy);
|
||||
expr_copy->value.str.len = 0;
|
||||
expr_copy->value.str.val = STR_EMPTY_ALLOC();
|
||||
if(Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
/* Standard PHP objects */
|
||||
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) {
|
||||
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
|
||||
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
|
||||
|
||||
z->refcount++;
|
||||
if(Z_TYPE_P(z) != IS_OBJECT) {
|
||||
zend_make_printable_zval(z, expr_copy, use_copy);
|
||||
if (*use_copy) {
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
ZVAL_ZVAL(expr_copy, z, 0, 1);
|
||||
*use_copy = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
zval_ptr_dtor(&z);
|
||||
}
|
||||
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
|
||||
expr_copy->value.str.len = 0;
|
||||
expr_copy->value.str.val = STR_EMPTY_ALLOC();
|
||||
}
|
||||
expr_copy->value.str.val = (char *) emalloc(sizeof("Object id #")-1 + MAX_LENGTH_OF_LONG);
|
||||
expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Object id #%ld", (long)expr->value.obj.handle);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
*expr_copy = *expr;
|
||||
@@ -364,13 +357,13 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
|
||||
{
|
||||
switch (expr->type) {
|
||||
case IS_ARRAY:
|
||||
ZEND_PUTS("Array\n");
|
||||
ZEND_PUTS_EX("Array\n");
|
||||
if (++expr->value.ht->nApplyCount>1) {
|
||||
ZEND_PUTS(" *RECURSION*");
|
||||
ZEND_PUTS_EX(" *RECURSION*");
|
||||
expr->value.ht->nApplyCount--;
|
||||
return;
|
||||
}
|
||||
print_hash(expr->value.ht, indent, 0 TSRMLS_CC);
|
||||
print_hash(write_func, expr->value.ht, indent, 0 TSRMLS_CC);
|
||||
expr->value.ht->nApplyCount--;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
@@ -382,7 +375,12 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
|
||||
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
|
||||
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
|
||||
}
|
||||
zend_printf("%s Object\n", class_name?class_name:"Unknown Class");
|
||||
if (class_name) {
|
||||
ZEND_PUTS_EX(class_name);
|
||||
} else {
|
||||
ZEND_PUTS_EX("Unknown Class");
|
||||
}
|
||||
ZEND_PUTS_EX(" Object\n");
|
||||
if (class_name) {
|
||||
efree(class_name);
|
||||
}
|
||||
@@ -391,17 +389,17 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
|
||||
}
|
||||
if (properties) {
|
||||
if (++properties->nApplyCount>1) {
|
||||
ZEND_PUTS(" *RECURSION*");
|
||||
ZEND_PUTS_EX(" *RECURSION*");
|
||||
properties->nApplyCount--;
|
||||
return;
|
||||
}
|
||||
print_hash(properties, indent, 1 TSRMLS_CC);
|
||||
print_hash(write_func, properties, indent, 1 TSRMLS_CC);
|
||||
properties->nApplyCount--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
zend_print_variable(expr);
|
||||
zend_print_zval_ex(write_func, expr, indent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -504,6 +502,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
|
||||
EG(in_autoload) = NULL;
|
||||
EG(current_execute_data) = NULL;
|
||||
EG(current_module) = NULL;
|
||||
EG(exit_status) = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -525,19 +524,8 @@ static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
|
||||
zend_copy_ini_directives(TSRMLS_C);
|
||||
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
|
||||
}
|
||||
|
||||
static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
{
|
||||
shutdown_memory_manager(0, 1 TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
{
|
||||
start_memory_manager(TSRMLS_C);
|
||||
}
|
||||
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
/* FreeBSD and DragonFly floating point precision fix */
|
||||
#include <floatingpoint.h>
|
||||
@@ -566,19 +554,15 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
#ifdef ZTS
|
||||
zend_compiler_globals *compiler_globals;
|
||||
zend_executor_globals *executor_globals;
|
||||
void ***tsrm_ls;
|
||||
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
|
||||
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
|
||||
#else
|
||||
extern zend_scanner_globals ini_scanner_globals;
|
||||
extern zend_scanner_globals language_scanner_globals;
|
||||
#endif
|
||||
TSRMLS_FETCH();
|
||||
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
|
||||
#else
|
||||
alloc_globals_ctor(&alloc_globals TSRMLS_CC);
|
||||
#endif
|
||||
start_memory_manager(TSRMLS_C);
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
/* FreeBSD and DragonFly floating point precision fix */
|
||||
@@ -606,6 +590,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_getenv = utility_functions->getenv_function;
|
||||
|
||||
zend_compile_file = compile_file;
|
||||
zend_compile_string = compile_string;
|
||||
zend_execute = execute;
|
||||
zend_execute_internal = NULL;
|
||||
zend_throw_exception_hook = NULL;
|
||||
@@ -771,14 +756,14 @@ ZEND_API void _zend_bailout(char *filename, uint lineno)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (!EG(bailout_set)) {
|
||||
if (!EG(bailout)) {
|
||||
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
|
||||
exit(-1);
|
||||
}
|
||||
CG(unclean_shutdown) = 1;
|
||||
CG(in_compilation) = EG(in_execution) = 0;
|
||||
EG(current_execute_data) = NULL;
|
||||
longjmp(EG(bailout), FAILURE);
|
||||
longjmp(*EG(bailout), FAILURE);
|
||||
}
|
||||
END_EXTERN_C()
|
||||
|
||||
@@ -930,6 +915,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
case E_USER_ERROR:
|
||||
case E_USER_WARNING:
|
||||
case E_USER_NOTICE:
|
||||
case E_RECOVERABLE_ERROR:
|
||||
if (zend_is_compiling(TSRMLS_C)) {
|
||||
error_filename = zend_get_compiled_filename(TSRMLS_C);
|
||||
error_lineno = zend_get_compiled_lineno(TSRMLS_C);
|
||||
@@ -1098,7 +1084,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
|
||||
if (!file_handle) {
|
||||
continue;
|
||||
}
|
||||
EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE TSRMLS_CC);
|
||||
EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
|
||||
if(file_handle->opened_path) {
|
||||
int dummy=1;
|
||||
zend_hash_add(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
|
||||
|
||||
+18
-17
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "2.1.0"
|
||||
#define ZEND_VERSION "2.2.0"
|
||||
|
||||
#define ZEND_ENGINE_2
|
||||
|
||||
@@ -258,7 +258,6 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
|
||||
# define zend_error_noreturn zend_error
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* zval
|
||||
*/
|
||||
@@ -320,7 +319,7 @@ struct _zend_class_entry {
|
||||
char type;
|
||||
char *name;
|
||||
zend_uint name_length;
|
||||
struct _zend_class_entry *parent;
|
||||
struct _zend_class_entry *parent;
|
||||
int refcount;
|
||||
zend_bool constants_updated;
|
||||
zend_uint ce_flags;
|
||||
@@ -341,6 +340,7 @@ struct _zend_class_entry {
|
||||
union _zend_function *__unset;
|
||||
union _zend_function *__isset;
|
||||
union _zend_function *__call;
|
||||
union _zend_function *__tostring;
|
||||
union _zend_function *serialize_func;
|
||||
union _zend_function *unserialize_func;
|
||||
|
||||
@@ -348,7 +348,7 @@ struct _zend_class_entry {
|
||||
|
||||
/* handlers */
|
||||
zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
|
||||
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object TSRMLS_DC);
|
||||
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
|
||||
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
|
||||
|
||||
/* serializer callbacks */
|
||||
@@ -363,7 +363,7 @@ struct _zend_class_entry {
|
||||
zend_uint line_end;
|
||||
char *doc_comment;
|
||||
zend_uint doc_comment_len;
|
||||
|
||||
|
||||
struct _zend_module_entry *module;
|
||||
};
|
||||
|
||||
@@ -384,7 +384,7 @@ typedef struct _zend_utility_functions {
|
||||
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
|
||||
} zend_utility_functions;
|
||||
|
||||
|
||||
|
||||
typedef struct _zend_utility_values {
|
||||
char *import_use_extension;
|
||||
uint import_use_extension_length;
|
||||
@@ -430,7 +430,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define OE_IS_OBJECT (1<<1)
|
||||
#define OE_IS_METHOD (1<<2)
|
||||
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
|
||||
void zend_shutdown(TSRMLS_D);
|
||||
void zend_register_standard_ini_entries(TSRMLS_D);
|
||||
@@ -449,19 +448,19 @@ END_EXTERN_C()
|
||||
|
||||
#define zend_try \
|
||||
{ \
|
||||
jmp_buf orig_bailout; \
|
||||
zend_bool orig_bailout_set=EG(bailout_set); \
|
||||
jmp_buf *orig_bailout = EG(bailout); \
|
||||
jmp_buf bailout; \
|
||||
\
|
||||
EG(bailout_set) = 1; \
|
||||
memcpy(&orig_bailout, &EG(bailout), sizeof(jmp_buf)); \
|
||||
if (setjmp(EG(bailout))==0)
|
||||
EG(bailout) = &bailout; \
|
||||
if (setjmp(bailout)==0) {
|
||||
#define zend_catch \
|
||||
else
|
||||
} else { \
|
||||
EG(bailout) = orig_bailout;
|
||||
#define zend_end_try() \
|
||||
memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); \
|
||||
EG(bailout_set) = orig_bailout_set; \
|
||||
} \
|
||||
EG(bailout) = orig_bailout; \
|
||||
}
|
||||
#define zend_first_try EG(bailout_set)=0; zend_try
|
||||
#define zend_first_try EG(bailout)=NULL; zend_try
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API char *get_zend_version(void);
|
||||
@@ -503,7 +502,9 @@ END_EXTERN_C()
|
||||
|
||||
/* output support */
|
||||
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
|
||||
#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
|
||||
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
|
||||
#define ZEND_PUTS_EX(str) write_func((str), strlen((str)))
|
||||
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
|
||||
|
||||
|
||||
@@ -562,7 +563,7 @@ END_EXTERN_C()
|
||||
|
||||
#define INIT_PZVAL(z) \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0;
|
||||
(z)->is_ref = 0;
|
||||
|
||||
#define INIT_ZVAL(z) z = zval_used_for_init;
|
||||
|
||||
|
||||
+333
-154
File diff suppressed because it is too large.
Load diff
+72
-39
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "zend_modules.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute.h"
|
||||
@@ -42,9 +41,10 @@ typedef struct _zend_function_entry {
|
||||
} zend_function_entry;
|
||||
|
||||
#define ZEND_FN(name) zif_##name
|
||||
#define ZEND_MN(name) zim_##name
|
||||
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
|
||||
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
|
||||
#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_FN(classname##_##name))
|
||||
#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name))
|
||||
|
||||
#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
|
||||
|
||||
@@ -53,11 +53,12 @@ typedef struct _zend_function_entry {
|
||||
#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
|
||||
#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags)
|
||||
#define ZEND_NAMED_ME(zend_name, name, arg_info, flags) ZEND_FENTRY(zend_name, name, arg_info, flags)
|
||||
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)
|
||||
#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
|
||||
#define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
|
||||
ZEND_FENTRY(name, ZEND_FN(classname##_##alias), arg_info, flags)
|
||||
#define ZEND_ME_MAPPING(name, func_name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types)
|
||||
ZEND_FENTRY(name, ZEND_MN(classname##_##alias), arg_info, flags)
|
||||
#define ZEND_ME_MAPPING(name, func_name, arg_types, flags) ZEND_NAMED_ME(name, ZEND_FN(func_name), arg_types, flags)
|
||||
|
||||
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
@@ -77,6 +78,8 @@ typedef struct _zend_function_entry {
|
||||
#define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module
|
||||
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module) zm_post_zend_deactivate_##module
|
||||
#define ZEND_MODULE_INFO_N(module) zm_info_##module
|
||||
#define ZEND_MODULE_GLOBALS_CTOR_N(module) zm_globals_ctor_##module
|
||||
#define ZEND_MODULE_GLOBALS_DTOR_N(module) zm_globals_dtor_##module
|
||||
|
||||
/* Declaration macros */
|
||||
#define ZEND_MODULE_STARTUP_D(module) int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS)
|
||||
@@ -85,6 +88,8 @@ typedef struct _zend_function_entry {
|
||||
#define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
|
||||
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void)
|
||||
#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
|
||||
#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
|
||||
|
||||
#define ZEND_GET_MODULE(name) \
|
||||
BEGIN_EXTERN_C()\
|
||||
@@ -116,8 +121,6 @@ typedef struct _zend_function_entry {
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define INIT_CLASS_ENTRY(class_container, class_name, functions) INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
|
||||
|
||||
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
|
||||
@@ -128,21 +131,26 @@ typedef struct _zend_function_entry {
|
||||
class_container.constructor = NULL; \
|
||||
class_container.destructor = NULL; \
|
||||
class_container.clone = NULL; \
|
||||
class_container.create_object = NULL; \
|
||||
class_container.serialize = NULL; \
|
||||
class_container.unserialize = NULL; \
|
||||
class_container.create_object = NULL; \
|
||||
class_container.interface_gets_implemented = NULL; \
|
||||
class_container.__call = handle_fcall; \
|
||||
class_container.__get = handle_propget; \
|
||||
class_container.__set = handle_propset; \
|
||||
class_container.__unset = handle_propunset; \
|
||||
class_container.__isset = handle_propisset; \
|
||||
class_container.serialize = NULL; \
|
||||
class_container.unserialize = NULL; \
|
||||
class_container.parent = NULL; \
|
||||
class_container.num_interfaces = 0; \
|
||||
class_container.interfaces = NULL; \
|
||||
class_container.get_iterator = NULL; \
|
||||
class_container.iterator_funcs.funcs = NULL; \
|
||||
class_container.module = NULL; \
|
||||
class_container.__call = handle_fcall; \
|
||||
class_container.__tostring = NULL; \
|
||||
class_container.__get = handle_propget; \
|
||||
class_container.__set = handle_propset; \
|
||||
class_container.__unset = handle_propunset; \
|
||||
class_container.__isset = handle_propisset; \
|
||||
class_container.serialize_func = NULL; \
|
||||
class_container.unserialize_func = NULL; \
|
||||
class_container.serialize = NULL; \
|
||||
class_container.unserialize = NULL; \
|
||||
class_container.parent = NULL; \
|
||||
class_container.num_interfaces = 0; \
|
||||
class_container.interfaces = NULL; \
|
||||
class_container.get_iterator = NULL; \
|
||||
class_container.iterator_funcs.funcs = NULL; \
|
||||
class_container.module = NULL; \
|
||||
}
|
||||
|
||||
#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
|
||||
@@ -253,6 +261,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
|
||||
|
||||
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
|
||||
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
|
||||
ZEND_API char *zend_get_type_by_const(int type);
|
||||
|
||||
#define getThis() (this_ptr)
|
||||
|
||||
@@ -347,7 +356,7 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
|
||||
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
|
||||
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
|
||||
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
|
||||
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
|
||||
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
|
||||
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
|
||||
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
|
||||
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
|
||||
@@ -379,6 +388,26 @@ typedef struct _zend_fcall_info_cache {
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API extern zend_fcall_info_cache empty_fcall_info_cache;
|
||||
|
||||
/** Build zend_call_info/cache from a zval*
|
||||
*
|
||||
* Caller is responsible to provide a return value, otherwise the we will crash.
|
||||
* fci->retval_ptr_ptr = NULL;
|
||||
* In order to pass parameters the following members need to be set:
|
||||
* fci->param_count = 0;
|
||||
* fci->params = NULL;
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc TSRMLS_DC);
|
||||
|
||||
/** Set or clear the arguments in the zend_call_info struct taking care of
|
||||
* refcount. If args is NULL and arguments are set then those are cleared.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
|
||||
|
||||
/** Call a function using information created by zend_fcall_info_init()/args().
|
||||
* If args is given then those replace the arguement info in fci is temporarily.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
|
||||
|
||||
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -405,28 +434,28 @@ END_EXTERN_C()
|
||||
#define CHECK_ZVAL_STRING_REL(z)
|
||||
#endif
|
||||
|
||||
#define ZVAL_RESOURCE(z, l) { \
|
||||
(z)->type = IS_RESOURCE; \
|
||||
(z)->value.lval = l; \
|
||||
#define ZVAL_RESOURCE(z, l) { \
|
||||
Z_TYPE_P(z) = IS_RESOURCE; \
|
||||
Z_LVAL_P(z) = l; \
|
||||
}
|
||||
|
||||
#define ZVAL_BOOL(z, b) { \
|
||||
(z)->type = IS_BOOL; \
|
||||
(z)->value.lval = ((b) != 0); \
|
||||
#define ZVAL_BOOL(z, b) { \
|
||||
Z_TYPE_P(z) = IS_BOOL; \
|
||||
Z_LVAL_P(z) = ((b) != 0); \
|
||||
}
|
||||
|
||||
#define ZVAL_NULL(z) { \
|
||||
(z)->type = IS_NULL; \
|
||||
#define ZVAL_NULL(z) { \
|
||||
Z_TYPE_P(z) = IS_NULL; \
|
||||
}
|
||||
|
||||
#define ZVAL_LONG(z, l) { \
|
||||
(z)->type = IS_LONG; \
|
||||
(z)->value.lval = l; \
|
||||
#define ZVAL_LONG(z, l) { \
|
||||
Z_TYPE_P(z) = IS_LONG; \
|
||||
Z_LVAL_P(z) = l; \
|
||||
}
|
||||
|
||||
#define ZVAL_DOUBLE(z, d) { \
|
||||
(z)->type = IS_DOUBLE; \
|
||||
(z)->value.dval = d; \
|
||||
#define ZVAL_DOUBLE(z, d) { \
|
||||
Z_TYPE_P(z) = IS_DOUBLE; \
|
||||
Z_DVAL_P(z) = d; \
|
||||
}
|
||||
|
||||
#define ZVAL_STRING(z, s, duplicate) { \
|
||||
@@ -576,8 +605,8 @@ END_EXTERN_C()
|
||||
zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \
|
||||
}
|
||||
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
|
||||
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
|
||||
#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
|
||||
#define ZVAL_IS_NULL(z) (Z_TYPE_P(z)==IS_NULL)
|
||||
|
||||
/* For compatibility */
|
||||
#define ZEND_MINIT ZEND_MODULE_STARTUP_N
|
||||
@@ -585,15 +614,19 @@ END_EXTERN_C()
|
||||
#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N
|
||||
#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
|
||||
#define ZEND_MINFO ZEND_MODULE_INFO_N
|
||||
#define ZEND_GINIT(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_CTOR_N(module)))
|
||||
#define ZEND_GSHUTDOWN(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_DTOR_N(module)))
|
||||
|
||||
#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D
|
||||
#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D
|
||||
#define ZEND_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D
|
||||
#define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D
|
||||
#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D
|
||||
#define ZEND_GINIT_FUNCTION ZEND_MODULE_GLOBALS_CTOR_D
|
||||
#define ZEND_GSHUTDOWN_FUNCTION ZEND_MODULE_GLOBALS_DTOR_D
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
#endif /* ZEND_API_H */
|
||||
|
||||
|
||||
|
||||
+1608
-582
File diff suppressed because it is too large.
Load diff
+113
-104
@@ -25,52 +25,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../TSRM/TSRM.h"
|
||||
#include "zend_globals_macros.h"
|
||||
#include "zend.h"
|
||||
|
||||
#include "zend_mm.h"
|
||||
|
||||
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
|
||||
#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
|
||||
|
||||
typedef struct _zend_mem_header {
|
||||
#if ZEND_DEBUG
|
||||
long magic;
|
||||
typedef struct _zend_leak_info {
|
||||
void *addr;
|
||||
size_t size;
|
||||
char *filename;
|
||||
uint lineno;
|
||||
int reported;
|
||||
char *orig_filename;
|
||||
uint orig_lineno;
|
||||
# ifdef ZTS
|
||||
THREAD_T thread_id;
|
||||
# endif
|
||||
#endif
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
struct _zend_mem_header *pNext;
|
||||
struct _zend_mem_header *pLast;
|
||||
#endif
|
||||
unsigned int size;
|
||||
} zend_mem_header;
|
||||
|
||||
typedef union _align_test {
|
||||
void *ptr;
|
||||
double dbl;
|
||||
long lng;
|
||||
} align_test;
|
||||
|
||||
#define MAX_CACHED_MEMORY 11
|
||||
#define MAX_CACHED_ENTRIES 256
|
||||
#define PRE_INIT_CACHE_ENTRIES 32
|
||||
|
||||
#if ZEND_GCC_VERSION >= 2000
|
||||
# define PLATFORM_ALIGNMENT (__alignof__ (align_test))
|
||||
#else
|
||||
# define PLATFORM_ALIGNMENT (sizeof(align_test))
|
||||
#endif
|
||||
|
||||
#define MEM_HEADER_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
|
||||
|
||||
} zend_leak_info;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
@@ -84,28 +48,29 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
|
||||
#if USE_ZEND_ALLOC
|
||||
ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
/* Standard wrapper macros */
|
||||
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
|
||||
/* Relay wrapper macros */
|
||||
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
|
||||
/* Selective persistent/non persistent allocation macros */
|
||||
#define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size))
|
||||
@@ -123,51 +88,6 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
|
||||
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
|
||||
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
|
||||
|
||||
#else
|
||||
|
||||
#undef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#undef _GNU_SOURCE
|
||||
|
||||
/* Standard wrapper macros */
|
||||
#define emalloc(size) malloc(size)
|
||||
#define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
|
||||
#define efree(ptr) free(ptr)
|
||||
#define ecalloc(nmemb, size) calloc((nmemb), (size))
|
||||
#define erealloc(ptr, size) realloc((ptr), (size))
|
||||
#define erealloc_recoverable(ptr, size) realloc((ptr), (size))
|
||||
#define estrdup(s) strdup(s)
|
||||
#define estrndup(s, length) zend_strndup((s), (length))
|
||||
|
||||
/* Relay wrapper macros */
|
||||
#define emalloc_rel(size) malloc(size)
|
||||
#define safe_emalloc_rel(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
|
||||
#define efree_rel(ptr) free(ptr)
|
||||
#define ecalloc_rel(nmemb, size) calloc((nmemb), (size))
|
||||
#define erealloc_rel(ptr, size) realloc((ptr), (size))
|
||||
#define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size))
|
||||
#define estrdup_rel(s) strdup(s)
|
||||
#define estrndup_rel(s, length) zend_strndup((s), (length))
|
||||
|
||||
/* Selective persistent/non persistent allocation macros */
|
||||
#define pemalloc(size, persistent) malloc(size)
|
||||
#define safe_pemalloc(nmemb, size, offset, persistent) malloc((nmemb) * (size) + (offset))
|
||||
#define pefree(ptr, persistent) free(ptr)
|
||||
#define pecalloc(nmemb, size, persistent) calloc((nmemb), (size))
|
||||
#define perealloc(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define perealloc_recoverable(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define pestrdup(s, persistent) strdup(s)
|
||||
|
||||
#define pemalloc_rel(size, persistent) malloc(size)
|
||||
#define pefree_rel(ptr, persistent) free(ptr)
|
||||
#define pecalloc_rel(nmemb, size, persistent) calloc((nmemb), (size))
|
||||
#define perealloc_rel(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define pestrdup_rel(s, persistent) strdup(s)
|
||||
|
||||
#endif /* !USE_ZEND_ALLOC */
|
||||
|
||||
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
|
||||
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
|
||||
|
||||
@@ -187,8 +107,97 @@ void zend_debug_alloc_output(char *format, ...);
|
||||
#define full_mem_check(silent)
|
||||
#endif
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
ZEND_API size_t zend_memory_usage(TSRMLS_D);
|
||||
ZEND_API size_t zend_memory_peak_usage(TSRMLS_D);
|
||||
#endif
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
/* Macroses for zend_fast_cache.h compatibility */
|
||||
|
||||
#define ZEND_FAST_ALLOC(p, type, fc_type) \
|
||||
(p) = (type *) emalloc(sizeof(type))
|
||||
|
||||
#define ZEND_FAST_FREE(p, fc_type) \
|
||||
efree(p)
|
||||
|
||||
#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
|
||||
(p) = (type *) emalloc_rel(sizeof(type))
|
||||
|
||||
#define ZEND_FAST_FREE_REL(p, fc_type) \
|
||||
efree_rel(p)
|
||||
|
||||
/* fast cache for zval's */
|
||||
#define ALLOC_ZVAL(z) \
|
||||
ZEND_FAST_ALLOC(z, zval, ZVAL_CACHE_LIST)
|
||||
|
||||
#define FREE_ZVAL(z) \
|
||||
ZEND_FAST_FREE(z, ZVAL_CACHE_LIST)
|
||||
|
||||
#define ALLOC_ZVAL_REL(z) \
|
||||
ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST)
|
||||
|
||||
#define FREE_ZVAL_REL(z) \
|
||||
ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST)
|
||||
|
||||
/* fast cache for HashTables */
|
||||
#define ALLOC_HASHTABLE(ht) \
|
||||
ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define FREE_HASHTABLE(ht) \
|
||||
ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define ALLOC_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define FREE_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
/* Heap functions */
|
||||
typedef struct _zend_mm_heap zend_mm_heap;
|
||||
|
||||
ZEND_API zend_mm_heap *zend_mm_startup(void);
|
||||
ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent);
|
||||
ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
#define zend_mm_alloc(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define zend_mm_free(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define zend_mm_realloc(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define zend_mm_block_size(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
|
||||
#define zend_mm_alloc_rel(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define zend_mm_free_rel(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define zend_mm_realloc_rel(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define zend_mm_block_size_rel(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
|
||||
/* Heaps with user defined storage */
|
||||
typedef struct _zend_mm_storage zend_mm_storage;
|
||||
|
||||
typedef struct _zend_mm_segment {
|
||||
size_t size;
|
||||
struct _zend_mm_segment *next_segment;
|
||||
} zend_mm_segment;
|
||||
|
||||
typedef struct _zend_mm_mem_handlers {
|
||||
const char *name;
|
||||
zend_mm_storage* (*init)(void *params);
|
||||
void (*dtor)(zend_mm_storage *storage);
|
||||
zend_mm_segment* (*_alloc)(zend_mm_storage *storage, size_t size);
|
||||
zend_mm_segment* (*_realloc)(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size);
|
||||
void (*_free)(zend_mm_storage *storage, zend_mm_segment *ptr);
|
||||
} zend_mm_mem_handlers;
|
||||
|
||||
struct _zend_mm_storage {
|
||||
const zend_mm_mem_handlers *handlers;
|
||||
};
|
||||
|
||||
ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, void *params);
|
||||
ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -50,4 +50,3 @@ ZEND_END_ARG_INFO();
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
|
||||
ZEND_END_ARG_INFO();
|
||||
|
||||
@@ -276,7 +276,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
ZEND_NAMED_FUNCTION(zend_if_strlen)
|
||||
{
|
||||
zval **str;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
@@ -374,7 +374,7 @@ ZEND_FUNCTION(each)
|
||||
ulong num_key;
|
||||
zval **inserted_pointer;
|
||||
HashTable *target_hash;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
@@ -452,10 +452,10 @@ ZEND_FUNCTION(error_reporting)
|
||||
Define a new constant */
|
||||
ZEND_FUNCTION(define)
|
||||
{
|
||||
zval **var, **val, **non_cs;
|
||||
zval **var, **val, **non_cs, *val_free = NULL;
|
||||
int case_sensitive;
|
||||
zend_constant c;
|
||||
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 2:
|
||||
if (zend_get_parameters_ex(2, &var, &val)==FAILURE) {
|
||||
@@ -468,7 +468,7 @@ ZEND_FUNCTION(define)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(non_cs);
|
||||
if ((*non_cs)->value.lval) {
|
||||
if (Z_LVAL_PP(non_cs)) {
|
||||
case_sensitive = 0;
|
||||
} else {
|
||||
case_sensitive = CONST_CS;
|
||||
@@ -479,7 +479,8 @@ ZEND_FUNCTION(define)
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((*val)->type) {
|
||||
repeat:
|
||||
switch (Z_TYPE_PP(val)) {
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
case IS_STRING:
|
||||
@@ -487,15 +488,34 @@ ZEND_FUNCTION(define)
|
||||
case IS_RESOURCE:
|
||||
case IS_NULL:
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (!val_free) {
|
||||
if (Z_OBJ_HT_PP(val)->get) {
|
||||
val_free = *val = Z_OBJ_HT_PP(val)->get(*val TSRMLS_CC);
|
||||
goto repeat;
|
||||
} else if (Z_OBJ_HT_PP(val)->cast_object) {
|
||||
ALLOC_INIT_ZVAL(val_free);
|
||||
if (Z_OBJ_HT_PP(val)->cast_object(*val, val_free, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
val = &val_free;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* no break */
|
||||
default:
|
||||
zend_error(E_WARNING,"Constants may only evaluate to scalar values");
|
||||
if (val_free) {
|
||||
zval_ptr_dtor(&val_free);
|
||||
}
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
convert_to_string_ex(var);
|
||||
|
||||
c.value = **val;
|
||||
zval_copy_ctor(&c.value);
|
||||
if (val_free) {
|
||||
zval_ptr_dtor(&val_free);
|
||||
}
|
||||
c.flags = case_sensitive; /* non persistent */
|
||||
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
|
||||
c.name_len = (*var)->value.str.len+1;
|
||||
@@ -515,7 +535,7 @@ ZEND_FUNCTION(defined)
|
||||
{
|
||||
zval **var;
|
||||
zval c;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
@@ -539,12 +559,13 @@ ZEND_FUNCTION(get_class)
|
||||
char *name = "";
|
||||
zend_uint name_len = 0;
|
||||
int dup;
|
||||
|
||||
|
||||
if (!ZEND_NUM_ARGS()) {
|
||||
if (EG(scope)) {
|
||||
RETURN_STRINGL(EG(scope)->name, EG(scope)->name_length, 1);
|
||||
} else {
|
||||
zend_error(E_ERROR, "get_class() called without object from outside a class");
|
||||
zend_error(E_WARNING, "get_class() called without object from outside a class");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
@@ -623,13 +644,13 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
zend_error(E_WARNING, "Unknown class passed as parameter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
instance_ce = *the_ce;
|
||||
instance_ce = *the_ce;
|
||||
} else if (Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
instance_ce = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* TBI!! new object handlers */
|
||||
if (Z_TYPE_PP(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(**obj)) {
|
||||
RETURN_FALSE;
|
||||
@@ -702,7 +723,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
|
||||
|
||||
zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos);
|
||||
zend_hash_move_forward_ex(properties, &pos);
|
||||
zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
|
||||
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
|
||||
if (class_name) {
|
||||
if (class_name[0] != '*' && strcmp(class_name, ce->name)) {
|
||||
/* filter privates from base classes */
|
||||
@@ -724,7 +745,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
|
||||
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
|
||||
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
add_assoc_zval(return_value, prop_name, prop_copy);
|
||||
}
|
||||
}
|
||||
@@ -773,7 +794,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
if (Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (Z_OBJ_HT_PP(obj)->get_properties == NULL) {
|
||||
@@ -799,7 +820,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
(*value)->refcount++;
|
||||
add_assoc_zval_ex(return_value, key, key_len, *value);
|
||||
} else if (instanceof) {
|
||||
zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
|
||||
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
|
||||
if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) {
|
||||
/* Not separating references */
|
||||
(*value)->refcount++;
|
||||
@@ -870,7 +891,7 @@ ZEND_FUNCTION(method_exists)
|
||||
zval **klass, **method_name;
|
||||
char *lcname;
|
||||
zend_class_entry * ce, **pce;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
@@ -948,7 +969,7 @@ ZEND_FUNCTION(property_exists)
|
||||
if (property_info->flags & ZEND_ACC_PUBLIC) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
zend_unmangle_property_name_ex(property_info->name, property_info->name_length, &class_name, &prop_name);
|
||||
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
|
||||
if (!strncmp(class_name, "*", 1)) {
|
||||
if (instanceof_function(EG(scope), ce TSRMLS_CC)) {
|
||||
RETURN_TRUE;
|
||||
@@ -961,8 +982,7 @@ ZEND_FUNCTION(property_exists)
|
||||
RETURN_FALSE; /* shouldn't happen */
|
||||
}
|
||||
RETURN_BOOL(EG(scope) == ce);
|
||||
RETURN_FALSE;
|
||||
|
||||
|
||||
case IS_OBJECT:
|
||||
if (Z_OBJ_HANDLER_PP(object, has_property) && Z_OBJ_HANDLER_PP(object, has_property)(*object, *property, 2 TSRMLS_CC)) {
|
||||
RETURN_TRUE;
|
||||
@@ -1086,7 +1106,7 @@ ZEND_FUNCTION(leak)
|
||||
leakbytes = (*leak)->value.lval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
emalloc(leakbytes);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1170,7 +1190,7 @@ ZEND_FUNCTION(set_error_handler)
|
||||
zend_bool had_orig_error_handler=0;
|
||||
char *error_handler_name = NULL;
|
||||
long error_type = E_ALL | E_STRICT;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@@ -1333,7 +1353,7 @@ ZEND_FUNCTION(get_declared_interfaces)
|
||||
{
|
||||
zend_uint mask = ZEND_ACC_INTERFACE;
|
||||
zend_uint comply = 1;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
@@ -1358,7 +1378,7 @@ static int copy_function_name(zend_function *func, int num_args, va_list args, z
|
||||
} else if (func->type == ZEND_USER_FUNCTION) {
|
||||
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1369,26 +1389,26 @@ ZEND_FUNCTION(get_defined_functions)
|
||||
{
|
||||
zval *internal;
|
||||
zval *user;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
|
||||
MAKE_STD_ZVAL(internal);
|
||||
MAKE_STD_ZVAL(user);
|
||||
|
||||
|
||||
array_init(internal);
|
||||
array_init(user);
|
||||
array_init(return_value);
|
||||
|
||||
|
||||
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user);
|
||||
|
||||
if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
|
||||
|
||||
if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
|
||||
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
|
||||
|
||||
if (zend_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
|
||||
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1399,12 +1419,12 @@ ZEND_FUNCTION(get_defined_functions)
|
||||
/* {{{ proto array get_defined_vars(void)
|
||||
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
|
||||
ZEND_FUNCTION(get_defined_vars)
|
||||
{
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
zend_hash_copy(return_value->value.ht, EG(active_symbol_table),
|
||||
|
||||
zend_hash_copy(Z_ARRVAL_P(return_value), EG(active_symbol_table),
|
||||
(copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1568,7 +1588,7 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
|
||||
modules = ecalloc(zend_hash_num_elements(&module_registry) + 2, sizeof(zval *));
|
||||
module_names = emalloc((zend_hash_num_elements(&module_registry) + 2) * sizeof(char *));
|
||||
|
||||
|
||||
module_names[0] = "internal";
|
||||
zend_hash_internal_pointer_reset_ex(&module_registry, &pos);
|
||||
while (zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) != FAILURE) {
|
||||
@@ -1620,7 +1640,7 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
|
||||
zval *arg_array, **arg;
|
||||
int arg_count = (ulong) *p;
|
||||
|
||||
*curpos -= (arg_count+2);
|
||||
*curpos -= (arg_count+2);
|
||||
|
||||
MAKE_STD_ZVAL(arg_array);
|
||||
array_init(arg_array);
|
||||
@@ -1628,9 +1648,13 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
|
||||
|
||||
while (--arg_count >= 0) {
|
||||
arg = (zval **) p++;
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
|
||||
(*arg)->refcount++;
|
||||
add_next_index_zval(arg_array, *arg);
|
||||
if (*arg) {
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
|
||||
(*arg)->refcount++;
|
||||
add_next_index_zval(arg_array, *arg);
|
||||
} else {
|
||||
add_next_index_null(arg_array);
|
||||
}
|
||||
}
|
||||
|
||||
/* skip args from incomplete frames */
|
||||
@@ -1717,7 +1741,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
arg_array = NULL;
|
||||
|
||||
skip = ptr;
|
||||
/* skip internal handler */
|
||||
/* skip internal handler */
|
||||
if (!skip->op_array &&
|
||||
skip->prev_execute_data &&
|
||||
skip->prev_execute_data->opline &&
|
||||
@@ -1744,7 +1768,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
} else {
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
|
||||
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
|
||||
if(!dup) {
|
||||
free_class_name = class_name;
|
||||
@@ -1764,7 +1788,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
arg_array = debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC);
|
||||
frames_on_stack--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
|
||||
zend_bool build_filename_arg = 1;
|
||||
@@ -1774,7 +1798,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
function_name = "unknown";
|
||||
build_filename_arg = 0;
|
||||
} else
|
||||
switch (ptr->opline->op2.u.constant.value.lval) {
|
||||
switch (Z_LVAL(ptr->opline->op2.u.constant)) {
|
||||
case ZEND_EVAL:
|
||||
function_name = "eval";
|
||||
build_filename_arg = 0;
|
||||
@@ -1927,7 +1951,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
} else {
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
|
||||
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
|
||||
|
||||
@@ -1948,7 +1972,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC));
|
||||
frames_on_stack--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
|
||||
zend_bool build_filename_arg = 1;
|
||||
@@ -1988,7 +2012,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
|
||||
MAKE_STD_ZVAL(arg_array);
|
||||
array_init(arg_array);
|
||||
|
||||
|
||||
/* include_filename always points to the last filename of the last last called-fuction.
|
||||
if we have called include in the frame above - this is the file we have included.
|
||||
*/
|
||||
@@ -2017,7 +2041,7 @@ ZEND_FUNCTION(debug_backtrace)
|
||||
if (ZEND_NUM_ARGS()) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
|
||||
zend_fetch_debug_backtrace(return_value, 1, 1 TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2066,7 +2090,7 @@ ZEND_FUNCTION(get_extension_funcs)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
efree(lcname);
|
||||
|
||||
|
||||
if (!(func = module->functions)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+197
-144
@@ -25,13 +25,13 @@
|
||||
#include "zend_constants.h"
|
||||
#include "zend_llist.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
#ifdef ZEND_MULTIBYTE
|
||||
#include "zend_multibyte.h"
|
||||
#endif /* ZEND_MULTIBYTE */
|
||||
|
||||
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
|
||||
ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -104,7 +104,7 @@ int zend_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC)
|
||||
}
|
||||
|
||||
|
||||
int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
|
||||
ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
|
||||
{
|
||||
zend_auto_global *auto_global;
|
||||
|
||||
@@ -118,8 +118,8 @@ int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_
|
||||
|
||||
static void init_compiler_declarables(TSRMLS_D)
|
||||
{
|
||||
CG(declarables).ticks.type = IS_LONG;
|
||||
CG(declarables).ticks.value.lval = 0;
|
||||
Z_TYPE(CG(declarables).ticks) = IS_LONG;
|
||||
Z_LVAL(CG(declarables).ticks) = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ void zend_init_compiler_data_structures(TSRMLS_D)
|
||||
|
||||
void init_compiler(TSRMLS_D)
|
||||
{
|
||||
CG(active_op_array) = NULL;
|
||||
zend_init_compiler_data_structures(TSRMLS_C);
|
||||
zend_init_rsrc_list(TSRMLS_C);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
|
||||
@@ -244,7 +245,7 @@ static int lookup_cv(zend_op_array *op_array, char* name, int name_len)
|
||||
i = op_array->last_var;
|
||||
op_array->last_var++;
|
||||
if (op_array->last_var > op_array->size_var) {
|
||||
op_array->size_var += 16; /* FIXME */
|
||||
op_array->size_var += 16; /* FIXME */
|
||||
op_array->vars = erealloc(op_array->vars, op_array->size_var*sizeof(zend_compiled_variable));
|
||||
}
|
||||
op_array->vars[i].name = name; /* estrndup(name, name_len); */
|
||||
@@ -296,7 +297,7 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *o
|
||||
|
||||
if (last_op_number > 0) {
|
||||
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
|
||||
|
||||
|
||||
switch (last_op->opcode) {
|
||||
case ZEND_FETCH_OBJ_RW:
|
||||
last_op->opcode = op;
|
||||
@@ -499,7 +500,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
|
||||
char *method_type;
|
||||
|
||||
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
modifiers->u.constant.value.lval |= ZEND_ACC_ABSTRACT;
|
||||
Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
|
||||
method_type = "Interface";
|
||||
} else {
|
||||
method_type = "Abstract";
|
||||
@@ -509,7 +510,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
|
||||
if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
|
||||
zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
|
||||
}
|
||||
if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
|
||||
if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_RAISE_ABSTRACT_ERROR;
|
||||
@@ -548,8 +549,8 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
|
||||
|
||||
while (last_op_number - n > 0) {
|
||||
zend_op *last_op;
|
||||
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number-(n+1)];
|
||||
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
|
||||
|
||||
if (last_op->result.op_type == IS_VAR &&
|
||||
last_op->result.u.var == variable->u.var) {
|
||||
@@ -622,7 +623,7 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
|
||||
|
||||
opline->opcode = ZEND_ASSIGN_REF;
|
||||
if (zend_is_function_or_method_call(rvar)) {
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
@@ -684,7 +685,7 @@ void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
|
||||
opline->op1.u.opline_num = while_token->u.opline_num;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
|
||||
/* update while's conditional jmp */
|
||||
CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
@@ -823,7 +824,7 @@ void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char init
|
||||
}
|
||||
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
|
||||
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
|
||||
|
||||
|
||||
CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -877,7 +878,7 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
|
||||
le = fetch_list_ptr->head;
|
||||
|
||||
/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */
|
||||
|
||||
|
||||
if (le) {
|
||||
opline_ptr = (zend_op *)le->data;
|
||||
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
|
||||
@@ -978,7 +979,7 @@ void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC)
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
if (op1->u.constant.value.str.len>0) {
|
||||
if (Z_STRLEN(op1->u.constant)>0) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_ADD_STRING;
|
||||
opline->result = *result;
|
||||
@@ -1039,21 +1040,21 @@ void zend_do_free(znode *op1 TSRMLS_DC)
|
||||
}
|
||||
} else if (op1->op_type == IS_CONST) {
|
||||
zval_dtor(&op1->u.constant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier)
|
||||
{
|
||||
if ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK)
|
||||
&& (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK)
|
||||
&& ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) != (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK))) {
|
||||
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK)
|
||||
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)
|
||||
&& ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) != (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK))) {
|
||||
zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
|
||||
}
|
||||
if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
|
||||
if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
|
||||
}
|
||||
return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval);
|
||||
return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant));
|
||||
}
|
||||
|
||||
|
||||
@@ -1068,15 +1069,18 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
|
||||
if (is_method) {
|
||||
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
if ((fn_flags_znode->u.constant.value.lval & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
|
||||
if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
|
||||
}
|
||||
fn_flags_znode->u.constant.value.lval |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
|
||||
Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
|
||||
}
|
||||
fn_flags = fn_flags_znode->u.constant.value.lval; /* must be done *after* the above check */
|
||||
fn_flags = Z_LVAL(fn_flags_znode->u.constant); /* must be done *after* the above check */
|
||||
} else {
|
||||
fn_flags = 0;
|
||||
}
|
||||
if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT) && !(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error(E_COMPILE_ERROR, "Static function %s%s%s() cannot be abstract", is_method ? CG(active_class_entry)->name : "", is_method ? "::" : "", Z_STRVAL(function_name->u.constant));
|
||||
}
|
||||
|
||||
function_token->u.op_array = CG(active_op_array);
|
||||
lcname = zend_str_tolower_dup(name, name_len);
|
||||
@@ -1148,6 +1152,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
CG(active_class_entry)->__unset = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__isset = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__tostring = (zend_function *) CG(active_op_array);
|
||||
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
@@ -1178,11 +1184,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
/* Push a seperator to the switch and foreach stacks */
|
||||
zend_switch_entry switch_entry;
|
||||
|
||||
|
||||
switch_entry.cond.op_type = IS_UNUSED;
|
||||
switch_entry.default_case = 0;
|
||||
switch_entry.control_var = 0;
|
||||
@@ -1324,18 +1330,18 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC)
|
||||
switch (function->type) {
|
||||
case ZEND_USER_FUNCTION: {
|
||||
zend_op_array *op_array = (zend_op_array *) function;
|
||||
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *));
|
||||
}
|
||||
break;
|
||||
case ZEND_INTERNAL_FUNCTION: {
|
||||
zend_internal_function *internal_function = (zend_internal_function *) function;
|
||||
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *));
|
||||
}
|
||||
break;
|
||||
}
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1349,7 +1355,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
|
||||
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC);
|
||||
zend_do_begin_variable_parse(TSRMLS_C);
|
||||
|
||||
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
|
||||
@@ -1360,7 +1366,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
|
||||
|
||||
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
|
||||
last_op->opcode = ZEND_INIT_METHOD_CALL;
|
||||
left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME;
|
||||
Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
|
||||
} else {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
@@ -1370,9 +1376,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
|
||||
}
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
|
||||
{
|
||||
@@ -1400,7 +1406,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC)
|
||||
SET_UNUSED(opline->op1);
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -1486,13 +1492,13 @@ void zend_do_begin_class_member_function_call(znode *class_name, znode *method_n
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
|
||||
/* clone */
|
||||
if (argument_list->u.constant.value.lval != 0) {
|
||||
if (Z_LVAL(argument_list->u.constant) != 0) {
|
||||
zend_error(E_WARNING, "Clone method does not require arguments");
|
||||
}
|
||||
opline = &CG(active_op_array)->opcodes[function_name->u.constant.value.lval];
|
||||
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
|
||||
} else {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
|
||||
@@ -1503,14 +1509,14 @@ void zend_do_end_function_call(znode *function_name, znode *result, znode *argum
|
||||
SET_UNUSED(opline->op1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_VAR;
|
||||
*result = opline->result;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
zend_stack_del_top(&CG(function_call_stack));
|
||||
opline->extended_value = argument_list->u.constant.value.lval;
|
||||
opline->extended_value = Z_LVAL(argument_list->u.constant);
|
||||
}
|
||||
|
||||
|
||||
@@ -1521,7 +1527,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
int send_by_reference;
|
||||
int send_function = 0;
|
||||
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
function_ptr = *function_ptr_ptr;
|
||||
|
||||
@@ -1541,7 +1547,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
|
||||
send_by_reference = 0;
|
||||
} else {
|
||||
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
|
||||
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
|
||||
}
|
||||
} else {
|
||||
send_by_reference = 0;
|
||||
@@ -1611,11 +1617,11 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
|
||||
return (switch_entry->cond.op_type == IS_UNUSED);
|
||||
}
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_SWITCH_FREE;
|
||||
@@ -1632,7 +1638,7 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
|
||||
/* If we reach the seperator then stop applying the stack */
|
||||
if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
@@ -1649,14 +1655,14 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (do_end_vparse) {
|
||||
if (CG(active_op_array)->return_reference && !zend_is_function_or_method_call(expr)) {
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
@@ -1676,7 +1682,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_RETURN;
|
||||
|
||||
|
||||
if (expr) {
|
||||
opline->op1 = *expr;
|
||||
} else {
|
||||
@@ -1686,7 +1692,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
|
||||
|
||||
if (do_end_vparse) {
|
||||
if (zend_is_function_or_method_call(expr)) {
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
@@ -1745,7 +1751,7 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var,
|
||||
{
|
||||
long catch_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (catch_op_number > 0) {
|
||||
opline = &CG(active_op_array)->opcodes[catch_op_number-1];
|
||||
if (opline->opcode == ZEND_FETCH_CLASS) {
|
||||
@@ -1771,7 +1777,7 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC)
|
||||
void zend_do_throw(znode *expr TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_THROW;
|
||||
opline->op1 = *expr;
|
||||
@@ -1828,6 +1834,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
if (!ce->__call) {
|
||||
ce->__call = ce->parent->__call;
|
||||
}
|
||||
if (!ce->__tostring) {
|
||||
ce->__tostring = ce->parent->__tostring;
|
||||
}
|
||||
if (!ce->clone) {
|
||||
ce->clone = ce->parent->clone;
|
||||
}
|
||||
@@ -1849,7 +1858,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
|
||||
@@ -1911,8 +1920,8 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* No implementation checks for constructors */
|
||||
if (fe->common.fn_flags & ZEND_ACC_CTOR) {
|
||||
/* Checks for constructors only if they are declared in an interface */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2010,7 +2019,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
|
||||
*/
|
||||
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
|
||||
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
|
||||
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
|
||||
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
|
||||
child->common.fn_flags |= ZEND_ACC_CHANGED;
|
||||
}
|
||||
@@ -2019,12 +2028,12 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
|
||||
if (parent_flags & ZEND_ACC_ABSTRACT) {
|
||||
child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
child->common.prototype = parent;
|
||||
} else {
|
||||
child->common.prototype = parent->common.prototype;
|
||||
} else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
|
||||
/* ctors only have a prototype if it comes from an interface */
|
||||
child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
|
||||
}
|
||||
|
||||
|
||||
if (child->common.prototype) {
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
|
||||
}
|
||||
@@ -2066,11 +2075,11 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(parent_info->flags & ZEND_ACC_CHANGED) {
|
||||
child_info->flags |= ZEND_ACC_CHANGED;
|
||||
}
|
||||
|
||||
|
||||
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
|
||||
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
|
||||
@@ -2107,7 +2116,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
if (zend_hash_find(&ce->default_static_members, child_info->name, child_info->name_length+1, (void**)&new_prop) == SUCCESS) {
|
||||
if (Z_TYPE_PP(new_prop) != IS_NULL && Z_TYPE_PP(prop) != IS_NULL) {
|
||||
char *prop_name, *tmp;
|
||||
zend_unmangle_property_name_ex(child_info->name, child_info->name_length, &tmp, &prop_name);
|
||||
zend_unmangle_property_name(child_info->name, child_info->name_length, &tmp, &prop_name);
|
||||
|
||||
zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %s::$%s in class %s",
|
||||
parent_ce->name, prop_name, ce->name);
|
||||
@@ -2213,8 +2222,12 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
|
||||
do_inherit_parent_constructor(ce);
|
||||
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
|
||||
ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
|
||||
} else {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2226,7 +2239,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
|
||||
if (*old_constant != *parent_constant) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name);
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -2234,11 +2247,38 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
|
||||
|
||||
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC)
|
||||
{
|
||||
zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
|
||||
zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
|
||||
zend_uint i, ignore = 0;
|
||||
zend_uint current_iface_num = ce->num_interfaces;
|
||||
zend_uint parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
|
||||
|
||||
do_implement_interface(ce, iface TSRMLS_CC);
|
||||
zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
|
||||
for (i = 0; i < ce->num_interfaces; i++) {
|
||||
if (ce->interfaces[i] == NULL) {
|
||||
memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
|
||||
i--;
|
||||
} else if (ce->interfaces[i] == iface) {
|
||||
if (i < parent_iface_num) {
|
||||
ignore = 1;
|
||||
} else {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ignore) {
|
||||
if (ce->num_interfaces >= current_iface_num) {
|
||||
if (ce->type == ZEND_INTERNAL_CLASS) {
|
||||
ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
|
||||
} else {
|
||||
ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
|
||||
}
|
||||
}
|
||||
ce->interfaces[ce->num_interfaces++] = iface;
|
||||
|
||||
zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
|
||||
zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
|
||||
|
||||
do_implement_interface(ce, iface TSRMLS_CC);
|
||||
zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2272,7 +2312,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
|
||||
{
|
||||
@@ -2293,7 +2333,7 @@ ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table
|
||||
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
|
||||
* approach to work.
|
||||
*/
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
|
||||
}
|
||||
return NULL;
|
||||
} else {
|
||||
@@ -2336,7 +2376,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
|
||||
ce->refcount--;
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
@@ -2451,7 +2491,7 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC)
|
||||
}
|
||||
opline->op1 = *expr1;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
|
||||
op_token->u.opline_num = next_op_number;
|
||||
|
||||
*expr1 = opline->result;
|
||||
@@ -2486,7 +2526,7 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC)
|
||||
}
|
||||
opline->op1 = *expr1;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
|
||||
op_token->u.opline_num = next_op_number;
|
||||
|
||||
*expr1 = opline->result;
|
||||
@@ -2539,8 +2579,8 @@ void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC)
|
||||
if (expr) {
|
||||
opline->op2 = *expr;
|
||||
} else {
|
||||
opline->op2.u.constant.type = IS_LONG;
|
||||
opline->op2.u.constant.value.lval = 1;
|
||||
Z_TYPE(opline->op2.u.constant) = IS_LONG;
|
||||
Z_LVAL(opline->op2.u.constant) = 1;
|
||||
INIT_PZVAL(&opline->op2.u.constant);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
}
|
||||
@@ -2567,7 +2607,7 @@ void zend_do_switch_end(znode *case_list TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_switch_entry *switch_entry_ptr;
|
||||
|
||||
|
||||
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
|
||||
|
||||
/* add code to jmp to default case */
|
||||
@@ -2627,7 +2667,7 @@ void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *c
|
||||
zval_copy_ctor(&opline->op1.u.constant);
|
||||
}
|
||||
result = opline->result;
|
||||
|
||||
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_JMPZ;
|
||||
@@ -2735,7 +2775,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
|
||||
|
||||
if (doing_inheritance) {
|
||||
opline->extended_value = parent_class_name->u.var;
|
||||
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
|
||||
@@ -2799,11 +2839,6 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
|
||||
|
||||
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);
|
||||
|
||||
/* Inherit interfaces */
|
||||
if (ce->num_interfaces > 0) {
|
||||
ce->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *)*ce->num_interfaces);
|
||||
memset(ce->interfaces, 0, sizeof(zend_class_entry *)*ce->num_interfaces);
|
||||
}
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
@@ -2811,6 +2846,12 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
|
||||
do_verify_abstract_class(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
/* Inherit interfaces; reset number to zero, we need it for above check and
|
||||
* will restore it during actual implementation. */
|
||||
if (ce->num_interfaces > 0) {
|
||||
ce->interfaces = NULL;
|
||||
ce->num_interfaces = 0;
|
||||
}
|
||||
CG(active_class_entry) = NULL;
|
||||
}
|
||||
|
||||
@@ -2835,7 +2876,7 @@ void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_ADD_INTERFACE;
|
||||
opline->op1 = CG(implementing_class);
|
||||
@@ -2848,7 +2889,7 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
|
||||
{
|
||||
char *prop_name;
|
||||
int prop_name_length;
|
||||
|
||||
|
||||
prop_name_length = 1 + src1_length + 1 + src2_length;
|
||||
prop_name = pemalloc(prop_name_length + 1, internal);
|
||||
prop_name[0] = '\0';
|
||||
@@ -2860,29 +2901,38 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **class_name, char **prop_name)
|
||||
static int zend_strnlen(const char* s, int maxlen)
|
||||
{
|
||||
*prop_name = *class_name = NULL;
|
||||
|
||||
if (mangled_property_len < 2) { /* do not try to unmangle empty strings */
|
||||
*prop_name = mangled_property;
|
||||
return;
|
||||
}
|
||||
|
||||
zend_unmangle_property_name(mangled_property, class_name, prop_name);
|
||||
int len = 0;
|
||||
while (*s++ && maxlen--) len++;
|
||||
return len;
|
||||
}
|
||||
|
||||
ZEND_API void zend_unmangle_property_name(char *mangled_property, char **class_name, char **prop_name)
|
||||
ZEND_API int zend_unmangle_property_name(char *mangled_property, int len, char **class_name, char **prop_name)
|
||||
{
|
||||
*prop_name = *class_name = NULL;
|
||||
int class_name_len;
|
||||
|
||||
*class_name = NULL;
|
||||
|
||||
if (mangled_property[0]!=0) {
|
||||
*prop_name = mangled_property;
|
||||
return;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (len < 3) {
|
||||
zend_error(E_NOTICE, "Illegal member variable name");
|
||||
*prop_name = mangled_property;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
class_name_len = zend_strnlen(mangled_property+1, --len - 1) + 1;
|
||||
if (class_name_len >= len || mangled_property[class_name_len]!=0) {
|
||||
zend_error(E_NOTICE, "Corrupt member variable name");
|
||||
*prop_name = mangled_property;
|
||||
return FAILURE;
|
||||
}
|
||||
*class_name = mangled_property+1;
|
||||
*prop_name = (*class_name)+strlen(*class_name)+1;
|
||||
*prop_name = (*class_name)+class_name_len;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC)
|
||||
@@ -2916,7 +2966,7 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
|
||||
*property = value->u.constant;
|
||||
} else {
|
||||
INIT_PZVAL(property);
|
||||
property->type = IS_NULL;
|
||||
Z_TYPE_P(property) = IS_NULL;
|
||||
}
|
||||
|
||||
if (CG(doc_comment)) {
|
||||
@@ -2934,11 +2984,11 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
|
||||
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
|
||||
{
|
||||
zval *property;
|
||||
|
||||
|
||||
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
|
||||
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
|
||||
}
|
||||
|
||||
|
||||
ALLOC_ZVAL(property);
|
||||
*property = value->u.constant;
|
||||
|
||||
@@ -2956,9 +3006,9 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
|
||||
zend_op opline;
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_op *opline_ptr=NULL;
|
||||
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
|
||||
|
||||
if (fetch_list_ptr->count == 1) {
|
||||
zend_llist_element *le;
|
||||
|
||||
@@ -2966,7 +3016,7 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
|
||||
opline_ptr = (zend_op *) le->data;
|
||||
|
||||
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
|
||||
efree(opline_ptr->op1.u.constant.value.str.val);
|
||||
efree(Z_STRVAL(opline_ptr->op1.u.constant));
|
||||
SET_UNUSED(opline_ptr->op1); /* this means $this for objects */
|
||||
opline_ptr->op2 = *property;
|
||||
/* if it was usual fetch, we change it to object fetch */
|
||||
@@ -3065,7 +3115,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
|
||||
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_NEW;
|
||||
@@ -3073,7 +3123,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *class_type;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
|
||||
}
|
||||
|
||||
@@ -3133,7 +3183,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
|
||||
if (constant_container ||
|
||||
!zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
|
||||
opline->opcode = ZEND_FETCH_CONSTANT;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
@@ -3172,10 +3222,10 @@ void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC)
|
||||
opline->opcode = ZEND_DO_FCALL;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->op1.u.constant.value.str.val = estrndup("shell_exec", sizeof("shell_exec")-1);
|
||||
opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1;
|
||||
Z_STRVAL(opline->op1.u.constant) = estrndup("shell_exec", sizeof("shell_exec")-1);
|
||||
Z_STRLEN(opline->op1.u.constant) = sizeof("shell_exec")-1;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
opline->op1.u.constant.type = IS_STRING;
|
||||
Z_TYPE(opline->op1.u.constant) = IS_STRING;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->extended_value = 1;
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -3234,28 +3284,28 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
switch (offset->u.constant.type) {
|
||||
case IS_CONSTANT:
|
||||
/* Ugly hack to denote that this value has a constant index */
|
||||
element->type |= IS_CONSTANT_INDEX;
|
||||
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
|
||||
/* break missing intentionally */
|
||||
case IS_STRING:
|
||||
zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
|
||||
zval_dtor(&offset->u.constant);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL);
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL);
|
||||
case IS_BOOL:
|
||||
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL(result->u.constant), (long)Z_DVAL(offset->u.constant), &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_CONSTANT_ARRAY:
|
||||
zend_error(E_ERROR, "Illegal offset type");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);
|
||||
zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3337,8 +3387,8 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = last_container;
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_LONG;
|
||||
opline->op2.u.constant.value.lval = *((int *) dimension->data);
|
||||
Z_TYPE(opline->op2.u.constant) = IS_LONG;
|
||||
Z_LVAL(opline->op2.u.constant) = *((int *) dimension->data);
|
||||
INIT_PZVAL(&opline->op2.u.constant);
|
||||
opline->extended_value = ZEND_FETCH_ADD_LOCK;
|
||||
last_container = opline->result;
|
||||
@@ -3461,7 +3511,7 @@ void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = type;
|
||||
Z_LVAL(opline->op2.u.constant) = type;
|
||||
*result = opline->result;
|
||||
}
|
||||
zend_do_extended_fcall_end(TSRMLS_C);
|
||||
@@ -3513,7 +3563,7 @@ void zend_do_unset(znode *variable TSRMLS_DC)
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3524,7 +3574,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
|
||||
zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC);
|
||||
|
||||
zend_check_writable_variable(variable);
|
||||
|
||||
|
||||
if (variable->op_type == IS_CV) {
|
||||
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
|
||||
@@ -3537,7 +3587,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
|
||||
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
} else {
|
||||
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
|
||||
|
||||
|
||||
switch (last_op->opcode) {
|
||||
case ZEND_FETCH_IS:
|
||||
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
|
||||
@@ -3617,7 +3667,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *array;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = is_variable;
|
||||
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
|
||||
*open_brackets_token = opline->result;
|
||||
|
||||
{
|
||||
@@ -3640,7 +3690,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
/* save the location of FE_FETCH */
|
||||
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
@@ -3690,11 +3740,13 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
|
||||
}
|
||||
/* Mark extended_value for assign-by-reference */
|
||||
opline->extended_value |= ZEND_FE_FETCH_BYREF;
|
||||
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
|
||||
}
|
||||
|
||||
value_node = opline->result;
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
if (assign_by_ref) {
|
||||
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
if (assign_by_ref) {
|
||||
/* Mark FE_FETCH as IS_VAR as it holds the data directly as a value */
|
||||
zend_do_assign_ref(NULL, value, &value_node TSRMLS_CC);
|
||||
} else {
|
||||
@@ -3705,8 +3757,8 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
|
||||
if (key->op_type != IS_UNUSED) {
|
||||
znode key_node;
|
||||
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.u.EA.type = 0;
|
||||
opline->result.u.opline_num = get_temporary_variable(CG(active_op_array));
|
||||
@@ -3760,7 +3812,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
|
||||
zend_encoding *new_encoding, *old_encoding;
|
||||
zend_encoding_filter old_input_filter;
|
||||
|
||||
if (val->u.constant.type == IS_CONSTANT) {
|
||||
if (Z_TYPE(val->u.constant) == IS_CONSTANT) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
|
||||
}
|
||||
convert_to_string(&val->u.constant);
|
||||
@@ -3794,7 +3846,7 @@ void zend_do_declare_end(znode *declare_token TSRMLS_DC)
|
||||
|
||||
zend_stack_top(&CG(declare_stack), (void **) &declarables);
|
||||
/* We should restore if there was more than (current - start) - (ticks?1:0) opcodes */
|
||||
if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((CG(declarables).ticks.value.lval)?1:0)) {
|
||||
if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) {
|
||||
CG(declarables) = *declarables;
|
||||
}
|
||||
}
|
||||
@@ -3827,8 +3879,8 @@ void zend_do_exit(znode *result, znode *message TSRMLS_DC)
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
result->op_type = IS_CONST;
|
||||
result->u.constant.type = IS_BOOL;
|
||||
result->u.constant.value.lval = 1;
|
||||
Z_TYPE(result->u.constant) = IS_BOOL;
|
||||
Z_LVAL(result->u.constant) = 1;
|
||||
}
|
||||
|
||||
void zend_do_begin_silence(znode *strudel_token TSRMLS_DC)
|
||||
@@ -3858,7 +3910,7 @@ void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
|
||||
{
|
||||
int jmpz_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_JMPZ;
|
||||
@@ -3901,7 +3953,7 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
|
||||
opline->result = *qm_token;
|
||||
opline->op1 = *false_value;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
|
||||
CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
*result = opline->result;
|
||||
@@ -3913,11 +3965,11 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
|
||||
void zend_do_extended_info(TSRMLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (!CG(extended_info)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_EXT_STMT;
|
||||
@@ -3929,11 +3981,11 @@ void zend_do_extended_info(TSRMLS_D)
|
||||
void zend_do_extended_fcall_begin(TSRMLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (!CG(extended_info)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_EXT_FCALL_BEGIN;
|
||||
@@ -3945,11 +3997,11 @@ void zend_do_extended_fcall_begin(TSRMLS_D)
|
||||
void zend_do_extended_fcall_end(TSRMLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
|
||||
if (!CG(extended_info)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_EXT_FCALL_END;
|
||||
@@ -3960,7 +4012,7 @@ void zend_do_extended_fcall_end(TSRMLS_D)
|
||||
|
||||
void zend_do_ticks(TSRMLS_D)
|
||||
{
|
||||
if (CG(declarables).ticks.value.lval) {
|
||||
if (Z_LVAL(CG(declarables).ticks)) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_TICKS;
|
||||
@@ -4012,7 +4064,7 @@ again:
|
||||
CG(increment_lineno) = 0;
|
||||
}
|
||||
|
||||
zendlval->u.constant.type = IS_LONG;
|
||||
Z_TYPE(zendlval->u.constant) = IS_LONG;
|
||||
retval = lex_scan(&zendlval->u.constant TSRMLS_CC);
|
||||
switch (retval) {
|
||||
case T_COMMENT:
|
||||
@@ -4032,12 +4084,12 @@ again:
|
||||
retval = T_ECHO;
|
||||
break;
|
||||
case T_END_HEREDOC:
|
||||
efree(zendlval->u.constant.value.str.val);
|
||||
efree(Z_STRVAL(zendlval->u.constant));
|
||||
break;
|
||||
case EOF:
|
||||
return EOF;
|
||||
}
|
||||
|
||||
|
||||
INIT_PZVAL(&zendlval->u.constant);
|
||||
zendlval->op_type = IS_CONST;
|
||||
return retval;
|
||||
@@ -4089,6 +4141,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
|
||||
ce->__unset = NULL;
|
||||
ce->__isset = NULL;
|
||||
ce->__call = NULL;
|
||||
ce->__tostring = NULL;
|
||||
ce->create_object = NULL;
|
||||
ce->get_iterator = NULL;
|
||||
ce->iterator_funcs.funcs = NULL;
|
||||
|
||||
+15
-9
@@ -5,7 +5,7 @@
|
||||
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
@@ -149,6 +149,7 @@ typedef struct _zend_property_info {
|
||||
ulong h;
|
||||
char *doc_comment;
|
||||
int doc_comment_len;
|
||||
zend_class_entry *ce;
|
||||
} zend_property_info;
|
||||
|
||||
|
||||
@@ -226,9 +227,9 @@ struct _zend_op_array {
|
||||
typedef struct _zend_internal_function {
|
||||
/* Common elements */
|
||||
zend_uchar type;
|
||||
char *function_name;
|
||||
char * function_name;
|
||||
zend_class_entry *scope;
|
||||
zend_uint fn_flags;
|
||||
zend_uint fn_flags;
|
||||
union _zend_function *prototype;
|
||||
zend_uint num_args;
|
||||
zend_uint required_num_args;
|
||||
@@ -238,6 +239,7 @@ typedef struct _zend_internal_function {
|
||||
/* END of common elements */
|
||||
|
||||
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
|
||||
struct _zend_module_entry *module;
|
||||
} zend_internal_function;
|
||||
|
||||
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : "")
|
||||
@@ -257,7 +259,7 @@ typedef union _zend_function {
|
||||
zend_bool pass_rest_by_reference;
|
||||
unsigned char return_reference;
|
||||
} common;
|
||||
|
||||
|
||||
zend_op_array op_array;
|
||||
zend_internal_function internal_function;
|
||||
} zend_function;
|
||||
@@ -319,6 +321,7 @@ void shutdown_compiler(TSRMLS_D);
|
||||
void zend_init_compiler_data_structures(TSRMLS_D);
|
||||
|
||||
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
|
||||
extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
|
||||
|
||||
ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
|
||||
void startup_scanner(TSRMLS_D);
|
||||
@@ -507,7 +510,7 @@ ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
/* helper functions in zend_language_scanner.l */
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
|
||||
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
|
||||
@@ -525,8 +528,7 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce);
|
||||
void zend_class_add_ref(zend_class_entry **ce);
|
||||
|
||||
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal);
|
||||
ZEND_API void zend_unmangle_property_name(char *mangled_property, char **prop_name, char **class_name);
|
||||
ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
|
||||
ZEND_API int zend_unmangle_property_name(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
|
||||
|
||||
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
|
||||
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
|
||||
@@ -647,6 +649,9 @@ int zendlex(znode *zendlval TSRMLS_DC);
|
||||
#define ZEND_FE_FETCH_BYREF 1
|
||||
#define ZEND_FE_FETCH_WITH_KEY 2
|
||||
|
||||
#define ZEND_FE_RESET_VARIABLE 1
|
||||
#define ZEND_FE_RESET_REFERENCE 2
|
||||
|
||||
#define ZEND_MEMBER_FUNC_CALL 1<<0
|
||||
|
||||
#define ZEND_ARG_SEND_BY_REF (1<<0)
|
||||
@@ -705,9 +710,10 @@ END_EXTERN_C()
|
||||
#define ZEND_DESTRUCTOR_FUNC_NAME "__destruct"
|
||||
#define ZEND_GET_FUNC_NAME "__get"
|
||||
#define ZEND_SET_FUNC_NAME "__set"
|
||||
#define ZEND_UNSET_FUNC_NAME "__unset"
|
||||
#define ZEND_ISSET_FUNC_NAME "__isset"
|
||||
#define ZEND_UNSET_FUNC_NAME "__unset"
|
||||
#define ZEND_ISSET_FUNC_NAME "__isset"
|
||||
#define ZEND_CALL_FUNC_NAME "__call"
|
||||
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
|
||||
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
|
||||
|
||||
#endif /* ZEND_COMPILE_H */
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#ifndef ZEND_CONFIG_W32_H
|
||||
#define ZEND_CONFIG_W32_H
|
||||
|
||||
#define USE_ZEND_ALLOC 1
|
||||
|
||||
#include <../main/config.w32.h>
|
||||
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
|
||||
@@ -96,6 +96,7 @@ int zend_startup_constants(TSRMLS_D)
|
||||
void zend_register_standard_constants(TSRMLS_D)
|
||||
{
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
|
||||
|
||||
+2
-1
@@ -34,8 +34,9 @@
|
||||
#define E_USER_WARNING (1<<9L)
|
||||
#define E_USER_NOTICE (1<<10L)
|
||||
#define E_STRICT (1<<11L)
|
||||
#define E_RECOVERABLE_ERROR (1<<12L)
|
||||
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR)
|
||||
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
|
||||
|
||||
#endif /* ZEND_ERRORS_H */
|
||||
|
||||
+23
-23
@@ -81,8 +81,8 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
|
||||
zend_object *object;
|
||||
zval *trace;
|
||||
|
||||
obj.value.obj = zend_objects_new(&object, class_type TSRMLS_CC);
|
||||
obj.value.obj.handlers = &default_exception_handlers;
|
||||
Z_OBJVAL(obj) = zend_objects_new(&object, class_type TSRMLS_CC);
|
||||
Z_OBJ_HT(obj) = &default_exception_handlers;
|
||||
|
||||
ALLOC_HASHTABLE(object->properties);
|
||||
zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
@@ -97,7 +97,7 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
|
||||
zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
|
||||
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
|
||||
|
||||
return obj.value.obj;
|
||||
return Z_OBJVAL(obj);
|
||||
}
|
||||
|
||||
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
|
||||
@@ -171,7 +171,7 @@ ZEND_METHOD(error_exception, __construct)
|
||||
}
|
||||
|
||||
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
|
||||
|
||||
|
||||
if (argc >= 4) {
|
||||
zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename TSRMLS_CC);
|
||||
if (argc < 5) {
|
||||
@@ -271,7 +271,7 @@ ZEND_METHOD(error_exception, getSeverity)
|
||||
|
||||
#define TRACE_APPEND_STRL(val, vallen) \
|
||||
{ \
|
||||
int l = vallen; \
|
||||
int l = vallen; \
|
||||
*str = (char*)erealloc(*str, *len + l + 1); \
|
||||
memcpy((*str) + *len, val, l); \
|
||||
*len += l; \
|
||||
@@ -372,7 +372,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
|
||||
if(!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
|
||||
|
||||
TRACE_APPEND_STR("), ");
|
||||
break;
|
||||
}
|
||||
@@ -434,7 +434,7 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
zval *trace;
|
||||
char *res = estrdup(""), **str = &res, *s_tmp;
|
||||
int res_len = 0, *len = &res_len, num = 0;
|
||||
|
||||
|
||||
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
|
||||
|
||||
@@ -448,12 +448,12 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_spprintf(char **message, int max_len, char *format, ...)
|
||||
int zend_spprintf(char **message, int max_len, char *format, ...)
|
||||
{
|
||||
va_list arg;
|
||||
int len;
|
||||
|
||||
va_start(arg, format);
|
||||
va_start(arg, format);
|
||||
len = zend_vspprintf(message, max_len, format, arg);
|
||||
va_end(arg);
|
||||
return len;
|
||||
@@ -524,15 +524,15 @@ ZEND_METHOD(exception, __toString)
|
||||
|
||||
/* All functions that may be used in uncaught exception handlers must be final
|
||||
* and must not throw exceptions. Otherwise we would need a facility to handle
|
||||
* such exceptions in that handler.
|
||||
* such exceptions in that handler.
|
||||
* Also all getXY() methods are final because thy serve as read only access to
|
||||
* their corresponding properties, no more, no less. If after all you need to
|
||||
* their corresponding properties, no more, no less. If after all you need to
|
||||
* override somthing then it is method __toString().
|
||||
* And never try to change the state of exceptions and never implement anything
|
||||
* that gives the user anything to accomplish this.
|
||||
*/
|
||||
static
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_exception___construct, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_ARG_INFO(0, code)
|
||||
ZEND_END_ARG_INFO();
|
||||
@@ -551,7 +551,7 @@ static zend_function_entry default_exception_functions[] = {
|
||||
};
|
||||
|
||||
static
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 3)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_ARG_INFO(0, code)
|
||||
ZEND_ARG_INFO(0, severity)
|
||||
@@ -571,7 +571,7 @@ void zend_register_default_exception(TSRMLS_D)
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
|
||||
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
default_exception_ce->create_object = zend_default_exception_new;
|
||||
default_exception_ce->create_object = zend_default_exception_new;
|
||||
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
default_exception_handlers.clone_obj = NULL;
|
||||
|
||||
@@ -584,16 +584,16 @@ void zend_register_default_exception(TSRMLS_D)
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
|
||||
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
|
||||
error_exception_ce->create_object = zend_error_exception_new;
|
||||
error_exception_ce->create_object = zend_error_exception_new;
|
||||
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(void)
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D)
|
||||
{
|
||||
return default_exception_ce;
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_get_error_exception(void)
|
||||
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D)
|
||||
{
|
||||
return error_exception_ce;
|
||||
}
|
||||
@@ -613,7 +613,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
|
||||
exception_ce = default_exception_ce;
|
||||
}
|
||||
object_init_ex(ex, exception_ce);
|
||||
|
||||
|
||||
|
||||
if (message) {
|
||||
zend_update_property_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
|
||||
@@ -633,7 +633,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
|
||||
char *message;
|
||||
zval *zexception;
|
||||
|
||||
va_start(arg, format);
|
||||
va_start(arg, format);
|
||||
zend_vspprintf(&message, 0, format, arg);
|
||||
va_end(arg);
|
||||
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
|
||||
@@ -652,7 +652,7 @@ ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char
|
||||
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
||||
va_start(args, format);
|
||||
zend_error_cb(type, file, lineno, format, args);
|
||||
va_end(args);
|
||||
@@ -666,7 +666,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
|
||||
zval *str, *file, *line;
|
||||
|
||||
EG(exception) = NULL;
|
||||
|
||||
|
||||
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
|
||||
if (!EG(exception)) {
|
||||
if (Z_TYPE_P(str) != IS_STRING) {
|
||||
@@ -676,7 +676,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&str);
|
||||
|
||||
|
||||
if (EG(exception)) {
|
||||
/* do the best we can to inform about the inner exception */
|
||||
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
|
||||
@@ -704,7 +704,7 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
|
||||
{
|
||||
zend_class_entry *exception_ce;
|
||||
|
||||
if (exception == NULL || exception->type != IS_OBJECT) {
|
||||
if (exception == NULL || Z_TYPE_P(exception) != IS_OBJECT) {
|
||||
zend_error(E_ERROR, "Need to supply an object when throwing an exception");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC);
|
||||
|
||||
void zend_register_default_exception(TSRMLS_D);
|
||||
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(void);
|
||||
ZEND_API zend_class_entry *zend_get_error_exception(void);
|
||||
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
|
||||
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
|
||||
ZEND_API void zend_register_default_classes(TSRMLS_D);
|
||||
|
||||
/* exception_ce NULL or zend_exception_get_default() or a derived class
|
||||
/* exception_ce NULL or zend_exception_get_default() or a derived class
|
||||
* message NULL or the message of the exception */
|
||||
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
|
||||
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);
|
||||
@@ -48,6 +48,9 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
/* show an exception using zend_error(E_ERROR,...) */
|
||||
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
|
||||
|
||||
/* do not export, in php it's available thru spprintf directly */
|
||||
int zend_spprintf(char **message, int max_len, char *format, ...);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
+236
-237
@@ -31,11 +31,14 @@
|
||||
#include "zend_ptr_stack.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_fast_cache.h"
|
||||
#include "zend_ini.h"
|
||||
#include "zend_exceptions.h"
|
||||
#include "zend_interfaces.h"
|
||||
#include "zend_vm.h"
|
||||
|
||||
/* Virtual current working directory support */
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
|
||||
#define _CONST_CODE 0
|
||||
#define _TMP_CODE 1
|
||||
#define _VAR_CODE 2
|
||||
@@ -123,16 +126,16 @@ static inline void zend_pzval_unlock_free_func(zval *z)
|
||||
|
||||
#define INIT_PZVAL_COPY(z,v) \
|
||||
(z)->value = (v)->value; \
|
||||
(z)->type = (v)->type; \
|
||||
Z_TYPE_P(z) = Z_TYPE_P(v); \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0;
|
||||
(z)->is_ref = 0;
|
||||
|
||||
#define MAKE_REAL_ZVAL_PTR(val) \
|
||||
do { \
|
||||
zval *_tmp; \
|
||||
ALLOC_ZVAL(_tmp); \
|
||||
_tmp->value = (val)->value; \
|
||||
_tmp->type = (val)->type; \
|
||||
Z_TYPE_P(_tmp) = Z_TYPE_P(val); \
|
||||
_tmp->refcount = 1; \
|
||||
_tmp->is_ref = 0; \
|
||||
val = _tmp; \
|
||||
@@ -150,10 +153,10 @@ ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data
|
||||
|
||||
static inline void zend_get_cv_address(zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
|
||||
{
|
||||
zval *new_zval = &EG(uninitialized_zval);
|
||||
|
||||
new_zval->refcount++;
|
||||
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
|
||||
zval *new_zval = &EG(uninitialized_zval);
|
||||
|
||||
new_zval->refcount++;
|
||||
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
|
||||
}
|
||||
|
||||
static inline zval *_get_zval_ptr_tmp(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
|
||||
@@ -199,7 +202,7 @@ static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_
|
||||
static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
|
||||
{
|
||||
zval ***ptr = &CV_OF(node->u.var);
|
||||
|
||||
|
||||
if (!*ptr) {
|
||||
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
|
||||
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
|
||||
@@ -267,7 +270,7 @@ static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_
|
||||
static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
|
||||
{
|
||||
zval ***ptr = &CV_OF(node->u.var);
|
||||
|
||||
|
||||
if (!*ptr) {
|
||||
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
|
||||
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
|
||||
@@ -364,7 +367,7 @@ static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC
|
||||
PZVAL_UNLOCK_FREE(T->str_offset.str);
|
||||
} else {
|
||||
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
|
||||
if (opline->extended_value) { /* foreach() free */
|
||||
if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { /* foreach() free */
|
||||
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
|
||||
}
|
||||
}
|
||||
@@ -433,9 +436,10 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
|
||||
static inline void make_real_object(zval **object_ptr TSRMLS_DC)
|
||||
{
|
||||
/* this should modify object only if it's empty */
|
||||
if ((*object_ptr)->type == IS_NULL
|
||||
|| ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0)
|
||||
|| ((*object_ptr)->type == IS_STRING && (*object_ptr)->value.str.len == 0)) {
|
||||
if (Z_TYPE_PP(object_ptr) == IS_NULL
|
||||
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr)==0)
|
||||
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)) {
|
||||
|
||||
if (!PZVAL_IS_REF(*object_ptr)) {
|
||||
SEPARATE_ZVAL(object_ptr);
|
||||
}
|
||||
@@ -445,95 +449,76 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
|
||||
static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, zend_class_entry **pce TSRMLS_DC)
|
||||
{
|
||||
*pce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
|
||||
|
||||
if ((*pce)->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
return "implement interface ";
|
||||
} else {
|
||||
return "be an instance of ";
|
||||
}
|
||||
}
|
||||
|
||||
static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, zend_arg_info *cur_arg_info, char *need_msg, char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
|
||||
{
|
||||
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
|
||||
char *fname = zf->common.function_name;
|
||||
char *fsep;
|
||||
char *fclass;
|
||||
|
||||
if (zf->common.scope) {
|
||||
fsep = "::";
|
||||
fclass = zf->common.scope->name;
|
||||
} else {
|
||||
fsep = "";
|
||||
fclass = "";
|
||||
}
|
||||
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
|
||||
{
|
||||
zend_arg_info *cur_arg_info;
|
||||
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
|
||||
char *fclass, *fsep, *fname;
|
||||
char *need_msg;
|
||||
zend_class_entry *ce;
|
||||
|
||||
if (!zf->common.arg_info
|
||||
|| arg_num>zf->common.num_args) {
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
cur_arg_info = &zf->common.arg_info[arg_num-1];
|
||||
fname = zf->common.function_name;
|
||||
fsep = zf->common.scope ? "::" : "";
|
||||
fclass = zf->common.scope ? zf->common.scope->name : "";
|
||||
|
||||
if (cur_arg_info->class_name) {
|
||||
if (!arg) {
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
|
||||
}
|
||||
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
|
||||
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, "none", "" TSRMLS_CC);
|
||||
}
|
||||
switch (Z_TYPE_P(arg)) {
|
||||
case IS_NULL:
|
||||
if (!cur_arg_info->allow_null) {
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
zend_class_entry *ce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
|
||||
if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
|
||||
char *error_msg;
|
||||
|
||||
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
error_msg = "implement interface";
|
||||
} else {
|
||||
error_msg = "be an instance of";
|
||||
}
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s", arg_num, fclass, fsep, fname, error_msg, ce->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
|
||||
}
|
||||
break;
|
||||
if (Z_TYPE_P(arg) == IS_OBJECT) {
|
||||
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
|
||||
if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
|
||||
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
|
||||
}
|
||||
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
|
||||
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
|
||||
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||
}
|
||||
} else if (cur_arg_info->array_type_hint) {
|
||||
if (!arg) {
|
||||
if(ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
|
||||
}
|
||||
return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", "none", "" TSRMLS_CC);
|
||||
}
|
||||
switch (Z_TYPE_P(arg)) {
|
||||
case IS_NULL:
|
||||
if (!cur_arg_info->allow_null) {
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
break;
|
||||
default:
|
||||
if (ptr && ptr->op_array) {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
|
||||
}
|
||||
break;
|
||||
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
|
||||
return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -557,8 +542,8 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
|
||||
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
|
||||
object = *object_ptr;
|
||||
|
||||
if (object->type != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
|
||||
|
||||
if (Z_TYPE_P(object) != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
FREE_OP(free_op2);
|
||||
if (!RETURN_VALUE_UNUSED(result)) {
|
||||
@@ -607,7 +592,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
value->refcount = 0;
|
||||
zval_copy_ctor(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
value->refcount++;
|
||||
if (opcode == ZEND_ASSIGN_OBJ) {
|
||||
@@ -625,7 +610,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
}
|
||||
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
if (result && !RETURN_VALUE_UNUSED(result)) {
|
||||
T(result->u.var).var.ptr = value;
|
||||
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
|
||||
@@ -646,11 +631,12 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
zend_free_op free_op1;
|
||||
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, &free_op1, BP_VAR_W);
|
||||
zval *variable_ptr;
|
||||
|
||||
|
||||
if (!variable_ptr_ptr) {
|
||||
temp_variable *T = &T(op1->u.var);
|
||||
|
||||
if (T->str_offset.str->type == IS_STRING) do {
|
||||
if (Z_TYPE_P(T->str_offset.str) == IS_STRING)
|
||||
do {
|
||||
zval tmp;
|
||||
zval *final_value = value;
|
||||
|
||||
@@ -658,23 +644,23 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
|
||||
break;
|
||||
}
|
||||
if ((int)T->str_offset.offset >= T->str_offset.str->value.str.len) {
|
||||
if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) {
|
||||
zend_uint i;
|
||||
|
||||
if (T->str_offset.str->value.str.len==0) {
|
||||
STR_FREE(T->str_offset.str->value.str.val);
|
||||
T->str_offset.str->value.str.val = (char *) emalloc(T->str_offset.offset+1+1);
|
||||
if (Z_STRLEN_P(T->str_offset.str)==0) {
|
||||
STR_FREE(Z_STRVAL_P(T->str_offset.str));
|
||||
Z_STRVAL_P(T->str_offset.str) = (char *) emalloc(T->str_offset.offset+1+1);
|
||||
} else {
|
||||
T->str_offset.str->value.str.val = (char *) erealloc(T->str_offset.str->value.str.val, T->str_offset.offset+1+1);
|
||||
Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1);
|
||||
}
|
||||
for (i=T->str_offset.str->value.str.len; i<T->str_offset.offset; i++) {
|
||||
T->str_offset.str->value.str.val[i] = ' ';
|
||||
for (i=Z_STRLEN_P(T->str_offset.str); i<T->str_offset.offset; i++) {
|
||||
Z_STRVAL_P(T->str_offset.str)[i] = ' ';
|
||||
}
|
||||
T->str_offset.str->value.str.val[T->str_offset.offset+1] = 0;
|
||||
T->str_offset.str->value.str.len = T->str_offset.offset+1;
|
||||
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0;
|
||||
Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1;
|
||||
}
|
||||
|
||||
if (value->type!=IS_STRING) {
|
||||
if (Z_TYPE_P(value)!=IS_STRING) {
|
||||
tmp = *value;
|
||||
if (op2->op_type & (IS_VAR|IS_CV)) {
|
||||
zval_copy_ctor(&tmp);
|
||||
@@ -683,14 +669,14 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
final_value = &tmp;
|
||||
}
|
||||
|
||||
T->str_offset.str->value.str.val[T->str_offset.offset] = final_value->value.str.val[0];
|
||||
|
||||
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(final_value)[0];
|
||||
|
||||
if (op2->op_type == IS_TMP_VAR) {
|
||||
if (final_value == &T(op2->u.var).tmp_var) {
|
||||
/* we can safely free final_value here
|
||||
* because separation is done only
|
||||
* in case op2->op_type == IS_VAR */
|
||||
STR_FREE(final_value->value.str.val);
|
||||
STR_FREE(Z_STRVAL_P(final_value));
|
||||
}
|
||||
}
|
||||
if (final_value == &tmp) {
|
||||
@@ -702,7 +688,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
*/
|
||||
} while (0);
|
||||
/* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
|
||||
|
||||
|
||||
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
|
||||
if (!RETURN_VALUE_UNUSED(result)) {
|
||||
T(result->u.var).var.ptr_ptr = &value;
|
||||
@@ -728,65 +714,64 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
return;
|
||||
}
|
||||
|
||||
if(Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
|
||||
/* TODO? ze1_compatibility_mode support */
|
||||
if (Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
|
||||
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
|
||||
goto done_setting_var;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (variable_ptr != value) {
|
||||
zend_uint refcount = variable_ptr->refcount;
|
||||
zval garbage;
|
||||
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount++;
|
||||
}
|
||||
garbage = *variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
variable_ptr->refcount = refcount;
|
||||
variable_ptr->is_ref = 1;
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount--;
|
||||
}
|
||||
zendi_zval_dtor(garbage);
|
||||
}
|
||||
} else {
|
||||
if (variable_ptr != value) {
|
||||
value->refcount++;
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount == 0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
} else {
|
||||
ALLOC_ZVAL(variable_ptr);
|
||||
*variable_ptr_ptr = variable_ptr;
|
||||
}
|
||||
*variable_ptr = *value;
|
||||
INIT_PZVAL(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
zval_ptr_dtor(&value);
|
||||
}
|
||||
}
|
||||
if (!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (variable_ptr != value) {
|
||||
zend_uint refcount = variable_ptr->refcount;
|
||||
zval garbage;
|
||||
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount++;
|
||||
}
|
||||
garbage = *variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
variable_ptr->refcount = refcount;
|
||||
variable_ptr->is_ref = 1;
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount--;
|
||||
}
|
||||
zendi_zval_dtor(garbage);
|
||||
}
|
||||
} else {
|
||||
if (variable_ptr != value) {
|
||||
value->refcount++;
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount == 0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
} else {
|
||||
ALLOC_ZVAL(variable_ptr);
|
||||
*variable_ptr_ptr = variable_ptr;
|
||||
}
|
||||
*variable_ptr = *value;
|
||||
INIT_PZVAL(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
zval_ptr_dtor(&value);
|
||||
}
|
||||
}
|
||||
if (!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (variable_ptr!=value) {
|
||||
zend_uint refcount = variable_ptr->refcount;
|
||||
zval garbage;
|
||||
|
||||
|
||||
if (type!=IS_TMP_VAR) {
|
||||
value->refcount++;
|
||||
}
|
||||
@@ -812,7 +797,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
variable_ptr->refcount++;
|
||||
} else if (PZVAL_IS_REF(value)) {
|
||||
zval tmp;
|
||||
|
||||
|
||||
tmp = *value;
|
||||
zval_copy_ctor(&tmp);
|
||||
tmp.refcount=1;
|
||||
@@ -859,13 +844,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
}
|
||||
(*variable_ptr_ptr)->is_ref=0;
|
||||
}
|
||||
|
||||
|
||||
done_setting_var:
|
||||
if (result && !RETURN_VALUE_UNUSED(result)) {
|
||||
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
|
||||
PZVAL_LOCK(*variable_ptr_ptr);
|
||||
AI_USE_PTR(T(result->u.var).var);
|
||||
}
|
||||
}
|
||||
FREE_OP_VAR_PTR(free_op1);
|
||||
}
|
||||
|
||||
@@ -874,32 +859,32 @@ static inline void zend_receive(zval **variable_ptr_ptr, zval *value TSRMLS_DC)
|
||||
{
|
||||
zval *variable_ptr = *variable_ptr_ptr;
|
||||
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
|
||||
} else {
|
||||
variable_ptr->refcount--;
|
||||
ALLOC_ZVAL(variable_ptr);
|
||||
*variable_ptr_ptr = variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
INIT_PZVAL(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
}
|
||||
if (!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
} else {
|
||||
variable_ptr->refcount--;
|
||||
*variable_ptr_ptr = value;
|
||||
value->refcount++;
|
||||
}
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
|
||||
} else {
|
||||
variable_ptr->refcount--;
|
||||
ALLOC_ZVAL(variable_ptr);
|
||||
*variable_ptr_ptr = variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
INIT_PZVAL(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
}
|
||||
if (!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
} else {
|
||||
variable_ptr->refcount--;
|
||||
*variable_ptr_ptr = value;
|
||||
value->refcount++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Utility Functions for Extensions */
|
||||
@@ -960,6 +945,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, zval *dim
|
||||
offset_key = "";
|
||||
offset_key_length = 0;
|
||||
goto fetch_string_dim;
|
||||
|
||||
case IS_STRING:
|
||||
|
||||
offset_key = dim->value.str.val;
|
||||
@@ -989,17 +975,17 @@ fetch_string_dim:
|
||||
}
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", dim->value.lval, dim->value.lval);
|
||||
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
|
||||
/* Fall Through */
|
||||
case IS_DOUBLE:
|
||||
case IS_BOOL:
|
||||
case IS_BOOL:
|
||||
case IS_LONG: {
|
||||
long index;
|
||||
|
||||
if (dim->type == IS_DOUBLE) {
|
||||
index = (long)dim->value.dval;
|
||||
if (Z_TYPE_P(dim) == IS_DOUBLE) {
|
||||
index = (long)Z_DVAL_P(dim);
|
||||
} else {
|
||||
index = dim->value.lval;
|
||||
index = Z_LVAL_P(dim);
|
||||
}
|
||||
if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) {
|
||||
switch (type) {
|
||||
@@ -1024,7 +1010,7 @@ fetch_string_dim:
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
@@ -1048,7 +1034,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
if (!container_ptr) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
|
||||
|
||||
container = *container_ptr;
|
||||
|
||||
if (container == EG(error_zval_ptr)) {
|
||||
@@ -1062,9 +1048,9 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
return;
|
||||
}
|
||||
|
||||
if (container->type==IS_NULL
|
||||
|| (container->type==IS_BOOL && container->value.lval==0)
|
||||
|| (container->type==IS_STRING && container->value.str.len==0)) {
|
||||
if (Z_TYPE_P(container)==IS_NULL
|
||||
|| (Z_TYPE_P(container)==IS_BOOL && Z_LVAL_P(container)==0)
|
||||
|| (Z_TYPE_P(container)==IS_STRING && Z_STRLEN_P(container)==0)) {
|
||||
switch (type) {
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
@@ -1078,7 +1064,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
}
|
||||
}
|
||||
|
||||
switch (container->type) {
|
||||
switch (Z_TYPE_P(container)) {
|
||||
zval **retval;
|
||||
|
||||
case IS_ARRAY:
|
||||
@@ -1090,13 +1076,13 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
zval *new_zval = &EG(uninitialized_zval);
|
||||
|
||||
new_zval->refcount++;
|
||||
if (zend_hash_next_index_insert(container->value.ht, &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
|
||||
if (zend_hash_next_index_insert(Z_ARRVAL_P(container), &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
retval = &EG(error_zval_ptr);
|
||||
new_zval->refcount--;
|
||||
new_zval->refcount--;
|
||||
}
|
||||
} else {
|
||||
retval = zend_fetch_dimension_address_inner(container->value.ht, dim, type TSRMLS_CC);
|
||||
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
|
||||
}
|
||||
if (result) {
|
||||
result->var.ptr_ptr = retval;
|
||||
@@ -1121,7 +1107,20 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
|
||||
}
|
||||
|
||||
if (dim->type != IS_LONG) {
|
||||
if (Z_TYPE_P(dim) != IS_LONG) {
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
/* case IS_LONG: */
|
||||
case IS_STRING:
|
||||
case IS_DOUBLE:
|
||||
case IS_NULL:
|
||||
case IS_BOOL:
|
||||
/* do nothing */
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
break;
|
||||
}
|
||||
|
||||
tmp = *dim;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_long(&tmp);
|
||||
@@ -1141,7 +1140,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
container = *container_ptr;
|
||||
result->str_offset.str = container;
|
||||
PZVAL_LOCK(container);
|
||||
result->str_offset.offset = dim->value.lval;
|
||||
result->str_offset.offset = Z_LVAL_P(dim);
|
||||
result->var.ptr_ptr = NULL;
|
||||
if (type == BP_VAR_R || type == BP_VAR_IS) {
|
||||
AI_USE_PTR(result->var);
|
||||
@@ -1155,19 +1154,19 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
zend_error_noreturn(E_ERROR, "Cannot use object as array");
|
||||
} else {
|
||||
zval *overloaded_result;
|
||||
|
||||
|
||||
if (dim_is_tmp_var) {
|
||||
zval *orig = dim;
|
||||
MAKE_REAL_ZVAL_PTR(dim);
|
||||
ZVAL_NULL(orig);
|
||||
}
|
||||
}
|
||||
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
|
||||
|
||||
if (overloaded_result) {
|
||||
switch (type) {
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
if (overloaded_result->type != IS_OBJECT
|
||||
if (Z_TYPE_P(overloaded_result) != IS_OBJECT
|
||||
&& !overloaded_result->is_ref) {
|
||||
zend_error_noreturn(E_ERROR, "Objects used as arrays in post/pre increment/decrement must return values by reference");
|
||||
}
|
||||
@@ -1193,7 +1192,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
default: {
|
||||
switch (type) {
|
||||
case BP_VAR_UNSET:
|
||||
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
|
||||
@@ -1224,7 +1223,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
|
||||
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
|
||||
{
|
||||
zval *container;
|
||||
|
||||
|
||||
container = *container_ptr;
|
||||
if (container == EG(error_zval_ptr)) {
|
||||
if (result) {
|
||||
@@ -1234,9 +1233,9 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
return;
|
||||
}
|
||||
/* this should modify object only if it's empty */
|
||||
if (container->type == IS_NULL
|
||||
|| (container->type == IS_BOOL && container->value.lval==0)
|
||||
|| (container->type == IS_STRING && container->value.str.len == 0)) {
|
||||
if (Z_TYPE_P(container) == IS_NULL
|
||||
|| (Z_TYPE_P(container) == IS_BOOL && Z_LVAL_P(container)==0)
|
||||
|| (Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)) {
|
||||
switch (type) {
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
@@ -1248,8 +1247,8 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (container->type != IS_OBJECT) {
|
||||
|
||||
if (Z_TYPE_P(container) != IS_OBJECT) {
|
||||
if (result) {
|
||||
if (type == BP_VAR_R || type == BP_VAR_IS) {
|
||||
result->var.ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
@@ -1260,14 +1259,14 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
|
||||
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
|
||||
if(NULL == ptr_ptr) {
|
||||
if (NULL == ptr_ptr) {
|
||||
zval *ptr;
|
||||
|
||||
if (Z_OBJ_HT_P(container)->read_property &&
|
||||
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC)) != NULL) {
|
||||
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC)) != NULL) {
|
||||
if (result) {
|
||||
result->var.ptr = ptr;
|
||||
result->var.ptr_ptr = &result->var.ptr;
|
||||
@@ -1280,7 +1279,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
}
|
||||
} else if (Z_OBJ_HT_P(container)->read_property) {
|
||||
if (result) {
|
||||
result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC);
|
||||
result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC);
|
||||
result->var.ptr_ptr = &result->var.ptr;
|
||||
}
|
||||
} else {
|
||||
@@ -1289,10 +1288,10 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
|
||||
result->var.ptr_ptr = &EG(error_zval_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (result) {
|
||||
PZVAL_LOCK(*result->var.ptr_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline zend_brk_cont_element* zend_brk_cont(zval *nest_levels_zval, int array_offset, zend_op_array *op_array, temp_variable *Ts TSRMLS_DC)
|
||||
@@ -1347,7 +1346,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
|
||||
} else if (Z_TYPE_PP(pz) == IS_ARRAY) {
|
||||
zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
|
||||
} else if (Z_TYPE_PP(pz) == IS_OBJECT) {
|
||||
|
||||
|
||||
/* OBJ-TBI - doesn't support new object model! */
|
||||
zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
|
||||
}
|
||||
@@ -1369,13 +1368,13 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
|
||||
}
|
||||
|
||||
#define ZEND_VM_NEXT_OPCODE() \
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline)++; \
|
||||
ZEND_VM_CONTINUE()
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline)++; \
|
||||
ZEND_VM_CONTINUE()
|
||||
|
||||
#define ZEND_VM_SET_OPCODE(new_op) \
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline) = new_op
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline) = new_op
|
||||
|
||||
#define ZEND_VM_JMP(new_op) \
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
@@ -1383,21 +1382,21 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
|
||||
ZEND_VM_CONTINUE()
|
||||
|
||||
#define ZEND_VM_INC_OPCODE() \
|
||||
if (!EG(exception)) { \
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline)++; \
|
||||
}
|
||||
if (!EG(exception)) { \
|
||||
CHECK_SYMBOL_TABLES() \
|
||||
EX(opline)++; \
|
||||
}
|
||||
|
||||
#define ZEND_VM_RETURN_FROM_EXECUTE_LOOP() \
|
||||
free_alloca(EX(CVs)); \
|
||||
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
|
||||
free_alloca(EX(Ts)); \
|
||||
} else { \
|
||||
efree(EX(Ts)); \
|
||||
} \
|
||||
EG(in_execution) = EX(original_in_execution); \
|
||||
EG(current_execute_data) = EX(prev_execute_data); \
|
||||
ZEND_VM_RETURN()
|
||||
free_alloca(EX(CVs)); \
|
||||
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
|
||||
free_alloca(EX(Ts)); \
|
||||
} else { \
|
||||
efree(EX(Ts)); \
|
||||
} \
|
||||
EG(in_execution) = EX(original_in_execution); \
|
||||
EG(current_execute_data) = EX(prev_execute_data); \
|
||||
ZEND_VM_RETURN()
|
||||
|
||||
#include "zend_vm_execute.h"
|
||||
|
||||
|
||||
+12
-10
@@ -24,8 +24,8 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_hash.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
|
||||
typedef union _temp_variable {
|
||||
zval tmp_var;
|
||||
@@ -73,28 +73,28 @@ static inline int i_zend_is_true(zval *op)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (op->type) {
|
||||
switch (Z_TYPE_P(op)) {
|
||||
case IS_NULL:
|
||||
result = 0;
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
result = (op->value.lval?1:0);
|
||||
result = (Z_LVAL_P(op)?1:0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = (op->value.dval ? 1 : 0);
|
||||
result = (Z_DVAL_P(op) ? 1 : 0);
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (op->value.str.len == 0
|
||||
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
|
||||
if (Z_STRLEN_P(op) == 0
|
||||
|| (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
result = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if(IS_ZEND_STD_OBJECT(*op)) {
|
||||
@@ -102,7 +102,7 @@ static inline int i_zend_is_true(zval *op)
|
||||
|
||||
if (Z_OBJ_HT_P(op)->cast_object) {
|
||||
zval tmp;
|
||||
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL, 0 TSRMLS_CC) == SUCCESS) {
|
||||
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
|
||||
result = Z_LVAL(tmp);
|
||||
break;
|
||||
}
|
||||
@@ -143,7 +143,9 @@ static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
|
||||
|
||||
EG(argument_stack).top -= (delete_count+2);
|
||||
while (--delete_count>=0) {
|
||||
zval_ptr_dtor((zval **) --p);
|
||||
zval *q = *(zval **)(--p);
|
||||
*p = NULL;
|
||||
zval_ptr_dtor(&q);
|
||||
}
|
||||
EG(argument_stack).top_element = p;
|
||||
}
|
||||
@@ -191,7 +193,7 @@ void zend_shutdown_timeout_thread();
|
||||
/* The following tries to resolve the classname of a zval of type object.
|
||||
* Since it is slow it should be only used in error messages.
|
||||
*/
|
||||
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && (zval)->type == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
|
||||
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
|
||||
|
||||
ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var);
|
||||
|
||||
|
||||
Loaded 100 of 1055 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user