codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php /* sample code to show use of magic methods <b>__toString()</b>. * http://royads.blogspot.com */ class stringTest { public function __toString() { return 'It can\'t be echo like this'; } } class stringTest2 { } $obj = new stringTest(); echo $obj."\n\n\n"; $obj = new stringTest2(); echo $obj; ?>
Private
[
?
]
Run code