syntax error, unexpected ')', expecting '='¶
Description¶
list() must appear on the left side of an assignation. It will be filled with the values in the array of the right side.
Example¶
<?php
var_dump(list(1,2,3));
?>
Solutions¶
Add a
=sign to the right of thelist()call, and then, add an array on the right.Turn the
list()into a[]short syntax. This might change the meaning, as, in this case,list()becomes an array.