hobbit monitor
Results 1 to 8 of 8

Thread: The Number * Is EVIL !

Threaded View

  1. #1
    Join Date
    Aug 2007
    Posts
    122

    Angry The Number * Is EVIL !

    I'm using Windows XP Pro SP2 and PHP v4.4.4 installed on Microsoft IIS v5.*

    I have been going insane because I think I've found a bug in PHP, or at least a strange problem that I can't seem to easily resolve. It has been causing some mysterious computational failures giving erroneous numeric results.

    Is there someone here who can test a simple PHP function and see if they get a similar result?

    I've never seen a problem like this before.




    This following code prints out the value 5 when I run it.

    Code:
    <?PHP
    
       print test(05);
    
    
    
       function test ($arg)
    
      {
    
       return $arg;
    
      }
    
    ?>

    If I change the digits 05 to something else, such as 07, then it will print 7 as the result. That's what it should do. Nothing wrong with that.

    Try changing the digits 05 to 0* and see what happens.

    Every time I do that, I get 0 as the result!

    Why does it fail ONLY if the digits are 0*?


    I'm making a time input interface where the user enters the time as HH MM SS into three 2-digit text boxes on a form, one box for each time element.

    A time such as 0*:0*:0* should also be able to be entered as *:*:*, but I can't get it to work that way.

    The user should be able to enter a time as 06 or simply as 6 for 6 hours, minutes or seconds and shouldn't have to worry about the leading zero.

    It seems to be only when the hours, minutes or seconds is 0*, that it fails and reads as zero. If I simply enter *, then it works perfectly! All other values from 00 to 08 work OK. The problem only occurs if the value is 0*.

    I think it's a big, stinky, slimy PHP bug.

    It took a long time to figure out why my computations were only occasionally wrong for an unknown reason and that bug(?) seems to be the cause of the problem.

    The same result occurs even if more than one zero or more than one * is used.

    For example, in the above function, the argument 000** returns zero and 00077* returns 6* !

    The number * is evil, I tell you, EVIL !!!

    Arghhhhhhhh!

    I just want to know if the problem occurs for others using the same code or if the problem is unique to me.




    PS: Apparently it happens with 08 too!

    Rats!
    Last edited by JayT; 09-14-2007 at 12:24 AM.
    Oh to be free, so blissfully free, of the ravages of intelligence, there is no greater joy! - The Cweationist's Cweed

    All that is necessary for evil to triumph is a good PR firm.
    Very funny, Scotty. Now beam down my clothes!

Similar Threads

  1. Changing MAC Number
    By Noodles in forum Tutorials
    Replies: 2
    Last Post: 11-07-2007, 04:44 AM
  2. Evil Opinions - Hacking You
    By SyntaXmasteR in forum Internet Privacy
    Replies: 3
    Last Post: 12-25-2005, 09:43 AM
  3. port number
    By vietlinh23ark in forum Viruses and Trojans
    Replies: 0
    Last Post: 09-12-2005, 10:17 AM
  4. To find *** number with iP-adress
    By Unregistered in forum Internet Privacy
    Replies: 1
    Last Post: 11-16-2004, 11:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts