PHP code example of treehousetim / exception

1. Go to this page and download the library: Download treehousetim/exception 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/ */

    

treehousetim / exception example snippets


throw new Exception(
	'This',
	'is',
	$lib->getErrorText(),
	'bad',
	Exception::normalError
);

 namespace treehousetim\somefancylibrary;

class Exception extends \treehousetim\exception\Exception
{
	const normalError = 0;
	const shinyError = 1;
	const matteError = 2;
	const sphericalError = 3;
}

 namespace treehousetim\somefancylibrary;

class burgerifier
{
	public function zorkAdventure()
	{
		throw new Exception(
			'This',
			'is',
			$lib->getErrorText(),
			'bad',
			Exception::normalError
		);
	}
}