|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-03-07 22:33 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
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