3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str='a-1-2-3-4'; list($a, $b, $c) = (explode('-', $str, 4) + array_fill(0, 3, NULL)); echo $a; echo $b; echo $c;
based on 0nN4v
Output for 4.3.0 - 7.2.0
a12