<?php
$n = 2;
## echo $n.'<br />';
$n = $n - 1;
## if($n > 0){
}else{
}
## echo 'I'm a bitch, I haven't executed it yet' . $n . '<br />';
?>
function dg( $n ){
echo $n.'<br />';
if($n > 0){
//Called dg itself in the function body
dg($n);
echo '--------------';
echo 'I'm a bitch, I haven't executed it yet' . $n . '<br />';
There is no function called, just add dg($n); after it
You didn’t call the function
<?php
$n = 2;
function dg( $n ){
echo $n.'<br />';
$n = $n - 1;
if($n > 0){
//Called dg itself in the function body
dg($n);
}else{
echo '--------------';
}
echo 'I'm a bitch, I haven't executed it yet' . $n . '<br />';
}
dg($n);
?>
There is no function called, just add dg($n); after it
You didn’t call the function