- Output for 8.3.5 - 8.3.26, 8.4.9 - 8.4.13
- array(2) { ["prop"]=> string(8) "A::$prop" ["prop"]=> string(8) "B::$prop" } string(4) "prop" string(8) "A::$prop" string(4) "prop" string(8) "B::$prop"
<?php
class A {
private $prop = 'A::$prop';
public function __construct() {
var_dump(get_object_vars($this));
foreach ($this as $name => $prop) {
var_dump($name, $prop);
}
}
}
class B extends A {
protected $prop = 'B::$prop';
}
new B;