Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37867 invoked from network); 4 Jul 2009 12:27:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2009 12:27:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.94.239.7 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.7 mail.jdi.nl Received: from [82.94.239.7] ([82.94.239.7:38545] helo=mail.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/E4-06257-0CA4F4A4 for ; Sat, 04 Jul 2009 08:27:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id n64CRfsL013891; Sat, 4 Jul 2009 14:27:41 +0200 X-Virus-Scanned: by amavisd-new at jdi-ict.nl Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id n64CRHwV013796; Sat, 4 Jul 2009 14:27:40 +0200 Date: Sat, 4 Jul 2009 13:27:17 +0100 (BST) X-X-Sender: derick@kossu.ez.no To: Lukas Kahwe Smith cc: PHP Internals In-Reply-To: <5A834C9A-6D1B-49B7-88E6-FF047B084AB6@pooteeweet.org> Message-ID: References: <5A834C9A-6D1B-49B7-88E6-FF047B084AB6@pooteeweet.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1757697130-1246710460=:6365" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (jdi.jdi-ict.nl [127.0.0.1]); Sat, 04 Jul 2009 14:27:40 +0200 (CEST) Subject: Re: [PHP-DEV] weak and strict type checking RFC From: derick@php.net (Derick Rethans) --8323329-1757697130-1246710460=:6365 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 4 Jul 2009, Lukas Kahwe Smith wrote: > I am publishing it a bit prematurely imho, but its not without merit=20 > at this stage either and since I will be busy playing frisbee all=20 > weekend, I thought I get it out there for people to comment right now:=20 > http://wiki.php.net/rfc/typecheckingstrictandweak Like Ilia mentioned on IRC, there is no reason why the strict type=20 checking which he proposes is necessarily a conflict with the weak type=20 checking.=20 So I would much rather have seen an RFC where you are trying to=20 make a case why we would need week type checking, instead of saying that=20 strict type checking is bad. You might not agree with the strict type=20 checking, but people ask for it, people have been using it and there are=20 plenty of reasons why it is useful=E2=80=94whether you see it or not. So I would propose to: 1. have ilia's strict typing patch (minus scalar and numeric) 2. have a patch that also adds for casting type hints from your RFC. Those could (and should) be considered as *two* new features. As for syntax, I believe the following would be best: function add_user(string $name, string $phone_number, (int) $age) { .. } because: 1. the casting type hint "(int) $var" is used for normal casting already 2. the strict type hint "int $var" is already used for class names regards, Derick --=20 http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org twitter: @derickr --8323329-1757697130-1246710460=:6365--