3v4l.org

run code in 300+ PHP versions simultaneously
<?php $opts = array ( 'English', //'French', 'Spanish', //'Hindi', //'Korean', ); $langs = array ( 'English', 'French', 'Spanish', 'Hindi', 'Korean', ); $recs = array ( array ('name' => 'Bart Simpson', 'lang' => 'English, Spanish'), array ('name' => 'Homer Simpson', 'lang' => 'English'), array ('name' => 'Marge Simpson', 'lang' => 'Hindi, Korean'), array ('name' => 'Lisa Simpson', 'lang' => 'English, French, Spanish, Hindi, Korean'), ); print 'looking for : ' . implode (', ', $opts) . "\n\n"; foreach ($recs as $r) { if (lang_match ($r, $opts)) print 'YES: ' . $r['name'] . ' - ' . $r['lang'] . "\n"; else print 'no: ' . $r['name'] . ' - ' . $r['lang'] . "\n"; } function lang_match ($r, $opts) { $rlang = preg_split ('/\s*,\s*/', $r['lang']); foreach ($opts as $o) if (! in_array ($o, $rlang)) return false; return true; }
Output for git.master, git.master_jit, rfc.property-hooks
looking for : English, Spanish YES: Bart Simpson - English, Spanish no: Homer Simpson - English no: Marge Simpson - Hindi, Korean YES: Lisa Simpson - English, French, Spanish, Hindi, Korean

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