b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / share / pear / test / propro / tests /
Filename/usr/share/pear/test/propro/tests/001.phpt
Size789
Permissionrw-r--r--
Ownerapache
Create time26-May-2024 11:05
Last modified16-Feb-2017 23:52
Last accessed16-Feb-2017 23:52
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
--TEST--
property proxy
--SKIPIF--
<?php if (!extension_loaded("propro")) print "skip"; ?>
--FILE--
<?php

echo "Test\n";

class c {
private $prop;
private $anon;
function __get($p) {
return new php\PropertyProxy($this, $p);
}
}

$c = new c;

$p = $c->prop;
$a = $c->anon;

var_dump($c);

$a = 123;
echo $a,"\n";

$p["foo"] = 123;
$p["bar"]["baz"]["a"]["b"]=987;

var_dump($c);

?>
DONE
--EXPECTF--
Test
object(c)#%d (2) {
["prop":"c":private]=>
NULL
["anon":"c":private]=>
NULL
}
123
object(c)#%d (2) {
["prop":"c":private]=>
array(2) {
["foo"]=>
int(123)
["bar"]=>
array(1) {
["baz"]=>
array(1) {
["a"]=>
array(1) {
["b"]=>
int(987)
}
}
}
}
["anon":"c":private]=>
int(123)
}
DONE