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, $options) { $array= array(); preg_match_all("/\{{=(.*?)}}/",$string,$array); //var_dump($array); die; var_dump($options["location"]["address"]); die; } echo render($template, $options); ?>
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["pincode"]=> string(6) "110035" ["city"]=> string(5) "Delhi" }

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:
38.47 ms | 401 KiB | 8 Q