php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52367 file() return nothing for a file over than 10000 lines
Submitted: 2010-07-17 20:21 UTC Modified: 2013-02-18 00:34 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: menz12x at gmail dot com Assigned:
Status: No Feedback Package: Performance problem
PHP Version: 5.2.13 OS: windows xp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: menz12x at gmail dot com
New email:
PHP Version: OS:

 

 [2010-07-17 20:21 UTC] menz12x at gmail dot com
Description:
------------
<?php
 if (is_file($Fichier)) {
                        if ($TabFich = file($Fichier))
                        {
                         $numTotal=count($TabFich);
			 echo count($TabFich);
}

?>

Test script:
---------------
file() function return FALSE for a file over than 10000 lines

Expected result:
----------------
i'd like to see the number of lines the file() function returns

Actual result:
--------------
the file () function returns nothing

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-17 21:00 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2010-07-17 21:00 UTC] rasmus@php.net
You will need to provide some more info here.  Works perfectly on Linux on files 
10x that.  eg.


11:58am new:~> wc test.txt
  100003   300003 26033650 test.txt
11:58am new:~> php -a 
Interactive shell

php > error_reporting(-1);
php > $a = file('./test.txt');
php > echo count($a);
100003
php > echo $a[9999];
    [9997] => 
99989998999899989998999899989998999899989998999899989998999899989998999899989998
99989998999899989998999899989998999899989998999899989998999899989998999899989998
9998999899989998999899989998999899989998
 [2010-07-18 23:36 UTC] degeberg@php.net
Is it possible that you hit the memory_limit and that you've turned display_errors off so you get a blank page?
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 02:05:54 2022 UTC