3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['0' => ['part_img_url' => '354.test'],'1' => ['part_img_url' => '647.test']]; $names = array_map(function($p) { return $p['part_img_url'] = preg_replace("~\d+~", $p['element_id'], $p['part_img_url']); }, (array)$data); print_r($names);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "element_id" in /in/F2UJM on line 4 Deprecated: preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated in /in/F2UJM on line 4 Warning: Undefined array key "element_id" in /in/F2UJM on line 4 Deprecated: preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated in /in/F2UJM on line 4 Array ( [0] => .test [1] => .test )

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