Return to octdec_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Test octdec() - basic function test octdec() 3: --SKIPIF-- 4: <?php 5: if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6: ?> 7: --FILE-- 8: <?php 9: $values = array(01234567, 10: 0567, 11: 017777777777, 12: 020000000000, 13: 0x1234ABC, 14: 12345, 15: '01234567', 16: '0567', 17: '017777777777', 18: '020000000000', 19: '0x1234ABC', 20: '12345', 21: 31101.3, 22: 31.1013e5, 23: true, 24: false, 25: null); 26: 27: for ($i = 0; $i < count($values); $i++) { 28: $res = octdec($values[$i]); 29: var_dump($res); 30: } 31: ?> 32: --EXPECTF-- 33: int(14489) 34: int(253) 35: int(36947879) 36: int(4618484) 37: int(4104) 38: int(5349) 39: int(342391) 40: int(375) 41: int(2147483647) 42: float(2147483648) 43: int(668) 44: int(5349) 45: int(102923) 46: int(823384) 47: int(1) 48: int(0) 49: int(0)