Net_Gearman
[ class tree: Net_Gearman ] [ index: Net_Gearman ] [ all elements ]

Source for file Sum.php

Documentation is available at Sum.php

  1. <?php
  2.  
  3. /**
  4.  * Sum up a bunch of numbers
  5.  *
  6.  * @author      Joe Stump <joe@joestump.net>
  7.  * @package     Net_Gearman
  8.  */
  9. {
  10.     /**
  11.      * Run the summing job
  12.      *
  13.      * @access      public
  14.      * @param       array       $arg 
  15.      * @return      array 
  16.      */
  17.     public function run($arg)
  18.     {
  19.         $sum = 0;
  20.         foreach ($arg as $i{
  21.             if (is_numeric($i)) {
  22.                 $sum += $i;
  23.             }
  24.         }
  25.  
  26.         return array('sum' => $sum);
  27.     }
  28. }
  29.  
  30. ?>

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