#35393 [Opn->Asn]: changing static protected members from outside the class
ID: 35393
Updated by: tony2001@php.net
Reported By: tony2001@php.net
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.1.0
-Assigned To:
+Assigned To: dmitry
New Comment:
Assigned to Dmitry by his request.
Previous Comments:
------------------------------------------------------------------------
[2005-11-25 14:46:39] tony2001@php.net
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) {
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35393&edit=1
Thread (3 messages)