ID: 43994 Updated by: [email protected] Reported By: [email protected] -Status: No Feedback +Status: Closed Bug Type: mbstring related Operating System: Windows XP SP2 PHP Version: 5.2CVS-2008-01-31 (snap) Assigned To: hirokawa
Previous Comments: ------------------------------------------------------------------------ [2008-02-26 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2008-02-18 14:19:49] [email protected] I've run the above example on the latest 5.2 and 5.3 snapshots and am getting error messages warning about empty patterns similar to that in ereg() which is great. Thanks for making the change! ------------------------------------------------------------------------ [2008-02-16 11:46:16] [email protected] Please try using this CVS snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.3-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.3-win32-installer-latest.msi ------------------------------------------------------------------------ [2008-01-31 17:06:05] [email protected] Assign to extension maintainer ------------------------------------------------------------------------ [2008-01-31 15:04:31] [email protected] Description: ------------ When mb_ereg is passed certain data types as the $pattern argument it will return int(1), i.e. a successful match, when in fact it has not matched. This is shown by setting the $regs argument and looking at the returned array which only contains one element which is bool(false). Reproduce code: --------------- <?php $unset_var = 10; unset ($unset_var); $inputs = array(NULL, null, false, FALSE, "", '', @$undefined_var, @$unset_var); $iterator = 1; foreach($inputs as $input) { if(@is_array($mb_regs)){ $mb_regs = ''; } echo "\n-- Iteration $iterator --\n"; echo "Without \$regs arg:\n"; var_dump( mb_ereg($input, 'hello, world') ); echo "With \$regs arg:\n"; var_dump(mb_ereg($input, 'hello, world', $mb_regs)); var_dump($mb_regs); $iterator++; }; ?> Expected result: ---------------- http://pastebin.com/f5f5c20ff Actual result: -------------- http://pastebin.com/f3f966bd0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43994&edit=1
