php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #703 Parser Error occurs when on obj with constructor created with eval
Submitted: 1998-08-29 20:54 UTC Modified: 1998-09-01 11:44 UTC
From: sheffield_e at mediasoft dot net Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.3 OS: Linux 2.0.33
Private report: No CVE-ID: None
 [1998-08-29 20:54 UTC] sheffield_e at mediasoft dot net
This bug was discovered using the PHP Base Library with
PHP 3.0.3. Part of this library essentially performs a
call like:

eval('$GLOBALS["auth"]=new Album_Auth;');

The problem is that if Album_Auth has a constructor, then
a Parse Error occurs on the line containing the closing
'}' at the end of the class definition. If there is no
constructor, everything is fine.

A workaround I found was to modify the code so that the
call became:

eval('$GLOBALS["auth"]=$this->makeobject("Album_Auth");');

and I defined a the makeobject function as:

  function makeobject($obj) {
    return new $obj;
  }

This seems to work fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-09-01 11:44 UTC] zeev
This should be fixed.
Can you please update to the latest CVS and see if
the problem persists?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 17:01:28 2024 UTC