Req #63020 [Opn->Sus]: Dynamic functions & methods unification
| From: | cmb@php.net | Date: | Tue, 17 Oct 2017 12:27:39 +0000 |
| Subject: | Req #63020 [Opn->Sus]: Dynamic functions & methods unification | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211758@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63020&edit=1
ID: 63020
Updated by: cmb@php.net
Reported by: p dot szymkowski at gmail dot com
Summary: Dynamic functions & methods unification
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: Any
PHP Version: 5.4.6
Block user comment: N
Private report: N
New Comment:
Thank you for your interest in PHP and for submitting a feature request. Please
be aware that due to the magnitude of change this request requires, it would be
necessary to discuss it on PHP Internals list (internals@lists.php.net) as an
RFC. Please read the guide about creating RFCs here:
<https://wiki.php.net/rfc/howto>. If you
haven't had experience with writing
RFCs before, it is advised to seek guidance on the Internals list
(<http://php.net/mailing-lists.php>) and/or
solicit help from one of the
experienced developers.
Please do not consider this comment as a negative view on the merits of your
proposal â every proposal which requires changes of certain magnitude, even the
very successful and widely supported ones, must be done through the RFC process.
This helps make the process predictable, transparent and accessible to all
developers.
Previous Comments:
------------------------------------------------------------------------
[2012-09-06 01:35:30] aharvey@php.net
I'd be surprised if we didn't have bugs/requests for this already, but I can't find
them at a glance, so let's leave this open in the right package.
The AST RFC might be of interest here, since it would presumably provide a path towards fixing this:
https://wiki.php.net/rfc/ast_based_parsing_compilation_process
------------------------------------------------------------------------
[2012-09-05 20:21:07] p dot szymkowski at gmail dot com
Description:
------------
This is more than a feature than a bug.
Usage of '{}' is not unified at all.
Why this syntax:
$this->{'function'};
works, but:
{'function'}();
doesn't?
It's really confusing. In "test script" form i am giving you full example of it.
Test script:
---------------
<?php
function myFunction(){};
// {'myFunction'}(); // doesn't work
$str = 'myFunction';
$str(); // works
class myClass {
public $bar = 'myClass';
public $test = 'myClass';
public function foo() {
}
}
// $class = new {'myClass'}(); // doesn't work
$str = "myClass";
$class = new $str(); // works
$class->{'foo'}(); // works
// $class2 = new {$class->test}; // doesn't work
$class2 = new $class->test(); // works
Expected result:
----------------
syntax {'myFunction'}(); should work
syntax $class = new {'myClass'}(); should work
syntax $class2 = new {$class->test}; should work
Actual result:
--------------
only calling methods and getting properties of class works in that way.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63020&edit=1