Fix: Initialise $x to fix PhanUndeclaredVariableAssignOp & optimize
This commit is contained in:
parent
a34798c832
commit
bee172c4b7
1 changed files with 2 additions and 1 deletions
|
|
@ -1589,8 +1589,9 @@ function check_value($mask, $value)
|
|||
function binhex($bin, $pad = false, $upper = false)
|
||||
{
|
||||
$last = dol_strlen($bin) - 1;
|
||||
$x = 0;
|
||||
for ($i = 0; $i <= $last; $i++) {
|
||||
$x += $bin[$last - $i] * pow(2, $i);
|
||||
$x += ($bin[$last - $i] ? 1 : 0) << $i;
|
||||
}
|
||||
$x = dechex($x);
|
||||
if ($pad) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue