Req #46988 [Fbk->NoF]: 2 requests: Closures Recursion & __callFunction
| From: | php-bugs at lists dot php dot net | Date: | Sun, 18 Jan 2015 04:22:19 +0000 |
| Subject: | Req #46988 [Fbk->NoF]: 2 requests: Closures Recursion & __callFunction | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-190017@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=46988&edit=1
ID: 46988
Updated by: php-bugs@lists.php.net
Reported by: info at netmosfera dot it
Summary: 2 requests: Closures Recursion & __callFunction
-Status: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: *General Issues
PHP Version: 5.3.0
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2015-01-07 21:49:47] requinix@php.net
First request sounds like a plain function version of a class's __call.
notDefined(); // -> __callFunction("notDefined", array())
Second request doesn't have the right syntax but the idea of getting a closure to call itself
is already possible:
$increment = function($i) use (&$increment) { // reference
echo ++$i;
if ($i == 20) return;
$increment($i);
};
$increment(0);
------------------------------------------------------------------------
[2015-01-07 20:47:59] levim@php.net
It is unclear what you are asking for, could you please clarify?
------------------------------------------------------------------------
[2009-01-02 01:05:57] info at netmosfera dot it
Description:
------------
hello, i have two requests for next releases of php
like __call & __callStatic, __callFunction... for dynamic function overloading
and recursion for closures
Reproduce code:
---------------
function __callFunction($funcname, Array $arguments)
{
echo $funcname;
}
notDefined();
---------------
function($increment) use ($i = 0)
{
// code here
// code here
echo ++$increment;
if ($increment==20) return;
function use($increment);
};
alternative syntax:
recursion use($increment);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=46988&edit=1