simaguo / javascript-bitwise-operators
php to achieve javascript bitwise operation
v1.0.2
2017-06-29 04:30 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- ext-v8js: *
- phpunit/phpunit: ~6.2.0
This package is not auto-updated.
Last update: 2025-03-22 02:15:58 UTC
README
In the 64-bit operating system, php to achieve javascript bitwise operation.
Installation
composer require simaguo/javascript-bitwise-operators
Usage
<?php
use Simaguo\JavascriptBitwiseOperators\Tool;
$a=1024;
$b=2;
Tool::andOperator($a, $b);//$a & $b
Tool::notOperator($a);//~$a
Tool::orOperator($a, $b);//$a | $b
Tool::shiftLeftOperator($a, $b);//$a << $b
Tool::shiftRightOperator($a, $b);//$a >> $b
Tool::unSignedShiftRightOperator($a,$b);//$a >>> $b
Tool::xorOperator($a,$b);//$a ^ $b