3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $r1 = '/(?!<r)rn/'; $r2 = '(r(?:r(*SKIP)(*FAIL)|)n)'; var_dump(preg_match($r1, "rrn", $m1), $m1); var_dump(preg_match($r2, "rrn", $m2), $m2);
Output for 4.4.9, 5.2.5 - 7.1.0
int(1) array(1) { [0]=> string(2) "rn" } int(0) array(0) { }
Output for 5.2.0 - 5.2.4
int(1) array(1) { [0]=> string(2) "rn" } Warning: preg_match(): Compilation failed: nothing to repeat at offset 6 in /in/DWLbU on line 7 bool(false) NULL
Output for 4.3.11 - 4.4.8, 5.0.0 - 5.1.6
int(1) array(1) { [0]=> string(2) "rn" } Warning: preg_match(): Compilation failed: nothing to repeat at offset 6 in /in/DWLbU on line 7 bool(false) array(0) { }
Output for 4.3.0 - 4.3.10
int(1) array(1) { [0]=> string(2) "rn" } Warning: Compilation failed: nothing to repeat at offset 6 in /in/DWLbU on line 7 bool(false) array(0) { }