php-src/ext/spl/tests/ArrayObject_get_object_vars.phpt
Nikita Popov a5fa51afbb Don't overload get_properties for ArrayObject
Instead overload get_properties_for for a few specific cases such
as array casts. This resolves the issue where ArrayObject
get_properties may violate engine invariants in some cases.
2018-10-10 10:39:10 +02:00

31 lines
447 B
PHP

--TEST--
get_object_vars() on ArrayObject works on the properties of the ArrayObject itself
--FILE--
<?php
class Test {
public $test;
public $test2;
}
class AO extends ArrayObject {
private $test;
public function getObjectVars() {
return get_object_vars($this);
}
}
$ao = new AO(new Test);
var_dump(get_object_vars($ao));
var_dump($ao->getObjectVars());
?>
--EXPECT--
array(0) {
}
array(1) {
["test"]=>
NULL
}