¡@

Home 

php Programming Glossary: recursivefunc

What is better in a foreach loop… using the & symbol or reassigning based on key?

http://stackoverflow.com/questions/17459521/what-is-better-in-a-foreach-loop-using-the-symbol-or-reassigning-based-on-k

the original value in the array no side effects function recursiveFunc n max 10 if max return n 1 10 max recursiveFunc n 2 n 3 1 n.. function recursiveFunc n max 10 if max return n 1 10 max recursiveFunc n 2 n 3 1 n 2 max return null array range 10 20 foreach array.. 2 max return null array range 10 20 foreach array as k v v recursiveFunc v reassigning v here if v null array k v only now will the..