Skip navigation.
Home

5 Ways to show that you're l33t

Hall of Fame | Wonky Code

Somebody sent this in yesterday, it's in German, but bad code is bad in any language. There are so many WTFs with this code I had to summarize the best WTFs for you:

  • list($as,$nl)=explode("0","array_slice0<br>\n"); I guess actually declaring the variables $as and $nl took too many lines of code.
  • More solutions for idle CPU time.

    Wonky Code

    Yesterday we had a great example of how to make sure your database isn't slacking off. Here's a example to make sure your web server keeps working hard too.

    Also thanks to everybody who submitted a WTF. Keep them coming! :)

    <?php
    if( $_USER['uid'] > 1 )
        {
            
    $usermenu = new Template( $_CONF['path_layout'] );
            
    $usermenu->set_file( array( 'option' => 'useroption.thtml',
                                        
    'current' => 'useroption_off.thtml' ));
            
    $usermenu->set_var( 'site_url', $_CONF['site_url'] );
            
    $usermenu->set_var( 'layout_url', $_CONF['layout_url'] );
            <
    strong>$usermenu->set_var( 'block_name', str_replace( '_', '-', 'user_block' ));</strong>

            if( empty(
    $title ))
            {
                
    $title = DB_getItem( $_TABLES['blocks'], 'title', "name='user_block'" );
            }
        
    //....
    ?>