Yasuo Ohgaki wrote:

> Derick Rethans wrote:
> 
>> On Thu, 15 Nov 2001, Yasuo Ohgaki wrote:
>>
>>
>>> Hi Derick,
>>>
>>> May I ask question? I've spent a little more time on this. (When I
>>> submit the patch, I spent less than 10 minutes :)
>>>
>>> When unset($arr[]) is called, get_zval_ptr() returns NULL since
>>> znode has IS_UNUSED type.
>>>
>>
>> unset is supposed to work on a variabele. $arr[] is not a variable, so
>> the parser should give a parsing error IMO.
> 
> 
> 
> Nice catch. I didn't think about that. $something != valid var :(
> 

I'm glad Zeev has fixed this in parser level.
I was assuming PHP/Zend is tolerant for these errors.

Look like some more work is needed on this.

Try this script.


<?php

function foo()
{
        echo "foo()";
}

$name = "foo";
unset($$name);

$bar = 'AAA;
$name = "bar";

unset($$name);
?>

I think this is critical bug. There are might other faults that is 
similar to this problem in parser.

--
Yasuo Ohgaki


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to