[RFC] [VOTE] Deprecate PHP's short open tags

php.internals

Girgias

7 years ago
Hello Internals, As there have been no further comments the voting for my RFC [1] to deprecate PHP's short open tags has started and will run for two (2) weeks. Best regards George P. Banyard [1] https://wiki.php.net/rfc/deprecate_php_short_tags

Net Mo

7 years ago
Finally!!! everybody will be able to parse my xml files with embedded php!!!!1!1 if I ever wrote one!!! Sorry for the sarcasm, please don't consider this as a personal attack. The whole community (not just you) considers short open tags poison because not XML-compatible... while they use stuff like twig, which is also not XML-compatible. This is just beyond my understanding. But sure, let's keep vilifying this kind stuff and pretend they are the root cause of PHP's bad rep. Sorry again for the negativity.

M. W. Moe

7 years ago
deprecate short closing tag <?php /* EOF */ On Wed, Apr 10, 2019 at 2:45 PM Wes <netmo.php@gmail.com> wrote:

Robert Korulczyk

7 years ago
> Sorry for the sarcasm, please don't consider this as a personal attack. The > whole community (not just you) considers short open tags poison because not > XML-compatible...
This is rather removing another trap from the language. As long as short open tags exist and depend on INI directive, there will be bugs and source code leaks after moving application to a different environment. Using <?php over <? is the only safe way to write PHP code, and now you need an external tool to enforce this. Regards, Robert Korulczyk W dniu 10.04.2019 o 23:49, Wes pisze:

Thomas Hruska

7 years ago
On 4/11/2019 1:12 AM, Robert Korulczyk wrote:
>> Sorry for the sarcasm, please don't consider this as a personal attack. The >> whole community (not just you) considers short open tags poison because not >> XML-compatible... > > This is rather removing another trap from the language. As long as short open tags exist and depend on INI directive, there will be bugs and source > code leaks after moving application to a different environment. Using <?php over <? is the only safe way to write PHP code, and now you need an > external tool to enforce this.
I wouldn't say it is the ONLY safe way. Turning it on permanently would also solve the problem and there's also allowing '<?[whitespace character]' as a permanent always-on option. (Native XML compatibility is a complaint, not a requirement of a language. XML is also basically dead in my corner of the PHP universe, only ever cropping up on very rare and very confused occasions.) It's going to be interesting to see how many people who rely on and *prefer* using short open tags in internal systems come out of the woodwork when PHP 7.4 and 8 drops. Maybe I'm the only one who likes saving a few characters here and there and thinks code is more readable without the verbose tag. The vote is on the knife's edge of passing/failing at the moment and could go a couple of unusual directions as already noted elsewhere. This is probably the most interesting RFC *vote* to happen in a long while.
-- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/

Robert Korulczyk

7 years ago
> Turning it on permanently would also solve the problem
Well, yes, although it creates "another way of doing the same thing". So far PHP was on a way to remove redundant tags. Permanently enabling of short open tags looks like a move in the opposite direction. Personally, I'm surprised by the controversy around this change. So far it was an obvious anti-pattern for me, and never seen anybody who was aware of the consequences of using <? and still use <? instead <?php on purpose. Regards, Robert Korulczyk W dniu 11.04.2019 o 17:36, Thomas Hruska pisze:

Reinis Rozitis

7 years ago
> From: Robert Korulczyk [mailto:robert@korulczyk.pl] > > Personally, I'm surprised by the controversy around this change. So far it was an > obvious anti-pattern for me, and never seen anybody who was aware of the > consequences of using <? and still use <? instead <?php on purpose.
It's not really a problem for programmers/coders writing new code rather for server providers/administrators (maybe also a reason why such issues are not (or rarely) voiced in a language development internal list) hosting legacy applications where no one wants or there is nobody to fix anything (even more with an automatic third party tool) and then there won't even be a switch (ini option) anymore for backwards compability. So you are (will be) forced to stay on EOL php version or implement a patch for reverting particular thing in your distro/custom package. p.s. somewhat similar is the situation with 'mysql' extension which by default prints a lot of deprecated warnings even being in pecl and basically the same wrapper around mysqlnd as mysqli/pdo, but at least there is still an option if your code really requires mysql_* (and many thanks to the people like Dmitry, Matteo who still make it compatible with the actual php versions). rr

