Re: [RFC] Warn about invalid strings in arithmetic (moving backtodiscussion)

From: Date: Fri, 05 Feb 2016 12:59:23 +0000
Subject: Re: [RFC] Warn about invalid strings in arithmetic (moving backtodiscussion)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-91085@lists.php.net to get a copy of this message
Hi Mike, Michael Wallner wrote:
To be honest, I had not even memorised intval() supports a base, but that we have base_convert(). I’d opt for dropping base convert support from intval(), but that’s obviously not possible, because PHP-7.1 is the target for this RFC.
Yeah, it's easy to forget about it. And as I've mentioned before, it violates weak typing, unfortunately. base_convert() is more uniform, but it's horrible in its own way (ignores any characters in any position which aren't of the expected base). The bin/hex/dec/oct family have similar issues. Alas, you're correct that we can't really do much about this in 7.1. -- Andrea Faulds https://ajf.me/

« previous php.internals (#91085) next »