3v4l.org

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