mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 23:46:37 +00:00
Compare commits
409
Commits
php-5.4.9
...
php-5.4.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b30251268d | ||
|
|
b4e4a2c7ae | ||
|
|
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 | ||
|
|
42437dd870 | ||
|
|
7b0107cc5d | ||
|
|
92b1cb3ca0 | ||
|
|
59b016192d | ||
|
|
263accb626 | ||
|
|
01ae5c3c2f | ||
|
|
375e3c273b | ||
|
|
68fa6a3eb7 | ||
|
|
4b900f4831 | ||
|
|
188c196d4d | ||
|
|
050aae2860 | ||
|
|
e67a2b9e47 | ||
|
|
bfdb889d4f | ||
|
|
0ea83ff847 | ||
|
|
92a7924c1a | ||
|
|
1a18e84822 | ||
|
|
afe98b7829 | ||
|
|
ed6763420c | ||
|
|
702b436ef4 | ||
|
|
cc4c318b0c | ||
|
|
e7ce002c01 | ||
|
|
6533094d9e | ||
|
|
740b823be8 | ||
|
|
643ce95b5b | ||
|
|
0110662ae9 | ||
|
|
73de4d8c68 | ||
|
|
ac6342bbc0 | ||
|
|
40663ede83 | ||
|
|
24e380f970 | ||
|
|
9283b8aea4 | ||
|
|
97d656fc82 | ||
|
|
a100c25ea4 | ||
|
|
0cea9e6843 | ||
|
|
f45a85c386 | ||
|
|
b09f5a4f56 | ||
|
|
9d75bf35e9 | ||
|
|
f7362232f4 | ||
|
|
9d6636364d | ||
|
|
a80fdc47b3 | ||
|
|
836a2b1131 | ||
|
|
4a01ddfb55 | ||
|
|
bb4d11b405 | ||
|
|
321f4f18e5 | ||
|
|
31468401b7 | ||
|
|
09b6e33b40 | ||
|
|
7a6e76fd2f | ||
|
|
1433854681 | ||
|
|
264279439b | ||
|
|
ec53b60072 | ||
|
|
93fd9c704b | ||
|
|
5382e156f9 | ||
|
|
3e6d633a0d | ||
|
|
122570443b | ||
|
|
38bf6951b3 | ||
|
|
b8b3bb08b2 | ||
|
|
aa0adce47d | ||
|
|
86c1a26169 | ||
|
|
9e7c2e5906 | ||
|
|
33b104c778 | ||
|
|
b69fd9c9b8 | ||
|
|
77ee200097 | ||
|
|
a85ae16e74 | ||
|
|
be2f547497 | ||
|
|
94a4e0f823 | ||
|
|
142c40f32c | ||
|
|
f63a9f6c11 | ||
|
|
9498cf6194 | ||
|
|
4c38003dbd | ||
|
|
93e35137aa | ||
|
|
930ef9ddd6 | ||
|
|
83864b470b | ||
|
|
b1bf524140 | ||
|
|
c077074c13 | ||
|
|
374ebc8741 | ||
|
|
0510701474 | ||
|
|
3bc7490370 | ||
|
|
4fcf4e0845 | ||
|
|
a4191b0aad | ||
|
|
9b5cb0e805 | ||
|
|
6a065876b9 | ||
|
|
bf9ad4e661 | ||
|
|
1e9a3ed234 | ||
|
|
99d087e5d4 | ||
|
|
d7bac4f5ba | ||
|
|
e5029ac40b | ||
|
|
93d1171c47 | ||
|
|
cddbb98ada | ||
|
|
2111ee3df5 | ||
|
|
ccf15cf2dc | ||
|
|
1a96fe0b32 | ||
|
|
c6203da6c2 | ||
|
|
a06313fe5a | ||
|
|
046ae2f77c | ||
|
|
e1410b5a70 | ||
|
|
36e88d78e6 | ||
|
|
f659ec108f | ||
|
|
dc9f0e70b7 | ||
|
|
d430b5a4eb | ||
|
|
258c76eb41 | ||
|
|
bcd278ad7f | ||
|
|
6a6ec195ac | ||
|
|
12e759c2ea | ||
|
|
625000ab44 | ||
|
|
d4650c5d69 | ||
|
|
f9e8678dd3 | ||
|
|
f3b1b85169 | ||
|
|
15aaa9c660 | ||
|
|
c05ee74e7f | ||
|
|
6e684e6a6c | ||
|
|
9c52d09ebc | ||
|
|
0de5fb4165 | ||
|
|
67c662a0a2 | ||
|
|
ba35ae32b7 | ||
|
|
bdc1e2302c | ||
|
|
ff9c1b12ff | ||
|
|
d7da1aa694 | ||
|
|
a426e0b050 | ||
|
|
a3a699e090 | ||
|
|
c2f8e90504 | ||
|
|
bc11e6fdbb | ||
|
|
8e5460ad86 | ||
|
|
67557fcfce | ||
|
|
2feea39a33 | ||
|
|
aff5d084a5 | ||
|
|
c3e6de2227 | ||
|
|
5894aa0950 | ||
|
|
aaecb99c6b | ||
|
|
712710bfec | ||
|
|
7ed2fdbf99 | ||
|
|
86c46b96b6 | ||
|
|
36e19c9cab | ||
|
|
dd288f93e1 | ||
|
|
0a7395e009 | ||
|
|
58dabff8ed | ||
|
|
831fbcf385 | ||
|
|
38150cbd7a | ||
|
|
a2045ff332 | ||
|
|
ee258fe87d | ||
|
|
dcd99c4b19 | ||
|
|
3990641e62 | ||
|
|
ac3d227e28 | ||
|
|
663434cd76 | ||
|
|
b35ffdeae1 | ||
|
|
c12ab5c306 | ||
|
|
fad960a404 | ||
|
|
7e2629635b | ||
|
|
f0b459b7c4 | ||
|
|
3f8c729e69 | ||
|
|
3f0dcc08e0 | ||
|
|
b10a3b9466 | ||
|
|
a2b6d9c104 | ||
|
|
5499c7d201 | ||
|
|
1c553eba19 | ||
|
|
af10e698a2 | ||
|
|
517f800277 | ||
|
|
59a4514dc0 | ||
|
|
63659ce526 | ||
|
|
763bce0303 | ||
|
|
56d9edbbb9 | ||
|
|
180b9e150b | ||
|
|
66b88c92bb | ||
|
|
c46e1cdcae | ||
|
|
59692de77f | ||
|
|
e01fe5315c | ||
|
|
ae9ba081c8 | ||
|
|
3732fa95c5 | ||
|
|
1f7c46b579 | ||
|
|
05deaf1706 | ||
|
|
06739a1b72 | ||
|
|
2f7f57a407 | ||
|
|
d2cc097049 | ||
|
|
36a5eca89c | ||
|
|
c3b480323f | ||
|
|
d813af0618 | ||
|
|
e5b1ebc082 | ||
|
|
77c4b84ac8 | ||
|
|
7a49e09fd8 | ||
|
|
d845549257 | ||
|
|
9d1bc1b622 | ||
|
|
538d8338c0 | ||
|
|
eecdb4c254 | ||
|
|
6566ea6173 | ||
|
|
ef37055c34 | ||
|
|
a11606b18f | ||
|
|
0d458ae89f | ||
|
|
35f86d24d8 | ||
|
|
1f516510b7 | ||
|
|
39a3007ab2 | ||
|
|
2d1694d4eb | ||
|
|
95fd52ff3d | ||
|
|
a2cf4f1932 | ||
|
|
bd36d4901c | ||
|
|
795e3f1c0f | ||
|
|
3d86e6d881 | ||
|
|
8b8fb649dc | ||
|
|
ad553a7af2 | ||
|
|
a1e401fb34 | ||
|
|
db6d8e2724 | ||
|
|
2a75f59355 | ||
|
|
d86decd7b4 | ||
|
|
fa7e230c76 | ||
|
|
811cd765a9 | ||
|
|
22fe268ad4 | ||
|
|
df97c3aa0d | ||
|
|
881416cda6 | ||
|
|
73e66ff1bd | ||
|
|
94cbd6374a | ||
|
|
c3b6f6feed | ||
|
|
d398456e48 | ||
|
|
fd650ec93e | ||
|
|
b8553d8494 | ||
|
|
89e547ce7f | ||
|
|
627eb9e3d9 | ||
|
|
12f451c771 | ||
|
|
1377942b69 | ||
|
|
12de2e91d0 | ||
|
|
ec2a132f9c | ||
|
|
7552a7eb19 | ||
|
|
e9c1a45daa | ||
|
|
31ab57e052 | ||
|
|
92a5e4def0 | ||
|
|
c2554b4bb4 | ||
|
|
35f636019d | ||
|
|
ff6c9e2726 | ||
|
|
96300f551a | ||
|
|
dc36933181 | ||
|
|
00d86afedf | ||
|
|
b689819567 | ||
|
|
40fabf68ed | ||
|
|
7f7cff0bbb | ||
|
|
dc2192c087 | ||
|
|
1a09bf8023 | ||
|
|
f877d7fee6 | ||
|
|
92e2f29381 | ||
|
|
c37d7a9456 | ||
|
|
487b7c7f32 | ||
|
|
bc492007da | ||
|
|
0f4772d12f | ||
|
|
f08060a48f | ||
|
|
1e6baa2673 | ||
|
|
be1e5b9c54 | ||
|
|
575790e842 | ||
|
|
d88017e992 | ||
|
|
e6b727d3b7 | ||
|
|
e0ad33c24a | ||
|
|
eff12e56b6 | ||
|
|
070239a194 | ||
|
|
df3b9a1e07 | ||
|
|
7751a68824 | ||
|
|
289bb339c9 | ||
|
|
8d2c44b59d | ||
|
|
137503dd6f | ||
|
|
c08e2c8c17 | ||
|
|
7262bf67a2 | ||
|
|
67e67c254d | ||
|
|
88d2b8c5fd | ||
|
|
92147243bf | ||
|
|
90d2561a9c | ||
|
|
7cd2f4b6a6 | ||
|
|
f55bed9dad | ||
|
|
9d8ed21bd5 | ||
|
|
8a84b1b5d9 | ||
|
|
dc862f4fd4 | ||
|
|
1702024073 | ||
|
|
6bd0a92a35 | ||
|
|
cc315e79e1 | ||
|
|
e54970aaf1 | ||
|
|
111aa9fd2e | ||
|
|
396c1e990a | ||
|
|
75746d60b6 | ||
|
|
d412152f31 | ||
|
|
99edb55e41 | ||
|
|
c886691100 | ||
|
|
15ab75be8a | ||
|
|
6dff07aa8c | ||
|
|
975fb4e3ea | ||
|
|
16f9f46935 | ||
|
|
2a59f1d06c | ||
|
|
7468fc0e37 | ||
|
|
3d82f16c7d | ||
|
|
f99befadbd | ||
|
|
65585b3aa2 | ||
|
|
5a1d2fe415 | ||
|
|
55a4da7f53 | ||
|
|
f5d8b638c7 | ||
|
|
117d2dd688 | ||
|
|
019bdff395 | ||
|
|
4f36aeb120 | ||
|
|
00ad4c0e6a | ||
|
|
1e081a825e | ||
|
|
d9aea7cd4d | ||
|
|
6b9df7a454 | ||
|
|
bca8ff723d | ||
|
|
5b82fb52fd | ||
|
|
bb60122c2f | ||
|
|
065862a750 | ||
|
|
964acdaa35 | ||
|
|
44a6fe8411 | ||
|
|
9d95f7d286 | ||
|
|
417b1b238f | ||
|
|
db0f623490 | ||
|
|
1784279be0 | ||
|
|
3e94ce6a97 |
No files matched your search
@@ -1,6 +1,230 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.4.9
|
||||
11 Apr 2013, PHP 5.4.14
|
||||
- Core
|
||||
. Fixed bug #64529 (Ran out of opcode space). (Dmitry)
|
||||
. Fixed bug #64515 (Memoryleak when using the same variablename two times in
|
||||
function declaration). (Laruence)
|
||||
. Fixed bug #64432 (more empty delimiter warning in strX methods). (Laruence)
|
||||
. Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error).
|
||||
(Dmitry)
|
||||
. Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).
|
||||
(Anatol)
|
||||
. Fixed bug #64239 (Debug backtrace changed behavior since 5.4.10 or 5.4.11).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #63976 (Parent class incorrectly using child constant in class
|
||||
property). (Dmitry)
|
||||
. Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle
|
||||
exceptions properly). (Jeff Welch)
|
||||
. Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry)
|
||||
|
||||
- PCRE:
|
||||
. Merged PCRE 8.32. (Anatol)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #61981 (OO API, walk: $suffix_as_key is not working correctly).
|
||||
(Boris Lytochkin)
|
||||
|
||||
- Zip:
|
||||
. Bug #64452 (Zip crash intermittently). (Anatol)
|
||||
|
||||
14 Mar 2013, PHP 5.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64354 (Unserialize array of objects whose class can't
|
||||
be autoloaded fail). (Laruence)
|
||||
. Fixed bug #64235 (Insteadof not work for class method in 5.4.11).
|
||||
(Laruence)
|
||||
. Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang).
|
||||
(Ard Biesheuvel)
|
||||
. Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell)
|
||||
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
|
||||
. Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
|
||||
|
||||
- Mbstring:
|
||||
. mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
|
||||
for stmt->param_bind). (Andrey)
|
||||
|
||||
- OpenSSL:
|
||||
. New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey,
|
||||
Lars)
|
||||
. Fixed bug #61930 (openssl corrupts ssl key resource when using
|
||||
openssl_get_publickey()). (Stas)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs).
|
||||
(Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
|
||||
- SOAP
|
||||
. Added check that soap.wsdl_cache_dir conforms to open_basedir
|
||||
(CVE-2013-1635). (Dmitry)
|
||||
. Disabled external entities loading (CVE-2013-1643, CVE-2013-1824).
|
||||
(Dmitry)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
|
||||
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
|
||||
(patch by kriss@krizalys.com, Laruence)
|
||||
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
|
||||
(Mike Willbanks)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin)
|
||||
|
||||
21 Feb 2013, PHP 5.4.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes)
|
||||
. Fixed bug #64011 (get_html_translation_table() output incomplete with
|
||||
HTML_ENTITIES and ISO-8859-1). (Gustavo)
|
||||
. Fixed bug #63982 (isset() inconsistently produces a fatal error on
|
||||
protected property). (Stas)
|
||||
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
|
||||
(Laruence)
|
||||
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
|
||||
. Fixed bug #63893 (Poor efficiency of strtr() using array with keys of very
|
||||
different length). (Gustavo)
|
||||
. Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
|
||||
. Fixed bug #63462 (Magic methods called twice for unset protected
|
||||
properties). (Stas)
|
||||
. Fixed bug #62524 (fopen follows redirects for non-3xx statuses).
|
||||
(Wes Mason)
|
||||
. Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63699 (Performance improvements for various ext/date functions).
|
||||
(Lars, original patch by njaguar at gmail dot com)
|
||||
. Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV.
|
||||
(Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
|
||||
|
||||
- Litespeed:
|
||||
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
|
||||
|
||||
- ext/sqlite3:
|
||||
. Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't
|
||||
using sqlite3_*_int64 API). (srgoogleguy, Lars)
|
||||
|
||||
- PDO_OCI
|
||||
. Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence)
|
||||
. Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long
|
||||
testsuite). (hswong3i, Lars)
|
||||
|
||||
- PDO_sqlite:
|
||||
. Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even
|
||||
on 64bit builds in pdo_sqlite). (srgoogleguy, Lars)
|
||||
|
||||
17 Jan 2013, PHP 5.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
|
||||
(Johannes)
|
||||
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
|
||||
(Todd Ruth, Stas).
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #63757 (getenv() produces memory leak with CGI SAPI). (Dmitry)
|
||||
. Fixed bug #54096 (FILTER_VALIDATE_INT does not accept +0 and -0).
|
||||
(martin at divbyzero dot net, Lars)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #63737 (json_decode does not properly decode with options
|
||||
parameter). (Adam)
|
||||
|
||||
- CLI server
|
||||
. Update list of common mime types. Added webm, ogv, ogg. (Lars,
|
||||
pascalc at gmail dot com)
|
||||
|
||||
- cURL extension:
|
||||
. Fixed bug (segfault due to libcurl connection caching). (Pierrick)
|
||||
. Fixed bug #63859 (Memory leak when reusing curl-handle). (Pierrick)
|
||||
. Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for
|
||||
CURLOPT_SSL_VERIFYHOST). (Pierrick)
|
||||
. Fixed bug #63352 (Can't enable hostname validation when using curl stream
|
||||
wrappers). (Pierrick)
|
||||
. Fixed bug #55438 (Curlwapper is not sending http header randomly).
|
||||
(phpnet@lostreality.org, Pierrick)
|
||||
|
||||
20 Dec 2012, PHP 5.4.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #63726 (Memleak with static properties and internal/user
|
||||
classes). (Laruence)
|
||||
. Fixed bug #63635 (Segfault in gc_collect_cycles). (Dmitry)
|
||||
. Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes
|
||||
from value). (Pierrick)
|
||||
. Fixed bug #63468 (wrong called method as callback with inheritance).
|
||||
(Laruence)
|
||||
. Fixed bug #63451 (config.guess file does not have AIX 7 defined,
|
||||
shared objects are not created). (kemcline at au1 dot ibm dot com)
|
||||
. Fixed bug #61557 (Crasher in tt-rss backend.php).
|
||||
(i dot am dot jack dot mail at gmail dot com)
|
||||
. Fixed bug #61272 (ob_start callback gets passed empty string).
|
||||
(Mike, casper at langemeijer dot eu)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63666 (Poor date() performance). (Paul Taulborg).
|
||||
. Fixed bug #63435 (Datetime::format('u') sometimes wrong by 1 microsecond).
|
||||
(Remi)
|
||||
|
||||
- Imap:
|
||||
. Fixed bug #63126 (DISABLE_AUTHENTICATOR ignores array). (Remi)
|
||||
|
||||
- Json:
|
||||
. Fixed bug #63588 (use php_next_utf8_char and remove duplicate
|
||||
implementation). (Remi)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #63361 (missing header). (Remi)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #63398 (Segfault when polling closed link). (Laruence)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #63590 (Different results in TS and NTS under Windows).
|
||||
(Anatoliy)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #63581 Possible null dereference and buffer overflow (Remi)
|
||||
|
||||
- Pdo_sqlite:
|
||||
. Fixed Bug #63149 getColumnMeta should return the table name
|
||||
when system SQLite used. (Remi)
|
||||
|
||||
- Apache2 Handler SAPI:
|
||||
. Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy)
|
||||
|
||||
- Reflection:
|
||||
. Fixed Bug #63614 (Fatal error on Reflection). (Laruence)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #63271 (SOAP wsdl cache is not enabled after initial requests).
|
||||
(John Jawed, Dmitry)
|
||||
|
||||
- Sockets
|
||||
. Fixed bug #49341 (Add SO_REUSEPORT support for socket_set_option()).
|
||||
(Igor Wiedler, Lars)
|
||||
|
||||
- SPL
|
||||
. Fixed bug #63680 (Memleak in splfixedarray with cycle reference). (Laruence)
|
||||
|
||||
22 Nov 2012, PHP 5.4.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #63305 (zend_mm_heap corrupted with traits). (Dmitry, Laruence)
|
||||
@@ -37,10 +261,22 @@ PHP NEWS
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec).
|
||||
(Martin Osvald, Remi)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #62593 (Emulate prepares behave strangely with PARAM_BOOL).
|
||||
(Will Fitch)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #63297 (Phar fails to write an openssl based signature).
|
||||
(Anatoliy)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #63240 (stream_get_line() return contains delimiter string).
|
||||
(Tjerk, Gustavo)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #63399 (ReflectionClass::getTraitAliases() incorrectly resolves
|
||||
traitnames). (Laruence)
|
||||
|
||||
@@ -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
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -525,6 +525,8 @@ b. Extensions with changed behavior
|
||||
must be activated manually with the "extension = php_com_dotnet.dll" directive
|
||||
in php.ini.
|
||||
|
||||
- Apache 2.4 handler is supported as of PHP 5.4.9
|
||||
|
||||
==================
|
||||
12. New in PHP 5.4
|
||||
==================
|
||||
|
||||
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
|
||||
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
|
||||
|
||||
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
|
||||
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
|
||||
===DONE===
|
||||
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #62343 (Show class_alias In get_declared_classes())
|
||||
--FILE--
|
||||
<?php
|
||||
class a { }
|
||||
class_alias("a", "b");
|
||||
$c = get_declared_classes();
|
||||
var_dump(end($c));
|
||||
var_dump(prev($c));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "b"
|
||||
string(1) "a"
|
||||
@@ -0,0 +1,74 @@
|
||||
--TEST--
|
||||
Test script to verify that magic methods should be called only once when accessing an unset property.
|
||||
--CREDITS--
|
||||
Marco Pivetta <ocramius@gmail.com>
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public $publicProperty;
|
||||
protected $protectedProperty;
|
||||
private $privateProperty;
|
||||
|
||||
public function __construct() {
|
||||
unset(
|
||||
$this->publicProperty,
|
||||
$this->protectedProperty,
|
||||
$this->privateProperty
|
||||
);
|
||||
}
|
||||
|
||||
function __get($name) {
|
||||
echo '__get ' . $name . "\n";
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
function __set($name, $value) {
|
||||
echo '__set ' . $name . "\n";
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
function __isset($name) {
|
||||
echo '__isset ' . $name . "\n";
|
||||
return isset($this->$name);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
$test->nonExisting;
|
||||
$test->publicProperty;
|
||||
$test->protectedProperty;
|
||||
$test->privateProperty;
|
||||
isset($test->nonExisting);
|
||||
isset($test->publicProperty);
|
||||
isset($test->protectedProperty);
|
||||
isset($test->privateProperty);
|
||||
$test->nonExisting = 'value';
|
||||
$test->publicProperty = 'value';
|
||||
$test->protectedProperty = 'value';
|
||||
$test->privateProperty = 'value';
|
||||
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
__get nonExisting
|
||||
|
||||
Notice: Undefined property: Test::$nonExisting in %s on line %d
|
||||
__get publicProperty
|
||||
|
||||
Notice: Undefined property: Test::$publicProperty in %s on line %d
|
||||
__get protectedProperty
|
||||
|
||||
Notice: Undefined property: Test::$protectedProperty in %s on line %d
|
||||
__get privateProperty
|
||||
|
||||
Notice: Undefined property: Test::$privateProperty in %s on line %d
|
||||
__isset nonExisting
|
||||
__isset publicProperty
|
||||
__isset protectedProperty
|
||||
__isset privateProperty
|
||||
__set nonExisting
|
||||
__set publicProperty
|
||||
__set protectedProperty
|
||||
__set privateProperty
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #63468 (wrong called method as callback with inheritance)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
return call_user_func(array('Bar', 'getValue'));
|
||||
}
|
||||
|
||||
private static function getValue()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public static function getValue()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
}
|
||||
|
||||
$x = new Bar;
|
||||
var_dump($x->run());
|
||||
--EXPECT--
|
||||
string(3) "Bar"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #63635 (Segfault in gc_collect_cycles)
|
||||
--FILE--
|
||||
<?php
|
||||
class Node {
|
||||
public $parent = NULL;
|
||||
public $childs = array();
|
||||
|
||||
function __construct(Node $parent=NULL) {
|
||||
if ($parent) {
|
||||
$parent->childs[] = $this;
|
||||
}
|
||||
$this->childs[] = $this;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
$this->childs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
define("MAX", 16);
|
||||
|
||||
for ($n = 0; $n < 20; $n++) {
|
||||
$top = new Node();
|
||||
for ($i=0 ; $i<MAX ; $i++) {
|
||||
$ci = new Node($top);
|
||||
for ($j=0 ; $j<MAX ; $j++) {
|
||||
$cj = new Node($ci);
|
||||
for ($k=0 ; $k<MAX ; $k++) {
|
||||
$ck = new Node($cj);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "$n\n";
|
||||
}
|
||||
echo "ok\n";
|
||||
--EXPECT--
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
ok
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #63762 - Sigsegv when Exception::$trace is changed by user
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new Exception();
|
||||
|
||||
$ref = new ReflectionProperty($e, 'trace');
|
||||
$ref->setAccessible(TRUE);
|
||||
|
||||
echo "Array of NULL:\n";
|
||||
$ref->setValue($e, array(NULL));
|
||||
|
||||
var_dump($e->getTraceAsString());
|
||||
|
||||
echo "\nArray of empty array:\n";
|
||||
$ref->setValue($e, array(array()));
|
||||
var_dump($e->getTraceAsString());
|
||||
|
||||
echo "\nArray of array of NULL values:\n";
|
||||
$ref->setValue($e, array(array(
|
||||
'file' => NULL,
|
||||
'line' => NULL,
|
||||
'class' => NULL,
|
||||
'type' => NULL,
|
||||
'function' => NULL,
|
||||
'args' => NULL
|
||||
)));
|
||||
var_dump($e->getTraceAsString());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array of NULL:
|
||||
|
||||
Warning: Expected array for frame 0 in %s on line %d
|
||||
string(9) "#0 {main}"
|
||||
|
||||
Array of empty array:
|
||||
string(36) "#0 [internal function]: ()
|
||||
#1 {main}"
|
||||
|
||||
Array of array of NULL values:
|
||||
|
||||
Warning: Function name is no string in %s on line %d
|
||||
|
||||
Warning: Value for class is no string in %s on line %d
|
||||
|
||||
Warning: Value for type is no string in %s on line %d
|
||||
|
||||
Warning: Value for function is no string in %s on line %d
|
||||
|
||||
Warning: args element is no array in %s on line %d
|
||||
string(60) "#0 [unknown function][unknown][unknown][unknown]()
|
||||
#1 {main}"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #63882 (zend_std_compare_objects crash on recursion)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test { public $x = 5; }
|
||||
|
||||
$testobj1 = new Test;
|
||||
$testobj2 = new Test;
|
||||
$testobj1->x = $testobj1;
|
||||
$testobj2->x = $testobj2;
|
||||
|
||||
var_dump($testobj1 == $testobj2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #63976 (Parent class incorrectly using child constant in class property)
|
||||
--FILE--
|
||||
<?php
|
||||
if (1) {
|
||||
class Foo {
|
||||
const TABLE = "foo";
|
||||
public $table = self::TABLE;
|
||||
}
|
||||
}
|
||||
if (1) {
|
||||
class Bar extends Foo {
|
||||
const TABLE = "bar";
|
||||
}
|
||||
}
|
||||
$bar = new Bar();
|
||||
var_dump($bar->table);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
protected $protectedProperty;
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
var_dump(isset($test->protectedProperty));
|
||||
var_dump(isset($test->protectedProperty->foo));
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -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
|
||||
@@ -16,4 +16,4 @@ class C implements IFoo {
|
||||
}
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
|
||||
Fatal error: Declaration of TFoo::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
|
||||
@@ -23,4 +23,4 @@ $o = new CBroken;
|
||||
$o->foo(1);
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of TBroken1::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s on line %d
|
||||
Fatal error: Declaration of TBroken2::foo($a, $b = 0) must be compatible with TBroken1::foo($a) in %s on line %d
|
||||
@@ -23,4 +23,4 @@ $o = new CBroken;
|
||||
$o->foo(1);
|
||||
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of TBroken1::foo($a, $b = 0) must be compatible with TBroken2::foo($a) in %s on line %d
|
||||
Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #64070 (Inheritance with Traits failed with error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait first_trait
|
||||
{
|
||||
function first_function()
|
||||
{
|
||||
echo "From First Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait second_trait
|
||||
{
|
||||
use first_trait {
|
||||
first_trait::first_function as second_function;
|
||||
}
|
||||
|
||||
function first_function()
|
||||
{
|
||||
echo "From Second Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
class first_class
|
||||
{
|
||||
use second_trait;
|
||||
}
|
||||
|
||||
$obj = new first_class();
|
||||
$obj->first_function();
|
||||
$obj->second_function();
|
||||
?>
|
||||
--EXPECT--
|
||||
From Second Trait
|
||||
From First Trait
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method insteadof TestTrait;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235.php on line %d
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method as TestParent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
|
||||
@@ -22,4 +22,4 @@ class TraitsTest1 {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
|
||||
Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d
|
||||
@@ -23,4 +23,4 @@ class TraitsTest1 {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d
|
||||
Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
|
||||
@@ -10,13 +10,9 @@ trait c {
|
||||
public function test() { return 2; }
|
||||
}
|
||||
|
||||
trait b {
|
||||
public function test() { return 1; }
|
||||
}
|
||||
|
||||
class bar {
|
||||
use foo, c { c::test insteadof foo, b; }
|
||||
use foo, c { c::test insteadof foo, b; }
|
||||
use foo, c { c::test insteadof foo; }
|
||||
use foo, c { c::test insteadof foo; }
|
||||
}
|
||||
|
||||
$x = new bar;
|
||||
|
||||
@@ -35,4 +35,4 @@ $o->sayHello(array());
|
||||
--EXPECTF--
|
||||
World!
|
||||
|
||||
Fatal error: Declaration of MyHelloWorld::sayHello() must be compatible with Base::sayHello(array $a) in %s on line %d
|
||||
Fatal error: Declaration of SayWorld::sayHello(Base $d) must be compatible with Base::sayHello(array $a) in %s on line %d
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Aliasing leading to conflict should result in error message
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
trait Hello {
|
||||
public function hello() {
|
||||
echo 'Hello';
|
||||
}
|
||||
}
|
||||
|
||||
trait World {
|
||||
public function world() {
|
||||
echo ' World!';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyClass {
|
||||
use Hello, World { world as hello; }
|
||||
}
|
||||
|
||||
$o = new MyClass();
|
||||
$o->hello();
|
||||
$o->world();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as lhs of "insteadof")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T2::foo insteadof T1;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as rhs of "insteadof")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T1::foo insteadof T2;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Invalid conflict resolution (unused trait as lhs of "as")
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {echo "T1\n";}
|
||||
}
|
||||
trait T2 {
|
||||
function foo() {echo "T2\n";}
|
||||
}
|
||||
class C {
|
||||
use T1 {
|
||||
T2::foo as private;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
abstract alias
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {}
|
||||
}
|
||||
class C1 {
|
||||
use T1 {
|
||||
T1::foo as abstract;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use 'abstract' as method modifier in %s on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
final alias
|
||||
--FILE--
|
||||
<?php
|
||||
trait T1 {
|
||||
function foo() {}
|
||||
}
|
||||
class C1 {
|
||||
use T1 {
|
||||
T1::foo as final;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use 'final' as method modifier in %s on line %d
|
||||
+9
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -131,7 +131,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
static uint zend_version_info_length;
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2012 Zend Technologies\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2013 Zend Technologies\n"
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
|
||||
@@ -1238,7 +1238,13 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
va_end(args);
|
||||
|
||||
if (type == E_PARSE) {
|
||||
EG(exit_status) = 255;
|
||||
/* eval() errors do not affect exit_status */
|
||||
if (!(EG(current_execute_data) &&
|
||||
EG(current_execute_data)->opline &&
|
||||
EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
|
||||
EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) {
|
||||
EG(exit_status) = 255;
|
||||
}
|
||||
zend_init_compiler_data_structures(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -350,6 +350,10 @@ struct _zval_struct {
|
||||
#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
|
||||
#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#if __GNUC__ >= 3
|
||||
#define zend_always_inline inline __attribute__((always_inline))
|
||||
@@ -358,7 +362,6 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
#define zend_always_inline __forceinline
|
||||
#define zend_never_inline
|
||||
@@ -366,6 +369,7 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
#endif /* ZEND_DEBUG */
|
||||
|
||||
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
|
||||
# define EXPECTED(condition) __builtin_expect(condition, 1)
|
||||
@@ -437,7 +441,7 @@ struct _zend_trait_precedence {
|
||||
|
||||
zend_class_entry** exclude_from_classes;
|
||||
|
||||
union _zend_function* function;
|
||||
union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
|
||||
};
|
||||
typedef struct _zend_trait_precedence zend_trait_precedence;
|
||||
|
||||
@@ -455,7 +459,7 @@ struct _zend_trait_alias {
|
||||
*/
|
||||
zend_uint modifiers;
|
||||
|
||||
union _zend_function* function;
|
||||
union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
|
||||
};
|
||||
typedef struct _zend_trait_alias zend_trait_alias;
|
||||
|
||||
|
||||
+97
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1022,6 +1022,41 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zval_update_class_constant(zval **pp, int is_static, int offset TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
|
||||
(Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
|
||||
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
|
||||
|
||||
if ((*scope)->parent) {
|
||||
zend_class_entry *ce = *scope;
|
||||
HashPosition pos;
|
||||
zend_property_info *prop_info;
|
||||
|
||||
do {
|
||||
for (zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
|
||||
zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop_info, &pos) == SUCCESS;
|
||||
zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
|
||||
if (is_static == ((prop_info->flags & ZEND_ACC_STATIC) != 0) &&
|
||||
offset == prop_info->offset) {
|
||||
int ret;
|
||||
zend_class_entry *old_scope = *scope;
|
||||
*scope = prop_info->ce;
|
||||
ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
*scope = old_scope;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
ce = ce->parent;
|
||||
} while (ce);
|
||||
|
||||
}
|
||||
return zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED) == 0 || (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count)) {
|
||||
@@ -1034,7 +1069,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
|
||||
for (i = 0; i < class_type->default_properties_count; i++) {
|
||||
if (class_type->default_properties_table[i]) {
|
||||
zval_update_constant(&class_type->default_properties_table[i], (void**)1 TSRMLS_CC);
|
||||
zval_update_class_constant(&class_type->default_properties_table[i], 0, i TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1075,7 +1110,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
}
|
||||
|
||||
for (i = 0; i < class_type->default_static_members_count; i++) {
|
||||
zval_update_constant(&CE_STATIC_MEMBERS(class_type)[i], (void**)1 TSRMLS_CC);
|
||||
zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i TSRMLS_CC);
|
||||
}
|
||||
|
||||
*scope = old_scope;
|
||||
@@ -2732,7 +2767,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
} else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) {
|
||||
retval = 1;
|
||||
if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) &&
|
||||
EG(scope) &&
|
||||
!strict_class && EG(scope) &&
|
||||
instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) {
|
||||
zend_function *priv_fbc;
|
||||
|
||||
@@ -3708,6 +3743,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
|
||||
(*property)->value = value->value;
|
||||
if (Z_REFCOUNT_P(value) > 0) {
|
||||
zval_copy_ctor(*property);
|
||||
} else {
|
||||
efree(value);
|
||||
}
|
||||
} else {
|
||||
zval *garbage = *property;
|
||||
@@ -3876,6 +3913,62 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f) /* {{{ */
|
||||
{
|
||||
zend_function *func;
|
||||
HashPosition iterator;
|
||||
HashTable *function_table;
|
||||
|
||||
if (f->common.type != ZEND_USER_FUNCTION ||
|
||||
*(f->op_array.refcount) < 2 ||
|
||||
!f->common.scope ||
|
||||
!f->common.scope->trait_aliases) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
|
||||
function_table = &ce->function_table;
|
||||
zend_hash_internal_pointer_reset_ex(function_table, &iterator);
|
||||
while (zend_hash_get_current_data_ex(function_table, (void **)&func, &iterator) == SUCCESS) {
|
||||
if (func == f) {
|
||||
char *name;
|
||||
uint len;
|
||||
ulong idx;
|
||||
|
||||
if (zend_hash_get_current_key_ex(function_table, &name, &len, &idx, 0, &iterator) != HASH_KEY_IS_STRING) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
--len;
|
||||
if (len == strlen(f->common.function_name) &&
|
||||
!strncasecmp(name, f->common.function_name, len)) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
return zend_find_alias_name(f->common.scope, name, len);
|
||||
}
|
||||
zend_hash_move_forward_ex(function_table, &iterator);
|
||||
}
|
||||
return f->common.function_name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+7
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -60,7 +60,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
zval *object_ptr;
|
||||
} zend_fcall_info_cache;
|
||||
|
||||
#define ZEND_NS_NAME(ns, name) ns"\\"name
|
||||
#define ZEND_NS_NAME(ns, name) ns "\\" name
|
||||
|
||||
#define ZEND_FN(name) zif_##name
|
||||
#define ZEND_MN(name) zim_##name
|
||||
@@ -279,9 +279,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
|
||||
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
|
||||
|
||||
#define zend_register_class_alias(name, ce) \
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
|
||||
#define zend_register_ns_class_alias(ns, name, ce) \
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
|
||||
@@ -517,6 +517,9 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_rebuild_symbol_table(TSRMLS_D);
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len);
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
|
||||
|
||||
#define add_method(arg, key, method) add_assoc_function((arg), (key), (method))
|
||||
|
||||
ZEND_API ZEND_FUNCTION(display_disabled_function);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1025,6 +1025,13 @@ ZEND_FUNCTION(get_object_vars)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int same_name(const char *key, const char *name, zend_uint name_len)
|
||||
{
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret = memcmp(lcname, key, name_len) == 0;
|
||||
efree(lcname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* {{{ proto array get_class_methods(mixed class)
|
||||
Returns an array of method names for class or class instance. */
|
||||
@@ -1072,14 +1079,26 @@ ZEND_FUNCTION(get_class_methods)
|
||||
uint len = strlen(mptr->common.function_name);
|
||||
|
||||
/* Do not display old-style inherited constructors */
|
||||
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
if (zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
if (mptr->type == ZEND_USER_FUNCTION &&
|
||||
*mptr->op_array.refcount > 1 &&
|
||||
(len != key_len - 1 ||
|
||||
!same_name(key, mptr->common.function_name, len))) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, zend_find_alias_name(mptr->common.scope, key, key_len - 1), key_len - 1, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
zend_hash_move_forward_ex(&ce->function_table, &pos);
|
||||
@@ -1640,7 +1659,6 @@ ZEND_FUNCTION(restore_exception_handler)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
zval *array = va_arg(args, zval *);
|
||||
@@ -1651,7 +1669,13 @@ static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int nu
|
||||
|
||||
if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0)
|
||||
&& (comply_mask == (ce->ce_flags & mask))) {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
if (ce->refcount > 1 &&
|
||||
(ce->name_length != hash_key->nKeyLength - 1 ||
|
||||
!same_name(hash_key->arKey, ce->name, ce->name_length))) {
|
||||
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength - 1, 1);
|
||||
} else {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
@@ -2094,7 +2118,14 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
lineno = 0;
|
||||
}
|
||||
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
if (ptr->object) {
|
||||
@@ -2275,7 +2306,14 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
filename = NULL;
|
||||
}
|
||||
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), (char*)function_name, 1);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+223
-389
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -219,6 +219,7 @@ ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
|
||||
void init_compiler(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
CG(active_op_array) = NULL;
|
||||
memset(&CG(context), 0, sizeof(CG(context)));
|
||||
zend_init_compiler_data_structures(TSRMLS_C);
|
||||
zend_init_rsrc_list(TSRMLS_C);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
|
||||
@@ -1797,7 +1798,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
|
||||
pass_two(CG(active_op_array) TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC);
|
||||
@@ -2319,13 +2320,14 @@ void zend_do_goto(const znode *label TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_release_labels(TSRMLS_D) /* {{{ */
|
||||
void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (CG(context).labels) {
|
||||
zend_hash_destroy(CG(context).labels);
|
||||
FREE_HASHTABLE(CG(context).labels);
|
||||
CG(context).labels = NULL;
|
||||
}
|
||||
if (!zend_stack_is_empty(&CG(context_stack))) {
|
||||
if (!temporary && !zend_stack_is_empty(&CG(context_stack))) {
|
||||
zend_compiler_context *ctx;
|
||||
|
||||
zend_stack_top(&CG(context_stack), (void**)&ctx);
|
||||
@@ -3332,7 +3334,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
|
||||
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
|
||||
Z_DELREF_P(ce->default_properties_table[parent_info->offset]);
|
||||
zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
|
||||
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
|
||||
ce->default_properties_table[child_info->offset] = NULL;
|
||||
child_info->offset = parent_info->offset;
|
||||
@@ -3526,8 +3528,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
|
||||
ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
|
||||
} else if (!(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES)
|
||||
&& !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
} else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
|
||||
/* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
@@ -3624,7 +3625,6 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
|
||||
}
|
||||
}
|
||||
ce->traits[ce->num_traits++] = trait;
|
||||
trait->refcount++;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3635,93 +3635,9 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_
|
||||
zend_uint other_flags = other_fn->common.scope->ce_flags;
|
||||
|
||||
return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
|
||||
&& zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)
|
||||
&& ((fn_flags & ZEND_ACC_FINAL) == (other_flags & ZEND_ACC_FINAL)) /* equal final qualifier */
|
||||
&& ((fn_flags & ZEND_ACC_STATIC)== (other_flags & ZEND_ACC_STATIC)); /* equal static qualifier */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
{
|
||||
size_t current;
|
||||
size_t i;
|
||||
size_t count;
|
||||
HashTable* resulting_table;
|
||||
HashTable** function_tables;
|
||||
zend_class_entry *ce;
|
||||
size_t collision = 0;
|
||||
size_t abstract_solved = 0;
|
||||
zend_function* other_trait_fn;
|
||||
|
||||
current = va_arg(args, size_t); /* index of current trait */
|
||||
count = va_arg(args, size_t);
|
||||
resulting_table = va_arg(args, HashTable*);
|
||||
function_tables = va_arg(args, HashTable**);
|
||||
ce = va_arg(args, zend_class_entry*);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (i == current) {
|
||||
continue; /* just skip this, cause its the table this function is applied on */
|
||||
}
|
||||
|
||||
if (zend_hash_quick_find(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&other_trait_fn) == SUCCESS) {
|
||||
/* if it is an abstract method, there is no collision */
|
||||
if (other_trait_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure they are compatible */
|
||||
/* In case both are abstract, just check prototype, but need to do that in both directions */
|
||||
if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(other_trait_fn TSRMLS_CC));
|
||||
}
|
||||
|
||||
/* we can savely free and remove it from other table */
|
||||
zend_function_dtor(other_trait_fn);
|
||||
zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
} else {
|
||||
/* if it is not an abstract method, there is still no collision */
|
||||
/* if fn is an abstract method */
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure they are compatible.
|
||||
Here, we already know other_trait_fn cannot be abstract, full check ok. */
|
||||
if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(other_trait_fn TSRMLS_CC));
|
||||
}
|
||||
|
||||
/* just mark as solved, will be added if its own trait is processed */
|
||||
abstract_solved = 1;
|
||||
} else {
|
||||
/* but else, we have a collision of non-abstract methods */
|
||||
collision++;
|
||||
zend_function_dtor(other_trait_fn);
|
||||
zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (collision) {
|
||||
zend_function* class_fn;
|
||||
|
||||
/* make sure method is not already overridden in class */
|
||||
if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&class_fn) == FAILURE
|
||||
|| class_fn->common.scope != ce) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", fn->common.function_name, ce->name);
|
||||
}
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else if (abstract_solved) {
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
/* Add it to result function table */
|
||||
if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name);
|
||||
}
|
||||
}
|
||||
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
&& ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
|
||||
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
|
||||
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3766,66 +3682,84 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
static void zend_add_trait_method(zend_class_entry *ce, const char *name, const char *arKey, uint nKeyLength, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = va_arg(args, zend_class_entry*);
|
||||
zend_function* existing_fn = NULL;
|
||||
zend_function fn_copy, *fn_copy_p;
|
||||
zend_function* prototype = NULL; /* is used to determine the prototype according to the inheritance chain */
|
||||
zend_function *existing_fn = NULL;
|
||||
ulong h = zend_hash_func(arKey, nKeyLength);
|
||||
|
||||
if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &existing_fn) == FAILURE ||
|
||||
existing_fn->common.scope != ce) {
|
||||
/* not found or inherited from other class or interface */
|
||||
zend_function* parent_function;
|
||||
|
||||
if (ce->parent && zend_hash_quick_find(&ce->parent->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &parent_function) != FAILURE) {
|
||||
prototype = parent_function; /* ->common.fn_flags |= ZEND_ACC_ABSTRACT; */
|
||||
|
||||
/* we got that method in the parent class, and are going to override it,
|
||||
except, if the trait is just asking to have an abstract method implemented. */
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* then we clean up an skip this method */
|
||||
zend_function_dtor(fn);
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
if (zend_hash_quick_find(&ce->function_table, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) {
|
||||
if (existing_fn->common.scope == ce) {
|
||||
/* members from the current class override trait methods */
|
||||
/* use temporary *overriden HashTable to detect hidden conflict */
|
||||
if (*overriden) {
|
||||
if (zend_hash_quick_find(*overriden, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) {
|
||||
if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the trait method is compatible with previosly declared abstract method */
|
||||
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the abstract declaration is compatible with previous declaration */
|
||||
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ALLOC_HASHTABLE(*overriden);
|
||||
zend_hash_init_ex(*overriden, 2, NULL, NULL, 0, 0);
|
||||
}
|
||||
zend_hash_quick_update(*overriden, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
|
||||
return;
|
||||
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the trait method is compatible with previosly declared abstract method */
|
||||
if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* Make sure the abstract declaration is compatible with previous declaration */
|
||||
if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
|
||||
zend_get_function_declaration(fn TSRMLS_CC),
|
||||
zend_get_function_declaration(existing_fn TSRMLS_CC));
|
||||
}
|
||||
return;
|
||||
} else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
/* two trais can't define the same non-abstract method */
|
||||
#if 1
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
|
||||
name, ce->name);
|
||||
#else /* TODO: better errot message */
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
|
||||
fn->common.scope->name, fn->common.function_name,
|
||||
ce->name, name,
|
||||
existing_fn->common.scope->name, existing_fn->common.function_name);
|
||||
#endif
|
||||
} else {
|
||||
/* inherited members are overridden by members inserted by traits */
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
function_add_ref(fn);
|
||||
zend_hash_quick_update(&ce->function_table, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
|
||||
zend_add_magic_methods(ce, arKey, nKeyLength, fn TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
|
||||
fn->common.scope = ce;
|
||||
fn->common.prototype = prototype;
|
||||
|
||||
if (prototype
|
||||
&& (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT
|
||||
|| prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
fn->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT) {
|
||||
/* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */
|
||||
fn->common.fn_flags = fn->common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
}
|
||||
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
if (prototype) {
|
||||
do_inheritance_check_on_method(fn, prototype TSRMLS_CC);
|
||||
}
|
||||
|
||||
/* one more thing: make sure we properly implement an abstract method */
|
||||
if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
prototype = fn->common.prototype;
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
fn->common.prototype = prototype;
|
||||
}
|
||||
|
||||
/* delete inherited fn if the function to be added is not abstract */
|
||||
if (existing_fn
|
||||
&& existing_fn->common.scope != ce
|
||||
&& (fn->common.fn_flags & ZEND_ACC_ABSTRACT) == 0) {
|
||||
/* it is just a reference which was added to the subclass while doing
|
||||
the inheritance, so we can deleted now, and will add the overriding
|
||||
method afterwards.
|
||||
Except, if we try to add an abstract function, then we should not
|
||||
delete the inherited one */
|
||||
zend_hash_quick_del(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h);
|
||||
}
|
||||
|
||||
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
||||
@@ -3833,130 +3767,109 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
if (fn->op_array.static_variables) {
|
||||
ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
|
||||
}
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
|
||||
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
|
||||
}
|
||||
|
||||
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
zend_function_dtor(fn);
|
||||
}
|
||||
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
||||
{
|
||||
HashTable* target;
|
||||
zend_trait_alias** aliases;
|
||||
HashTable* exclude_table;
|
||||
char* lcname;
|
||||
unsigned int fnname_len;
|
||||
zend_function fn_copy;
|
||||
void* dummy;
|
||||
size_t i = 0;
|
||||
zend_class_entry *ce;
|
||||
HashTable **overriden;
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
HashTable *exclude_table;
|
||||
char *lcname;
|
||||
unsigned int fnname_len;
|
||||
zend_function fn_copy;
|
||||
void *dummy;
|
||||
|
||||
target = va_arg(args, HashTable*);
|
||||
aliases = va_arg(args, zend_trait_alias**);
|
||||
ce = va_arg(args, zend_class_entry*);
|
||||
overriden = va_arg(args, HashTable**);
|
||||
exclude_table = va_arg(args, HashTable*);
|
||||
|
||||
fnname_len = strlen(fn->common.function_name);
|
||||
|
||||
fnname_len = hash_key->nKeyLength - 1;
|
||||
|
||||
/* apply aliases which are qualified with a class name, there should not be any ambiguity */
|
||||
if (aliases) {
|
||||
while (aliases[i]) {
|
||||
if (ce->trait_aliases) {
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
/* Scope unset or equal to the function we compare to, and the alias applies to fn */
|
||||
if (aliases[i]->alias != NULL
|
||||
&& (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce)
|
||||
&& aliases[i]->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
if (alias->alias != NULL
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& alias->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
/* this function_name is never destroyed, because ZEND_ACC_ALIAS
|
||||
flag is set */
|
||||
fn_copy.common.function_name = aliases[i]->alias;
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
if (aliases[i]->modifiers) {
|
||||
fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS;
|
||||
if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) {
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC;
|
||||
}
|
||||
fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK);
|
||||
if (alias->modifiers) {
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
}
|
||||
|
||||
lcname = zend_str_tolower_dup(aliases[i]->alias, aliases[i]->alias_len);
|
||||
|
||||
if (zend_hash_add(target, lcname, aliases[i]->alias_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Failed to add aliased trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name);
|
||||
}
|
||||
lcname = zend_str_tolower_dup(alias->alias, alias->alias_len);
|
||||
zend_add_trait_method(ce, alias->alias, lcname, alias->alias_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
efree(lcname);
|
||||
|
||||
/** Record the trait from which this alias was resolved. */
|
||||
if (!aliases[i]->trait_method->ce) {
|
||||
aliases[i]->trait_method->ce = fn->common.scope;
|
||||
/* Record the trait from which this alias was resolved. */
|
||||
if (!alias->trait_method->ce) {
|
||||
alias->trait_method->ce = fn->common.scope;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len);
|
||||
lcname = hash_key->arKey;
|
||||
|
||||
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
|
||||
|
||||
/* apply aliases which are not qualified by a class name, or which have not
|
||||
* alias name, just setting visibility */
|
||||
if (aliases) {
|
||||
i = 0;
|
||||
while (aliases[i]) {
|
||||
/* apply aliases which have not alias name, just setting visibility */
|
||||
if (ce->trait_aliases) {
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
/* Scope unset or equal to the function we compare to, and the alias applies to fn */
|
||||
if (aliases[i]->alias == NULL && aliases[i]->modifiers != 0
|
||||
&& (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce)
|
||||
&& (aliases[i]->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS;
|
||||
if (alias->alias == NULL && alias->modifiers != 0
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& (alias->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) {
|
||||
|
||||
if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) {
|
||||
fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC;
|
||||
}
|
||||
fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK);
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
|
||||
/** Record the trait from which this alias was resolved. */
|
||||
if (!aliases[i]->trait_method->ce) {
|
||||
aliases[i]->trait_method->ce = fn->common.scope;
|
||||
if (!alias->trait_method->ce) {
|
||||
alias->trait_method->ce = fn->common.scope;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (zend_hash_add(target, lcname, fnname_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Failed to add trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name);
|
||||
}
|
||||
zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Copies function table entries to target function table with applied aliasing */
|
||||
static void zend_traits_copy_trait_function_table(HashTable *target, HashTable *source, zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) /* {{{ */
|
||||
static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_hash_apply_with_arguments(source TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, target, aliases, exclude_table);
|
||||
zend_uint i;
|
||||
|
||||
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
|
||||
}
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->traits[i] == trait) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3979,6 +3892,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
|
||||
|
||||
/** Ensure that the prefered method is actually available. */
|
||||
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
|
||||
@@ -4007,8 +3921,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
|
||||
if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name);
|
||||
}
|
||||
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC);
|
||||
|
||||
/* make sure that the trait method is not from a class mentioned in
|
||||
exclude_from_classes, for consistency */
|
||||
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) {
|
||||
@@ -4037,6 +3952,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name);
|
||||
}
|
||||
zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
|
||||
|
||||
/** And, ensure that the referenced method is resolvable, too. */
|
||||
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
|
||||
@@ -4086,70 +4002,45 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra
|
||||
|
||||
static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
HashTable** function_tables;
|
||||
HashTable* resulting_table;
|
||||
HashTable exclude_table;
|
||||
size_t i;
|
||||
zend_uint i;
|
||||
HashTable *overriden = NULL;
|
||||
|
||||
/* prepare copies of trait function tables for combination */
|
||||
function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
|
||||
resulting_table = (HashTable *)emalloc(sizeof(HashTable));
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
|
||||
|
||||
if (ce->trait_precedences) {
|
||||
HashTable exclude_table;
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0);
|
||||
|
||||
zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
|
||||
|
||||
/* copies functions, applies defined aliasing, and excludes unused trait methods */
|
||||
zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, &exclude_table TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table);
|
||||
|
||||
zend_hash_destroy(&exclude_table);
|
||||
} else {
|
||||
zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, NULL TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* now merge trait methods */
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
zend_hash_apply_with_arguments(function_tables[i] TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions, 5, i, ce->num_traits, resulting_table, function_tables, ce);
|
||||
}
|
||||
|
||||
/* Now the resulting_table contains all trait methods we would have to
|
||||
* add to the class in the following step the methods are inserted into the method table
|
||||
* if there is already a method with the same name it is replaced iff ce != fn.scope
|
||||
* --> all inherited methods are overridden, methods defined in the class are left untouched
|
||||
*/
|
||||
zend_hash_apply_with_arguments(resulting_table TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions_to_class, 1, ce);
|
||||
|
||||
/* free temporary function tables */
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
/* zend_hash_destroy(function_tables[i]); */
|
||||
zend_hash_graceful_destroy(function_tables[i]);
|
||||
efree(function_tables[i]);
|
||||
}
|
||||
efree(function_tables);
|
||||
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC);
|
||||
|
||||
/* free temporary resulting table */
|
||||
/* zend_hash_destroy(resulting_table); */
|
||||
zend_hash_graceful_destroy(resulting_table);
|
||||
efree(resulting_table);
|
||||
if (overriden) {
|
||||
zend_hash_destroy(overriden);
|
||||
FREE_HASHTABLE(overriden);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, const char* prop_name, int prop_name_length, ulong prop_hash, zend_class_entry *coliding_ce) /* {{{ */
|
||||
{
|
||||
size_t i;
|
||||
zend_property_info *coliding_prop;
|
||||
for (i = 0; (i < current_trait) && (i < ce->num_traits); i++) {
|
||||
if (zend_hash_quick_find(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) {
|
||||
return ce->traits[i];
|
||||
|
||||
if (coliding_ce == ce) {
|
||||
for (i = 0; i < current_trait; i++) {
|
||||
if (zend_hash_quick_exists(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash)) {
|
||||
return ce->traits[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4157,54 +4048,6 @@ static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t curr
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_traits_register_private_property(zend_class_entry *ce, const char *name, int name_len, zend_property_info *old_info, zval *property TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *priv_name;
|
||||
int priv_name_length;
|
||||
const char *interned_name;
|
||||
zend_property_info property_info;
|
||||
ulong h = zend_get_hash_value(name, name_len+1);
|
||||
property_info = *old_info;
|
||||
|
||||
if (old_info->flags & ZEND_ACC_STATIC) {
|
||||
property_info.offset = ce->default_static_members_count++;
|
||||
ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval*) * ce->default_static_members_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_static_members_table[property_info.offset] = property;
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
ce->static_members_table = ce->default_static_members_table;
|
||||
}
|
||||
} else {
|
||||
property_info.offset = ce->default_properties_count++;
|
||||
ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval*) * ce->default_properties_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_properties_table[property_info.offset] = property;
|
||||
}
|
||||
|
||||
zend_mangle_property_name(&priv_name, &priv_name_length, ce->name, ce->name_length, name, name_len, ce->type & ZEND_INTERNAL_CLASS);
|
||||
property_info.name = priv_name;
|
||||
property_info.name_length = priv_name_length;
|
||||
|
||||
interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC);
|
||||
if (interned_name != property_info.name) {
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
efree((char*)property_info.name);
|
||||
} else {
|
||||
free((char*)property_info.name);
|
||||
}
|
||||
property_info.name = interned_name;
|
||||
}
|
||||
|
||||
property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1);
|
||||
|
||||
property_info.ce = ce;
|
||||
|
||||
if (property_info.doc_comment) {
|
||||
property_info.doc_comment = estrndup(property_info.doc_comment, property_info.doc_comment_len);
|
||||
}
|
||||
|
||||
zend_hash_quick_update(&ce->properties_info, name, name_len+1, h, &property_info, sizeof(zend_property_info), NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t i;
|
||||
@@ -4218,7 +4061,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
zend_bool not_compatible;
|
||||
zval* prop_value;
|
||||
char* doc_comment;
|
||||
|
||||
zend_uint flags;
|
||||
|
||||
/* In the following steps the properties are inserted into the property table
|
||||
* for that, a very strict approach is applied:
|
||||
* - check for compatibility, if not compatible with any property in class -> fatal
|
||||
@@ -4231,7 +4075,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
/* first get the unmangeld name if necessary,
|
||||
* then check whether the property is already there
|
||||
*/
|
||||
if ((property_info->flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
|
||||
flags = property_info->flags;
|
||||
if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
|
||||
prop_hash = property_info->h;
|
||||
prop_name = property_info->name;
|
||||
prop_name_length = property_info->name_length;
|
||||
@@ -4245,61 +4090,50 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
|
||||
/* next: check for conflicts with current class */
|
||||
if (zend_hash_quick_find(&ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
/* this one is inherited, lets look it up in its own class */
|
||||
zend_hash_quick_find(&coliding_prop->ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop);
|
||||
if (coliding_prop->flags & ZEND_ACC_PRIVATE) {
|
||||
/* private property, make the property_info.offset indenpended */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
prop_value = ce->traits[i]->default_static_members_table[property_info->offset];
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
zend_hash_quick_del(&ce->properties_info, prop_name, prop_name_length+1, prop_hash);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
prop_value = ce->traits[i]->default_properties_table[property_info->offset];
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
}
|
||||
Z_ADDREF_P(prop_value);
|
||||
|
||||
zend_traits_register_private_property(ce, prop_name, prop_name_length, property_info, prop_value TSRMLS_CC);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (property_info->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
} else {
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* property not found, so lets add it */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
if (flags & ZEND_ACC_STATIC) {
|
||||
prop_value = ce->traits[i]->default_static_members_table[property_info->offset];
|
||||
} else {
|
||||
prop_value = ce->traits[i]->default_properties_table[property_info->offset];
|
||||
@@ -4308,7 +4142,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
|
||||
doc_comment = property_info->doc_comment ? estrndup(property_info->doc_comment, property_info->doc_comment_len) : NULL;
|
||||
zend_declare_property_ex(ce, prop_name, prop_name_length,
|
||||
prop_value, property_info->flags,
|
||||
prop_value, flags,
|
||||
doc_comment, property_info->doc_comment_len TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -4432,20 +4266,6 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, Ha
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_add_to_list(&ce->trait_precedences, precedence_znode->u.op.ptr TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_add_trait_alias(znode *alias_znode TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_add_to_list(&ce->trait_aliases, alias_znode->u.op.ptr TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_trait_method_reference *method_ref = emalloc(sizeof(zend_trait_method_reference));
|
||||
@@ -4470,18 +4290,25 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */
|
||||
void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *trait_alias = emalloc(sizeof(zend_trait_alias));
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_trait_alias *trait_alias;
|
||||
|
||||
trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
trait_alias->modifiers = Z_LVAL(modifiers->u.constant);
|
||||
|
||||
if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'static' as method modifier");
|
||||
return;
|
||||
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_ABSTRACT) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier");
|
||||
return;
|
||||
} else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier");
|
||||
return;
|
||||
}
|
||||
|
||||
trait_alias = emalloc(sizeof(zend_trait_alias));
|
||||
trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
trait_alias->modifiers = Z_LVAL(modifiers->u.constant);
|
||||
if (alias) {
|
||||
trait_alias->alias = Z_STRVAL(alias->u.constant);
|
||||
trait_alias->alias_len = Z_STRLEN(alias->u.constant);
|
||||
@@ -4490,12 +4317,13 @@ void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *mod
|
||||
}
|
||||
trait_alias->function = NULL;
|
||||
|
||||
result->u.op.ptr = trait_alias;
|
||||
zend_add_to_list(&ce->trait_aliases, trait_alias TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */
|
||||
void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
zend_trait_precedence *trait_precedence = emalloc(sizeof(zend_trait_precedence));
|
||||
|
||||
trait_precedence->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr;
|
||||
@@ -4503,7 +4331,7 @@ void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode
|
||||
|
||||
trait_precedence->function = NULL;
|
||||
|
||||
result->u.op.ptr = trait_precedence;
|
||||
zend_add_to_list(&ce->trait_precedences, trait_precedence TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4538,7 +4366,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
|
||||
}
|
||||
return NULL;
|
||||
} else {
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES))) {
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
return ce;
|
||||
@@ -4970,10 +4798,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
|
||||
/* Prefix class name with name of current namespace */
|
||||
znode tmp;
|
||||
|
||||
tmp.op_type = IS_CONST;
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
|
||||
class_name = &tmp;
|
||||
*class_name = tmp;
|
||||
efree(lcname);
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
|
||||
}
|
||||
@@ -5106,9 +4935,9 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
|
||||
}
|
||||
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
&& (parent_token || (ce->num_interfaces > 0))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
if (ce->num_interfaces) {
|
||||
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
do_verify_abstract_class(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
@@ -5158,9 +4987,10 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_do_implements_trait(znode *trait_name TSRMLS_DC) /* {{{ */
|
||||
void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"Cannot use traits inside of interfaces. %s is used in %s",
|
||||
@@ -5890,7 +5720,11 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */
|
||||
void** list = *(void**)result;
|
||||
size_t n = 0;
|
||||
|
||||
while (list && list[n]) { n++; }
|
||||
if (list) {
|
||||
while (list[n]) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
list = erealloc(list, sizeof(void*) * (n+2));
|
||||
|
||||
|
||||
+6
-11
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -207,8 +207,6 @@ typedef struct _zend_try_catch_element {
|
||||
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
|
||||
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
|
||||
|
||||
#define ZEND_ACC_ALIAS 0x10000000
|
||||
|
||||
char *zend_visibility_string(zend_uint fn_flags);
|
||||
|
||||
|
||||
@@ -509,16 +507,13 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
|
||||
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC);
|
||||
|
||||
/* Trait related functions */
|
||||
void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC);
|
||||
void zend_add_trait_alias(znode *alias_znode TSRMLS_DC);
|
||||
void zend_do_use_trait(znode *trait_znode TSRMLS_DC);
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC);
|
||||
void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC);
|
||||
|
||||
|
||||
void zend_do_implements_trait(znode *interface_znode /*, znode* aliases */ TSRMLS_DC);
|
||||
ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC);
|
||||
ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC);
|
||||
void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC);
|
||||
void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
|
||||
void zend_do_early_binding(TSRMLS_D);
|
||||
@@ -621,7 +616,7 @@ void zend_do_end_compilation(TSRMLS_D);
|
||||
void zend_do_label(znode *label TSRMLS_DC);
|
||||
void zend_do_goto(const znode *label TSRMLS_DC);
|
||||
void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
|
||||
void zend_release_labels(TSRMLS_D);
|
||||
void zend_release_labels(int temporary TSRMLS_DC);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+40
-16
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -350,9 +350,14 @@ ZEND_METHOD(error_exception, getSeverity)
|
||||
#define TRACE_APPEND_STR(val) \
|
||||
TRACE_APPEND_STRL(val, sizeof(val)-1)
|
||||
|
||||
#define TRACE_APPEND_KEY(key) \
|
||||
if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \
|
||||
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
|
||||
#define TRACE_APPEND_KEY(key) \
|
||||
if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \
|
||||
if (Z_TYPE_PP(tmp) != IS_STRING) { \
|
||||
zend_error(E_WARNING, "Value for %s is no string", key); \
|
||||
TRACE_APPEND_STR("[unknown]"); \
|
||||
} else { \
|
||||
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
@@ -461,6 +466,11 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
HashTable *ht = Z_ARRVAL_PP(frame);
|
||||
zval **file, **tmp;
|
||||
|
||||
if (Z_TYPE_PP(frame) != IS_ARRAY) {
|
||||
zend_error(E_WARNING, "Expected array for frame %lu", hash_key->h);
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
|
||||
str = va_arg(args, char**);
|
||||
len = va_arg(args, int*);
|
||||
num = va_arg(args, int*);
|
||||
@@ -470,15 +480,25 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) {
|
||||
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
|
||||
line = Z_LVAL_PP(tmp);
|
||||
} else {
|
||||
line = 0;
|
||||
if (Z_TYPE_PP(file) != IS_STRING) {
|
||||
zend_error(E_WARNING, "Function name is no string");
|
||||
TRACE_APPEND_STR("[unknown function]");
|
||||
} else{
|
||||
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
|
||||
if (Z_TYPE_PP(tmp) == IS_LONG) {
|
||||
line = Z_LVAL_PP(tmp);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Line is no long");
|
||||
line = 0;
|
||||
}
|
||||
} else {
|
||||
line = 0;
|
||||
}
|
||||
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
|
||||
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
}
|
||||
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
|
||||
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
|
||||
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
|
||||
efree(s_tmp);
|
||||
} else {
|
||||
TRACE_APPEND_STR("[internal function]: ");
|
||||
}
|
||||
@@ -487,10 +507,14 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
|
||||
TRACE_APPEND_KEY("function");
|
||||
TRACE_APPEND_CHR('(');
|
||||
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
|
||||
int last_len = *len;
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||
if (last_len != *len) {
|
||||
*len -= 2; /* remove last ', ' */
|
||||
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
|
||||
int last_len = *len;
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
|
||||
if (last_len != *len) {
|
||||
*len -= 2; /* remove last ', ' */
|
||||
}
|
||||
} else {
|
||||
zend_error(E_WARNING, "args element is no array");
|
||||
}
|
||||
}
|
||||
TRACE_APPEND_STR(")\n");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -1313,7 +1313,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
opline++;
|
||||
}
|
||||
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(1 TSRMLS_CC);
|
||||
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+5
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -644,7 +644,8 @@ tail_call:
|
||||
struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj;
|
||||
|
||||
if (obj->buffered == (gc_root_buffer*)GC_WHITE) {
|
||||
GC_SET_BLACK(obj->buffered);
|
||||
/* PURPLE instead of BLACK to prevent buffering in nested gc calls */
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
|
||||
if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid &&
|
||||
(get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) {
|
||||
@@ -715,7 +716,8 @@ static void zobj_collect_white(zval *pz TSRMLS_DC)
|
||||
struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj;
|
||||
|
||||
if (obj->buffered == (gc_root_buffer*)GC_WHITE) {
|
||||
GC_SET_BLACK(obj->buffered);
|
||||
/* PURPLE instead of BLACK to prevent buffering in nested gc calls */
|
||||
GC_SET_PURPLE(obj->buffered);
|
||||
|
||||
if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid &&
|
||||
(get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -28,7 +28,7 @@
|
||||
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
|
||||
|
||||
#ifndef XtOffsetOf
|
||||
# if defined(CRAY) || (defined(__arm) && !defined(LINUX))
|
||||
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
|
||||
# ifdef __STDC__
|
||||
# define XtOffset(p_type, field) _Offsetof(p_type, field)
|
||||
# else
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1596
-1610
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+26
-19
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^"\n\r;\000]
|
||||
RAW_VALUE_CHARS [^\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
@@ -445,33 +445,40 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
return '=';
|
||||
}
|
||||
|
||||
<ST_RAW>["] {
|
||||
<ST_RAW>{RAW_VALUE_CHARS} { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
char *sc = NULL;
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
switch (*YYCURSOR) {
|
||||
case '\n':
|
||||
SCNG(lineno)++;
|
||||
break;
|
||||
case '\r':
|
||||
if (*YYCURSOR != '\n') {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
goto end_raw_value_chars;
|
||||
break;
|
||||
case '"':
|
||||
yyleng = YYCURSOR - SCNG(yy_text) - 2;
|
||||
SCNG(yy_text)++;
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
case ';':
|
||||
if (sc == NULL) {
|
||||
sc = YYCURSOR;
|
||||
}
|
||||
/* no break */
|
||||
default:
|
||||
YYCURSOR++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
end_raw_value_chars:
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
/* Eat trailing semicolons */
|
||||
while (yytext[yyleng - 1] == ';') {
|
||||
yyleng--;
|
||||
}
|
||||
|
||||
/* Eat leading and trailing double quotes */
|
||||
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
} else if (sc) {
|
||||
YYCURSOR = sc;
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */
|
||||
/* Generated by re2c 0.13.5 on Fri Nov 16 18:24:06 2012 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -452,7 +452,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
if (result == FAILURE) {
|
||||
if (result == FAILURE && !EG(exception)) {
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+10
-10
@@ -3,7 +3,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -375,13 +375,13 @@ unticked_class_declaration_statement:
|
||||
implements_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
|
||||
| interface_entry T_STRING
|
||||
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
|
||||
interface_extends_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -585,8 +585,8 @@ trait_use_statement:
|
||||
;
|
||||
|
||||
trait_list:
|
||||
fully_qualified_class_name { zend_do_implements_trait(&$1 TSRMLS_CC); }
|
||||
| trait_list ',' fully_qualified_class_name { zend_do_implements_trait(&$3 TSRMLS_CC); }
|
||||
fully_qualified_class_name { zend_do_use_trait(&$1 TSRMLS_CC); }
|
||||
| trait_list ',' fully_qualified_class_name { zend_do_use_trait(&$3 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
trait_adaptations:
|
||||
@@ -605,12 +605,12 @@ non_empty_trait_adaptation_list:
|
||||
;
|
||||
|
||||
trait_adaptation_statement:
|
||||
trait_precedence ';' { zend_add_trait_precedence(&$1 TSRMLS_CC); }
|
||||
| trait_alias ';' { zend_add_trait_alias(&$1 TSRMLS_CC); }
|
||||
trait_precedence ';'
|
||||
| trait_alias ';'
|
||||
;
|
||||
|
||||
trait_precedence:
|
||||
trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { zend_prepare_trait_precedence(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { zend_add_trait_precedence(&$1, &$3 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
trait_reference_list:
|
||||
@@ -628,8 +628,8 @@ trait_method_reference_fully_qualified:
|
||||
;
|
||||
|
||||
trait_alias:
|
||||
trait_method_reference T_AS trait_modifiers T_STRING { zend_prepare_trait_alias(&$$, &$1, &$3, &$4 TSRMLS_CC); }
|
||||
| trait_method_reference T_AS member_modifier { zend_prepare_trait_alias(&$$, &$1, &$3, NULL TSRMLS_CC); }
|
||||
trait_method_reference T_AS trait_modifiers T_STRING { zend_add_trait_alias(&$1, &$3, &$4 TSRMLS_CC); }
|
||||
| trait_method_reference T_AS member_modifier { zend_add_trait_alias(&$1, &$3, NULL TSRMLS_CC); }
|
||||
;
|
||||
|
||||
trait_modifiers:
|
||||
|
||||
+346
-344
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -578,6 +578,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
|
||||
zend_init_compiler_context(TSRMLS_C);
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
zend_do_return(&retval_znode, 0 TSRMLS_CC);
|
||||
@@ -592,7 +593,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
} else {
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
@@ -747,6 +748,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
|
||||
CG(interactive) = orig_interactive;
|
||||
CG(active_op_array) = op_array;
|
||||
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
|
||||
zend_init_compiler_context(TSRMLS_C);
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
@@ -766,7 +768,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Apr 30 15:55:05 2012 */
|
||||
/* Generated by re2c 0.13.5 on Wed Mar 27 23:52:29 2013 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
Loaded 100 of 996 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user