Home
last modified time | relevance | path

Searched refs:sprintf (Results 1 – 25 of 361) sorted by relevance

12345678910>>...15

/PHP-7.1/ext/standard/tests/general_functions/
H A D001.phpt2 sprintf() function
6 $agent = sprintf("%.5s", "James Bond, 007");
8 echo("sprintf string truncate test: ");
15 echo("sprintf padding and align test: ");
32 $test = sprintf("%b", 3457925);
47 echo sprintf("%.2f\n", "99.00");
48 echo sprintf("%.2f\n", 99.00);
50 echo sprintf("%e\n", 1.234E-18);
51 echo sprintf("%e\n", 1.234E+18);
52 echo sprintf("%e\n", 9843243.12);
[all …]
/PHP-7.1/ext/standard/tests/strings/
H A Dsprintf_f.phpt2 sprintf %f
6 var_dump(sprintf("%3.2f", 1.2));
7 var_dump(sprintf("%-3.2f", 1.2));
8 var_dump(sprintf("%03.2f", 1.2));
9 var_dump(sprintf("%-03.2f", 1.2));
11 var_dump(sprintf("%5.2f", 3.4));
12 var_dump(sprintf("%-5.2f", 3.4));
13 var_dump(sprintf("%05.2f", 3.4));
14 var_dump(sprintf("%-05.2f", 3.4));
16 var_dump(sprintf("%7.2f", -5.6));
[all …]
H A Dsprintf_error.phpt2 Test sprintf() function : error conditions
10 echo "*** Testing sprintf() : error conditions ***\n";
14 var_dump( sprintf() );
24 var_dump( sprintf($format1) );
25 var_dump( sprintf($format2,$arg1) );
26 var_dump( sprintf($format3,$arg1,$arg2) );
29 var_dump( sprintf($format2) );
30 var_dump( sprintf($format3,$arg1) );
33 var_dump( sprintf($format3) );
38 *** Testing sprintf() : error conditions ***
[all …]
H A Dsprintf_f_2.phpt2 sprintf %f #2
7 var_dump(sprintf("%.3F", 100.426));
8 var_dump(sprintf("%.2F", 100.426));
9 var_dump(sprintf("%d", 100.426));
10 var_dump(sprintf("%d", 100.9));
11 var_dump(sprintf("%o", 100.426));
12 var_dump(sprintf("%o", 100.9));
21 var_dump(sprintf($format, $num, $location));
25 var_dump(sprintf($format, $num, $location));
29 var_dump(sprintf($format, $num, $location));
[all …]
H A Dsprintf_basic3.phpt2 Test sprintf() function : basic functionality - float format
27 // Calling sprintf() with default arguments
28 var_dump( sprintf($format) );
30 // Calling sprintf() with two arguments
31 var_dump( sprintf($format1, $arg1) );
32 var_dump( sprintf($format11, $arg1) );
34 // Calling sprintf() with three arguments
35 var_dump( sprintf($format2, $arg1, $arg2) );
36 var_dump( sprintf($format22, $arg1, $arg2) );
38 // Calling sprintf() with four arguments
[all …]
H A Dsprintf_basic9.phpt28 // Calling sprintf() with default arguments
29 var_dump( sprintf($format) );
31 // Calling sprintf() with two arguments
32 var_dump( sprintf($format1, $arg1) );
33 var_dump( sprintf($format11, $arg1) );
35 // Calling sprintf() with three arguments
36 var_dump( sprintf($format2, $arg1, $arg2) );
37 var_dump( sprintf($format22, $arg1, $arg2) );
39 // Calling sprintf() with four arguments
40 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic2.phpt2 Test sprintf() function : basic functionality - integer format
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
22 // Calling sprintf() with default arguments
23 var_dump( sprintf($format) );
25 // Calling sprintf() with two arguments
26 var_dump( sprintf($format1, $arg1) );
28 // Calling sprintf() with three arguments
29 var_dump( sprintf($format2, $arg1, $arg2) );
31 // Calling sprintf() with four arguments
32 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic4.phpt2 Test sprintf() function : basic functionality - bool format
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
22 // Calling sprintf() with default arguments
23 var_dump( sprintf($format) );
25 // Calling sprintf() with two arguments
26 var_dump( sprintf($format1, $arg1) );
28 // Calling sprintf() with three arguments
29 var_dump( sprintf($format2, $arg1, $arg2) );
31 // Calling sprintf() with four arguments
32 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic5.phpt2 Test sprintf() function : basic functionality - char format
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
22 // Calling sprintf() with default arguments
23 var_dump( sprintf($format) );
25 // Calling sprintf() with two arguments
26 var_dump( sprintf($format1, $arg1) );
28 // Calling sprintf() with three arguments
29 var_dump( sprintf($format2, $arg1, $arg2) );
31 // Calling sprintf() with four arguments
32 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic6.phpt2 Test sprintf() function : basic functionality - exponential format
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
21 // Calling sprintf() with default arguments
22 var_dump( sprintf($format) );
24 // Calling sprintf() with two arguments
25 var_dump( sprintf($format1, $arg1) );
27 // Calling sprintf() with three arguments
28 var_dump( sprintf($format2, $arg1, $arg2) );
30 // Calling sprintf() with four arguments
31 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic7.phpt2 Test sprintf() function : basic functionality - unsigned format
11 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
28 // Calling sprintf() with default arguments
29 var_dump( sprintf($format) );
31 // Calling sprintf() with two arguments
32 var_dump( sprintf($format1, $arg1) );
34 // Calling sprintf() with three arguments
35 var_dump( sprintf($format2, $arg1, $arg2) );
37 // Calling sprintf() with four arguments
38 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic7_64bit.phpt2 Test sprintf() function : basic functionality - unsigned format
7 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
24 // Calling sprintf() with default arguments
25 var_dump( sprintf($format) );
27 // Calling sprintf() with two arguments
28 var_dump( sprintf($format1, $arg1) );
30 // Calling sprintf() with three arguments
31 var_dump( sprintf($format2, $arg1, $arg2) );
33 // Calling sprintf() with four arguments
34 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic8.phpt2 Test sprintf() function : basic functionality - octal format
11 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
27 // Calling sprintf() with default arguments
28 var_dump( sprintf($format) );
30 // Calling sprintf() with two arguments
31 var_dump( sprintf($format1, $arg1) );
33 // Calling sprintf() with three arguments
34 var_dump( sprintf($format2, $arg1, $arg2) );
36 // Calling sprintf() with four arguments
37 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic8_64bit.phpt2 Test sprintf() function : basic functionality - octal format
7 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
23 // Calling sprintf() with default arguments
24 var_dump( sprintf($format) );
26 // Calling sprintf() with two arguments
27 var_dump( sprintf($format1, $arg1) );
29 // Calling sprintf() with three arguments
30 var_dump( sprintf($format2, $arg1, $arg2) );
32 // Calling sprintf() with four arguments
33 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dsprintf_basic1.phpt2 Test sprintf() function : basic functionality - string format
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
21 // Calling sprintf() with default arguments
22 var_dump( sprintf($format) );
24 // Calling sprintf() with two arguments
25 var_dump( sprintf($format1, $arg1) );
27 // Calling sprintf() with three arguments
28 var_dump( sprintf($format2, $arg1, $arg2) );
30 // Calling sprintf() with four arguments
31 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
[all …]
H A Dbug36392.phpt2 Bug #36392 (wrong number of decimal digits with %e specifier in sprintf)
5 echo sprintf("%e\n", 1.123456789);
6 echo sprintf("%.10e\n", 1.123456789);
7 echo sprintf("%.0e\n", 1.123456789);
8 echo sprintf("%.1e\n", 1.123456789);
9 echo sprintf("%5.1e\n", 1.123456789);
H A Dsprintf_f_3.phpt2 sprintf %f #3
8 var_dump(sprintf("%.3f", 100.426));
9 var_dump(sprintf("%.2f", 100.426));
10 var_dump(sprintf("%f'", 100.426));
15 var_dump(sprintf("%01.2f", $money));
16 var_dump(sprintf("%.3e", $money));
H A Dsprintf_variation52.phpt2 Test sprintf() function : usage variations - typical format strings
5 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
10 echo "*** Testing sprintf() : with typical format strings ***\n";
17 var_dump(sprintf("%%%.2f", 1.23456789e10));
20 var_dump(sprintf("%%", 1.23456789e10));
23 var_dump(sprintf("%.988f", 1.23456789e10));
26 var_dump(sprintf("%030.-15s", $tempstring));
29 var_dump(sprintf("%X", 12));
32 var_dump(sprintf("%d %s %d\n", $tempnum, $tempstring, $tempnum));
35 var_dump(sprintf("%s", $tempstring, $tempstring, $tempstring));
[all …]
H A Dbug28633.phpt2 Bug #28633 (sprintf incorrectly adding padding to floats)
5 echo sprintf("%05.2f", 0.02) . "\n";
6 echo sprintf("%05.2f", 2.02) . "\n";
/PHP-7.1/ext/standard/html_tables/
H A Dhtml_table_gen.php125 echo sprintf($t, date("Y"));
219 sprintf("%02X", $i << 6)." = { {\n";
348 echo "\t{ ", sprintf("0x%04X", $k), ", ", sprintf("0x%02X", $v[0]), " },\t/* ",
473 sprintf("%05s", $k), "[] = {", "\n";
481 echo "\t{ {", sprintf("%-22s", 'NULL,'),
486 echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t",
550 sprintf("%02X%03X", $i, $k << 6), "[] = {\n";
613 sprintf("%02X000", $i), "[] = {\n";
761 echo sprintf(' {"%s", %d, 0x%05X, 0x%05X},',
764 echo sprintf(' {"%s", %d, 0x%05X, 0},',
[all …]
/PHP-7.1/ext/intl/tests/
H A Dresourcebundle_individual.phpt14 $str_res .= sprintf( "length: %d\n", ut_resourcebundle_count($r) );
15 $str_res .= sprintf( "teststring: %s\n", ut_resourcebundle_get($r, 'teststring' ) );
16 $str_res .= sprintf( "testint: %d\n", ut_resourcebundle_get($r, 'testint' ) );
20 $str_res .= sprintf( "testbin: %s\n", bin2hex(ut_resourcebundle_get( $r,'testbin' )) );
23 $str_res .= sprintf( "testtable: %d\n", ut_resourcebundle_get($r2, 'major' ) );
26 $str_res .= sprintf( "testarray: %s\n", ut_resourcebundle_get($r2, 2 ) );
/PHP-7.1/ext/pdo_mysql/tests/
H A Dpdo_mysql_attr_multi_statements.phpt20 $table = sprintf("test_%s", md5(mt_rand(0, PHP_INT_MAX)));
22 $db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
23 $create = sprintf('CREATE TABLE %s(id INT)', $table);
25 $db->exec(sprintf('INSERT INTO %s(id) VALUES (1)', $table));
26 $stmt = $db->query(sprintf('SELECT * FROM %s; INSERT INTO %s(id) VALUES (2)', $table, $table));
30 $stmt = $db->query(sprintf('SELECT id FROM %s', $table));
38 $stmt = $db->query(sprintf('SELECT * FROM %s; INSERT INTO %s(id) VALUES (3)', $table, $table));
43 $stmt = $db->query(sprintf('SELECT id FROM %s', $table));
49 $db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
H A Dpdo_mysql_attr_init_command.phpt20 $table = sprintf("test_%s", md5(mt_rand(0, PHP_INT_MAX)));
22 $db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
24 $create = sprintf('CREATE TABLE %s(id INT)', $table);
31 $db->exec(sprintf('INSERT INTO %s(id) VALUES (1)', $table));
32 $stmt = $db->query(sprintf('SELECT id FROM %s', $table));
35 $db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
/PHP-7.1/ext/mysqli/tests/
H A Dmysqli_pam_sha256_public_key_option.phpt24 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
38 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
42 die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
52 die(sprintf("skip Cannot create RSA pub key file '%s'", $file));
55 die(sprintf("skip Failed to create pub key file"));
60 die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error));
69 die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
74 die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
80 die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
83 if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) ||
[all …]
H A Dmysqli_pam_sha256_public_key_option_invalid.phpt24 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
38 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
42 die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
52 die(sprintf("skip Cannot create RSA pub key file '%s'", $file));
55 die(sprintf("skip Failed to create pub key file"));
60 die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error));
69 die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
74 die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
80 die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
83 if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) ||
[all …]

Completed in 46 milliseconds

12345678910>>...15