3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public $x = 1; // access modifiers effect property/method visibility not scope protected $y = 2; private $z = 3; } $o = new Test(); function Try(){ $f = new Test(); echo $f->x; } var_dump($GLOBALS['o']); var_dump($GLOBALS['f']);
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected 'Try' (T_TRY), expecting identifier (T_STRING) or '(' in /in/Wkocr on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_TRY, expecting T_STRING or '(' in /in/Wkocr on line 9
Process exited with code 255.