|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-01-02 01:05 UTC] 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);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 13 08:00:02 2025 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; $increment($i); }; $increment(0);