Search Type Ahead

PHP Parse error - Search Type Ahead

PHP Parse error

by PandV » Tue Feb 21, 2023 5:06 am

I've just installed 1.4.0 on my test store running 1.8.17 and received the following error:

PHP Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in /public_html/includes/hooks/shop/system/searchTypeAhead.php on line 35

I've reinstalled mutiple times to no avail. Any thoughts on what the cause might be?
PandV
VIP Member
VIP Member
Posts: 13
Joined: Sat Sep 04, 2021 5:32 am
Contact:

Re: PHP Parse error

by zipurman » Tue Feb 21, 2023 5:11 am

What version of php are you running?
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Contact:

Re: PHP Parse error

by PandV » Tue Feb 21, 2023 5:15 am

PHP 7.3
PandV
VIP Member
VIP Member
Posts: 13
Joined: Sat Sep 04, 2021 5:32 am
Contact:

Re: PHP Parse error

by zipurman » Tue Feb 21, 2023 5:27 am

You could try one of the following:

Upgrade to PHP 7.4 if that is an option.

OR, remove the type casting on lines 35-38 changing them to:

Code: Select all

        private $php_configs;
        private $js_configs;
        private $installed;
        private $debug;
I will test on PHP 7.3 when I get a chance.
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Contact:

Re: PHP Parse error

by PandV » Tue Feb 21, 2023 5:29 am

Yep - upgrading to 7.4 fixed it. Thanks!
PandV
VIP Member
VIP Member
Posts: 13
Joined: Sat Sep 04, 2021 5:32 am
Contact: