Re: [RFC][Vote] Typed Properties
| From: | Fleshgrinder | Date: | Fri, 27 May 2016 18:03:58 +0000 |
| Subject: | Re: [RFC][Vote] Typed Properties | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93615@lists.php.net to get a copy of this message | ||
On 5/27/2016 7:48 PM, Rowan Collins wrote:
> On 27 May 2016 11:25:48 GMT+01:00, Fleshgrinder <php@fleshgrinder.com> wrote:
>> if (isset($row['d'])) {
>> $o->d = new DateTime($row['d']);
>> }
>>
>> No need to assign null since it already is null by default and the
>> nullable hint will not result in any errors upon accessing it.
>
> Actually, that's one of the points up for discussion: should accessing the property when
> no assignment has been made raise an E_NOTICE, so that there is a difference between "?int
> $foo" and "?int $foo = null".
>
> Regards,
>
True, I forgot and I am in favor of E_NOTICE. This was actually part of
my super confusing long example.
--
Richard "Fleshgrinder" Fussenegger
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc