note 99751 added to language.oop5.magic

From: Date: Fri, 03 Sep 2010 02:27:38 +0000
Subject: note 99751 added to language.oop5.magic
Groups: php.notes 
Request: Send a blank email to php-notes+get-172287@lists.php.net to get a copy of this message
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

« previous php.notes (#172287) next »