[Kolab-devel] debug("checkuniquemail...) in user.php fails withphp-5.2

Marcus Hüwe suse-tux at gmx.de
Tue Dec 19 21:53:06 CET 2006


Hi,

On 2006-12-19 15:16:54 -0500, Marc-Antoine Zizka wrote:
> > From: Marcus Hüwe [mailto:suse-tux at gmx.de]
> > [...]
> >
> > The problem is that the version of php which is delivered with opensuse
> > 10.2
> > is more strict than older php version.
> > 
> > "$form" is an instance of the KolabForm class, so $form can't be echo'ed
> > and
> > can't be put in a string ("blabla $form...").
> > So what should we do now? For what do you need the $form object or what
> > for
> > debug information do you want to get from it?
> > 
> > I think it's the object id. Because if you run "echo $object" you'll get
> > the
> > object id (this doesn't work anymore with newer php version).
> > for example:
> > 	echo "$form";
> > 
> > 	output:
> > 	"Object id #3"
> > 
> > Do someone know if there's a way to get the object id (in newer php
> > versions)?
> 
> Just add a __toString() function inside KolabForm and have it return some
> useful info concerning the object (form name, etc). In older PHP versions it
> will still print the object ID (I can't see how that could be useful
> debugging information), but in PHP 5.2+ the __toString method will be called
> automatically.
> 
Hmm i thought about the __toString() method too but i'm not quite sure if such
information would be sufficient. (well i don't know much about php so i don't
know for what the object id can be used).
What variables from the KolabForm class can be returned in the __tostring
method?

Can someone comment on this? (maybe one of the dev's? :) ).


Marcus




More information about the devel mailing list