Bug #80229 [Opn]: assert_options should have "int" and "bool" for $value parameter PHPDoc

From: Date: Tue, 13 Oct 2020 16:21:16 +0000
Subject: Bug #80229 [Opn]: assert_options should have "int" and "bool" for $value parameter PHPDoc
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229600@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80229&edit=1 ID: 80229 Updated by: cmb@php.net Reported by: ondrej at mirtes dot cz Summary: assert_options should have "int" and "bool" for $value parameter PHPDoc Status: Open Type: Bug Package: Reflection related PHP Version: 8.0.0rc1 Block user comment: N Private report: N New Comment: There are likely some other functions with the same issue. The problem here is strict_types on vs. off. In case of the latter the current signature is correct; in case of the former, int and bool are indeed missing. Not sure how to resolve this. Previous Comments: ------------------------------------------------------------------------ [2020-10-13 14:54:19] ondrej at mirtes dot cz Description: ------------ The function assert_options accepts integers and booleans as the second argument. Currently according to the stub's PHPDoc, it only accepts strings, callables and null. The PHPDoc should be corrected. I guess the assert_options function can be called with either "1" or "true" for the same result... Expected result: ---------------- /** @param string|callable|int|bool|null $value */ function assert_options(int $option, $value = UNKNOWN) : array|object|int|string|null { } Actual result: -------------- /** @param string|callable|null $value */ function assert_options(int $option, $value = UNKNOWN) : array|object|int|string|null { } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80229&edit=1

« previous php.bugs (#229600) next »