php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62256 SCANDIR_SORT_NONE undefined
Submitted: 2012-06-07 23:21 UTC Modified: 2012-06-07 23:45 UTC
From: gem at rellim dot com Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.13 OS: Gentoo
Private report: No CVE-ID: None
 [2012-06-07 23:21 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-07 23:42 UTC] 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:45 UTC] philip@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: philip
 [2012-06-07 23:45 UTC] philip@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 15:01:36 2024 UTC