-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Binary string forward compatibility removal #2187
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
Instead of changing phpt's to have this in their name: +no longer support basic binary nowdoc syntax Same goes for the whole tests, where the EXPECT part have changed to just a parse error, either the tests should be updated to work without the b-prefix or the (binary) cast, or dropped entirely. |
I did that for the heredoc and nowdoc tests on Related to this and other feedback I'll try to split these changes in smaller commits. Thanks |
Hi @pmmaga its fine that the numeration does not fit, we do have a few cases like this around the source, and after all, it is just an irrelevant number :) |
Also, as a quick reply, this would need an RFC, and since it changes the syntax, it would need a 2/3+1 vote to be accepted :) |
6269606
to
a22e013
Compare
@KalleZ , thanks for the tips. I've removed those tests and split up the commits a bit better. |
Agree, we should merge the phar stub fix asap. We should also merge the removal of b/binary from unrelated tests in master to avoid bitrot of this huge patch. The actual removal/deprecation/whatever can then be handled later much more easily. |
Ok, that sounds good. Should I create individual PRs for each thing? |
I'll close this PR as this change should go through a deprecation phase before removal. |
In version 5.2.1, the
b
prefix and the(binary)
cast were introduced for forward compatibility with the PHP6 project. As it is known, that project never came to be. However, these are still accepted by the language scanner although ignored from then on.This PR aims at removing those as they are naturally confusing given that they are simply ignored or, in the case of the cast, the same as casting to
string
.However, I've separated this PR in various commits because the removal of the
(binary)
cast will bring a more serious BC break issue: On thePHAR
extension, the current default stub for PHAR's makes use of the binary cast. I've removed it from the default stub and fixed the tests that made use of it but this means that the old PHARs that make use of this default stub will be broken.Also, I have split the tests that were using the prefix or the cast but were unrelated to them from the others as these may be introduced first if this is split up in multiple steps.
What seemed to be a simple task actually turned out to be far more complex given the number of tests that were written with this forward compatibility in mind.
I would be happy to transform this into an RFC if you think it would be appropriate.