Bug #74188 [Opn->Ver]: Null coalescing operator issue with undeclared static class properties
| From: | requinix@php.net | Date: | Wed, 01 Mar 2017 13:39:58 +0000 |
| Subject: | Bug #74188 [Opn->Ver]: Null coalescing operator issue with undeclared static class properties | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207634@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74188&edit=1
ID: 74188
Updated by: requinix@php.net
Reported by: pandenitz at mail dot ru
Summary: Null coalescing operator issue with undeclared
static class properties
-Status: Open
+Status: Verified
Type: Bug
Package: Variables related
Operating System: Win 7 64
PHP Version: 7.0.16
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2017-03-01 07:42:17] pandenitz at mail dot ru
Description:
------------
Null coalescing operator doesn't check isset() for static properties
Test script:
---------------
abstract class Test
{
public static function get()
{
return static::$test ?? true;
}
public static function get2()
{
return isset(static::$test) ? static::$test : true;
}
}
// Access to undeclared static property
Test::get();
// Works
Test::get2();
Expected result:
----------------
No errors
Actual result:
--------------
Error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74188&edit=1