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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sheffield_e at mediasoft dot net
New email:
PHP Version: OS:

 

 [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: Tue Jul 23 21:01:28 2024 UTC