Display the drop-down list

Test of json_encode()

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 success
Example #12 : test success
Example #13 : test success
Example #14 : test success
Example #15 : test success
Example #16 : test success
Example #1
$input = [
  
=> [
    
'a' => 1,
    
'b' => 2,
    
'c' => 3,
    
'd' => 4,
    
'e' => 5,
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{"a":1,"b":2,"c":3,"d":4,"e":5}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #2
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["<foo>","\'bar\'","\\"baz\\"","&blong&","\\u00e9"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #3
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_HEX_TAG',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["\\u003Cfoo\\u003E","\'bar\'","\\"baz\\"","&blong&","\\u00e9"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #4
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_HEX_APOS',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["<foo>","\\u0027bar\\u0027","\\"baz\\"","&blong&","\\u00e9"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #5
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_HEX_QUOT',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["<foo>","\'bar\'","\\u0022baz\\u0022","&blong&","\\u00e9"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #6
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_HEX_AMP',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["<foo>","\'bar\'","\\"baz\\"","\\u0026blong\\u0026","\\u00e9"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #7
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_UNESCAPED_UNICODE',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["<foo>","\'bar\'","\\"baz\\"","&blong&","é"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #8
$input = [
  
=> [
    
=> '<foo>',
    
=> '\'bar\'',
    
=> '_SINGLE_QUOTE_"baz"_SINGLE_QUOTE_',
    
=> '&blong&',
    
=> '_DOUBLE_QUOTES_\\xc3\\xa9_DOUBLE_QUOTES_',
  ],
  
=> 'JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["\\u003Cfoo\\u003E","\\u0027bar\\u0027","\\u0022baz\\u0022","\\u0026blong\\u0026","é"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #9
$input = [
  
=> [
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #10
$input = [
  
=> [
  ],
  
=> 'JSON_FORCE_OBJECT',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #11
$input = [
  
=> [
    
=> [
      
=> 1,
      
=> 2,
      
=> 3,
    ],
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '[[1,2,3]]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #12
$input = [
  
=> [
    
=> [
      
=> 1,
      
=> 2,
      
=> 3,
    ],
  ],
  
=> 'JSON_FORCE_OBJECT',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{"0":{"0":1,"1":2,"2":3}}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #13
$input = [
  
=> [
    
'foo' => 'bar',
    
'baz' => 'long',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{"foo":"bar","baz":"long"}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #14
$input = [
  
=> [
    
'foo' => 'bar',
    
'baz' => 'long',
  ],
  
=> 'JSON_FORCE_OBJECT',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{"foo":"bar","baz":"long"}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #15
$input = [
  
=> [
    
=> 'foo',
    
=> 'bar',
    
=> 'baz',
    
=> 'blong',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '["foo","bar","baz","blong"]',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #16
$input = [
  
=> [
    
=> 'foo',
    
=> 'bar',
    
=> 'baz',
    
=> 'blong',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '{"1":"foo","2":"bar","3":"baz","4":"blong"}',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]