Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81561 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81295 invoked from network); 2 Feb 2015 08:32:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 08:32:15 -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.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:38772] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/92-02376-B063FC45 for ; Mon, 02 Feb 2015 03:32:13 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id C27D18C0081; Mon, 2 Feb 2015 03:32:08 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pbGnqZq8dmMQ; Mon, 2 Feb 2015 03:32:08 -0500 (EST) Received: from [137.50.173.145] (oa-edu-173-145.wireless.abdn.ac.uk [137.50.173.145]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 2BEB78C007D; Mon, 2 Feb 2015 03:32:05 -0500 (EST) References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-D7980C76-61AC-4A14-B289-AE4DCB6FE480 Content-Transfer-Encoding: 7bit Message-ID: <41333C12-A30F-4C5B-AAC2-4523D9FA3FCB@ajf.me> Cc: PHP Internals List X-Mailer: iPhone Mail (12B466) Date: Mon, 2 Feb 2015 08:32:05 +0000 To: Dmitry Stogov Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) --Apple-Mail-D7980C76-61AC-4A14-B289-AE4DCB6FE480 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Hi Dmitry, -- Andrea Faulds http://ajf.me/ > On 2 Feb 2015, at 07:02, Dmitry Stogov wrote: >=20 > As I already told, in my opinion, version 0.1 was the perfect solution tha= t fit into PHP semantic very well. >=20 > declare(strict_types=3D1); - is really weird solution. > It changes type hinting behavior per file scope, so, just to try strict ty= pe hinting in a big project, people will have to change every single PHP fil= e. > =46rom the RFC text, I didn't completely understand, if declare() affects c= all site or declaration. Will we able to call the same function using weak t= ype hinting from on file and with strict from the other? > "The strict type checking mode also affects extension and built-in PHP fun= ctions", sin(1) - error !!! >=20 > Strict type hinting is not suitable for PHP by definition (as a weakly typ= ed language), however, I see, it may be useful in some cases. > I would prefer to have "weak" types at first, then think about introducing= ability to switch to "strict" type hinting in context of use-cases. >=20 > Thanks. Dmitry. >=20 >=20 >=20 >=20 >> On Mon, Feb 2, 2015 at 2:49 AM, Andrea Faulds wrote: >> Good evening, >>=20 >> The RFC has been updated to cover return types, since Levi=92s Return Typ= es RFC has passed. The patch is a work in progress: it works, but lacks test= s for return types. >>=20 >> Version 0.3 of the RFC can be found here: https://wiki.php.net/rfc/scalar= _type_hints >>=20 >> Thanks! >> -- >> Andrea Faulds >> http://ajf.me/ >>=20 >>=20 >>=20 >>=20 >>=20 >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >=20 --Apple-Mail-D7980C76-61AC-4A14-B289-AE4DCB6FE480--