cancel
Showing results for 
Search instead for 
Did you mean: 

Cron Job syntax error, unexpected T_FUNCTION Line 240

Cron Job syntax error, unexpected T_FUNCTION Line 240

Hi, I'm currently running Magento v1.9.1.1 on Parallel Plesk server on a Windows environment with PHP 5.3 and encountered this problem when my cron (scheduled task) is running;

 

Parse error:  syntax error, unexpected T_FUNCTION in C:\Inetpub\vhosts\domain.com\httpdocs\app\code\core\Mage\Core\Helper\Abstract.php on line 240

 

I've not been tampering the Magento core files and this is the section that I've found to be problematic;

 

 

 

    public function removeTags($html)
    {
        $html = preg_replace_callback(
            "# <(?![/a-z]) | (?<=\s)>(?![a-z]) #xi",
            function ($matches) {
                return htmlentities($matches[0]);
            },
            $html
        );
        $html =  strip_tags($html);
        return htmlspecialchars_decode($html);
    }

 

Line 240 is referring to function ($matches) {

 

Any help is highly appreciated. Thanks!

1 REPLY 1

Re: Cron Job syntax error, unexpected T_FUNCTION Line 240

This error is displayed when you run script using unsupported PHP version. Make sure that  it's not the case and you should be good.

Tanel Raja