3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "foo" => "no", "foo_contact_firstname" => "Mark", "foo_email" => "mark@gmail.com", "foo_address1" => "91", "foo_address2" => "old road", "foo_bill" => "no", "bar" => "yes", "bar_contact_lastname" => null, "bar_telephone" => null, "bar_email" => null, "bar_address1" => null, "bar_address2" => null, "bar_address3" => null, "bar_address4" => null, "bar_address5" => null, "bar_postcode" => null, "register_contact_firstname" => null, "register_contact_lastname" => null, "register_telephone" => null, "register_email" => null, "register_address1" => null, "register_address2" => null, "register_address3" => null, "register_address4" => null, "register_address5" => null, "register_postcode" => null, ]; $test = array_filter($array, function($key) { return strpos($key, "foo") === 0; }, ARRAY_FILTER_USE_KEY ); var_dump($test);
Output for git.master_jit, git.master, rfc.property-hooks
array(6) { ["foo"]=> string(2) "no" ["foo_contact_firstname"]=> string(4) "Mark" ["foo_email"]=> string(14) "mark@gmail.com" ["foo_address1"]=> string(2) "91" ["foo_address2"]=> string(8) "old road" ["foo_bill"]=> string(2) "no" }

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:
66.14 ms | 402 KiB | 8 Q