ID:               30421
 User updated by:  melnikow at hotbox dot ru
 Reported By:      melnikow at hotbox dot ru
 Status:           Bogus
 Bug Type:         Feature/Change Request
-Operating System: *
+Operating System: WinXP
 PHP Version:      5.0.1
 New Comment:

Sorry, assumes that

$obj = new Foo();


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

[2004-10-13 10:17:50] [EMAIL PROTECTED]

Your script is bogus:
Notice: Use of undefined constant Foo - assumed 'Foo' in - on line 8



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

[2004-10-13 10:08:06] melnikow at hotbox dot ru

Description:
------------
The new __toString() magic method wont work

Reproduce code:
---------------
The new __toString() magic method allows you to overload the object to
string conversion:
<?php 
class Foo { 
   function __toString() { 
       return "What ever"; 
   } 
} 

$obj = Foo; 
$str = (string) $obj; // call __toString() 
echo $obj; // call __toString() 
?> 

Expected result:
----------------
What ever

Actual result:
--------------
Object#n


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


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

Reply via email to