> If we're talking syntax and introducing new keywords anyway, why not go
with a new language construct like `is_initialized($obj->property)` ?
It was one of my suggestions at the beginning of the thread. Also, I said
that I'd love the "$objectVar->property is uninitialized" (answering to
Larry)
b
On Sat, May 18, 2024 at 4:41 PM Rowan Tommins [IMSoP]
wrote:
>
> On 18/05/2024 11:52, Luigi Cardamone wrote:
> > Are there any downsides in adding a
> > specific syntax to check if a property
> > is initialized with any value?
>
> In my opinion - and I stress that others may not share this opinion
On 20-5-2024 19:41, Erick de Azevedo Lima wrote:
> All of which is to say that, yes, there are use cases for an "is
this property initialized" check that is less fugly than the
get_object_vars() hack I have to rely on now.
I'd like to see this:
if ($objectVar->property is uninitialized) {
...
On 18/05/2024 18:08, Rowan Tommins [IMSoP] wrote:
>
> In my opinion - and I stress that others may not share this opinion -
> the entire concept of "uninitialized properties" is a wart on the
> language, which we should be doing our best to eliminate, not adding
> more features around it.
>
> As
> All of which is to say that, yes, there are use cases for an "is this
property initialized" check that is less fugly than the get_object_vars()
hack I have to rely on now.
I'd like to see this:
if ($objectVar->property is uninitialized) {
...
}
or/and:
if ($objectVar->property is initialized)
On Sat, May 18, 2024, at 5:41 PM, Rowan Tommins [IMSoP] wrote:
> On 18 May 2024 17:13:49 BST, Larry Garfield wrote:
>>However, that breaks down with readonly properties, which are not allowed to
>>have a sentinel. Uninitialized is their sentinel, for better or worse.
>
> Sorry, I don't understan
On 18 May 2024 17:13:49 BST, Larry Garfield wrote:
>However, that breaks down with readonly properties, which are not allowed to
>have a sentinel. Uninitialized is their sentinel, for better or worse.
Sorry, I don't understand this statement at all. A readonly property can be set
to PatchSt
On Sat, May 18, 2024, at 9:40 AM, Rowan Tommins [IMSoP] wrote:
> On 18/05/2024 11:52, Luigi Cardamone wrote:
>> I am already using a solution like the one
>> proposed by Robert: it works but it
>> leaves some doubts since each project
>> can have a different name for NotSet
>
>
> An argument is oft
On 18/05/2024 11:52, Luigi Cardamone wrote:
I am already using a solution like the one
proposed by Robert: it works but it
leaves some doubts since each project
can have a different name for NotSet
An argument is often made that this is a good thing, in the sense that
"null" and other "univer
> I am already using a solution like the one
> proposed by Robert: it works but it leaves some doubts since each project
> can have a different name for NotSet while it seems a general concept of
the language
Hi everyone.
I just thought of some ways to standardize this:
1 - Create an RFC to crea
On Sat, May 18, 2024 at 12:52 PM Luigi Cardamone
wrote:
>
> Thank you for your feedback.
>
> I am already using a solution like the one
> proposed by Robert: it works but it
> leaves some doubts since each project
> can have a different name for NotSet
> while it seems a general concept of the
> l
Thank you for your feedback.
I am already using a solution like the one
proposed by Robert: it works but it
leaves some doubts since each project
can have a different name for NotSet
while it seems a general concept of the
language.
Besides the example I proposed, I think
that there are many case
On Fri, May 17, 2024 at 11:43 PM Luigi Cardamone
wrote:
>
> Hello Internals,
> during last PHPDay in Verona I discussed this topic with some of
> you and it was suggested to me to send an email here.
>
> Here is an example to describe my problem. Imagine a simple
> DTO like this:
>
> class MyDTO{
Hi Luigi
On Fri, May 17, 2024 at 11:40 PM Luigi Cardamone
wrote:
>
> Here is an example to describe my problem. Imagine a simple
> DTO like this:
>
> class MyDTO{
> public ?int $propA;
> public ?int $propB;
> }
>
> Imagine that a Form processor or a generic mapper fill some of
> these fie
On Fri, May 17, 2024, at 9:40 PM, Luigi Cardamone wrote:
> Hello Internals,
> during last PHPDay in Verona I discussed this topic with some of
> you and it was suggested to me to send an email here.
>
> Here is an example to describe my problem. Imagine a simple
> DTO like this:
>
> class MyDTO{
>
Hello Internals,
during last PHPDay in Verona I discussed this topic with some of
you and it was suggested to me to send an email here.
Here is an example to describe my problem. Imagine a simple
DTO like this:
class MyDTO{
public ?int $propA;
public ?int $propB;
}
Imagine that a Form pr
16 matches
Mail list logo