Bug #72160 [Opn->Dup]: isset() produces unexpected result
| From: | nikic@php.net | Date: | Wed, 04 May 2016 20:24:17 +0000 |
| Subject: | Bug #72160 [Opn->Dup]: isset() produces unexpected result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200899@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72160&edit=1
ID: 72160
Updated by: nikic@php.net
Reported by: godmod at eqdkp-plus dot eu
Summary: isset() produces unexpected result
-Status: Open
+Status: Duplicate
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: 7.0.6
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #72117. The behavior change you're seeing is caused by a number of bugs
relating to missing __isset/offsetExists calls having been fixed. Presumably your $user object not
only has a __get() method, but also an __isset() method, and that __isset() method is implemented
incorrectly. In particular, it does not return true for __isset('style').
Previous Comments:
------------------------------------------------------------------------
[2016-05-04 20:12:32] godmod at eqdkp-plus dot eu
Description:
------------
In PHP < 7.0.6, the result for
var_dump($this->user->style['template_path']);
var_dump(isset($this->user));
var_dump(isset($this->user->style));
var_dump(isset($this->user->style['template_path']));
is, as expected:
string(6) "modern"
bool(false)
bool(true)
bool(true)
But since the 7.0.6 release, it is not as expected, it is
string(6) "modern"
bool(false)
bool(false)
bool(false)
Why does the isset() return false, for the exact same code?
Please note that $user is handled by __get() method
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72160&edit=1