• Waffle (unregistered)

    Frist!

    You missed TRWRTF: $valor = $valor;

  • freakinhuge (unregistered)

    If you stare at it long enough you can see the hidden 3D image.

  • methinks (unregistered)

    OMG... what an absolute and genuine idiot.

    IIRC, set_time_limit takes a number of seconds as argument.

    thus, a value of 473040000000000000 (=4.7304e+17) seconds = 15 billion years roughly equals the lifetime of the universe so far.

    still not enough for some, apparently...

    people who do something like that should be subject to an occupational ban for every carreer except sweeping pavements.

  • ozBash (unregistered)
    which means all the zeroes after about 300 are meaningless.
    TRWTF: these are 9s, not 0s
  • Arvind (unregistered)

    Count the time left before you would retire from the company. Add 1 second to it. The number you get is "freaking huge enough". Don't waste your time.

  • Anon (unregistered)

    Oh well, I really didn't believe people posted fake WTFs in here but this thing is just too bad. I refuse to believe this really happened.

  • (cs)

    It's a good thing they set a time limit. Anything longer than that amount would be just too long.

  • dalin (unregistered)

    Not to mention the fact that set_time_limit() restarts the timeout counter from zero. So given that this is executed each iteration of the loop, even if it took 100 billion years to execute there would still be plenty of time left over.

  • Mark (unregistered)

    My mouse wheel seems to be stuck in an infinite loop.

  • (cs)

    Perhaps an introduction to scientific notation is in order here.

  • Christopher (unregistered)

    You know, that's 64 9's short of being exactly 128 KB (not counting the newlines). Couldn't they at least add 64 more 9's to round it out??

    My guess is whoever wrote this... abomination typed a 9, selected all, copied and pasted, and then repeated that 16 more times, thereby doubling it each cycle up to 2^17 9's, more or less.

  • verifier (unregistered)

    "You know, that's 64 9's short of being exactly 128 KB (not counting the newlines). Couldn't they at least add 64 more 9's to round it out?? " TWTF is that you actually did the math. TRWTF is that I verified your math, pray that I don't verify it further.

  • peer_review (unregistered) in reply to verifier

    au contraire, I do pray that you verify the math even further. After all, peer reviewed comments are all that stands between making the craziness of commenting into the mad science of commenting.

  • (cs)

    Are you really sure that it was between 10^250 and 10^300? The maximum value double precision floating point numbers can hold is on the order of 10^308, and I don't see why PHP would use something else.

    Of course, it is PHP, so it might use something else...

  • El Kukuruzo (unregistered) in reply to freakinhuge

    Hey, look - there is a sailboat!

  • Dotan Cohen (unregistered)

    all the zeroes after about 300 are meaningless.

    Good thing that the dev didn't waste his time with useless zeros and used nines instead.

    Captcha: populus, like the set_time_limit config

  • Martian Kyo (double posting) (unregistered) in reply to freakinhuge

    Wow It's a schooner!

  • Scythe (unregistered)

    The real WTF is the lack of imagination of the person who wrote this. Suppose the value is in miliseconds:

    One day is +- 8,64 * 10^7 One year is +- 3,15 * 10^10 THE AGE OF THE UNIVERSE is +- 4,33 * 10^23

    I guess this program was meant to last till the end of the world.

  • Mystify (unregistered)

    131,008 digits. Thats...excessive. Its approximately 10^130985 times the pf instructions you execute if you had a 8-core 3Mhz processor running for the length of the universe. This number is so large, that even in comparison to ridiculous numbers like that it is still unfathomably large.

  • (cs)

    syntax error expected 9 in nine.php on line 9

  • Christian (unregistered)

    I have seen something similar where they at least put the huge number into an external file and included it everywhere. Even where it wasn't needed. They were wondering why their application always took so much ram, even on things where not much was happening... Well, there's your problem...

  • obvious (unregistered)

    Isn't it obvious? This is the decimal representation of FILE_NOT_FOUND.

  • (cs)

    This code could use some serious refactoring!

    for (i=0; i < 473040000000000000; i++) {
        sTimeout .= "9";
    }
    set_time_limit(sTimeout);
    

    There I FTFY

  • Bender (unregistered)

    I thought I saw a two

  • TST (unregistered)

    Michael J. "Crocodile" Dundee: [chuckles] That's not a time limit. [he pulls out 999999999999999999999999999999999999999999999...] Michael J. "Crocodile" Dundee: Now THAT's a time limit!

  • (cs) in reply to nobulate
    nobulate:
    This code could use some _serious_ refactoring!
    for (i=0; i < 473040000000000000; i++) {
        sTimeout .= "9";
    }
    set_time_limit(sTimeout);
    

    If you're going to refactor, you may as well do it "properly".

    sTimeout = str_repeat("9", 131008);
    set_time_limit(sTimeout);
    
  • (cs) in reply to Bender

    Don't worry, there's no such thing as two.

  • (cs)

    Maybe it's in uninonary system, where the only digit is "9" and thus numbers written in it have a just a cardinality value based on their length, rather than a semantic. So the time limit is close to 128K...in whatever units.

  • Lech (unregistered)

    Is it longer than universe will (probably) last?

  • Thomas (unregistered)

    TRWTF is the sloppy writing in the remainder of the article.

  • Saky (unregistered) in reply to freakinhuge

    Actually, there is a bug in this code, its missing one '9' !!

  • krez (unregistered)

    I thought TRWTF was that there is no "mysql_query_params" in PHP.

  • Pluis (unregistered)

    I think I found that hidden image, you can see it here:

    http://ruigekonijnen.nl/hiddenimage.html

  • fitzy89 (unregistered)

    As the other commenter mentioned, when scrolling up and down the page on my Android Galaxy S it does look slightly 3d. Makes me want to sleep.

  • Joe (unregistered)

    "Setting the time limit to 0 will give no limit" - this means checking the documentation to make sure that that's what happens, and testing to make sure that the implementer read the documentation the same way.

    Quicker to enter a gigantic number and not worry about the documentation.

    Though admittedly there's gigantic and there's gigantic. Presumably the number was thought of by someone who loses the more normal games of "mine is bigger than yours".

  • Matt Westwood (unregistered) in reply to TST
    TST:
    Michael J. "Crocodile" Dundee: [chuckles] That's not a time limit. [he pulls out 999999999999999999999999999999999999999999999...] Michael J. "Crocodile" Dundee: Now THAT's a time limit!
    +1
  • Joe (unregistered) in reply to Joe

    Which, for a Brazilian, is very unusual indeed.

  • nortee (unregistered)

    To boldly go where no set_time_limit has gone before!!!!! wooooooooooosh

  • (cs) in reply to Tacroy
    Tacroy:
    Are you really sure that it was between 10^250 and 10^300? The maximum value double precision floating point numbers can hold is on the order of 10^308, and I don't see why PHP would use something else.

    Of course, it is PHP, so it might use something else...

    Maybe the PHP parser overflows the mantissa and chooses to use +-INF instead. As you said, it is PHP... Maybe it parses the number as a boolean, and gets INF when converting it to a double.

    Anyway, hey, a Brazilian WTF!!! I've tried to submit things to it before, but having the important thing written in portuguese don't help.

  • Frank (unregistered) in reply to Tacroy

    Obviously, the boss told him "I'm sick of this thing timing out. Set it to the highest possible number you can!"

    Tacroy:
    Are you really sure that it was between 10^250 and 10^300? The maximum value double precision floating point numbers can hold is on the order of 10^308, and I don't see why PHP would use something else.

    Of course, it is PHP, so it might use something else...

    Values between 10^300 and 10^308 in PHP are reserved for error codes.

  • deanWombourne (unregistered) in reply to freakinhuge

    I would so love that to be true :)

    Stereoscopic images using only a few px difference in characters - surely there's a library that does that somewhere?

  • Eldon (unregistered)

    Considering the universe is not even that old.....

  • K (unregistered) in reply to Frank
    Frank:
    Obviously, the boss told him "I'm sick of this thing timing out. Set it to the highest possible number you can!"
    Tacroy:
    Are you really sure that it was between 10^250 and 10^300? The maximum value double precision floating point numbers can hold is on the order of 10^308, and I don't see why PHP would use something else.

    Of course, it is PHP, so it might use something else...

    Values between 10^300 and 10^308 in PHP are reserved for error codes.
    I hadn't realized PHP had that many different error codes.

  • Jerry (unregistered) in reply to K
    K:
    Frank:
    Values between 10^300 and 10^308 in PHP are reserved for error codes.
    I hadn't realized PHP had that many different error codes.
    10^8 errors ought to be enough for anyone... even php.
  • Jose (unregistered)

    Portuguese! Brazilian! Wow!

  • Mordred (unregistered)

    How about instead, write some code that goes back in time, computes, then is ready when time to execute?

  • Mordred (unregistered) in reply to methinks

    or Dog catching.

  • (cs) in reply to Mystify
    Mystify:
    131,008 digits. Thats...excessive. Its approximately 10^130985 times the pf instructions you execute if you had a 8-core 3Mhz processor running for the length of the universe. This number is so large, that even in comparison to ridiculous numbers like that it is still unfathomably large.
    Ha, but use a 3 GHz system, and that number drops down to 10^130982! That's a game changer, no less.
  • (cs)

    There is a logical but boring explanation for this. Someone got fed up with fixing the same shitty time-out problem for the 7th time after sitting in 10 meetings with the lead-architect-gury who proudly claimed millisecond response time. Instead of just writing 1e100 or something simple, he/she spent the next 5 mins pressing 999999999999... out of frustration.

    This is a cry for help.

  • TimG (unregistered) in reply to Martian Kyo (double posting)

    I find it hard to believe that at no point did the person who copy-pasted umpteen lines of 9's say to themselves "hm, is there a better way to do what I'm trying to do here?" Then again, I see that kind of behavior every day.

    Martian Kyo (double posting):
    Wow It's a schooner!
    You dumb bastard. It's a sailboat!

Leave a comment on “Really, Really Freaking Huge Time Limit”

Log In or post as a guest

Replying to comment #:

« Return to Article