3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('one', 'two'); $b = array('two'); $c = array_diff($a, $b); $c[] = 'three'; var_dump($c);
based on fj1tC
Output for 7.0.0 - 7.2.0
array(2) { [0]=> string(3) "one" [1]=> string(5) "three" }
Output for 5.3.21 - 5.6.28
array(2) { [0]=> string(3) "one" [2]=> string(5) "three" }