PHP Error, is it resolvable, or a language bug?

Posted by rls on Stack Overflow See other posts from Stack Overflow or by rls
Published on 2010-03-29T12:47:38Z Indexed on 2010/03/29 13:03 UTC
Read the original article Hit count: 264

Filed under:
|
|

Given the following code

$c= new SoapClient('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL');

$usa = "USD";
$eng = "GBP";

doing a __getTypes on the client gives me

Array ( [0] => struct ConversionRate { Currency FromCurrency; Currency ToCurrency; } [1] => string Currency [2] => struct ConversionRateResponse { double ConversionRateResult; } )

if i then do

$calculation = $c->ConversionRate($usa, $eng);

and print calculation i get an error about

Catchable fatal error: Object of class stdClass could not be converted to string

Is there a specific way i should be printing this out, or i it a bug, from researching / googling many people seem to have a problem but i cant find a suitbale solution, other than downgrading php, which isnt a solution for me as i am doing this as homework and its running off of a college server

© Stack Overflow or respective owner

Related posts about php

Related posts about error