2 things that are foriegn to me. Im trying to construct a class to
handle errors.
I started out trying to make it recognise errors in the first place and
then expand, but Im having difficulty.
class.php
<?php
class eh
{
function eh()
{
error_reporting (E_ERROR | E_WARNING | E_PARSE);
set_error_handler($this->errorhandler);
}
function errorhandler($type, $str, $file, $line)
{
switch ($type)
{
case E_ERROR:
echo 'ERROR OCCURED';
break;
case E_WARNING:
echo 'YOUR WARNING!';
break;
}
}
}
?>
-----------------------------------------------------------
test.php
<?php
require_once('./class.php');
$eh = new eh();
join (':', $next);
?>
Whenever I run test.php, I get the regular php error page instead 'ERROR
OCCURED'. Im not sure if I can feed set_error_handler the way I did.
Does anyone see anything wrong with this piece of code?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php