source: branches/version-2_5-dev/data/module/Compat/tests/function/inet_pton.phpt @ 20116

Revision 20116, 893 bytes checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
Line 
1--TEST--
2Function -- inet_pton
3--SKIPIF--
4<?php if (function_exists('inet_pton')) { echo 'skip'; } ?>
5--FILE--
6<?php
7require_once 'PHP/Compat.php';
8PHP_Compat::loadFunction('inet_pton');
9
10$adds = array(
11    '127.0.0.1'                  => '7f000001',
12    '192.232.131.222'            => 'c0e883de',
13    '::1'                        => '00000000000000000000000000000001',
14    '2001:260:0:10::1'           => '20010260000000100000000000000001',
15    'fe80::200:4cff:fe43:172f'   => 'fe8000000000000002004cfffe43172f'
16);
17
18foreach ($adds as $k => $v) {
19    echo "\ntesting: $k\n    ";
20    echo bin2hex(inet_pton($k)), "\n";
21}
22
23?>
24--EXPECT--
25testing: 127.0.0.1
26    7f000001
27
28testing: 192.232.131.222
29    c0e883de
30
31testing: ::1
32    00000000000000000000000000000001
33
34testing: 2001:260:0:10::1
35    20010260000000100000000000000001
36
37testing: fe80::200:4cff:fe43:172f
38    fe8000000000000002004cfffe43172f
Note: See TracBrowser for help on using the repository browser.