3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cars = [ 0 => ["id" => 1, "name" => "FORD"], 1 => ["id" => 2, "name" => "BMW"], 2 => ["id" => 3, "name" => "FIAT"], 3 => ["id" => 4, "name" => "RENAULT"], 4 => ["id" => 5, "name" => "BENTLEY"], ]; $selection = [ 0 => "1", 1 => "3", 2 => "4" ]; $carsBySelection = array_filter($cars, function($car) use ($selection) { return in_array($car["id"], $selection); }); print_r($carsBySelection);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [id] => 1 [name] => FORD ) [2] => Array ( [id] => 3 [name] => FIAT ) [3] => Array ( [id] => 4 [name] => RENAULT ) )

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:
105.65 ms | 406 KiB | 5 Q