ID: 30421
Updated by: [EMAIL PROTECTED]
Reported By: melnikow at hotbox dot ru
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: WinXP SP2
PHP Version: 5.0.1
New Comment:
Your script is bogus:
Notice: Use of undefined constant Foo - assumed 'Foo' in - on line 8
Previous Comments:
------------------------------------------------------------------------
[2004-10-13 10:08:06] melnikow at hotbox dot ru
Description:
------------
The new __toString() magic method wont work
Reproduce code:
---------------
The new __toString() magic method allows you to overload the object to
string conversion:
<?php
class Foo {
function __toString() {
return "What ever";
}
}
$obj = Foo;
$str = (string) $obj; // call __toString()
echo $obj; // call __toString()
?>
Expected result:
----------------
What ever
Actual result:
--------------
Object#n
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30421&edit=1