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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 11:01:32 2024 UTC