--TEST-- Redeclare inherited public property as protected. --FILE-- p . "\n"; } } class B extends A { protected $p = "B::p"; function showB() { echo $this->p . "\n"; } } $a = new A; $a->showA(); $b = new B; $b->showA(); $b->showB(); ?> --EXPECTF-- Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18