Re: Binary string forward compatibility removal
| From: | Niklas Keller | Date: | Mon, 07 Nov 2016 17:00:28 +0000 |
| Subject: | Re: Binary string forward compatibility removal | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96761@lists.php.net to get a copy of this message | ||
2016-11-06 20:22 GMT+01:00 Pedro Magalhães <mail@pmmaga.net>:
> Hi internals,
>
> I've created a PR (https://github.com/php/php-src/pull/2187) aiming at
> the removal of the binary string forward compatibility.
>
> Reproducing the description of the PR:
> ----
> 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 2 commits because the removal of the
> (binary) cast will bring a more serious BC break issue: On the PHAR
> 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.
>
> 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.
> ----
>
> Any feedback would be greatly appreciated.
>
> Best regards,
> Pedro Magalhães
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
No matter whether we choose to merge this somewhere in the future or not,
there's no reason to have (binary) in the phar stub anymore.
I have just opened a PR to remove the (binary) casts there again, as we no
longer need that forward compatibility:
https://github.com/php/php-src/pull/2190
As for the removal itself: There's no particular reason to remove it now,
but we could at least issue a deprecation warning.
Regards, Niklas