|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #75504 make default mode of SplFileInfo::openFile 'rb'
Submitted: 2017-11-09 01:51 UTC Modified: -
From: divinity76 at gmail dot com Assigned:
Status: Open Package: SPL related
PHP Version: Next Minor Version OS: Windows*
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:
31 + 33 = ?
Subscribe to this entry?

 [2017-11-09 01:51 UTC] divinity76 at gmail dot com
on most platforms, it won't make a difference, but where it actually does, the implicit `rt` mode of `r` sure is a portability hazard when not thinking about it, thus i suggest making the default mode `rb`, thus being "portable by default". and ofc, when you take the time to think about rb vs rt, and you decide to depend on rt, you can just set the `rt` mode manually. migrating codebases depending on the current default, is trivial, and this change would make it easier to write portable code.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jun 25 13:01:24 2021 UTC