= & operator in PHP

Example:

$ this-> sql = & new GuestBook_SQL;

What is he doing?

+3
source share
3 answers

This statement assigns a link. Here is an explanation from the PHP manual

+9
source

It assigns by reference instead of value.

+2
source

And it is old. You no longer need this syntax in PHP5. It still assigns new objects by reference.

+1
source

Source: https://habr.com/ru/post/1746157/


All Articles