Return to bindec_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Test bindec() - basic function test bindec() 3: --SKIPIF-- 4: <?php 5: if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6: ?> 7: --INI-- 8: precision=14 9: --FILE-- 10: <?php 11: $values = array(111000111, 12: 011100000, 13: 1111111111111111111111111111111, 14: 10000000000000000000000000000000, 15: 100002001, 16: '111000111', 17: '011100000', 18: '1111111111111111111111111111111', 19: '10000000000000000000000000000000', 20: '100002001', 21: 'abcdefg', 22: 311015, 23: 31101.3, 24: 31.1013e5, 25: 0x111ABC, 26: 011237, 27: true, 28: false, 29: null); 30: 31: for ($i = 0; $i < count($values); $i++) { 32: $res = bindec($values[$i]); 33: var_dump($res); 34: } 35: ?> 36: --EXPECTF-- 37: int(455) 38: int(0) 39: int(32766) 40: int(5) 41: int(129) 42: int(455) 43: int(224) 44: int(2147483647) 45: float(2147483648) 46: int(129) 47: int(0) 48: int(13) 49: int(13) 50: int(26) 51: int(6) 52: int(0) 53: int(1) 54: int(0) 55: int(0)