3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Check if an array contains any value in a set. ** * @param array $array * @param array $subset * @param bool $strict Strict type checking * @return bool */ $a=array(1,'test'); $b=array(2,'test'); function array_contains_any_val(array $array, array $subset, bool $strict = false) :bool { $contains = false; foreach ($subset as $value) { if (in_array($value, $array, $strict)) { $contains = true; break; } } return $contains; } var_dump(array_contains_any_val($a, $b));
Output for git.master, git.master_jit, rfc.property-hooks
bool(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:
30.59 ms | 405 KiB | 5 Q