From: Derick Rethans Date: Mon, 1 Mar 2004 08:07:25 +0000 (+0000) Subject: - Fixed bug #27443 (defined() returns wrong type). X-Git-Tag: RELEASE_0_2_0~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a84efbe9232ffec55a52f9dd3eae0418aa7e5eed;p=php - Fixed bug #27443 (defined() returns wrong type). --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index bebff236d5..54691ce99a 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -506,9 +506,9 @@ ZEND_FUNCTION(defined) convert_to_string_ex(var); if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c TSRMLS_CC)) { zval_dtor(&c); - RETURN_LONG(1); + RETURN_TRUE; } else { - RETURN_LONG(0); + RETURN_FALSE; } } /* }}} */ diff --git a/tests/lang/bug27443.phpt b/tests/lang/bug27443.phpt new file mode 100644 index 0000000000..409794331b --- /dev/null +++ b/tests/lang/bug27443.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #27443 (defined() returns wrong type) +--FILE-- + +--EXPECT-- +boolean