Jump to content

what is the usage of &$ ?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
yonghan

yonghan

    Learning Programmer

  • Members
  • PipPipPip
  • 99 posts
Hi all,i found out a code like this


while ($column = $meta->fetch_field())

{

$bindVarArray[] = &$results[$column->name];

}


I don't know what is the usage of & in front of $results for..Thanks a lot...

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You are assigning that array value by reference.

PHP: Spotting References - Manual

#3
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
This is very useful if you are passing large arrays. If you do not pass the array by reference, you are creating another copy of the array in memory.

#4
yonghan

yonghan

    Learning Programmer

  • Members
  • PipPipPip
  • 99 posts
Ok guys...Thanks a lot..