3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isUrl($value) { $alpha = "a-z\x80-\xFF"; $domain = "[0-9$alpha](?:[-0-9$alpha]{0,61}[0-9$alpha])?"; $topDomain = "[$alpha](?:[-0-9$alpha]{0,17}[$alpha])?"; return (bool) preg_match("(^https?://(?:(?:$domain\\.)*$topDomain|\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}|\[[0-9a-f:]{3,39}\])(:\\d{1,5})?(/\\S*)?\\z)i", $value); } var_dump($isUrl("https://test.cz")); var_dump($isUrl("http://test.cz")); var_dump($isUrl("https://www.test.cz")); var_dump($isUrl("http://www.test.cz"));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $isUrl in /in/XjoQV on line 11 Fatal error: Uncaught Error: Value of type null is not callable in /in/XjoQV:11 Stack trace: #0 {main} thrown in /in/XjoQV on line 11
Process exited with code 255.

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:
44.51 ms | 401 KiB | 8 Q