3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 0 => 'john', 1 => 'robinson', 2 => '27-08-1980', 3 => 'football', 4 => 'pizza', ]; $template = "{0} {1} birthday {2} <br /> Hobbie : {3} <br /> favorite : {4}"; $string = preg_replace_callback( '/\{(\d+)\}/', function ($matches) use ($data) { return $data[$matches[1]]; }, $template ); echo $string;
Output for git.master, git.master_jit, rfc.property-hooks
john robinson birthday 27-08-1980 <br /> Hobbie : football <br /> favorite : pizza

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:
28.57 ms | 405 KiB | 5 Q