|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8129 ereg returns incorrect results
Submitted: 2000-12-05 18:15 UTC Modified: 2001-01-28 18:35 UTC
From: scion at webrelay dot net Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.0.3pl1 OS: Solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: scion at webrelay dot net
New email:
PHP Version: OS:


 [2000-12-05 18:15 UTC] scion at webrelay dot net

$str[] = "Makefile";
$str[] = "makefile";
$str[] = "..";
$str[] = "X-picturev";

$regexp = "^[a-z]";

while ( list( $key, $e) = each($str) ){

        if( ereg( $e, $regexp))
                echo "$e is lower<br>";
                echo "$e is UPPER<br>";

confugured --regex=pcre  will illustrate the 
bug and show phpinfo();

Also php4.0pl1 with OpenBSD with -regex=php will behave similarly.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-05 18:22 UTC]
The same code works as expected for me - and I have used similar code on oBSD.

Please doublecheck your code. Perhaps the regex is actually '[^a-z]'?
 [2001-01-08 18:47 UTC]
Is this bug still present in php-4.0.4?
 [2001-01-28 18:35 UTC]
the script is buggy: 

ereg($e, $regexp) should be ereg($regexp, $e)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC