That’s because you’re treating functions as objects which they are not. Functions are just that, functions. They could return objects, but they are not objects themselves. Objects are classes that can have functions which we call methods in the OOP world.
To solve your error, it states it in the error itself. Sort of the reason why I love PHP’s error reporting because it isn’t ambiguous and vague like other languages.
This means just that. There is a class called “ew_connect” that you’re trying to instantiate which PHP cannot find. I’ll give you a hint, it’s what I said in my 1st paragraph.
Im pretty much there with upgrading to php8. However theres one directory that I simply cant get working in php8 and needs to stay as php7.
The site is on Plesk. Despite uploading an htaccess file to the relevant folder telling it to behave as php7, phpinfo() still shows it as running as php8. I cant seem to force that 1 directory to run as php7.
That’s more of a server config issue rather than PHP language - you might be better off starting a new topic in that section. I’d normally move the thread, but the rest of it is more PHP-centric.
Or you could go into a bit more detail about what is stopping you from converting this last part to PHP8 and see who can help with it.