diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 4ba3588a63a1b..8d8c608ef2b17 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -516,7 +516,7 @@ PHP_FUNCTION(posix_isatty) if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) { php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given", zend_zval_value_name(z_fd)); - fd = zval_get_long(z_fd); + RETURN_FALSE; } } diff --git a/ext/posix/tests/posix_isatty_manual_zpp.phpt b/ext/posix/tests/posix_isatty_manual_zpp.phpt index 6a20801af208d..11843189f3d6f 100644 --- a/ext/posix/tests/posix_isatty_manual_zpp.phpt +++ b/ext/posix/tests/posix_isatty_manual_zpp.phpt @@ -58,13 +58,9 @@ Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|reso bool(false) class: Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, stdClass given in %s on line %d - -Warning: Object of class stdClass could not be converted to int in %s on line %d bool(false) stringable class: Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, classWithToString given in %s on line %d - -Warning: Object of class classWithToString could not be converted to int in %s on line %d bool(false) int castable class: Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, GMP given in %s on line %d