Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58875 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76484 invoked from network); 12 Mar 2012 13:52:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2012 13:52:56 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:63916] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/A9-20445-7BFFD5F4 for ; Mon, 12 Mar 2012 08:52:56 -0500 Received: by ghbg2 with SMTP id g2so2895568ghb.29 for ; Mon, 12 Mar 2012 06:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=NK+AbRXcuSh1N+9KHxlHLGitAy9Hjzq3XSE0L8l2pzw=; b=xMyzuTO40zRy0fiUS0L2Lapc49nrBbWePDQLucXGPHmba9cyNX8MxNenJ4jKbPdi20 +Hti9i4xHEORRe25fkmK25tTCNh+XbJmyhvZUob6d15aDUOKVqWaMV6AkGaIfgSW84SH 6bNfe/AifjhPMkWGsbsEcx3UjhZ+mxBXKmmMjQVchwvukZL1HoFxxSCViY4/4D0MNaiq ik4h+NWQ9GKPxTdwL6PC/a97Tqn1ZHzwHmUT8r/xKP2ubegY4bwXyi/YmoSCxDbO/5bO dhVpCDHtqtDvWTC33H8XXAO4RwStxHmty93hB0BY8FECITmV3b3f2rKSKpIqNVi0skbo Flvw== Received: by 10.236.170.193 with SMTP id p41mr13230412yhl.15.1331560372212; Mon, 12 Mar 2012 06:52:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.172.8 with HTTP; Mon, 12 Mar 2012 06:52:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Mar 2012 14:52:32 +0100 Message-ID: To: Arvids Godjuks Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf305e21b1fb93a704bb0c0e21 Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: linepogl@gmail.com (Lazare Inepologlou) --20cf305e21b1fb93a704bb0c0e21 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > I'm not sure about you, but I don't wanna see that kind of thing eventually making it's way into the language Me neither. All I am saying is that, since int|null is already here from the back door, I think it should be properly supported. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel 2012/3/12 Arvids Godjuks > I think that the "null issue" is not an issue. Strictly speaking if you > want null or an int - leave out the type hint and use generic argument th= at > will accept anything. > I think it's over-engineering to try and push a special treatment for the > null. If function/method argument accepts anything but a single type - > it's type-less and does not need a type hint. > > Developers should not abuse type hints and adding a special case for > handling null will make many start to request things like this: > function foo(string|array $data) > function foo(bool|int $flag) > function foo(mixed $someVar) > etc. > > I'm not sure about you, but I don't wanna see that kind of thing > eventually making it's way into the language (believe me - even I > considered that at some point, but i'm more mature now and more settled i= n > my wishes :)) > --20cf305e21b1fb93a704bb0c0e21--