|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 + 16 = ?
Subscribe to this entry?

 [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 May 30 04:01:31 2024 UTC