3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { private $name; private $age; function __construct() { $this->name ="manzoor"; $this->age =28; } } $foo = new foo(); echo $foo->name; echo $foo->{$name};
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Cannot access private property foo::$name in /in/Upkqg:14 Stack trace: #0 {main} thrown in /in/Upkqg on line 14
Process exited with code 255.
Output for 5.3.7 - 5.6.28, hhvm-3.10.0 - 3.12.0
Fatal error: Cannot access private property foo::$name in /in/Upkqg on line 14
Process exited with code 255.