mirror of
https://github.com/php/php-src.git
synced 2025-01-06 02:43:34 +08:00
a5fa51afbb
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.
31 lines
447 B
PHP
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
|
|
}
|