cvs: ZendEngine2(PHP_5_0) /tests bug27798.phpt

From: Date: Mon, 04 Oct 2004 09:00:11 +0000
Subject: cvs: ZendEngine2(PHP_5_0) /tests bug27798.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3074@lists.php.net to get a copy of this message
helly Mon Oct 4 05:00:11 2004 EDT Added files: (Branch: PHP_5_0) /ZendEngine2/tests bug27798.phpt Log: MFH http://cvs.php.net/co.php/ZendEngine2/tests/bug27798.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug27798.phpt +++ ZendEngine2/tests/bug27798.phpt --TEST-- Bug #27798 (private / protected variables not exposed by get_object_vars() inside class) --FILE-- <?php class Base { public $Foo = 1; protected $Bar = 2; private $Baz = 3; function __construct() { echo __METHOD__ . "\n"; var_dump(get_object_vars($this)); } } class Child extends Base { private $Baz = 4; function __construct() { parent::__construct(); echo __METHOD__ . "\n"; var_dump(get_object_vars($this)); } } var_dump(get_object_vars(new Base)); var_dump(get_object_vars(new Child)); ?> ===DONE=== --EXPECT-- Base::__construct array(3) { ["Foo"]=> int(1) ["Bar"]=> int(2) ["Baz"]=> int(3) } array(1) { ["Foo"]=> int(1) } Base::__construct array(3) { ["Baz"]=> int(4) ["Foo"]=> int(1) ["Bar"]=> int(2) } Child::__construct array(3) { ["Baz"]=> int(4) ["Foo"]=> int(1) ["Bar"]=> int(2) } array(1) { ["Foo"]=> int(1) } ===DONE===

« previous php.zend-engine.cvs (#3074) next »