Commit Graph

316 Commits

Author SHA1 Message Date
Xinchen Hui
7b5960b085 Merge branch 'PHP-5.4' 2012-09-01 14:38:33 +08:00
Xinchen Hui
f3108b5f81 Remove extra blank in notice message, should act as same as vm 2012-09-01 14:37:45 +08:00
Xinchen Hui
cc30524c89 Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) 2012-07-21 23:26:18 +08:00
Xinchen Hui
a580405f38 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault)
2012-07-21 22:46:14 +08:00
Xinchen Hui
0c996613c0 Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) 2012-07-21 22:45:16 +08:00
Anatoliy Belsky
ed1f5b4dae Merge branch 'PHP-5.4'
* PHP-5.4:
  reverted news about #62477
  reverted changes for #62477

Conflicts:
	NEWS
2012-07-12 11:02:33 +02:00
Anatoliy Belsky
86428169d3 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  reverted changes for #62477
2012-07-12 10:57:26 +02:00
Anatoliy Belsky
ad7eeba3c1 reverted changes for #62477 2012-07-12 10:54:14 +02:00
Anatoliy Belsky
b530d6d790 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62477 LimitIterator int overflow
2012-07-11 22:30:40 +02:00
Anatoliy Belsky
40f8010a13 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62477 LimitIterator int overflow
2012-07-11 22:29:45 +02:00
Anatoliy Belsky
b383ddf1e5 Fixed bug #62477 LimitIterator int overflow 2012-07-11 22:25:31 +02:00
Johannes Schlüter
b025b9d0cf Fix #62432 ReflectionMethod random corrupt memory on high concurrent
This fixes the same issue in multiple extensions. This isn't needed
in later branches as 5.4 introduced object_properties_init()
2012-06-27 23:26:33 +02:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Gustavo André dos Santos Lopes
32f7337bd4 - Reverted changes that required constructor overrides to invoke the parent
constructor in several SPL classes and applied 5.3 fixes instead.
  Related bugs: #54384, #55175 and #55300
2011-10-29 23:17:18 +00:00
Gustavo André dos Santos Lopes
41abc6d017 - Reverted changes that required constructor overrides to invoke the parent
constructor in several SPL classes and applied 5.3 fixes instead.
  Related bugs: #54384, #55175 and #55300
2011-10-29 23:17:18 +00:00
Hannes Magnusson
4ff1539384 Allow replacement to be any scalar value 2011-09-12 13:21:57 +00:00
Hannes Magnusson
75c4d6f888 Allow replacement to be any scalar value 2011-09-12 13:21:57 +00:00
Hannes Magnusson
2c5574b3d8 Allow replacement to be any scalar value 2011-09-12 13:21:57 +00:00
Etienne Kneuss
b03860a935 Fix CID 593 Mark the missing break by an explicit comment, we DO intend to fall through here 2011-08-12 22:20:35 +00:00
Etienne Kneuss
80742189b8 Fix CID 593 Mark the missing break by an explicit comment, we DO intend to fall through here 2011-08-12 22:20:35 +00:00
Felipe Pena
23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
da376383e8 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Pierrick Charron
1b416caeb1 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Pierrick Charron
e53ca46fc0 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Pierrick Charron
a814063804 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Gustavo André dos Santos Lopes
2975308e1a - Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and
SplTempFileObject crash when user-space classes don't call the paren
  constructor).
2011-04-04 02:50:27 +00:00
Arnaud Le Blanc
b83e243c23 Added CallbackFilterIterator and RecursiveCallbackFilterIterator classes
[DOC] This is a concrete FilterIterator which takes a callback as
constructor parameter, and uses this callback for filtering. This allows
to use FilterIterator without extending it.

CallbackFilterIterator Example:

$it = new ArrayIterator(range(1,100));
$it = new CallbackFilterIterator($it, function($value) {
	return $value % 2;
});
foreach($it as $value) // ...

RecursiveCallbackFilterIterator Example:

