Req #54888 [NEW]: The use of "as" in closure "use"
From: alex at arcomit dot co dot uk Date: Fri, 20 May 2011 11:47:13 +0000 Subject: Req #54888 [NEW]: The use of "as" in closure "use" Groups: php.bugs Request: Send a blank email to php-bugs+get-160866@lists.php.net to get a copy of this message
From:
Operating system:
PHP version: 5.3.6
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:The use of "as" in closure "use"
Description:
------------
Would be handy if "as" or something similar could be used in closures to
allow for easy passing of class properties.
e.g.
$callback = function() use ($this as $_this) {
};
$callback = function() use ($this->prop1 as $prop) {
};
--
Edit bug report at http://bugs.php.net/bug.php?id=54888&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54888&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54888&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54888&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54888&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54888&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54888&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54888&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54888&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54888&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54888&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54888&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54888&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54888&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54888&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54888&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54888&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54888&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54888&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54888&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54888&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54888&r=mysqlcfg
Thread (2 messages)
| « previous | php.bugs (#160866) | next » |
|---|