Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anonymous functions does not work: Function name must be a string

Tags:

php

I have:

PHP Version 5.4.20
'./configure' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' 

And I test this code:

$greet = function($name) {
    printf("Hello %s\r\n", $name);
};

$greet('PHP');

I am getting this error:

Fatal error: Function name must be a string

On PHP Version 5.3.10-1ubuntu3.8 it is working as it should. Does anyone what is going on?

like image 898
FlyLord Avatar asked Dec 09 '13 19:12

FlyLord


1 Answers

Uhh, I think I just find out :( : http://snippets.webaware.com.au/howto/eaccelerator-and-php-closures-dont-mix

like image 195
FlyLord Avatar answered Oct 14 '22 06:10

FlyLord