-
-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
Description
php
$t = 1 & 1 << 7;
var_dump($t);int(0)
zephir
int t;
int u = 1;
int v = 1;
let t = u & v << 7;
var_dump(t);u = 1;
v = 1;
t = ((u & v) << 7);
ZEPHIR_INIT_VAR(&_10);
ZEPHIR_INIT_NVAR(&_10);
ZVAL_LONG(&_10, t);
zephir_var_dump(&_10);int(128)
look at this:
php -r "var_dump((1 & 1) << 7);"
int(128)
php -r "var_dump(1 & 1 << 7);"
int(0)
so we shouldn't add parenthes t = ((u & v) << 7); here.