From:             alpha at rrs dot at
Operating system: Unix
PHP version:      4.3.4
PHP Bug Type:     Feature/Change Request
Bug description:  sleep() doesn't return unslept seconds

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

-- 
Edit bug report at http://bugs.php.net/?id=27356&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27356&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27356&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27356&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27356&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27356&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27356&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27356&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27356&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27356&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27356&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27356&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27356&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27356&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27356&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27356&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27356&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27356&r=float

Reply via email to