Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74821 invoked from network); 26 May 2016 16:52:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 16:52:19 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:35466] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/DA-17600-2C927475 for ; Thu, 26 May 2016 12:52:19 -0400 Received: by mail-wm0-f46.google.com with SMTP id a136so36226308wme.0 for ; Thu, 26 May 2016 09:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=tVlBfebJ8Xg4IrcX5unM+AJhRywepYq9n4EdJ+rhCwc=; b=DrEOCMXv9//BJf55G3Xl3oU/0qf/L4Qm3PViKcwM09COioeFzQhCQuK6hZzGDJG6sc Xqb9rXcCUHcsALgwc+W5ri9R/oX9QuyVyqYCSN51mEw3M9yQsk1BHke8qmNRdLNw/iUK JuCRealz873VGPgQzdTbqglkbYx3jotvzDbAF9YfB4EtEr4a75qbTTcOiKVkVDB2oPL5 FHliRJPAWppWAk+o4XuglYEaARkIlo6oTGK76JN8ysPxMsGZY4rEgm5mDWmS+KAq2XJv RR70xj4ojJlsU8J7CkwJuwEIbtSRS5RDCs0Z89anwV/vXAYm3ghB9ZL++FOgqrrRqek/ 102Q== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tVlBfebJ8Xg4IrcX5unM+AJhRywepYq9n4EdJ+rhCwc=; b=BJulVe4UiffgSFFcmnxIEPmQNG5QSsIA7SpWyyvmGch0uKN6Qb1r74WgPFID28AvoL FuTWXRIg1hP32VfxqetG2YFprIkzyfP7KgsXpy0pSJkbjFvwVs+8Xigv9ZPpcRplROtn MC4PFq3sGwYnYLJMhKFqFNBT/M+LijBtftUFGX+aMGPYHRU5BhgrgkIjHKowDBqkihgW 2xsScqX7Qg3MQXUh66VwJZMjTX2pkwPLkGjc3Kigjfwq2UsaUIW+l9gwNuts94aGynhd /udHu0JCKHYDtcO1s4N/kaHyDtjYG7JnAgnSOEn4FEJvVfuCZnwaqNCmnmJbwxgnb6FC /Xrw== X-Gm-Message-State: ALyK8tJKJOW3LGKJL4xDfgJPOtb6sbc6UCTboBhA+vpGlNs9dmWtSoR+JQynZ6cYyZz0Ow== X-Received: by 10.28.232.152 with SMTP id f24mr4456068wmi.45.1464281535565; Thu, 26 May 2016 09:52:15 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id gk6sm15183769wjc.31.2016.05.26.09.52.14 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 09:52:14 -0700 (PDT) To: internals@lists.php.net References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> Message-ID: Date: Thu, 26 May 2016 17:50:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: rowan.collins@gmail.com (Rowan Collins) On 26/05/2016 17:30, Fleshgrinder wrote: > class O { > public int $x; > } > echo (new O)->x; // null + E_NOTICE As I'm sure has already been pointed out (I haven't followed the whole thread) this defeats a large advantage of typed properties - I now can't read from the property without checking if it's null, so I can't do this: class O { public \DateTimeImmutable $d; } echo (new O)->d->format('Y-m-d H:i:s'); There's no ? on the type def, so I ought to be able to trust the type. A TypeError makes more sense here, because it is a programming error for it to be in this state. Regards, Rowan Collins [IMSoP]