Bug #64101 [Fbk->Asn]: SoapClient weirdness when passed undefined connection_timeout

From: Date: Fri, 12 Feb 2021 23:56:46 +0000
Subject: Bug #64101 [Fbk->Asn]: SoapClient weirdness when passed undefined connection_timeout
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232120@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64101&edit=1 ID: 64101 User updated by: jeffdafoe at gmail dot com Reported by: jeffdafoe at gmail dot com Summary: SoapClient weirdness when passed undefined connection_timeout -Status: Feedback +Status: Assigned Type: Bug Package: SOAP related Operating System: CentOS linux, Debian stable PHP Version: 5.3.21 Assigned To: cmb Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2021-02-12 13:50:38] 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> ------------------------------------------------------------------------ [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

« previous php.bugs (#232120) next »