NYCPHP Meetup

[nycphp-talk] PHP 5.3 Problem - Object Creation problem

Jeff Siegel jeffmailings99 at verizon.net
Thu Aug 23 10:25:01 EDT 2007


Dan,

While the Q&D (Quick and Dirty) method solved the problem...you are
correct...makes sense to find out the real source of the problem.

As best as I can tell...what made PHP annoyed was when I instantiated a
class from within another class. That is, class "A" was instantiated by one
of the methods in class "B."

Jeff



[snip]
On Tue, Aug 21, 2007 at 09:39:47AM -0400, jeff mailings wrote:
> Anyone know the best way to handle this error? "PHP Catchable fatal error:
> Object of class Database could not be converted to string"

Beside the __toString() workaround mentioned, I'd get to the root of the
matter: objects are not strings, so fix the code where you're using them
as such.  Are you, by chance, using an object as an array key?

--Dan
[snip]





More information about the talk mailing list