$it = new RecursiveDirectoryIterator("/");
$it = new RecursiveCallbackFilterIterator($it, function($file, $k, $it) {
	return $it->hasChildren() || $file->getSize() > 1024;
});
foreach(new RecursiveIteratorIterator($it) as $file) // ...

The callback takes the current value, the current key and the inner
iterator as parameters.
2011-03-27 20:13:27 +00:00
Gustavo André dos Santos Lopes
c2fe893985 - Fixed bug #54384: Several SPL classes crash when parent constructor is
not called.
#Merge to 5.3 pending (slight BC break on AppendIterator, as it's no
#longer possible to defer the call to the parent constructor until
#after the constructor is performed).
#Bugs fixed in an atypical way for SPL. The parent constructor call
#check is performed at construction time by using a wrapper constructor
#instead of a check on the beginning of each instance method.
#Perhaps this should be uniformized in trunk; this method was mainly
#applied only to the ones crashing, except a few iterators (at least
#AppendIterator and RecursiveIteratorIterator).
2011-03-27 04:21:06 +00:00
Felipe Pena
0dd448cbf1 - Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator) 2011-03-22 22:41:16 +00:00
Felipe Pena
11c4a5b96a - Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator) 2011-03-22 22:41:16 +00:00
Felipe Pena
5b442c82f0 - Fixed bug #54040 (Logical && where & probably needed in spl_iterators) 2011-02-20 16:09:50 +00:00
Felipe Pena
c4850dbf88 - Fixed bug #54040 (Logical && where & probably needed in spl_iterators) 2011-02-20 16:09:50 +00:00
Adam Harvey
3571c955b5 Implement request #53659 (Implementing RegexIterator::getRegex() method). Patch
by Joshua Thijssen.
2011-01-06 02:32:02 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Felipe Pena
6958cb4a14 - Added missing void arg checks 2010-11-14 18:40:08 +00:00
Felipe Pena
8192f0f771 - Added missing void arg checks 2010-11-14 18:40:08 +00:00
Felipe Pena
590ad22361 - Fix the fix (wrong behavior) 2010-11-08 20:26:14 +00:00
Felipe Pena
22f7998a0d - Fix the fix (wrong behavior) 2010-11-08 20:26:14 +00:00
Felipe Pena
7636635ec5 - Fixed bug #50579 (RegexIterator::REPLACE doesn't work) 2010-11-06 00:09:50 +00:00
Felipe Pena
d31e4e7f8e - Fixed bug #50579 (RegexIterator::REPLACE doesn't work) 2010-11-06 00:09:50 +00:00
Felipe Pena
5f790678ec - Fixed ZTS build 2010-07-07 22:46:54 +00:00
Felipe Pena
c0c5c1ad4c - Fixed ZTS build 2010-07-07 22:46:54 +00:00
Etienne Kneuss
a3bf7aa4fe Fixed #51697 (Unsafe operations in free_storage of SPL iterators,
causes crashes during shutdown)
2010-07-07 21:55:17 +00:00
Etienne Kneuss
bb15b92d2d Fixed #51697 (Unsafe operations in free_storage of SPL iterators,
causes crashes during shutdown)
2010-07-07 21:55:17 +00:00
Johannes Schlüter
e46fee1d1a Fix bug #52238: Crash when an Exception occured in iterator_to_array 2010-07-02 19:17:45 +00:00
Johannes Schlüter
21d5041c03 Fix bug #52238: Crash when an Exception occured in iterator_to_array 2010-07-02 19:17:45 +00:00
Dmitry Stogov
c5237d82bf Added caches to eliminate repeatable run-time bindings of functions, classes, constants, methods and properties 2010-05-24 14:11:39 +00:00
Etienne Kneuss
9f16874a53 Fix #49723 (Skip seek when unnecessary) 2010-04-27 04:57:48 +00:00
Etienne Kneuss
6f5f6d2bca Fix #49723 (Skip seek when unnecessary) 2010-04-27 04:57:48 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Peter Cowburn
fbbe3e3686 Corrected typo in LimitIterator offset exception. Fixes #51119 2010-02-22 23:55:30 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Felipe Pena
a94558c855 - Added MAKE_COPY_ZVAL(ppzv, pzv) macro 2009-12-08 01:57:37 +00:00
Felipe Pena
8f11dc62d5 - Fixed bug #50090 (Typo in IteratorIterator constructor) 2009-11-07 21:27:15 +00:00
Felipe Pena
8ce58b2490 - Fixed bug #50018 (Typo in spl_limit_it_seek()) 2009-10-27 21:57:26 +00:00
Johannes Schlüter
0a8fc25b7d Fix #49972 (AppendIterator undefined function crash) 2009-10-23 16:47:35 +00:00
Felipe Pena
fc4e43ec3c MFH:
- Added missing methods' arginfo (for void params)
- Fixed arginfos:
  - MultipleIterator::__construct
  - MultipleIterator::setFlags      (Thanks Philip!)
  - SplFixedArray::__construct
