--- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> But dereferncing like this
> $foo->bar()->fubar
its not 
$foo->bar()->fubar
its
$foo->bar->fubar

4.1.2 can't derefrence objects from functions 
that IS a feature of Z2.. but my example isn't
derefrencing something from a function just
a member of an object.

 - Brad

> is feature of Z2 or not?
> Till today I didn't know that my 4.1.1(or 2) not sure can do this kind of
> dereferencing.
> 
> Andrey
> 
> ----- Original Message ----- 
> From: "brad lafountain" <[EMAIL PROTECTED]>
> To: "Andrey Hristov" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, April 11, 2002 8:58 PM
> Subject: Re: [PHP-DEV] object refrences (POSSIBLE MAJOR BUG)
> 
> 
> > 
> > --- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> > > Not sure but I think that the answer is maybe on pages 8 and 9 here
> > > http://www.zend.com/engine2/ZendEngine-2.0.pdf
> > > What do you think?
> > 
> >  No thats engine 2.. this is enginge one... 
> > engine 2 says objects are treated as refrences..
> > engine one copys all objects..
> > 
> > besides..
> > 
> > $foo = new foo();
> > $foo->bar->set_tmp("outside foo");
> > $foo->variable = "foo";
> > 
> > $foo2 = $foo;
> > $foo2->bar->set_tmp("this is a bug");
> > $foo2->variable = "foo2"
> >  
> > var_dump($foo2);
> > var_dump($foo);
> > 
> > variable will be 'foo' for foo and 'foo2' for foo2
> > which it should be..
> > 
> >  - Brad
> > 
> > > 
> > > Andrey
> > > ----- Original Message ----- 
> > > From: "brad lafountain" <[EMAIL PROTECTED]>
> > > To: "Andrey Hristov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > > Sent: Thursday, April 11, 2002 7:58 PM
> > > Subject: Re: [PHP-DEV] object refrences (POSSIBLE MAJOR BUG)
> > > 
> > > 
> > > > 
> > > > --- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> > > > > I receive this:
> > > > > object(foo)(1) {
> > > > >   ["bar"]=>
> > > > >   &object(bar)(1) {
> > > > >     ["tmp"]=>
> > > > >     string(23) "why does this add a ref"
> > > > >   }
> > > > > }
> > > > > 
> > > > > As far as I can see, there is an reference.
> > > > 
> > > > 
> > > > this is why im conserned.....
> > > > 
> > > > <?
> > > > class foo
> > > > {
> > > >         var $bar;
> > > >         function foo()
> > > >         {
> > > >                 $this->bar = new bar("inside foo");
> > > >         }
> > > > }
> > > > 
> > > > class bar
> > > > {
> > > >         var $tmp;
> > > > 
> > > >         function bar($tmp)
> > > >         {
> > > >                 $this->tmp = $tmp;
> > > >         }
> > > > 
> > > >         function set_tmp($tmp)
> > > >         {
> > > >                 $this->tmp = $tmp;
> > > >         }
> > > > }
> > > > 
> > > > $foo = new foo();
> > > > $foo->bar->set_tmp("outside foo");
> > > > 
> > > > $foo2 = $foo;
> > > > $foo2->bar->set_tmp("this is a bug");
> > > > 
> > > > var_dump($foo2);
> > > > var_dump($foo);
> > > > ?>
> > > > 
> > > >  i really think this is a pretty big bug.... and if it was coded to act
> > > this
> > > > way.. then WHY???
> > > > 
> > > >  - Brad
> > > > > 
> > > > > Andrey
> > > > > ----- Original Message ----- 
> > > > > From: "brad lafountain" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Thursday, April 11, 2002 7:37 PM
> > > > > Subject: [PHP-DEV] object refrences (POSSIBLE MAJOR BUG)
> > > > > 
> > > > > 
> > > > > > After a full day of looking into a bug on a script i have i found
> this
> > > > > problem.
> > > > > > 
> > > > > > basically if you invoke a method from a member object it adds a ref
> > > instead
> > > > > of
> > > > > > keeping it 'non ref'. 
> > > > > > 
> > > > > >  Is this by design or is it a bug.
> > > > > > 
> > > > > > <?
> > > > > > class foo
> > > > > > {
> > > > > >         var $bar;
> > > > > >         function foo()
> > > > > >         {
> > > > > >                 $this->bar = new bar("inside foo");
> > > > > >                 $this->bar->set_tmp("why does this add a ref");
> > > > > > 
> > > > > >                 /*
> > > > > >                 // this works fine
> > > > > >                 $bar = new bar("inside foo");
> > > > > >                 $bar->set_tmp("no ref");
> > > > > >                 $this->bar = $bar;
> > > > > >                 */
> > > > > > 
> > > > > >                 /*
> > > > > >                 file://this doesn't work
> > > > > >                 $bar = new bar("inside foo");
> > > > > >                 $this->bar = $bar;
> > > > > >                 $this->bar->set_tmp("why does this add a ref");
> > > > > >                 */
> > > > > >         }
> > > > > > }
> > > > > > 
> > > > > > class bar
> > > > > > {
> > > > > >         var $tmp;
> > > > > > 
> > > > > >         function bar($tmp)
> > > > > >         {
> > > > > >                 $this->tmp = $tmp;
> > > > > >         }
> > > > > > 
> > > > > >         function set_tmp($tmp)
> > > > > >         {
> > > > > >                 $this->tmp = $tmp;
> > > > > >         }
> > > > > > }
> > > > > > 
> > > > > > var_dump(new foo());
> > > > > > 
> > > > > > ?>
> > > > > > 
> > > > > >  - Brad
> > > > > > 
> > > > > > 
> > > > > > __________________________________________________
> > > > > > Do You Yahoo!?
> > > > > > Yahoo! Tax Center - online filing with TurboTax
> > > > > > http://taxes.yahoo.com/
> > > > > > 
> > > > > > -- 
> > > > > > PHP Development Mailing List <http://www.php.net/>
> > > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > > > 
> > > > > > 
> > > > > 
> > > > > 
> > > > > -- 
> > > > > PHP Development Mailing List <http://www.php.net/>
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > > 
> > > > 
> > > > 
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Yahoo! Tax Center - online filing with TurboTax
> > > > http://taxes.yahoo.com/
> > > > 
> > > > -- 
> > > > PHP Development Mailing List <http://www.php.net/>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to