You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This test also needs to exclude the protected and private variables
// since they cannot be accessed from the external object which iterates
// them.
#[AllowDynamicProperties]
class test
{
public$pub = "public";
protected$pro = "protected";
private$pri = "private";
function__construct()
{
$this->imp = "implicit";
}
};
$test = newtest;
$test->dyn = "dynamic";
print_r($test);
$object = newArrayObject($test);
print_r($object);
foreach($testas$key => $val)
{
echo"$key => $val\n";
}
?>
--EXPECTF--
test Object
(
[pub] => public
[pro:protected] => protected
[pri:test:private] => private
[imp] => implicit
[dyn] => dynamic
)
Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d