Php magic method efficiency is relatively low? I want to know its underlying c Principle

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.