Skip to content

Instantly share code, notes, and snippets.

@spectrox
Last active December 25, 2015 14:59
Show Gist options
  • Save spectrox/6994920 to your computer and use it in GitHub Desktop.
Save spectrox/6994920 to your computer and use it in GitHub Desktop.
PHP...
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