Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26315 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16674 invoked by uid 1010); 3 Nov 2006 22:46:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16659 invoked from network); 3 Nov 2006 22:46:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2006 22:46:02 -0000 Authentication-Results: pb1.pair.com header.from=brianm@dealnews.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianm@dealnews.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dealnews.com designates 129.41.69.185 as permitted sender) X-PHP-List-Original-Sender: brianm@dealnews.com X-Host-Fingerprint: 129.41.69.185 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [129.41.69.185] ([129.41.69.185:35713] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/D5-07680-8A6CB454 for ; Fri, 03 Nov 2006 17:46:01 -0500 Received: (qmail 14058 invoked from network); 3 Nov 2006 17:45:57 -0500 Received: from unknown (HELO ?10.1.6.4?) (10.1.6.4) by -H with SMTP; 3 Nov 2006 17:45:57 -0500 Message-ID: <454BC69D.6050409@dealnews.com> Date: Fri, 03 Nov 2006 16:45:49 -0600 User-Agent: Thunderbird 1.5.0.2 (Macintosh/20060406) MIME-Version: 1.0 To: Ron Korving CC: internals@lists.php.net References: <7f3ed2c30611031000j2dc48a6amb7f04c8011442b56@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Scalar type hinting ;) From: brianm@dealnews.com (Brian Moon) Ron Korving wrote: > If you ask me, scaler type hinting should try to do some auto-conversion. > That way, the type hints would actually be useful. While I like the idea of type hinting on scalars, I agree that it causes issues. Using request data is the main issue. Its all strings. The only way I see it working is if the hints converted the data and checked if it "changed". So, "1" and 1 are "the same" so it does not complain. Likewise, any number could be changed to a string. But non-numeric strings changing to 0 would throw an error. That is the main place where scalars cause issues. That does bring up the question of why scalar as a hint is not supported. function test (scalar $var) { echo $var; } I would seem that would have made sense. Currently, that code throws: Fatal error: Argument 1 passed to test() must be an object of class scalar That is funny on its own. -- Brian Moon ------------- http://dealnews.com/ It's good to be cheap =)