3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'word1&word2 !word3 word4 &word5'; var_export( preg_split('/ |(?=[&!])/', $string, 0, PREG_SPLIT_NO_EMPTY) );

preferences:
23.89 ms | 405 KiB | 5 Q