MDanz Posted February 25, 2011 Share Posted February 25, 2011 can you do that with php? Database2() { function test($id) { $newdb = new Database2(); $newdb->test($id); } } Quote Link to comment https://forums.phpfreaks.com/topic/228819-calling-the-same-function-from-within-that-function/ Share on other sites More sharing options...
samoht Posted February 25, 2011 Share Posted February 25, 2011 yes, but you need to define $id and you need to provide an excape from the function otherwise you'll be in an infinite loop. Quote Link to comment https://forums.phpfreaks.com/topic/228819-calling-the-same-function-from-within-that-function/#findComment-1179640 Share on other sites More sharing options...
KevinM1 Posted February 25, 2011 Share Posted February 25, 2011 http://en.wikipedia.org/wiki/Recursion_%28computer_science%29 Quote Link to comment https://forums.phpfreaks.com/topic/228819-calling-the-same-function-from-within-that-function/#findComment-1179641 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.