1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

core: Warn when non-representable floats are coerced to int (#19760)

RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
This commit is contained in:
Gina Peter Banyard
2025-09-21 23:53:16 +01:00
committed by GitHub
parent 5f00673a45
commit b4ed215299
62 changed files with 1107 additions and 275 deletions

View File

@@ -745,7 +745,7 @@ static inline void php_register_server_variables(void)
/* store request init time */
ZVAL_DOUBLE(&tmp, sapi_get_request_time());
php_register_variable_quick("REQUEST_TIME_FLOAT", sizeof("REQUEST_TIME_FLOAT")-1, &tmp, ht);
ZVAL_LONG(&tmp, zend_dval_to_lval(Z_DVAL(tmp)));
ZVAL_LONG(&tmp, zend_dval_to_lval_silent(Z_DVAL(tmp)));
php_register_variable_quick("REQUEST_TIME", sizeof("REQUEST_TIME")-1, &tmp, ht);
}
/* }}} */