witam, ostatnio napotkalem sie z wyjatkami (exception, nie wiem czy dobrze przetlumaczylem)
no i mam taka prosta klase do wyjatkow
<?php
/**
* visionBoard
*
* @author Denis Wróbel
* @package visionBoard
* @license <a href="http://www.gnu.org/licenses/gpl-3.0.html" target="_blank">http://www.gnu.org/licenses/gpl-3.0.html</a>
* @version 0.1
*
*/
class visionException extends Exception
{
/**
* Exception type
*/
private $exc_type = '';
/**
* Exception message
*/
private $exc_message = '';
/**
* Exception cause
*/
private $exc_cause = '';
// ------------------------------------------------------------------------
/**
* Exception constructor
*
* @param string $ext_type
* @param string $exc_message
*/
function __construct( $ext_type, $exc_message, $exc_cause)
{
// Pass variables from function arguments to in-class variables
$this -> exc_type = $ext_type;
$this -> exc_message = $exc_message;
$this -> exc_cause = $exc_cause;
}
/**
* Returns exception page HTML
*/
function __toString()
{
return $this->exc_cause . $this->exc_message . $this->exc_type;
}
}
?>
no i jak cos nie pasuje to robie w klase macierzystej ze tak to nazwe
throw new visionException( 'COS', 'COS2', 'COS3' );
no i efekt
Fatal error: Uncaught COS3COS2COS thrown in E:\htdocs\vision\index.php on line 25
nie umiem sobie z tym poradzic

pomocy