3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = array( "id" => 17570527.00, "seq" => 0, "line1" => "1 Heron Close", "line2" => "Bradwell", "post_town" => "Great Yarmouth", "county" => "Norfolk", "postcode" => "NR31 8LY", "mailsort" => "54136", "barcode" => "(NR318LY1AA)", "is_residential" => 1, "is_small_organisation" => 0, "is_large_organisation" => 0, ); function pluck_keys($array, ...$keys) { return array_intersect_key($address, array_flip($keys)); } echo implode("\n", pluck_keys(['line1', 'line2', 'line3', 'line4', 'line5']));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $address in /in/5KFjh on line 20 Fatal error: Uncaught TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in /in/5KFjh:20 Stack trace: #0 /in/5KFjh(20): array_intersect_key(NULL, Array) #1 /in/5KFjh(23): pluck_keys(Array) #2 {main} thrown in /in/5KFjh on line 20
Process exited with code 255.

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