3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'asdf'; preg_match('/.(?<secondAndThird>(?<second>.)(.))(?<fourth>.)/n', $string, $m); var_export($m);
Output for 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.7
array ( 0 => 'asdf', 'secondAndThird' => 'sd', 1 => 'sd', 'second' => 's', 2 => 's', 'fourth' => 'f', 3 => 'f', )
Output for 8.1.0 - 8.1.34
Warning: preg_match(): Unknown modifier 'n' in /in/qBX2Z on line 4 NULL

preferences:
72.35 ms | 1006 KiB | 4 Q