1--TEST-- 2Test bindec() - basic function test bindec() 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6?> 7--INI-- 8precision=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 ); 30 31for ($i = 0; $i < count($values); $i++) { 32 $res = bindec($values[$i]); 33 var_dump($res); 34} 35?> 36--EXPECTF-- 37int(455) 38 39Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 40int(0) 41 42Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 43int(32766) 44 45Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 46int(5) 47 48Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 49int(129) 50int(455) 51int(224) 52int(2147483647) 53float(2147483648) 54 55Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 56int(129) 57 58Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 59int(0) 60 61Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 62int(13) 63 64Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 65int(13) 66 67Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 68int(26) 69 70Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 71int(6) 72 73Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 74int(0) 75int(1) 76int(0) 77