Jump to content

Recommended Posts

Hi Barand,

 

PHP version on my local server is 5.6 whereas on the online server it is 5.4, this might be the reason that the script has thrown the following error on then taken online:

 

PHP Local: 5.6
PHP Online: 5.4

"Parse error: syntax error, unexpected '[' in /home/content/87/html/nroll-classwise.php on line 37"

 

When I inspected the code on the line number mentioned above it is:

$data = [];

Please tell me how to handle this situation, thank you.

Edited by JDevOnline

PHP 5.4 reached end of life back in 2015. You need to keep your server up to date. The current PHP version is 7, the last supported one from the old 5.x branch is 5.6.

 

Actually, you don't even seem to have 5.4, because this version already supported the short array syntax. Sounds more like 5.3 or older.

  • Like 1

Let me be more clear: PHP 5.4 was entirely abandoned and is full of security vulnerabilities that will never be fixed. Unless you have a special LTS operating system which provides its own PHP updates, you cannot use PHP 5.4. No amount of code will fix that.

 

What kind of hoster and system is this?

Let me be more clear: PHP 5.4 was entirely abandoned and is full of security vulnerabilities that will never be fixed. Unless you have a special LTS operating system which provides its own PHP updates, you cannot use PHP 5.4. No amount of code will fix that.

 

What kind of hoster and system is this?

Thanks for the info, I will either upgrade if possible or change my web hosting company, to be able to use the latest version of php, thanks.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.