3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Obc { function __toString() { return "chips"; } } $a = new StdClass(); $b = new Obc(); echo $b; try { echo $a; } catch (Exception $e) { echo "no toString()\n"; }
based on GW7mC
Output for 7.1.0 - 7.2.0
chips Recoverable fatal error: Object of class stdClass could not be converted to string in /in/E6VTf on line 12
Process exited with code 255.
Output for 5.3.20 - 7.0.20
chips Catchable fatal error: Object of class stdClass could not be converted to string in /in/E6VTf on line 12
Process exited with code 255.