Bug #64101 [Opn->Fbk]: SoapClient weirdness when passed undefined connection_timeout
Edit report at https://bugs.php.net/bug.php?id=64101&edit=1
ID: 64101
Updated by: cmb@php.net
Reported by: jeffdafoe at gmail dot com
Summary: SoapClient weirdness when passed undefined
connection_timeout
-Status: Open
+Status: Feedback
Type: Bug
Package: SOAP related
Operating System: CentOS linux, Debian stable
PHP Version: 5.3.21
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I cannot reproduce this with PHP-7.4. Can anybody else still
reproduce this with any of the actively supported PHP versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2013-10-08 14:07:19] nampuom at gmail dot com
I confirm this bug.
Linux CentOS PHP 5.4.20 affected
Linux Fentoo PHP 5.3.18 also affected
It was very hard to locate this bug.
Also we see this behavior:
If try access to sub-element of non-existent array, then parent array initialize to 0.
Test script:
--------------
#$_SESSION['application'] = array();
$_SESSION['application']['id'] = 123;
Expected result:
--------------
array(
'application'=>array('id'=>1)
)
Actual result:
--------------
array(
'application'=>0
)
------------------------------------------------------------------------
[2013-01-29 21:00:24] jeffdafoe at gmail dot com
Description:
------------
When SoapClient is passed an undefined variable in the connection_timeout hash key, it seems that
all global variables are initialized to 0.
I can reproduce this on multiple linux distributions and PHP versions. I can also repro it using
any WSDL. It only happens when connection_timeout is set to an uninitialized variable, I am not
able to reproduce it in any other case. I discovered it by accident but figured I'd report it
due to the unusual and seemingly wide impact of the resultant behavior.
Test script:
---------------
$myi = null;
print 'Before: myi->foo=' . $myi->foo . ' fakevar=' . $fakevar . '
fakeobj->prop=' . $fakeobj->prop . "\n";
$url = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl';
$sc = new SoapClient($url,
array(
'connection_timeout'=>$foo
)
);
print 'After: myi->foo=' . $myi->foo . ' fakevar=' . $fakevar . '
fakeobj->prop=' . $fakeobj->prop . "\n";
Expected result:
----------------
myi->foo= fakevar= fakeobj->prop=
Actual result:
--------------
myi->foo=0 fakevar=0 fakeobj->prop=0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64101&edit=1
Thread (6 messages)