Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66374 invoked from network); 12 Mar 2012 12:55:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2012 12:55:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:64093] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/97-20445-852FD5F4 for ; Mon, 12 Mar 2012 07:55:52 -0500 Received: by wibhr17 with SMTP id hr17so3184653wib.5 for ; Mon, 12 Mar 2012 05:55:50 -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=QM1NA3DroxaRVvX1n0vXPDFjjzIPoNzsFmQhky/Jflw=; b=dWSKl3n58worHXXfOyXjqRS+pvMerXkBJoxPzjarXiiCY2BAATsKg4Nq7ukBKX/QYg v/lcVCYkadypA9bUCn1VbaCFDoT4CVUfYuBW8zc7QE342qAgtN9qH3C5sPmrZR4ydKgp +S7Ta9FyEVe/S2tLu4ReBJVKuscDbQjqrgztsljjcySQCwyemS0HCQNARI6CHnbwbyBN KrE0ne3KSuqcc9z96XG2MhqcJiPKZHajwuR/AStAvZOUuvldCfFi6TjOaBi5c+g2wtNw Jo9Cdc8EjdZ0RhCF6ecomETGGoSyXUndhQNwlEQsUu0e2uOIvXWjZFVhNLzBUZ1WQVFD 54oQ== Received: by 10.180.96.168 with SMTP id dt8mr16790783wib.18.1331556950128; Mon, 12 Mar 2012 05:55:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.117.1 with HTTP; Mon, 12 Mar 2012 05:55:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Mar 2012 14:55:30 +0200 Message-ID: To: Simon Schick Cc: Lazare Inepologlou , Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d0442880e02b97f04bb0b432b Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: arvids.godjuks@gmail.com (Arvids Godjuks) --f46d0442880e02b97f04bb0b432b Content-Type: text/plain; charset=UTF-8 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 that 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 in my wishes :)) --f46d0442880e02b97f04bb0b432b--