note 70257 deleted from function.strval by bjori
| From: | bjori@php.net | Date: | Mon, 09 Oct 2006 10:55:34 +0000 |
| Subject: | note 70257 deleted from function.strval by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118249@lists.php.net to get a copy of this message | ||
Note Submitter: judas dot iscariote at gmail dot com
Reason: in docs
----
since PHP 5.2 this function can be used with objects that implements the magic __toString() method,
previous versions will return the object id as an string.
<?php
class test {
function __toString()
{
return "foo";
}
}
$foo = strval(new test) . PHP_EOL;
echo $foo;
?>
php 5.2 outputs : foo
earlier versions : Object id #1