Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6645 invoked by uid 1010); 11 May 2006 22:56:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6630 invoked from network); 11 May 2006 22:56:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2006 22:56:28 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:43084] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id AF/D4-19568-C11C3644 for ; Thu, 11 May 2006 18:56:28 -0400 Received: from baumbart.mbo (dslb-084-063-015-157.pools.arcor-ip.net [84.63.15.157]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 298E235C1DC; Fri, 12 May 2006 00:56:25 +0200 (CEST) Date: Fri, 12 May 2006 00:56:34 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1677896835.20060512005634@marcus-boerger.de> To: "D. Dante Lorenso" Cc: PHPdev In-Reply-To: <4463BF89.9040906@vocalspace.com> References: <4463BF89.9040906@vocalspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] allow extension writers to ignore E_NOTICE warnings about unset variables From: helly@php.net (Marcus Boerger) Hello D., no, the compiler generates code that makes the executor generate the variable and complain prior to performing the call. In a zend extension you could try to hook into that process. marcus Friday, May 12, 2006, 12:49:45 AM, you wrote: > All, > Is there a way to define a function in an extension which would not > require a passed in variable to exist? In other words, can ZE be > modified to allow extensions to not trigger E_NOTICE warnings if an > unset variable is passed to a function which does not care if the var is > set? > I can specify preferences about whether variables are passed by > reference or not using macros like: > * PHP_FE(..., first_arg_force_ref) > * PHP_FE(..., third_arg_force_by_ref_rest) > * PHP_FE(..., first_through_third_args_force_ref) > Which probably boil down somewhere into: > * #define ZEND_SEND_BY_VAL 0 > * #define ZEND_SEND_BY_REF 1 > * #define ZEND_SEND_PREFER_REF 2 > And I notice that if a variable is passed by reference to an extension > function, no E_NOTICE is thrown. Well, can we extend this concept > further to say something like: > * #define ZEND_SEND_WHO_CARES_IF_IT_EXISTS_OR_NOT 4 > *but with a better name, of course* > Then, extension developers can write 'ifsetor', 'coalesce', and 'filled' > as extensions (by themselves) and not need those specific functions > added to the 'PHP core language' per-se. > Dante Best regards, Marcus