Re: Re: Binary string forward compatibility removal
| From: | Andrea Faulds | Date: | Mon, 07 Nov 2016 13:03:53 +0000 |
| Subject: | Re: Re: Binary string forward compatibility removal | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96758@lists.php.net to get a copy of this message | ||
Hi,
Joe Watkins wrote:
Afternoon Andrea,Well, that's not quite fair. b"" and "" are equivalent, u"" wouldn't be. It's only as useless as, say, the unary + operator. I can imagine it being used to be explicit about using a binary string. In any case, I don't think that it not doing anything that a bare string literal does makes enough of a case to remove it. It's going to bite some people if we remove this, and for what gain?A case can be made that the binary cast might at some point dosomething: "(binary) $ustring"There is no case whatever for the literal b prefix, it will *never*have a function if we are not changing the default string representation.If we do adopt a literal prefix for unicode strings, it's going to berather confusing to learn that u"" does something and b"" is also supported, but b"" doesn't, and has never done anything.
The two are related, if we're to get rid of one, we should get rid of both. If there's BC concerns for (binary), I suspect there's also breakage for b"". (binary) is also “useless”, insofar as you could just use (string). Thanks. -- Andrea Faulds https://ajf.me/OP: I think this should be split into two RFC's and voted onseparately, it certainly can't be merged by anyone as a PR.