php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44539 Anonymous Functions
Submitted: 2008-03-26 16:36 UTC Modified: 2008-03-26 17:38 UTC
From: xwisdom at yahoo dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xwisdom at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-03-26 16:36 UTC] xwisdom at yahoo dot com
Description:
------------
Hello,

I would like to see improved anonymous functions in PHP6 or maybe 5.2.6

It would be really nice to be able to do the following similar to what we can do in Javascript:

$fn = function($a,$b){
   return $a + $b;
}

echo $fn(2,5);

// with anonymous functions we can do things like:
$object.each(function($index,$value) {
   // do something here
});

// to remove reference to the function we just do this:
unset($fn); // or $fn = null;

Anonymous functions must conform to scope and maybe closures, etc.

__
xwisdom
http://xwisdomhtml.com



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-26 17:38 UTC] colder@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

http://wiki.php.net/gsoc/2008#anonymous_functions_and_closures_and_other_missing_object_oriented_features
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 13:01:29 2024 UTC