floridaflatlander Posted December 4, 2012 Share Posted December 4, 2012 Are php user defined functions defined/redefined every time a page loads? I have a functions page and function_exist() tells me the function is redefined every time I load a page. Is this correct, is this the nature of the beast that the functions will be redefined each time the function.inc file is used? When they(books) say remember, are they taking about a page that uses the function.inc file 2,3,4 5 times? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/271614-are-php-user-defined-functions-definedredefined-every-time-a-page-loads/ Share on other sites More sharing options...
trq Posted December 4, 2012 Share Posted December 4, 2012 Yes they are redefined every time the included file is include. Hence, you should be using include_once or require_once. Quote Link to comment https://forums.phpfreaks.com/topic/271614-are-php-user-defined-functions-definedredefined-every-time-a-page-loads/#findComment-1397604 Share on other sites More sharing options...
floridaflatlander Posted December 4, 2012 Author Share Posted December 4, 2012 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/271614-are-php-user-defined-functions-definedredefined-every-time-a-page-loads/#findComment-1397610 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.