You are here: Re: if $a =& $b is assignment by reference, why don't you need to dereference it? « PHP Programming Language « IT news, forums, messages
Re: if $a =& $b is assignment by reference, why don't you need to dereference it?

Posted by Lars Eighner on 09/28/07 06:59

In our last episode, <1190961700.418756.41530@50g2000hsm.googlegroups.com>,
the lovely and talented Summercool broadcast on comp.lang.php:

> so many places, including the book PHP in a Nutshell, p. 80, it says:

> $a =& $b # set $a to reference $b

> if $a reference $b, then while you can say $b =1, you can't really
> say $a = 1. you need to say *($a) = 1 as in C or C++. Referencing
> must be coupled with dereferencing, and PHP is not doing the
> dereferencing, so why is it call referencing in the first place?
> (don't tell me PHP automatically dereference... as it will be really
> weird).

> and i think in the PHP group, people say "reference" to mean "alias".

That is exactly what the manual says in Chapter 21. References Explained.
Instead of guessing, why not RTFM?


--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 480 days to go.
What do you do when you're debranded?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация