Re: [PHP4BETA] A small question
| From: | Andrey Zmievski | Date: | Wed, 01 Sep 1999 13:19:35 +0000 |
| Subject: | Re: [PHP4BETA] A small question | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3964@lists.php.net to get a copy of this message | ||
Joey wrote:
> I was trying something out, and ran into something
> that seemed odd...
>
> I wanted to know what would happen if I:
>
> <?
> $a = array(1,2,3,4,5,6,7,8);
>
> $foo = &$a[3];
>
> $next = $foo++;
>
> echo $next . "\n";
> ?>
>
>
> Hoping that maybe $a[4] would get into $next...
No, $foo is not a pointer - it is a reference to $a[3] which means that both
$foo and $a[3] get the value of 5 after $foo++, and $next is 4.
> Here's what I got:
>
> 4
> -: Freeing 0x001A50E8 (39 bytes), allocated in zend_hash.c on line
> 175<br>
> -: Freeing 0x001A4E48 (4 bytes), allocated in zend_hash.c on line 391<br>
> -: Freeing 0x001A4DF0 (35 bytes), allocated in zend_hash.c on line
> 380<br>
I'm not getting these leaks. Are you using 4.0 beta 2?
-Andrey
* Only 19,999 lines of C++ to my next ski trip... *