3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "123456-12345", "12345678901", "12345678", "1312345678912", "12345678901", "1234567890123", "12345-12345", "1234567-12345", "123456", "12345678901234", "1234567890", "123456789088", "123456789-12345", "1111111111111111111" ]; $pattern = "/^(?:\d{6}-\d+|\d{8}|\d{11}|\d{13})$/"; foreach ($strings as $str) { if (preg_match($pattern, $str)) { echo "Match --> $str"; } else { echo "No match --> $str"; } echo PHP_EOL; }
Output for rfc.property-hooks, git.master, git.master_jit
Match --> 123456-12345 Match --> 12345678901 Match --> 12345678 Match --> 1312345678912 Match --> 12345678901 Match --> 1234567890123 No match --> 12345-12345 No match --> 1234567-12345 No match --> 123456 No match --> 12345678901234 No match --> 1234567890 No match --> 123456789088 No match --> 123456789-12345 No match --> 1111111111111111111

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:
47.74 ms | 1464 KiB | 4 Q