Exemplo n.º 1
0
/**
 * Usage of goto statement
 */
function example()
{
    if ($a == $b) {
        if ($a1 == $b1) {
            fiddle();
        } else {
            if ($a2 == $b2) {
                fiddle();
            } else {
                //                goto b;
            }
        }
    } elseif ($a == $b) {
        if ($a1 == $b1) {
            fiddle();
        } else {
            if ($a2 == $b2) {
                fiddle();
            } else {
                goto b;
            }
        }
    }
    eval('echo "hello";');
    eval('echo "hello";');
    eval('echo "hello";');
    eval('echo "hello";');
}
Exemplo n.º 2
0
 public function example()
 {
     if ($a == $b) {
         if ($a1 == $b1) {
             fiddle();
         } else {
             if ($a2 == $b2) {
                 fiddle();
             } else {
                 fiddle();
             }
         }
     } else {
         if ($c == $d) {
             while ($c == $d) {
                 fiddle();
             }
         } else {
             if ($e == $f) {
                 for ($n = 0; $n < $h; $n++) {
                     fiddle();
                 }
             } else {
                 switch ($z) {
                     case 1:
                         fiddle();
                         break;
                     case 2:
                         fiddle();
                         break;
                     case 3:
                         fiddle();
                         break;
                     default:
                         fiddle();
                         break;
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 /**
  * A very long and complicated class method
  */
 public function example12()
 {
     if ($a == $b) {
         if ($a1 == $b1) {
             fiddle();
         } else {
             if ($a2 == $b2) {
                 fiddle();
             } else {
                 fiddle();
             }
         }
     } else {
         if ($c == $d) {
             while ($c == $d) {
                 fiddle();
             }
         } else {
             if ($e == $f) {
                 for ($n = 0; $n < $h; $n++) {
                     fiddle();
                 }
             } else {
                 switch ($z) {
                     case 1:
                         fiddle();
                         break;
                     case 2:
                         fiddle();
                         break;
                     case 3:
                         fiddle();
                         break;
                     default:
                         fiddle();
                         break;
                 }
             }
         }
     }
     if ($a == $b) {
         if ($a1 == $b1) {
             fiddle();
         } else {
             if ($a2 == $b2) {
                 fiddle();
             } else {
                 fiddle();
             }
         }
     } else {
         if ($c == $d) {
             while ($c == $d) {
                 fiddle();
             }
         } else {
             if ($e == $f) {
                 for ($n = 0; $n < $h; $n++) {
                     fiddle();
                 }
             } else {
                 switch ($z) {
                     case 1:
                         fiddle();
                         break;
                     case 2:
                         fiddle();
                         break;
                     case 3:
                         fiddle();
                         break;
                     default:
                         fiddle();
                         break;
                 }
             }
         }
     }
     // Just to make sure the class method is very long
     abc();
     xyz();
     abc();
     xyz();
     abc();
     xyz();
     abc();
     xyz();
 }