php.net |  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
Votes:1
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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jc at mega-bucks dot co dot jp
New email:
PHP Version: OS:

 

 [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:

OUTPUT:

RETURN was ** 
a is FALSE

CODE:

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>";}
exit;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 10:28 UTC] yohgaki@php.net
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] yohgaki@php.net
s/page/paste/
 [2002-10-01 13:02 UTC] moriyoshi@php.net
I think you may have meant with the line
  "echo NO MATCH <BR>"
for
  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] derick@php.net
Setting to bogus then
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC