The simplest way of debugging is adding echo or die calls to your code.
Pros
Cons
<?php
function foo() {
    echo 
"Foo has been called!<br />";
}

function 
bar() {
    die(
"Bar has been called!<br />");
}

for (
$i 0$i 3$i++)
    
foo();

for (
$i 0$i 3$i++)
    
bar();
?>
Output
Foo has been called!
Foo has been called!
Foo has been called!
Bar has been called!