2009-07-04 20:31:27 +00:00
Scott MacVicar
01a6919ff0 Fix bug #48206 again 2009-05-09 19:45:26 +00:00
Scott MacVicar
e89c1cf7d9 MFH Fix bug #48206 - Iterating over an invalid data structure leads to a segfault 2009-05-09 19:35:09 +00:00
Felipe Pena
d29e47652f - MFH: Added missing "return;" 2009-01-20 00:43:25 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Etienne Kneuss
3919b16f04 MFH: Fix #46241 (stacked error_handlers, error_handling in general) 2008-11-19 02:00:53 +00:00
Felipe Pena
fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Felipe Pena
7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Felipe Pena
df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Arnaud Le Blanc
261f0c32a5 initialize optional vars 2008-10-21 22:08:20 +00:00
Felipe Pena
084124fb37 - MFH: Fixed bug #46088 (RegexIterator::accept - segfault) 2008-09-22 13:09:09 +00:00
Arnaud Le Blanc
506e49c6e1 MFH: Fixed bug #46031 (Segfault in AppendIterator::next) 2008-09-09 19:44:15 +00:00
Etienne Kneuss
c77ca4c34a MFH: Fix error_handling usage in various extensions 2008-08-08 22:07:07 +00:00
Felipe Pena
e304515ddb - MFH: Added parameter TSRMLS_DC in zend_is_callable() 2008-08-02 04:46:07 +00:00
Dmitry Stogov
3c62c4bf7e Removed warning 2008-07-29 11:50:05 +00:00
Etienne Kneuss
5495813bb3 MFH: Complete the ZTS build fix 2008-07-19 19:45:55 +00:00
Derick Rethans
5501431626 - MFH: Fixed ZTS build. 2008-07-19 19:24:07 +00:00
Marcus Boerger
e537b7934d - MFH Added RecursiveTreeIterator 2008-07-19 15:49:21 +00:00
Etienne Kneuss
b57e7b44da Fix bug #41828 (Fix crash on wrong instantiation) 2008-03-12 13:34:47 +00:00
Marcus Boerger
522166bad1 - MFH Fix bug in example code found by Surf Chen 2008-01-10 10:11:33 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
b489251177 - MFH from HEAD:
. Folding tags
  . Parameter parsing
  . SPL debug info
  . array function improvements (not all yet)
  . Improvements to function calling with call_user_* functions
  . Improvements to debugging info in var_dump/print_r
