]> granicus.if.org Git - php/commitdiff
- Fixed bug #27443 (defined() returns wrong type).
authorDerick Rethans <derick@php.net>
Mon, 1 Mar 2004 08:07:25 +0000 (08:07 +0000)
committerDerick Rethans <derick@php.net>
Mon, 1 Mar 2004 08:07:25 +0000 (08:07 +0000)
Zend/zend_builtin_functions.c
tests/lang/bug27443.phpt [new file with mode: 0644]

index bebff236d5260847cf1f7dcf194c31a2a058c2f0..54691ce99a72ab744deda00316fb676ee6aea2fb 100644 (file)
@@ -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 (file)
index 0000000..4097943
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+Bug #27443 (defined() returns wrong type)
+--FILE--
+<?php
+echo gettype(defined('test'));
+?>
+--EXPECT--
+boolean