Bug #80413 [Opn->Nab]: TypeError: docs says param 4 of sem_get() is bool but PHP says int
| From: | nikic@php.net | Date: | Wed, 25 Nov 2020 09:00:19 +0000 |
| Subject: | Bug #80413 [Opn->Nab]: TypeError: docs says param 4 of sem_get() is bool but PHP says int | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18152@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80413&edit=1
ID: 80413
Updated by: nikic@php.net
Reported by: cmanley at xs4all dot nl
Summary: TypeError: docs says param 4 of sem_get() is bool
but PHP says int
-Status: Open
+Status: Not a bug
Type: Bug
Package: Documentation problem
Operating System: Debian 10
PHP Version: 7.3.24
Block user comment: N
Private report: N
New Comment:
See the changelog entry on the documentation page:
> 8.0.0 The type of auto_release has been changed from int to bool.
The type is bool in PHP 8 and int in earlier PHP versions.
Previous Comments:
------------------------------------------------------------------------
[2020-11-25 08:33:37] cmanley at xs4all dot nl
Description:
------------
The documentation says parameter 4 of sem_get is a bool (bool $auto_release = TRUE), but when
calling sem_get using true as parameter 4 in strict_types=1 mode, then PHP throws a TypeError:
"sem_get() expects parameter 4 to be int, bool given"
Exact PHP version I'm using: PHP 7.3.19-1~deb10u1
Previously, someone reported that the parameter wasn't documented (see bug #51045). Now
it's documented, but either the documentation is incorrect or the implementation is incorrect.
Test script:
---------------
<?php declare(strict_types = 1);
$semkey = ftok(__FILE__, 'R');
$semid = sem_get($semkey, 1, 0666, true);
print "OK\n";
Expected result:
----------------
OK
Actual result:
--------------
TypeError: sem_get() expects parameter 4 to be int, bool given
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80413&edit=1