3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = new ArrayIterator( array( 'foo' => 1, 'bar' => 2, ) ); $keys = array_keys( $x ); if ( ! empty( $keys ) && is_array( $keys ) ) { print "PASS"; } else { print "FAIL"; }
based on vIFPF
Output for 5.3.0 - 7.2.6
Warning: array_keys() expects parameter 1 to be array, object given in /in/bdoq5 on line 7 FAIL
Output for 5.0.0 - 5.2.17
Warning: array_keys(): The first argument should be an array in /in/bdoq5 on line 7 FAIL
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/bdoq5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/bdoq5 on line 3