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/* Prototype : int ip2long(string ip_address) 16 * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address 17 * Source code: ext/standard/basic_functions.c 18 * Alias to functions: 19 */ 20 21$ips = array( 22 "1.1.011.011", 23 "127.0.0.1", 24 "1.1.071.071", 25 "0.0.0.0", 26 "1.1.081.081", 27 "192.168.0.0", 28 "256.0.0.1", 29 "192.168.0xa.5", 30); 31 32foreach($ips as $ip) { 33 var_dump(ip2long($ip)); 34} 35 36?> 37===DONE=== 38--EXPECT-- 39bool(false) 40int(2130706433) 41bool(false) 42int(0) 43bool(false) 44int(3232235520) 45bool(false) 46bool(false) 47===DONE=== 48