# I propably forgot already something but this all was pretty close tied
# to each other so it wasn't possible to do it in parts.
2007-11-02 19:40:39 +00:00
Marcus Boerger
80893e5727 - Fix #42703 2007-10-18 04:41:39 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Marcus Boerger
93583f9680 - MFH Add invert option to RegexIterator 2007-05-11 00:15:25 +00:00
Marcus Boerger
fa29c1a2f5 - Fix copy'n'paste issues 2007-03-04 14:01:06 +00:00
Marcus Boerger
ed359b4529 - MFH simplify, synch docu/implementation 2007-03-04 12:18:02 +00:00
Ilia Alshanetsky
efad70c2cc snprintf() -> slprintf() 2007-02-27 03:28:17 +00:00
Marcus Boerger
58c77d3925 - MFH CachingIterator implements Countable 2007-02-19 16:18:24 +00:00
Marcus Boerger
ac3b5ebbde - MFH Rearrange code: mode Countable from spl_array.c to spl_iterator.c 2007-02-08 22:17:40 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Marcus Boerger
164929d557 - MFH: Add new test 2006-11-20 19:58:01 +00:00
Johannes Schlüter
c65a1f10cb - MFH: No C++ comments (fix #39414) 2006-11-07 15:19:11 +00:00
Hannes Magnusson
69dbaaacac MFH: arginfo fixes 2006-11-06 23:20:11 +00:00
Hannes Magnusson
bece30aee5 MFH: fix crash on invalid regex 2006-11-03 14:11:23 +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
Marcus Boerger
45d09c71ba - Synch RegexIterator with HEAD 2006-07-20 22:54:21 +00:00
Ilia Alshanetsky
480104a456 Fixed memory leak 2006-07-18 22:42:28 +00:00
Marcus Boerger
34cfec2536 - MFH Fix #38125 undefined reference to spl_dual_it_free_storage 2006-07-17 21:11:33 +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
e0844e09bd - MFH iterator_apply() 2006-06-07 09:44:42 +00:00
Antony Dovgal
928c20942b plug a leak in ext/spl/tests/iterator_047.phpt 2006-06-06 20:11:35 +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
96916c95e8 - MFH Sync with head fixes part of an issue with iterator_(to_array|count) 2006-05-20 21:01:42 +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
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
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
Antony Dovgal
046b34955c MFH: fix #37416 (iterator_to_array() hides exceptions thrown in rewind() method) 2006-05-12 09:42:56 +00:00
Andrei Zmievski
9e0e89c5cf Rename RegExIterator -> RegexIterator.
Also rename recursive one.
2006-05-10 16:50:57 +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
Antony Dovgal
af429910ef AIX #define's accept as naccept
add a workaround
2006-04-13 13:21:43 +00:00
Antony Dovgal
59b8592c8c fix bug #36898 (__set() leaks in classes extending internal ones)
Added:
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)

