ALeX: Code Twister Demo
Author: ALeX Kazik
Keywords: alx alex kazik amiga home hoempage mac macintosh apple video macosx

URL: http://alex.kazik.de/twister_demo2.html
demo.php 581 Bytes | `<?php // This is an example of an use of twister.php // defines define('MY_TRUE', true); define('MY_FALSE', false); if($a){ echo "one"; }else if(MY_FALSE){ echo "two"; }else if($b){ echo "three"; }else if(MY_TRUE){ echo "four"; }else if($c){ echo "five"; } if(MY_FALSE && MY_TRUE){ echo "one"; }else if($a){ echo "two"; }else if(MY_FALSE || MY_TRUE){ if($b): echo "three"; elseif(! true): echo "four"; elseif(0.0 <= 1.0): echo "five"; else: echo "six"; endif; } ?>`
output |
    Welcome to PHP Code Twister V0.7 - (c) 2003 ALeX Kazik
    [ Loading file demo.php ]
    [ Define, Name substituation precheck ]
    [ Packit, Fileloader ]
    [ Scan and Remove ]
    [ Name substituation ]
final (linebreaks added automatically) 134 Bytes | `<?php if($a){echo"one";}else if($b){echo"three"; }else{echo"four";}if($a){echo"two";}else{if($b):echo"three"; else :echo"five";endif; }?>`
debugging output
stage1 after include 581 Bytes | `<?php // This is an example of an use of twister.php // defines define('MY_TRUE', true); define('MY_FALSE', false); if($a){ echo "one"; }else if(MY_FALSE){ echo "two"; }else if($b){ echo "three"; }else if(MY_TRUE){ echo "four"; }else if($c){ echo "five"; } if(MY_FALSE && MY_TRUE){ echo "one"; }else if($a){ echo "two"; }else if(MY_FALSE || MY_TRUE){ if($b): echo "three"; elseif(! true): echo "four"; elseif(0.0 <= 1.0): echo "five"; else: echo "six"; endif; } ?>`
stage2 after replacing defines and packit 599 Bytes | `<?php // This is an example of an use of twister.php // defines /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ if($a){ echo "one"; }else if(false){ echo "two"; }else if($b){ echo "three"; }else if(true){ echo "four"; }else if($c){ echo "five"; } if(false && true){ echo "one"; }else if($a){ echo "two"; }else if(false || true){ if($b): echo "three"; elseif(! true): echo "four"; elseif(0.0 <= 1.0): echo "five"; else: echo "six"; endif; } ?>`
stage3 after removing unused 811 Bytes | `<?php // This is an example of an use of twister.php // defines /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ if($a){ echo "one"; }/*r2*/ /*r2*//*r2*//*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*/else if($b){ echo "three"; }else /*r2*//*r2*//*r2*//*r2*/{ echo "four"; }/*r2*/ /*r2*//*r2*//*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*//*r2*/ if($a){ echo "two"; }else /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/{ if($b): echo "three"; /*r2*//*r2*//*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ else/*r2*//*r2*/ /*r2*/ /*r2*//*r2*/: echo "five"; /*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ endif; } ?>`
stage4 after name substituation 811 Bytes | `<?php // This is an example of an use of twister.php // defines /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*//*d1*/ /*d1*//*d1*//*d1*/ if($a){ echo "one"; }/*r2*/ /*r2*//*r2*//*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*/else if($b){ echo "three"; }else /*r2*//*r2*//*r2*//*r2*/{ echo "four"; }/*r2*/ /*r2*//*r2*//*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ /*r2*//*r2*/ if($a){ echo "two"; }else /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/{ if($b): echo "three"; /*r2*//*r2*//*r2*/ /*r2*//*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ else/*r2*//*r2*/ /*r2*/ /*r2*//*r2*/: echo "five"; /*r2*//*r2*/ /*r2*/ /*r2*//*r2*/ endif; } ?>`
files | `<?php $files = array ( 'include' => array ( ), 'include_once' => array ( ), 'require' => array ( ), 'require_once' => array ( ), 'fileloader' => array ( ), ); ?>`
scan | `<?php $scan = array ( 'global' => array ( 'a' => 2, 'b' => 2, ), 'function' => array ( ), 'class' => array ( ), 'method' => array ( ), 'member' => array ( ), 'fn_global' => array ( ), 'fn_local' => array ( ), 'me_global' => array ( ), 'me_local' => array ( ), 0 => 1, ); $replace = array ( 'global' => array ( 'a' => 'a', 'b' => 'b', ), 'function' => array ( ), 'class' => array ( ), 'method' => array ( ), 'member' => array ( ), ); ?>`
©2003 ALeX Kazik · last update 06. Oct 2003