Display the drop-down list

Test of array_multisort()

Example #1 : test success
Example #2 : test success
Example #3 : test success
Example #4 : test success
Example #1
$input = [
  
'__array1' => [
    
=> 10,
    
=> 100,
    
=> 100,
    
=> 0,
  ],
  
=> '$array1',
  
=> 'SORT_ASC',
  
=> 'SORT_REGULAR',
  
'__array2' => [
    
=> 1,
    
=> 3,
    
=> 2,
    
=> 4,
  ],
  
=> '$array2',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array1' => [
      
=> 0,
      
=> 10,
      
=> 100,
      
=> 100,
    ],
    
'array2' => [
      
=> 4,
      
=> 1,
      
=> 2,
      
=> 3,
    ],
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
'__array1' => [
    
=> '10',
    
=> 11,
    
=> 100,
    
=> 100,
    
=> 'a',
  ],
  
=> '$array1',
  
=> 'SORT_ASC',
  
=> 'SORT_STRING',
  
'__array2' => [
    
=> 1,
    
=> 2,
    
=> '2',
    
=> 3,
    
=> 1,
  ],
  
=> '$array2',
  
=> 'SORT_NUMERIC',
  
=> 'SORT_DESC',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array1' => [
      
=> '10',
      
=> 100,
      
=> 100,
      
=> 11,
      
=> 'a',
    ],
    
'array2' => [
      
=> 1,
      
=> 3,
      
=> '2',
      
=> 2,
      
=> 1,
    ],
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
'__array1' => [
    
=> 67,
    
=> 86,
    
=> 85,
    
=> 98,
    
=> 86,
    
=> 67,
  ],
  
=> '$array1',
  
=> 'SORT_DESC',
  
=> 'SORT_REGULAR',
  
'__array2' => [
    
=> 2,
    
=> 1,
    
=> 6,
    
=> 2,
    
=> 6,
    
=> 7,
  ],
  
=> '$array2',
  
=> 'SORT_ASC',
  
=> 'SORT_REGULAR',
  
'__array3' => [
    
=> [
      
'volume' => 67,
      
'edition' => 2,
    ],
    
=> [
      
'volume' => 86,
      
'edition' => 1,
    ],
    
=> [
      
'volume' => 85,
      
'edition' => 6,
    ],
    
=> [
      
'volume' => 98,
      
'edition' => 2,
    ],
    
=> [
      
'volume' => 86,
      
'edition' => 6,
    ],
    
=> [
      
'volume' => 67,
      
'edition' => 7,
    ],
  ],
  
=> '$array3',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array1' => [
      
=> 98,
      
=> 86,
      
=> 86,
      
=> 85,
      
=> 67,
      
=> 67,
    ],
    
'array2' => [
      
=> 2,
      
=> 1,
      
=> 6,
      
=> 6,
      
=> 2,
      
=> 7,
    ],
    
'array3' => [
      
=> [
        
'volume' => 98,
        
'edition' => 2,
      ],
      
=> [
        
'volume' => 86,
        
'edition' => 1,
      ],
      
=> [
        
'volume' => 86,
        
'edition' => 6,
      ],
      
=> [
        
'volume' => 85,
        
'edition' => 6,
      ],
      
=> [
        
'volume' => 67,
        
'edition' => 2,
      ],
      
=> [
        
'volume' => 67,
        
'edition' => 7,
      ],
    ],
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
'__array1' => [
    
=> 'alpha',
    
=> 'atomic',
    
=> 'beta',
    
=> 'bank',
  ],
  
=> '$array1',
  
=> 'SORT_ASC',
  
=> 'SORT_STRING',
  
'__array2' => [
    
=> 'Alpha',
    
=> 'atomic',
    
=> 'Beta',
    
=> 'bank',
  ],
  
=> '$array2',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array1' => [
      
=> 'alpha',
      
=> 'atomic',
      
=> 'bank',
      
=> 'beta',
    ],
    
'array2' => [
      
=> 'Alpha',
      
=> 'atomic',
      
=> 'bank',
      
=> 'Beta',
    ],
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]