3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $keys = array(1,2,3,6,9); //note that 9 does not exist as key in the $values array $values = array('000', '001', '002', '003', '004', '005', '006', '007'); $new = array_map( function( $key) use( $values) { return isset( $values[$key]) ? $values[ $key ]; }, array_intersect( $keys, array_keys( $values)); var_dump( $new);
Output for 5.3.0 - 5.4.9
Parse error: syntax error, unexpected ';' in /in/nnDun on line 5
Process exited with code 255.