php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55807 Wrong value for splFileObject::SKIP_EMPTY
Submitted: 2011-09-28 15:21 UTC Modified: 2012-02-09 20:31 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: jgotti at modedemploi dot fr Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: 5.3.8 OS: linux
Private report: No CVE-ID: None
 [2011-09-28 15:21 UTC] jgotti at modedemploi dot fr
Description:
------------
isn't this weird that splFileObject::SKIP_EMPTY=6.
I think this should be 4 and not 6 as setting splFileObject flag to SKIP_EMPTY 
will report flag splFileObject::READ_AHEAD to be set even if not intended to be 
set


Test script:
---------------
$fileObj = new SplFileObject('/tmp/test.txt');
$fileObj->setFlags(SplFileObject::SKIP_EMPTY); 
if( $fileObj->getFlags() & SplFileObject::READ_AHEAD ){//<-- should not pass here we didn't set READ_AHEAD flag
  echo "READ_AHEAD on";
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-29 13:53 UTC] colder@php.net
-Assigned To: +Assigned To: colder
 [2011-09-30 14:17 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=317501
Log: Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY)
 [2011-09-30 14:17 UTC] bjori@php.net
Heh. Excellent point :)
 [2011-09-30 14:17 UTC] bjori@php.net
-Status: Assigned +Status: Closed
 [2011-09-30 14:17 UTC] bjori@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-02-09 20:31 UTC] rasmus@php.net
-Status: Closed +Status: Re-Opened -Type: Feature/Change Request +Type: Bug
 [2012-02-09 20:31 UTC] rasmus@php.net
This fix was not correct. SKIP_EMPTY included READ_AHEAD on purpose. See Helly's 
original commit message:

http://svn.php.net/viewvc?view=revision&revision=212726

This is now causing problems. See bug 61032

We need to either revert this, or change the logic to restore the original 
behaviour of SKIP_EMPTY
 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of bjori
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b4f6baf9aa5d77c014eb5304dd334ac1faf59d29
Log: Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY)
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of bjori
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b4f6baf9aa5d77c014eb5304dd334ac1faf59d29
Log: Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY)
 [2013-11-17 09:36 UTC] laruence@php.net
Automatic comment on behalf of bjori
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b4f6baf9aa5d77c014eb5304dd334ac1faf59d29
Log: Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY)
 [2013-11-17 09:36 UTC] laruence@php.net
-Status: Re-Opened +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC