3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * So if you have 2 arrays holding either a string or integer and a key * holding an array, after php5.3, you'll get these error messages. Weird * that the behaviour has changed. */ $a = array(1, 2, 3, 4); $b = array(1, 2, 3 => array(1), 4); $diff = array_diff($a, $b); print_r( $diff );
based on ZNp7i
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/04KfO on line 12 Array ( [2] => 3 )
Output for 5.4.12 - 5.6.28
Notice: Array to string conversion in /in/04KfO on line 12 Notice: Array to string conversion in /in/04KfO on line 12 Notice: Array to string conversion in /in/04KfO on line 12 Array ( [2] => 3 )
Output for 5.3.22 - 5.3.29
Array ( [2] => 3 )