1--TEST-- 2Test sprintf() 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/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]]) 12 * Description: Return a formatted string 13 * Source code: ext/standard/formatted_print.c 14 */ 15 16echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n"; 17 18 19// Initialise all required variables 20$format = "format"; 21$format1 = "%u"; 22$format2 = "%u %u"; 23$format3 = "%u %u %u"; 24$arg1 = -1111; 25$arg2 = -1234567; 26$arg3 = +2345432; 27 28// Calling sprintf() with default arguments 29var_dump( sprintf($format) ); 30 31// Calling sprintf() with two arguments 32var_dump( sprintf($format1, $arg1) ); 33 34// Calling sprintf() with three arguments 35var_dump( sprintf($format2, $arg1, $arg2) ); 36 37// Calling sprintf() with four arguments 38var_dump( sprintf($format3, $arg1, $arg2, $arg3) ); 39 40echo "Done"; 41?> 42--EXPECTF-- 43*** Testing sprintf() : basic functionality - using unsigned format *** 44string(6) "format" 45string(10) "4294966185" 46string(21) "4294966185 4293732729" 47string(29) "4294966185 4293732729 2345432" 48Done 49