php.net |  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-11-09 01:51 UTC] divinity76 at gmail dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC