|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-02 18:35 UTC] mike@php.net
[2006-04-02 19:11 UTC] acc dot data at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 01:00:01 2025 UTC |
Description: ------------ Can't set an error handler to a private method from another (public) method of the same class Reproduce code: --------------- <?php class Test { private function errorHandler($errno, $errstr, $errfile, $errline) { echo "handled"; } function __construct() { set_error_handler(array(&$this, "errorHandler")); $dom = new DOMDocument(); $dom->load("not found"); // warning restore_error_handler(); } } $test = new Test(); ?> Expected result: ---------------- handled Actual result: -------------- Fatal error: Call to private method Test::errorHandler() from context '' in C:\test.php on line 13