3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_multiupdate_from_keys(array &$array, array $keys, $value){ if(!empty($keys)){ $key = array_shift($keys); if(key_exists($key, $array)){ count($keys) > 0 ? array_multiupdate_from_keys($array[$key], $keys, $value) : $array[$key] = $value; } } } $array = array( 'a' => 'a', 'b' => 'b', 'c' => array( 0 => 0, 1 => 1, 2 => array( 'foo', 'bar' ) ) ); array_multiupdate_from_keys($array, array('c', 1, 0), 'updated'); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_multiupdate_from_keys(): Argument #1 ($array) must be of type array, int given, called in /in/bIPKX on line 7 and defined in /in/bIPKX:3 Stack trace: #0 /in/bIPKX(7): array_multiupdate_from_keys(1, Array, 'updated') #1 /in/bIPKX(7): array_multiupdate_from_keys(Array, Array, 'updated') #2 /in/bIPKX(25): array_multiupdate_from_keys(Array, Array, 'updated') #3 {main} thrown in /in/bIPKX on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
58.78 ms | 401 KiB | 8 Q