Bug #77966 [NEW]: Cannot alias a method named "namespace"
| From: | mattacosta at gmail dot com | Date: | Sat, 04 May 2019 01:42:06 +0000 |
| Subject: | Bug #77966 [NEW]: Cannot alias a method named "namespace" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-220697@lists.php.net to get a copy of this message | ||
From: mattacosta at gmail dot com
Operating system:
PHP version: 7.3.5
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Cannot alias a method named "namespace"
Description:
------------
Methods may use semi-reserved keywords, however it is not possible to
alias a method named "namespace". According to the error, the alias
statement somehow becomes equivalent to 'as as bar'.
Test script:
---------------
<?php
trait A {
function namespace() {}
}
class C {
use A {
namespace as bar;
}
}
Expected result:
----------------
No error. This should be no different than if the method were named
'foo' and then using 'foo as bar'.
Actual result:
--------------
Fatal error: An alias (bar) was defined for method as(), but this method
does not exist in /in/DmNne on line 7
--
Edit bug report at https://bugs.php.net/bug.php?id=77966&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77966&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77966&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77966&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77966&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77966&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77966&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77966&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77966&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77966&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77966&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77966&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77966&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77966&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77966&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77966&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77966&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77966&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77966&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77966&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77966&r=mysqlcfg