Re: [RFC] Lazy Objects

From: Date: Thu, 18 Jul 2024 10:18:30 +0000
Subject: Re: [RFC] Lazy Objects
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
 Hi,

Minor point: Why is the $initializer return type null, instead of void?  I
>> don't see a purpose to allowing an explicit null return and nothing else..
>>
>
> Updated to use "void". Both would work :)
>
>
Super minor nitpick: You have updated the prototype, but not the
explanation text which still says:

When initialization is required, the $initializer is called with the object
> as first parameter. The initializer should initialize the object, and must
> return null (or void). See the “Initialization Sequence” section.
>

However, given the :void return type, you can’t return null - that
would be a fatal error.

The phrase should probably be

When initialization is required, the $initializer is called with the object
> as first parameter. The initializer should initialize the object. See the
> “Initialization Sequence” section.
>

Philip


Thread (95 messages)