Skip to content

Commit ced2ca3

Browse files
Only display report_memleaks deprecation message in debug builds
1 parent 504a633 commit ced2ca3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,11 @@ static PHP_INI_MH(OnUpdateReportMemleaks)
703703
bool *p = (bool *) ZEND_INI_GET_ADDR();
704704
bool new_bool_value = zend_ini_parse_bool(new_value);
705705

706+
#if ZEND_DEBUG
706707
if (!new_bool_value) {
707708
php_error_docref(NULL, E_DEPRECATED, "Directive 'report_memleaks' is deprecated");
708709
}
710+
#endif
709711

710712
*p = new_bool_value;
711713
return SUCCESS;

tests/basic/ini_directive_deprecated_report_memleaks.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
2-
Deprecated INI directive report_memleaks warning
2+
Deprecated INI directive report_memleaks warning (debug build only)
3+
--SKIPIF--
4+
<?php
5+
if (!ZEND_DEBUG_BUILD) die("skip requires debug build");
6+
?>
37
--INI--
48
report_memleaks=0
59
--FILE--

0 commit comments

Comments
 (0)