3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a1 = array( 'one', 'two', 'three', 'four' ); $a2 = array_diff( $a1, array( 'one', 'two', 'three', 'four' ) ); $a3 = $a2; $a3[] = 'five'; print_r($a3);
based on P3tEe
Output for 4.3.0 - 5.4.32, 5.5.0 - 5.5.16, 5.6.0, 7.0.0 - 7.1.0
Array ( [0] => five )
Output for 5.4.34 - 5.4.45, 5.5.18 - 5.5.38, 5.6.1 - 5.6.28
Array ( [4] => five )