From: swquinn at gmail dot com Operating system: Windows XP Professional PHP version: 5.3CVS-2009-06-23 (snap) PHP Bug Type: Reflection related Bug description: ReflectionMethod::getClosure() Undefined on Windows binary for PHP 5.3.0RC5-dev
Description: ------------ Attempting to access a closure through the ReflectionMethod's getClosure() method results in a fatal error declaring that a "... Call to undefined method ReflectionMethod::getClosure() ..." has occurred. The example below was taken from the RFC described on http://wiki.php.net/rfc/closures. I have tried this on two different Windows binaries for PHP 5.3.0 (RC3-dev and the more recent RC5-dev). NOTE: 5.3.0RC5-dev was not available for the PHP version listed, so I chose 5.3CVS-2009-06-23 (snap) as the version I tested it on (same date as the Windows binary I downloaded from http://windows.php.net/snapshots/). Reproduce code: --------------- class Example { public $x = 4; function printer () { echo "Hello World: $this->x!\n"; } } $class = new ReflectionClass ('Example'); $method = $class->getMethod ('printer'); $object = new Example; $closure = $method->getClosure ($object); $closure (); $object->x = 5; $closure (); Expected result: ---------------- Hello World: 4! Hello World: 5! Actual result: -------------- Fatal error: Call to undefined method ReflectionMethod::getClosure() -- Edit bug report at http://bugs.php.net/?id=48654&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48654&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48654&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48654&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48654&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48654&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48654&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48654&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48654&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48654&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48654&r=support Expected behavior: http://bugs.php.net/fix.php?id=48654&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48654&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48654&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48654&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48654&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48654&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48654&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48654&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48654&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48654&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48654&r=mysqlcfg