php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24821 regex parsing errors (info please)
Submitted: 2003-07-26 14:41 UTC Modified: 2003-07-26 23:20 UTC
From: yan at fitterer dot org Assigned:
Status: Not a bug Package: Regexps related
PHP Version: Irrelevant OS: Linux RH 7.3
Private report: No CVE-ID: None
 [2003-07-26 14:41 UTC] yan at fitterer dot org
Description:
------------
Error in matching literal { inside regexp

Sorry I'm not putting a version on this. See below.

Reproduce code:
---------------
<?php
if (ereg("^\{$","{")) echo "^\{$ matched {";
if (ereg("^\{\}$","{}")) echo "^\{\}$ matched {}";
?>


Expected result:
----------------
This does work on 4.2.3 (and later I expect), but doesn't on 4.1.2. 

I'm trying to get it fixed by Redhat, bcse they still ship 4.1.2 with RH 7.3.

Could somebody tell me when it was fixed (which version), and if there is an associated bug no? I searched, but to no avail. I suppose it was fixed as part of something else...

Thanks
Yan

Actual result:
--------------
Warning: Unmatched \{ in /usr/local/typo3/museum/phptest.php on line 2

Warning: Invalid content of \{\} in /usr/local/typo3/museum/phptest.php on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-26 19:28 UTC] cunha17 at uol dot com dot br
I can tell you that the latest PHP5-dev has it working.

Cristiano Duarte
 [2003-07-26 23:20 UTC] pollita@php.net
Copy/Pasting that exact script using PHP-4.1.2 on Linux, I am unable to reproduce the behavior you describe.

Are you using php.ini-dist? php.ini-recommended?  A variant thereof?

Is it compiled from source or an RPM installation?

I realize you won't have the answer to all of these questions as its your hosting provide who set everything up.  

But... given that... maybe it's time to find one who is a little more up-to-date?  I know, easier said than done.

In any event, I'm marking this as 'Bogus' only because the behavior is working correctly as of the current version.  I suggest asking on the php.generals (general@lists.php.net) list if others have experienced similar issues with that version and post other examples if you can find something which reliably reproduces.  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC