Annotation of embedaddon/php/ext/standard/tests/math/hexdec_basic_64bit.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test hexdec() - basic function test hexdec()
! 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: echo "*** Testing hexdec() : basic functionality ***\n";
! 10:
! 11: $values = array(0x123abc,
! 12: 0x789DEF,
! 13: 0x7FFFFFFF,
! 14: 0x80000000,
! 15: '0x123abc',
! 16: '0x789DEF',
! 17: '0x7FFFFFFF',
! 18: '0x80000000',
! 19: '0x123XYZABC',
! 20: 311015,
! 21: '311015',
! 22: 31101.3,
! 23: 31.1013e5,
! 24: 011237,
! 25: '011237',
! 26: true,
! 27: false,
! 28: null);
! 29:
! 30: foreach($values as $value) {
! 31: echo "\n-- hexdec $value --\n";
! 32: var_dump(hexdec($value));
! 33: };
! 34:
! 35: ?>
! 36: ===Done===
! 37: --EXPECTF--
! 38: *** Testing hexdec() : basic functionality ***
! 39:
! 40: -- hexdec 1194684 --
! 41: int(18433668)
! 42:
! 43: -- hexdec 7904751 --
! 44: int(126895953)
! 45:
! 46: -- hexdec 2147483647 --
! 47: int(142929835591)
! 48:
! 49: -- hexdec 2147483648 --
! 50: int(142929835592)
! 51:
! 52: -- hexdec 0x123abc --
! 53: int(1194684)
! 54:
! 55: -- hexdec 0x789DEF --
! 56: int(7904751)
! 57:
! 58: -- hexdec 0x7FFFFFFF --
! 59: int(2147483647)
! 60:
! 61: -- hexdec 0x80000000 --
! 62: int(2147483648)
! 63:
! 64: -- hexdec 0x123XYZABC --
! 65: int(1194684)
! 66:
! 67: -- hexdec 311015 --
! 68: int(3215381)
! 69:
! 70: -- hexdec 311015 --
! 71: int(3215381)
! 72:
! 73: -- hexdec 31101.3 --
! 74: int(3215379)
! 75:
! 76: -- hexdec 3110130 --
! 77: int(51446064)
! 78:
! 79: -- hexdec 4767 --
! 80: int(18279)
! 81:
! 82: -- hexdec 011237 --
! 83: int(70199)
! 84:
! 85: -- hexdec 1 --
! 86: int(1)
! 87:
! 88: -- hexdec --
! 89: int(0)
! 90:
! 91: -- hexdec --
! 92: int(0)
! 93: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>