mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
cffa81e438
@ -10,7 +10,22 @@ class Foo {
|
||||
public bool $bool = false;
|
||||
public iterable $iter = [];
|
||||
}
|
||||
echo "ok\n";
|
||||
var_dump(new Foo);
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
object(Foo)#1 (6) {
|
||||
["int"]=>
|
||||
int(1)
|
||||
["flt"]=>
|
||||
float(2.2)
|
||||
["flt2"]=>
|
||||
float(2)
|
||||
["arr"]=>
|
||||
array(0) {
|
||||
}
|
||||
["bool"]=>
|
||||
bool(false)
|
||||
["iter"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
|
@ -5352,6 +5352,7 @@ static zend_type zend_compile_typename(zend_ast *ast, zend_bool force_allow_null
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* May convert value from int to float. */
|
||||
static zend_bool zend_is_valid_default_value(zend_type type, zval *value)
|
||||
{
|
||||
ZEND_ASSERT(ZEND_TYPE_IS_SET(type));
|
||||
@ -5367,6 +5368,7 @@ static zend_bool zend_is_valid_default_value(zend_type type, zval *value)
|
||||
}
|
||||
if ((ZEND_TYPE_MASK(type) & MAY_BE_DOUBLE) && Z_TYPE_P(value) == IS_LONG) {
|
||||
/* Integers are allowed as initializers for floating-point values. */
|
||||
convert_to_double(value);
|
||||
return 1;
|
||||
}
|
||||
if ((ZEND_TYPE_MASK(type) & MAY_BE_ITERABLE) && Z_TYPE_P(value) == IS_ARRAY) {
|
||||
|
Loading…
Reference in New Issue
Block a user