-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Deprecate PHP's Short Open Tags in PHP 7.4 #3972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think this should be ready for review. |
@@ -43,6 +43,7 @@ foreach($string_array as $string) | |||
echo "Done"; | |||
?> | |||
--EXPECT-- | |||
Deprecated: Directive 'short_open_tag' is deprecated in Unknown on line 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For most of these tests, that ini entry doesn't really make a difference. I'd suggest to remove it from those tests instead of adding the deprecation notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left the deprecation notices in the tokenizer tests, should I remove those too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it is safe to remove from token_get_all_variation15.phpt
given that the test doesn't even use the short open tags. For 002.phpt
you'd have to check if it actually influences the behavior of the tokenizer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff for 002 is pretty large as the behavior is indeed changes as can be seen with my PR for the removal in PHP 8 #3975
c.f. https://github.com/php/php-src/pull/3975/files#diff-55fd96e8ffa1d4e3150d3eb9dbc52829
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. On that PR, it would probably be more useful for that test to switch from <?
to <?php
to maintain its usefulness. As it stands right now, 2/3 of the things being tested are lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was probably thinking that changing the opening tag would be better than changing the whole output. Will do that when I touch on that PR again.
… INI setting from the engine default. Commented out short_open_tag INI setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM technically. I'll wait with merging this until the internals discussion settles.
No problem, I mean if the default change is a concern I don't mind reverting that and only have the deprecation notice for PHP 7.4. |
Just checking in: what's the status of this ? |
Well, I'll need to have a look at it again to change the implementation to go away from this controversial implementation and maybe even need to push it through the RFC process again. |
Thanks @Girgias for getting back to me. Would it be safe to presume that the chances of this making it into 7.4 are getting slim ? |
As is yes, will try to work on it tomorrow. |
We're still a few weeks away from feature freeze. I think that most likely this will land, with the updated implementation approach. |
Closing in favor of #4263. |
This comment has been minimized.
This comment has been minimized.
Sorry, but this is trash, now i want to quit php
It was so simple and beautiful (!)
|
Locking this so more people don't embarrass themselves. This change never landed and wouldn't have affected |
Implementation of my RFC for deprecating PHP Short tags: https://wiki.php.net/rfc/deprecate_php_short_tags
First time making a PR so help/reviews are appreciated.
On my local machine, some tests fail but I suppose this is due to me using WSL and not a native Linux.
Also, I'm having trouble fixing two tests related to strip_tags:ext/standard/tests/strings/strip_tags_variation5.phptext/standard/tests/strings/strip_tags_variation9.phptAnd it seems I made some changes to the output which I only realized with the diff view (don't know if that's due to my IDE or being on WSL).Fixed.
Probably gonna do a second PR for the removal in PHP 8.