Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36489 invoked from network); 1 Nov 2009 21:41:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2009 21:41:26 -0000 X-Host-Fingerprint: 86.137.226.219 host86-137-226-219.range86-137.btcentralplus.com Received: from [86.137.226.219] ([86.137.226.219:19847] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/23-17998-6800EEA4 for ; Sun, 01 Nov 2009 16:41:26 -0500 Message-ID: To: internals@lists.php.net Date: Sun, 01 Nov 2009 21:41:18 +0000 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 References: <61.F1.17998.729FDEA4@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 86.137.226.219 Subject: Re: [PHP-DEV] Seg fault when using active_symbol_table called from userspace function. From: markskilbeck@gmail.com (Mark Skilbeck) Scott MacVicar wrote: > On 1 Nov 2009, at 21:09, Mark Skilbeck wrote: > >> [snip] > > There is no symbol table as there are no variables. You should check if > it's NULL before using zend_hash_exists. > > Scott Hi, Scott. I'm having trouble - I added the check to see if the symbol table i available, yet it returns false even if I have added variables within the function: [code] PHP_FUNCTION(sample_var_a_exists) { if (!EG(active_symbol_table) || !zend_hash_exists(EG(active_symbol_table), "a", sizeof("a"))) { RETURN_BOOL(0); } RETURN_BOOL(1); } [/code] [code] $a = ''; var_dump(sample_var_a_exists()); function x() { $a = ''; // Add a symbol to the hash table. var_dump(sample_var_a_exists()); // Shows bool(false) } x(); [/code]