Re: proposed <example> RFC change

From: Date: Tue, 19 Nov 2002 21:47:30 +0000
Subject: Re: proposed <example> RFC change
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969349810@lists.php.net to get a copy of this message
I really vote +1 for that. -- Regards. M.CHAILLAN Nicolas nicos@php.net www.WorldAKT.com Hébergement de sites internets. "Philip Olson" <philip@cornado.com> a écrit dans le message de news: Pine.BSF.4.10.10211192047560.72025-100000@localhost... > Hi all- > > There are two main ways to do examples, one includes the output > within the example itself while another uses <screen> shortly > after. I prefer putting the output inline as the user can > take the expected output home with them (in their cut-n-paste). > Also, if we ever create that index of all examples then both code > and output will be included without much thought. Here's what > I mean: > > -------------------------------- > Simple examples: > -------------------------------- > <?php > $var = ucfirst('hello'); > > print $var; // Hello > print $var; // outputs: Hello > ?> > > In the above I see no need to write "outputs:" in the comment > and prefer the first. I certainly hope a user knows what > print or echo does. The coding-standards shows outputs: > in the example. I vote that is unneeded except when in /* */ > like so: > > -------------------------------- > More 'complex' examples: > -------------------------------- > <?php > $arr = explode('|', 'a|b|c|d|e|f|g'); > > print_r($arr); > > /* Outputs: > > Array > ( > [0] => a > [1] => b > [2] => c > [3] => d > [4] => e > [5] => f > [6] => g > ) > > */ > ?> > > The other method suggests using <screen> for output in a new <para> > after the example. This is fine but I prefer the inline method and > would like to hear other peoples opinions on this matter. The > coding-standards RFC suggests to use <screen>, I vote this is > changed. Although there are times when using <screen> is appropriate, > like for command line operations, so in those occasions use <screen>. > > Regards, > Philip > > re: phpdoc/RFC/codeing-standards > > > > > > >

« previous php.doc (#969349810) next »