From:             
Operating system: *
PHP version:      Irrelevant
Package:          Filter related
Bug Type:         Feature/Change Request
Bug description:Add filter option to allow both arrays and scalars

Description:
------------
This is a request for adding another flag (FILTER_FLAG_ALLOW_ARRAY) to
filter extension to allow both arrays and scalars for input, while
retaining their type (as opposed to FILTER_FORCE_ARRAY, which can accept
scalars, but will return an array).



So if input is array, return an array, and if scalar, return scalar.

It seems pretty basic.

Test script:
---------------
$test = filter_input(INPUT_GET, "a", FILTER_VALIDATE_INT,
FILTER_FLAG_ALLOW_ARRAY);

var_dump($test);

Expected result:
----------------
test.php?a=1

int(1)



test.php?a[]=1&a[]=2

array (2) { [0] => int(1), [1] => int(2) }

Actual result:
--------------
FILTER_FLAG_ALLOW_ARRAY not implemented ;)

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54852&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54852&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54852&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54852&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54852&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54852&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54852&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54852&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54852&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54852&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54852&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54852&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54852&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54852&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54852&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54852&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54852&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54852&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54852&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54852&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54852&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54852&r=mysqlcfg

Reply via email to