3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function dotest($s) { list($x,$y) = explode( ' ', $s, 2); var_dump($x); var_dump($y); } dotest('test'); dotest('test and'); dotest('test and last');
Output for 5.5.0 - 7.1.0
Notice: Undefined offset: 1 in /in/a2597 on line 4 string(4) "test" NULL string(4) "test" string(3) "and" string(4) "test" string(8) "and last"
Output for 4.3.0 - 5.4.45
string(4) "test" NULL string(4) "test" string(3) "and" string(4) "test" string(8) "and last"