|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-25 14:49 UTC] tony2001@php.net
[2005-11-28 15:35 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ It's possible to change value of static protected member with a tricky code like the one below (pay attention to the "()" around the method call). Reproduce code: --------------- class ObjectPath { static protected $type = array(0=>'main'); static function getType() { return self::$type; } } var_dump(ObjectPath::getType()); $object_type = array_pop((ObjectPath::getType())); var_dump(ObjectPath::getType()); Expected result: ---------------- array(1) { [0]=> string(4) "main" } array(1) { [0]=> string(4) "main" } Actual result: -------------- array(1) { [0]=> string(4) "main" } array(0) { }