php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #435 pclose() does not behave as documented
Submitted: 1998-06-03 20:57 UTC Modified: 1998-06-04 01:33 UTC
From: sam at daemoninc dot com Assigned: rasmus (profile)
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Release Candidate 5 OS: Solaris 2.5.1
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: sam at daemoninc dot com
New email:
PHP Version: OS:

 

 [1998-06-03 20:57 UTC] sam at daemoninc dot com
Pclose docs says it returns true if successful, false otherwise.
In reality it returns the exit status.
Reproduce with:

echo "/bin/true=", pclose(popen("/bin/true", "w")), "\n";
echo "/bin/false=", pclose(popen("/bin/false", "w")), "\n";

This produces:
/bin/true=0
/bin/false=65280

Documentation says that both should return a true value (non-zero).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-04 01:33 UTC] rasmus
Documentation bug.  We do actually want the process termination status to be returned by pclose()
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC