Compare commits

...
700 Commits
Author SHA1 Message Date
SVN Migration 7d2731bb32 This commit was manufactured by cvs2svn to create tag 'php_5_2_0RC1'. 2006-07-24 18:51:32 +00:00
Ilia Alshanetsky 5e24aedf46 5.2.0RC1 2006-07-24 18:51:31 +00:00
Pierre Joye 6cf345f571 - #38179 and zip entry 2006-07-24 18:30:53 +00:00
Andrei Zmievski 8474838a9a +1 for keys 2006-07-24 18:18:33 +00:00
Marcus Boerger d0f2f6cd04 - MFH zend_unmangle_property_name(), drop zend_unmangle_property_name_ex() 2006-07-24 18:03:45 +00:00
Marcus Boerger 519ed8e13b - Better fix for #34505 and related, drop zend_unmangle_property_name_ex() 2006-07-24 17:58:32 +00:00
Pierre Joye 53d297a7ea - this one was not in 2006-07-24 17:26:24 +00:00
SVN Migration 664d102aa6 This commit was manufactured by cvs2svn to create branch 'PHP_5_2'. 2006-07-24 16:58:59 +00:00
Michael Wallner 467e129ce5 - note about allow_url_include 2006-07-24 12:15:28 +00:00
Dmitry Stogov b9ba07f7a0 Documentation fix 2006-07-24 12:15:07 +00:00
Dmitry Stogov 3b7386acea Fixed memory leaks detection 2006-07-24 08:15:26 +00:00
Dmitry Stogov a49e04477f Test for bug #38146 (Cannot use array returned from foo::__get('bar') in write context) 2006-07-24 07:43:49 +00:00
Ilia Alshanetsky 60b2f49762 Fixed compiler warning. 2006-07-24 03:58:41 +00:00
foobar 1a8d655fec fix build and typo after another lazy ass who does not test before commit: Dmitry 2006-07-24 00:01:02 +00:00
foobar 25f06142c2 MFH: cleanup after lazy people 2006-07-23 23:55:46 +00:00
foobar 93c0ddb2f3 MFH: fix compile failure and remove unnecessary TSRMLS_FETCH calls 2006-07-23 23:50:43 +00:00
Pierre Joye 261beb0326 - #38179, imagecopy, palette to truecolor must use alpha channel too 2006-07-23 21:41:12 +00:00
Marcus Boerger 43fa4e015b - This was reintroduced by Zeev
# I could need help in writing this file. Actually i know why i didn't want
# to start it in the first place.
2006-07-23 18:51:23 +00:00
Andrei Zmievski bb430b3737 Gah. 2006-07-22 16:58:39 +00:00
Andrei Zmievski d827c76379 Matt should be happy now. 2006-07-22 16:58:06 +00:00
Stefan Esser cfac29e20e Added RFC1867 fileupload processing hook. 2006-07-22 16:38:29 +00:00
foobar 2b8ad5a0af MFH:- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be called Foo) 2006-07-22 15:41:42 +00:00
Rob Richards 40e08311e5 MFH: enable by default 2006-07-22 15:33:02 +00:00
Nuno Lopes ff591e2cf0 more const keywording 2006-07-22 15:22:56 +00:00
Nuno Lopes 5e7efb5ec9 dont create images in the php source root. output them instead 2006-07-22 15:15:53 +00:00
Pierre Joye 4219fe6c66 - hopla, before I got more conflicts ;)
(fix compiler warnings with latest const char changes)
2006-07-22 12:59:15 +00:00
Nuno Lopes 083b13335e use const keyword where possible 2006-07-22 12:49:36 +00:00
Pierre Joye 3ce212ccae - silent compiler warnings (char/unsigned char) 2006-07-22 09:39:24 +00:00
Pierre Joye 0714c1a3d5 - api shake #1, parse_pararameter has to be changed too 2006-07-22 09:09:06 +00:00
Pierre Joye 697f4e1f08 - API Shake up #1, use input type as first argument in input_get_args
(INPUT_GET/POST)
2006-07-22 08:58:03 +00:00
Andrei Zmievski 1223119155 MFH 2006-07-21 23:54:19 +00:00
Marcus Boerger a6f8252f9b - MFH Update docu 2006-07-21 21:55:43 +00:00
Marcus Boerger 6a738f6b5b - MFH Match code with docu 2006-07-21 21:26:11 +00:00
Marcus Boerger 85963e6300 - MFH Update RegexIterator, Docu & Tests 2006-07-21 20:14:31 +00:00
Dmitry Stogov 33a1a4d39a Changed error message (E_ERROR -> E_NOTICE) in case of indirect modification of overloaded property. 2006-07-21 10:32:17 +00:00
Dmitry Stogov 9a98904ddd Fixed wrong "type" argument to read_property() handler 2006-07-21 08:39:30 +00:00
Marcus Boerger 45d09c71ba - Synch RegexIterator with HEAD 2006-07-20 22:54:21 +00:00
Marcus Boerger 6fb763c4f9 - MFH Clean up (after consulting Andrei)
. Change the handlers SPL uses to php_pcre_*_impl(pcre_cache_entry*,....)
  . All refactored funcs (match, split, replace, grep) use the above
  . Change (zend|php)_error() to php_error_docref()
  . Move from old to new param parsing api
  . Fix memleaks in unicode mode
2006-07-20 22:53:07 +00:00
Edin Kadribasic 163e1fd41c Lib update 2006-07-20 22:21:27 +00:00
Seiji Masugata 3e1c05170e Initial commit. Updated bundled oniguruma library (used for multibyte regular expression) to 4.2.0. 2006-07-20 15:56:29 +00:00
Derick Rethans 150d058008 - MFH: Rename date classes to DateTime and DateTimeZone 2006-07-20 15:49:02 +00:00
Seiji Masugata e95f9a0eeb Updated bundled oniguruma library (used for multibyte regular expression) to 4.2.0. 2006-07-20 15:45:07 +00:00
Pierre Joye d6c2c283ed - make boolean logical filter works like int/float and php itself
- add more tests for boolean input
2006-07-20 12:58:13 +00:00
Antony Dovgal f59a139f61 rephrase 2006-07-20 10:47:37 +00:00
foobar 68ae270793 MFH: simplify 2006-07-20 10:11:15 +00:00
foobar 34ae4eafd0 update 2006-07-20 10:09:09 +00:00
foobar 479055a85b MFH 2006-07-20 10:07:29 +00:00
Antony Dovgal 3003cd2473 MFH: use E_WARNING on recursion and add null to the result to keep it valid 2006-07-20 09:33:28 +00:00
Antony Dovgal 60720d285f MFH: ZTS fix 2006-07-20 09:19:02 +00:00
Antony Dovgal ad8445a828 add missing .cvsignore 2006-07-20 08:58:49 +00:00
Antony Dovgal 3e308d3a6b MFH: add recursion protection to json_encode() and new tests 2006-07-20 08:56:57 +00:00
Antony Dovgal 0b97d2bd60 fix segfault, add test 2006-07-20 08:24:31 +00:00
Antony Dovgal 074feedc2b MFH 2006-07-20 07:40:49 +00:00
Antony Dovgal 926961192f MFH 2006-07-20 07:30:22 +00:00
Antony Dovgal efe0314db6 break; break; -> break; 2006-07-20 07:20:23 +00:00
Pierre Joye 92b6f24241 - fix tests for PI with libxml 2.6.24+, a new line is now added 2006-07-19 18:50:51 +00:00
Ilia Alshanetsky 221ac1b9e5 Extension news 2006-07-19 16:20:02 +00:00
Ilia Alshanetsky cdfe00b801 Fixed compiler warnings and enable Json by default. 2006-07-19 16:17:15 +00:00
foobar a90c48fb48 un*uck NEWS 2006-07-19 13:54:56 +00:00
foobar 92f080a0a3 Missing file.. 2006-07-19 13:45:43 +00:00
Michael Wallner 46f21b8a32 MFH: added error_get_last() function 2006-07-19 12:25:46 +00:00
Dmitry Stogov f7c99da2fe Fixed bug #37144 (PHP crashes trying to assign into property of dead object) 2006-07-19 09:55:19 +00:00
Antony Dovgal e8241e59ac no need to fetch name and free it immediately after that 2006-07-19 08:35:55 +00:00
Antony Dovgal 28c9afe35d fix tests 2006-07-19 08:26:50 +00:00
Antony Dovgal 4e8a4a4235 MFH: increase refcount when adding zval to the result array 2006-07-19 07:18:34 +00:00
Antony Dovgal f61572e645 fix compile warnings 2006-07-19 06:57:21 +00:00
Antony Dovgal ca7875ab83 fetch tsrm_ls, don't use it uninitialized 2006-07-19 06:32:52 +00:00
Ilia Alshanetsky 480104a456 Fixed memory leak 2006-07-18 22:42:28 +00:00
Antony Dovgal c204ff0258 MFH: fix build on platforms without mremap() 2006-07-18 15:41:58 +00:00
Antony Dovgal a390c84dc5 news entry 2006-07-18 14:58:42 +00:00
Antony Dovgal 9e905c3de7 MFH: add gmp_nextprime()
patch by ants dot aasma at gmail dot com
2006-07-18 14:54:32 +00:00
Derick Rethans 9ccbb28696 - Enable all new date functions and classes 2006-07-18 12:38:05 +00:00
Antony Dovgal b45268a07a fix test 2006-07-18 09:22:32 +00:00
Dmitry Stogov 29ed52ffa4 New memory manager 2006-07-18 09:06:33 +00:00
Antony Dovgal 7f9a43653c fix logic 2006-07-18 09:00:10 +00:00
Antony Dovgal 7a089a43af MFH: fix DVAL_TO_LVAL() on AIX with old gcc 2006-07-18 08:17:28 +00:00
Ilia Alshanetsky fea4eeb845 Added possible failure note. 2006-07-18 00:09:01 +00:00
Marcus Boerger 34cfec2536 - MFH Fix #38125 undefined reference to spl_dual_it_free_storage 2006-07-17 21:11:33 +00:00
Michael Wallner c0fcaa7acb - fix bug #37945 pathinfo() cannot handle argument with special characters
like german "Umlaute"
2006-07-17 20:36:47 +00:00
Pierre Joye 2a06ce8518 - #38112, add test and use MAX_LWZ_BITS instead of the value 2006-07-17 14:30:21 +00:00
Pierre Joye cb41a19f28 - sync tests with HEAD 2006-07-17 12:54:09 +00:00
Nuno Lopes 46c036cd4d make valgrind trace child processes. useful for the PCNTL extension (fork()), for example 2006-07-17 11:43:48 +00:00
Nuno Lopes 7a38509835 new test 2006-07-17 11:39:13 +00:00
Nuno Lopes 0433d29020 now they are really equivalent.. 2006-07-17 10:48:11 +00:00
Antony Dovgal 7c24d8fbee typofix 2006-07-17 10:08:17 +00:00
Dmitry Stogov d68797945a Fixed memory leaks in ZTS mode. 2006-07-17 07:20:12 +00:00
Antony Dovgal f3f44275f4 MFH 2006-07-17 06:45:08 +00:00
Seiji Masugata 1d6182a907 added option parameter mb_strrpos( ). 2006-07-17 04:48:17 +00:00
Ilia Alshanetsky cd0e0124c9 Don't use regex where none is needed. 2006-07-17 03:57:31 +00:00
Marcus Boerger 109c89c848 - MFH Typo 2006-07-16 23:48:34 +00:00
Marcus Boerger f2623f0b50 - MFH Update docu 2006-07-16 23:46:12 +00:00
Marcus Boerger 55f0596fab - MFH:
. Upgrade RegexIterator capabilities, see docu
  . Update docu
  . Add test (which fails right now: iterator_049.phpt)
  . Add tests for new functionality
2006-07-16 21:12:32 +00:00
Marcus Boerger bf4c9ef686 - MFH: Little bit refactoring: Two new PHPAPI functions:
. php_pcre_match
  . php_pcre_split
2006-07-16 21:09:30 +00:00
Nuno Lopes 717ca4ef55 new tests. almost 90% of code coverage 2006-07-16 19:35:09 +00:00
Marcus Boerger bd760162e6 - MFH Correct test name 2006-07-16 17:34:37 +00:00
Christian Stocker 2dbcfcb8cb improved code (after suggestion by helly) 2006-07-16 16:04:09 +00:00
Antony Dovgal e79591b081 fix test 2006-07-16 15:59:08 +00:00
Christian Stocker dc8ba6f475 Added DOMNode::getNodePath() for getting an XPath for a node. 2006-07-16 15:03:53 +00:00
Pierre Joye 17f6ae66ce - #38112, corrupt GIF segfaults, test will follow 2006-07-16 11:07:31 +00:00
Marcus Boerger dc571fa9e2 - MFH Fixed Bug #29538 number_format and problem with 0 2006-07-16 10:50:58 +00:00
Marcus Boerger f03f2c5eae - MFH Pathinfo allows to get filename (Toby S, Christian S) 2006-07-16 10:37:24 +00:00
Marcus Boerger 9c30e20bd6 - MFH Implement todo: SplFileObject: ability to set the CSV separator per object 2006-07-15 15:08:41 +00:00
Marcus Boerger bb3c702162 - MFH Fix issue with SplFileObject and directories 2006-07-15 13:01:59 +00:00
Marcus Boerger 31a8d6a6b3 - MFH array_fill_keys, better unicode support, use new param parsing API 2006-07-15 12:14:07 +00:00
Marcus Boerger 87c64280b0 - MFH Added array_fill_keys(). (Marcus, Mathew W) 2006-07-15 10:21:10 +00:00
Antony Dovgal 54dba635a3 rephrase the error message (fixes #38106) 2006-07-14 20:44:04 +00:00
Nuno Lopes 3876158e8f fix test with some aspell versions 2006-07-14 16:14:05 +00:00
Antony Dovgal 19a9052d6e fix build 2006-07-13 17:03:35 +00:00
Ilia Alshanetsky ab6d4d411a Fixed test for systems where set_charset() method is unavailable. 2006-07-13 15:42:43 +00:00
Ilia Alshanetsky 9c125eeb27 Fixed compiler warnings. 2006-07-13 15:05:30 +00:00
Antony Dovgal 4902fc6c25 MFH: fix #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length)
add tests
2006-07-13 12:00:17 +00:00
Ilia Alshanetsky 1784db8087 Fixed compiler warnings. 2006-07-13 00:13:19 +00:00
Antony Dovgal a9469060e5 MFH: init variables and get rid of annoying warnings 2006-07-12 21:17:30 +00:00
Antony Dovgal 9d57621235 MFH: initialize EG(exit_status) in ZTS mode 2006-07-12 18:10:56 +00:00
Michael Wallner 33dbaff1ed MFH: add note why replace is 0, so that I don't wonder again in 2 months
why session_regenerate_id() sends the session cookie twice
2006-07-12 15:28:44 +00:00
Antony Dovgal f9070e626a bailout on error and don't try to create fields of unknown type
add test
2006-07-12 13:08:38 +00:00
Antony Dovgal 69d6fe45c8 it's usually good idea to initialize variables
especially if you rely on their values
2006-07-12 12:38:49 +00:00
Antony Dovgal 3cce465528 fix invalid read - no need to compare strings if haystack is "" or shorter than needle
add test
2006-07-12 12:33:48 +00:00
Antony Dovgal 8a35e9d014 fix #38072 (boolean arg for mysqli_autocommit() is always true on Solaris) 2006-07-12 09:51:47 +00:00
Antony Dovgal 1f09c0b9d5 fix TSRM build 2006-07-12 09:33:37 +00:00
Dmitry Stogov c48a2e38f4 Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding option) 2006-07-12 08:59:40 +00:00
Hartmut Holzgraefe 3fe315c652 MFH new test cases 2006-07-12 08:01:44 +00:00
Dmitry Stogov b6d2c54059 Destructors call order is changed (Fixed bug #36759 - Objects destructors are invoked in wrong order when script is finished) 2006-07-12 07:55:17 +00:00
Dmitry Stogov 8bb047ee97 Fixed bug #36759 (Objects destructors are invoked in wrong order when script is finished). 2006-07-12 07:54:00 +00:00
Marcus Boerger 39a4078b8c - Reorder and add missing 2006-07-12 07:34:28 +00:00
Hartmut Holzgraefe e796974f6f fixed C&P errors in groups handling, activated groups feature 2006-07-12 07:01:04 +00:00
Hartmut Holzgraefe aca6460346 MFH 2006-07-11 23:45:28 +00:00
Hartmut Holzgraefe ae749049f5 MFH make sure that embedded database is correctly initialized 2006-07-11 23:43:55 +00:00
Hartmut Holzgraefe 61e9783154 debug output was breaking all tests 2006-07-11 23:42:58 +00:00
Hartmut Holzgraefe 3e099a5983 MFH test for ping and kill methods 2006-07-11 23:35:38 +00:00
Ilia Alshanetsky d21628f993 Fixed test 2006-07-11 22:13:53 +00:00
Antony Dovgal 7ff8061d0a add new tests by Ligaya Turmelle 2006-07-11 21:28:38 +00:00
Antony Dovgal 40b87ec99f MFH: /tmp is often a symlink, use /bin instead 2006-07-11 21:20:20 +00:00
Antony Dovgal 24d3381b10 fix typo, add new test 2006-07-11 16:33:25 +00:00
Dmitry Stogov a602a3eef5 Nuke signed/unsigned compiler warnings 2006-07-11 14:35:50 +00:00
Dmitry Stogov ee1dc90d1e Nuke signed/unsigned compiler warnings 2006-07-11 14:24:18 +00:00
Antony Dovgal b491930ef6 fix segfault in jdmonthname(), add test 2006-07-11 14:16:26 +00:00
Antony Dovgal 5e93a7df9a eliminate compile warnings 2006-07-11 12:37:00 +00:00
Antony Dovgal 3aaf62d159 there is no Unicode in 5_2 2006-07-11 12:15:11 +00:00
Dmitry Stogov 631a00a0a0 Fixed memory leak in case of exception in iterator callbacks in 'foreach(new Iterator()...' (spl/tests/iterator_047.phpt). 2006-07-11 08:52:28 +00:00
Ilia Alshanetsky 190c186fb8 apache2handler sapi is no longer experimental 2006-07-11 00:15:30 +00:00
Hartmut Holzgraefe c1b67d83cc (MFH) "transaction" tests should test commit, too, not only rollback 2006-07-10 16:29:50 +00:00
Dmitry Stogov fbd3ef09ed Fixed memory leaks in ext/spl/tests/fileobject_003.phpt 2006-07-10 15:47:58 +00:00
Hartmut Holzgraefe 836e74ebee MFH 2006-07-10 14:06:13 +00:00
Dmitry Stogov 83ac79600e Fixed bug #37947 (zend_ptr_stack reallocation problem) 2006-07-10 14:02:40 +00:00
Antony Dovgal d9d23050d1 MFH: fix mysqli_*_free_storage() funcs to conform with their prototypes 2006-07-10 13:02:43 +00:00
Dmitry Stogov 26c7981ccf Another fix for #38019 2006-07-10 12:46:28 +00:00
Antony Dovgal 3113fa9440 MFH: initialize vars 2006-07-10 11:26:22 +00:00
Dmitry Stogov 26499be68f Fixed bug #38055 (Wrong interpretation of boolean parameters) 2006-07-10 10:33:43 +00:00
Dmitry Stogov 690e86fdb2 Fixed bug #38019 (segfault extending mysqli class) 2006-07-10 10:05:20 +00:00
Dmitry Stogov 795a482a48 Fixed bug #38005 (SoapFault faultstring doesn't follow encoding rules) 2006-07-10 07:41:33 +00:00
Hartmut Holzgraefe 098d3d2b02 MFH 2006-07-10 07:39:35 +00:00
Dmitry Stogov 1cfb8af265 Fixed test 2006-07-10 07:26:17 +00:00
Dmitry Stogov c389a653f7 Fixed bug #38004 Parameters in SoapServer are decoded twice 2006-07-10 07:21:41 +00:00
Marcus Boerger f66cd50510 - BFN 2006-07-10 00:36:47 +00:00
Marcus Boerger 704eced26b - MFH Fixed Bug #37667 (Object is not added into array returned by __get) 2006-07-10 00:36:28 +00:00
Marcus Boerger 71efa5b435 - MFH Fixed bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute) 2006-07-10 00:18:53 +00:00
Marcus Boerger c5ff44688a - MFH Fix logic 2006-07-09 23:30:19 +00:00
Ilia Alshanetsky ff08705591 Removed pointless declarations 2006-07-09 23:28:28 +00:00
Marcus Boerger d6b489fb32 - Add new entry 2006-07-09 22:58:36 +00:00
Marcus Boerger 21858220b2 - MFH It appears i am the maintainer 2006-07-09 22:49:16 +00:00
Marcus Boerger ec11b44e84 - BFN 2006-07-09 22:45:32 +00:00
Marcus Boerger dd5cbcd24c - Fixed Bug #37811 define not using toString on objects 2006-07-09 22:45:11 +00:00
Marcus Boerger c514ee0c9b - MFH Fix issue with comparing objects with objects 2006-07-09 18:03:42 +00:00
Marcus Boerger 2f0e80afac - BFN 2006-07-09 17:53:55 +00:00
Marcus Boerger e9be807267 - MFH Add new test 2006-07-09 17:04:27 +00:00
Marcus Boerger fa57959f47 - MFH:
. Fix comparision edgecases involving objects (Tony, Marcus)
  . Use ZVAL_LONG() where appropriate
2006-07-09 16:58:05 +00:00
Marcus Boerger d5811fc08a - MFH Fix test 2006-07-09 16:56:22 +00:00
Marcus Boerger d26b539c61 - MFH DualIterator 2006-07-09 10:24:32 +00:00
Marcus Boerger 5fee10735f - MFH Add spl_object_hash() 2006-07-09 10:22:27 +00:00
Marcus Boerger 0fd2b96204 - MFH Add test 2006-07-08 12:25:57 +00:00
Nuno Lopes c26991a9eb MFH 2006-07-08 00:13:17 +00:00
Nuno Lopes 8b139b654d static + const keywords 2006-07-07 23:32:14 +00:00
Hannes Magnusson 147840dd93 MFH: ReflectionFunction::isDisabled() 2006-07-07 11:55:23 +00:00
Ilia Alshanetsky 89635eb158 E_ERROR > E_RECOVERABLE_ERROR 2006-07-06 23:13:18 +00:00
Antony Dovgal 91f9af4360 add test 2006-07-06 16:14:56 +00:00
Sara Golemon 86bbbbdce4 MFH (def.h rev:1.121, execute.h rev:1.120)
Silence FETCH_OBJ_IS / undefined notices
2006-07-06 15:32:07 +00:00
Ilia Alshanetsky 278dc574f2 E_ERROR > E_RECOVERABLE_ERROR 2006-07-05 17:38:14 +00:00
Antony Dovgal d90263437c add test for bug #38003 2006-07-05 13:31:17 +00:00
Antony Dovgal 0c05e6da00 fix tests 2006-07-05 11:55:59 +00:00
Antony Dovgal 058b529ae7 oops.. fix copy/paste typo 2006-07-05 11:54:08 +00:00
Antony Dovgal 4c26ed263d BFN 2006-07-05 11:49:37 +00:00
Antony Dovgal 0f8f945418 MFH: fix bug #38003(in classes inherited from mysqli it's possible to call private constructors from invalid context) 2006-07-05 11:48:30 +00:00
Antony Dovgal c4c96c042e MFH: export zend_std_get_constructor() 2006-07-05 11:41:25 +00:00
Antony Dovgal 859ab9a4cf MFH: improve error messages 2006-07-05 11:39:00 +00:00
Edin Kadribasic e84a7de005 apache2filter on windows news 2006-07-05 10:18:25 +00:00
SVN Migration 1b0a789ab9 This commit was manufactured by cvs2svn to create branch 'PHP_5_2'. 2006-07-05 10:12:43 +00:00
Ilia Alshanetsky f0178f71ee Eliminate some compiler warnings 2006-07-04 20:12:38 +00:00
Derick Rethans d060a6e8a2 - MFH: Updated timezonedb to version 2006.7.
- MFH: Fixed test cases because of new constant values for the formats.
2006-07-04 18:13:58 +00:00
Hannes Magnusson 612e75442f mfh 2006-07-04 15:37:34 +00:00
Hannes Magnusson 1d6e7e3d93 MFH: Fix protos&arginfo 2006-07-04 15:33:57 +00:00
Dmitry Stogov d550c270ce Fixed memory leak 2006-07-04 07:26:53 +00:00
Dmitry Stogov acb1e07980 Changed priority of PHPRC environment variable on win32 to be higher then value from registry. 2006-07-04 06:35:49 +00:00
Hannes Magnusson a32fb32781 Make everyone happy 2006-07-03 22:42:03 +00:00
Ilia Alshanetsky 4a0d670f43 Fixed test 2006-07-03 21:58:46 +00:00
John Coggeshall 42c462c755 Adding Apache2Filter news 2006-07-03 16:55:57 +00:00
John Coggeshall 3a0791c99b Reimplementation of the way Apache 2 Filter works. Instead of ripping the
source from a file (thus bypassing any previous filters in the chain). This
implementation wraps Zend's internal stream mechanism, allowing ZE to read
from Apache's streams instead.
2006-07-03 16:51:38 +00:00
Hannes Magnusson 87bc74ea7a fix tests 2006-07-03 16:03:51 +00:00
Nuno Lopes 919d737505 more testing 2006-07-03 14:46:44 +00:00
Nuno Lopes 9990b3f431 new tests and fix the locales test where the pt local isnt available. 2006-07-03 13:04:45 +00:00
Ilia Alshanetsky 1b2cc459c6 Fixed bug #37987 (invalid return of file_exists() in safe mode). 2006-07-02 13:51:40 +00:00
Hannes Magnusson 7af33194e5 MFH: arginfo fixes 2006-07-02 00:11:06 +00:00
Nuno Lopes b7311e9173 fixed segfaults and such things within the new assert02.phpt test 2006-07-01 12:21:07 +00:00
Nuno Lopes 7961207d6b add const keywords 2006-07-01 11:35:34 +00:00
Hannes Magnusson 6910275d51 MFH reference fixes 2006-06-30 18:17:38 +00:00
Antony Dovgal bdd4183fba news 2006-06-30 10:55:06 +00:00
Antony Dovgal a518b450fd MFH: add error messages to disk_free_space() & disk_total_space() (feature request #37971) 2006-06-30 10:53:11 +00:00
Ilia Alshanetsky 9048ae292c Fixed test for situations where pspell_clear_session() is unavailable. 2006-06-29 22:54:31 +00:00
Antony Dovgal 6c37c9fa0a fix test on AIX and Solaris 2006-06-29 22:45:19 +00:00
Ilia Alshanetsky 70f2bcf763 Fixed test 2006-06-29 22:42:25 +00:00
Hannes Magnusson 1c530aa7cb Fix test on linux 2006-06-29 22:10:47 +00:00
Hannes Magnusson 3fd28953c6 mfh 2006-06-29 15:01:31 +00:00
Hannes Magnusson 77b307021d fix test 2006-06-29 14:53:50 +00:00
Hannes Magnusson 7a6fe06e4b url->URL 2006-06-29 14:40:49 +00:00
Hannes Magnusson bcd06ef1b6 Bug #37961 (url should be URL) 2006-06-29 14:31:56 +00:00
Antony Dovgal b8f97db580 MFH: make sure we won't get into endless loop 2006-06-29 09:03:27 +00:00
Antony Dovgal 6a43f6805c add new tests 2006-06-29 09:00:33 +00:00
Ilia Alshanetsky 24ac7931cd Improved safe_mode check for the error_log() function. 2006-06-28 22:08:42 +00:00
Antony Dovgal 5ca11825d1 BFN 2006-06-28 15:04:28 +00:00
Antony Dovgal 0212ec6c71 MFH: fix #37931 (possible crash after database restart when using persistent connections) 2006-06-28 15:03:33 +00:00
Nuno Lopes e8a3530d50 new tests (001.phpt is just a rename from the older one)
increases coverage from 20% to 70%
2006-06-28 14:36:23 +00:00
Ilia Alshanetsky 58c82af64d Improved the error reporting in SOAP extension on request failure. 2006-06-27 23:32:56 +00:00
Nuno Lopes 38e47dd0bb add new tests. bump code coverage to more than 80% 2006-06-27 22:43:26 +00:00
Hannes Magnusson 297a3d8e4c arginof fixes 2006-06-27 22:14:18 +00:00
Hannes Magnusson 52fd069ff4 Fix arg info (php6 features) 2006-06-27 21:42:16 +00:00
Antony Dovgal 41ada4ba9b add new tests 2006-06-27 21:10:04 +00:00
Nuno Lopes 29b0798cc8 revert per Derick request 2006-06-27 21:00:03 +00:00
Antony Dovgal badf27fb2a MFH: no need to throw E_ERROR here 2006-06-27 19:58:43 +00:00
Nuno Lopes 5c97837ca2 add a couple of static and const keywords, to let the compiler optimize better
will MFB in a hour, or so
2006-06-27 19:48:01 +00:00
Antony Dovgal 7dec2a7354 more tests 2006-06-27 15:55:06 +00:00
Antony Dovgal 5f024dcc16 more date() tests 2006-06-27 15:08:16 +00:00
Antony Dovgal ac4f8071c5 BFN 2006-06-27 08:28:24 +00:00
Antony Dovgal 6c52ec1319 MFH: fix #37920 (compilation problems on z/OS) 2006-06-27 08:27:10 +00:00
Hannes Magnusson aaa1d62614 MFH: fix/add SKIPIF 2006-06-27 00:09:43 +00:00
Hannes Magnusson 000957818e MFH: fix test 2006-06-26 23:42:59 +00:00
Antony Dovgal 8058f9fd11 add new tests 2006-06-26 23:35:22 +00:00
Antony Dovgal e24fe395a2 MFH: zero-terminate strings produced with FORCE_DEFLATE 2006-06-26 23:22:58 +00:00
Antony Dovgal 3d97f45bc4 don't try to inflate empty strings (and stop segfaulting!) 2006-06-26 22:53:10 +00:00
Hannes Magnusson fd1679e7f0 nuke obsolete arginfo 2006-06-26 22:47:31 +00:00
Hannes Magnusson e06665c961 MFH: argument info 2006-06-26 22:41:22 +00:00
Hannes Magnusson c9c2c0e1f8 MFH: test for bug #37244 2006-06-26 22:20:27 +00:00
Antony Dovgal 3d63ca3edc add new tests, improve the old ones 2006-06-26 22:17:18 +00:00
Antony Dovgal 5d2d2fd5a3 MFH: detect empty mode string and avoid off-by-one 2006-06-26 21:13:46 +00:00
Hannes Magnusson ec420c3df8 Updated protos & vim folding 2006-06-26 18:48:56 +00:00
Hannes Magnusson 5326a8b2bc MFH: argument info for php_user_filter
Add tests
2006-06-26 17:23:39 +00:00
Hannes Magnusson 223d122cae MFH: use the ZEND_ACC_DEPRECATED flag rather than custom warnings 2006-06-26 16:33:39 +00:00
Hannes Magnusson d258bcd951 MFH: Removed obsolete arginfo include 2006-06-26 14:11:17 +00:00
Hannes Magnusson ae1ec65637 Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML() 2006-06-26 13:41:52 +00:00
Dmitry Stogov de85c9cd70 Fixed bug #37862 (Integer pointer comparison to numeric value) 2006-06-26 13:23:46 +00:00
Rasmus Lerdorf 862c4d2345 MFH: fix sapi_getenv() leak 2006-06-26 13:15:20 +00:00
Hannes Magnusson 563c920c24 MFH http_build_query() & parse_url() news
# Patch by helgi thormar
2006-06-25 23:22:40 +00:00
Antony Dovgal 0b073cd34c improve test file
don't forget to test invalid parameters etc.
2006-06-25 21:21:59 +00:00
Hannes Magnusson a5d56bb9f5 Added image_type_to_extension()
# Was suppost to be in 5.0beta#3... :)
2006-06-25 21:12:49 +00:00
Hannes Magnusson d836ff68c8 WS fix 2006-06-25 21:08:28 +00:00
Hannes Magnusson 7b6bf33b03 MFH: image_type_to_mime_type() 2006-06-25 21:06:39 +00:00
Marcus Boerger 97062cade9 - MFH Fix ReflectionObject::getProperties() + dyn properties 2006-06-24 18:55:15 +00:00
Antony Dovgal 87dd729187 plug leak 2006-06-23 13:53:43 +00:00
Ilia Alshanetsky f1d09682fb Change E_ERROR to E_RECOVERABLE_ERROR 2006-06-23 11:37:53 +00:00
Antony Dovgal 1fdd8d7b2a MFH: fix typo and bug #37886 2006-06-23 08:26:15 +00:00
Michael Wallner 68421695ac - use %zu to format size_t 2006-06-23 07:30:26 +00:00
Antony Dovgal 1757bf8822 fix typo 2006-06-22 21:24:23 +00:00
Antony Dovgal 6ccc1d1fb5 MFH: add wrappers for timelib_day_of_week_ex() 2006-06-22 21:04:32 +00:00
Antony Dovgal 47b41a5d6c MFH:
don't try to parse empty string, return false immediately
(fixes off-by-one)
2006-06-22 18:44:31 +00:00
Ilia Alshanetsky 0d708dc358 Fixed compiler warnings. 2006-06-21 15:19:23 +00:00
Antony Dovgal 4b674fb7b0 MFH: improve check for stream mode, add tests 2006-06-21 14:38:28 +00:00
Antony Dovgal 8c30a7f8a6 MFH: don't try to read or write from/to a stream if it was open in different mode (leads to segfault in libbz2) 2006-06-21 13:12:37 +00:00
Antony Dovgal e7439fa200 MFH: fix invalid read with bzopen("","") and prevent filename from being empty (which causes endless loop somewhere is libbz2) 2006-06-21 12:43:27 +00:00
Ilia Alshanetsky f496f5014a Removed pointless callbacks. 2006-06-20 22:39:15 +00:00
Nuno Lopes b7bca610dd make sure the test outputs what we want 2006-06-20 21:49:16 +00:00
Hannes Magnusson 437494ddf7 Bug fix news... 2006-06-20 19:35:52 +00:00
Hannes Magnusson 748b589925 Renamed to bug37864.phpt 2006-06-20 19:33:31 +00:00
Hannes Magnusson 1332a14cfc MFH 2006-06-20 19:32:59 +00:00
Antony Dovgal 959af2a28d don't leave garbage in tmp dir 2006-06-20 18:55:46 +00:00
Hannes Magnusson 3674994be5 MFH: test for file_get_contents leaking on empty file 2006-06-20 18:48:56 +00:00
Hannes Magnusson c4154145df MFH: plug memleak 2006-06-20 18:09:50 +00:00
Hannes Magnusson c14ba0f124 MFH: Missing header include 2006-06-20 18:04:25 +00:00
Antony Dovgal 5ffbb85103 MFH: init variables 2006-06-20 13:28:11 +00:00
Antony Dovgal 3ff986ecf7 init vatiables 2006-06-20 13:26:01 +00:00
Antony Dovgal eaf4ea2e74 MFH: nuke unused variables and init variables when needed 2006-06-20 13:21:16 +00:00
Antony Dovgal 44005b7986 fix test 2006-06-20 13:14:29 +00:00
Antony Dovgal 8df36aaf32 fix test 2006-06-20 13:06:50 +00:00
Antony Dovgal 20a379fa7d MFH: initialize pointers 2006-06-20 12:55:26 +00:00
Ilia Alshanetsky 0406556da4 Added missing ifdef block.
# Thanks Mike
2006-06-19 23:52:39 +00:00
Antony Dovgal ba8f17e483 MFH: display oci8 version in phpinfo() 2006-06-19 18:21:28 +00:00
Antony Dovgal 33616195b9 MFH: plug leak in CGI SAPI when running scripts with query string in console 2006-06-19 17:49:26 +00:00
Antony Dovgal c458d1347b fix tests 2006-06-19 17:33:44 +00:00
Antony Dovgal 8b99387569 BFN 2006-06-19 16:59:05 +00:00
Antony Dovgal 3ce8ccb6f2 fix #37848 (ext/odbc compile failure) 2006-06-19 16:13:15 +00:00
Michael Wallner f4106441cb - Fix Bug #37780 memory leak trying to execute a non existing file (CLI) 2006-06-19 14:52:34 +00:00
Antony Dovgal 20ee84dea6 MFH: fix #37807 (segmentation fault during SOAP schema import) 2006-06-19 11:43:45 +00:00
Antony Dovgal cd7d7039ac MFH: add missing ifdef and avoid "unused variable" warning 2006-06-19 11:39:02 +00:00
Ilia Alshanetsky 3b7be889d8 Added posix_initgroups() function. 2006-06-19 02:19:13 +00:00
Hannes Magnusson aae5df3ffd MFH: arg ifno 2006-06-17 13:06:06 +00:00
Hannes Magnusson c6080567e2 Fix test 2006-06-17 12:51:02 +00:00
Nuno Lopes 6509311ebb plug memory leak in sapi_putenv, by using setenv(), that doesnt need any malloc 2006-06-17 11:08:05 +00:00
Nuno Lopes aa48814378 change the timezone used (per Derick request)
add one string I missed yesterday. Now every strotime() rule is covered
2006-06-17 10:30:23 +00:00
Nuno Lopes ca6e1bbcda new tests. the .re file coverage increases to 96%. really good :) 2006-06-16 22:46:57 +00:00
Seiji Masugata ee23aba678 changed GINIT definition. 2006-06-16 16:45:46 +00:00
Rasmus Lerdorf 6bfeea9eb9 MFH: Backported allow_url_include from HEAD. This directive allows
separate control of URL handling in includes/requires allowing sites to
enable allow_url_fopen without enabling remote includes.
2006-06-16 14:09:01 +00:00
Stefan Esser 6320ee11cf MFH: Only care about wrong flex version, when needed. 2006-06-16 08:01:03 +00:00
Dmitry Stogov 6c310f9c0a New crypt() implementation for win32 which is about 10 times faster and has more friendly license. 2006-06-16 05:57:18 +00:00
foobar 4793980a8f Fix build. (gmp_nextprime() was added in PHP 6!) 2006-06-16 00:14:35 +00:00
Rasmus Lerdorf 8ab6f3fd39 MFH: Optimize the other string conversion functions here to just create
raw text nodes.
2006-06-15 22:45:30 +00:00
Rasmus Lerdorf 12022014fa MFH:
I don't think the call to xmlNodeSetContentLen() is needed here and
it is causing performance problems because it tries to parse the blob
and create a subtree.  Because we are escaping the string anyway, we
are never going to get a subtree, but the entity parsing that is done
by xmlNodeSetContentLen() is killing performance on large blobs of
text.  On one recent example it took a couple of minutes to parse
whereas if we just create a text node like this and set the contents
to the raw string it is down to milliseconds.
2006-06-15 20:49:05 +00:00
Dmitry Stogov 1dbaae2795 Added automatic module globals management 2006-06-15 18:33:09 +00:00
Nuno Lopes c3ed91477a fix bug #37800: preg_replace() limit parameter odd behaviour
#this is a regression in PHP_5_2 and HEAD branches only
2006-06-15 15:33:25 +00:00
Hannes Magnusson 954acfe261 MFH: Revert array type hinting 2006-06-15 15:31:54 +00:00
Dmitry Stogov 60328ea7c3 Added automatic module globals management 2006-06-15 14:06:35 +00:00
Dmitry Stogov ada4e506a7 MFH: Added automatic module globals management. 2006-06-15 14:03:21 +00:00
foobar d3c3a54b4e fix news. gaps left intentionally.. 2006-06-15 13:07:37 +00:00
Hannes Magnusson f0d98ad3de MFH: argument info.. 2006-06-14 21:36:10 +00:00
Nuno Lopes a943d234f5 fix memory leak uncovered by the pcre_extra.phpt test 2006-06-14 17:52:56 +00:00
Nuno Lopes a7bc286638 more tests (and fix 2 from yesterday) 2006-06-14 17:37:53 +00:00
Nuno Lopes 7406f3771a remove the pcre_dfa_exec.c file, as it is needed (we dont expose that API) 2006-06-14 16:26:22 +00:00
Nuno Lopes 45a2bdaf73 missing newline 2006-06-14 16:16:02 +00:00
Ilia Alshanetsky 18870e3afc E_ERROR -> E_RECOVERABLE_ERROR 2006-06-14 16:04:13 +00:00
Christian Stocker d7fd19b7ff MFH
Fix a segfault, when an unknown type was given and support all known xpath object types
2006-06-14 09:42:35 +00:00
Nuno Lopes e607e2ab9a also ignore lcov generated files 2006-06-13 22:02:57 +00:00
Nuno Lopes c93dc5d873 add new tests, increasing coverage by about 10% 2006-06-13 21:55:38 +00:00
Marcus Boerger 9660548a22 - MFH Arginfo fix (Hannes) 2006-06-13 20:57:35 +00:00
Ilia Alshanetsky b8bee35259 Removed unused variables. 2006-06-13 20:19:37 +00:00
Dmitry Stogov eb8c558966 Removed warnings 2006-06-13 14:22:46 +00:00
Dmitry Stogov 5a73f8f13f Removed warning 2006-06-13 13:55:12 +00:00
Stefan Esser 7bbf35320d MFH: Added hook for compile_string() 2006-06-13 12:57:48 +00:00
Ilia Alshanetsky 3ff5fb0631 Fixed compiler warning 2006-06-12 23:28:32 +00:00
Ilia Alshanetsky d74f9ff550 Improved performance of the implode() function on associated arrays by
200-300%.
2006-06-11 21:55:49 +00:00
Ilia Alshanetsky 66141bd5d1 Fixed ZTS build 2006-06-11 20:47:34 +00:00
Hannes Magnusson dd2c03ca48 MFH: fix typo 2006-06-11 20:12:17 +00:00
Hannes Magnusson 21b0f60332 MFH: argument infos 2006-06-11 20:03:05 +00:00
Ilia Alshanetsky f1fb77d1aa Make zend_print_zval_r_ex() use the write callback function. 2006-06-11 16:28:24 +00:00
Ilia Alshanetsky f876b800a2 Fully print array() in phpinfo(). 2006-06-11 16:27:16 +00:00
Hannes Magnusson 3104233019 MFH: arginfo, protos, vim folding 2006-06-11 01:42:17 +00:00
Hannes Magnusson 50de3fd1ce MFH: fix test 2006-06-11 00:18:30 +00:00
Ilia Alshanetsky 37d88ca5a0 Improved performance of str_replace() when doing 1 char to 1 char or 1 char
to many chars replacement by 30-40%.
2006-06-10 15:29:06 +00:00
Hannes Magnusson 13fe33c2df MFH
- Created new abstract class, ReflectionFunctionAbstract implementing Reflector
- Moved all methods from ReflectionFunction (except export, invoke & invokeArgs)
- ReflectionFunction now inherits everything from ReflectionFunctionAbstract
    and implements its own export, invoke & invokeArgs methods
- ReflectionMethod now extends ReflectionFunctionAbstract and implements
    its own export, invoke & invokeArgs methods.
- Removed stdClass typehint from ReflectionClass::isInstance
- Removed stdClass typehint from ReflectionClass::set/getValue
2006-06-10 00:40:57 +00:00
Rasmus Lerdorf 50cc487b21 MFH: Patch from Nuno 2006-06-09 23:47:10 +00:00
Michael Wallner 76838bcd54 - sync with apache2handler 2006-06-09 16:29:35 +00:00
Michael Wallner 96724797c8 BFN: - Fixed bug #37720 (merge_php_config scrambles values). (Mike,
pumuckel at metropolis dot de)
2006-06-09 15:17:39 +00:00
Michael Wallner 2e9ec84ce2 MFH: fix bug #37720 (merge_php_config scrambles values) 2006-06-09 15:13:39 +00:00
Ilia Alshanetsky 6654a07e73 Update credits 2006-06-08 22:04:52 +00:00
Derick Rethans ddd8fd3e3d - Fixed bug #37747 (strtotime segfaults when given "nextyear"). 2006-06-08 16:27:05 +00:00
Dmitry Stogov 2a7d16f8fd Proper fix for bug #37707 ("clone $x" must call __clone() enven if result value is not used) 2006-06-08 08:56:27 +00:00
Dmitry Stogov 6e24feb80d Wrap "wrong" unreachable code with "#if 0" 2006-06-08 08:37:51 +00:00
Marcus Boerger 44ba014c5f - MFH Add arginfo (hannes) 2006-06-07 22:39:22 +00:00
Rasmus Lerdorf 76bff5194c Put the TODO back 2006-06-07 21:14:04 +00:00
Rasmus Lerdorf 658762a0b5 Get rid of useless function calls 2006-06-07 21:09:52 +00:00
Ilia Alshanetsky 402de0146e Bug fixing news 2006-06-07 13:44:08 +00:00
Ilia Alshanetsky 8d4bb9ca74 Fixed bug #37707 clone without assigning leaks memory
# Based on a patch by Nuno
2006-06-07 13:41:49 +00:00
Antony Dovgal 9123bee257 MFH:
fix Unicode LOB problems using callbacks to read LOBs
using chunk_size*X buffer should speed up LOB reading a bit

many thanks to Massimo Squillace <msquillace at sogei dot it> for the patch.
2006-06-07 13:36:51 +00:00
Marcus Boerger e0844e09bd - MFH iterator_apply() 2006-06-07 09:44:42 +00:00
Marcus Boerger 64c353ab79 - MFH zend_fcall_info_*() and parameter parsing option 'f'
# Right now i see this as the best option but we might shuffle code around
# later if someone comes up with a better solution.
2006-06-07 09:43:54 +00:00
Marcus Boerger 1f93575c88 - MFH Add ReflectionClass::getInterfaceNames() 2006-06-07 09:26:11 +00:00
Marcus Boerger de39078f7b - Regenerated after zend_vm_def.h change 2006-06-07 09:22:08 +00:00
Marcus Boerger 5cdefd07cd - MFH Fix issue with interfaces being inherited multiple times 2006-06-07 09:21:06 +00:00
Ilia Alshanetsky a9c6e4be1e Fixed bug #37709 (Possible crash in PDO::errorCode()). 2006-06-07 03:33:16 +00:00
Antony Dovgal e5c8f8c59b yet another dummy clone_obj handler to fix problems created by ze1 compat mode 2006-06-06 22:05:56 +00:00
Antony Dovgal a07500042d implement a dummy clone_obj handler for ze1 compat mode
(fixes segfault on every XMLReader instantiation)
2006-06-06 21:44:34 +00:00
Michael Wallner d6212d96f4 - only try to fetch stream context options if context is set 2006-06-06 21:38:03 +00:00
Antony Dovgal 928c20942b plug a leak in ext/spl/tests/iterator_047.phpt 2006-06-06 20:11:35 +00:00
Antony Dovgal f6a400bd9f revert by Andi's request 2006-06-06 14:17:21 +00:00
Antony Dovgal 2f26d8d7ae MFH: don't leak when decoding failed 2006-06-06 14:09:12 +00:00
Rob Richards 704ed9625c nuke unused call 2006-06-06 12:08:11 +00:00
Rob Richards d6a526d66b restore missing ze1 compat code 2006-06-06 12:05:30 +00:00
Antony Dovgal e8d568ea8d fix test 2006-06-06 11:33:59 +00:00
Antony Dovgal 8204511d71 MFH: do not allow to implement the same interface twice
add tests
2006-06-06 10:03:01 +00:00
Ilia Alshanetsky 6ab23efb3a Fixed bug #37705 (Semaphore constants not available). 2006-06-05 22:52:11 +00:00
Antony Dovgal 073ee1397a MFH: no need to check if non-existing include_path complies with open_basedir setting 2006-06-05 22:39:50 +00:00
Edin Kadribasic 8b764bd08c Fixed bug #35886 (nlopes) 2006-06-05 22:19:36 +00:00
Antony Dovgal 1b602e85d1 fix leak appearing on phpinfo() when there are no PDO modules available 2006-06-05 22:08:16 +00:00
Zeev Suraski 66b90c7052 Final ze1_compat restoration - it was mostly done by hand, so if anybody
spots any (new) problems, let me know.  Test wise, the same tests that
failed before are failing now.
2006-06-05 16:53:21 +00:00
Zeev Suraski b1683ea891 ze1 restoration 2006-06-05 16:25:25 +00:00
Zeev Suraski 51d495850a Restore ZE1 compatibility mode (Zend Engine part - the modules patches
will follow later today)
2006-06-05 13:58:52 +00:00
Antony Dovgal 163f0da75a BFN 2006-06-05 09:57:17 +00:00
Stanislav Malyshev 1ebb0590bd improve .dsp build 2006-06-05 09:02:28 +00:00
Antony Dovgal a588f2dc60 MFH: fix OCIPasswordChange() parameters (patch by pholdaway at technocom-wireless dot com)
prevent username, password and new password from being empty
2006-06-05 07:35:32 +00:00
Stanislav Malyshev 0c518a03a9 fix .dsp build 2006-06-04 18:03:25 +00:00
Ilia Alshanetsky 63a658ee7a Fixed bug #37671 (MySQLi extension fails to recognize BIT column). 2006-06-04 14:56:34 +00:00
Marcus Boerger ac2a29913c - Add missing classes 2006-06-04 10:47:22 +00:00
Marcus Boerger 37f5474ce9 - MFH Use engine call to register interfaces (steph) 2006-06-04 10:34:22 +00:00
Marcus Boerger 6c0f166794 - Fix function flag check 2006-06-04 10:27:28 +00:00
Marcus Boerger dfd2295849 - Use engine call to register interfaces (steph) 2006-06-04 10:26:55 +00:00
Johannes Schlüter 2f418134ff MFH 2006-06-03 22:02:02 +00:00
Andrei Zmievski 5735927d86 I swear it wasn't me. 2006-06-03 18:56:44 +00:00
Rob Richards a86232d9bb MFH: add setIdAttribute, setIdAttributeNS and setIdAttributeNode functionality 2006-06-02 16:17:25 +00:00
Dmitry Stogov 6c61aeb012 SAPI globals are destroied at this point and reporting errors about memory leaks can cause crash. 2006-06-02 13:30:55 +00:00
Ilia Alshanetsky 5b5e7a4de9 Fixed compiler warning 2006-06-01 22:42:22 +00:00
Michael Wallner 6e2ff39e3e - Fix bug #37630: MySQL extensions should link against thread safe client libs if built with ZTS 2006-06-01 19:14:48 +00:00
Michael Wallner 57cdfc58d2 - fix order 2006-06-01 19:11:59 +00:00
Michael Wallner c0505439c3 - Fixed bug #37363 (PDO_MYSQL does not build if no other mysql extension is
enabled)
2006-06-01 15:14:45 +00:00
Antony Dovgal 17ad6e2ebf apply correct fix 2006-06-01 14:31:22 +00:00
Antony Dovgal fbeb246a3a no need to do TSRMLS_FETCH() twice 2006-06-01 14:06:23 +00:00
Antony Dovgal 112f263591 MFH: suppress_errors is used only on Win32, no need to look for it on other systems 2006-06-01 14:03:49 +00:00
Antony Dovgal 0675e5eabb MFH: nuke unused variable 2006-06-01 13:45:26 +00:00
Antony Dovgal 48098f0774 fix tests 2006-06-01 13:17:36 +00:00
Antony Dovgal 210335909a MFH: no need to fetch trsm_ls when it's already available 2006-06-01 12:25:38 +00:00
Antony Dovgal ff59351416 add new tests 2006-06-01 11:57:49 +00:00
Antony Dovgal 29be5946f9 MFH: throw a warning when using invalid offset types with strings 2006-06-01 11:56:44 +00:00
Ilia Alshanetsky 378d5d4e34 spelling corrections 2006-05-31 23:06:50 +00:00
Andrei Zmievski b8ebfce9af Revert accidentally committed internal patch 2006-05-31 21:48:43 +00:00
Antony Dovgal d5be48711a MFH: add expected warning to the test 2006-05-31 20:40:11 +00:00
Derick Rethans c116ecf207 - There was nothing wrong here, bug report #37595 is bogus.
- Added a new test case to demonstrate a longer plain text.
2006-05-31 20:09:07 +00:00
Antony Dovgal c188ec09eb add more tests 2006-05-31 18:47:21 +00:00
Andrei Zmievski 1f04ac91b0 MFB 2006-05-31 17:18:08 +00:00
Antony Dovgal 8f78a2727b add tests for E_STRICT that will become E_FATAL in PHP 6 2006-05-31 14:54:52 +00:00
Dmitry Stogov 8df40bdb31 Keeping consistent arg_stack during arguments freeing (Exception from destructor may use inconsistent arg_stack for backtrace). 2006-05-31 13:01:57 +00:00
Dmitry Stogov 51e52e20ef Support for nested exceptions and fatal errors in destructors 2006-05-31 12:59:31 +00:00
Antony Dovgal 47edd8a303 MFH: fix #37595 (mcrypt_generic calculates data length in wrong way) 2006-05-31 12:06:36 +00:00
Andi Gutmans 42f32bfa4b - Fix typo 2006-05-31 03:43:17 +00:00
Marcus Boerger 4703e96853 - Add new tests 2006-05-30 23:11:33 +00:00
Marcus Boerger d87de86823 - Switch back to old severities and still keep bugfix for
#37632 (Protected method access problem)
# It wasn't really my intention to change the severity. We simply didn't
# have tests for that.
2006-05-30 23:10:28 +00:00
Antony Dovgal 9246ba2a82 more test fixes, this time support Oracle 10 2006-05-30 22:34:16 +00:00
Antony Dovgal c1272d8972 fix tests 2006-05-30 22:27:32 +00:00
Antony Dovgal 2817ddccf5 fix test 2006-05-30 21:54:42 +00:00
Antony Dovgal bc5b8eabea MFH 2006-05-30 21:38:12 +00:00
Marcus Boerger 2d7d2aebe6 - MFH WS 2006-05-30 19:41:04 +00:00
Sara Golemon 79b21ec4cf MFH: Minor fixes (bjori) 2006-05-30 19:06:22 +00:00
Michael Wallner 258351c30a - fix bug #37635 (parameter of pcntl signal handler is trashed) 2006-05-30 17:40:52 +00:00
Seiji Masugata c314888c29 added mb_stristr( ), mb_strrichr( ). 2006-05-30 15:47:53 +00:00
Seiji Masugata 731584c076 added mb_strstr( ), mb_strrchr( ). 2006-05-30 15:45:35 +00:00
Seiji Masugata 42aadabfcb added mb_stripos( ), mb_strripos( ). 2006-05-30 15:43:09 +00:00
Seiji Masugata 7314771a35 added mb_list_encodings_alias_names( ), mb_list_mime_names( ). 2006-05-30 15:40:39 +00:00
Seiji Masugata 91dd8376bd added option parameter mb_list_encodings( ). 2006-05-30 15:38:22 +00:00
Hannes Magnusson 91d4ef33ef MFH: Play nice, use 4digit years in DATE_RSS 2006-05-30 15:14:22 +00:00
Ilia Alshanetsky 5186ee9c59 Added memory_get_peak_usage() function for retrieving peak memory usage of
a PHP script.
2006-05-30 14:51:20 +00:00
Hannes Magnusson 61fc424321 MFH: Fixed DATE_COOKIE, DATE_RSS & tests 2006-05-30 14:46:46 +00:00
Antony Dovgal bb4c7ff0e9 MFH: don't require libociei, this allows us to build ext/oci8 against basiclite OIC package 2006-05-30 13:16:48 +00:00
Derick Rethans 9a9cd86f38 - Now as text and not HTML. 2006-05-30 13:14:51 +00:00
Derick Rethans fb92e33b5d - MFH: Fixed bug #37616: DATE_RFC822 does not product RFC 822 dates. (Patch by
Hannes Magnusson)
2006-05-30 13:12:21 +00:00
Antony Dovgal e4a3732c91 no need to call zend_is_callable() if callable is known to be invalid
free fname on failure and plug possible leak
2006-05-30 09:46:59 +00:00
Ilia Alshanetsky a400d8908d Convert E_ERROR to E_RECOVERABLE_ERROR 2006-05-30 02:40:33 +00:00
Antony Dovgal 43b660b6ea MFH: no need to check it for not-NULL 2006-05-29 21:31:49 +00:00
Antony Dovgal 82d326bdea MFH: there is no ce at this point, revert this line to its previous state 2006-05-29 21:28:29 +00:00
Antony Dovgal 70c643f5f0 fix tests 2006-05-29 21:08:02 +00:00
Antony Dovgal fb696afd10 add test 2006-05-29 20:31:48 +00:00
Antony Dovgal 8ca3826a28 MFH: return NULL in case of error 2006-05-29 20:26:32 +00:00
Marcus Boerger aa40595644 - BFN 2006-05-29 20:07:39 +00:00
Marcus Boerger 1b172b1371 - MFH Bugfix #37632 (Protected method access problem) 2006-05-29 20:06:43 +00:00
Antony Dovgal 9e1b944989 MFH: improve sed expressions 2006-05-29 18:12:55 +00:00
Michael Wallner 3b407d143b - Fixed bug #36949 (invalid internal mysqli objects dtor) 2006-05-29 16:53:56 +00:00
Antony Dovgal aed81da3fa BFN 2006-05-29 11:00:32 +00:00
Antony Dovgal be0fc2b801 MFH: fix #37531 (oci8 persistent connection corruption) 2006-05-29 10:59:30 +00:00
Antony Dovgal ec68882101 add test 2006-05-29 10:42:54 +00:00
Antony Dovgal be0b8c71bc initialize srcstream 2006-05-29 10:39:59 +00:00
Antony Dovgal 1a63feffd1 MFH: prevent resource leaking when passing invalid stream resource as second argument 2006-05-29 10:24:49 +00:00
Georg Richter 10ed7a1e0a Fix for bug #37620 2006-05-29 05:38:50 +00:00
Michael Wallner 7ac96de039 - news entry for apache2handler ap_set_content_type() fix 2006-05-28 20:34:10 +00:00
Michael Wallner d724f9cfb1 MFH: call ap_set_content_type() only once, else each time we call it,
configured output filters for that content type will be added
2006-05-28 20:32:00 +00:00
Ilia Alshanetsky 1ad21d9b12 Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recurssion
limit support).
2006-05-28 15:33:56 +00:00
Marcus Boerger 5f63b5c4ee - Revert until there is an ok for the full patch 2006-05-27 20:16:53 +00:00
Marcus Boerger ca6a202160 - WS 2006-05-27 19:06:06 +00:00
Marcus Boerger 493f39da2d - MFH: Fix bug #37212 (Access to protected property of common base class)
By adding "zend_class_entry *ce" to struct zend_property_info;
2006-05-27 18:39:53 +00:00
Johannes Schlüter ccfc0d9d99 - MFH Fix #37614 (Class name lowercased in error message) 2006-05-27 18:23:48 +00:00
Marcus Boerger 26145c2e0c - WS/CS 2006-05-27 18:04:13 +00:00
Rob Richards a7aa62ded1 MFH: add C14N() and C14NFile() methods to perform XML canonicalization
add test
2006-05-26 18:23:50 +00:00
Dmitry Stogov 10371b034a Fixed bug #37523 (namespaces added too late, leads to missing xsi:type attributes. incompatibility with libxml2-2.6.24) 2006-05-26 09:02:35 +00:00
Marcus Boerger 1d5f721fd9 - MFH Sync error messages and simplify error message generation code 2006-05-26 00:36:13 +00:00
Pierre Joye 59ddb74938 - fix leaks in openssl context options 2006-05-26 00:32:07 +00:00
Ilia Alshanetsky b882f9f37e Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters) 2006-05-25 22:54:16 +00:00
Edin Kadribasic 58962c7371 Missing definition, patch by Steph Fox 2006-05-25 18:47:21 +00:00
Michael Wallner 3dcef1b9be - implement standard http stream wrapper options, fixes bug #34180
- skip empty headers in on_header_available()
2006-05-25 12:41:35 +00:00
Antony Dovgal 99e13c50f9 MFH: remove debug output and fix bug #37589 2006-05-25 11:46:38 +00:00
Marcus Boerger 7110650668 - Update test 2006-05-25 10:46:53 +00:00
Marcus Boerger a681fcb006 - Update update news and sync with NEWS 2006-05-25 10:20:56 +00:00
Antony Dovgal 9dd24c6d87 fix error messages when converting objects to other types
add new function
MFB will follow soon
2006-05-25 10:01:06 +00:00
Marcus Boerger ec79dd793d - MFH Bugfix 37587 2006-05-25 09:59:25 +00:00
Dmitry Stogov 93851ebf11 Fixed bug #37278 (SOAP not respecting uri in __soapCall) 2006-05-25 08:14:28 +00:00
Dmitry Stogov 26ccde4da9 Fixed bug #37558 (timeout functionality doesn't work after a second PHP starup on the same thread). (p dot desarnaud at wanadoo dot fr) 2006-05-25 07:46:25 +00:00
Antony Dovgal 43c79a616e reorder 2006-05-25 07:31:47 +00:00
Dmitry Stogov 630def46f7 Fixed bug #37496 (FastCGI output buffer overrun) 2006-05-25 06:40:04 +00:00
Ilia Alshanetsky 53988d8cf5 Fixed bug #37563 (array_key_exists performance is poor for &$array). 2006-05-24 23:14:08 +00:00
Antony Dovgal 755caecfc9 fix test 2006-05-24 23:04:58 +00:00
Edin Kadribasic f2a48add80 BFN 2006-05-24 22:04:57 +00:00
Edin Kadribasic 740d39454b Initialize windows globals, fixes #37428 2006-05-24 22:00:15 +00:00
Antony Dovgal c53dbdbe75 BFN 2006-05-24 21:24:29 +00:00
Antony Dovgal 4cb3d18276 fix #37418 (tidy module crashes CLI version of PHP) 2006-05-24 21:22:13 +00:00
Antony Dovgal fb32c077a2 fix #37499 (CLI segmentation faults during cleanup (only with sybase-ct extension enabled)) 2006-05-24 20:21:02 +00:00
Dmitry Stogov a953a1abda Fixed CGI tests. 2006-05-24 13:28:59 +00:00
Dmitry Stogov 6fe36adf0c Fixed bug #37256 (php-fastcgi dosen't handle connection abort) 2006-05-24 09:42:21 +00:00
Dmitry Stogov 07b8d051fa Fixed bug #37341 ($_SERVER in included file is shortened to two entries, if $_ENV gets used). 2006-05-24 07:55:19 +00:00
Marcus Boerger 1448086b22 - MFH Add more tests from Ligaya Turmelle 2006-05-23 23:47:44 +00:00
Ilia Alshanetsky cd8c7a3e09 Fixed handling of extremely long paths inside tempnam() function. 2006-05-23 23:22:04 +00:00
Marcus Boerger 59d2ce8258 - MFH Fix feof() 2006-05-23 22:31:25 +00:00
Marcus Boerger 200c627aeb - MFH Sync with head (namespace prefix handling) 2006-05-23 22:24:44 +00:00
Marcus Boerger f88a172959 - MFH Handle NULL in C argument parsing correct 2006-05-23 22:22:11 +00:00
Marcus Boerger 64701cf42b - MFH Bugfix #37565 2006-05-23 21:58:44 +00:00
Marcus Boerger 8d4eea74d5 - Fix double error raising issue 2006-05-23 21:50:29 +00:00
Sebastian Bergmann 3e7df40852 MFH: Add bison 2.2 to the list of supported versions. 2006-05-23 11:11:16 +00:00
Marcus Boerger c1b749f491 - Update 2006-05-22 19:04:19 +00:00
Rob Richards c384b34ae9 MFH: add registerNodeClass() method
- update attribute isID functionality
 - add test
2006-05-22 17:12:26 +00:00
Rob Richards 3997d6663b MFH: move document property struct from xml_common.h 2006-05-22 17:09:05 +00:00
Ilia Alshanetsky e2c6d3edae E_ERROR > E_RECOVERABLE_ERROR 2006-05-22 14:22:26 +00:00
Dmitry Stogov 302c53fc5d Fixed bug #37496 (FastCGI output buffer overrun) 2006-05-22 09:22:20 +00:00
Antony Dovgal 52cb01a933 fix typo 2006-05-22 06:49:48 +00:00
Antony Dovgal 095162c3d4 re-enable OCILobRead2() support 2006-05-22 04:17:42 +00:00
Marcus Boerger e3f89f116a - MFH
. Make code exception safe
  . Make RecursiveRegexIterator::getChildren pass regex to inner ctor
  . Fix CachingIterator::__toString() in TOSTRING_USE_KEY mode
  . Add CachingIterator::getCache()
  . Add tests
2006-05-21 18:13:37 +00:00
Marcus Boerger 7577130156 - MFH improve error messages 2006-05-21 18:10:31 +00:00
Marcus Boerger 1be624e7ba - MFH Sync vm generation with head
- Regenerate vm
2006-05-21 18:00:14 +00:00
Ilia Alshanetsky 24f3d55f3c Added control character checks for cURL extension's open_basedir/safe_mode
checks.
2006-05-21 16:31:57 +00:00
Ilia Alshanetsky 38d7ea305c Added a note about E_RECOVERABLE_ERROR being a part of E_ALL. 2006-05-21 15:50:31 +00:00
Marcus Boerger e145343b57 - MFH Handle corrupt base64 data in data: url 2006-05-21 13:37:19 +00:00
Marcus Boerger abcee63635 - Update 2006-05-21 09:12:34 +00:00
Marcus Boerger 290ed55060 - MFH Improved error message 2006-05-20 21:02:44 +00:00
Marcus Boerger 96916c95e8 - MFH Sync with head fixes part of an issue with iterator_(to_array|count) 2006-05-20 21:01:42 +00:00
Antony Dovgal 25eca319fa MFH: attempt to fix OCILobRead2() related problems 2006-05-20 13:46:59 +00:00
Marcus Boerger 10ab729e88 - MFH Add new tests 2006-05-20 11:35:38 +00:00
Marcus Boerger cd4ab2f6fe - MFH Use correct version 2006-05-20 09:12:28 +00:00
Marcus Boerger 397c88ae74 - MFH Add new tests 2006-05-20 09:08:35 +00:00
Dmitry Stogov cdb0ed7587 Fixed random crashes in ZTS mode becouse of uninitialized EG(modified_ini_directives). 2006-05-19 15:31:25 +00:00
Derick Rethans ab8329ec31 - Fixed bug #37514 (strtotime doesn't assume year correctly). 2006-05-19 14:52:30 +00:00
Michael Wallner bea595aef9 - nuke compiler warnings 2006-05-19 14:19:27 +00:00
Antony Dovgal ab9429900a fix test 2006-05-19 10:57:48 +00:00
Antony Dovgal 6557578657 MFH: initialize factory 2006-05-19 10:24:05 +00:00
Antony Dovgal c13ba99551 add new tests by Ligaya Turmelle 2006-05-19 07:44:24 +00:00
Dmitry Stogov 14f6b9149d Optimized zend_try/zend_catch macroses (eliminated memcpy()) 2006-05-19 06:09:15 +00:00
Ilia Alshanetsky 95875d9966 Fixed bug #37505 (touch() truncates large files). 2006-05-19 02:51:00 +00:00
Marcus Boerger 55041d6f3d - MFH Add new test 2006-05-18 22:52:04 +00:00
Marcus Boerger 69079a7537 - MFH Add new test 2006-05-18 22:42:05 +00:00
Marcus Boerger aa0172a4da - MFH Fix bug #37510 session_regenerate_id changes session_id() even on failure 2006-05-18 22:12:26 +00:00
Marcus Boerger 5e5327a7e0 - MFH Add new test 2006-05-18 21:59:05 +00:00
Edin Kadribasic 51ed0ebad8 Use heap insted of stack for recursion in hope of avoid stack overflow crashes 2006-05-18 21:50:51 +00:00
Marcus Boerger e33afedd96 - You shall not use %v in 5.*
# Even though it is there it is only meant for pecl dev to ease their pain
2006-05-18 21:48:33 +00:00
Edin Kadribasic 52566bba75 Give exe files 8MB stack (same default as on Linux) instead of Windows default 1MB 2006-05-18 21:46:12 +00:00
Marcus Boerger 20ac90bac8 - Update 2006-05-18 21:45:38 +00:00
Marcus Boerger 7d79686f45 - MFH Fixed CachingIterator issues with string conversion/__toString()
Partly by adding new mode TOSTRING_USE_INNER
2006-05-18 21:42:58 +00:00
Antony Dovgal 80d7ac0e9e there is no %v in 5.2 2006-05-18 21:24:04 +00:00
Antony Dovgal 749f4ac2ab MFH: fix #37487 (oci_fetch_array() array-type should always default to OCI_BOTH) 2006-05-18 13:21:08 +00:00
Antony Dovgal 557b7fbec5 fix tests 2006-05-17 20:13:05 +00:00
Marcus Boerger 9c8b47d15e - Fix oversight and drop E_STRICT in 5.x series 2006-05-17 19:07:45 +00:00
Rob Richards 0b3b1448d0 BFN 2006-05-17 16:37:01 +00:00
Rob Richards 6f95fa95cc add tests 2006-05-17 16:36:21 +00:00
Rob Richards aebc5833a9 Synch from HEAD
- Fix bug #37456 (DOMElement->setAttribute() loops forever)
- update iterators for engine change merged from HEAD
2006-05-17 16:35:50 +00:00
Antony Dovgal 6783be767a change argument name, it should be "object" not "property" 2006-05-17 14:28:21 +00:00
Ilia Alshanetsky 4fd736fbe9 Bug fixing news 2006-05-17 13:28:29 +00:00
Ilia Alshanetsky 21724432de Fixed bug #35512 (Lack of read permission on main script results in
E_WARNING rather then E_ERROR).
2006-05-17 13:27:51 +00:00
Antony Dovgal e2afb33e87 fix skip reason 2006-05-17 10:12:36 +00:00
Marcus Boerger 09b741ff47 - MFH Proto fix/add 2006-05-17 00:07:28 +00:00
Marcus Boerger 216049bb27 - MFH '_' is valid in test blocks 2006-05-16 23:05:49 +00:00
Antony Dovgal 1f02fad528 fix test 2006-05-16 22:59:32 +00:00
Ilia Alshanetsky ccad354535 Make filters without a resource throw E_RECOVERABLE_ERROR rather then
E_ERROR
2006-05-16 14:11:52 +00:00
Antony Dovgal 1feef82dc4 new mkdir tests 2006-05-16 13:06:06 +00:00
Antony Dovgal 3a830a30f4 fix #37395 (recursive mkdir() fails to create nonexistent directories in root dir) 2006-05-16 13:05:02 +00:00
Marcus Boerger 26a67b8925 - MFH Fixed Bug #37457 (Crash when an exception is thrown in accept() method of FilterIterator) 2006-05-16 08:21:08 +00:00
Ilia Alshanetsky cccb406ee8 Disable realpath cache when open_basedir or safe_mode are enabled on a
per-request basis.
2006-05-16 00:39:32 +00:00
Dmitry Stogov be4c37919b Added test 2006-05-15 16:44:54 +00:00
Sebastian Bergmann c412cfe311 My bad. 2006-05-15 16:08:18 +00:00
Sebastian Bergmann a70d189c04 Fugbix NEWS entries. 2006-05-15 16:03:41 +00:00
Sebastian Bergmann d7138e1e5d Fugbix typo. 2006-05-15 16:01:24 +00:00
Dmitry Stogov dd5b835147 *** empty log message *** 2006-05-15 15:38:46 +00:00
Dmitry Stogov 963c7fa016 Optimized require_once/include_once (eliminated fopen() on second usage) 2006-05-15 15:31:27 +00:00
Dmitry Stogov 14cad8fdc3 Optimized shutdown sequence to iterate only over modified ini directives 2006-05-15 14:52:35 +00:00
Dmitry Stogov b5cd968ffc - Removed source compatibility with libfcgi
- Optimized access to FastCGI environment using HashTable instead of linear search
- Allowed PHP_FCGI_MAX_REQUESTS=0 to disable PHP die
- Allowed PHP_FCGI_CHILDREN=0 to disable PHP spawn workers
2006-05-15 14:30:31 +00:00
Derick Rethans 7975b4eb0e - MFH: Fixed windows compile error. 2006-05-15 08:54:16 +00:00
Antony Dovgal bb82fb0530 MFH: disable OCILobRead2() support on Win32 2006-05-15 08:34:40 +00:00
Marcus Boerger da438af187 - Update 2006-05-14 19:58:04 +00:00
Marcus Boerger 8886be7041 - Add some update notes 2006-05-14 19:23:19 +00:00
Marcus Boerger 9249d05bdd - We have it now fully RFC compliant 2006-05-14 19:20:21 +00:00
Marcus Boerger 5d43fe49f7 - MFH No need to have this controlled by allow_url_fopen 2006-05-14 19:15:31 +00:00
Marcus Boerger 0c40fb7ef2 - Readd that E_RECOVERABLE_ERROR, dropping it is a bad idea 2006-05-14 18:50:02 +00:00
Marcus Boerger 3fd2c5e217 - Do not include E_RECOVERABLE_ERROR to the default mode E_ALL 2006-05-14 18:45:10 +00:00
Marcus Boerger 3577115118 - MFH Add strict compliant RFC2397 support (no //) 2006-05-14 18:40:12 +00:00
Derick Rethans 74dfa9f0ba MFH:
- Implemented Dmitry's const patch.
- Added support for "weekday" as relative item.
- Fixed bug #37368 (Incorrect timestamp returned for strtotime()).
2006-05-14 17:36:05 +00:00
Ilia Alshanetsky 4ab6eb3d19 MFH: Fixed bug #36630 (umask not reset at the end of the request). 2006-05-14 16:06:48 +00:00
Marcus Boerger ad16c0a375 - Update 2006-05-14 02:00:04 +00:00
Marcus Boerger 653d895ecb - Update 2006-05-14 01:55:27 +00:00
Marcus Boerger 5b44266a5f - MFH RFC2397 decoding 2006-05-14 01:42:03 +00:00
Marcus Boerger 0c09d4cb63 - MFH RFC 2397 meta data handling 2006-05-14 01:06:09 +00:00
Pierre Joye fc06fb4a07 - initial commit
Please fill it :)
2006-05-14 00:29:08 +00:00
Rasmus Lerdorf 6fb0bf80ea Switch to a signed int for now. Will look at moving to a long throughout
the code here.
2006-05-13 21:50:28 +00:00
Marcus Boerger 2100a86198 - MFH Initial support for RFC2397 2006-05-13 17:58:58 +00:00
Marcus Boerger a4af2a9d16 - MFH add support for --EXPECTHEADERS-- 2006-05-13 14:01:58 +00:00
Marcus Boerger d45250a058 - MFH code layout for __toString() use in parameter parsing api 2006-05-13 10:37:45 +00:00
Rob Richards 8d1427dd98 MFH: add doXInclude property to allow processor to perform XIncludes 2006-05-12 18:53:40 +00:00
Ilia Alshanetsky aa19f65f56 Download pear phar file when making a distribution package 2006-05-12 14:54:10 +00:00
Derick Rethans 07d0f0cf01 - MFH: Tests for BC breaking changes. 2006-05-12 10:02:31 +00:00
Antony Dovgal 046b34955c MFH: fix #37416 (iterator_to_array() hides exceptions thrown in rewind() method) 2006-05-12 09:42:56 +00:00
Sebastian Bergmann ec7b8e2b1c Bump version. 2006-05-12 05:36:09 +00:00
Marcus Boerger b3c3c6de14 - Missing __toString() pieces 2006-05-12 00:21:00 +00:00
Marcus Boerger a5f8d2899c - Update 2006-05-11 22:58:14 +00:00
Marcus Boerger 7bbab02633 - MFH
. Fix iterator based access
  . Add new attribute ATTR_DEFAULT_FETCH_MODE: $bdh->setAttribute()
  . Add new fetch mode: FETCH_PROPS_LATE, this fills object member
    variables after calling the constructor (fixes #36428).
2006-05-11 22:43:44 +00:00
Antony Dovgal 7412202c43 no need to destroy the zval here 2006-05-11 22:41:37 +00:00
Antony Dovgal ca923a2cae fix test 2006-05-11 22:17:53 +00:00
Marcus Boerger bf9f762b4d - MFH: add new test 2006-05-11 22:17:42 +00:00
Dmitry Stogov 1f41b288e9 Fixed bug #37306 (max_execution_time = max_input_time) 2006-05-11 22:10:31 +00:00
Ilia Alshanetsky b8c7ecc061 Fixed bug #37413 (Rejected versions of flex that don't work). 2006-05-11 22:04:51 +00:00
Edin Kadribasic bbf97549b8 Remove pecl includes (Steph), except pdo_odbc which will remain broke 2006-05-11 21:43:59 +00:00
Marcus Boerger 7a5240e846 - MFH missing bits and pieces of the partial sync with head
# This time i added:
# ZEND_FE_RESET_VARIABLE
# ZEND_FE_RESET_REFERENCE
# and dapted parser,compiler,executor,interfaces to handle these flags
# their purpose is to be able to pass whetehr foreach is done by ref to
# the current() handler so that it can error out in case it is not capable
# to comply to the requested return signature/protocol/semantics (weyp).
2006-05-11 21:07:39 +00:00
Marcus Boerger b636a534c1 - Drop second superflous zval_ptr_dtor in string arg parsing 2006-05-11 21:03:14 +00:00
Marcus Boerger 05273a73d8 - Fix test 2006-05-11 21:01:04 +00:00
Antony Dovgal 8ee1c45a3b fix test 2006-05-11 15:43:28 +00:00
Antony Dovgal 085e0fc51f fix segfault when passing objects where strings are expected 2006-05-11 15:10:36 +00:00
Seiji Masugata 9b05e15e8a fixed all mbstring setting information doesn't return in mb_get_info( ). 2006-05-11 14:42:12 +00:00
Antony Dovgal bc4e9efef7 add new test 2006-05-11 14:18:34 +00:00
Marcus Boerger 38ff4bba17 - MFH Add missing ZEND_API declarations 2006-05-11 08:11:45 +00:00
Marcus Boerger ac3c882bb6 - Use of E_RECOVERABLE_ERROR 2006-05-11 08:06:22 +00:00
Marcus Boerger f7776502b5 - MFH Fix error mode handling 2006-05-11 07:56:36 +00:00
Rasmus Lerdorf ed7ed1189b This spelling mistake finally annoyed me enough to fix it. 2006-05-11 03:47:55 +00:00
Antony Dovgal 37ed02b199 change it to be consistent with the others 2006-05-10 22:57:50 +00:00
Marcus Boerger 288da2242e - Fix tests 2006-05-10 22:46:16 +00:00
Marcus Boerger 23b97b2530 - Update tests after MFH 2006-05-10 22:38:35 +00:00
Marcus Boerger de9fa58e0b - No more ze1 2006-05-10 22:36:49 +00:00
Marcus Boerger 3746ccb627 - Hardcoded error mode was changed to 8191 2006-05-10 21:46:59 +00:00
Marcus Boerger 9745215cf8 - MFH tests 2006-05-10 21:19:37 +00:00
Rasmus Lerdorf 4df7ab403c Add input_filter hook call in getenv() 2006-05-10 21:19:32 +00:00
Marcus Boerger d76c516176 - Missing __ToString() sync 2006-05-10 21:13:22 +00:00
Marcus Boerger f16bdce284 - Enforece rule of disallowing throw in __toString() 2006-05-10 21:12:48 +00:00
Rasmus Lerdorf cbb11e018a Now that ext/filter is bundled, we should be defining these in one place 2006-05-10 21:10:45 +00:00
Marcus Boerger 5efe53c596 - MFH add E_RECOVERABLE as default 2006-05-10 20:00:26 +00:00
Marcus Boerger 0dacd6d5c0 - ze1 cleanup (bjori) /thx 2006-05-10 19:41:34 +00:00
Rob Richards 1048c9cd52 Synch with HEAD 2006-05-10 19:38:35 +00:00
Marcus Boerger 848c5c7695 - Missing __tostring() conversion snippets 2006-05-10 19:36:47 +00:00
Marcus Boerger 168c0ead9e - Missed my name 2006-05-10 19:20:34 +00:00
Frank M. Kromann 815d3169ba Fix win32 build 2006-05-10 18:32:50 +00:00
Andrei Zmievski 9e0e89c5cf Rename RegExIterator -> RegexIterator.
Also rename recursive one.
2006-05-10 16:50:57 +00:00
Rob Richards f064d19f40 - Update after api changes 2006-05-10 14:39:10 +00:00
Antony Dovgal f7eec29f84 fix tests 2006-05-10 14:04:52 +00:00
Antony Dovgal 8a03fc5ef3 add missing parts of E_RECOVERABLE merge 2006-05-10 14:04:18 +00:00
Antony Dovgal 0f93228cb7 add missing ZEND_API to the implementation 2006-05-10 14:00:36 +00:00
Antony Dovgal 4f37b2f354 nuke extra semi-colon 2006-05-10 13:49:27 +00:00
Ilia Alshanetsky 91bd50d1b0 Fixed bug #37394 (substr_compare() returns an error when offset equals
string length).
2006-05-10 13:07:15 +00:00
Rob Richards aa38b5572e Synch with HEAD
add readInnerXML, readOuterXML, readString, and setSchema functionality
  allow parser options to be passed when loading reader
  optimization: use xmlTextReader const functions for string properties
  add test
2006-05-10 12:04:46 +00:00
Andrey Hristov ac97b77ed9 Don't allocate 2 chunks of memory when one can fit. Reduces memory
fragmentation. There is one more place that fragments memory but it will
complicate the ongoing Unicode upgrade of mysqli so leaving it away for now.
2006-05-10 11:53:13 +00:00
Antony Dovgal 0881dbd101 MFH: fix #37392 (Unnecessary call to OCITransRollback() at the end of request) 2006-05-10 10:07:28 +00:00
Marcus Boerger 83310cba5b - MFH news 2006-05-10 09:27:23 +00:00
Andrei Zmievski ee68b99571 *** empty log message *** 2006-05-10 02:47:21 +00:00
Marcus Boerger edfe649c6b - MFH Constructors in interfaces 2006-05-10 01:23:55 +00:00
Marcus Boerger 43217a3225 i- ZE1_compat tests are no longer necessary 2006-05-10 00:41:23 +00:00
Marcus Boerger 3a3e310e2e - MFH: SplFileObject improvements
. FILE_OBJECT_READ_AHEAD: allow to read ahead
  . FILE_OBJECT_SKIP_EMPTY: allow to skip empty lines (includes read ahead)
  . FILE_OBJECT_READ_CSV:   allow to read as csv
2006-05-10 00:31:04 +00:00
Marcus Boerger 982822be93 - Fix iterators part and add tests 2006-05-10 00:29:42 +00:00
Marcus Boerger 9afb3e041b - Update after api changes
- MFH
  . ArrayIterator/ArrayObject: function lookup caches and array functions
  . Added RegExIterator, RecursiveRegExIterator
  . Added (full) caching support for CachingIterator
2006-05-10 00:03:38 +00:00
Marcus Boerger 77c1b56cd7 - Update after api changes 2006-05-10 00:00:13 +00:00
Marcus Boerger 11f26c2c2a - Tweak version check 2006-05-09 23:54:48 +00:00
Marcus Boerger 0de69fe97d - MFH pcre_get_compiled_regex_cache() support 2006-05-09 23:53:40 +00:00
Marcus Boerger 637a40423c - MFH as discussed
. zend_exception_get_default() -> zend_exception_get_default(TSRMLS_D)
  . zend_get_error_exception()   -> zend_get_error_exception(TSRMLS_D)
  . added E_RECOVERABLE_ERROR
  . added ZEND_TOSTRING_FUNC_NAME
  . added __tostring function cache to zend_class_entry
  . added ZEND_NAMED_ME
  . modified ZEND_ME_MAPPING to support method flags
  . added ZEND_MN
  . method entries now use prefix "zim_" instead of "zif_"
  . drop EG(ze1_compatibility_mode)
  . changed cast handler, now without (int should_free):
    typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
  . changed get_iterator, now receives whether value is by ref:
    zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
  . added zend_objects_store_add_ref_by_handle
  . added zend_objects_store_del_ref_by_handle
  . convert_to_explicit_type(pzv, type)
2006-05-09 23:53:23 +00:00
Ilia Alshanetsky 57184454e9 Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). 2006-05-09 22:00:08 +00:00
Andrei Zmievski 5a8b4e72ce *** empty log message *** 2006-05-09 19:37:00 +00:00
Andrei Zmievski f9de2cc142 MFH 2006-05-09 18:29:26 +00:00
Georg Richter d2dd99ded5 removed unused macro parameter 2006-05-09 11:26:09 +00:00
Edin Kadribasic 0ca7a98800 Update news 2006-05-08 20:18:34 +00:00
Georg Richter d94467f7e8 moved zend_class_entry variables to mysqli.c 2006-05-08 16:19:43 +00:00
Brian France 39441f79e6 MFH: Add implementation of curl_multi_info_read 2006-05-08 15:29:28 +00:00
Andrey Hristov 818d2b7aee tweaks and optimizations
#tested on 32b and 64b
2006-05-08 15:06:51 +00:00
Ilia Alshanetsky 79ebfe382b Fixed memory leaks when working with cursors in PDO PostgreSQL driver. 2006-05-08 14:33:00 +00:00
Pierre Joye 3bad805e35 - more CS 2006-05-08 12:06:59 +00:00
Pierre Joye 4428076eae - MFH: #37360, bad gif size 2006-05-08 11:50:47 +00:00
Pierre Joye 570511c9b2 - CS (spaces > tabs) 2006-05-08 11:12:49 +00:00
Rasmus Lerdorf 65de977ea0 INSTALL_HEADERS takes absolute filenames there in the second arg.
This makes pecl/mailparse build again
2006-05-07 16:56:07 +00:00
Pierre Joye 52619b8427 - #37346, invalid colormap format 2006-05-07 16:37:40 +00:00
Ilia Alshanetsky 0423be06b5 Fixed bug #37348 (make PEAR install ignore open_basedir). 2006-05-07 16:32:40 +00:00
Marcus Boerger c018b83003 - MFH %v for s[np]printf 2006-05-07 12:40:17 +00:00
Edin Kadribasic 18eb480dd2 MFH: Added pg_field_table() as per req: #36750 2006-05-07 00:28:32 +00:00
Edin Kadribasic 12a5d2b547 Enable parallel build against Apache 2.2 libs and headers 2006-05-07 00:09:20 +00:00
Edin Kadribasic ff27860a66 Enable separate build dir for SAPIs, the same way it is possible for EXTENSIONs 2006-05-07 00:04:56 +00:00
Ilia Alshanetsky 7e8409de8c Fixed bug #37244 (Added strict flag to base64_decode() that enforces
RFC3548 compliance).
2006-05-06 22:47:14 +00:00
Ilia Alshanetsky 89e3ac9531 Creation of the 5.2 branch 2006-05-06 21:58:03 +00:00
SVN Migration 608baa409a This commit was manufactured by cvs2svn to create branch 'PHP_5_2'. 2006-05-05 15:49:42 +00:00
Michael Wallner 55f0daf65d - treat interfaces and classes gracefully in print_inh 2006-05-05 15:49:41 +00:00
Michael Wallner 78d11cbc70 - add print_inh (prints a very simple class tree, ie. extensible)
- add print_pi (prints property_info)
- add ____print_str (print strings binary safely, for hash keys etc)
2006-05-05 15:14:37 +00:00
Dmitry Stogov b096a5de17 Fixed bug #37313 (sigemptyset() used without including <signal.h>). (jdolecek) 2006-05-05 07:05:34 +00:00
Antony Dovgal 25de341259 plug a leak 2006-05-04 22:48:29 +00:00
Antony Dovgal ef0d7e3f58 MFH: several minor fixes: nuke compile warnings etc. 2006-05-04 19:00:11 +00:00
Sara Golemon 7e6beb9f28 Note addition of new class constants 2006-05-04 00:21:51 +00:00
Ilia Alshanetsky 5649f24524 Back to dev 2006-05-03 23:31:43 +00:00
Ilia Alshanetsky 87583528c6 go with 5.1.4 2006-05-03 23:30:02 +00:00
Sara Golemon 3c831fef01 News entry for exporting PDO::PARAM_EVT_* constants 2006-05-03 22:44:37 +00:00
Sara Golemon 91999f1175 mfh(r-1.129) Expose PARAM_EVT_* constants 2006-05-03 21:58:38 +00:00
Pierre Joye 3a7aee2472 - remove debug part
nota bene, there is still work in this area, but this is a start
2006-05-03 21:37:16 +00:00
Pierre Joye 1192667679 - add test for multipart POST
- also first example of the POST_RAW section
2006-05-03 21:35:26 +00:00
Pierre Joye 9e4283227d - add support for POST_RAW, allow to pass raw POST data
- add support for TEST_PHP_CGI_EXECUTABLE env variable, it is now possible
  to set both TEST_PHP_EXECUTABLE and CGI
2006-05-03 21:33:44 +00:00
Antony Dovgal 24f0701867 MFH: plug leak 2006-05-03 19:40:58 +00:00
Antony Dovgal 43db0fce03 more POST+array tests 2006-05-03 19:02:12 +00:00
Dmitry Stogov f03fe1c09d Fixed bug #37205 (incompatibility with mod_fastcgi) 2006-05-03 15:39:16 +00:00
Ilia Alshanetsky c10762e967 Prepare news file for release 2006-05-03 13:32:46 +00:00
Ilia Alshanetsky fd2726641b Revert previous optimization if preparation for 5.1.4 2006-05-03 13:32:10 +00:00
Dmitry Stogov 0c6f5f5810 Fixed bug #37291 (FastCGI now longer works with isapi_fcgi.dll) 2006-05-03 13:25:37 +00:00
Dmitry Stogov 79fd560e5e Fixed incompatibility with isapi_fcgi.dll 2006-05-03 13:19:57 +00:00
Dmitry Stogov efad37874b Fixed bug #37276 (problems witch $_POST array) 2006-05-03 11:24:29 +00:00
Pierre Joye dbf2a5c65c - document the --with-pdo-sqlite[=dir] 2006-05-03 11:12:54 +00:00
Rob Richards ed33d232e0 BFN
re-order news
2006-05-03 08:44:32 +00:00
Rob Richards f57c75112d Fix bug #37277 (cloning Dom Documents or Nodes does not work)
Proper fix for bug #36859
add test
2006-05-03 08:43:04 +00:00
Dmitry Stogov a34755e9cf MFH 2006-05-03 06:36:02 +00:00
Dmitry Stogov 7941dcf544 typo 2006-05-02 15:50:04 +00:00
Dmitry Stogov ab5a8b2ae3 Fixed possible crash in highlight_string() (proper place) 2006-05-02 15:49:26 +00:00
Ilia Alshanetsky e95addcbfa Attempt to increase smart_str performance through the use of larger
default buffers. Biased micro benchmarks show it makes sense :P
2006-05-02 13:52:24 +00:00
Dmitry Stogov 8d1cc50067 Fixed ossible crash in highlight_string(). 2006-05-02 07:19:00 +00:00
Wez Furlong 30f98ae77b set min pdo dep to 1.0.3, which will be the new pecl release 2006-05-02 02:43:11 +00:00
Wez Furlong 7614368f8a prep for pecl release 2006-05-02 02:32:40 +00:00
Wez Furlong c1555236c9 tweak for better compatibility when building as SCE.
(library order is important)
2006-05-02 00:59:22 +00:00
Marcus Boerger 6f1a0f67ff - Make SplTempFileObject work in 5.1 2006-05-01 16:02:07 +00:00
Wez Furlong 299fe2554f add note about ssl context options. 2006-05-01 01:10:33 +00:00
Wez Furlong 8f87235107 Add two new context options for ssl:
"capture_peer_cert" and "capture_peer_cert_chain"

If true, the peer certificate and peer certificate chain respectively will be
captured and made available in the ssl context variables "peer_certificate" and
"peer_certificate_chain" respectively.  The certificates are exposed as x509
certificate resources and can be inspected using the existing openssl extension
functions.

This allows applications to perform extended validation.
2006-04-30 23:43:46 +00:00
Marcus Boerger f3a123a9db - After 5.1.3 follows 5.1.4, 5.2 requires a new branch, preferable from
this point of development (ilia will do so)
2006-04-30 14:30:05 +00:00
Wez Furlong ea2037a2d3 fix PECL #6544 2006-04-30 01:42:53 +00:00
Wez Furlong 07e11dcc4d Fix #36632 2006-04-30 01:27:33 +00:00
Wez Furlong aa5dbc8c92 Fix #35552 2006-04-30 00:52:28 +00:00
Frank M. Kromann fa94d911df Revert patch for pdb files. No need to have it twice! 2006-04-29 14:33:46 +00:00
Frank M. Kromann 6ba807db50 Add new configure option --enable-pdb-files
This will generate .pdb files for debugging
2006-04-29 06:24:38 +00:00
Dmitry Stogov ff452441e2 Proper fix for bug #37205 2006-04-27 11:39:32 +00:00
Moriyoshi Koizumi 522ce80071 - MFH: fix bug #37176 (iconv_strpos() fails to find a string) 2006-04-27 00:50:54 +00:00
Dmitry Stogov e0beb7fc71 Revert wrong fix 2006-04-26 17:48:27 +00:00
Ilia Alshanetsky 0c54f6f72b Restore dev 2006-04-26 16:07:11 +00:00
1055 changed files with 72727 additions and 28860 deletions

No files matched your search

+118 -7
View File
@@ -119,7 +119,8 @@ define ____printzv_contents
set $type = 0
end
if $type == 6
printf "string(%d): \"%s\"", $zvalue->value.str.len, $zvalue->value.str.val
printf "string(%d): ", $zvalue->value.str.len
____print_str $zvalue->value.str.val $zvalue->value.str.len
end
if $type == 7
printf "resource: #%d", $zvalue->value.lval
@@ -167,8 +168,9 @@ define ____print_const_table
set $i = $i - 1
end
if $p->nKeyLength > 0
printf "\"%s\" => ", $p->arKey
if $p->nKeyLength > 0
____print_str $p->arKey $p->nKeyLength
printf " => "
else
printf "%d => ", $p->h
end
@@ -198,8 +200,9 @@ define ____print_ht
set $i = $i - 1
end
if $p->nKeyLength > 0
printf "\"%s\" => ", $p->arKey
if $p->nKeyLength > 0
____print_str $p->arKey $p->nKeyLength
printf " => "
else
printf "%d => ", $p->h
end
@@ -233,8 +236,9 @@ define ____print_ft
set $i = $i - 1
end
if $p->nKeyLength > 0
printf "\"%s\" => ", (char*)$p->arKey
if $p->nKeyLength > 0
____print_str $p->arKey $p->nKeyLength
printf " => "
else
printf "%d => ", $p->h
end
@@ -255,6 +259,113 @@ document print_ft
dumps a function table (HashTable)
end
define ____print_inh_class
set $ce = $arg0
if $ce->ce_flags & 0x10 || $ce->ce_flags & 0x20
printf "abstract "
else
if $ce->ce_flags & 0x40
printf "final "
end
end
printf "class %s", $ce->name
if $ce->parent != 0
printf " extends %s", $ce->parent->name
end
if $ce->num_interfaces != 0
printf " implements"
set $tmp = 0
while $tmp < $ce->num_interfaces
printf " %s", $ce->interfaces[$tmp]->name
set $tmp = $tmp + 1
if $tmp < $ce->num_interfaces
printf ","
end
end
end
set $ce = $ce->parent
end
define ____print_inh_iface
set $ce = $arg0
printf "interface %s", $ce->name
if $ce->num_interfaces != 0
set $ce = $ce->interfaces[0]
printf " extends %s", $ce->name
else
set $ce = 0
end
end
define print_inh
set $ce = $arg0
set $depth = 0
while $ce != 0
set $tmp = $depth
while $tmp != 0
printf " "
set $tmp = $tmp - 1
end
set $depth = $depth + 1
if $ce->ce_flags & 0x80
____print_inh_iface $ce
else
____print_inh_class $ce
end
printf " {\n"
end
while $depth != 0
set $tmp = $depth
while $tmp != 1
printf " "
set $tmp = $tmp - 1
end
printf "}\n"
set $depth = $depth - 1
end
end
define print_pi
set $pi = $arg0
printf "[0x%08x] {\n", $pi
printf " h = %lu\n", $pi->h
printf " flags = %d (", $pi->flags
if $pi->flags & 0x100
printf "ZEND_ACC_PUBLIC"
else
if $pi->flags & 0x200
printf "ZEND_ACC_PROTECTED"
else
if $pi->flags & 0x400
printf "ZEND_ACC_PRIVATE"
else
if $pi->flags & 0x800
printf "ZEND_ACC_CHANGED"
end
end
end
end
printf ")\n"
printf " name = "
____print_str $pi->name $pi->name_length
printf "\n}\n"
end
define ____print_str
set $tmp = 0
set $str = $arg0
printf "\""
while $tmp < $arg1
if $str[$tmp] > 32 && $str[$tmp] < 127
printf "%c", $str[$tmp]
else
printf "\\%o", $str[$tmp]
end
set $tmp = $tmp + 1
end
printf "\""
end
define printzn
____executor_globals
set $ind = 0
+6 -1
View File
@@ -229,7 +229,7 @@ STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: simplexml
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
@@ -464,6 +464,11 @@ PRIMARY MAINTAINER: Kristian K
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: reflection
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: session
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
MAINTENANCE: Maintained
+3
View File
@@ -37,6 +37,9 @@ php_lcov.info: lcov-test
if test -f "$(top_srcdir)/$$y.c"; then \
ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
fi; \
if test -f "$(top_srcdir)/$$y.h"; then \
ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
fi; \
if test -f "$(top_srcdir)/$$y.re"; then \
ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
fi; \
+234 -1
View File
@@ -1,6 +1,239 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 Apr 2006, PHP 5.1.3
24 Jul 2006, PHP 5.2.0RC1
- Updated bundled MySQL client library to version 5.0.22 in the Windows
distribution. (Edin)
- Updated timezonedb to version 2006.7. (Derick)
- Changed priority of PHPRC environment variable on win32 to be higher then
value from registry. (Dmitry)
- Changed __toString() to be called wherever applicable. (Marcus)
- Changed E_ALL error reporting mode to include E_RECOVERABLE_ERROR. (Marcus)
- Changed realpath cache to be disabled when "open_basedir" or "safe_mode"
are enabled on per-request basis. (Ilia)
- Improved the Zend memory manager: (Dmitry)
. Removed unnecessary "--disable-zend-memory-manager" configure option.
. Added "--enable-malloc-mm" configure option which is enabled by default
in debug builds to allow using internal and external memory debuggers.
. Allow tweaking the memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE
environment variables.
. For more information: Zend/README.ZEND_MM
- Improved safe_mode check for the error_log() function. (Ilia)
- Improved the error reporting in SOAP extension on request failure. (Ilia)
- Improved crypt() on win32 to be about 10 times faster and to have friendlier
license. (Frank, Dmitry)
- Improved performance of the implode() function on associated arrays. (Ilia)
- Improved performance of str_replace() when doing 1 char to 1 char or 1 char
to many chars replacement. (Ilia)
- Improved apache2filter SAPI:
. Allowed PHP to be an arbitrary filter in the chain and read the script
from the Apache stream. (John)
. Added support for apache2filter in the Windows build including binary
support for both Apache 2.0.x (php5apache2_filter.dll) and Apache 2.2.x
(php5apache2_2_filter.dll). (Edin)
- Improved apache2handler SAPI:
. Changed ap_set_content_type() to be called only once. (Mike)
. Added support for Apache 2.2 handler in the Windows distribution. (Edin)
- Improved FastCGI SAPI: (Dmitry)
. Removed source compatibility with libfcgi.
. Optimized access to FastCGI environment variables by using HashTable
instead of linear search.
. Allowed PHP_FCGI_MAX_REQUESTS=0 that assumes no limit.
. Allowed PHP_FCGI_CHILDREN=0 that assumes no worker children. (FastCGI
requests are handled by main process itself)
- Improved CURL:
. Added control character checks for "open_basedir" and "safe_mode" checks.
(Ilia)
. Added implementation of curl_multi_info_read(). (Brian)
- Improved PCRE: (Andrei)
. Added run-time configurable backtracking/recursion limits.
. Added preg_last_error(). (Andrei)
- Improved PDO:
. Added new attribute ATTR_DEFAULT_FETCH_MODE. (Pierre)
. Added FETCH_PROPS_LATE. (Marcus)
- Improved SPL: (Marcus)
. Made most iterator code exception safe.
. Added RegExIterator and RecursiveRegExIterator.
. Added full caching support and ArrayAccess to CachingIterator.
. Added array functions to ArrayObject/ArrayIterator and made them faster.
. Added support for reading csv and skipping empty lines in SplFileObject.
. Added CachingIterator::TOSTRING_USE_INNER, calls inner iterator __toString.
. Added ability to set the CSV separator per SplFileObject.
- Improved xmlReader: (Rob)
. Added readInnerXml(), xmlReader::setSchema().
. Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+)
. Changed to passing libxml options when loading reader.
- Added Zip Archive extension. (Pierre)
- Added RFC1867 fileupload processing hook. (Stefan E.)
- Added JSON and Filter extensions. (Derick, Rasmus)
- Added error messages to disk_free_space() and disk_total_space()
functions. FR #37971 (Tony)
- Added PATHINFO_FILENAME option to pathinfo() to get the filename. (Toby S.
and Christian S.)
- Added array_fill_keys() function. (Marcus, Matthew Wilmas)
- Added posix_initgroups() function. (Ilia)
- Added an optional parameter to parse_url() to allow retrieval of distinct URL
components. (Ilia)
- Added optional parameter to http_build_query() to allow specification of
string separator. (Ilia)
- Added image_type_to_extension() function. (Hannes, Ilia)
- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
- Added automatic module globals management. (Dmitry)
- Added RFC2397 (data: stream) support. (Marcus)
- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
- Added support for getenv() input filtering. (Rasmus)
- Added support for constructors in interfaces to force constructor signature
checks in implementations. (Marcus)
- Added memory_get_peak_usage() function for retrieving peak memory usage of
a PHP script. (Ilia)
- Added pg_field_table() function. (Edin)
- Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML().
(Hannes)
- Added DOMNode::getNodePath() for getting an XPath for a node. (Christian)
- Added gmp_nextprime() function. (ants dot aasma at gmail dot com, Tony)
- Added error_get_last() function. (Mike)
- Optimized zend_try/zend_catch macros by eliminating memcpy(3). (Dmitry)
- Optimized require_once() and include_once() by eliminating fopen(3)
on second usage. (Dmitry)
- Optimized request shutdown sequence. Restoring ini directives now iterates
only over modified directives instead of all. (Dmitry)
- Fixed memory leaks in openssl streams context options. (Pierre)
- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
called Foo). (Jani)
- Fixed bug #38179 (imagecopy from a palette to a truecolor image loose
alpha channel) (Pierre)
- Fixed bug #38146 (Cannot use array returned from foo::__get('bar') in write
context). (Dmitry)
- Fixed bug #38125 (undefined reference to spl_dual_it_free_storage). (Marcus)
- Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger
than the actual length). (Tony)
- Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on
Solaris). (Tony)
- Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding
option). (Dmitry)
- Fixed bug #38055 (Wrong interpretation of boolean parameters). (Dmitry)
- Fixed bug #38019 (segfault extending mysqli class). (Dmitry)
- Fixed bug #38005 (SoapFault faultstring doesn't follow encoding rules).
(Dmitry)
- Fixed bug #38004 (Parameters in SoapServer are decoded twice). (Dmitry)
- Fixed bug #38003 (in classes inherited from MySQLi it's possible to call
private constructors from invalid context). (Tony)
- Fixed bug #37987 (invalid return of file_exists() in safe mode). (Ilia)
- Fixed bug #37947 (zend_ptr_stack reallocation problem). (Dmitry)
- Fixed bug #37945 (pathinfo() cannot handle argument with special characters
like german "Umlaute"). (Mike)
- Fixed bug #37931 (possible crash in OCI8 after database restart
when using persistent connections). (Tony)
- Fixed bug #37920 (compilation problems on z/OS). (Tony)
- Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes)
- Fixed bug #37862 (Integer pointer comparison to numeric value).
(bugs-php at thewrittenword dot com)
- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing
protected attribute). (Marcus)
- Fixed bug #37811 (define not using toString on objects). (Marcus)
- Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony)
- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus)
- Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)).
(Mike)
- Fixed bug #37747 (strtotime segfaults when given "nextyear"). (Derick)
- Fixed bug #37720 (merge_php_config scrambles values). (Mike,
pumuckel at metropolis dot de)
- Fixed bug #37709 (Possible crash in PDO::errorCode()). (Ilia)
- Fixed bug #37707 (clone without assigning leaks memory). (Ilia, Nuno, Dmitri)
- Fixed bug #37705 (Semaphore constants not available). (Ilia)
- Fixed bug #37671 (MySQLi extension fails to recognize BIT column). (Ilia)
- Fixed bug #37667 (Object is not added into array returned by __get). (Marcus)
- Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike)
- Fixed bug #37632 (Protected method access problem). (Marcus)
- Fixed bug #37630 (MySQL extensions should link against thread safe client
libs if built with ZTS). (Mike)
- Fixed bug #37620 (mysqli_ssl_set validation is inappropriate). (Georg)
- Fixed bug #37616 (DATE_RFC822 does not product RFC 822 dates).
(Hannes Magnusson, Derick)
- Fixed bug #37614 (Class name lowercased in error message). (Johannes)
- Fixed bug #37587 (var without attribute causes segfault). (Marcus)
- Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recursion
limit support). (Ilia)
- Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters). (Ilia)
- Fixed bug #37565 (Using reflection::export with simplexml causing a crash).
(Marcus)
- Fixed bug #37563 (array_key_exists performance is poor for &$array). (Ilia)
- Fixed bug #37558 (timeout functionality doesn't work after a second PHP
startup on the same thread). (p dot desarnaud at wanadoo dot fr)
- Fixed bug #37531 (oci8 persistent connection corruption). (Tony)
- Fixed bug #37523 (namespaces added too late, leads to missing xsi:type
attributes. incompatibility with libxml2-2.6.24). (Dmitry)
- Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick)
- Fixed bug #37510 (session_regenerate_id changes session_id() even on
failure). (Hannes)
- Fixed bug #37505 (touch() truncates large files). (Ilia)
- Fixed bug #37499 (CLI segmentation faults during cleanup with sybase-ct
extension enabled). (Tony)
- Fixed bug #37496 (FastCGI output buffer overrun). (Piotr, Dmitry)
- Fixed bug #37487 (oci_fetch_array() array-type should always default to
OCI_BOTH). (Tony)
- Fixed bug #37457 (Crash when an exception is thrown in accept() method of
FilterIterator). (Marcus)
- Fixed bug #37456 (DOMElement->setAttribute() loops forever). (Rob)
- Fixed bug #37428 (PHP crashes on windows if there are startup errors
and event log is used for logging them). (Edin)
- Fixed bug #37418 (tidy module crashes on shutdown). (Tony)
- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
method). (Tony)
- Fixed bug #37413 (Rejected versions of flex that don't work). (Ilia)
- Fixed bug #37395 (recursive mkdir() fails to create nonexistent directories
in root dir). (Tony)
- Fixed bug #37394 (substr_compare() returns an error when offset equals
string length). (Ilia)
- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
request). (Tony)
- Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). (Ilia)
- Fixed bug #37368 (Incorrect timestamp returned for strtotime()). (Derick)
- Fixed bug #37363 (PDO_MYSQL does not build if no other mysql extension is
enabled). (Mike)
- Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
- Fixed bug #37341 ($_SERVER in included file is shortened to two entries,
if $_ENV gets used). (Dmitry)
- Fixed bug #37313 (sigemptyset() used without including <signal.h>).
(jdolecek)
- Fixed bug #37306 (max_execution_time = max_input_time). (Dmitry)
- Fixed Bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry)
- Fixed bug #37256 (php-fastcgi doesn't handle connection abort). (Dmitry)
- Fixed bug #37244 (Added strict flag to base64_decode() that enforces
RFC3548 compliance). (Ilia)
- Fixed bug #37144 (PHP crashes trying to assign into property of dead object).
(Dmitry)
- Fixed bug #36949 (invalid internal mysqli objects dtor). (Mike)
- Fixed bug #36759 (Objects destructors are invoked in wrong order when script
is finished). (Dmitry)
- Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
- Fixed bug #35886 (file_get_contents() fails with some
combinations of offset & maxlen). (Nuno)
- Fixed bug #35512 (Lack of read permission on main script results in
E_WARNING rather then E_ERROR). (Ilia)
- Fixed bug #34180 (--with-curlwrappers causes PHP to disregard some HTTP
stream context options). (Mike)
- Fixed bug #34005 (oci_password_change() fails).
(pholdaway at technocom-wireless dot com, Tony)
- Fixed bug #29538 (number_format and problem with 0). (Matthew Wilmas)
04 May 2006, PHP 5.1.4
- Added "capture_peer_cert" and "capture_peer_cert_chain" context options
for SSL streams. (Wez).
- Added PDO::PARAM_EVT_* family of constants. (Sara)
- Fixed possible crash in highlight_string(). (Dmitry)
- Fixed bug #37291 (FastCGI now longer works with isapi_fcgi.dll). (Dmitry)
- Fixed bug #37277 (cloning Dom Documents or Nodes does not work). (Rob)
- Fixed bug #37276 (problems with $_POST array). (Dmitry)
- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).
28 Apr 2006, PHP 5.1.3
- Updated bundled PCRE library to version 6.6. (Andrei)
- Moved extensions to PECL:
. ext/msession (Derick)
+12 -4
View File
@@ -29,14 +29,22 @@ Having said that, here are the organizational rules:
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for thos who need that.
Currently we have the following branches in use:
HEAD Will become PHP 6.0. This CVS branch is for active development.
PHP_5_1 Is used to release the PHP 5.1.x series. Only minor feature
enhancements may go in here, but please keep that as infrequent as
possible.
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
enhancements may go in here, but please keep that as infrequent as
possible.
PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
PHP_5_0 This branch is closed.
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
on this branch.
on this branch (Consult the releasemaster prior to commit).
PHP_4_3 This branch is closed.
The next few rules are more of a technical nature.
+8 -5
View File
@@ -31,14 +31,17 @@ resources cannot be auto-converted.
Type specifiers
---------------
l - long
d - double
s - string (with possible null bytes) and its length
b - boolean, stored in zend_bool
r - resource (stored in zval)
a - array
b - boolean, stored in zend_bool
d - double
f - function or array containing php method call info (returned as
zend_fcall_info* and zend_fcall_info_cache*)
h - array (returned as HashTable*)
l - long
o - object (of any type)
O - object (of specific type, specified by class entry)
r - resource (stored in zval)
s - string (with possible null bytes) and its length
z - the actual zval
The following characters also have a meaning in the specifier string:
+51
View File
@@ -0,0 +1,51 @@
PHP 5.2 Update info or NEWS explained
- Changed E_ALL error reporting mode to includes E_RECOVERABLE_ERROR. (Marcus)
This changes means that the value of the E_ALL constant had changed to 6143
from its previous value of 2047. If you are setting your error reporting mode
inside the Apache config file or the .htaccess files you will need to adjust
the value of error_reporting INI setting accordingly.
- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
This changes a few E_ERROR conditions to something that you can now catch
using a user error handler. If the user error handler does not grab these
kind of error they behave as fatal errors just like in any PHP version prior
to 5.2. Errors of this type are logged as 'Catchable fatal error'.
- Added support for constructors in interfaces to force constructor signature
checks in implementations. (Marcus)
Starting with PHP 5.2 interfaces can have constructors. If you use this
feature then all implementing classes must implement constructors with a
matching signature, while normally constructors do not need to follow any
base class or interface constructor signature. (Signature is the name for
the parameter and return type definition which captures count, reference or
not and any type hints).
- Changed __toString to be called whereever applicable. (Marcus)
The magic object method __toString() is now called whenever an object is used
as a string. The function must not throw an exception or the script will be
terminated. The PHP 5.0/%51 fallback to return a string containing the object
idetifier has been dropped. Note that the object identifier is never unique.
That measn that if you have used this feature your application has been
flawed. Nonetheless it will now be a catchable fatal error (see above).
- Added RFC2397 (data: stream) support. (Marcus)
Under windows this can mean a very rare change of behavior. If you are using
NTFS filesystem and making use of meta streams in your application this does
no longer work for a file with the name 'data' accessed without any path. IF
you need to do so you have to prefix the filename with the "file:" protocol.
For the functionality itself look here http://www.faqs.org/rfcs/rfc2397.html.
- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
With this option one can now distinguish between standard file operations on
remote files and inclusion of remote files. While the former is usually
desired, the latter implies security risks if used naivly. Starting with
PHP-5.2 it is now possible to allow standard file operations while
dissalowing inclusion of remote files, which will also be the default
configuration.
+13
View File
@@ -0,0 +1,13 @@
The goal of the new memory manager (PHP 5.2 and later) is reducing memory allocation overhead and speedup memory management.
The new manager's "configure" has no "--disable-zend-memory-manager" option, but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG build and disabled by default in RELEASE built. It allows select malloc/emalloc at runtime. So you can use internal and external memory debuggers without recompilation.
$ sapi/cli/php -r 'leak();'
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();'
The patch allows tweaking memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment variables. Default values are "malloc" and "256K". Dependent on target system you can also use "mmap_anon", "mmap_zero"
and "win32" storage managers.
$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php
+106 -6
View File
@@ -129,13 +129,11 @@ AC_ARG_WITH(zend-vm,
PHP_ZEND_VM=CALL
])
AC_ARG_ENABLE(zend-memory-manager,
[ --disable-zend-memory-manager
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
AC_ARG_ENABLE(malloc-mm,
[ --enable-malloc-mm Use environment variable for run-time malloc/emalloc
selection - FOR DEVELOPERS ONLY!!],
[
ZEND_USE_ZEND_ALLOC=$enableval
], [
ZEND_USE_ZEND_ALLOC=yes
ZEND_USE_MALLOC_MM=$enableval
])
AC_ARG_ENABLE(maintainer-zts,
@@ -306,6 +304,108 @@ int main()
AC_MSG_RESULT(done)
dnl test for memory allocation using mmap(MAP_ANON)
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_ANON
# ifdef MAP_ANONYMOUS
# define MAP_ANON MAP_ANONYMOUS
# endif
#endif
#ifndef MREMAP_MAYMOVE
# define MREMAP_MAYMOVE 0
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
#define SEG_SIZE (256*1024)
int main()
{
void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (seg == MAP_FAILED) {
return 1;
}
if (munmap(seg, SEG_SIZE) != 0) {
return 2;
}
return 0;
}
], [
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
], [
dnl cross-compile needs something here
AC_MSG_RESULT(no)
])
dnl test for memory allocation using mmap("/dev/zero")
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_ANON
# ifdef MAP_ANONYMOUS
# define MAP_ANON MAP_ANONYMOUS
# endif
#endif
#ifndef MREMAP_MAYMOVE
# define MREMAP_MAYMOVE 0
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
#define SEG_SIZE (256*1024)
int main()
{
int fd;
void *seg;
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
if (fd < 0) {
return 1;
}
seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (seg == MAP_FAILED) {
return 2;
}
if (munmap(seg, SEG_SIZE) != 0) {
return 3;
}
if (close(fd) != 0) {
return 4;
}
return 0;
}
], [
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
], [
dnl cross-compile needs something here
AC_MSG_RESULT(no)
])
AC_CHECK_FUNCS(mremap)
])
+1
View File
@@ -169,6 +169,7 @@ SOURCE=.\zend_exceptions.c
# Begin Source File
SOURCE=.\zend_execute.c
# ADD CPP /I "..\TSRM"
# End Source File
# Begin Source File
+1 -1
View File
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
+54
View File
@@ -0,0 +1,54 @@
--TEST--
func_num_args() tests
--FILE--
<?php
function test1() {
var_dump(func_num_args());
}
function test2($a) {
var_dump(func_num_args());
}
function test3($a, $b) {
var_dump(func_num_args());
}
test1();
test2(1);
test2();
test3(1,2);
call_user_func("test1");
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
static function test1($a) {
var_dump(func_num_args());
}
}
test::test1(1);
var_dump(func_num_args());
echo "Done\n";
?>
--EXPECTF--
int(0)
int(1)
Warning: Missing argument 1 for test2(), called in %s on line %d
int(0)
int(2)
int(0)
Warning: Missing argument 2 for test3() in %s on line %d
int(1)
int(2)
int(1)
Warning: func_num_args(): Called from the global scope - no function context in %s on line %d
int(-1)
Done
+108
View File
@@ -0,0 +1,108 @@
--TEST--
func_get_arg() tests
--FILE--
<?php
function test1() {
var_dump(func_get_arg(-10));
var_dump(func_get_arg(0));
var_dump(func_get_arg(1));
}
function test2($a) {
var_dump(func_get_arg(0));
var_dump(func_get_arg(1));
}
function test3($a, $b) {
var_dump(func_get_arg(0));
var_dump(func_get_arg(1));
var_dump(func_get_arg(2));
}
test1();
test1(10);
test2(1);
test2();
test3(1,2);
call_user_func("test1");
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
static function test1($a) {
var_dump(func_get_arg(0));
var_dump(func_get_arg(1));
}
}
test::test1(1);
var_dump(func_get_arg(1));
echo "Done\n";
?>
--EXPECTF--
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false)
int(10)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
int(1)
int(2)
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: Missing argument 2 for test3() in %s on line %d
int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
bool(false)
int(1)
int(2)
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
bool(false)
int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
bool(false)
Done
+81
View File
@@ -0,0 +1,81 @@
--TEST--
func_get_args() tests
--FILE--
<?php
function test1() {
var_dump(func_get_args());
}
function test2($a) {
var_dump(func_get_args());
}
function test3($a, $b) {
var_dump(func_get_args());
}
test1();
test1(10);
test2(1);
test2();
test3(1,2);
call_user_func("test1");
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
static function test1($a) {
var_dump(func_get_args());
}
}
test::test1(1);
var_dump(func_get_args());
echo "Done\n";
?>
--EXPECTF--
array(0) {
}
array(1) {
[0]=>
int(10)
}
array(1) {
[0]=>
int(1)
}
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
array(0) {
}
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
array(0) {
}
Warning: Missing argument 2 for test3() in %s on line %d
array(1) {
[0]=>
int(1)
}
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
array(1) {
[0]=>
int(1)
}
Warning: func_get_args(): Called from the global scope - no function context in %s on line %d
bool(false)
Done
+25
View File
@@ -0,0 +1,25 @@
--TEST--
strncmp() tests
--FILE--
<?php
var_dump(strncmp("", ""));
var_dump(strncmp("", "", 100));
var_dump(strncmp("aef", "dfsgbdf", -1));
var_dump(strncmp("fghjkl", "qwer", 0));
var_dump(strncmp("qwerty", "qwerty123", 6));
var_dump(strncmp("qwerty", "qwerty123", 7));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for strncmp() in %s on line %d
NULL
int(0)
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(0)
int(0)
int(-1)
Done
+27
View File
@@ -0,0 +1,27 @@
--TEST--
strcasecmp() tests
--FILE--
<?php
var_dump(strcasecmp(""));
var_dump(strcasecmp("", ""));
var_dump(strcasecmp("aef", "dfsgbdf"));
var_dump(strcasecmp("qwe", "qwer"));
var_dump(strcasecmp("qwerty", "QweRty"));
var_dump(strcasecmp("qwErtY", "qwerty"));
var_dump(strcasecmp("q123", "Q123"));
var_dump(strcasecmp("01", "01"));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for strcasecmp() in %s on line %d
NULL
int(0)
int(-3)
int(-1)
int(0)
int(0)
int(0)
int(0)
Done
+31
View File
@@ -0,0 +1,31 @@
--TEST--
strncasecmp() tests
--FILE--
<?php
var_dump(strncasecmp(""));
var_dump(strncasecmp("", "", -1));
var_dump(strncasecmp("aef", "dfsgbdf", 0));
var_dump(strncasecmp("aef", "dfsgbdf", 10));
var_dump(strncasecmp("qwe", "qwer", 3));
var_dump(strncasecmp("qwerty", "QweRty", 6));
var_dump(strncasecmp("qwErtY", "qwer", 7));
var_dump(strncasecmp("q123", "Q123", 3));
var_dump(strncasecmp("01", "01", 1000));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for strncasecmp() in %s on line %d
NULL
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(0)
int(-3)
int(0)
int(0)
int(2)
int(0)
int(0)
Done
+63
View File
@@ -0,0 +1,63 @@
--TEST--
each() tests
--FILE--
<?php
var_dump(each());
$var = 1;
var_dump(each($var));
$var = "string";
var_dump(each($var));
$var = array(1,2,3);
var_dump(each($var));
$var = array("a"=>1,"b"=>2,"c"=>3);
var_dump(each($var));
$a = array(1);
$a [] =&$a[0];
var_dump(each($a));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for each() in %s on line %d
NULL
Warning: Variable passed to each() is not an array or object in %s on line %d
NULL
Warning: Variable passed to each() is not an array or object in %s on line %d
NULL
array(4) {
[1]=>
int(1)
["value"]=>
int(1)
[0]=>
int(0)
["key"]=>
int(0)
}
array(4) {
[1]=>
int(1)
["value"]=>
int(1)
[0]=>
string(1) "a"
["key"]=>
string(1) "a"
}
array(4) {
[1]=>
int(1)
["value"]=>
int(1)
[0]=>
int(0)
["key"]=>
int(0)
}
Done
+53
View File
@@ -0,0 +1,53 @@
--TEST--
define() tests
--FILE--
<?php
var_dump(define());
var_dump(define("TRUE"));
var_dump(define("TRUE", 1));
var_dump(define("TRUE", 1, array(1)));
var_dump(define(array(1,2,3,4,5), 1));
var_dump(define(" ", 1));
var_dump(define("[[[", 2));
var_dump(define("test const", 3));
var_dump(define("test const", 3));
var_dump(define("test", array(1)));
var_dump(define("test1", new stdclass));
var_dump(constant(" "));
var_dump(constant("[[["));
var_dump(constant("test const"));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for define() in %s on line %d
NULL
Warning: Wrong parameter count for define() in %s on line %d
NULL
bool(true)
Notice: Constant true already defined in %s on line %d
bool(false)
Notice: Array to string conversion in %s on line %d
bool(true)
bool(true)
bool(true)
bool(true)
Notice: Constant test const already defined in %s on line %d
bool(false)
Warning: Constants may only evaluate to scalar values in %s on line %d
bool(false)
Warning: Constants may only evaluate to scalar values in %s on line %d
bool(false)
int(1)
int(2)
int(3)
Done
+46
View File
@@ -0,0 +1,46 @@
--TEST--
get_class() tests
--FILE--
<?php
class foo {
function bar () {
var_dump(get_class());
}
}
class foo2 extends foo {
}
foo::bar();
foo2::bar();
$f1 = new foo;
$f2 = new foo2;
$f1->bar();
$f2->bar();
var_dump(get_class());
var_dump(get_class("qwerty"));
var_dump(get_class($f1));
var_dump(get_class($f2));
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
string(3) "foo"
Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
string(3) "foo"
string(3) "foo"
string(3) "foo"
Warning: get_class() called without object from outside a class in %s on line %d
bool(false)
bool(false)
string(3) "foo"
string(4) "foo2"
Done
+59
View File
@@ -0,0 +1,59 @@
--TEST--
get_parent_class() tests
--FILE--
<?php
interface i {
function test();
}
class foo implements i {
function test() {
var_dump(get_parent_class());
}
}
class bar extends foo {
function test_bar() {
var_dump(get_parent_class());
}
}
$bar = new bar;
$foo = new foo;
$foo->test();
$bar->test();
$bar->test_bar();
var_dump(get_parent_class($bar));
var_dump(get_parent_class($foo));
var_dump(get_parent_class("bar"));
var_dump(get_parent_class("foo"));
var_dump(get_parent_class("i"));
var_dump(get_parent_class(""));
var_dump(get_parent_class("[[[["));
var_dump(get_parent_class(" "));
var_dump(get_parent_class(new stdclass));
var_dump(get_parent_class(array()));
var_dump(get_parent_class(1));
echo "Done\n";
?>
--EXPECTF--
bool(false)
bool(false)
string(3) "foo"
string(3) "foo"
bool(false)
string(3) "foo"
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Done
+89
View File
@@ -0,0 +1,89 @@
--TEST--
property_exists() tests
--FILE--
<?php
class foo {
public $pp1 = 1;
private $pp2 = 2;
protected $pp3 = 3;
function bar() {
var_dump(property_exists("foo","pp1"));
var_dump(property_exists("foo","pp2"));
var_dump(property_exists("foo","pp3"));
}
}
class bar extends foo {
function test() {
var_dump(property_exists("foo","pp1"));
var_dump(property_exists("foo","pp2"));
var_dump(property_exists("foo","pp3"));
}
}
var_dump(property_exists());
var_dump(property_exists(""));
var_dump(property_exists("foo","pp1"));
var_dump(property_exists("foo","pp2"));
var_dump(property_exists("foo","pp3"));
var_dump(property_exists("foo","nonexistent"));
var_dump(property_exists("fo","nonexistent"));
var_dump(property_exists("foo",""));
var_dump(property_exists("","test"));
var_dump(property_exists("",""));
$foo = new foo;
var_dump(property_exists($foo,"pp1"));
var_dump(property_exists($foo,"pp2"));
var_dump(property_exists($foo,"pp3"));
var_dump(property_exists($foo,"nonexistent"));
var_dump(property_exists($foo,""));
var_dump(property_exists(array(),"test"));
var_dump(property_exists(1,"test"));
var_dump(property_exists(true,"test"));
$foo->bar();
$bar = new bar;
$bar->test();
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for property_exists() in %s on line %d
NULL
Warning: Wrong parameter count for property_exists() in %s on line %d
NULL
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
NULL
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
NULL
Warning: First parameter must either be an object or the name of an existing class in %s on line %d
NULL
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
Done
+34
View File
@@ -0,0 +1,34 @@
--TEST--
class_exists() tests
--FILE--
<?php
class foo {
}
var_dump(class_exists());
var_dump(class_exists("qwerty"));
var_dump(class_exists(""));
var_dump(class_exists(array()));
var_dump(class_exists("test", false));
var_dump(class_exists("foo", false));
var_dump(class_exists("foo"));
var_dump(class_exists("stdClass", false));
var_dump(class_exists("stdClass"));
echo "Done\n";
?>
--EXPECTF--
Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)
bool(false)
Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d
NULL
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
Done
+34
View File
@@ -0,0 +1,34 @@
--TEST--
interface_exists() tests
--FILE--
<?php
interface foo {
}
var_dump(interface_exists());
var_dump(interface_exists("qwerty"));
var_dump(interface_exists(""));
var_dump(interface_exists(array()));
var_dump(interface_exists("test", false));
var_dump(interface_exists("foo", false));
var_dump(interface_exists("foo"));
var_dump(interface_exists("stdClass", false));
var_dump(interface_exists("stdClass"));
echo "Done\n";
?>
--EXPECTF--
Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)
bool(false)
Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d
NULL
bool(false)
bool(true)
bool(true)
bool(false)
bool(false)
Done
+3
View File
@@ -0,0 +1,3 @@
<?php
/* dummy file for 014.phpt */
?>
+52
View File
@@ -0,0 +1,52 @@
--TEST--
get_included_files() tests
--FILE--
<?php
var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc");
var_dump(get_included_files());
var_dump(get_included_files(1,1));
include_once(dirname(__FILE__)."/014.inc");
var_dump(get_included_files());
var_dump(get_included_files(1));
include(dirname(__FILE__)."/014.inc");
var_dump(get_included_files());
echo "Done\n";
?>
--EXPECTF--
array(1) {
[0]=>
string(%d) "%s"
}
array(2) {
[0]=>
string(%d) "%s"
[1]=>
string(%d) "%s"
}
Warning: Wrong parameter count for get_included_files() in %s on line %d
NULL
array(2) {
[0]=>
string(%d) "%s"
[1]=>
string(%d) "%s"
}
Warning: Wrong parameter count for get_included_files() in %s on line %d
NULL
array(2) {
[0]=>
string(%d) "%s"
[1]=>
string(%d) "%s"
}
Done
+35
View File
@@ -0,0 +1,35 @@
--TEST--
trigger_error() tests
--FILE--
<?php
var_dump(trigger_error());
var_dump(trigger_error("error"));
var_dump(trigger_error(array()));
var_dump(trigger_error("error", -1));
var_dump(trigger_error("error", 0));
var_dump(trigger_error("error", E_USER_WARNING));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for trigger_error() in %s on line %d
NULL
Notice: error in %s on line %d
bool(true)
Notice: Array to string conversion in %s on line %d
Notice: Array in %s on line %d
bool(true)
Warning: Invalid error type specified in %s on line %d
bool(false)
Warning: Invalid error type specified in %s on line %d
bool(false)
Warning: error in %s on line %d
bool(true)
Done
+12
View File
@@ -0,0 +1,12 @@
--TEST--
isset() with object properties when operating on non-object
--FILE--
<?php
$foo = NULL;
isset($foo->bar->bar);
echo "Done\n";
?>
--EXPECT--
Done
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Test for abstract static classes
--FILE--
<?php
abstract class TestClass
{
abstract static public function getName();
}
?>
===DONE===
--EXPECTF--
Fatal error: Static function TestClass::getName() cannot be abstract in %sabstract-static.php on line %d
+1 -1
View File
@@ -12,4 +12,4 @@ foo(123);
--EXPECTF--
3
Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
+21 -14
View File
@@ -2,6 +2,7 @@
Bug #26166 (__toString() crash when no values returned)
--FILE--
<?php
class Foo
{
function __toString()
@@ -28,6 +29,23 @@ class Bar
$o = new Bar;
echo $o;
echo "===NONE===\n";
function my_error_handler($errno, $errstr, $errfile, $errline) {
var_dump($errstr);
}
set_error_handler('my_error_handler');
class None
{
function __toString() {
}
}
$o = new None;
echo $o;
echo "===THROW===\n";
class Error
@@ -45,23 +63,12 @@ catch (Exception $e) {
echo "Got the exception\n";
}
echo "===NONE===\n";
class None
{
function __toString() {
}
}
$o = new None;
echo $o;
?>
===DONE===
--EXPECTF--
Hello World!
===THROW===
Got the exception
===NONE===
string(52) "Method None::__toString() must return a string value"
===THROW===
Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
-44
View File
@@ -1,44 +0,0 @@
--TEST--
Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
--INI--
error_reporting=4095
--FILE--
<?php
class A {
public $a = "Default for A";
public $b = "Default for B";
function __construct($a, $b) {
$this->a = $a;
$this->b = $b;
}
function A() {
$args = func_get_args();
call_user_func_array(Array(&$this, '__construct'), $args);
}
}
$t = new A("New A", "New B");
print_r($t);
print_r(get_class_vars(get_class($t)));
print_r(get_object_vars($t));
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
A Object
(
[a] => New A
[b] => New B
)
Array
(
[a] => Default for A
[b] => Default for B
)
Array
(
[a] => New A
[b] => New B
)
+8 -1
View File
@@ -3,6 +3,12 @@ Bug #28444 (Cannot access undefined property for object with overloaded property
--FILE--
<?php
function my_error_handler($errno, $errstr, $errfile, $errline) {
var_dump($errstr);
}
set_error_handler('my_error_handler');
class Object
{
public $x;
@@ -60,7 +66,8 @@ Overloaded::__set(y,3)
int(3)
Overloaded::__get(y)
int(3)
Overloaded::__set(z,Object id #3)
string(55) "Object of class Object could not be converted to string"
Overloaded::__set(z,)
object(Object)#%d (1) {
["x"]=>
int(4)
+15 -3
View File
@@ -2,21 +2,33 @@
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
--FILE--
<?php
class a {
function my_error_handler($errno, $errstr, $errfile, $errline) {
var_dump($errstr);
}
set_error_handler('my_error_handler');
class a
{
public $a = 4;
function __call($a,$b) {
return "unknown method";
}
}
$b = new a;
echo $b,"\n";
$c = unserialize(serialize($b));
echo $c,"\n";
var_dump($c);
?>
--EXPECT--
Object id #1
Object id #2
string(50) "Object of class a could not be converted to string"
string(50) "Object of class a could not be converted to string"
object(a)#2 (1) {
["a"]=>
int(4)
+4 -1
View File
@@ -28,9 +28,12 @@ $b = "much longer";
print_r($a);
?>
--EXPECTF--
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20
A Object
(
[q] => long
[q] => 3
)
Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
+1 -1
View File
@@ -27,7 +27,7 @@ interface iB2 extends iA2 {
class A2 implements iA2 {
}
class B2 extends A2 implements iB2 {
class B2 extends A2 implements iA2 {
}
echo iA2::cA;
+5 -5
View File
@@ -1,5 +1,5 @@
--TEST--
bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
--FILE--
<?php
@@ -14,7 +14,7 @@ function make_exception()
function make_exception_and_change_err_reporting()
{
error_reporting(E_ALL);
error_reporting(E_ALL & ~E_STRICT);
throw new Exception();
}
@@ -34,7 +34,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
int(4095)
int(4095)
int(2047)
int(8191)
int(8191)
int(6143)
Done
+3 -3
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
--INI--
error_reporting=4095
error_reporting=8191
--FILE--
<?php
class Foo
@@ -24,6 +24,6 @@ FooTest();
FooTest(new Foo());
?>
--EXPECTF--
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
Hi!
Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #36759 (Objects destructors are invoked in wrong order when script is finished)
--FILE--
<?php
class Foo {
private $bar;
function __construct($bar) {
$this->bar = $bar;
}
function __destruct() {
echo __METHOD__,"\n";
unset($this->bar);
}
}
class Bar {
function __destruct() {
echo __METHOD__,"\n";
unset($this->bar);
}
}
$y = new Bar();
$x = new Foo($y);
?>
--EXPECT--
Foo::__destruct
Bar::__destruct
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #37144 (PHP crashes trying to assign into property of dead object)
--FILE--
<?php
function foo() {
$x = new stdClass();
$x->bar = array(1);
return $x;
}
foo()->bar[1] = "123";
foo()->bar[0]++;
unset(foo()->bar[0]);
echo "ok\n";
?>
--EXPECT--
ok
+55
View File
@@ -0,0 +1,55 @@
--TEST--
Bug #3721 (Access to protected property of common base class)
--FILE--
<?php
class A
{
protected $value;
public function __construct($val)
{
$this->value = $val;
}
protected function getValue()
{
return $this->value;
}
}
class B extends A
{
public function copyValue($obj)
{
$this->value = $obj->getValue();
$this->value = $obj->value; // value defined in common base class
}
}
class C extends A {}
$B = new B("B");
var_dump($B);
$C = new C("C");
var_dump($C);
$B->copyValue($C);
var_dump($B);
?>
===DONE===
--EXPECTF--
object(B)#%d (1) {
["value:protected"]=>
string(1) "B"
}
object(C)#%d (1) {
["value:protected"]=>
string(1) "C"
}
object(B)#%d (1) {
["value:protected"]=>
string(1) "C"
}
===DONE===
+135
View File
@@ -0,0 +1,135 @@
--TEST--
Bug #37632 (Protected method access problem)
--FILE--
<?php
class A1
{
protected function test()
{
echo __METHOD__ . "\n";
}
}
class B1 extends A1
{
public function doTest(A1 $obj)
{
echo __METHOD__ . "\n";
$obj->test();
}
}
class C1 extends A1
{
protected function test()
{
echo __METHOD__ . "\n";
}
}
$b = new B1;
$b->doTest(new C1);
class A2
{
static protected function test()
{
echo __METHOD__ . "\n";
}
}
class B2 extends A2
{
static public function doTest(A2 $obj)
{
echo __METHOD__ . "\n";
$obj->test();
}
}
class C2 extends A2
{
static protected function test()
{
echo __METHOD__ . "\n";
}
}
B2::doTest(new C2);
/* Right now Ctor's cannot be made protected when defined in a ctor. That is
* we cannot decrease visibility.
*
interface Ctor
{
function __construct($x);
}
class A3 implements Ctor
{
protected function __construct()
{
echo __METHOD__ . "\n";
}
}
class B3 extends A3
{
static public function doTest()
{
echo __METHOD__ . "\n";
new C3;
}
}
class C3 extends A3
{
protected function __construct()
{
echo __METHOD__ . "\n";
}
}
B3::doTest();
*/
class A4
{
protected function __construct()
{
echo __METHOD__ . "\n";
}
}
class B4 extends A4
{
static public function doTest()
{
echo __METHOD__ . "\n";
new C4;
}
}
class C4 extends A4
{
protected function __construct()
{
echo __METHOD__ . "\n";
}
}
B4::doTest();
?>
===DONE===
--EXPECTF--
B1::doTest
C1::test
B2::doTest
C2::test
B4::doTest
Fatal error: Call to protected C4::__construct() from context 'B4' in %sbug37632.php on line %d
+53
View File
@@ -0,0 +1,53 @@
--TEST--
Bug #37667 (Object is not added into array returned by __get)
--FILE--
<?php
class Test
{
protected $property = array('foo' => 'bar');
function __get($name)
{
return $this->property;
}
}
$obj = new Test;
var_dump($obj->property['foo']);
var_dump($obj->property[2]);
var_dump($obj);
$obj->property[] = 1;
$obj->property[] = 2;
var_dump($obj);
?>
===DONE===
--EXPECTF--
string(3) "bar"
Notice: Undefined offset: 2 in %sbug37667.php on line 16
NULL
object(Test)#%d (1) {
["property:protected"]=>
array(1) {
["foo"]=>
string(3) "bar"
}
}
Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20
Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
object(Test)#%d (1) {
["property:protected"]=>
array(1) {
["foo"]=>
string(3) "bar"
}
}
===DONE===
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #37707 (clone without assigning leaks memory)
--FILE--
<?php
class testme {
function __clone() {
echo "clonned\n";
}
}
clone new testme();
echo "NO LEAK\n";
?>
--EXPECT--
clonned
NO LEAK
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #37811 define not using toString on objects
--FILE--
<?php
class TestClass
{
function __toString()
{
return "Foo";
}
}
define("Bar",new TestClass);
var_dump(Bar);
define("Baz",new stdClass);
var_dump(Baz);
?>
===DONE===
--EXPECTF--
string(3) "Foo"
Warning: Constants may only evaluate to scalar values in %sbug37811.php on line %d
Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
string(3) "Baz"
===DONE===
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
--FILE--
<?php
class foo {
public function __get($member) {
$f = array("foo"=>"bar","bar"=>"foo");
return $f;
}
}
$f = new foo();
foreach($f->bar as $key => $value) {
print "$key => $value\n";
}
?>
--EXPECT--
foo => bar
bar => foo
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Catching an exception in a constructor
--FILE--
<?php
class MyObject
{
function __construct()
{
throw new Exception();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
}
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
?>
===DONE===
--EXPECT--
Caught
===DONE===
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Catching an exception in a constructor fired form a static method
--FILE--
<?php
class MyObject
{
function fail()
{
throw new Exception();
}
function __construct()
{
self::fail();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
}
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
?>
===DONE===
--EXPECT--
Caught
===DONE===
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Catching an exception in a constructor inside a static method
--FILE--
<?php
class MyObject
{
function fail()
{
throw new Exception();
}
function __construct()
{
self::fail();
echo __METHOD__ . "() Must not be reached\n";
}
function __destruct()
{
echo __METHOD__ . "() Must not be called\n";
}
static function test()
{
try
{
new MyObject();
}
catch(Exception $e)
{
echo "Caught\n";
}
}
}
MyObject::test();
?>
===DONE===
--EXPECT--
Caught
===DONE===
+1 -1
View File
@@ -22,5 +22,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
int(2047)
int(6143)
Done
+1 -1
View File
@@ -23,5 +23,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
int(4095)
int(8191)
Done
+1 -1
View File
@@ -31,5 +31,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef2 in %s on line %d
int(4095)
int(8191)
Done
+1 -1
View File
@@ -19,5 +19,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef in %s on line %d
int(4095)
int(8191)
Done
+1 -1
View File
@@ -30,5 +30,5 @@ echo "Done\n";
Notice: Undefined variable: undef_value in %s on line %d
Notice: Undefined variable: undef_name in %s on line %d
int(2047)
int(6143)
Done
+1 -1
View File
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
int(2047)
int(6143)
Done
+1 -1
View File
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
int(2047)
int(6143)
Done
+1 -1
View File
@@ -28,5 +28,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef3 in %s on line %d
int(4095)
int(8191)
Done
+1 -1
View File
@@ -27,5 +27,5 @@ echo "Done\n";
Notice: Undefined variable: blah in %s on line %d
Notice: Undefined variable: undef2 in %s on line %d
int(4095)
int(8191)
Done
+2 -2
View File
@@ -30,6 +30,6 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
int(2047)
int(2039)
int(6143)
int(6135)
Done
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Test whether an object is NULL or not.
--FILE--
<?php
class Bla
{
}
$b = new Bla;
var_dump($b != null);
var_dump($b == null);
var_dump($b !== null);
var_dump($b === null);
?>
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(false)
+60
View File
@@ -0,0 +1,60 @@
--TEST--
comparing objects to other types
--FILE--
<?php
class Bar {
}
$b = new Bar;
var_dump($b == NULL);
var_dump($b != NULL);
var_dump($b == true);
var_dump($b != true);
var_dump($b == false);
var_dump($b != false);
var_dump($b == "");
var_dump($b != "");
var_dump($b == 0);
var_dump($b != 0);
var_dump($b == 1);
var_dump($b != 1);
var_dump($b == 1.0);
var_dump($b != 1.0);
var_dump($b == 1);
echo "Done\n";
?>
--EXPECTF--
bool(false)
bool(true)
bool(true)
bool(false)
bool(false)
bool(true)
bool(false)
bool(true)
Notice: Object of class Bar could not be converted to int in %s on line %d
bool(false)
Notice: Object of class Bar could not be converted to int in %s on line %d
bool(true)
Notice: Object of class Bar could not be converted to int in %s on line %d
bool(true)
Notice: Object of class Bar could not be converted to int in %s on line %d
bool(false)
Notice: Object of class Bar could not be converted to double in %s on line %d
bool(true)
Notice: Object of class Bar could not be converted to double in %s on line %d
bool(false)
Notice: Object of class Bar could not be converted to int in %s on line %d
bool(true)
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo() {}
}
class test2 extends test {
function foo() {}
}
class test3 extends test {
function foo($arg) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo($arg) {}
}
class test2 extends test {
function foo($arg) {}
}
class test3 extends test {
function foo($arg, $arg2) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo($arg) {}
}
class test2 extends test {
function foo($arg) {}
}
class test3 extends test {
function foo(&$arg) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function &foo() {}
}
class test2 extends test {
function &foo() {}
}
class test3 extends test {
function foo() {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo($arg, $arg2 = NULL) {}
}
class test2 extends test {
function foo($arg, $arg2 = NULL) {}
}
class test3 extends test {
function foo($arg, $arg2) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo($arg, &$arg2 = NULL) {}
}
class test2 extends test {
function foo($arg, &$arg2 = NULL) {}
}
class test3 extends test {
function foo($arg, &$arg2) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo(Test $arg) {}
}
class test2 extends test {
function foo(Test $arg) {}
}
class test3 extends test {
function foo(Test3 $arg) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+24
View File
@@ -0,0 +1,24 @@
--TEST--
method overloading with different method signature
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function foo(Test $arg) {}
}
class test2 extends test {
function foo(Test $arg) {}
}
class test3 extends test {
function foo($arg) {}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
Done
+19
View File
@@ -0,0 +1,19 @@
--TEST--
redefining constructor (__construct second)
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function test() {
}
function __construct() {
}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class test in %s on line %d
Done
+19
View File
@@ -0,0 +1,19 @@
--TEST--
redefining constructor (__construct first)
--INI--
error_reporting=8191
--FILE--
<?php
class test {
function __construct() {
}
function test() {
}
}
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class test in %s on line %d
Done
+15
View File
@@ -0,0 +1,15 @@
--TEST--
implementing a class
--FILE--
<?php
class foo {
}
interface bar extends foo {
}
echo "Done\n";
?>
--EXPECTF--
Fatal error: bar cannot implement foo - it is not an interface in %s on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
implementing the same interface twice
--FILE--
<?php
interface foo {
}
class bar implements foo, foo {
}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
extending the same interface twice
--FILE--
<?php
interface foo {
}
interface bar extends foo, foo {
}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
+26
View File
@@ -0,0 +1,26 @@
--TEST--
comparing objects with strings/NULL
--FILE--
<?php
$o=new stdClass;
var_dump($o == "");
var_dump($o != "");
var_dump($o < "");
var_dump("" < $o);
var_dump("" > $o);
var_dump($o != null);
var_dump(is_null($o));
?>
===DONE===
--EXPECT--
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
===DONE===
+47
View File
@@ -0,0 +1,47 @@
--TEST--
using different variables to access array offsets
--FILE--
<?php
$arr = array(1,2,3,4,5,6,7,8);
var_dump($arr[1]);
var_dump($arr[0.0836]);
var_dump($arr[NULL]);
var_dump($arr["run away"]);
var_dump($arr[TRUE]);
var_dump($arr[FALSE]);
$fp = fopen(__FILE__, "r");
var_dump($arr[$fp]);
$obj = new stdClass;
var_dump($arr[$obj]);
$arr1 = Array(1,2,3);
var_dump($arr[$arr1]);
echo "Done\n";
?>
--EXPECTF--
int(2)
int(1)
Notice: Undefined index: in %s on line %d
NULL
Notice: Undefined index: run away in %s on line %d
NULL
int(2)
int(1)
Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
int(%d)
Warning: Illegal offset type in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d
NULL
Done
+37
View File
@@ -0,0 +1,37 @@
--TEST--
using different variables to access boolean offsets
--FILE--
<?php
$bool = TRUE;
var_dump($bool[1]);
var_dump($bool[0.0836]);
var_dump($bool[NULL]);
var_dump($bool["run away"]);
var_dump($bool[TRUE]);
var_dump($bool[FALSE]);
$fp = fopen(__FILE__, "r");
var_dump($bool[$fp]);
$obj = new stdClass;
var_dump($bool[$obj]);
$arr = Array(1,2,3);
var_dump($bool[$arr]);
echo "Done\n";
?>
--EXPECTF--
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Done
+37
View File
@@ -0,0 +1,37 @@
--TEST--
using different variables to access long offsets
--FILE--
<?php
$long = 1;
var_dump($long[1]);
var_dump($long[0.0836]);
var_dump($long[NULL]);
var_dump($long["run away"]);
var_dump($long[TRUE]);
var_dump($long[FALSE]);
$fp = fopen(__FILE__, "r");
var_dump($long[$fp]);
$obj = new stdClass;
var_dump($long[$obj]);
$arr = Array(1,2,3);
var_dump($long[$arr]);
echo "Done\n";
?>
--EXPECTF--
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Done
+37
View File
@@ -0,0 +1,37 @@
--TEST--
using different variables to access null offsets
--FILE--
<?php
$null = NULL;
var_dump($null[1]);
var_dump($null[0.0836]);
var_dump($null[NULL]);
var_dump($null["run away"]);
var_dump($null[TRUE]);
var_dump($null[FALSE]);
$fp = fopen(__FILE__, "r");
var_dump($null[$fp]);
$obj = new stdClass;
var_dump($null[$obj]);
$arr = Array(1,2,3);
var_dump($null[$arr]);
echo "Done\n";
?>
--EXPECTF--
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Done
+11
View File
@@ -0,0 +1,11 @@
--TEST--
accessing object dimension
--FILE--
<?php
$object = new stdClass;
var_dump($object[1]);
?>
--EXPECTF--
Fatal error: Cannot use object of type stdClass as array in %s on line %d
+45
View File
@@ -0,0 +1,45 @@
--TEST--
using different variables to access string offsets
--FILE--
<?php
$str = "Sitting on a corner all alone, staring from the bottom of his soul";
var_dump($str[1]);
var_dump($str[0.0836]);
var_dump($str[NULL]);
var_dump($str["run away"]);
var_dump($str[TRUE]);
var_dump($str[FALSE]);
$fp = fopen(__FILE__, "r");
var_dump($str[$fp]);
$obj = new stdClass;
var_dump($str[$obj]);
$arr = Array(1,2,3);
var_dump($str[$arr]);
echo "Done\n";
?>
--EXPECTF--
string(1) "i"
string(1) "S"
string(1) "S"
string(1) "S"
string(1) "i"
string(1) "S"
Warning: Illegal offset type in %s on line %d
string(1) "%s"
Warning: Illegal offset type in %s on line %d
Notice: Object of class stdClass could not be converted to int in %s on line %d
string(1) "%s"
Warning: Illegal offset type in %s on line %d
string(1) "i"
Done
+19
View File
@@ -0,0 +1,19 @@
--TEST--
using resource as array offset
--INI--
error_reporting=8191
--FILE--
<?php
$fp = fopen(__FILE__, 'r');
$array = array(1,2,3,4,5,6,7);
var_dump($array[$fp]);
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
int(%d)
Done
+27
View File
@@ -0,0 +1,27 @@
--TEST--
assigning static property as non static
--INI--
error_reporting=8191
--FILE--
<?php
class test {
static $foo = 1;
}
$t = new test;
$t->foo = 5;
$fp = fopen(__FILE__, 'r');
var_dump($t);
echo "Done\n";
?>
--EXPECTF--
Strict Standards: Accessing static property test::$foo as non static in %s on line %d
object(test)#%d (1) {
["foo"]=>
int(5)
}
Done
+66 -80
View File
@@ -87,7 +87,6 @@ ZEND_INI_END()
#ifdef ZTS
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
ZEND_API int alloc_globals_id;
HashTable *global_function_table;
HashTable *global_class_table;
HashTable *global_constants_table;
@@ -107,7 +106,7 @@ static uint zend_version_info_length;
#define PRINT_ZVAL_INDENT 4
static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
{
zval **tmp;
char *string_key;
@@ -117,48 +116,52 @@ static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
int i;
for (i=0; i<indent; i++) {
ZEND_PUTS(" ");
ZEND_PUTS_EX(" ");
}
ZEND_PUTS("(\n");
ZEND_PUTS_EX("(\n");
indent += PRINT_ZVAL_INDENT;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
for (i=0; i<indent; i++) {
ZEND_PUTS(" ");
ZEND_PUTS_EX(" ");
}
ZEND_PUTS("[");
ZEND_PUTS_EX("[");
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
case HASH_KEY_IS_STRING:
if (is_object) {
char *prop_name, *class_name;
zend_unmangle_property_name_ex(string_key, str_len, &class_name, &prop_name);
ZEND_PUTS(prop_name);
zend_unmangle_property_name(string_key, str_len-1, &class_name, &prop_name);
ZEND_PUTS_EX(prop_name);
if (class_name) {
if (class_name[0]=='*') {
ZEND_PUTS(":protected");
ZEND_PUTS_EX(":protected");
} else {
ZEND_PUTS(":private");
ZEND_PUTS_EX(":private");
}
}
} else {
ZEND_WRITE(string_key, str_len-1);
ZEND_WRITE_EX(string_key, str_len-1);
}
break;
case HASH_KEY_IS_LONG:
zend_printf("%ld", num_key);
{
char key[25];
sprintf(key, "%ld", num_key);
ZEND_PUTS_EX(key);
}
break;
}
ZEND_PUTS("] => ");
zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
ZEND_PUTS("\n");
ZEND_PUTS_EX("] => ");
zend_print_zval_r_ex(zend_write, *tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
ZEND_PUTS_EX("\n");
zend_hash_move_forward_ex(ht, &iterator);
}
indent -= PRINT_ZVAL_INDENT;
for (i=0; i<indent; i++) {
ZEND_PUTS(" ");
ZEND_PUTS_EX(" ");
}
ZEND_PUTS(")\n");
ZEND_PUTS_EX(")\n");
}
static void print_flat_hash(HashTable *ht TSRMLS_DC)
@@ -221,46 +224,36 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
case IS_OBJECT:
{
TSRMLS_FETCH();
#if 0
/* Standard PHP objects */
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HT_P(expr)->cast_object) {
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
break;
}
zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
}
#endif
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
if(Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
break;
}
} else {
if(Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
z->refcount++;
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_printable_zval(z, expr_copy, use_copy);
if (*use_copy) {
zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
zval_ptr_dtor(&z);
}
}
if (EG(exception)) {
zval_dtor(expr_copy);
expr_copy->value.str.len = 0;
expr_copy->value.str.val = STR_EMPTY_ALLOC();
if(Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
break;
}
/* Standard PHP objects */
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) {
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
break;
}
}
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
z->refcount++;
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_printable_zval(z, expr_copy, use_copy);
if (*use_copy) {
zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
expr_copy->value.str.len = 0;
expr_copy->value.str.val = STR_EMPTY_ALLOC();
}
expr_copy->value.str.val = (char *) emalloc(sizeof("Object id #")-1 + MAX_LENGTH_OF_LONG);
expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Object id #%ld", (long)expr->value.obj.handle);
break;
case IS_DOUBLE:
*expr_copy = *expr;
@@ -364,13 +357,13 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
{
switch (expr->type) {
case IS_ARRAY:
ZEND_PUTS("Array\n");
ZEND_PUTS_EX("Array\n");
if (++expr->value.ht->nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
ZEND_PUTS_EX(" *RECURSION*");
expr->value.ht->nApplyCount--;
return;
}
print_hash(expr->value.ht, indent, 0 TSRMLS_CC);
print_hash(write_func, expr->value.ht, indent, 0 TSRMLS_CC);
expr->value.ht->nApplyCount--;
break;
case IS_OBJECT:
@@ -382,7 +375,12 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
}
zend_printf("%s Object\n", class_name?class_name:"Unknown Class");
if (class_name) {
ZEND_PUTS_EX(class_name);
} else {
ZEND_PUTS_EX("Unknown Class");
}
ZEND_PUTS_EX(" Object\n");
if (class_name) {
efree(class_name);
}
@@ -391,17 +389,17 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
}
if (properties) {
if (++properties->nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
ZEND_PUTS_EX(" *RECURSION*");
properties->nApplyCount--;
return;
}
print_hash(properties, indent, 1 TSRMLS_CC);
print_hash(write_func, properties, indent, 1 TSRMLS_CC);
properties->nApplyCount--;
}
break;
}
default:
zend_print_variable(expr);
zend_print_zval_ex(write_func, expr, indent);
break;
}
}
@@ -504,6 +502,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
EG(in_autoload) = NULL;
EG(current_execute_data) = NULL;
EG(current_module) = NULL;
EG(exit_status) = 0;
}
@@ -525,19 +524,8 @@ static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
zend_copy_ini_directives(TSRMLS_C);
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
}
static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
{
shutdown_memory_manager(0, 1 TSRMLS_CC);
}
#endif
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
{
start_memory_manager(TSRMLS_C);
}
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
#include <floatingpoint.h>
@@ -566,19 +554,15 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#ifdef ZTS
zend_compiler_globals *compiler_globals;
zend_executor_globals *executor_globals;
void ***tsrm_ls;
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
#else
extern zend_scanner_globals ini_scanner_globals;
extern zend_scanner_globals language_scanner_globals;
#endif
TSRMLS_FETCH();
#ifdef ZTS
ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
#else
alloc_globals_ctor(&alloc_globals TSRMLS_CC);
#endif
start_memory_manager(TSRMLS_C);
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
@@ -606,6 +590,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_getenv = utility_functions->getenv_function;
zend_compile_file = compile_file;
zend_compile_string = compile_string;
zend_execute = execute;
zend_execute_internal = NULL;
zend_throw_exception_hook = NULL;
@@ -771,14 +756,14 @@ ZEND_API void _zend_bailout(char *filename, uint lineno)
{
TSRMLS_FETCH();
if (!EG(bailout_set)) {
if (!EG(bailout)) {
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
exit(-1);
}
CG(unclean_shutdown) = 1;
CG(in_compilation) = EG(in_execution) = 0;
EG(current_execute_data) = NULL;
longjmp(EG(bailout), FAILURE);
longjmp(*EG(bailout), FAILURE);
}
END_EXTERN_C()
@@ -930,6 +915,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
case E_USER_ERROR:
case E_USER_WARNING:
case E_USER_NOTICE:
case E_RECOVERABLE_ERROR:
if (zend_is_compiling(TSRMLS_C)) {
error_filename = zend_get_compiled_filename(TSRMLS_C);
error_lineno = zend_get_compiled_lineno(TSRMLS_C);
@@ -1098,7 +1084,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
if (!file_handle) {
continue;
}
EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE TSRMLS_CC);
EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
if(file_handle->opened_path) {
int dummy=1;
zend_hash_add(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+18 -17
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.1.0"
#define ZEND_VERSION "2.2.0"
#define ZEND_ENGINE_2
@@ -258,7 +258,6 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
# define zend_error_noreturn zend_error
#endif
/*
* zval
*/
@@ -320,7 +319,7 @@ struct _zend_class_entry {
char type;
char *name;
zend_uint name_length;
struct _zend_class_entry *parent;
struct _zend_class_entry *parent;
int refcount;
zend_bool constants_updated;
zend_uint ce_flags;
@@ -341,6 +340,7 @@ struct _zend_class_entry {
union _zend_function *__unset;
union _zend_function *__isset;
union _zend_function *__call;
union _zend_function *__tostring;
union _zend_function *serialize_func;
union _zend_function *unserialize_func;
@@ -348,7 +348,7 @@ struct _zend_class_entry {
/* handlers */
zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object TSRMLS_DC);
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
/* serializer callbacks */
@@ -363,7 +363,7 @@ struct _zend_class_entry {
zend_uint line_end;
char *doc_comment;
zend_uint doc_comment_len;
struct _zend_module_entry *module;
};
@@ -384,7 +384,7 @@ typedef struct _zend_utility_functions {
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
} zend_utility_functions;
typedef struct _zend_utility_values {
char *import_use_extension;
uint import_use_extension_length;
@@ -430,7 +430,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define OE_IS_OBJECT (1<<1)
#define OE_IS_METHOD (1<<2)
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
void zend_shutdown(TSRMLS_D);
void zend_register_standard_ini_entries(TSRMLS_D);
@@ -449,19 +448,19 @@ END_EXTERN_C()
#define zend_try \
{ \
jmp_buf orig_bailout; \
zend_bool orig_bailout_set=EG(bailout_set); \
jmp_buf *orig_bailout = EG(bailout); \
jmp_buf bailout; \
\
EG(bailout_set) = 1; \
memcpy(&orig_bailout, &EG(bailout), sizeof(jmp_buf)); \
if (setjmp(EG(bailout))==0)
EG(bailout) = &bailout; \
if (setjmp(bailout)==0) {
#define zend_catch \
else
} else { \
EG(bailout) = orig_bailout;
#define zend_end_try() \
memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); \
EG(bailout_set) = orig_bailout_set; \
} \
EG(bailout) = orig_bailout; \
}
#define zend_first_try EG(bailout_set)=0; zend_try
#define zend_first_try EG(bailout)=NULL; zend_try
BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
@@ -503,7 +502,9 @@ END_EXTERN_C()
/* output support */
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
#define ZEND_PUTS_EX(str) write_func((str), strlen((str)))
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
@@ -562,7 +563,7 @@ END_EXTERN_C()
#define INIT_PZVAL(z) \
(z)->refcount = 1; \
(z)->is_ref = 0;
(z)->is_ref = 0;
#define INIT_ZVAL(z) z = zval_used_for_init;
+333 -154
View File
File diff suppressed because it is too large. Load diff
+72 -39
View File
@@ -25,7 +25,6 @@
#include "zend_modules.h"
#include "zend_list.h"
#include "zend_fast_cache.h"
#include "zend_operators.h"
#include "zend_variables.h"
#include "zend_execute.h"
@@ -42,9 +41,10 @@ typedef struct _zend_function_entry {
} zend_function_entry;
#define ZEND_FN(name) zif_##name
#define ZEND_MN(name) zim_##name
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_FN(classname##_##name))
#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name))
#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
@@ -53,11 +53,12 @@ typedef struct _zend_function_entry {
#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags)
#define ZEND_NAMED_ME(zend_name, name, arg_info, flags) ZEND_FENTRY(zend_name, name, arg_info, flags)
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)
#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
#define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
ZEND_FENTRY(name, ZEND_FN(classname##_##alias), arg_info, flags)
#define ZEND_ME_MAPPING(name, func_name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types)
ZEND_FENTRY(name, ZEND_MN(classname##_##alias), arg_info, flags)
#define ZEND_ME_MAPPING(name, func_name, arg_types, flags) ZEND_NAMED_ME(name, ZEND_FN(func_name), arg_types, flags)
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
@@ -77,6 +78,8 @@ typedef struct _zend_function_entry {
#define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module) zm_post_zend_deactivate_##module
#define ZEND_MODULE_INFO_N(module) zm_info_##module
#define ZEND_MODULE_GLOBALS_CTOR_N(module) zm_globals_ctor_##module
#define ZEND_MODULE_GLOBALS_DTOR_N(module) zm_globals_dtor_##module
/* Declaration macros */
#define ZEND_MODULE_STARTUP_D(module) int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS)
@@ -85,6 +88,8 @@ typedef struct _zend_function_entry {
#define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void)
#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
#define ZEND_GET_MODULE(name) \
BEGIN_EXTERN_C()\
@@ -116,8 +121,6 @@ typedef struct _zend_function_entry {
#endif
#define INIT_CLASS_ENTRY(class_container, class_name, functions) INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
@@ -128,21 +131,26 @@ typedef struct _zend_function_entry {
class_container.constructor = NULL; \
class_container.destructor = NULL; \
class_container.clone = NULL; \
class_container.create_object = NULL; \
class_container.serialize = NULL; \
class_container.unserialize = NULL; \
class_container.create_object = NULL; \
class_container.interface_gets_implemented = NULL; \
class_container.__call = handle_fcall; \
class_container.__get = handle_propget; \
class_container.__set = handle_propset; \
class_container.__unset = handle_propunset; \
class_container.__isset = handle_propisset; \
class_container.serialize = NULL; \
class_container.unserialize = NULL; \
class_container.parent = NULL; \
class_container.num_interfaces = 0; \
class_container.interfaces = NULL; \
class_container.get_iterator = NULL; \
class_container.iterator_funcs.funcs = NULL; \
class_container.module = NULL; \
class_container.__call = handle_fcall; \
class_container.__tostring = NULL; \
class_container.__get = handle_propget; \
class_container.__set = handle_propset; \
class_container.__unset = handle_propunset; \
class_container.__isset = handle_propisset; \
class_container.serialize_func = NULL; \
class_container.unserialize_func = NULL; \
class_container.serialize = NULL; \
class_container.unserialize = NULL; \
class_container.parent = NULL; \
class_container.num_interfaces = 0; \
class_container.interfaces = NULL; \
class_container.get_iterator = NULL; \
class_container.iterator_funcs.funcs = NULL; \
class_container.module = NULL; \
}
#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
@@ -253,6 +261,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
ZEND_API char *zend_get_type_by_const(int type);
#define getThis() (this_ptr)
@@ -347,7 +356,7 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
@@ -379,6 +388,26 @@ typedef struct _zend_fcall_info_cache {
BEGIN_EXTERN_C()
ZEND_API extern zend_fcall_info_cache empty_fcall_info_cache;
/** Build zend_call_info/cache from a zval*
*
* Caller is responsible to provide a return value, otherwise the we will crash.
* fci->retval_ptr_ptr = NULL;
* In order to pass parameters the following members need to be set:
* fci->param_count = 0;
* fci->params = NULL;
*/
ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc TSRMLS_DC);
/** Set or clear the arguments in the zend_call_info struct taking care of
* refcount. If args is NULL and arguments are set then those are cleared.
*/
ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
/** Call a function using information created by zend_fcall_info_init()/args().
* If args is given then those replace the arguement info in fci is temporarily.
*/
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
@@ -405,28 +434,28 @@ END_EXTERN_C()
#define CHECK_ZVAL_STRING_REL(z)
#endif
#define ZVAL_RESOURCE(z, l) { \
(z)->type = IS_RESOURCE; \
(z)->value.lval = l; \
#define ZVAL_RESOURCE(z, l) { \
Z_TYPE_P(z) = IS_RESOURCE; \
Z_LVAL_P(z) = l; \
}
#define ZVAL_BOOL(z, b) { \
(z)->type = IS_BOOL; \
(z)->value.lval = ((b) != 0); \
#define ZVAL_BOOL(z, b) { \
Z_TYPE_P(z) = IS_BOOL; \
Z_LVAL_P(z) = ((b) != 0); \
}
#define ZVAL_NULL(z) { \
(z)->type = IS_NULL; \
#define ZVAL_NULL(z) { \
Z_TYPE_P(z) = IS_NULL; \
}
#define ZVAL_LONG(z, l) { \
(z)->type = IS_LONG; \
(z)->value.lval = l; \
#define ZVAL_LONG(z, l) { \
Z_TYPE_P(z) = IS_LONG; \
Z_LVAL_P(z) = l; \
}
#define ZVAL_DOUBLE(z, d) { \
(z)->type = IS_DOUBLE; \
(z)->value.dval = d; \
#define ZVAL_DOUBLE(z, d) { \
Z_TYPE_P(z) = IS_DOUBLE; \
Z_DVAL_P(z) = d; \
}
#define ZVAL_STRING(z, s, duplicate) { \
@@ -576,8 +605,8 @@ END_EXTERN_C()
zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \
}
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
#define ZVAL_IS_NULL(z) (Z_TYPE_P(z)==IS_NULL)
/* For compatibility */
#define ZEND_MINIT ZEND_MODULE_STARTUP_N
@@ -585,15 +614,19 @@ END_EXTERN_C()
#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N
#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
#define ZEND_MINFO ZEND_MODULE_INFO_N
#define ZEND_GINIT(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_CTOR_N(module)))
#define ZEND_GSHUTDOWN(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_DTOR_N(module)))
#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D
#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D
#define ZEND_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D
#define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D
#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D
#define ZEND_GINIT_FUNCTION ZEND_MODULE_GLOBALS_CTOR_D
#define ZEND_GSHUTDOWN_FUNCTION ZEND_MODULE_GLOBALS_DTOR_D
END_EXTERN_C()
#endif /* ZEND_API_H */
+1608 -582
View File
File diff suppressed because it is too large. Load diff
+113 -104
View File
@@ -25,52 +25,16 @@
#include <stdio.h>
#include "../TSRM/TSRM.h"
#include "zend_globals_macros.h"
#include "zend.h"
#include "zend_mm.h"
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
typedef struct _zend_mem_header {
#if ZEND_DEBUG
long magic;
typedef struct _zend_leak_info {
void *addr;
size_t size;
char *filename;
uint lineno;
int reported;
char *orig_filename;
uint orig_lineno;
# ifdef ZTS
THREAD_T thread_id;
# endif
#endif
#if ZEND_DEBUG || !defined(ZEND_MM)
struct _zend_mem_header *pNext;
struct _zend_mem_header *pLast;
#endif
unsigned int size;
} zend_mem_header;
typedef union _align_test {
void *ptr;
double dbl;
long lng;
} align_test;
#define MAX_CACHED_MEMORY 11
#define MAX_CACHED_ENTRIES 256
#define PRE_INIT_CACHE_ENTRIES 32
#if ZEND_GCC_VERSION >= 2000
# define PLATFORM_ALIGNMENT (__alignof__ (align_test))
#else
# define PLATFORM_ALIGNMENT (sizeof(align_test))
#endif
#define MEM_HEADER_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
} zend_leak_info;
BEGIN_EXTERN_C()
@@ -84,28 +48,29 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
#if USE_ZEND_ALLOC
ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
/* Standard wrapper macros */
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
/* Relay wrapper macros */
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
/* Selective persistent/non persistent allocation macros */
#define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size))
@@ -123,51 +88,6 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
#else
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <string.h>
#undef _GNU_SOURCE
/* Standard wrapper macros */
#define emalloc(size) malloc(size)
#define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
#define efree(ptr) free(ptr)
#define ecalloc(nmemb, size) calloc((nmemb), (size))
#define erealloc(ptr, size) realloc((ptr), (size))
#define erealloc_recoverable(ptr, size) realloc((ptr), (size))
#define estrdup(s) strdup(s)
#define estrndup(s, length) zend_strndup((s), (length))
/* Relay wrapper macros */
#define emalloc_rel(size) malloc(size)
#define safe_emalloc_rel(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
#define efree_rel(ptr) free(ptr)
#define ecalloc_rel(nmemb, size) calloc((nmemb), (size))
#define erealloc_rel(ptr, size) realloc((ptr), (size))
#define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size))
#define estrdup_rel(s) strdup(s)
#define estrndup_rel(s, length) zend_strndup((s), (length))
/* Selective persistent/non persistent allocation macros */
#define pemalloc(size, persistent) malloc(size)
#define safe_pemalloc(nmemb, size, offset, persistent) malloc((nmemb) * (size) + (offset))
#define pefree(ptr, persistent) free(ptr)
#define pecalloc(nmemb, size, persistent) calloc((nmemb), (size))
#define perealloc(ptr, size, persistent) realloc((ptr), (size))
#define perealloc_recoverable(ptr, size, persistent) realloc((ptr), (size))
#define pestrdup(s, persistent) strdup(s)
#define pemalloc_rel(size, persistent) malloc(size)
#define pefree_rel(ptr, persistent) free(ptr)
#define pecalloc_rel(nmemb, size, persistent) calloc((nmemb), (size))
#define perealloc_rel(ptr, size, persistent) realloc((ptr), (size))
#define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size))
#define pestrdup_rel(s, persistent) strdup(s)
#endif /* !USE_ZEND_ALLOC */
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
@@ -187,8 +107,97 @@ void zend_debug_alloc_output(char *format, ...);
#define full_mem_check(silent)
#endif
#if MEMORY_LIMIT
ZEND_API size_t zend_memory_usage(TSRMLS_D);
ZEND_API size_t zend_memory_peak_usage(TSRMLS_D);
#endif
END_EXTERN_C()
/* Macroses for zend_fast_cache.h compatibility */
#define ZEND_FAST_ALLOC(p, type, fc_type) \
(p) = (type *) emalloc(sizeof(type))
#define ZEND_FAST_FREE(p, fc_type) \
efree(p)
#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
(p) = (type *) emalloc_rel(sizeof(type))
#define ZEND_FAST_FREE_REL(p, fc_type) \
efree_rel(p)
/* fast cache for zval's */
#define ALLOC_ZVAL(z) \
ZEND_FAST_ALLOC(z, zval, ZVAL_CACHE_LIST)
#define FREE_ZVAL(z) \
ZEND_FAST_FREE(z, ZVAL_CACHE_LIST)
#define ALLOC_ZVAL_REL(z) \
ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST)
#define FREE_ZVAL_REL(z) \
ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST)
/* fast cache for HashTables */
#define ALLOC_HASHTABLE(ht) \
ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST)
#define FREE_HASHTABLE(ht) \
ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST)
#define ALLOC_HASHTABLE_REL(ht) \
ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST)
#define FREE_HASHTABLE_REL(ht) \
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
/* Heap functions */
typedef struct _zend_mm_heap zend_mm_heap;
ZEND_API zend_mm_heap *zend_mm_startup(void);
ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent);
ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
#define zend_mm_alloc(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define zend_mm_free(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define zend_mm_realloc(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define zend_mm_block_size(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define zend_mm_alloc_rel(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mm_free_rel(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mm_realloc_rel(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mm_block_size_rel(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
/* Heaps with user defined storage */
typedef struct _zend_mm_storage zend_mm_storage;
typedef struct _zend_mm_segment {
size_t size;
struct _zend_mm_segment *next_segment;
} zend_mm_segment;
typedef struct _zend_mm_mem_handlers {
const char *name;
zend_mm_storage* (*init)(void *params);
void (*dtor)(zend_mm_storage *storage);
zend_mm_segment* (*_alloc)(zend_mm_storage *storage, size_t size);
zend_mm_segment* (*_realloc)(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size);
void (*_free)(zend_mm_storage *storage, zend_mm_segment *ptr);
} zend_mm_mem_handlers;
struct _zend_mm_storage {
const zend_mm_mem_handlers *handlers;
};
ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, void *params);
ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC);
#endif
/*
-1
View File
@@ -50,4 +50,3 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
ZEND_END_ARG_INFO();
+74 -50
View File
@@ -276,7 +276,7 @@ ZEND_FUNCTION(func_get_args)
ZEND_NAMED_FUNCTION(zend_if_strlen)
{
zval **str;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -374,7 +374,7 @@ ZEND_FUNCTION(each)
ulong num_key;
zval **inserted_pointer;
HashTable *target_hash;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -452,10 +452,10 @@ ZEND_FUNCTION(error_reporting)
Define a new constant */
ZEND_FUNCTION(define)
{
zval **var, **val, **non_cs;
zval **var, **val, **non_cs, *val_free = NULL;
int case_sensitive;
zend_constant c;
switch (ZEND_NUM_ARGS()) {
case 2:
if (zend_get_parameters_ex(2, &var, &val)==FAILURE) {
@@ -468,7 +468,7 @@ ZEND_FUNCTION(define)
RETURN_FALSE;
}
convert_to_long_ex(non_cs);
if ((*non_cs)->value.lval) {
if (Z_LVAL_PP(non_cs)) {
case_sensitive = 0;
} else {
case_sensitive = CONST_CS;
@@ -479,7 +479,8 @@ ZEND_FUNCTION(define)
break;
}
switch ((*val)->type) {
repeat:
switch (Z_TYPE_PP(val)) {
case IS_LONG:
case IS_DOUBLE:
case IS_STRING:
@@ -487,15 +488,34 @@ ZEND_FUNCTION(define)
case IS_RESOURCE:
case IS_NULL:
break;
case IS_OBJECT:
if (!val_free) {
if (Z_OBJ_HT_PP(val)->get) {
val_free = *val = Z_OBJ_HT_PP(val)->get(*val TSRMLS_CC);
goto repeat;
} else if (Z_OBJ_HT_PP(val)->cast_object) {
ALLOC_INIT_ZVAL(val_free);
if (Z_OBJ_HT_PP(val)->cast_object(*val, val_free, IS_STRING TSRMLS_CC) == SUCCESS) {
val = &val_free;
break;
}
}
}
/* no break */
default:
zend_error(E_WARNING,"Constants may only evaluate to scalar values");
if (val_free) {
zval_ptr_dtor(&val_free);
}
RETURN_FALSE;
break;
}
convert_to_string_ex(var);
c.value = **val;
zval_copy_ctor(&c.value);
if (val_free) {
zval_ptr_dtor(&val_free);
}
c.flags = case_sensitive; /* non persistent */
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
c.name_len = (*var)->value.str.len+1;
@@ -515,7 +535,7 @@ ZEND_FUNCTION(defined)
{
zval **var;
zval c;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -539,12 +559,13 @@ ZEND_FUNCTION(get_class)
char *name = "";
zend_uint name_len = 0;
int dup;
if (!ZEND_NUM_ARGS()) {
if (EG(scope)) {
RETURN_STRINGL(EG(scope)->name, EG(scope)->name_length, 1);
} else {
zend_error(E_ERROR, "get_class() called without object from outside a class");
zend_error(E_WARNING, "get_class() called without object from outside a class");
RETURN_FALSE;
}
}
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
@@ -623,13 +644,13 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
zend_error(E_WARNING, "Unknown class passed as parameter");
RETURN_FALSE;
}
instance_ce = *the_ce;
instance_ce = *the_ce;
} else if (Z_TYPE_PP(obj) != IS_OBJECT) {
RETURN_FALSE;
} else {
instance_ce = NULL;
}
/* TBI!! new object handlers */
if (Z_TYPE_PP(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(**obj)) {
RETURN_FALSE;
@@ -702,7 +723,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos);
zend_hash_move_forward_ex(properties, &pos);
zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (class_name) {
if (class_name[0] != '*' && strcmp(class_name, ce->name)) {
/* filter privates from base classes */
@@ -724,7 +745,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
}
add_assoc_zval(return_value, prop_name, prop_copy);
}
}
@@ -773,7 +794,7 @@ ZEND_FUNCTION(get_object_vars)
ZEND_WRONG_PARAM_COUNT();
}
if ((*obj)->type != IS_OBJECT) {
if (Z_TYPE_PP(obj) != IS_OBJECT) {
RETURN_FALSE;
}
if (Z_OBJ_HT_PP(obj)->get_properties == NULL) {
@@ -799,7 +820,7 @@ ZEND_FUNCTION(get_object_vars)
(*value)->refcount++;
add_assoc_zval_ex(return_value, key, key_len, *value);
} else if (instanceof) {
zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) {
/* Not separating references */
(*value)->refcount++;
@@ -870,7 +891,7 @@ ZEND_FUNCTION(method_exists)
zval **klass, **method_name;
char *lcname;
zend_class_entry * ce, **pce;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -948,7 +969,7 @@ ZEND_FUNCTION(property_exists)
if (property_info->flags & ZEND_ACC_PUBLIC) {
RETURN_TRUE;
}
zend_unmangle_property_name_ex(property_info->name, property_info->name_length, &class_name, &prop_name);
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
if (!strncmp(class_name, "*", 1)) {
if (instanceof_function(EG(scope), ce TSRMLS_CC)) {
RETURN_TRUE;
@@ -961,8 +982,7 @@ ZEND_FUNCTION(property_exists)
RETURN_FALSE; /* shouldn't happen */
}
RETURN_BOOL(EG(scope) == ce);
RETURN_FALSE;
case IS_OBJECT:
if (Z_OBJ_HANDLER_PP(object, has_property) && Z_OBJ_HANDLER_PP(object, has_property)(*object, *property, 2 TSRMLS_CC)) {
RETURN_TRUE;
@@ -1086,7 +1106,7 @@ ZEND_FUNCTION(leak)
leakbytes = (*leak)->value.lval;
}
}
emalloc(leakbytes);
}
/* }}} */
@@ -1170,7 +1190,7 @@ ZEND_FUNCTION(set_error_handler)
zend_bool had_orig_error_handler=0;
char *error_handler_name = NULL;
long error_type = E_ALL | E_STRICT;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
return;
}
@@ -1333,7 +1353,7 @@ ZEND_FUNCTION(get_declared_interfaces)
{
zend_uint mask = ZEND_ACC_INTERFACE;
zend_uint comply = 1;
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -1358,7 +1378,7 @@ static int copy_function_name(zend_function *func, int num_args, va_list args, z
} else if (func->type == ZEND_USER_FUNCTION) {
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1);
}
return 0;
}
@@ -1369,26 +1389,26 @@ ZEND_FUNCTION(get_defined_functions)
{
zval *internal;
zval *user;
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
MAKE_STD_ZVAL(internal);
MAKE_STD_ZVAL(user);
array_init(internal);
array_init(user);
array_init(return_value);
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user);
if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
RETURN_FALSE;
}
if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
if (zend_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
RETURN_FALSE;
}
@@ -1399,12 +1419,12 @@ ZEND_FUNCTION(get_defined_functions)
/* {{{ proto array get_defined_vars(void)
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
ZEND_FUNCTION(get_defined_vars)
{
{
zval *tmp;
array_init(return_value);
zend_hash_copy(return_value->value.ht, EG(active_symbol_table),
zend_hash_copy(Z_ARRVAL_P(return_value), EG(active_symbol_table),
(copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *));
}
/* }}} */
@@ -1568,7 +1588,7 @@ ZEND_FUNCTION(get_defined_constants)
modules = ecalloc(zend_hash_num_elements(&module_registry) + 2, sizeof(zval *));
module_names = emalloc((zend_hash_num_elements(&module_registry) + 2) * sizeof(char *));
module_names[0] = "internal";
zend_hash_internal_pointer_reset_ex(&module_registry, &pos);
while (zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) != FAILURE) {
@@ -1620,7 +1640,7 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
zval *arg_array, **arg;
int arg_count = (ulong) *p;
*curpos -= (arg_count+2);
*curpos -= (arg_count+2);
MAKE_STD_ZVAL(arg_array);
array_init(arg_array);
@@ -1628,9 +1648,13 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
while (--arg_count >= 0) {
arg = (zval **) p++;
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
(*arg)->refcount++;
add_next_index_zval(arg_array, *arg);
if (*arg) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
(*arg)->refcount++;
add_next_index_zval(arg_array, *arg);
} else {
add_next_index_null(arg_array);
}
}
/* skip args from incomplete frames */
@@ -1717,7 +1741,7 @@ ZEND_FUNCTION(debug_print_backtrace)
arg_array = NULL;
skip = ptr;
/* skip internal handler */
/* skip internal handler */
if (!skip->op_array &&
skip->prev_execute_data &&
skip->prev_execute_data->opline &&
@@ -1744,7 +1768,7 @@ ZEND_FUNCTION(debug_print_backtrace)
} else {
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
if(!dup) {
free_class_name = class_name;
@@ -1764,7 +1788,7 @@ ZEND_FUNCTION(debug_print_backtrace)
arg_array = debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC);
frames_on_stack--;
}
}
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
@@ -1774,7 +1798,7 @@ ZEND_FUNCTION(debug_print_backtrace)
function_name = "unknown";
build_filename_arg = 0;
} else
switch (ptr->opline->op2.u.constant.value.lval) {
switch (Z_LVAL(ptr->opline->op2.u.constant)) {
case ZEND_EVAL:
function_name = "eval";
build_filename_arg = 0;
@@ -1927,7 +1951,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
} else {
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
@@ -1948,7 +1972,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC));
frames_on_stack--;
}
}
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
@@ -1988,7 +2012,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
MAKE_STD_ZVAL(arg_array);
array_init(arg_array);
/* include_filename always points to the last filename of the last last called-fuction.
if we have called include in the frame above - this is the file we have included.
*/
@@ -2017,7 +2041,7 @@ ZEND_FUNCTION(debug_backtrace)
if (ZEND_NUM_ARGS()) {
ZEND_WRONG_PARAM_COUNT();
}
zend_fetch_debug_backtrace(return_value, 1, 1 TSRMLS_CC);
}
/* }}} */
@@ -2066,7 +2090,7 @@ ZEND_FUNCTION(get_extension_funcs)
RETURN_FALSE;
}
efree(lcname);
if (!(func = module->functions)) {
RETURN_FALSE;
}
+197 -144
View File
@@ -25,13 +25,13 @@
#include "zend_constants.h"
#include "zend_llist.h"
#include "zend_API.h"
#include "zend_fast_cache.h"
#ifdef ZEND_MULTIBYTE
#include "zend_multibyte.h"
#endif /* ZEND_MULTIBYTE */
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
#ifndef ZTS
@@ -104,7 +104,7 @@ int zend_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC)
}
int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
{
zend_auto_global *auto_global;
@@ -118,8 +118,8 @@ int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_
static void init_compiler_declarables(TSRMLS_D)
{
CG(declarables).ticks.type = IS_LONG;
CG(declarables).ticks.value.lval = 0;
Z_TYPE(CG(declarables).ticks) = IS_LONG;
Z_LVAL(CG(declarables).ticks) = 0;
}
@@ -154,6 +154,7 @@ void zend_init_compiler_data_structures(TSRMLS_D)
void init_compiler(TSRMLS_D)
{
CG(active_op_array) = NULL;
zend_init_compiler_data_structures(TSRMLS_C);
zend_init_rsrc_list(TSRMLS_C);
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
@@ -244,7 +245,7 @@ static int lookup_cv(zend_op_array *op_array, char* name, int name_len)
i = op_array->last_var;
op_array->last_var++;
if (op_array->last_var > op_array->size_var) {
op_array->size_var += 16; /* FIXME */
op_array->size_var += 16; /* FIXME */
op_array->vars = erealloc(op_array->vars, op_array->size_var*sizeof(zend_compiled_variable));
}
op_array->vars[i].name = name; /* estrndup(name, name_len); */
@@ -296,7 +297,7 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *o
if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
switch (last_op->opcode) {
case ZEND_FETCH_OBJ_RW:
last_op->opcode = op;
@@ -499,7 +500,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
char *method_type;
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
modifiers->u.constant.value.lval |= ZEND_ACC_ABSTRACT;
Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
method_type = "Interface";
} else {
method_type = "Abstract";
@@ -509,7 +510,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
}
if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RAISE_ABSTRACT_ERROR;
@@ -548,8 +549,8 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
while (last_op_number - n > 0) {
zend_op *last_op;
last_op = &CG(active_op_array)->opcodes[last_op_number-(n+1)];
last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
if (last_op->result.op_type == IS_VAR &&
last_op->result.u.var == variable->u.var) {
@@ -622,7 +623,7 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@@ -684,7 +685,7 @@ void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
opline->op1.u.opline_num = while_token->u.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
/* update while's conditional jmp */
CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
@@ -823,7 +824,7 @@ void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char init
}
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
@@ -877,7 +878,7 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
le = fetch_list_ptr->head;
/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */
if (le) {
opline_ptr = (zend_op *)le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
@@ -978,7 +979,7 @@ void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC)
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
if (op1->u.constant.value.str.len>0) {
if (Z_STRLEN(op1->u.constant)>0) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_STRING;
opline->result = *result;
@@ -1039,21 +1040,21 @@ void zend_do_free(znode *op1 TSRMLS_DC)
}
} else if (op1->op_type == IS_CONST) {
zval_dtor(&op1->u.constant);
}
}
}
int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier)
{
if ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK)
&& (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK)
&& ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) != (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK))) {
if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK)
&& (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)
&& ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) != (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK))) {
zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
}
if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
}
return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval);
return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant));
}
@@ -1068,15 +1069,18 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (is_method) {
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
if ((fn_flags_znode->u.constant.value.lval & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
}
fn_flags_znode->u.constant.value.lval |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
}
fn_flags = fn_flags_znode->u.constant.value.lval; /* must be done *after* the above check */
fn_flags = Z_LVAL(fn_flags_znode->u.constant); /* must be done *after* the above check */
} else {
fn_flags = 0;
}
if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT) && !(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error(E_COMPILE_ERROR, "Static function %s%s%s() cannot be abstract", is_method ? CG(active_class_entry)->name : "", is_method ? "::" : "", Z_STRVAL(function_name->u.constant));
}
function_token->u.op_array = CG(active_op_array);
lcname = zend_str_tolower_dup(name, name_len);
@@ -1148,6 +1152,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
CG(active_class_entry)->__unset = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)))) {
CG(active_class_entry)->__isset = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)))) {
CG(active_class_entry)->__tostring = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
@@ -1178,11 +1184,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
{
/* Push a seperator to the switch and foreach stacks */
zend_switch_entry switch_entry;
switch_entry.cond.op_type = IS_UNUSED;
switch_entry.default_case = 0;
switch_entry.control_var = 0;
@@ -1324,18 +1330,18 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC)
switch (function->type) {
case ZEND_USER_FUNCTION: {
zend_op_array *op_array = (zend_op_array *) function;
zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *));
}
break;
case ZEND_INTERNAL_FUNCTION: {
zend_internal_function *internal_function = (zend_internal_function *) function;
zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *));
}
break;
}
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
return 0;
}
@@ -1349,7 +1355,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
@@ -1360,7 +1366,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
last_op->opcode = ZEND_INIT_METHOD_CALL;
left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME;
Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
@@ -1370,9 +1376,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
}
void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
{
@@ -1400,7 +1406,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC)
SET_UNUSED(opline->op1);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
}
@@ -1486,13 +1492,13 @@ void zend_do_begin_class_member_function_call(znode *class_name, znode *method_n
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
{
zend_op *opline;
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
if (argument_list->u.constant.value.lval != 0) {
if (Z_LVAL(argument_list->u.constant) != 0) {
zend_error(E_WARNING, "Clone method does not require arguments");
}
opline = &CG(active_op_array)->opcodes[function_name->u.constant.value.lval];
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
} else {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
@@ -1503,14 +1509,14 @@ void zend_do_end_function_call(znode *function_name, znode *result, znode *argum
SET_UNUSED(opline->op1);
}
}
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
*result = opline->result;
SET_UNUSED(opline->op2);
zend_stack_del_top(&CG(function_call_stack));
opline->extended_value = argument_list->u.constant.value.lval;
opline->extended_value = Z_LVAL(argument_list->u.constant);
}
@@ -1521,7 +1527,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
int send_function = 0;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
@@ -1541,7 +1547,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
send_by_reference = 0;
} else {
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
}
} else {
send_by_reference = 0;
@@ -1611,11 +1617,11 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
{
zend_op *opline;
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
return (switch_entry->cond.op_type == IS_UNUSED);
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
@@ -1632,7 +1638,7 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
/* If we reach the seperator then stop applying the stack */
if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
return 1;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -1649,14 +1655,14 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
SET_UNUSED(opline->op2);
opline->extended_value = 0;
}
return 0;
}
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
{
zend_op *opline;
if (do_end_vparse) {
if (CG(active_op_array)->return_reference && !zend_is_function_or_method_call(expr)) {
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
@@ -1676,7 +1682,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RETURN;
if (expr) {
opline->op1 = *expr;
} else {
@@ -1686,7 +1692,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
if (do_end_vparse) {
if (zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@@ -1745,7 +1751,7 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var,
{
long catch_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
if (catch_op_number > 0) {
opline = &CG(active_op_array)->opcodes[catch_op_number-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
@@ -1771,7 +1777,7 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC)
void zend_do_throw(znode *expr TSRMLS_DC)
{
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_THROW;
opline->op1 = *expr;
@@ -1828,6 +1834,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
if (!ce->__call) {
ce->__call = ce->parent->__call;
}
if (!ce->__tostring) {
ce->__tostring = ce->parent->__tostring;
}
if (!ce->clone) {
ce->clone = ce->parent->clone;
}
@@ -1849,7 +1858,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
}
return;
}
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
@@ -1911,8 +1920,8 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
return 1;
}
/* No implementation checks for constructors */
if (fe->common.fn_flags & ZEND_ACC_CTOR) {
/* Checks for constructors only if they are declared in an interface */
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
return 1;
}
@@ -2010,7 +2019,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
*/
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
child->common.fn_flags |= ZEND_ACC_CHANGED;
}
@@ -2019,12 +2028,12 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
if (parent_flags & ZEND_ACC_ABSTRACT) {
child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
child->common.prototype = parent;
} else {
child->common.prototype = parent->common.prototype;
} else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
/* ctors only have a prototype if it comes from an interface */
child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
}
if (child->common.prototype) {
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
}
@@ -2066,11 +2075,11 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
}
if(parent_info->flags & ZEND_ACC_CHANGED) {
child_info->flags |= ZEND_ACC_CHANGED;
}
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
@@ -2107,7 +2116,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if (zend_hash_find(&ce->default_static_members, child_info->name, child_info->name_length+1, (void**)&new_prop) == SUCCESS) {
if (Z_TYPE_PP(new_prop) != IS_NULL && Z_TYPE_PP(prop) != IS_NULL) {
char *prop_name, *tmp;
zend_unmangle_property_name_ex(child_info->name, child_info->name_length, &tmp, &prop_name);
zend_unmangle_property_name(child_info->name, child_info->name_length, &tmp, &prop_name);
zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %s::$%s in class %s",
parent_ce->name, prop_name, ce->name);
@@ -2213,8 +2222,12 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
do_inherit_parent_constructor(ce);
zend_verify_abstract_class(ce TSRMLS_CC);
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
} else {
zend_verify_abstract_class(ce TSRMLS_CC);
}
}
@@ -2226,7 +2239,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
if (*old_constant != *parent_constant) {
zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name);
}
return 0;
return 0;
}
return 1;
}
@@ -2234,11 +2247,38 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC)
{
zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
zend_uint i, ignore = 0;
zend_uint current_iface_num = ce->num_interfaces;
zend_uint parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
do_implement_interface(ce, iface TSRMLS_CC);
zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
for (i = 0; i < ce->num_interfaces; i++) {
if (ce->interfaces[i] == NULL) {
memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
i--;
} else if (ce->interfaces[i] == iface) {
if (i < parent_iface_num) {
ignore = 1;
} else {
zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name);
}
}
}
if (!ignore) {
if (ce->num_interfaces >= current_iface_num) {
if (ce->type == ZEND_INTERNAL_CLASS) {
ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
} else {
ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
}
}
ce->interfaces[ce->num_interfaces++] = iface;
zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
do_implement_interface(ce, iface TSRMLS_CC);
zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
}
}
@@ -2272,7 +2312,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
return SUCCESS;
}
}
ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
{
@@ -2293,7 +2333,7 @@ ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
}
return NULL;
} else {
@@ -2336,7 +2376,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
/* Register the derived class */
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
ce->refcount--;
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->default_properties);
@@ -2451,7 +2491,7 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@@ -2486,7 +2526,7 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@@ -2539,8 +2579,8 @@ void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC)
if (expr) {
opline->op2 = *expr;
} else {
opline->op2.u.constant.type = IS_LONG;
opline->op2.u.constant.value.lval = 1;
Z_TYPE(opline->op2.u.constant) = IS_LONG;
Z_LVAL(opline->op2.u.constant) = 1;
INIT_PZVAL(&opline->op2.u.constant);
opline->op2.op_type = IS_CONST;
}
@@ -2567,7 +2607,7 @@ void zend_do_switch_end(znode *case_list TSRMLS_DC)
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
/* add code to jmp to default case */
@@ -2627,7 +2667,7 @@ void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *c
zval_copy_ctor(&opline->op1.u.constant);
}
result = opline->result;
next_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@@ -2735,7 +2775,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
opline->op2.op_type = IS_CONST;
opline->op2.u.constant.type = IS_STRING;
opline->op2.u.constant.refcount = 1;
if (doing_inheritance) {
opline->extended_value = parent_class_name->u.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
@@ -2799,11 +2839,6 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);
/* Inherit interfaces */
if (ce->num_interfaces > 0) {
ce->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *)*ce->num_interfaces);
memset(ce->interfaces, 0, sizeof(zend_class_entry *)*ce->num_interfaces);
}
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
zend_verify_abstract_class(ce TSRMLS_CC);
@@ -2811,6 +2846,12 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
do_verify_abstract_class(TSRMLS_C);
}
}
/* Inherit interfaces; reset number to zero, we need it for above check and
* will restore it during actual implementation. */
if (ce->num_interfaces > 0) {
ce->interfaces = NULL;
ce->num_interfaces = 0;
}
CG(active_class_entry) = NULL;
}
@@ -2835,7 +2876,7 @@ void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
}
break;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
opline->op1 = CG(implementing_class);
@@ -2848,7 +2889,7 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
{
char *prop_name;
int prop_name_length;
prop_name_length = 1 + src1_length + 1 + src2_length;
prop_name = pemalloc(prop_name_length + 1, internal);
prop_name[0] = '\0';
@@ -2860,29 +2901,38 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
}
ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **class_name, char **prop_name)
static int zend_strnlen(const char* s, int maxlen)
{
*prop_name = *class_name = NULL;
if (mangled_property_len < 2) { /* do not try to unmangle empty strings */
*prop_name = mangled_property;
return;
}
zend_unmangle_property_name(mangled_property, class_name, prop_name);
int len = 0;
while (*s++ && maxlen--) len++;
return len;
}
ZEND_API void zend_unmangle_property_name(char *mangled_property, char **class_name, char **prop_name)
ZEND_API int zend_unmangle_property_name(char *mangled_property, int len, char **class_name, char **prop_name)
{
*prop_name = *class_name = NULL;
int class_name_len;
*class_name = NULL;
if (mangled_property[0]!=0) {
*prop_name = mangled_property;
return;
return SUCCESS;
}
if (len < 3) {
zend_error(E_NOTICE, "Illegal member variable name");
*prop_name = mangled_property;
return FAILURE;
}
class_name_len = zend_strnlen(mangled_property+1, --len - 1) + 1;
if (class_name_len >= len || mangled_property[class_name_len]!=0) {
zend_error(E_NOTICE, "Corrupt member variable name");
*prop_name = mangled_property;
return FAILURE;
}
*class_name = mangled_property+1;
*prop_name = (*class_name)+strlen(*class_name)+1;
*prop_name = (*class_name)+class_name_len;
return SUCCESS;
}
void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC)
@@ -2916,7 +2966,7 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
*property = value->u.constant;
} else {
INIT_PZVAL(property);
property->type = IS_NULL;
Z_TYPE_P(property) = IS_NULL;
}
if (CG(doc_comment)) {
@@ -2934,11 +2984,11 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
{
zval *property;
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
}
ALLOC_ZVAL(property);
*property = value->u.constant;
@@ -2956,9 +3006,9 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
zend_op opline;
zend_llist *fetch_list_ptr;
zend_op *opline_ptr=NULL;
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
if (fetch_list_ptr->count == 1) {
zend_llist_element *le;
@@ -2966,7 +3016,7 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
opline_ptr = (zend_op *) le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
efree(opline_ptr->op1.u.constant.value.str.val);
efree(Z_STRVAL(opline_ptr->op1.u.constant));
SET_UNUSED(opline_ptr->op1); /* this means $this for objects */
opline_ptr->op2 = *property;
/* if it was usual fetch, we change it to object fetch */
@@ -3065,7 +3115,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
{
zend_op *opline;
unsigned char *ptr = NULL;
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_NEW;
@@ -3073,7 +3123,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *class_type;
SET_UNUSED(opline->op2);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
}
@@ -3133,7 +3183,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
if (constant_container ||
!zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CONSTANT;
opline->result.op_type = IS_TMP_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
@@ -3172,10 +3222,10 @@ void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC)
opline->opcode = ZEND_DO_FCALL;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
opline->op1.u.constant.value.str.val = estrndup("shell_exec", sizeof("shell_exec")-1);
opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1;
Z_STRVAL(opline->op1.u.constant) = estrndup("shell_exec", sizeof("shell_exec")-1);
Z_STRLEN(opline->op1.u.constant) = sizeof("shell_exec")-1;
INIT_PZVAL(&opline->op1.u.constant);
opline->op1.u.constant.type = IS_STRING;
Z_TYPE(opline->op1.u.constant) = IS_STRING;
opline->op1.op_type = IS_CONST;
opline->extended_value = 1;
SET_UNUSED(opline->op2);
@@ -3234,28 +3284,28 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
switch (offset->u.constant.type) {
case IS_CONSTANT:
/* Ugly hack to denote that this value has a constant index */
element->type |= IS_CONSTANT_INDEX;
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
/* break missing intentionally */
case IS_STRING:
zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
break;
case IS_NULL:
zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL);
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL);
case IS_BOOL:
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL);
zend_hash_index_update(Z_ARRVAL(result->u.constant), (long)Z_DVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_CONSTANT_ARRAY:
zend_error(E_ERROR, "Illegal offset type");
break;
}
} else {
zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);
zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
}
}
@@ -3337,8 +3387,8 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = last_container;
opline->op2.op_type = IS_CONST;
opline->op2.u.constant.type = IS_LONG;
opline->op2.u.constant.value.lval = *((int *) dimension->data);
Z_TYPE(opline->op2.u.constant) = IS_LONG;
Z_LVAL(opline->op2.u.constant) = *((int *) dimension->data);
INIT_PZVAL(&opline->op2.u.constant);
opline->extended_value = ZEND_FETCH_ADD_LOCK;
last_container = opline->result;
@@ -3461,7 +3511,7 @@ void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *op1;
SET_UNUSED(opline->op2);
opline->op2.u.constant.value.lval = type;
Z_LVAL(opline->op2.u.constant) = type;
*result = opline->result;
}
zend_do_extended_fcall_end(TSRMLS_C);
@@ -3513,7 +3563,7 @@ void zend_do_unset(znode *variable TSRMLS_DC)
break;
}
}
}
}
@@ -3524,7 +3574,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC);
zend_check_writable_variable(variable);
if (variable->op_type == IS_CV) {
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@@ -3537,7 +3587,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
switch (last_op->opcode) {
case ZEND_FETCH_IS:
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@@ -3617,7 +3667,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *array;
SET_UNUSED(opline->op2);
opline->extended_value = is_variable;
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
*open_brackets_token = opline->result;
{
@@ -3640,7 +3690,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
{
zend_op *opline;
/* save the location of FE_FETCH */
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
@@ -3690,11 +3740,13 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
}
/* Mark extended_value for assign-by-reference */
opline->extended_value |= ZEND_FE_FETCH_BYREF;
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
}
value_node = opline->result;
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
if (assign_by_ref) {
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
if (assign_by_ref) {
/* Mark FE_FETCH as IS_VAR as it holds the data directly as a value */
zend_do_assign_ref(NULL, value, &value_node TSRMLS_CC);
} else {
@@ -3705,8 +3757,8 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
if (key->op_type != IS_UNUSED) {
znode key_node;
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
opline->result.op_type = IS_TMP_VAR;
opline->result.u.EA.type = 0;
opline->result.u.opline_num = get_temporary_variable(CG(active_op_array));
@@ -3760,7 +3812,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
zend_encoding *new_encoding, *old_encoding;
zend_encoding_filter old_input_filter;
if (val->u.constant.type == IS_CONSTANT) {
if (Z_TYPE(val->u.constant) == IS_CONSTANT) {
zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
}
convert_to_string(&val->u.constant);
@@ -3794,7 +3846,7 @@ void zend_do_declare_end(znode *declare_token TSRMLS_DC)
zend_stack_top(&CG(declare_stack), (void **) &declarables);
/* We should restore if there was more than (current - start) - (ticks?1:0) opcodes */
if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((CG(declarables).ticks.value.lval)?1:0)) {
if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) {
CG(declarables) = *declarables;
}
}
@@ -3827,8 +3879,8 @@ void zend_do_exit(znode *result, znode *message TSRMLS_DC)
SET_UNUSED(opline->op2);
result->op_type = IS_CONST;
result->u.constant.type = IS_BOOL;
result->u.constant.value.lval = 1;
Z_TYPE(result->u.constant) = IS_BOOL;
Z_LVAL(result->u.constant) = 1;
}
void zend_do_begin_silence(znode *strudel_token TSRMLS_DC)
@@ -3858,7 +3910,7 @@ void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@@ -3901,7 +3953,7 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
opline->result = *qm_token;
opline->op1 = *false_value;
SET_UNUSED(opline->op2);
CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
*result = opline->result;
@@ -3913,11 +3965,11 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
void zend_do_extended_info(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_STMT;
@@ -3929,11 +3981,11 @@ void zend_do_extended_info(TSRMLS_D)
void zend_do_extended_fcall_begin(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_BEGIN;
@@ -3945,11 +3997,11 @@ void zend_do_extended_fcall_begin(TSRMLS_D)
void zend_do_extended_fcall_end(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_END;
@@ -3960,7 +4012,7 @@ void zend_do_extended_fcall_end(TSRMLS_D)
void zend_do_ticks(TSRMLS_D)
{
if (CG(declarables).ticks.value.lval) {
if (Z_LVAL(CG(declarables).ticks)) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_TICKS;
@@ -4012,7 +4064,7 @@ again:
CG(increment_lineno) = 0;
}
zendlval->u.constant.type = IS_LONG;
Z_TYPE(zendlval->u.constant) = IS_LONG;
retval = lex_scan(&zendlval->u.constant TSRMLS_CC);
switch (retval) {
case T_COMMENT:
@@ -4032,12 +4084,12 @@ again:
retval = T_ECHO;
break;
case T_END_HEREDOC:
efree(zendlval->u.constant.value.str.val);
efree(Z_STRVAL(zendlval->u.constant));
break;
case EOF:
return EOF;
}
INIT_PZVAL(&zendlval->u.constant);
zendlval->op_type = IS_CONST;
return retval;
@@ -4089,6 +4141,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->__unset = NULL;
ce->__isset = NULL;
ce->__call = NULL;
ce->__tostring = NULL;
ce->create_object = NULL;
ce->get_iterator = NULL;
ce->iterator_funcs.funcs = NULL;
+15 -9
View File
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@@ -149,6 +149,7 @@ typedef struct _zend_property_info {
ulong h;
char *doc_comment;
int doc_comment_len;
zend_class_entry *ce;
} zend_property_info;
@@ -226,9 +227,9 @@ struct _zend_op_array {
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
char *function_name;
char * function_name;
zend_class_entry *scope;
zend_uint fn_flags;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
@@ -238,6 +239,7 @@ typedef struct _zend_internal_function {
/* END of common elements */
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
struct _zend_module_entry *module;
} zend_internal_function;
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : "")
@@ -257,7 +259,7 @@ typedef union _zend_function {
zend_bool pass_rest_by_reference;
unsigned char return_reference;
} common;
zend_op_array op_array;
zend_internal_function internal_function;
} zend_function;
@@ -319,6 +321,7 @@ void shutdown_compiler(TSRMLS_D);
void zend_init_compiler_data_structures(TSRMLS_D);
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
void startup_scanner(TSRMLS_D);
@@ -507,7 +510,7 @@ ZEND_API void function_add_ref(zend_function *function);
/* helper functions in zend_language_scanner.l */
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
@@ -525,8 +528,7 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce);
void zend_class_add_ref(zend_class_entry **ce);
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal);
ZEND_API void zend_unmangle_property_name(char *mangled_property, char **prop_name, char **class_name);
ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
ZEND_API int zend_unmangle_property_name(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
@@ -647,6 +649,9 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_FE_FETCH_BYREF 1
#define ZEND_FE_FETCH_WITH_KEY 2
#define ZEND_FE_RESET_VARIABLE 1
#define ZEND_FE_RESET_REFERENCE 2
#define ZEND_MEMBER_FUNC_CALL 1<<0
#define ZEND_ARG_SEND_BY_REF (1<<0)
@@ -705,9 +710,10 @@ END_EXTERN_C()
#define ZEND_DESTRUCTOR_FUNC_NAME "__destruct"
#define ZEND_GET_FUNC_NAME "__get"
#define ZEND_SET_FUNC_NAME "__set"
#define ZEND_UNSET_FUNC_NAME "__unset"
#define ZEND_ISSET_FUNC_NAME "__isset"
#define ZEND_UNSET_FUNC_NAME "__unset"
#define ZEND_ISSET_FUNC_NAME "__isset"
#define ZEND_CALL_FUNC_NAME "__call"
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
#endif /* ZEND_COMPILE_H */
-2
View File
@@ -22,8 +22,6 @@
#ifndef ZEND_CONFIG_W32_H
#define ZEND_CONFIG_W32_H
#define USE_ZEND_ALLOC 1
#include <../main/config.w32.h>
#define _CRTDBG_MAP_ALLOC
+1
View File
@@ -96,6 +96,7 @@ int zend_startup_constants(TSRMLS_D)
void zend_register_standard_constants(TSRMLS_D)
{
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
+2 -1
View File
@@ -34,8 +34,9 @@
#define E_USER_WARNING (1<<9L)
#define E_USER_NOTICE (1<<10L)
#define E_STRICT (1<<11L)
#define E_RECOVERABLE_ERROR (1<<12L)
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
#endif /* ZEND_ERRORS_H */
+23 -23
View File
@@ -81,8 +81,8 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
zend_object *object;
zval *trace;
obj.value.obj = zend_objects_new(&object, class_type TSRMLS_CC);
obj.value.obj.handlers = &default_exception_handlers;
Z_OBJVAL(obj) = zend_objects_new(&object, class_type TSRMLS_CC);
Z_OBJ_HT(obj) = &default_exception_handlers;
ALLOC_HASHTABLE(object->properties);
zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
@@ -97,7 +97,7 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
return obj.value.obj;
return Z_OBJVAL(obj);
}
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
@@ -171,7 +171,7 @@ ZEND_METHOD(error_exception, __construct)
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
if (argc >= 4) {
zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename TSRMLS_CC);
if (argc < 5) {
@@ -271,7 +271,7 @@ ZEND_METHOD(error_exception, getSeverity)
#define TRACE_APPEND_STRL(val, vallen) \
{ \
int l = vallen; \
int l = vallen; \
*str = (char*)erealloc(*str, *len + l + 1); \
memcpy((*str) + *len, val, l); \
*len += l; \
@@ -372,7 +372,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
if(!dup) {
efree(class_name);
}
TRACE_APPEND_STR("), ");
break;
}
@@ -434,7 +434,7 @@ ZEND_METHOD(exception, getTraceAsString)
zval *trace;
char *res = estrdup(""), **str = &res, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
@@ -448,12 +448,12 @@ ZEND_METHOD(exception, getTraceAsString)
}
/* }}} */
static int zend_spprintf(char **message, int max_len, char *format, ...)
int zend_spprintf(char **message, int max_len, char *format, ...)
{
va_list arg;
int len;
va_start(arg, format);
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
@@ -524,15 +524,15 @@ ZEND_METHOD(exception, __toString)
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
* such exceptions in that handler.
* such exceptions in that handler.
* Also all getXY() methods are final because thy serve as read only access to
* their corresponding properties, no more, no less. If after all you need to
* their corresponding properties, no more, no less. If after all you need to
* override somthing then it is method __toString().
* And never try to change the state of exceptions and never implement anything
* that gives the user anything to accomplish this.
*/
static
ZEND_BEGIN_ARG_INFO(arginfo_exception___construct, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, message)
ZEND_ARG_INFO(0, code)
ZEND_END_ARG_INFO();
@@ -551,7 +551,7 @@ static zend_function_entry default_exception_functions[] = {
};
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 3)
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, message)
ZEND_ARG_INFO(0, code)
ZEND_ARG_INFO(0, severity)
@@ -571,7 +571,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
default_exception_ce->create_object = zend_default_exception_new;
default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
@@ -584,16 +584,16 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
error_exception_ce->create_object = zend_error_exception_new;
error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
ZEND_API zend_class_entry *zend_exception_get_default(void)
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D)
{
return default_exception_ce;
}
ZEND_API zend_class_entry *zend_get_error_exception(void)
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D)
{
return error_exception_ce;
}
@@ -613,7 +613,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
if (message) {
zend_update_property_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
@@ -633,7 +633,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
char *message;
zval *zexception;
va_start(arg, format);
va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
@@ -652,7 +652,7 @@ ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
{
va_list args;
va_start(args, format);
zend_error_cb(type, file, lineno, format, args);
va_end(args);
@@ -666,7 +666,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
zval *str, *file, *line;
EG(exception) = NULL;
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
@@ -676,7 +676,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
}
}
zval_ptr_dtor(&str);
if (EG(exception)) {
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
@@ -704,7 +704,7 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
{
zend_class_entry *exception_ce;
if (exception == NULL || exception->type != IS_OBJECT) {
if (exception == NULL || Z_TYPE_P(exception) != IS_OBJECT) {
zend_error(E_ERROR, "Need to supply an object when throwing an exception");
}
+6 -3
View File
@@ -30,11 +30,11 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC);
void zend_register_default_exception(TSRMLS_D);
ZEND_API zend_class_entry *zend_exception_get_default(void);
ZEND_API zend_class_entry *zend_get_error_exception(void);
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
ZEND_API void zend_register_default_classes(TSRMLS_D);
/* exception_ce NULL or zend_exception_get_default() or a derived class
/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);
@@ -48,6 +48,9 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
/* show an exception using zend_error(E_ERROR,...) */
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
/* do not export, in php it's available thru spprintf directly */
int zend_spprintf(char **message, int max_len, char *format, ...);
END_EXTERN_C()
#endif
+236 -237
View File
@@ -31,11 +31,14 @@
#include "zend_ptr_stack.h"
#include "zend_constants.h"
#include "zend_extensions.h"
#include "zend_fast_cache.h"
#include "zend_ini.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "zend_vm.h"
/* Virtual current working directory support */
#include "tsrm_virtual_cwd.h"
#define _CONST_CODE 0
#define _TMP_CODE 1
#define _VAR_CODE 2
@@ -123,16 +126,16 @@ static inline void zend_pzval_unlock_free_func(zval *z)
#define INIT_PZVAL_COPY(z,v) \
(z)->value = (v)->value; \
(z)->type = (v)->type; \
Z_TYPE_P(z) = Z_TYPE_P(v); \
(z)->refcount = 1; \
(z)->is_ref = 0;
(z)->is_ref = 0;
#define MAKE_REAL_ZVAL_PTR(val) \
do { \
zval *_tmp; \
ALLOC_ZVAL(_tmp); \
_tmp->value = (val)->value; \
_tmp->type = (val)->type; \
Z_TYPE_P(_tmp) = Z_TYPE_P(val); \
_tmp->refcount = 1; \
_tmp->is_ref = 0; \
val = _tmp; \
@@ -150,10 +153,10 @@ ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data
static inline void zend_get_cv_address(zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
{
zval *new_zval = &EG(uninitialized_zval);
new_zval->refcount++;
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
zval *new_zval = &EG(uninitialized_zval);
new_zval->refcount++;
zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
}
static inline zval *_get_zval_ptr_tmp(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
@@ -199,7 +202,7 @@ static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_
static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
@@ -267,7 +270,7 @@ static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_
static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
@@ -364,7 +367,7 @@ static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC
PZVAL_UNLOCK_FREE(T->str_offset.str);
} else {
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
if (opline->extended_value) { /* foreach() free */
if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { /* foreach() free */
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
}
}
@@ -433,9 +436,10 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
static inline void make_real_object(zval **object_ptr TSRMLS_DC)
{
/* this should modify object only if it's empty */
if ((*object_ptr)->type == IS_NULL
|| ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0)
|| ((*object_ptr)->type == IS_STRING && (*object_ptr)->value.str.len == 0)) {
if (Z_TYPE_PP(object_ptr) == IS_NULL
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr)==0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)) {
if (!PZVAL_IS_REF(*object_ptr)) {
SEPARATE_ZVAL(object_ptr);
}
@@ -445,95 +449,76 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
}
}
static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, zend_class_entry **pce TSRMLS_DC)
{
*pce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
if ((*pce)->ce_flags & ZEND_ACC_INTERFACE) {
return "implement interface ";
} else {
return "be an instance of ";
}
}
static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, zend_arg_info *cur_arg_info, char *need_msg, char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
char *fname = zf->common.function_name;
char *fsep;
char *fclass;
if (zf->common.scope) {
fsep = "::";
fclass = zf->common.scope->name;
} else {
fsep = "";
fclass = "";
}
if (ptr && ptr->op_array) {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
}
return 0;
}
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
char *fclass, *fsep, *fname;
char *need_msg;
zend_class_entry *ce;
if (!zf->common.arg_info
|| arg_num>zf->common.num_args) {
return;
return 1;
}
cur_arg_info = &zf->common.arg_info[arg_num-1];
fname = zf->common.function_name;
fsep = zf->common.scope ? "::" : "";
fclass = zf->common.scope ? zf->common.scope->name : "";
if (cur_arg_info->class_name) {
if (!arg) {
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
}
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, "none", "" TSRMLS_CC);
}
switch (Z_TYPE_P(arg)) {
case IS_NULL:
if (!cur_arg_info->allow_null) {
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
}
}
break;
case IS_OBJECT: {
zend_class_entry *ce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
char *error_msg;
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
error_msg = "implement interface";
} else {
error_msg = "be an instance of";
}
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s", arg_num, fclass, fsep, fname, error_msg, ce->name);
}
}
}
break;
default:
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
}
break;
if (Z_TYPE_P(arg) == IS_OBJECT) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
}
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &ce TSRMLS_CC);
return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce->name, zend_zval_type_name(arg), "" TSRMLS_CC);
}
} else if (cur_arg_info->array_type_hint) {
if (!arg) {
if(ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
}
return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", "none", "" TSRMLS_CC);
}
switch (Z_TYPE_P(arg)) {
case IS_NULL:
if (!cur_arg_info->allow_null) {
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
}
}
break;
case IS_ARRAY:
break;
default:
if (ptr && ptr->op_array) {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
}
break;
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
}
return 1;
}
@@ -557,8 +542,8 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
if (object->type != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
if (Z_TYPE_P(object) != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op2);
if (!RETURN_VALUE_UNUSED(result)) {
@@ -607,7 +592,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
value->refcount = 0;
zval_copy_ctor(value);
}
value->refcount++;
if (opcode == ZEND_ASSIGN_OBJ) {
@@ -625,7 +610,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
}
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
@@ -646,11 +631,12 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zend_free_op free_op1;
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, &free_op1, BP_VAR_W);
zval *variable_ptr;
if (!variable_ptr_ptr) {
temp_variable *T = &T(op1->u.var);
if (T->str_offset.str->type == IS_STRING) do {
if (Z_TYPE_P(T->str_offset.str) == IS_STRING)
do {
zval tmp;
zval *final_value = value;
@@ -658,23 +644,23 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
break;
}
if ((int)T->str_offset.offset >= T->str_offset.str->value.str.len) {
if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) {
zend_uint i;
if (T->str_offset.str->value.str.len==0) {
STR_FREE(T->str_offset.str->value.str.val);
T->str_offset.str->value.str.val = (char *) emalloc(T->str_offset.offset+1+1);
if (Z_STRLEN_P(T->str_offset.str)==0) {
STR_FREE(Z_STRVAL_P(T->str_offset.str));
Z_STRVAL_P(T->str_offset.str) = (char *) emalloc(T->str_offset.offset+1+1);
} else {
T->str_offset.str->value.str.val = (char *) erealloc(T->str_offset.str->value.str.val, T->str_offset.offset+1+1);
Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1);
}
for (i=T->str_offset.str->value.str.len; i<T->str_offset.offset; i++) {
T->str_offset.str->value.str.val[i] = ' ';
for (i=Z_STRLEN_P(T->str_offset.str); i<T->str_offset.offset; i++) {
Z_STRVAL_P(T->str_offset.str)[i] = ' ';
}
T->str_offset.str->value.str.val[T->str_offset.offset+1] = 0;
T->str_offset.str->value.str.len = T->str_offset.offset+1;
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0;
Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1;
}
if (value->type!=IS_STRING) {
if (Z_TYPE_P(value)!=IS_STRING) {
tmp = *value;
if (op2->op_type & (IS_VAR|IS_CV)) {
zval_copy_ctor(&tmp);
@@ -683,14 +669,14 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
final_value = &tmp;
}
T->str_offset.str->value.str.val[T->str_offset.offset] = final_value->value.str.val[0];
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(final_value)[0];
if (op2->op_type == IS_TMP_VAR) {
if (final_value == &T(op2->u.var).tmp_var) {
/* we can safely free final_value here
* because separation is done only
* in case op2->op_type == IS_VAR */
STR_FREE(final_value->value.str.val);
STR_FREE(Z_STRVAL_P(final_value));
}
}
if (final_value == &tmp) {
@@ -702,7 +688,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
*/
} while (0);
/* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
if (!RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = &value;
@@ -728,65 +714,64 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
return;
}
if(Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
/* TODO? ze1_compatibility_mode support */
if (Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
goto done_setting_var;
}
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr != value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
if (type != IS_TMP_VAR) {
value->refcount++;
}
garbage = *variable_ptr;
*variable_ptr = *value;
variable_ptr->refcount = refcount;
variable_ptr->is_ref = 1;
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
if (type != IS_TMP_VAR) {
value->refcount--;
}
zendi_zval_dtor(garbage);
}
} else {
if (variable_ptr != value) {
value->refcount++;
variable_ptr->refcount--;
if (variable_ptr->refcount == 0) {
zendi_zval_dtor(*variable_ptr);
} else {
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
}
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
zval_ptr_dtor(&value);
}
}
if (!dup) {
efree(class_name);
}
} else if (PZVAL_IS_REF(variable_ptr)) {
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr != value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
if (type != IS_TMP_VAR) {
value->refcount++;
}
garbage = *variable_ptr;
*variable_ptr = *value;
variable_ptr->refcount = refcount;
variable_ptr->is_ref = 1;
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
if (type != IS_TMP_VAR) {
value->refcount--;
}
zendi_zval_dtor(garbage);
}
} else {
if (variable_ptr != value) {
value->refcount++;
variable_ptr->refcount--;
if (variable_ptr->refcount == 0) {
zendi_zval_dtor(*variable_ptr);
} else {
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
}
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
zval_ptr_dtor(&value);
}
}
if (!dup) {
efree(class_name);
}
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr!=value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
if (type!=IS_TMP_VAR) {
value->refcount++;
}
@@ -812,7 +797,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
variable_ptr->refcount++;
} else if (PZVAL_IS_REF(value)) {
zval tmp;
tmp = *value;
zval_copy_ctor(&tmp);
tmp.refcount=1;
@@ -859,13 +844,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
(*variable_ptr_ptr)->is_ref=0;
}
done_setting_var:
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
AI_USE_PTR(T(result->u.var).var);
}
}
FREE_OP_VAR_PTR(free_op1);
}
@@ -874,32 +859,32 @@ static inline void zend_receive(zval **variable_ptr_ptr, zval *value TSRMLS_DC)
{
zval *variable_ptr = *variable_ptr_ptr;
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
} else {
variable_ptr->refcount--;
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
}
if (!dup) {
efree(class_name);
}
} else {
variable_ptr->refcount--;
*variable_ptr_ptr = value;
value->refcount++;
}
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
} else {
variable_ptr->refcount--;
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
}
if (!dup) {
efree(class_name);
}
} else {
variable_ptr->refcount--;
*variable_ptr_ptr = value;
value->refcount++;
}
}
/* Utility Functions for Extensions */
@@ -960,6 +945,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, zval *dim
offset_key = "";
offset_key_length = 0;
goto fetch_string_dim;
case IS_STRING:
offset_key = dim->value.str.val;
@@ -989,17 +975,17 @@ fetch_string_dim:
}
break;
case IS_RESOURCE:
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", dim->value.lval, dim->value.lval);
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
/* Fall Through */
case IS_DOUBLE:
case IS_BOOL:
case IS_BOOL:
case IS_LONG: {
long index;
if (dim->type == IS_DOUBLE) {
index = (long)dim->value.dval;
if (Z_TYPE_P(dim) == IS_DOUBLE) {
index = (long)Z_DVAL_P(dim);
} else {
index = dim->value.lval;
index = Z_LVAL_P(dim);
}
if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) {
switch (type) {
@@ -1024,7 +1010,7 @@ fetch_string_dim:
}
}
break;
default:
default:
zend_error(E_WARNING, "Illegal offset type");
switch (type) {
case BP_VAR_R:
@@ -1048,7 +1034,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
if (!container_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
@@ -1062,9 +1048,9 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
return;
}
if (container->type==IS_NULL
|| (container->type==IS_BOOL && container->value.lval==0)
|| (container->type==IS_STRING && container->value.str.len==0)) {
if (Z_TYPE_P(container)==IS_NULL
|| (Z_TYPE_P(container)==IS_BOOL && Z_LVAL_P(container)==0)
|| (Z_TYPE_P(container)==IS_STRING && Z_STRLEN_P(container)==0)) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
@@ -1078,7 +1064,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
}
}
switch (container->type) {
switch (Z_TYPE_P(container)) {
zval **retval;
case IS_ARRAY:
@@ -1090,13 +1076,13 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zval *new_zval = &EG(uninitialized_zval);
new_zval->refcount++;
if (zend_hash_next_index_insert(container->value.ht, &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
if (zend_hash_next_index_insert(Z_ARRVAL_P(container), &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
retval = &EG(error_zval_ptr);
new_zval->refcount--;
new_zval->refcount--;
}
} else {
retval = zend_fetch_dimension_address_inner(container->value.ht, dim, type TSRMLS_CC);
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
}
if (result) {
result->var.ptr_ptr = retval;
@@ -1121,7 +1107,20 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
}
if (dim->type != IS_LONG) {
if (Z_TYPE_P(dim) != IS_LONG) {
switch(Z_TYPE_P(dim)) {
/* case IS_LONG: */
case IS_STRING:
case IS_DOUBLE:
case IS_NULL:
case IS_BOOL:
/* do nothing */
break;
default:
zend_error(E_WARNING, "Illegal offset type");
break;
}
tmp = *dim;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
@@ -1141,7 +1140,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
container = *container_ptr;
result->str_offset.str = container;
PZVAL_LOCK(container);
result->str_offset.offset = dim->value.lval;
result->str_offset.offset = Z_LVAL_P(dim);
result->var.ptr_ptr = NULL;
if (type == BP_VAR_R || type == BP_VAR_IS) {
AI_USE_PTR(result->var);
@@ -1155,19 +1154,19 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
zval *overloaded_result;
if (dim_is_tmp_var) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
}
}
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
if (overloaded_result->type != IS_OBJECT
if (Z_TYPE_P(overloaded_result) != IS_OBJECT
&& !overloaded_result->is_ref) {
zend_error_noreturn(E_ERROR, "Objects used as arrays in post/pre increment/decrement must return values by reference");
}
@@ -1193,7 +1192,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
return;
}
break;
default: {
default: {
switch (type) {
case BP_VAR_UNSET:
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
@@ -1224,7 +1223,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
{
zval *container;
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
if (result) {
@@ -1234,9 +1233,9 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
return;
}
/* this should modify object only if it's empty */
if (container->type == IS_NULL
|| (container->type == IS_BOOL && container->value.lval==0)
|| (container->type == IS_STRING && container->value.str.len == 0)) {
if (Z_TYPE_P(container) == IS_NULL
|| (Z_TYPE_P(container) == IS_BOOL && Z_LVAL_P(container)==0)
|| (Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
@@ -1248,8 +1247,8 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
break;
}
}
if (container->type != IS_OBJECT) {
if (Z_TYPE_P(container) != IS_OBJECT) {
if (result) {
if (type == BP_VAR_R || type == BP_VAR_IS) {
result->var.ptr_ptr = &EG(uninitialized_zval_ptr);
@@ -1260,14 +1259,14 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
return;
}
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
if(NULL == ptr_ptr) {
if (NULL == ptr_ptr) {
zval *ptr;
if (Z_OBJ_HT_P(container)->read_property &&
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC)) != NULL) {
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC)) != NULL) {
if (result) {
result->var.ptr = ptr;
result->var.ptr_ptr = &result->var.ptr;
@@ -1280,7 +1279,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
} else if (Z_OBJ_HT_P(container)->read_property) {
if (result) {
result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC);
result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC);
result->var.ptr_ptr = &result->var.ptr;
}
} else {
@@ -1289,10 +1288,10 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
result->var.ptr_ptr = &EG(error_zval_ptr);
}
}
if (result) {
PZVAL_LOCK(*result->var.ptr_ptr);
}
}
}
static inline zend_brk_cont_element* zend_brk_cont(zval *nest_levels_zval, int array_offset, zend_op_array *op_array, temp_variable *Ts TSRMLS_DC)
@@ -1347,7 +1346,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
} else if (Z_TYPE_PP(pz) == IS_ARRAY) {
zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
} else if (Z_TYPE_PP(pz) == IS_OBJECT) {
/* OBJ-TBI - doesn't support new object model! */
zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
}
@@ -1369,13 +1368,13 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
}
#define ZEND_VM_NEXT_OPCODE() \
CHECK_SYMBOL_TABLES() \
EX(opline)++; \
ZEND_VM_CONTINUE()
CHECK_SYMBOL_TABLES() \
EX(opline)++; \
ZEND_VM_CONTINUE()
#define ZEND_VM_SET_OPCODE(new_op) \
CHECK_SYMBOL_TABLES() \
EX(opline) = new_op
CHECK_SYMBOL_TABLES() \
EX(opline) = new_op
#define ZEND_VM_JMP(new_op) \
CHECK_SYMBOL_TABLES() \
@@ -1383,21 +1382,21 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
ZEND_VM_CONTINUE()
#define ZEND_VM_INC_OPCODE() \
if (!EG(exception)) { \
CHECK_SYMBOL_TABLES() \
EX(opline)++; \
}
if (!EG(exception)) { \
CHECK_SYMBOL_TABLES() \
EX(opline)++; \
}
#define ZEND_VM_RETURN_FROM_EXECUTE_LOOP() \
free_alloca(EX(CVs)); \
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
free_alloca(EX(Ts)); \
} else { \
efree(EX(Ts)); \
} \
EG(in_execution) = EX(original_in_execution); \
EG(current_execute_data) = EX(prev_execute_data); \
ZEND_VM_RETURN()
free_alloca(EX(CVs)); \
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
free_alloca(EX(Ts)); \
} else { \
efree(EX(Ts)); \
} \
EG(in_execution) = EX(original_in_execution); \
EG(current_execute_data) = EX(prev_execute_data); \
ZEND_VM_RETURN()
#include "zend_vm_execute.h"
+12 -10
View File
@@ -24,8 +24,8 @@
#include "zend_compile.h"
#include "zend_hash.h"
#include "zend_variables.h"
#include "zend_operators.h"
#include "zend_variables.h"
typedef union _temp_variable {
zval tmp_var;
@@ -73,28 +73,28 @@ static inline int i_zend_is_true(zval *op)
{
int result;
switch (op->type) {
switch (Z_TYPE_P(op)) {
case IS_NULL:
result = 0;
break;
case IS_LONG:
case IS_BOOL:
case IS_RESOURCE:
result = (op->value.lval?1:0);
result = (Z_LVAL_P(op)?1:0);
break;
case IS_DOUBLE:
result = (op->value.dval ? 1 : 0);
result = (Z_DVAL_P(op) ? 1 : 0);
break;
case IS_STRING:
if (op->value.str.len == 0
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
if (Z_STRLEN_P(op) == 0
|| (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
result = 0;
} else {
result = 1;
}
break;
case IS_ARRAY:
result = (zend_hash_num_elements(op->value.ht)?1:0);
result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
break;
case IS_OBJECT:
if(IS_ZEND_STD_OBJECT(*op)) {
@@ -102,7 +102,7 @@ static inline int i_zend_is_true(zval *op)
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL, 0 TSRMLS_CC) == SUCCESS) {
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_LVAL(tmp);
break;
}
@@ -143,7 +143,9 @@ static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
EG(argument_stack).top -= (delete_count+2);
while (--delete_count>=0) {
zval_ptr_dtor((zval **) --p);
zval *q = *(zval **)(--p);
*p = NULL;
zval_ptr_dtor(&q);
}
EG(argument_stack).top_element = p;
}
@@ -191,7 +193,7 @@ void zend_shutdown_timeout_thread();
/* The following tries to resolve the classname of a zval of type object.
* Since it is slow it should be only used in error messages.
*/
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && (zval)->type == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var);
Loaded 100 of 1055 files, more files were not shown because too many files have changed in this diff. Show more