Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93518 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7070 invoked from network); 25 May 2016 17:11:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 17:11:08 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:35647] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/65-14311-BACD5475 for ; Wed, 25 May 2016 13:11:07 -0400 Received: by mail-wm0-f53.google.com with SMTP id a136so136795160wme.0 for ; Wed, 25 May 2016 10:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8phiTrjGWPS63xN/C4GFM8a7vH1cnU+r2R1wcL8omxA=; b=0BNU05fH8cvyDVsKb/Ylf9gcH9TvF5MkfU6JH2crjx0Wk8MmQjTHu98H0cnV48i7uF OgJLjDvzYp9vF2S+GeWj1Z74a0Vee+a7Vpe9B0OW3MmwYbUWGLbD77al+ylkcRoemvqB L7r1ol11e6a9eBiSpNqkPBSIzjs67UpZmRl+XVpfyZPRChovJ0KbeoetzITg2KNEmFax E0EQeeHORM7s5YdxqM3I669J+k3Qmwpl/i9eAE3HrzTPFEFfjvsqd3TRmUDGOS5IuUXU VLJZ/K/Zhsg691zn/ASO4DNw53ReGyUSB4MfXHWD73yp/Ws8/tYD81hAMJeScNueLHhd g5ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8phiTrjGWPS63xN/C4GFM8a7vH1cnU+r2R1wcL8omxA=; b=FriGy5skDg826agqf833KOJXK3tRMdfL7jlpwOcDkCEC2IZOznjpd058a7DPyXpkK2 iRam9HgLj9WJ4ryUmeKDvokPm6hC3cMB28Xzd7orMkh6USchMHO3ZXWnNqrcPsazg8oT ljB6G12V8fIChTxrUkxo2tvAW4upwnlUshHMrQabL1yx6WBu1qJuWQPrqnCfA/fepulr /r5UmY0AYafEo+j5S3DICK9y85jB6uK2+dCDpbCYcxIjpB+G5fxJU9PDaSXOhoHoCgt4 6myxqX+irdgOGyNWfYOzCKYELhOPQtunyC10caX5b9b33gO+sGGnyFBPwTBsMvAyh1z9 IU2g== X-Gm-Message-State: ALyK8tLuBWBOx3BgrJ7hF+OIs/+9Vt9FwecYz85agjJX+X5r6RRtlnvNhasEwpMe23+mK11uIDbdivUuzxhk0Q== X-Received: by 10.194.15.8 with SMTP id t8mr4842150wjc.177.1464196264632; Wed, 25 May 2016 10:11:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.35.225 with HTTP; Wed, 25 May 2016 10:10:44 -0700 (PDT) In-Reply-To: References: <7B.12.14311.F79C5475@pb1.pair.com> Date: Wed, 25 May 2016 19:10:44 +0200 Message-ID: To: Niklas Keller Cc: Bob Weinand , Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary=047d7b66fddd3c2b6b0533adc279 Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: ocramius@gmail.com (Marco Pivetta) --047d7b66fddd3c2b6b0533adc279 Content-Type: text/plain; charset=UTF-8 Since there are so many questions about nullable state (the default, in PHP), would it make sense to enforce nullable types, for now? Specifically, the current RFC could be simplified until further clarity is made on how non-nullability behaves: * we'd enforce users to always have `private ?Type $foo;` in their signatures for 7.1 * we'd allow `private Type $foo;` for 7.2, when the behavior of non-nullable properties is fully clarified * until then, `private Type $foo;` will cause a parser error I'm just trying to simplify things to get such a feature in, as type checking on object properties is a huge and very beneficial addition. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 25 May 2016 at 19:00, Niklas Keller wrote: > > > > There is a difference between not set and no meaningful value. > > > > In PHP, there's no such difference for properties. And I think we should be > consistent with the existing behavior here. > > > > The former is literally unset(), the latter is null. The only semantics > > PHP exposes here is that not set can be upgraded to "no meaningful" value > > in form of null with a notice. > > > > The difference thus is quite minor, but semantically important. > > Hence to *set* the value, we need to explicitly set null. > > > > If we don't do it this way, we won't have a way to explicitly *set* > > nullable properties to a value (null in this case). (without explicit > unset > > in ctor). > > > > Bob > --047d7b66fddd3c2b6b0533adc279--