3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $key = new stdClass(); $key->foo = "bar"; $arr = array( $key => "what's this?" ); print_r( $arr );
Output for 4.3.9 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/Y8PCQ on line 6 Array ( )
Output for hhvm-3.12.0
Warning: Invalid operand type was used: Invalid type used as key in /in/Y8PCQ on line -1 Array ( )
Output for hhvm-3.10.0
Warning: Invalid operand type was used: Invalid type used as key in /in/Y8PCQ on line 6 Array ( )
Output for 4.3.0 - 4.3.8
Array ( )