Really true



  • Yesterday I had to push a button. Sounds easy, right? Well, it isn't if you have to do it from PHP on a website with heavy two phase authenctication. In this case the source code of the button and the surroundings always help, don't they? Let's look at this little example:

    if (true) {
        // lots of code
    } else {
        // another lots of code
    }

    Isn't it just wonderful to debug a 20k PHP file like that?



  • The other code is executed when true is a lie.



  • Maybe this is self-modifying code... the "true" in the PHP source is
    dynamically changed into "false" at appropriate times by another
    portion of code that is not displayed here. Sure, it may be a little
    harder to maintain, but it has the invaluable advantage of persistence
    between multiple invocations of the program.



  • truth is lie, ignorance is strength, freedom is slavery



  • @jwenting said:

    truth is lie, ignorance is strength, freedom is slavery


    War is Peace.



  • @Zizzencs said:

    Yesterday I had to push a button. Sounds easy, right? Well, it isn't if you have to do it from PHP on a website with heavy two phase authenctication. In this case the source code of the button and the surroundings always help, don't they? Let's look at this little example:

    if (true) {
        // lots of code
    } else {
        // another lots of code
    }

    Isn't it just wonderful to debug a 20k PHP file like that?


    I should think it would be pretty easy since you only ever need to look at half the code...


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.