com php-src: Fixed #70053 MutlitpleIterator arr ay-keys incompatible change in PHP 7: NEWS ex t/spl/spl_observer.c ext/spl/tests/bug70053.p hpt

From: Date: Sun, 12 Jul 2015 16:33:55 +0000
Subject: com php-src: Fixed #70053 MutlitpleIterator arr ay-keys incompatible change in PHP 7: NEWS ex t/spl/spl_observer.c ext/spl/tests/bug70053.p hpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87932@lists.php.net to get a copy of this message
Commit: 03d18d9a52065689d27384e95a54b7ae01e77780 Author: Tjerk Meesters <datibbaw@php.net> Mon, 13 Jul 2015 00:33:55 +0800 Parents: fcdf1d05276e22c34d3ad536b5c6796f3a8e2fd3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=03d18d9a52065689d27384e95a54b7ae01e77780 Log: Fixed #70053 MutlitpleIterator array-keys incompatible change in PHP 7 Bugs: https://bugs.php.net/70053 Changed paths: M NEWS M ext/spl/spl_observer.c A ext/spl/tests/bug70053.phpt Diff: diff --git a/NEWS b/NEWS index 3ba24cf..cbba441 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,10 @@ . Fixed bug #70032 (make_http_soap_request calls zend_hash_get_current_key_ex(,,,NULL). (Laruence) +- SPL: + . Fixed bug #70053 (MutlitpleIterator array-keys incompatible change in + PHP 7). (Tjerk) + - Standard: . Fixed bug #70018 (exec does not strip all whitespace). (Laruence) diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer..c index 5ad1c5d..6a9e27a 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -1182,7 +1182,7 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_ add_index_zval(return_value, Z_LVAL(element->inf), &retval); break; case IS_STRING: - zend_hash_update(Z_ARRVAL_P(return_value), Z_STR(element->inf), &retval); + zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR(element->inf), &retval); break; default: zval_ptr_dtor(&retval); diff --git a/ext/spl/tests/bug70053.phpt b/ext/spl/tests/bug70053.phpt new file mode 100644 index 0000000..2cab083 --- /dev/null +++ b/ext/spl/tests/bug70053.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: ArrayObject +--FILE-- +<?php + +echo "-- Two empty iterators attached with infos that are different but same array key --\n"; +$mit = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC); +$mit ->attachIterator(new EmptyIterator(), "2"); +$mit ->attachIterator(new EmptyIterator(), 2); +var_dump($mit->countIterators()); +$mit->rewind(); +var_dump($mit->current()); + +?> +--EXPECT-- +-- Two empty iterators attached with infos that are different but same array key -- +int(2) +array(1) { + [2]=> + NULL +}

« previous php.cvs (#87932) next »