mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
- add a test for input_get and array
This test fails now. When the input variable is an array, its contents is replace by the filter result. To be fixed asap (before 5.2.0)
This commit is contained in:
parent
1fea711ac4
commit
d10b686b6e
1 changed files with 35 additions and 0 deletions
35
ext/filter/tests/035.phpt
Normal file
35
ext/filter/tests/035.phpt
Normal file
|
@ -0,0 +1,35 @@
|
|||
--TEST--
|
||||
GET/POST/REQUEST Test with input_get
|
||||
--POST--
|
||||
d=379
|
||||
--GET--
|
||||
ar[elm1]=1234&ar[elm2]=0660&a=0234
|
||||
--FILE--
|
||||
<?php
|
||||
$ret = input_get(INPUT_GET, 'a', FILTER_VALIDATE_INT);
|
||||
var_dump($ret);
|
||||
|
||||
$ret = input_get(INPUT_GET, 'a', FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
|
||||
var_dump($ret);
|
||||
|
||||
$ret = input_get(INPUT_GET, 'ar', FILTER_VALIDATE_INT);
|
||||
var_dump($ret);
|
||||
|
||||
$ret = input_get(INPUT_GET, 'ar', FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
|
||||
var_dump($ret);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(156)
|
||||
array(2) {
|
||||
["elm1"]=>
|
||||
int(1234)
|
||||
["elm2"]=>
|
||||
bool(false)
|
||||
}
|
||||
array(2) {
|
||||
["elm1"]=>
|
||||
int(1234)
|
||||
["elm2"]=>
|
||||
int(432)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue