Example #1
0
 function do_it()
 {
     if ($this->foo_name == 'Bar') {
         $res = globalDoIt();
         echo $res;
     }
     False;
     //в простых случаях {} можно опускать
     if ($this->foo_name == 'Test') {
         return;
     }
 }
 /**
  *  Echoes some stuff
  */
 function doIt()
 {
     if ($this->foo_name == 'Bar') {
         $res = globalDoIt();
         echo $res;
     }
     //в простых случаях {} можно опускать
     if ($this->foo_name == 'Test') {
         return;
     }
     //логически сгруппированный блок кода
     $db = getDbConnection();
     $it = $db->exec('select * from a');
     foreach ($it as $record) {
         echo $record->get('id');
     }
     $i++;
 }