Can you explain to me why the following causes a segfault:

[code]
PHP_FUNCTION(sample_var_a_exists)
{
        if (!zend_hash_exists(EG(active_symbol_table), "a", sizeof("a"))) {
                RETURN_BOOL(0);
        }
        RETURN_BOOL(1);
}
[/code]

Note: the segfault only occurs when the sample_var_a_exists function is called from within a userspace function:

[code]
$a = '';
var_dump(sample_var_a_exists()); // bool(true)

function x() {
    var_dump(sample_var_a_exists()); // segmentation fault
}

x();
[/code]

Thanks.

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

Reply via email to