Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13350 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47522 invoked by uid 1010); 16 Oct 2004 21:20:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47475 invoked from network); 16 Oct 2004 21:20:18 -0000 Received: from unknown (HELO sunshine.home) (80.108.136.197) by pb1.pair.com with SMTP; 16 Oct 2004 21:20:18 -0000 Received: from venom.home ([192.168.1.10]) by sunshine.home with asmtp (Exim 4.34) id 1CIvyK-0006gH-D3 for internals@lists.php.net; Sat, 16 Oct 2004 23:20:16 +0200 Message-ID: <417191AB.80405@fischer.name> Date: Sat, 16 Oct 2004 23:24:59 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040514 MultiZilla/1.6.4.0a X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <20041016191353.85746.qmail@pb1.pair.com> In-Reply-To: <20041016191353.85746.qmail@pb1.pair.com> X-Enigmail-Version: 0.84.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "sunshine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or block similar future email. If you have any questions, see the administrator of that system for details. Content preview: Cristiano Duarte wrote: > Now that 5.0.3 is out, maybe it's time to bring back that > old problem left in May: type hints and null default values. > This feature was dropped since no one could come with a > reasonable solution. > So, for now, there is no (engine) way to have a parameter that > can only be of some class or null. Am I right ? > The use of null (I know it's not a value it's a type...) is > justified because we don't have a "value" to represent > a NULL OBJECT(or NO OBJECT). > IMO, this is a necessary feature (maybe others thing this way > too) and that's why I brought it back. [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- Subject: Re: [PHP-DEV] Type hints with null default values From: markus@fischer.name (Markus Fischer) Cristiano Duarte wrote: > Now that 5.0.3 is out, maybe it's time to bring back that > old problem left in May: type hints and null default values. > This feature was dropped since no one could come with a > reasonable solution. > So, for now, there is no (engine) way to have a parameter that > can only be of some class or null. Am I right ? > The use of null (I know it's not a value it's a type...) is > justified because we don't have a "value" to represent > a NULL OBJECT(or NO OBJECT). > IMO, this is a necessary feature (maybe others thing this way > too) and that's why I brought it back. I'm also realing waiting for this implemented. Since I've started to use the new features of v5, I've had to deal with parameter checks in exactly this way. If it's not class/interface instanceof type x, throw an exception. I just hope, if it gets implemented, it's done via exceptions too. - Markus