Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93548 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78876 invoked from network); 26 May 2016 00:11:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 00:11:32 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.153 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.153 blu004-omc4s14.hotmail.com Received: from [65.55.111.153] ([65.55.111.153:53449] helo=BLU004-OMC4S14.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/73-14311-23F36475 for ; Wed, 25 May 2016 20:11:31 -0400 Received: from BLU436-SMTP213 ([65.55.111.136]) by BLU004-OMC4S14.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 25 May 2016 17:11:27 -0700 X-TMN: [NYO7WdOq+n8IqLX1x9XkwxRRIc1wEqw1] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="windows-1252" MIME-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) In-Reply-To: Date: Thu, 26 May 2016 02:11:22 +0200 CC: Thomas Bley , ajf@ajf.me, internals@lists.php.net, ocramius@gmail.com, bensor987@neuf.fr, Niklas Keller Content-Transfer-Encoding: quoted-printable References: <7B.12.14311.F79C5475@pb1.pair.com> <1b12b09f-f190-dca0-51d9-468e9c571268@fleshgrinder.com> <20160525213546.D7EE41A801B3@dd1730.kasserver.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.3112) X-OriginalArrivalTime: 26 May 2016 00:11:25.0687 (UTC) FILETIME=[24834870:01D1B6E3] Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: bobwei9@hotmail.com (Bob Weinand) > Am 25.05.2016 um 23:56 schrieb Stanislav Malyshev = : >=20 > Hi! >=20 >> var_dump($a->w); // Fatal error, uninitialized... >=20 > This means every read access to a property should be checked for it > being typed, and every access to a typed property should be checked = for > it being initialized. I'm concerned there might be a performance hit = for > this. >=20 > Also, this means no access for a property - even defined one - is = safe, > and if you want to avoid fatal errors, you need to check every access, > at least if you suspect typed properties may be involved. And, of > course, there's no function in the RFC to actually check it. > --=20 > Stas Malyshev > smalyshev@gmail.com Hey Stas, this is pretty much a non-issue (perf-wise) as we anyway need to check = against IS_UNDEF to emit a notice and return null, even with normal = properties. Also, property access never was safe. Consider: $obj =3D new class { public $foo; function __construct() { unset($this->foo); } function __get($prop) { throw new Exception("No $prop for you today!"); } }; var_dump($obj->foo); // exception. isset() checks will continue to work. It's just about getting a *value*. = (and to check whether it's a typed property, there's Reflection support = in the RFC.) This definitely is no problem. Bob=