phpDocumentor
[ class tree: phpDocumentor ] [ index: phpDocumentor ] [ all elements ]
Prev Next

Source code for sample1.php

phpDocumentor for newbies tutorial

by Gregory Beaver
cellog@php.net

sample1.php

  1. <?php
  2. // sample file #1
  3.  
  4. include_once 'sample2.php';
  5.  
  6. $GLOBALS['_myvar'= 6;
  7.  
  8. define('testing'6);
  9. define('anotherconstant'strlen('hello'));
  10.  
  11. function firstFunc($param1$param2 'optional')
  12. {
  13.     static $staticvar = 7;
  14.     global $_myvar;
  15.     return $staticvar;
  16. }
  17.  
  18. class myclass {
  19.     var $firstvar = 6;
  20.     var $secondvar =
  21.         array(
  22.             'stuff' =>
  23.                 array(
  24.                     6,
  25.                     17,
  26.                     'armadillo'
  27.                 ),
  28.             testing => anotherconstant
  29.         );
  30.  
  31.     function myclass()
  32.     {
  33.         $this->firstvar = 7;
  34.     }
  35.     
  36.     function parentfunc($paramie)
  37.     {
  38.         if ($paramie{
  39.             return 6;
  40.         else {
  41.             return new babyclass;
  42.         }
  43.     }
  44. }
  45.  
  46. class babyclass extends myclass {
  47.     var $secondvar = 42;
  48.     var $thirdvar;
  49.     
  50.     function babyclass()
  51.     {
  52.         parent::myclass();
  53.         $this->firstvar++;
  54.     }
  55.     
  56.     function parentfunc($paramie)
  57.     {
  58.         return new myclass;
  59.     }
  60. }
  61. ?>

Prev Up Next
phpDocumentor Quickstart phpDocumentor Quickstart Source code for sample2.php

Documentation generated on Mon, 11 Mar 2019 15:50:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.