Re: Why the ampersand?
| From: | Justin Patrin | Date: | Mon, 16 Apr 2007 15:36:21 +0000 |
| Subject: | Re: Why the ampersand? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27064@lists.php.net to get a copy of this message | ||
On 4/16/07, Alex Grasman <alex.grasman@gmail.com> wrote:
Hello people, 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).Which notices? IIRC PHP5 supports them....perhaps they've put it into E_STRICT, though, I havent' been following it. These are there to tell PHP5 to do return and assign by reference. They can't be removed from the original packages because the original packages still support PHP4, which needs them in order to function properly. They won't be removed until the packages switch to PHP5. If you are using PHP4 packages in PHP5 then you should make your error reporting non-strict as you will see many notices. error_reporting = E_ALL & ~E_STRICT -- Justin Patrin