PHP supports C++ single-line comment syntax, which is prefaced
with a double slash (//), like this:
// Title: My first PHP script
// Author: Jason
echo "This is a PHP program";
?>
60 CHAPTER 3 ?– PHP B ASICS
Shell Syntax
PHP also supports an alternative to the C++-style single-line syntax, known as shell
syntax, which is prefaced with a hash mark (#). Revisiting the previous example, I??™ll
use hash marks to add some information about the script:
# Title: My PHP program
# Author: Jason
echo "This is a PHP program";
?>
ADVANCED DOCUMENTATION WITH PHPDOCUMENTOR
Because documentation is such an important part of effective code creation and management,
considerable effort has been put into devising methods for helping developers automate the process. In
fact, these days documentation solutions are available for all mainstream programming languages,
PHP included. phpDocumentor (http://www.phpdoc.org/) is an open source project that facilitates
the documentation process by converting the comments embedded within the source code into a
variety of easily readable formats, including HTML and PDF.
phpDocumentor works by parsing an application??™s source code, searching for special comments
known as DocBlocks. Used to document all code within an application, including scripts, classes,
functions, variables, and more, DocBlocks contain human-readable explanations along with
formalized descriptors such as the author??™s name, code version, copyright statement, function
return values, and much more.
Pages:
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145