Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58870 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58521 invoked from network); 12 Mar 2012 12:17:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2012 12:17:40 -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.213.170 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:40404] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/26-20445-469ED5F4 for ; Mon, 12 Mar 2012 07:17:40 -0500 Received: by yenl5 with SMTP id l5so2776515yen.29 for ; Mon, 12 Mar 2012 05:17:37 -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=oTaofJw3ipU7QzKGEEN/l0loNYo0dYdzZnkP75ON824=; b=R5zcqH556eTXP+CBjLSRqNZXr4Ne4/INlzWGBmZ5MkysxEuYg7yB3tFkq/AJ4O4m5F z6JiBHLX9Zw7Ge4W/0OPqSnZouN0BF2DiFbbwC0E38qzoUbdKlZRWUgmo9ResbH5OSVB Y4xUyzHDfpxEEy9VIkTQRESHBtqCOfV8Li3TBdg0+AogKIjULVvDAjmjw+mOmTW7uKjG u4/xPK4+TGAKf4KihYNw9Ne5X9xLjcEUUnPymqoctfMst1/oOsAtxzUPoVmamUbeD/1T 5AU5Eon0X3XzsvKs9PurowHzhzULiV3j5GnFKopoWWdVEb9a/oOBtUSNt4gQplYucyqG sFlw== Received: by 10.236.170.193 with SMTP id p41mr12911700yhl.15.1331554657381; Mon, 12 Mar 2012 05:17:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.172.8 with HTTP; Mon, 12 Mar 2012 05:17:17 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Mar 2012 13:17:17 +0100 Message-ID: To: Anthony Ferrara Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf305e21b15a2f5004bb0abaf0 Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: linepogl@gmail.com (Lazare Inepologlou) --20cf305e21b15a2f5004bb0abaf0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Anthony, I will raise once again the question about accepting null. According to your POC, null is an acceptable value if it is also declared as a default value. This is problematic for the scalar types, because they can very well have a different default value. An example: There is a check box with three states (check, unchecked and mixed). This is usually translated to a three state boolean (true, false and null). The default value of the check box is false. function set_check_box_state( bool state =3D false ) { ... } set_check_box_state( null ); // null will be converted to false here... Therefore, this cannot work, unless the default value becomes null, which is against the requirements. What I suggest is something like this: function set_check_box_state( bool? state =3D false ) { ... } set_check_box_state( null ); // works fine In my opinion this is much clearer, as it separates the notions of the type and that of the default value. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel --20cf305e21b15a2f5004bb0abaf0--