Bug #72408 [Opn->Fbk]: Coalescing operator on classes with overridden __get() method and NOT __isset()
| From: | requinix@php.net | Date: | Wed, 15 Jun 2016 11:33:27 +0000 |
| Subject: | Bug #72408 [Opn->Fbk]: Coalescing operator on classes with overridden __get() method and NOT __isset() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201644@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72408&edit=1
ID: 72408
Updated by: requinix@php.net
Reported by: kostasxx at gmail dot com
Summary: Coalescing operator on classes with overridden
__get() method and NOT __isset()
-Status: Open
+Status: Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Linux 4.1.13
PHP Version: 7.0.7
Block user comment: N
Private report: N
New Comment:
Why is the first test supposed to call __get but the second should not? Neither $attribute1 nor
$attribute2 exist so the behavior should be the same for both.
Previous Comments:
------------------------------------------------------------------------
[2016-06-15 07:27:17] kostasxx at gmail dot com
Description:
------------
When __get() method is overridden in a class and NOT the __isset(), when the null coalescing
operator is used, the __get() is triggered instead of native isset().
This issue is related to https://bugs.php.net/bug.php?id=71359
Test script:
---------------
https://3v4l.org/RMS3W
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72408&edit=1