Girgias

7 years ago
Hello Internal, The two weeks of voting have now ended. The results are 38 for and 18 against (total 56) for the primary vote to deprecate PHP's short open tag in PHP 7.4. This passes in favor with 68%. The results are 42 for and 15 against (total 57) for the secondary vote to remove PHP's short open tag in PHP 8. This passes in favor with 74%. Thanks for everyone who voted on this issue. Best regards George P. Banyard

Zeev Suraski

7 years ago
FWIW, I think it's a bad decision, made against the thoughts of clear majority of core developers - and for hardly a good reason. I believe it illustrates very well why we need to properly define our voting eligibility rules, and I hope someone would be up to the challenge of tackling it (I decided not to pursue it further after the 'abolish' RFC(s)). A 68% majority which barely clears the 2/3 requirements for something as fundamental as that - with so many core devs against it - we'll deserve all the criticism that will be coming our way in 7.4/8.0 from end users wondering why we needlessly broke their apps and made migration a bit more of a headache. My 2c. Zeev -----Original Message----- From: G. P. B. <george.banyard@gmail.com> Sent: Wednesday, April 24, 2019 2:29 PM To: PHP internals <internals@lists.php.net> Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags Hello Internal, The two weeks of voting have now ended. The results are 38 for and 18 against (total 56) for the primary vote to deprecate PHP's short open tag in PHP 7.4. This passes in favor with 68%. The results are 42 for and 15 against (total 57) for the secondary vote to remove PHP's short open tag in PHP 8. This passes in favor with 74%. Thanks for everyone who voted on this issue. Best regards George P. Banyard

Lester Caine

7 years ago
On 24/04/2019 14:41, vsuraski@gmail.com wrote:
> A 68% majority which barely clears the 2/3 requirements for something as fundamental as that - with so many core devs against it - we'll deserve all the criticism that will be coming our way in 7.4/8.0 from end users wondering why we needlessly broke their apps and made migration a bit more of a headache.
This is yet another negative move in my forward planning and just another cross against even bothering with PHP8 ... and PHP7.4 is only going to complain about things so while I've not even started testing on PHP7.3, that is likely to be the last version of PHP I will be using ... once all the warnings are dealt with on PHP7.2 ... I don't think even the carrot of 'JIT' this time trumps being beaten around the head with more and more BC changes we will to have to manage and adding 'php' to every <? that is not a simple <?= in template files goes heavily against all the other attempts at removing descriptive text elsewhere.
-- Lester Caine - G8HFL ----------------------------- Contact - https://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - https://lsces.co.uk EnquirySolve - https://enquirysolve.com/ Model Engineers Digital Workshop - https://medw.co.uk Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

Chase Peeler

7 years ago
On Wed, Apr 24, 2019 at 10:00 AM Lester Caine <lester@lsces.co.uk> wrote:
> On 24/04/2019 14:41, vsuraski@gmail.com wrote: > > A 68% majority which barely clears the 2/3 requirements for something as > fundamental as that - with so many core devs against it - we'll deserve all > the criticism that will be coming our way in 7.4/8.0 from end users > wondering why we needlessly broke their apps and made migration a bit more > of a headache. > > This is yet another negative move in my forward planning and just > another cross against even bothering with PHP8 ... and PHP7.4 is only > going to complain about things so while I've not even started testing on > PHP7.3, that is likely to be the last version of PHP I will be using ... > once all the warnings are dealt with on PHP7.2 ... I don't think even > the carrot of 'JIT' this time trumps being beaten around the head with > more and more BC changes we will to have to manage and adding 'php' to > every <? that is not a simple <?= in template files goes heavily against > all the other attempts at removing descriptive text elsewhere. > > Total files scanned: 20,767
Total lines scanned: 4,013,170 Total short open tag references: 6,787 Total files w/ short open tag references: 1,665 If I get started now, maybe I can have everything fixed by the time 8.1 is released.
> -- > Lester Caine - G8HFL > ----------------------------- > Contact - https://lsces.co.uk/wiki/?page=contact > L.S.Caine Electronic Services - https://lsces.co.uk > EnquirySolve - https://enquirysolve.com/ > Model Engineers Digital Workshop - https://medw.co.uk > Rainbow Digital Media - https://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- Chase Peeler chasepeeler@gmail.com

