-2

have this linecode

$panel_setting = new Setting();

$panel_setting = $panel_setting->where(["admin_id"=> $admin->id])->one();

the php version on my local wamp server is 5.3.10 but when i run it on my local server then it gives this error

( ! ) Parse error: syntax error, unexpected '[', expecting ')'

I don't know how to solve it, please help.

1 Answers1

0

If I am correct [] syntax for arrays is available from php 5.4 and you have version 5.3.10.

Maybe you should write as this:

$panel_setting = $panel_setting->where(array("admin_id" => $admin->id))->one();
Sergiy T.
  • 1,433
  • 1
  • 23
  • 25
  • Questions that are about basic PHP syntax errors should not be answered. They should be closed as a duplicate of [PHP Parse/Syntax Errors; and How to solve them?](//stackoverflow.com/questions/18050071) only. If you want to point out their mistake, just post a comment. See: [Should one advise on off topic questions?](//meta.stackoverflow.com/q/276572/1768232). Off-topic questions can be closed and deleted, which could nullify your contribution anyway. – John Conde Jun 03 '20 at 11:38