summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2004-03-01 08:07:25 +0000
committerDerick Rethans <derick@php.net>2004-03-01 08:07:25 +0000
commita84efbe9232ffec55a52f9dd3eae0418aa7e5eed (patch)
treea9eaf7bd69ca4dcc7bff0a2bb6bc656b15e8fdc5
parent4db900732d3508612255051da5beb304f56d2175 (diff)
downloadphp-git-a84efbe9232ffec55a52f9dd3eae0418aa7e5eed.tar.gz
- Fixed bug #27443 (defined() returns wrong type).
-rw-r--r--Zend/zend_builtin_functions.c4
-rw-r--r--tests/lang/bug27443.phpt8
2 files changed, 10 insertions, 2 deletions
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--
+<?php
+echo gettype(defined('test'));
+?>
+--EXPECT--
+boolean