Am 01.07.2025 um 14:40 schrieb Gina P. Banyard <intern...@gpb.moe>: >> The RFC talks about "from" AND "to" bool conversion but the examples under >> Backward Incompatible Changes only seem mention "from" bool, is that correct? > > I didn't think adding examples for "to" bool was useful, but I can add some.
Thanks! >> I tried the implementation in branch bool-juggling-dep-poc on >> https://github.com/Girgias/php-src.git and encountered two things: >> - php -r 'strlen(false);' produced a core dump with Zend/zend_API.c:561: >> zend_arg_from_bool_deprecated: Assertion `func->common.fn_flags & (1 << 14)' >> failed. > > I forgot to update the optimized strlen opcode, I pushed a fix for this, > please pull in the latest version of the branch that has been force pushed. Yes, that fixed it for me. >> - array_slice($a, 1, preserve_keys:"a") did not produce a warning even >> though I would have thought that is a "to" bool conversion. Am I wrong? What >> should I test instead? > > I haven't had time to look at why this is not triggering as it should. But > some internal functions do weird stuff sometimes. Not sure if it was a side-effect of the other fix or if you fixed more but the code above now correctly reports a warning. Thanks again, my evaluation with our code base show very little impact so I'm positive about the change, - Chris