note 109599 deleted from language.types.null by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:55:27 +0000 |
| Subject: | note 109599 deleted from language.types.null by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210837@lists.php.net to get a copy of this message | ||
Note Submitter: foxdie_cs at hotmail dot com
----
a quick note about the magic function __get() :
<?php
class Foo{
protected $bar;
public function __construct(){
$this->bar = NULL;
var_dump( $this->bar ); //prit 'NULL' but won't call the magic method __get()
unset( $this->bar );
var_dump( $this->bar ); //print 'GET bar' and 'NULL'
}
public function __get( $var ){ echo "GET " . $var; }
}
new Foo();
?>