3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^\h*+\K.{0,11}\S(?!\S)/m'; $str = 'this is a test sentence this is a test sentence a b c'; preg_match_all($re, $str, $matches); var_export($matches[0]);

preferences:
61.37 ms | 405 KiB | 5 Q