An often-forgotten feature of PHP is the streams layer. First introduced in PHP 4.3, the streams layer is most often used without the developer even knowing that it exists: whenever you access a file using
require, and a multitude of other functions, PHP uses the functionality provided by the streams layer to do the actual “dirty work.”
The streams layer is an abstraction layer for file access. The term “stream” refers to the fact that a number of different resource—like files—but also network connections, compression protocols, and so on—can be considered “streams” of data to be read and/or written either in sequence or at random.
There are some security considerations ...