mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 02:30:50 +00:00
Compare commits
492
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10b84a9015 | ||
|
|
874c727c55 | ||
|
|
338469f596 | ||
|
|
c74bc8360c | ||
|
|
eb8c15b573 | ||
|
|
bb6d74918e | ||
|
|
135f81c5ae | ||
|
|
d3a4af4db8 | ||
|
|
bcb39d9c6a | ||
|
|
9561e598a0 | ||
|
|
e617679c0b | ||
|
|
76775a3aa7 | ||
|
|
2c73ce4363 | ||
|
|
e9a95d78ef | ||
|
|
b79b13b4ef | ||
|
|
bb64106f64 | ||
|
|
2bad01e61b | ||
|
|
a51b50000d | ||
|
|
f4b9b20b35 | ||
|
|
bcef0ebc2d | ||
|
|
07501dc1a2 | ||
|
|
6e3134610c | ||
|
|
add0833681 | ||
|
|
67c03eac62 | ||
|
|
d012bdca03 | ||
|
|
6e32a871a4 | ||
|
|
ebad5178c4 | ||
|
|
eab076020d | ||
|
|
0863a0d6a0 | ||
|
|
281936b295 | ||
|
|
0ddb3d97de | ||
|
|
d2a83efe5b | ||
|
|
b2fbb4cc40 | ||
|
|
5b01b0904f | ||
|
|
2acc386270 | ||
|
|
96f77f845a | ||
|
|
e2e002d4ea | ||
|
|
4c6c048e3e | ||
|
|
9c4ef50146 | ||
|
|
4204e2cb5b | ||
|
|
710eee5555 | ||
|
|
29ac511b8a | ||
|
|
c7ee677f2f | ||
|
|
79df8cf9c2 | ||
|
|
2c3f6dcdb6 | ||
|
|
9fc38183b7 | ||
|
|
e4a28b7b7b | ||
|
|
7d163e8a08 | ||
|
|
e964817b24 | ||
|
|
c652cc93ec | ||
|
|
7549beb102 | ||
|
|
5bc7e597d9 | ||
|
|
0265c2d961 | ||
|
|
74d434c091 | ||
|
|
50ac53e1b1 | ||
|
|
67817a199c | ||
|
|
f4ce5e7fb6 | ||
|
|
4bc11af193 | ||
|
|
c940aab789 | ||
|
|
743c4864eb | ||
|
|
06418aca28 | ||
|
|
46214a23b8 | ||
|
|
87dda666c7 | ||
|
|
ef63334fa6 | ||
|
|
103cf4c060 | ||
|
|
e46beabe8f | ||
|
|
3becd3879f | ||
|
|
8cb782bbce | ||
|
|
e00ed6bc3f | ||
|
|
ce8c023910 | ||
|
|
fa8611c81e | ||
|
|
76866e0a2e | ||
|
|
60dcc5851f | ||
|
|
02682f4169 | ||
|
|
891bd46f3d | ||
|
|
cd176e0452 | ||
|
|
7e33b5d2fa | ||
|
|
f477ad22c2 | ||
|
|
b34e8d2e3e | ||
|
|
8922c50ca4 | ||
|
|
6c8cef3ca4 | ||
|
|
12b75e3d3e | ||
|
|
e15ca39708 | ||
|
|
4289696828 | ||
|
|
12fdf8fb95 | ||
|
|
111b385afe | ||
|
|
a689fde2bf | ||
|
|
04db57066d | ||
|
|
40c3601947 | ||
|
|
2ab53f4b5e | ||
|
|
41b73e4cee | ||
|
|
5d0094e5f9 | ||
|
|
5ae1983b33 | ||
|
|
6ba93a4bae | ||
|
|
a52258ae17 | ||
|
|
423b132a7a | ||
|
|
38eb909d06 | ||
|
|
982c11573d | ||
|
|
d43a2f0ffb | ||
|
|
8776555d7a | ||
|
|
9cf3e65391 | ||
|
|
e3d625bc4e | ||
|
|
a0d48e01ed | ||
|
|
8aba119f55 | ||
|
|
860a5c4b01 | ||
|
|
a0b4348abc | ||
|
|
f1e37d03c1 | ||
|
|
61fb822d1a | ||
|
|
2531307be6 | ||
|
|
8623562b02 | ||
|
|
f5c7fe9202 | ||
|
|
283f56af66 | ||
|
|
b5978e239e | ||
|
|
e4ee921b7e | ||
|
|
9be591bdb5 | ||
|
|
0e55d3a12a | ||
|
|
f0eaa02f6f | ||
|
|
67bde2f8ac | ||
|
|
c666239265 | ||
|
|
25e9aa6b0a | ||
|
|
5edd530511 | ||
|
|
e2bb74ab4f | ||
|
|
dda3f404ec | ||
|
|
2ce4bd7f2d | ||
|
|
6b896fa57f | ||
|
|
5ac0ee30ce | ||
|
|
95cc763a14 | ||
|
|
248414f132 | ||
|
|
272c5edea4 | ||
|
|
ca3e0862db | ||
|
|
cfb1ffb4fa | ||
|
|
ebef8c4176 | ||
|
|
ee01af7df1 | ||
|
|
2a93fd1347 | ||
|
|
7bb052ee3e | ||
|
|
0dc98208ee | ||
|
|
d9c034ee5e | ||
|
|
b5b0a53b09 | ||
|
|
600d6deef9 | ||
|
|
2208447d42 | ||
|
|
088c183639 | ||
|
|
b6dd1ec60d | ||
|
|
49e57a3165 | ||
|
|
7457867ba8 | ||
|
|
8acfa0b3f8 | ||
|
|
02f552ceca | ||
|
|
6238dd6f32 | ||
|
|
10b9579395 | ||
|
|
ed2690477c | ||
|
|
cd1b44c4b6 | ||
|
|
1cc750493f | ||
|
|
eccc05fc44 | ||
|
|
251ec84a97 | ||
|
|
f16143f5ac | ||
|
|
760b7d00c3 | ||
|
|
ac40c0b562 | ||
|
|
04145dc2aa | ||
|
|
ed2e84e239 | ||
|
|
7a1e670d76 | ||
|
|
18403e496d | ||
|
|
0f9cf35315 | ||
|
|
e1e07cb431 | ||
|
|
88c2dbe5fc | ||
|
|
d8792d87cf | ||
|
|
53c39e2b4e | ||
|
|
f68b8a5e74 | ||
|
|
f5f6404260 | ||
|
|
8a8bef1b73 | ||
|
|
f4e3c7ab7c | ||
|
|
336a8e1943 | ||
|
|
fdd7379686 | ||
|
|
f338510c94 | ||
|
|
75c57122e3 | ||
|
|
e14800dd46 | ||
|
|
3cc891bf3a | ||
|
|
ab22fda7e5 | ||
|
|
e8f004d542 | ||
|
|
a7e25bdd48 | ||
|
|
4b96b8f909 | ||
|
|
25cae37b13 | ||
|
|
1aee7ad636 | ||
|
|
5ee047b486 | ||
|
|
ec3bcbcb5a | ||
|
|
3c93402f86 | ||
|
|
f597f5561e | ||
|
|
3c87945c95 | ||
|
|
efdeec3c0e | ||
|
|
93e0d78ec6 | ||
|
|
90bb28726b | ||
|
|
5a04ab9a54 | ||
|
|
7360f0f1e6 | ||
|
|
2463e89794 | ||
|
|
a98359b7b9 | ||
|
|
cbf90b1a90 | ||
|
|
51c065f611 | ||
|
|
25aae37229 | ||
|
|
de42833115 | ||
|
|
79803bebde | ||
|
|
a3b5b42e77 | ||
|
|
598e2690b8 | ||
|
|
bf4a034e3e | ||
|
|
510498947e | ||
|
|
df6ca450ce | ||
|
|
65d233f06c | ||
|
|
0c9f11758f | ||
|
|
2dd67abb7d | ||
|
|
1c623e3b07 | ||
|
|
8b515fa00a | ||
|
|
13e5c97ffd | ||
|
|
bcdac7526d | ||
|
|
2d386db878 | ||
|
|
9f6ca9bc64 | ||
|
|
cd74b7d57e | ||
|
|
4cb25d25f1 | ||
|
|
c53058763a | ||
|
|
c50cef1dc5 | ||
|
|
73eedaf6f7 | ||
|
|
013797588a | ||
|
|
fc2a9d6e47 | ||
|
|
0776337e28 | ||
|
|
de4fd8638b | ||
|
|
d4ad889824 | ||
|
|
2d7415a4af | ||
|
|
646ebc2cb9 | ||
|
|
4828f7343b | ||
|
|
0e99329e0a | ||
|
|
77fffff157 | ||
|
|
1124b0678f | ||
|
|
fb58e69a84 | ||
|
|
7c66c502d0 | ||
|
|
2d5695cbc5 | ||
|
|
b142e8825f | ||
|
|
aff65a0346 | ||
|
|
46b05bc57a | ||
|
|
3eb1745643 | ||
|
|
8dec06ea2a | ||
|
|
d82704b677 | ||
|
|
09470ebf35 | ||
|
|
de82e7edf7 | ||
|
|
86db5fb4c2 | ||
|
|
7ec2e5314e | ||
|
|
ba1af29805 | ||
|
|
1a46a102d9 | ||
|
|
8c36156070 | ||
|
|
74555e7c26 | ||
|
|
f37c54ab27 | ||
|
|
533e636a62 | ||
|
|
156576fcce | ||
|
|
fe21accfb4 | ||
|
|
89159926ad | ||
|
|
dd188e9538 | ||
|
|
d6505acbf5 | ||
|
|
699dc04c55 | ||
|
|
898ddcb9e1 | ||
|
|
1cc2162b83 | ||
|
|
ec4388158d | ||
|
|
f1e5127e7a | ||
|
|
5c701d19ac | ||
|
|
8c3b8f39aa | ||
|
|
c34274acb8 | ||
|
|
3a413f216a | ||
|
|
f1269d80c5 | ||
|
|
b1c24d1eac | ||
|
|
aa4762572e | ||
|
|
b1ea0b7a7a | ||
|
|
e36adfe94a | ||
|
|
a39282b64d | ||
|
|
3828f6227b | ||
|
|
5af2c5d202 | ||
|
|
aa448adc83 | ||
|
|
9996c310d1 | ||
|
|
f087c53130 | ||
|
|
4a34d4a83c | ||
|
|
3fd4b6be63 | ||
|
|
0549e55d82 | ||
|
|
b7b150b830 | ||
|
|
444e59eb20 | ||
|
|
08b72ac9f1 | ||
|
|
331540d20c | ||
|
|
c374b80dda | ||
|
|
d0c40220d1 | ||
|
|
78c48af2f2 | ||
|
|
8492bbefbb | ||
|
|
a7d6cb2360 | ||
|
|
be3f7ba4fb | ||
|
|
ab117573cd | ||
|
|
3f2f534a5c | ||
|
|
1656b337ce | ||
|
|
514afd67b6 | ||
|
|
4a92ae3401 | ||
|
|
4e773c1b92 | ||
|
|
7b9eabaf51 | ||
|
|
15b554cd9b | ||
|
|
8f5a534b21 | ||
|
|
d54432ed98 | ||
|
|
c7b8368ed5 | ||
|
|
e9b03c412b | ||
|
|
cdc1a63790 | ||
|
|
5adf1be45d | ||
|
|
bf5506f511 | ||
|
|
239ba8d58b | ||
|
|
63434524f8 | ||
|
|
671ef9fda7 | ||
|
|
a58a279d7b | ||
|
|
84e5c8a0e2 | ||
|
|
5e24a6e74d | ||
|
|
18fdab5a09 | ||
|
|
43ab915b41 | ||
|
|
4cf0647399 | ||
|
|
b3aa3c2616 | ||
|
|
8febe2ad08 | ||
|
|
f082d6311b | ||
|
|
0b2c411323 | ||
|
|
70b67f2e50 | ||
|
|
b02241b968 | ||
|
|
92bbe6be72 | ||
|
|
39cc08c7e9 | ||
|
|
0802961bd1 | ||
|
|
ecf76e2da8 | ||
|
|
fb955a613c | ||
|
|
4fbe1173eb | ||
|
|
323fdb9879 | ||
|
|
a9271a8b0d | ||
|
|
e694d40963 | ||
|
|
ba292b037f | ||
|
|
4475dbf11d | ||
|
|
684f4d5272 | ||
|
|
b6d54faa92 | ||
|
|
56b028e590 | ||
|
|
782085bbfb | ||
|
|
ceb5b684e0 | ||
|
|
968ae4a56a | ||
|
|
c480bf3fb2 | ||
|
|
224a67fb9f | ||
|
|
442ff25187 | ||
|
|
146d786137 | ||
|
|
ecdf8bcc45 | ||
|
|
aab5659357 | ||
|
|
88b3cdc4e9 | ||
|
|
10d62de4aa | ||
|
|
4d4adf47e0 | ||
|
|
a35d386612 | ||
|
|
9de5dcad1c | ||
|
|
f3ca1155d6 | ||
|
|
28e26b0fad | ||
|
|
b0b81c0a37 | ||
|
|
10367fa7c6 | ||
|
|
39bc1bd25f | ||
|
|
1bcaf771dc | ||
|
|
569eddce0f | ||
|
|
1b60c189ad | ||
|
|
185e5e15ae | ||
|
|
4f2acd8cde | ||
|
|
846d298f9b | ||
|
|
9883d8d3e5 | ||
|
|
934dfae4e1 | ||
|
|
82ac3106e0 | ||
|
|
f4f8b5a94b | ||
|
|
c96a5bc6be | ||
|
|
db3d629f05 | ||
|
|
7fc8077e4c | ||
|
|
99ad08f9a5 | ||
|
|
e8d80b770b | ||
|
|
e34767d426 | ||
|
|
78a9489f6a | ||
|
|
37b20a1bc2 | ||
|
|
d7f709a032 | ||
|
|
c51e32860a | ||
|
|
731a5c5104 | ||
|
|
8e8a75444c | ||
|
|
6b4148bc97 | ||
|
|
7b07d05917 | ||
|
|
9456dac54e | ||
|
|
72426a446d | ||
|
|
1d4fcdff9f | ||
|
|
92aa361bfc | ||
|
|
bbe9052ca3 | ||
|
|
fecce5a55f | ||
|
|
ef93a93ee2 | ||
|
|
242d88c20c | ||
|
|
46ee57f2d7 | ||
|
|
124a867b6a | ||
|
|
640e72ce91 | ||
|
|
ab089611e0 | ||
|
|
55341ac0a8 | ||
|
|
467cd6a60f | ||
|
|
f982aaafa7 | ||
|
|
210d43d7a2 | ||
|
|
85e5e60777 | ||
|
|
1182a3356c | ||
|
|
5e9377ebd5 | ||
|
|
e9f996c00d | ||
|
|
c4686b4de9 | ||
|
|
6f560b0487 | ||
|
|
de71f435d8 | ||
|
|
66682f5abe | ||
|
|
bb18fa448c | ||
|
|
3af4896837 | ||
|
|
04b492a5fe | ||
|
|
638c4b89b7 | ||
|
|
3654ff7366 | ||
|
|
b022e54bd1 | ||
|
|
39a173b79b | ||
|
|
7dce0194c8 | ||
|
|
08624ea90d | ||
|
|
0fd3572f4e | ||
|
|
0881ff0466 | ||
|
|
06a526be3e | ||
|
|
bb935ff8dc | ||
|
|
cfd096fd7c | ||
|
|
8d199c7c4f | ||
|
|
c6f6bf88d8 | ||
|
|
7687b8b81c | ||
|
|
7b0993bfb4 | ||
|
|
984561cfa8 | ||
|
|
84630a1109 | ||
|
|
4a6291508d | ||
|
|
e62bb03257 | ||
|
|
e25b2d7ea5 | ||
|
|
87c8ea15f2 | ||
|
|
db4d473d53 | ||
|
|
85d9d85ce2 | ||
|
|
44197774c0 | ||
|
|
b32405053f | ||
|
|
5de1b08482 | ||
|
|
62364e6e01 | ||
|
|
73c38eca5a | ||
|
|
90c8f16c3b | ||
|
|
b903d2d6cd | ||
|
|
30eff1a697 | ||
|
|
9350f45aca | ||
|
|
5df8cf1975 | ||
|
|
e43c5a8395 | ||
|
|
0777a18703 | ||
|
|
f1e2edff8b | ||
|
|
a328cc452e | ||
|
|
bdaafe3c7b | ||
|
|
98bb5f4798 | ||
|
|
50ad2af503 | ||
|
|
0444708c5c | ||
|
|
7197f0ffcc | ||
|
|
f52b2e6a65 | ||
|
|
6fece94369 | ||
|
|
38847482c8 | ||
|
|
4e46a87392 | ||
|
|
b6fdb60ecf | ||
|
|
2578f7bcc0 | ||
|
|
656fcb67f1 | ||
|
|
d95faef1a1 | ||
|
|
fe2612d71e | ||
|
|
00ecc12c0f | ||
|
|
faf14e9b2e | ||
|
|
e1023affc1 | ||
|
|
6c2564766f | ||
|
|
206cce0d8b | ||
|
|
b36df28dca | ||
|
|
ca4a3e6138 | ||
|
|
357ab3cbad | ||
|
|
a3f020a4be | ||
|
|
c134f2a1a5 | ||
|
|
fe5ce5cb91 | ||
|
|
9bda6a25a5 | ||
|
|
ecf0cbdf3b | ||
|
|
b6656d0ec9 | ||
|
|
03dfa08da9 | ||
|
|
5c5bc7cf1b | ||
|
|
8f533d2dfd | ||
|
|
31a6f8b7f4 | ||
|
|
7ffb77d243 | ||
|
|
7c08232509 | ||
|
|
61099f8585 | ||
|
|
52d1add0fe | ||
|
|
d24ac6953e | ||
|
|
1b58bd39a6 | ||
|
|
064c62e4cf | ||
|
|
1e9bc56775 | ||
|
|
fcd4b5335a | ||
|
|
b5d267aa95 | ||
|
|
7b113d789d | ||
|
|
c16d6befd4 | ||
|
|
bc55a8eb9f | ||
|
|
9a44a9806c | ||
|
|
bae95bd9d4 | ||
|
|
07a13fd9fa | ||
|
|
81e9aa6c8d | ||
|
|
c737b89473 | ||
|
|
8e76d0404b | ||
|
|
021f57ef0e | ||
|
|
afc1debb2f | ||
|
|
cc34dfce16 | ||
|
|
558c5dbe65 | ||
|
|
3e94ce6a97 |
No files matched your search
@@ -96,8 +96,6 @@ stamp-h.in
|
||||
scan_makefile_in.awk
|
||||
TSRM/tsrm_config.h
|
||||
Zend/zend_config.h
|
||||
Zend/zend_dtrace_gen.h
|
||||
Zend/zend_dtrace_gen.hbak
|
||||
Zend/zend_ini_parser.c
|
||||
Zend/zend_ini_parser.h
|
||||
Zend/zend_ini_parser.output
|
||||
|
||||
+4
-19
@@ -1,24 +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
|
||||
|
||||
env:
|
||||
- REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
# Setup Extensions
|
||||
- . ./travis/ext/mysql/setup.sh
|
||||
- . ./travis/ext/mysqli/setup.sh
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script: ./sapi/cli/php run-tests.php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2012 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ $(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
|
||||
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
|
||||
|
||||
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
|
||||
|
||||
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
|
||||
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@@ -18,6 +18,6 @@ $(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
|
||||
|
||||
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
|
||||
|
||||
$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
|
||||
+8
-22
@@ -3,8 +3,6 @@
|
||||
# LCOV
|
||||
#
|
||||
|
||||
LCOV_INCLUDE="."
|
||||
|
||||
lcov: lcov-html
|
||||
|
||||
lcov-test: lcov-clean-data test
|
||||
@@ -14,7 +12,7 @@ php_lcov.info: lcov-test
|
||||
@rm -rf lcov_data/
|
||||
@$(mkinstalldirs) lcov_data/
|
||||
@echo
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq` ;\
|
||||
for x in $$files; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
@@ -41,26 +39,14 @@ php_lcov.info: lcov-test
|
||||
if test -f "$(top_builddir)/$$y.c"; then \
|
||||
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
|
||||
fi; \
|
||||
if test -f "$$x.gcno"; then \
|
||||
cp $$x.gcno lcov_data/$$y.gcno ; \
|
||||
fi; \
|
||||
if test -f "$$x.gcda"; then \
|
||||
cp $$x.gcda lcov_data/$$y.gcda ; \
|
||||
fi; \
|
||||
if test -f "$$x.da"; then \
|
||||
cp $$x.da lcov_data/$$y.da ; \
|
||||
fi; \
|
||||
if test -f "$$x.bb"; then \
|
||||
cp $$x.bb lcov_data/$$y.bb ; \
|
||||
fi; \
|
||||
if test -f "$$x.bbg"; then \
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
test -f "$$x.gcno" && cp $$x.gcno lcov_data/$$y.gcno ; \
|
||||
test -f "$$x.gcda" && cp $$x.gcda lcov_data/$$y.gcda ; \
|
||||
test -f "$$x.da" && cp $$x.da lcov_data/$$y.da ; \
|
||||
test -f "$$x.bb" && cp $$x.bb lcov_data/$$y.bb ; \
|
||||
test -f "$$x.bbg" && cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
done
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
test -d lcov_data/$$dir && rm -rf lcov_data/$$dir ; \
|
||||
done
|
||||
@echo
|
||||
@echo "Generating $@"
|
||||
|
||||
+1
-3
@@ -86,7 +86,7 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
|
||||
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
|
||||
|
||||
test: all
|
||||
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
@@ -102,9 +102,7 @@ test: all
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
TEST_RESULT_EXIT_CODE=$$?; \
|
||||
rm $(top_builddir)/tmp-php.ini; \
|
||||
exit $$TEST_RESULT_EXIT_CODE; \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
+6
-5
@@ -45,15 +45,16 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. It allows for larger
|
||||
enhancements.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.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.3 Is used to release the PHP 5.3.x series. This is current
|
||||
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.
|
||||
|
||||
@@ -28,22 +28,11 @@ Both functions return SUCCESS or FAILURE depending on the result.
|
||||
The auto-conversions are performed as necessary. Arrays, objects, and
|
||||
resources cannot be auto-converted.
|
||||
|
||||
PHP 5.5 includes a new function:
|
||||
|
||||
int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);
|
||||
|
||||
This function behaves like zend_parse_parameters_ex() except that instead of
|
||||
reading the arguments from the stack, it receives a single zval to convert
|
||||
(passed with double indirection). The passed zval may be changed in place as
|
||||
part of the conversion process.
|
||||
|
||||
See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse_parameter
|
||||
|
||||
|
||||
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
|
||||
@@ -76,13 +65,9 @@ Type specifiers
|
||||
will not be touched by the parsing function if they are not
|
||||
passed to it.
|
||||
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
|
||||
! - the parameter it follows can be of specified type or NULL. If NULL is
|
||||
passed and the output for such type is a pointer, then the output
|
||||
pointer is set to a native NULL pointer.
|
||||
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
|
||||
passed after the corresponding bool*, long* or double* arguments,
|
||||
respectively. A non-zero value will be written to the zend_bool iif a
|
||||
PHP NULL is passed.
|
||||
! - the parameter it follows can be of specified type or NULL (applies
|
||||
to all specifiers except for 'b', 'l', and 'd'). If NULL is passed, the
|
||||
results pointer is set to NULL as well.
|
||||
|
||||
|
||||
Note on 64bit compatibility
|
||||
|
||||
+11
-3
@@ -64,9 +64,9 @@ Do not use abbreviations for alpha and beta.
|
||||
``git push --tags origin HEAD``
|
||||
|
||||
8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz,bz2 and xz).
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
9. Copy those three tarballs to www.php.net, in your homedir there should be a
|
||||
9. Copy those two tarballs to www.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick.
|
||||
|
||||
@@ -154,7 +154,15 @@ origin <branch>``".
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
12. Commit those two tarballs to Git (php-distributions.git)
|
||||
12. Commit those two tarballs to web/php-distributions.git, then update the git
|
||||
submodule reference in web/php.git:
|
||||
git submodule init;
|
||||
git submodule update;
|
||||
cd distributions;
|
||||
git pull origin master;
|
||||
cd ..;
|
||||
git commit distributions;
|
||||
git push;
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
The PHP Interpreter
|
||||
===================
|
||||
|
||||
This is the github mirror of the official PHP repository located at
|
||||
http://git.php.net.
|
||||
|
||||
[](http://travis-ci.org/php/php-src)
|
||||
|
||||
Pull Requests
|
||||
=============
|
||||
PHP accepts pull requests via github. Discussions are done on github, but
|
||||
depending on the topic can also be relayed to the official PHP developer
|
||||
mailinglist internals@lists.php.net.
|
||||
|
||||
New features require an RFC and must be accepted by the developers.
|
||||
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
information on the process.
|
||||
|
||||
Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
|
||||
open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
|
||||
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
|
||||
|
||||
After removing magic quotes, the get_magic_quotes_gpc function caused
|
||||
a deprecate warning. get_magic_quotes_gpc can be used to detected
|
||||
the magic_quotes behavior and therefore should not raise a warning at any
|
||||
time. The patch removes this warning
|
||||
|
||||
We do not merge pull requests directly on github. All PRs will be
|
||||
pulled and pushed through http://git.php.net.
|
||||
+171
-40
@@ -3,9 +3,15 @@ $Id$
|
||||
UPGRADE NOTES - PHP X.Y
|
||||
|
||||
1. Internal API changes
|
||||
a. Streams pooling API
|
||||
b. Lowercasing and locales
|
||||
c. zend_qsort_r
|
||||
a. virtual_file_ex
|
||||
b. stat/lstat support
|
||||
c. readlink support
|
||||
d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...)
|
||||
e. Zend\zend_fast_cache.h has been removed
|
||||
f. streams that enclose private streams
|
||||
g. leak_variable
|
||||
h. API Signature changes
|
||||
i. new TSRM function expand_filepath_with_mode
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -16,61 +22,186 @@ UPGRADE NOTES - PHP X.Y
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Streams pooling API
|
||||
a. virtual_file_ex
|
||||
|
||||
The streams pooling API has been removed. The following functions no longer
|
||||
exist:
|
||||
virtual_file_ex takes now a TSRM context as last parameter:
|
||||
CWD_API int virtual_file_ex(cwd_state *state, const char *path,
|
||||
verify_path_func verify_path, int use_realpath TSRLS_DC);
|
||||
|
||||
PHPAPI int php_stream_context_get_link(php_stream_context *context,
|
||||
const char *hostent, php_stream **stream);
|
||||
PHPAPI int php_stream_context_set_link(php_stream_context *context,
|
||||
const char *hostent, php_stream *stream);
|
||||
PHPAPI int php_stream_context_del_link(php_stream_context *context,
|
||||
php_stream *stream);
|
||||
|
||||
b. Lowercasing and locales
|
||||
b. stat/lstat support
|
||||
|
||||
The lowercasing functions in zend_operators.c were split into those that do
|
||||
lowercasing according to locale rules and those that do ASCII lowercasing.
|
||||
ASCII:
|
||||
lstat is now available on all platforms. On unix-like platform
|
||||
php_sys_lstat is an alias to lstat (when avaible). On Windows it is now
|
||||
available using php_sys_lstat. php_sys_stat and php_sys_lstat usage is recommended
|
||||
instead of calling lstat directly, to ensure portability.
|
||||
|
||||
zend_str_tolower_copy
|
||||
zend_str_tolower_dup
|
||||
zend_str_tolower
|
||||
zend_binary_strcasecmp
|
||||
zend_binary_strncasecmp
|
||||
|
||||
Locale-based:
|
||||
zend_binary_strncasecmp_l
|
||||
zend_binary_strcasecmp_l
|
||||
zend_binary_zval_strcasecmp
|
||||
zend_binary_zval_strncasecmp
|
||||
string_compare_function_ex
|
||||
string_case_compare_function
|
||||
c. readlink support
|
||||
|
||||
Internal engine lowercasing will be using ASCII-only rules. User-facing functions,
|
||||
such as strcasecmp, will be using locale rules.
|
||||
readlink is now available on all platforms. On unix-like platform
|
||||
php_sys_readlink is an alias to readlink (when avaible). On Windows it is now
|
||||
available using php_sys_readlink. php_sys_readlink usage is recommended
|
||||
instead of calling readlink directly, to ensure portability.
|
||||
|
||||
Two new functions - zend_binary_strncasecmp_l and zend_binary_strcasecmp_l - added as
|
||||
locale-based counterparts to zend_binary_strcasecmp and zend_binary_strncasecmp.
|
||||
|
||||
c. zend_qsort_r
|
||||
d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...)
|
||||
|
||||
Added the function zend_qsort_r():
|
||||
. zend_function.pass_rest_by_reference is replaced by
|
||||
ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
|
||||
. zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
|
||||
in zend_function.fn_flags
|
||||
. zend_arg_info.required_num_args removed. it was needed only for internal
|
||||
functions. Now the first arg_info for internal function (which has special
|
||||
meaning) is represented by zend_internal_function_info structure.
|
||||
. zend_op_array.size, size_var, size_literal, current_brk_cont,
|
||||
backpatch_count moved into CG(context), because they are used only during
|
||||
compilation.
|
||||
. zend_op_array.start_op is moved into EG(start_op), because it's used
|
||||
only for 'interactive' execution of single top-level op-array.
|
||||
. zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
|
||||
zend_op_array.fn_flags.
|
||||
. op_array.vars array is trimmed (reallocated) during pass_two.
|
||||
. zend_class_entry.constants_updated is replaced by
|
||||
ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
|
||||
. the size of zend_class_entry is reduced by sharing the same memory space
|
||||
by different information for internal and user classes.
|
||||
See zend_class_inttry.info union.
|
||||
|
||||
|
||||
typedef int (*compare_r_func_t)(const void *, const void * TSRMLS_DC, void *);
|
||||
void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC);
|
||||
e. Zend\zend_fast_cache.h
|
||||
|
||||
The extra argument it has (relatively to zend_qsort()) is passed to the
|
||||
comparison function.
|
||||
It should not have been used anymore since php5, but now this header has
|
||||
been removed. The following macros are not available anymore:
|
||||
|
||||
ZEND_FAST_ALLOC(p, type, fc_type)
|
||||
ZEND_FAST_FREE(p, fc_type)
|
||||
ZEND_FAST_ALLOC_REL(p, type, fc_type)
|
||||
ZEND_FAST_FREE_REL(p, fc_type)
|
||||
|
||||
Use emalloc, emalloc_rel, efree or efree_rel instead.
|
||||
|
||||
|
||||
f. Streams that enclose private streams
|
||||
|
||||
Some streams, like the temp:// stream, may enclose private streams. If the
|
||||
outer stream leaks due to a programming error or is not exposed through a
|
||||
zval (and therefore is not deleted when all the zvals are gone), it will
|
||||
be destroyed on shutdown.
|
||||
The problem is that the outer usually wants itself to close the inner stream,
|
||||
so that it may do any other shutdown action that requires the inner stream to
|
||||
be live (e.g. commit data to it). If the outer stream is exposed through a
|
||||
zval and the inner one isn't, this is not a problem because the outer stream
|
||||
will be freed when the zval is destroyed, which happens before the resources
|
||||
are destroyed on shutdown.
|
||||
On resource list shutdown, the cleanup happens in reverse order of resource
|
||||
creation, so if the inner stream was created in the opener of the outer stream,
|
||||
it will be destroyed first.
|
||||
The following functions were added to the streams API to force a predictable
|
||||
destruction order:
|
||||
|
||||
PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);
|
||||
#define php_stream_free_enclosed(stream_enclosed, close_options)
|
||||
PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC);
|
||||
|
||||
Additionally, the following member was added to php_stream:
|
||||
|
||||
struct _php_stream *enclosing_stream;
|
||||
|
||||
and the following macro was added:
|
||||
|
||||
#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32
|
||||
|
||||
The function php_stream_encloses declares the first stream encloses the second.
|
||||
This has the effect that, when the inner stream is closed from a resource
|
||||
destructor it will abort and try to free its enclosing stream instead.
|
||||
To prevent this from happening when the inner stream is freed from the outer
|
||||
stream, the macro php_stream_free_enclosed should be used instead of
|
||||
php_stream_free/php_stream_close/php_stream_pclose, or the flag
|
||||
PHP_STREAM_FREE_IGNORE_ENCLOSING should be directly passed to php_stream_free.
|
||||
The outer stream cannot abstain, in its close callback, from closing the inner
|
||||
stream or clear the enclosing_stream pointer in its enclosed stream by calling
|
||||
php_stream_encloses with the 2nd argument NULL. If this is not done, there will
|
||||
be problems, so observe this requirement when using php_stream_encloses.
|
||||
|
||||
|
||||
g. leak_variable
|
||||
|
||||
The function leak_variable(variable [, leak_data]) was added. It is only
|
||||
available on debug builds. It increments the refcount of a zval or, if the
|
||||
second argument is true and the variable is either an object or a resource
|
||||
it increments the refcounts of those objects instead.
|
||||
|
||||
|
||||
h. API Signature changes
|
||||
|
||||
. zend_list_insert
|
||||
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
|
||||
call: zend_list_insert(a, SOMETYPE TSRMLS_CC);
|
||||
NB: If zend_list_insert is used to register a resource,
|
||||
ZEND_REGISTER_RESOURCE could be used instead.
|
||||
|
||||
. php_le_stream_context(TSRMLS_C)
|
||||
PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
|
||||
call: context = php_stream_context_alloc(TSRMLS_C);
|
||||
|
||||
. php_stream_context_alloc
|
||||
PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D);
|
||||
call: context = php_stream_context_alloc(TSRMLS_C);
|
||||
|
||||
. sapi_get_request_time(TSRMLS_D);
|
||||
SAPI_API double sapi_get_request_time(TSRMLS_D);
|
||||
|
||||
. sapi_register_default_post_reader
|
||||
SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC);
|
||||
|
||||
. sapi_register_treat_data
|
||||
SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC);
|
||||
|
||||
. sapi_register_input_filter
|
||||
SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
|
||||
|
||||
. tsrm_win32_access
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC);
|
||||
|
||||
. popen_ex (win32)
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
|
||||
|
||||
. php_get_current_user
|
||||
PHPAPI php_get_current_user(TSRMLS_D)
|
||||
Call: char *user = php_get_current_user(TSRMLS_C);
|
||||
|
||||
. php_idate
|
||||
PHPAPI php_idate(char format, time_t ts, int localtime TSRMLS_DC)
|
||||
Call: int ret = php_idate(format, ts, localtime TSRMLS_CC)
|
||||
|
||||
. php_escape_html_entities
|
||||
(size_t parameters were ints, previous "quote_style" (now flags) has expanded meaning)
|
||||
PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
|
||||
|
||||
. php_escape_html_entities_ex
|
||||
PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC);
|
||||
|
||||
. php_unescape_html_entities
|
||||
PHPAPI char *php_unescape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
|
||||
|
||||
i.
|
||||
PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC);
|
||||
expand_filepath_with_mode lets define how realpath will behave, using one of the existing mode: CWD_EXPAND , CWD_FILEPATH or CWD_REALPATH.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
========================
|
||||
|
||||
a. Unix build system changes
|
||||
-
|
||||
|
||||
- Changes in SAPI module build:
|
||||
. When adding new binary SAPI (executable, like CLI/CGI/FPM) use CLI config.m4 and Makefile.frag files as templates and replace CLI/cli with your SAPI name.
|
||||
|
||||
- New macros:
|
||||
. PHP_INIT_DTRACE(providerdesc, header-file, sources [, module])
|
||||
|
||||
|
||||
b. Windows build system changes
|
||||
- Drop Windows XP and 2003 support.
|
||||
-
|
||||
|
||||
+3
-4
@@ -17,8 +17,7 @@ libZend_la_SOURCES=\
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c \
|
||||
zend_default_classes.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c \
|
||||
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
|
||||
zend_generators.c
|
||||
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
@@ -32,7 +31,7 @@ zend_ini_scanner.lo: zend_ini_parser.h
|
||||
# Language parser/scanner rules
|
||||
|
||||
zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l
|
||||
|
||||
zend_language_parser.h: zend_language_parser.c
|
||||
zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@@ -44,7 +43,7 @@ zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
|
||||
|
||||
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l
|
||||
|
||||
zend_ini_parser.h: zend_ini_parser.c
|
||||
|
||||
|
||||
+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.
|
||||
@@ -159,10 +159,6 @@ SOURCE=.\zend_float.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -185,10 +185,6 @@ SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 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,37 +0,0 @@
|
||||
--TEST--
|
||||
Bug #18556 (Setting locale to 'tr_TR' lowercases class names)
|
||||
--FILE--
|
||||
<?php
|
||||
$g_lang = 'tr_TR';
|
||||
putenv("LANG=$g_lang");
|
||||
setlocale(LC_ALL, $g_lang);
|
||||
|
||||
class InfoBlob {
|
||||
var $foo;
|
||||
function InfoBlob() {
|
||||
$this->foo = "Foo";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Instantiating an infoBlob with a lowercase i\n";
|
||||
$foobar = new infoBlob();
|
||||
echo $foobar->foo;
|
||||
echo "\nInstantiating an InfoBlob with an uppercase I\n";
|
||||
$foobar = new InfoBlob();
|
||||
echo $foobar->foo;
|
||||
echo "\n";
|
||||
setlocale(LC_ALL, "tr_TR.utf8");
|
||||
foreach(get_declared_classes() as $class)
|
||||
{
|
||||
if(!class_exists($class))
|
||||
echo "$class No Longer Exists!\n";
|
||||
|
||||
}
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Instantiating an infoBlob with a lowercase i
|
||||
Foo
|
||||
Instantiating an InfoBlob with an uppercase I
|
||||
Foo
|
||||
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;
|
||||
|
||||
@@ -13,8 +13,10 @@ function eh()
|
||||
set_error_handler("eh");
|
||||
$a = $empty($b);
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:%d
|
||||
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
|
||||
Stack trace:
|
||||
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d, Array)
|
||||
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug51394.php on line %d
|
||||
thrown in %sbug51394.php on line 4
|
||||
|
||||
Fatal error: Function name must be a string in %sbug51394.php on line 9
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60738 Allow 'set_error_handler' to handle NULL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(set_error_handler(
|
||||
function() { echo 'Intercepted error!', "\n"; }
|
||||
));
|
||||
|
||||
trigger_error('Error!');
|
||||
|
||||
var_dump(set_error_handler(null));
|
||||
|
||||
trigger_error('Error!');
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
Intercepted error!
|
||||
object(Closure)#1 (0) {
|
||||
}
|
||||
|
||||
Notice: Error! in %s on line %d
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60738 Allow 'set_error_handler' to handle NULL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(set_exception_handler(
|
||||
function() { echo 'Intercepted exception!', "\n"; }
|
||||
));
|
||||
|
||||
var_dump(set_exception_handler(null));
|
||||
|
||||
throw new Exception('Exception!');
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
object(Closure)#1 (0) {
|
||||
}
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' with message 'Exception!' in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -4,6 +4,7 @@ test of larger than 8kb text file being parsed by require statement
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60833 (self, parent, static behave inconsistently case-sensitive)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
static $x = "A";
|
||||
function testit() {
|
||||
$this->v1 = new sELF;
|
||||
$this->v2 = new SELF;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
static $x = "B";
|
||||
function testit() {
|
||||
PARENT::testit();
|
||||
$this->v3 = new sELF;
|
||||
$this->v4 = new PARENT;
|
||||
$this->v4 = STATIC::$x;
|
||||
}
|
||||
}
|
||||
$t = new B();
|
||||
$t->testit();
|
||||
var_dump($t);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(B)#%d (4) {
|
||||
["v1"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["v2"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["v3"]=>
|
||||
object(B)#%d (0) {
|
||||
}
|
||||
["v4"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61681: Malformed grammar
|
||||
--FILE--
|
||||
<?php
|
||||
$la = "ooxx";
|
||||
|
||||
echo "${substr('laruence', 0, 2)}";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ooxx
|
||||
@@ -17,16 +17,18 @@ $undefined->foo();
|
||||
--EXPECTF--
|
||||
Error handler called (Undefined variable: undefined)
|
||||
|
||||
Fatal error: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:%d
|
||||
Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
|
||||
Stack trace:
|
||||
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
|
||||
#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug61767.php on line %d
|
||||
thrown in %sbug61767.php on line 13
|
||||
|
||||
Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
|
||||
Shutting down
|
||||
Array
|
||||
(
|
||||
[type] => 1
|
||||
[message] => %a
|
||||
[message] => Call to a member function foo() on a non-object
|
||||
[file] => %sbug61767.php
|
||||
[line] => %d
|
||||
[line] => 13
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #62343 (Show class_alias In get_declared_classes())
|
||||
--FILE--
|
||||
<?php
|
||||
class a { }
|
||||
class_alias("a", "b");
|
||||
$c = get_declared_classes();
|
||||
var_dump(end($c));
|
||||
var_dump(prev($c));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "b"
|
||||
string(1) "a"
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62991 (Segfault with generator and closure)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test( array $array )
|
||||
{
|
||||
$closure = function() use ( $array ) {
|
||||
print_r( $array );
|
||||
yield "hi";
|
||||
};
|
||||
return $closure();
|
||||
}
|
||||
|
||||
function test2( array $array )
|
||||
{
|
||||
$closure = function() use ( $array ) {
|
||||
print_r( $array );
|
||||
yield "hi";
|
||||
};
|
||||
return $closure; // if you return the $closure and call it outside this function it works.
|
||||
}
|
||||
|
||||
$generator = test(array( 1, 2, 3 ) );
|
||||
foreach($generator as $something) {
|
||||
}
|
||||
|
||||
$generator = test2(array( 1, 2, 3 ) );
|
||||
foreach($generator() as $something) {
|
||||
}
|
||||
|
||||
|
||||
$generator = test2(array( 1, 2, 3 ) );
|
||||
|
||||
echo "okey\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
okey
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63741 (Crash when autoloading from spl)
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents(dirname(__FILE__)."/bug63741.tmp.php",
|
||||
<<<'EOT'
|
||||
<?php
|
||||
if (isset($autoloading))
|
||||
{
|
||||
class ClassToLoad
|
||||
{
|
||||
static function func ()
|
||||
{
|
||||
print "OK!\n";
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
class autoloader
|
||||
{
|
||||
static function autoload($classname)
|
||||
{
|
||||
print "autoloading...\n";
|
||||
$autoloading = true;
|
||||
include __FILE__;
|
||||
}
|
||||
}
|
||||
|
||||
spl_autoload_register(["autoloader", "autoload"]);
|
||||
|
||||
function start()
|
||||
{
|
||||
ClassToLoad::func();
|
||||
}
|
||||
|
||||
start();
|
||||
}
|
||||
?>
|
||||
EOT
|
||||
);
|
||||
|
||||
include dirname(__FILE__)."/bug63741.tmp.php";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?>
|
||||
--EXPECT--
|
||||
autoloading...
|
||||
OK!
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #63976 (Parent class incorrectly using child constant in class property)
|
||||
--FILE--
|
||||
<?php
|
||||
if (1) {
|
||||
class Foo {
|
||||
const TABLE = "foo";
|
||||
public $table = self::TABLE;
|
||||
}
|
||||
}
|
||||
if (1) {
|
||||
class Bar extends Foo {
|
||||
const TABLE = "bar";
|
||||
}
|
||||
}
|
||||
$bar = new Bar();
|
||||
var_dump($bar->table);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64135 (Exceptions from set_error_handler are not always propagated)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function exception_error_handler() {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
set_error_handler("exception_error_handler");
|
||||
try {
|
||||
$undefined->undefined();
|
||||
} catch(Exception $e) {
|
||||
echo "Exception is thrown";
|
||||
}
|
||||
--EXPECT--
|
||||
Exception is thrown
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #64239 (get_class_methods() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
}
|
||||
}
|
||||
print_r(get_class_methods("A"));
|
||||
print_r(get_class_methods("B"));
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T1;
|
||||
public function test() { $this->backtrace(); }
|
||||
}
|
||||
|
||||
class B {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
}
|
||||
|
||||
trait T1 {
|
||||
protected function backtrace() {
|
||||
$b = new B();
|
||||
$b->Bmethod();
|
||||
}
|
||||
}
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
|
||||
}
|
||||
}
|
||||
$a = new A();
|
||||
$a->test();
|
||||
|
||||
$c = new C();
|
||||
$c->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->Bmethod();
|
||||
$a->t2method();
|
||||
|
||||
$c = new C();
|
||||
$c->Bmethod();
|
||||
$c->t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
#0 C->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public static function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public static function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
A::Bmethod();
|
||||
A::t2method();
|
||||
|
||||
C::Bmethod();
|
||||
C::t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
#0 C::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
|
||||
--FILE--
|
||||
<?php
|
||||
class B implements Serializable {
|
||||
public function serialize() {
|
||||
throw new Exception("serialize");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function unserialize($data) {
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(new B);
|
||||
|
||||
try {
|
||||
serialize($data);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(9) "serialize"
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
Bug #64417 (BC break: ArrayAccess::&offsetGet() in a trait causes fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait aa {
|
||||
private $container = array();
|
||||
public function offsetSet($offset, $value) {
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
public function &offsetGet($offset) {
|
||||
$result = null;
|
||||
if (isset($this->container[$offset])) {
|
||||
$result = &$this->container[$offset];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
class obj implements ArrayAccess {
|
||||
use aa;
|
||||
}
|
||||
|
||||
$o = new obj;
|
||||
$o['x'] = 1;
|
||||
++$o['x'];
|
||||
echo $o['x'], "\n";
|
||||
--EXPECT--
|
||||
2
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($unused = null, $unused = null, $arg = array()) {
|
||||
return 1;
|
||||
}
|
||||
foo();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $err) { var_dump($err); });
|
||||
|
||||
function x($s) { $s['a'] = 1; };
|
||||
$y = '1';
|
||||
x($y);
|
||||
print_r($y);
|
||||
--EXPECTF--
|
||||
string(25) "Illegal string offset 'a'"
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #64660 (Segfault on memory exhaustion within function definition)
|
||||
--FILE--
|
||||
<?php
|
||||
function a() {
|
||||
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[Line truncated
|
||||
}
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
|
||||
Parse error: memory exhausted in %s on line %d
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #64720 (SegFault on zend_deactivate)
|
||||
--FILE--
|
||||
<?php
|
||||
class Stat {
|
||||
private static $requests;
|
||||
public static function getInstance() {
|
||||
if (!isset(self::$requests[1])) {
|
||||
self::$requests[1] = new self();
|
||||
}
|
||||
return self::$requests[1];
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
unset(self::$requests[1]);
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
Stat::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Error {
|
||||
private $trace;
|
||||
public function __construct() {
|
||||
$this->trace = debug_backtrace(1);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function __destruct() {
|
||||
Stat::getInstance();
|
||||
new Error();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
new Error();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$bar->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->message = NULL;
|
||||
$this->string = NULL;
|
||||
$this->code = array();
|
||||
$this->line = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
$this->file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #64960 (Segfault in gc_zval_possible_root)
|
||||
--FILE--
|
||||
<?php
|
||||
// this makes ob_end_clean raise an error
|
||||
ob_end_flush();
|
||||
|
||||
class ExceptionHandler {
|
||||
public function __invoke (Exception $e)
|
||||
{
|
||||
// this triggers the custom error handler
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
// this must be a class, closure does not trigger segfault
|
||||
set_exception_handler(new ExceptionHandler());
|
||||
|
||||
// exception must be throwed from error handler.
|
||||
set_error_handler(function()
|
||||
{
|
||||
$e = new Exception;
|
||||
$e->_trace = debug_backtrace();
|
||||
|
||||
throw $e;
|
||||
});
|
||||
|
||||
// trigger error handler
|
||||
$a['waa'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
|
||||
#1 %sbug64960.php(9): ob_end_clean()
|
||||
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
|
||||
#3 {main}
|
||||
thrown in %sbug64960.php on line 19
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
|
||||
|
||||
function test($func) {
|
||||
$a = $func("");
|
||||
return true;
|
||||
}
|
||||
class A {
|
||||
public function b() {
|
||||
test("strlen");
|
||||
test("iterator_apply");
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->b();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
|
||||
#1 %sbug64966.php(6): iterator_apply('')
|
||||
#2 %sbug64966.php(12): test('iterator_apply')
|
||||
#3 %sbug64966.php(17): A->b()
|
||||
#4 {main}
|
||||
thrown in %sbug64966.php on line 3
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #64988 (Class loading order affects E_STRICT warning)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Base1 {
|
||||
public function insert(array $data){
|
||||
return array_reverse($data);
|
||||
}
|
||||
}
|
||||
|
||||
class Noisy1 extends Base1 {
|
||||
public function insert(array $data, $option1 = Null) {
|
||||
if (!empty($option1)) {
|
||||
$data['option1'] = $option1;
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
class Smooth1 extends Noisy1 {
|
||||
public function insert(array $data) {
|
||||
return parent::insert($data, count($data));
|
||||
}
|
||||
}
|
||||
|
||||
$o = new Smooth1();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
|
||||
okey
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #65108 (is_callable() triggers Fatal Error)
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private function f() {}
|
||||
static function __callStatic($name, $args) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
public function B() {
|
||||
$isCallable = is_callable(array(new C, 'f'));
|
||||
var_dump($isCallable);
|
||||
}
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
Class E {
|
||||
private function f() {}
|
||||
function __call($name, $args) {}
|
||||
}
|
||||
$isCallable = is_callable(array('E', 'f'));
|
||||
var_dump($isCallable);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
eval("namespace ns_test; class test {}");
|
||||
|
||||
throw new \Exception('abcd');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
\ns_test\test::go();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo 'caught';
|
||||
}
|
||||
--EXPECT--
|
||||
caught
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (basic test)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($throw = FALSE) {
|
||||
try {
|
||||
echo "try\n";
|
||||
if ($throw) {
|
||||
throw new Exception("ex");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "catch\n";
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
}
|
||||
|
||||
echo "end\n";
|
||||
}
|
||||
|
||||
foo();
|
||||
echo "\n";
|
||||
foo(true);
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
finally
|
||||
end
|
||||
|
||||
try
|
||||
catch
|
||||
finally
|
||||
end
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (basic test with return)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
try {
|
||||
echo "try\n";
|
||||
return 1;
|
||||
} catch (Exception $e) {
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
var_dump(foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
finally
|
||||
int(1)
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (with multi-returns)
|
||||
--FILE--
|
||||
<?php
|
||||
function dummy($msg) {
|
||||
var_dump($msg);
|
||||
}
|
||||
|
||||
function foo ($a) {
|
||||
try {
|
||||
dummy("try");
|
||||
return $a;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
} finally {
|
||||
dummy("finally");
|
||||
return "finally";
|
||||
}
|
||||
return "end";
|
||||
}
|
||||
|
||||
function &bar($a) {
|
||||
try {
|
||||
echo "try\n";
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $e) {
|
||||
} finally {
|
||||
return $a;
|
||||
}
|
||||
return ($c = "end");
|
||||
}
|
||||
var_dump(foo("para"));
|
||||
var_dump(bar("para"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "try"
|
||||
string(7) "finally"
|
||||
string(7) "finally"
|
||||
try
|
||||
string(4) "para"
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (nesting try-catch-finally)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function throw_exception($msg) {
|
||||
throw new Exception($msg);
|
||||
}
|
||||
|
||||
function foo (&$ex) {
|
||||
try {
|
||||
echo "1";
|
||||
try {
|
||||
echo "2";
|
||||
throw_exception("try");
|
||||
} catch (Exception $e) {
|
||||
echo "3";
|
||||
throw_exception("catch");
|
||||
} finally {
|
||||
echo "4";
|
||||
throw_exception("finally");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$ex = $e;
|
||||
echo "3";
|
||||
} finally {
|
||||
echo "2";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
var_dump(foo($ex));
|
||||
|
||||
do {
|
||||
var_dump($ex->getMessage());
|
||||
} while ($ex = $ex->getPrevious());
|
||||
?>
|
||||
--EXPECT--
|
||||
123432int(1)
|
||||
string(7) "finally"
|
||||
string(5) "catch"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (with multi-returns and exception)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($a) {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (PdoException $e) {
|
||||
die("error");
|
||||
} catch (Exception $e) {
|
||||
return 2;
|
||||
} finally {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
var_dump(foo("para"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(3)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (re-throw exception in catch block)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($a) {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $e) {
|
||||
var_dump($a);
|
||||
throw $e;
|
||||
} finally {
|
||||
var_dump("finally");
|
||||
return "return";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(foo("para"));
|
||||
} catch (Exception $e) {
|
||||
"caught exception" . PHP_EOL;
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "para"
|
||||
string(7) "finally"
|
||||
string(6) "return"
|
||||
@@ -1,77 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
// compile time constants
|
||||
const A = self::class;
|
||||
const B = Two::class;
|
||||
}
|
||||
class Two extends One {
|
||||
public static function run() {
|
||||
var_dump(self::class); // self compile time lookup
|
||||
var_dump(static::class); // runtime lookup
|
||||
var_dump(parent::class); // runtime lookup
|
||||
var_dump(Baz::class); // default compile time lookup
|
||||
}
|
||||
}
|
||||
class Three extends Two {
|
||||
// compile time static lookups
|
||||
public static function checkCompileTime(
|
||||
$one = self::class,
|
||||
$two = Baz::class,
|
||||
$three = One::A,
|
||||
$four = self::B
|
||||
) {
|
||||
var_dump($one, $two, $three, $four);
|
||||
}
|
||||
}
|
||||
echo "In NS\n";
|
||||
var_dump(Moo::CLASS); // resolve in namespace
|
||||
}
|
||||
|
||||
namespace {
|
||||
use Bee\Bop as Moo,
|
||||
Foo\Bar\One;
|
||||
echo "Top\n";
|
||||
var_dump(One::class); // resolve from use
|
||||
var_dump(Boo::class); // resolve in global namespace
|
||||
var_dump(Moo::CLASS); // resolve from use as
|
||||
var_dump(\Moo::Class); // resolve fully qualified
|
||||
$class = One::class; // assign class as scalar to var
|
||||
$x = new $class; // create new class from original scalar assignment
|
||||
var_dump($x);
|
||||
Foo\Bar\Two::run(); // resolve runtime lookups
|
||||
echo "Parent\n";
|
||||
Foo\Bar\Three::run(); // resolve runtime lookups with inheritance
|
||||
echo "Compile Check\n";
|
||||
Foo\Bar\Three::checkCompileTime();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
In NS
|
||||
string(11) "Foo\Bar\Moo"
|
||||
Top
|
||||
string(11) "Foo\Bar\One"
|
||||
string(3) "Boo"
|
||||
string(7) "Bee\Bop"
|
||||
string(3) "Moo"
|
||||
object(Foo\Bar\One)#1 (0) {
|
||||
}
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
Parent
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(13) "Foo\Bar\Three"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
Compile Check
|
||||
string(13) "Foo\Bar\Three"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Two"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static in class constant
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
const Baz = static::class;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: static::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in class constant
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
const Baz = parent::class;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: parent::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static in method signature
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
public function baz($x = static::class) {}
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: static::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in method signature
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
public function baz($x = parent::class) {}
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: parent::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static non class context
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = static::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot access static::class when no class scope is active in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in non class context
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = parent::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot access parent::class when no class scope is active in %s on line %d
|
||||
@@ -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,21 +0,0 @@
|
||||
--TEST--
|
||||
Const array deference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump(array(1, 2, 3, 4,) [3]);
|
||||
var_dump(array(1, 2, 3, 4,) ['foo']);
|
||||
var_dump(array(array(1,2,3), array(4, 5, 6))[1][2]);
|
||||
|
||||
foreach (array(array(1, 2, 3))[0] as $var) {
|
||||
echo $var;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(4)
|
||||
|
||||
Notice: Undefined index: foo in %sconst_dereference_001.php on line %d
|
||||
NULL
|
||||
int(6)
|
||||
123
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Const string dereference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump("foobar"[3]);
|
||||
var_dump("foobar"[2][0]);
|
||||
var_dump("foobar"["foo"]["bar"]);
|
||||
|
||||
--EXPECTF--
|
||||
string(1) "b"
|
||||
string(1) "o"
|
||||
|
||||
Warning: Illegal string offset 'foo' in %sconst_dereference_002.php on line %d
|
||||
|
||||
Warning: Illegal string offset 'bar' in %sconst_dereference_002.php on line %d
|
||||
string(1) "f"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Const array deference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump([1, 2, 3, 4,][3]);
|
||||
var_dump([1, 2, 3, 4]['foo']);
|
||||
var_dump([array(1,2,3), [4, 5, 6]][1][2]);
|
||||
|
||||
foreach (array([1, 2, 3])[0] as $var) {
|
||||
echo $var;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(4)
|
||||
|
||||
Notice: Undefined index: foo in %sconst_dereference_003.php on line %d
|
||||
NULL
|
||||
int(6)
|
||||
123
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
empty() with arbitrary expressions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function getEmptyArray() { return []; }
|
||||
function getNonEmptyArray() { return [1, 2, 3]; }
|
||||
|
||||
var_dump(empty([]));
|
||||
var_dump(empty([1, 2, 3]));
|
||||
|
||||
var_dump(empty(getEmptyArray()));
|
||||
var_dump(empty(getNonEmptyArray()));
|
||||
|
||||
var_dump(empty([] + []));
|
||||
var_dump(empty([1, 2, 3] + []));
|
||||
|
||||
var_dump(empty("string"));
|
||||
var_dump(empty(""));
|
||||
var_dump(empty(true));
|
||||
var_dump(empty(false));
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
errmsg: cannot create references to temp array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach (array(1,2,3) as $k=>&$v) {
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot create references to elements of a temporary array expression in %s on line %d
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Exceptions before fatal error
|
||||
--FILE--
|
||||
<?php
|
||||
function exception_error_handler($code, $msg) {
|
||||
throw new Exception($msg);
|
||||
}
|
||||
|
||||
set_error_handler("exception_error_handler");
|
||||
|
||||
try {
|
||||
$foo->a();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
new $foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
throw $foo;
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$foo::b();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$b = clone $foo;
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
class b {
|
||||
}
|
||||
|
||||
try {
|
||||
b::$foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
foreach with list syntax
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach(array(array(1,2), array(3,4)) as list($a, $b)) {
|
||||
var_dump($a . $b);
|
||||
}
|
||||
|
||||
$array = array(
|
||||
array('a', 'b'),
|
||||
array('c', 'd'),
|
||||
);
|
||||
|
||||
foreach ($array as list($a, $b)) {
|
||||
var_dump($a . $b);
|
||||
}
|
||||
|
||||
|
||||
$multi = array(
|
||||
array(array(1,2), array(3,4)),
|
||||
array(array(5,6), array(7,8)),
|
||||
);
|
||||
|
||||
foreach ($multi as list(list($a, $b), list($c, $d))) {
|
||||
var_dump($a . $b . $c . $d);
|
||||
}
|
||||
|
||||
foreach ($multi as $key => list(list($a, $b), list($c, $d))) {
|
||||
var_dump($key . $a . $b . $c . $d);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "12"
|
||||
string(2) "34"
|
||||
string(2) "ab"
|
||||
string(2) "cd"
|
||||
string(4) "1234"
|
||||
string(4) "5678"
|
||||
string(5) "01234"
|
||||
string(5) "15678"
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
foreach with freak lists
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach (array(array(1,2), array(3,4)) as list($a, )) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as list(list(), $a)) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(3)
|
||||
string(1) "b"
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
|
||||
string(0) ""
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
|
||||
string(0) ""
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
foreach with list key
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as list($key) => list(list(), $a)) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use list as key element in %sforeach_list_003.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
foreach with empty list
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as $key => list()) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use empty list in %sforeach_list_004.php on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Temporary array expressions can be iterated by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 'a';
|
||||
$b = 'b';
|
||||
|
||||
foreach ([&$a, &$b] as &$value) {
|
||||
$value .= '-foo';
|
||||
}
|
||||
|
||||
var_dump($a, $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "a-foo"
|
||||
string(5) "b-foo"
|
||||
@@ -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,22 +0,0 @@
|
||||
--TEST--
|
||||
Generator keys are auto-incrementing by default
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 'foo';
|
||||
yield 'bar';
|
||||
yield 5 => 'rab';
|
||||
yield 'oof';
|
||||
}
|
||||
|
||||
foreach (gen() as $k => $v) {
|
||||
echo $k, ' => ', $v, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0 => foo
|
||||
1 => bar
|
||||
5 => rab
|
||||
6 => oof
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Printing the stack trace in a generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function f1() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
|
||||
function f2($arg1, $arg2) {
|
||||
f1();
|
||||
yield; // force generator
|
||||
}
|
||||
|
||||
function f3($gen) {
|
||||
$gen->rewind(); // trigger run
|
||||
}
|
||||
|
||||
$gen = f2('foo', 'bar');
|
||||
f3($gen);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 f1() called at [%s:%d]
|
||||
#1 f2(foo, bar)
|
||||
#2 Generator->rewind() called at [%s:%d]
|
||||
#3 f3(Generator Object ()) called at [%s:%d]
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63066 (Calling an undefined method in a generator results in a seg fault)
|
||||
--FILE--
|
||||
<?php
|
||||
function gen($o)
|
||||
{
|
||||
yield 'foo';
|
||||
$o->fatalError();
|
||||
}
|
||||
|
||||
foreach(gen(new stdClass()) as $value)
|
||||
echo $value, "\n";
|
||||
--EXPECTF--
|
||||
foo
|
||||
|
||||
Fatal error: Call to undefined method stdClass::fatalError() in %sbug63066.php on line 5
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Generators can be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function firstN($end) {
|
||||
for ($i = 0; $i < $end; ++$i) {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
|
||||
$g1 = firstN(5);
|
||||
var_dump($g1->current());
|
||||
$g1->next();
|
||||
|
||||
$g2 = clone $g1;
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
|
||||
var_dump($g2->current());
|
||||
var_dump($g1->current());
|
||||
|
||||
$g1->next();
|
||||
var_dump($g1->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator after an object method was called
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A { public function b() { } }
|
||||
|
||||
function gen() {
|
||||
$a = new A;
|
||||
$a->b();
|
||||
yield;
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
|
||||
echo "Done";
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator with a foreach loop properly adds a ref for the loop var
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
foreach ([1, 2, 3] as $i) {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
var_dump($g1->current());
|
||||
|
||||
$g2 = clone $g1;
|
||||
var_dump($g2->current());
|
||||
|
||||
$g1->next();
|
||||
$g2->next();
|
||||
var_dump($g1->current());
|
||||
var_dump($g2->current());
|
||||
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
var_dump($g2->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(2)
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Tests cloning a generator with properties
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$g1 = gen();
|
||||
$g1->prop = 'val';
|
||||
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
|
||||
var_dump($g2->prop);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "val"
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
A generator with an active stack can be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
var_dump(str_repeat("x", yield));
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->send(10);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(10) "xxxxxxxxxx"
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
A generator using a symbol table can be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
// force compiled variable for $foo
|
||||
$foo = 'foo';
|
||||
|
||||
// force symbol table
|
||||
extract(['foo' => 'bar']);
|
||||
|
||||
// interrupt
|
||||
yield;
|
||||
|
||||
var_dump($foo);
|
||||
}
|
||||
|
||||
$g1 = gen();
|
||||
$g1->rewind();
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Cloning a generator method (with $this)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
protected $foo;
|
||||
|
||||
public function gen() {
|
||||
$this->foo = 'bar';
|
||||
yield; // interrupt
|
||||
var_dump($this->foo);
|
||||
}
|
||||
}
|
||||
|
||||
$g1 = (new Test)->gen();
|
||||
$g1->rewind(); // goto yield
|
||||
$g2 = clone $g1;
|
||||
unset($g1);
|
||||
$g2->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
It's possible to invoke a generator dynamically
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen($foo, $bar) {
|
||||
yield $foo;
|
||||
yield $bar;
|
||||
}
|
||||
|
||||
$gen = call_user_func('gen', 'bar', 'foo');
|
||||
foreach ($gen as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
string(3) "foo"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Generators cannot return values (even before yield)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
return $foo;
|
||||
yield;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Generators cannot return values using "return" in %s on line 4
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Generators cannot return values
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
return $abc;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Generators cannot return values using "return" in %s on line 5
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
The Generator class cannot be extended
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ExtendedGenerator extends Generator { }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class ExtendedGenerator may not inherit from final class (Generator) in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
It's not possible to directly instantiate the Generator class
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
new Generator;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Catchable fatal error: The "Generator" class is reserved for internal use and cannot be manually instantiated in %s on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Non-ref generators cannot be iterated by-ref
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$gen = gen();
|
||||
foreach ($gen as &$value) { }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'You can only iterate a generator by-reference if it declared that it yields by-reference' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unknown()
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
It is not possible to resume an already running generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$gen = yield;
|
||||
$gen->next();
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->send($gen);
|
||||
$gen->next();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot resume an already running generator in %s on line %d
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Generators can't be serialized or unserialized
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$gen = gen();
|
||||
|
||||
try {
|
||||
serialize($gen);
|
||||
} catch (Exception $e) {
|
||||
echo $e, "\n\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(unserialize('O:9:"Generator":0:{}'));
|
||||
} catch (Exception $e) {
|
||||
echo $e, "\n\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(unserialize('C:9:"Generator":0:{}'));
|
||||
} catch (Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
exception 'Exception' with message 'Serialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): serialize(Object(Generator))
|
||||
#1 {main}
|
||||
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: Generator->__wakeup()
|
||||
#1 %s(%d): unserialize('O:9:"Generator"...')
|
||||
#2 {main}
|
||||
|
||||
|
||||
Notice: unserialize(): Error at offset 19 of 20 bytes in %s on line %d
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unserialize('C:9:"Generator"...')
|
||||
#1 {main}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
A notice is thrown when yielding a constant value by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &gen() {
|
||||
yield "foo";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
var_dump($gen->current());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be yielded by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
Loaded 100 of 1657 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user