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