<?= isn't 'safe'This is a web app for God's sake. You have full control on what your php.ini have. Which one is more complex? Install a templating language? or ensure your short-tags=On (or whatever that is) in your php.ini. And if you are talking about hosted service, short tags are by default kept "On" on most hosted services, if not all.
<?php while(list($key, $item) = loop($iterator)){?>
No, I can write any of the following if I want the variables localy.
<?while($r=loop($rs)){?> <---- this is the version I use most frequently.
<?foreach($rs as $key=>$item){?>
or even
<?while(extract(loop($rs))){?>
Now compare all these with any other language beside PHP. Java, C# or Python.
response.write "<html><head><title>" + myTitle + "</title>";
response.write "<body bgcolor=\"white\">";
while(loop inside iterator){
response.write "<tr><td" + print_var;
}
Imagine typing your full page like this! You need to enclose each of your line inside a quote and also escape all quotation marks inside it. Here code and design are mixed in real sense. These are the languages that really need a templating engine.
And the template engine can inline the code (rather than call a loop() function) for better performance.
Here is an idea, better performace is gained by not loading the templating engine at all. Whatever number of chars typing saved is more complicated by loading and initializing the whole templating engine. Even that is not enough, which is why Smarty has {if}, {else}, {switch} statements. So long for seperating code and design.
You might want to type twice as much identical code for each output variable
I am not typing identical code even once.
If only you had a template language that keeps you having to know that!
We can continue discussion without making attacks? No?