Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29695 invoked from network); 13 Jul 2014 13:18:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2014 13:18:01 -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:56292] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/32-16748-80782C35 for ; Sun, 13 Jul 2014 09:18:01 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 164418C0080; Sun, 13 Jul 2014 09:17:58 -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 JoAGZczz_nvV; Sun, 13 Jul 2014 09:17:57 -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 B27E48C007B; Sun, 13 Jul 2014 09:17:56 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53C285FD.5060204@gmail.com> Date: Sun, 13 Jul 2014 14:17:54 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C28081.10005@gmail.com> <53C285FD.5060204@gmail.com> To: Jocelyn Fournier X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: ajf@ajf.me (Andrea Faulds) On 13 Jul 2014, at 14:13, Jocelyn Fournier = wrote: > Actually displaying a warning in E_STRICT but still doing the implicit = cast would not change the function signature. Sure. What I meant was more that we=92re changing expectations based on = php.ini/variable/etc., and I=92d rather it=92s always consistent. >=20 > Indeed :) But I have also performances in mind. Usually (at least in = HACK / Zephir), "type hinting" is used to help the compiler optimize the = code. If this type hinting could be useful to help my code working in a = futur PHP->PECL compiler, or help the PHP opcache to do some = optimisations, I'd like to use "type hinting" as much as possible. >=20 > But with the above limitation, I'll not be able to do so. I think this type hinting wouldn=92t hinder optimisation. Casting means = that it=92s still guaranteed that the value you get is of the requested = type. -- Andrea Faulds http://ajf.me/