Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

note 99751 added to language.oop5.magic

4 views
Skip to first unread message

ihsan...@gmail.com

unread,
Sep 2, 2010, 10:27:38 PM9/2/10
to php-...@lists.php.net
Why is there nothing to use the object name as a resource like __toString method?

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

danb...@php.net

unread,
Sep 3, 2010, 10:06:07 AM9/3/10
to php-...@lists.php.net
Note Submitter: ihsanduvac at gmail dot com

----

0 new messages