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_INT_SIZE != 8) {die('skip 64 bit only');} 12?> 13--FILE-- 14<?php 15$ips = array( 16 "1.1.011.011", 17 "127.0.0.1", 18 "1.1.071.071", 19 "0.0.0.0", 20 "1.1.081.081", 21 "192.168.0.0", 22 "256.0.0.1", 23 "192.168.0xa.5", 24); 25 26foreach($ips as $ip) { 27 var_dump(ip2long($ip)); 28} 29 30?> 31--EXPECT-- 32bool(false) 33int(2130706433) 34bool(false) 35int(0) 36bool(false) 37int(3232235520) 38bool(false) 39bool(false) 40