php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1180 ereg behaving unexpectedly
Submitted: 1999-02-24 15:36 UTC Modified: 1999-05-11 08:15 UTC
From: david at persimmon dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Digital Unix 4.0d
Private report: No CVE-ID: None
 [1999-02-24 15:36 UTC] david at persimmon dot com
The "ereg" function seems to be behaving oddly.  This script:

<?php
$testvar = 'abcdefghijklmnopqrstuvwxyzabcd';
if (ereg($testvar,$testvar)) {
        print "A match!";
} else {
        print "No match???";
}
?>

produces "A match!" as you would expect.  But if you add a single character to $testvar (say, an "e" at the end of the string), and rerun it, PHP will return "No match???"

The limit on my machine for strings passed to ereg seems to be 30 characters - any more than that and ereg always returns "false".  Is that the way it's supposed to be, or is this a bug? (or a strange occurance on my machine only?)

PHP was compiled under Digital Unix 4.0d using gcc v2.8.1 and compiled with mSQL and MySQL support.  It runs as a standalone CGI.

---------------
UPDATE: 2/24/99
The problem was fixed when I recompiled with --use-system-regex.  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-11 08:15 UTC] sas at cvs dot php dot net
Submitter forgot to close the report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 06:01:31 2024 UTC