--TEST-- Test vsprintf() function : usage variations - char formats with non-char values --FILE-- "12twelve"), array("3"), array("4"), array("1"), array("2") ), // array of boolean data array( true, TRUE, false, TRUE, 0, FALSE, 1, true, false, TRUE, FALSE, 0, 1, 1, 0, 1, TRUE, 0, FALSE), ); // looping to test vsprintf() with different char formats from the above $format array // and with non-char values from the above $args_array array $counter = 1; foreach($args_array as $args) { echo "\n-- Iteration $counter --\n"; var_dump( vsprintf($formats, $args) ); $counter++; } echo "Done"; ?> --EXPECTF-- *** Testing vsprintf() : char formats and non-char values *** -- Iteration 1 -- string(50) "A B ] c ~ # = 2 B ] A " -- Iteration 2 -- string(50) "A B c ~ # = 2 B A " -- Iteration 3 -- string(50) " { c { @ { " -- Iteration 4 -- string(50) "    c              " -- Iteration 5 -- string(50) "   c        " Done --UEXPECTF-- *** Testing vsprintf() : char formats and non-char values *** -- Iteration 1 -- unicode(50) "A ﾿ B ] c ~ ツ # ￝ ¢ ᅢ = 2 ᅧ B ] A ﾿" -- Iteration 2 -- unicode(50) "A ﾿ B ᄅ c ~ ツ # ￝ ¢ ᅢ = 2 ᅧ B ᄅ A ﾿" -- Iteration 3 -- unicode(50) " { c ナ { @ ᅭ { " -- Iteration 4 -- unicode(50) "    c              " -- Iteration 5 -- unicode(50) "   c        " Done