3v4l.org

run code in 300+ PHP versions simultaneously
<?php function t($parent_key, $parent_array, &$data) { foreach ($parent_array as $k => $v) { if (is_array($v)) { t("${parent_key}_${k}", $v, $data); } else { $data[trim("${parent_key}_${k}", '_')] = $v; } } } $data = array(); $attributes = array( 'Users' => array( 'Name' => 'Name', ), 'Address' => 'Address', 'Tags' => array( 0 => array( 'Key' => 'Key', 'Value' => 'Value', ), 1 => array( 'Key' => 'Key', ), 2 => array( ) ), ); t('', $attributes, $data); print_r($data);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/UsD0a on line 6 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/UsD0a on line 6 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/UsD0a on line 8 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/UsD0a on line 8 Array ( [Users_Name] => Name [Address] => Address [Tags_0_Key] => Key [Tags_0_Value] => Value [Tags_1_Key] => Key )

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