ID: 30421
Updated by: [EMAIL PROTECTED]
Reported By: melnikow at hotbox dot ru
Status: Bogus
Bug Type: Feature/Change Request
Operating System: WinXP
PHP Version: 5.0.1
New Comment:
Still works as expected:
[EMAIL PROTECTED]:~$ php-5.0dev bug30421.php
What ever
[EMAIL PROTECTED]:~$ php-5.0dev -v bug30421.php
PHP 5.0.2-dev (cli) (built: Sep 12 2004 11:50:47) (DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.2-dev, Copyright (c) 1998-2004 Zend Technologies
Previous Comments:
------------------------------------------------------------------------
[2004-10-13 18:22:59] melnikow at hotbox dot ru
Sorry, assumes that
$obj = new Foo();
------------------------------------------------------------------------
[2004-10-13 10:17:50] [EMAIL PROTECTED]
Your script is bogus:
Notice: Use of undefined constant Foo - assumed 'Foo' in - on line 8
------------------------------------------------------------------------
[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