3v4l.org

run code in 300+ PHP versions simultaneously
<?php $options = [ "site" => "Smartprix", "users" => [ 10 => [ "name" => "Hitesh", "city" => "Delhi" ], 34 => [ "name" => "Abhinav", "city" => "Bharatpur" ], ], "location" => [ "address" => [ "pincode" => "110035", "city" => "Delhi", ], "near" => "Shastri Nagar Metro", ], ]; $template = "{{=site}} is located at pincode {{=location.address.pincode}} near {{=location.near}}. Users of {{=site}} are: {{@users}} User ID: {{=_key}}, name: {{=_val.name}}, city: {{=_val.city}}. {{/@users}}"; function render($string, $array) { preg_match("/\{{=(.*/\.?)}}/",$string,$array); var_dump($array); die; } echo render($template, $options); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_match(): Unknown modifier '\' in /in/fnQgF on line 27 array(3) { ["site"]=> string(9) "Smartprix" ["users"]=> array(2) { [10]=> array(2) { ["name"]=> string(6) "Hitesh" ["city"]=> string(5) "Delhi" } [34]=> array(2) { ["name"]=> string(7) "Abhinav" ["city"]=> string(9) "Bharatpur" } } ["location"]=> array(2) { ["address"]=> array(2) { ["pincode"]=> string(6) "110035" ["city"]=> string(5) "Delhi" } ["near"]=> string(19) "Shastri Nagar Metro" } }

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