1
In the scope of my design use include("funcoes.php")
, inside that file has all the functions I use in different parts of the project, I don’t use all the functions all the time.
So a doubt!
Pro system would be more advantageous, with respect to performance, use only this include and leave all functions there, or make several files, where each has its given function, and as the need of the use of the function use the include("nome.funcao.php")
, or the gain would not be so advantageous, so it would be easier to keep a single file and centralize everything in the same scope!
My question is this.
In this file I have about 30 functions, simple functions even the most complex, only that I don’t use the 30 all the time, and the file include("funcoes.php")
is included at the top of all pages, so assuming I use 5 functions, the other 25 were loaded "atoa".
related: https://answall.com/questions/203510/um-arquivo-com-v%C3%A1rias-fun%C3%A7%C3%B5es-ou-v%C3%A1rios-arquivos-com-uma-fun%C3%A7%C3%A3o (I don’t mean it’s a solution)
– Daniel Omine
related: https://answall.com/questions/74647/unir-arquivos-php-em-um-s%C3%B3-increases-a-performance
– Daniel Omine
@Danielomine gave a read! Already gave a help!
– ivan veloso
I would create a file for each function...becomes lighter and clear the project...
– alexjosesilva
I believe that if it is not an absurdly large file it will not make a difference, that you will only notice testing, it is very relative, however an idea can be categorizing these functions, for example, a file for functions related to dates and times, other for strings and etc... so you get a middle.
– abfurlan