|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-12-18 12:56 UTC] gregorv at web dot de
[2015-12-18 12:57 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2015-12-18 12:58 UTC] requinix@php.net
[2015-12-18 13:06 UTC] gregorv at web dot de
[2015-12-18 13:08 UTC] gregorv at web dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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