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' ); print '<table>'; $results = array(); foreach ($samples as $s) { print '<tr><td>'.$s.'</td><td>'.str_replace($targets, $replace, $filename).'</td><tr>'; } print '</table>';
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<table> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>c:\Windows\win.com</td><td></td><tr> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>/chat/stackoverflow/com/rooms/11.php</td><td></td><tr> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>I like goats</td><td></td><tr></table>
Output for 4.3.0 - 5.0.3
<table> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>c:\Windows\win.com</td><td></td><tr> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>/chat/stackoverflow/com/rooms/11.php</td><td></td><tr> Notice: Undefined variable: filename in /in/gMogo on line 15 <tr><td>I like goats</td><td></td><tr></table>