Sample structure of a php-source


<?php

class <classname>  <optional keywords>
{
  // comment of class-code...
  var ...
  function <classfuncname>
  {
    .
    .
    .
  }
}

... more classes ...

------ beginning of main-part: ---------------
echo ...
more php-code 
    .
    .
    .
exit();
------ end of main-part ----------------------

function <funcname(optional params)>
{
  // comment of function-code...
  .
  .
  .
}

?<
Note:
Any comments in a function or class must be located behind the function-/class-header (not before).
The following would lead to a wrong parsing of the php-file:
// function-comment (inadequately positioned):
function <funcname(optional params)>
{
  .
  .
  .
}