Merge branch 'PHP-8.4'

* PHP-8.4:
  NEWS for hrtime in FTP and standard
  Handle broken hrtime in ftp
  Fix arginfo/zpp violation if zend_hrtime is not available
This commit is contained in:
Niels Dossche 2025-07-25 12:05:17 +02:00
commit 93b9808004
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 3 additions and 2 deletions

View file

@ -1382,7 +1382,8 @@ static int my_poll(php_socket_t fd, int events, int timeout) {
if (n == -1 && php_socket_errno() == EINTR) {
zend_hrtime_t delta_ns = zend_hrtime() - start_ns;
if (delta_ns > timeout_hr) {
/* delta_ns == 0 is only possible with a platform that does not support a high-res timer. */
if (delta_ns > timeout_hr || UNEXPECTED(delta_ns == 0)) {
#ifndef PHP_WIN32
errno = ETIMEDOUT;
#endif

View file

@ -46,7 +46,6 @@
delivered timestamp is monotonic and cannot be adjusted. */
PHP_FUNCTION(hrtime)
{
#if ZEND_HRTIME_AVAILABLE
bool get_as_num = 0;
zend_hrtime_t t = zend_hrtime();
@ -55,6 +54,7 @@ PHP_FUNCTION(hrtime)
Z_PARAM_BOOL(get_as_num)
ZEND_PARSE_PARAMETERS_END();
#if ZEND_HRTIME_AVAILABLE
if (UNEXPECTED(get_as_num)) {
PHP_RETURN_HRTIME(t);
} else {