Given the following interface:
interface ISoapInterface {
public static function registerSoapTypes( &$wsdl );
public static function registerSoapOperations( &$server );
}
And the following code:
$soapProvider = array( "FilePool", "UserList" );
foreach( $soapProvider as $provider ) {
call_user_func( array( $provider, "registerSoapTypes" ), &$server->wsdl );
call_user_func( array( $provider, "registerSoapOperations" ), &$server );
}
FilePool
and UserList
both implement ISoapInterface
.
PHP will complain about the two calls inside the foreach stating:
Call-time pass-by-reference has been deprecated
So I looked that message up, and the documentation seems quite clear on how to resolve this. Removing the ampersand from the actual call.
So I changed my code to look like this:
$soapProvider = array( "FilePool", "UserList" );
foreach( $soapProvider as $provider ) {
call_user_func( array( $provider, "registerSoapTypes" ), $server->wsdl );
call_user_func( array( $provider, "registerSoapOperations" ), $server );
}
Now PHP complains
Parameter 1 to FilePool::registerSoapTypes expected to be reference, value given
Parameter 1 to FilePool::registerSoapOperations expected to be reference, value given
In addition to that, the functionality is now broken. So this obviously can't be the solution.