3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a['abc']['def']['ghi'] = 'meukee!'; function getArrayValueByKeys(array $array, $key, ...$keys) { if (isset($array[$key])) return getArrayValueByKeys($array[$key], ...$keys); throw new Exception; } echo getArrayValueByKeys($a, ...['abc', 'def', 'ghi']); echo getArrayValueByKeys($a, ...['ddd', 'def', 'ghi']);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: getArrayValueByKeys(): Argument #1 ($array) must be of type array, string given, called in /in/gh8Zo on line 8 and defined in /in/gh8Zo:5 Stack trace: #0 /in/gh8Zo(8): getArrayValueByKeys('meukee!') #1 /in/gh8Zo(8): getArrayValueByKeys(Array, 'ghi') #2 /in/gh8Zo(8): getArrayValueByKeys(Array, 'def', 'ghi') #3 /in/gh8Zo(14): getArrayValueByKeys(Array, 'abc', 'def', 'ghi') #4 {main} thrown in /in/gh8Zo on line 5
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:
38.52 ms | 402 KiB | 8 Q