mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Fixed bug #27443 (defined() returns wrong type).
This commit is contained in:
parent
4db900732d
commit
a84efbe923
2 changed files with 10 additions and 2 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue