Berkeley CSUA MOTD:Entry 42906
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/09 [General] UID:1000 Activity:popular
7/9     

2006/5/3-5 [Computer/SW/Languages/Web] UID:42906 Activity:nil
5/2     Running into a weird php problem. When I do the following I get
        both "1" and "2":
                print "1";
                require_once('./print_something.php');
                print "2";
        However, when I replace require_once with require (because I
        want to print something multiple times), I never get "2", ever.
        The control flow is never returned to me. Why is that?
        \_ Syntax error or call to exit() or die() in print_something.php?
           (OK, not syntax error if it makes it through the first time....)
        \_ At that point in the file had print_something.php been already
           required?  It looks like print_somthing.php can't handle being
           loaded twice.  It isn't idempotent.