ID:               31766
 Updated by:       [EMAIL PROTECTED]
 Reported By:      Robin at RHarmsen dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Output Control
 Operating System: Windows 2003
 PHP Version:      5.0.3
 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

only echo and print call __toString()


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

[2005-01-30 20:57:46] Robin at RHarmsen dot nl

Description:
------------
When having an object with an __toString() and using this object as a
parameter in a printf the __toString isn't called

Reproduce code:
---------------
class User
{
  public $username;
  public function __toString()
  {
    return $username;
  }
}

$user = new User();
$user->username = "Test";
echo $this->user;
printf("Logged in as: %s\n",$this->user);



Expected result:
----------------
Test
Logged in as: Test

Actual result:
--------------
Test
Logged in as: Object id #1


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


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

Reply via email to