|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-01 09:25 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jan 02 00:00:02 2026 UTC |
Description: ------------ The magic methods __get, __set, __call and __clone (and maybe others too) cannot be set as private methods when clearly, this is what they should be. They should not be called from outside of the object except by the engine which shouldn't count. Allowing public access to these could cause users to start using them. - Davey Reproduce code: --------------- <?php class foo { private function __get($var) { echo __FUNCTION__ . ' called'; } } $foo = new foo; $foo->bar; ?> Expected result: ---------------- __get called Actual result: -------------- <b>Fatal error</b>: Call to private method foo::__get() from context '' in <b>PHPDocument2</b> on line <b>22</b><br />