We should use a function like __toResource:
class a
{
public function __toString()
{
return "Hello";
}
}
$a = new a();
echo $a; //Hello
If we wonna use $a as resource type(example:image), we would should use another magic method
----
Server IP: 69.147.83.197
Probable Submitter: 94.123.171.66
----
Manual Page -- http://www.php.net/manual/en/language.oop5.magic.php
Edit -- https://master.php.net/note/edit/99751
Del: integrated -- https://master.php.net/note/delete/99751/integrated
Del: useless -- https://master.php.net/note/delete/99751/useless
Del: bad code -- https://master.php.net/note/delete/99751/bad+code
Del: spam -- https://master.php.net/note/delete/99751/spam
Del: non-english -- https://master.php.net/note/delete/99751/non-english
Del: in docs -- https://master.php.net/note/delete/99751/in+docs
Del: other reasons-- https://master.php.net/note/delete/99751
Reject -- https://master.php.net/note/reject/99751
Search -- https://master.php.net/manage/user-notes.php
----