mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
7ec48cb37f
Fixed bug #41929 (Foreach on object does not iterate over all visible properties)
29 lines
402 B
PHP
Executable File
29 lines
402 B
PHP
Executable File
--TEST--
|
|
Bug #40757 (get_object_vars() get nothing in child class)
|
|
--FILE--
|
|
<?php
|
|
class Base {
|
|
private $p1='sadf';
|
|
|
|
function getFields($obj){
|
|
return get_object_vars($obj);
|
|
}
|
|
}
|
|
|
|
class Child extends Base { }
|
|
|
|
$base=new Base();
|
|
print_r($base->getFields(new Base()));
|
|
$child=new Child();
|
|
print_r($child->getFields(new Base()));
|
|
?>
|
|
--EXPECT--
|
|
Array
|
|
(
|
|
[p1] => sadf
|
|
)
|
|
Array
|
|
(
|
|
[p1] => sadf
|
|
)
|