Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47142 invoked from network); 1 Jan 2015 16:35:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2015 16:35:40 -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.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:36448] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/ED-60454-A5775A45 for ; Thu, 01 Jan 2015 11:35:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id A2FA82400C3; Thu, 1 Jan 2015 11:35:35 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9s8ba7o7KSgT; Thu, 1 Jan 2015 11:35:35 -0500 (EST) Received: from [192.168.0.13] (unknown [94.13.96.117]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id BC6382400AA; Thu, 1 Jan 2015 11:35:34 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54A56EB3.2000308@fischer.name> Date: Thu, 1 Jan 2015 16:35:01 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A5051F.1090400@php.net> <54A52AE6.70704@fischer.name> <54A56EB3.2000308@fischer.name> To: Markus Fischer X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) Hi Markus, > On 1 Jan 2015, at 15:58, Markus Fischer wrote: >=20 > On 01.01.15 16:19, Andrea Faulds wrote: >> I think it=E2=80=99d be weird to have different syntaxes for scalars = and non-scalars. We already use the syntax the RFC proposes in the PHP = manual, and I don=E2=80=99t think anyone=E2=80=99s confused by it.=20 >=20 > I didn't meant to stay there's something wrong with the syntax, sorry = if > my text was confusing! I was rather trying to point out that it does = not > hint at anything but proactively tries to convert types; see below for = more: Ah, I see. Well, at least I was able to cover that syntax suggestion = before someone else brings it up. I see your point. > And as you also pointed out: those conversion rules are different from > what a plain "(int)$whatever" would do. The conversion rules are the same, it=E2=80=99s just that scalar hints = reject certain values. The values they accept are converted the same. I = don=E2=80=99t think this is unreasonable: implicit and explicit casts = shouldn=E2=80=99t behave identically. Implicit casts need to be much = stricter. > Now, going on step back here (talking about me), I'm speaking up = because >> my< needs are developer are different (mostly speaking about backend > code, interfaces, libraries, frameworks) but OTOH I'm not a big known > open source framework developer either ;) >=20 > I would honestly be interested what the big framework/library players > actually want/need; do they prefer this implicit scalar type = conversion > system or rather have a rigid system like the current object types but > for scalars too? I think decision on this RFC should include also > "their" saying too. >=20 > It's complex because we can't force anyone to participate but I think > above all these are the most important audience here because they know > what they want and they know what their users want. I say this because > usage of object types in PHP is almost non-existent (or, there are = just > too few cases) compared to the architecture of some of the > framework/library systems out there. That=E2=80=99s a fair point. I=E2=80=99m not sure how they feel about = it. Their views aren=E2=80=99t necessarily the most important, though. = Frameworks can do whatever they like, but what ultimately matters is = what=E2=80=99s best for the end users, who don=E2=80=99t deal with the = framework internals. Thanks. -- Andrea Faulds http://ajf.me/