Check for infinite loop?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • el_roachmeister@yahoo.com

    Check for infinite loop?

    I suspect there might be an infinite loop in my code, however, php
    seems to timeout and continue running the script. Is there a way to
    check for this?

  • Colin McKinnon

    #2
    Re: Check for infinite loop?

    el_roachmeister @yahoo.com wrote:
    [color=blue]
    > I suspect there might be an infinite loop in my code, however, php
    > seems to timeout and continue running the script. Is there a way to
    > check for this?[/color]

    With vi:

    /for
    o
    print "I'm in the first loop!<br />";
    /
    o
    print "I'm in the second loop<br />";
    (repeat until it wraps)
    /while
    o
    print "I'm in the first while loop!<br />";
    /
    o
    print "I'm in the scond while loop<br />";

    etc.
    C.

    Comment

    • Andy Hassall

      #3
      Re: Check for infinite loop?

      On 20 Oct 2005 08:45:10 -0700, el_roachmeister @yahoo.com wrote:
      [color=blue]
      >I suspect there might be an infinite loop in my code, however, php
      >seems to timeout and continue running the script. Is there a way to
      >check for this?[/color]


      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Check for infinite loop?

        el_roachmeister @yahoo.com wrote:[color=blue]
        > I suspect there might be an infinite loop in my code, however, php
        > seems to timeout and continue running the script. Is there a way to
        > check for this?[/color]

        Possibly with profiler or debugger <http://in.php.net/APD>

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        • el_roachmeister@yahoo.com

          #5
          Re: Check for infinite loop?


          el_roachmeister @yahoo.com wrote:[color=blue]
          > I suspect there might be an infinite loop in my code, however, php
          > seems to timeout and continue running the script. Is there a way to
          > check for this?[/color]

          I traced the problem to several calls to http requests like:

          $contents = file('http://www.mydomain.co m/some_variable') ;

          Each one could took upto a second so I got rid of all but one . I
          suppose there is a lot of overhead with making the http request through
          php?

          Comment

          Working...