Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58096 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70716 invoked from network); 26 Feb 2012 21:49:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2012 21:49:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:50404] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/C4-40985-7F8AA4F4 for ; Sun, 26 Feb 2012 16:49:44 -0500 Received: by vcbfo14 with SMTP id fo14so203193vcb.29 for ; Sun, 26 Feb 2012 13:49:40 -0800 (PST) Received-SPF: pass (google.com: domain of kris.craig@gmail.com designates 10.220.153.16 as permitted sender) client-ip=10.220.153.16; Authentication-Results: mr.google.com; spf=pass (google.com: domain of kris.craig@gmail.com designates 10.220.153.16 as permitted sender) smtp.mail=kris.craig@gmail.com; dkim=pass header.i=kris.craig@gmail.com Received: from mr.google.com ([10.220.153.16]) by 10.220.153.16 with SMTP id i16mr7011339vcw.48.1330292980928 (num_hops = 1); Sun, 26 Feb 2012 13:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zkM/KkiTMxH0cg88DXR2p34fNYNF0ZeEBxQE9kixLfM=; b=oQj5q0ssFgJLgJvIMGNisoxTUHzrYh8WeP1tQqLOevTJSIfu1dXTTMnUOAmsbuE42N 9b54ED8x5R1hGLCCxiv4QR4VQehUtUne1A4kOKdApPhYjt6FbBeQ9E3GE3sRx9TevjMv 5T7/+BI2HYhqR3VuCqNDEa1L9CoXEgRwGcKXo= MIME-Version: 1.0 Received: by 10.220.153.16 with SMTP id i16mr5613843vcw.48.1330292980344; Sun, 26 Feb 2012 13:49:40 -0800 (PST) Received: by 10.52.91.5 with HTTP; Sun, 26 Feb 2012 13:49:40 -0800 (PST) In-Reply-To: <4F4AA569.10502@gmail.com> References: <4F455E91.2060408@alliantinternet.com> <028001ccf1ab$0b200050$216000f0$@alliantinternet.com> <4F457517.7050901@alliantinternet.com> <028d01ccf230$91d79b00$b586d100$@alliantinternet.com> <4F4686C6.2040207@sugarcrm.com> <4F496818.8000405@sugarcrm.com> <4F4982BF.8090102@sugarcrm.com> <4F4AA569.10502@gmail.com> Date: Sun, 26 Feb 2012 13:49:40 -0800 Message-ID: To: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= Cc: Arvids Godjuks , internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d043bdfe48a665804b9e4f853 Subject: Re: [PHP-DEV] [RFC] Enum proposal (yet another) From: kris.craig@gmail.com (Kris Craig) --f46d043bdfe48a665804b9e4f853 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Bleh well that's just semantics. Strict typing / type hinting is what I'm talking about; not specifically advocating one or the other. And yeah this started as an enum proposal, but it came back to this issue. I offered to move this to a separate topic but everyone seems content to just keep talking about it here. I honestly don't care either way. So long as this important discussion isn't just "tabled" yet again I'm good. --Kris 2012/2/26 =C1ngel Gonz=E1lez > On 26/02/12 05:11, Arvids Godjuks wrote: > > Kris Craig > > > > I usually just read the list, sometimes add if I have something to say > and > > I had voiced my opinion on typehinting before. And you know, just from > the > > stand of a userland developer who has 7-8 years of experience and > devoting > > myself to the excelence at PHP, i see this discussion about adding stri= ct > > typehinting to PHP as ridicilous. I cannot express my thrustration, > because > > i would probably be kicked out of the list permanently. > > The problem is that those, who are actually advocating for this, come > from > > all sorts of languages (or have moved to them some time ago) and now wh= at > > to "make php better". Sorry folks, but I have picked up a script langua= ge > > not because it has strict type hinting, but actually because it does no= t > > have it. And because in web we are working with text. Almost any data w= e > > get is text and in critical places we just check that data we have is > > actually a number and not a random string. Or is an object of certain > type. > > Or is an array. Or a valid string. And we let the PHP to handle routine > > conversions. And it's good because there can be tons of them per single > > script call. String to number and vice-verse conversions are all over t= he > > place in almost any script. They are so common, that if you would add > > strict typehinting - you would probably need a type conversion on every > > function/method call. > I'm not so sure about that. In a well-written web application, you would > typically convert them on the first layer, when receiving from the web. > On next usages, your int variables are usually ints already. > > Anyway, you seem to think that people is advocating to add strict typing > to the language, while I haven't seen that in this thread. Only to add ty= pe > hinting (and this all began with an enum proposal!), which could be eithe= r > strict or weak. > Some people positioned against typehints, have been much more vocal > against strict, of course, as that has much more ground. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d043bdfe48a665804b9e4f853--