#41895 [Bgs->Opn]: State that no implicit print of objects
| From: | phpbugs at localpin dot com | Date: | Fri, 17 Aug 2007 06:49:52 +0000 |
| Subject: | #41895 [Bgs->Opn]: State that no implicit print of objects | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969377525@lists.php.net to get a copy of this message | ||
ID: 41895
User updated by: phpbugs at localpin dot com
Reported By: phpbugs at localpin dot com
-Status: Bogus
+Status: Open
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
The problem with the documentation is not that the information does not
exist; the problem is that it is not presented in as clear a way as
possible.
Previous Comments:
------------------------------------------------------------------------
[2007-08-16 12:50:27] vrana@php.net
"print $foo" is mentioned in the example of __toString().
------------------------------------------------------------------------
[2007-07-04 15:32:05] phpbugs at localpin dot com
Description:
------------
State explicitly in it's own bullet that "print $myObject" breaks in
5.2.
Reproduce code:
---------------
On the Backward Incompatible Changes page
(http://be.php.net/manual/en/migration52.incompatible.php), it is not
obvious to someone having a problem with "print $myObject" having broken
that the solution lies in the section about "__toString()".
I think it would be worth stating as a separate bullet point the
following
* "print $myObject" no longer works implicitly.
You will need to define a "__toString()" method to any class which you
wish to print directly. See below the section on __toString() for more
details.
This would save people (like me) who are looking for the
answer/solution to this problem a lot of time. The problem is not
noticed by people having a "__toString()" method, and so the info about
"__toString()" does not initially appear relevant. The description
should relate more directly to the most likely place where such a
problem occurs, i.e. why the "print $myObject" has suddenly stopped
working.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41895&edit=1