Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19754 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59994 invoked by uid 1010); 27 Oct 2005 07:05:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59974 invoked from network); 27 Oct 2005 07:05:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2005 07:05:49 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:54803] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C3/9D-22886-94C70634 for ; Thu, 27 Oct 2005 03:05:46 -0400 Received: from [192.168.1.3] (dslb-084-063-047-105.pools.arcor-ip.net [84.63.47.105]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 07E7D35C393; Thu, 27 Oct 2005 09:08:48 +0200 (CEST) Date: Thu, 27 Oct 2005 09:05:46 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <648260031.20051027090546@marcus-boerger.de> To: Bob Silva Cc: internals@lists.php.net In-Reply-To: <000101c5dac2$d529e390$5d54edc6@jake> References: <200510240730.j9O7UCS0027321@ez1.php.net> <000101c5dac2$d529e390$5d54edc6@jake> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Accept null type hint in C From: helly@php.net (Marcus Boerger) Hello Bob, Thursday, October 27, 2005, 8:51:18 AM, you wrote: > Hi, > Since NULL typehints are allowed in userland, how would I go about it in C? > I have ZEND_ARG_OBJ_INFO(0, obj, ZObject, 1) which has allow null set on. > Then in the method: > if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objA, > pow_ce_ZObject) == FAILURE) { Use "|!O" or "|!o" instead. '!' allows NULL and sets the return value in c-land to NULL. marcus > If I pass NULL, it fails on the grounds that it isn't a ZObject. > Also, > Could someone explain the purpose of the zend_parse_method_parameters > function as opposed to using the zend_parse_parameters? > Thanks > Bob Silva Best regards, Marcus