3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $object1 = new \stdClass(); $object2 = new \stdClass(); $object1->car = 'Toyota'; $object2->food = 'Ham'; $object1->gender = 'Male'; try { throw new Exception("Exception1: {$object1}, Exception2: {$object2}"); } catch (\Exception $e) { echo $e->getMessage(); }
based on 4KaQZ
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class stdClass could not be converted to string in /in/VS8Vp on line 12
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Catchable fatal error: Object of class stdClass could not be converted to string in /in/VS8Vp on line 12
Process exited with code 255.