Doc #71158 [NEW]: Calling methods with reserved keywords is inconsistent.
| From: | gregorv at web dot de | Date: | Fri, 18 Dec 2015 12:37:13 +0000 |
| Subject: | Doc #71158 [NEW]: Calling methods with reserved keywords is inconsistent. | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-12956@lists.php.net to get a copy of this message | ||
From: gregorv at web dot de
Operating system:
PHP version: Irrelevant
Package: *General Issues
Bug Type: Documentation Problem
Bug description:Calling methods with reserved keywords is inconsistent.
Description:
------------
Inconsistent parsing errors for using language constructs as functions
in combination with magic methods.
Calling methods with names of reserved keywords produce a fatal error
when
called statically like Something::list(), but work perfectly well when
doing $something->list();
See code in Test Script.
Test script:
---------------
class Testing {
public function scopeList() {
echo "scopeList";
}
public function __call($method, $parameters) {
if($method == "list") {
$this->scopeList();
}
}
public static function __callStatic($method, $parameters) {
$instance = new static;
call_user_func_array([$instance, $method], $parameters);
}
}
// Testingg::list() failes;
//Testing::list();
$testing = new Testing();
$testing->list(); // this does not
--
Edit bug report at https://bugs.php.net/bug.php?id=71158&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71158&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71158&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71158&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71158&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71158&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71158&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71158&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71158&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71158&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71158&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71158&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71158&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71158&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71158&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71158&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71158&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71158&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71158&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71158&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71158&r=mysqlcfg