3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testRegExp($regexp, $string) { $valid = preg_match($regexp, $string); echo $string. " - " . ($valid ? "valid" : "invalid") ."\n"; } function matchRegExp($regexp, $text){ if(preg_match($regexp, $text, $matches)){ print_r($matches); }else{ echo "no match in text: ".$text; } echo "\n"; } // hledání emailu @seznam.cz v textu (zjednodušená verze) $regexpEmail = "/\b(?P<email>\w+@seznam\.cz)\b/"; matchRegExp($regexpEmail, "adsd dominik@seznam.cz ssdasd"); matchRegExp($regexpEmail, "adsd dominik@seam.cz ssdasd"); // validace IP adresy $regexpIp = "/^((25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)$/"; echo "Test IP\n"; testRegExp($regexpIp, "10.1.0.1"); testRegExp($regexpIp, "199.1.0.1"); testRegExp($regexpIp, "255.1.0.1"); testRegExp($regexpIp, "256.1.0.1"); testRegExp($regexpIp, "260.1.0.1"); testRegExp($regexpIp, "300.1.0.1"); testRegExp($regexpIp, "1.0.1"); testRegExp($regexpIp, "125.1..1"); testRegExp($regexpIp, "192.11.168.255"); testRegExp($regexpIp, "192.11.168.256"); testRegExp($regexpIp, "192.11.168.300");
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => dominik@seznam.cz [email] => dominik@seznam.cz [1] => dominik@seznam.cz ) no match in text: adsd dominik@seam.cz ssdasd Test IP 10.1.0.1 - valid 199.1.0.1 - valid 255.1.0.1 - valid 256.1.0.1 - invalid 260.1.0.1 - invalid 300.1.0.1 - invalid 1.0.1 - invalid 125.1..1 - invalid 192.11.168.255 - valid 192.11.168.256 - invalid 192.11.168.300 - invalid

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
71.14 ms | 402 KiB | 8 Q