Stephen Reay

7 years ago
> On 24 Apr 2019, at 21:00, Lester Caine <lester@lsces.co.uk> wrote: > > On 24/04/2019 14:41, vsuraski@gmail.com wrote: >> A 68% majority which barely clears the 2/3 requirements for something as fundamental as that - with so many core devs against it - we'll deserve all the criticism that will be coming our way in 7.4/8.0 from end users wondering why we needlessly broke their apps and made migration a bit more of a headache. > > This is yet another negative move in my forward planning and just another cross against even bothering with PHP8 ... and PHP7.4 is only going to complain about things so while I've not even started testing on PHP7.3, that is likely to be the last version of PHP I will be using ... once all the warnings are dealt with on PHP7.2 ... I don't think even the carrot of 'JIT' this time trumps being beaten around the head with more and more BC changes we will to have to manage and adding 'php' to every <? that is not a simple <?= in template files goes heavily against all the other attempts at removing descriptive text elsewhere. > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - https://lsces.co.uk/wiki/?page=contact > L.S.Caine Electronic Services - https://lsces.co.uk > EnquirySolve - https://enquirysolve.com/ > Model Engineers Digital Workshop - https://medw.co.uk > Rainbow Digital Media - https://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >
Of all the things to ‘refuse to upgrade’ over this seems pretty silly. There are multiple tools that will automatically fix this across an entire codebase in seconds. Heck, a sed 1 liner would do it if you want to DIY it.

Reinis Rozitis

7 years ago
> A 68% majority which barely clears the 2/3 requirements for something as > fundamental as that - with so many core devs against it - we'll deserve all the > criticism that will be coming our way in 7.4/8.0 from end users wondering why > we needlessly broke their apps and made migration a bit more of a headache.
It's quite interesting to check the karma levels for the voters (might be on a slippery slope here but it feels a bit unfair that someone with just a documentation karma (or no karma at all (at least according to wiki.php.net)) has the same weight on a core option getting removed). p.s. at least for the deprecation stage for 7.4 the revert patch is simple rr

Unnamed Person

7 years ago
Hello, I understand that breaking changes always need extra work, but in this case I think it's a quick change. On my code base (mostly legacy with 1.8m lines), I ran this and got 10 matches to check: grep -rin "<?[^pxi=]" . | grep -v "\.git/" | grep -v "Binary file" | grep -v "\.js:" Regards Thomas

Chase Peeler

7 years ago
On Wed, Apr 24, 2019 at 12:03 PM Thomas Bley <mails@thomasbley.de> wrote:
> Hello, > > I understand that breaking changes always need extra work, but in this > case I think it's a quick change. On my code base (mostly legacy with 1.8m > lines), I ran this and got 10 matches to check: > > Awesome. I got 6,787 over 4m lines.
> grep -rin "<?[^pxi=]" . | grep -v "\.git/" | grep -v "Binary file" | grep > -v "\.js:" > > Regards > Thomas > > > vsuraski@gmail.com hat am 24. April 2019 um 15:41 geschrieben: > > > > > > FWIW, > > > > I think it's a bad decision, made against the thoughts of clear majority > of core developers - and for hardly a good reason. I believe it illustrates > very well why we need to properly define our voting eligibility rules, and > I hope someone would be up to the challenge of tackling it (I decided not > to pursue it further after the 'abolish' RFC(s)). > > > > A 68% majority which barely clears the 2/3 requirements for something as > fundamental as that - with so many core devs against it - we'll deserve all > the criticism that will be coming our way in 7.4/8.0 from end users > wondering why we needlessly broke their apps and made migration a bit more > of a headache. > > > > My 2c. > > > > Zeev > > > > > > -----Original Message----- > > From: G. P. B. <george.banyard@gmail.com> > > Sent: Wednesday, April 24, 2019 2:29 PM > > To: PHP internals <internals@lists.php.net> > > Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags > > > > Hello Internal, > > > > The two weeks of voting have now ended. > > The results are 38 for and 18 against (total 56) for the primary vote to > deprecate PHP's short open tag in PHP 7.4. > > This passes in favor with 68%. > > > > The results are 42 for and 15 against (total 57) for the secondary vote > to remove PHP's short open tag in PHP 8. > > This passes in favor with 74%. > > > > Thanks for everyone who voted on this issue. > > > > Best regards > > > > George P. Banyard > > > > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- Chase Peeler chasepeeler@gmail.com

