3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function formatToId( $str ) { return str_replace( " " , "-" , strtolower( $str )); } $metals = array( 'Or blanc' , 'Or jaune' , 'Or noir' , 'Or rose' , 'Platine'); echo var_dump($metals_key = array_map( "formatToId" , $metals )); //array_fill_keys( $metals_key , $metals );
based on MdcsO
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.2.0
array(5) { [0]=> string(8) "or-blanc" [1]=> string(8) "or-jaune" [2]=> string(7) "or-noir" [3]=> string(7) "or-rose" [4]=> string(7) "platine" }
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/gd8Bp on line 8
Process exited with code 255.