php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #27356 sleep() doesn't return unslept seconds
Submitted: 2004-02-22 19:18 UTC Modified: 2005-04-30 05:42 UTC
Votes:3
Avg. Score:3.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: alpha at rrs dot at Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.4 OS: Unix
Private report: No CVE-ID: None
 [2004-02-22 19:18 UTC] alpha at rrs dot at
Description:
------------
The C function sleep() is defined as:
unsigned int sleep(unsigned int seconds); 

In PHP it is defined as:
void sleep ( int seconds)

The Problem is when using a CLI with a signal handler sleep() ends immediately but doesn't return the unslept seconds, thus it's not possible to resleep.
Checked current CVS via cvs.php.net and there is still no return value. So it's not a documentation problem.

Reproduce code:
---------------
php -r "var_dump(sleep(10));"

Expected result:
----------------
int(0) or unslept seconds if a signal was handled

Actual result:
--------------
NULL

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-10 12:23 UTC] alpha at rrs dot at
Seems like the bug got fixed in CVS last week by andrey: http://cvs.php.net/php-src/ext/standard/basic_functions.c

As it seems like noone'll find my bug (see #27841) I'll close it myself.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 09:01:27 2024 UTC