die()s in functions are a Very Bad Idea because there's no way for callers to capture and do something about the error. They also can cause silent failures by exiting the page without anyone else knowing. This replaces die()s in our include files with exceptions. This does not replace die()s in non-include files. This shouldn't need a lot of (any?) testing as die()s are effectively the same as thrown exceptions from a "stop the world" perspective.
Also replace an assert() that should always be checked. Asserts are only for dev & test and in "production" mode the code within them is not generated or evaluated at all. See https://www.php.net/manual/en/function.assert.php
die()
s in functions are a Very Bad Idea because there's no way for callers to capture and do something about the error. They also can cause silent failures by exiting the page without anyone else knowing. This replacesdie()
s in our include files with exceptions. This does not replacedie()
s in non-include files. This shouldn't need a lot of (any?) testing asdie()
s are effectively the same as thrown exceptions from a "stop the world" perspective.Also replace an
assert()
that should always be checked. Asserts are only for dev & test and in "production" mode the code within them is not generated or evaluated at all. See https://www.php.net/manual/en/function.assert.phpSandbox: https://www.pgdp.org/~cpeel/c.branch/die-die-and-asserts/