|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53409 sleep() return NULL
Submitted: 2010-11-25 22:45 UTC Modified: 2010-11-26 19:27 UTC
From: webmaster at skarmflyg dot org Assigned: pajoye
Status: Closed Package: Unknown/Other Function
PHP Version: 5.3.3 OS: pajoye
Private report: No CVE-ID:
 [2010-11-25 22:45 UTC] webmaster at skarmflyg dot org
From manual page: Values
Sleep should return int or possibly boolean false but returns NULL.

PHP 5.3.3 
Apache 2.2.6
Windows XP SP3

Test script:
var_dump($x);  // Outputs NULL. Expected int 0.

Expected result:
According to documentation $x should be integer 0 or possibly false.

Actual result:
Variable $x becomes NULL.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-25 23:57 UTC]
-Status: Open +Status: To be documented
 [2010-11-25 23:57 UTC]
Sleep on windows returns nothing as well as some other platforms.

The result of sleep is actually platform dependent (NULL/FALSE or 0/FALSE).
 [2010-11-26 10:17 UTC]
-Status: To be documented +Status: Assigned -Type: Bug +Type: Documentation Problem -Package: Unknown/Other Function +Package: Documentation problem -Assigned To: +Assigned To: aharvey
 [2010-11-26 10:19 UTC]
Automatic comment from SVN on behalf of aharvey
Log: Fix doc bug #53409 (sleep() return NULL).
 [2010-11-26 10:19 UTC]
-Status: Assigned +Status: Closed
 [2010-11-26 10:19 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

 [2010-11-26 12:44 UTC]
-Status: Closed +Status: Re-Opened -Type: Documentation Problem +Type: Bug -Package: Documentation problem +Package: Unknown/Other Function -Operating System: Windows XP +Operating System: pajoye -Assigned To: aharvey +Assigned To: pajoye
 [2010-11-26 12:44 UTC]
After quick discussion on IRC;
Windows does actually have a way to provide the same functionality as, f.e., 
Linux by using SleepEx().

Re-classifying as php-src bug & assign to Pierre.
 [2010-11-26 19:25 UTC]
Automatic comment from SVN on behalf of pajoye
Log: - Fixed #53409, sleep() return NULL on Windows
 [2010-11-26 19:27 UTC]
-Status: Re-Opened +Status: Closed
 [2010-11-26 19:27 UTC]
Fixed in 5.3 and trunk
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 22:01:38 2015 UTC