Re: Why the ampersand?

From: Date: Mon, 16 Apr 2007 15:44:01 +0000
Subject: Re: Why the ampersand?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-27065@lists.php.net to get a copy of this message
Alex Grasman wrote:
I have a basic question about PEAR Packages. Why do all the objects have ampersands? They usually cause notices when a function has been written like function &functionname () And when assigning a variabele &= is used instead of =. I know that there was something with PHP4 and objects needing ampersands. But since they cause notices and look ugly, I tend to remove them (I use PHP 5.2.1). Is this OK to do?
I think you just answered your own question didn't you? :) In PHP 5 you shouldn't need ampersands. Have a read of this: http://mjtsai.com/blog/2004/07/15/php-5-object-references/ -- David Sanders shangxiao

« previous php.pear.general (#27065) next »