Last active
December 25, 2015 14:59
-
-
Save spectrox/6994920 to your computer and use it in GitHub Desktop.
PHP...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interactive shell | |
php > class A { public $i = 3; public function __toString() { return $this->i; } } | |
php > $a = new A(); | |
php > echo "$a" + 2; | |
PHP Catchable fatal error: Method A::__toString() must return a string value in php shell code on line 1 | |
php > $a->i = '3'; | |
php > echo "$a" + 2; | |
5 | |
php > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment