The following code produces and undefined variable $s instead of "number two"
define("T1","one");
define("T2","two");
$test="number %2$s";
$test=sprintf($test, T1,T2);
echo $test;
The following code produces and undefined variable $s instead of "number two"
define("T1","one");
define("T2","two");
$test="number %2$s";
$test=sprintf($test, T1,T2);
echo $test;
Single quotes solve your problem. Double quotes cause PHP to interpolate your '$' as a variable.
<?php
define("T1","one");
define("T2","two");
$test='number %2$s';
$test=sprintf($test, T1,T2);
echo $test;