3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ppr($array){ echo '<pre>'; print_r($array); echo '</pre>'; } $brand = 'Fox'; $list = array('Ape','Bat','Cat','Dog','Elk','Fox','G','Hen'); unset($list[$brand]); ppr($list); array_unshift($list,$brand); ppr($list);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => Ape [1] => Bat [2] => Cat [3] => Dog [4] => Elk [5] => Fox [6] => G [7] => Hen ) </pre><pre>Array ( [0] => Fox [1] => Ape [2] => Bat [3] => Cat [4] => Dog [5] => Elk [6] => Fox [7] => G [8] => Hen ) </pre>