3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sweet = array('a' => 'apple', 'b' => 'banana'); $fruits = array('sweet' => $sweet, 'sour' => 'lemon'); $arr = array('data-object.url' => 'http://yamamotohi.beautist.dev-php55.istyle.local/beautist/article/2004580', 'data-object.parent.class' => 'blog', 'data-object.parent.id' => '2004580', 'data-object.parent.owner.class' =>'uid', 'data-object.parent.owner.id' => '101607419', ); function test_print($item, $key) { echo "$key holds $item\n"; } array_walk_recursive($fruits, 'test_print'); array_walk_recursive($arr, function($item, $key){ echo "$key=\"$item\"\n"; }); $str = ''; array_walk_recursive($arr, function($item, $key){ $str .= vsprintf("$key=\"$item\"\n"); }); var_dump($str); ?>
Output for git.master, git.master_jit, rfc.property-hooks
a holds apple b holds banana sour holds lemon data-object.url="http://yamamotohi.beautist.dev-php55.istyle.local/beautist/article/2004580" data-object.parent.class="blog" data-object.parent.id="2004580" data-object.parent.owner.class="uid" data-object.parent.owner.id="101607419" Fatal error: Uncaught ArgumentCountError: vsprintf() expects exactly 2 arguments, 1 given in /in/kq5W1:26 Stack trace: #0 /in/kq5W1(26): vsprintf('data-object.url...') #1 [internal function]: {closure}('http://yamamoto...', 'data-object.url') #2 /in/kq5W1(25): array_walk_recursive(Array, Object(Closure)) #3 {main} thrown in /in/kq5W1 on line 26
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:
55.83 ms | 402 KiB | 8 Q