3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myString = "apple^;ball^room^mouse^bat^;cricket^news^man^"; var_export(implode(' ', preg_split('/\^[^;]*;?/', $myString, 0, PREG_SPLIT_NO_EMPTY)));

preferences:
31.99 ms | 406 KiB | 5 Q