Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67367 invoked from network); 26 Feb 2012 21:29:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2012 21:29:51 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-ww0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:51587] helo=mail-ww0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/24-40985-D44AA4F4 for ; Sun, 26 Feb 2012 16:29:50 -0500 Received: by wgbdt10 with SMTP id dt10so844386wgb.5 for ; Sun, 26 Feb 2012 13:29:47 -0800 (PST) Received-SPF: pass (google.com: domain of keisial@gmail.com designates 10.180.80.71 as permitted sender) client-ip=10.180.80.71; Authentication-Results: mr.google.com; spf=pass (google.com: domain of keisial@gmail.com designates 10.180.80.71 as permitted sender) smtp.mail=keisial@gmail.com; dkim=pass header.i=keisial@gmail.com Received: from mr.google.com ([10.180.80.71]) by 10.180.80.71 with SMTP id p7mr21702231wix.10.1330291787231 (num_hops = 1); Sun, 26 Feb 2012 13:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=k0HkqY5E9ZtOUeGJLq4L+PzK27vnqCiPrwkpA8Njpvg=; b=p8k/54ZUOsa3kAeMWxpojrBNGd3fodjxlO1GrmfedA/hgn2Fwu4T7DcpLkbWLWYiTT X5o+2Elax/VwkQHT2I3q3TUY0vQHpjgqAQ6kk/4wh4dvlfl0v5P918BmqoAL7Fwnmn+3 JaqLYakRUNSEwfRrrMqGCC9ruHNGVUMoCENf4= Received: by 10.180.80.71 with SMTP id p7mr17275750wix.10.1330291787068; Sun, 26 Feb 2012 13:29:47 -0800 (PST) Received: from [192.168.1.26] (33.Red-83-44-158.dynamicIP.rima-tde.net. [83.44.158.33]) by mx.google.com with ESMTPS id by4sm11830847wib.3.2012.02.26.13.29.45 (version=SSLv3 cipher=OTHER); Sun, 26 Feb 2012 13:29:46 -0800 (PST) Message-ID: <4F4AA569.10502@gmail.com> Date: Sun, 26 Feb 2012 22:34:33 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Arvids Godjuks CC: internals@lists.php.net 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Enum proposal (yet another) From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) 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 strict > 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 what > to "make php better". Sorry folks, but I have picked up a script language > not because it has strict type hinting, but actually because it does not > have it. And because in web we are working with text. Almost any data we > 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 the > 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 type hinting (and this all began with an enum proposal!), which could be either strict or weak. Some people positioned against typehints, have been much more vocal against strict, of course, as that has much more ground.