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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mlemos at acm dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 05:01:33 2025 UTC