Bug #77291 [Ana->Csd]: __isset() magic method doesn't work if implemented via a trait.

From: Date: Sun, 16 Dec 2018 12:43:20 +0000
Subject: Bug #77291 [Ana->Csd]: __isset() magic method doesn't work if implemented via a trait.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218467@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77291&edit=1 ID: 77291 Updated by: cmb@php.net Reported by: tandrewbennett at hotmail dot com Summary: __isset() magic method doesn't work if implemented via a trait. -Status: Analyzed +Status: Closed Type: Bug Package: *General Issues Operating System: Ubuntu 16.04 PHP Version: 7.3.0 Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=0061db5503497458a85c40fb6bf1e2da80e7a036 Log: Fix #77291: magic methods inherited from a trait may be ignored Previous Comments: ------------------------------------------------------------------------ [2018-12-14 19:30:43] cmb@php.net The following pull request has been associated: Patch Name: Fix #77291: magic methods inherited from a trait may be ignored On GitHub: https://github.com/php/php-src/pull/3707 Patch: https://github.com/php/php-src/pull/3707.patch ------------------------------------------------------------------------ [2018-12-14 19:13:55] cmb@php.net Thanks for reporting this issue, and for providing a simple reproducer! This regression has been introduced with commit 43aca31[1]. It is not particularly related to namespaces, and does not only affect __isset(), but rather all magic methods which are inherited from a trait, whose name has the same length as the class name, see, for instance, <https://3v4l.org/0jmp1>. ------------------------------------------------------------------------ [2018-12-14 00:34:47] tandrewbennett at hotmail dot com Also, here is an updated version from 3v4l.org (wrapping in namespaces triggers the error) if you don't want to clone down the demo repo I created. https://3v4l.org/rSfeG ------------------------------------------------------------------------ [2018-12-13 23:32:30] tandrewbennett at hotmail dot com So this seems to go beyond the scope of what I originally thought. I think this is somehow related to autoloading (but I'm not quite sure). I've created a sample app to reproduce the error: git clone git@github.com:tabennett/php-7.3.0-error.git CD into the app composer install vendor/bin/phpunit If you rename Foo to a class that has two words (e.g FooBar) this error goes away! Alternatively, if you set the PSR-4 namespace in composer.json to something with two words it also goes away. ------------------------------------------------------------------------ [2018-12-13 09:31:04] danack@php.net This appears to work for me on PHP 7.3.0 https://3v4l.org/i9Lpv Please can you try with OPCache disabled, and/or disabling any non-core extensions you have enabled? ------------------------------------------------------------------------ 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=77291 -- Edit this bug report at https://bugs.php.net/bug.php?id=77291&edit=1

« previous php.bugs (#218467) next »