Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #38770 (unpack() broken with longs on 64 bit machines) --SKIPIF-- <?php if (P..

Decoded Output download

--TEST--
Bug #38770 (unpack() broken with longs on 64 bit machines)
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php

foreach (array('N','l') as $v) {
    print_r(unpack($v, pack($v, -30000)));
}

echo "Done
";
?>
--EXPECT--
Array
(
    [1] => 4294937296
)
Array
(
    [1] => -30000
)
Done

Did this file decode correctly?

Original Code

--TEST--
Bug #38770 (unpack() broken with longs on 64 bit machines)
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php

foreach (array('N','l') as $v) {
    print_r(unpack($v, pack($v, -30000)));
}

echo "Done\n";
?>
--EXPECT--
Array
(
    [1] => 4294937296
)
Array
(
    [1] => -30000
)
Done

Function Calls

None

Variables

None

Stats

MD5 2079a39ab479537d2b7af6bf4224ffb0
Eval Count 0
Decode Time 84 ms