diff options
author | Nikita Popov <nikic@php.net> | 2012-06-19 18:08:22 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2012-06-19 18:08:22 +0200 |
commit | cce4764f138bd303e9fdf69d3dcc3d0cb377ead6 (patch) | |
tree | 9ea4d58ec1961071d38ce423b991e04c7a479d51 | |
parent | 34bd1c941b4124f80ef25fdfbb08702f89913d68 (diff) | |
parent | 4cba4c61931caf4abb1599493fdcbb2b492072f0 (diff) | |
download | php-git-cce4764f138bd303e9fdf69d3dcc3d0cb377ead6.tar.gz |
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
Fixed bug RecursiveArrayIterator does not implement Countable
Conflicts:
ext/spl/spl_array.c
-rwxr-xr-x | ext/spl/spl_array.c | 5 | ||||
-rw-r--r-- | ext/spl/tests/bug62262.phpt | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index e448731a52..84977c4b9b 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1943,6 +1943,7 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate); REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); spl_handler_ArrayObject.clone_obj = spl_array_object_clone; @@ -1967,6 +1968,7 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator); REGISTER_SPL_IMPLEMENTS(ArrayIterator, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers)); spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator; @@ -1974,9 +1976,6 @@ PHP_MINIT_FUNCTION(spl_array) REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator); spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator; - REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); - REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST); REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS); diff --git a/ext/spl/tests/bug62262.phpt b/ext/spl/tests/bug62262.phpt new file mode 100644 index 0000000000..0e006ec2c2 --- /dev/null +++ b/ext/spl/tests/bug62262.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #62262: RecursiveArrayIterator does not implement Countable +--FILE-- +<?php + +var_dump(new RecursiveArrayIterator(array()) instanceof Countable); + +?> +--EXPECT-- +bool(true) |