Issue with proc_open documentation examples
| From: | William D. Richards | Date: | Fri, 15 Jul 2005 18:52:24 +0000 |
| Subject: | Issue with proc_open documentation examples | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969369157@lists.php.net to get a copy of this message | ||
Hi, Folks,
Though the command proc_open() is shown as PHP 4.0-4.3 and PHP 5 compatible, the examples given are strictly PHP 5. The documentation should reflect that issue to avoid confusion.
The key points:
1. proc_open examples are using five fields with the proc_open function. That only works in PHP 5. PHP 4 can only use the first three.
2. In the first example, the function stream_get_contents() is used to retrieve the results from the child process. stream_get_contents() only appears in PHP5.
People who are new to PHP may become frustrated with trying to learn if an example given works only in PHP5 and they are working on a system with only PHP 4.3 (or lower) on it, and they are unaware that there is a difference.
Solution: Add a line before an example that specifies which version the example is supposed to run in. (ex: "PHP4" or "PHP5" or "PHP4,5", etc....)
I realize that it creates just yet one more thing to add to the clutter, but I think it will help in the long run.— Bill Richards
"I spent a minute looking at my own code by accident.
I was thinking 'What the hell is this guy doing?'."
- <Logan>, http://bash.org