note 83367 added to language.oop5.overloading

From: Date: Thu, 22 May 2008 15:36:29 +0000
Subject: note 83367 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-139616@lists.php.net to get a copy of this message
@durist at frii dot com: It is not a bug. "Variables" managed by __set & __get aren't really variables - so there's no way get_object_vars could know them. Example with array is simple, but I can imagine more sophisticated scenarios, eg. __get could retrieve data from a database, or even you could write: <?php public function __get($name) { return md5($name); } ?> If you were correct, it would mean that get_object_vars should return infinite array of "member variables". get_object_vars returns real variables. If you define a __set method that puts your data into array, you don't create a new variable, you just append some keys into an array;) Hope I made myself clear;) ---- Server IP: 82.160.94.10 Probable Submitter: 62.89.68.200 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php Edit -- https://master.php.net/note/edit/83367 Del: integrated -- https://master.php.net/note/delete/83367/integrated Del: useless -- https://master.php.net/note/delete/83367/useless Del: bad code -- https://master.php.net/note/delete/83367/bad+code Del: spam -- https://master.php.net/note/delete/83367/spam Del: non-english -- https://master.php.net/note/delete/83367/non-english Del: in docs -- https://master.php.net/note/delete/83367/in+docs Del: other reasons-- https://master.php.net/note/delete/83367 Reject -- https://master.php.net/note/reject/83367 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139616) next »