Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58586 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45249 invoked from network); 4 Mar 2012 16:50:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2012 16:50:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:61967] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/77-12048-E4D935F4 for ; Sun, 04 Mar 2012 11:50:23 -0500 Received: by lahl5 with SMTP id l5so4126704lah.29 for ; Sun, 04 Mar 2012 08:50:19 -0800 (PST) Received-SPF: pass (google.com: domain of dragoonis@gmail.com designates 10.112.101.198 as permitted sender) client-ip=10.112.101.198; Authentication-Results: mr.google.com; spf=pass (google.com: domain of dragoonis@gmail.com designates 10.112.101.198 as permitted sender) smtp.mail=dragoonis@gmail.com; dkim=pass header.i=dragoonis@gmail.com Received: from mr.google.com ([10.112.101.198]) by 10.112.101.198 with SMTP id fi6mr8116321lbb.18.1330879819973 (num_hops = 1); Sun, 04 Mar 2012 08:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=A8cdwNWTwXhSHHL+LVREYO+pwWsErRhZpEFfjsPnv+A=; b=V7irM/f+33RzKyyEkIJNx28llmSHWeABZ3dAQcJ26hAKsqr5nYwKCEAT5nxfOYjEr3 t+vZqzQSZPq0HyWj1LIPvTNrnXKJutaN/eUCaYdVBcuGfNliStHqc+XgHBvzDfQzLm9m nEjpcT8sI/HvMgIPoQhFxe4ReMxLVP1kJKS+jf77VdBM1kKM4gBnipq2cjfjIP39PNZV WYI6snpkBYazsE7oFDHqr4EF4ZxjtNgoPymHjSOAZY55WYbCgqnwDYZp577xVuVn3LEp vKvGFGt0ztmZqEsxGLegZ9k+oNUvEYuZ2MA8huBIKRVVjm3KBrXRb3F31CBvUc17obu7 qqmQ== MIME-Version: 1.0 Received: by 10.112.101.198 with SMTP id fi6mr6705319lbb.18.1330879819877; Sun, 04 Mar 2012 08:50:19 -0800 (PST) Received: by 10.152.13.40 with HTTP; Sun, 4 Mar 2012 08:50:19 -0800 (PST) In-Reply-To: References: Date: Sun, 4 Mar 2012 16:50:19 +0000 Message-ID: To: Lazare Inepologlou Cc: Anthony Ferrara , internals@lists.php.net Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC - Discussion] Parameter Type Casting Hints From: dragoonis@gmail.com (Paul Dragoonis) It would make sense that the default value you're setting matches the zval.type of the casted value. You always want it to be an int, if you're doing (int) so setting it to a string or array would not make sense. - Paul. On Sun, Mar 4, 2012 at 4:46 PM, Lazare Inepologlou wro= te: > Anthony, just a tiny detail in your RCF: > > So (int) $foo =3D null and (int) $foo =3D 1 are both supported, but (int)= $foo >> =3D =931=94 will generate an E_COMPILE_ERROR. >> > > If null is going to be cast, (int)null is 0. So I don't think it should b= e > a valid default value. > > > Lazare INEPOLOGLOU > Ing=E9nieur Logiciel > > > 2012/3/4 Anthony Ferrara > >> Hey all, >> >> I've drafted an RFC for the Parameter type casting hint proposal that >> I posted to before. =A0Attached to the RFC is a patch that's proposed >> for inclusion in core for functionality (it doesn't include news >> entries, or documentation, or any of the other steps that would be >> needed prior to commit). >> >> https://wiki.php.net/rfc/parameter_type_casting_hints >> >> Please provide feedback here on the implementation and RFC topics. >> >> Thanks, >> >> Anthony >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >>