- var_dump: documentation ( source)
<?php
class CustomException_Post extends Exception {}
class api {
public function __construct($user_id, $token) {}
public function post($data) {
throw new CustomException_Post('Error 1');
}
}
$data = [];
try {
$api = new api('id','key');
$output = $api->post($data);
} catch (CustomException_Post $e) {
var_dump($e);
} catch (Exception $e) {
var_dump($e);
}