mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
- Fixed bug #27443 (defined() returns wrong type).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
8
tests/lang/bug27443.phpt
Normal file
8
tests/lang/bug27443.phpt
Normal file
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Bug #27443 (defined() returns wrong type)
|
||||
--FILE--
|
||||
<?php
|
||||
echo gettype(defined('test'));
|
||||
?>
|
||||
--EXPECT--
|
||||
boolean
|
||||
Reference in New Issue
Block a user