Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92525 invoked from network); 26 May 2016 05:00:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 05:00:36 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.173 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.173 mail-pf0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:34954] helo=mail-pf0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/B4-14311-4F286475 for ; Thu, 26 May 2016 01:00:36 -0400 Received: by mail-pf0-f173.google.com with SMTP id g64so27121546pfb.2 for ; Wed, 25 May 2016 22:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=2fgNXVlwHMlpJ7X1/b10+vUF/80fhdnFdmqD6tk4opk=; b=z7jRtQKDyV/QeAo6eadaLj5V419u+8qxrKeQGyOxvn6Br5vxUt2ZMRyYwX/Kzdngcj 1S0jdkmXd0e5tJZZEeVKpUXTfXVv6FGGPW5FUneZ9z5SmDPvbvzLW1+D3kpsHQ4Fp8du JO2BmGRMexsuH2eGytGNYDns1YuuNEOujB87qQDus1ThT56VbKPvC9gFUCbt1HckqdHr sw8iTBFny2hHh1KLHbMS6npcJUlyG60eDT4VtuxkrBOF+7yl4Dyk0sAbZ0zoSPopAAX4 KGYxM/UsjHlJbwJKqJWBJ0An43Sv8m6fN81xy70W9jkhZhbM6kVVczoW+rgbAVIyNK1O aHow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2fgNXVlwHMlpJ7X1/b10+vUF/80fhdnFdmqD6tk4opk=; b=U/58dZHYhyC3ll3QwDQ0Xbt1kujaoPyydVkwKNkf5Kvw+OsGktGiVgtvPHvPuBW19z Hd3FyZornboB0JPj7hm6cFBQeBHnYdqaqJKYO4mf58f9hijoVzcpX2W3A3ijIYyu2fNg aC8e4aOUbPj/wyKL2wxnTOaqCfQzvm7G0S7qoORleeF2L36c3DiTIMCPnnFjKVNSoNhX ZbJ8bQXJ+kzawRFPpFoeNxP4q3+WccXRFV9NpUqpt+xEbKOJiE7wWDvelTK+RSGrY9Zc xyDFUJY7aY7OKcQkEwYgCHwnLbZetXeowjLtaURwzxTaYqpi2nr/jeUw9oIlYzRgA9U8 oMdg== X-Gm-Message-State: ALyK8tLztv4SlrGNs/9ZCB67cEULV5PsaRPjj4lyEvV8RAn0KsI/7XjC/PrTWGeEHfNb6w== X-Received: by 10.98.17.140 with SMTP id 12mr11231340pfr.140.1464238833777; Wed, 25 May 2016 22:00:33 -0700 (PDT) Received: from ?IPv6:2602:304:cdc2:e5f0:a925:c02c:2c13:602c? ([2602:304:cdc2:e5f0:a925:c02c:2c13:602c]) by smtp.gmail.com with ESMTPSA id zj2sm16533103pac.6.2016.05.25.22.00.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 22:00:33 -0700 (PDT) To: Bob Weinand References: <7B.12.14311.F79C5475@pb1.pair.com> <1b12b09f-f190-dca0-51d9-468e9c571268@fleshgrinder.com> <20160525213546.D7EE41A801B3@dd1730.kasserver.com> Cc: Thomas Bley , ajf@ajf.me, internals@lists.php.net, ocramius@gmail.com, bensor987@neuf.fr, Niklas Keller Message-ID: <53274ca9-98a5-ca46-94ac-57b2c61885d4@gmail.com> Date: Wed, 25 May 2016 22:00:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Also, property access never was safe. Consider: > > $obj = 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. This is different. Your code throws exception purposefully so you intend something to break here - you might as well just written exit(1) and said there's no safe code at all since you could exit at any moment. That's not what I mean. I mean that operation that was previously not prone to fatal errors just because of variable holding some value would now produce such errors - not because the user wrote code to specifically do that but because of hidden properties of the engine. If the engine would by itself insert such code as above into user classes that would be dangerous too but of course it does not. > > isset() checks will continue to work. For some definition of "work" - since it would return false for null values, but null values are actually OK. > It's just about getting a *value*. (and to check whether it's a typed property, there's Reflection support in the RFC.) You don't propose using Reflection before each variable access I presume. Reflection is useless in runtime scenario. -- Stas Malyshev smalyshev@gmail.com