to initialize and destroy zend_object structs
2006-03-29 14:28:43 +00:00
Marcus Boerger
a824bcf41d - MFH: Make IteratorIterator base of most SPL iterators 2006-03-26 02:25:03 +00:00
Marcus Boerger
a325d22cd1 - MFH Missed 'proto' 2006-03-06 22:22:54 +00:00
Marcus Boerger
dc8221c154 - Fix last %v, too 2006-03-06 10:56:41 +00:00
Marcus Boerger
94165e41a7 - There is no %v in 5.1 (found by Tony) 2006-03-06 10:09:13 +00:00
Marcus Boerger
e795f8f427 - MFH Proto fixes 2006-03-06 09:50:44 +00:00
Marcus Boerger
7dc322754a - Fix issues with not/double calling of constructors of SPL iterators
- Fix issues with info-class/file-class in SPL directory handling classes
- Add SimpleXMLElement::count()
- Drop erroneous RecursiveDirectoryIterator::getSubPathInfo()
- Drop dead code
- Add tests
- Update docu
2006-03-05 17:39:49 +00:00
Antony Dovgal
bccf4bd9e7 MFH: initialize variables and reduce the number of warnings 2006-02-06 11:28:41 +00:00
Marcus Boerger
2d1d476391 - MFH Fix error message 2006-01-23 02:26:32 +00:00
Marcus Boerger
34f32d4dcd - Just another place where rewind() might not be set 2006-01-01 19:55:27 +00:00
Marcus Boerger
e99fac3d01 - key() might be optional 2006-01-01 19:51:17 +00:00
Marcus Boerger
d6ee7d1d9a - Fix SEGV when rewind() not set 2006-01-01 19:48:11 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
cfda375620 MFH 2005-12-25 16:04:15 +00:00
Marcus Boerger
7f6018aa3a - WS 2005-12-22 00:37:07 +00:00
Marcus Boerger
53e37ac843 - Fix memleak 2005-12-22 00:35:37 +00:00
Marcus Boerger
0986f33d1e - Fix memleak 2005-12-22 00:06:38 +00:00
Antony Dovgal
efff8a45e2 more SPL leak fixes 2005-12-20 12:41:24 +00:00
Marcus Boerger
32220d2e7e - Check for result of getIterator() call 2005-12-19 00:45:28 +00:00
Marcus Boerger
e989e9f70f - Fix reference counting 2005-12-19 00:32:51 +00:00
Antony Dovgal
9e8a1bfcbe fix leak in SPL iterators 2005-12-18 22:52:24 +00:00
foobar
a4295629b8 MFH 2005-12-06 02:00:14 +00:00
Stanislav Malyshev
3eafc3d329 fix reallocation bug 2005-12-05 19:54:47 +00:00
Antony Dovgal
241aa9a59d MFH: fix #35197 (Destructor is not called) and similar issues in other extensions 2005-11-14 22:03:02 +00:00
Marcus Boerger
376d4554fb - MFH the iterator base interface is Traversable not IteratorAggregate 2005-11-01 21:18:24 +00:00
Marcus Boerger
b29b16af2e - Synch RecursiveIteratorIterator, fixes a few memory corruptions/memleaks 2005-10-05 21:59:13 +00:00
Marcus Boerger
308a64bc08 - MFH Really allow SXE being shared by not using anything from it directly in SPL 2005-10-03 16:05:08 +00:00
Marcus Boerger
7d918fae4c - Synch naming/move changes with HEAD
- Update tests/docu
# New functionality in CachingIterator/RecursiveIteratorIterator not MFHed
2005-09-18 17:15:04 +00:00
Marcus Boerger
b4dd030782 MFH:
- Add SplObjectStorage
- Add RecursiveFilterIterator
- Rename Observer to SplObserver
- Rename Subject to SplSubject
- Move SPL constants to class constants
- Update docu
2005-09-15 03:33:04 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Marcus Boerger
0b34e041e3 - Before we later run into BC trouble we split flags into two params mode
and flags now before branching for 5.1.
2005-07-28 21:09:02 +00:00
Marcus Boerger
a935b06236 - Fix issues with iterators and excpetions
# update documentation
#
# In 5.2 we need to implement an event handler onException() to be invoked
# on exceptions during getChildren() calls. Its default implementation
# would simply rethrow the exception if the flag is not set and delete if
# if it was set. To do so the exceptions refcount needs to be increased
# before calling zend_clear_exception() to keep the exception alive but
# clear the control information.
#
# As a side note this is alos the easy solution to allow multi exception
# handling: Simply clear the engine's exception info and add a property
# called $previousException to the base exception and assign it from the
# already pending one.
2005-07-27 22:19:01 +00:00
Dmitry Stogov
aedbdb087d Allowed return by refrence from internal functions 2005-06-16 14:56:13 +00:00
Marcus Boerger
626d781afd - Execute both RecursiveIteratorIterator::beginChildren() and endChildren()
on the same level (while the actual child is available).
2005-05-14 16:40:58 +00:00
Marcus Boerger
530917b463 - Make iterator_to_array() accept Traversable 2005-03-31 21:49:47 +00:00
Marcus Boerger
f9de3fd02b - Allow to hook into RecursiveIteratorIterator's child handling
- Better=faster function caching for RecursiveIteratorIterator
- Check for exceptions and fix check for illegal return values
- Add UnexpectedValueException
- Add docu
2005-03-12 23:03:33 +00:00