The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
sintaxe error - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: sintaxe error (/showthread.php?tid=653)



sintaxe error - marceloatmartins - 08-01-2017

Hi everybody,

I moved my site to other PC and now I get the error in this line:

//adding more ids to this array allows people to access everything, whether offline or not. Use caution.
$master_account = [1];


The message of error: Parse error: syntax error, unexpected '[' in /home/smsrio/public_html/subhue/pacientesocial/users/init.php on line 54

Some idea about this ?

Thanks



sintaxe error - marceloatmartins - 08-01-2017

I do a test and the sintaxe below is the same:

$master_account [] = 1;

The result with print_r is:

Array ( [0] => 1 )

In both sintaxes below:

$master_account = [1];
$master_account [] = 1;

The result is the same.





sintaxe error - firestorm - 08-01-2017

when you did the move did you use the installer?


sintaxe error - marceloatmartins - 08-01-2017

No, just copy to the new server.
I think that problem is caused by PHP version, is different of developer server.



sintaxe error - firestorm - 08-01-2017

firstly make sure init.php isnt same as dev and has the right credentials for the new server, paste a copy of your init to paste bin or hastebin and link it here we can have a look, php version should be 5.3 or higher, ive tested past 7 without issue, you might want to try clean install aswell


sintaxe error - marceloatmartins - 08-01-2017

Thank you for you help,

My Production Environment has PHP 5.3.27 version,

I resolve this with: $master_account [] = 1;

It's worked.








sintaxe error - karsen - 08-01-2017

Your version probably just doesn't recognize the syntax. Your fix does the same thing, as would
Code:
$master_account = array(1);
The code that doesn't work is a more recently added shorthand but all 3 do the same thing.