Re: [PATCH] Unsigned Right Shift Operator
| From: | Jason Greene | Date: | Mon, 18 Mar 2002 05:28:48 +0000 |
| Subject: | Re: [PATCH] Unsigned Right Shift Operator | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-81411@lists.php.net to get a copy of this message | ||
Note: there is a slight WS fix in this patch. (A couple of lines had
trailing spaces)
On Sun, 2002-03-17 at 23:22, Jason Greene wrote:
> After a short discussion on the zend-engine-2 list about handling
> unsigned values I decided to write a quick patch (Attached) that adds an
> unsigned right shift operator, and an unsigned right shift assign
> operator (Similar to Java).
>
> The following code/output displays the difference:
>
> Code:
>
> <?php
>
> $signed = 1 << 31 >> 31;
> $unsigned = 1 << 31 >>> 31;
>
> print "Signed: $signed\n";
> print "Unsigned: $unsigned\n";
>
> ?>
>
> Output:
>
> Signed: -1
> Unsigned: 1
>
>
>
>