Req #50029 [Ana]: __invoke() can not work as class property.

From: Date: Sun, 03 Nov 2013 21:12:22 +0000
Subject: Req #50029 [Ana]: __invoke() can not work as class property.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182582@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=50029&edit=1 ID: 50029 Updated by: yohgaki@php.net Reported by: marc dot gray at gmail dot com Summary: __invoke() can not work as class property. Status: Analyzed Type: Feature/Change Request Package: Class/Object related Operating System: * PHP Version: master Block user comment: N Private report: N New Comment: Are we going to fix(implement) this? If not, all we have to do is document this behavior. It seems it's not documented, yet. Previous Comments: ------------------------------------------------------------------------ [2013-11-03 14:09:18] nikic@php.net Link to RFC should be https://wiki.php.net/rfc/closures/object-extension. ------------------------------------------------------------------------ [2013-11-03 14:08:10] nikic@php.net This is definitely an FR. Current behavior is intended as is, but somewhat controversial. Some reading on this topic: * https://wiki.php.net/rfc/closures/object-extension#warnings_on_direct-method_calls * http://markmail.org/message/3zi53txadno6xrqa * http://markmail.org/message/adr6ejlr4xewzo5a * http://markmail.org/message/5mhjr472jfzmkhd4 ------------------------------------------------------------------------ [2013-11-03 04:41:35] yohgaki@php.net I think this is bug, not FR. ------------------------------------------------------------------------ [2013-11-02 23:29:42] worldoffame at hotmail dot com Has this bug been fixed yet? Its one of the most annoying glitches in PHP, and funny it has existed for more than 4 years. ------------------------------------------------------------------------ [2013-08-29 10:50:17] worldoffame at hotmail dot com Also the argument that invoking class property could override class methods itself is just nonsense. Guess what? Its a poor design if your method shares the same name as your property anyway. If collision occurs it looks more like an improper OOP practice to me. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=50029 -- Edit this bug report at https://bugs.php.net/bug.php?id=50029&edit=1

« previous php.bugs (#182582) next »