<?php

$specimem='string:{$vector|escape:"javascript"}';

$reference="\\`\\\$\\{alert(\\`Hello, \\\$\\{name}!\\`)}\\\$\\{\\`\\\\n\\`}\\`";

set_include_path('/usr/share/php/smarty3/');

require('Smarty.class.php');

$tpl = new Smarty();

$tpl->assign('vector', '`${alert(`Hello, ${name}!`)}${`\n`}`');
$test = $tpl->createTemplate($specimem);

$output =$tpl->fetch($test);

print("EXPECTED: $reference\n");
print("ACTUALLY: $output\n");

assert(0==strcmp($output,$reference));

if(0!=strcmp($output,$reference)) {
  print("NOT EQUAL\n");
  exit(1);
}

