- var_dump: documentation ( source)
<?php
$object1 = new \stdClass();
$object2 = new \stdClass();
$object1->car = 'Toyota';
$object2->food = 'Ham';
$object1->gender = 'Male';
try {
throw new Exception('Exception1: ' . var_dump($object1) . ', Exception2: ' . var_dump($object2));
} catch (\Exception $e) {
echo $e->getMessage();
}