Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63355 invoked from network); 25 May 2016 22:03:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 22:03:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.52 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.52 mail-pa0-f52.google.com Received: from [209.85.220.52] ([209.85.220.52:35477] helo=mail-pa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/80-14311-C4126475 for ; Wed, 25 May 2016 18:03:56 -0400 Received: by mail-pa0-f52.google.com with SMTP id fy7so5384900pac.2 for ; Wed, 25 May 2016 15:03:56 -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=YUnoEwoTeIPF5Vu+M54U5D5Ble8Ujq680a6n9cR/WNI=; b=RyVUi0gDyAXzwR5KeGAItdV3UzIocNhBJEqVr79Gg/R6hzBByDlGjNYrW/ODgmZDZG Vi9ULLRdC1r7MJ+XebNkqYuFEXsXHV/K4FXG7DKjCH8qm171+VFVDDvfkQsXoiUu6aKf 924oDwQmfuOfDZH6hy/q7f1d6aUvsHHxY4z3Z9ZmNEykIuJEatVYcxag4jrZMCw9ljwV sGMA9tAsqQUz3xXS1dt+DMkE1H25F5o+SVwlO0yydqc6gaDSkxHJUAWq7eOoTMNRn3iX 7g7JCRtWUeByXbWDCufeOj8uLQhHFlxfjx9mGtnlQ1UhiKI0JsRpsxdVBCPl/T9yM5df q5QA== 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=YUnoEwoTeIPF5Vu+M54U5D5Ble8Ujq680a6n9cR/WNI=; b=OzD5P5b5vuTCESzwXJqTwkypb4+VoTplbzk1XaVUw2l8Gtx7uleYnQ2xG0PZg7MI75 OGjqLUYv9XTXzdM9PCemZHqKAcVCOmS5n9790bao/E+X1MreQPDur8oMiMNEmn6BM/pL C5dY66Ykai82246hpkj2ZHkKobKXfHB2zFizh9kHL5RFh27h7RovKlzy+qCApPIq5AmD hp7Bj//++dygGHCyeT1yW3voUj7G/OrHGffpc3lFiaWWGjJJacIAHvVMsyih0/yQd4Mq MLP6XEZ8GGBm3n9VLjXaOk0PrUjFeqVPG5oMiAaOPSHkXLD5qaFj496lL6QTnGbEWxS1 lywA== X-Gm-Message-State: ALyK8tIqAbN4Fb7iIVoxUVJfG2sZRljLEpqyvSCbWf5Kf9Z+544v8cNRejzNNJkW6xSeKw== X-Received: by 10.66.242.3 with SMTP id wm3mr9129949pac.81.1464213832874; Wed, 25 May 2016 15:03:52 -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 p190sm738879pfp.46.2016.05.25.15.03.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 15:03:51 -0700 (PDT) To: internals@lists.php.net, Andrea Faulds 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> Cc: Marco Pivetta , Benoit Schildknecht , Niklas Keller Message-ID: Date: Wed, 25 May 2016 15:03:41 -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: <00482771-3a07-06cf-ee8d-cd83a301c7e7@fleshgrinder.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Andrea already said that we would not use it for untyped properties, > hence, no BC. Again, it's not that simple. Properties are not local. That means any code that can deal with a class that may have typed properties (which may be library class, for example, so you don't even know what it has inside) has to deal with the possibility of it being of the new type. So if the old code uses is_null($object->foo) as means to check if the value wasn't initialized, and it's no longer null, then that code is broken and needs to be rewritten. That's a BC break. Yes, it will never happen if you never use typed properties, and never use any libraries that might use typed properties, but then what's the point of the whole thing? The point of BC is that if you don't use new features, you don't have to change your code and it will keep working. With the proposed solution, it won't be the case. > It is not the same as null, very similar, but definitely not the same. > Think of it in DB terms: > > | table | > | ----- | > | id | > > SELECT name FROM table; > > That's not null, it's not defined (undefined, unset, ...). In other > words, null is a value and undefined/unset a state. "name" is not a value, as in if you do that in SQL, you don't get a value, you get an error. Same as if you wrote "please can I haz a pony?". It's just something the SQL can not give you, so it produces an error. What is proposed here, however, is a PHP type, not an error. That's a different thing - if you have a variable, then you have to have a value, and if you have a value, then you have to have a type. -- Stas Malyshev smalyshev@gmail.com