|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-06-17 21:50 UTC] nikic@php.net
[2013-06-17 21:50 UTC] nikic@php.net
-Status: Open
+Status: Closed
[2013-11-17 09:30 UTC] laruence@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
Description: ------------ If code is run inside an array offset unset the reported size of that array will be off by one: <?php class Foo { public $array; public function __destruct() { var_dump(count($this->array[0])); var_dump($this->array[0]); } } $array = [[new Foo]]; $array[0][0]->array =& $array; unset($array[0][0]); Outputs: int(1) array(1) { } The reason is that zend_hash_del_key_or_index decrements the element count *after* calling the bucket dtor.