3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $postcode = 'SW196QX'; // Validate the postcode if (preg_match( '/^GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKPSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})$/', $postcode ) === 1) { echo 'Invalid'; } else { echo 'Valid'; }
Output for 7.0.19 - 7.0.32, 7.1.5 - 7.2.12
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 8 in /in/eqdsr on line 8 Valid
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 8 in /in/eqdsr on line 7 Valid
Output for hhvm-3.22.0
Warning: Compilation failed: unmatched parentheses at offset 8 in /in/eqdsr on line -1 Valid
Output for hhvm-3.10.1 - 3.21.3
Warning: Compilation failed: unmatched parentheses at offset 8 in /in/eqdsr on line 9 Valid
Output for 5.3.18 - 5.6.38
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 8 in /in/eqdsr on line 9 Valid