Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83015 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98703 invoked from network); 18 Feb 2015 00:53:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 00:53:22 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.192.42 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.42 mail-qg0-f42.google.com Received: from [209.85.192.42] ([209.85.192.42:65106] helo=mail-qg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/86-34644-182E3E45 for ; Tue, 17 Feb 2015 19:53:21 -0500 Received: by mail-qg0-f42.google.com with SMTP id z107so30813720qgd.1 for ; Tue, 17 Feb 2015 16:53:18 -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=XbLSB6mkywM0UkyQSMSuZ8OSu7LmVyByaKkCpOYkvlc=; b=EIjEuW+7g9d2Wcq4H/1sUnAK82T6QKu72Ltr2bzr422RgwfrINpr024TALBcpm1peW xIiGCOo7EIvjoMnXqhKG74slX4dwYGO8CBJnO3Ee8ihDGbK58kAI61qv8M99t1jUDyVF TJRq1a0F7vRJrdE+0fJj09Z2rSE0gQtcpZQzotSUN+CEvigLQMVsr//TRekqNEiUxwXn 8TzY22CKrY5lS3wkzzIeXAflNSXTh3f3uSAFgNwukWm3zfDkVIi/ddkyC059ngm9c/Z1 /lZk8focNU805ATC9rThWibcLZN//1d0Ubk7PIwfdAEabPvpNIWgjcIipHIQcvHbyOLT Y+ig== X-Gm-Message-State: ALoCoQlRvZbgyHE0dd7/NXbn2wkuS/IHJ9OkojgG6LZ8gLtedphZPtR7lGiOidzVNhd3buRJQf2P X-Received: by 10.140.20.23 with SMTP id 23mr124217qgi.40.1424220798179; Tue, 17 Feb 2015 16:53:18 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id z67sm16899800qgz.10.2015.02.17.16.53.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 16:53:16 -0800 (PST) Message-ID: <54E3E27B.2010903@lerdorf.com> Date: Tue, 17 Feb 2015 16:53:15 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nikita Popov , Sara Golemon CC: PHP internals References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GMhtj8BTapLBr80TH7NLewhECdrlBUlup" Subject: Re: [PHP-DEV] Scalar Type Hints v0.4 From: rasmus@lerdorf.com (Rasmus Lerdorf) --GMhtj8BTapLBr80TH7NLewhECdrlBUlup Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/17/2015 04:35 PM, Nikita Popov wrote: > I don't buy into Rasmus arguments about internal functions. They concer= n > one particular edge case (int->float coercion) and I doubt they have mu= ch > relevance if applied to codebases with pervasive use of typehints (wher= e > you can be reasonably sure of the types of your variables). Even if, fo= r > the sake of argument, we acknowledge the concern as valid we should be > discussing that particular case (int->float coercion) rather than dropp= ing > the strict typing for internal functions altogether. int->float is actually secondary to "123"->int. And while they may be edge-cases there are enough of them that we would be pushing people towards casting by default which should be a last-resort thing, not the first thing you do. -Rasmus --GMhtj8BTapLBr80TH7NLewhECdrlBUlup Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTj4nsACgkQlxayKTuqOuBt1gCeOBbKhGjr0XsC7c5Gk7vAQ+g9 YHoAnA9lulbyPU3A5AOXCz8E03rzZh2I =/csp -----END PGP SIGNATURE----- --GMhtj8BTapLBr80TH7NLewhECdrlBUlup--