Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91723 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62856 invoked from network); 16 Mar 2016 23:30:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2016 23:30:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:37727] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/00-62552-48CE9E65 for ; Wed, 16 Mar 2016 18:30:13 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 270E244DFC; Thu, 17 Mar 2016 00:30:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-46-244-174-245.dynamic.mnet-online.de [46.244.174.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 1C14244DFC; Thu, 17 Mar 2016 00:30:08 +0100 (CET) Message-ID: <1458171004.3969.27.camel@kuechenschabe> To: Phil Sturgeon Cc: "internals@lists.php.net" Date: Thu, 17 Mar 2016 00:30:04 +0100 In-Reply-To: References: <1458149992.3969.2.camel@kuechenschabe> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-hVLXqPpFjV0cGGWTOT6u" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-hVLXqPpFjV0cGGWTOT6u Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2016-03-16 at 15:29 -0400, Phil Sturgeon wrote: > > What's expected here: > > > > class A { > > public int $i; > > } > > > > $a =3D new A(); > > $r =3D &$a->i; > > $r =3D "foobar"; > I put your code into 3v4l so you could see what would happen: >=20 > https://3v4l.org/taC8D >=20 > Fatal error: Uncaught TypeError: Typed property A::$i must not be referen= ced >=20 > Is that what you expect? If not, what would you expect? Well, I think a na=C3=AFve user would expect to get an error about "foobar" not being an integer and would expect $r =3D 42; to work. Maybe the other example from the discussion with Bob might be more clear about the issue: class A { private array $data =3D [42, 23]; public function sort() { sort($this->data); print_r($this->data); } } $a =3D new A(); $a->sort(); An "Uncaught TypeError" is completely unexpected there. btw. while testing this it seems the patch is broken: https://3v4l.org/sOBca/rfc#tabs - this gives a strange error ("A::$data must be array, unknown used") in the print_r call!? https://3v4l.org/kl5e2/rfc#tabs - this changes the type johannes --=-hVLXqPpFjV0cGGWTOT6u Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJW6ex8AAoJEH3sTmn8nIPXbUMIAK+7pEDtrpzILJ86G8opzTVU OCaaGVVxgVGU/IHZXgRCTpI2CYx0odHrn+uyulDLs8eZbfqPtdeg3EopzMwzJQEM Ias0GESoXrlZpmln819r4SfFajADf5gdzfa3qjGg1U1niy5Q0iSMEAckQq0t+CQb 4cQSFTRbTvct0whIpcIM6H9LJuyI5Ub513Vd1k4RlGf0bmP0bhkvbRKLimpntlgw fBGq7eVltFCEKtVryQUC5vJhXpfpOCO8qKSJFq5uUQou5Zicar8l9gntb4ves7b2 /pupg0JuUvop91Fxr/zmU35cogZeynmkeIpUwXElx504+2Glnoy73uuswA7pxeY= =GDkl -----END PGP SIGNATURE----- --=-hVLXqPpFjV0cGGWTOT6u--