Re: [PHP-DEV] __isset() and null value

2020-09-05 Thread Rowan Tommins
Hi Michael, On 4 September 2020 18:03:29 BST, "Michael Voříšek - ČVUT FEL" wrote: >Ideally, we should introduce __exist() which should return true even if >value is null Magic methods in PHP allow the user to overload some built-in operator or behaviour, so it doesn't make sense to talk about

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
Yes, this is purely to offer native/php support for it. When implementing custom ORM etc., we do not have any control over the class, ie. extra method for checking property existance is not possible. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek, studen

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread David Rodrigues
Maybe you just can implements your own method to check? Like your exists() example. Em sex, 4 de set de 2020 15:08, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> escreveu: > Your examples provide code for checking the existance of real > properties. But how to check existance of a magic one?

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
Your examples provide code for checking the existance of real properties. But how to check existance of a magic one? The best is currently __isset(), but to comply with isset() definition, it should not return true when the magic property has null value, thus I belive, there is currently not wa

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread Marco Pivetta
Heya, On Fri, Sep 4, 2020 at 7:03 PM Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > isset() returns false for null > > __isset() should return the same, but then if magic property with null > value exists, there is no way to detect it > > Example: http

[PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
isset() returns false for null __isset() should return the same, but then if magic property with null value exists, there is no way to detect it Example: https://3v4l.org/GqUsh this is currently an limitation of php Ideally, we should introduce __exist() which should return true even if v