3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tests = array( 'test1', 't1;t2;t3', '', null, ); foreach ( $tests as $i => $str ) { var_dump(array_shift(explode(';',$str))); }
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/NtkbK on line 10 string(5) "test1" Notice: Only variables should be passed by reference in /in/NtkbK on line 10 string(2) "t1" Notice: Only variables should be passed by reference in /in/NtkbK on line 10 string(0) "" Notice: Only variables should be passed by reference in /in/NtkbK on line 10 string(0) ""
Output for 5.1.0 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/NtkbK on line 10 string(5) "test1" Strict Standards: Only variables should be passed by reference in /in/NtkbK on line 10 string(2) "t1" Strict Standards: Only variables should be passed by reference in /in/NtkbK on line 10 string(0) "" Strict Standards: Only variables should be passed by reference in /in/NtkbK on line 10 string(0) ""
Output for 5.0.5
Fatal error: Only variables can be passed by reference in /in/NtkbK on line 10
Process exited with code 255.
Output for 4.3.0 - 5.0.4
string(5) "test1" string(2) "t1" string(0) "" string(0) ""