|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46988 2 requests: Closures Recursion & __callFunction
Submitted: 2009-01-02 01:05 UTC Modified: 2015-01-18 04:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: info at netmosfera dot it Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.3.0 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-01-02 01:05 UTC] info at netmosfera dot it
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;


function($increment) use ($i = 0)
      // code here
      // code here
      echo ++$increment;
      if ($increment==20) return;
      function use($increment);

alternative syntax:
recursion use($increment);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-07 20:47 UTC]
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues -PHP Version: 5.3.0alpha3 +PHP Version: 5.3.0
 [2015-01-07 20:47 UTC]
It is unclear what you are asking for, could you please clarify?
 [2015-01-07 21:49 UTC]
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;
 [2015-01-18 04:22 UTC] php-bugs at lists dot php dot net
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 08:01:28 2024 UTC