Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80539 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80721 invoked from network); 15 Jan 2015 14:32:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 14:32:43 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 74.125.82.175 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 74.125.82.175 mail-we0-f175.google.com Received: from [74.125.82.175] ([74.125.82.175:64349] helo=mail-we0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/DA-14306-A8FC7B45 for ; Thu, 15 Jan 2015 09:32:43 -0500 Received: by mail-we0-f175.google.com with SMTP id k11so15018703wes.6 for ; Thu, 15 Jan 2015 06:32:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=wLDTjoyEH1WIcjvWWkaoDAPi6hUqmkaOMrPrSGhlShs=; b=SLPQpHEp0NYJQPvTezQ7bKKWZMLKw/PewiVKULossoPf7Ja/o3fZAEzeJ9h6+p4OdG bfWEMb8yV4rHaYqoDC5dhDVlUjeYcTnAa9TTGswSLMgT1wU8I8FWYNVzfqZyiG+hXaJf NZwSD0G0B91XwaRfj6L2Rc6GCrBMUYGc5/IeEQYn0OOHQewhucPoyK1akR4baMqQCLN0 V9RPpG6/apS9avzqSvtkx5AfxhuVm8N0fv6UQSFOpOpNJ1O2l54uXvfRVRboyk4mo+QO FebZEMAkOSr7zKeqQsaTB3m1DDJo+oM8sMhpnbMB+mQ/uafYCcyaVp0MZ8P4B7LoHAnv CEvw== X-Gm-Message-State: ALoCoQl/2afVyLznMNqLwi3OxRPi/GaEe3oC5P1wUE0h+aAaNBs1EFpryre/mhWHVS5b8ZOcHjIqSuXV/RP2vABfVSg11og95STTA3nLxgsx9EelJ/3XhKVSPUlEDaYazx27Xw0YqhlJ8RJwcj25iF6/ZR24KMKycg== X-Received: by 10.194.81.104 with SMTP id z8mr18628561wjx.45.1421332359241; Thu, 15 Jan 2015 06:32:39 -0800 (PST) References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <9a033dd1f223f854e760924d118ab812@mail.gmail.com> <2ae0164cb9b9bf1c974d7a3c60af0466@mail.gmail.com> <6105ea99002e634373c09685310e26a6@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGo6gmoLPH7aNIVeHjTN7HPWATOMwFgXHbXAiinDCoCNhsVSQIuHXg7AMzhfAQCiQHczQI0OxjrAkYga26ckdzgUA== Date: Thu, 15 Jan 2015 16:32:38 +0200 Message-ID: To: Andrea Faulds Cc: RQuadling@gmail.com, Leigh , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: RE: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Andrea Faulds [mailto:ajf@ajf.me] > Sent: Thursday, January 15, 2015 4:10 PM > To: Zeev Suraski > Cc: RQuadling@gmail.com; Leigh; PHP Internals List > Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 > > Hi Zeev, > > Whether or not they are in the majority, a very large portion of PHP > developers would prefer strict typing. In particular, the most vocal ones > would seem to. There are also a lot of PHP developers who would prefer > weak typing. Thus we have a problem: either approach to scalar hints will > upset a large portion of the community. That's correct. As I said though, the source of the opposition is fundamentally different. The camp which opposes weak typing opposes it based on the idea that it doesn't behave in the way that would suit their needs. The camp which opposes strict typing - which incidentally includes most of the people who originally created the language - opposes it based on the assertion that it goes against the spirit of the language. That is equally true for the v0.2 proposal you've just submitted. > > How do you deduce that 'nobody uses them' from the fact that some > > group of people said they won't? I'm sorry, but it makes no sense, > > especially given the positive feedback you saw on internals, making it > > clear that there would be in fact people using it. > > Not all of it was positive. Sure, a lot of people would use them though, > but > I=E2=80=99ve heard quite a few developers say they wouldn=E2=80=99t use t= hem and continue > to use manual (!is_int($foo))-style assertions. Of course not all of it was positive, but it was overwhelmingly positive. Very few opposed. Someone saying they won't use it doesn't count as opposition. You see, PHP exists for 15-20 years now. There aren't any must-have features that aren't in it. No single feature we add will be use= d by everyone, and people telling us they won't use this feature shouldn't 'deter' us in any way. > > If there's one thing that's worse than introducing an alien concept > > like strict typing into PHP, it's introducing it as a feature that > > will include all the negatives of this alien concept, PLUS have the > > ability to radically change how it behaves based on a runtime option. > > This isn=E2=80=99t a runtime option, it is entirely compile-time. Much li= ke > namespaces > are not a runtime option. There isn=E2=80=99t even the ability to toggle = it at > runtime, > unless we somehow add some ability to edit the flags on individual > opcodes. Compile time and runtime in PHP are intertwined when you factor in cross-file interaction. Zeev