3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match_all("/(?J)((?<A>a)!|(?<A>a)=(?<type>[si])) ((?<B>b)!|(?<B>b)=(?<type>[si]))/", "a! b=s a=i b!", $m, PREG_SET_ORDER); print_r($m);
Output for 4.4.6 - 4.4.9, 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => a! b=s [1] => a! [A] => [2] => a [3] => [type] => s [4] => [5] => b=s [B] => b [6] => [7] => b [8] => s ) [1] => Array ( [0] => a=i b! [1] => a=i [A] => a [2] => [3] => a [type] => i [4] => i [5] => b! [B] => b [6] => b ) )
Output for 5.2.0 - 5.2.1
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 8 in /in/ji18e on line 2
Output for 4.3.11 - 4.4.4, 5.0.0 - 5.1.6
Warning: preg_match_all(): Compilation failed: unrecognized character after (? at offset 2 in /in/ji18e on line 2 Array ( )
Output for 4.4.5
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 8 in /in/ji18e on line 2 Array ( )
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unrecognized character after (? at offset 2 in /in/ji18e on line 2 Array ( )