Re: [RFC] Base convert changes

From: Date: Tue, 21 May 2019 08:43:34 +0000
Subject: Re: [RFC] Base convert changes
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-105771@lists.php.net to get a copy of this message
On Tue, 21 May 2019, 06:42 Scott Dutton, <scott@exussum.co.uk> wrote: > > Not sure if I can add and example to the RFC at this point, but I came > across another example of this recently. > > > > https://gist.github.com/iansltx/4820b02ab276c3306314daaa41573445#file-getlines-php-L9 > > // bindec() was doing weird things, hence converting through hex > first > // sttrev() to match endian-ness to expectations; zip file values > are little-endian > $compressedSize = hexdec(bin2hex(strrev(fread($stream, 4)))); // > compressed size > > bindec was returning 0 without warning, as it was passed binary data > not a binary string. No warning bin2hex actually does the correct > translation. > > a warning here would have at least indicated there was something wrong > with the input it was being passed instead of just 0. > > Thanks > > Scott > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Until the RFC is in voting you can still make amendments to it. So feel free to add these functions/examples to the RFC. Best regards George Peter Banyard

« previous php.internals (#105771) next »