mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
parent
9a42d2b87b
commit
629965c80f
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Promote deprecation warning for int|string type into exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int|string $arg) {}
|
||||
|
||||
set_error_handler(function($_, $msg) {
|
||||
throw new Exception($msg);
|
||||
});
|
||||
|
||||
try {
|
||||
test(0.5);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Implicit conversion from float 0.5 to int loses precision
|
@ -726,6 +726,8 @@ static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
|
||||
zval_ptr_dtor(arg);
|
||||
ZVAL_LONG(arg, lval);
|
||||
return 1;
|
||||
} else if (UNEXPECTED(EG(exception))) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if ((type_mask & MAY_BE_DOUBLE) && zend_parse_arg_double_weak(arg, &dval, 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user