SEFE Posted April 10, 2007 Share Posted April 10, 2007 Is there some way to find out (inside func2), that iz was called from func1? function func1() { func2(); } function func2() { somefunctionthattellsmewherefunc2wascalledfrom(); } Link to comment https://forums.phpfreaks.com/topic/46417-can-i-find-out-which-function-called-my-second-function/ Share on other sites More sharing options...
jitesh Posted April 10, 2007 Share Posted April 10, 2007 <?php function fun1(){ echo "Called a function 1"; } function fun2(){ fun1(); } fun2(); ?> -------------------------- if Functions are in class <?php function fun1(){ echo "Called a function 1"; } function fun2(){ $this->fun1();} obj->fun2(); ?> Link to comment https://forums.phpfreaks.com/topic/46417-can-i-find-out-which-function-called-my-second-function/#findComment-225748 Share on other sites More sharing options...
SEFE Posted April 10, 2007 Author Share Posted April 10, 2007 No, functions are not in class. Link to comment https://forums.phpfreaks.com/topic/46417-can-i-find-out-which-function-called-my-second-function/#findComment-225783 Share on other sites More sharing options...
jitesh Posted April 10, 2007 Share Posted April 10, 2007 Then check this <?php function fun1(){ echo "Called a function 1"; } function fun2(){ fun1(); } fun2(); ?> Link to comment https://forums.phpfreaks.com/topic/46417-can-i-find-out-which-function-called-my-second-function/#findComment-225786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.