3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'store:key' => 1, 'user' => 'demo', 'store:foo' => 'bar', 'login' => true, ); if (PHP_VERSION_ID > 56000) { $return1 = array_filter($array, function ($e) { return strpos($e, 'store:') === 0; }, ARRAY_FILTER_USE_KEY); var_dump($return1); } $return2 = array_intersect_key($array, array_flip(array_filter(array_keys($array), function ($e) { return strpos($e, 'store:') === 0; }))); var_dump($return2);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["store:key"]=> int(1) ["store:foo"]=> string(3) "bar" } array(2) { ["store:key"]=> int(1) ["store:foo"]=> string(3) "bar" }

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:
29.33 ms | 405 KiB | 5 Q