Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Adam Trachtenberg's Weblog:
PHP Streams Rock/Suck?
Dec 01, 2004 @ 13:24:59

Adam Trachtenberg has a new posting over on his weblog soncerning PHP streams, aptly titled PHP Streams Sucks! PHP Streams Rocks!.

I often think the most overlooked and underrated part of PHP are streams. First added in PHP 4.3 by Wez, streams enable the magic that lets you call file_get_contents() (and friends) on more than just local files, but also remote files using ftp, http, https, etc.

In PHP 5, you can do lots of really cool things with streams, including filtering them using a concept similar to Unix pipes. You can also define your own stream wrappers in PHP, so you can “speak” LDAP or to shared memory using fopen() and other file system commands.

He continues on, however, providing the other side of the story. This includes pointing out the "bad" side of streams - the vauge HTTP spec integrated into them leading to "a clear tension over the future direction of streams".

tagged:

Link:


Trending Topics: