Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56057 invoked from network); 14 Jul 2014 17:59:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 17:59:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; 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:55563] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/52-45205-87A14C35 for ; Mon, 14 Jul 2014 13:59:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 1CC958C007D; Mon, 14 Jul 2014 13:59:17 -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 uuzisOaZBTrp; Mon, 14 Jul 2014 13:59:16 -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 AE2488C0075; Mon, 14 Jul 2014 13:59:15 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <8177fae7c5a1a21ab2bc2b98d7e29d17@mail.gmail.com> Date: Mon, 14 Jul 2014 18:59:12 +0100 Cc: Rowan Collins , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <3F4D195C-256C-443D-A92A-E130776C4E88@ajf.me> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C3F70A.7010706@gmail.com> <3aa29e080d70c843713e19a952dfbad6@mail.gmail.com> <3b06c592b0b88bb95d3ae7ea7a93d86f@mail.gmail.com> <6AF150D1-1398-43CA-977A-3CF3D51719F4@ajf.me> <5b53012f7b5437d85cdf9972194aa34f@mail.gmail.com> <53C408EC.7080104@gmail.com> <5f491f470e902489f036102ae0f437f8@mail.gmail.com> <53C41244.5010505@gmail.com> <8177fae7c5a1a21ab2bc2b98d7e29d17@mail.gmail.com> To: Zeev Suraski 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 14 Jul 2014, at 18:52, Zeev Suraski wrote: > Type hints were first and foremost introduced for object oriented = safety, as > a part of the major OO model shift Andi and I pushed for in PHP 5.0. = What > you may be alluding to - type hints for arrays and objects - were = added at > later time and introduced that small inconsistency you're talking = about. > Still, type juggling for scalars has been the fundamental nature of = PHP > since the get go; Type jugging for arrays/objects was always more of = an > edge case and perhaps even a misfeature. I=92m not sure we actually do =93juggle=94 arrays and objects much, do = we? You can cast to them, sure, because PHP as a rule allows you to cast = anything to anything explicitly (bar resources), but I can=92t, for = example, do a loose comparison between an array and a string. -- Andrea Faulds http://ajf.me/