RE: [PHP-DEV] RE: Another Interesting Reference Issue

From: Date: Fri, 27 May 2005 14:32:55 +0000
Subject: RE: [PHP-DEV] RE: Another Interesting Reference Issue
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-16303@lists.php.net to get a copy of this message
We need to increment refcount then put for stack, because we can lose zval. When we pass temporary vallue to function we haven't zval on caller side. But function may ignore this parameter. So it live only on stack and destroied on exit from function. Look into example: <?php function foo($a) {} $a=1; foo($a,$a+1); ?> Thanks. Dmitry. > -----Original Message----- > From: Derick Rethans [mailto:derick@php.net] > Sent: Friday, May 27, 2005 5:12 PM > To: Dmitry Stogov > Cc: Marcus Brg; 'Andi Gutmans'; 'PHP Developers Mailing List' > Subject: [PHP-DEV] RE: Another Interesting Reference Issue > > > On Fri, 27 May 2005, Dmitry Stogov wrote: > > > One for global $tree. > > > > One for stack. > > > > One for local $node. > > > > = 3 > > > > What is wrong? > > I didn't say it was wrong :) I was wondering *why* it was three. I > didn't know we kept a reference for it being on the stack. Do you > perhaps want to divulge what the reason for this is? > > thanks, > Derick > > -- > Derick Rethans > http://derickrethans.nl | > http://ez.no | http://xdebug.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#16303) next »