3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $values = array('a'=>1, 'b'=>2, 'c'=>3); $revisions = array('b'=>4, 'c'=>5, 'd'=>6); $fees = array(); foreach(array_keys($values + $revisions) as $key){ if(array_key_exists($key, $values) && array_key_exists($key, $revisions)){ $fees[$key] = $values[$key] + $revisions[$key]; } elseif(array_key_exists($key, $values)){ $fees[$key] = $values[$key]; } elseif(array_key_exists($key, $revisions)){ $fees[$key] = $revisions[$key]; } }
Output for 4.3.0 - 7.1.0