3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_by_path($value, $path) { $curr = array_shift($path); if (!isset($value[$curr])) { return null; } elseif (is_array($value[$curr])) { return array_by_path($value[$curr]); } return $value; } $test = array( 'wot' => array( 'mate' => 'hello' ) ); echo array_by_path($test, ['wot', 'mate']);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function array_by_path(), 1 passed in /in/g6A5r on line 6 and exactly 2 expected in /in/g6A5r:3 Stack trace: #0 /in/g6A5r(6): array_by_path(Array) #1 /in/g6A5r(17): array_by_path(Array, Array) #2 {main} thrown in /in/g6A5r 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:
56.58 ms | 401 KiB | 8 Q