Hello Josh, > Link to working draft: https://bit.ly/php-0001 <https://bit.ly/php-0001>
>From a type safety POV I'd prefer to have an interface available, the same way we did to the Stringable interface RFC. But I'd rather keep these engine affecting behaviors with the same magic method naming conventions and its `__` prefix. So `implements Bool` + `function __toBool() : bool` is the only path that seems entirely consistent with what we already have. The draft doesn't mention (bool) casting behavior at the time I'm reading it, but you do mention the possibility. It seems necessary to me. Why wouldn't `(bool) $my_bool_obj` behave differently from `(string) $my_stringable_obj`? > > ps. If you have any feedback or information on social interactions here that > might help, please do let me know, normally I would have watched for a while > before putting my foot in - hopefully it doesn’t end up in my mouth. :) Thanks, Márcio Almada -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php