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 .= print("$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" data-object.url="http://yamamotohi.beautist.dev-php55.istyle.local/beautist/article/2004580" Warning: Undefined variable $str in /in/9ubAM on line 26 data-object.parent.class="blog" Warning: Undefined variable $str in /in/9ubAM on line 26 data-object.parent.id="2004580" Warning: Undefined variable $str in /in/9ubAM on line 26 data-object.parent.owner.class="uid" Warning: Undefined variable $str in /in/9ubAM on line 26 data-object.parent.owner.id="101607419" Warning: Undefined variable $str in /in/9ubAM on line 26 string(0) ""

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:
58.09 ms | 403 KiB | 8 Q