Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8089977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:34:30+00:00 2026-06-05T19:34:30+00:00

Possible Duplicate: unexpected T_FUNCTION with php 5.2.17 but fine on localhost and php 5.3.10

  • 0

Possible Duplicate:
unexpected T_FUNCTION with php 5.2.17 but fine on localhost and php 5.3.10

I’m not really used to programming in PHP and it’s my first time using an API, so this is how I’m calling it (copy/pasted from their wiki)

spl_autoload_register(function($class) {
    $dir = __DIR__ .'/lib/';
    $file = $dir . strtr($class, '\\', '/') . '.php';
    if (file_exists($file)) {
        require $file;
        return true;
    }
});

use WowApi\Client;

When I’m working on localhost on my own computer, everything works perfectly I’ve got no warning, no error, it works fine. The problem is when I upload this on my FTP I’ve got the following error:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')'

Which refers to this line:

spl_autoload_register(function($class) {

I was told to write this in my .htaccess:

suPHP_ConfigPath /home/MYUSERNAME/public_html/php.ini

and this in my php.ini

safe_mode = OFF

But unfortunatly nothing works, I still got an error. Do you guys have an idea on how to fix this? Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:34:31+00:00Added an answer on June 5, 2026 at 7:34 pm

    Anonymous function comes from php 5.3, check the php version of your server. If it is below 5.3, you need to define the function first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP unexpected result of float to int type cast int((0.1+0.7)*10) = 7
Possible Duplicate: git - removing a file from source control (but not from the
Possible Duplicate: Workaround for basic syntax not being parsed Why don't PHP attributes allow
Possible Duplicate: Best way to stop SQL Injection in PHP I am creating a
Possible Duplicate: iOS - Detecting whether or not device support phone calls? I'm writing
Possible Duplicate: Workaround for basic syntax not being parsed I am trying to allow
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always
Possible Duplicate: MySQL datetime fields and daylight savings time — how do I reference
Possible Duplicate: declare property as object? Why don't PHP attributes allow functions? I'm trying
Possible Duplicate: Access array returned by a function in php The code: $cnt =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.