3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $n = "Chan"; $str = ")24.231.23.2 " + $n + ":"; $pattern="/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} " + $n + "/"; preg_match($pattern, $str, $m); echo $m[0]; //str_replace(" " + $n, "", $m[0], $r); //$ip = $r[0]; // Should return 24.231.23.2 //echo $ip;
Output for 7.1.0
Warning: A non-numeric value encountered in /in/Vksp7 on line 3 Warning: A non-numeric value encountered in /in/Vksp7 on line 3 Warning: A non-numeric value encountered in /in/Vksp7 on line 3 Warning: A non-numeric value encountered in /in/Vksp7 on line 4 Warning: A non-numeric value encountered in /in/Vksp7 on line 4 Warning: A non-numeric value encountered in /in/Vksp7 on line 4 Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Vksp7 on line 5
Output for 5.2.0 - 7.0.14
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Vksp7 on line 5
Output for 4.3.11 - 5.0.5, 5.1.1 - 5.1.6
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Vksp7 on line 5 Notice: Undefined offset: 0 in /in/Vksp7 on line 6
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Vksp7 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.10
Warning: Delimiter must not be alphanumeric or backslash in /in/Vksp7 on line 5 Notice: Undefined offset: 0 in /in/Vksp7 on line 6