From: david at grudl dot com Operating system: windows xp PHP version: 5.3CVS-2008-07-16 (snap) PHP Bug Type: Feature/Change Request Bug description: Object Closure as
Description: ------------ Lambda functions and closures are AWESOME! But they are not still supported as ob_start() argument. Reproduce code: --------------- function redirect($file) { $handle = fopen($file, 'w'); ob_start(function($buffer) use ($handle) { fwrite($handle, $buffer); }); } redirect('output.html'); echo 'Hello World!'; Expected result: ---------------- Should work Actual result: -------------- Fatal error: ob_start(): No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class Closure to use as output buffer. -- Edit bug report at http://bugs.php.net/?id=45525&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45525&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45525&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45525&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45525&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45525&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45525&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45525&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45525&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45525&r=support Expected behavior: http://bugs.php.net/fix.php?id=45525&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45525&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45525&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45525&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45525&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45525&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45525&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45525&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45525&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45525&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45525&r=mysqlcfg