Hi
On 12/16/22 14:28, Derick Rethans wrote:
Question 2 is that class. I know folks have been clammoring for a
`String` class for some time and this actually fills that niche quite
well. A part of me wonders if we can overload it a little to provide
a psuedo locale of "binary" so that users can, optionally, treat it
like a more generalized String class in specific cases, storing a
normal `char*` zend_string under the hood in that case. Possibly as a
specialzation tree.
An alternative could be to just have this as an implementation detail,
in case the associated locale/collation is C/root. Then nobody needs to
worry about it, *but* it would mean implementing everything twice. Which
I am not too keen on, especially because we have such a wide array of
operations on strings already.
I rather not see this either, because if a 'Text' object may contain
binary data, the type safety is lost and users cannot rely on "'Text'
implies valid UTF-8" (see sibling thread).
Best regards
Tim Düsterhus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php