Currently, php's underlying implementation cannot be directly viewed. So what is the general implementation process of php magic methods from construction to running? People who want to understand it will not be enlightened because they are not able to directly view the underlying implementation of php.
So what is the general implementation process of php magic methods from construction to running?
People who want to understand it will not be enlightened
Reply content:
Currently, php's underlying implementation cannot be directly viewed.
So what is the general implementation process of php magic methods from construction to running?
People who want to understand it will not be enlightened
The magic method is not directly integrated into the attributes of the Object, or even not put in function_table, so the search speed can be faster. There is no difference between magic functions and general functions in terms of the underlying architecture and implementation.
The slowness you mentioned here should be determined by the features of some magic functions, such as the _ get ,__ set method. The implementation process must be slower than the direct operation of object attributes. Another example is the _ call method. Not only do you need to check whether there are any methods in function_table, but also the compatibility code is usually put in it. You need to make more judgments during runtime. But there is no such concern for functions like _ construct.