php.net |  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: 2021-07-02 15:24 UTC
Votes:2
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: cmb (profile)
Status: Wont fix Package: SPL related
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-03-14 23:20 UTC] proofek at gmail dot com
Description:
------------
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 
pain.

Also see the discussion in the internal mailing list:  http://marc.info/?l=php-
internals&m=129988577428035&w=2

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


Patches

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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-02 15:24 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-07-02 15:24 UTC] cmb@php.net
From skimming the ML thread, this obviously is controversial, and
as such needs the RFC process[1].  Since there was no further
comment for more than ten years, I'm closing.  Anybody who is
still interested in this feature, please pursue the RFC process.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Aug 05 09:01:23 2021 UTC