Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106128 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50524 invoked from network); 2 Jul 2019 19:20:33 -0000 Received: from unknown (HELO mail-lf1-f48.google.com) (209.85.167.48) by pb1.pair.com with SMTP; 2 Jul 2019 19:20:33 -0000 Received: by mail-lf1-f48.google.com with SMTP id x144so11871958lfa.9 for ; Tue, 02 Jul 2019 09:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rXF1APPn6+upQfXhMmE1G5oa4NFJelWAVhiuHV659do=; b=cjwuBGapbvzKaJRH87Em9X6PHaSbYtYsFzl20zedASpbYUSFOoFYuUmc+eXkyMEG26 ahSpGlXpbOO2M5qZtfejH0m4hqkps34Bs0uzvgJlsNOs46H/AKYBFwLEp5xz4OriAy4H zwound5AV2vKxUiCPaYw78YgGgKELPY7faSfIR6SaMXyFyZIKc4alKPluTUdM4osacfx 54P7yleUOpRt3CD3DGHT3dtt7HwKkkLGIjWp+qA4sNCYykSsACIHbmK7YqZofNJfiXk+ hIj6tVKacP1m0EBxn7SNEFyYHtIbYJXfjtOGk3bfOydyNn6teffhpPSPg2LNafI6PR9I eYdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rXF1APPn6+upQfXhMmE1G5oa4NFJelWAVhiuHV659do=; b=phAn82avrfGfkE7g2HKEgUuPuj9F4G2e5qKT2JbWaGJsFV/LGuGtTgRQK2nAf0Opmw RPSrd/NNNjrXjHnWisL+VDTZQ8foPp9Q3HMBgeVPgS8o7ANKUsGinvEQX7HJr8MQFUMZ xkkDr3wQL7L9GAPn9KT42gH7jwwduExVvHU/D6ywvitUCfPmnfV7mBC/ATcUIokmzEEG eE3soj7QpwCBshih2/5PQt7TE53pA7wTlbrb049Lq1hwjqmwjBJFx81BRpL5EJkNeUe5 mRvrfKxL+dSgiGp34p+dypHbgcPyNuGZJNCOfvZbwJMmJH3ImMXYbkrEa7+oXiStVzaj Kvbg== X-Gm-Message-State: APjAAAXQY/4Eb4oYWq+X5GGK7GGNoPLPiwl5ij6AIMvS04PuC3MbJBmJ f37b4Vg0x9plwlwQVJB0kN5/sJQiXW1IN1Yq5kc= X-Google-Smtp-Source: APXvYqwLTQJz4j+vONiae2D7j3SepzvuxznKJy49BGDi/NUr3WXdx9lbyHpNHRg+PYrd4RnHkBph68A0dPdGHbkW6SY= X-Received: by 2002:a19:9152:: with SMTP id y18mr15074362lfj.128.1562085508599; Tue, 02 Jul 2019 09:38:28 -0700 (PDT) MIME-Version: 1.0 References: <008001d526a0$a6ac24e0$f4046ea0$@jhdxr.com> <5a5d7c1247d0d75591980c1571f12dbc@exussum.co.uk> In-Reply-To: <5a5d7c1247d0d75591980c1571f12dbc@exussum.co.uk> Date: Tue, 2 Jul 2019 18:38:12 +0200 Message-ID: To: Scott Dutton Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d953d9058cb55f3e" Subject: Re: [PHP-DEV] [RFC] [Vote] Base convert changes From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d953d9058cb55f3e Content-Type: text/plain; charset="UTF-8" On Mon, Jul 1, 2019 at 4:09 PM Scott Dutton 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 --000000000000d953d9058cb55f3e--