How to I return different type with __toString() method?

palmermeerkat

New Member
We use __toString() to returning class's default value like that:\[code\]<?phpclass my{ public function __toString() { return "asdasd"; }}?>\[/code\]It returns only string type. But I want to return resource type:\[code\]<?phpclass my{ public function __toString() { return imagecreatefromjpeg("image.jpg"); }}?>\[/code\]It doesn't work.How to do it?Is there any method instead of __toString() or any way with using __toString?
 
Back
Top