In reply to Justin Tadlock.

Thanks Justin.

Yeah, I'm certainly not religious about PHP vs. templating engines. But then again...

So we are ripping out the use of Mustache for PHP and replacing with pure PHP. Why?

Debugging Mustache is like flying in the cargo hold vs. debugging PHP with PhpStorm or VSCode is like flying first class.
When using Mustache — which is admittedly worse that using templates that support logic — you have to populate an array of arrays and stdClass objects for damn near every permutation you can imagine, and it ends up being a maintenance nightmare.Thirds, and admittedly by far the least important in most cases is performance. Using templating can be slower than just doing it in PHP, unless the templating system has a compile to PHP option and you can implement a build process into your workflow.

Yes, I know there are techniques to improve #2 but given #1 we felt it was better to just go back to PHP.

I am just posting this as a cautionary tale for anyone who considers using a templating language. Better to know this and still choose to use a templating language than to not know this, commit to using a templating language on a larger project, and later become surprised with these issues after it is too late to reverse course.

#fwiw. #ymmv

-Mike
P.S. If PhpStorm were to implement a single-step debugging and variable inspection feature for one or more templating engines, I might change my tune completely.