Bug #78226 [Asn->Csd]: Unexpected __set behavior with typed properties

From: Date: Fri, 25 Oct 2019 14:32:27 +0000
Subject: Bug #78226 [Asn->Csd]: Unexpected __set behavior with typed properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223461@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 Updated by: nikic@php.net Reported by: dirk dot gerigk at tui dot com Summary: Unexpected __set behavior with typed properties -Status: Assigned +Status: Closed 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: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=f1848a4b3f807d21415c5a334b461d240b2a83af Log: Fix bug #78226: Don't call __set() on uninitialized typed properties Previous Comments: ------------------------------------------------------------------------ [2019-10-24 10:02:40] nikic@php.net 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 ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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

« previous php.bugs (#223461) next »