3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 'a'=>1, 'b'=>2, 'c'=>3 ); $b = array( 'b'=>3, 'c'=>4, 'd'=>5 ); $values = array(); foreach(array_keys($a + $b) as $key){ if(array_key_exists($key, $a) && array_key_exists($key, $b)){ $values[$key] = $a[$key] + $b[$key]; } elseif(array_key_exists($key, $a)){ $values[$key] = $a[$key]; } else(array_key_exists($key, $b)){ $values[$key] = $b[$key]; } } print_r($values);
Output for 5.3.0 - 5.4.4
Parse error: syntax error, unexpected '{' in /in/4GAUe on line 21
Process exited with code 255.