3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match_all('/(?J)(?<string>.*)1|(?<string>.*)2|(?<string>.*)3$/', "text2\npext3", $matches, PREG_SET_ORDER); var_dump($matches); preg_match_all('/(?J)(?<string>.*)1|(?<string>.*)2|(?<string>.*)3$/', "text2\npext3", $matches); var_dump($matches);
Output for 4.4.6 - 4.4.9, 5.2.2 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.0.0 - 7.0.27, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
array(2) { [0]=> array(4) { [0]=> string(5) "text2" ["string"]=> string(4) "text" [1]=> string(0) "" [2]=> string(4) "text" } [1]=> array(5) { [0]=> string(5) "pext3" ["string"]=> string(4) "pext" [1]=> string(0) "" [2]=> string(0) "" [3]=> string(4) "pext" } } array(5) { [0]=> array(2) { [0]=> string(5) "text2" [1]=> string(5) "pext3" } ["string"]=> array(2) { [0]=> string(0) "" [1]=> string(4) "pext" } [1]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } [2]=> array(2) { [0]=> string(4) "text" [1]=> string(0) "" } [3]=> array(2) { [0]=> string(0) "" [1]=> string(4) "pext" } }
Output for 5.2.0 - 5.2.1
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 7 in /in/fnm76 on line 5 NULL Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 7 in /in/fnm76 on line 8 NULL
Output for 4.3.11, 4.4.0 - 4.4.4, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Warning: preg_match_all(): Compilation failed: unrecognized character after (? at offset 2 in /in/fnm76 on line 5 array(0) { } Warning: preg_match_all(): Compilation failed: unrecognized character after (? at offset 2 in /in/fnm76 on line 8 array(0) { }
Output for 4.4.5
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 7 in /in/fnm76 on line 5 array(0) { } Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 7 in /in/fnm76 on line 8 array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unrecognized character after (? at offset 2 in /in/fnm76 on line 5 array(0) { } Warning: Compilation failed: unrecognized character after (? at offset 2 in /in/fnm76 on line 8 array(0) { }

preferences:
259.75 ms | 402 KiB | 383 Q