Re: Base_convert changes
| From: | Scott Dutton | Date: | Tue, 12 Mar 2019 13:05:59 +0000 |
| Subject: | Re: Base_convert changes | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104670@lists.php.net to get a copy of this message | ||
On 11.03.2019 10:51, Nikita Popov wrote:
Both changes sound reasonable to me. Could you show some examples where the output is going to change due to the zend_ulong->zend_long switch? NikitaSure! For example var_dump(decbin(9223372036854775807)); would currently show string(64) "1000000000000000000000000000000000000000000000000000000000000000" After these changes it would show string(65) "-000000000000000000000000000000000000000000000000000000000000000" var_dump(decbin(9223372036854775806)); would be the same for both showing. string(63) "111111111111111111111111111111111111111111111111111111111111110" As the code is reused for decbin etc all of the helper functions have a similar effect. Also userland code would look like this currently $converted = base_convert($original, 2, 10); if ($original < 0) {
$converted = - $converted;} So anyone who use coded around this will also break. I have pushed some fixed suggested to the PR again all comments welcome, my C is quite rusty so happy to change anything Thanks