- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Fatal error: Access level to B::$b must be protected (as in class A) or weaker in /in/DT2R1 on line 18
Process exited with code 255.
<?php
class A {
public $a = 3;
protected $b = 4;
private $c = 5;
}
class B extends A {
public $a = 9;
private $b = 8;
private $c = 7;
function doIt() {
return $this->a + $this->b + $this->c;
}
}
$b = new B();
echo $b->doIt();