Display the drop-down list

Test of json_decode()

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 not validated (platform dependant or random result etc.)
Example #9 : test success
Example #1
$input = '_SINGLE_QUOTE_{"a":1,"b":2,"c":3,"d":4,"e":5}_SINGLE_QUOTE_'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 
    
stdClass::__set_state(array(
       
'a' => 1,
       
'b' => 2,
       
'c' => 3,
       
'd' => 4,
       
'e' => 5,
    )],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #2
$input = [
  
=> '_SINGLE_QUOTE_{"a":1,"b":2,"c":3,"d":4,"e":5}_SINGLE_QUOTE_',
  
=> true,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => [
      
'a' => 1,
      
'b' => 2,
      
'c' => 3,
      
'd' => 4,
      
'e' => 5,
    ],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #3
$input = '_SINGLE_QUOTE_{"foo-bar": 12345}_SINGLE_QUOTE_'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 
    
stdClass::__set_state(array(
       
'foo-bar' => 12345,
    )],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #4
$input = '{ \'bar\': \'baz\' }'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => NULL,
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #5
$input = '_SINGLE_QUOTE_{ bar: "baz" }_SINGLE_QUOTE_'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => NULL,
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #6
$input = '_SINGLE_QUOTE_{ bar: "baz", }_SINGLE_QUOTE_'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => NULL,
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #7
$input = '_SINGLE_QUOTE_{"1":{"English":["One","January"],"French":["Une","Janvier"]}}_SINGLE_QUOTE_'
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 
    
stdClass::__set_state(array(
       
'1' => 
      
stdClass::__set_state(array(
         
'English' => [
          
=> 'One',
          
=> 'January',
        ],
         
'French' => [
          
=> 'Une',
          
=> 'Janvier',
        ],
      )],
    )],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #8
$input = '_SINGLE_QUOTE_{"number": 12345678901234567890}_SINGLE_QUOTE_'
test not validated (platform dependant or random result etc.)
$test_output = [
  
'result' => [
    
'mixed' => 
    
stdClass::__set_state(array(
       
'number' => 1.2345678901234567E+19,
    )],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]
Example #9
$input = [
  
=> '_SINGLE_QUOTE_{"number": 12345678901234567890}_SINGLE_QUOTE_',
  
=> false,
  
=> 512,
  
=> 'JSON_BIGINT_AS_STRING',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 
    
stdClass::__set_state(array(
       
'number' => '12345678901234567890',
    )],
  ],
  
'php_version' => '7.1.26 Linux x86_64',
]