3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['type' => 'foo'], ]; function hasDependencyTypeLoop(array $dependencies, string $type): bool { foreach ($dependencies as ['type' => $currentType]) { if ($currentType === $type) { return true; } } return false; } function hasDependencyTypeArrayAny(array $dependencies, string $type): bool { return array_any($dependencies, fn() => $currentType === $type); } var_dump(hasDependencyTypeLoop($data, 'foo')); var_dump(hasDependencyTypeArrayAny($data, 'foo'));
Output for git.master, git.master_jit
bool(true) Warning: Undefined variable $currentType in /in/a7int on line 18 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:
29.78 ms | 405 KiB | 5 Q