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

From: Date: Thu, 30 Sep 2021 11:32:33 +0000
Subject: Req #50029 [Ana->Csd]: __invoke() can not work as class property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236932@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:         cmb@php.net
 Reported by:        marc dot gray at gmail dot com
-Summary:            __invoke() can not work as class property.
+Summary:            __invoke() can not work as class property
-Status:             Analyzed
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Class/Object related
 Operating System:   *
 PHP Version:        master
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> […] what partly solves this issue.

Well, actually completely solves this issue – be explicit[1]!

[1] <https://3v4l.org/NGXF2>


Previous Comments:
------------------------------------------------------------------------
[2015-07-18 16:05:42] cmb@php.net

The behavior of PHP 7 is still the same as PHP 5[1], and is
unlikely to change for PHP 7.0 which is in feature freeze.

However, due to the "uniform variable syntax"[2] one can use
parens to make it clear that an instance property is meant to be
called[3] what partly solves this issue.

[1] <http://3v4l.org/3Pu60>
[2] <https://wiki.php.net/rfc/uniform_variable_syntax>
[3] <http://3v4l.org/NGXF2>

------------------------------------------------------------------------
[2015-01-27 22:27:21] worldoffame at hotmail dot com

And whats the current status of this bug? Will this be fixed in PHP 7? I must admit this is one of
the unbearable glitches that I find almost impossible to withstand. There are some bad behaviors in
PHP that I can live with, but this one annoys me so much. It's not just a bad design, its just
a bug. Please make sure to fix this in PHP 7, if it hasnt taken place in the current PHP 5.6.

------------------------------------------------------------------------
[2013-11-03 21:36:14] yohgaki@php.net

I mean if this FR is not feasible, then we may document this and close bug.
If this FR is feasible, then we may document current behavior and keep open this bug.

I didn't follow closure implementation details closely, just curious about feasibility of the
fix.

------------------------------------------------------------------------
[2013-11-03 21:12:21] yohgaki@php.net

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.

------------------------------------------------------------------------
[2013-11-03 14:09:18] nikic@php.net

Link to RFC should be https://wiki.php.net/rfc/closures/object-extension.

------------------------------------------------------------------------


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


Thread (20 messages)

« previous php.bugs (#236932) next »