Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule fopen_flags

The flags in fopen calls must omit t, and b must be omitted or included consistently.


Using this rule is risky

Risky when the function fopen is overridden.



The b flag must be used (true) or omitted (false).

Allowed types: bool

Default value: true


Example #1

Default configuration.

--- Original
+++ New
-$a = fopen($foo, 'rwt');
+$a = fopen($foo, 'rwb');

Example #2

With configuration: ['b_mode' => false].

--- Original
+++ New
-$a = fopen($foo, 'rwt');
+$a = fopen($foo, 'rw');

Rule sets

The rule is part of the following rule sets:

The logo is © 2010-2022 Sensio Labs