Re: [PHP] Object References Problem

From: Gareth Williams (gareth_at_venditor.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 08:27:09 +0100
To: php-general@lists.php.net


Boyan, Michael and Mike,

Thanks for the help, I now understand what is going on, and you guys
have saved me from pulling my hair out in frustration.

I'm more used to doing OOP in Delphi and Perl, and the peculiarities of
PHP are somewhat confusing.

Once again, thanks for the help.

On Friday, Oct 31, 2003, at 03:03 Europe/Amsterdam, Mike Migurski wrote:

>> 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
>



Relevant Pages

  • Re: [PHP] Object References Problem
    ... >I don't pretend to fully understand PHP references, ... >mysterious ways that they work in regards to PHP objects, ... language engine is optimized to perform well under those circumstances. ... optimization, but it's a royal pain when you need to maintain some degree ...
    (php.general)
  • Re: [PHP] php5 and possible oop features/questions
    ... multiple files (as you must have one file with the class sometimes quite ... its just static, which may proove to be a bit of a problem, since the php ... OOP lacks dynamic patterns - in general it's a step back with what you could ... the existing OOP syntax takes a lot of work, and you cant please everyone. ...
    (php.general)
  • Re: Mixing Oil and Water ?? (PHP with UML & Unit Testing)
    ... the use of UML or OOP does not have to do the size of the sites. ... any database driven project could have its data model ... > for PHP scripting or web-application development? ... Again, like UML, Unit Testing seems ...
    (comp.lang.php)
  • Re: [PHP] Re: OOP Hello World
    ... > PHP seems to be getting more and more object oriented, ... public function respond; ... public function respond(Salutable $receiver, $response) { ... OOP or not. ...
    (php.general)
  • Re: [PHP] Are PHP5 features worth it?
    ... I'm writing a PHP program and I've got a number of concerns. ... what PHP4 can do with OOP. ... using what PHP5 offers where it makes sense, ... Exceptions: I just don't see the big advantage. ...
    (php.general)