Skip to content

Commit 18b09f7

Browse files
committed
Do not display deprecation on shutdown
1 parent 9da0c71 commit 18b09f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ext/standard/assert.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */
4848
ZVAL_UNDEF(&ASSERTG(callback));
4949
}
5050
if (new_value && (Z_TYPE(ASSERTG(callback)) != IS_UNDEF || ZSTR_LEN(new_value))) {
51-
php_error_docref(NULL, E_DEPRECATED, "assert.callback INI setting is deprecated");
51+
if (stage != ZEND_INI_STAGE_DEACTIVATE && stage != ZEND_INI_STAGE_SHUTDOWN && stage != ZEND_INI_STAGE_ASSERT_OPTIONS) {
52+
php_error_docref(NULL, E_DEPRECATED, "assert.callback INI setting is deprecated");
53+
}
5254
ZVAL_STR_COPY(&ASSERTG(callback), new_value);
5355
}
5456
} else {
5557
if (ASSERTG(cb)) {
5658
pefree(ASSERTG(cb), 1);
5759
}
5860
if (new_value && ZSTR_LEN(new_value)) {
59-
php_error_docref(NULL, E_DEPRECATED, "assert.callback INI setting is deprecated");
61+
if (stage != ZEND_INI_STAGE_DEACTIVATE && stage != ZEND_INI_STAGE_SHUTDOWN && stage != ZEND_INI_STAGE_ASSERT_OPTIONS) {
62+
php_error_docref(NULL, E_DEPRECATED, "assert.callback INI setting is deprecated");
63+
}
6064
ASSERTG(cb) = pemalloc(ZSTR_LEN(new_value) + 1, 1);
6165
memcpy(ASSERTG(cb), ZSTR_VAL(new_value), ZSTR_LEN(new_value));
6266
ASSERTG(cb)[ZSTR_LEN(new_value)] = '\0';

ext/standard/tests/assert/assert_variation.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,3 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated in %s on line %d
193193

194194
Deprecated: Function assert_options() is deprecated in %s on line %d
195195
float(3.141)
196-
197-
Deprecated: PHP Request Shutdown: assert.callback INI setting is deprecated in Unknown on line 0

0 commit comments

Comments
 (0)