|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-07-15 12:51 UTC] zeev@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
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(); ?>