assert.bail INI setting is deprecated
Description
assert.bail is a legacy INI directive from the pre-PHP 7 implementation of assert(). When enabled, it terminated script execution as soon as a failed assertion was encountered, instead of letting the script continue.
This behavior is redundant with throwing an AssertionError (the default behavior since PHP 7 when assert.exception is enabled), which already interrupts execution unless the exception is caught. As part of the general cleanup of the legacy assertion configuration, assert.bail is now deprecated.
The deprecation notice is triggered whenever assert.bail is set to a truthy value, either in php.ini or through ini_set().
Example
<?php
ini_set('assert.bail', '1');
?>
Alternatives
- Rely on the
AssertionErrorexception thrown by failed assertions (controlled byassert.exception) to stop execution, and catch it where appropriate. - Remove
ini_set()/ini_get()calls involvingassert.bailfrom the code.
Related error messages
- assert.active-ini-setting-is-deprecated
- assert.exception-ini-setting-is-deprecated
- assert.warning-ini-setting-is-deprecated
In previous PHP versions, this error message used to be :ref:assert.active-ini-setting-is-deprecated.
In more recent PHP versions, this error message is now :ref:assert.exception-ini-setting-is-deprecated.
Changed Behavior
This error may appear following an evolution in behavior, in previous versions. See assert