3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // $x = hash('sha256', "\n", !true); // var_dump($x); class X { private $x=1; private $x1=1; protected $y=2; protected $y1=2; public $z=3; public $z1=3; public function a() { return 1; } } $x=new X(); var_dump((array) $x);
Output for 5.0.0 - 7.1.0
array(6) { ["Xx"]=> int(1) ["Xx1"]=> int(1) ["*y"]=> int(2) ["*y1"]=> int(2) ["z"]=> int(3) ["z1"]=> int(3) }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/PUJgk on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/PUJgk on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/PUJgk on line 7
Process exited with code 255.