Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82106 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74717 invoked from network); 8 Feb 2015 02:38:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 02:38:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.216.49 mail-qa0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:50222] helo=mail-qa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/10-07765-F3CC6D45 for ; Sat, 07 Feb 2015 21:38:56 -0500 Received: by mail-qa0-f49.google.com with SMTP id v8so16430912qal.8 for ; Sat, 07 Feb 2015 18:38:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=XIYOswQl349klWbxpGV2ZJEdoNftkEs+wuq58Kln0Fo=; b=MiCD8YoPZ/TpBG9hMB99TDQZVIkt0Njmv5xAJukpthtCBJz8OD78szLgl+/M4A2aRC UxK0rJ2Dh1eJRvTj2RbvwJf5qH0Ia/ohmdMmcgwCYq21W3Qv5kyXX7Uou7k63PFbd65g 1DgwyHiWTk2SqDkesMMt2vh4XGpKgkUL49nt+awe9pwZW5zeXoZNQFZGN17wgvNsjVgt Frdpc2KQGok7R5UeiBLmkRuaoXDrNDdWd0/lXKlkX+D3ngCYMg1tYuSQWbMlmaV+bRHk Kyrgqhgzyc5PbPDBk98Id1EmjyAwRoftgj8ZPM5utbNNAoPnK0Ds92u/+t27HzAUaDrQ x4Eg== X-Gm-Message-State: ALoCoQmh5vN62j1Wjw0IatmkrBXgVWLl+Sdse/09tyEpMl4a+4Pyvqto5oEEtdllH4DXUqOdcBJG X-Received: by 10.224.115.16 with SMTP id g16mr11286057qaq.97.1423363132050; Sat, 07 Feb 2015 18:38:52 -0800 (PST) Received: from [192.168.0.21] ([184.164.171.249]) by mx.google.com with ESMTPSA id 11sm7492294qgt.41.2015.02.07.18.38.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Feb 2015 18:38:50 -0800 (PST) Message-ID: <54D6CC39.50708@lerdorf.com> Date: Sat, 07 Feb 2015 21:38:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: =?UTF-8?B?UGF2ZWwgS291xZlpbA==?= , Andrea Faulds CC: PHP Internals References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <9E1C2427-0295-4F3E-BD29-04DA84321067@ajf.me> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I85vdVXduueJI00OX4OUGGQuitWJ2jhRM" Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: rasmus@lerdorf.com (Rasmus Lerdorf) --I85vdVXduueJI00OX4OUGGQuitWJ2jhRM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/07/2015 05:03 PM, Pavel Kou=C5=99il wrote: > I'm wishing more and more that the RFC doesn't pass (even though I'd > LOVE to have typehints in PHP as a userland developer) and someone > else will make a better version of typehints RFC for PHP 7, because > this one feels really like you took an ok-ish RFC (one that would be > good for PHP) and slapped a strict typing on it without enough > research about strong typing in other languages. And as I said myself > multiple times in the past, the declare syntax IS just ugly (and > changing how code works by writing one line is an ugly principle as > well, IMHO). :( I am not sure I would go that far. Andrea did plenty of research and has tons of experience in other languages, I just think this approach is misguided. I also wonder just how many people of those who voted even bothered to download and try the patch. I tried it a while back on some existing code and it was a nightmare. Does everyone realize that these simple things break? tan(1); echo strstr("test", "est", 1); Having absolutely no coercion for int to float and 0/1 to false/true, especially for internal functions, is just too pedantic to me. I also find this a bit hypocritical: declare(strict_types=3Dtrue); outputs: Fatal error: strict_types declaration must have 0 or 1 as its value That is obviously nit-picking, but if we are going to get this pedantic..= =2E And, you also have to realize that it isn't actually per file. For example, this: