3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mapping = [ "AccountId" => "account_id", "Id" => "master_id", "Name" => "name" ]; $input = [ "AccountId" => "18", "Id" => "53600065", "Name" => "Awesome Test Company From SS", "Financial" => [ "vat" => "12345", ] ]; $output = []; foreach ($mapping as $from => $to) { if (array_key_exists($from, $input)) { $output[$to] = $input[$from]; } } var_dump($output);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["account_id"]=> string(2) "18" ["master_id"]=> string(8) "53600065" ["name"]=> string(28) "Awesome Test Company From SS" }

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:
36.54 ms | 401 KiB | 8 Q