3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php$host= 'www.google.c0m'; $cmd = "ping $host"; $output = shell_exec($cmd); $error= "no pudo"; if (stristr($output,$error)){ echo '<font color=red><h1>El host ' . $host .' NO responde a ping </h1></font>'; } else { echo '<font color=green><h1>El host ' . $host .' SI responde a ping </h1></font>'; } ?>
Output for 5.4.0 - 5.4.32
<?php$host= 'www.google.c0m'; $cmd = "ping $host"; $output = shell_exec($cmd); $error= "no pudo"; if (stristr($output,$error)){ echo '<font color=red><h1>El host ' . $host .' NO responde a ping </h1></font>'; } else { echo '<font color=green><h1>El host ' . $host .' SI responde a ping </h1></font>'; } ?>