-
-
Notifications
You must be signed in to change notification settings - Fork 30
wp_die() not exclusively an early terminating function #200
Copy link
Copy link
Closed
Description
wp_die() is treated as if it terminated script execution early:
phpstan-wordpress/extension.neon
Lines 126 to 127 in 76f7835
| earlyTerminatingFunctionCalls: | |
| - wp_die |
But for wp_die('', '', ['exit' => false]) the script execution will not be terminated in any of WP's wp_die handlers.
if (somethingIsTrue()) {
$foo = true;
} elseif (orSomethingElseIsTrue()) {
$foo = false;
} else {
wp_die('', '', ['exit' => false])
}
doFoo($foo); // won't catch possibly undefined variable $fooReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels