Bug #61323 [Com]: regexp option missing for filter_var function

From: Date: Thu, 08 Mar 2012 00:10:46 +0000
Subject: Bug #61323 [Com]: regexp option missing for filter_var function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-168252@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61323&edit=1 ID: 61323 Comment by: me at ktamura dot com Reported by: tomp at tomp dot co dot uk Summary: regexp option missing for filter_var function Status: Open Type: Bug Package: Filter related Operating System: Centos 5.7 PHP Version: 5.4.0 Block user comment: N Private report: N New Comment: This is not a bug. Your function invocation is incorrect. I believe what you meant is $var = filter_var($string_to_filter, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^something$/'))); c.f. http://us.php.net/manual/en/function.filter-var.php Previous Comments: ------------------------------------------------------------------------ [2012-03-07 22:33:24] tomp at tomp dot co dot uk Description: ------------ The regexp option is missing when using filter_var function in PHP 5.4, but was present using the same SPEC file build process when using PHP 5.3. Test script: --------------- $var = filter_var('/^something$/', FILTER_VALIDATE_REGEXP); Expected result: ---------------- /^something$/ Actual result: -------------- Warning: filter_var(): 'regexp' option missing in php shell code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61323&edit=1

« previous php.bugs (#168252) next »