Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77241 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52104 invoked from network); 16 Sep 2014 10:05:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2014 10:05:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.169 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.169 mail-vc0-f169.google.com Received: from [209.85.220.169] ([209.85.220.169:51066] helo=mail-vc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/5C-64534-A7B08145 for ; Tue, 16 Sep 2014 06:05:46 -0400 Received: by mail-vc0-f169.google.com with SMTP id ij19so4766689vcb.0 for ; Tue, 16 Sep 2014 03:05:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7UCWrgmBKr8s9upJx9vBx8dqCTnZBYdPhVYlk1SzDyA=; b=VpboZflT6QIaGfWgQIsMVH3k2i43HIkKyodYP54djifJ0a7r4g4oU46y80WWYnTkeT AOeYmbHJj/0UihuiU5AcuhIayPnRDiBYj8yeIklqezhXP8dxSDVTNwOYx6Rk+u+NyZ8o 54ztnwcb+W4KrkuVNT9skfdQXoH0/iUt/eQVPgn8AY+5mMP9jGATFt7DK9P86Tw6V/OV StlIh1BDCZ9SQgGi0l9cUjODSQWXsXeakQZbGNVilZ8W7vAzrJFBdH9KSv/cO/Iuw+qR lQ/JdduJZngagANzy3kw3pEs8b3i1BPCfZTKnLE9cmJuSVI4yg+48gQHIM4OvX8G6huz TDZg== X-Gm-Message-State: ALoCoQnONEuTEZA4otEDj1MUHzgjjffYvLe3i16H7OCTdqYSoH+cA8ZJ5FuiLz/MsCCue2Rda9/m/7ycxMM+otst05RrDog+vBV6m/aa8HX6P4tCJqO0geEU2tSHMpbP05B++6plsn/7dV2ydmOkkiu4N+yjx0Xz2g== MIME-Version: 1.0 X-Received: by 10.220.4.137 with SMTP id 9mr28692311vcr.27.1410861943107; Tue, 16 Sep 2014 03:05:43 -0700 (PDT) Received: by 10.52.158.197 with HTTP; Tue, 16 Sep 2014 03:05:43 -0700 (PDT) In-Reply-To: <93C6A290-493F-42B3-824B-AE81ACCDBA61@ajf.me> References: <528B8D9E-58FF-47DD-9B91-013F8844EC70@ajf.me> <93C6A290-493F-42B3-824B-AE81ACCDBA61@ajf.me> Date: Tue, 16 Sep 2014 14:05:43 +0400 Message-ID: To: Andrea Faulds Cc: Levi Morrison , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a11c3a8d6f24f0005032be4fe Subject: Re: [PHP-DEV] [VOTE][RFC] Integer Semantics From: dmitry@zend.com (Dmitry Stogov) --001a11c3a8d6f24f0005032be4fe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable you already made silent break for N << 64 and N >> 64, but it may be explained as more consistent behaviour. I don't see a big difference with negative shifts. The real thing that I don't like - is a "boolean" result. Warning is not a big problem. Thanks. Dmitry. On Tue, Sep 16, 2014 at 1:23 PM, Andrea Faulds wrote: > > On 16 Sep 2014, at 10:16, Dmitry Stogov wrote: > > > Shifts by negative number may make sense. (N << -1) =3D> (N >> 1) > > At least receiving "false" from shift is not very pleasant. > > The problem is that changing from the current behaviour (undefined in C, > but typically a shift by (PHP_INT_MAX - $bits)) to do what you=E2=80=99d = expect > (shift in the opposite direction) would be a silent BC break. I think it= =E2=80=99s > better to just stop it altogether and raise an E_WARNING, where it=E2=80= =99s at > least obvious something went wrong, than change this behaviour silently. > > > In the patch you use SIZEOF_LONG. It probably should be changed to > > SIZEOF_ZEND_LONG. > > Will fix, thanks for spotting that. > > -- > Andrea Faulds > http://ajf.me/ > > > > > --001a11c3a8d6f24f0005032be4fe--