function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter KayePeter Kaye 

SOAP API PHP Toolkit with PHP 7.x ?

php 7 gives the following deprecated method warning when used with the current ( Version 20 ? ) of the php developer toolkit:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; SforceEnterpriseClient has a deprecated constructor in /home/sites/xxxx.xom/mmc4/soapclient/SforceEnterpriseClient.php on line 38

Is there any workaround for this ?  When is it likely a new release will be available  that works with 7.x without giving this warning ?  Thanks.
 
NagendraNagendra (Salesforce Developers) 
Hi Peter,

PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated, and will be removed in the future. PHP 7 will emit E_DEPRECATED if a PHP 4 constructor is the only constructor defined within a class. Classes that implement a __construct() method are unaffected.
<?php
class foo {
    function foo() {
        echo 'I am the constructor';
    }
}
?>

The above example will output:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in example.php on line 3
For more information check with this post
http://stackoverflow.com/questions/36339774/php7-constructor-class-name

Please mark this post as solved if it helps.

Best Regards,
Nagendra.P
Peter KayePeter Kaye
Thanks for the explanation Nagendra.

I am currently using the php SOAP library provided in the PHP Developer Toolkit 'as is'. Cleaning up the SOAP library is the way to solve this - but will this get done or is solving this problem left to individual users ?   I am unsure who maintains the library - I assume it is not SF. As there must be many users, it doesn't make sense for these changes to be made many times over by individuals - and anyway I'm not sure my php skills are up to this.  How do I find out if anyone else is challenged by this problem - and hopefully may have solved it.