|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-30 21:07 UTC] derick@php.net
[2005-01-30 21:21 UTC] Robin at RHarmsen dot nl
[2005-01-30 22:56 UTC] helly@php.net
[2006-05-21 05:30 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 12:00:01 2025 UTC |
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