Peter Kokot

7 years ago
Hello, On Wed, 24 Apr 2019 at 13:29, G. P. B. <george.banyard@gmail.com> wrote:
> > Hello Internal, > > The two weeks of voting have now ended. > The results are 38 for and 18 against (total 56) for the primary vote to > deprecate PHP's short open tag in PHP 7.4. > This passes in favor with 68%. > > The results are 42 for and 15 against (total 57) for the secondary vote to > remove PHP's short open tag in PHP 8. > This passes in favor with 74%. > > Thanks for everyone who voted on this issue. > > Best regards > > George P. Banyard > > >
Great! It was about time this got removed. And it is a perfect timing also - PHP 8.0 when BC breaking changes can be done. Thank you so much for moving this forward. People who are thinking of supporting some legacy applications on the upcoming PHP 8 will be unfortunately a bit surprised with all the removed features and will have other bigger issues adjusting their code compared to a really simple replace of <? with <?php. It's what the software development and progress is also about. I think this is a good move.
-- Peter Kokot

Björn Larsson

7 years ago
Den 2019-04-24 kl. 16:56, skrev Peter Kokot:
> Hello, > > On Wed, 24 Apr 2019 at 13:29, G. P. B. <george.banyard@gmail.com> wrote: >> Hello Internal, >> >> The two weeks of voting have now ended. >> The results are 38 for and 18 against (total 56) for the primary vote to >> deprecate PHP's short open tag in PHP 7.4. >> This passes in favor with 68%. >> >> The results are 42 for and 15 against (total 57) for the secondary vote to >> remove PHP's short open tag in PHP 8. >> This passes in favor with 74%. >> >> Thanks for everyone who voted on this issue. >> >> Best regards >> >> George P. Banyard >> > Great! It was about time this got removed. And it is a perfect timing > also - PHP 8.0 when BC breaking changes can be done. Thank you so much > for moving this forward. People who are thinking of supporting some > legacy applications on the upcoming PHP 8 will be unfortunately a bit > surprised with all the removed features and will have other bigger > issues adjusting their code compared to a really simple replace of <? > with <?php. It's what the software development and progress is also > about. > > I think this is a good move. > > > -- > Peter Kokot
Hi, I agree on this to some degree when it comes to your own code that you control. But, imagine a relatively big open source library that is maintained with small resources. One example I have myself is using a relatively large & well established open source library where I'm using the latest version released before Christmas. I run the site on PHP 7.3, but I still get warnings regarding the RFC Counting of non-countable objects for PHP 7.2 related to this library. With that experience in mind I wonder how different libraries will fare, given this change? One should also have in mind that there has been a discussion on this list about extending the support cycle for PHP 7.4 like for 5.6, but to some degree it was rejected which doesn't help migration efforts. r//Björn L

Mark Randall

7 years ago
On 24/04/2019 21:32, Björn Larsson wrote:
> With that experience in mind I wonder how different libraries will fare, > given this > change? One should also have in mind that there has been a discussion on > this list about extending the support cycle for PHP 7.4 like for 5.6, but to > some degree it was rejected which doesn't help migration efforts.
I'm sure Nikita will pop up sometime in the next few days and put his recently downloaded 1000+ packages through his parser and give us some figures on how many use short open tags, if he hasn't already done so. I would naturally expect it to be extremely small, after all it makes no sense to have a public package which requires a language feature to be enabled in the INI and which can't be relied upon. If there's a problem, it will almost certainly be with internal code, which naturally there's a few million times more of, but that seems very much in-scope for individual developers to fix if they want to upgrade to PHP 8. My main worry is, and remains, that it's being converted to just a "not parser significant" in PHP 8. The potential for unexpected data / code leaks is *significant*. Until someone can convince me otherwise, I will continue to strongly believe that <? should lead to a compile-time fatal error for the foreseeable future (years). I'm half tempted to RFC it so it can go to a vote.
-- Mark Randall

Thomas Hruska

