Req #80165 [NEW]: set_exception_handler() should return false on error

From: Date: Thu, 01 Oct 2020 08:00:13 +0000
Subject: Req #80165 [NEW]: set_exception_handler() should return false on error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229291@lists.php.net to get a copy of this message
From:             divinity76 at gmail dot com
Operating system: 
PHP version:      Next Major Version
Package:          Unknown/Other Function
Bug Type:         Feature/Change Request
Bug description:set_exception_handler() should return false on error

Description:
------------
currently set_exception_handler() returns null on error, and
null|callable on success. 

so when it does return null, there's no good way to tell "did it return
null because of an error, or did it return null because of
success-but-there-was-no-previous-handler ?"

.. i think it would be an improvement if it returned bool(false) on
error and null|callable on success, then it would cleanly separate
error-returns from success-returns. i guess that's a BC-break and should
go in the next major version though (for scripts knowing full well that
there's a previous handler and looking for nulls to detect errors? idk
if that even exist, but i guess it might)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=80165&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80165&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80165&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80165&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80165&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80165&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80165&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80165&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80165&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80165&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80165&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80165&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80165&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80165&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80165&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80165&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80165&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80165&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#229291) next »