English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
get_called_class - 後期静的バインディング("Late Static Binding")のクラス名
get_called_class ( void );
静的メソッド呼び出しのクラス名を取得します。
番号 | 引数および説明 |
---|---|
1 | void voidは、任何の引数が必要でないことを示します。 |
この関数がクラス内で呼び出されていない場合、FALSEを返します。
以下はこの関数の使用方法です-
<?php class foo { static public function test() { var_dump(get_called_class()); } } class bar extends foo { } foo::test(); bar::test(); ?>テストを確認する ‹/›
出力結果:
string(3) "foo" string(3) "bar"