|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19691 mb_ereg_match is broken, does not return FALSE
Submitted: 2002-10-01 09:25 UTC Modified: 2002-10-01 13:32 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jc at mega-bucks dot co dot jp Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 4.2.3 OS: Red Hat Linux 7.2
Private report: No CVE-ID: None
 [2002-10-01 09:25 UTC] jc at mega-bucks dot co dot jp
Seems like mbstring function is borked in 4.2.3 :) 

mb_ereg_match doesn't seem to be returning a proper FALSE value when passed to a conditional statement.

BUT, the return value is an empty string which *should* evaluate to flase no?

Following output and code illustrate:


RETURN was ** 
a is FALSE


if (mb_ereg_match("A", "X")) {
 echo "MATCHES <BR>";
else {
  "echo NO MATCH <BR>"; 
$a = mb_ereg_match("A", "X");
echo "RETURN was *$a*<BR>";
if ($a) {
else {
 echo "a is FALSE<BR>";}


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 10:28 UTC]
Just a comment.

When you submit bug. Submit with "complete" script that is possible to copy & page, then execute.

It will speed up bug fix.
 [2002-10-01 10:29 UTC]
 [2002-10-01 13:02 UTC]
I think you may have meant with the line
  "echo NO MATCH <BR>"
  echo "NO MATCH<BR>";

But I can not reproduce the problem yet.
Can you give us a more accurate script to confirm the bug?

Hint: var_dump( mb_ereg_match( ... ) ); will do it easier.
 [2002-10-01 13:29 UTC] jc at mega-bucks dot co dot jp
Sorry! Bogus bug ...

I had quotes around my whole echo statement as you pointed out .... really sorry.
 [2002-10-01 13:32 UTC]
Setting to bogus then
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 27 20:01:30 2024 UTC