Bug #78226 [PATCH]: Unexpected __set behavior with typed properties

From: Date: Thu, 24 Oct 2019 10:02:40 +0000
Subject: Bug #78226 [PATCH]: Unexpected __set behavior with typed properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223451@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78226&edit=1

 ID:                 78226
 Patch added by:     nikic@php.net
 Reported by:        dirk dot gerigk at tui dot com
 Summary:            Unexpected __set behavior with typed properties
 Status:             Assigned
 Type:               Bug
 Package:            Class/Object related
 Operating System:   Linux
 PHP Version:        7.4Git-2019-06-28 (Git)
 Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

The following pull request has been associated:

Patch Name: Don't call __set() on uninitialized typed properties
On GitHub:  https://github.com/php/php-src/pull/4854
Patch:      https://github.com/php/php-src/pull/4854.patch


Previous Comments:
------------------------------------------------------------------------
[2019-10-23 17:48:38] nikic@php.net

Related To: Bug #78744

------------------------------------------------------------------------
[2019-09-11 09:54:57] nikic@php.net

The following pull request has been associated:

Patch Name: Don't invoke __set() on accessible declared but unset properties
On GitHub:  https://github.com/php/php-src/pull/4696
Patch:      https://github.com/php/php-src/pull/4696.patch

------------------------------------------------------------------------
[2019-08-18 13:26:50] nikic@php.net

I think we'll have to change the semantics of __set to not be called for properties that are
declared but unset (or uninitialized).

------------------------------------------------------------------------
[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

------------------------------------------------------------------------


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


Thread (11 messages)

« previous php.bugs (#223451) next »