3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ////////// CONFIGURATION ///////////////// $ips_array=array("PC_1_NAME:172.19.144.10","PC_2_NAME:172.19.144.11","PC_3_NAME:172.19.144.10"); function ping($PC,$ip){ $cmd=shell_exec("ping -c 1 -w 200 $ip"); $dati_mount=explode(",",$cmd); if (eregi ("0", $dati_mount[1], $out)) {$connesso="<img src=\"off.gif\">";} if (eregi ("1", $dati_mount[1], $out)) {$connesso="<img src=\"on.gif\">";} $esito="$connesso [$ip] <b>$PC</b><br>"; return $esito; } while(list($k,$v)=each($ips_array)){ $dati_ip=explode(":",$v); $esito=ping($dati_ip[0],$dati_ip[1]); echo $esito; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function eregi() in /in/Qn2Jt:8 Stack trace: #0 /in/Qn2Jt(16): ping('PC_1_NAME', '172.19.144.10') #1 {main} thrown in /in/Qn2Jt on line 8
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_1_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.11] <b>PC_2_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Deprecated: Function eregi() is deprecated in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_3_NAME</b><br>
Output for 5.0.4 - 5.2.17
Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_1_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.11] <b>PC_2_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_3_NAME</b><br>
Output for 4.3.0 - 5.0.3
Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_1_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.11] <b>PC_2_NAME</b><br> Notice: Undefined offset: 1 in /in/Qn2Jt on line 8 Notice: Undefined offset: 1 in /in/Qn2Jt on line 9 Notice: Undefined variable: connesso in /in/Qn2Jt on line 10 [172.19.144.10] <b>PC_3_NAME</b><br>