3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [ 123 => ['name' => 'xxx'], 456 => ['name' => 'yyy'], ]; echo \array_key_exists(123, $x) ? 'yes' : 'no'; echo "\n"; $x = [ ['id' => 123, 'name' => 'xxx'], ['id' => 456, 'name' => 'yyy'], ]; $check = 123; $y = \array_filter($x, function ($value) use ($check) { return $value['id'] === $check; }); echo \count($y) ? 'yes' : 'no'; // if array child id === 123 in any of the children, // then echo yes, // (without using a loop, and by using an array function)
Output for git.master_jit, git.master, rfc.property-hooks
yes yes

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:
33.1 ms | 401 KiB | 8 Q