Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23700 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54605 invoked by uid 1010); 26 May 2006 20:45:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54590 invoked from network); 26 May 2006 20:45:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2006 20:45:28 -0000 X-PHP-List-Original-Sender: dante@vocalspace.com X-Host-Fingerprint: 69.56.193.72 fox02.stravio.com Linux 2.5 (sometimes 2.4) (4) Received: from ([69.56.193.72:46872] helo=fox02.stravio.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6B/A0-17316-8E867744 for ; Fri, 26 May 2006 16:45:28 -0400 Received: from [127.0.0.1] (unknown [66.243.31.162]) by fox02.stravio.com (Postfix) with ESMTP id 8BC6926C2BC for ; Fri, 26 May 2006 15:45:24 -0500 (CDT) Message-ID: <447768DF.1000203@vocalspace.com> Date: Fri, 26 May 2006 15:45:19 -0500 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: PHPdev Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: extension can not receive unset values without E_NOTICE or reference creation From: dante@vocalspace.com ("D. Dante Lorenso") All, Back on the topic of trying to write a 'filled' function in an extension, I have run into trouble. I have declared a function as follows: ---------- 8< -------------------- 8< ---------- static ZEND_BEGIN_ARG_INFO(all_args_prefer_ref, ZEND_SEND_PREFER_REF) ZEND_END_ARG_INFO() zend_function_entry shorthand_functions[] = { PHP_FE(filled, all_args_prefer_ref) {NULL, NULL, NULL} /* Must be the last line in shorthand_functions[] */ }; PHP_FUNCTION(filled) { RETURN_TRUE; } ---------- 8< -------------------- 8< ---------- Then, in PHP I try the following test code: ---------- 8< -------------------- 8< ---------- testing); print "\n"; print_r($x); print_r($y); ?> ---------- 8< -------------------- 8< ---------- Unfortunately, $x now contains a 'pig' key and the non-existent $y has been transformed into an object: ---------- 8< -------------------- 8< ---------- Array ( [dog] => spot [cat] => moriss ) 1 Array ( [dog] => spot [cat] => moriss [pig] => ) stdClass Object ( [testing] => ) ---------- 8< -------------------- 8< ---------- Is there a way to define the parameters which an extension's function will accept to be optionally set? The prefer-by-ref I am using is making the var exist even when I don't want it to. Dante