Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PHP short tags not universally supported #7

Closed
michaw opened this Issue Jun 14, 2012 · 5 comments

Comments

Projects
None yet
2 participants

michaw commented Jun 14, 2012

In the recent commit, all PHP tags (<?php) were changed to PHP short tags (<?). This change makes the extension LESS useful as not all servers with PHP will support the short tag.

Please PLEASE roll back this commit.

Owner

thyseus commented Jun 14, 2012

In addition to this[http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use] good discussion about php short tags, they are enabled by default since php 5.4:

@thyseus thyseus closed this Jun 14, 2012

michaw commented Jun 17, 2012

I understand the desire to use short tags, however as a production developer I have to disagree. While short tags are increasing in support, if you are developing code for others to use, you should be making it as easy as possible for as many as possible to use your code. This change makes it harder for many to use this extension, and serves no purpose apart from saving a few KB. The requirement for Yii is PHP 5.2, and PHP 5.4 is rarely available on commercial hosting services. Even still, this change goes against the concept of 'maximum compatibility' that should be employed when writing code for others to use. Sure, it's easy enough to do a find and replace, by why make potential users do that? What purpose does it serve?

michaw commented Jun 17, 2012

In addition, that discussion on stackoverflow seems genuinely split, with even advocates of short tags acknowledging that unless you have complete control of your hosting environment, you should use long tags. Since you're writing an extension with absolutely no knowledge of the target environment, let alone control, wouldn't it be prudent to use long tags?

Owner

thyseus commented Jun 18, 2012

How about this compromise:

In git, for development, we use short <? tags. As soon as we do a packaged release, i
include the <?php tags for deployment on foreign hosters.

Speaking about that; its time for another release ;)

michaw commented Jun 29, 2012

That sounds like an acceptable compromise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment