Bug #54792 [Opn->Dup]: Constructor not called, but destructor is.
| From: | cmb@php.net | Date: | Fri, 27 Aug 2021 09:43:01 +0000 |
| Subject: | Bug #54792 [Opn->Dup]: Constructor not called, but destructor is. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236112@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54792&edit=1
ID: 54792
Updated by: cmb@php.net
Reported by: RQuadling at GMail dot com
Summary: Constructor not called, but destructor is.
-Status: Open
+Status: Duplicate
Type: Bug
Package: SOAP related
Operating System: Windows XP SP3
PHP Version: 5.3.6
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The link test script is no longer available, but this is a
duplicate of bug #45155 anyway.
Previous Comments:
------------------------------------------------------------------------
[2011-05-17 15:19:01] RQuadling at GMail dot com
Description:
------------
When using SOAPClient with WSDL types as PHP classes, you define the
relationship in the classmap element of the options parameter to the SoapClient
constructor.
The instances that are created by the SOAPClient do not call the constructor,
but, once created, the destructor is called as part of the script shutdown.
I don't know if this is a bug in SOAPClient in that it SHOULD call the
constructors, or just a documentation issue in that the lack of construction is
not documented.
If a PHP class with methods is used in the class map, the class is instantiated
and you can call the methods, so it looks just like a normal class/object. But
with no constructor.
When the script closes, the destructors are called.
My test script is fairly large as there are 14 magic methods to add to the
classes.
So, it is available at http://pastebin.com/4CWHrwKq
Test script:
---------------
http://pastebin.com/4CWHrwKq
Expected result:
----------------
ConversionRate::__construct ( a:0:{} )
ConversionRateResponse::__contruct ( a:0:{} )
0.6171
ConversionRateResponse::__destruct ( a:0:{} )
ConversionRate::__destruct ( a:0:{} )
Actual result:
--------------
ConversionRate::__construct ( a:0:{} )
0.6171
ConversionRateResponse::__destruct ( a:0:{} )
ConversionRate::__destruct ( a:0:{} )
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54792&edit=1