3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class First { protected $example; public function __construct() { $this->example = 'example'; } } class Second extends First { } $s = new Second(); var_dump($s->example);
Output for 7.0.0 - 7.2.0
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.
Output for 5.3.19 - 5.6.28
Fatal error: Cannot access protected property Second::$example in /in/CdHX5 on line 17
Process exited with code 255.