1--TEST-- 2Test ip2long() function : usage variation 2, 64 bit 3--SKIPIF-- 4<?php 5/* from man inet_pton : 6 All numbers supplied as ``parts'' in a `.' notation may be decimal, octal, or hexadecimal, as specified 7 in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; 8 otherwise, the number is interpreted as decimal). 9*/ 10if(PHP_OS == 'Darwin') die("skip - inet_pton behaves differently on Darwin"); 11if(PHP_OS == 'OpenBSD') die("skip - inet_pton accepts leading zeros on OpenBSD"); 12if(PHP_INT_SIZE != 8) {die('skip 64 bit only');} 13?> 14--FILE-- 15<?php 16$ips = array( 17 "1.1.011.011", 18 "127.0.0.1", 19 "1.1.071.071", 20 "0.0.0.0", 21 "1.1.081.081", 22 "192.168.0.0", 23 "256.0.0.1", 24 "192.168.0xa.5", 25); 26 27foreach($ips as $ip) { 28 var_dump(ip2long($ip)); 29} 30 31?> 32--EXPECT-- 33bool(false) 34int(2130706433) 35bool(false) 36int(0) 37bool(false) 38int(3232235520) 39bool(false) 40bool(false) 41