3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defaults = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]; $optionKeys = array_keys($defaults); $options = $defaults; $args = ['b' => 3, 'e' => 7]; array_walk($args, function($value, $key) use ($optionKeys, &$options){ var_dump($value, $key); if(in_array($key, $optionKeys)){ $options[$optionKeys[$key]] = $value; } }); print_r($options);
Output for git.master, git.master_jit, rfc.property-hooks
int(3) string(1) "b" Warning: Undefined array key "b" in /in/aa1bM on line 14 int(7) string(1) "e" Warning: Undefined array key "e" in /in/aa1bM on line 14 Array ( [a] => 1 [b] => 2 [c] => 3 [d] => 4 [e] => 5 [] => 7 )

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:
30.49 ms | 402 KiB | 8 Q