php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67823 posix_* $fd documented as int, should be resource.
Submitted: 2014-08-11 22:08 UTC Modified: 2014-08-11 23:08 UTC
From: donatj at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: POSIX related
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: donatj at gmail dot com
New email:
PHP Version: OS:

 

 [2014-08-11 22:08 UTC] donatj at gmail dot com
Description:
------------
posix_isatty and posix_ttyname are documented as taking an int parameter, when more specifically they take a *resource*; namely STDOUT, STDERR, STDIN, etc. 

Methods such as fread and frwite which take similar resources document this as *resource* rather than int and I think its more correct to change the posix methods to being documented as *resource*

http://docs.php.net/manual/en/function.posix-isatty.php
http://docs.php.net/manual/en/function.posix-ttyname.php


http://us3.php.net/manual/en/function.fread.php

Expected result:
----------------
resource

Actual result:
--------------
int

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-11 22:58 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2014-08-11 22:58 UTC] aharvey@php.net
Good catch. It's actually a little more complicated than that again — those two functions will accept both integers (in which case they're assumed to be file descriptors) and resources.

I'll fix that up.
 [2014-08-11 23:08 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=334543
Log: posix_isatty() and posix_ttyname() will accept both integers and resources.

Fixes doc bug #67823 (posix_* $fd documented as int, should be resource).
 [2014-08-11 23:08 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2014-08-11 23:08 UTC] aharvey@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 04:01:36 2025 UTC