xref: /PHP-7.2/Zend/tests/bug40757.phpt (revision 610c7fbe)
1--TEST--
2Bug #40757 (get_object_vars() get nothing in child class)
3--FILE--
4<?php
5class Base {
6  private $p1='sadf';
7
8  function getFields($obj){
9    return get_object_vars($obj);
10  }
11}
12
13class Child extends Base { }
14
15$base=new Base();
16print_r($base->getFields(new Base()));
17$child=new Child();
18print_r($child->getFields(new Base()));
19?>
20--EXPECT--
21Array
22(
23    [p1] => sadf
24)
25Array
26(
27    [p1] => sadf
28)
29