3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $targets = array('\\','/',':','*','?','"','<','>','|','-', ' '); $replace = '_'; $samples = array( 'c:\Windows\win.com', '/chat/stackoverflow/com/rooms/11.php', 'I like goats' ); $results = array(); foreach ($samples as $s) { print $s."\n".str_replace($targets, $replace, $s)."\n\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
c:\Windows\win.com c__Windows_win.com /chat/stackoverflow/com/rooms/11.php _chat_stackoverflow_com_rooms_11.php I like goats I_like_goats