????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.16.44.204 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/network/ |
Upload File : |
--TEST-- inet_ntop() & inet_pton() tests --SKIPIF-- <?php if (!function_exists("inet_ntop")) die("skip no inet_ntop()"); if (!function_exists("inet_pton")) die("skip no inet_pton()"); ?> --FILE-- <?php $packed = chr(127) . chr(0) . chr(0) . chr(1); var_dump(inet_ntop((binary)$packed)); $packed = chr(255) . chr(255) . chr(255) . chr(0); var_dump(inet_ntop((binary)$packed)); var_dump(inet_ntop()); var_dump(inet_ntop(-1)); var_dump(inet_ntop(b"")); var_dump(inet_ntop(b"blah-blah")); var_dump(inet_pton()); var_dump(inet_pton(b"")); var_dump(inet_pton(-1)); var_dump(inet_pton(b"abra")); $array = array( b"127.0.0.1", b"66.163.161.116", b"255.255.255.255", b"0.0.0.0", ); foreach ($array as $val) { var_dump(bin2hex($packed = inet_pton($val))); var_dump(inet_ntop($packed)); } echo "Done\n"; ?> --EXPECTF-- %unicode|string%(9) "127.0.0.1" %unicode|string%(13) "255.255.255.0" Warning: inet_ntop() expects exactly 1 parameter, 0 given in %s on line %d bool(false) Warning: inet_ntop(): Invalid in_addr value in %s on line %d bool(false) Warning: inet_ntop(): Invalid in_addr value in %s on line %d bool(false) Warning: inet_ntop(): Invalid in_addr value in %s on line %d bool(false) Warning: inet_pton() expects exactly 1 parameter, 0 given in %s on line %d bool(false) Warning: inet_pton(): Unrecognized address in %s on line %d bool(false) Warning: inet_pton(): Unrecognized address -1 in %s on line %d bool(false) Warning: inet_pton(): Unrecognized address abra in %s on line %d bool(false) %unicode|string%(%d) "7f000001" %unicode|string%(9) "127.0.0.1" %unicode|string%(%d) "42a3a174" %unicode|string%(14) "66.163.161.116" %unicode|string%(%d) "ffffffff" %unicode|string%(15) "255.255.255.255" %unicode|string%(%d) "00000000" %unicode|string%(7) "0.0.0.0" Done