|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-20 19:35 UTC] felipensp at gmail dot com
[2007-10-20 19:42 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 09:00:01 2025 UTC |
Description: ------------ Inherited Objects call a get_object_vars method in a parent. Scope should be of the type of object actually calling the method, but private members of the child do not recognized. Reproduce code: --------------- <?php class Base { function getObjectVars() { print_r(get_object_vars($this)); } } class Child extends Base{ private $varA = 'VarA'; protected $varB = 'VarB'; public $varC = 'VarC'; function __construct() { $this->getObjectVars(); } } $child = new Child(); ?> Expected result: ---------------- Array ([varA] => VarA [varB] => VarB [varC] => VarC ) Actual result: -------------- Array ( [varB] => VarB [varC] => VarC )