php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64101 SoapClient weirdness when passed undefined connection_timeout
Submitted: 2013-01-29 21:00 UTC Modified: 2021-02-12 23:59 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: jeffdafoe at gmail dot com Assigned: cmb (profile)
Status: Closed Package: SOAP related
PHP Version: 5.3.21 OS: CentOS linux, Debian stable
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: jeffdafoe at gmail dot com
New email:
PHP Version: OS:

 

 [2013-01-29 21:00 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-08 14:07 UTC] 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
)
 [2021-02-12 13:50 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-12 13:50 UTC] cmb@php.net
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>
 [2021-02-12 23:56 UTC] jeffdafoe at gmail dot com
-Status: Feedback +Status: Assigned
 [2021-02-12 23:56 UTC] jeffdafoe at gmail dot com
At this point, if you can't repro it I'd just close it. The bug is so old and could've been a manifestation of something long since fixed. I do appreciate you attempting to reproduce it.
 [2021-02-12 23:59 UTC] jeffdafoe at gmail dot com
-Status: Assigned +Status: Closed
 [2021-02-12 23:59 UTC] jeffdafoe at gmail dot com
Oops, been a while since using this bug tracking system. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 08:01:28 2024 UTC