File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
spl /
tests /
arrayObject_setFlags_basic2.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
SPL: Ensure access to non-visible properties falls back to dimension access with ArrayObject::ARRAY_AS_PROPS.
--FILE--
<?php
class C extends ArrayObject {
private $x = 'secret';
static function go($c) {
var_dump($c->x);
}
}
$c = new C(array('x'=>'public'));
$c->setFlags(ArrayObject::ARRAY_AS_PROPS);
C::go($c);
var_dump($c->x);
$c->setFlags(0);
C::go($c);
var_dump($c->x);
?>
--EXPECTF--
string(6) "secret"
string(6) "public"
string(6) "secret"
Fatal error: Cannot access private property C::$x in %s on line 19
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>