#23643 [Opn->Bgs]: Parse error when instancing object from a class property

From: Date: Thu, 15 May 2003 17:20:59 +0000
Subject: #23643 [Opn->Bgs]: Parse error when instancing object from a class property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39709@lists.php.net to get a copy of this message
 ID:               23643
 Updated by:       helly@php.net
 Reported By:      php at schlueters dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: Linux 2.4.20
 PHP Version:      5CVS-2003-05-15 (dev)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

$name will be used as the class name to be instanciated.


Previous Comments:
------------------------------------------------------------------------

[2003-05-15 10:04:57] php at schlueters dot de

I'm running this script using different php5 snapshots and current
php5-CVS-Versions:
<?php
class myclass {
  var $name = 'myclass';
}

$object1 = new myclass();

$object2 = new $object1->name(); // Parse error
?>

Gives a parse error at the marked line but

<?php
$name = $object1->name;
$object2 = new $name();
?>

works.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=23643&edit=1



Thread (3 messages)

« previous php.bugs (#39709) next »