>I don't pretend to fully understand PHP references, or the strange and
>mysterious ways that they work in regards to PHP objects, but I can tell
>you how to acheive the results you desire.  Someone else will have to
>explain it. :)

<snip>

>If someone sees that I'm leading Gareth astray here, feel free to jump in
>and correct me...

Your explanation squares with my experience. My understanding from dealing
with some fairly complex OOP interactions is that PHP operators generally
favor passing-by-value to passing-by-reference, and the underlying
language engine is optimized to perform well under those circumstances.

Which is great, if you're new to programming, have never used Java or C,
and are tossing arrays around and don't want to be bothered with premature
optimization, but it's a royal pain when you need to maintain some degree
of referential integrity. I frequently find myself using '&' all over the
place to cut down on accidental returns-by-value.

I have not yet had a chance to play with PHP5's beta versions, but its
strong focus on OOP makes me wonder, what kind of language changes (if
any) were required to help ease this situation?

-mike.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to