3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str= 'There must be a fast and efficient way to split a (text) string at the "nth" occurrence of a needle.'; var_export( preg_split('/([^ ]*\K ){2}/', $str, 2) );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
154.97 ms | 1736 KiB | 12 Q