<?php
$data = [
"carro" => "Fiat Uno",
"ano" => "2017"
];
$template = "Meu carro é {{carro}}, ano {{ano}}\n";
function parse
($template, array $vars) {
return ${$match[1]};
}, $template);
}
echo parse($template, $data);
PD9waHAKCiRkYXRhID0gWwogICAgImNhcnJvIiA9PiAiRmlhdCBVbm8iLAogICAgImFubyIgPT4gIjIwMTciCl07CgokdGVtcGxhdGUgPSAiTWV1IGNhcnJvIMOpIHt7Y2Fycm99fSwgYW5vIHt7YW5vfX1cbiI7CgpmdW5jdGlvbiBwYXJzZSAoJHRlbXBsYXRlLCBhcnJheSAkdmFycykKewogICAgcmV0dXJuIHByZWdfcmVwbGFjZV9jYWxsYmFjaygnI3t7KC4qPyl9fSMnLCBmdW5jdGlvbigkbWF0Y2gpIHVzZSAoJHZhcnMpIHsKICAgICAgICBleHRyYWN0KCR2YXJzKTsKICAgICAgICByZXR1cm4gJHskbWF0Y2hbMV19OwogICB9LCAkdGVtcGxhdGUpOwp9CgplY2hvIHBhcnNlKCR0ZW1wbGF0ZSwgJGRhdGEpOwo=