3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array( 'test1', 't1;t2;t3', '', null, ); foreach ( $tests as $i => $str ) { var_dump(array_shift(explode(';',$str))); }

preferences:
35.68 ms | 402 KiB | 5 Q