From:             kievman at ukrpost dot net
Operating system: Win2k server
PHP version:      5.0.1
PHP Bug Type:     Strings related
Bug description:  Converting of object to string does not work properly.

Description:
------------
Converting of object to string does not work properly. The code below
explains all.

Reproduce code:
---------------
<?php
class Foo {
    function __toString() {
        return "What ever";
    }
}

$obj = new Foo;
$str = (string) $obj; // call __toString()
echo $obj; // call __toString(), prints "What ever", it's good
print $str; // prints "Object id #1" it's not good
?>


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

Reply via email to