Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33875 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63604 invoked by uid 1010); 8 Dec 2007 21:38:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63589 invoked from network); 8 Dec 2007 21:38:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2007 21:38:31 -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:50574] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/10-58559-DCE0B574 for ; Sat, 08 Dec 2007 16:38:22 -0500 Received: from [216.15.51.211] (port=50287 helo=[192.168.1.96]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1J17NN-00060g-Vr for internals@lists.php.net; Sat, 08 Dec 2007 15:38:22 -0600 To: internals@lists.php.net In-Reply-To: <698DE66518E7CA45812BD18E807866CE0100C741@us-ex1.zend.net> References: <698DE66518E7CA45812BD18E807866CEF88FDD@us-ex1.zend.net> <7d5a202f0712031900i386f8964s675da26cc93af3fe@mail.gmail.com> <47550FAB.30002@daylessday.org> <698DE66518E7CA45812BD18E807866CEF890ED@us-ex1.zend.net> <475578BE.40908@daylessday.org> <4755A797.1020905@lerdorf.com> <009001c836ae$4ba0add0$e2e20970$@mcnaught@synergy8.com> <4755B310.9070603@lerdorf.com> <4755B55A.1030708@zend.com> <4755B61A.2000803@lerdorf.com> <50921.98.193.37.55.1197080740.squirrel@www.l-i-e.com> <698DE66518E7CA45812BD18E807866CE0100C741@us-ex1.zend.net> Content-Type: text/plain Date: Sat, 08 Dec 2007 16:38:23 -0500 Message-ID: <1197149903.9893.16.camel@sams-room> 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: Type hinting From: sam@sambarrow.com (Sam Barrow) A few weeks ago I wrote a message on this list about my patch for scalar type hinting. I've been using it for about a month now in a large scale application im developing with no problems. It allows type hinting for the following types: int, float, string, bool (boolean), num (int or float), scalar (int, float, string, or bool), object, and resource. All of these types have been very useful. Num has been useful for any mathematical functions, scalar has been the most useful, mostly for echoing values and interacting with the database (as a database cant store arrays or objects). The type hinting is all 100% optional and has caused no problems for me at all, I use it in most function but some functions I'll use it for one parameter and not the other, or none at all with no problems. What is the general opinion on this? Examples below: 'b')) ; // Catchable fatal error: Argument 1 passed to displayStuff() must be a scalar, array given ?>