Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9627 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10506 invoked by uid 1010); 1 May 2004 22:05:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10453 invoked from network); 1 May 2004 22:05:23 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 1 May 2004 22:05:23 -0000 Received: from BAUMBART (p508EB34D.dip.t-dialin.net [80.142.179.77]) by shiva.mind.de (Postfix) with ESMTP id 0275A97B58; Sun, 2 May 2004 00:05:21 +0200 (CEST) Date: Sun, 2 May 2004 00:05:23 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <384305020.20040502000523@marcus-boerger.de> To: John Coggeshall Cc: PHP Internals In-Reply-To: <1083446852.2709.24.camel@coogle.localdomain> References: <243202120.20040501220932@marcus-boerger.de> <1083446852.2709.24.camel@coogle.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Type hints From: helly@php.net (Marcus Boerger) Hello John, Saturday, May 1, 2004, 11:27:32 PM, you wrote: > I agree with the idea that it would be nice to force an instance of a > particular class, etc. to be passed. However, if we are going to > introduce another keyword anyway why not keep BC intact by by > introducing the 'force' keyword: the point of solution 3 was not to introduce a new keyword other than null. And adding null as a keyword dosn't have implications other that ppl may have a fucntion called 'null'. But i don't think that happens often. Using force or forced on the other hand seems to happen often at least i used it myself. > I remember discussing 'array' as a typehint (big +1 there), good so far > but I don't > see anything gained from such a type-hint. When exactly would you use it > (that you couldn't use the existing type hinting).. I guess the obvious > answer is when you don't know the type of class being passed, but if you > don't know that how do you plan on actually using the parameter at all? What are you speaking of here? array means the parameter must be an array. class means the parameter must be any class instance which can be used for reflection as an example. Best regards, Marcus