&new vs. new
| From: | �mer Rauf Atay | Date: | Wed, 17 Dec 2003 20:58:13 +0000 |
| Subject: | &new vs. new | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-4304@lists.php.net to get a copy of this message | ||
this code gives the following error:
---------------------------------------------------------
<?
if(!class_exists("gtk"))
{
if (strtoupper(substr(PHP_OS, 0,3) == "WIN"))
dl("php_gtk.dll");
else
dl("php_gtk.so");
}
$helpWindow = &new HelpWindow();
gtk::main();
class HelpWindow extends GtkWindow
{
var $hPaned;
function HelpWindow()
{
parent::GtkWindow();
$this->set_title("Help");
$this->connect("destroy", array(&$this, "quit"));
$this->hPaned = &new GtkHPaned(); //*********************** line 22
$this->add($this->hPaned);
$this->show_all();
}
function quit()
{
gtk::main_quit();
}
}
?>
---------------------------------------------------------
Fatal error: Cannot create references to/from string offsets nor overloaded
objects in ....\help.ght on line 22
---------------------------------------------------------
When i change the "&new GtkHPaned()" to "new GtkHPaned()" the problem is
solved.
What is the actual difference between &new and new, and why is that error
occurs?