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
TODO PhpToken
#406
Comments
what if one is using and having one covered but not another is falsy polyfill - one will see |
@keradus no need override |
@WinterSilence we cannot convert it, as we cannot override |
sorry don't undersand you, can you explain why we cant convert result of |
@WinterSilence for code calling |
i.e. we can convert |
@WinterSilence but that requires the caller to know that it has to do the conversion (which our polyfill cannot do for them), which is precisely what could break if they rely on detecting |
@stof users don't call |
@WinterSilence that's not true for existing code written before PhpToken was part of PHP. Polyfilling |
@stof |
@WinterSilence do you plan to work on this? How much effort would that be? I feel like we don't have to provide such level of forward compatibility, but if you're up to work on it, I'd be happy to review. |
@nicolas-grekas if no one helps, then i can impeelments 1-2.2 It's not so hard, for example,
need replace tokens |
@WinterSilence but those |
@WinterSilence do you have an actual use case or is this for completeness? Because if not driven by a use case, better wait for someone that would really need that before considering. |
how? this constants not exist in PHP7 @nicolas-grekas as I already say, i can impeelments 1-2.2 |
@WinterSilence that's the whole point. Existing code written with |
And this is true for other |
@stof yes, that makes sense, but what about the incomplete implementation of |
@WinterSilence our intl polyfills don't break feature detection for an existing feature of PHP when polyfilling another one. |
It's reason why this package have so many bugs. Detect features by indirect signs is bad practice. What's if some packages uses similar checks to determine $formatter = class_exists('MessageFormatter') ? new MessageFormatter() : new MyMsgFormatter();
<...>
$calendar = $formatter instanceof MyMsgFormatter ? new MyCalendar() : new IntlCalendar(); Do you want remove polyfill breaks their code? I don't think. |
In PHP 7 id's of |
T_NAME_FULLY_QUALIFIED
,T_NAME_RELATIVE
,T_NAME_QUALIFIED
,T_NULLSAFE_OBJECT_OPERATOR
,T_ATTRIBUTE
andT_MATCH
.PhpToken::tokenize()
result:2.1. Implements
T_NAME_RELATIVE
andT_NAME_QUALIFIED
tokens ((T_STRING T_NS_SEPARATOR)xN
or(T_NS_SEPARATOR T_STRING)xN
).2.2. Implement
T_NULLSAFE_OBJECT_OPERATOR
token (T_STRING '?->' T_STRING
)2.3. Implement
T_MATCH
token2.3. Implement
T_ATTRIBUTE
tokenThe text was updated successfully, but these errors were encountered: