|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 11:00:01 2025 UTC |
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 )