php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47581 Calling __construct from an extended SoapClient class via variable broken
Submitted: 2009-03-05 22:33 UTC Modified: 2013-02-18 00:33 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: starson dot hochschild at mtginfo dot com Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.2.9 OS: Linux RedHat Enterprise V4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: starson dot hochschild at mtginfo dot com
New email:
PHP Version: OS:

 

 [2009-03-05 22:33 UTC] starson dot hochschild at mtginfo dot com
Description:
------------
I just upgraded from 5.1.6 to 5.2.9.

Calling __construct from an extended SoapClient class via variable used to work but this is no longer the case.  Somehow it gets picked up by __call now.
Calling __construct from an extended SoapClient class explicitly still works.
Calling SoapClient from an extended SoapClient class via variable still works.  I did not include an example for this, though.

This is definitely not a show-stopper but it would be nice to have consistency.

I haven't noticed this with any other classes, but then again using a variable to call __construct isn't exactly common.


Reproduce code:
---------------
<?php
class SoapClientExplicit extends SoapClient {
	public function misSoap($wsdl, $options = array()) {
		parent::__construct($wsdl, $options);
	}
}
class SoapClientVariable extends SoapClient {
	public function misSoap($wsdl, $options = array()) {
		$function = __FUNCTION__;
		parent::$function($wsdl, $options);
	}
}
echo __LINE__."\n";
$sce = new SoapClientExplicit('http://example.com/ns/func?wsdl');
echo __LINE__."\n";
$scv = new SoapClientVariable('http://example.com/ns/func?wsdl');
echo __LINE__."\n";
?>


Expected result:
----------------
13
15
17


Actual result:
--------------
13
15

Fatal error: Uncaught SoapFault exception: [Client] Error finding "uri" property in /path/to/script.php:10
Stack trace:
#0 [internal function]: SoapClient->__call('__construct', Array)
#1 /path/to/script.php(10): SoapClient->__construct('http://example...', Array)
#2 /path/to/script.php(16): SoapClientVariable->__construct('http://example...', Array)
#3 {main}
  thrown in /path/to/script.php on line 10


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-05 22:38 UTC] starson dot hochschild at mtginfo dot com
public function misSoap
should be
public function __construct
 [2010-06-20 21:29 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2010-06-20 21:29 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 09 19:01:28 2024 UTC