From:             [EMAIL PROTECTED]
Operating system: Redhat Linux 7.0
PHP version:      4.0.6
PHP Bug Type:     Scripting Engine problem
Bug description:  set_error_handler doesn't trap all errors

I believe this is the same bug as bug report 11803, but I think the scope
is wider than initially reported.

The bug: set_error_handler does not trap an error if I try to call a method
that does not exist.

This is causing grief when a PEAR-style method returns one type of object
on success and another on failure.   The code expecting the success will
call a non-existant method.

Here's some code to emulate the problem:
<?php

// set up my custom error handler
set_error_handler("handleError");

function handleError($errno, $errstr, $errfile, $errline, $obj)
{
  print "<b>My Error Handler:</b> $errstr on line $errline";
}

// define a really basic class
class Foo
{
  var $i;
}

$myFoo = new Foo();

// call a non-existant property (this calls the errorHandler OK)
print $myFoo->choo;

// now call a non-existant method (this bypasses the errorHandler!!!)
$myFoo->bar();

?>
-- 
Edit bug report at: http://bugs.php.net/?id=12136&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to