jeudi 11 février 2016

PHP Parse error: syntax error, unexpected '[' [duplicate]

This question already has an answer here:

Recently I moved my website from localhost to a url domain, and now it keeps showing the errors above. The lines with problems are shown bellow. I think it's because the sintax that I used is from a more recent version of PHP, but I can't find any specific documentation for previous versions.

<?php echo explode(' ', $_SESSION['usuario_nome'])[0]; ?>

...

$fields_holder += [$name => $table_info[$i][$name]];

What is the equivalent of those lines of code to PHP < 5.4? Can anybody think of any other reason the code suddenly stopped working?

Sorry about my bad english...




Aucun commentaire:

Enregistrer un commentaire