Skip to content

Only display report_memleaks deprecation message in debug builds #19521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ static PHP_INI_MH(OnUpdateReportMemleaks)
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool new_bool_value = zend_ini_parse_bool(new_value);

#if ZEND_DEBUG
if (!new_bool_value) {
php_error_docref(NULL, E_DEPRECATED, "Directive 'report_memleaks' is deprecated");
}
#endif

*p = new_bool_value;
return SUCCESS;
Expand Down
6 changes: 5 additions & 1 deletion tests/basic/ini_directive_deprecated_report_memleaks.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
--TEST--
Deprecated INI directive report_memleaks warning
Deprecated INI directive report_memleaks warning (debug build only)
--SKIPIF--
<?php
if (!ZEND_DEBUG_BUILD) die("skip requires debug build");
?>
--INI--
report_memleaks=0
--FILE--
Expand Down