For the record, we're a mid-size organization, building a modern product on
PHP 7 with a PSR-based stack.
We've shunned template engines and rely heavily on short open tags and
alternative control-structures - mainly because we insist on static
analysis and IDE support, which we get by manually type-hinting a single
view-model variable $view at the beginning of each template.
No other template engine gives us what we want in terms of static analysis,
type-checking or IDE support.
The choice to rebuild a very large product in PHP vs e.g. Node, at the
time, was in part motivated by PHP's template features - which, while it
may look pretty verbose and ugly on the surface, has a huge advantage over
basically anything else, e.g. static analysis with various QA tools,
automated refactorings (rename etc.) in PHP Storm, and so on.
The loss of this feature would be a substantial setback for our
organization - for which there is no really good replacement.
On Tue, Mar 12, 2019 at 10:51 AM Rowan Collins rowan.collins@gmail.com
wrote:
From my understanding, the <?
tag is not available without the
directive,
so maybe we should deprecate PHP's short tag altogether?
I think when that's been proposed in the past, people have said they like
it for use in simple templates, often along with the "alternative control
structures", e.g.:
<? foreach ( $things as $thing ): ?>
<? if ( $thing->quantity > 1 ): ?><p><?= $thing->description; ?></p><?
endif; ?>
<? endforeach; ?>
I couldn't find any discussions for a few years, though, so it's possible
opinions have changed.
Regards,
Rowan Collins
[IMSoP]