Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58881 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95010 invoked from network); 12 Mar 2012 16:04:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2012 16:04:44 -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.42 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:38835] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/B2-15296-B9E1E5F4 for ; Mon, 12 Mar 2012 11:04:43 -0500 Received: by yhfq11 with SMTP id q11so3055638yhf.29 for ; Mon, 12 Mar 2012 09:04:40 -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=jDVNcm+DKj5kc8B5josk8QE8vShO3a44BgOUS08ixao=; b=FBM9VAGu7IeYkXx8gwGxSIPzJL9H0pRkxPdwihdfIeCSVilhqt0+Wb0KEVol2T4nnd WgGGXf4PddqBSJTeNdWuSNiDRGgztNmptar+19yzs/57sqzjOcdehUhX0mJIi4OpmHr5 neeKbllDxdGUxXI6XdmhDLaXzWYoCR226lC6lmT85dm/OGYvuxSwlJApoIT32bE8U2/j iddwyww3QS11hk0uHrTmW8D/6WvM0GJ69qo7DD64M/UQFcoi3kmrWdTnMo7WprFt/333 JT2QZVPHCtClbs+s3khjKLsx4q4R6MkCjnd8tQO4OL2LSkzKj9HOatF732HTPgLNfv72 MS5g== Received: by 10.101.187.13 with SMTP id o13mr4171530anp.14.1331568280109; Mon, 12 Mar 2012 09:04:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.172.8 with HTTP; Mon, 12 Mar 2012 09:04:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Mar 2012 17:04:20 +0100 Message-ID: To: Anthony Ferrara Cc: Arvids Godjuks , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001636ed6eeb54822804bb0de65e Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: linepogl@gmail.com (Lazare Inepologlou) --001636ed6eeb54822804bb0de65e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you for the confirmation. What I am saying here is that, although this behavior was fine for objects, it is not enough for scalars. One of the main arguments in favor of the adoption of this syntax was that null was the only possible default value for objects anyway. This obviously is not the case with for scalar types. This is why I suggest a different syntax (which can also be used by object types for consistency). Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel 2012/3/12 Anthony Ferrara > Lazare, > > > The patch of Anthony, clearly states that this is accepted: > > > > function foo ( int $bar =3D null ) { } > > > > And this is what I called an int|null. > > Yup, it does. Because that's the current behavior with array and > object casting. If you default it to null in the declaration, null is > a valid value. If you don't, it's not... > --001636ed6eeb54822804bb0de65e--