Display the drop-down list

Test of filter_var()

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 #17 : test success
Example #18 : test success
Example #1
$input = [
  
=> '0755',
  
=> 'FILTER_VALIDATE_INT',
  
=> [
    
'options' => [
      
'default' => 3,
      
'min_range' => 0,
    ],
    
'flags' => 'FILTER_FLAG_ALLOW_OCTAL',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 493,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> 'oops',
  
=> 'FILTER_VALIDATE_BOOLEAN',
  
=> 'FILTER_NULL_ON_FAILURE',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => NULL,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> 'oops',
  
=> 'FILTER_VALIDATE_BOOLEAN',
  
=> [
    
'flags' => 'FILTER_NULL_ON_FAILURE',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => NULL,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
=> 'Doe, Jane Sue',
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => 'foo',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 'Doe, Jane Sue',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #5
$input = [
  
=> 'bob@example.com',
  
=> 'FILTER_VALIDATE_EMAIL',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 'bob@example.com',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #6
$input = [
  
=> 'http://example.com',
  
=> 'FILTER_VALIDATE_URL',
  
=> 'FILTER_FLAG_PATH_REQUIRED',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => false,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #7
$input = [
  
=> '127.0.0.1',
  
=> 'FILTER_VALIDATE_IP',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => '127.0.0.1',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #8
$input = [
  
=> '1',
  
=> 'FILTER_VALIDATE_INT',
  
=> [
    
'options' => [
      
'default' => 3,
      
'min_range' => 0,
    ],
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #9
$input = [
  
=> '-1',
  
=> 'FILTER_VALIDATE_INT',
  
=> [
    
'options' => [
      
'default' => 3,
      
'min_range' => 0,
    ],
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 3,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #10
$input = [
  
=> '4',
  
=> 'FILTER_VALIDATE_INT',
  
=> [
    
'options' => [
      
'default' => 3,
      
'min_range' => 0,
    ],
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 4,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #11
$input = [
  
=> '(bob@example.com)',
  
=> 'FILTER_SANITIZE_EMAIL',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 'bob@example.com',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #12
$input = [
  
=> 'Doe Jane Sue',
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => 'foo',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => false,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #13
$input = [
  
=> 'bogus',
  
=> 'FILTER_VALIDATE_EMAIL',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => false,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #14
$input = [
  
=> '42.42',
  
=> 'FILTER_VALIDATE_IP',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => false,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #15
$input = [
  
=> 3,
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => 'cube',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 27,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #16
$input = [
  
=> 3,
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => '$cube',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 27,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #17
$input = [
  
=> 3,
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => 'pbx_callbacks::cube',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 27,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #18
$input = [
  
=> 3,
  
=> 'FILTER_CALLBACK',
  
=> [
    
'options' => [
      
=> '$object',
      
=> 'cube',
    ],
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'mixed' => 27,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]