Bug #52270 [Opn->Bgs]: Anonymous functions :: Example #2 :: parse error, unexpected T_FUNCTION

From: Date: Tue, 06 Jul 2010 22:37:18 +0000
Subject: Bug #52270 [Opn->Bgs]: Anonymous functions :: Example #2 :: parse error, unexpected T_FUNCTION
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-152161@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52270&edit=1 ID: 52270 Updated by: johannes@php.net Reported by: user at niepodam dot pl Summary: Anonymous functions :: Example #2 :: parse error, unexpected T_FUNCTION -Status: Open +Status: Bogus Type: Bug Package: *General Issues Operating System: Windows/Linus PHP Version: 5.2.13 New Comment: The page has a box telling you: Note: Anonymous functions are available since PHP 5.3.0. Previous Comments: ------------------------------------------------------------------------ [2010-07-07 00:30:44] user at niepodam dot pl Description: ------------ http://www.php.net/manual/en/functions.anonymous.php example #2 produce error: Parse error: parse error, unexpected T_FUNCTION in ./ on line 4 Test script: --------------- <?php $greet = function($name) { printf("Hello %s\r\n", $name); }; $greet('World'); $greet('PHP'); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52270&edit=1

« previous php.bugs (#152161) next »