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

Source for file example_main.php

Documentation is available at example_main.php

  1. <html>
  2. </html>
  3. <?php
  4.  
  5.     // Class and Function List    
  6.     // First, the ugly code from the homepage
  7.  for ($i = 0;$i<strlen($str);$i++if ($new_line_counter == 0{if (($i+1<sizeof($a)) if ($a[$i+1== "?" AND $a[$i== "<"out($outstr); out("<?php")$indent++; $new_line_counter++; if (($i+4<sizeof($a)) if ($a[$i+2== "p" AND $a[$i+3== "h" AND $a[$i+4== "p"$i $i+3; $i++; continue; else $outstr.= $a[$i]; continue; } } } }
  8.     // Without Beautify
  9.     // PHP_Beautifier->setBeautify(false);
  10.  for ($i = 0;$i<strlen($str);$i++{if ($new_line_counter == 0{if (($i+1<sizeof($a)) if ($a[$i+1== "?" AND $a[$i== "<"out($outstr); out("<?php")$indent++; $new_line_counter++; if (($i+4<sizeof($a)) if ($a[$i+2== "p" AND $a[$i+3== "h" AND $a[$i+4== "p"$i $i+3; $i++; continue; else $outstr.= $a[$i]; continue; } } } }
  11.  
  12.     // And beautify again!
  13.     // PHP_Beautifier->setBeautify(true);
  14.     // Second, the comments!
  15.     echo $a// inline
  16.     echo $a// inline
  17.     /**
  18. * Multiline
  19.     */
  20.     // and the old folding markers!
  21.     function folder(
  22.     /*{{{{*/
  23.     }   /*}}}*/
  24.     // The power of callbacks: the next line deactivate the Filter ListClassFunction for functions
  25.     // ListClassFunction->includeInList('functions',false);
  26.     function notInList(
  27.     {
  28.     }
  29.     // ListClassFunction->includeInList('functions',true);
  30.     function InList(
  31.     {
  32.     }
  33.     class class_1 extends class_0 {
  34.     }
  35.     // Third, do you remember Pascal?
  36.     if ($a):
  37.         echo 'a';
  38.         echo 'n';
  39.     else:
  40.         echo 'b';
  41.     endif;
  42.     while ($japan):
  43.         echo 'nothing';
  44.     endwhile;
  45.     // Fourth.... The horrible switch inside switch! ... break includes!
  46.     switch ($a{
  47.         case 'a':
  48.         case 'b':
  49.         break;
  50.  
  51.         default:
  52.             foreach($a as $b{
  53.                 if ($x{
  54.                     break;
  55.                 }
  56.             }
  57.             switch ($b{
  58.                 case 'a':
  59.                 case 'b':
  60.                     echo 'a';
  61.                 break;
  62.  
  63.                 default:
  64.                     echo 'b';
  65.                 break;
  66.             }
  67.         break;
  68.     }
  69.     // Fifth: Nested arrays...
  70.     $aMyArray = array(
  71.         array(
  72.             array(
  73.                 array(
  74.                     'el'=>1,
  75.                     'el'=>2
  76.                 )
  77.             )
  78.         )
  79.     );
  80.     // Somebody remember callbacks?
  81.     // ArrayNested->off()
  82.     $aMyArray = array(array(array(array('el'=>1,'el'=>2))));
  83.     // PHP5, dude!
  84.     throw new Exception();
  85.     $o->getArray(-> createNewThing();
  86.     MyFunction :: singleton()->record();
  87.     echo (__FUNCTION__.__LINE__.__CLASS__);
  88. ?>

Documentation generated on Mon, 11 Mar 2019 14:13:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.