php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62580 Argument-resolving of set_error_handler() within namespaces
Submitted: 2012-07-16 17:28 UTC Modified: 2012-07-16 17:34 UTC
From: r dot wilczek at web-appz dot de Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.4.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: r dot wilczek at web-appz dot de
New email:
PHP Version: OS:

 

 [2012-07-16 17:28 UTC] r dot wilczek at web-appz dot de
Description:
------------
Within a namespace, set_error_handler($callable) tries to resolve $callable against this namespace, if $callable is a simple string.

This is inconsistent to other PHP-APIs, which do not resolve static global functionnames against the current namespace.



Test script:
---------------
<?php
namespace Foo;
function handle() {}
set_error_handler('handle');

Expected result:
----------------
# no error, warning etc. at all

Actual result:
--------------
PHP Warning:  set_error_handler() expects the argument (handle) to be a valid callback

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-16 17:34 UTC] r dot wilczek at web-appz dot de
argh. Forget this one. Not an issue.
 [2012-07-16 17:34 UTC] r dot wilczek at web-appz dot de
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 02 21:01:27 2025 UTC