|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54252 Implement countLines() method for SplFileObject
Submitted: 2011-03-14 23:20 UTC Modified: -
Avg. Score:4.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: proofek at gmail dot com Assigned:
Status: Open Package: SPL related
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
32 - 15 = ?
Subscribe to this entry?

 [2011-03-14 23:20 UTC] proofek at gmail dot com
It'd be nice to have native support for counting lines in SplFileObject. At the 
moment I have to go through the file line by line to count the lines. It's a real 

Also see the discussion in the internal mailing list:

I have attached a patch containing both countLines() method implementation and 
phpt tests.  


SplFileObject_countLines (last revision 2011-03-14 22:21 UTC by proofek at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jun 17 07:01:23 2021 UTC