3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function tg($T) { foreach ($T['i'] as $i) { $T['i'] = $i + 1; } $T['i'] = array_unique($T['i']); } tg(array(1, 1, 3, 5));
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: i in /in/T5eKD on line 4 Warning: Invalid argument supplied for foreach() in /in/T5eKD on line 4 Notice: Undefined index: i in /in/T5eKD on line 8 Warning: array_unique() expects parameter 1 to be array, null given in /in/T5eKD on line 8
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: i in /in/T5eKD on line 4 Warning: Invalid argument supplied for foreach() in /in/T5eKD on line 6 Notice: Undefined index: i in /in/T5eKD on line 8 Warning: Invalid operand type was used: tg expects array(s) in /in/T5eKD on line 8
Output for 5.2.1 - 5.2.17
Notice: Undefined index: i in /in/T5eKD on line 4 Warning: Invalid argument supplied for foreach() in /in/T5eKD on line 4 Notice: Undefined index: i in /in/T5eKD on line 8 Warning: array_unique(): The argument should be an array in /in/T5eKD on line 8
Output for 4.3.2 - 4.3.10, 4.4.0 - 5.2.0
Warning: Invalid argument supplied for foreach() in /in/T5eKD on line 4 Warning: array_unique(): The argument should be an array in /in/T5eKD on line 8
Output for 4.3.11
Warning: array_unique(): The argument should be an array in /in/T5eKD on line 8
Output for 4.3.0 - 4.3.1
Warning: Invalid argument supplied for foreach() in /in/T5eKD on line 4 Warning: array_unique() [http://www.php.net/function.array-unique]: The argument should be an array in /in/T5eKD on line 8