开发者

How to tell what class you extends?

Is there a function that tells what class you are extending? Like function_exists?

I want to use this in开发者_JAVA百科 an __autoload function that if it detects a class that extends mysqli, then I will automatically connect it to the database.


class foo { };
class bar extends foo {};
$bar = new bar();
echo get_parent_class($bar);

assuming bar extends foo, should echo foo

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