php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3881 Can not create an object specifying another object variable as class name
Submitted: 2000-03-20 03:31 UTC Modified: 2001-02-10 15:37 UTC
From: mlemos at acm dot org Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.15 OS: Linux RH 6.0
Private report: No CVE-ID: None
 [2000-03-20 03:31 UTC] mlemos at acm dot org
If I specify to new an object instance variabe as class name of another
object it gives me the error below.  Try the script below under PHP 3.  PHP
4 does not have this problem.

Fatal error:  Object is not a class in test.php on line 10

<?
class some_class
{
 var $variable="some_class";
};

$object=new some_class;
$variable=$object->variable;
$another_object=new $variable;
$another_object=new $object->variable;

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-20 03:34 UTC] rasmus at cvs dot php dot net
Fixed in PHP 4 - probably won't be fixed in 3
 [2001-02-10 15:37 UTC] jimw@php.net
won't be fixed in php3.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC