Please read this small code and the comment below. Any thoughts?
<?php
class numberHandler
{
function numberHandler ()
{
}
function divide_by ($num, $div)
{
// this will cause an Error in case $div is zero
return $num/$div;
}
};
// Some code
$n = new numberHandler();
print $n->divide_by(4,2) . "\n"; // ok
print $n->divide_by(4,0) . "\n"; // Here's the error
/
A "Division by zero on line 13" error will be reported with the line number from the inner of the class and there's no way of tracking the real originator of the error.
How to make it possible to track the origin of the error, like in Java ?
/
?>