Bug #71193 [Opn->Nab]: old bug has reappeared
| From: | requinix@php.net | Date: | Tue, 22 Dec 2015 05:47:22 +0000 |
| Subject: | Bug #71193 [Opn->Nab]: old bug has reappeared | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198124@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71193&edit=1
ID: 71193
Updated by: requinix@php.net
Reported by: iam4webwork at hotmail dot com
Summary: old bug has reappeared
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: n/a
PHP Version: 7.0.1
Block user comment: N
Private report: N
New Comment:
PHP 7 changed how expressions like those are evaluated.
https://wiki.php.net/rfc/uniform_variable_syntax
Use A::{$y[0]}()
Previous Comments:
------------------------------------------------------------------------
[2015-12-22 05:00:17] iam4webwork at hotmail dot com
Description:
------------
Cannot statically call a method if its name is in an array. Last time this was an issue was
apparently back in 2004 (see bug #27669). This bug effects PHP versions 7.0.0alpha2 - 7.0.1,
7.1@2015-11 (see https://3v4l.org/8MTtD)
Test script:
---------------
<?php
class A {
static function hello(){
echo "Hello World\n";
}
}
$x = 'hello';
$y[0] = 'hello';
A::$x();
A::$y[0]();
Expected result:
----------------
Hello World
Hello World
Actual result:
--------------
Hello World
Fatal error: Uncaught Error: Access to undeclared static property: A::$y in /in/8MTtD:11
Stack trace:
#0 {main}
thrown in /in/8MTtD on line 11
Process exited with code 255.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71193&edit=1