Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://old.master.cmc.msu.ru/php/language.references.return.html
Дата изменения: Sun Feb 3 22:33:41 2002 Дата индексирования: Tue Oct 2 12:01:44 2012 Кодировка: |
Returning by-reference is useful when you want to use a function to find which variable a reference should be bound to. When returning references, use this syntax:
In this example, the property of the object returned by the find_var function would be set, not the copy, as it would be without using reference syntax.Note: Unlike parameter passing, here you have to use & in both places - to indicate that you return by-reference, not a copy as usual, and to indicate that reference binding, rather than usual assignment, should be done for $foo.