Display the drop-down list

Test of sprintf()

Example #1 : test success
Example #2 : test success
Example #3 : test success
Example #4 : test success
Example #5 : test success
Example #6 : test success
Example #7 : test success
Example #8 : test success
Example #9 : test success
Example #10 : test success
Example #11 : test not validated (platform dependant or random result etc.)
Example #12 : test success
Example #13 : test success
Example #14 : test success
Example #15 : test success
Example #16 : test success
Example #17 : test success
Example #18 : test success
Example #19 : test success
Example #20 : test success
Example #21 : test success
Example #22 : test success
Example #23 : test success
Example #24 : test success
Example #25 : test success
Example #26 : test success
Example #27 : test success
Example #1
$input = [
  
=> 'There are %d monkeys in the %s',
  
=> 5,
  
=> 'tree',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'There are 5 monkeys in the tree',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> 'The %s contains %d monkeys',
  
=> 5,
  
=> 'tree',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'The 5 contains 0 monkeys',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> 'The %2$s contains %1$d monkeys',
  
=> 5,
  
=> 'tree',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'The tree contains 5 monkeys',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
=> 'The %2$s contains %1$d monkeys.
            That\'s a nice %2$s full of %1$d monkeys.'
,
  
=> 5,
  
=> 'tree',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'The tree contains 5 monkeys.
That\'s a nice tree full of 5 monkeys.'
,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #5
$input = [
  
=> 'The %2$s contains %1$04d monkeys',
  
=> 5,
  
=> 'tree',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'The tree contains 0005 monkeys',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #6
$input = [
  
=> '%b',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '10100111101010011010101101',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #7
$input = [
  
=> '%c',
  
=> 65,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => 'A',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #8
$input = [
  
=> '%d',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '43951789',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #9
$input = [
  
=> '%e',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '4.395179e+7',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #10
$input = [
  
=> '%u',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '43951789',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #11
$input = [
  
=> '%u',
  
=> -43951789,
]
test not validated (platform dependant or random result etc.)
$test_output = [
  
'result' => [
    
'string' => '4251015507',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #12
$input = [
  
=> '%f',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '43951789.000000',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #13
$input = [
  
=> '%o',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '247523255',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #14
$input = [
  
=> '%s',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '43951789',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #15
$input = [
  
=> '%x',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '29ea6ad',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #16
$input = [
  
=> '%X',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '29EA6AD',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #17
$input = [
  
=> '%+d',
  
=> 43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '+43951789',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #18
$input = [
  
=> '%+d',
  
=> -43951789,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '-43951789',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #19
$input = [
  
=> '[%s]',
  
=> 'monkey',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[monkey]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #20
$input = [
  
=> '[%10s]',
  
=> 'monkey',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[    monkey]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #21
$input = [
  
=> '[%-10s]',
  
=> 'monkey',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[monkey    ]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #22
$input = [
  
=> '[%010s]',
  
=> 'monkey',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[0000monkey]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #23
$input = [
  
=> '[%\'#10s]',
  
=> 'monkey',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[####monkey]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #24
$input = [
  
=> '[%10.10s]',
  
=> 'many monkeys',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[many monke]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #25
$input = [
  
=> '%04d-%02d-%02d',
  
=> '2014',
  
=> '2',
  
=> '15',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '2014-02-15',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #26
$input = [
  
=> '%01.2f',
  
=> 123.1,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '123.10',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #27
$input = [
  
=> '%.3e',
  
=> 362525200,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '3.625e+8',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]