|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-06 14:09 UTC] derick@php.net
[2007-02-06 14:10 UTC] tony2001@php.net
[2007-02-06 14:16 UTC] djungowski at chipxonio dot de
[2007-02-06 14:49 UTC] djungowski at chipxonio dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 23:00:02 2025 UTC |
Description: ------------ __get() does not seem to work properly when predeclaring the property When declared as public, __get isn't referenced, private properties are being redeclared as public! Reproduce code: --------------- class param { public $a; private $b; function __get($memberName) { switch($memberName) { case 'a': $var = 'a'; break; case 'b': $var = 'b'; break; } return $var; } } $p = new param(); $a = $p->a; $b = $p->b; Expected result: ---------------- $a = 'a' $b should throw an error, since param->b has been declared as private Actual result: -------------- $a = '' $b = 'b'