3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Tests { } $a = array('Test' => 'foo'); $b = new Tests(); var_dump($a[$b]);
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/Wtp4p on line 10 NULL
Output for hhvm-3.12.0 - 3.13.2
Warning: Invalid operand type was used: Invalid type used as key in /in/Wtp4p on line 10 Fatal error: Uncaught Error: Object of class Tests could not be converted to string in /in/Wtp4p:10 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Warning: Invalid operand type was used: Invalid type used as key in /in/Wtp4p on line 10 Catchable fatal error: Object of class Tests could not be converted to string in /in/Wtp4p on line 10
Process exited with code 255.