I only want to solve the speed problem. I don't mention the usage for the moment. someone on the Internet said that Const is a structure syntax and the speed will be several times higher than the define function. I need a professional saying, is that true? Currently, const can be used outside the class. Will it be used preferentially when you define constants? I only want to solve the speed problem. I don't mention the usage for the moment. someone on the Internet said that Const is a structure syntax and the speed will be several times higher than the define function. I need a professional saying, is that true? Currently, const can be used outside the class. Will it be used preferentially when you define constants?
Reply content:
I only want to solve the speed problem. I don't mention the usage for the moment. someone on the Internet said that Const is a structure syntax and the speed will be several times higher than the define function. I need a professional saying, is that true? Currently, const can be used outside the class. Will it be used preferentially when you define constants?
For speed comparison, I suggest you write a few lines of code for testing, which is much better than asking here.
1. expressions can be used in both methods;
2. const can define arrays, and define can only define scalar
Even if the syntax structure is faster than the function call, the const and define () are also insignificant differences. it is not a trivial matter to tangle with this. it is better to optimize the table structure and SQL statements.