1--TEST-- 2Test sscanf() function : basic functionality - unsigned format 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) { 6 die("skip this test is for 32bit platform only"); 7} 8?> 9--FILE-- 10<?php 11 12/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] ) 13 * Description: Parses input from a string according to a format 14 * Source code: ext/standard/string.c 15*/ 16 17echo "*** Testing sscanf() : basic functionality - using unsigned format ***\n"; 18 19$str = "-11 +11 11 -11.234 +11.234 11.234"; 20$format = "%u %u %u %u %u %u"; 21 22echo "\n-- Try sccanf() WITHOUT optional args --\n"; 23// extract details using short format 24list($arg1, $arg2, $arg3, $arg4, $arg5, $arg6) = sscanf($str, $format); 25var_dump($arg1, $arg2, $arg3, $arg4, $arg5, $arg6); 26 27echo "\n-- Try sccanf() WITH optional args --\n"; 28// extract details using long format 29$res = sscanf($str, $format, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); 30var_dump($res, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); 31 32?> 33===DONE=== 34--EXPECT-- 35*** Testing sscanf() : basic functionality - using unsigned format *** 36 37-- Try sccanf() WITHOUT optional args -- 38string(10) "4294967285" 39int(11) 40int(11) 41string(10) "4294967285" 42NULL 43NULL 44 45-- Try sccanf() WITH optional args -- 46int(4) 47string(10) "4294967285" 48int(11) 49int(11) 50string(10) "4294967285" 51NULL 52NULL 53===DONE=== 54