1 (edited by iz1kbp 2020-08-20 09:38:24)

Topic: Parse error: syntax error, unexpected T_FUNCTION .../core/core.php

Hi to all,
sorry for troubble and my poor english,
I've installed the last rev of cutenew on my personal site (Php version 5.6.32).
It is a new installatio in a sub dir : mysite.it/a52/cutenews/
When I run the program, it return this error
Parse error: syntax error, unexpected T_FUNCTION mysitet/home/a52/cutenews/core/core.php on line 300
I'm search in all the forum but i have not found any topics about it.
Is there some one that can give me an idea to solve the problem?
Thank's in advance to any!
Mario

2 (edited by valeriedixon1970 2020-10-28 09:29:24)

Re: Parse error: syntax error, unexpected T_FUNCTION .../core/core.php

Thanks for sharing your reply here keep share your queries here
so anyone from the community who has faced the same issue can also find 
the solution from comments below, keep sharing  my account access

3 (edited by Virginie 2021-04-23 03:57:24)

Re: Parse error: syntax error, unexpected T_FUNCTION .../core/core.php

The problem is that you are attempting to register an anonymous function using spl_autoload_register(), but as you told that you are using PHP5.2 on your web server.

Unfortunately PHP < 5.3 does not support anonymous functions. You need to write a "regular" function:

function my_autoload($class) {
    require_once 'classes/' . $class . '.php';
}

spl_autoload_register('my_autoload');
This will work on PHP >= 5.3 as well.

PrepaidGiftBalance