From 434ae90e852ed2b39432baf30d928e26b834c03e Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 22 Aug 2016 23:44:38 +0800 Subject: Fixed bug #72920 (Accessing a private constant using constant() creates an exception AND warning) --- ext/standard/basic_functions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/standard/basic_functions.c') diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 5463665a09..58f9b49151 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3887,7 +3887,9 @@ PHP_FUNCTION(constant) } } } else { - php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", ZSTR_VAL(const_name)); + if (!EG(exception)) { + php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", ZSTR_VAL(const_name)); + } RETURN_NULL(); } } -- cgit v1.2.1