Bug #62256 [Opn->Csd]: SCANDIR_SORT_NONE undefined

From: Date: Thu, 07 Jun 2012 23:45:16 +0000
Subject: Bug #62256 [Opn->Csd]: SCANDIR_SORT_NONE undefined
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8435@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62256&edit=1 ID: 62256 Updated by: philip@php.net Reported by: gem at rellim dot com Summary: SCANDIR_SORT_NONE undefined -Status: Open +Status: Closed Type: Bug Package: Documentation problem Operating System: Gentoo PHP Version: 5.3.13 -Assigned To: +Assigned To: philip Block user comment: N Private report: N New Comment: Thank you for the report, this has been fixed in SVN. Those constants were added in PHP 5.4.0 and the documentation has been clarified to reflect this. These documentation changes will show up online in a day or two. See also: http://php.net/manual/en/dir.constants.php Previous Comments: ------------------------------------------------------------------------ [2012-06-07 23:42:39] philip@php.net Automatic comment from SVN on behalf of philip Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=326021 Log: Clarified that the constants were added in 5.4.0, and how to mimic asc|desc before that. Closes PHP bug #62256 ------------------------------------------------------------------------ [2012-06-07 23:21:38] gem at rellim dot com Description: ------------ The scandir() doc page mentions an optional 2nd parameter that may contain SCANDIR_SORT_NONE. But that constant does not exist. http://us3.php.net/manual/en/function.scandir.php If I grep the PHP source I can not find any match for SCANDIR_ anywhere. Test script: --------------- <?php $files = scandir( '/tmp', SCANDIR_SORT_NONE); $cnt = count($files); echo "{$cnt}\n"; ?> Expected result: ---------------- I expect a count of files in /tmp. Actual result: -------------- # php tmp.php PHP Notice: Use of undefined constant SCANDIR_SORT_NONE - assumed 'SCANDIR_SORT_NONE' in /tmp/tmp.php on line 2 PHP Stack trace: PHP 1. {main}() /tmp/tmp.php:0 PHP Warning: scandir() expects parameter 2 to be long, string given in /tmp/tmp.php on line 2 PHP Stack trace: PHP 1. {main}() /tmp/tmp.php:0 PHP 2. scandir() /tmp/tmp.php:2 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62256&edit=1

« previous php.doc.bugs (#8435) next »