Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93562 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32430 invoked from network); 26 May 2016 12:24:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 12:24:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.85 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.85 mx104.easyname.com Received: from [77.244.243.85] ([77.244.243.85:41806] helo=mx206.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/C2-17600-10BE6475 for ; Thu, 26 May 2016 08:24:34 -0400 Received: from cable-81-173-133-15.netcologne.de ([81.173.133.15] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b5uL0-0005ht-O2; Thu, 26 May 2016 12:24:30 +0000 Reply-To: internals@lists.php.net References: <7B.12.14311.F79C5475@pb1.pair.com> <1b12b09f-f190-dca0-51d9-468e9c571268@fleshgrinder.com> <4ec823c6-b039-fc91-7c78-60d67719cd81@gmail.com> <00482771-3a07-06cf-ee8d-cd83a301c7e7@fleshgrinder.com> <1ac579b7-6bf3-f362-c045-0261abcfa17c@fleshgrinder.com> <2f058fee-f230-739f-4ed5-ff7d0cabe924@fleshgrinder.com> <7c3f6b51-f93b-c69f-a592-7bb0a00586e6@gmail.com> <528dd5dc-0e17-d766-a83f-02e2429277fa@fleshgrinder.com> To: Rowan Collins , internals@lists.php.net Message-ID: <27df5e8c-2829-4a2a-026e-5c30ebe1ad00@fleshgrinder.com> Date: Thu, 26 May 2016 14:24:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="r96h8QJoT9pJjvoJT9RnBI7T59BS0rXhR" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: php@fleshgrinder.com (Fleshgrinder) --r96h8QJoT9pJjvoJT9RnBI7T59BS0rXhR Content-Type: multipart/mixed; boundary="mbapdik0ckLtf9hxSP2q6QL9OI445nWR8" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rowan Collins , internals@lists.php.net Message-ID: <27df5e8c-2829-4a2a-026e-5c30ebe1ad00@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties References: <7B.12.14311.F79C5475@pb1.pair.com> <1b12b09f-f190-dca0-51d9-468e9c571268@fleshgrinder.com> <4ec823c6-b039-fc91-7c78-60d67719cd81@gmail.com> <00482771-3a07-06cf-ee8d-cd83a301c7e7@fleshgrinder.com> <1ac579b7-6bf3-f362-c045-0261abcfa17c@fleshgrinder.com> <2f058fee-f230-739f-4ed5-ff7d0cabe924@fleshgrinder.com> <7c3f6b51-f93b-c69f-a592-7bb0a00586e6@gmail.com> <528dd5dc-0e17-d766-a83f-02e2429277fa@fleshgrinder.com> In-Reply-To: --mbapdik0ckLtf9hxSP2q6QL9OI445nWR8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/26/2016 1:57 PM, Rowan Collins wrote: > I am definitely in favour of this from a language point of view. The > notice is warning about *initialization*, not *declaration*, so it make= s > sense to warn on "var $foo" and not "var $foo =3D null". >=20 > The only thing I'm not sure is what the impact would have on the > internals, which may be why it doesn't already work that way. With a > simple variable the notice can be easily raised based on the variable > name not being in the current symbol table; with an object property, th= e > name *is* in the relevant table, because it's been *declared* even > though it hasn't been *initialized*. Thus you need some extra flag to > track that a declared property exists but has never been written to. >=20 > But it sounds like typed properties require adding some such overhead > anyway... >=20 > Regards, Looking at `zend_object_handlers.c` and `zend_std_read_property` there is the line: retval =3D &EG(uninitialized_zval); This is what gives us the default null of our properties if I interpret everything correctly. This is also the place where the undefined property error comes from. We need help here from people who know the PHP source better. --=20 Richard "Fleshgrinder" Fussenegger --mbapdik0ckLtf9hxSP2q6QL9OI445nWR8-- --r96h8QJoT9pJjvoJT9RnBI7T59BS0rXhR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXRur2AAoJEOKkKcqFPVVrBRQP/j6Qi/cFDt+aPzvWsFQcFi4R SPh0uLTo1803Bk4dNLdKUCKIMIr5xMo2FJCYCWNqdt+4mp8tBJGzNmfXDbCjbML+ Vil5nDPJRL38LIkIW2Cbylm3AHshtkZeazqH55Uz8gD5Dc434vEsISIo+xfTQDcO B7nVy4ybqmbYy2YrfFQAmHsWvy9qtFMgi2SDARNdTROK54S5TgDQ6wn79jX/LmAu ek7zCONFIDDNAPvCaOmWXtykobMBZ26SCS5CcHRQSjxRmbIqxTPnOhBtyUUefc8u 6majPh/0v7VuEd99qKs1+tFamRTSrSY5O928xl4qB/EyO6l7xk4wcifpHwU53yLE qZuGdUcww1vJ752ZfWClX2dUMe8s5QvAnM7uHiUPWMabcq1A2r0PcKCQsFKVtbw2 2ntZLTK+u/J5zY8eWGl5BnFomy+e7ywjztbTtJtwuxL8Yg5RONTHQUi8+VsqHHf4 j7hZBPwkopimEEKYSqXMbnMZLsnBv6qlwIEHVwi8ybT5a52SVSNwf2CskJa7Mur4 O6Sw5Md8f7NVkmFVejyG/MN8d5FyHsLf9npuDPmQ+pBV32oUciyeCbrgXxub2njp E+GVyShjR6T8cWa3buf5MJxuGG8zSXWinMDWL2wqTgSRjzkEgkfRllOWjbEK2Zb1 8lllc1e+rTAFz5eI0FN3 =2xsz -----END PGP SIGNATURE----- --r96h8QJoT9pJjvoJT9RnBI7T59BS0rXhR--