NewReflectionClass () is generally used in what scenarios? This post was last edited by php_cdsn2 from 2014-11-1414: 21: 21, because it is nothing more than printing out the structure in the class, and if this structure has the source code, who will use it? So the question is, is it really a chicken rib? ------ Solution -------- new ReflectionClass () in what scenarios?
This post was last edited by php_cdsn2 at 14:21:21
I think it is a chicken rib, because it is nothing more than printing out the structure in the class, and if this structure has the source code, who will use it?
So the question isIs it really a chicken rib?
------ 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
include 'pack.php';
$class=new ReflectionClass('ActiveDate');
var_dump($class->getFileName());
------ Solution ----------------------
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