On 15 February 2023 02:35:42 GMT, Thomas Hruska <[email protected]> wrote: >On 2/14/2023 2:02 PM, Rowan Tommins wrote: >I thought about that but didn't know how well it would be received nor, >perhaps more importantly, the direction it should take (i.e. a formal Zend >type in the engine, extending the existing zend_string type, a class, some >combination, or something else entirely). All of the more advanced options I >came up with would have required some code changes to the PHP source itself >with a new data type being the most involved and probably the most >controversial.
My instinct was that it could just be a built-in class, with an internal pointer to a zend_string that's completely invisible to userland. Something like how the SimpleXML and DOM objects just point into a libxml parse result. Then to add to existing functions requires changing an argument type from string to string|Buffer, rather than adding new arguments. No change to the type system needed, internally or externally, just some code to unwrap the pointer. But perhaps I'm being naive and oversimplifying, as I don't have a deep understanding of the engine. >I'm not entirely sure what the next step here should be. Should I go research >the above, or go back and develop/test and then propose something concrete in >an OO direction and gather feedback at that point, or should we hash it out a >bit more here on the list to get a more specific direction to go in? Well, those were just my thoughts; maybe someone else will come along shortly with a very different take. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php
