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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC