-1

I have a MVC and I have a function: updateVisitor()

This function is called in visitors.php

And visitors.php is included once time with require_one

But the function is being executed three times, any idea? Is there any php debugger to see where are the functions being called from?

I can't code because it's very huge and I resume it very well

jsertx
  • 636
  • 7
  • 17

2 Answers2

0

There're at least two well-known debugging extensions (Xdebug and Zend Debugger) but you can track where a given function is being called with some of the builtin functions such as debug_print_backtrace().

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
0

I suggest adding a call to debug_print_backtrace at the beginning of your function:

debug_print_backtrace(0, 3);

It will tell you where the function was called from.

If it prints too many lines, you can limit that by passing a parameter:

debug_print_backtrace(0, 3); // would print only 3 lines at each call
Jocelyn
  • 11,209
  • 10
  • 43
  • 60