note 125434 added to class.arithmeticerror
| From: | nima dot shirinzadeh at gmail dot com | Date: | Mon, 12 Oct 2020 05:45:03 +0000 |
| Subject: | note 125434 added to class.arithmeticerror | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215573@lists.php.net to get a copy of this message | ||
the first example shifted by the positive number and the result is 4, but the second example shifted
by the negative number and the result is ArithmeticError(this example is the same for left shift)
<?php
$shif =1;
$number = 8;
$result = $number >> $shif;
echo $result; //// 1000 >> 01000 = 4
$shif =-1;
$number = 8;
$result = $number >> $shif;
////result is ArithmeticError
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.172 (proxied: 80.82.68.179)
----
Manual Page -- http://php.net/manual/en/class.arithmeticerror.php
Edit -- https://master.php.net/note/edit/125434
Del: integrated -- https://master.php.net/note/delete/125434/integrated
Del: useless -- https://master.php.net/note/delete/125434/useless
Del: bad code -- https://master.php.net/note/delete/125434/bad+code
Del: spam -- https://master.php.net/note/delete/125434/spam
Del: non-english -- https://master.php.net/note/delete/125434/non-english
Del: in docs -- https://master.php.net/note/delete/125434/in+docs
Del: other reasons-- https://master.php.net/note/delete/125434
Reject -- https://master.php.net/note/reject/125434
Search -- https://master.php.net/manage/user-notes.php