Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92310 invoked by uid 1010); 7 Jan 2008 18:32:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92294 invoked from network); 7 Jan 2008 18:32:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jan 2008 18:32:07 -0000 Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:39617] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/F7-15135-62072874 for ; Mon, 07 Jan 2008 13:32:07 -0500 Received: from [98.172.154.66] (port=3131 helo=[10.200.100.14]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1JBwlZ-00055B-ER; Mon, 07 Jan 2008 12:32:05 -0600 To: Elizabeth M Smith Cc: internals@lists.php.net In-Reply-To: <2E.37.15135.28C62874@pb1.pair.com> References: <477DB7BF.10201@chiaraquartet.net> <2E.37.15135.28C62874@pb1.pair.com> Content-Type: text/plain Date: Mon, 07 Jan 2008 13:30:07 -0500 Message-ID: <1199730607.15292.253.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Re: type hinting From: sam@sambarrow.com (Sam Barrow) On Mon, 2008-01-07 at 13:16 -0500, Elizabeth M Smith wrote: > Afternoon, > > Wow, go away for a weekend and look what happens... > > Personally I think the issue is that true "scalar" type hinting doesn't > make much sense with a dynamically typed language. Deciding if/when/how > to juggle a scalar typehint is going to make at least one person angry > and some new user confused. > > However, I have to agree with the fact that the current typehinting > system feels "unfinished". I can tell a function that it has to be > passed an array or some specific type of object, but can't tell it that > it has to be passed a scalar type, or a resource, or any generic object. > > These don't "juggle" well like the generic scalar (int, bool, float, > string) types. Is there any reason we can't at least add "scalar" and > "resource" (and possibly "object" for generic objects) to typehints? It > wouldn't be the full "scalar typehinting" solution that people are > yelling for, but it would cut out lines of bad input handling in my own > code, and make the current typehint solution feel more complete. Scalar, resource, and object type hints would be very useful, and fit perfectly with the current type juggling system. I still support all of the hints, but these 3 alone have an even stronger argument than the other ones. > My own $0.02, > Elizabeth Smith >