Maybe need allow the short tag for v8?

Permalink
I'm talking about tag "<?=" only.
Version 8 system requirements PHP 5.5.9+ (PHP 5.6 or 7 recommended.).
Short tag "<?=" always available since PHP 5.4.0http://php.net/manual/en/migration54.new-features.php...
Why this tag forbidden in packages?

guyasyou
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
Its a lot easier to administer a one size fits all set of marketplace guidelines than it is to make judgements on every single case. Pretty much every developer thinks they have a special case somewhere, where they think the way they want to do something is better than the way everyone else does. Maybe 10% of such cases could be justified. But we don't have time in every review to argue the point for the 90% that are not justified or consider which 10% are. Life just isn't long enough.

Hence the one size fits all approach. We all compromise to a median (Including PRB members and Portland Labs), which is the current guidelines.

That's not a comment on this specific issue, but a generalisation that makes the whole system workable for the amount of resources available.

Currently I don't think we can justify unnecessarily diverging guidelines for 5.7 and v8.

For short tags, amongst other ways they can be automatically expanded using the c5 command line. Work in short tags as much as you like, then replace them as part of your final build process. That is what the core does.

When the c5 core is released with short tags and core support for non short-tag versions of php is completely dropped, that will be when the overall guideline can change.
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi guyasyou,

In the example you pasted, there is a space between the question mark and the equals sign.
"<? ="

I wonder if the marketplace linter is seeing that as "<?". If so, it is seeing it as a short open tag and not echo shortcut syntax.
guyasyou replied on at Permalink Reply
guyasyou
It was just a typo
pixelhero replied on at Permalink Reply
pixelhero
This is likely not allowed as they can be disabled on servers quite easily, and sometimes people do disable them due to security concerns years ago - no longer a real concern.

But to keep compatibility high you should never use short tags in 3rd party items as you cannot guarantee the user buying your code has them enabled.
guyasyou replied on at Permalink Reply
guyasyou
"<?=" cannot be disabled since php 5.4

https://secure.php.net/manual/en/ini.core.php#ini.short-open-tag...
Note:
This directive also affected the shorthand <?= before PHP 5.4.0, which is identical to <? echo. Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0, <?= is always available.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@guyasyou

The marketplace linter also lints 5.6 and 5.7 add-ons and themes. The PHP minimum for those is below 5.4.
mlocati replied on at Permalink Reply
mlocati
I'm in favor of enabling the short echo tags for packages requiring concrete5 8.0+: it's such a handy coding style that I couldn't live without it xD
As always, things are moving forward, and I think that more and more people will switch to v8.
I don't think it'll be a problem for PRB reviewers, since it should be an automatic test that doesn't need manual review.
Imposing to not use short echo tags would be a kind of "violence" against package developers. With no valid reason imho.