3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function show() { echo __CLASS__; } } $key = ''; $arr = array('' => new foo()); var_dump($arr, $key, $arr[$key]->show());
based on ZFUt9
Output for 5.0.0 - 7.1.0
fooarray(1) { [""]=> object(foo)#1 (0) { } } string(0) "" NULL
Output for 4.3.0 - 4.4.9
fooarray(1) { [""]=> object(foo)(0) { } } string(0) "" NULL