Re: Wikimedia - php4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vizion wrote:
> 	function &setupTemplate( $classname, $repository=false, $cache_dir=false ) {
> 		return new $classname();
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 	}

Is that really all they have in that function?  It seems rather useless
to me.  Why call a function just to instantiate a class like that?

Regardless, here it is trying to create a reference to a temp var.
Basically PHP will ignore the reference here, and it should work, but
you are getting a notice because the reference is being discarded.
Either drop the reference from the function definition or do:

 $class =& new $classname();
 return $class;

And for PHP5 you can just drop all references related to objects and it
will do the right thing.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux