PHP Parse error: syntax error, unexpected ‘::’ (T_PAAMAYIM_NEKUDOTAYIM)

Error

When using theme in WordPress, getting an error like the following:

[05-Dec-2021 21:11:48 UTC] PHP Parse error:  syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /home/***/public_html/wp-content/themes/stockholm/framework/admin/options/elements/map.php on line 71

Solution

In Hebrew ‘PAAMAYIM NEKUDOTAYIM’ means double colons. PHP has stopped using a double colon to refer to object elements. These need to use the ‘->’ arrow instead of the ‘::’ double colon. In our case, the issue was with the following:

$icons_instance = stockholm_qode_icon_collections()::getInstance();

This should have been

$icons_instance = stockholm_qode_icon_collections()->getInstance();

Hope this helps.