- Output for 7.1.0 - 7.1.16, 7.2.0 - 7.2.4
- Fatal error: Access level to C::$x must be protected (as in class B) or weaker in /in/L11de on line 15
Process exited with code 255.
<?php
class B {
protected $x = 'x';
function foo() {
return $this->x;
}
}
class C extends B {
private $x = 'y';
function foo() {
return $this->x . parent::foo();
}
}
$c = new C;
var_export($c->foo());