From:             scm2tj at cs dot cf dot ac dot uk
Operating system: 
PHP version:      5.0.0
PHP Bug Type:     Feature/Change Request
Bug description:  die() does not call $obj->__toString()

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 bug report at http://bugs.php.net/?id=29295&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29295&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29295&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29295&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29295&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29295&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29295&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29295&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29295&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29295&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29295&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29295&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29295&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29295&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29295&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29295&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29295&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29295&r=float

Reply via email to