3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { private $a = array(1, 2, 3); private $b = array('a' => 1, 'b' => 2, 'c' => 3); } $a = new A(); $b = clone $a; var_dump($b);
Output for 5.3.0 - 7.1.0
object(A)#2 (2) { ["a":"A":private]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } ["b":"A":private]=> array(3) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) } }
Output for 5.0.0 - 5.2.17
object(A)#2 (2) { ["a:private"]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } ["b:private"]=> array(3) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) } }
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/vmR5Q</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/vmR5Q</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/vmR5Q</b> on line <b>5</b><br />
Process exited with code 255.