Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83218 invoked from network); 13 Jul 2014 01:57:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2014 01:57:36 -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.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:60727] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/30-14675-F87E1C35 for ; Sat, 12 Jul 2014 21:57:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 89F6C8C007B for ; Sat, 12 Jul 2014 21:57:32 -0400 (EDT) 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 j8YjfRPJxbEM for ; Sat, 12 Jul 2014 21:57:32 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id F16558C0075 for ; Sat, 12 Jul 2014 21:57:31 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Message-ID: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> Date: Sun, 13 Jul 2014 02:57:28 +0100 To: PHP internals Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) Subject: [RFC] Scalar Type Hinting With Casts (re-opening) From: ajf@ajf.me (Andrea Faulds) Good evening, PHP=92s type hinting system is rather incomplete as it does not support = scalars, only arrays, callables and objects. In 2012, Anthony Ferrara = created an RFC which proposed type hinting for scalar types (int, float, = bool, string and resource) with casting, with behaviour nearly the same = as that of zend_parse_parameters. Sadly, he later left PHP internals and = withdrew his RFCs. Since I am very much in favour of scalar type hints, I=92ve updated the = patch to master and made some minor improvements, and I am re-opening = the RFC with the intent to try and get it into PHP 5.7. The patch is = mostly there. It needs some more tests and there are some edge cases I = need to deal with, but it otherwise works, and I expect I can finish = fixing it up very soon. The RFC is here: https://wiki.php.net/rfc/scalar_type_hinting_with_cast A pull request is here: https://github.com/php/php-src/pull/717 I=92m hoping I can get this into PHP 5.7. I think scalar type hinting = would be a valuable addition to PHP=92s existing type hinting system. Thanks! -- Andrea Faulds http://ajf.me/