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 11echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n"; 12 13 14// Initialise all required variables 15$format = "format"; 16$format1 = "%u"; 17$format2 = "%u %u"; 18$format3 = "%u %u %u"; 19$arg1 = -1111; 20$arg2 = -1234567; 21$arg3 = +2345432; 22 23// Calling sprintf() with default arguments 24var_dump( sprintf($format) ); 25 26// Calling sprintf() with two arguments 27var_dump( sprintf($format1, $arg1) ); 28 29// Calling sprintf() with three arguments 30var_dump( sprintf($format2, $arg1, $arg2) ); 31 32// Calling sprintf() with four arguments 33var_dump( sprintf($format3, $arg1, $arg2, $arg3) ); 34 35echo "Done"; 36?> 37--EXPECT-- 38*** Testing sprintf() : basic functionality - using unsigned format *** 39string(6) "format" 40string(10) "4294966185" 41string(21) "4294966185 4293732729" 42string(29) "4294966185 4293732729 2345432" 43Done 44