Bug #53573 [NEW]: Invisible "static" property of Closure

From: Date: Sun, 19 Dec 2010 05:03:08 +0000
Subject: Bug #53573 [NEW]: Invisible "static" property of Closure
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157086@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.4 Package: Scripting Engine problem Bug Type: Bug Bug description:Invisible "static" property of Closure Description: ------------ var_dump($closure) displays public property named "static", but I cannot access to it with standard call: Closure object cannot have properties It might be very useful! Thanks. Test script: --------------- <?php $a = function() { static $foo = 'bar'; echo $foo."\n"; }; var_dump($a); $a->{'static'}['foo'] = 'foo'; $a(); Expected result: ---------------- Output: foo Actual result: -------------- object(Closure)#1 (1) { ["static"]=> array(1) { ["foo"]=> string(3) "bar" } } PHP Catchable fatal error: Closure object cannot have properties in /home/web/1.php on line 7 -- Edit bug report at http://bugs.php.net/bug.php?id=53573&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53573&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53573&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53573&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53573&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53573&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53573&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53573&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53573&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53573&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53573&r=support Expected behavior: http://bugs.php.net/fix.php?id=53573&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53573&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53573&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53573&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53573&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53573&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53573&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53573&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53573&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53573&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53573&r=mysqlcfg

« previous php.bugs (#157086) next »