3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = array( "id" => 1, "char1" => 2, "char2" => 3, "char3" => 4, ); $needles = array(2, 4); function in_array_any($needles, $haystack) { unset($haystack['id']); return !array_diff($needles, $haystack); } $exists = in_array_any([2, 4], $haystack); // true var_dump($exists); $exists = in_array_any([1, 3], $haystack); // true var_dump($exists);
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) 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:
27.65 ms | 405 KiB | 5 Q