Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80454 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68153 invoked from network); 14 Jan 2015 10:20:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 10:20:09 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:37222] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/61-61073-7D246B45 for ; Wed, 14 Jan 2015 05:20:08 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 263868800D5; Wed, 14 Jan 2015 05:20:04 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7PlJ_JgrbQR3; Wed, 14 Jan 2015 05:20:03 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 1DEA88800A2; Wed, 14 Jan 2015 05:20:02 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54B6402B.1020401@nunninger.info> Date: Wed, 14 Jan 2015 10:20:00 +0000 Cc: Leigh , PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <77C73BB0-C124-47EC-81AB-ADDE6DAB1C60@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <54B6402B.1020401@nunninger.info> To: Thomas Nunninger X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hi Thomas, > On 14 Jan 2015, at 10:08, Thomas Nunninger = wrote: >=20 > ---------------- > $i =3D 1; > $a =3D myFunc( $i ); >=20 > declare(strict_typehints=3DTRUE); >=20 > function myFunc( float $f ) > { > return otherFunc( $f ); > } >=20 > function otherFunc( float $f ) > { > ... > } > ---------------- >=20 > As author of strict code I need to replace >=20 > return otherFunc( $f ); >=20 > by >=20 > return otherFunc( (float) $f ); >=20 >=20 > I'm not sure >=20 > - if this is what a strict coder wants and >=20 > - if you find an acceptable way to test your strict code if it works = with non-strict code. I don=E2=80=99t understand, I=E2=80=99m sorry. If you are using declare(strict_typehints=3DTRUE); then all calls in a = file are =E2=80=9Cstrict=E2=80=9D. If you are not, all calls in a file = are =E2=80=9Cweak=E2=80=9D. -- Andrea Faulds http://ajf.me/