Thanks for sharing this. I manage an app that consumes a SOAP service and it often takes several minutes to load the WSDL, so I have to use the WSDL cache.

I have a scheduled task which refreshes the cache outside of peak hours so that it’s always current. The scheduled task uses “ini_get(“soap.wsdl_cache_dir”)” and then scandir() and unlink() to delete the cached files. You could use something similar with the above version-switching problem, i.e. do a manual refresh of the cache after a version-switch rather than disabling cache completely.

As I type I thought of something possibly fancier – perhaps you could extend SoapClient and in the constructor check the PHP version against a user-cached version – if it doesn’t match (i.e. the PHP version has changed since the last call to the SoapClient), it could do a cache refresh before invoking the parent class.

Please excuse me if I am talking out of my backside, I am not used to sharing code concepts with such luminaries :-)