I would like to know if it is a good thing to define a function inside another function in PHP. Isn\'t it better to define it before the function (and not inside) in terms o
I think you should care more about maintenability, and less about performance, especially in that kind of situation, where the difference in performances is probably not that big between the two solutions, while the difference in maintenability seems important.
Like Donald Knuth said :
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.
This is quite true, in this situation ;-)