php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dennis at born05 dot nl
New email:
PHP Version: OS:

 

 [2008-05-21 15:12 UTC] dennis at born05 dot nl
Description:
------------
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\ExtendedSoapClient.class.inc.php 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\ExtendedSoapClient.class.inc.php 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.

http://db.cover05.nl/php_bug


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-22 08:33 UTC] jani@php.net
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] felipe@php.net
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: Tue Dec 07 20:03:33 2021 UTC