Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81812 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11569 invoked from network); 4 Feb 2015 12:45:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2015 12:45:44 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:62503] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/0B-55046-87412D45 for ; Wed, 04 Feb 2015 07:45:44 -0500 Received: by mail-vc0-f170.google.com with SMTP id kv7so412504vcb.1 for ; Wed, 04 Feb 2015 04:45:41 -0800 (PST) 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=cyqWRXtMVEKvK7A4+agQnTW6Xcrfzhco3DmZjkExSZo=; b=Wp0oNPjXT01TgVc73GYXg3/pYH6KP+h7GaZtILm1D+rJ3eHoXq05n7Oeau/V5M5/sW mVBQzcgpZS+qY0wJF4xMbkNNm36qbdrXicbEFYF9xgh5sAzGRUCps8L4hFTgbLaZVsHR s465d+HcLdkeIuSx7k3kdCJYZ/1+2p6MT4LF04t+SXXZiu1gm7spbuMBF+pWBUM9wztQ v8OSVEJIKEcZPWdQpzsohJgu4UpqhNMr3yfEWlGl3rUID3oeiR2iwRJiYNLzSIRkTyNO bhPwhNqqwVnabjLJ9zWsua4vTnLf1ZgbqX9heOOeaqtanFVGnjgTEmC14bbGRfuxu1s5 SONA== X-Gm-Message-State: ALoCoQlrnYMZ2BGTozQ+i6K7p0A4Ye5sc3OYKlwLnUkaRXVjUfI0AYNa8C3kMnzAhHDw6vE6qThuOHMIYPPSOaScJmtigNYS431lo+KDFbuqOwehJ1aZ9tiAcfNGW0Lkvh+MfaXYPQ5mKyZK35LfggEOJNXd3F9+7g== MIME-Version: 1.0 X-Received: by 10.52.103.75 with SMTP id fu11mr16122557vdb.5.1423053940968; Wed, 04 Feb 2015 04:45:40 -0800 (PST) Received: by 10.52.74.73 with HTTP; Wed, 4 Feb 2015 04:45:40 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Feb 2015 16:45:40 +0400 Message-ID: To: Leigh Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7b86d990a5e7d1050e4290b4 Subject: Re: [PHP-DEV] Zero-fill right shift. From: dmitry@zend.com (Dmitry Stogov) --047d7b86d990a5e7d1050e4290b4 Content-Type: text/plain; charset=UTF-8 I'm not sure if this is often necessary, but sometimes it may be nice to have. Actually, this is "logical right shift" operation (>> is "arithmetic right shift"). LSHR is a well recognizable name, used in assemblers. Use T_LSHR instead of T_SHRZF. Thanks. Dmitry. On Tue, Feb 3, 2015 at 4:20 PM, Leigh wrote: > Hi list, > > How do we feel about a zero-fill right shift operator? > > PHPs current right shift operator preserves signage, but this is not > always desirable. > > I propose the same syntax as JavaScript for this: >>> > > php -r 'var_dump(-256 >> 8);' > int(-1) > > php -r 'var_dump(-256 >>> 8);' > int(16777215) > > This will introduce a T_SHRZF token and corresponding opcode. Targeting > PHP 7. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b86d990a5e7d1050e4290b4--