php function get_class()在类继承使用时需要特别注意。
abstract class bar { public function __construct() { var_dump(get_class($this)); var_dump(get_class()); }}class foo extends bar {}new foo; |
The above example will output:
string(3) "foo"string(3) "bar" |
{"type":"编程笔记"}
php function get_class()在类继承使用时需要特别注意。
<?phpabstract class bar { public function __construct() { var_dump(get_class($this)); var_dump(get_class()); }}class foo extends bar {}new foo;?> |
The above example will output:
string(3) "foo"string(3) "bar" |