Annotation of embedaddon/php/ext/standard/tests/math/dechex_basiclong_64bit.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test dechex function : 64bit long tests
                      3: --SKIPIF--
                      4: <?php
                      5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9:  
                     10: define("MAX_64Bit", 9223372036854775807);
                     11: define("MAX_32Bit", 2147483647);
                     12: define("MIN_64Bit", -9223372036854775807 - 1);
                     13: define("MIN_32Bit", -2147483647 - 1);
                     14: 
                     15: $longVals = array(
                     16:     MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
                     17:     MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
                     18:     MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
                     19: );
                     20: 
                     21: 
                     22: foreach ($longVals as $longVal) {
                     23:    echo "--- testing: $longVal ---\n";
                     24:    var_dump(dechex($longVal));
                     25: }
                     26:    
                     27: ?>
                     28: ===DONE===
                     29: --EXPECT--
                     30: --- testing: 9223372036854775807 ---
                     31: string(16) "7fffffffffffffff"
                     32: --- testing: -9223372036854775808 ---
                     33: string(16) "8000000000000000"
                     34: --- testing: 2147483647 ---
                     35: string(8) "7fffffff"
                     36: --- testing: -2147483648 ---
                     37: string(16) "ffffffff80000000"
                     38: --- testing: 9223372034707292160 ---
                     39: string(16) "7fffffff80000000"
                     40: --- testing: -9223372034707292160 ---
                     41: string(16) "8000000080000000"
                     42: --- testing: 2147483648 ---
                     43: string(8) "80000000"
                     44: --- testing: -2147483649 ---
                     45: string(16) "ffffffff7fffffff"
                     46: --- testing: 4294967294 ---
                     47: string(8) "fffffffe"
                     48: --- testing: 4294967295 ---
                     49: string(8) "ffffffff"
                     50: --- testing: 4294967293 ---
                     51: string(8) "fffffffd"
                     52: --- testing: 9223372036854775806 ---
                     53: string(16) "7ffffffffffffffe"
                     54: --- testing: 9.2233720368548E+18 ---
                     55: string(16) "8000000000000000"
                     56: --- testing: -9223372036854775807 ---
                     57: string(16) "8000000000000001"
                     58: --- testing: -9.2233720368548E+18 ---
                     59: string(16) "8000000000000000"
                     60: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>