1--TEST--
2Test sscanf() function : basic functionality - octal format
3--FILE--
4<?php
5
6echo "*** Testing sscanf() : basic functionality - using octal format ***\n";
7
8$str = "0123 -0123 +0123 0129 -0129 +0129";
9$format = "%o %o %o %o %o %o";
10
11echo "\n-- Try sccanf() WITHOUT optional args --\n";
12// extract details using short format
13list($arg1, $arg2, $arg3, $arg4, $arg5, $arg6) = sscanf($str, $format);
14var_dump($arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
15
16echo "\n-- Try sccanf() WITH optional args --\n";
17// extract details using long  format
18$res = sscanf($str, $format, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
19var_dump($res, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
20
21?>
22--EXPECT--
23*** Testing sscanf() : basic functionality - using octal format ***
24
25-- Try sccanf() WITHOUT optional args --
26int(83)
27int(-83)
28int(83)
29int(10)
30NULL
31NULL
32
33-- Try sccanf() WITH optional args --
34int(4)
35int(83)
36int(-83)
37int(83)
38int(10)
39NULL
40NULL
41