|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-11-06 13:04 UTC] nikic@php.net
[2018-11-06 13:37 UTC] bwoebi@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: bwoebi
[2018-11-06 13:37 UTC] bwoebi@php.net
[2018-11-06 13:37 UTC] bwoebi@php.net
-Status: Closed
+Status: Re-Opened
-Assigned To: bwoebi
+Assigned To:
[2018-11-06 13:37 UTC] bwoebi@php.net
[2018-11-06 13:50 UTC] nikic@php.net
[2021-07-23 10:10 UTC] nikic@php.net
-Status: Re-Opened
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2021-07-23 10:10 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 05:00:01 2025 UTC |
Description: ------------ The array contains 2 identical keys. Reproduced in all PHP 7.*. Not reproduced in PHP 5.6. Test script: --------------- <?php class A { private $foo = 'fooA'; public function dump() { return get_object_vars($this); } } class B extends A { public $foo = 'fooB'; } $b = new B(); $object_vars = $b->dump(); var_dump($object_vars); unset($object_vars['foo']); var_dump($object_vars); unset($object_vars['foo']); var_dump($object_vars); Expected result: ---------------- The array contains unique keys only. Actual result: -------------- array(2) { ["foo"]=> string(4) "fooB" ["foo"]=> string(4) "fooA" } array(1) { ["foo"]=> string(4) "fooB" } array(0) { }