3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $foo; } class Bar extends Foo { protected $foo; }
Output for 5.6.0 - 5.6.30, 7.1.0 - 7.2.4
Fatal error: Access level to Bar::$foo must be public (as in class Foo) in /in/8vbr3 on line 11
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Access level to Bar::$foo() must be public (as in class Foo) or weaker in /in/8vbr3:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Access level to Bar::$foo() must be public (as in class Foo) or weaker in /in/8vbr3:8 Stack trace: #0 {main}
Process exited with code 255.