3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_keys_recursive(array $array) : array { foreach ($array as $key => $value) { if (is_array($value)) { $index[$key] = array_keys_recursive($value); } else { $index []= $key; } } return $index ?? []; } $a = ['a'=>11, 'b'=>2,'c'=>['r'=>5,'s'=>8]]; $b = ['a'=>1, 'b'=>2, 'c'=>['r'=>15,'s'=>18]]; var_dump(array_keys_recursive($a) === array_keys_recursive($b)); $a = ['a'=>11, 'b'=>2,'c'=>['r'=>5,'s'=>8]]; $b = ['a'=>1, 'c'=>2, 'b'=>['r'=>15,'s'=>18]]; var_dump(array_keys_recursive($a) === array_keys_recursive($b)); $a = ['a'=>11, 'b'=>2,'c'=>['r'=>5,'s'=>8]]; $b = ['a'=>1, 'b'=>2, 'c'=>['r1'=>15,'m'=>18]]; var_dump(array_keys_recursive($a) === array_keys_recursive($b));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(false) bool(false)

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