Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87127 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8156 invoked from network); 13 Jul 2015 01:34:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2015 01:34:37 -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.220.49 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.49 mail-pa0-f49.google.com Received: from [209.85.220.49] ([209.85.220.49:33627] helo=mail-pa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/72-17022-CA513A55 for ; Sun, 12 Jul 2015 21:34:36 -0400 Received: by padck2 with SMTP id ck2so33442567pad.0 for ; Sun, 12 Jul 2015 18:34:33 -0700 (PDT) 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 :subject:references:in-reply-to:content-type; bh=DxLC2vxiusAdHfQxcqkSAoqNDQ+FN0o/WVdLMcNGiRg=; b=bH6x+ls9/4DyFd6kxbohQRsQW4KAHFWuFA1Dx3ivIbNlSWnOKcuow5vtXu7PFBcrou rYppB4IJl4kWJHa+lE2J6wHtgytW+maqecNt+ZzQiPnudRDSun1v6hTx+TfG2v05CQ95 5bzKaPu51tTaXLP0K/6E+rX0Jl4iK7jrA1JwPQDpkAk+F5ljV7WRmul5a2xcgNONmXA3 HT4deu2rPUTLfXFfRvAq4sO0SxgF2H+Il9qemBfXufSqOpiiNyxlkWaF7UVYYHGYSrt3 VOk0KnNSNHP1nuc630OhL2GyvNSfJxiNHwIqBCTQhtZ21ftaNMxnvDJudObeanPa+tQh YbbA== X-Gm-Message-State: ALoCoQnmy5YcRPuKwKzxdbVaBmTvZsiEsb8JNENa75ZUoXyfkzrWY4A0S2WNSAR8N7jThxgeMZ4Q X-Received: by 10.68.134.226 with SMTP id pn2mr63870056pbb.86.1436751273481; Sun, 12 Jul 2015 18:34:33 -0700 (PDT) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by smtp.googlemail.com with ESMTPSA id wa4sm16829103pab.17.2015.07.12.18.34.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2015 18:34:31 -0700 (PDT) Message-ID: <55A315A6.1080104@lerdorf.com> Date: Sun, 12 Jul 2015 18:34:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Larry Garfield , internals@lists.php.net References: <55A16375.4000707@php.net> <55A220D8.3090004@gmail.com> <55A2C1F2.8000301@garfieldtech.com> <55A30267.10204@lerdorf.com> In-Reply-To: <55A30267.10204@lerdorf.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b8gMfkqnOb3iqiPvjUnjHmta8bHhpeSr2" Subject: Re: [PHP-DEV] PHP7 and types From: rasmus@lerdorf.com (Rasmus Lerdorf) --b8gMfkqnOb3iqiPvjUnjHmta8bHhpeSr2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/12/2015 05:12 PM, Rasmus Lerdorf wrote: > On 07/12/2015 12:37 PM, Larry Garfield wrote: >> I don't know why we're even talking about IDEs here. IDE >> auto-completion isn't the point, anymore than it was the point for >> scalar type hints or return type hints. It's about the language doing= >> type checking for you and static analysis, so that the language can fi= nd >> bugs for you. Eg: >> >> class Foo { >> public Bar $bar; >> } >> >> $f =3D new Foo(); >> $f->bar =3D new Baz(); // This line is clearly wrong and the compiler = can check it for you By the way, I forgot to add that you can't possibly say that this line is clearly wrong without knowing what Baz is and you didn't define Baz. So the only thing clearly wrong with that line is that the Baz class doesn't exist which has nothing to do with the property type. If you have: class Bar { } class Baz extends Bar { } Then that line is perfectly valid since Baz is an instance of Bar which would meet the type criteria provided. And this also shows that the compiler can't actually check that necessarily. We don't know whether Baz is an instance of Bar at compile-time. -Rasmus --b8gMfkqnOb3iqiPvjUnjHmta8bHhpeSr2 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 iEYEARECAAYFAlWjFaYACgkQlxayKTuqOuAawQCcC7Wk2MPaFWKoBeP3VCJys6RO E5sAn0mR2EaI0OtV3fhMFtrpfV95HEXA =i/Su -----END PGP SIGNATURE----- --b8gMfkqnOb3iqiPvjUnjHmta8bHhpeSr2--