Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67056 invoked from network); 30 Nov 2009 11:19:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2009 11:19:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=WIMARTIN@uk.ibm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=WIMARTIN@uk.ibm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain uk.ibm.com designates 194.196.100.166 as permitted sender) X-PHP-List-Original-Sender: WIMARTIN@uk.ibm.com X-Host-Fingerprint: 194.196.100.166 mtagate6.uk.ibm.com Linux 2.5 (sometimes 2.4) (4) Received: from [194.196.100.166] ([194.196.100.166:47172] helo=mtagate6.uk.ibm.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/44-43487-F3AA31B4 for ; Mon, 30 Nov 2009 06:19:27 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id nAUBJONb025598 for ; Mon, 30 Nov 2009 11:19:24 GMT Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAUBJOQo889022 for ; Mon, 30 Nov 2009 11:19:24 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nAUBJOPu011984 for ; Mon, 30 Nov 2009 04:19:24 -0700 Received: from d06ml063.portsmouth.uk.ibm.com (d06ml063.portsmouth.uk.ibm.com [9.149.39.187]) by d06av06.portsmouth.uk.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nAUBJOra011975 for ; Mon, 30 Nov 2009 04:19:24 -0700 In-Reply-To: <20091127112342.10032rdp6hlsydic@webmail.df.eu> References: <20091127112342.10032rdp6hlsydic@webmail.df.eu> X-KeepSent: DA96EF9F:16359A5A-8025767E:003D692E; type=4; name=$KeepSent To: internals@lists.php.net X-Mailer: Lotus Notes Release 8.0.2 HF623 January 16, 2009 Message-ID: Date: Mon, 30 Nov 2009 11:19:47 +0000 X-MIMETrack: Serialize by Router on D06ML063/06/M/IBM(Release 8.0.2FP2|June 22, 2009) at 30/11/2009 11:19:48 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Subject: ARGINFO and Userspace Type Hinting From: WIMARTIN@uk.ibm.com (William Martin) I have a curious example of what to me, appears to be a discrepancy (intentional or not, I don't know) between how ARGINFO is treated in extensions and Type Hinting is treated in userspace and I would appreciate some aid in clarification. For example, IteratorIterator::__construct(), the ARGINFO is ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0). Whenever a non-Traversable value is passed, a Catchable Fatal Error is thrown as I would expect. If however, you do: the code does not cause error and continues into the method body until an InvalidArgumentException is thrown by zend_parse_parameters (This can all be found in spl_iterators.c). On the other hand however, if you were to run the following userspace code: test(); ?> then you get a Catchable Fatal Error. Firstly, and quite possibly, am I missing a flag that sets this behavior? Secondly, If I am not missing anything, should hinted methods be treating calls with no arguments the same and if so, which version is correct? Perhaps of course, this behavior is intentional and would cause problems if/shouldn't be changed. Either way, I would appreciate any help in clarifying this. Thanks, William Martin