[PHP] object references

2004-01-05 Thread Tilman Giese
Hi, I was wondering if any of you could help me out with a problem concerning object references. At first, I thought that it would be a bug (http://bugs.php.net/bug.php?id=26756) but the developers told me that it is not. So here is a short description: If you have two object that reference each

Re: [PHP] Object References Problem

2003-10-31 Thread Gareth Williams
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,

Re: [PHP] Object References Problem

2003-10-30 Thread Mike Migurski
>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. :) >If someone sees that I'm leading Gareth astray here, feel free

Re: [PHP] Object References Problem

2003-10-30 Thread Michael Sims
On Thu, 30 Oct 2003 22:54:49 +0100, you wrote: >Hi there, > >I'm having trouble with passing objects as references. What I want to >do is something like this: [snip code] >The above code give the output: > >instance: >parent: test > >where I want it to give: > >instance: test >parent: test I do

Re: [PHP] Object References Problem

2003-10-30 Thread Boyan Nedkov
Since i see from your code, you are trying to create an object which maintains a list (collection) of instances of another object. Is that correct? Or you are trying to inherit a class from a parent class? Then it's a little bit different story. If this is the case, just tell me and I'll provi

[PHP] Object References Problem

2003-10-30 Thread Gareth Williams
Hi there, I'm having trouble with passing objects as references. What I want to do is something like this: class object_1 { var $my_chld; var $my_array; function object_1() { $this->my_array = array('id' => 0, 'name'=>''); $this->my_chil

Re: [PHP] object references lose local variables

2001-10-03 Thread Steve Strassmann
Hi, I'm the original author. I put my address in the body of the message to avoid spammers. To answer your question, nobody answered my question. However, after messing around, I found a change that did the trick. Coming from an OOP background (lisp, smalltalk, etc.) it sure seems to me that PHP h

[PHP] object references lose local variables

2001-09-26 Thread a
I'd like to ask your help to figure out why PHP objects are stripped of their local variables when you add the objects to an array. Shouldn't these be references, not shallow copies? The code below is a simple org chart. I create three instances, each is added to a global array called orgs[]. Ea