|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45059 incorrect signature for __call() method
Submitted: 2008-05-21 15:12 UTC Modified: 2008-06-13 18:02 UTC
From: dennis at born05 dot nl Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.6 OS: Windows XP Pro SP2
Private report: No CVE-ID: None
 [2008-05-21 15:12 UTC] dennis at born05 dot nl
Actually, I am using PHP version 5.2.5, but I couldn't find it in the list.

The current implementation of the __call() method in the SoapClient class is as follows: mixed  __call  ( string $function_name  , array $arguments  [, array $options  [, array $input_headers  [, array $output_headers  ]]] ) (as per the documentation)

While the default 'magic method' __call() is defined as: __call  ( string $name  , array $arguments  )

Now I'm extending the SoapClient class and want to overload the __call() method, but I'm unable to do so without raising errors (with error_reporting (E_ALL | E_STRICT) )

There are a couple of different things here:

1. Implement the __call() method like the default method. This raises the following error: Strict Standards: Declaration of ExtendedSoapClient::__call() should be compatible with that of SoapClient::__call() in C:\Program Files\xampp\htdocs\CodeBase\soaptest\ on line 9 (line 9 is closing bracket of ExtendedSoapClient)

2. So I implemented as documented for the SoapClient::__call(). This raises the following error: Fatal error: Method ExtendedSoapClient::__call() must take exactly 2 arguments in C:\Program Files\xampp\htdocs\CodeBase\soaptest\ on line 7

This behaviour only exhibits when ExtendedSoapClient resides in a seperate file. When the class definition is in the same file as the calling code it still raises the E_FATAL, but it won't raise the E_STRICT anymore.

Reproduce code:
I have put up a page which shows a couple of different code samples which illustrate what happens.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-22 08:33 UTC]
You can't find 5.2.5 on the list since latest version is 5.2.6, if you don't have that -> upgrade first.
 [2008-05-22 12:04 UTC] dennis at born05 dot nl
OK, I have upgraded to the latest version -> 5.2.6

It displays the exact same behaviour as does PHP 5.2.5.
 [2008-06-13 18:02 UTC]
That __call function isn't the magic method, maybe that has been the reason to become it obsolete.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 17:04:05 2021 UTC