1. Go to this page and download the library: Download evo/ejinn library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
//Catch a single exception ( based on class )
try{
throw \Excption("some really verbose message");
}catch(\Exception $e ){
echo $e->getMessage(); //prints "?"
}
//Catch a single exception ( based on class )
try{
throw \Excption("some really verbose message", 100);
}catch(\Exception $e ){
if($e->getCode() == 200 )
echo $e->getMessage(); //prints "?"
else
throw \Excption("rethrow", $e->getCode(), $e);
}
//Catch a single exception ( based on class )
try{
throw \Excption("some really verbose message", 100);
}catch(\eJinn\Exception\ResservedCode $e ){
//catch only class \eJinn\Exception\ResservedCode
}catch(\eJinn\Exception\eJinnExceptionInterface $e ){
//catch any class that implements \eJinn\Exception\eJinnExceptionInterface
}