php8.5
Home/ Manual/ reference / reflection/ The ReflectionMethod class

The ReflectionMethod class

The ReflectionMethod class reports information about a method.

Intro

The ReflectionMethod class reports information about a method.

Class synopsis

class ReflectionMethod extends ReflectionFunctionAbstract { }

Properties

name

Method name

class

Class name

Predefined Constants

ReflectionMethod Modifiers

ReflectionMethod::IS_STATICint

Indicates that the method is static. Prior to PHP 7.4.0, the value was 1.

ReflectionMethod::IS_PUBLICint

Indicates that the method is public. Prior to PHP 7.4.0, the value was 256.

ReflectionMethod::IS_PROTECTEDint

Indicates that the method is protected. Prior to PHP 7.4.0, the value was 512.

ReflectionMethod::IS_PRIVATEint

Indicates that the method is private. Prior to PHP 7.4.0, the value was 1024.

ReflectionMethod::IS_ABSTRACTint

Indicates that the method is abstract. Prior to PHP 7.4.0, the value was 2.

ReflectionMethod::IS_FINALint

Indicates that the method is final. Prior to PHP 7.4.0, the value was 4.

Note

The values of these constants may change between PHP versions. It is recommended to always use the constants and not rely on the values directly.

Changelog

VersionDescription
8.4.0The class constants are now typed.
8.0.0ReflectionMethod::export was removed.

Reflectionmethod

In this section

Source: reference/reflection/reflectionmethod.xml · from the official PHP manual (php/doc-en)