php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /var/www/html/sub/images/sym/root/proc/self/root/opt/php-7.0.1/tests/classes/ |
| files >> /var/www/html/sub/images/sym/root/proc/self/root/opt/php-7.0.1/tests/classes/__set__get_005.phpt |
--TEST--
ZE2 __set() and __get()
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
class Test
{
protected $x;
function __get($name) {
echo __METHOD__ . "\n";
if (isset($this->x[$name])) {
return $this->x[$name];
}
else
{
return NULL;
}
}
function __set($name, $val) {
echo __METHOD__ . "\n";
$this->x[$name] = $val;
}
}
class AutoGen
{
protected $x;
function __get($name) {
echo __METHOD__ . "\n";
if (!isset($this->x[$name])) {
$this->x[$name] = new Test();
}
return $this->x[$name];
}
function __set($name, $val) {
echo __METHOD__ . "\n";
$this->x[$name] = $val;
}
}
$foo = new AutoGen();
$foo->bar->baz = "Check";
var_dump($foo->bar);
var_dump($foo->bar->baz);
?>
===DONE===
--EXPECTF--
AutoGen::__get
Test::__set
AutoGen::__get
object(Test)#%d (1) {
["x":protected]=>
array(1) {
["baz"]=>
string(5) "Check"
}
}
AutoGen::__get
Test::__get
string(5) "Check"
===DONE===
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`