Bug #52360 [Ver->Csd]: Strval documentation is unclear on whether it works on objects

From: Date: Tue, 20 Jul 2010 13:56:44 +0000
Subject: Bug #52360 [Ver->Csd]: Strval documentation is unclear on whether it works on objects
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4718@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52360&edit=1 ID: 52360 Updated by: rquadling@php.net Reported by: sjoerd-php at linuxonly dot nl Summary: Strval documentation is unclear on whether it works on objects -Status: Verified +Status: Closed Type: Bug Package: Documentation problem PHP Version: Irrelevant Assigned To: rquadling New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2010-07-20 15:56:35] rquadling@php.net Automatic comment from SVN on behalf of rquadling Revision: http://svn.php.net/viewvc/?view=revision&revision=301421 Log: Strval var parameter updated to include objects implmenting a __toString() method. Fixes bug #52360 ------------------------------------------------------------------------ [2010-07-16 14:21:31] degeberg@php.net It isn't bogus. The example contradicts the parameter description. It can take objects iff they implement the __toString() method. ------------------------------------------------------------------------ [2010-07-16 14:16:05] rquadling@php.net Please explain what else needs to be said in the Parameters section regarding the $var parameter which currently reads: "The variable that is being converted to a string. var may be any scalar type. You cannot use strval() on arrays or objects." Clearly, new StrValTest which returns an object of class StrValTest, is an object and can't be used by strval(). ------------------------------------------------------------------------ [2010-07-16 14:01:36] sjoerd-php at linuxonly dot nl Description: ------------ Strval documentation is unclear on whether it works on objects. Parameter documentation for val: var may be any scalar type. You cannot use strval() on arrays or objects. Example #1: echo strval(new StrValTest); Does not compute. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52360&edit=1

« previous php.doc.bugs (#4718) next »