note 78115 added to language.oop5.overloading

From: Date: Fri, 28 Sep 2007 08:23:15 +0000
Subject: note 78115 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-130878@lists.php.net to get a copy of this message
"These methods will only be triggered when your object or inherited object doesn't contain the member or method you're trying to access." is not quite correct: they get called when the member you trying to access in not visible: <?php class test { public $a; private $b; function __set($name, $value) { echo("__set called to set $name to $value\n"); $this->$name = $value; } } $t = new test; $t->a = 'a'; $t->b = 'b'; ?> Outputs: __set called to set b to b Be aware that set ist not called for public properties ---- Server IP: 69.147.83.197 Probable Submitter: 217.91.21.157 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php Edit -- https://master.php.net/note/edit/78115 Del: integrated -- https://master.php.net/note/delete/78115/integrated Del: useless -- https://master.php.net/note/delete/78115/useless Del: bad code -- https://master.php.net/note/delete/78115/bad+code Del: spam -- https://master.php.net/note/delete/78115/spam Del: non-english -- https://master.php.net/note/delete/78115/non-english Del: in docs -- https://master.php.net/note/delete/78115/in+docs Del: other reasons-- https://master.php.net/note/delete/78115 Reject -- https://master.php.net/note/reject/78115 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130878) next »