3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; function __construct() { $this->bar = "bar"; } function bar() { return $this->bar; } } $foo = new Foo(); echo $foo->bar;
based on eEOGP
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access private property Foo::$bar in /in/LmfbL:18 Stack trace: #0 {main} thrown in /in/LmfbL on line 18
Process exited with code 255.
Output for 5.3.19 - 5.6.21
Fatal error: Cannot access private property Foo::$bar in /in/LmfbL on line 18
Process exited with code 255.