7 years ago
On 4/24/2019 4:28 AM, G. P. B. wrote:
> Hello Internal, > > The two weeks of voting have now ended. > The results are 38 for and 18 against (total 56) for the primary vote to > deprecate PHP's short open tag in PHP 7.4. > This passes in favor with 68%. > > The results are 42 for and 15 against (total 57) for the secondary vote to > remove PHP's short open tag in PHP 8. > This passes in favor with 74%. > > Thanks for everyone who voted on this issue. > > Best regards > > George P. Banyard
Since this has passed, I would like to discuss official tool recommendations when 7.4 and 8 are published. Because users are going to want that. sed-based solutions do NOT work. PHP is a complex language and it requires using the tokenizer to properly replace short open tags. The PHP-CS-Fixer FullOpeningTag fixer is also completely broken software - it actually misses common use-cases and it intentionally damages code and then attempts (and in some cases fails) to revert the damage in the process. Neither of the two recommended options to date on this list are valid recommendations for serious software deployment managers. I also looked at a number of other tools that have popped up on my radar and found nothing that met my basic criteria of: - Total control over the transformation process, favoring analysis over modification. - Zero regexes and relying solely on token_get_all(). - Does exactly one thing and does it well in as little code as possible so it can be easily vetted by others. So I built a tool that meets the above minimum criteria and have already run it against a fairly extensive codebase (and have shared the tool with a few concerned folks - you've already seen its output here on-list): https://github.com/cubiclesoft/php-short-open-tag-finder/ The included test suite (test.php), while a mere 14 lines, presents suitably difficult scenarios to correctly handle both situations of having (pre-PHP 8) and not having (post-PHP 8) short open tag support. The tool correctly parses the test suite in both modes without using any regexes. The only downside to the tool is that the 'Y' key on a keyboard might get broken in the optional '-ask' mode. I did experience a bit of fatigue with using the tool to modify several thousand files with short open tags but the transformation was otherwise flawless (i.e. no false positives or false negatives) and was end-user transparent (i.e. didn't break anything in production) other than having to go back and do git-commits on all of the 70+ affected projects afterwards. I recommend having a short list of vetted, verified tools that meet specific criteria. Tools that just walk down a directory tree and bulk modify by default, those that rely on regexes, and those that require short tags to be enabled to function should all be rejected from consideration. Recommended tools should also be able to be run by a wide range of users, including hosting providers who might want to inform their customers that use short open tags when they plan on upgrading the host to PHP 8 that they have code on their website that will probably break. In summary, I went ahead and wrote a tool, ran it against 9.4 million lines of real production code, then ran it in '-ask' mode and let it carefully modify a few thousand files by mashing my 'Y' key a bunch of times pausing briefly to look at interesting changes (which really only took a couple of hours and probably lowered the lifespan of that key on the keyboard a bit). I hope others can benefit from the tool too.
-- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/

Stephen Reay

7 years ago
> On 25 Apr 2019, at 14:11, Thomas Hruska <thruska@cubiclesoft.com> wrote: > sed-based solutions do NOT work. > Neither of the two recommended options to date on this list are valid recommendations for serious software deployment managers.
I have no issue with suggesting tools to fix short opening tags, but lay off the absolute statements. The approaches mentioned literally do work (because the people who mentioned them used them), they just may not work *for your codebase*.

Thomas Hruska

7 years ago
On 4/25/2019 12:26 AM, Stephen Reay wrote:
> >> On 25 Apr 2019, at 14:11, Thomas Hruska <thruska@cubiclesoft.com> wrote: >> sed-based solutions do NOT work. >> Neither of the two recommended options to date on this list are valid recommendations for serious software deployment managers. > > > I have no issue with suggesting tools to fix short opening tags, but lay off the absolute statements. > > The approaches mentioned literally do work (because the people who mentioned them used them), they just may not work *for your codebase*.
Both the sed and PHP-CS-Fixer solutions recommended on this list would have broken several of my production applications AND failed to provide a complete conversion in the process. Hopefully that explains where my statement came from. Apologies if I came on too strongly here. I still think that software that works only on a subset of PHP code is a recipe for disaster.
-- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/

Côme Chilliet

7 years ago
Le jeudi 25 avril 2019, 00:11:42 CEST Thomas Hruska a écrit :
> So I built a tool that meets the above minimum criteria and have already > run it against a fairly extensive codebase (and have shared the tool > with a few concerned folks - you've already seen its output here on-list): > > https://github.com/cubiclesoft/php-short-open-tag-finder/
«// (C) 2019 CubicleSoft. All Rights Reserved.» does not meet my minimum criteria.
> Tools that just walk down a directory tree and bulk > modify by default, […] should all be rejected from > consideration.
I do not understand why you have a problem with this, the rest of your email seems to suggest you are using git. Just run the tool and then look at the diff before committing anything. This makes *way* more sense than having to manually review each change one by one. Côme

Thomas Hruska

7 years ago
On 4/25/2019 12:57 AM, Côme Chilliet wrote:
> Le jeudi 25 avril 2019, 00:11:42 CEST Thomas Hruska a écrit : >> So I built a tool that meets the above minimum criteria and have already >> run it against a fairly extensive codebase (and have shared the tool >> with a few concerned folks - you've already seen its output here on-list): >> >> https://github.com/cubiclesoft/php-short-open-tag-finder/ > > «// (C) 2019 CubicleSoft. All Rights Reserved.» does not meet my minimum criteria.
From the README: * Has a liberal open source license. MIT or LGPL, your choice. Not sure what the problem is here.
>> Tools that just walk down a directory tree and bulk >> modify by default, […] should all be rejected from >> consideration. > > I do not understand why you have a problem with this, the rest of your email seems to suggest you are using git. > Just run the tool and then look at the diff before committing anything. > > This makes *way* more sense than having to manually review each change one by one.
I err on the side of caution for a variety of reasons that are off-topic for this list/thread.
-- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/

Thomas Hruska

7 years ago
On 4/24/2019 4:28 AM, G. P. B. wrote:
> Hello Internal, > > The two weeks of voting have now ended. > The results are 38 for and 18 against (total 56) for the primary vote to > deprecate PHP's short open tag in PHP 7.4. > This passes in favor with 68%. > > The results are 42 for and 15 against (total 57) for the secondary vote to > remove PHP's short open tag in PHP 8. > This passes in favor with 74%. > > Thanks for everyone who voted on this issue. > > Best regards > > George P. Banyard
By the way, has anyone thought about the GDPR impact of this change?
-- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/

Benjamin Eberlei

7 years ago
On Wed, Apr 24, 2019 at 1:29 PM G. P. B. <george.banyard@gmail.com> wrote:
> Hello Internal, > > The two weeks of voting have now ended. > The results are 38 for and 18 against (total 56) for the primary vote to > deprecate PHP's short open tag in PHP 7.4. > This passes in favor with 68%. > > The results are 42 for and 15 against (total 57) for the secondary vote to > remove PHP's short open tag in PHP 8. > This passes in favor with 74%. > > Thanks for everyone who voted on this issue. > > Best regards > > George P. Banyard >
The RFC doesn't mention to much details on the exact implementation of this removal, but to avoid the potential security nightmare of <? code to suddenly be printed to screens when people upgrade to 8.0 I would suggest (props to Bob who mentioned this idea) that we at least keep the INI option indefinitely and when set to On always cause a fatal error in RINIT with an error message that mentions the security implications of disabling it and potentially linking to a PHP documentation page that offers solutions on how to migrate. This page could also be linked in the deprecation error message in 7.4

Stephen Reay

7 years ago
> On 11 Apr 2019, at 04:49, Wes <netmo.php@gmail.com> wrote: > > The > whole community (not just you) considers short open tags poison because not > XML-compatible... while they use stuff like twig, which is also not > XML-compatible.
I can’t say I’ve run into the XML issue in a real environment, but IMO the big ‘problem’ is that they can be disabled, so they can’t be relied upon for anything being distributed outside your own direct control. Also for the record, *I* don’t use Twig (The one thing no one can deny is php’s power as a markup templating language.. and then people don’t use it directly? Insanity.) Cheers Stephen

Peter Cowburn

7 years ago
On Wed, 10 Apr 2019 at 11:44, G. P. B. <george.banyard@gmail.com> wrote:
> Hello Internals, > > As there have been no further comments the voting for my RFC [1] to > deprecate PHP's > short open tags has started and will run for two (2) weeks. >
Firstly, I apologize for not mentioning this before the vote was opened. Does the primary (it's probably not fair to call it that, for this RFC) vote include changing the default (php -n) from On to Off? That's what is specified in the very concise proposal section, so it seems reasonable to assume it's the case, but I just want to be sure since the actual vote question doesn't mention changing the default value. With the current state of voting, it is looking like we could end up such that we don't deprecate (and disable by default, maybe) the feature, but jump straight to removing it. That's not usually how feature removal works. It would've been better, IMO, to just take the proposal ("Deprecate and disable short_open_tag in PHP 7.4 and remove PHP's short open tags in PHP 8.0.") and make that a yes/no vote. Best regards

Girgias

7 years ago
On Thu, 11 Apr 2019 at 12:14, Peter Cowburn <petercowburn@gmail.com> wrote:
> > > On Wed, 10 Apr 2019 at 11:44, G. P. B. <george.banyard@gmail.com> wrote: > >> Hello Internals, >> >> As there have been no further comments the voting for my RFC [1] to >> deprecate PHP's >> short open tags has started and will run for two (2) weeks. >> > > Firstly, I apologize for not mentioning this before the vote was opened. > > Does the primary (it's probably not fair to call it that, for this RFC) > vote include changing the default (php -n) from On to Off? That's what is > specified in the very concise proposal section, so it seems reasonable to > assume it's the case, but I just want to be sure since the actual vote > question doesn't mention changing the default value. > > With the current state of voting, it is looking like we could end up such > that we don't deprecate (and disable by default, maybe) the feature, but > jump straight to removing it. That's not usually how feature removal > works. It would've been better, IMO, to just take the proposal > ("Deprecate and disable short_open_tag in PHP 7.4 and remove PHP's short > open tags in PHP 8.0.") and make that a yes/no vote. >
Hello Peter, For changing the default from On to Off it more something I realised during the implementation of the patch that the in-engine default is "On", which I found to be unexpected (probably because the doc says it's only enabled with a compile flag) so I changed it. But the default could stay the same as I'm starting to realise that with current state of voting we are getting kind of a mess of a split vote as you said. It would have been nice that someone would have noticed the problems with the voting structure before I start it but not to sure how to proceed. I don't know if people vote against the deprecation notice in PHP 7.4 as the default value changes because if this is the case maybe leaving the default as is and only deprecating would be better? Also I do agree that having deprecation notices before a feature removal is wise but from my understanding the RFC which removed the ASP tags also didn't have deprecation notices, so there is already a precedent for removing features without warning (not that I agree with it). So not sure how to proceed ATM and some more feedback would be probably necessary as it is my first RFC. Best regards George P. Banyard

Peter Kokot

7 years ago
Hello, On Wed, 10 Apr 2019 at 12:44, G. P. B. <george.banyard@gmail.com> wrote:
> > Hello Internals, > > As there have been no further comments the voting for my RFC [1] to > deprecate PHP's > short open tags has started and will run for two (2) weeks. > > Best regards > > George P. Banyard > > [1] https://wiki.php.net/rfc/deprecate_php_short_tags
I want to thank you for this RFC, for your time dedicated to it, for the actual implementation and everything. You have done everything correct and also the general idea i.e. removing these legacy tags in either PHP 8.0 or not was completely correctly pointed out and RFC (at least according to the current PHP RFC standards) met all the criteria to get into implementation step. Everyone who is working with PHP development knows that these short tags are not meant to be used anymore. Also everything was correctly accepted and the numbers are correct. This entire thread is also showing the integrity, intelligence level of the PHP a bit but one day maybe these legacy leftovers can be removed, hopefully... Because they really should. So let's not give up and let's find some normal solution here... RFC and results are quite clear but maybe Nikita's solution is good enough for all: - Deprecation warnings in PHP 7.4 (RFC criteria met, people here happy or not) - PHP 8.0 complete compile error without any option to further use them anymore (RFC criteria sort of met -!!!, and the reason of pretending that the legacy apps will work ok on PHP 8.0 also met) - Actual removal in PHP 9 (because this is then the logical next step). Removing something like this in PHP 8.1 is not following semantic versioning at all. Either removal in 8.0 or 9.0. Cheers and thanks.
-- Peter Kokot