-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix case sensitivity for special class names #121
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
The current behaviour is incorrect as special class names are case-insensitive as demonstrated here: http://3v4l.org/4g7Hj
@TimeToogo can you also provide a test case? |
General +1 for test case inclusion in PRs. |
I suspect that keywords in general are case insensitive. Could you please add/update corresponding test case? |
Maybe we should raise this issue with hhvm as a php5 compliance issue? |
Added the corresponding test :) |
$stmt = $stmts[0]; | ||
$methodStmt = $stmt->stmts[1]->stmts[1]; | ||
|
||
$this->assertEquals('SELF', (string)$methodStmt->stmts[0]->class); |
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 test suggests, that result is always in uppercase. However code change lowercases it.
I think test should check, that regardless of case in PHP file the result is lowercase.
Good catch, I'll merge this in about a week, when I'm back home. |
Did not look into why this is. Looks like the original tree already lowercases static::
Finally got the test to pass. |
I thought, that all 3 are lowercased. I that parser can do some normalization, since writing keywords in uppercase doesn't seem like a good idea to me (even if it works). Same as calling |
@aik099 As far as I can tell only |
Maybe you should introduce some random lowercased letter, e.g. |
@aik099 I just confirmed locally that for |
just for reference: since php 5.5. |
Ah, so these ones were case-sensitive before PHP 5.5? |
The current behaviour in the name resolver visitor is incorrect as special class names are case-insensitive as demonstrated here:
http://3v4l.org/4g7Hj