Edit report at https://bugs.php.net/bug.php?id=78226&edit=1
ID: 78226
Updated by: nikic@php.net
Reported by: dirk dot gerigk at tui dot com
Summary: Unexpected __set behavior with typed properties
-Status: Open
+Status: Assigned
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: 7.4Git-2019-06-28 (Git)
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
I think we'll have to change the semantics of __set to not be called for properties that are
declared but unset (or uninitialized).
Previous Comments:
------------------------------------------------------------------------
[2019-08-14 12:47:32] tandrewbennett at hotmail dot com
For what it's worth, I think that a lot of the use cases for using __set() in userland code are
based on devs trying to roll their own property accessor syntax for their entities, value objects,
etc. I think this new behavior would be a non issue if we had something like this: https://wiki.php.net/rfc/propertygetsetsyntax-v1.2
I know there are differing opinions regarding the specific syntax (some prefer a C# style syntax
while other prefer an ES6 based approach), but I still think it's worth mentioning here,
perhaps for future releases.
------------------------------------------------------------------------
[2019-08-13 20:51:44] nikic@php.net
Related To: Bug #78411
------------------------------------------------------------------------
[2019-08-05 07:55:14] nikic@php.net
Related To: Bug #78372
------------------------------------------------------------------------
[2019-07-23 07:08:58] wanghao at imwh dot net
The behavior is quite surprising.It make me upset.
------------------------------------------------------------------------
[2019-06-28 15:23:07] dirk dot gerigk at atraveo dot com
Ignore my last question in the last comment. :-)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78226
--
Edit this bug report at https://bugs.php.net/bug.php?id=78226&edit=1