3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "http://regex101.", "http://www.regex101.", "https://regex101.", "https://www.regex101.", "https://www.mydomain.", "https://mydomain." ]; $pattern = "~^https?://(?:www\.)?+(?!mydomain\.)\S+$~"; foreach ($strings as $s) { if (preg_match($pattern, $s)) { echo "Match: $s" . PHP_EOL; } else { echo "No match: $s" . PHP_EOL; } }
Output for git.master, git.master_jit, rfc.property-hooks
Match: http://regex101. Match: http://www.regex101. Match: https://regex101. Match: https://www.regex101. No match: https://www.mydomain. No match: https://mydomain.

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:
111.27 ms | 1447 KiB | 4 Q