3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { } $b = new Test(); $a = array($b => 'foo'); var_dump($a[$b]);
Output for 5.2.3 - 7.1.0
Warning: Illegal offset type in /in/1eJsW on line 8 Warning: Illegal offset type in /in/1eJsW on line 11 NULL
Output for 4.3.9 - 5.2.2
<br /> <b>Warning</b>: Illegal offset type in <b>/in/1eJsW</b> on line <b>8</b><br /> <br /> <b>Warning</b>: Illegal offset type in <b>/in/1eJsW</b> on line <b>11</b><br /> NULL
Output for 4.3.0 - 4.3.8
<br /> <b>Warning</b>: Illegal offset type in <b>/in/1eJsW</b> on line <b>11</b><br /> NULL