Re: [RFC] [Vote] Base convert changes

From: Date: Tue, 02 Jul 2019 16:38:12 +0000
Subject: Re: [RFC] [Vote] Base convert changes
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-106128@lists.php.net to get a copy of this message
On Mon, Jul 1, 2019 at 4:09 PM Scott Dutton <scott@exussum.co.uk> wrote: > Hi all > > I have made a PR for 7.4 for just the ignoring invalid input. I will > open a similar one for PHP 8. > > https://github.com/php/php-src/pull/4328 > > All tests have been fixed for linux, there is one failure for windows > which I am looking in to. > > Voting ends in a few days time so last chance to vote. looks like the > negative number part is not going to pass so the PR has not been > updated. > Link to RFC if you need it - > https://wiki.php.net/rfc/base_convert_improvements > > Any questions please let me know > > Thanks > > Scott > A possibility to consider would to only support negative numbers in bindec, octdec and hexdec. Allowing negative numbers wouldn't change any existing behavior (assuming we consider the leading "-" an error before, as we would per this RFC). The problem is only on the decbin, decoct and dechex side, where we currently treat the input as unsigned. base_convert could also support negative numbers, though it might need some implementation changes (it would be great to make base_convert directly work from string -> string to avoid the float precision loss.) Nikita

« previous php.internals (#106128) next »