mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
512
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d0eafce3a | ||
|
|
6c48c6bc78 | ||
|
|
ed038d2ee3 | ||
|
|
bfb1fe10cb | ||
|
|
d69513afec | ||
|
|
7da6498342 | ||
|
|
5bff1286b6 | ||
|
|
dfc6feb6e8 | ||
|
|
15694f66b2 | ||
|
|
747daa5354 | ||
|
|
72027cd084 | ||
|
|
1fdcc705a4 | ||
|
|
3745bdadc0 | ||
|
|
e6424d89e9 | ||
|
|
b378b0b081 | ||
|
|
e22c139fe0 | ||
|
|
6b8dade6dc | ||
|
|
3f9af558e7 | ||
|
|
768c34e7cd | ||
|
|
5ab6d215fc | ||
|
|
7109f369e8 | ||
|
|
f2ceb4963e | ||
|
|
d5987478a8 | ||
|
|
54d4a28003 | ||
|
|
1af111dd68 | ||
|
|
d0bede2efa | ||
|
|
f38bd22ed2 | ||
|
|
d8023d13eb | ||
|
|
540f325664 | ||
|
|
696852f2bd | ||
|
|
5c06e5c2e0 | ||
|
|
e9b12bedc3 | ||
|
|
9c9fee3f43 | ||
|
|
d82f9339fe | ||
|
|
eba85f91d8 | ||
|
|
b455ba971c | ||
|
|
27c803aaed | ||
|
|
72d1ec883e | ||
|
|
d487f5e9ac | ||
|
|
dc384a571d | ||
|
|
c60067c09a | ||
|
|
1ac4d8f2c6 | ||
|
|
aa7d3d8e6d | ||
|
|
a4862503d4 | ||
|
|
71c24f4c2e | ||
|
|
4bad49e3bc | ||
|
|
cf96aa155e | ||
|
|
c1c49d6e39 | ||
|
|
14f5732096 | ||
|
|
9973658a44 | ||
|
|
0154db1c5f | ||
|
|
98d29d20a1 | ||
|
|
a3fa25e857 | ||
|
|
3da2fb335d | ||
|
|
ac2d2b9b72 | ||
|
|
4a0e87e497 | ||
|
|
cb539b3e96 | ||
|
|
6993ca5bd7 | ||
|
|
0ebef462ce | ||
|
|
060fadca31 | ||
|
|
ba30c78d5c | ||
|
|
8280393828 | ||
|
|
9ad97cd489 | ||
|
|
9d62807190 | ||
|
|
7f69f07fc1 | ||
|
|
dcea4ec698 | ||
|
|
2874696a5a | ||
|
|
f4dc2240a0 | ||
|
|
72aacbf735 | ||
|
|
4134ebec8e | ||
|
|
cf39c3d638 | ||
|
|
36b759d1dd | ||
|
|
503d39d925 | ||
|
|
bff1a96a0f | ||
|
|
0ad81ac18a | ||
|
|
e9b128c1bf | ||
|
|
ac28283beb | ||
|
|
fc7fe62e3b | ||
|
|
a188693a27 | ||
|
|
80fe5461a9 | ||
|
|
4ed133c4e2 | ||
|
|
2743c3aac8 | ||
|
|
a831499b4a | ||
|
|
47d66a0b4e | ||
|
|
3bbe5931bc | ||
|
|
a5c524f1be | ||
|
|
3c5e229212 | ||
|
|
ec4019e8f6 | ||
|
|
cabf38af6d | ||
|
|
f718684a6c | ||
|
|
a93a462dce | ||
|
|
8d86597d73 | ||
|
|
5f137d080a | ||
|
|
a03f0943ca | ||
|
|
d60e168a7a | ||
|
|
ea75b1b5db | ||
|
|
e55f08a5ae | ||
|
|
5753b74fab | ||
|
|
ce9169e360 | ||
|
|
cb13f8318b | ||
|
|
4590070f31 | ||
|
|
4395f70207 | ||
|
|
fd8f454520 | ||
|
|
0a974f14d1 | ||
|
|
1d7b6970f2 | ||
|
|
fd616ba50f | ||
|
|
29b2522df1 | ||
|
|
979194351d | ||
|
|
515092917d | ||
|
|
9909c4d4c4 | ||
|
|
96a53f6715 | ||
|
|
c28ab73d73 | ||
|
|
9b6aa268a3 | ||
|
|
a1bf38e075 | ||
|
|
7c9bb87edd | ||
|
|
25f924abf6 | ||
|
|
f8efdc2b4b | ||
|
|
1b4103c09d | ||
|
|
ba984582db | ||
|
|
da3886de6d | ||
|
|
3380de9774 | ||
|
|
cc91fbe986 | ||
|
|
b963249456 | ||
|
|
a015fa83a7 | ||
|
|
2b9d42433f | ||
|
|
445dffa75a | ||
|
|
b9e3f737d9 | ||
|
|
e6ae977082 | ||
|
|
ba3234888d | ||
|
|
eb8c15b573 | ||
|
|
bb6d74918e | ||
|
|
135f81c5ae | ||
|
|
d3a4af4db8 | ||
|
|
bcb39d9c6a | ||
|
|
9561e598a0 | ||
|
|
e617679c0b | ||
|
|
76775a3aa7 | ||
|
|
2c73ce4363 | ||
|
|
e9a95d78ef | ||
|
|
b79b13b4ef | ||
|
|
bb64106f64 | ||
|
|
2bad01e61b | ||
|
|
a51b50000d | ||
|
|
f4b9b20b35 | ||
|
|
bcef0ebc2d | ||
|
|
07501dc1a2 | ||
|
|
6e3134610c | ||
|
|
add0833681 | ||
|
|
67c03eac62 | ||
|
|
d012bdca03 | ||
|
|
6e32a871a4 | ||
|
|
ebad5178c4 | ||
|
|
eab076020d | ||
|
|
0863a0d6a0 | ||
|
|
281936b295 | ||
|
|
0ddb3d97de | ||
|
|
d2a83efe5b | ||
|
|
b2fbb4cc40 | ||
|
|
5b01b0904f | ||
|
|
2acc386270 | ||
|
|
96f77f845a | ||
|
|
e2e002d4ea | ||
|
|
4c6c048e3e | ||
|
|
9c4ef50146 | ||
|
|
4204e2cb5b | ||
|
|
710eee5555 | ||
|
|
29ac511b8a | ||
|
|
c7ee677f2f | ||
|
|
79df8cf9c2 | ||
|
|
2c3f6dcdb6 | ||
|
|
9fc38183b7 | ||
|
|
e4a28b7b7b | ||
|
|
7d163e8a08 | ||
|
|
e964817b24 | ||
|
|
c652cc93ec | ||
|
|
7549beb102 | ||
|
|
5bc7e597d9 | ||
|
|
0265c2d961 | ||
|
|
74d434c091 | ||
|
|
50ac53e1b1 | ||
|
|
67817a199c | ||
|
|
f4ce5e7fb6 | ||
|
|
4bc11af193 | ||
|
|
c940aab789 | ||
|
|
743c4864eb | ||
|
|
06418aca28 | ||
|
|
46214a23b8 | ||
|
|
87dda666c7 | ||
|
|
ef63334fa6 | ||
|
|
103cf4c060 | ||
|
|
e46beabe8f | ||
|
|
3becd3879f | ||
|
|
8cb782bbce | ||
|
|
e00ed6bc3f | ||
|
|
ce8c023910 | ||
|
|
fa8611c81e | ||
|
|
76866e0a2e | ||
|
|
60dcc5851f | ||
|
|
02682f4169 | ||
|
|
891bd46f3d | ||
|
|
cd176e0452 | ||
|
|
7e33b5d2fa | ||
|
|
f477ad22c2 | ||
|
|
b34e8d2e3e | ||
|
|
8922c50ca4 | ||
|
|
6c8cef3ca4 | ||
|
|
12b75e3d3e | ||
|
|
e15ca39708 | ||
|
|
4289696828 | ||
|
|
12fdf8fb95 | ||
|
|
111b385afe | ||
|
|
a689fde2bf | ||
|
|
04db57066d | ||
|
|
40c3601947 | ||
|
|
2ab53f4b5e | ||
|
|
41b73e4cee | ||
|
|
5d0094e5f9 | ||
|
|
5ae1983b33 | ||
|
|
6ba93a4bae | ||
|
|
a52258ae17 | ||
|
|
423b132a7a | ||
|
|
38eb909d06 | ||
|
|
982c11573d | ||
|
|
d43a2f0ffb | ||
|
|
8776555d7a | ||
|
|
9cf3e65391 | ||
|
|
e3d625bc4e | ||
|
|
a0d48e01ed | ||
|
|
8aba119f55 | ||
|
|
860a5c4b01 | ||
|
|
a0b4348abc | ||
|
|
f1e37d03c1 | ||
|
|
61fb822d1a | ||
|
|
2531307be6 | ||
|
|
8623562b02 | ||
|
|
f5c7fe9202 | ||
|
|
283f56af66 | ||
|
|
b5978e239e | ||
|
|
e4ee921b7e | ||
|
|
9be591bdb5 | ||
|
|
0e55d3a12a | ||
|
|
f0eaa02f6f | ||
|
|
67bde2f8ac | ||
|
|
c666239265 | ||
|
|
25e9aa6b0a | ||
|
|
5edd530511 | ||
|
|
e2bb74ab4f | ||
|
|
dda3f404ec | ||
|
|
2ce4bd7f2d | ||
|
|
6b896fa57f | ||
|
|
5ac0ee30ce | ||
|
|
95cc763a14 | ||
|
|
248414f132 | ||
|
|
272c5edea4 | ||
|
|
ca3e0862db | ||
|
|
cfb1ffb4fa | ||
|
|
ebef8c4176 | ||
|
|
ee01af7df1 | ||
|
|
2a93fd1347 | ||
|
|
7bb052ee3e | ||
|
|
0dc98208ee | ||
|
|
d9c034ee5e | ||
|
|
b5b0a53b09 | ||
|
|
600d6deef9 | ||
|
|
2208447d42 | ||
|
|
088c183639 | ||
|
|
b6dd1ec60d | ||
|
|
49e57a3165 | ||
|
|
7457867ba8 | ||
|
|
8acfa0b3f8 | ||
|
|
02f552ceca | ||
|
|
6238dd6f32 | ||
|
|
10b9579395 | ||
|
|
ed2690477c | ||
|
|
cd1b44c4b6 | ||
|
|
1cc750493f | ||
|
|
eccc05fc44 | ||
|
|
251ec84a97 | ||
|
|
f16143f5ac | ||
|
|
760b7d00c3 | ||
|
|
ac40c0b562 | ||
|
|
04145dc2aa | ||
|
|
ed2e84e239 | ||
|
|
7a1e670d76 | ||
|
|
18403e496d | ||
|
|
0f9cf35315 | ||
|
|
e1e07cb431 | ||
|
|
88c2dbe5fc | ||
|
|
d8792d87cf | ||
|
|
53c39e2b4e | ||
|
|
f68b8a5e74 | ||
|
|
f5f6404260 | ||
|
|
8a8bef1b73 | ||
|
|
f4e3c7ab7c | ||
|
|
336a8e1943 | ||
|
|
fdd7379686 | ||
|
|
f338510c94 | ||
|
|
75c57122e3 | ||
|
|
e14800dd46 | ||
|
|
3cc891bf3a | ||
|
|
ab22fda7e5 | ||
|
|
e8f004d542 | ||
|
|
a7e25bdd48 | ||
|
|
4b96b8f909 | ||
|
|
25cae37b13 | ||
|
|
1aee7ad636 | ||
|
|
5ee047b486 | ||
|
|
ec3bcbcb5a | ||
|
|
3c93402f86 | ||
|
|
f597f5561e | ||
|
|
3c87945c95 | ||
|
|
efdeec3c0e | ||
|
|
93e0d78ec6 | ||
|
|
90bb28726b | ||
|
|
5a04ab9a54 | ||
|
|
7360f0f1e6 | ||
|
|
2463e89794 | ||
|
|
a98359b7b9 | ||
|
|
cbf90b1a90 | ||
|
|
51c065f611 | ||
|
|
25aae37229 | ||
|
|
de42833115 | ||
|
|
79803bebde | ||
|
|
a3b5b42e77 | ||
|
|
598e2690b8 | ||
|
|
bf4a034e3e | ||
|
|
510498947e | ||
|
|
df6ca450ce | ||
|
|
65d233f06c | ||
|
|
0c9f11758f | ||
|
|
2dd67abb7d | ||
|
|
1c623e3b07 | ||
|
|
8b515fa00a | ||
|
|
13e5c97ffd | ||
|
|
bcdac7526d | ||
|
|
2d386db878 | ||
|
|
9f6ca9bc64 | ||
|
|
cd74b7d57e | ||
|
|
4cb25d25f1 | ||
|
|
c53058763a | ||
|
|
c50cef1dc5 | ||
|
|
73eedaf6f7 | ||
|
|
013797588a | ||
|
|
fc2a9d6e47 | ||
|
|
0776337e28 | ||
|
|
de4fd8638b | ||
|
|
d4ad889824 | ||
|
|
2d7415a4af | ||
|
|
646ebc2cb9 | ||
|
|
4828f7343b | ||
|
|
0e99329e0a | ||
|
|
77fffff157 | ||
|
|
1124b0678f | ||
|
|
fb58e69a84 | ||
|
|
7c66c502d0 | ||
|
|
2d5695cbc5 | ||
|
|
b142e8825f | ||
|
|
aff65a0346 | ||
|
|
46b05bc57a | ||
|
|
3eb1745643 | ||
|
|
8dec06ea2a | ||
|
|
d82704b677 | ||
|
|
09470ebf35 | ||
|
|
de82e7edf7 | ||
|
|
86db5fb4c2 | ||
|
|
7ec2e5314e | ||
|
|
ba1af29805 | ||
|
|
1a46a102d9 | ||
|
|
8c36156070 | ||
|
|
74555e7c26 | ||
|
|
f37c54ab27 | ||
|
|
533e636a62 | ||
|
|
156576fcce | ||
|
|
fe21accfb4 | ||
|
|
89159926ad | ||
|
|
dd188e9538 | ||
|
|
d6505acbf5 | ||
|
|
699dc04c55 | ||
|
|
898ddcb9e1 | ||
|
|
1cc2162b83 | ||
|
|
ec4388158d | ||
|
|
f1e5127e7a | ||
|
|
5c701d19ac | ||
|
|
8c3b8f39aa | ||
|
|
c34274acb8 | ||
|
|
3a413f216a | ||
|
|
f1269d80c5 | ||
|
|
b1c24d1eac | ||
|
|
aa4762572e | ||
|
|
b1ea0b7a7a | ||
|
|
e36adfe94a | ||
|
|
a39282b64d | ||
|
|
3828f6227b | ||
|
|
5af2c5d202 | ||
|
|
aa448adc83 | ||
|
|
9996c310d1 | ||
|
|
f087c53130 | ||
|
|
4a34d4a83c | ||
|
|
3fd4b6be63 | ||
|
|
0549e55d82 | ||
|
|
b7b150b830 | ||
|
|
444e59eb20 | ||
|
|
08b72ac9f1 | ||
|
|
331540d20c | ||
|
|
c374b80dda | ||
|
|
d0c40220d1 | ||
|
|
78c48af2f2 | ||
|
|
8492bbefbb | ||
|
|
a7d6cb2360 | ||
|
|
be3f7ba4fb | ||
|
|
ab117573cd | ||
|
|
3f2f534a5c | ||
|
|
1656b337ce | ||
|
|
514afd67b6 | ||
|
|
4a92ae3401 | ||
|
|
4e773c1b92 | ||
|
|
7b9eabaf51 | ||
|
|
15b554cd9b | ||
|
|
8f5a534b21 | ||
|
|
d54432ed98 | ||
|
|
c7b8368ed5 | ||
|
|
e9b03c412b | ||
|
|
cdc1a63790 | ||
|
|
5adf1be45d | ||
|
|
bf5506f511 | ||
|
|
239ba8d58b | ||
|
|
63434524f8 | ||
|
|
671ef9fda7 | ||
|
|
a58a279d7b | ||
|
|
84e5c8a0e2 | ||
|
|
5e24a6e74d | ||
|
|
18fdab5a09 | ||
|
|
43ab915b41 | ||
|
|
4cf0647399 | ||
|
|
b3aa3c2616 | ||
|
|
8febe2ad08 | ||
|
|
f082d6311b | ||
|
|
0b2c411323 | ||
|
|
70b67f2e50 | ||
|
|
b02241b968 | ||
|
|
92bbe6be72 | ||
|
|
39cc08c7e9 | ||
|
|
0802961bd1 | ||
|
|
ecf76e2da8 | ||
|
|
fb955a613c | ||
|
|
4fbe1173eb | ||
|
|
323fdb9879 | ||
|
|
a9271a8b0d | ||
|
|
e694d40963 | ||
|
|
ba292b037f | ||
|
|
4475dbf11d | ||
|
|
684f4d5272 | ||
|
|
b6d54faa92 | ||
|
|
56b028e590 | ||
|
|
782085bbfb | ||
|
|
ceb5b684e0 | ||
|
|
968ae4a56a | ||
|
|
c480bf3fb2 | ||
|
|
224a67fb9f | ||
|
|
442ff25187 | ||
|
|
146d786137 | ||
|
|
ecdf8bcc45 | ||
|
|
aab5659357 | ||
|
|
88b3cdc4e9 | ||
|
|
10d62de4aa | ||
|
|
4d4adf47e0 | ||
|
|
a35d386612 | ||
|
|
9de5dcad1c | ||
|
|
f3ca1155d6 | ||
|
|
28e26b0fad | ||
|
|
b0b81c0a37 | ||
|
|
10367fa7c6 | ||
|
|
39bc1bd25f | ||
|
|
1bcaf771dc | ||
|
|
569eddce0f | ||
|
|
1b60c189ad | ||
|
|
185e5e15ae | ||
|
|
4f2acd8cde | ||
|
|
846d298f9b | ||
|
|
9883d8d3e5 | ||
|
|
934dfae4e1 | ||
|
|
82ac3106e0 | ||
|
|
f4f8b5a94b | ||
|
|
c96a5bc6be | ||
|
|
db3d629f05 | ||
|
|
7fc8077e4c | ||
|
|
99ad08f9a5 | ||
|
|
e8d80b770b | ||
|
|
e34767d426 | ||
|
|
78a9489f6a | ||
|
|
37b20a1bc2 | ||
|
|
d7f709a032 | ||
|
|
c51e32860a | ||
|
|
731a5c5104 | ||
|
|
8e8a75444c | ||
|
|
6b4148bc97 | ||
|
|
7b07d05917 | ||
|
|
9456dac54e | ||
|
|
72426a446d | ||
|
|
1d4fcdff9f | ||
|
|
92aa361bfc | ||
|
|
bbe9052ca3 | ||
|
|
fecce5a55f | ||
|
|
ef93a93ee2 | ||
|
|
242d88c20c | ||
|
|
46ee57f2d7 | ||
|
|
124a867b6a | ||
|
|
640e72ce91 | ||
|
|
ab089611e0 | ||
|
|
55341ac0a8 | ||
|
|
467cd6a60f | ||
|
|
f982aaafa7 |
No files matched your search
+4
-5
@@ -1,10 +1,9 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
branches:
|
||||
except:
|
||||
- /^PHP-5\.3.*/
|
||||
- /^PHP-5\.4.*/
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
+2
-2
@@ -10,7 +10,7 @@ all: $(all_targets)
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@echo
|
||||
|
||||
|
||||
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
|
||||
|
||||
build-binaries: $(PHP_BINARIES)
|
||||
@@ -116,7 +116,7 @@ clean:
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
+9
-6
@@ -45,14 +45,17 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
|
||||
changes now.
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
PHP-5.1 This branch is closed.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ resources cannot be auto-converted.
|
||||
Type specifiers
|
||||
---------------
|
||||
The following list shows the type specifier, its meaning and the parameter
|
||||
types that need to be passed by address. All passed paramaters are set
|
||||
types that need to be passed by address. All passed parameters are set
|
||||
if the PHP parameter is non optional and untouched if optional and the
|
||||
parameter is not present. The only exception is O where the zend_class_entry*
|
||||
has to be provided on input and is used to verify the PHP parameter is an
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
|
||||
+5
-3
@@ -625,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->info = info_handle;
|
||||
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (created) {
|
||||
if (NULL != shm->descriptor && created) {
|
||||
shm->descriptor->shm_perm.key = key;
|
||||
shm->descriptor->shm_segsz = size;
|
||||
shm->descriptor->shm_ctime = time(NULL);
|
||||
@@ -639,8 +639,10 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0;
|
||||
}
|
||||
|
||||
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) {
|
||||
CloseHandle(shm->segment);
|
||||
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
|
||||
if (NULL != shm->segment) {
|
||||
CloseHandle(shm->segment);
|
||||
}
|
||||
UnmapViewOfFile(shm->descriptor);
|
||||
CloseHandle(shm->info);
|
||||
return -1;
|
||||
|
||||
@@ -640,6 +640,9 @@ c. New functions
|
||||
- SPL
|
||||
- class_uses()
|
||||
|
||||
- SplFixedArray
|
||||
- SplFixedArray::__wakeup() (5.4.18)
|
||||
|
||||
d. New global constants
|
||||
|
||||
- CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading
|
||||
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
|
||||
code execution (with specialized executor and direct threading execution
|
||||
method). As in most PHP applications raw execution speed isn't the limiting
|
||||
factor but system calls and database callls are, your mileage with this patch
|
||||
factor but system calls and database calls are, your mileage with this patch
|
||||
will vary.
|
||||
|
||||
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can
|
||||
|
||||
+3
-3
@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
|
||||
that of other object-oriented languages, such as Java: When the
|
||||
last reference to an object is destroyed the object's
|
||||
destructor, which is a class method name __destruct() that
|
||||
recieves no parameters, is called before the object is freed
|
||||
receives no parameters, is called before the object is freed
|
||||
from memory.
|
||||
|
||||
Example:
|
||||
@@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0
|
||||
(supports breakpoints, expression evaluation, step-in/over,
|
||||
function call backtrace, and more).
|
||||
|
||||
The Zend Engine claims 100% compatability with the engine of PHP
|
||||
The Zend Engine claims 100% compatibility with the engine of PHP
|
||||
3.0, and is shamelessly lying about it. Here's why:
|
||||
|
||||
* Static variable initializers only accept scalar values
|
||||
@@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0
|
||||
printed the letter { and the contents of the variable $somevar in
|
||||
PHP 3.0), it will result in a parse error with the Zend Engine.
|
||||
In this case, you would have to change the code to print
|
||||
"\{$somevar"; This incompatability is due to the full variable
|
||||
"\{$somevar"; This incompatibility is due to the full variable
|
||||
reference within quoted strings feature added in the Zend
|
||||
Engine.
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ var_dump($global_var);
|
||||
test_unset3();
|
||||
var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
//Note: No error conditions relating to passing arguments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32428 (The @ warning error supression operator is broken)
|
||||
Bug #32428 (The @ warning error suppression operator is broken)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = @$not_exists;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #60598 (cli/apache sapi segfault on objects manipulation)
|
||||
--FILE--
|
||||
<?php
|
||||
define('OBJECT_COUNT', 10000);
|
||||
|
||||
$containers = array();
|
||||
|
||||
class Object {
|
||||
protected $_guid = 0;
|
||||
public function __construct() {
|
||||
global $containers;
|
||||
$this->guid = 1;
|
||||
$containers[spl_object_hash($this)] = $this;
|
||||
}
|
||||
public function __destruct() {
|
||||
global $containers;
|
||||
$containers[spl_object_hash($this)] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
|
||||
new Object();
|
||||
}
|
||||
|
||||
// You probably won't see this because of the "zend_mm_heap corrupted"
|
||||
?>
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
--EXPECT--
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
@@ -1,9 +1,10 @@
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('./test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $err) { var_dump($err); });
|
||||
|
||||
function x($s) { $s['a'] = 1; };
|
||||
$y = '1';
|
||||
x($y);
|
||||
print_r($y);
|
||||
--EXPECTF--
|
||||
string(25) "Illegal string offset 'a'"
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #64660 (Segfault on memory exhaustion within function definition)
|
||||
--FILE--
|
||||
<?php
|
||||
function a() {
|
||||
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[Line truncated
|
||||
}
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
|
||||
Parse error: memory exhausted in %s on line %d
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #64720 (SegFault on zend_deactivate)
|
||||
--FILE--
|
||||
<?php
|
||||
class Stat {
|
||||
private static $requests;
|
||||
public static function getInstance() {
|
||||
if (!isset(self::$requests[1])) {
|
||||
self::$requests[1] = new self();
|
||||
}
|
||||
return self::$requests[1];
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
unset(self::$requests[1]);
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
Stat::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Error {
|
||||
private $trace;
|
||||
public function __construct() {
|
||||
$this->trace = debug_backtrace(1);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function __destruct() {
|
||||
Stat::getInstance();
|
||||
new Error();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
new Error();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$bar->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->message = NULL;
|
||||
$this->string = NULL;
|
||||
$this->code = array();
|
||||
$this->line = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
$this->file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
|
||||
--XFAIL--
|
||||
We can not fix this bug without a significant (performace slow down) change to gc
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
class bad
|
||||
{
|
||||
private $_private = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_private[] = 'php';
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
global $bar;
|
||||
$bar = $this;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new stdclass;
|
||||
$foo->foo = $foo;
|
||||
$foo->bad = new bad;
|
||||
|
||||
gc_disable();
|
||||
|
||||
unserialize(serialize($foo));
|
||||
gc_collect_cycles();
|
||||
var_dump($bar);
|
||||
/* will output:
|
||||
object(bad)#4 (1) {
|
||||
["_private":"bad":private]=>
|
||||
&UNKNOWN:0
|
||||
}
|
||||
*/
|
||||
?>
|
||||
--EXPECTF--
|
||||
bject(bad)#%d (1) {
|
||||
["_private":"bad":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "php"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #64960 (Segfault in gc_zval_possible_root)
|
||||
--FILE--
|
||||
<?php
|
||||
// this makes ob_end_clean raise an error
|
||||
ob_end_flush();
|
||||
|
||||
class ExceptionHandler {
|
||||
public function __invoke (Exception $e)
|
||||
{
|
||||
// this triggers the custom error handler
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
// this must be a class, closure does not trigger segfault
|
||||
set_exception_handler(new ExceptionHandler());
|
||||
|
||||
// exception must be throwed from error handler.
|
||||
set_error_handler(function()
|
||||
{
|
||||
$e = new Exception;
|
||||
$e->_trace = debug_backtrace();
|
||||
|
||||
throw $e;
|
||||
});
|
||||
|
||||
// trigger error handler
|
||||
$a['waa'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
|
||||
#1 %sbug64960.php(9): ob_end_clean()
|
||||
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
|
||||
#3 {main}
|
||||
thrown in %sbug64960.php on line 19
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
|
||||
|
||||
function test($func) {
|
||||
$a = $func("");
|
||||
return true;
|
||||
}
|
||||
class A {
|
||||
public function b() {
|
||||
test("strlen");
|
||||
test("iterator_apply");
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->b();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
|
||||
#1 %sbug64966.php(6): iterator_apply('')
|
||||
#2 %sbug64966.php(12): test('iterator_apply')
|
||||
#3 %sbug64966.php(17): A->b()
|
||||
#4 {main}
|
||||
thrown in %sbug64966.php on line 3
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64988 (Class loading order affects E_STRICT warning)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Base1 {
|
||||
public function insert(array $data){
|
||||
return array_reverse($data);
|
||||
}
|
||||
}
|
||||
|
||||
class Noisy1 extends Base1 {
|
||||
public function insert(array $data, $option1 = Null) {
|
||||
if (!empty($option1)) {
|
||||
$data['option1'] = $option1;
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
class Smooth1 extends Noisy1 {
|
||||
public function insert(array $data) {
|
||||
return parent::insert($data, count($data));
|
||||
}
|
||||
}
|
||||
|
||||
$o = new Smooth1();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
|
||||
okey
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #65108 (is_callable() triggers Fatal Error)
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private function f() {}
|
||||
static function __callStatic($name, $args) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
public function B() {
|
||||
$isCallable = is_callable(array(new C, 'f'));
|
||||
var_dump($isCallable);
|
||||
}
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
Class E {
|
||||
private function f() {}
|
||||
function __call($name, $args) {}
|
||||
}
|
||||
$isCallable = is_callable(array('E', 'f'));
|
||||
var_dump($isCallable);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
eval("namespace ns_test; class test {}");
|
||||
|
||||
throw new \Exception('abcd');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
\ns_test\test::go();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo 'caught';
|
||||
}
|
||||
--EXPECT--
|
||||
caught
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65291 - get_defined_constants() causes PHP to crash in a very limited case.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public static function testStaticFunction()
|
||||
{
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
class Tester
|
||||
{
|
||||
use TestTrait;
|
||||
}
|
||||
|
||||
$foo = Tester::testStaticFunction();
|
||||
get_defined_constants();
|
||||
get_defined_constants(true);
|
||||
|
||||
echo $foo;
|
||||
?>
|
||||
--EXPECT--
|
||||
Tester
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ParentClass
|
||||
{
|
||||
private static $_OBJECTS;
|
||||
|
||||
public static function Get()
|
||||
{
|
||||
self::$_OBJECTS[1] = new ChildClass();
|
||||
return self::$_OBJECTS[1];
|
||||
}
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClass
|
||||
{
|
||||
public $Manager;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->Manager = $this;
|
||||
}
|
||||
|
||||
public static function &GetCurrent()
|
||||
{
|
||||
return ChildClass::Get();
|
||||
}
|
||||
|
||||
public static function &Get()
|
||||
{
|
||||
return parent::Get();
|
||||
}
|
||||
}
|
||||
|
||||
$staff = ChildClass::GetCurrent();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be returned by reference in %sbug65372.php on line 30
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #65579 (Using traits with get_class_methods causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait ParentTrait {
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
trait ChildTrait {
|
||||
use ParentTrait {
|
||||
testMethod as testMethodFromParentTrait;
|
||||
}
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
class TestClass {
|
||||
use ChildTrait;
|
||||
}
|
||||
|
||||
$obj = new TestClass();
|
||||
var_dump(get_class_methods($obj));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(10) "testMethod"
|
||||
[1]=>
|
||||
string(25) "testmethodfromparenttrait"
|
||||
}
|
||||
@@ -3,7 +3,7 @@ Closure 044: Scope/bounding combination invariants; non static closures
|
||||
--FILE--
|
||||
<?php
|
||||
/* A non-static closure has a bound instance if it has a scope
|
||||
* and does't have an instance if it has no scope */
|
||||
* and doesn't have an instance if it has no scope */
|
||||
|
||||
$nonstaticUnscoped = function () { var_dump(isset(A::$priv)); var_dump(isset($this)); };
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 007: Unreferensed array cycle
|
||||
GC 007: Unreferenced array cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 008: Unreferensed object cycle
|
||||
GC 008: Unreferenced object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 009: Unreferensed array-object cycle
|
||||
GC 009: Unreferenced array-object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Overridding Conflicting Methods should not result in a notice/warning about collisions
|
||||
Overriding Conflicting Methods should not result in a notice/warning about collisions
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
+5
-3
@@ -1091,17 +1091,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
error_filename = "Unknown";
|
||||
}
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if(DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
va_start(args, format);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
va_end(args);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
/* if we don't have a user defined error handler */
|
||||
if (!EG(user_error_handler)
|
||||
|| !(EG(user_error_handler_error_reporting) & type)
|
||||
|
||||
+18
-12
@@ -1143,7 +1143,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
|
||||
|
||||
/* This function requires 'properties' to contain all props declared in the
|
||||
* class and all props being public. If only a subset is given or the class
|
||||
* has protected members then you need to merge the properties seperately by
|
||||
* has protected members then you need to merge the properties separately by
|
||||
* calling zend_merge_properties(). */
|
||||
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
@@ -2514,7 +2514,12 @@ ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_c
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret;
|
||||
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
if (lcname[0] == '\\') {
|
||||
ret = zend_hash_add(CG(class_table), lcname+1, name_len, &ce, sizeof(zend_class_entry *), NULL);
|
||||
} else {
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
if (ret == SUCCESS) {
|
||||
ce->refcount++;
|
||||
@@ -2779,8 +2784,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 &&
|
||||
(fcc->calling_scope &&
|
||||
(fcc->calling_scope->__call ||
|
||||
fcc->calling_scope->__callstatic))) {
|
||||
((fcc->object_ptr && fcc->calling_scope->__call) ||
|
||||
(!fcc->object_ptr && fcc->calling_scope->__callstatic)))) {
|
||||
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) {
|
||||
retval = 0;
|
||||
@@ -3917,15 +3922,16 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
if ((alias_ptr = ce->trait_aliases)) {
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
|
||||
+3
-3
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
|
||||
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
@@ -461,7 +461,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
|
||||
|
||||
/** Clear argumens connected with zend_fcall_info *fci
|
||||
/** Clear arguments connected with zend_fcall_info *fci
|
||||
* If free_mem is not zero then the params array gets free'd as well
|
||||
*/
|
||||
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
|
||||
@@ -499,7 +499,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
|
||||
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
|
||||
|
||||
/** Call a function using information created by zend_fcall_info_init()/args().
|
||||
* If args is given then those replace the arguement info in fci is temporarily.
|
||||
* If args is given then those replace the argument info in fci is temporarily.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
|
||||
|
||||
|
||||
+15
-5
@@ -672,7 +672,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsrq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsr %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
@@ -698,12 +698,12 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsfq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsf %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
bsf eax, _size
|
||||
}
|
||||
}
|
||||
#else
|
||||
static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
|
||||
unsigned int n;
|
||||
@@ -2461,7 +2461,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
@@ -2481,12 +2481,22 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1"
|
||||
#ifdef __ILP32__ /* x32 */
|
||||
# define LP_SUFF "l"
|
||||
#else /* amd64 */
|
||||
# define LP_SUFF "q"
|
||||
#endif
|
||||
|
||||
__asm__ ("mul" LP_SUFF " %3\n\t"
|
||||
"add %4,%0\n\t"
|
||||
"adc $0,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
"rm"(offset));
|
||||
|
||||
#undef LP_SUFF
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
|
||||
@@ -1399,15 +1399,8 @@ ZEND_FUNCTION(class_alias)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!autoload) {
|
||||
lc_name = do_alloca(class_name_len + 1, use_heap);
|
||||
zend_str_tolower_copy(lc_name, class_name, class_name_len);
|
||||
found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC);
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name, use_heap);
|
||||
} else {
|
||||
found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC);
|
||||
}
|
||||
if (found == SUCCESS) {
|
||||
if ((*ce)->type == ZEND_USER_CLASS) {
|
||||
if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1926,6 +1919,11 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
|
||||
zval *name_array = (zval *)arg;
|
||||
zval *const_val;
|
||||
|
||||
if (!constant->name) {
|
||||
/* skip special constants */
|
||||
return 0;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(const_val);
|
||||
*const_val = constant->value;
|
||||
zval_copy_ctor(const_val);
|
||||
@@ -1993,11 +1991,16 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) {
|
||||
zval *const_val;
|
||||
|
||||
if (!val->name) {
|
||||
/* skip special constants */
|
||||
goto next_constant;
|
||||
}
|
||||
|
||||
if (val->module_number == PHP_USER_CONSTANT) {
|
||||
module_number = i;
|
||||
} else if (val->module_number > i || val->module_number < 0) {
|
||||
/* should not happen */
|
||||
goto bad_module_id;
|
||||
goto next_constant;
|
||||
} else {
|
||||
module_number = val->module_number;
|
||||
}
|
||||
@@ -2014,7 +2017,7 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
INIT_PZVAL(const_val);
|
||||
|
||||
add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val);
|
||||
bad_module_id:
|
||||
next_constant:
|
||||
zend_hash_move_forward_ex(EG(zend_constants), &pos);
|
||||
}
|
||||
efree(module_names);
|
||||
@@ -2386,7 +2389,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.
|
||||
/* include_filename always points to the last filename of the last last called-function.
|
||||
if we have called include in the frame above - this is the file we have included.
|
||||
*/
|
||||
|
||||
|
||||
+9
-9
@@ -1723,7 +1723,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
}
|
||||
|
||||
{
|
||||
/* Push a seperator to the switch and foreach stacks */
|
||||
/* Push a separator to the switch and foreach stacks */
|
||||
zend_switch_entry switch_entry;
|
||||
|
||||
switch_entry.cond.op_type = IS_UNUSED;
|
||||
@@ -1817,7 +1817,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
|
||||
/* Pop the switch and foreach seperators */
|
||||
/* Pop the switch and foreach separators */
|
||||
zend_stack_del_top(&CG(switch_cond_stack));
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
}
|
||||
@@ -2584,7 +2584,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
/* If we reach the seperator then stop applying the stack */
|
||||
/* If we reach the separator then stop applying the stack */
|
||||
if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
@@ -3267,11 +3267,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
|
||||
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
|
||||
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
|
||||
efree(method_prototype);
|
||||
}
|
||||
@@ -3744,7 +3744,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
|
||||
#endif
|
||||
} else {
|
||||
/* inherited members are overridden by members inserted by traits */
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
/* check whether the trait method fulfills the inheritance requirements */
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -3911,7 +3911,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
/** With the other traits, we are more permissive.
|
||||
We do not give errors for those. This allows to be more
|
||||
defensive in such definitions.
|
||||
However, we want to make sure that the insteadof declartion
|
||||
However, we want to make sure that the insteadof declaration
|
||||
is consistent in itself.
|
||||
*/
|
||||
j = 0;
|
||||
@@ -5479,7 +5479,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
|
||||
break;
|
||||
}
|
||||
SET_NODE(opline->op1, cmd);
|
||||
opline->op2.opline_num = 0;
|
||||
opline->op2.opline_num = 1;
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
@@ -6943,7 +6943,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
* Find the first occurence of : from the left
|
||||
* Find the first occurrence of : from the left
|
||||
* move the path pointer to the position just after :
|
||||
* increment the len_adjust to the length of path till colon character(inclusive)
|
||||
* If there is no character beyond : simple return len
|
||||
|
||||
+11
-13
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
/* PHP DTrace probes {{{ */
|
||||
static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
{
|
||||
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
|
||||
return EG(current_execute_data)->op_array->filename;
|
||||
@@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
|
||||
{
|
||||
zend_op_array *res;
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
|
||||
res = compile_file(file_handle, type TSRMLS_CC);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t
|
||||
ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *scope, *filename, *funcname, *classname;
|
||||
const char *scope, *filename, *funcname, *classname;
|
||||
scope = filename = funcname = classname = NULL;
|
||||
|
||||
/* we need filename and lineno for both execute and function probes */
|
||||
@@ -58,48 +58,46 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
classname = get_active_class_name(&scope TSRMLS_CC);
|
||||
funcname = get_active_function_name(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
execute(op_array TSRMLS_CC);
|
||||
|
||||
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
execute_internal(execute_data_ptr, return_value_used TSRMLS_CC);
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-4
@@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
|
||||
char *classname;
|
||||
int name_len;
|
||||
const char *classname;
|
||||
zend_uint name_len;
|
||||
|
||||
if (exception != NULL) {
|
||||
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
|
||||
DTRACE_EXCEPTION_THROWN(classname);
|
||||
DTRACE_EXCEPTION_THROWN((char *)classname);
|
||||
} else {
|
||||
DTRACE_EXCEPTION_THROWN(NULL);
|
||||
}
|
||||
@@ -817,6 +817,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
|
||||
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
convert_to_string(file);
|
||||
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
|
||||
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
|
||||
} else {
|
||||
file = NULL;
|
||||
line = NULL;
|
||||
@@ -828,7 +832,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
convert_to_string(str);
|
||||
convert_to_string(file);
|
||||
convert_to_long(line);
|
||||
|
||||
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
} else {
|
||||
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
|
||||
}
|
||||
|
||||
+4
-3
@@ -1145,6 +1145,10 @@ convert_to_array:
|
||||
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
|
||||
}
|
||||
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(dim) != IS_LONG) {
|
||||
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
@@ -1173,9 +1177,6 @@ convert_to_array:
|
||||
convert_to_long(&tmp);
|
||||
dim = &tmp;
|
||||
}
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
container = *container_ptr;
|
||||
result->str_offset.str = container;
|
||||
PZVAL_LOCK(container);
|
||||
|
||||
@@ -254,15 +254,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
|
||||
if (EG(user_error_handler)) {
|
||||
zeh = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
zval_ptr_dtor(&zeh);
|
||||
}
|
||||
|
||||
if (EG(user_exception_handler)) {
|
||||
zeh = EG(user_exception_handler);
|
||||
EG(user_exception_handler) = NULL;
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
zval_ptr_dtor(&zeh);
|
||||
}
|
||||
|
||||
zend_stack_destroy(&EG(user_error_handlers_error_reporting));
|
||||
@@ -1074,7 +1072,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_
|
||||
}
|
||||
|
||||
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
|
||||
* (doesn't impact fuctionality of __autoload()
|
||||
* (doesn't impact functionality of __autoload()
|
||||
*/
|
||||
if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
|
||||
if (!key) {
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
|
||||
gc_root_buffer *first_unused; /* pointer to first unused buffer */
|
||||
gc_root_buffer *last_unused; /* pointer to last unused buffer */
|
||||
|
||||
zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
|
||||
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
|
||||
zval_gc_info *free_list;
|
||||
zval_gc_info *next_to_free;
|
||||
|
||||
@@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
|
||||
GC_ZVAL_INIT(z); \
|
||||
} while (0)
|
||||
|
||||
/* The following macroses override macroses from zend_alloc.h */
|
||||
/* The following macros override macros from zend_alloc.h */
|
||||
#undef ALLOC_ZVAL
|
||||
#define ALLOC_ZVAL(z) \
|
||||
do { \
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ struct _zend_php_scanner_globals {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
@@ -41,17 +41,19 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 3
|
||||
|
||||
%code requires {
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
}
|
||||
|
||||
%token END 0 "end of file"
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%token T_INCLUDE "include (T_INCLUDE)"
|
||||
|
||||
+346
-343
File diff suppressed because it is too large.
Load diff
@@ -44,7 +44,7 @@ typedef struct _zend_lex_state {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
@@ -256,6 +256,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
|
||||
CG(heredoc) = NULL;
|
||||
CG(heredoc_len) = 0;
|
||||
}
|
||||
RESET_DOC_COMMENT();
|
||||
}
|
||||
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
|
||||
@@ -539,6 +540,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
CG(zend_lineno) = 1;
|
||||
}
|
||||
|
||||
RESET_DOC_COMMENT();
|
||||
CG(increment_lineno) = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -583,7 +585,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
zend_do_return(&retval_znode, 0 TSRMLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
if (compiler_result != 0) { /* parser error */
|
||||
zend_bailout();
|
||||
}
|
||||
compilation_successful=1;
|
||||
@@ -689,6 +691,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_set_compiled_filename(filename TSRMLS_CC);
|
||||
CG(zend_lineno) = 1;
|
||||
CG(increment_lineno) = 0;
|
||||
RESET_DOC_COMMENT();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -758,7 +761,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
SCNG(script_filtered) = NULL;
|
||||
}
|
||||
|
||||
if (compiler_result==1) {
|
||||
if (compiler_result != 0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Mar 27 23:52:29 2013 */
|
||||
/* Generated by re2c 0.13.5 on Sun Jun 16 14:52:22 2013 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __tmpvar; \
|
||||
__asm__ ("imulq %3,%0\n" \
|
||||
"adcq $0,%1" \
|
||||
__asm__ ("imul %3,%0\n" \
|
||||
"adc $0,%1" \
|
||||
: "=r"(__tmpvar),"=r"(usedval) \
|
||||
: "0"(a), "r"(b), "1"(0)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
|
||||
@@ -1278,6 +1278,14 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
|
||||
}
|
||||
}
|
||||
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) ||
|
||||
UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) {
|
||||
if (!silent) {
|
||||
zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &CE_STATIC_MEMBERS(ce)[property_info->offset];
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
obj = &objects->object_buckets[i].bucket.obj;
|
||||
obj->refcount--;
|
||||
|
||||
if (obj->refcount == 0) {
|
||||
/* in case gc_collect_cycle is triggered before free_storage */
|
||||
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -162,8 +162,9 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
|
||||
|
||||
for (i = 0; i < ce->default_static_members_count; i++) {
|
||||
if (ce->static_members_table[i]) {
|
||||
zval_ptr_dtor(&ce->static_members_table[i]);
|
||||
zval *p = ce->static_members_table[i];
|
||||
ce->static_members_table[i] = NULL;
|
||||
zval_ptr_dtor(&p);
|
||||
}
|
||||
}
|
||||
ce->static_members_table = NULL;
|
||||
|
||||
@@ -1475,7 +1475,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
|
||||
/* If both are objects sharing the same comparision handler then use is */
|
||||
if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
|
||||
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
|
||||
/* object handles are identical, apprently this is the same object */
|
||||
/* object handles are identical, apparently this is the same object */
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+30
-17
@@ -2229,9 +2229,11 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -2414,9 +2416,11 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -2684,6 +2688,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -2904,9 +2910,12 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2975,7 +2984,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -3140,7 +3149,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
@@ -3264,7 +3275,6 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
|
||||
}
|
||||
|
||||
@@ -3276,7 +3286,6 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
|
||||
}
|
||||
|
||||
@@ -3496,9 +3505,11 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3885,15 +3896,17 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (OP1_TYPE != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
FREE_OP1();
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4925,7 +4938,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
|
||||
+162
-88
@@ -648,6 +648,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -1272,9 +1274,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1389,7 +1393,6 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
|
||||
}
|
||||
|
||||
@@ -1401,7 +1404,6 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
|
||||
}
|
||||
|
||||
@@ -1447,7 +1449,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
@@ -1578,9 +1580,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1746,9 +1750,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1947,9 +1953,11 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -2316,9 +2324,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3419,9 +3430,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3588,9 +3601,11 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3772,15 +3787,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4221,9 +4238,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4895,9 +4914,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5157,15 +5178,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5454,9 +5477,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5698,15 +5723,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -6125,9 +6152,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -6250,7 +6279,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -6717,9 +6746,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -8134,15 +8166,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -9479,15 +9513,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -9904,15 +9940,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -11023,9 +11061,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -11171,7 +11212,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -13490,9 +13533,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -13659,9 +13704,11 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -13843,15 +13890,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -15660,9 +15709,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -17797,9 +17848,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -18059,15 +18112,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -19073,9 +19128,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -19317,15 +19374,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -20910,9 +20969,11 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -22412,9 +22473,11 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -26976,9 +27039,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -27123,7 +27189,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -29420,15 +29488,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -33377,15 +33447,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -34513,15 +34585,17 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
|
||||
@@ -1417,7 +1417,7 @@ for ($i = 1; $i < $argc; $i++) {
|
||||
// Disabling code for old-style executor
|
||||
define("ZEND_VM_OLD_EXECUTOR", 1);
|
||||
} else if ($argv[$i] == "--with-lines") {
|
||||
// Enabling debuging using original zend_vm_def.h
|
||||
// Enabling debugging using original zend_vm_def.h
|
||||
define("ZEND_VM_LINES", 1);
|
||||
} else if ($argv[$i] == "--help") {
|
||||
usage();
|
||||
|
||||
+53
-10
@@ -66,10 +66,10 @@ AC_DEFUN([PHP_EXPAND_PATH],[
|
||||
$2=$1
|
||||
else
|
||||
changequote({,})
|
||||
ep_dir="`echo $1|$SED 's%/*[^/][^/]*/*$%%'`"
|
||||
ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'`
|
||||
changequote([,])
|
||||
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
|
||||
$2="$ep_realdir/`basename \"$1\"`"
|
||||
ep_realdir=`(cd "$ep_dir" && pwd)`
|
||||
$2="$ep_realdir"/`basename "$1"`
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl Library/function existance and build sanity checks
|
||||
dnl Library/function existence and build sanity checks
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl
|
||||
@@ -2342,8 +2342,10 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
|
||||
if test -n "$OPENSSL_LIBS"; then
|
||||
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
|
||||
fi
|
||||
if test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_INCLINE($OPENSSL_INCS)
|
||||
fi
|
||||
fi
|
||||
@@ -2923,14 +2925,17 @@ dnl providerdesc
|
||||
dnl header-file
|
||||
ac_hdrobj=$2
|
||||
|
||||
dnl Add providerdesc.o into global objects when needed
|
||||
dnl Add providerdesc.o or .lo into global objects when needed
|
||||
case $host_alias in
|
||||
*freebsd*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
|
||||
;;
|
||||
*solaris*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
*linux*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2957,15 +2962,53 @@ dnl DTrace objects
|
||||
esac
|
||||
|
||||
dnl Generate Makefile.objects entries
|
||||
dnl The empty $ac_provsrc command stops an implicit circular dependency
|
||||
dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
|
||||
cat>>Makefile.objects<<EOF
|
||||
|
||||
$abs_srcdir/$ac_provsrc:;
|
||||
|
||||
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
|
||||
dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 's,PHP_,DTRACE_,g' \$[]@
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
|
||||
|
||||
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
|
||||
|
||||
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
|
||||
dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
|
||||
EOF
|
||||
|
||||
case $host_alias in
|
||||
*solaris*|*linux*)
|
||||
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
|
||||
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
|
||||
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
|
||||
dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
|
||||
for ac_lo in $PHP_DTRACE_OBJS; do
|
||||
dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
|
||||
done;
|
||||
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
|
||||
echo "[#] Generated by Makefile for libtool" > \$[]@
|
||||
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
|
||||
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
|
||||
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "non_pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
|
||||
EOF
|
||||
|
||||
;;
|
||||
*)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
|
||||
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
])
|
||||
Vendored
+1
-1
@@ -1230,7 +1230,7 @@ if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
|
||||
test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
|
||||
test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
|
||||
|
||||
# We can hardcode non-existant directories.
|
||||
# We can hardcode non-existent directories.
|
||||
if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
|
||||
# If the only mechanism to avoid hardcoding is shlibpath_var, we
|
||||
# have to relink, otherwise we might link with an installed library
|
||||
|
||||
+2
-2
@@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do
|
||||
eval "opt_${opt_OPT}=yes"
|
||||
;;
|
||||
':' )
|
||||
# option with argument (multiple occurances override)
|
||||
# option with argument (multiple occurrences override)
|
||||
eval "opt_${opt_OPT}=\"\$opt_ARG\""
|
||||
;;
|
||||
'+' )
|
||||
# option with argument (multiple occurances append)
|
||||
# option with argument (multiple occurrences append)
|
||||
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
|
||||
;;
|
||||
* )
|
||||
|
||||
+4
-4
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_RELEASE_VERSION=20
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -784,7 +784,7 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.5 1.6 1.7"
|
||||
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
@@ -1582,7 +1582,7 @@ cat <<X
|
||||
| see the file debug.log for error messages. |
|
||||
| |
|
||||
| If you are unable to fix this, send the file debug.log to the |
|
||||
| php-install@lists.php.net mailing list and include appropiate |
|
||||
| php-install@lists.php.net mailing list and include appropriate |
|
||||
| information about your setup. |
|
||||
X
|
||||
fi
|
||||
|
||||
+1
-1
@@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress)
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* Copy the buffer, we have perhaps allocate alot more than we need,
|
||||
/* Copy the buffer, we have perhaps allocate a lot more than we need,
|
||||
so we erealloc() the buffer to the proper size */
|
||||
dest = erealloc(dest, dest_len + 1);
|
||||
dest[dest_len] = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning)
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "testfile.bz2";
|
||||
$filename = "bug51997.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
|
||||
@@ -7,7 +7,7 @@ BZ2 with files
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "testfile.bz2";
|
||||
$filename = "with_files.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
|
||||
@@ -272,6 +272,7 @@
|
||||
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
|
||||
|
||||
#define JEWISH_SDN_OFFSET 347997
|
||||
#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
|
||||
#define NEW_MOON_OF_CREATION 31524
|
||||
|
||||
#define SUNDAY 0
|
||||
@@ -519,7 +520,7 @@ void SdnToJewish(
|
||||
int tishri1After;
|
||||
int yearLength;
|
||||
|
||||
if (sdn <= JEWISH_SDN_OFFSET) {
|
||||
if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #64895: Integer overflow in SndToJewish
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
|
||||
|
||||
foreach ($a as $x) var_dump(jdtojewish($x));
|
||||
--EXPECTF--
|
||||
string(11) "2/22/103759"
|
||||
string(12) "12/13/887605"
|
||||
string(5) "0/0/0"
|
||||
string(5) "0/0/0"
|
||||
@@ -102,8 +102,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
|
||||
|
||||
switch (Z_TYPE_P(z)) {
|
||||
switch (ztype) {
|
||||
case IS_NULL:
|
||||
V_VT(v) = VT_NULL;
|
||||
break;
|
||||
@@ -429,7 +430,7 @@ PHP_FUNCTION(com_variant_create_instance)
|
||||
/* If already an array and VT_ARRAY is passed then:
|
||||
- if only VT_ARRAY passed then do not perform a conversion
|
||||
- if VT_ARRAY plus other type passed then perform conversion
|
||||
but will probably fail (origional behavior)
|
||||
but will probably fail (original behavior)
|
||||
*/
|
||||
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
|
||||
long orig_vt = vt;
|
||||
|
||||
@@ -1068,7 +1068,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
{
|
||||
php_curl *ch = (php_curl *) clientp;
|
||||
php_curl_progress *t = ch->handlers->progress;
|
||||
int length = -1;
|
||||
size_t rval = 0;
|
||||
|
||||
#if PHP_CURL_DEBUG
|
||||
@@ -1118,7 +1117,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
ch->in_callback = 0;
|
||||
if (error == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
|
||||
length = -1;
|
||||
} else if (retval_ptr) {
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
@@ -1373,9 +1371,9 @@ static void curl_free_post(void **post)
|
||||
|
||||
/* {{{ curl_free_slist
|
||||
*/
|
||||
static void curl_free_slist(void **slist)
|
||||
static void curl_free_slist(void *slist)
|
||||
{
|
||||
curl_slist_free_all((struct curl_slist *) *slist);
|
||||
curl_slist_free_all(*((struct curl_slist **) slist));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1443,8 +1441,10 @@ static void alloc_curl_handle(php_curl **ch)
|
||||
(*ch)->handlers->read->stream = NULL;
|
||||
|
||||
zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
|
||||
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
|
||||
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
|
||||
|
||||
(*ch)->to_free->slist = emalloc(sizeof(HashTable));
|
||||
zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1675,6 +1675,7 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch);
|
||||
|
||||
efree(dupch->to_free->slist);
|
||||
efree(dupch->to_free);
|
||||
dupch->to_free = ch->to_free;
|
||||
|
||||
@@ -2184,7 +2185,7 @@ string_copy:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
zend_llist_add_element(&ch->to_free->slist, &slist);
|
||||
zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
@@ -2680,8 +2681,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
/* cURL destructors should be invoked only by last curl handle */
|
||||
if (Z_REFCOUNT_P(ch->clone) <= 1) {
|
||||
zend_llist_clean(&ch->to_free->str);
|
||||
zend_llist_clean(&ch->to_free->slist);
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
zend_hash_destroy(ch->to_free->slist);
|
||||
efree(ch->to_free->slist);
|
||||
efree(ch->to_free);
|
||||
FREE_ZVAL(ch->clone);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ struct _php_curl_send_headers {
|
||||
struct _php_curl_free {
|
||||
zend_llist str;
|
||||
zend_llist post;
|
||||
zend_llist slist;
|
||||
HashTable *slist;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65458 (curl memory leak)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
$init = memory_get_usage();
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]);
|
||||
}
|
||||
|
||||
$preclose = memory_get_usage();
|
||||
curl_close($ch);
|
||||
|
||||
// This is a slightly tricky heuristic, but basically, we want to ensure
|
||||
// $preclose - $init has a delta in the order of bytes, not megabytes. Given
|
||||
// the number of iterations in the loop, if we're wasting memory here, we
|
||||
// should have megs and megs of extra allocations.
|
||||
var_dump(($preclose - $init) < 10000);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+101
-100
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -651,7 +651,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -871,11 +872,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 997 "ext/date/lib/parse_date.re"
|
||||
#line 998 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 879 "ext/date/lib/parse_date.c"
|
||||
#line 880 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -995,7 +996,7 @@ std:
|
||||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1083 "ext/date/lib/parse_date.re"
|
||||
#line 1084 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -1011,7 +1012,7 @@ yy2:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 1015 "ext/date/lib/parse_date.c"
|
||||
#line 1016 "ext/date/lib/parse_date.c"
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1034,7 +1035,7 @@ yy3:
|
||||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1677 "ext/date/lib/parse_date.re"
|
||||
#line 1678 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -1047,7 +1048,7 @@ yy4:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1051 "ext/date/lib/parse_date.c"
|
||||
#line 1052 "ext/date/lib/parse_date.c"
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1358,12 +1359,12 @@ yy12:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1772 "ext/date/lib/parse_date.re"
|
||||
#line 1773 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1367 "ext/date/lib/parse_date.c"
|
||||
#line 1368 "ext/date/lib/parse_date.c"
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2420,11 +2421,11 @@ yy49:
|
||||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1761 "ext/date/lib/parse_date.re"
|
||||
#line 1762 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2428 "ext/date/lib/parse_date.c"
|
||||
#line 2429 "ext/date/lib/parse_date.c"
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2433,12 +2434,12 @@ yy52:
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1766 "ext/date/lib/parse_date.re"
|
||||
#line 1767 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2442 "ext/date/lib/parse_date.c"
|
||||
#line 2443 "ext/date/lib/parse_date.c"
|
||||
yy54:
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2825,7 +2826,7 @@ yy72:
|
||||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
#line 1746 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2840,7 +2841,7 @@ yy73:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2844 "ext/date/lib/parse_date.c"
|
||||
#line 2845 "ext/date/lib/parse_date.c"
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3602,7 +3603,7 @@ yy166:
|
||||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1608 "ext/date/lib/parse_date.re"
|
||||
#line 1609 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3619,7 +3620,7 @@ yy167:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3623 "ext/date/lib/parse_date.c"
|
||||
#line 3624 "ext/date/lib/parse_date.c"
|
||||
yy168:
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4139,7 +4140,7 @@ yy193:
|
||||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1667 "ext/date/lib/parse_date.re"
|
||||
#line 1668 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4148,7 +4149,7 @@ yy194:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4152 "ext/date/lib/parse_date.c"
|
||||
#line 4153 "ext/date/lib/parse_date.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4199,7 +4200,7 @@ yy198:
|
||||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
#line 1414 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4212,7 +4213,7 @@ yy199:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4216 "ext/date/lib/parse_date.c"
|
||||
#line 4217 "ext/date/lib/parse_date.c"
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4481,7 +4482,7 @@ yy222:
|
||||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
#line 1716 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4510,7 +4511,7 @@ yy223:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4514 "ext/date/lib/parse_date.c"
|
||||
#line 4515 "ext/date/lib/parse_date.c"
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5208,7 +5209,7 @@ yy278:
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1691 "ext/date/lib/parse_date.re"
|
||||
#line 1692 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5231,7 +5232,7 @@ yy278:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5235 "ext/date/lib/parse_date.c"
|
||||
#line 5236 "ext/date/lib/parse_date.c"
|
||||
yy280:
|
||||
YYDEBUG(280, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5409,7 +5410,7 @@ yy294:
|
||||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1385 "ext/date/lib/parse_date.re"
|
||||
#line 1386 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5422,7 +5423,7 @@ yy295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5426 "ext/date/lib/parse_date.c"
|
||||
#line 5427 "ext/date/lib/parse_date.c"
|
||||
yy296:
|
||||
YYDEBUG(296, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6642,7 +6643,7 @@ yy362:
|
||||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1529 "ext/date/lib/parse_date.re"
|
||||
#line 1530 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6655,7 +6656,7 @@ yy364:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6659 "ext/date/lib/parse_date.c"
|
||||
#line 6660 "ext/date/lib/parse_date.c"
|
||||
yy365:
|
||||
YYDEBUG(365, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7293,7 +7294,7 @@ yy392:
|
||||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1587 "ext/date/lib/parse_date.re"
|
||||
#line 1588 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7313,7 +7314,7 @@ yy393:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7317 "ext/date/lib/parse_date.c"
|
||||
#line 7318 "ext/date/lib/parse_date.c"
|
||||
yy394:
|
||||
YYDEBUG(394, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -9063,7 +9064,7 @@ yy454:
|
||||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1290 "ext/date/lib/parse_date.re"
|
||||
#line 1291 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9074,7 +9075,7 @@ yy455:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9078 "ext/date/lib/parse_date.c"
|
||||
#line 9079 "ext/date/lib/parse_date.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9634,7 +9635,7 @@ yy475:
|
||||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1427 "ext/date/lib/parse_date.re"
|
||||
#line 1428 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9645,7 +9646,7 @@ yy476:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9649 "ext/date/lib/parse_date.c"
|
||||
#line 9650 "ext/date/lib/parse_date.c"
|
||||
yy477:
|
||||
YYDEBUG(477, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9786,7 +9787,7 @@ yy488:
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1145 "ext/date/lib/parse_date.re"
|
||||
#line 1146 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9802,7 +9803,7 @@ yy488:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9806 "ext/date/lib/parse_date.c"
|
||||
#line 9807 "ext/date/lib/parse_date.c"
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9815,7 +9816,7 @@ yy490:
|
||||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1182 "ext/date/lib/parse_date.re"
|
||||
#line 1183 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9840,7 +9841,7 @@ yy491:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9844 "ext/date/lib/parse_date.c"
|
||||
#line 9845 "ext/date/lib/parse_date.c"
|
||||
yy492:
|
||||
YYDEBUG(492, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10150,7 +10151,7 @@ yy523:
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1162 "ext/date/lib/parse_date.re"
|
||||
#line 1163 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10169,7 +10170,7 @@ yy523:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10173 "ext/date/lib/parse_date.c"
|
||||
#line 10174 "ext/date/lib/parse_date.c"
|
||||
yy525:
|
||||
YYDEBUG(525, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10275,7 +10276,7 @@ yy534:
|
||||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1344 "ext/date/lib/parse_date.re"
|
||||
#line 1345 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -10289,7 +10290,7 @@ yy535:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10293 "ext/date/lib/parse_date.c"
|
||||
#line 10294 "ext/date/lib/parse_date.c"
|
||||
yy536:
|
||||
YYDEBUG(536, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -11026,7 +11027,7 @@ yy605:
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1359 "ext/date/lib/parse_date.re"
|
||||
#line 1360 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11037,7 +11038,7 @@ yy605:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11041 "ext/date/lib/parse_date.c"
|
||||
#line 11042 "ext/date/lib/parse_date.c"
|
||||
yy608:
|
||||
YYDEBUG(608, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11073,7 +11074,7 @@ yy611:
|
||||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1371 "ext/date/lib/parse_date.re"
|
||||
#line 1372 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11086,7 +11087,7 @@ yy612:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11090 "ext/date/lib/parse_date.c"
|
||||
#line 11091 "ext/date/lib/parse_date.c"
|
||||
yy613:
|
||||
YYDEBUG(613, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11727,7 +11728,7 @@ yy656:
|
||||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1330 "ext/date/lib/parse_date.re"
|
||||
#line 1331 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11740,7 +11741,7 @@ yy657:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11744 "ext/date/lib/parse_date.c"
|
||||
#line 11745 "ext/date/lib/parse_date.c"
|
||||
yy658:
|
||||
YYDEBUG(658, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11846,7 +11847,7 @@ yy666:
|
||||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1274 "ext/date/lib/parse_date.re"
|
||||
#line 1275 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11861,7 +11862,7 @@ yy667:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11865 "ext/date/lib/parse_date.c"
|
||||
#line 11866 "ext/date/lib/parse_date.c"
|
||||
yy668:
|
||||
YYDEBUG(668, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12094,7 +12095,7 @@ yy700:
|
||||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
#line 1558 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12114,7 +12115,7 @@ yy701:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12118 "ext/date/lib/parse_date.c"
|
||||
#line 12119 "ext/date/lib/parse_date.c"
|
||||
yy702:
|
||||
YYDEBUG(702, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12666,7 +12667,7 @@ yy763:
|
||||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1302 "ext/date/lib/parse_date.re"
|
||||
#line 1303 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12679,7 +12680,7 @@ yy764:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12683 "ext/date/lib/parse_date.c"
|
||||
#line 12684 "ext/date/lib/parse_date.c"
|
||||
yy765:
|
||||
YYDEBUG(765, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12718,7 +12719,7 @@ yy771:
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1543 "ext/date/lib/parse_date.re"
|
||||
#line 1544 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12731,7 +12732,7 @@ yy771:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12735 "ext/date/lib/parse_date.c"
|
||||
#line 12736 "ext/date/lib/parse_date.c"
|
||||
yy773:
|
||||
YYDEBUG(773, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12869,7 +12870,7 @@ yy783:
|
||||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1578 "ext/date/lib/parse_date.re"
|
||||
#line 1579 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12877,7 +12878,7 @@ yy784:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12881 "ext/date/lib/parse_date.c"
|
||||
#line 12882 "ext/date/lib/parse_date.c"
|
||||
yy785:
|
||||
YYDEBUG(785, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13028,7 +13029,7 @@ yy793:
|
||||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1399 "ext/date/lib/parse_date.re"
|
||||
#line 1400 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -13041,7 +13042,7 @@ yy794:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 13045 "ext/date/lib/parse_date.c"
|
||||
#line 13046 "ext/date/lib/parse_date.c"
|
||||
yy795:
|
||||
YYDEBUG(795, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13256,7 +13257,7 @@ yy814:
|
||||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
#line 1511 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13274,7 +13275,7 @@ yy815:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13278 "ext/date/lib/parse_date.c"
|
||||
#line 13279 "ext/date/lib/parse_date.c"
|
||||
yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13284,7 +13285,7 @@ yy817:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1491 "ext/date/lib/parse_date.re"
|
||||
#line 1492 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13302,7 +13303,7 @@ yy817:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13306 "ext/date/lib/parse_date.c"
|
||||
#line 13307 "ext/date/lib/parse_date.c"
|
||||
yy819:
|
||||
YYDEBUG(819, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13366,7 +13367,7 @@ yy821:
|
||||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1477 "ext/date/lib/parse_date.re"
|
||||
#line 1478 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13379,7 +13380,7 @@ yy822:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13383 "ext/date/lib/parse_date.c"
|
||||
#line 13384 "ext/date/lib/parse_date.c"
|
||||
yy823:
|
||||
YYDEBUG(823, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13482,7 +13483,7 @@ yy842:
|
||||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1451 "ext/date/lib/parse_date.re"
|
||||
#line 1452 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13507,7 +13508,7 @@ yy843:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13511 "ext/date/lib/parse_date.c"
|
||||
#line 13512 "ext/date/lib/parse_date.c"
|
||||
yy844:
|
||||
YYDEBUG(844, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13769,7 +13770,7 @@ yy848:
|
||||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
#line 1440 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13780,7 +13781,7 @@ yy849:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13784 "ext/date/lib/parse_date.c"
|
||||
#line 13785 "ext/date/lib/parse_date.c"
|
||||
yy850:
|
||||
YYDEBUG(850, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14700,7 +14701,7 @@ yy973:
|
||||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1316 "ext/date/lib/parse_date.re"
|
||||
#line 1317 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -14713,7 +14714,7 @@ yy974:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14717 "ext/date/lib/parse_date.c"
|
||||
#line 14718 "ext/date/lib/parse_date.c"
|
||||
yy975:
|
||||
YYDEBUG(975, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15722,7 +15723,7 @@ yy1066:
|
||||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1208 "ext/date/lib/parse_date.re"
|
||||
#line 1209 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15744,7 +15745,7 @@ yy1068:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15748 "ext/date/lib/parse_date.c"
|
||||
#line 15749 "ext/date/lib/parse_date.c"
|
||||
yy1069:
|
||||
YYDEBUG(1069, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15836,7 +15837,7 @@ yy1075:
|
||||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1254 "ext/date/lib/parse_date.re"
|
||||
#line 1255 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15855,7 +15856,7 @@ yy1076:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15859 "ext/date/lib/parse_date.c"
|
||||
#line 15860 "ext/date/lib/parse_date.c"
|
||||
yy1077:
|
||||
YYDEBUG(1077, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16753,7 +16754,7 @@ yy1117:
|
||||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
#line 1651 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16769,7 +16770,7 @@ yy1118:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16773 "ext/date/lib/parse_date.c"
|
||||
#line 16774 "ext/date/lib/parse_date.c"
|
||||
yy1119:
|
||||
YYDEBUG(1119, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16820,7 +16821,7 @@ yy1126:
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1123 "ext/date/lib/parse_date.re"
|
||||
#line 1124 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16841,7 +16842,7 @@ yy1126:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16845 "ext/date/lib/parse_date.c"
|
||||
#line 16846 "ext/date/lib/parse_date.c"
|
||||
yy1128:
|
||||
YYDEBUG(1128, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16949,7 +16950,7 @@ yy1141:
|
||||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
#line 1627 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16972,7 +16973,7 @@ yy1142:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16976 "ext/date/lib/parse_date.c"
|
||||
#line 16977 "ext/date/lib/parse_date.c"
|
||||
yy1143:
|
||||
YYDEBUG(1143, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19649,7 +19650,7 @@ yy1294:
|
||||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1100 "ext/date/lib/parse_date.re"
|
||||
#line 1101 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19671,7 +19672,7 @@ yy1295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19675 "ext/date/lib/parse_date.c"
|
||||
#line 19676 "ext/date/lib/parse_date.c"
|
||||
yy1296:
|
||||
YYDEBUG(1296, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -21362,7 +21363,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1057 "ext/date/lib/parse_date.re"
|
||||
#line 1058 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21387,7 +21388,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21391 "ext/date/lib/parse_date.c"
|
||||
#line 21392 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21823,7 +21824,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1045 "ext/date/lib/parse_date.re"
|
||||
#line 1046 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21834,7 +21835,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21838 "ext/date/lib/parse_date.c"
|
||||
#line 21839 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21869,7 +21870,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1035 "ext/date/lib/parse_date.re"
|
||||
#line 1036 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21878,7 +21879,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21882 "ext/date/lib/parse_date.c"
|
||||
#line 21883 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23890,7 +23891,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 1014 "ext/date/lib/parse_date.re"
|
||||
#line 1015 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23898,7 +23899,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23902 "ext/date/lib/parse_date.c"
|
||||
#line 23903 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -24037,7 +24038,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 1023 "ext/date/lib/parse_date.re"
|
||||
#line 1024 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -24048,7 +24049,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24052 "ext/date/lib/parse_date.c"
|
||||
#line 24053 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24581,7 +24582,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 1002 "ext/date/lib/parse_date.re"
|
||||
#line 1003 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24592,7 +24593,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24596 "ext/date/lib/parse_date.c"
|
||||
#line 24597 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24765,7 +24766,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1776 "ext/date/lib/parse_date.re"
|
||||
#line 1777 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -25123,7 +25124,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
@@ -649,7 +649,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -2130,7 +2131,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
+511
-483
File diff suppressed because it is too large.
Load diff
+309
-32
@@ -39,6 +39,20 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i
|
||||
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define DATE_I64_BUF_LEN 65
|
||||
# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
|
||||
# define DATE_A64I(i, s) i = _atoi64(s)
|
||||
#else
|
||||
#define DATE_I64_BUF_LEN 65
|
||||
# define DATE_I64A(i, s, len) \
|
||||
do { \
|
||||
int st = snprintf(s, len, "%lld", i); \
|
||||
s[st] = '\0'; \
|
||||
} while (0);
|
||||
# define DATE_A64I(i, s) i = atoll(s)
|
||||
#endif
|
||||
|
||||
/* {{{ arginfo */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, format)
|
||||
@@ -472,6 +486,8 @@ const zend_function_entry date_funcs_interval[] = {
|
||||
|
||||
const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
@@ -569,9 +585,13 @@ static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_
|
||||
static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
|
||||
static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int *n TSRMLS_DC);
|
||||
static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
|
||||
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC);
|
||||
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
|
||||
|
||||
/* {{{ Module struct */
|
||||
zend_module_entry date_module_entry = {
|
||||
@@ -977,7 +997,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
|
||||
{
|
||||
smart_str string = {0};
|
||||
int i, length;
|
||||
int i, length = 0;
|
||||
char buffer[97];
|
||||
timelib_time_offset *offset = NULL;
|
||||
timelib_sll isoweek, isoyear;
|
||||
@@ -1332,7 +1352,7 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_parse_date: Backwards compability function */
|
||||
/* {{{ php_parse_date: Backwards compatibility function */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
{
|
||||
timelib_time *parsed_time;
|
||||
@@ -1982,6 +2002,11 @@ static void date_register_classes(TSRMLS_D)
|
||||
zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
|
||||
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_period.clone_obj = date_object_clone_period;
|
||||
date_object_handlers_period.get_properties = date_object_get_properties_period;
|
||||
date_object_handlers_period.get_property_ptr_ptr = NULL;
|
||||
date_object_handlers_period.get_gc = date_object_get_gc_period;
|
||||
date_object_handlers_period.read_property = date_period_read_property;
|
||||
date_object_handlers_period.write_property = date_period_write_property;
|
||||
|
||||
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
|
||||
zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
|
||||
@@ -2081,20 +2106,20 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
|
||||
if (!dateobj->time) {
|
||||
if (!dateobj->time || GC_G(gc_active)) {
|
||||
return props;
|
||||
}
|
||||
|
||||
/* first we add the date and time in ISO format */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL);
|
||||
|
||||
/* then we add the timezone name (or similar) */
|
||||
if (dateobj->time->is_localtime) {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, dateobj->time->zone_type);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
switch (dateobj->time->zone_type) {
|
||||
@@ -2117,7 +2142,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
ZVAL_STRING(zv, dateobj->time->tz_abbr, 1);
|
||||
break;
|
||||
}
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
|
||||
return props;
|
||||
@@ -2229,7 +2254,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
zval *zv;
|
||||
php_interval_obj *intervalobj;
|
||||
|
||||
|
||||
intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
@@ -2240,8 +2264,8 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
|
||||
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
|
||||
MAKE_STD_ZVAL(zv); \
|
||||
ZVAL_LONG(zv, intervalobj->diff->f); \
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
|
||||
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL);
|
||||
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("m", m);
|
||||
@@ -2249,14 +2273,21 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("h", h);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("i", i);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("s", s);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
|
||||
if (intervalobj->diff->days != -99999) {
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
|
||||
} else {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_FALSE(zv);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
|
||||
|
||||
return props;
|
||||
}
|
||||
@@ -2358,6 +2389,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
|
||||
object_init_ex(object, pce);
|
||||
Z_SET_REFCOUNT_P(object, 1);
|
||||
Z_UNSET_ISREF_P(object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -2377,8 +2409,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
timelib_time *now;
|
||||
timelib_tzinfo *tzi = NULL;
|
||||
timelib_error_container *err = NULL;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst;
|
||||
char *new_abbr;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
|
||||
char *new_abbr = NULL;
|
||||
timelib_sll new_offset;
|
||||
|
||||
if (dateobj->time) {
|
||||
@@ -3536,7 +3568,11 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze
|
||||
ALLOC_INIT_ZVAL(retval);
|
||||
Z_SET_REFCOUNT_P(retval, 0);
|
||||
|
||||
ZVAL_LONG(retval, value);
|
||||
if (value != -99999) {
|
||||
ZVAL_LONG(retval, value);
|
||||
} else {
|
||||
ZVAL_FALSE(retval);
|
||||
}
|
||||
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
@@ -3629,30 +3665,48 @@ PHP_METHOD(DateInterval, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
|
||||
{
|
||||
zval **z_arg = NULL;
|
||||
|
||||
if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
|
||||
convert_to_long(*z_arg);
|
||||
return Z_LVAL_PP(z_arg);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
(*intobj)->diff = timelib_rel_time_ctor();
|
||||
|
||||
(*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
|
||||
(*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
|
||||
(*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
|
||||
(*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
|
||||
(*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
|
||||
(*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
|
||||
(*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
|
||||
(*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_long(*z_arg); \
|
||||
(*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = (itype)def; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_string(*z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0);
|
||||
(*intobj)->initialized = 1;
|
||||
|
||||
return 0;
|
||||
@@ -4256,6 +4310,229 @@ PHP_FUNCTION(date_sun_info)
|
||||
timelib_time_dtor(t2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC)
|
||||
{
|
||||
*table = NULL;
|
||||
*n = 0;
|
||||
return zend_std_get_properties(object TSRMLS_CC);
|
||||
}
|
||||
|
||||
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
|
||||
{
|
||||
HashTable *props;
|
||||
zval *zv;
|
||||
php_period_obj *period_obj;
|
||||
|
||||
period_obj = zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
|
||||
if (!period_obj->start || GC_G(gc_active)) {
|
||||
return props;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->start) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->start);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->current) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->current);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->end) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->end);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->interval) {
|
||||
php_interval_obj *interval_obj;
|
||||
object_init_ex(zv, date_ce_interval);
|
||||
interval_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
interval_obj->diff = timelib_rel_time_clone(period_obj->interval);
|
||||
interval_obj->initialized = 1;
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
|
||||
|
||||
/* converted to larger type (int->long); must check when unserializing */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, (long) period_obj->recurrences);
|
||||
zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_BOOL(zv, period_obj->include_start_date);
|
||||
zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
zval **ht_entry;
|
||||
|
||||
/* this function does no rollback on error */
|
||||
|
||||
if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->start = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->end = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->current = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) {
|
||||
php_interval_obj *interval_obj;
|
||||
interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->interval = timelib_rel_time_clone(interval_obj->diff);
|
||||
} else { /* interval is required */
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS &&
|
||||
Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) {
|
||||
period_obj->recurrences = Z_LVAL_PP(ht_entry);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS &&
|
||||
Z_TYPE_PP(ht_entry) == IS_BOOL) {
|
||||
period_obj->include_start_date = Z_BVAL_PP(ht_entry);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
period_obj->initialized = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* {{{ proto DatePeriod::__set_state()
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, __set_state)
|
||||
{
|
||||
php_period_obj *period_obj;
|
||||
zval *array;
|
||||
HashTable *myht;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
myht = Z_ARRVAL_P(array);
|
||||
|
||||
object_init_ex(return_value, date_ce_period);
|
||||
period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto DatePeriod::__wakeup()
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, __wakeup)
|
||||
{
|
||||
zval *object = getThis();
|
||||
php_period_obj *period_obj;
|
||||
HashTable *myht;
|
||||
|
||||
period_obj = zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_read_property */
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC)
|
||||
{
|
||||
zval *zv;
|
||||
if (type != BP_VAR_IS && type != BP_VAR_R) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
|
||||
}
|
||||
|
||||
Z_OBJPROP_P(object); /* build properties hash table */
|
||||
|
||||
zv = std_object_handlers.read_property(object, member, type, key TSRMLS_CC);
|
||||
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
|
||||
/* defensive copy */
|
||||
zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC);
|
||||
MAKE_STD_ZVAL(zv);
|
||||
Z_TYPE_P(zv) = IS_OBJECT;
|
||||
Z_OBJVAL_P(zv) = zov;
|
||||
}
|
||||
|
||||
return zv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_write_property */
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
|
||||
{
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+3
-1
@@ -88,6 +88,8 @@ PHP_FUNCTION(date_interval_format);
|
||||
PHP_FUNCTION(date_interval_create_from_date_string);
|
||||
|
||||
PHP_METHOD(DatePeriod, __construct);
|
||||
PHP_METHOD(DatePeriod, __wakeup);
|
||||
PHP_METHOD(DatePeriod, __set_state);
|
||||
|
||||
/* Options and Configuration */
|
||||
PHP_FUNCTION(date_default_timezone_set);
|
||||
@@ -163,7 +165,7 @@ ZEND_END_MODULE_GLOBALS(date)
|
||||
#define DATEG(v) (date_globals.v)
|
||||
#endif
|
||||
|
||||
/* Backwards compability wrapper */
|
||||
/* Backwards compatibility wrapper */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now);
|
||||
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
|
||||
PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Wrong var_dump(DateInterval->days) value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2Y4DT6H8M');
|
||||
|
||||
var_dump($interval->days);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Test fix for DateTime when date have textual day with dot or other special char at end
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//Set the default time zone
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
echo "*** Testing clone on DateTime objects ***\n";
|
||||
|
||||
// Create a DateTime object..
|
||||
$orig = new DateTime('2012-11-29 17:00:00');
|
||||
|
||||
// String to parse
|
||||
$string = "Thu., Nov. 29, 2012 5:00PM";
|
||||
|
||||
// Create a DateTime object from format
|
||||
$fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string );
|
||||
|
||||
echo "Format method: " . $orig->format("D., M. j, Y g:iA") . "\n";
|
||||
echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n";
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing clone on DateTime objects ***
|
||||
Format method: Thu., Nov. 29, 2012 5:00PM
|
||||
createFromFormat method: Thu., Nov. 29, 2012 5:00PM
|
||||
===DONE===
|
||||
@@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008");
|
||||
$diff = date_diff($date, $other);
|
||||
|
||||
var_dump($diff);
|
||||
--EXPECT--
|
||||
object(DateInterval)#3 (8) {
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -25,8 +25,22 @@ object(DateInterval)#3 (8) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(3)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -15,8 +15,15 @@ DateInterval Object
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>%s
|
||||
[days] =>
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
DateInterval Object
|
||||
(
|
||||
@@ -26,6 +33,13 @@ DateInterval Object
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>%s
|
||||
[days] => 0
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
@@ -17,6 +17,13 @@ DateInterval Object
|
||||
[h] => 4
|
||||
[i] => 0
|
||||
[s] => 0
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] => 30
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
@@ -8,7 +8,7 @@ echo $i->format("%d"), "\n";
|
||||
echo $i->format("%a"), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
object(DateInterval)#1 (8) {
|
||||
object(DateInterval)#1 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -21,10 +21,24 @@ object(DateInterval)#1 (8) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
7
|
||||
(unknown)
|
||||
@@ -4,8 +4,6 @@ Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimest
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 8) die('skip 32-bit only');
|
||||
?>
|
||||
--XFAIL--
|
||||
Waiting for resolution of the 32-bit case.
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
|
||||
@@ -32,7 +32,7 @@ var_dump($unser, $p);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(DateInterval)#3 (8) {
|
||||
object(DateInterval)#3 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -45,12 +45,26 @@ object(DateInterval)#3 (8) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}"
|
||||
string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
|
||||
DateInterval::__set_state(array(
|
||||
'y' => 0,
|
||||
'm' => 0,
|
||||
@@ -58,9 +72,16 @@ DateInterval::__set_state(array(
|
||||
'h' => 4,
|
||||
'i' => 0,
|
||||
's' => 0,
|
||||
'weekday' => 0,
|
||||
'weekday_behavior' => 0,
|
||||
'first_last_day_of' => 0,
|
||||
'invert' => 0,
|
||||
'days' => 0,
|
||||
))object(DateInterval)#5 (8) {
|
||||
'special_type' => 0,
|
||||
'special_amount' => 0,
|
||||
'have_weekday_relative' => 0,
|
||||
'have_special_relative' => 0,
|
||||
))object(DateInterval)#5 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -73,14 +94,78 @@ DateInterval::__set_state(array(
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DatePeriod)#6 (0) {
|
||||
object(DatePeriod)#6 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#4 (3) {
|
||||
["date"]=>
|
||||
string(19) "2003-01-02 08:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
NULL
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#7 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(4)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
object(DateInterval)#4 (8) {
|
||||
object(DateInterval)#8 (15) {
|
||||
["y"]=>
|
||||
int(7)
|
||||
["m"]=>
|
||||
@@ -93,10 +178,74 @@ object(DateInterval)#4 (8) {
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(2)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(1)
|
||||
["days"]=>
|
||||
int(2400)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DatePeriod)#7 (0) {
|
||||
object(DatePeriod)#9 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#6 (3) {
|
||||
["date"]=>
|
||||
string(19) "2003-01-02 08:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
NULL
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#7 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(4)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
@@ -27,6 +27,13 @@ di Object
|
||||
[h] => 0
|
||||
[i] => 0
|
||||
[s] => 0
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
@@ -25,7 +25,7 @@ foreach($intervals as $iv) {
|
||||
echo "==DONE==\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (8) {
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(1)
|
||||
["m"]=>
|
||||
@@ -38,12 +38,26 @@ object(DateInterval)#%d (8) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(1)
|
||||
["days"]=>
|
||||
int(437)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DateInterval)#%d (8) {
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -56,12 +70,26 @@ object(DateInterval)#%d (8) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(294)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DateInterval)#%d (8) {
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -74,10 +102,24 @@ object(DateInterval)#%d (8) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(294)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/)
|
||||
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance)
|
||||
--XFAIL--
|
||||
Bug #53437 Not fixed yet
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1
|
||||
--FILE--
|
||||
<?php
|
||||
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2);
|
||||
@@ -20,9 +18,137 @@ $dpu = unserialize($ser); // $dpu has invalid values???
|
||||
var_dump($dpu);
|
||||
|
||||
echo "Unserialized:\r\n";
|
||||
// ???which leads to CRASH:
|
||||
foreach($dpu as $dt) {
|
||||
echo $dt->format('Y-m-d H:i:s')."\r\n";
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
Original:
|
||||
2010-01-01 00:00:00
|
||||
2010-01-02 00:00:00
|
||||
2010-01-03 00:00:00
|
||||
|
||||
object(DatePeriod)#1 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#2 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-01 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
object(DateTime)#4 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-04 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#5 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(1)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
object(DatePeriod)#5 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#10 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-01 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
object(DateTime)#7 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-04 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#8 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(1)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
Unserialized:
|
||||
2010-01-01 00:00:00
|
||||
2010-01-02 00:00:00
|
||||
2010-01-03 00:00:00
|
||||
==DONE==
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:10:"DatePeriod":0:{}';
|
||||
|
||||
$dp = unserialize($s);
|
||||
|
||||
var_dump($dp);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d
|
||||
@@ -0,0 +1,80 @@
|
||||
--TEST--
|
||||
Bug #53437 DateInterval basic serialization
|
||||
--FILE--
|
||||
<?php
|
||||
$di0 = new DateInterval('P2Y4DT6H8M');
|
||||
|
||||
$s = serialize($di0);
|
||||
|
||||
$di1 = unserialize($s);
|
||||
|
||||
var_dump($di0, $di1);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
object(DateInterval)#1 (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["h"]=>
|
||||
int(6)
|
||||
["i"]=>
|
||||
int(8)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DateInterval)#2 (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["h"]=>
|
||||
int(6)
|
||||
["i"]=>
|
||||
int(8)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
==DONE==
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Bug #53437 DateInterval unserialize bad data, 32 bit
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
|
||||
|
||||
$di = unserialize($s);
|
||||
var_dump($di);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(6)
|
||||
["i"]=>
|
||||
int(8)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(10)
|
||||
["weekday_behavior"]=>
|
||||
int(10)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(9)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
==DONE==
|
||||
@@ -0,0 +1,64 @@
|
||||
--TEST--
|
||||
Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4
|
||||
--INI--
|
||||
date.timezone = Europe/Berlin
|
||||
--FILE--
|
||||
<?php
|
||||
$dt = new DateTime('2009-10-11');
|
||||
|
||||
$df = $dt->diff(new DateTime('2009-10-13'));
|
||||
|
||||
var_dump($df,
|
||||
$df->y,
|
||||
$df->m,
|
||||
$df->d,
|
||||
$df->h,
|
||||
$df->i,
|
||||
$df->s,
|
||||
$df->invert,
|
||||
$df->days);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(2)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(2)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(2)
|
||||
==DONE==
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Bug #53437 DateInterval unserialize bad data, 64 bit
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 8) { die('skip true 64 bit only'); } ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
|
||||
|
||||
$di = unserialize($s);
|
||||
var_dump($di);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
["y"]=>
|
||||
int(2)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(6)
|
||||
["i"]=>
|
||||
int(8)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(10)
|
||||
["weekday_behavior"]=>
|
||||
int(10)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(9223372036854775807)
|
||||
["have_weekday_relative"]=>
|
||||
int(9)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
==DONE==
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV)
|
||||
Bug #55397 (comparison of incomplete DateTime causes SIGSEGV)
|
||||
--INI--
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -28,7 +28,7 @@ object(DateTime)#2 (3) {
|
||||
["timezone"]=>
|
||||
string(3) "EDT"
|
||||
}
|
||||
object(DateInterval)#3 (8) {
|
||||
object(DateInterval)#3 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -41,8 +41,22 @@ object(DateInterval)#3 (8) {
|
||||
int(19)
|
||||
["s"]=>
|
||||
int(40)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(33)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -14,7 +14,7 @@ offset: +1 GMT
|
||||
|
||||
echo "Basic test for date_sunrise() and date_sunset()\n";
|
||||
|
||||
// supress date() function strict msgs
|
||||
// suppress date() function strict msgs
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
|
||||
echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
|
||||
|
||||
+1
-2
@@ -538,7 +538,6 @@ PHP_MINFO_FUNCTION(dba)
|
||||
*/
|
||||
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
{
|
||||
char *v;
|
||||
int val_len;
|
||||
zval *id;
|
||||
dba_info *info = NULL;
|
||||
@@ -889,7 +888,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) {
|
||||
/* Needed becasue some systems do not allow to write to the original
|
||||
/* Needed because some systems do not allow to write to the original
|
||||
* file contents with O_APPEND being set.
|
||||
*/
|
||||
if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) {
|
||||
|
||||
@@ -460,7 +460,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
|
||||
*/
|
||||
static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC)
|
||||
{
|
||||
size_t pos_grp_start, pos_grp_next;
|
||||
size_t pos_grp_start = 0, pos_grp_next;
|
||||
inifile *ini_tmp = NULL;
|
||||
php_stream *fp_tmp = NULL;
|
||||
int ret;
|
||||
|
||||
@@ -8,10 +8,18 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function isLittleEndian() {
|
||||
return 0x00FF === current(unpack('v', pack('S',0x00FF)));
|
||||
}
|
||||
|
||||
$db_file = dirname(__FILE__) .'/129php.cdb';
|
||||
|
||||
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
|
||||
dba_insert(pack('i',129), "Booo!", $db_make);
|
||||
if (isLittleEndian() === FALSE) {
|
||||
dba_insert(pack('V',129), "Booo!", $db_make);
|
||||
} else{
|
||||
dba_insert(pack('i',129), "Booo!", $db_make);
|
||||
}
|
||||
dba_close($db_make);
|
||||
// write md5 checksum of generated database file
|
||||
var_dump(md5_file($db_file));
|
||||
|
||||
Loaded 100 of 766 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user