Q:

PHP: unexpected T_FUNCTION

I have an error on my website: http://www.velosofy.com/blog/

Parse error: syntax error, unexpected T_FUNCTION in /home/velosofy/public_html/blog/index.php on line 17

index.php (line 17): 
get('/index', function () {
    $page = from($_GET, 'page');
    $page = $page ? (int)$page : 1;

    $posts = get_posts($page);

    if(empty($posts) || $page < 1){
        // a non-existing page
        not_found();
    }

    render('main',array(
    'page' => $page,
    'posts' => $posts,
    'has_pagination' => has_pagination($page)
    ));
});

Can anyone tell me how to fix this?

A:

Looking at the code you've posted, it looks like the error is occurring on an inline function call.
This syntax is only valid in PHP 5.3 and higher. I guess you're trying to run the code in PHP 5.2, which would give the error you reported.
Solution: Upgrade to an up-to-date version of PHP.

