|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-12-16 11:17 UTC] reeze@php.net
[2012-12-16 11:17 UTC] reeze@php.net
-Status: Open
+Status: Feedback
[2013-01-23 11:11 UTC] saschaprolic at googlemail dot com
[2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 04:00:02 2025 UTC |
Description: ------------ Situation: Custom class which extend from SoapClient and override "public function __doRequest($request, $location, $action, $version, $one_way = null)" $request can't be used to compare strings, instead throw a Segmentation Fault error. $request looks like a C Pointer or any other type instead of a PHP String type As workaround you can filter the variable passing the value through a function which return basically the same value of the argument passed as input (like ltrim) after that it's possible save the returned value and now is a normal PHP String and can be compared. Test script: --------------- FAILING CODE: public $lastRequest; function __doRequest($request, $location, $action, $version, $one_way = 0) { $this->lastRequest = $request; } $this->assertEquals('SomeContent', $this->lastRequest); // Segmentation Faul. WORKAROUND: public $lastRequest; function __doRequest($request, $location, $action, $version, $one_way = 0) { $this->lastRequest = ltrim($request); // Pass $request through a function } $this->assertEquals('SomeContent', $this->lastRequest); // Works