Re: Issue with proc_open documentation examples

From: Date: Sat, 16 Jul 2005 15:40:27 +0000
Subject: Re: Issue with proc_open documentation examples
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369168@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.
If someone is trying to learn PHP, probably he/she should learn the latest version. (IMHO) I've used the stream_get_contents() function to the example because it is much faster than the classic while(!feof($fp)). People need to see examples of how to use the new functions, so that they can start using them and improving the scripts' performance. About the 5 parameters, we have a new documentation style (we are in the process of migrating) and we added a Changelog section. There, it is clearly stated when those parameters were added, so there isn't any problem. I wanted to use all parameters in the example (once again) to show its usage (thats the main purpose of the examples..). Thanks for you email anyway, Nuno

« previous php.doc (#969369168) next »