3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ "_token" => "62d46d4h6dfh841df8h", "sku62" => "3e", "name62" => "meh", "sku61" => "3e", "name61" => "mah", "sku64" => "3e", "name64" => "moh" ]; $array2 = [64, 74, 61]; var_export( array_intersect_ukey( $array1, array_flip($array2), fn($a, $b) => ltrim($a, 'a..z') <=> ltrim($b, 'a..z') ) ); echo "\n---\n"; $lookup = array_flip($array2); var_export( array_filter( $array1, fn($key) => isset($lookup[ltrim($key, 'a..z')]), ARRAY_FILTER_USE_KEY ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'sku61' => '3e', 'sku64' => '3e', ) --- array ( 'sku61' => '3e', 'name61' => 'mah', 'sku64' => '3e', 'name64' => 'moh', )

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