Answer the question
In order to leave comments, you need to log in
How to fix eternal recursion?
I want to make a function that every time, provided that the number is more than one hundred, will subtract 5 from it, but for some reason the browser goes into eternal recursion and simply subtracts 5, not even every time, but one-time, here is the construction itself:
function number($sum){
if ($sum > 100) {
echo $sum - 5;
number($sum);
}else return;
}
number(156);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question