3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Dummy { public $pub = 0; protected $prot = 1; private $priv = 2; } $dummy = new Dummy(); var_dump((array) $dummy); foreach ((array) $dummy as $name => $val) { $tpl->$name = $val; }
Output for 7.0.0 - 7.1.0
array(3) { ["pub"]=> int(0) ["*prot"]=> int(1) ["Dummypriv"]=> int(2) } Warning: Creating default object from empty value in /in/RULeq on line 13 Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/RULeq:13 Stack trace: #0 {main} thrown in /in/RULeq on line 13
Process exited with code 255.
Output for 5.4.0 - 5.6.28
array(3) { ["pub"]=> int(0) ["*prot"]=> int(1) ["Dummypriv"]=> int(2) } Warning: Creating default object from empty value in /in/RULeq on line 13 Fatal error: Cannot access property started with '\0' in /in/RULeq on line 13
Process exited with code 255.
Output for 5.0.5 - 5.3.29
array(3) { ["pub"]=> int(0) ["*prot"]=> int(1) ["Dummypriv"]=> int(2) } Strict Standards: Creating default object from empty value in /in/RULeq on line 13 Fatal error: Cannot access property started with '\0' in /in/RULeq on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.4
array(3) { ["pub"]=> int(0) ["*prot"]=> int(1) ["Dummypriv"]=> int(2) } Strict Standards: Creating default object from empty value in /in/RULeq on line 13
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/RULeq on line 3
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/RULeq on line 3
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/RULeq on line 3
Process exited with code 255.