Req #47136 [Com]: namespace reserved set_error|exception_handler
| From: | nikic@php.net | Date: | Fri, 23 Mar 2012 21:14:04 +0000 |
| Subject: | Req #47136 [Com]: namespace reserved set_error|exception_handler | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168781@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47136&edit=1
ID: 47136
Comment by: nikic@php.net
Reported by: info at netmosfera dot it
Summary: namespace reserved set_error|exception_handler
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: irrelevant
PHP Version: 5.3.0alpha3
Block user comment: N
Private report: N
New Comment:
I don't understand this feature request. Do you mean that the error handler should only catch
errors thrown in that namespace? If so, then it doesn't make sense as namespaces are only a
mechanism of resolving names, they don't interfere with the main code.
Previous Comments:
------------------------------------------------------------------------
[2009-01-17 12:40:55] info at netmosfera dot it
Description:
------------
hello
is possibile to define errors/exceptions handlers
reserved to namespaces?
because argument 2 is optional maybe it is hard to write
set_error_handler("debug", E_ALL, __NAMESPACE__);
so:
// for functions:
set_error_handler(array("", "debug", __NAMESPACE__));
// for classes (static way):
set_error_handler(array("myclass", "debug", __NAMESPACE__));
// for objects:
set_error_handler(array($this, "debug", __NAMESPACE__));
thank you
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47136&edit=1