|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80413 TypeError: docs says param 4 of sem_get() is bool but PHP says int
Submitted: 2020-11-25 08:33 UTC Modified: 2020-11-25 09:00 UTC
From: cmanley at xs4all dot nl Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.3.24 OS: Debian 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 - 3 = ?
Subscribe to this entry?

 [2020-11-25 08:33 UTC] cmanley at xs4all dot nl
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:

Actual result:
TypeError: sem_get() expects parameter 4 to be int, bool given


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-25 09:00 UTC]
-Status: Open +Status: Not a bug
 [2020-11-25 09:00 UTC]
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 03:03:37 2021 UTC