Quickie (I guess...) - What does =& do?

This is a discussion on Quickie (I guess...) - What does =& do? within the PHP Language forums, part of the PHP Programming Forums category; Trying to learn php, and came across =& as in $form =& $HTTP_POST_VARS; I can't find any reference to =&...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-27-2003
Glutinous
 
Posts: n/a
Default Quickie (I guess...) - What does =& do?

Trying to learn php, and came across

=&

as in

$form =& $HTTP_POST_VARS;

I can't find any reference to =&, with no success in searching for a
definition (as though it's _so_ obvious it doesn't need explanation).

Thanks!

Reply With Quote
  #2 (permalink)  
Old 10-27-2003
Kevin Thorpe
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

Glutinous wrote:
> Trying to learn php, and came across
>
> =&
>
> as in
>
> $form =& $HTTP_POST_VARS;
>
> I can't find any reference to =&, with no success in searching for a
> definition (as though it's _so_ obvious it doesn't need explanation).
>
> Thanks!
>

It sets $form to be another refernce to $HTTP_POST_VARS. Thus changing
the contents of one affects the other. Without the ampersand $form
becomes a copy of $HTTP_POST_VARS.

Reply With Quote
  #3 (permalink)  
Old 10-27-2003
k-caj
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

Glutinous wrote:
> Trying to learn php, and came across
> I can't find any reference to =&, with no success in searching for a
> definition (as though it's _so_ obvious it doesn't need explanation).


it's a reference

same as

$form = &$HTTP_POST_VARS;

--
--- --- --- --- --- --- ---
jack@croatiabiz.com


Reply With Quote
  #4 (permalink)  
Old 10-27-2003
Glutinous
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

On Mon, 27 Oct 2003 10:06:55 +0000, Kevin Thorpe <kevin@pricetrak.com>
wrote:

>Glutinous wrote:
>> Trying to learn php, and came across
>>
>> =&
>>
>> as in
>>
>> $form =& $HTTP_POST_VARS;
>>
>> I can't find any reference to =&, with no success in searching for a
>> definition (as though it's _so_ obvious it doesn't need explanation).
>>
>> Thanks!
>>

>It sets $form to be another refernce to $HTTP_POST_VARS. Thus changing
>the contents of one affects the other. Without the ampersand $form
>becomes a copy of $HTTP_POST_VARS.


Thank you so much! Very helpful...

So whatever happens to the one, happens to the other also (in a manner
of speaking). As in ($input and $output being arbitary names):

<?php

$input =& $output;

echo '$input and $output are unassigned.<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br><br>";

$input = "Dogs";

echo '$input is now set to "Dogs".<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br><br>";

$output = "Cats";

echo '$output is now set to "Cats".<br>This is $input:'."
"."$input<br>";
echo 'This is $output:'." "."$output<br>";

?>

?

Reply With Quote
  #5 (permalink)  
Old 10-27-2003
Glutinous
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

On Mon, 27 Oct 2003 11:09:37 +0100, "k-caj" <jack@iskrica.com> wrote:

>Glutinous wrote:
>> Trying to learn php, and came across
>> I can't find any reference to =&, with no success in searching for a
>> definition (as though it's _so_ obvious it doesn't need explanation).

>
>it's a reference
>
>same as
>
>$form = &$HTTP_POST_VARS;


Thank you. Your 'same as &$' enabled me to look up more info. I
appreciate your help!

Reply With Quote
  #6 (permalink)  
Old 10-27-2003
Shawn Wilson
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

Glutinous wrote:
>
> Thank you. Your 'same as &$' enabled me to look up more info. I
> appreciate your help!


Slightly off topic, but I've had trouble in the past looking up non-text
functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
them, even when quoted. Does anyone know a good method/place to look these up?

Thanks,
Shawn

--
Shawn Wilson
shawn@glassgiant.com
http://www.glassgiant.com
Reply With Quote
  #7 (permalink)  
Old 10-27-2003
Glutinous
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

On Mon, 27 Oct 2003 10:39:48 -0400, Shawn Wilson
<shawn@glassgiant.com> wrote:

>Glutinous wrote:
>>
>> Thank you. Your 'same as &$' enabled me to look up more info. I
>> appreciate your help!

>
>Slightly off topic, but I've had trouble in the past looking up non-text
>functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
>them, even when quoted. Does anyone know a good method/place to look these up?
>
>Thanks,
>Shawn


Well, there's here... :-)

I even found searching the pdf-format php manual wasn't much help with
my query, and I didn't have any success with searching for lists of
functions and operators...

Reply With Quote
  #8 (permalink)  
Old 10-27-2003
John Dunlop
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

Shawn Wilson wrote:

> Slightly off topic, but I've had trouble in the past looking up non-text
> functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
> them, even when quoted.


news:d6a0a71c.0201210351.671b1a4c@posting.google.c om

Mostly, nonalphanumerics aren't taken literally. But Google at
least treats ampersands literally. The hash character is an odd
one though.

--
Jock
Reply With Quote
  #9 (permalink)  
Old 10-28-2003
Markus Weber
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

"John Dunlop" <john+usenet@johndunlop.info> schrieb im Newsbeitrag
news:MPG.1a0789008961c1a3989793@news.freeserve.net ...
> Shawn Wilson wrote:
>
> > Slightly off topic, but I've had trouble in the past looking up non-text
> > functions and operators (<<<, &, @, etc.). It seems Google likes to
> > ignore
> > them, even when quoted.

>
> news:d6a0a71c.0201210351.671b1a4c@posting.google.c om


do you mean this?
http://groups.google.com/groups?hl=e...ing.google.com

Does anybody know a good search engine for strings like 'en/(*)'? Google
will search for 'en *' instead of 'en/(*)'.

>
> Mostly, nonalphanumerics aren't taken literally. But Google at
> least treats ampersands literally. The hash character is an odd
> one though.
>
> --
> Jock


bye,
Markus



Reply With Quote
  #10 (permalink)  
Old 10-28-2003
Shawn Wilson
 
Posts: n/a
Default Re: Quickie (I guess...) - What does =& do?

John Dunlop wrote:
>
> Shawn Wilson wrote:
>
> > Slightly off topic, but I've had trouble in the past looking up non-text
> > functions and operators (<<<, &, @, etc.). It seems Google likes to ignore
> > them, even when quoted.

>
> news:d6a0a71c.0201210351.671b1a4c@posting.google.c om
>
> Mostly, nonalphanumerics aren't taken literally. But Google at
> least treats ampersands literally. The hash character is an odd
> one though.
>
> --
> Jock


Thanks, that'll help in the future.

Shawn
--
Shawn Wilson
shawn@glassgiant.com
http://www.glassgiant.com
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:30 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0