3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fp = $fp = fopen(__FILE__, "r"); class classA { public function __toString() { return "Class A object"; } } $a = array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'); var_dump($a); var_dump(array_combine($a, $a));
Output for 5.3.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/CdYaE on line 8 Warning: Illegal offset type in /in/CdYaE on line 8 array(1) { [""]=> string(5) "hello" } array(1) { ["hello"]=> string(5) "hello" }
Output for hhvm-3.12.0
Warning: Invalid operand type was used: Invalid type used as key in /in/CdYaE on line 8 array(2) { [""]=> string(5) "hello" [4]=> string(8) "resource" } array(2) { ["hello"]=> string(5) "hello" ["resource"]=> string(8) "resource" }
Output for hhvm-3.10.0

Process exited with code 153.