<?php
abstract class First {
protected $example;
public function __construct()
{
$this->example = 'example';
}
}
class Second extends First {
}
$s = new Second();
var_dump($s->example);
Fatal error: Uncaught Error: Cannot access protected property Second::$example in /in/CdHX5:17
Stack trace:
#0 {main}
thrown in /in/CdHX5 on line 17
Process exited with code 255.