Removing lots of bogus tests...
Closes GH-5435.
break;
default:
- break;
+ zend_value_error("Unknown format specifier '%c'", *format);
+ goto fail;
}
format++;
format_len--;
--SKIPIF--
<?php
if (PHP_INT_MAX > 2147483647) {
- die("skip 32bit test only");
+ die("skip 32bit test only");
}
?>
--FILE--
printf("%.988f",1.23456789e10);
echo"\n\n*** Output for invalid width(-15) specifier ***\n";
-printf("%030.-15s", $tempstring);
+try {
+ printf("%030.-15s", $tempstring);
+} catch (ValueError $e) {
+ echo $e->getMessage();
+}
echo"\n\n*** Output for '%F' as the format parameter ***\n";
printf("%F",1.23456789e10);
12345678900.00000000000000000000000000000000000000000000000000000
*** Output for invalid width(-15) specifier ***
-15s
+Unknown format specifier '-'
*** Output for '%F' as the format parameter ***
12345678900.000000
printf("%.988f",1.23456789e10);
echo"\n\n*** Output for invalid width(-15) specifier ***\n";
-printf("%030.-15s", $tempstring);
+try {
+ printf("%030.-15s", $tempstring);
+} catch (ValueError $e) {
+ echo $e->getMessage();
+}
echo"\n\n*** Output for '%F' as the format parameter ***\n";
printf("%F",1.23456789e10);
12345678900.0000000000%d
*** Output for invalid width(-15) specifier ***
-15s
+Unknown format specifier '-'
*** Output for '%F' as the format parameter ***
12345678900.000000
// various float formats
$float_formats = array(
- "%f", "%hf", "%lf",
- "%Lf", " %f", "%f ",
- "\t%f", "\n%f", "%4f",
- "%30f", "%[0-9]", "%*f"
+ "%f", "%lf", " %f", "%f ",
+ "\t%f", "\n%f", "%4f", "%30f",
);
$count = 1;
-- Iteration 1 --
string(8) "0.000000"
-string(1) "f"
string(8) "0.000000"
-string(1) "f"
string(9) " 0.000000"
string(9) "0.000000 "
string(9) " 0.000000"
0.000000"
string(8) "0.000000"
string(30) " 0.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 2 --
string(8) "1.000000"
-string(1) "f"
string(8) "1.000000"
-string(1) "f"
string(9) " 1.000000"
string(9) "1.000000 "
string(9) " 1.000000"
1.000000"
string(8) "1.000000"
string(30) " 1.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 3 --
string(9) "-1.000000"
-string(1) "f"
string(9) "-1.000000"
-string(1) "f"
string(10) " -1.000000"
string(10) "-1.000000 "
string(10) " -1.000000"
-1.000000"
string(9) "-1.000000"
string(30) " -1.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 4 --
string(18) "-2147483648.000000"
-string(1) "f"
string(18) "-2147483648.000000"
-string(1) "f"
string(19) " -2147483648.000000"
string(19) "-2147483648.000000 "
string(19) " -2147483648.000000"
-2147483648.000000"
string(18) "-2147483648.000000"
string(30) " -2147483648.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 5 --
string(18) "-2147483647.000000"
-string(1) "f"
string(18) "-2147483647.000000"
-string(1) "f"
string(19) " -2147483647.000000"
string(19) "-2147483647.000000 "
string(19) " -2147483647.000000"
-2147483647.000000"
string(18) "-2147483647.000000"
string(30) " -2147483647.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 6 --
string(17) "2147483647.000000"
-string(1) "f"
string(17) "2147483647.000000"
-string(1) "f"
string(18) " 2147483647.000000"
string(18) "2147483647.000000 "
string(18) " 2147483647.000000"
2147483647.000000"
string(17) "2147483647.000000"
string(30) " 2147483647.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 7 --
string(17) "2147483640.000000"
-string(1) "f"
string(17) "2147483640.000000"
-string(1) "f"
string(18) " 2147483640.000000"
string(18) "2147483640.000000 "
string(18) " 2147483640.000000"
2147483640.000000"
string(17) "2147483640.000000"
string(30) " 2147483640.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 8 --
string(11) "4667.000000"
-string(1) "f"
string(11) "4667.000000"
-string(1) "f"
string(12) " 4667.000000"
string(12) "4667.000000 "
string(12) " 4667.000000"
4667.000000"
string(11) "4667.000000"
string(30) " 4667.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 9 --
string(11) "4779.000000"
-string(1) "f"
string(11) "4779.000000"
-string(1) "f"
string(12) " 4779.000000"
string(12) "4779.000000 "
string(12) " 4779.000000"
4779.000000"
string(11) "4779.000000"
string(30) " 4779.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 10 --
string(11) "4095.000000"
-string(1) "f"
string(11) "4095.000000"
-string(1) "f"
string(12) " 4095.000000"
string(12) "4095.000000 "
string(12) " 4095.000000"
4095.000000"
string(11) "4095.000000"
string(30) " 4095.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 11 --
string(10) "250.000000"
-string(1) "f"
string(10) "250.000000"
-string(1) "f"
string(11) " 250.000000"
string(11) "250.000000 "
string(11) " 250.000000"
250.000000"
string(10) "250.000000"
string(30) " 250.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 12 --
string(18) "-2147483648.000000"
-string(1) "f"
string(18) "-2147483648.000000"
-string(1) "f"
string(19) " -2147483648.000000"
string(19) "-2147483648.000000 "
string(19) " -2147483648.000000"
-2147483648.000000"
string(18) "-2147483648.000000"
string(30) " -2147483648.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 13 --
string(17) "2147483647.000000"
-string(1) "f"
string(17) "2147483647.000000"
-string(1) "f"
string(18) " 2147483647.000000"
string(18) "2147483647.000000 "
string(18) " 2147483647.000000"
2147483647.000000"
string(17) "2147483647.000000"
string(30) " 2147483647.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 14 --
string(17) "2147483647.000000"
-string(1) "f"
string(17) "2147483647.000000"
-string(1) "f"
string(18) " 2147483647.000000"
string(18) "2147483647.000000 "
string(18) " 2147483647.000000"
2147483647.000000"
string(17) "2147483647.000000"
string(30) " 2147483647.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 15 --
string(9) "83.000000"
-string(1) "f"
string(9) "83.000000"
-string(1) "f"
string(10) " 83.000000"
string(10) "83.000000 "
string(10) " 83.000000"
83.000000"
string(9) "83.000000"
string(30) " 83.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 16 --
string(8) "1.000000"
-string(1) "f"
string(8) "1.000000"
-string(1) "f"
string(9) " 1.000000"
string(9) "1.000000 "
string(9) " 1.000000"
1.000000"
string(8) "1.000000"
string(30) " 1.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 17 --
string(18) "-2147483648.000000"
-string(1) "f"
string(18) "-2147483648.000000"
-string(1) "f"
string(19) " -2147483648.000000"
string(19) "-2147483648.000000 "
string(19) " -2147483648.000000"
-2147483648.000000"
string(18) "-2147483648.000000"
string(30) " -2147483648.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 18 --
string(17) "2147483647.000000"
-string(1) "f"
string(17) "2147483647.000000"
-string(1) "f"
string(18) " 2147483647.000000"
string(18) "2147483647.000000 "
string(18) " 2147483647.000000"
2147483647.000000"
string(17) "2147483647.000000"
string(30) " 2147483647.000000"
-string(4) "0-9]"
-string(1) "f"
Done
// array of octal formats
$octal_formats = array(
- "%o", "%ho", "%lo",
- "%Lo", " %o", "%o ",
- "\t%o", "\n%o", "%4o",
- "%30o", "%[0-7]", "%*o"
+ "%o", "%lo", " %o", "%o ",
+ "\t%o", "\n%o", "%4o", "%30o",
);
$count = 1;
-- Iteration 1 --
string(1) "0"
-string(1) "o"
string(1) "0"
-string(1) "o"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 2 --
string(1) "1"
-string(1) "o"
string(1) "1"
-string(1) "o"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 3 --
string(11) "37777777777"
-string(1) "o"
string(11) "37777777777"
-string(1) "o"
string(12) " 37777777777"
string(12) "37777777777 "
string(12) " 37777777777"
37777777777"
string(11) "37777777777"
string(30) " 37777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 4 --
string(11) "20000000000"
-string(1) "o"
string(11) "20000000000"
-string(1) "o"
string(12) " 20000000000"
string(12) "20000000000 "
string(12) " 20000000000"
20000000000"
string(11) "20000000000"
string(30) " 20000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 5 --
string(11) "20000000001"
-string(1) "o"
string(11) "20000000001"
-string(1) "o"
string(12) " 20000000001"
string(12) "20000000001 "
string(12) " 20000000001"
20000000001"
string(11) "20000000001"
string(30) " 20000000001"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 6 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 7 --
string(11) "17777777770"
-string(1) "o"
string(11) "17777777770"
-string(1) "o"
string(12) " 17777777770"
string(12) "17777777770 "
string(12) " 17777777770"
17777777770"
string(11) "17777777770"
string(30) " 17777777770"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 8 --
string(5) "11073"
-string(1) "o"
string(5) "11073"
-string(1) "o"
string(6) " 11073"
string(6) "11073 "
string(6) " 11073"
11073"
string(5) "11073"
string(30) " 11073"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 9 --
string(5) "11253"
-string(1) "o"
string(5) "11253"
-string(1) "o"
string(6) " 11253"
string(6) "11253 "
string(6) " 11253"
11253"
string(5) "11253"
string(30) " 11253"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 10 --
string(4) "7777"
-string(1) "o"
string(4) "7777"
-string(1) "o"
string(5) " 7777"
string(5) "7777 "
string(5) " 7777"
7777"
string(4) "7777"
string(30) " 7777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 11 --
string(3) "372"
-string(1) "o"
string(3) "372"
-string(1) "o"
string(4) " 372"
string(4) "372 "
string(4) " 372"
372"
string(4) " 372"
string(30) " 372"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 12 --
string(11) "20000000000"
-string(1) "o"
string(11) "20000000000"
-string(1) "o"
string(12) " 20000000000"
string(12) "20000000000 "
string(12) " 20000000000"
20000000000"
string(11) "20000000000"
string(30) " 20000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 13 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 14 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 15 --
string(3) "123"
-string(1) "o"
string(3) "123"
-string(1) "o"
string(4) " 123"
string(4) "123 "
string(4) " 123"
123"
string(4) " 123"
string(30) " 123"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 16 --
string(1) "1"
-string(1) "o"
string(1) "1"
-string(1) "o"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 17 --
string(11) "20000000000"
-string(1) "o"
string(11) "20000000000"
-string(1) "o"
string(12) " 20000000000"
string(12) "20000000000 "
string(12) " 20000000000"
20000000000"
string(11) "20000000000"
string(30) " 20000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 18 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
Done
// array of octal formats
$octal_formats = array(
- "%o", "%ho", "%lo",
- "%Lo", " %o", "%o ",
- "\t%o", "\n%o", "%4o",
- "%30o", "%[0-7]", "%*o"
+ "%o", "%lo", " %o", "%o ",
+ "\t%o", "\n%o", "%4o", "%30o",
);
$count = 1;
-- Iteration 1 --
string(1) "0"
-string(1) "o"
string(1) "0"
-string(1) "o"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 2 --
string(1) "1"
-string(1) "o"
string(1) "1"
-string(1) "o"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 3 --
string(22) "1777777777777777777777"
-string(1) "o"
string(22) "1777777777777777777777"
-string(1) "o"
string(23) " 1777777777777777777777"
string(23) "1777777777777777777777 "
string(23) " 1777777777777777777777"
1777777777777777777777"
string(22) "1777777777777777777777"
string(30) " 1777777777777777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 4 --
string(22) "1777777777760000000000"
-string(1) "o"
string(22) "1777777777760000000000"
-string(1) "o"
string(23) " 1777777777760000000000"
string(23) "1777777777760000000000 "
string(23) " 1777777777760000000000"
1777777777760000000000"
string(22) "1777777777760000000000"
string(30) " 1777777777760000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 5 --
string(22) "1777777777760000000001"
-string(1) "o"
string(22) "1777777777760000000001"
-string(1) "o"
string(23) " 1777777777760000000001"
string(23) "1777777777760000000001 "
string(23) " 1777777777760000000001"
1777777777760000000001"
string(22) "1777777777760000000001"
string(30) " 1777777777760000000001"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 6 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 7 --
string(11) "17777777770"
-string(1) "o"
string(11) "17777777770"
-string(1) "o"
string(12) " 17777777770"
string(12) "17777777770 "
string(12) " 17777777770"
17777777770"
string(11) "17777777770"
string(30) " 17777777770"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 8 --
string(5) "11073"
-string(1) "o"
string(5) "11073"
-string(1) "o"
string(6) " 11073"
string(6) "11073 "
string(6) " 11073"
11073"
string(5) "11073"
string(30) " 11073"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 9 --
string(5) "11253"
-string(1) "o"
string(5) "11253"
-string(1) "o"
string(6) " 11253"
string(6) "11253 "
string(6) " 11253"
11253"
string(5) "11253"
string(30) " 11253"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 10 --
string(4) "7777"
-string(1) "o"
string(4) "7777"
-string(1) "o"
string(5) " 7777"
string(5) "7777 "
string(5) " 7777"
7777"
string(4) "7777"
string(30) " 7777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 11 --
string(3) "372"
-string(1) "o"
string(3) "372"
-string(1) "o"
string(4) " 372"
string(4) "372 "
string(4) " 372"
372"
string(4) " 372"
string(30) " 372"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 12 --
string(22) "1777777777760000000000"
-string(1) "o"
string(22) "1777777777760000000000"
-string(1) "o"
string(23) " 1777777777760000000000"
string(23) "1777777777760000000000 "
string(23) " 1777777777760000000000"
1777777777760000000000"
string(22) "1777777777760000000000"
string(30) " 1777777777760000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 13 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 14 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 15 --
string(3) "123"
-string(1) "o"
string(3) "123"
-string(1) "o"
string(4) " 123"
string(4) "123 "
string(4) " 123"
123"
string(4) " 123"
string(30) " 123"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 16 --
string(1) "1"
-string(1) "o"
string(1) "1"
-string(1) "o"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 17 --
string(22) "1777777777760000000000"
-string(1) "o"
string(22) "1777777777760000000000"
-string(1) "o"
string(23) " 1777777777760000000000"
string(23) "1777777777760000000000 "
string(23) " 1777777777760000000000"
1777777777760000000000"
string(22) "1777777777760000000000"
string(30) " 1777777777760000000000"
-string(4) "0-7]"
-string(1) "o"
-- Iteration 18 --
string(11) "17777777777"
-string(1) "o"
string(11) "17777777777"
-string(1) "o"
string(12) " 17777777777"
string(12) "17777777777 "
string(12) " 17777777777"
17777777777"
string(11) "17777777777"
string(30) " 17777777777"
-string(4) "0-7]"
-string(1) "o"
Done
);
// various integer formats
$int_formats = array(
- "%d", "%hd", "%ld",
- "%Ld", " %d", "%d ",
- "\t%d", "\n%d", "%4d",
- "%30d", "%[0-9]", "%*d"
+ "%d", "%ld", " %d", "%d ",
+ "\t%d", "\n%d", "%4d", "%30d",
);
$count = 1;
-- Iteration 1 --
string(1) "0"
-string(1) "d"
string(1) "0"
-string(1) "d"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 2 --
string(1) "1"
-string(1) "d"
string(1) "1"
-string(1) "d"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 3 --
string(2) "-1"
-string(1) "d"
string(2) "-1"
-string(1) "d"
string(3) " -1"
string(3) "-1 "
string(3) " -1"
-1"
string(4) " -1"
string(30) " -1"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 4 --
string(11) "-2147483648"
-string(1) "d"
string(11) "-2147483648"
-string(1) "d"
string(12) " -2147483648"
string(12) "-2147483648 "
string(12) " -2147483648"
-2147483648"
string(11) "-2147483648"
string(30) " -2147483648"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 5 --
string(11) "-2147483647"
-string(1) "d"
string(11) "-2147483647"
-string(1) "d"
string(12) " -2147483647"
string(12) "-2147483647 "
string(12) " -2147483647"
-2147483647"
string(11) "-2147483647"
string(30) " -2147483647"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 6 --
string(10) "2147483647"
-string(1) "d"
string(10) "2147483647"
-string(1) "d"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 7 --
string(10) "2147483640"
-string(1) "d"
string(10) "2147483640"
-string(1) "d"
string(11) " 2147483640"
string(11) "2147483640 "
string(11) " 2147483640"
2147483640"
string(10) "2147483640"
string(30) " 2147483640"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 8 --
string(4) "4667"
-string(1) "d"
string(4) "4667"
-string(1) "d"
string(5) " 4667"
string(5) "4667 "
string(5) " 4667"
4667"
string(4) "4667"
string(30) " 4667"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 9 --
string(4) "4779"
-string(1) "d"
string(4) "4779"
-string(1) "d"
string(5) " 4779"
string(5) "4779 "
string(5) " 4779"
4779"
string(4) "4779"
string(30) " 4779"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 10 --
string(4) "4095"
-string(1) "d"
string(4) "4095"
-string(1) "d"
string(5) " 4095"
string(5) "4095 "
string(5) " 4095"
4095"
string(4) "4095"
string(30) " 4095"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 11 --
string(3) "250"
-string(1) "d"
string(3) "250"
-string(1) "d"
string(4) " 250"
string(4) "250 "
string(4) " 250"
250"
string(4) " 250"
string(30) " 250"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 12 --
string(11) "-2147483648"
-string(1) "d"
string(11) "-2147483648"
-string(1) "d"
string(12) " -2147483648"
string(12) "-2147483648 "
string(12) " -2147483648"
-2147483648"
string(11) "-2147483648"
string(30) " -2147483648"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 13 --
string(10) "2147483647"
-string(1) "d"
string(10) "2147483647"
-string(1) "d"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 14 --
string(10) "2147483647"
-string(1) "d"
string(10) "2147483647"
-string(1) "d"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 15 --
string(2) "83"
-string(1) "d"
string(2) "83"
-string(1) "d"
string(3) " 83"
string(3) "83 "
string(3) " 83"
83"
string(4) " 83"
string(30) " 83"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 16 --
string(1) "1"
-string(1) "d"
string(1) "1"
-string(1) "d"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 17 --
string(11) "-2147483648"
-string(1) "d"
string(11) "-2147483648"
-string(1) "d"
string(12) " -2147483648"
string(12) "-2147483648 "
string(12) " -2147483648"
-2147483648"
string(11) "-2147483648"
string(30) " -2147483648"
-string(4) "0-9]"
-string(1) "d"
-- Iteration 18 --
string(10) "2147483647"
-string(1) "d"
string(10) "2147483647"
-string(1) "d"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "d"
Done
// array of hexa formats
$hexa_formats = array(
- "%x", "%xx", "%lx",
- "%Lx", " %x", "%x ",
- "\t%x", "\n%x", "%4x",
- "%30x", "%[0-9A-Fa-f]", "%*x"
+ "%x", "%xx", "%lx", " %x", "%x ",
+ "\t%x", "\n%x", "%4x", "%30x",
);
$count = 1;
string(1) "0"
string(2) "0x"
string(1) "0"
-string(1) "x"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 2 --
string(1) "1"
string(2) "1x"
string(1) "1"
-string(1) "x"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 3 --
string(8) "ffffffff"
string(9) "ffffffffx"
string(8) "ffffffff"
-string(1) "x"
string(9) " ffffffff"
string(9) "ffffffff "
string(9) " ffffffff"
ffffffff"
string(8) "ffffffff"
string(30) " ffffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 4 --
string(8) "80000000"
string(9) "80000000x"
string(8) "80000000"
-string(1) "x"
string(9) " 80000000"
string(9) "80000000 "
string(9) " 80000000"
80000000"
string(8) "80000000"
string(30) " 80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 5 --
string(8) "80000001"
string(9) "80000001x"
string(8) "80000001"
-string(1) "x"
string(9) " 80000001"
string(9) "80000001 "
string(9) " 80000001"
80000001"
string(8) "80000001"
string(30) " 80000001"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 6 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 7 --
string(8) "7ffffff8"
string(9) "7ffffff8x"
string(8) "7ffffff8"
-string(1) "x"
string(9) " 7ffffff8"
string(9) "7ffffff8 "
string(9) " 7ffffff8"
7ffffff8"
string(8) "7ffffff8"
string(30) " 7ffffff8"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 8 --
string(4) "123b"
string(5) "123bx"
string(4) "123b"
-string(1) "x"
string(5) " 123b"
string(5) "123b "
string(5) " 123b"
123b"
string(4) "123b"
string(30) " 123b"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 9 --
string(4) "12ab"
string(5) "12abx"
string(4) "12ab"
-string(1) "x"
string(5) " 12ab"
string(5) "12ab "
string(5) " 12ab"
12ab"
string(4) "12ab"
string(30) " 12ab"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 10 --
string(3) "fff"
string(4) "fffx"
string(3) "fff"
-string(1) "x"
string(4) " fff"
string(4) "fff "
string(4) " fff"
fff"
string(4) " fff"
string(30) " fff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 11 --
string(2) "fa"
string(3) "fax"
string(2) "fa"
-string(1) "x"
string(3) " fa"
string(3) "fa "
string(3) " fa"
fa"
string(4) " fa"
string(30) " fa"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 12 --
string(8) "80000000"
string(9) "80000000x"
string(8) "80000000"
-string(1) "x"
string(9) " 80000000"
string(9) "80000000 "
string(9) " 80000000"
80000000"
string(8) "80000000"
string(30) " 80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 13 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 14 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 15 --
string(2) "53"
string(3) "53x"
string(2) "53"
-string(1) "x"
string(3) " 53"
string(3) "53 "
string(3) " 53"
53"
string(4) " 53"
string(30) " 53"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 16 --
string(1) "1"
string(2) "1x"
string(1) "1"
-string(1) "x"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 17 --
string(8) "80000000"
string(9) "80000000x"
string(8) "80000000"
-string(1) "x"
string(9) " 80000000"
string(9) "80000000 "
string(9) " 80000000"
80000000"
string(8) "80000000"
string(30) " 80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 18 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
Done
// array of hexa formats
$hexa_formats = array(
- "%x", "%xx", "%lx",
- "%Lx", " %x", "%x ",
- "\t%x", "\n%x", "%4x",
- "%30x", "%[0-9A-Fa-f]", "%*x"
+ "%x", "%xx", "%lx", " %x", "%x ",
+ "\t%x", "\n%x", "%4x", "%30x",
);
$count = 1;
string(1) "0"
string(2) "0x"
string(1) "0"
-string(1) "x"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 2 --
string(1) "1"
string(2) "1x"
string(1) "1"
-string(1) "x"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 3 --
string(16) "ffffffffffffffff"
string(17) "ffffffffffffffffx"
string(16) "ffffffffffffffff"
-string(1) "x"
string(17) " ffffffffffffffff"
string(17) "ffffffffffffffff "
string(17) " ffffffffffffffff"
ffffffffffffffff"
string(16) "ffffffffffffffff"
string(30) " ffffffffffffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 4 --
string(16) "ffffffff80000000"
string(17) "ffffffff80000000x"
string(16) "ffffffff80000000"
-string(1) "x"
string(17) " ffffffff80000000"
string(17) "ffffffff80000000 "
string(17) " ffffffff80000000"
ffffffff80000000"
string(16) "ffffffff80000000"
string(30) " ffffffff80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 5 --
string(16) "ffffffff80000001"
string(17) "ffffffff80000001x"
string(16) "ffffffff80000001"
-string(1) "x"
string(17) " ffffffff80000001"
string(17) "ffffffff80000001 "
string(17) " ffffffff80000001"
ffffffff80000001"
string(16) "ffffffff80000001"
string(30) " ffffffff80000001"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 6 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 7 --
string(8) "7ffffff8"
string(9) "7ffffff8x"
string(8) "7ffffff8"
-string(1) "x"
string(9) " 7ffffff8"
string(9) "7ffffff8 "
string(9) " 7ffffff8"
7ffffff8"
string(8) "7ffffff8"
string(30) " 7ffffff8"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 8 --
string(4) "123b"
string(5) "123bx"
string(4) "123b"
-string(1) "x"
string(5) " 123b"
string(5) "123b "
string(5) " 123b"
123b"
string(4) "123b"
string(30) " 123b"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 9 --
string(4) "12ab"
string(5) "12abx"
string(4) "12ab"
-string(1) "x"
string(5) " 12ab"
string(5) "12ab "
string(5) " 12ab"
12ab"
string(4) "12ab"
string(30) " 12ab"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 10 --
string(3) "fff"
string(4) "fffx"
string(3) "fff"
-string(1) "x"
string(4) " fff"
string(4) "fff "
string(4) " fff"
fff"
string(4) " fff"
string(30) " fff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 11 --
string(2) "fa"
string(3) "fax"
string(2) "fa"
-string(1) "x"
string(3) " fa"
string(3) "fa "
string(3) " fa"
fa"
string(4) " fa"
string(30) " fa"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 12 --
string(16) "ffffffff80000000"
string(17) "ffffffff80000000x"
string(16) "ffffffff80000000"
-string(1) "x"
string(17) " ffffffff80000000"
string(17) "ffffffff80000000 "
string(17) " ffffffff80000000"
ffffffff80000000"
string(16) "ffffffff80000000"
string(30) " ffffffff80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 13 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 14 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 15 --
string(2) "53"
string(3) "53x"
string(2) "53"
-string(1) "x"
string(3) " 53"
string(3) "53 "
string(3) " 53"
53"
string(4) " 53"
string(30) " 53"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 16 --
string(1) "1"
string(2) "1x"
string(1) "1"
-string(1) "x"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 17 --
string(16) "ffffffff80000000"
string(17) "ffffffff80000000x"
string(16) "ffffffff80000000"
-string(1) "x"
string(17) " ffffffff80000000"
string(17) "ffffffff80000000 "
string(17) " ffffffff80000000"
ffffffff80000000"
string(16) "ffffffff80000000"
string(30) " ffffffff80000000"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
-- Iteration 18 --
string(8) "7fffffff"
string(9) "7fffffffx"
string(8) "7fffffff"
-string(1) "x"
string(9) " 7fffffff"
string(9) "7fffffff "
string(9) " 7fffffff"
7fffffff"
string(8) "7fffffff"
string(30) " 7fffffff"
-string(10) "0-9A-Fa-f]"
-string(1) "x"
Done
// array of unsigned formats
$unsigned_formats = array(
- "%u", "%hu", "%lu",
- "%Lu", " %u", "%u ",
- "\t%u", "\n%u", "%4u",
- "%30u", "%[0-9]", "%*u"
+ "%u", "%lu", " %u", "%u ",
+ "\t%u", "\n%u", "%4u", "%30u",
);
-- Iteration 1 --
string(1) "0"
-string(1) "u"
string(1) "0"
-string(1) "u"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 2 --
string(1) "1"
-string(1) "u"
string(1) "1"
-string(1) "u"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 3 --
string(10) "4294967295"
-string(1) "u"
string(10) "4294967295"
-string(1) "u"
string(11) " 4294967295"
string(11) "4294967295 "
string(11) " 4294967295"
4294967295"
string(10) "4294967295"
string(30) " 4294967295"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 4 --
string(10) "2147483648"
-string(1) "u"
string(10) "2147483648"
-string(1) "u"
string(11) " 2147483648"
string(11) "2147483648 "
string(11) " 2147483648"
2147483648"
string(10) "2147483648"
string(30) " 2147483648"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 5 --
string(10) "2147483649"
-string(1) "u"
string(10) "2147483649"
-string(1) "u"
string(11) " 2147483649"
string(11) "2147483649 "
string(11) " 2147483649"
2147483649"
string(10) "2147483649"
string(30) " 2147483649"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 6 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 7 --
string(10) "2147483640"
-string(1) "u"
string(10) "2147483640"
-string(1) "u"
string(11) " 2147483640"
string(11) "2147483640 "
string(11) " 2147483640"
2147483640"
string(10) "2147483640"
string(30) " 2147483640"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 8 --
string(4) "4667"
-string(1) "u"
string(4) "4667"
-string(1) "u"
string(5) " 4667"
string(5) "4667 "
string(5) " 4667"
4667"
string(4) "4667"
string(30) " 4667"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 9 --
string(4) "4779"
-string(1) "u"
string(4) "4779"
-string(1) "u"
string(5) " 4779"
string(5) "4779 "
string(5) " 4779"
4779"
string(4) "4779"
string(30) " 4779"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 10 --
string(4) "4095"
-string(1) "u"
string(4) "4095"
-string(1) "u"
string(5) " 4095"
string(5) "4095 "
string(5) " 4095"
4095"
string(4) "4095"
string(30) " 4095"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 11 --
string(3) "250"
-string(1) "u"
string(3) "250"
-string(1) "u"
string(4) " 250"
string(4) "250 "
string(4) " 250"
250"
string(4) " 250"
string(30) " 250"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 12 --
string(10) "2147483648"
-string(1) "u"
string(10) "2147483648"
-string(1) "u"
string(11) " 2147483648"
string(11) "2147483648 "
string(11) " 2147483648"
2147483648"
string(10) "2147483648"
string(30) " 2147483648"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 13 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 14 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 15 --
string(2) "83"
-string(1) "u"
string(2) "83"
-string(1) "u"
string(3) " 83"
string(3) "83 "
string(3) " 83"
83"
string(4) " 83"
string(30) " 83"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 16 --
string(1) "1"
-string(1) "u"
string(1) "1"
-string(1) "u"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 17 --
string(10) "2147483648"
-string(1) "u"
string(10) "2147483648"
-string(1) "u"
string(11) " 2147483648"
string(11) "2147483648 "
string(11) " 2147483648"
2147483648"
string(10) "2147483648"
string(30) " 2147483648"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 18 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
Done
// array of unsigned formats
$unsigned_formats = array(
- "%u", "%hu", "%lu",
- "%Lu", " %u", "%u ",
- "\t%u", "\n%u", "%4u",
- "%30u", "%[0-9]", "%*u"
+ "%u", "%lu", " %u", "%u ",
+ "\t%u", "\n%u", "%4u", "%30u",
);
-- Iteration 1 --
string(1) "0"
-string(1) "u"
string(1) "0"
-string(1) "u"
string(2) " 0"
string(2) "0 "
string(2) " 0"
0"
string(4) " 0"
string(30) " 0"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 2 --
string(1) "1"
-string(1) "u"
string(1) "1"
-string(1) "u"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 3 --
string(20) "18446744073709551615"
-string(1) "u"
string(20) "18446744073709551615"
-string(1) "u"
string(21) " 18446744073709551615"
string(21) "18446744073709551615 "
string(21) " 18446744073709551615"
18446744073709551615"
string(20) "18446744073709551615"
string(30) " 18446744073709551615"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 4 --
string(20) "18446744071562067968"
-string(1) "u"
string(20) "18446744071562067968"
-string(1) "u"
string(21) " 18446744071562067968"
string(21) "18446744071562067968 "
string(21) " 18446744071562067968"
18446744071562067968"
string(20) "18446744071562067968"
string(30) " 18446744071562067968"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 5 --
string(20) "18446744071562067969"
-string(1) "u"
string(20) "18446744071562067969"
-string(1) "u"
string(21) " 18446744071562067969"
string(21) "18446744071562067969 "
string(21) " 18446744071562067969"
18446744071562067969"
string(20) "18446744071562067969"
string(30) " 18446744071562067969"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 6 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 7 --
string(10) "2147483640"
-string(1) "u"
string(10) "2147483640"
-string(1) "u"
string(11) " 2147483640"
string(11) "2147483640 "
string(11) " 2147483640"
2147483640"
string(10) "2147483640"
string(30) " 2147483640"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 8 --
string(4) "4667"
-string(1) "u"
string(4) "4667"
-string(1) "u"
string(5) " 4667"
string(5) "4667 "
string(5) " 4667"
4667"
string(4) "4667"
string(30) " 4667"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 9 --
string(4) "4779"
-string(1) "u"
string(4) "4779"
-string(1) "u"
string(5) " 4779"
string(5) "4779 "
string(5) " 4779"
4779"
string(4) "4779"
string(30) " 4779"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 10 --
string(4) "4095"
-string(1) "u"
string(4) "4095"
-string(1) "u"
string(5) " 4095"
string(5) "4095 "
string(5) " 4095"
4095"
string(4) "4095"
string(30) " 4095"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 11 --
string(3) "250"
-string(1) "u"
string(3) "250"
-string(1) "u"
string(4) " 250"
string(4) "250 "
string(4) " 250"
250"
string(4) " 250"
string(30) " 250"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 12 --
string(20) "18446744071562067968"
-string(1) "u"
string(20) "18446744071562067968"
-string(1) "u"
string(21) " 18446744071562067968"
string(21) "18446744071562067968 "
string(21) " 18446744071562067968"
18446744071562067968"
string(20) "18446744071562067968"
string(30) " 18446744071562067968"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 13 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 14 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 15 --
string(2) "83"
-string(1) "u"
string(2) "83"
-string(1) "u"
string(3) " 83"
string(3) "83 "
string(3) " 83"
83"
string(4) " 83"
string(30) " 83"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 16 --
string(1) "1"
-string(1) "u"
string(1) "1"
-string(1) "u"
string(2) " 1"
string(2) "1 "
string(2) " 1"
1"
string(4) " 1"
string(30) " 1"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 17 --
string(20) "18446744071562067968"
-string(1) "u"
string(20) "18446744071562067968"
-string(1) "u"
string(21) " 18446744071562067968"
string(21) "18446744071562067968 "
string(21) " 18446744071562067968"
18446744071562067968"
string(20) "18446744071562067968"
string(30) " 18446744071562067968"
-string(4) "0-9]"
-string(1) "u"
-- Iteration 18 --
string(10) "2147483647"
-string(1) "u"
string(10) "2147483647"
-string(1) "u"
string(11) " 2147483647"
string(11) "2147483647 "
string(11) " 2147483647"
2147483647"
string(10) "2147483647"
string(30) " 2147483647"
-string(4) "0-9]"
-string(1) "u"
Done
// array of scientific formats
$scientific_formats = array(
- "%e", "%he", "%le",
- "%Le", " %e", "%e ",
- "\t%e", "\n%e", "%4e",
- "%30e", "%[0-1]", "%*e"
+ "%e", "%le", " %e", "%e ",
+ "\t%e", "\n%e", "%4e", "%30e",
);
$count = 1;
-- Iteration 1 --
string(11) "0.000000e+0"
-string(1) "e"
string(11) "0.000000e+0"
-string(1) "e"
string(12) " 0.000000e+0"
string(12) "0.000000e+0 "
string(12) " 0.000000e+0"
0.000000e+0"
string(11) "0.000000e+0"
string(30) " 0.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 2 --
string(11) "1.000000e+0"
-string(1) "e"
string(11) "1.000000e+0"
-string(1) "e"
string(12) " 1.000000e+0"
string(12) "1.000000e+0 "
string(12) " 1.000000e+0"
1.000000e+0"
string(11) "1.000000e+0"
string(30) " 1.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 3 --
string(12) "-1.000000e+0"
-string(1) "e"
string(12) "-1.000000e+0"
-string(1) "e"
string(13) " -1.000000e+0"
string(13) "-1.000000e+0 "
string(13) " -1.000000e+0"
-1.000000e+0"
string(12) "-1.000000e+0"
string(30) " -1.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 4 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 5 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 6 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 7 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 8 --
string(11) "4.667000e+3"
-string(1) "e"
string(11) "4.667000e+3"
-string(1) "e"
string(12) " 4.667000e+3"
string(12) "4.667000e+3 "
string(12) " 4.667000e+3"
4.667000e+3"
string(11) "4.667000e+3"
string(30) " 4.667000e+3"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 9 --
string(11) "4.779000e+3"
-string(1) "e"
string(11) "4.779000e+3"
-string(1) "e"
string(12) " 4.779000e+3"
string(12) "4.779000e+3 "
string(12) " 4.779000e+3"
4.779000e+3"
string(11) "4.779000e+3"
string(30) " 4.779000e+3"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 10 --
string(11) "4.095000e+3"
-string(1) "e"
string(11) "4.095000e+3"
-string(1) "e"
string(12) " 4.095000e+3"
string(12) "4.095000e+3 "
string(12) " 4.095000e+3"
4.095000e+3"
string(11) "4.095000e+3"
string(30) " 4.095000e+3"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 11 --
string(11) "2.500000e+2"
-string(1) "e"
string(11) "2.500000e+2"
-string(1) "e"
string(12) " 2.500000e+2"
string(12) "2.500000e+2 "
string(12) " 2.500000e+2"
2.500000e+2"
string(11) "2.500000e+2"
string(30) " 2.500000e+2"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 12 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 13 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 14 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 15 --
string(11) "8.300000e+1"
-string(1) "e"
string(11) "8.300000e+1"
-string(1) "e"
string(12) " 8.300000e+1"
string(12) "8.300000e+1 "
string(12) " 8.300000e+1"
8.300000e+1"
string(11) "8.300000e+1"
string(30) " 8.300000e+1"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 16 --
string(11) "1.000000e+0"
-string(1) "e"
string(11) "1.000000e+0"
-string(1) "e"
string(12) " 1.000000e+0"
string(12) "1.000000e+0 "
string(12) " 1.000000e+0"
1.000000e+0"
string(11) "1.000000e+0"
string(30) " 1.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 17 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 18 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
Done
// array of scientific formats
$scientific_formats = array(
- "%e", "%he", "%le",
- "%Le", " %e", "%e ",
- "\t%e", "\n%e", "%4e",
- "%30e", "%[0-1]", "%*e"
+ "%e", "%le", " %e", "%e ",
+ "\t%e", "\n%e", "%4e", "%30e",
);
-- Iteration 1 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 2 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 3 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 4 --
string(12) "3.435974e+10"
-string(1) "e"
string(12) "3.435974e+10"
-string(1) "e"
string(13) " 3.435974e+10"
string(13) "3.435974e+10 "
string(13) " 3.435974e+10"
3.435974e+10"
string(12) "3.435974e+10"
string(30) " 3.435974e+10"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 5 --
string(11) "2.147484e+9"
-string(1) "e"
string(11) "2.147484e+9"
-string(1) "e"
string(12) " 2.147484e+9"
string(12) "2.147484e+9 "
string(12) " 2.147484e+9"
2.147484e+9"
string(11) "2.147484e+9"
string(30) " 2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 6 --
string(12) "-2.147484e+9"
-string(1) "e"
string(12) "-2.147484e+9"
-string(1) "e"
string(13) " -2.147484e+9"
string(13) "-2.147484e+9 "
string(13) " -2.147484e+9"
-2.147484e+9"
string(12) "-2.147484e+9"
string(30) " -2.147484e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 7 --
string(11) "0.000000e+0"
-string(1) "e"
string(11) "0.000000e+0"
-string(1) "e"
string(12) " 0.000000e+0"
string(12) "0.000000e+0 "
string(12) " 0.000000e+0"
0.000000e+0"
string(11) "0.000000e+0"
string(30) " 0.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 8 --
string(12) "-1.000000e-1"
-string(1) "e"
string(12) "-1.000000e-1"
-string(1) "e"
string(13) " -1.000000e-1"
string(13) "-1.000000e-1 "
string(13) " -1.000000e-1"
-1.000000e-1"
string(12) "-1.000000e-1"
string(30) " -1.000000e-1"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 9 --
string(11) "1.000000e+0"
-string(1) "e"
string(11) "1.000000e+0"
-string(1) "e"
string(12) " 1.000000e+0"
string(12) "1.000000e+0 "
string(12) " 1.000000e+0"
1.000000e+0"
string(11) "1.000000e+0"
string(30) " 1.000000e+0"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 10 --
string(11) "1.000000e+5"
-string(1) "e"
string(11) "1.000000e+5"
-string(1) "e"
string(12) " 1.000000e+5"
string(12) "1.000000e+5 "
string(12) " 1.000000e+5"
1.000000e+5"
string(11) "1.000000e+5"
string(30) " 1.000000e+5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 11 --
string(12) "-1.000000e+5"
-string(1) "e"
string(12) "-1.000000e+5"
-string(1) "e"
string(13) " -1.000000e+5"
string(13) "-1.000000e+5 "
string(13) " -1.000000e+5"
-1.000000e+5"
string(12) "-1.000000e+5"
string(30) " -1.000000e+5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 12 --
string(12) "-1.000000e+5"
-string(1) "e"
string(12) "-1.000000e+5"
-string(1) "e"
string(13) " -1.000000e+5"
string(13) "-1.000000e+5 "
string(13) " -1.000000e+5"
-1.000000e+5"
string(12) "-1.000000e+5"
string(30) " -1.000000e+5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 13 --
string(11) "1.000000e+5"
-string(1) "e"
string(11) "1.000000e+5"
-string(1) "e"
string(12) " 1.000000e+5"
string(12) "1.000000e+5 "
string(12) " 1.000000e+5"
1.000000e+5"
string(11) "1.000000e+5"
string(30) " 1.000000e+5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 14 --
string(11) "1.000000e+5"
-string(1) "e"
string(11) "1.000000e+5"
-string(1) "e"
string(12) " 1.000000e+5"
string(12) "1.000000e+5 "
string(12) " 1.000000e+5"
1.000000e+5"
string(11) "1.000000e+5"
string(30) " 1.000000e+5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 15 --
string(12) "-1.000000e-5"
-string(1) "e"
string(12) "-1.000000e-5"
-string(1) "e"
string(13) " -1.000000e-5"
string(13) "-1.000000e-5 "
string(13) " -1.000000e-5"
-1.000000e-5"
string(12) "-1.000000e-5"
string(30) " -1.000000e-5"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 16 --
string(11) "1.000000e+8"
-string(1) "e"
string(11) "1.000000e+8"
-string(1) "e"
string(12) " 1.000000e+8"
string(12) "1.000000e+8 "
string(12) " 1.000000e+8"
1.000000e+8"
string(11) "1.000000e+8"
string(30) " 1.000000e+8"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 17 --
string(12) "-1.000000e+9"
-string(1) "e"
string(12) "-1.000000e+9"
-string(1) "e"
string(13) " -1.000000e+9"
string(13) "-1.000000e+9 "
string(13) " -1.000000e+9"
-1.000000e+9"
string(12) "-1.000000e+9"
string(30) " -1.000000e+9"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 18 --
string(11) "1.000000e+1"
-string(1) "e"
string(11) "1.000000e+1"
-string(1) "e"
string(12) " 1.000000e+1"
string(12) "1.000000e+1 "
string(12) " 1.000000e+1"
1.000000e+1"
string(11) "1.000000e+1"
string(30) " 1.000000e+1"
-string(4) "0-1]"
-string(1) "e"
-- Iteration 19 --
string(11) "1.050000e+6"
-string(1) "e"
string(11) "1.050000e+6"
-string(1) "e"
string(12) " 1.050000e+6"
string(12) "1.050000e+6 "
string(12) " 1.050000e+6"
1.050000e+6"
string(11) "1.050000e+6"
string(30) " 1.050000e+6"
-string(4) "0-1]"
-string(1) "e"
Done
var_dump(sprintf("%.988f", 1.23456789e10));
echo"\n-- Testing for invalid width(-15) specifier --\n";
-var_dump(sprintf("%030.-15s", $tempstring));
+try {
+ var_dump(sprintf("%030.-15s", $tempstring));
+} catch (ValueError $e) {
+ echo $e->getMessage(), "\n";
+}
echo"\n-- Testing for '%X' as the format parameter --\n";
var_dump(sprintf("%X", 12));
string(65) "12345678900.00000000000000000000000000000000000000000000000000000"
-- Testing for invalid width(-15) specifier --
-string(3) "15s"
+Unknown format specifier '-'
-- Testing for '%X' as the format parameter --
string(1) "C"
// various float formats
$float_formats = array(
- "%f", "%hf", "%lf",
- "%Lf", " %f", "%f ",
- "\t%f", "\n%f", "%4f",
- "%30f", "%[0-9]", "%*f",
+ "%f", "%lf", " %f", "%f ",
+ "\t%f", "\n%f", "%4f", "%30f",
);
$count = 1;
-- Iteration 1 --
string(18) "-2147483649.000000"
-string(1) "f"
string(18) "-2147483649.000000"
-string(1) "f"
string(19) " -2147483649.000000"
string(19) "-2147483649.000000 "
string(19) " -2147483649.000000"
-2147483649.000000"
string(18) "-2147483649.000000"
string(30) " -2147483649.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 2 --
string(17) "2147483648.000000"
-string(1) "f"
string(17) "2147483648.000000"
-string(1) "f"
string(18) " 2147483648.000000"
string(18) "2147483648.000000 "
string(18) " 2147483648.000000"
2147483648.000000"
string(17) "2147483648.000000"
string(30) " 2147483648.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 3 --
string(18) "-2147483649.000000"
-string(1) "f"
string(18) "-2147483649.000000"
-string(1) "f"
string(19) " -2147483649.000000"
string(19) "-2147483649.000000 "
string(19) " -2147483649.000000"
-2147483649.000000"
string(18) "-2147483649.000000"
string(30) " -2147483649.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 4 --
string(18) "34359738369.000000"
-string(1) "f"
string(18) "34359738369.000000"
-string(1) "f"
string(19) " 34359738369.000000"
string(19) "34359738369.000000 "
string(19) " 34359738369.000000"
34359738369.000000"
string(18) "34359738369.000000"
string(30) " 34359738369.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 5 --
string(17) "2147483649.000000"
-string(1) "f"
string(17) "2147483649.000000"
-string(1) "f"
string(18) " 2147483649.000000"
string(18) "2147483649.000000 "
string(18) " 2147483649.000000"
2147483649.000000"
string(17) "2147483649.000000"
string(30) " 2147483649.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 6 --
string(18) "-2147483649.000000"
-string(1) "f"
string(18) "-2147483649.000000"
-string(1) "f"
string(19) " -2147483649.000000"
string(19) "-2147483649.000000 "
string(19) " -2147483649.000000"
-2147483649.000000"
string(18) "-2147483649.000000"
string(30) " -2147483649.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 7 --
string(8) "0.000000"
-string(1) "f"
string(8) "0.000000"
-string(1) "f"
string(9) " 0.000000"
string(9) "0.000000 "
string(9) " 0.000000"
0.000000"
string(8) "0.000000"
string(30) " 0.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 8 --
string(9) "-0.100000"
-string(1) "f"
string(9) "-0.100000"
-string(1) "f"
string(10) " -0.100000"
string(10) "-0.100000 "
string(10) " -0.100000"
-0.100000"
string(9) "-0.100000"
string(30) " -0.100000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 9 --
string(9) "10.000000"
-string(1) "f"
string(9) "10.000000"
-string(1) "f"
string(10) " 10.000000"
string(10) "10.000000 "
string(10) " 10.000000"
10.000000"
string(9) "10.000000"
string(30) " 10.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 10 --
string(14) "1050000.000000"
-string(1) "f"
string(14) "1050000.000000"
-string(1) "f"
string(15) " 1050000.000000"
string(15) "1050000.000000 "
string(15) " 1050000.000000"
1050000.000000"
string(14) "1050000.000000"
string(30) " 1050000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 11 --
string(13) "100000.000000"
-string(1) "f"
string(13) "100000.000000"
-string(1) "f"
string(14) " 100000.000000"
string(14) "100000.000000 "
string(14) " 100000.000000"
100000.000000"
string(13) "100000.000000"
string(30) " 100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 12 --
string(14) "-100000.000000"
-string(1) "f"
string(14) "-100000.000000"
-string(1) "f"
string(15) " -100000.000000"
string(15) "-100000.000000 "
string(15) " -100000.000000"
-100000.000000"
string(14) "-100000.000000"
string(30) " -100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 13 --
string(8) "0.000010"
-string(1) "f"
string(8) "0.000010"
-string(1) "f"
string(9) " 0.000010"
string(9) "0.000010 "
string(9) " 0.000010"
0.000010"
string(8) "0.000010"
string(30) " 0.000010"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 14 --
string(9) "-0.000010"
-string(1) "f"
string(9) "-0.000010"
-string(1) "f"
string(10) " -0.000010"
string(10) "-0.000010 "
string(10) " -0.000010"
-0.000010"
string(9) "-0.000010"
string(30) " -0.000010"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 15 --
string(13) "100000.000000"
-string(1) "f"
string(13) "100000.000000"
-string(1) "f"
string(14) " 100000.000000"
string(14) "100000.000000 "
string(14) " 100000.000000"
100000.000000"
string(13) "100000.000000"
string(30) " 100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 16 --
string(14) "-100000.000000"
-string(1) "f"
string(14) "-100000.000000"
-string(1) "f"
string(15) " -100000.000000"
string(15) "-100000.000000 "
string(15) " -100000.000000"
-100000.000000"
string(14) "-100000.000000"
string(30) " -100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 17 --
string(13) "100000.000000"
-string(1) "f"
string(13) "100000.000000"
-string(1) "f"
string(14) " 100000.000000"
string(14) "100000.000000 "
string(14) " 100000.000000"
100000.000000"
string(13) "100000.000000"
string(30) " 100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 18 --
string(14) "-100000.000000"
-string(1) "f"
string(14) "-100000.000000"
-string(1) "f"
string(15) " -100000.000000"
string(15) "-100000.000000 "
string(15) " -100000.000000"
-100000.000000"
string(14) "-100000.000000"
string(30) " -100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 19 --
string(13) "100000.000000"
-string(1) "f"
string(13) "100000.000000"
-string(1) "f"
string(14) " 100000.000000"
string(14) "100000.000000 "
string(14) " 100000.000000"
100000.000000"
string(13) "100000.000000"
string(30) " 100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 20 --
string(14) "-100000.000000"
-string(1) "f"
string(14) "-100000.000000"
-string(1) "f"
string(15) " -100000.000000"
string(15) "-100000.000000 "
string(15) " -100000.000000"
-100000.000000"
string(14) "-100000.000000"
string(30) " -100000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 21 --
string(8) "0.000010"
-string(1) "f"
string(8) "0.000010"
-string(1) "f"
string(9) " 0.000010"
string(9) "0.000010 "
string(9) " 0.000010"
0.000010"
string(8) "0.000010"
string(30) " 0.000010"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 22 --
string(9) "-0.000010"
-string(1) "f"
string(9) "-0.000010"
-string(1) "f"
string(10) " -0.000010"
string(10) "-0.000010 "
string(10) " -0.000010"
-0.000010"
string(9) "-0.000010"
string(30) " -0.000010"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 23 --
string(14) "5000000.000000"
-string(1) "f"
string(14) "5000000.000000"
-string(1) "f"
string(15) " 5000000.000000"
string(15) "5000000.000000 "
string(15) " 5000000.000000"
5000000.000000"
string(14) "5000000.000000"
string(30) " 5000000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 24 --
string(15) "-5000000.000000"
-string(1) "f"
string(15) "-5000000.000000"
-string(1) "f"
string(16) " -5000000.000000"
string(16) "-5000000.000000 "
string(16) " -5000000.000000"
-5000000.000000"
string(15) "-5000000.000000"
string(30) " -5000000.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 25 --
string(8) "0.000000"
-string(1) "f"
string(8) "0.000000"
-string(1) "f"
string(9) " 0.000000"
string(9) "0.000000 "
string(9) " 0.000000"
0.000000"
string(8) "0.000000"
string(30) " 0.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 26 --
string(9) "-0.000000"
-string(1) "f"
string(9) "-0.000000"
-string(1) "f"
string(10) " -0.000000"
string(10) "-0.000000 "
string(10) " -0.000000"
-0.000000"
string(9) "-0.000000"
string(30) " -0.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 27 --
string(50) "5000000000000000069686058479707049565356032.000000"
-string(1) "f"
string(50) "5000000000000000069686058479707049565356032.000000"
-string(1) "f"
string(51) " 5000000000000000069686058479707049565356032.000000"
string(51) "5000000000000000069686058479707049565356032.000000 "
string(51) " 5000000000000000069686058479707049565356032.000000"
5000000000000000069686058479707049565356032.000000"
string(50) "5000000000000000069686058479707049565356032.000000"
string(50) "5000000000000000069686058479707049565356032.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 28 --
string(51) "-5000000000000000069686058479707049565356032.000000"
-string(1) "f"
string(51) "-5000000000000000069686058479707049565356032.000000"
-string(1) "f"
string(52) " -5000000000000000069686058479707049565356032.000000"
string(52) "-5000000000000000069686058479707049565356032.000000 "
string(52) " -5000000000000000069686058479707049565356032.000000"
-5000000000000000069686058479707049565356032.000000"
string(51) "-5000000000000000069686058479707049565356032.000000"
string(51) "-5000000000000000069686058479707049565356032.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 29 --
string(8) "0.000000"
-string(1) "f"
string(8) "0.000000"
-string(1) "f"
string(9) " 0.000000"
string(9) "0.000000 "
string(9) " 0.000000"
0.000000"
string(8) "0.000000"
string(30) " 0.000000"
-string(4) "0-9]"
-string(1) "f"
-- Iteration 30 --
string(9) "-0.000000"
-string(1) "f"
string(9) "-0.000000"
-string(1) "f"
string(10) " -0.000000"
string(10) "-0.000000 "
string(10) " -0.000000"
-0.000000"
string(9) "-0.000000"
string(30) " -0.000000"
-string(4) "0-9]"
-string(1) "f"
Done
echo $exception->getMessage() . "\n";
}
-var_dump( vfprintf( $fp, "Foo %y fake", "not available" ) );
+try {
+ var_dump( vfprintf( $fp, "Foo %y fake", "not available" ) );
+} catch (ValueError $e) {
+ echo $e->getMessage(), "\n";
+}
rewind( $fp );
var_dump( stream_get_contents( $fp ) );
--EXPECT--
-- Testing vfprintf() function with wrong variable types as argument --
vfprintf(): Argument #2 ($format) must be of type string, array given
-int(9)
-string(9) "Foo fake"
+Unknown format specifier 'y'
+string(0) ""
// defining array of octal formats
$formats = array(
"%o",
- "%+o %-o %O",
- "%lo %Lo, %4o %-4o",
+ "%+o %-o",
+ "%lo %4o %-4o",
"%10.4o %-10.4o %04o %04.4o",
"%'#2o %'2o %'$2o %'_2o",
"%o %o %o %o",
- "%% %%o %10 o%",
+ "%% %%o %10",
'%3$o %4$o %1$o %2$o'
);
// Each sub array contains octal values which correspond to each format string in $format
$args_array = array(
array(00),
- array(-01, 01, +022),
- array(-020000000000, 020000000000, 017777777777, -017777777777),
+ array(-01, 01),
+ array(-020000000000, 017777777777, -017777777777),
array(0123456, 01234567, -01234567, 01234567),
array(0111, 02222, -0333333, -044444444),
array(0x123b, 0xfAb, 0123, 012),
- array(01234, 0567, -01234, 02345),
+ array(01234, 0567, -01234),
array(03, 04, 01, 02)
);
int(1)
-- Iteration 2 --
-37777777777 1
-int(14)
+37777777777 1
+int(13)
-- Iteration 3 --
-20000000000 o, 17777777777 20000000001
-int(38)
+20000000000 17777777777 20000000001
+int(35)
-- Iteration 4 --
37776543211 0000
int(17)
-- Iteration 7 --
-% %o o
-int(6)
+% %o
+int(5)
-- Iteration 8 --
1 2 3 4
// defining array of octal formats
$formats = array(
"%o",
- "%+o %-o %O",
- "%lo %Lo, %4o %-4o",
+ "%+o %-o",
+ "%lo %4o %-4o",
"%10.4o %-10.4o %04o %04.4o",
"%'#2o %'2o %'$2o %'_2o",
"%o %o %o %o",
- "%% %%o %10 o%",
+ "%% %%o %10",
'%3$o %4$o %1$o %2$o'
);
// Each sub array contains octal values which correspond to each format string in $format
$args_array = array(
array(00),
- array(-01, 01, +022),
- array(-020000000000, 020000000000, 017777777777, -017777777777),
+ array(-01, 01),
+ array(-020000000000, 017777777777, -017777777777),
array(0123456, 01234567, -01234567, 01234567),
array(0111, 02222, -0333333, -044444444),
array(0x123b, 0xfAb, 0123, 012),
- array(01234, 0567, -01234, 02345),
+ array(01234, 0567, -01234),
array(03, 04, 01, 02)
);
int(1)
-- Iteration 2 --
-1777777777777777777777 1
-int(25)
+1777777777777777777777 1
+int(24)
-- Iteration 3 --
-1777777777760000000000 o, 17777777777 1777777777760000000001
-int(60)
+1777777777760000000000 17777777777 1777777777760000000001
+int(57)
-- Iteration 4 --
1777777777777776543211 0000
int(17)
-- Iteration 7 --
-% %o o
-int(6)
+% %o
+int(5)
-- Iteration 8 --
1 2 3 4
// defining array of octal formats
$formats =
'%o %+o %-o
- %lo %Lo %4o %-4o
+ %lo %4o %-4o
%10.4o %-10.4o %.4o
%\'#2o %\'2o %\'$2o %\'_2o
%3$o %4$o %1$o %2$o';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e12, 22e+12,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 0 12
- 361100 o 37777775456 2322
+ 361100 37777775456 2322
30071 14 37777777764 37777416700
12 361100 2 0
-int(114)
+int(112)
-- Iteration 2 --
2 37777777776 2
- 361100 o 37720715133 57062645
+ 361100 37720715133 57062645
57060664 4475347 37721631371 37720717336
2 361100 2 37777777776
-int(144)
+int(142)
-- Iteration 3 --
0 0 0
- 173 o 37777777605 173
+ 173 37777777605 173
2322 0 $0 _0
0 173 0 0
-int(86)
+int(84)
-- Iteration 4 --
1 1 1
- 1 o 1 1
+ 1 1 1
#1 1 $1 _1
1 1 1 1
-int(73)
+int(71)
-- Iteration 5 --
1 1 0
- 1 o 0 1
+ 1 0 1
#0 1 $1 _0
0 1 1 1
-int(73)
+int(71)
// defining array of octal formats
$formats =
'%o %+o %-o
- %lo %Lo %4o %-4o
+ %lo %4o %-4o
%10.4o %-10.4o %.4o
%\'#2o %\'2o %\'$2o %\'_2o
%3$o %4$o %1$o %2$o';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e12, 22e+12,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 0 12
- 361100 o 1777777777777777775456 2322
+ 361100 1777777777777777775456 2322
30071 14 1777777777777777777764 1777777777777777416700
12 361100 2 0
-int(151)
+int(149)
-- Iteration 2 --
2 1777777777777777777776 2
- 361100 o 1777777777777720715133 57062645
+ 361100 1777777777777720715133 57062645
57060664 4475347 1777777777777721631371 1777777777777720717336
2 361100 2 1777777777777777777776
-int(203)
+int(201)
-- Iteration 3 --
0 0 0
- 173 o 1777777777777777777605 173
+ 173 1777777777777777777605 173
2322 0 $0 _0
0 173 0 0
-int(101)
+int(99)
-- Iteration 4 --
1 1 1
- 1 o 1 1
+ 1 1 1
#1 1 $1 _1
1 1 1 1
-int(77)
+int(75)
-- Iteration 5 --
1 1 0
- 1 o 0 1
+ 1 0 1
#0 1 $1 _0
0 1 1 1
-int(77)
+int(75)
$formats = array(
"%x",
"%+x %-x %X",
- "%lx %Lx, %4x %-4x",
+ "%lx %4x %-4x",
"%10.4x %-10.4x %04x %04.4x",
"%'#2x %'2x %'$2x %'_2x",
"%x %x %x %x",
$args_array = array(
array(0x0),
array(-0x1, 0x1, +0x22),
- array(0x7FFFFFFF, -0x7fffffff, +0x7000000, -0x80000000),
+ array(0x7FFFFFFF, +0x7000000, -0x80000000),
array(123456, 12345678, -1234567, 1234567),
array(1, 0x2222, 0333333, -0x44444444),
array(0x123b, 0xfAb, "0xaxz", 012),
}
?>
---EXPECT--
+--EXPECTF--
*** Testing vprintf() : hexa formats with hexa values ***
-- Iteration 1 --
int(13)
-- Iteration 3 --
-7fffffff x, 7000000 80000000
-int(28)
+7fffffff 7000000 80000000
+int(25)
-- Iteration 4 --
ffed2979 0000
$formats = array(
"%x",
"%+x %-x %X",
- "%lx %Lx, %4x %-4x",
+ "%lx %4x %-4x",
"%10.4x %-10.4x %04x %04.4x",
"%'#2x %'2x %'$2x %'_2x",
"%x %x %x %x",
$args_array = array(
array(0x0),
array(-0x1, 0x1, +0x22),
- array(0x7FFFFFFF, -0x7fffffff, +0x7000000, -0x80000000),
+ array(0x7FFFFFFF, +0x7000000, -0x80000000),
array(123456, 12345678, -1234567, 1234567),
array(1, 0x2222, 0333333, -0x44444444),
array(0x123b, 0xfAb, "0xaxz", 012),
}
?>
---EXPECT--
+--EXPECTF--
*** Testing vprintf() : hexa formats with hexa values ***
-- Iteration 1 --
int(21)
-- Iteration 3 --
-7fffffff x, 7000000 ffffffff80000000
-int(36)
+7fffffff 7000000 ffffffff80000000
+int(33)
-- Iteration 4 --
ffffffffffed2979 0000
// defining array of different hexa formats
$formats =
'%x %+x %-x
- %lx %Lx %4x %-4x
+ %lx x %4x %-4x
%10.4x %-10.4x %.4x
%\'#2x %\'2x %\'$2x %\'_2x
%3$x %4$x %1$x %2$x';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e12, 22e+12,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
// defining array of different hexa formats
$formats =
'%x %+x %-x
- %lx %Lx %4x %-4x
+ %lx %4x %-4x
%10.4x %-10.4x %.4x
%\'#2x %\'2x %\'$2x %\'_2x
%3$x %4$x %1$x %2$x';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e12, 22e+12,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 0 a
- 1e240 x fffffffffffffb2e 4d2
+ 1e240 fffffffffffffb2e 4d2
3039 c fffffffffffffff4 fffffffffffe1dc0
a 1e240 2 0
-int(127)
+int(125)
-- Iteration 2 --
2 fffffffffffffffe 2
- 1e240 x ffffffffff439a5b bc65a5
+ 1e240 ffffffffff439a5b bc65a5
bc61b4 127ae7 ffffffffff4732f9 ffffffffff439ede
2 1e240 2 fffffffffffffffe
-int(166)
+int(164)
-- Iteration 3 --
0 0 0
- 7b x ffffffffffffff85 7b
+ 7b ffffffffffffff85 7b
4d2 0 $0 _0
0 7b 0 0
-int(92)
+int(90)
-- Iteration 4 --
1 1 1
- 1 x 1 1
+ 1 1 1
#1 1 $1 _1
1 1 1 1
-int(77)
+int(75)
-- Iteration 5 --
1 1 0
- 1 x 0 1
+ 1 0 1
#0 1 $1 _0
0 1 1 1
-int(77)
+int(75)
// defining array of unsigned formats
$formats = array(
'%u %+u %-u',
- '%lu %Lu %4u %-4u',
+ '%lu %4u %-4u',
'%10.4u %-10.4u %.4u',
'%\'#2u %\'2u %\'$2u %\'_2u',
'%3$u %4$u %1$u %2$u'
// Each sub array contains unsigned values which correspond to each format string in $format
$args_array = array(
array(1234567, 01234567, 0 ),
- array(12345678900, 12345678900, 1234, 12345),
+ array(12345678900, 1234, 12345),
array("1234000", 10.1234567e10, 1.2e2),
array(1, 0, 00, "10_"),
array(3, 4, 1, 2)
int(16)
-- Iteration 2 --
-3755744308 u 1234 12345
-int(23)
+3755744308 1234 12345
+int(21)
-- Iteration 3 --
1234000 2450319192 120
// defining array of unsigned formats
$formats = array(
'%u %+u %-u',
- '%lu %Lu %4u %-4u',
+ '%lu %4u %-4u',
'%10.4u %-10.4u %.4u',
'%\'#2u %\'2u %\'$2u %\'_2u',
'%3$u %4$u %1$u %2$u'
// Each sub array contains unsigned values which correspond to each format string in $format
$args_array = array(
array(1234567, 01234567, 0 ),
- array(12345678900, 12345678900, 1234, 12345),
+ array(12345678900, 1234, 12345),
array("1234000", 10e20, 1.2e2),
array(1, 0, 00, "10_"),
array(3, 4, 1, 2)
int(16)
-- Iteration 2 --
-12345678900 u 1234 12345
-int(24)
+12345678900 1234 12345
+int(22)
-- Iteration 3 --
1234000 3875820019684212736 120
// defining array of unsigned formats
$formats =
'%u %+u %-u
- %lu %Lu %4u %-4u
+ %lu %4u %-4u
%10.4u %-10.4u %.4u
%\'#2u %\'2u %\'$2u %\'_2u
%3$u %4$u %1$u %2$u';
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 0 10
- 123456 u 1234 2820130816
- 2840207360 1177509888 12345
- 12 4294967284 4294843840 _3
+ 123456 123456 1234
+ 2820130816 2840207360 1177509888
+ 12345 12 4294967284 4294843840
10 123456 2 0
-int(113)
+int(115)
-- Iteration 2 --
0 0 0
- 123 u 4294967173 123
+ 123 4294967173 123
0 0 0
1234 0 $0 _0
0 123 0 0
-int(86)
+int(84)
-- Iteration 3 --
1 1 1
- 1 u 1 1
+ 1 1 1
1 1 1
#1 1 $1 _1
1 1 1 1
-int(74)
+int(72)
-- Iteration 4 --
1 1 0
- 1 u 0 1
+ 1 0 1
1 1 0
#0 1 $1 _0
0 1 1 1
-int(74)
+int(72)
// defining array of unsigned formats
$formats =
'%u %+u %-u
- %lu %Lu %4u %-4u
+ %lu %4u %-4u
%10.4u %-10.4u %.4u
%\'#2u %\'2u %\'$2u %\'_2u
%3$u %4$u %1$u %2$u';
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 0 10
- 123456 u 1234 20000000000
- 2000000000000 22000000000000 12345
- 12 18446744073709551604 18446744073709428160 _3
+ 123456 123456 1234
+ 20000000000 2000000000000 22000000000000
+ 12345 12 18446744073709551604 18446744073709428160
10 123456 2 0
-int(145)
+int(147)
-- Iteration 2 --
0 0 0
- 123 u 18446744073709551493 123
+ 123 18446744073709551493 123
0 0 0
1234 0 $0 _0
0 123 0 0
-int(100)
+int(98)
-- Iteration 3 --
1 1 1
- 1 u 1 1
+ 1 1 1
1 1 1
#1 1 $1 _1
1 1 1 1
-int(78)
+int(76)
-- Iteration 4 --
1 1 0
- 1 u 0 1
+ 1 0 1
1 1 0
#0 1 $1 _0
0 1 1 1
-int(78)
+int(76)
// defining array of scientific formats
$formats = array(
'%e %+e %-e',
- '%le %Le %4e %-4e',
+ '%le %4e %-4e',
'%10.4e %-10.4e %.4e',
'%\'#20e %\'20e %\'$20e %\'_20e',
'%3$e %4$e %1$e %2$e'
// Each sub array contains scientific values which correspond to each format string in $format
$args_array = array(
array(0, 1e0, "10e2" ),
- array(2.2e2, 10e10, 1000e-2, 1000e7),
+ array(2.2e2, 1000e-2, 1000e7),
array(-22e12, 10e20, 1.2e2),
array(1e1, +1e2, -1e3, "1e2_"),
array(3e3, 4e3, 1e3, 2e3)
int(36)
-- Iteration 2 --
-2.200000e+2 e 1.000000e+1 1.000000e+10
-int(38)
+2.200000e+2 1.000000e+1 1.000000e+10
+int(36)
-- Iteration 3 --
-2.2000e+13 1.0000e+21 1.2000e+2
// defining array of non-scientific formats
$formats =
'%e %+e %-e
- %le %Le %4e %-4e
+ %le %4e %-4e
%10.4e %-10.4e %04e %04.4e
%\'#2e %\'2e %\'$2e %\'_2e
%3$e %4$e %1$e %2$e';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
20.00, +212.2, -411000000000, 2212.000000000001,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", '0123456hello', 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2.200000e+0 +2.000000e-1 1.020000e+1
- 1.234562e+5 e -1.234679e+3 1.234679e+3
+ 1.234562e+5 -1.234679e+3 1.234679e+3
2.0000e+1 2.1220e+2 -4.110000e+11 2.2120e+3
1.234578e+4 1.200000e+1 -1.200000e+1 -1.234562e+5
1.020000e+1 1.234562e+5 2.200000e+0 2.000000e-1
-int(235)
+int(233)
-- Iteration 2 --
0.000000e+0 +0.000000e+0 0.000000e+0
- 1.230000e+2 e -1.230000e+2 1.230000e+2
+ 1.230000e+2 -1.230000e+2 1.230000e+2
0.0000e+0 0.0000e+0 1.234560e+5 0.0000e+0
1.234000e+3 0.000000e+0 0.000000e+0 0.000000e+0
0.000000e+0 1.230000e+2 0.000000e+0 0.000000e+0
-int(231)
+int(229)
-- Iteration 3 --
1.000000e+0 +1.000000e+0 1.000000e+0
- 1.000000e+0 e 1.000000e+0 1.000000e+0
+ 1.000000e+0 1.000000e+0 1.000000e+0
1.0000e+0 1.0000e+0 1.000000e+0 1.0000e+0
1.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0
1.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0
-int(230)
+int(228)
-- Iteration 4 --
1.000000e+0 +1.000000e+0 0.000000e+0
- 1.000000e+0 e 0.000000e+0 1.000000e+0
+ 1.000000e+0 0.000000e+0 1.000000e+0
1.0000e+0 0.0000e+0 1.000000e+0 0.0000e+0
0.000000e+0 1.000000e+0 1.000000e+0 0.000000e+0
0.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0
-int(230)
+int(228)
// defining array of int formats
$formats = array(
"%d",
- "%+d %-d %D",
- "%ld %Ld, %4d %-4d",
+ "%+d %-d",
+ "%ld %4d %-4d",
"%10.4d %-10.4d %04d %04.4d",
"%'#2d %'2d %'$2d %'_2d",
"%d %d %d %d",
// Each sub array contains int values which correspond to each format string in $format
$args_array = array(
array(0),
- array(-1, 1, +22),
- array(2147483647, -2147483648, +2147483640, -2147483640),
+ array(-1, 1),
+ array(2147483647, +2147483640, -2147483640),
array(123456, 12345678, -1234567, 1234567),
array(111, 2222, 333333, 44444444),
array(0x123b, 0xfAb, 0123, 012),
int(1)
-- Iteration 2 --
--1 1
-int(5)
+-1 1
+int(4)
-- Iteration 3 --
-2147483647 d, 2147483640 -2147483640
-int(36)
+2147483647 2147483640 -2147483640
+int(33)
-- Iteration 4 --
123456 12345678 -1234567 1234567
// defining array of int formats
$formats =
'%d %+d %-d
- %ld %Ld %4d %-4d
+ %ld %4d %-4d
%10.4d %-10.4d %.4d %04.4d
%\'#2d %\'2d %\'$2d %\'_2d
%3$d %4$d %1$d %2$d';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e5, 4e3, 22e+6,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", '0123456hello', 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 +0 10
- 123456 d -1234 1234
+ 123456 -1234 1234
-1474836480 200000 4000 22000000
12345 12 -12 -123456
10 123456 2 0
-int(111)
+int(109)
-- Iteration 2 --
0 +0 0
- 123 d -123 123
+ 123 -123 123
0 0 123456 0000
1234 0 $0 _0
0 123 0 0
-int(91)
+int(89)
-- Iteration 3 --
1 +1 1
- 1 d 1 1
+ 1 1 1
1 1 1 0001
#1 1 $1 _1
1 1 1 1
-int(80)
+int(78)
-- Iteration 4 --
1 +1 0
- 1 d 0 1
+ 1 0 1
1 0 1 0000
#0 1 $1 _0
0 1 1 1
-int(80)
+int(78)
// defining array of int formats
$formats =
'%d %+d %-d
- %ld %Ld %4d %-4d
+ %ld %4d %-4d
%10.4d %-10.4d %.4d %04.4d
%\'#2d %\'2d %\'$2d %\'_2d
%3$d %4$d %1$d %2$d';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2e10, +2e5, 4e3, 22e+6,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", '0123456hello', 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2 +0 10
- 123456 d -1234 1234
+ 123456 -1234 1234
20000000000 200000 4000 22000000
12345 12 -12 -123456
10 123456 2 0
-int(115)
+int(113)
-- Iteration 2 --
0 +0 0
- 123 d -123 123
+ 123 -123 123
0 0 123456 0000
1234 0 $0 _0
0 123 0 0
-int(95)
+int(93)
-- Iteration 3 --
1 +1 1
- 1 d 1 1
+ 1 1 1
1 1 1 0001
#1 1 $1 _1
1 1 1 1
-int(84)
+int(82)
-- Iteration 4 --
1 +1 0
- 1 d 0 1
+ 1 0 1
1 0 1 0000
#0 1 $1 _0
0 1 1 1
-int(84)
+int(82)
$formats = array(
"%f",
"%+f %-f %F",
- "%lf %Lf, %4f %-4f",
+ "%lf %4f %-4f",
"%10.4f %-10.4F %04f %04.4f",
"%'#2f %'2f %'$2f %'_2f",
"%f %f %f %f",
$args_array = array(
array(0.0),
array(-0.1, +0.1, +10.0000006),
- array(2147483649, -2147483647, +2147483640, -2147483640),
+ array(2147483649, +2147483640, -2147483640),
array(2e5, 2e-5, -2e5, -2e-5),
array(0.2E5, -0.2e40, 0.2E-20, 0.2E+20),
array(0x123b, 0xfAb, 0123, 012),
int(28)
-- Iteration 3 --
-2147483649.000000 f, 2147483640.000000 -2147483640.000000
-int(57)
+2147483649.000000 2147483640.000000 -2147483640.000000
+int(54)
-- Iteration 4 --
200000.0000 0.0000 -200000.000000 -0.0000
// defining array of float formats
$formats =
'%f %+f %-f
- %lf %Lf %4f %-4f
+ %lf %4f %-4f
%10.4f %-10.4f %04f %04.4f
%\'#2f %\'2f %\'$2f %\'_2f
%3$f %4$f %1$f %2$f';
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, -40000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// array of strings
array(" ", ' ', 'hello',
- '123hello', "123hello", '-123hello', '+123hello',
+ '123hello', '-123hello', '+123hello',
"\12345678hello", "-\12345678hello", '0123456hello', 'h123456ello',
"1234hello", "hello\0world", "NULL", "true",
"3", "4", '1', '2'),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2.000000 -2.000000 2.000000
- 123456.000000 f -12346789.000000 12346789.000000
+ 123456.000000 -12346789.000000 12346789.000000
123200.0000 20000.0000 -40000.000000 22212.0000
12345780.000000 1211111.000000 -12111111.000000 -12345634.000000
2.000000 123456.000000 2.000000 -2.000000
-int(247)
+int(245)
-- Iteration 2 --
0.000000 +0.000000 0.000000
- 123.000000 f -123.000000 123.000000
+ 123.000000 -123.000000 123.000000
0.0000 0.0000 123456.000000 0.0000
1234.000000 0.000000 0.000000 0.000000
0.000000 123.000000 0.000000 0.000000
-int(199)
+int(197)
-- Iteration 3 --
1.000000 +1.000000 1.000000
- 1.000000 f 1.000000 1.000000
+ 1.000000 1.000000 1.000000
1.0000 1.0000 1.000000 1.0000
1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000
-int(182)
+int(180)
-- Iteration 4 --
1.000000 +1.000000 0.000000
- 1.000000 f 0.000000 1.000000
+ 1.000000 0.000000 1.000000
1.0000 0.0000 1.000000 0.0000
0.000000 1.000000 1.000000 0.000000
0.000000 1.000000 1.000000 1.000000
-int(182)
+int(180)
// defining array of string formats
$formats =
'%s %+s %-s
- %ls %Ls %4s %-4s
+ %ls %4s %-4s
%10.4s %-10.4s %04s %04.4s
%\'#2s %\'2s %\'$2s %\'_2s
%3$s %4$s %1$s %2$s';
// array of float values
array(2.2, .2, 10.2,
- 123456.234, 123456.234, -1234.6789, +1234.6789,
+ 123456.234, -1234.6789, +1234.6789,
2.1234567e10, +2.7654321e10, -2.7654321e10,
12345.780, 12.000000011111, -12.00000111111, -123456.234,
3.33, +4.44, 1.11,-2.22 ),
// array of int values
array(2, -2, +2,
- 123456, 123456234, -12346789, +12346789,
+ 123456, -12346789, +12346789,
123200, +20000, -40000, 22212,
12345780, 1211111, -12111111, -12345634,
3, +4, 1,-2 ),
// different arrays
array( array(0), array(1, 2), array(-1, -1),
- array("123"), array('123'), array('-123'), array("-123"),
+ array("123"), array('-123'), array("-123"),
array(true), array(false), array(TRUE), array(FALSE),
array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),
array("3"), array("4"), array("1"), array("2") ),
// array of boolean data
array( true, TRUE, false,
- TRUE, 0, FALSE, 1,
+ TRUE, FALSE, 1,
true, false, TRUE, FALSE,
0, 1, 1, 0,
1, TRUE, 0, FALSE),
-- Iteration 1 --
2.2 0.2 10.2
- 123456.234 s -1234.6789 1234.6789
+ 123456.234 -1234.6789 1234.6789
2123 2765 -27654321000 1234
12.000000011111 -12.00000111111 -123456.234 3.33
10.2 123456.234 2.2 0.2
-int(175)
+int(173)
-- Iteration 2 --
2 -2 2
- 123456 s -12346789 12346789
+ 123456 -12346789 12346789
1232 2000 -40000 2221
12345780 1211111 -12111111 -12345634
2 123456 2 -2
-int(135)
+int(133)
-- Iteration 3 --
Warning: Array to string conversion in %s on line %d
Array Array Array
- Array s Array Array
+ Array Array Array
Arra Arra Array Arra
Array Array Array Array
Array Array Array Array
-int(134)
+int(132)
-- Iteration 4 --
1 1
- 1 s 1
+ 1 1
1 0001 0000
#0 1 $1 _0
1 1 1
-int(84)
+int(82)