I did as much as possible from the steps asked in the php bugs page, but still I want to check with you folks before submitting a bug report.
I found a strange behavior in PHP 5.2.4. Try running the following code: <?php class Foo { static public $foo; function __toString() { self::$foo = $this; return 'foo'; } } $foo = (string) new Foo(); var_dump(Foo::$foo); ?> At the end of the script, the static var stores not the object but the string returned by toString.