[ciapug] PHP 5.2.x : __toString stuff

Wade Arnold Wade.Arnold at t8design.com
Fri Nov 21 19:33:36 CST 2008


David I an curiuse as to why you upgraded to 5.2 and not 5.2.6 ? Was  
that the distro and if so what distro ?

Wade

Sent from my iPhone

On Nov 21, 2008, at 2:25 PM, "David Champion"  
<dchampion at visionary.com> wrote:

> I ran across an issue in an existing system, where a server got  
> upgraded
> to PHP 5.2.0 from 5.1.4, and it started throwing this error:
>
> "Catchable fatal error: Object of class stdClass could not be  
> converted
> to string in.."
>
> Here's a thread that explains and / or complains about the issue:
>
> http://bugs.php.net/bug.php?id=41221
>
> In my case, I was able to do a quick fix - it was referencing the  
> ADODB
> result set's method FetchField like this:
>
> $field = $this->results->FetchField($col);
>
> I changed it to this:
>
> $field = $this->results->FetchField[$col];
>
> ... and it fixed the issue, since it's now returning the array element
> instead of making a function call that returns a string.
>
> Anyway, just something some of you may need to look out for when
> upgrading PHP. Looking around for solutions, I saw that this affects
> various 3rd party apps & libraries like forums and shopping cart
> applications, so... be sure and test before you upgrade.
>
> Somewhere along the way, among some documentation about __toString()  
> and
> the other "magic functions", there was a mention that this behavior  
> may
> change in the future too.
>
> -dc
>
>
> _______________________________________________
> ciapug mailing list
> ciapug at cialug.org
> http://cialug.org/mailman/listinfo/ciapug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/ciapug/attachments/20081121/5195e1f2/attachment.htm


More information about the ciapug mailing list