3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php Class MyClass { private $prop1 = "foo"; private $prop2 = "bar"; public function func1() { global $prop1; global $prop2; // by declaring global variables inside this method, it works! echo $prop1; } } obj1 = new MyClass(); obj1->func1();
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '=' in /in/7WfE6 on line 18
Process exited with code 255.