What scenarios is newReflectionClass () used in?

Source: Internet
Author: User
NewReflectionClass () is generally used in what scenarios, and it feels like a chicken rib, because it is nothing more than printing out the structure in the class. if such a structure has Source Code, who will use it?
So the question isIs it really a chicken rib?


Reply to discussion (solution)

The role of ReflectionClass is to get information about the class ......

Phpinfo is not the information about the php environment .... Is it also a chicken rib


Using ReflectionClass to get the class source code file path is really good

 GetFileName ());


Reflection is a mechanism used in the php kernel.
For some reason, he also exposed it to programmers.
If you don't want to use it, you don't need. It's unnecessary to say that he is a chicken rib.

You also know that reflection can analyze the class structure. So you can view the source code in a line with no targets for the batch source code? Isn't reflection easy to understand the overall situation? Http://bbs.csdn.net/topics/390836735)

In the scheme design mode, reflection is usually used to instantiate objects.
There are some possible usage, you can see the http://blog.csdn.net/salc3k/article/details/7287387

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.