note 55979 deleted from ref.classobj by jome
| From: | jome@php.net | Date: | Sun, 25 Sep 2005 11:39:09 +0000 |
| Subject: | note 55979 deleted from ref.classobj by jome | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-95751@lists.php.net to get a copy of this message | ||
Note Submitter: akb at akb dot com dot au
----
Re: Note by: ia [AT] zoznam [DOT] sk on 03-Aug-2005 03:55
There should only be one dollar sign when instantiating an object with a class of a string value of
a variable.
<?php
...
...
// and then call constructor like this:
$dbName = "MySQL";
$db = new $dbName ( ... );
// ... which creates an object of class MySQL
?>
Also note, this is a PHP5 only feature.