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

Marc-Antoine Zizka mazizka at wantedtech.com
Tue Dec 19 21:16:54 CET 2006


> 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.




More information about the devel mailing list