RE: [PHP] Variables don't pass... *sniff*
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | RE: [PHP] Variables don't pass... *sniff* | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149403@lists.php.net to get a copy of this message | ||
On Thu, 29 May 2003, Wendell Brown wrote:
> On Thu, 29 May 2003 10:33:16 +0100, Ford, Mike [LSS]
> wrote:
>
> >Well, how about references, then? (And me, personally, I'd use isset()
> >rather than is_array().)
> >
> > if (isset($_POST)):
> > $POST = &$_POST;
> > else:
> > $POST = &$HTTP_POST_VARS;
> > endif;
>
> I was told that PHP didn't do pointers - just goes to show that you
> can't believe everything your told. Thanks for the POINTER. ;)
It isn't a pointer. It is a reference which you should think of as a
symbol table alias. A pointer, at least by my definition, is a memory
address. In PHP it isn't a memory address, just another entry in the
symbol table that references the same data as another symbol.
-Rasmus