3v4l.org

run code in 300+ PHP versions simultaneously
<?php //The values in this arrays contains the names of the indexes (keys) that should exist in the data array $required = array('key1', 'key2', 'key30' ); $data = array( 'key1' => 10, 'key2' => 20, 'key3' => 30, 'key4' => 40 ); if(count(array_intersect_key(array_flip($required), $data)) === count($required)) { echo "all exist"; }else{ echo "fail"; }
Output for git.master, git.master_jit, rfc.property-hooks
fail

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