3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_array = ['A1'=>'Data1','A2'=>'Data2','A3'=>'Data3','A4'=>'Data4','A5'=>'Data5']; $allowed = ['0'=>'A1','1'=>'A2','2'=>'A3']; $filtered = array_filter( $my_array, function ($key) use ($allowed) { return in_array($key, $allowed); }, ARRAY_FILTER_USE_KEY ); var_dump($filtered);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["A1"]=> string(5) "Data1" ["A2"]=> string(5) "Data2" ["A3"]=> string(5) "Data3" }

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