PHP 8.5.0 Alpha 4 available for testing

ReflectionConstant::getExtension

(PHP 8 >= 8.5.0)

ReflectionConstant::getExtension定数を定義した拡張モジュールの ReflectionExtension を取得する

説明

public ReflectionConstant::getExtension(): ?ReflectionExtension

この定数を定義した拡張モジュールの ReflectionExtension オブジェクトを取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

この定数を定義した拡張モジュールを表す ReflectionExtension オブジェクトを返します。 ユーザーが定義した定数の場合は null を返します。

例1 ReflectionConstant::getExtension() の基本的な使い方

<?php
var_dump
((new ReflectionConstant('SQLITE3_TEXT'))->getExtension());
?>

上の例の出力は以下となります。

object(ReflectionExtension)#2 (1) {
  ["name"]=>
  string(7) "sqlite3"
}

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top