显示下拉菜单

Test of array_filter() 本页面仅提供英文版本。

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 #1
$input = [
  
=> [
    
'a' => 1,
    
'b' => 2,
    
'c' => 3,
    
'd' => 4,
    
'e' => 5,
  ],
  
=> 'odd',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
'a' => 1,
      
'c' => 3,
      
'e' => 5,
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> [
    
=> 6,
    
=> 7,
    
=> 8,
    
=> 9,
    
=> 10,
    
=> 11,
    
=> 12,
  ],
  
=> 'even',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
=> 6,
      
=> 8,
      
=> 10,
      
=> 12,
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> [
    
=> 'foo',
    
=> false,
    
=> -1,
    
=> NULL,
    
=> '',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
=> 'foo',
      
=> -1,
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
=> [
    
=> 'foo',
    
=> false,
    
=> -1,
    
=> NULL,
    
=> '',
  ],
  
=> 'is_numeric',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
=> -1,
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #5
$input = [
  
=> [
    
=> 'foo',
    
=> false,
    
=> -1,
    
=> NULL,
    
=> '',
  ],
  
=> 'ctype_alpha',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
=> 'foo',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #6
$input = [
  
=> [
    
'a' => 1,
  ],
  
=> 'xyz',
]
$expected_output = $test_output
$test_output = [
  
'errors' => [
    
=> [
      
'code' => 512,
      
'message' => 'this callback function is invalid or not available on this server',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #7
$input = [
  
=> [
    
'a' => 1,
  ],
  
=> 'time',
]
$expected_output = $test_output
$test_output = [
  
'errors' => [
    
=> [
      
'code' => 512,
      
'message' => 'this callback function may not be used',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #8
$input = [
  
=> [
    
'a' => 1,
  ],
  
=> 'exception::getMessage',
]
$expected_output = $test_output
$test_output = [
  
'errors' => [
    
=> [
      
'code' => 512,
      
'message' => 'this class may not be used',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]