ID:          29295
 Updated by:  [EMAIL PROTECTED]
 Reported By: scm2tj at cs dot cf dot ac dot uk
-Status:      Open
+Status:      Bogus
 Bug Type:    Feature/Change Request
 PHP Version: 5.0.0
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

In 5.0.x __toString() will only be called automatically for print/echo.
Maybe we will change that for 5.1.x if we find out how.


Previous Comments:
------------------------------------------------------------------------

[2004-07-21 12:58:23] scm2tj at cs dot cf dot ac dot uk

Description:
------------
Using the die() function and passing a object as a parameter, you'd
expect the __toString() function to be called, but it isn't. I
understand there are problems with concatenation, but in this instance,
just the object is being passed.

Reproduce code:
---------------
<?php
class Foobar {
    public function __toString() {
        return "Foo";
    }
}
$bar = new Foobar;
die($bar);
?>

Expected result:
----------------
Foo

Actual result:
--------------
Object id #1


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29295&edit=1

Reply via email to