3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasNonEmptyArray(array $array): bool { try { array_walk_recursive( $array, fn($v, $k) => throw new Exception("Found element $k\n") ); return false; } catch (Exception $e) { echo $e->getMessage(); return true; } } $array = [ [ 'one' => [], 'two' => [ 'a' => [ 'foo' => [], ], 'b' => [] ], 'three' => [ 'c' => [ 'fizz' => 'buzz' ] ] ] ]; var_export(hasNonEmptyArray($array));
Output for git.master_jit, git.master
Found element fizz true

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:
43.48 ms | 405 KiB | 5 Q