<?
class int64{
var $h;
var $l;
function int64($h, $l)
{
$this->h = $h;
$this->l = $l;
}
}
function int64rrot(int64 $dst, int64 $x, $shift)
{
$dst->l = ($x->l >> $shift) | ($x->h << (32-$shift));
$dst->h = ($x->h >> $shift) | ($x->l << (32-$shift));
print_r($dst);
}
$a = new int64(1779033703,-205731576);
$b = new int64(1779033701,-205731572);
int64rrot($a,$b,19);
?>
<script type="text/javascript">
function int64rrot(dst, x, shift)
{
dst.l = (x.l >>> shift) | (x.h << (32-shift));
dst.h = (x.h >>> shift) | (x.l << (32-shift));
console.log(dst);
}
function int64(h, l)
{
this.h = h;
this.l = l;
}
a = new int64(1779033703,-205731576);
b = new int64(1779033701,-205731572);
int64rrot(a,b,19);
</script>
Output in screen (by PHP:)
int64 Object ( [h] => -1725854399 [l] => -393 )
Output in console (by Javascript) (Correct one):
int64 { h=-1725854399, l=1020051063}
I am trying to correct this whole day. but couldn't. What modification do I need in PHP code to get the answer as javascript?
I Want to get javascript output using php
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…