List Info

Thread: note 78115 added to language.oop5.overloading




note 78115 added to language.oop5.overloading
user name
2007-09-28 03:23:15
"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
$valuen");
    $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  -- h
ttps://master.php.net/note/delete/78115/integrated
Del: useless     -- http
s://master.php.net/note/delete/78115/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/78115/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78115
Reject      -- https://mast
er.php.net/note/reject/78115
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )