= PHP_7_1_0, PHP_8 // void // OFFLINE | ReflectionEnum - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionNamedType - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionEnumUnitCase - PHP_8 >= PHP_8_1_0 // UnitEnum // OFFLINE | ReflectionEnumBackedCase - PHP_8 >= PHP_8_1_0 // ReflectionZendExtension - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionFunction - PHP_5, PHP_7, PHP_8 // Closure // ReflectionFunctionAbstract - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // OFFLINE | ReflectionType - PHP_7, PHP_8 // static // ReflectionObject - PHP_5, PHP_7, PHP_8 // ReflectionParameter - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionUnionType - PHP_8 // OFFLINE | ReflectionGenerator - PHP_7, PHP_8 // Generator // OFFLINE | ReflectionFiber - PHP_8 >= PHP_8_1_0 // Fiber // callable // OFFLINE | ReflectionIntersectionType - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionReference - PHP_7 >= PHP_7_4_0, PHP_8 // OFFLINE | ReflectionAttribute - PHP_8 // ============================== END // REQUIREMENTS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION // ============================== ABOUT // PHP Manual / Function Reference / Variable and Type Related Extensions / Reflection // URL: https://www.php.net/manual/en/book.reflection.php // ============================== DESCRIPTION // REFLECTION // ENUMERATIONS // // REFLECTION - BEGIN // Reflection // // INTRODUCTION // INSTALLING_CONFIGURING // PREDEFINED_CONSTANTS // EXAMPLES // EXTENDING // THE_REFLECTION_CLASS // THE_REFLECTIONCLASS_CLASS // THE_REFLECTIONCLASSCONSTANT_CLASS // THE_REFLECTIONENUM_CLASS // THE_REFLECTIONENUMUNITCASE_CLASS // THE_REFLECTIONENUMBACKEDCASE_CLASS // THE_REFLECTIONZENDEXTENSION_CLASS // THE_REFLECTIONEXTENSION_CLASS // THE_REFLECTIONFUNCTION_CLASS // THE_REFLECTIONFUNCTIONABSTRACT_CLASS // THE_REFLECTIONMETHOD_CLASS // THE_REFLECTIONNAMEDTYPE_CLASS // THE_REFLECTIONOBJECT_CLASS // THE_REFLECTIONPARAMETER_CLASS // THE_REFLECTIONPROPERTY_CLASS // THE_REFLECTIONTYPE_CLASS // THE_REFLECTIONUNIONTYPE_CLASS // THE_REFLECTIONGENERATOR_CLASS // THE_REFLECTIONFIBER_CLASS // THE_REFLECTIONINTERSECTIONTYPE_CLASS // THE_REFLECTIONREFERENCE_CLASS // THE_REFLECTIONATTRIBUTE_CLASS // THE_REFLECTOR_INTERFACE // THE_REFLECTIONEXCEPTION_CLASS // // INTRODUCTION - BEGIN // Introduction // // PHP comes with a complete reflection API that adds the ability to introspect classes, interfaces, functions, methods and extensions. Additionally, the reflection API offers ways to retrieve doc comments for functions, classes and methods. // Please note that certain parts of the internal API are missing the necessary code to work with the Reflection extension. E.g., an internal PHP class might be missing reflection data for properties. These few cases are considered bugs, however, so they should be discovered and fixed. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/intro.reflection.php // INTRODUCTION - END // // INSTALLING_CONFIGURING - BEGIN // Installing/Configuring // // REQUIREMENTS // INSTALLATION // RUNTIME_CONFIGURATION // RESOURCE_TYPES // // REQUIREMENTS - BEGIN // Requirements // // No external libraries are needed to build this extension. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.requirements.php // REQUIREMENTS - END // // INSTALLATION - BEGIN // Installation // // There is no installation needed to use these functions; they are part of the PHP core. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.installation.php // INSTALLATION - END // // RUNTIME_CONFIGURATION - BEGIN // Runtime Configuration // // This extension has no configuration directives defined in php.ini. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.configuration.php // RUNTIME_CONFIGURATION - END // // RESOURCE_TYPES - BEGIN // Resource Types // // This extension has no resource types defined. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.resources.php // RESOURCE_TYPES - END // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.setup.php // INSTALLING_CONFIGURING - END // // PREDEFINED_CONSTANTS - BEGIN // Predefined Constants // // Each class describes its own constants. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/reflection.constants.php // PREDEFINED_CONSTANTS - END // // EXAMPLES - BEGIN // Examples // // Many examples exist within the Reflection documentation, typically within the __construct documentation for each class. // // [example] // Example #1 Reflection Example from Shell (a Terminal) // [code] // $ php --rf strlen // $ php --rc finfo // $ php --re json // $ php --ri dom // [/code] // The above example will output something similar to: // [result] // Function [ function strlen ] { // // - Parameters [1] { // Parameter #0 [ $str ] // } // } // // Class [ class finfo ] { // // - Constants [0] { // } // // - Static properties [0] { // } // // - Static methods [0] { // } // // - Properties [0] { // } // // - Methods [4] { // Method [ public method finfo ] { // // - Parameters [2] { // Parameter #0 [ $options ] // Parameter #1 [ $arg ] // } // } // // Method [ public method set_flags ] { // // - Parameters [1] { // Parameter #0 [ $options ] // } // } // // Method [ public method file ] { // // - Parameters [3] { // Parameter #0 [ $filename ] // Parameter #1 [ $options ] // Parameter #2 [ $context ] // } // } // // Method [ public method buffer ] { // // - Parameters [3] { // Parameter #0 [ $string ] // Parameter #1 [ $options ] // Parameter #2 [ $context ] // } // } // } // } // // Extension [ extension #23 json version 1.2.1 ] { // // - Constants [10] { // Constant [ integer JSON_HEX_TAG ] { 1 } // Constant [ integer JSON_HEX_AMP ] { 2 } // Constant [ integer JSON_HEX_APOS ] { 4 } // Constant [ integer JSON_HEX_QUOT ] { 8 } // Constant [ integer JSON_FORCE_OBJECT ] { 16 } // Constant [ integer JSON_ERROR_NONE ] { 0 } // Constant [ integer JSON_ERROR_DEPTH ] { 1 } // Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 } // Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 } // Constant [ integer JSON_ERROR_SYNTAX ] { 4 } // } // // - Functions { // Function [ function json_encode ] { // // - Parameters [2] { // Parameter #0 [ $value ] // Parameter #1 [ $options ] // } // } // Function [ function json_decode ] { // // - Parameters [3] { // Parameter #0 [ $json ] // Parameter #1 [ $assoc ] // Parameter #2 [ $depth ] // } // } // Function [ function json_last_error ] { // // - Parameters [0] { // } // } // } // } // // dom // // DOM/XML => enabled // DOM/XML API Version => 20031129 // libxml Version => 2.7.3 // HTML Support => enabled // XPath Support => enabled // XPointer Support => enabled // Schema Support => enabled // RelaxNG Support => enabled // [/result] // [/example] // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/reflection.examples.php // EXAMPLES - END // // EXTENDING - BEGIN // Extending // // If you want to create specialized versions of the built-in classes (say, for creating colorized HTML when being exported, having easy-access member variables instead of methods or having utility methods), you may go ahead and extend them. // [example] // Example #1 Extending the built-in classes // [php] // /** // * My Reflection_Method class // */ // class My_Reflection_Method extends ReflectionMethod // { // public $visibility = array(); // // public function __construct($o, $m) // { // parent::__construct($o, $m); // $this->visibility = Reflection::getModifierNames($this->getModifiers()); // } // } // // /** // * Demo class #1 // * // */ // class T { // protected function x() {} // } // // /** // * Demo class #2 // * // */ // class U extends T { // function x() {} // } // // // Print out information // var_dump(new My_Reflection_Method('U', 'x')); // [/php] // The above example will output something similar to: // [result] // object(My_Reflection_Method)#1 (3) { // ["visibility"]=> // array(1) { // [0]=> // string(6) "public" // } // ["name"]=> // string(1) "x" // ["class"]=> // string(1) "U" // } // [/result] // [/example] // Caution: If you're overwriting the constructor, remember to call the parent's constructor before any code you insert. Failing to do so will result in the following: Fatal error: Internal error: Failed to retrieve the reflection object // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/reflection.extending.php // EXTENDING - END // // THE_REFLECTION_CLASS - BEGIN // The Reflection class // // PHP_5, PHP_7, PHP_8 // // Introduction // The reflection class. // // Class synopsis // [code] // class Reflection { // // /* Methods */ // public static export(Reflector $reflector, bool $return = false): string // public static getModifierNames(int $modifiers): array // } // [/code] // // Table of Contents // * Reflection::export - Exports // * Reflection::getModifierNames - Gets modifier names // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.reflection.php // THE_REFLECTION_CLASS - END // // THE_REFLECTIONCLASS_CLASS - BEGIN // The ReflectionClass class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionClass class reports information about a class. // // Class synopsis // [code] // class ReflectionClass implements Reflector { // // /* Constants */ // public const int IS_IMPLICIT_ABSTRACT; // public const int IS_EXPLICIT_ABSTRACT; // public const int IS_FINAL; // public const int IS_READONLY; // // /* Properties */ // public string $name; // // /* Methods */ // public __construct(object|string $objectOrClass) // public static export(mixed $argument, bool $return = false): string // public getAttributes(?string $name = null, int $flags = 0): array // public getConstant(string $name): mixed // public getConstants(?int $filter = null): array // public getConstructor(): ?ReflectionMethod // public getDefaultProperties(): array // public getDocComment(): string|false // public getEndLine(): int|false // public getExtension(): ?ReflectionExtension // public getExtensionName(): string|false // public getFileName(): string|false // public getInterfaceNames(): array // public getInterfaces(): array // public getMethod(string $name): ReflectionMethod // public getMethods(?int $filter = null): array // public getModifiers(): int // public getName(): string // public getNamespaceName(): string // public getParentClass(): ReflectionClass|false // public getProperties(?int $filter = null): array // public getProperty(string $name): ReflectionProperty // public getReflectionConstant(string $name): ReflectionClassConstant|false // public getReflectionConstants(?int $filter = null): array // public getShortName(): string // public getStartLine(): int|false // public getStaticProperties(): ?array // public getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed // public getTraitAliases(): array // public getTraitNames(): array // public getTraits(): array // public hasConstant(string $name): bool // public hasMethod(string $name): bool // public hasProperty(string $name): bool // public implementsInterface(ReflectionClass|string $interface): bool // public inNamespace(): bool // public isAbstract(): bool // public isAnonymous(): bool // public isCloneable(): bool // public isEnum(): bool // public isFinal(): bool // public isInstance(object $object): bool // public isInstantiable(): bool // public isInterface(): bool // public isInternal(): bool // public isIterable(): bool // public isReadOnly(): bool // public isSubclassOf(ReflectionClass|string $class): bool // public isTrait(): bool // public isUserDefined(): bool // public newInstance(mixed ...$args): object // public newInstanceArgs(array $args = []): ?object // public newInstanceWithoutConstructor(): object // public setStaticPropertyValue(string $name, mixed $value): void // public __toString(): string // } // [/code] // // Properties // name - Name of the class. Read-only, throws ReflectionException in attempt to write. // // Predefined Constants // // ReflectionClass Modifiers // ReflectionClass::IS_IMPLICIT_ABSTRACT - Indicates the class is abstract because it has some abstract methods. // ReflectionClass::IS_EXPLICIT_ABSTRACT - Indicates the class is abstract because of its definition. // ReflectionClass::IS_FINAL - Indicates the class is final. // ReflectionClass::IS_READONLY - Indicates the class is readonly. // // Changelog // Version - Description // 8.0.0 - ReflectionClass::export() was removed. // // Table of Contents // * ReflectionClass::__construct - Constructs a ReflectionClass // * ReflectionClass::export - Exports a class // * ReflectionClass::getAttributes - Gets Attributes // * ReflectionClass::getConstant - Gets defined constant // * ReflectionClass::getConstants - Gets constants // * ReflectionClass::getConstructor - Gets the constructor of the class // * ReflectionClass::getDefaultProperties - Gets default properties // * ReflectionClass::getDocComment - Gets doc comments // * ReflectionClass::getEndLine - Gets end line // * ReflectionClass::getExtension - Gets a ReflectionExtension object for the extension which defined the class // * ReflectionClass::getExtensionName - Gets the name of the extension which defined the class // * ReflectionClass::getFileName - Gets the filename of the file in which the class has been defined // * ReflectionClass::getInterfaceNames - Gets the interface names // * ReflectionClass::getInterfaces - Gets the interfaces // * ReflectionClass::getMethod - Gets a ReflectionMethod for a class method // * ReflectionClass::getMethods - Gets an array of methods // * ReflectionClass::getModifiers - Gets the class modifiers // * ReflectionClass::getName - Gets class name // * ReflectionClass::getNamespaceName - Gets namespace name // * ReflectionClass::getParentClass - Gets parent class // * ReflectionClass::getProperties - Gets properties // * ReflectionClass::getProperty - Gets a ReflectionProperty for a class's property // * ReflectionClass::getReflectionConstant - Gets a ReflectionClassConstant for a class's constant // * ReflectionClass::getReflectionConstants - Gets class constants // * ReflectionClass::getShortName - Gets short name // * ReflectionClass::getStartLine - Gets starting line number // * ReflectionClass::getStaticProperties - Gets static properties // * ReflectionClass::getStaticPropertyValue - Gets static property value // * ReflectionClass::getTraitAliases - Returns an array of trait aliases // * ReflectionClass::getTraitNames - Returns an array of names of traits used by this class // * ReflectionClass::getTraits - Returns an array of traits used by this class // * ReflectionClass::hasConstant - Checks if constant is defined // * ReflectionClass::hasMethod - Checks if method is defined // * ReflectionClass::hasProperty - Checks if property is defined // * ReflectionClass::implementsInterface - Implements interface // * ReflectionClass::inNamespace - Checks if in namespace // * ReflectionClass::isAbstract - Checks if class is abstract // * ReflectionClass::isAnonymous - Checks if class is anonymous // * ReflectionClass::isCloneable - Returns whether this class is cloneable // * ReflectionClass::isEnum - Returns whether this is an enum // * ReflectionClass::isFinal - Checks if class is final // * ReflectionClass::isInstance - Checks class for instance // * ReflectionClass::isInstantiable - Checks if the class is instantiable // * ReflectionClass::isInterface - Checks if the class is an interface // * ReflectionClass::isInternal - Checks if class is defined internally by an extension, or the core // * ReflectionClass::isIterable - Check whether this class is iterable // * ReflectionClass::isIterateable - Alias of ReflectionClass::isIterable // * ReflectionClass::isReadOnly - Checks if class is readonly // * ReflectionClass::isSubclassOf - Checks if a subclass // * ReflectionClass::isTrait - Returns whether this is a trait // * ReflectionClass::isUserDefined - Checks if user defined // * ReflectionClass::newInstance - Creates a new class instance from given arguments // * ReflectionClass::newInstanceArgs - Creates a new class instance from given arguments // * ReflectionClass::newInstanceWithoutConstructor - Creates a new class instance without invoking the constructor // * ReflectionClass::setStaticPropertyValue - Sets static property value // * ReflectionClass::__toString - Returns the string representation of the ReflectionClass object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionclass.php // THE_REFLECTIONCLASS_CLASS - END // // THE_REFLECTIONCLASSCONSTANT_CLASS - BEGIN // The ReflectionClassConstant class // // PHP_7 >= PHP_7_1_0, PHP_8 // // Introduction // The ReflectionClassConstant class reports information about a class constant. // // Class synopsis // [code] // class ReflectionClassConstant implements Reflector { // // /* Constants */ // public const int IS_PUBLIC; // public const int IS_PROTECTED; // public const int IS_PRIVATE; // public const int IS_FINAL; // // /* Properties */ // public string $name; // public string $class; // // /* Methods */ // public __construct(object|string $class, string $constant) // public static export(mixed $class, string $name, bool $return = ?): string // public getAttributes(?string $name = null, int $flags = 0): array // public getDeclaringClass(): ReflectionClass // public getDocComment(): string|false // public getModifiers(): int // public getName(): string // public getValue(): mixed // public isEnumCase(): bool // public isFinal(): bool // public isPrivate(): bool // public isProtected(): bool // public isPublic(): bool // public __toString(): string // } // [/code] // // Properties // name - Name of the class constant. Read-only, throws ReflectionException in attempt to write. // class - Name of the class where the class constant is defined. Read-only, throws ReflectionException in attempt to write. // // Predefined Constants // // ReflectionClassConstant Modifiers // ReflectionClassConstant::IS_PUBLIC - Indicates public constants. Prior to PHP 7.4.0, the value was 256. // ReflectionClassConstant::IS_PROTECTED - Indicates protected constants. Prior to PHP 7.4.0, the value was 512. // ReflectionClassConstant::IS_PRIVATE - Indicates private constants. Prior to PHP 7.4.0, the value was 1024. // ReflectionClassConstant::IS_FINAL - Indicates final constants. Available as of PHP 8.1.0. // 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 // Version - Description // 8.0.0 - ReflectionClassConstant::export() was removed. // // Table of Contents // * ReflectionClassConstant::__construct - Constructs a ReflectionClassConstant // * ReflectionClassConstant::export - Export // * ReflectionClassConstant::getAttributes - Gets Attributes // * ReflectionClassConstant::getDeclaringClass - Gets declaring class // * ReflectionClassConstant::getDocComment - Gets doc comments // * ReflectionClassConstant::getModifiers - Gets the class constant modifiers // * ReflectionClassConstant::getName - Get name of the constant // * ReflectionClassConstant::getValue - Gets value // * ReflectionClassConstant::isEnumCase - Checks if class constant is an Enum case // * ReflectionClassConstant::isFinal - Checks if class constant is final // * ReflectionClassConstant::isPrivate - Checks if class constant is private // * ReflectionClassConstant::isProtected - Checks if class constant is protected // * ReflectionClassConstant::isPublic - Checks if class constant is public // * ReflectionClassConstant::__toString - Returns the string representation of the ReflectionClassConstant object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionclassconstant.php // THE_REFLECTIONCLASSCONSTANT_CLASS - END // // THE_REFLECTIONENUM_CLASS - BEGIN // The ReflectionEnum class // // PHP_8 >= PHP_8_1_0 // // Introduction // The ReflectionEnum class reports information about an Enum. // // Class synopsis // [code] // class ReflectionEnum extends ReflectionClass { // // /* Inherited constants */ // public const int ReflectionClass::IS_IMPLICIT_ABSTRACT; // public const int ReflectionClass::IS_EXPLICIT_ABSTRACT; // public const int ReflectionClass::IS_FINAL; // public const int ReflectionClass::IS_READONLY; // // /* Inherited properties */ // public string $name; // // /* Methods */ // public __construct(object|string $objectOrClass) // public getBackingType(): ?ReflectionNamedType // public getCase(string $name): ReflectionEnumUnitCase // public getCases(): array // public hasCase(string $name): bool // public isBacked(): bool // // /* Inherited methods */ // public static ReflectionClass::export(mixed $argument, bool $return = false): string // public ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionClass::getConstant(string $name): mixed // public ReflectionClass::getConstants(?int $filter = null): array // public ReflectionClass::getConstructor(): ?ReflectionMethod // public ReflectionClass::getDefaultProperties(): array // public ReflectionClass::getDocComment(): string|false // public ReflectionClass::getEndLine(): int|false // public ReflectionClass::getExtension(): ?ReflectionExtension // public ReflectionClass::getExtensionName(): string|false // public ReflectionClass::getFileName(): string|false // public ReflectionClass::getInterfaceNames(): array // public ReflectionClass::getInterfaces(): array // public ReflectionClass::getMethod(string $name): ReflectionMethod // public ReflectionClass::getMethods(?int $filter = null): array // public ReflectionClass::getModifiers(): int // public ReflectionClass::getName(): string // public ReflectionClass::getNamespaceName(): string // public ReflectionClass::getParentClass(): ReflectionClass|false // public ReflectionClass::getProperties(?int $filter = null): array // public ReflectionClass::getProperty(string $name): ReflectionProperty // public ReflectionClass::getReflectionConstant(string $name): ReflectionClassConstant|false // public ReflectionClass::getReflectionConstants(?int $filter = null): array // public ReflectionClass::getShortName(): string // public ReflectionClass::getStartLine(): int|false // public ReflectionClass::getStaticProperties(): ?array // public ReflectionClass::getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed // public ReflectionClass::getTraitAliases(): array // public ReflectionClass::getTraitNames(): array // public ReflectionClass::getTraits(): array // public ReflectionClass::hasConstant(string $name): bool // public ReflectionClass::hasMethod(string $name): bool // public ReflectionClass::hasProperty(string $name): bool // public ReflectionClass::implementsInterface(ReflectionClass|string $interface): bool // public ReflectionClass::inNamespace(): bool // public ReflectionClass::isAbstract(): bool // public ReflectionClass::isAnonymous(): bool // public ReflectionClass::isCloneable(): bool // public ReflectionClass::isEnum(): bool // public ReflectionClass::isFinal(): bool // public ReflectionClass::isInstance(object $object): bool // public ReflectionClass::isInstantiable(): bool // public ReflectionClass::isInterface(): bool // public ReflectionClass::isInternal(): bool // public ReflectionClass::isIterable(): bool // public ReflectionClass::isReadOnly(): bool // public ReflectionClass::isSubclassOf(ReflectionClass|string $class): bool // public ReflectionClass::isTrait(): bool // public ReflectionClass::isUserDefined(): bool // public ReflectionClass::newInstance(mixed ...$args): object // public ReflectionClass::newInstanceArgs(array $args = []): ?object // public ReflectionClass::newInstanceWithoutConstructor(): object // public ReflectionClass::setStaticPropertyValue(string $name, mixed $value): void // public ReflectionClass::__toString(): string // } // [/code] // // See Also // * Enumerations // // Table of Contents // * ReflectionEnum::__construct - Instantiates a ReflectionEnum object // * ReflectionEnum::getBackingType - Gets the backing type of an Enum, if any // * ReflectionEnum::getCase - Returns a specific case of an Enum // * ReflectionEnum::getCases - Returns a list of all cases on an Enum // * ReflectionEnum::hasCase - Checks for a case on an Enum // * ReflectionEnum::isBacked - Determines if an Enum is a Backed Enum // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionenum.php // THE_REFLECTIONENUM_CLASS - END // // THE_REFLECTIONENUMUNITCASE_CLASS - BEGIN // The ReflectionEnumUnitCase class // // PHP_8 >= PHP_8_1_0 // // Introduction // The ReflectionEnumUnitCase class reports information about an Enum unit case, which has no scalar equivalent. // // Class synopsis // [code] // class ReflectionEnumUnitCase extends ReflectionClassConstant { // // /* Inherited constants */ // public const int ReflectionClassConstant::IS_PUBLIC; // public const int ReflectionClassConstant::IS_PROTECTED; // public const int ReflectionClassConstant::IS_PRIVATE; // public const int ReflectionClassConstant::IS_FINAL; // // /* Inherited properties */ // public string $name; // public string $class; // // /* Methods */ // public __construct(object|string $class, string $constant) // public getEnum(): ReflectionEnum // public getValue(): UnitEnum // // /* Inherited methods */ // public static ReflectionClassConstant::export(mixed $class, string $name, bool $return = ?): string // public ReflectionClassConstant::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionClassConstant::getDeclaringClass(): ReflectionClass // public ReflectionClassConstant::getDocComment(): string|false // public ReflectionClassConstant::getModifiers(): int // public ReflectionClassConstant::getName(): string // public ReflectionClassConstant::getValue(): mixed // public ReflectionClassConstant::isEnumCase(): bool // public ReflectionClassConstant::isFinal(): bool // public ReflectionClassConstant::isPrivate(): bool // public ReflectionClassConstant::isProtected(): bool // public ReflectionClassConstant::isPublic(): bool // public ReflectionClassConstant::__toString(): string // } // [/code] // // See Also // * Enumerations // * ReflectionEnumBackedCase // // Table of Contents // * ReflectionEnumUnitCase::__construct - Instantiates a ReflectionEnumUnitCase object // * ReflectionEnumUnitCase::getEnum - Gets the reflection of the enum of this case // * ReflectionEnumUnitCase::getValue - Gets the enum case object described by this reflection object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionenumunitcase.php // THE_REFLECTIONENUMUNITCASE_CLASS - END // // THE_REFLECTIONENUMBACKEDCASE_CLASS - BEGIN // The ReflectionEnumBackedCase class // // PHP_8 >= PHP_8_1_0 // // Introduction // The ReflectionEnumBackedCase class reports information about an Enum backed case, which has a scalar equivalent. // // Class synopsis // [code] // class ReflectionEnumBackedCase extends ReflectionEnumUnitCase { // // /* Inherited constants */ // public const int ReflectionClassConstant::IS_PUBLIC; // public const int ReflectionClassConstant::IS_PROTECTED; // public const int ReflectionClassConstant::IS_PRIVATE; // public const int ReflectionClassConstant::IS_FINAL; // // /* Inherited properties */ // public string $name; // public string $class; // // /* Methods */ // public __construct(object|string $class, string $constant) // public getBackingValue(): int|string // // /* Inherited methods */ // public ReflectionEnumUnitCase::getEnum(): ReflectionEnum // public ReflectionEnumUnitCase::getValue(): UnitEnum // public static ReflectionClassConstant::export(mixed $class, string $name, bool $return = ?): string // public ReflectionClassConstant::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionClassConstant::getDeclaringClass(): ReflectionClass // public ReflectionClassConstant::getDocComment(): string|false // public ReflectionClassConstant::getModifiers(): int // public ReflectionClassConstant::getName(): string // public ReflectionClassConstant::getValue(): mixed // public ReflectionClassConstant::isEnumCase(): bool // public ReflectionClassConstant::isFinal(): bool // public ReflectionClassConstant::isPrivate(): bool // public ReflectionClassConstant::isProtected(): bool // public ReflectionClassConstant::isPublic(): bool // public ReflectionClassConstant::__toString(): string // } // [/code] // // See Also // * Enumerations // * ReflectionEnumUnitCase // // Table of Contents // * ReflectionEnumBackedCase::__construct - Instantiates a ReflectionEnumBackedCase object // * ReflectionEnumBackedCase::getBackingValue - Gets the scalar value backing this Enum case // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionenumbackedcase.php // THE_REFLECTIONENUMBACKEDCASE_CLASS - END // // THE_REFLECTIONZENDEXTENSION_CLASS - BEGIN // The ReflectionZendExtension class // // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // // Introduction // // Class synopsis // [code] // class ReflectionZendExtension implements Reflector { // // /* Properties */ // public string $name; // // /* Methods */ // public __construct(string $name) // private __clone(): void // public static export(string $name, bool $return = ?): string // public getAuthor(): string // public getCopyright(): string // public getName(): string // public getURL(): string // public getVersion(): string // public __toString(): string // } // [/code] // // Properties // name - Name of the extension. Read-only, throws ReflectionException in attempt to write. // // Changelog // Version - Description // 8.0.0 - ReflectionZendExtension::export() was removed. // // Table of Contents // * ReflectionZendExtension::__clone - Clone handler // * ReflectionZendExtension::__construct - Constructs a ReflectionZendExtension object // * ReflectionZendExtension::export - Export // * ReflectionZendExtension::getAuthor - Gets author // * ReflectionZendExtension::getCopyright - Gets copyright // * ReflectionZendExtension::getName - Gets name // * ReflectionZendExtension::getURL - Gets URL // * ReflectionZendExtension::getVersion - Gets version // * ReflectionZendExtension::__toString - To string handler // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionzendextension.php // THE_REFLECTIONZENDEXTENSION_CLASS - END // // THE_REFLECTIONEXTENSION_CLASS - BEGIN // The ReflectionExtension class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionExtension class reports information about an extension. // // Class synopsis // [code] // class ReflectionExtension implements Reflector { // // /* Properties */ // public string $name; // // /* Methods */ // public __construct(string $name) // private __clone(): void // public static export(string $name, string $return = false): string // public getClasses(): array // public getClassNames(): array // public getConstants(): array // public getDependencies(): array // public getFunctions(): array // public getINIEntries(): array // public getName(): string // public getVersion(): ?string // public info(): void // public isPersistent(): bool // public isTemporary(): bool // public __toString(): string // } // [/code] // // Properties // name - Name of the extension, same as calling the ReflectionExtension::getName() method. // // Changelog // Version - Description // 8.0.0 - ReflectionExtension::export() was removed. // // Table of Contents // * ReflectionExtension::__clone - Clones // * ReflectionExtension::__construct - Constructs a ReflectionExtension // * ReflectionExtension::export - Export // * ReflectionExtension::getClasses - Gets classes // * ReflectionExtension::getClassNames - Gets class names // * ReflectionExtension::getConstants - Gets constants // * ReflectionExtension::getDependencies - Gets dependencies // * ReflectionExtension::getFunctions - Gets extension functions // * ReflectionExtension::getINIEntries - Gets extension ini entries // * ReflectionExtension::getName - Gets extension name // * ReflectionExtension::getVersion - Gets extension version // * ReflectionExtension::info - Print extension info // * ReflectionExtension::isPersistent - Returns whether this extension is persistent // * ReflectionExtension::isTemporary - Returns whether this extension is temporary // * ReflectionExtension::__toString - To string // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionextension.php // THE_REFLECTIONEXTENSION_CLASS - END // // THE_REFLECTIONFUNCTION_CLASS - BEGIN // The ReflectionFunction class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionFunction class reports information about a function. // // Class synopsis // [code] // class ReflectionFunction extends ReflectionFunctionAbstract { // // /* Constants */ // public const int IS_DEPRECATED; // // /* Inherited properties */ // public string $name; // // /* Methods */ // public __construct(Closure|string $function) // public static export(string $name, string $return = ?): string // public getClosure(): Closure // public invoke(mixed ...$args): mixed // public invokeArgs(array $args): mixed // public isAnonymous(): bool // public isDisabled(): bool // public __toString(): string // // /* Inherited methods */ // private ReflectionFunctionAbstract::__clone(): void // public ReflectionFunctionAbstract::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionFunctionAbstract::getClosureScopeClass(): ?ReflectionClass // public ReflectionFunctionAbstract::getClosureThis(): ?object // public ReflectionFunctionAbstract::getClosureUsedVariables(): array // public ReflectionFunctionAbstract::getDocComment(): string|false // public ReflectionFunctionAbstract::getEndLine(): int|false // public ReflectionFunctionAbstract::getExtension(): ?ReflectionExtension // public ReflectionFunctionAbstract::getExtensionName(): string|false // public ReflectionFunctionAbstract::getFileName(): string|false // public ReflectionFunctionAbstract::getName(): string // public ReflectionFunctionAbstract::getNamespaceName(): string // public ReflectionFunctionAbstract::getNumberOfParameters(): int // public ReflectionFunctionAbstract::getNumberOfRequiredParameters(): int // public ReflectionFunctionAbstract::getParameters(): array // public ReflectionFunctionAbstract::getReturnType(): ?ReflectionType // public ReflectionFunctionAbstract::getShortName(): string // public ReflectionFunctionAbstract::getStartLine(): int|false // public ReflectionFunctionAbstract::getStaticVariables(): array // public ReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType // public ReflectionFunctionAbstract::hasReturnType(): bool // public ReflectionFunctionAbstract::hasTentativeReturnType(): bool // public ReflectionFunctionAbstract::inNamespace(): bool // public ReflectionFunctionAbstract::isClosure(): bool // public ReflectionFunctionAbstract::isDeprecated(): bool // public ReflectionFunctionAbstract::isGenerator(): bool // public ReflectionFunctionAbstract::isInternal(): bool // public ReflectionFunctionAbstract::isStatic(): bool // public ReflectionFunctionAbstract::isUserDefined(): bool // public ReflectionFunctionAbstract::isVariadic(): bool // public ReflectionFunctionAbstract::returnsReference(): bool // abstract public ReflectionFunctionAbstract::__toString(): void // } // [/code] // // Predefined Constants // // ReflectionFunction Modifiers // ReflectionFunction::IS_DEPRECATED - Indicates deprecated functions. // // Changelog // Version - Description // 8.0.0 - ReflectionFunction::export() was removed. // // Table of Contents // * ReflectionFunction::__construct - Constructs a ReflectionFunction object // * ReflectionFunction::export - Exports function // * ReflectionFunction::getClosure - Returns a dynamically created closure for the function // * ReflectionFunction::invoke - Invokes function // * ReflectionFunction::invokeArgs - Invokes function args // * ReflectionFunction::isAnonymous - Checks if a function is anonymous // * ReflectionFunction::isDisabled - Checks if function is disabled // * ReflectionFunction::__toString - Returns the string representation of the ReflectionFunction object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionfunction.php // THE_REFLECTIONFUNCTION_CLASS - END // // THE_REFLECTIONFUNCTIONABSTRACT_CLASS - BEGIN // The ReflectionFunctionAbstract class // // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // // Introduction // A parent class to ReflectionFunction, read its description for details. // // Class synopsis // [code] // abstract class ReflectionFunctionAbstract implements Reflector { // // /* Properties */ // public string $name; // // /* Methods */ // private __clone(): void // public getAttributes(?string $name = null, int $flags = 0): array // public getClosureScopeClass(): ?ReflectionClass // public getClosureThis(): ?object // public getClosureUsedVariables(): array // public getDocComment(): string|false // public getEndLine(): int|false // public getExtension(): ?ReflectionExtension // public getExtensionName(): string|false // public getFileName(): string|false // public getName(): string // public getNamespaceName(): string // public getNumberOfParameters(): int // public getNumberOfRequiredParameters(): int // public getParameters(): array // public getReturnType(): ?ReflectionType // public getShortName(): string // public getStartLine(): int|false // public getStaticVariables(): array // public getTentativeReturnType(): ?ReflectionType // public hasReturnType(): bool // public hasTentativeReturnType(): bool // public inNamespace(): bool // public isClosure(): bool // public isDeprecated(): bool // public isGenerator(): bool // public isInternal(): bool // public isStatic(): bool // public isUserDefined(): bool // public isVariadic(): bool // public returnsReference(): bool // abstract public __toString(): void // } // [/code] // // Properties // name - Name of the function. Read-only, throws ReflectionException in attempt to write. // // Table of Contents // * ReflectionFunctionAbstract::__clone - Clones function // * ReflectionFunctionAbstract::getAttributes - Gets Attributes // * ReflectionFunctionAbstract::getClosureScopeClass - Returns the scope class associated with the closure // * ReflectionFunctionAbstract::getClosureThis - Returns this pointer bound to closure // * ReflectionFunctionAbstract::getClosureUsedVariables - Returns an array of the used variables in the Closure // * ReflectionFunctionAbstract::getDocComment - Gets doc comment // * ReflectionFunctionAbstract::getEndLine - Gets end line number // * ReflectionFunctionAbstract::getExtension - Gets extension info // * ReflectionFunctionAbstract::getExtensionName - Gets extension name // * ReflectionFunctionAbstract::getFileName - Gets file name // * ReflectionFunctionAbstract::getName - Gets function name // * ReflectionFunctionAbstract::getNamespaceName - Gets namespace name // * ReflectionFunctionAbstract::getNumberOfParameters - Gets number of parameters // * ReflectionFunctionAbstract::getNumberOfRequiredParameters - Gets number of required parameters // * ReflectionFunctionAbstract::getParameters - Gets parameters // * ReflectionFunctionAbstract::getReturnType - Gets the specified return type of a function // * ReflectionFunctionAbstract::getShortName - Gets function short name // * ReflectionFunctionAbstract::getStartLine - Gets starting line number // * ReflectionFunctionAbstract::getStaticVariables - Gets static variables // * ReflectionFunctionAbstract::getTentativeReturnType - Returns the tentative return type associated with the function // * ReflectionFunctionAbstract::hasReturnType - Checks if the function has a specified return type // * ReflectionFunctionAbstract::hasTentativeReturnType - Returns whether the function has a tentative return type // * ReflectionFunctionAbstract::inNamespace - Checks if function in namespace // * ReflectionFunctionAbstract::isClosure - Checks if closure // * ReflectionFunctionAbstract::isDeprecated - Checks if deprecated // * ReflectionFunctionAbstract::isGenerator - Returns whether this function is a generator // * ReflectionFunctionAbstract::isInternal - Checks if is internal // * ReflectionFunctionAbstract::isStatic - Checks if the function is static // * ReflectionFunctionAbstract::isUserDefined - Checks if user defined // * ReflectionFunctionAbstract::isVariadic - Checks if the function is variadic // * ReflectionFunctionAbstract::returnsReference - Checks if returns reference // * ReflectionFunctionAbstract::__toString - Returns the string representation of the ReflectionFunctionAbstract object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionfunctionabstract.php // THE_REFLECTIONFUNCTIONABSTRACT_CLASS - END // // THE_REFLECTIONMETHOD_CLASS - BEGIN // The ReflectionMethod class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionMethod class reports information about a method. // // Class synopsis // [code] // class ReflectionMethod extends ReflectionFunctionAbstract { // // /* Constants */ // public const int IS_STATIC; // public const int IS_PUBLIC; // public const int IS_PROTECTED; // public const int IS_PRIVATE; // public const int IS_ABSTRACT; // public const int IS_FINAL; // // /* Properties */ // public string $class; // // /* Inherited properties */ // public string $name; // // /* Methods */ // public __construct(object|string $objectOrMethod, string $method) // public __construct(string $classMethod) // public static createFromMethodName(string $method): static // public static export(string $class, string $name, bool $return = false): string // public getClosure(?object $object = null): Closure // public getDeclaringClass(): ReflectionClass // public getModifiers(): int // public getPrototype(): ReflectionMethod // public hasPrototype(): bool // public invoke(?object $object, mixed ...$args): mixed // public invokeArgs(?object $object, array $args): mixed // public isAbstract(): bool // public isConstructor(): bool // public isDestructor(): bool // public isFinal(): bool // public isPrivate(): bool // public isProtected(): bool // public isPublic(): bool // public setAccessible(bool $accessible): void // public __toString(): string // // /* Inherited methods */ // private ReflectionFunctionAbstract::__clone(): void // public ReflectionFunctionAbstract::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionFunctionAbstract::getClosureScopeClass(): ?ReflectionClass // public ReflectionFunctionAbstract::getClosureThis(): ?object // public ReflectionFunctionAbstract::getClosureUsedVariables(): array // public ReflectionFunctionAbstract::getDocComment(): string|false // public ReflectionFunctionAbstract::getEndLine(): int|false // public ReflectionFunctionAbstract::getExtension(): ?ReflectionExtension // public ReflectionFunctionAbstract::getExtensionName(): string|false // public ReflectionFunctionAbstract::getFileName(): string|false // public ReflectionFunctionAbstract::getName(): string // public ReflectionFunctionAbstract::getNamespaceName(): string // public ReflectionFunctionAbstract::getNumberOfParameters(): int // public ReflectionFunctionAbstract::getNumberOfRequiredParameters(): int // public ReflectionFunctionAbstract::getParameters(): array // public ReflectionFunctionAbstract::getReturnType(): ?ReflectionType // public ReflectionFunctionAbstract::getShortName(): string // public ReflectionFunctionAbstract::getStartLine(): int|false // public ReflectionFunctionAbstract::getStaticVariables(): array // public ReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType // public ReflectionFunctionAbstract::hasReturnType(): bool // public ReflectionFunctionAbstract::hasTentativeReturnType(): bool // public ReflectionFunctionAbstract::inNamespace(): bool // public ReflectionFunctionAbstract::isClosure(): bool // public ReflectionFunctionAbstract::isDeprecated(): bool // public ReflectionFunctionAbstract::isGenerator(): bool // public ReflectionFunctionAbstract::isInternal(): bool // public ReflectionFunctionAbstract::isStatic(): bool // public ReflectionFunctionAbstract::isUserDefined(): bool // public ReflectionFunctionAbstract::isVariadic(): bool // public ReflectionFunctionAbstract::returnsReference(): bool // abstract public ReflectionFunctionAbstract::__toString(): void // } // [/code] // // Properties // name - Method name // class - Class name // // Predefined Constants // // ReflectionMethod Modifiers // ReflectionMethod::IS_STATIC - Indicates that the method is static. Prior to PHP 7.4.0, the value was 1. // ReflectionMethod::IS_PUBLIC - Indicates that the method is public. Prior to PHP 7.4.0, the value was 256. // ReflectionMethod::IS_PROTECTED - Indicates that the method is protected. Prior to PHP 7.4.0, the value was 512. // ReflectionMethod::IS_PRIVATE - Indicates that the method is private. Prior to PHP 7.4.0, the value was 1024. // ReflectionMethod::IS_ABSTRACT - Indicates that the method is abstract. Prior to PHP 7.4.0, the value was 2. // ReflectionMethod::IS_FINAL - 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 // Version - Description // 8.0.0 - ReflectionMethod::export() was removed. // // Table of Contents // * ReflectionMethod::__construct - Constructs a ReflectionMethod // * ReflectionMethod::createFromMethodName - Creates a new ReflectionMethod // * ReflectionMethod::export - Export a reflection method // * ReflectionMethod::getClosure - Returns a dynamically created closure for the method // * ReflectionMethod::getDeclaringClass - Gets declaring class for the reflected method // * ReflectionMethod::getModifiers - Gets the method modifiers // * ReflectionMethod::getPrototype - Gets the method prototype (if there is one) // * ReflectionMethod::hasPrototype - Returns whether a method has a prototype // * ReflectionMethod::invoke - Invoke // * ReflectionMethod::invokeArgs - Invoke args // * ReflectionMethod::isAbstract - Checks if method is abstract // * ReflectionMethod::isConstructor - Checks if method is a constructor // * ReflectionMethod::isDestructor - Checks if method is a destructor // * ReflectionMethod::isFinal - Checks if method is final // * ReflectionMethod::isPrivate - Checks if method is private // * ReflectionMethod::isProtected - Checks if method is protected // * ReflectionMethod::isPublic - Checks if method is public // * ReflectionMethod::setAccessible - Set method accessibility // * ReflectionMethod::__toString - Returns the string representation of the Reflection method object // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionmethod.php // THE_REFLECTIONMETHOD_CLASS - END // // THE_REFLECTIONNAMEDTYPE_CLASS - BEGIN // The ReflectionNamedType class // // PHP_7 >= PHP_7_1_0, PHP_8 // // Introduction // // Class synopsis // [code] // class ReflectionNamedType extends ReflectionType { // // /* Methods */ // public getName(): string // public isBuiltin(): bool // // /* Inherited methods */ // public ReflectionType::allowsNull(): bool // public ReflectionType::__toString(): string // } // [/code] // // Table of Contents // * ReflectionNamedType::getName - Get the name of the type as a string // * ReflectionNamedType::isBuiltin - Checks if it is a built-in type // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionnamedtype.php // THE_REFLECTIONNAMEDTYPE_CLASS - END // // THE_REFLECTIONOBJECT_CLASS - BEGIN // The ReflectionObject class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionObject class reports information about an object. // // Class synopsis // [code] // class ReflectionObject extends ReflectionClass { // // /* Inherited constants */ // public const int ReflectionClass::IS_IMPLICIT_ABSTRACT; // public const int ReflectionClass::IS_EXPLICIT_ABSTRACT; // public const int ReflectionClass::IS_FINAL; // public const int ReflectionClass::IS_READONLY; // // /* Inherited properties */ // public string $name; // // /* Methods */ // public __construct(object $object) // // /* Inherited methods */ // public static ReflectionClass::export(mixed $argument, bool $return = false): string // public ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array // public ReflectionClass::getConstant(string $name): mixed // public ReflectionClass::getConstants(?int $filter = null): array // public ReflectionClass::getConstructor(): ?ReflectionMethod // public ReflectionClass::getDefaultProperties(): array // public ReflectionClass::getDocComment(): string|false // public ReflectionClass::getEndLine(): int|false // public ReflectionClass::getExtension(): ?ReflectionExtension // public ReflectionClass::getExtensionName(): string|false // public ReflectionClass::getFileName(): string|false // public ReflectionClass::getInterfaceNames(): array // public ReflectionClass::getInterfaces(): array // public ReflectionClass::getMethod(string $name): ReflectionMethod // public ReflectionClass::getMethods(?int $filter = null): array // public ReflectionClass::getModifiers(): int // public ReflectionClass::getName(): string // public ReflectionClass::getNamespaceName(): string // public ReflectionClass::getParentClass(): ReflectionClass|false // public ReflectionClass::getProperties(?int $filter = null): array // public ReflectionClass::getProperty(string $name): ReflectionProperty // public ReflectionClass::getReflectionConstant(string $name): ReflectionClassConstant|false // public ReflectionClass::getReflectionConstants(?int $filter = null): array // public ReflectionClass::getShortName(): string // public ReflectionClass::getStartLine(): int|false // public ReflectionClass::getStaticProperties(): ?array // public ReflectionClass::getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed // public ReflectionClass::getTraitAliases(): array // public ReflectionClass::getTraitNames(): array // public ReflectionClass::getTraits(): array // public ReflectionClass::hasConstant(string $name): bool // public ReflectionClass::hasMethod(string $name): bool // public ReflectionClass::hasProperty(string $name): bool // public ReflectionClass::implementsInterface(ReflectionClass|string $interface): bool // public ReflectionClass::inNamespace(): bool // public ReflectionClass::isAbstract(): bool // public ReflectionClass::isAnonymous(): bool // public ReflectionClass::isCloneable(): bool // public ReflectionClass::isEnum(): bool // public ReflectionClass::isFinal(): bool // public ReflectionClass::isInstance(object $object): bool // public ReflectionClass::isInstantiable(): bool // public ReflectionClass::isInterface(): bool // public ReflectionClass::isInternal(): bool // public ReflectionClass::isIterable(): bool // public ReflectionClass::isReadOnly(): bool // public ReflectionClass::isSubclassOf(ReflectionClass|string $class): bool // public ReflectionClass::isTrait(): bool // public ReflectionClass::isUserDefined(): bool // public ReflectionClass::newInstance(mixed ...$args): object // public ReflectionClass::newInstanceArgs(array $args = []): ?object // public ReflectionClass::newInstanceWithoutConstructor(): object // public ReflectionClass::setStaticPropertyValue(string $name, mixed $value): void // public ReflectionClass::__toString(): string // } // [/code] // // Changelog // Version - Description // 8.0.0 - ReflectionObject::export() was removed. // // Table of Contents // * ReflectionObject::__construct - Constructs a ReflectionObject // * ReflectionObject::export - Export // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionobject.php // THE_REFLECTIONOBJECT_CLASS - END // // THE_REFLECTIONPARAMETER_CLASS - BEGIN // The ReflectionParameter class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionParameter class retrieves information about function's or method's parameters. // To introspect function parameters, first create an instance of the ReflectionFunction or ReflectionMethod classes and then use their ReflectionFunctionAbstract::getParameters() method to retrieve an array of parameters. // // Class synopsis // [code] // class ReflectionParameter implements Reflector { // // /* Properties */ // public string $name; // // /* Methods */ // public __construct(string|array|object $function, int|string $param) // public allowsNull(): bool // public canBePassedByValue(): bool // private __clone(): void // public static export(string $function, string $parameter, bool $return = ?): string // public getAttributes(?string $name = null, int $flags = 0): array // public getClass(): ?ReflectionClass // public getDeclaringClass(): ?ReflectionClass // public getDeclaringFunction(): ReflectionFunctionAbstract // public getDefaultValue(): mixed // public getDefaultValueConstantName(): ?string // public getName(): string // public getPosition(): int // public getType(): ?ReflectionType // public hasType(): bool // public isArray(): bool // public isCallable(): bool // public isDefaultValueAvailable(): bool // public isDefaultValueConstant(): bool // public isOptional(): bool // public isPassedByReference(): bool // public isVariadic(): bool // public __toString(): string // } // [/code] // // Properties // name - Name of the parameter. Read-only, throws ReflectionException in attempt to write. // // Changelog // Version - Description // 8.0.0 - ReflectionParameter::export() was removed. // // Table of Contents // * ReflectionParameter::allowsNull - Checks if null is allowed // * ReflectionParameter::canBePassedByValue - Returns whether this parameter can be passed by value // * ReflectionParameter::__clone - Clone // * ReflectionParameter::__construct - Construct // * ReflectionParameter::export - Exports // * ReflectionParameter::getAttributes - Gets Attributes // * ReflectionParameter::getClass - Get a ReflectionClass object for the parameter being reflected or null // * ReflectionParameter::getDeclaringClass - Gets declaring class // * ReflectionParameter::getDeclaringFunction - Gets declaring function // * ReflectionParameter::getDefaultValue - Gets default parameter value // * ReflectionParameter::getDefaultValueConstantName - Returns the default value's constant name if default value is constant or null // * ReflectionParameter::getName - Gets parameter name // * ReflectionParameter::getPosition - Gets parameter position // * ReflectionParameter::getType - Gets a parameter's type // * ReflectionParameter::hasType - Checks if parameter has a type // * ReflectionParameter::isArray - Checks if parameter expects an array // * ReflectionParameter::isCallable - Returns whether parameter MUST be callable // * ReflectionParameter::isDefaultValueAvailable - Checks if a default value is available // * ReflectionParameter::isDefaultValueConstant - Returns whether the default value of this parameter is a constant // * ReflectionParameter::isOptional - Checks if optional // * ReflectionParameter::isPassedByReference - Checks if passed by reference // * ReflectionParameter::isVariadic - Checks if the parameter is variadic // * ReflectionParameter::__toString - To string // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionparameter.php // THE_REFLECTIONPARAMETER_CLASS - END // // THE_REFLECTIONPROPERTY_CLASS - BEGIN // The ReflectionProperty class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionProperty class reports information about class properties. // // Class synopsis // [code] // class ReflectionProperty implements Reflector { // // /* Constants */ // public const int IS_STATIC; // public const int IS_READONLY; // public const int IS_PUBLIC; // public const int IS_PROTECTED; // public const int IS_PRIVATE; // // /* Properties */ // public string $name; // public string $class; // // /* Methods */ // public __construct(object|string $class, string $property) // private __clone(): void // public static export(mixed $class, string $name, bool $return = ?): string // public getAttributes(?string $name = null, int $flags = 0): array // public getDeclaringClass(): ReflectionClass // public getDefaultValue(): mixed // public getDocComment(): string|false // public getModifiers(): int // public getName(): string // public getType(): ?ReflectionType // public getValue(?object $object = null): mixed // public hasDefaultValue(): bool // public hasType(): bool // public isDefault(): bool // public isInitialized(?object $object = null): bool // public isPrivate(): bool // public isPromoted(): bool // public isProtected(): bool // public isPublic(): bool // public isReadOnly(): bool // public isStatic(): bool // public setAccessible(bool $accessible): void // public setValue(object $object, mixed $value): void // public __toString(): string // } // [/code] // // Properties // name - Name of the property. Read-only, throws ReflectionException in attempt to write. // class - Name of the class where the property is defined. Read-only, throws ReflectionException in attempt to write. // // Predefined Constants // // ReflectionProperty Modifiers // ReflectionProperty::IS_STATIC - Indicates static properties. Prior to PHP 7.4.0, the value was 1. // ReflectionProperty::IS_READONLY - Indicates readonly properties. Available as of PHP 8.1.0. // ReflectionProperty::IS_PUBLIC - Indicates public properties. Prior to PHP 7.4.0, the value was 256. // ReflectionProperty::IS_PROTECTED - Indicates protected properties. Prior to PHP 7.4.0, the value was 512. // ReflectionProperty::IS_PRIVATE - Indicates private properties. Prior to PHP 7.4.0, the value was 1024. // 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 // Version - Description // 8.0.0 - ReflectionProperty::export() was removed. // // Table of Contents // * ReflectionProperty::__clone - Clone // * ReflectionProperty::__construct - Construct a ReflectionProperty object // * ReflectionProperty::export - Export // * ReflectionProperty::getAttributes - Gets Attributes // * ReflectionProperty::getDeclaringClass - Gets declaring class // * ReflectionProperty::getDefaultValue - Returns the default value declared for a property // * ReflectionProperty::getDocComment - Gets the property doc comment // * ReflectionProperty::getModifiers - Gets the property modifiers // * ReflectionProperty::getName - Gets property name // * ReflectionProperty::getType - Gets a property's type // * ReflectionProperty::getValue - Gets value // * ReflectionProperty::hasDefaultValue - Checks if property has a default value declared // * ReflectionProperty::hasType - Checks if property has a type // * ReflectionProperty::isDefault - Checks if property is a default property // * ReflectionProperty::isInitialized - Checks whether a property is initialized // * ReflectionProperty::isPrivate - Checks if property is private // * ReflectionProperty::isPromoted - Checks if property is promoted // * ReflectionProperty::isProtected - Checks if property is protected // * ReflectionProperty::isPublic - Checks if property is public // * ReflectionProperty::isReadOnly - Checks if property is readonly // * ReflectionProperty::isStatic - Checks if property is static // * ReflectionProperty::setAccessible - Set property accessibility // * ReflectionProperty::setValue - Set property value // * ReflectionProperty::__toString - To string // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionproperty.php // THE_REFLECTIONPROPERTY_CLASS - END // // THE_REFLECTIONTYPE_CLASS - BEGIN // The ReflectionType class // // PHP_7, PHP_8 // // Introduction // The ReflectionType class reports information about a function's parameter/return type or a class's property type. The Reflection extension declares the following subtypes: // * ReflectionNamedType (as of PHP 7.1.0) // * ReflectionUnionType (as of PHP 8.0.0) // * ReflectionIntersectionType (as of PHP 8.1.0) // // Class synopsis // [code] // abstract class ReflectionType implements Stringable { // // /* Methods */ // public allowsNull(): bool // public __toString(): string // } // [/code] // // Changelog // Version - Description // 8.0.0 - ReflectionType has become abstract and ReflectionType::isBuiltin() has been moved to ReflectionNamedType::isBuiltin(). // // Table of Contents // * ReflectionType::allowsNull - Checks if null is allowed // * ReflectionType::__toString - To string // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectiontype.php // THE_REFLECTIONTYPE_CLASS - END // // THE_REFLECTIONUNIONTYPE_CLASS - BEGIN // The ReflectionUnionType class // // PHP_8 // // Introduction // // Class synopsis // [code] // class ReflectionUnionType extends ReflectionType { // // /* Methods */ // public getTypes(): array // // /* Inherited methods */ // public ReflectionType::allowsNull(): bool // public ReflectionType::__toString(): string // } // [/code] // // Table of Contents // * ReflectionUnionType::getTypes - Returns the types included in the union type // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionuniontype.php // THE_REFLECTIONUNIONTYPE_CLASS - END // // THE_REFLECTIONGENERATOR_CLASS - BEGIN // The ReflectionGenerator class // // PHP_7, PHP_8 // // Introduction // The ReflectionGenerator class reports information about a generator. // // Class synopsis // [code] // final class ReflectionGenerator { // // /* Methods */ // public __construct(Generator $generator) // public getExecutingFile(): string // public getExecutingGenerator(): Generator // public getExecutingLine(): int // public getFunction(): ReflectionFunctionAbstract // public getThis(): ?object // public getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array // } // [/code] // // Changelog // Version - Description // 8.0.0 - The class is final now. // // Table of Contents // * ReflectionGenerator::__construct - Constructs a ReflectionGenerator object // * ReflectionGenerator::getExecutingFile - Gets the file name of the currently executing generator // * ReflectionGenerator::getExecutingGenerator - Gets the executing Generator object // * ReflectionGenerator::getExecutingLine - Gets the currently executing line of the generator // * ReflectionGenerator::getFunction - Gets the function name of the generator // * ReflectionGenerator::getThis - Gets the $this value of the generator // * ReflectionGenerator::getTrace - Gets the trace of the executing generator // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectiongenerator.php // THE_REFLECTIONGENERATOR_CLASS - END // // THE_REFLECTIONFIBER_CLASS - BEGIN // The ReflectionFiber class // // PHP_8 >= PHP_8_1_0 // // Introduction // // Class synopsis // [code] // final class ReflectionFiber { // // /* Methods */ // public __construct(Fiber $fiber) // public getCallable(): callable // public getExecutingFile(): string // public getExecutingLine(): int // public getFiber(): Fiber // public getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array // } // [/code] // // Table of Contents // * ReflectionFiber::__construct - Constructs a ReflectionFiber object // * ReflectionFiber::getCallable - Gets the callable used to create the Fiber // * ReflectionFiber::getExecutingFile - Get the file name of the current execution point // * ReflectionFiber::getExecutingLine - Get the line number of the current execution point // * ReflectionFiber::getFiber - Get the reflected Fiber instance // * ReflectionFiber::getTrace - Get the backtrace of the current execution point // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionfiber.php // THE_REFLECTIONFIBER_CLASS - END // // THE_REFLECTIONINTERSECTIONTYPE_CLASS - BEGIN // The ReflectionIntersectionType class // // PHP_8 >= PHP_8_1_0 // // Introduction // // Class synopsis // [code] // class ReflectionIntersectionType extends ReflectionType { // // /* Methods */ // public getTypes(): array // // /* Inherited methods */ // public ReflectionType::allowsNull(): bool // public ReflectionType::__toString(): string // } // [/code] // // Table of Contents // * ReflectionIntersectionType::getTypes - Returns the types included in the intersection type // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionintersectiontype.php // THE_REFLECTIONINTERSECTIONTYPE_CLASS - END // // THE_REFLECTIONREFERENCE_CLASS - BEGIN // The ReflectionReference class // // PHP_7 >= PHP_7_4_0, PHP_8 // // Introduction // The ReflectionReference class provides information about a reference. // // Class synopsis // [code] // final class ReflectionReference { // // /* Methods */ // private __construct() // public static fromArrayElement(array $array, int|string $key): ?ReflectionReference // public getId(): string // } // [/code] // // Table of Contents // * ReflectionReference::__construct - Private constructor to disallow direct instantiation // * ReflectionReference::fromArrayElement - Create a ReflectionReference from an array element // * ReflectionReference::getId - Get unique ID of a reference // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionreference.php // THE_REFLECTIONREFERENCE_CLASS - END // // THE_REFLECTIONATTRIBUTE_CLASS - BEGIN // The ReflectionAttribute class // // PHP_8 // // Introduction // The ReflectionAttribute class provides information about an Attribute. // // Class synopsis // [code] // class ReflectionAttribute implements Reflector { // // /* Constants */ // public const int IS_INSTANCEOF; // // /* Methods */ // private __construct() // public getArguments(): array // public getName(): string // public getTarget(): int // public isRepeated(): bool // public newInstance(): object // } // [/code] // // Predefined Constants // // ReflectionAttribute Flags // ReflectionAttribute::IS_INSTANCEOF - Retrieve attributes using an instanceof check. // 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. // // Table of Contents // * ReflectionAttribute::__construct - Private constructor to disallow direct instantiation // * ReflectionAttribute::getArguments - Gets arguments passed to attribute // * ReflectionAttribute::getName - Gets attribute name // * ReflectionAttribute::getTarget - Returns the target of the attribute as bitmask // * ReflectionAttribute::isRepeated - Returns whether the attribute of this name has been repeated on a code element // * ReflectionAttribute::newInstance - Instantiates the attribute class represented by this ReflectionAttribute class and arguments // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionattribute.php // THE_REFLECTIONATTRIBUTE_CLASS - END // // THE_REFLECTOR_INTERFACE - BEGIN // The Reflector interface // // REFLECTOR_EXPORT // // PHP_5, PHP_7, PHP_8 // // Introduction // Reflector is an interface implemented by all exportable Reflection classes. // // Interface synopsis // [code] // interface Reflector extends Stringable { // // /* Inherited methods */ // public Stringable::__toString(): string // } // [/code] // // Changelog // Version - Description // 8.0.0 - Reflector::export() was removed. // 8.0.0 - Reflector extends Stringable now. It inherits Stringable::__toString(), replacing Reflector::__toString(). // // See Also // * Reflector::export() // // Table of Contents // * Reflector::export - Exports // // REFLECTOR_EXPORT - BEGIN // Reflector::export // // ===== ABOUT // Exports // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static Reflector::export(): string // ===== CODE // This function has no parameters. // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflector.export.php // REFLECTOR_EXPORT - END // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflector.php // THE_REFLECTOR_INTERFACE - END // // THE_REFLECTIONEXCEPTION_CLASS - BEGIN // The ReflectionException class // // PHP_5, PHP_7, PHP_8 // // Introduction // The ReflectionException class. // // Class synopsis // [code] // class ReflectionException extends Exception { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/class.reflectionexception.php // THE_REFLECTIONEXCEPTION_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/book.reflection.php // REFLECTION - END // // ENUMERATIONS - BEGIN // Enumerations (PHP Manual / Language Reference / Enumerations) // // ENUMERATIONS_OVERVIEW // BASIC_ENUMERATIONS // BACKED_ENUMERATIONS // ENUMERATION_METHODS // ENUMERATION_STATIC_METHODS // ENUMERATION_CONSTANTS // TRAITS // ENUM_VALUES_IN_CONSTANT_EXPRESSIONS // DIFFERENCES_FROM_OBJECTS // VALUE_LISTING // SERIALIZATION // WHY_ENUMS_ARENT_EXTENDABLE // EXAMPLES // // ENUMERATIONS_OVERVIEW - BEGIN // Enumerations overview // // PHP_8 >= PHP_8_1_0 // // Enumerations, or "Enums" allow a developer to define a custom type that is limited to one of a discrete number of possible values. That can be especially helpful when defining a domain model, as it enables "making invalid states unrepresentable." // Enums appear in many languages with a variety of different features. In PHP, Enums are a special kind of object. The Enum itself is a class, and its possible cases are all single-instance objects of that class. That means Enum cases are valid objects and may be used anywhere an object may be used, including type checks. // The most popular example of enumerations is the built-in boolean type, which is an enumerated type with legal values true and false. Enums allows developers to define their own arbitrarily robust enumerations. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.overview.php // ENUMERATIONS_OVERVIEW - END // // BASIC_ENUMERATIONS - BEGIN // Basic enumerations // // Enums are similar to classes, and share the same namespaces as classes, interfaces, and traits. They are also autoloadable the same way. An Enum defines a new type, which has a fixed, limited number of possible legal values. // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // [/php] // This declaration creates a new enumerated type named Suit, which has four and only four legal values: Suit::Hearts, Suit::Diamonds, Suit::Clubs, and Suit::Spades. Variables may be assigned to one of those legal values. A function may be type checked against an enumerated type, in which case only values of that type may be passed. // [php] // function pick_a_card(Suit $suit) { ... } // // $val = Suit::Diamonds; // // // OK // pick_a_card($val); // // OK // pick_a_card(Suit::Clubs); // // TypeError: pick_a_card(): Argument #1 ($suit) must be of type Suit, string given // pick_a_card('Spades'); // [/php] // An Enumeration may have zero or more case definitions, with no maximum. A zero-case enum is syntactically valid, if rather useless. // For Enumeration cases, the same syntax rules apply as to any label in PHP, see Constants. // By default, cases are not intrinsically backed by a scalar value. That is, Suit::Hearts is not equal to "0". Instead, each case is backed by a singleton object of that name. That means that: // [php] // $a = Suit::Spades; // $b = Suit::Spades; // // $a === $b; // true // // $a instanceof Suit; // true // [/php] // It also means that enum values are never < or > each other, since those comparisons are not meaningful on objects. Those comparisons will always return false when working with enum values. // This type of case, with no related data, is called a "Pure Case." An Enum that contains only Pure Cases is called a Pure Enum. // All Pure Cases are implemented as instances of their enum type. The enum type is represented internally as a class. // All Cases have a read-only property, name, that is the case-sensitive name of the case itself. // [php] // print Suit::Spades->name; // // prints "Spades" // [/php] // It is also possible to use the defined() and constant() functions to check for the existence of or read an enum case if the name is obtained dynamically. This is, however, discouraged as using Backed enums should work for most use cases. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.basics.php // BASIC_ENUMERATIONS - END // // BACKED_ENUMERATIONS - BEGIN // Backed enumerations // // By default, Enumerated Cases have no scalar equivalent. They are simply singleton objects. However, there are ample cases where an Enumerated Case needs to be able to round-trip to a database or similar datastore, so having a built-in scalar (and thus trivially serializable) equivalent defined intrinsically is useful. // To define a scalar equivalent for an Enumeration, the syntax is as follows: // [php] // enum Suit: string // { // case Hearts = 'H'; // case Diamonds = 'D'; // case Clubs = 'C'; // case Spades = 'S'; // } // [/php] // A case that has a scalar equivalent is called a Backed Case, as it is "Backed" by a simpler value. An Enum that contains all Backed Cases is called a "Backed Enum." A Backed Enum may contain only Backed Cases. A Pure Enum may contain only Pure Cases. // A Backed Enum may be backed by types of int or string, and a given enumeration supports only a single type at a time (that is, no union of int|string). If an enumeration is marked as having a scalar equivalent, then all cases must have a unique scalar equivalent defined explicitly. There are no auto-generated scalar equivalents (e.g., sequential integers). Backed cases must be unique; two backed enum cases may not have the same scalar equivalent. However, a constant may refer to a case, effectively creating an alias. See Enumeration constants. // Equivalent values must be literals or literal expressions. Constants and constant expressions are not supported. That is, 1 + 1 is allowed, but 1 + SOME_CONST is not. // Backed Cases have an additional read-only property, value, which is the value specified in the definition. // [php] // print Suit::Clubs->value; // // Prints "C" // [/php] // In order to enforce the value property as read-only, a variable cannot be assigned as a reference to it. That is, the following throws an error: // [php] // $suit = Suit::Clubs; // $ref = &$suit->value; // // Error: Cannot acquire reference to property Suit::$value // [/php] // Backed enums implement an internal BackedEnum interface, which exposes two additional methods: // * from(int|string): self will take a scalar and return the corresponding Enum Case. If one is not found, it will throw a ValueError. This is mainly useful in cases where the input scalar is trusted and a missing enum value should be considered an application-stopping error. // * tryFrom(int|string): ?self will take a scalar and return the corresponding Enum Case. If one is not found, it will return null. This is mainly useful in cases where the input scalar is untrusted and the caller wants to implement their own error handling or default-value logic. // The from() and tryFrom() methods follow standard weak/strong typing rules. In weak typing mode, passing an integer or string is acceptable and the system will coerce the value accordingly. Passing a float will also work and be coerced. In strict typing mode, passing an integer to from() on a string-backed enum (or vice versa) will result in a TypeError, as will a float in all circumstances. All other parameter types will throw a TypeError in both modes. // [php] // $record = get_stuff_from_database($id); // print $record['suit']; // // $suit = Suit::from($record['suit']); // // Invalid data throws a ValueError: "X" is not a valid scalar value for enum "Suit" // print $suit->value; // // $suit = Suit::tryFrom('A') ?? Suit::Spades; // // Invalid data returns null, so Suit::Spades is used instead. // print $suit->value; // [/php] // Manually defining a from() or tryFrom() method on a Backed Enum will result in a fatal error. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.backed.php // BACKED_ENUMERATIONS - END // // ENUMERATION_METHODS - BEGIN // Enumeration methods // // Enums (both Pure Enums and Backed Enums) may contain methods, and may implement interfaces. If an Enum implements an interface, then any type check for that interface will also accept all cases of that Enum. // [php] // interface Colorful // { // public function color(): string; // } // // enum Suit implements Colorful // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // // // Fulfills the interface contract. // public function color(): string // { // return match($this) { // Suit::Hearts, Suit::Diamonds => 'Red', // Suit::Clubs, Suit::Spades => 'Black', // }; // } // // // Not part of an interface; that's fine. // public function shape(): string // { // return "Rectangle"; // } // } // // function paint(Colorful $c) { ... } // // paint(Suit::Clubs); // Works // // print Suit::Diamonds->shape(); // prints "Rectangle" // [/php] // In this example, all four instances of Suit have two methods, color() and shape(). As far as calling code and type checks are concerned, they behave exactly the same as any other object instance. // On a Backed Enum, the interface declaration goes after the backing type declaration. // [php] // interface Colorful // { // public function color(): string; // } // // enum Suit: string implements Colorful // { // case Hearts = 'H'; // case Diamonds = 'D'; // case Clubs = 'C'; // case Spades = 'S'; // // // Fulfills the interface contract. // public function color(): string // { // return match($this) { // Suit::Hearts, Suit::Diamonds => 'Red', // Suit::Clubs, Suit::Spades => 'Black', // }; // } // } // [/php] // Inside a method, the $this variable is defined and refers to the Case instance. // Methods may be arbitrarily complex, but in practice will usually return a static value or match on $this to provide different results for different cases. // Note that in this case it would be a better data modeling practice to also define a SuitColor Enum Type with values Red and Black and return that instead. However, that would complicate this example. // The above hierarchy is logically similar to the following class structure (although this is not the actual code that runs): // [php] // interface Colorful // { // public function color(): string; // } // // final class Suit implements UnitEnum, Colorful // { // public const Hearts = new self('Hearts'); // public const Diamonds = new self('Diamonds'); // public const Clubs = new self('Clubs'); // public const Spades = new self('Spades'); // // private function __construct(public readonly string $name) {} // // public function color(): string // { // return match($this) { // Suit::Hearts, Suit::Diamonds => 'Red', // Suit::Clubs, Suit::Spades => 'Black', // }; // } // // public function shape(): string // { // return "Rectangle"; // } // // public static function cases(): array // { // // Illegal method, because manually defining a cases() method on an Enum is disallowed. // // See also "Value listing" section. // } // } // [/php] // Methods may be public, private, or protected, although in practice private and protected are equivalent as inheritance is not allowed. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.methods.php // ENUMERATION_METHODS - END // // ENUMERATION_STATIC_METHODS - BEGIN // Enumeration static methods // // Enumerations may also have static methods. The use for static methods on the enumeration itself is primarily for alternative constructors. E.g.: // [php] // enum Size // { // case Small; // case Medium; // case Large; // // public static function fromLength(int $cm): static // { // return match(true) { // $cm < 50 => static::Small, // $cm < 100 => static::Medium, // default => static::Large, // }; // } // } // [/php] // Static methods may be public, private, or protected, although in practice private and protected are equivalent as inheritance is not allowed. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.static-methods.php // ENUMERATION_STATIC_METHODS - END // // ENUMERATION_CONSTANTS - BEGIN // Enumeration constants // // Enumerations may include constants, which may be public, private, or protected, although in practice private and protected are equivalent as inheritance is not allowed. // An enum constant may refer to an enum case: // [php] // enum Size // { // case Small; // case Medium; // case Large; // // public const Huge = self::Large; // } // [/php] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.constants.php // ENUMERATION_CONSTANTS - END // // TRAITS - BEGIN // Traits // // Enumerations may leverage traits, which will behave the same as on classes. The caveat is that traits used in an enum must not contain properties. They may only include methods and static methods. A trait with properties will result in a fatal error. // [php] // interface Colorful // { // public function color(): string; // } // // trait Rectangle // { // public function shape(): string { // return "Rectangle"; // } // } // // enum Suit implements Colorful // { // use Rectangle; // // case Hearts; // case Diamonds; // case Clubs; // case Spades; // // public function color(): string // { // return match($this) { // Suit::Hearts, Suit::Diamonds => 'Red', // Suit::Clubs, Suit::Spades => 'Black', // }; // } // } // [/php] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.traits.php // TRAITS - END // // ENUM_VALUES_IN_CONSTANT_EXPRESSIONS - BEGIN // Enum values in constant expressions // // Because cases are represented as constants on the enum itself, they may be used as static values in most constant expressions: property defaults, static variable defaults, parameter defaults, global and class constant values. They may not be used in other enum case values, but normal constants may refer to an enum case. // However, implicit magic method calls such as ArrayAccess on enums are not allowed in static or constant definitions as we cannot absolutely guarantee that the resulting value is deterministic or that the method invocation is free of side effects. Function calls, method calls, and property access continue to be invalid operations in constant expressions. // [php] // // This is an entirely legal Enum definition. // enum Direction implements ArrayAccess // { // case Up; // case Down; // // public function offsetGet($val) { ... } // public function offsetExists($val) { ... } // public function offsetSet($val) { throw new Exception(); } // public function offsetUnset($val) { throw new Exception(); } // } // // class Foo // { // // This is allowed. // const Bar = Direction::Down; // // // This is disallowed, as it may not be deterministic. // const Bar = Direction::Up['short']; // // Fatal error: Cannot use [] on enums in constant expression // } // // // This is entirely legal, because it's not a constant expression. // $x = Direction::Up['short']; // [/php] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.expressions.php // ENUM_VALUES_IN_CONSTANT_EXPRESSIONS - END // // DIFFERENCES_FROM_OBJECTS - BEGIN // Differences from objects // // Although Enums are built on classes and objects, they do not support all object-related functionality. In particular, Enum cases are forbidden from having state. // * Constructors and Destructors are forbidden. // * Inheritance is not supported. Enums may not extend or be extended. // * Static or object properties are not allowed. // * Cloning an Enum case is not supported, as cases must be singleton instances. // * Magic methods, except for those listed below, are disallowed. // * Enums must always be declared before they are used. // The following object functionality is available, and behaves just as it does on any other object: // * Public, private, and protected methods. // * Public, private, and protected static methods. // * Public, private, and protected constants. // * Enums may implement any number of interfaces. // * Enums and cases may have attributes attached to them. The TARGET_CLASS target filter includes Enums themselves. The TARGET_CLASS_CONST target filter includes Enum Cases. // * __call, __callStatic, and __invoke magic methods // * __CLASS__ and __FUNCTION__ constants behave as normal // The ::class magic constant on an Enum type evaluates to the type name including any namespace, exactly the same as an object. The ::class magic constant on a Case instance also evaluates to the Enum type, as it is an instance of that type. // Additionally, enum cases may not be instantiated directly with new, nor with ReflectionClass::newInstanceWithoutConstructor() in reflection. Both will result in an error. // [php] // $clovers = new Suit(); // // Error: Cannot instantiate enum Suit // $horseshoes = (new ReflectionClass(Suit::class))->newInstanceWithoutConstructor() // // Error: Cannot instantiate enum Suit // [/php] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.object-differences.php // DIFFERENCES_FROM_OBJECTS - END // // VALUE_LISTING - BEGIN // Value listing // // Both Pure Enums and Backed Enums implement an internal interface named UnitEnum. UnitEnum includes a static method cases(). cases() returns a packed array of all defined Cases in the order of declaration. // [php] // Suit::cases(); // // Produces: [Suit::Hearts, Suit::Diamonds, Suit::Clubs, Suit::Spades] // [/php] // Manually defining a cases() method on an Enum will result in a fatal error. // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/language.enumerations.listing.php // VALUE_LISTING - END // // SERIALIZATION - BEGIN // Serialization // // Enumerations are serialized differently from objects. Specifically, they have a new serialization code, "E", that specifies the name of the enum case. The deserialization routine is then able to use that to set a variable to the existing singleton value. That ensures that: // [php] // // Suit::Hearts === unserialize(serialize(Suit::Hearts)); // // print serialize(Suit::Hearts); // // E:11:"Suit:Hearts"; // [/php] // On deserialization, if an enum and case cannot be found to match a serialized value a warning will be issued and false returned. // If a Pure Enum is serialized to JSON, an error will be thrown. If a Backed Enum is serialized to JSON, it will be represented by its scalar value only, in the appropriate type. The behavior of both may be overridden by implementing JsonSerializable. // For print_r(), the output of an enum case is slightly different from objects to minimize confusion. // [php] // enum Foo { // case Bar; // } // // enum Baz: int { // case Beep = 5; // } // // print_r(Foo::Bar); // print_r(Baz::Beep); // // /* Produces // // Foo Enum ( // [name] => Bar // ) // Baz Enum:int { // [name] => Beep // [value] => 5 // } // */ // [/php] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.serialization.php // SERIALIZATION - END // // WHY_ENUMS_ARENT_EXTENDABLE - BEGIN // Why enums aren't extendable // // Classes have contracts on their methods: // [php] // // class A {} // class B extends A {} // // function foo(A $a) {} // // function bar(B $b) { // foo($b); // } // [/php] // This code is type-safe, as B follows the contract of A, and through the magic of co/contra-variance, any expectation one may have of the methods will be preserved, exceptions excepted. // Enums have contracts on their cases, not methods: // [php] // enum ErrorCode { // case SOMETHING_BROKE; // } // // function quux(ErrorCode $errorCode) // { // // When written, this code appears to cover all cases // match ($errorCode) { // ErrorCode::SOMETHING_BROKE => true, // } // } // // [/php] // The match statement in the function quux can be static analyzed to cover all of the cases in ErrorCode. // But imagine it was allowed to extend enums: // [php] // // Thought experiment code where enums are not final. // // Note, this won't actually work in PHP. // enum MoreErrorCode extends ErrorCode { // case PEBKAC; // } // // function fot(MoreErrorCode $errorCode) { // quux($errorCode); // } // // fot(MoreErrorCode::PEBKAC); // // [/php] // Under normal inheritance rules, a class that extends another will pass the type check. // The problem would be that the match statement in quux() no longer covers all the cases. Because it doesn't know about MoreErrorCode::PEBKAC the match will throw an exception. // Because of this enums are final and can't be extended. // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.object-differences.inheritance.php // WHY_ENUMS_ARENT_EXTENDABLE - END // // EXAMPLES - BEGIN // Examples // // [example] // Example #1 Basic limited values // [php] // // enum SortOrder // { // case Asc; // case Desc; // } // // function query($fields, $filter, SortOrder $order = SortOrder::Asc) { ... } // [/php] // [/example] // The query() function can now proceed safe in the knowledge that $order is guaranteed to be either SortOrder::Asc or SortOrder::Desc. Any other value would have resulted in a TypeError, so no further error checking or testing is needed. // [example] // Example #2 Advanced exclusive values // [php] // // enum UserStatus: string // { // case Pending = 'P'; // case Active = 'A'; // case Suspended = 'S'; // case CanceledByUser = 'C'; // // public function label(): string // { // return match($this) { // static::Pending => 'Pending', // static::Active => 'Active', // static::Suspended => 'Suspended', // static::CanceledByUser => 'Canceled by user', // }; // } // } // [/php] // [/example] // In this example, a user's status may be one of, and exclusively, UserStatus::Pending, UserStatus::Active, UserStatus::Suspended, or UserStatus::CanceledByUser. A function can type a parameter against UserStatus and then only accept those four values, period. // All four values have a label() method, which returns a human-readable string. That string is independent of the "machine name" scalar equivalent string, which can be used in, for example, a database field or an HTML select box. // [example] // [php] // // foreach (UserStatus::cases() as $case) { // printf('\n', $case->value, $case->label()); // } // [/php] // [/example] // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.examples.php // EXAMPLES - END // // LITERATURE_SOURCES // * PHP_NET (2023-11-07) // URL: https://www.php.net/manual/en/language.enumerations.php // ENUMERATIONS - END // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTION // ============================== PUBLIC // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTION_EXPORT - string php_variable_reflection_reflection_export(Reflection $reflection, Reflector $reflector, bool $return = false) // PHP_VARIABLE_REFLECTION_REFLECTION_GETMODIFIERNAMES - array php_variable_reflection_reflection_getmodifiernames(Reflection $reflection, int $modifiers) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // OFFLINE | Reflection::export() - PHP_5, PHP_7 // Reflection::getModifierNames() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // string // Reflection - PHP_5, PHP_7, PHP_8 // Reflector - PHP_5, PHP_7, PHP_8 // bool // array // int // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTION_EXPORT // ============================== OFFLINE // ============================== ABOUT // Exports. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // Reflection::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflection_export($reflection, $reflector, $return = false) { $return_reflection_export = null; // ========== REFLECTION_EXPORT - BEGIN // ===== ABOUT // Exports // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflection. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static Reflection::export(Reflector $reflector, bool $return = false): string // ===== CODE $return_reflection_export = $reflection->export( $reflector, // Reflector reflector - The reflection to export. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflection.export.php // ========== REFLECTION_EXPORT - END // SYNTAX: // string Reflection::export(Reflector $reflector, bool $return = false) return $return_reflection_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTION_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTION_GETMODIFIERNAMES // ============================== PUBLIC // ============================== ABOUT // Gets modifier names. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // Reflection::getModifierNames() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflection_getmodifiernames($reflection, $modifiers) { $return_reflection_getmodifiernames = null; // ========== REFLECTION_GETMODIFIERNAMES - BEGIN // ===== ABOUT // Gets modifier names // ===== DESCRIPTION // Gets modifier names. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public static Reflection::getModifierNames(int $modifiers): array // ===== CODE $return_reflection_getmodifiernames = $reflection->getModifierNames( $modifiers // int modifiers - Bitfield of the modifiers to get. ); // Return Values // An array of modifier names. // // [examples] // Examples // [example] // Example #1 Reflection::getModifierNames() example // [php] // class Testing // { // final public static function foo() // { // return; // } // // public function bar() // { // return; // } // } // // $foo = new ReflectionMethod('Testing', 'foo'); // // echo "Modifiers for method foo():\n"; // echo $foo->getModifiers() . "\n"; // echo implode(' ', Reflection::getModifierNames($foo->getModifiers())) . "\n"; // // $bar = new ReflectionMethod('Testing', 'bar'); // // echo "Modifiers for method bar():\n"; // echo $bar->getModifiers() . "\n"; // echo implode(' ', Reflection::getModifierNames($bar->getModifiers())); // [/php] // The above example will output something similar to: // [result] // Modifiers for method foo(): // 261 // final public static // Modifiers for method bar(): // 65792 // public // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflection.getmodifiernames.php // ========== REFLECTION_GETMODIFIERNAMES - END // SYNTAX: // array Reflection::getModifierNames(int $modifiers) return $return_reflection_getmodifiernames; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTION_GETMODIFIERNAMES // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_CONSTRUCT - ReflectionClass php_variable_reflection_reflectionclass_construct(object|string $objectOrClass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_EXPORT - string php_variable_reflection_reflectionclass_export(ReflectionClass $reflectionclass, mixed $argument, bool $return = false) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETATTRIBUTES - array php_variable_reflection_reflectionclass_getattributes(ReflectionClass $reflectionclass, string $name = null, int $flags = 0) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANT - mixed php_variable_reflection_reflectionclass_getconstant(ReflectionClass $reflectionclass, string $name) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANTS - array php_variable_reflection_reflectionclass_getconstants(ReflectionClass $reflectionclass, int $filter = null) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTRUCTOR - ReflectionMethod php_variable_reflection_reflectionclass_getconstructor(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDEFAULTPROPERTIES - array php_variable_reflection_reflectionclass_getdefaultproperties(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDOCCOMMENT - string|false php_variable_reflection_reflectionclass_getdoccomment(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETENDLINE - int|false php_variable_reflection_reflectionclass_getendline(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSION - ReflectionExtension php_variable_reflection_reflectionclass_getextension(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSIONNAME - string|false php_variable_reflection_reflectionclass_getextensionname(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETFILENAME - string|false php_variable_reflection_reflectionclass_getfilename(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACENAMES - array php_variable_reflection_reflectionclass_getinterfacenames(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACES - array php_variable_reflection_reflectionclass_getinterfaces(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHOD - ReflectionMethod php_variable_reflection_reflectionclass_getmethod(ReflectionClass $reflectionclass, string $name) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHODS - array php_variable_reflection_reflectionclass_getmethods(ReflectionClass $reflectionclass, int $filter = null) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMODIFIERS - int php_variable_reflection_reflectionclass_getmodifiers(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAME - string php_variable_reflection_reflectionclass_getname(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAMESPACENAME - string php_variable_reflection_reflectionclass_getnamespacename(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPARENTCLASS - ReflectionClass|false php_variable_reflection_reflectionclass_getparentclass(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTIES - array php_variable_reflection_reflectionclass_getproperties(ReflectionClass $reflectionclass, int $filter = null) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTY - ReflectionProperty php_variable_reflection_reflectionclass_getproperty(ReflectionClass $reflectionclass, string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANT - ReflectionClassConstant|false php_variable_reflection_reflectionclass_getreflectionconstant(ReflectionClass $reflectionclass, string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANTS - array php_variable_reflection_reflectionclass_getreflectionconstants(ReflectionClass $reflectionclass, int $filter = null) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSHORTNAME - string php_variable_reflection_reflectionclass_getshortname(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTARTLINE - int|false php_variable_reflection_reflectionclass_getstartline(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTIES - array php_variable_reflection_reflectionclass_getstaticproperties(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTYVALUE - mixed php_variable_reflection_reflectionclass_getstaticpropertyvalue(ReflectionClass $reflectionclass, string $name, mixed& $def_value) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITALIASES - array php_variable_reflection_reflectionclass_gettraitaliases(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITNAMES - array php_variable_reflection_reflectionclass_gettraitnames(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITS - array php_variable_reflection_reflectionclass_gettraits(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASCONSTANT - bool php_variable_reflection_reflectionclass_hasconstant(ReflectionClass $reflectionclass, string $name) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASMETHOD - bool php_variable_reflection_reflectionclass_hasmethod(ReflectionClass $reflectionclass, string $name) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASPROPERTY - bool php_variable_reflection_reflectionclass_hasproperty(ReflectionClass $reflectionclass, string $name) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_IMPLEMENTSINTERFACE - bool php_variable_reflection_reflectionclass_implementsinterface(ReflectionClass $reflectionclass, ReflectionClass|string $interface) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_INNAMESPACE - bool php_variable_reflection_reflectionclass_innamespace(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISABSTRACT - bool php_variable_reflection_reflectionclass_isabstract(ReflectionClass $reflectionclass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISANONYMOUS - bool php_variable_reflection_reflectionclass_isanonymous(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISCLONEABLE - bool php_variable_reflection_reflectionclass_iscloneable(ReflectionClass $reflectionclass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISENUM - bool php_variable_reflection_reflectionclass_isenum(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISFINAL - bool php_variable_reflection_reflectionclass_isfinal(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANCE - bool php_variable_reflection_reflectionclass_isinstance(ReflectionClass $reflectionclass, object $object) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANTIABLE - bool php_variable_reflection_reflectionclass_isinstantiable(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERFACE - bool php_variable_reflection_reflectionclass_isinterface(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERNAL - bool php_variable_reflection_reflectionclass_isinternal(ReflectionClass $reflectionclass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERABLE - bool php_variable_reflection_reflectionclass_isiterable(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERATEABLE - bool php_variable_reflection_reflectionclass_isiterateable(ReflectionClass $reflectionclass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISREADONLY - bool php_variable_reflection_reflectionclass_isreadonly(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISSUBCLASSOF - bool php_variable_reflection_reflectionclass_issubclassof(ReflectionClass $reflectionclass, ReflectionClass|string $class) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISTRAIT - bool php_variable_reflection_reflectionclass_istrait(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISUSERDEFINED - bool php_variable_reflection_reflectionclass_isuserdefined(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCE - object php_variable_reflection_reflectionclass_newinstance(ReflectionClass $reflectionclass, mixed $args) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEARGS - object php_variable_reflection_reflectionclass_newinstanceargs(ReflectionClass $reflectionclass, array $args = array()) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEWITHOUTCONSTRUCTOR - object php_variable_reflection_reflectionclass_newinstancewithoutconstructor(ReflectionClass $reflectionclass) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_SETSTATICPROPERTYVALUE - void php_variable_reflection_reflectionclass_setstaticpropertyvalue(ReflectionClass $reflectionclass, string $name, mixed $value) // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_TOSTRING - string php_variable_reflection_reflectionclass_tostring(ReflectionClass $reflectionclass) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (56) // ReflectionClass::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClass::export() - PHP_5, PHP_7 // OFFLINE | ReflectionClass::getAttributes() - PHP_8 // ReflectionClass::getConstant() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getConstants() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getConstructor() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getDefaultProperties() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getDocComment() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getEndLine() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getExtension() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getExtensionName() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getFileName() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getInterfaceNames() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionClass::getInterfaces() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getMethod() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getMethods() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getModifiers() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getName() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getNamespaceName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionClass::getParentClass() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getProperties() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getProperty() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClass::getReflectionConstant() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClass::getReflectionConstants() - PHP_7 >= PHP_7_1_0, PHP_8 // ReflectionClass::getShortName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionClass::getStartLine() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getStaticProperties() - PHP_5, PHP_7, PHP_8 // ReflectionClass::getStaticPropertyValue() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionClass::getTraitAliases() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionClass::getTraitNames() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionClass::getTraits() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionClass::hasConstant() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionClass::hasMethod() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionClass::hasProperty() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionClass::implementsInterface() - PHP_5, PHP_7, PHP_8 // ReflectionClass::inNamespace() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionClass::isAbstract() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClass::isAnonymous() - PHP_7, PHP_8 // ReflectionClass::isCloneable() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // OFFLINE | ReflectionClass::isEnum() - PHP_8 >= PHP_8_1_0 // ReflectionClass::isFinal() - PHP_5, PHP_7, PHP_8 // ReflectionClass::isInstance() - PHP_5, PHP_7, PHP_8 // ReflectionClass::isInstantiable() - PHP_5, PHP_7, PHP_8 // ReflectionClass::isInterface() - PHP_5, PHP_7, PHP_8 // ReflectionClass::isInternal() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClass::isIterable() - PHP_7 >= PHP_7_2_0, PHP_8 // ReflectionClass::isIterateable() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClass::isReadOnly() - PHP_8 >= PHP_8_2_0 // ReflectionClass::isSubclassOf() - PHP_5, PHP_7, PHP_8 // ReflectionClass::isTrait() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionClass::isUserDefined() - PHP_5, PHP_7, PHP_8 // ReflectionClass::newInstance() - PHP_5, PHP_7, PHP_8 // ReflectionClass::newInstanceArgs() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ReflectionClass::newInstanceWithoutConstructor() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionClass::setStaticPropertyValue() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionClass::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (13) // ReflectionClass - PHP_5, PHP_7, PHP_8 // object // string // mixed // bool // array // int // ReflectionMethod - PHP_5, PHP_7, PHP_8 // false // ReflectionExtension - PHP_5, PHP_7, PHP_8 // ReflectionProperty - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionClassConstant - PHP_7 >= PHP_7_1_0, PHP_8 // void // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionClass. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_construct($objectOrClass) { $return_reflectionclass_construct = null; // ========== REFLECTIONCLASS_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionClass // ===== DESCRIPTION // Constructs a new ReflectionClass object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::__construct(object|string $objectOrClass) // ===== CODE $return_reflectionclass_construct = new ReflectionClass( $objectOrClass // object|string objectOrClass - Either a string containing the name of the class to reflect, or an object. ); // Return // ReflectionClass // // Errors/Exceptions // Throws ReflectionException if the class to reflect does not exist. // // [examples] // Examples // [example] // Example #1 Basic usage ReflectionClass // [php] // $reflection = new ReflectionClass('Exception'); // echo $reflection; // [/php] // The above example will output something similar to: // [result] // Class [ class Exception implements Stringable, Throwable ] { // // - Constants [0] { // } // // - Static properties [0] { // } // // - Static methods [0] { // } // // - Properties [7] { // Property [ protected $message = '' ] // Property [ private string $string = '' ] // Property [ protected $code = 0 ] // Property [ protected string $file = '' ] // Property [ protected int $line = 0 ] // Property [ private array $trace = [] ] // Property [ private ?Throwable $previous = NULL ] // } // // - Methods [11] { // Method [ private method __clone ] { // // - Parameters [0] { // } // - Return [ void ] // } // // Method [ public method __construct ] { // // - Parameters [3] { // Parameter #0 [ string $message = "" ] // Parameter #1 [ int $code = 0 ] // Parameter #2 [ ?Throwable $previous = null ] // } // } // // Method [ public method __wakeup ] { // // - Parameters [0] { // } // - Tentative return [ void ] // } // // Method [ final public method getMessage ] { // // - Parameters [0] { // } // - Return [ string ] // } // // Method [ final public method getCode ] { // // - Parameters [0] { // } // } // // Method [ final public method getFile ] { // // - Parameters [0] { // } // - Return [ string ] // } // // Method [ final public method getLine ] { // // - Parameters [0] { // } // - Return [ int ] // } // // Method [ final public method getTrace ] { // // - Parameters [0] { // } // - Return [ array ] // } // // Method [ final public method getPrevious ] { // // - Parameters [0] { // } // - Return [ ?Throwable ] // } // // Method [ final public method getTraceAsString ] { // // - Parameters [0] { // } // - Return [ string ] // } // // Method [ public method __toString ] { // // - Parameters [0] { // } // - Return [ string ] // } // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.construct.php // ========== REFLECTIONCLASS_CONSTRUCT - END // SYNTAX: // ReflectionClass ReflectionClass::__construct(object|string $objectOrClass) return $return_reflectionclass_construct; // ReflectionClass } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_EXPORT // ============================== OFFLINE // ============================== ABOUT // Exports a class. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionClass::export() - PHP_5, PHP_7 // ============================== CODE function php_variable_reflection_reflectionclass_export($reflectionclass, $argument, $return = false) { $return_reflectionclass_export = null; // ========== REFLECTIONCLASS_EXPORT - BEGIN // ===== ABOUT // Exports a class // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflected class. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionClass::export(mixed $argument, bool $return = false): string // ===== CODE $return_reflectionclass_export = $reflectionclass->export( $argument, // mixed argument - The reflection to export. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::export() // [php] // class Apple { // public $var1; // public $var2 = 'Orange'; // // public function type() { // return 'Apple'; // } // } // ReflectionClass::export('Apple'); // [/php] // The above example will output something similar to: // [result] // Class [ class Apple ] { // @@ php shell code 1-8 // // - Constants [0] { // } // // - Static properties [0] { // } // // - Static methods [0] { // } // // - Properties [2] { // Property [ public $var1 ] // Property [ public $var2 ] // } // // - Methods [1] { // Method [ public method type ] { // @@ php shell code 5 - 7 // } // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclass.export.php // ========== REFLECTIONCLASS_EXPORT - END // SYNTAX: // string ReflectionClass::export(mixed $argument, bool $return = false) return $return_reflectionclass_export; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETATTRIBUTES // ============================== OFFLINE // ============================== ABOUT // Gets Attributes. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getAttributes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclass_getattributes($reflectionclass, $name = null, $flags = 0) { $return_reflectionclass_getattributes = null; // ========== REFLECTIONCLASS_GETATTRIBUTES - BEGIN // ===== ABOUT // Gets Attributes // ===== DESCRIPTION // Returns all attributes declared on this class as an array of ReflectionAttribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array // ===== CODE $return_reflectionclass_getattributes = $reflectionclass->getAttributes( $name, // string name - Filter the results to include only ReflectionAttribute instances for attributes matching this class name. $flags // int flags - Flags for determining how to filter the results, if name is provided. // Default is 0 which will only return results for attributes that are of the class name. // The only other option available, is to use ReflectionAttribute::IS_INSTANCEOF, which will instead use instanceof for filtering. ); // Return Values // Array of attributes, as a ReflectionAttribute object. // // [examples] // Examples // [example] // Example #1 Basic usage // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // #[Fruit] // #[Red] // class Apple { // } // // $class = new ReflectionClass('Apple'); // $attributes = $class->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #2 Filtering results by class name // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // #[Fruit] // #[Red] // class Apple { // } // // $class = new ReflectionClass('Apple'); // $attributes = $class->getAttributes('Fruit'); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // ) // [/result] // [/example] // [example] // Example #3 Filtering results by class name, with inheritance // [php] // interface Color { // } // // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red implements Color { // } // // #[Fruit] // #[Red] // class Apple { // } // // $class = new ReflectionClass('Apple'); // $attributes = $class->getAttributes(Color::class, ReflectionAttribute::IS_INSTANCEOF); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Red // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getattributes.php // ========== REFLECTIONCLASS_GETATTRIBUTES - END // SYNTAX: // array ReflectionClass::getAttributes(string $name = null, int $flags = 0) return $return_reflectionclass_getattributes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETATTRIBUTES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANT // ============================== PUBLIC // ============================== ABOUT // Gets defined constant. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getConstant() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getconstant($reflectionclass, $name) { $return_reflectionclass_getconstant = null; // ========== REFLECTIONCLASS_GETCONSTANT - BEGIN // ===== ABOUT // Gets defined constant // ===== DESCRIPTION // Gets the defined constant. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getConstant(string $name): mixed // ===== CODE $return_reflectionclass_getconstant = $reflectionclass->getConstant( $name // string name - The name of the class constant to get. ); // Return Values // Value of the constant with the name name. Returns false if the constant was not found in the class. // // [examples] // Examples // [example] // Example #1 Usage of ReflectionClass::getConstant() // [php] // // class Example { // const C1 = false; // const C2 = 'I am a constant'; // } // // $reflection = new ReflectionClass('Example'); // // var_dump($reflection->getConstant('C1')); // var_dump($reflection->getConstant('C2')); // var_dump($reflection->getConstant('C3')); // [/php] // The above example will output: // [result] // bool(false) // string(15) "I am a constant" // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getconstant.php // ========== REFLECTIONCLASS_GETCONSTANT - END // SYNTAX: // mixed ReflectionClass::getConstant(string $name) return $return_reflectionclass_getconstant; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANTS // ============================== PUBLIC // ============================== ABOUT // Gets constants. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getConstants() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getconstants($reflectionclass, $filter = null) { $return_reflectionclass_getconstants = null; // ========== REFLECTIONCLASS_GETCONSTANTS - BEGIN // ===== ABOUT // Gets constants // ===== DESCRIPTION // Gets all defined constants from a class, regardless of their visibility. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getConstants(?int $filter = null): array // ===== CODE $return_reflectionclass_getconstants = $reflectionclass->getConstants( $filter // int filter - The optional filter, for filtering desired constant visibilities. It's configured using the ReflectionClassConstant constants, and defaults to all constant visibilities. ); // Return Values // An array of constants, where the keys hold the name and the values the value of the constants. // // Changelog // Version - Description // 8.0.0 - filter has been added. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getconstants.php // ========== REFLECTIONCLASS_GETCONSTANTS - END // SYNTAX: // array ReflectionClass::getConstants(int $filter = null) return $return_reflectionclass_getconstants; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTANTS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTRUCTOR // ============================== PUBLIC // ============================== ABOUT // Gets the constructor of the class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getConstructor() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getconstructor($reflectionclass) { $return_reflectionclass_getconstructor = null; // ========== REFLECTIONCLASS_GETCONSTRUCTOR - BEGIN // ===== ABOUT // Gets the constructor of the class // ===== DESCRIPTION // Gets the constructor of the reflected class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getConstructor(): ?ReflectionMethod // ===== CODE $return_reflectionclass_getconstructor = $reflectionclass->getConstructor( // This function has no parameters. ); // Return Values // A ReflectionMethod object reflecting the class' constructor, or null if the class has no constructor. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getConstructor() // [php] // $class = new ReflectionClass('ReflectionClass'); // $constructor = $class->getConstructor(); // var_dump($constructor); // [/php] // The above example will output: // [result] // object(ReflectionMethod)#2 (2) { // ["name"]=> // string(11) "__construct" // ["class"]=> // string(15) "ReflectionClass" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getconstructor.php // ========== REFLECTIONCLASS_GETCONSTRUCTOR - END // SYNTAX: // ReflectionMethod ReflectionClass::getConstructor() return $return_reflectionclass_getconstructor; // ReflectionMethod } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETCONSTRUCTOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDEFAULTPROPERTIES // ============================== PUBLIC // ============================== ABOUT // Gets default properties. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getDefaultProperties() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getdefaultproperties($reflectionclass) { $return_reflectionclass_getdefaultproperties = null; // ========== REFLECTIONCLASS_GETDEFAULTPROPERTIES - BEGIN // ===== ABOUT // Gets default properties // ===== DESCRIPTION // Gets default properties from a class (including inherited properties). // Note: This method only works for static properties when used on internal classes. The default value of a static class property can not be tracked when using this method on user defined classes. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getDefaultProperties(): array // ===== CODE $return_reflectionclass_getdefaultproperties = $reflectionclass->getDefaultProperties( // This function has no parameters. ); // Return Values // An array of default properties, with the key being the name of the property and the value being the default value of the property or null if the property doesn't have a default value. The function does not distinguish between static and non static properties and does not take visibility modifiers into account. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getDefaultProperties() example // [php] // class Bar { // protected $inheritedProperty = 'inheritedDefault'; // } // // class Foo extends Bar { // public $property = 'propertyDefault'; // private $privateProperty = 'privatePropertyDefault'; // public static $staticProperty = 'staticProperty'; // public $defaultlessProperty; // } // // $reflectionClass = new ReflectionClass('Foo'); // var_dump($reflectionClass->getDefaultProperties()); // [/php] // The above example will output: // [result] // array(5) { // ["staticProperty"]=> // string(14) "staticProperty" // ["property"]=> // string(15) "propertyDefault" // ["privateProperty"]=> // string(22) "privatePropertyDefault" // ["defaultlessProperty"]=> // NULL // ["inheritedProperty"]=> // string(16) "inheritedDefault" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getdefaultproperties.php // ========== REFLECTIONCLASS_GETDEFAULTPROPERTIES - END // SYNTAX: // array ReflectionClass::getDefaultProperties() return $return_reflectionclass_getdefaultproperties; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDEFAULTPROPERTIES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDOCCOMMENT // ============================== PUBLIC // ============================== ABOUT // Gets doc comments. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getDocComment() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getdoccomment($reflectionclass) { $return_reflectionclass_getdoccomment = false; // ========== REFLECTIONCLASS_GETDOCCOMMENT - BEGIN // ===== ABOUT // Gets doc comments // ===== DESCRIPTION // Gets doc comments from a class. Doc comments start with /**, followed by whitespace. If there are multiple doc comments above the class definition, the one closest to the class will be taken. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getDocComment(): string|false // ===== CODE $return_reflectionclass_getdoccomment = $reflectionclass->getDocComment( // This function has no parameters. ); // Return Values // The doc comment if it exists, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getDocComment() example // [php] // /** // * A test class // * // * @param foo bar // * @return baz // */ // class TestClass { } // // $rc = new ReflectionClass('TestClass'); // var_dump($rc->getDocComment()); // [/php] // The above example will output: // [result] // string(61) "/** // * A test class // * // * @param foo bar // * @return baz // */" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getdoccomment.php // ========== REFLECTIONCLASS_GETDOCCOMMENT - END // SYNTAX: // string|false ReflectionClass::getDocComment() return $return_reflectionclass_getdoccomment; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETDOCCOMMENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETENDLINE // ============================== PUBLIC // ============================== ABOUT // Gets end line. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getEndLine() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getendline($reflectionclass) { $return_reflectionclass_getendline = false; // ========== REFLECTIONCLASS_GETENDLINE - BEGIN // ===== ABOUT // Gets end line // ===== DESCRIPTION // Gets end line number from a user-defined class definition. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getEndLine(): int|false // ===== CODE $return_reflectionclass_getendline = $reflectionclass->getEndLine( // This function has no parameters. ); // Return Values // The ending line number of the user defined class, or false if unknown. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getEndLine() example // [php] // // Test Class // class TestClass { } // // $rc = new ReflectionClass('TestClass'); // // echo $rc->getEndLine(); // [/php] // The above example will output: // [result] // 3 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getendline.php // ========== REFLECTIONCLASS_GETENDLINE - END // SYNTAX: // int|false ReflectionClass::getEndLine() return $return_reflectionclass_getendline; // int|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETENDLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSION // ============================== PUBLIC // ============================== ABOUT // Gets a ReflectionExtension object for the extension which defined the class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getExtension() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getextension($reflectionclass) { $return_reflectionclass_getextension = null; // ========== REFLECTIONCLASS_GETEXTENSION - BEGIN // ===== ABOUT // Gets a ReflectionExtension object for the extension which defined the class // ===== DESCRIPTION // Gets a ReflectionExtension object for the extension which defined the class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getExtension(): ?ReflectionExtension // ===== CODE $return_reflectionclass_getextension = $reflectionclass->getExtension( // This function has no parameters. ); // Return Values // A ReflectionExtension object representing the extension which defined the class, or null for user-defined classes. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getExtension() // [php] // $class = new ReflectionClass('ReflectionClass'); // $extension = $class->getExtension(); // var_dump($extension); // [/php] // The above example will output: // [result] // object(ReflectionExtension)#2 (1) { // ["name"]=> // string(10) "Reflection" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getextension.php // ========== REFLECTIONCLASS_GETEXTENSION - END // SYNTAX: // ReflectionExtension ReflectionClass::getExtension() return $return_reflectionclass_getextension; // ReflectionExtension } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSIONNAME // ============================== PUBLIC // ============================== ABOUT // Gets the name of the extension which defined the class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getExtensionName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getextensionname($reflectionclass) { $return_reflectionclass_getextensionname = false; // ========== REFLECTIONCLASS_GETEXTENSIONNAME - BEGIN // ===== ABOUT // Gets the name of the extension which defined the class // ===== DESCRIPTION // Gets the name of the extension which defined the class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getExtensionName(): string|false // ===== CODE $return_reflectionclass_getextensionname = $reflectionclass->getExtensionName( // This function has no parameters. ); // Return Values // The name of the extension which defined the class, or false for user-defined classes. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getExtensionName() // [php] // $class = new ReflectionClass('ReflectionClass'); // $extension = $class->getExtensionName(); // var_dump($extension); // [/php] // The above example will output: // [result] // string(10) "Reflection" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getextensionname.php // ========== REFLECTIONCLASS_GETEXTENSIONNAME - END // SYNTAX: // string|false ReflectionClass::getExtensionName() return $return_reflectionclass_getextensionname; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETEXTENSIONNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETFILENAME // ============================== PUBLIC // ============================== ABOUT // Gets the filename of the file in which the class has been defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getFileName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getfilename($reflectionclass) { $return_reflectionclass_getfilename = false; // ========== REFLECTIONCLASS_GETFILENAME - BEGIN // ===== ABOUT // Gets the filename of the file in which the class has been defined // ===== DESCRIPTION // Gets the filename of the file in which the class has been defined. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getFileName(): string|false // ===== CODE $return_reflectionclass_getfilename = $reflectionclass->getFileName( // This function has no parameters. ); // Return Values // Returns the filename of the file in which the class has been defined. If the class is defined in the PHP core or in a PHP extension, false is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getfilename.php // ========== REFLECTIONCLASS_GETFILENAME - END // SYNTAX: // string|false ReflectionClass::getFileName() return $return_reflectionclass_getfilename; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETFILENAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACENAMES // ============================== PUBLIC // ============================== ABOUT // Gets the interface names. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getInterfaceNames() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getinterfacenames($reflectionclass) { $return_reflectionclass_getinterfacenames = null; // ========== REFLECTIONCLASS_GETINTERFACENAMES - BEGIN // ===== ABOUT // Gets the interface names // ===== DESCRIPTION // Get the interface names. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getInterfaceNames(): array // ===== CODE $return_reflectionclass_getinterfacenames = $reflectionclass->getInterfaceNames( // This function has no parameters. ); // Return Values // A numerical array with interface names as the values. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getInterfaceNames() example // [php] // interface Foo { } // // interface Bar { } // // class Baz implements Foo, Bar { } // // $rc1 = new ReflectionClass("Baz"); // // print_r($rc1->getInterfaceNames()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [0] => Foo // [1] => Bar // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getinterfacenames.php // ========== REFLECTIONCLASS_GETINTERFACENAMES - END // SYNTAX: // array ReflectionClass::getInterfaceNames() return $return_reflectionclass_getinterfacenames; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACENAMES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACES // ============================== PUBLIC // ============================== ABOUT // Gets the interfaces. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getInterfaces() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getinterfaces($reflectionclass) { $return_reflectionclass_getinterfaces = null; // ========== REFLECTIONCLASS_GETINTERFACES - BEGIN // ===== ABOUT // Gets the interfaces // ===== DESCRIPTION // Gets the interfaces. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getInterfaces(): array // ===== CODE $return_reflectionclass_getinterfaces = $reflectionclass->getInterfaces( // This function has no parameters. ); // Return Values // An associative array of interfaces, with keys as interface names and the array values as ReflectionClass objects. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getInterfaces() example // [php] // interface Foo { } // // interface Bar { } // // class Baz implements Foo, Bar { } // // $rc1 = new ReflectionClass("Baz"); // // print_r($rc1->getInterfaces()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [Foo] => ReflectionClass Object // ( // [name] => Foo // ) // // [Bar] => ReflectionClass Object // ( // [name] => Bar // ) // // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getinterfaces.php // ========== REFLECTIONCLASS_GETINTERFACES - END // SYNTAX: // array ReflectionClass::getInterfaces() return $return_reflectionclass_getinterfaces; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETINTERFACES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHOD // ============================== PUBLIC // ============================== ABOUT // Gets a ReflectionMethod for a class method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getMethod() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getmethod($reflectionclass, $name) { $return_reflectionclass_getmethod = null; // ========== REFLECTIONCLASS_GETMETHOD - BEGIN // ===== ABOUT // Gets a ReflectionMethod for a class method // ===== DESCRIPTION // Gets a ReflectionMethod for a class method. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getMethod(string $name): ReflectionMethod // ===== CODE $return_reflectionclass_getmethod = $reflectionclass->getMethod( $name // string name - The method name to reflect. ); // Return Values // A ReflectionMethod. // // Errors/Exceptions // A ReflectionException if the method does not exist. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getMethod() // [php] // $class = new ReflectionClass('ReflectionClass'); // $method = $class->getMethod('getMethod'); // var_dump($method); // [/php] // The above example will output: // [result] // object(ReflectionMethod)#2 (2) { // ["name"]=> // string(9) "getMethod" // ["class"]=> // string(15) "ReflectionClass" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getmethod.php // ========== REFLECTIONCLASS_GETMETHOD - END // SYNTAX: // ReflectionMethod ReflectionClass::getMethod(string $name) return $return_reflectionclass_getmethod; // ReflectionMethod } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHOD // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHODS // ============================== PUBLIC // ============================== ABOUT // Gets an array of methods. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getMethods() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getmethods($reflectionclass, $filter = null) { $return_reflectionclass_getmethods = null; // ========== REFLECTIONCLASS_GETMETHODS - BEGIN // ===== ABOUT // Gets an array of methods // ===== DESCRIPTION // Gets an array of methods for the class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getMethods(?int $filter = null): array // ===== CODE $return_reflectionclass_getmethods = $reflectionclass->getMethods( $filter // int filter - Filter the results to include only methods with certain attributes. Defaults to no filtering. // Any bitwise disjunction of ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC, ReflectionMethod::IS_PROTECTED, ReflectionMethod::IS_PRIVATE, ReflectionMethod::IS_ABSTRACT, ReflectionMethod::IS_FINAL, so that all methods with any of the given attributes will be returned. // Note: Note that other bitwise operations, for instance ~ will not work as expected. In other words, it is not possible to retrieve all non-static methods, for example. ); // Return Values // An array of ReflectionMethod objects reflecting each method. // // Changelog // Version - Description // 7.2.0 - filter is nullable now. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getMethods() // [php] // class Apple { // public function firstMethod() { } // final protected function secondMethod() { } // private static function thirdMethod() { } // } // // $class = new ReflectionClass('Apple'); // $methods = $class->getMethods(); // var_dump($methods); // [/php] // The above example will output: // [result] // array(3) { // [0]=> // object(ReflectionMethod)#2 (2) { // ["name"]=> // string(11) "firstMethod" // ["class"]=> // string(5) "Apple" // } // [1]=> // object(ReflectionMethod)#3 (2) { // ["name"]=> // string(12) "secondMethod" // ["class"]=> // string(5) "Apple" // } // [2]=> // object(ReflectionMethod)#4 (2) { // ["name"]=> // string(11) "thirdMethod" // ["class"]=> // string(5) "Apple" // } // } // [/result] // [/example] // [example] // Example #2 Filtering results from ReflectionClass::getMethods() // [php] // class Apple { // public function firstMethod() { } // final protected function secondMethod() { } // private static function thirdMethod() { } // } // // $class = new ReflectionClass('Apple'); // $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_FINAL); // var_dump($methods); // [/php] // The above example will output: // [result] // array(2) { // [0]=> // object(ReflectionMethod)#2 (2) { // ["name"]=> // string(12) "secondMethod" // ["class"]=> // string(5) "Apple" // } // [1]=> // object(ReflectionMethod)#3 (2) { // ["name"]=> // string(11) "thirdMethod" // ["class"]=> // string(5) "Apple" // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getmethods.php // ========== REFLECTIONCLASS_GETMETHODS - END // SYNTAX: // array ReflectionClass::getMethods(int $filter = null) return $return_reflectionclass_getmethods; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMETHODS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMODIFIERS // ============================== PUBLIC // ============================== ABOUT // Gets the class modifiers. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getModifiers() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getmodifiers($reflectionclass) { $return_reflectionclass_getmodifiers = 0; // ========== REFLECTIONCLASS_GETMODIFIERS - BEGIN // ===== ABOUT // Gets the class modifiers // ===== DESCRIPTION // Returns a bitfield of the access modifiers for this class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getModifiers(): int // ===== CODE $return_reflectionclass_getmodifiers = $reflectionclass->getModifiers( // This function has no parameters. ); // Return Values // Returns bitmask of modifier constants. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getmodifiers.php // ========== REFLECTIONCLASS_GETMODIFIERS - END // SYNTAX: // int ReflectionClass::getModifiers() return $return_reflectionclass_getmodifiers; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETMODIFIERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets class name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getname($reflectionclass) { $return_reflectionclass_getname = null; // ========== REFLECTIONCLASS_GETNAME - BEGIN // ===== ABOUT // Gets class name // ===== DESCRIPTION // Gets the class name. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getName(): string // ===== CODE $return_reflectionclass_getname = $reflectionclass->getName( // This function has no parameters. ); // Return Values // The class name. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getName() example // [php] // namespace A\B; // // class Foo { } // // $function = new \ReflectionClass('stdClass'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // // $function = new \ReflectionClass('A\\B\\Foo'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // [/php] // The above example will output: // [result] // bool(false) // string(8) "stdClass" // string(0) "" // string(8) "stdClass" // // bool(true) // string(7) "A\B\Foo" // string(3) "A\B" // string(3) "Foo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getname.php // ========== REFLECTIONCLASS_GETNAME - END // SYNTAX: // string ReflectionClass::getName() return $return_reflectionclass_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAMESPACENAME // ============================== PUBLIC // ============================== ABOUT // Gets namespace name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getNamespaceName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getnamespacename($reflectionclass) { $return_reflectionclass_getnamespacename = null; // ========== REFLECTIONCLASS_GETNAMESPACENAME - BEGIN // ===== ABOUT // Gets namespace name // ===== DESCRIPTION // Gets the namespace name. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getNamespaceName(): string // ===== CODE $return_reflectionclass_getnamespacename = $reflectionclass->getNamespaceName( // This function has no parameters. ); // Return Values // The namespace name. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getNamespaceName() example // [php] // namespace A\B; // // class Foo { } // // $class = new \ReflectionClass('stdClass'); // // var_dump($class->inNamespace()); // var_dump($class->getName()); // var_dump($class->getNamespaceName()); // var_dump($class->getShortName()); // // $class = new \ReflectionClass('A\\B\\Foo'); // // var_dump($class->inNamespace()); // var_dump($class->getName()); // var_dump($class->getNamespaceName()); // var_dump($class->getShortName()); // [/php] // The above example will output: // [result] // bool(false) // string(8) "stdClass" // string(0) "" // string(8) "stdClass" // // bool(true) // string(7) "A\B\Foo" // string(3) "A\B" // string(3) "Foo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getnamespacename.php // ========== REFLECTIONCLASS_GETNAMESPACENAME - END // SYNTAX: // string ReflectionClass::getNamespaceName() return $return_reflectionclass_getnamespacename; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETNAMESPACENAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPARENTCLASS // ============================== PUBLIC // ============================== ABOUT // Gets parent class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getParentClass() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getparentclass($reflectionclass) { $return_reflectionclass_getparentclass = false; // ========== REFLECTIONCLASS_GETPARENTCLASS - BEGIN // ===== ABOUT // Gets parent class // ===== DESCRIPTION // Get the parent class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getParentClass(): ReflectionClass|false // ===== CODE $return_reflectionclass_getparentclass = $reflectionclass->getParentClass( // This function has no parameters. ); // Return Values // A ReflectionClass or false if there's no parent. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getparentclass.php // ========== REFLECTIONCLASS_GETPARENTCLASS - END // SYNTAX: // ReflectionClass|false ReflectionClass::getParentClass() return $return_reflectionclass_getparentclass; // ReflectionClass|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPARENTCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTIES // ============================== PUBLIC // ============================== ABOUT // Gets properties. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getProperties() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getproperties($reflectionclass, $filter = null) { $return_reflectionclass_getproperties = null; // ========== REFLECTIONCLASS_GETPROPERTIES - BEGIN // ===== ABOUT // Gets properties // ===== DESCRIPTION // Retrieves reflected properties. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getProperties(?int $filter = null): array // ===== CODE $return_reflectionclass_getproperties = $reflectionclass->getProperties( $filter // int filter - The optional filter, for filtering desired property types. It's configured using the ReflectionProperty constants, and defaults to all property types. ); // Return Values // An array of ReflectionProperty objects. // // Changelog // Version - Description // 7.2.0 filter is nullable now. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getProperties() filtering example // This example demonstrates usage of the optional filter parameter, where it essentially skips private properties. // [php] // class Foo { // public $foo = 1; // protected $bar = 2; // private $baz = 3; // } // // $foo = new Foo(); // // $reflect = new ReflectionClass($foo); // $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED); // // foreach ($props as $prop) { // print $prop->getName() . "\n"; // } // // var_dump($props); // // [/php] // The above example will output something similar to: // [result] // foo // bar // array(2) { // [0]=> // object(ReflectionProperty)#3 (2) { // ["name"]=> // string(3) "foo" // ["class"]=> // string(3) "Foo" // } // [1]=> // object(ReflectionProperty)#4 (2) { // ["name"]=> // string(3) "bar" // ["class"]=> // string(3) "Foo" // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getproperties.php // ========== REFLECTIONCLASS_GETPROPERTIES - END // SYNTAX: // array ReflectionClass::getProperties(int $filter = null) return $return_reflectionclass_getproperties; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTIES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTY // ============================== PUBLIC // ============================== ABOUT // Gets a ReflectionProperty for a class's property. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getProperty() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getproperty($reflectionclass, $name) { $return_reflectionclass_getproperty = null; // ========== REFLECTIONCLASS_GETPROPERTY - BEGIN // ===== ABOUT // Gets a ReflectionProperty for a class's property // ===== DESCRIPTION // Gets a ReflectionProperty for a class's property. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getProperty(string $name): ReflectionProperty // ===== CODE $return_reflectionclass_getproperty = $reflectionclass->getProperty( $name // string name - The property name. ); // Return Values // A ReflectionProperty. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getProperty() // [php] // $class = new ReflectionClass('ReflectionClass'); // $property = $class->getProperty('name'); // var_dump($property); // [/php] // The above example will output: // [result] // object(ReflectionProperty)#2 (2) { // ["name"]=> // string(4) "name" // ["class"]=> // string(15) "ReflectionClass" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getproperty.php // ========== REFLECTIONCLASS_GETPROPERTY - END // SYNTAX: // ReflectionProperty ReflectionClass::getProperty(string $name) return $return_reflectionclass_getproperty; // ReflectionProperty } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETPROPERTY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANT // ============================== OFFLINE // ============================== ABOUT // Gets a ReflectionClassConstant for a class's constant. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getReflectionConstant() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclass_getreflectionconstant($reflectionclass, $name) { $return_reflectionclass_getreflectionconstant = false; // ========== REFLECTIONCLASS_GETREFLECTIONCONSTANT - BEGIN // ===== ABOUT // Gets a ReflectionClassConstant for a class's constant // ===== DESCRIPTION // Gets a ReflectionClassConstant for a class's property. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClass::getReflectionConstant(string $name): ReflectionClassConstant|false // ===== CODE $return_reflectionclass_getreflectionconstant = $reflectionclass->getReflectionConstant( $name // string name - The class constant name. ); // Return Values // A ReflectionClassConstant, or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getreflectionconstant.php // ========== REFLECTIONCLASS_GETREFLECTIONCONSTANT - END // SYNTAX: // ReflectionClassConstant|false ReflectionClass::getReflectionConstant(string $name) return $return_reflectionclass_getreflectionconstant; // ReflectionClassConstant|false } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANTS // ============================== OFFLINE // ============================== ABOUT // Gets class constants. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getReflectionConstants() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclass_getreflectionconstants($reflectionclass, $filter = null) { $return_reflectionclass_getreflectionconstants = null; // ========== REFLECTIONCLASS_GETREFLECTIONCONSTANTS - BEGIN // ===== ABOUT // Gets class constants // ===== DESCRIPTION // Retrieves reflected constants. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClass::getReflectionConstants(?int $filter = null): array // ===== CODE $return_reflectionclass_getreflectionconstants = $reflectionclass->getReflectionConstants( $filter // int filter - The optional filter, for filtering desired constant visibilities. It's configured using the ReflectionClassConstant constants, and defaults to all constant visibilities. ); // Return Values // An array of ReflectionClassConstant objects. // // Changelog // Version - Description // 8.0.0 - filter has been added. // // [examples] // Examples // [example] // Example #1 Basic ReflectionClass::getReflectionConstants() example // [php] // class Foo { // public const FOO = 1; // protected const BAR = 2; // private const BAZ = 3; // } // // $foo = new Foo(); // // $reflect = new ReflectionClass($foo); // $consts = $reflect->getReflectionConstants(); // // foreach ($consts as $const) { // print $const->getName() . "\n"; // } // // var_dump($consts); // // [/php] // The above example will output something similar to: // [result] // FOO // BAR // BAZ // array(3) { // [0]=> // object(ReflectionClassConstant)#3 (2) { // ["name"]=> // string(3) "FOO" // ["class"]=> // string(3) "Foo" // } // [1]=> // object(ReflectionClassConstant)#4 (2) { // ["name"]=> // string(3) "BAR" // ["class"]=> // string(3) "Foo" // } // [2]=> // object(ReflectionClassConstant)#5 (2) { // ["name"]=> // string(3) "BAZ" // ["class"]=> // string(3) "Foo" // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-30) // URL: https://www.php.net/manual/en/reflectionclass.getreflectionconstants.php // ========== REFLECTIONCLASS_GETREFLECTIONCONSTANTS - END // SYNTAX: // array ReflectionClass::getReflectionConstants(int $filter = null) return $return_reflectionclass_getreflectionconstants; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETREFLECTIONCONSTANTS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSHORTNAME // ============================== PUBLIC // ============================== ABOUT // Gets short name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getShortName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getshortname($reflectionclass) { $return_reflectionclass_getshortname = null; // ========== REFLECTIONCLASS_GETSHORTNAME - BEGIN // ===== ABOUT // Gets short name // ===== DESCRIPTION // Gets the short name of the class, the part without the namespace. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getShortName(): string // ===== CODE $return_reflectionclass_getshortname = $reflectionclass->getShortName( // This function has no parameters. ); // Return Values // The class short name. // // [examples] // Examples // [example] // Example #1 ReflectionClass::getShortName() example // [php] // namespace A\B; // // class Foo { } // // $function = new \ReflectionClass('stdClass'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // // $function = new \ReflectionClass('A\\B\\Foo'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // [/php] // The above example will output: // [result] // bool(false) // string(8) "stdClass" // string(0) "" // string(8) "stdClass" // // bool(true) // string(7) "A\B\Foo" // string(3) "A\B" // string(3) "Foo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.getshortname.php // ========== REFLECTIONCLASS_GETSHORTNAME - END // SYNTAX: // string ReflectionClass::getShortName() return $return_reflectionclass_getshortname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSHORTNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTARTLINE // ============================== PUBLIC // ============================== ABOUT // Gets starting line number. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getStartLine() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getstartline($reflectionclass) { $return_reflectionclass_getstartline = false; // ========== REFLECTIONCLASS_GETSTARTLINE - BEGIN // ===== ABOUT // Gets starting line number // ===== DESCRIPTION // Get the starting line number. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getStartLine(): int|false // ===== CODE $return_reflectionclass_getstartline = $reflectionclass->getStartLine( // This function has no parameters. ); // Return Values // The starting line number, as an int, or false if unknown. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.getstartline.php // ========== REFLECTIONCLASS_GETSTARTLINE - END // SYNTAX: // int|false ReflectionClass::getStartLine() return $return_reflectionclass_getstartline; // int|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTARTLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTIES // ============================== PUBLIC // ============================== ABOUT // Gets static properties. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getStaticProperties() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getstaticproperties($reflectionclass) { $return_reflectionclass_getstaticproperties = null; // ========== REFLECTIONCLASS_GETSTATICPROPERTIES - BEGIN // ===== ABOUT // Gets static properties // ===== DESCRIPTION // Get the static properties. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getStaticProperties(): array // ===== CODE $return_reflectionclass_getstaticproperties = $reflectionclass->getStaticProperties( // This function has no parameters. ); // Return Values // The static properties, as an array. // // Changelog // Version - Description // 8.3.0 - The return type of ReflectionClass::getStaticProperties() has been changed to array from ?array. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.getstaticproperties.php // ========== REFLECTIONCLASS_GETSTATICPROPERTIES - END // SYNTAX: // array ReflectionClass::getStaticProperties() return $return_reflectionclass_getstaticproperties; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTIES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTYVALUE // ============================== PUBLIC // ============================== ABOUT // Gets static property value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getStaticPropertyValue() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_getstaticpropertyvalue($reflectionclass, $name, & $def_value) { $return_reflectionclass_getstaticpropertyvalue = null; // ========== REFLECTIONCLASS_GETSTATICPROPERTYVALUE - BEGIN // ===== ABOUT // Gets static property value // ===== DESCRIPTION // Gets the value of a static property on this class. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed // ===== CODE $return_reflectionclass_getstaticpropertyvalue = $reflectionclass->getStaticPropertyValue( $name, // string name - The name of the static property for which to return a value. $def_value // mixed& def_value - A default value to return in case the class does not declare a static property with the given name. If the property does not exist and this argument is omitted, a ReflectionException is thrown. ); // Return Values // The value of the static property. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::getStaticPropertyValue() // [php] // class Apple { // public static $color = 'Red'; // } // // $class = new ReflectionClass('Apple'); // var_dump($class->getStaticPropertyValue('color')); // [/php] // The above example will output: // [result] // string(3) "Red" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.getstaticpropertyvalue.php // ========== REFLECTIONCLASS_GETSTATICPROPERTYVALUE - END // SYNTAX: // mixed ReflectionClass::getStaticPropertyValue(string $name, mixed& $def_value) return $return_reflectionclass_getstaticpropertyvalue; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETSTATICPROPERTYVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITALIASES // ============================== PUBLIC // ============================== ABOUT // Returns an array of trait aliases. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getTraitAliases() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_gettraitaliases($reflectionclass) { $return_reflectionclass_gettraitaliases = null; // ========== REFLECTIONCLASS_GETTRAITALIASES - BEGIN // ===== ABOUT // Returns an array of trait aliases // ===== DESCRIPTION // Get the array of trait method aliases defined in the current class. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getTraitAliases(): array // ===== CODE $return_reflectionclass_gettraitaliases = $reflectionclass->getTraitAliases( // This function has no parameters. ); // Return Values // Returns an array with new method names in keys and original names (in the format "TraitName::original") in values. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.gettraitaliases.php // ========== REFLECTIONCLASS_GETTRAITALIASES - END // SYNTAX: // array ReflectionClass::getTraitAliases() return $return_reflectionclass_gettraitaliases; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITALIASES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITNAMES // ============================== PUBLIC // ============================== ABOUT // Returns an array of names of traits used by this class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getTraitNames() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_gettraitnames($reflectionclass) { $return_reflectionclass_gettraitnames = null; // ========== REFLECTIONCLASS_GETTRAITNAMES - BEGIN // ===== ABOUT // Returns an array of names of traits used by this class // ===== DESCRIPTION // Get the names of the traits used by this class. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getTraitNames(): array // ===== CODE $return_reflectionclass_gettraitnames = $reflectionclass->getTraitNames( // This function has no parameters. ); // Return Values // Returns an array with trait names in values. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.gettraitnames.php // ========== REFLECTIONCLASS_GETTRAITNAMES - END // SYNTAX: // array ReflectionClass::getTraitNames() return $return_reflectionclass_gettraitnames; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITNAMES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITS // ============================== PUBLIC // ============================== ABOUT // Returns an array of traits used by this class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::getTraits() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_gettraits($reflectionclass) { $return_reflectionclass_gettraits = null; // ========== REFLECTIONCLASS_GETTRAITS - BEGIN // ===== ABOUT // Returns an array of traits used by this class // ===== DESCRIPTION // Get the array of traits used by this class. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::getTraits(): array // ===== CODE $return_reflectionclass_gettraits = $reflectionclass->getTraits( // This function has no parameters. ); // Return Values // Returns an array with trait names in keys and instances of trait's ReflectionClass in values. Returns null in case of an error. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.gettraits.php // ========== REFLECTIONCLASS_GETTRAITS - END // SYNTAX: // array ReflectionClass::getTraits() return $return_reflectionclass_gettraits; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_GETTRAITS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASCONSTANT // ============================== PUBLIC // ============================== ABOUT // Checks if constant is defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::hasConstant() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_hasconstant($reflectionclass, $name) { $return_reflectionclass_hasconstant = false; // ========== REFLECTIONCLASS_HASCONSTANT - BEGIN // ===== ABOUT // Checks if constant is defined // ===== DESCRIPTION // Checks whether the class has a specific constant defined or not. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::hasConstant(string $name): bool // ===== CODE $return_reflectionclass_hasconstant = $reflectionclass->hasConstant( $name // string name - The name of the constant being checked for. ); // Return Values // true if the constant is defined, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionClass::hasConstant() example // [php] // class Foo { // const c1 = 1; // } // // $class = new ReflectionClass("Foo"); // // var_dump($class->hasConstant("c1")); // var_dump($class->hasConstant("c2")); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.hasconstant.php // ========== REFLECTIONCLASS_HASCONSTANT - END // SYNTAX: // bool ReflectionClass::hasConstant(string $name) return $return_reflectionclass_hasconstant; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASCONSTANT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASMETHOD // ============================== PUBLIC // ============================== ABOUT // Checks if method is defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::hasMethod() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_hasmethod($reflectionclass, $name) { $return_reflectionclass_hasmethod = false; // ========== REFLECTIONCLASS_HASMETHOD - BEGIN // ===== ABOUT // Checks if method is defined // ===== DESCRIPTION // Checks whether a specific method is defined in a class. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::hasMethod(string $name): bool // ===== CODE $return_reflectionclass_hasmethod = $reflectionclass->hasMethod( $name // string name - Name of the method being checked for. ); // Return Values // true if it has the method, otherwise false // // [examples] // Examples // [example] // Example #1 ReflectionClass::hasMethod() example // [php] // Class C { // public function publicFoo() { // return true; // } // // protected function protectedFoo() { // return true; // } // // private function privateFoo() { // return true; // } // // static function staticFoo() { // return true; // } // } // // $rc = new ReflectionClass("C"); // // var_dump($rc->hasMethod('publicFoo')); // // var_dump($rc->hasMethod('protectedFoo')); // // var_dump($rc->hasMethod('privateFoo')); // // var_dump($rc->hasMethod('staticFoo')); // // // C should not have method bar // var_dump($rc->hasMethod('bar')); // // // Method names are case insensitive // var_dump($rc->hasMethod('PUBLICfOO')); // [/php] // The above example will output: // [result] // bool(true) // bool(true) // bool(true) // bool(true) // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.hasmethod.php // ========== REFLECTIONCLASS_HASMETHOD - END // SYNTAX: // bool ReflectionClass::hasMethod(string $name) return $return_reflectionclass_hasmethod; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASMETHOD // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASPROPERTY // ============================== PUBLIC // ============================== ABOUT // Checks if property is defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::hasProperty() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_hasproperty($reflectionclass, $name) { $return_reflectionclass_hasproperty = false; // ========== REFLECTIONCLASS_HASPROPERTY - BEGIN // ===== ABOUT // Checks if property is defined // ===== DESCRIPTION // Checks whether the specified property is defined. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::hasProperty(string $name): bool // ===== CODE $return_reflectionclass_hasproperty = $reflectionclass->hasProperty( $name // string name - Name of the property being checked for. ); // Return Values // true if it has the property, otherwise false // // [examples] // Examples // [example] // Example #1 ReflectionClass::hasProperty() example // [php] // class Foo { // public $p1; // protected $p2; // private $p3; // // } // // $obj = new ReflectionObject(new Foo()); // // var_dump($obj->hasProperty("p1")); // var_dump($obj->hasProperty("p2")); // var_dump($obj->hasProperty("p3")); // var_dump($obj->hasProperty("p4")); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(true) // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.hasproperty.php // ========== REFLECTIONCLASS_HASPROPERTY - END // SYNTAX: // bool ReflectionClass::hasProperty(string $name) return $return_reflectionclass_hasproperty; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_HASPROPERTY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_IMPLEMENTSINTERFACE // ============================== PUBLIC // ============================== ABOUT // Implements interface. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::implementsInterface() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_implementsinterface($reflectionclass, $interface) { $return_reflectionclass_implementsinterface = false; // ========== REFLECTIONCLASS_IMPLEMENTSINTERFACE - BEGIN // ===== ABOUT // Implements interface // ===== DESCRIPTION // Checks whether it implements an interface. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::implementsInterface(ReflectionClass|string $interface): bool // ===== CODE $return_reflectionclass_implementsinterface = $reflectionclass->implementsInterface( $interface // ReflectionClass|string interface - The interface name. ); // Return Values // Returns true on success or false on failure. // // Errors/Exceptions // ReflectionClass::implementsInterface() throws an ReflectionException if interface is not an interface. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.implementsinterface.php // ========== REFLECTIONCLASS_IMPLEMENTSINTERFACE - END // SYNTAX: // bool ReflectionClass::implementsInterface(ReflectionClass|string $interface) return $return_reflectionclass_implementsinterface; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_IMPLEMENTSINTERFACE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_INNAMESPACE // ============================== PUBLIC // ============================== ABOUT // Checks if in namespace. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::inNamespace() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_innamespace($reflectionclass) { $return_reflectionclass_innamespace = false; // ========== REFLECTIONCLASS_INNAMESPACE - BEGIN // ===== ABOUT // Checks if in namespace // ===== DESCRIPTION // Checks if this class is defined in a namespace. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::inNamespace(): bool // ===== CODE $return_reflectionclass_innamespace = $reflectionclass->inNamespace( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::inNamespace() example // [php] // namespace A\B; // // class Foo { } // // $function = new \ReflectionClass('stdClass'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // // $function = new \ReflectionClass('A\\B\\Foo'); // // var_dump($function->inNamespace()); // var_dump($function->getName()); // var_dump($function->getNamespaceName()); // var_dump($function->getShortName()); // [/php] // The above example will output: // [result] // bool(false) // string(8) "stdClass" // string(0) "" // string(8) "stdClass" // // bool(true) // string(7) "A\B\Foo" // string(3) "A\B" // string(3) "Foo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.innamespace.php // ========== REFLECTIONCLASS_INNAMESPACE - END // SYNTAX: // bool ReflectionClass::inNamespace() return $return_reflectionclass_innamespace; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_INNAMESPACE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISABSTRACT // ============================== PUBLIC // ============================== ABOUT // Checks if class is abstract. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isAbstract() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isabstract($reflectionclass) { $return_reflectionclass_isabstract = false; // ========== REFLECTIONCLASS_ISABSTRACT - BEGIN // ===== ABOUT // Checks if class is abstract // ===== DESCRIPTION // Checks if the class is abstract. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isAbstract(): bool // ===== CODE $return_reflectionclass_isabstract = $reflectionclass->isAbstract( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isAbstract() example // [php] // class TestClass { } // abstract class TestAbstractClass { } // // $testClass = new ReflectionClass('TestClass'); // $abstractClass = new ReflectionClass('TestAbstractClass'); // // var_dump($testClass->isAbstract()); // var_dump($abstractClass->isAbstract()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isabstract.php // ========== REFLECTIONCLASS_ISABSTRACT - END // SYNTAX: // bool ReflectionClass::isAbstract() return $return_reflectionclass_isabstract; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISABSTRACT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISANONYMOUS // ============================== OFFLINE // ============================== ABOUT // Checks if class is anonymous. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isAnonymous() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclass_isanonymous($reflectionclass) { $return_reflectionclass_isanonymous = false; // ========== REFLECTIONCLASS_ISANONYMOUS - BEGIN // ===== ABOUT // Checks if class is anonymous // ===== DESCRIPTION // Checks if a class is an anonymous class. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isAnonymous(): bool // ===== CODE $return_reflectionclass_isanonymous = $reflectionclass->isAnonymous( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isAnonymous() example // [php] // class TestClass {} // $anonClass = new class {}; // // $normalClass = new ReflectionClass('TestClass'); // $anonClass = new ReflectionClass($anonClass); // // var_dump($normalClass->isAnonymous()); // var_dump($anonClass->isAnonymous()); // // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isanonymous.php // ========== REFLECTIONCLASS_ISANONYMOUS - END // SYNTAX: // bool ReflectionClass::isAnonymous() return $return_reflectionclass_isanonymous; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISANONYMOUS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISCLONEABLE // ============================== PUBLIC // ============================== ABOUT // Returns whether this class is cloneable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isCloneable() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_iscloneable($reflectionclass) { $return_reflectionclass_iscloneable = false; // ========== REFLECTIONCLASS_ISCLONEABLE - BEGIN // ===== ABOUT // Returns whether this class is cloneable // ===== DESCRIPTION // Returns whether this class is cloneable. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isCloneable(): bool // ===== CODE $return_reflectionclass_iscloneable = $reflectionclass->isCloneable( // This function has no parameters. ); // Return Values // Returns true if the class is cloneable, false otherwise. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::isCloneable() // [php] // class NotCloneable { // public $var1; // // private function __clone() { // } // } // // class Cloneable { // public $var1; // } // // $notCloneable = new ReflectionClass('NotCloneable'); // $cloneable = new ReflectionClass('Cloneable'); // // var_dump($notCloneable->isCloneable()); // var_dump($cloneable->isCloneable()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.iscloneable.php // ========== REFLECTIONCLASS_ISCLONEABLE - END // SYNTAX: // bool ReflectionClass::isCloneable() return $return_reflectionclass_iscloneable; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISCLONEABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISENUM // ============================== OFFLINE // ============================== ABOUT // Returns whether this is an enum. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isEnum() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionclass_isenum($reflectionclass) { $return_reflectionclass_isenum = false; // ========== REFLECTIONCLASS_ISENUM - BEGIN // ===== ABOUT // Returns whether this is an enum // ===== DESCRIPTION // Checks if a class is an enum. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionClass::isEnum(): bool // ===== CODE $return_reflectionclass_isenum = $reflectionclass->isEnum( // This function has no parameters. ); // Return Values // Returns true if this is an enum, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isenum.php // ========== REFLECTIONCLASS_ISENUM - END // SYNTAX: // bool ReflectionClass::isEnum() return $return_reflectionclass_isenum; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISENUM // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISFINAL // ============================== PUBLIC // ============================== ABOUT // Checks if class is final. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isFinal() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isfinal($reflectionclass) { $return_reflectionclass_isfinal = false; // ========== REFLECTIONCLASS_ISFINAL - BEGIN // ===== ABOUT // Checks if class is final // ===== DESCRIPTION // Checks if a class is final. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isFinal(): bool // ===== CODE $return_reflectionclass_isfinal = $reflectionclass->isFinal( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isFinal() example // [php] // class TestClass { } // final class TestFinalClass { } // // $normalClass = new ReflectionClass('TestClass'); // $finalClass = new ReflectionClass('TestFinalClass'); // // var_dump($normalClass->isFinal()); // var_dump($finalClass->isFinal()); // // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isfinal.php // ========== REFLECTIONCLASS_ISFINAL - END // SYNTAX: // bool ReflectionClass::isFinal() return $return_reflectionclass_isfinal; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISFINAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANCE // ============================== PUBLIC // ============================== ABOUT // Checks class for instance. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isInstance() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isinstance($reflectionclass, $object) { $return_reflectionclass_isinstance = false; // ========== REFLECTIONCLASS_ISINSTANCE - BEGIN // ===== ABOUT // Checks class for instance // ===== DESCRIPTION // Checks if an object is an instance of a class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isInstance(object $object): bool // ===== CODE $return_reflectionclass_isinstance = $reflectionclass->isInstance( $object // object object - The object being compared to. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isInstance() related examples // [php] // // Example usage // $class = new ReflectionClass('Foo'); // // if ($class->isInstance($arg)) { // echo "Yes"; // } // // // Equivalent to // if ($arg instanceof Foo) { // echo "Yes"; // } // // // Equivalent to // if (is_a($arg, 'Foo')) { // echo "Yes"; // } // [/php] // The above example will output something similar to: // [result] // Yes // Yes // Yes // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isinstance.php // ========== REFLECTIONCLASS_ISINSTANCE - END // SYNTAX: // bool ReflectionClass::isInstance(object $object) return $return_reflectionclass_isinstance; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANCE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANTIABLE // ============================== PUBLIC // ============================== ABOUT // Checks if the class is instantiable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isInstantiable() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isinstantiable($reflectionclass) { $return_reflectionclass_isinstantiable = false; // ========== REFLECTIONCLASS_ISINSTANTIABLE - BEGIN // ===== ABOUT // Checks if the class is instantiable // ===== DESCRIPTION // Checks if the class is instantiable. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isInstantiable(): bool // ===== CODE $return_reflectionclass_isinstantiable = $reflectionclass->isInstantiable( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isInstantiable() example // [php] // class C { } // // interface iface { // function f1(); // } // // class ifaceImpl implements iface { // function f1() {} // } // // abstract class abstractClass { // function f1() { } // abstract function f2(); // } // // class D extends abstractClass { // function f2() { } // } // // trait T { // function f1() {} // } // // class privateConstructor { // private function __construct() { } // } // // $classes = array( // "C", // "iface", // "ifaceImpl", // "abstractClass", // "D", // "T", // "privateConstructor", // ); // // foreach($classes as $class ) { // $reflectionClass = new ReflectionClass($class); // echo "Is $class instantiable? "; // var_dump($reflectionClass->isInstantiable()); // } // // [/php] // The above example will output: // [result] // Is C instantiable? bool(true) // Is iface instantiable? bool(false) // Is ifaceImpl instantiable? bool(true) // Is abstractClass instantiable? bool(false) // Is D instantiable? bool(true) // Is T instantiable? bool(false) // Is privateConstructor instantiable? bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isinstantiable.php // ========== REFLECTIONCLASS_ISINSTANTIABLE - END // SYNTAX: // bool ReflectionClass::isInstantiable() return $return_reflectionclass_isinstantiable; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINSTANTIABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERFACE // ============================== PUBLIC // ============================== ABOUT // Checks if the class is an interface. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isInterface() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isinterface($reflectionclass) { $return_reflectionclass_isinterface = false; // ========== REFLECTIONCLASS_ISINTERFACE - BEGIN // ===== ABOUT // Checks if the class is an interface // ===== DESCRIPTION // Checks whether the class is an interface. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isInterface(): bool // ===== CODE $return_reflectionclass_isinterface = $reflectionclass->isInterface( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::isInterface() // [php] // interface SomeInterface { // public function interfaceMethod(); // } // // $class = new ReflectionClass('SomeInterface'); // var_dump($class->isInterface()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isinterface.php // ========== REFLECTIONCLASS_ISINTERFACE - END // SYNTAX: // bool ReflectionClass::isInterface() return $return_reflectionclass_isinterface; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERFACE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERNAL // ============================== PUBLIC // ============================== ABOUT // Checks if class is defined internally by an extension, or the core. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isInternal() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isinternal($reflectionclass) { $return_reflectionclass_isinternal = false; // ========== REFLECTIONCLASS_ISINTERNAL - BEGIN // ===== ABOUT // Checks if class is defined internally by an extension, or the core // ===== DESCRIPTION // Checks if the class is defined internally by an extension, or the core, as opposed to user-defined. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isInternal(): bool // ===== CODE $return_reflectionclass_isinternal = $reflectionclass->isInternal( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::isInternal() // [php] // $internalclass = new ReflectionClass('ReflectionClass'); // // class Apple {} // $userclass = new ReflectionClass('Apple'); // // var_dump($internalclass->isInternal()); // var_dump($userclass->isInternal()); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isinternal.php // ========== REFLECTIONCLASS_ISINTERNAL - END // SYNTAX: // bool ReflectionClass::isInternal() return $return_reflectionclass_isinternal; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISINTERNAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERABLE // ============================== OFFLINE // ============================== ABOUT // Check whether this class is iterable. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isIterable() - PHP_7 >= PHP_7_2_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclass_isiterable($reflectionclass) { $return_reflectionclass_isiterable = false; // ========== REFLECTIONCLASS_ISITERABLE - BEGIN // ===== ABOUT // Check whether this class is iterable // ===== DESCRIPTION // Check whether this class is iterable (i.e. can be used inside foreach). // ===== SUPPORTED // PHP_7 >= PHP_7_2_0, PHP_8 // ===== SYNTAX // public ReflectionClass::isIterable(): bool // ===== CODE $return_reflectionclass_isiterable = $reflectionclass->isIterable( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 Basic ReflectionClass::isIterable() Usage // [php] // // class IteratorClass implements Iterator { // public function __construct() { } // public function key() { } // public function current() { } // function next() { } // function valid() { } // function rewind() { } // } // class DerivedClass extends IteratorClass { } // class NonIterator { } // // function dump_iterable($class) { // $reflection = new ReflectionClass($class); // var_dump($reflection->isIterable()); // } // // $classes = array("ArrayObject", "IteratorClass", "DerivedClass", "NonIterator"); // // foreach ($classes as $class) { // echo "Is $class iterable? "; // dump_iterable($class); // } // [/php] // The above example will output: // [result] // Is ArrayObject iterable? bool(true) // Is IteratorClass iterable? bool(true) // Is DerivedClass iterable? bool(true) // Is NonIterator iterable? bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isiterable.php // ========== REFLECTIONCLASS_ISITERABLE - END // SYNTAX: // bool ReflectionClass::isIterable() return $return_reflectionclass_isiterable; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERATEABLE // ============================== PUBLIC // ============================== ABOUT // ReflectionClass::isIterateable - Alias of ReflectionClass::isIterable(). // // Check whether this class is iterable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isIterateable() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isiterateable($reflectionclass) { $return_reflectionclass_isiterateable = false; // ========== REFLECTIONCLASS_ISITERATEABLE - BEGIN // ===== ABOUT // ReflectionClass::isIterateable - Alias of ReflectionClass::isIterable() // ===== DESCRIPTION // Alias of ReflectionClass::isIterable() // As of PHP 7.2.0, instead of the missspelled RefectionClass::isIterateable(), ReflectionClass::isIterable() should be preferred. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // ===== CODE $return_reflectionclass_isiterateable = $reflectionclass->isIterateable( // This function has no parameters. ); // Return // bool // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isiterateable.php // ========== REFLECTIONCLASS_ISITERATEABLE - END // ========== REFLECTIONCLASS_ISITERABLE - BEGIN // ===== ABOUT // Check whether this class is iterable // ===== DESCRIPTION // Check whether this class is iterable (i.e. can be used inside foreach). // ===== SUPPORTED // PHP_7 >= PHP_7_2_0, PHP_8 // ===== SYNTAX // public ReflectionClass::isIterable(): bool // ===== CODE // $return_reflectionclass_isiterable = $reflectionclass->isIterable( // // This function has no parameters. // ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 Basic ReflectionClass::isIterable() Usage // [php] // // class IteratorClass implements Iterator { // public function __construct() { } // public function key() { } // public function current() { } // function next() { } // function valid() { } // function rewind() { } // } // class DerivedClass extends IteratorClass { } // class NonIterator { } // // function dump_iterable($class) { // $reflection = new ReflectionClass($class); // var_dump($reflection->isIterable()); // } // // $classes = array("ArrayObject", "IteratorClass", "DerivedClass", "NonIterator"); // // foreach ($classes as $class) { // echo "Is $class iterable? "; // dump_iterable($class); // } // [/php] // The above example will output: // [result] // Is ArrayObject iterable? bool(true) // Is IteratorClass iterable? bool(true) // Is DerivedClass iterable? bool(true) // Is NonIterator iterable? bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isiterable.php // ========== REFLECTIONCLASS_ISITERABLE - END // SYNTAX: // bool ReflectionClass::isIterateable() return $return_reflectionclass_isiterateable; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISITERATEABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISREADONLY // ============================== OFFLINE // ============================== ABOUT // Checks if class is readonly. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isReadOnly() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_variable_reflection_reflectionclass_isreadonly($reflectionclass) { $return_reflectionclass_isreadonly = false; // ========== REFLECTIONCLASS_ISREADONLY - BEGIN // ===== ABOUT // Checks if class is readonly // ===== DESCRIPTION // Checks if a class is readonly. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // public ReflectionClass::isReadOnly(): bool // ===== CODE $return_reflectionclass_isreadonly = $reflectionclass->isReadOnly( // This function has no parameters. ); // Return Values // true if a class is readonly, false otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionClass::isReadOnly() example // [php] // class TestClass { } // readonly class TestReadOnlyClass { } // // $normalClass = new ReflectionClass('TestClass'); // $readonlyClass = new ReflectionClass('TestReadOnlyClass'); // // var_dump($normalClass->isReadOnly()); // var_dump($readonlyClass->isReadOnly()); // // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isreadonly.php // ========== REFLECTIONCLASS_ISREADONLY - END // SYNTAX: // bool ReflectionClass::isReadOnly() return $return_reflectionclass_isreadonly; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISREADONLY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISSUBCLASSOF // ============================== PUBLIC // ============================== ABOUT // Checks if a subclass. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isSubclassOf() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_issubclassof($reflectionclass, $class) { $return_reflectionclass_issubclassof = false; // ========== REFLECTIONCLASS_ISSUBCLASSOF - BEGIN // ===== ABOUT // Checks if a subclass // ===== DESCRIPTION // Checks if the class is a subclass of a specified class or implements a specified interface. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isSubclassOf(ReflectionClass|string $class): bool // ===== CODE $return_reflectionclass_issubclassof = $reflectionclass->isSubclassOf( $class // ReflectionClass|string class - Either the name of the class as string or a ReflectionClass object of the class to check against. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.issubclassof.php // ========== REFLECTIONCLASS_ISSUBCLASSOF - END // SYNTAX: // bool ReflectionClass::isSubclassOf(ReflectionClass|string $class) return $return_reflectionclass_issubclassof; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISSUBCLASSOF // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISTRAIT // ============================== PUBLIC // ============================== ABOUT // Returns whether this is a trait. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isTrait() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_istrait($reflectionclass) { $return_reflectionclass_istrait = false; // ========== REFLECTIONCLASS_ISTRAIT - BEGIN // ===== ABOUT // Returns whether this is a trait // ===== DESCRIPTION // Check whether this ReflectionClass refers to a trait. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isTrait(): bool // ===== CODE $return_reflectionclass_istrait = $reflectionclass->isTrait( // This function has no parameters. ); // Return Values // Returns true if this is a trait, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.istrait.php // ========== REFLECTIONCLASS_ISTRAIT - END // SYNTAX: // bool ReflectionClass::isTrait() return $return_reflectionclass_istrait; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISTRAIT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISUSERDEFINED // ============================== PUBLIC // ============================== ABOUT // Checks if user defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::isUserDefined() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_isuserdefined($reflectionclass) { $return_reflectionclass_isuserdefined = false; // ========== REFLECTIONCLASS_ISUSERDEFINED - BEGIN // ===== ABOUT // Checks if user defined // ===== DESCRIPTION // Checks whether the class is user-defined, as opposed to internal. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::isUserDefined(): bool // ===== CODE $return_reflectionclass_isuserdefined = $reflectionclass->isUserDefined( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.isuserdefined.php // ========== REFLECTIONCLASS_ISUSERDEFINED - END // SYNTAX: // bool ReflectionClass::isUserDefined() return $return_reflectionclass_isuserdefined; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_ISUSERDEFINED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCE // ============================== PUBLIC // ============================== ABOUT // Creates a new class instance from given arguments. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::newInstance() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_newinstance($reflectionclass, $args) { $return_reflectionclass_newinstance = null; // ========== REFLECTIONCLASS_NEWINSTANCE - BEGIN // ===== ABOUT // Creates a new class instance from given arguments // ===== DESCRIPTION // Creates a new instance of the class. The given arguments are passed to the class constructor. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::newInstance(mixed ...$args): object // ===== CODE $return_reflectionclass_newinstance = $reflectionclass->newInstance( $args // mixed args - Accepts a variable number of arguments which are passed to the class constructor, much like call_user_func(). ); // Return Values // object // // Errors/Exceptions // A ReflectionException if the class constructor is not public. // A ReflectionException if the class does not have a constructor and the args parameter contains one or more parameters. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.newinstance.php // ========== REFLECTIONCLASS_NEWINSTANCE - END // SYNTAX: // object ReflectionClass::newInstance(mixed $args) return $return_reflectionclass_newinstance; // object } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEARGS // ============================== PUBLIC // ============================== ABOUT // Creates a new class instance from given arguments. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::newInstanceArgs() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_newinstanceargs($reflectionclass, $args = array()) { $return_reflectionclass_newinstanceargs = null; // ========== REFLECTIONCLASS_NEWINSTANCEARGS - BEGIN // ===== ABOUT // Creates a new class instance from given arguments // ===== DESCRIPTION // Creates a new instance of the class, the given arguments are passed to the class constructor. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::newInstanceArgs(array $args = []): ?object // ===== CODE $return_reflectionclass_newinstanceargs = $reflectionclass->newInstanceArgs( $args // array args - The parameters to be passed to the class constructor as an array. ); // Return Values // Returns a new instance of the class, or null on failure. // // Errors/Exceptions // A ReflectionException if the class constructor is not public. // A ReflectionException if the class does not have a constructor and the args parameter contains one or more parameters. // // [examples] // Examples // [example] // Example #1 Basic usage of ReflectionClass::newInstanceArgs() // [php] // $class = new ReflectionClass('ReflectionFunction'); // $instance = $class->newInstanceArgs(array('substr')); // var_dump($instance); // [/php] // The above example will output: // [result] // object(ReflectionFunction)#2 (1) { // ["name"]=> // string(6) "substr" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.newinstanceargs.php // ========== REFLECTIONCLASS_NEWINSTANCEARGS - END // SYNTAX: // object ReflectionClass::newInstanceArgs(array $args = array()) return $return_reflectionclass_newinstanceargs; // object } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEARGS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEWITHOUTCONSTRUCTOR // ============================== PUBLIC // ============================== ABOUT // Creates a new class instance without invoking the constructor. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::newInstanceWithoutConstructor() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_newinstancewithoutconstructor($reflectionclass) { $return_reflectionclass_newinstancewithoutconstructor = null; // ========== REFLECTIONCLASS_NEWINSTANCEWITHOUTCONSTRUCTOR - BEGIN // ===== ABOUT // Creates a new class instance without invoking the constructor // ===== DESCRIPTION // Creates a new instance of the class without invoking the constructor. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::newInstanceWithoutConstructor(): object // ===== CODE $return_reflectionclass_newinstancewithoutconstructor = $reflectionclass->newInstanceWithoutConstructor( ); // Return Values // object // // Errors/Exceptions // A ReflectionException if the class is an internal class that cannot be instantiated without invoking the constructor. This exception is limited only to internal classes that are final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-31) // URL: https://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php // ========== REFLECTIONCLASS_NEWINSTANCEWITHOUTCONSTRUCTOR - END // SYNTAX: // object ReflectionClass::newInstanceWithoutConstructor() return $return_reflectionclass_newinstancewithoutconstructor; // object } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_NEWINSTANCEWITHOUTCONSTRUCTOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_SETSTATICPROPERTYVALUE // ============================== PUBLIC // ============================== ABOUT // Sets static property value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::setStaticPropertyValue() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_setstaticpropertyvalue($reflectionclass, $name, $value) { // ========== REFLECTIONCLASS_SETSTATICPROPERTYVALUE - BEGIN // ===== ABOUT // Sets static property value // ===== DESCRIPTION // Sets static property value. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::setStaticPropertyValue(string $name, mixed $value): void // ===== CODE $reflectionclass->setStaticPropertyValue( $name, // string name - Property name. $value // mixed value - New property value. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclass.setstaticpropertyvalue.php // ========== REFLECTIONCLASS_SETSTATICPROPERTYVALUE - END // SYNTAX: // void ReflectionClass::setStaticPropertyValue(string $name, mixed $value) // return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_SETSTATICPROPERTYVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the string representation of the ReflectionClass object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClass::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionclass_tostring($reflectionclass) { $return_reflectionclass_tostring = null; // ========== REFLECTIONCLASS_TOSTRING - BEGIN // ===== ABOUT // Returns the string representation of the ReflectionClass object // ===== DESCRIPTION // Returns the string representation of the ReflectionClass object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionClass::__toString(): string // ===== CODE $return_reflectionclass_tostring = $reflectionclass->__toString( // This function has no parameters. ); // Return Values // A string representation of this ReflectionClass instance. // // [examples] // Examples // [example] // Example #1 ReflectionClass::__toString() example // [php] // $reflectionClass = new ReflectionClass('Exception'); // echo $reflectionClass->__toString(); // [/php] // The above example will output: // [result] // Class [ class Exception ] { // // - Constants [0] { // } // // - Static properties [0] { // } // // - Static methods [0] { // } // // - Properties [7] { // Property [ protected $message ] // Property [ private $string ] // Property [ protected $code ] // Property [ protected $file ] // Property [ protected $line ] // Property [ private $trace ] // Property [ private $previous ] // } // // - Methods [10] { // Method [ final private method __clone ] { // } // // Method [ public method __construct ] { // // - Parameters [3] { // Parameter #0 [ $message ] // Parameter #1 [ $code ] // Parameter #2 [ $previous ] // } // } // // Method [ final public method getMessage ] { // } // // Method [ final public method getCode ] { // } // // Method [ final public method getFile ] { // } // // Method [ final public method getLine ] { // } // // Method [ final public method getTrace ] { // } // // Method [ final public method getPrevious ] { // } // // Method [ final public method getTraceAsString ] { // } // // Method [ public method __toString ] { // } // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclass.tostring.php // ========== REFLECTIONCLASS_TOSTRING - END // SYNTAX: // string ReflectionClass::__toString() return $return_reflectionclass_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_CONSTRUCT - ReflectionClassConstant php_variable_reflection_reflectionclassconstant_construct(object|string $class, string $constant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_EXPORT - string php_variable_reflection_reflectionclassconstant_export(ReflectionClassConstant $reflectionclassconstant, mixed $class, string $name, bool $return) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETATTRIBUTES - array php_variable_reflection_reflectionclassconstant_getattributes(ReflectionClassConstant $reflectionclassconstant, string $name = null, int $flags = 0) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDECLARINGCLASS - ReflectionClass php_variable_reflection_reflectionclassconstant_getdeclaringclass(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDOCCOMMENT - string|false php_variable_reflection_reflectionclassconstant_getdoccomment(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETMODIFIERS - int php_variable_reflection_reflectionclassconstant_getmodifiers(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETNAME - string php_variable_reflection_reflectionclassconstant_getname(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETVALUE - mixed php_variable_reflection_reflectionclassconstant_getvalue(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISENUMCASE - bool php_variable_reflection_reflectionclassconstant_isenumcase(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISFINAL - bool php_variable_reflection_reflectionclassconstant_isfinal(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPRIVATE - bool php_variable_reflection_reflectionclassconstant_isprivate(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPROTECTED - bool php_variable_reflection_reflectionclassconstant_isprotected(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPUBLIC - bool php_variable_reflection_reflectionclassconstant_ispublic(ReflectionClassConstant $reflectionclassconstant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_TOSTRING - string php_variable_reflection_reflectionclassconstant_tostring(ReflectionClassConstant $reflectionclassconstant) // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (14) // OFFLINE | ReflectionClassConstant::__construct() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::export() - PHP_7 >= PHP_7_1_0 // OFFLINE | ReflectionClassConstant::getAttributes() - PHP_8 // OFFLINE | ReflectionClassConstant::getDeclaringClass() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::getDocComment() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::getModifiers() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::getName() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::getValue() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::isEnumCase() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionClassConstant::isFinal() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionClassConstant::isPrivate() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::isProtected() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::isPublic() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionClassConstant::__toString() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== USING DATA_TYPES (9) // OFFLINE | ReflectionClassConstant - PHP_7 >= PHP_7_1_0, PHP_8 // object // string // mixed // bool // array // int // ReflectionClass - PHP_5, PHP_7, PHP_8 // false // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Constructs a ReflectionClassConstant. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::__construct() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_construct($class, $constant) { $return_reflectionclassconstant_construct = null; // ========== REFLECTIONCLASSCONSTANT_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionClassConstant // ===== DESCRIPTION // Constructs a new ReflectionClassConstant object. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::__construct(object|string $class, string $constant) // ===== CODE $return_reflectionclassconstant_construct = new ReflectionClassConstant( $class, // object|string class - Either a string containing the name of the class to reflect, or an object. $constant // string constant - The name of the class constant. ); // Return // ReflectionClassConstant // // Errors/Exceptions // Throws an Exception in case the given class constant does not exist. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.construct.php // ========== REFLECTIONCLASSCONSTANT_CONSTRUCT - END // SYNTAX: // ReflectionClassConstant ReflectionClassConstant::__construct(object|string $class, string $constant) return $return_reflectionclassconstant_construct; // ReflectionClassConstant } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::export() - PHP_7 >= PHP_7_1_0 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_export($reflectionclassconstant, $class, $name, $return) { $return_reflectionclassconstant_export = null; // ========== REFLECTIONCLASSCONSTANT_EXPORT - BEGIN // ===== ABOUT // Export // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflection. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0 // ===== SYNTAX // public static ReflectionClassConstant::export(mixed $class, string $name, bool $return = ?): string // ===== CODE $return_reflectionclassconstant_export = $reflectionclassconstant->export( $class, // mixed class - The reflection to export. $name, // string name - The class constant name. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.export.php // ========== REFLECTIONCLASSCONSTANT_EXPORT - END // SYNTAX: // string ReflectionClassConstant::export(mixed $class, string $name, bool $return) return $return_reflectionclassconstant_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETATTRIBUTES // ============================== OFFLINE // ============================== ABOUT // Gets Attributes. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getAttributes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getattributes($reflectionclassconstant, $name = null, $flags = 0) { $return_reflectionclassconstant_getattributes = null; // ========== REFLECTIONCLASSCONSTANT_GETATTRIBUTES - BEGIN // ===== ABOUT // Gets Attributes // ===== DESCRIPTION // Returns all attributes declared on this class constant as an array of ReflectionAttribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getAttributes(?string $name = null, int $flags = 0): array // ===== CODE $return_reflectionclassconstant_getattributes = $reflectionclassconstant->getAttributes( $name, // string name - Filter the results to include only ReflectionAttribute instances for attributes matching this class name. $flags // int flags - Flags for determining how to filter the results, if name is provided. // Default is 0 which will only return results for attributes that are of the class name. // The only other option available, is to use ReflectionAttribute::IS_INSTANCEOF, which will instead use instanceof for filtering. ); // Return Values // Array of attributes, as a ReflectionAttribute object. // // [examples] // Examples // [example] // Example #1 Basic usage // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // class Basket { // #[Fruit] // #[Red] // public const APPLE = 'apple'; // } // // $classConstant = new ReflectionClassConstant('Basket', 'APPLE'); // $attributes = $classConstant->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #2 Filtering results by class name // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // class Basket { // #[Fruit] // #[Red] // public const APPLE = 'apple'; // } // // $classConstant = new ReflectionClassConstant('Basket', 'APPLE'); // $attributes = $classConstant->getAttributes('Fruit'); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // ) // [/result] // [/example] // [example] // Example #3 Filtering results by class name, with inheritance // [php] // interface Color { // } // // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red implements Color { // } // // class Basket { // #[Fruit] // #[Red] // public const APPLE = 'apple'; // } // // $classConstant = new ReflectionClassConstant('Basket', 'APPLE'); // $attributes = $classConstant->getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Red // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getattributes.php // ========== REFLECTIONCLASSCONSTANT_GETATTRIBUTES - END // SYNTAX: // array ReflectionClassConstant::getAttributes(string $name = null, int $flags = 0) return $return_reflectionclassconstant_getattributes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETATTRIBUTES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDECLARINGCLASS // ============================== OFFLINE // ============================== ABOUT // Gets declaring class. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getDeclaringClass() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getdeclaringclass($reflectionclassconstant) { $return_reflectionclassconstant_getdeclaringclass = null; // ========== REFLECTIONCLASSCONSTANT_GETDECLARINGCLASS - BEGIN // ===== ABOUT // Gets declaring class // ===== DESCRIPTION // Gets the declaring class. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getDeclaringClass(): ReflectionClass // ===== CODE $return_reflectionclassconstant_getdeclaringclass = $reflectionclassconstant->getDeclaringClass( // This function has no parameters. ); // Return Values // A ReflectionClass object. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getdeclaringclass.php // ========== REFLECTIONCLASSCONSTANT_GETDECLARINGCLASS - END // SYNTAX: // ReflectionClass ReflectionClassConstant::getDeclaringClass() return $return_reflectionclassconstant_getdeclaringclass; // ReflectionClass } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDECLARINGCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDOCCOMMENT // ============================== OFFLINE // ============================== ABOUT // Gets doc comments. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getDocComment() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getdoccomment($reflectionclassconstant) { $return_reflectionclassconstant_getdoccomment = false; // ========== REFLECTIONCLASSCONSTANT_GETDOCCOMMENT - BEGIN // ===== ABOUT // Gets doc comments // ===== DESCRIPTION // Gets doc comments from a class constant. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getDocComment(): string|false // ===== CODE $return_reflectionclassconstant_getdoccomment = $reflectionclassconstant->getDocComment( // This function has no parameters. ); // Return Values // The doc comment if it exists, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getdoccomment.php // ========== REFLECTIONCLASSCONSTANT_GETDOCCOMMENT - END // SYNTAX: // string|false ReflectionClassConstant::getDocComment() return $return_reflectionclassconstant_getdoccomment; // string|false } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETDOCCOMMENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETMODIFIERS // ============================== OFFLINE // ============================== ABOUT // Gets the class constant modifiers. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getModifiers() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getmodifiers($reflectionclassconstant) { $return_reflectionclassconstant_getmodifiers = 0; // ========== REFLECTIONCLASSCONSTANT_GETMODIFIERS - BEGIN // ===== ABOUT // Gets the class constant modifiers // ===== DESCRIPTION // Returns a bitfield of the access modifiers for this class constant. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getModifiers(): int // ===== CODE $return_reflectionclassconstant_getmodifiers = $reflectionclassconstant->getModifiers( // This function has no parameters. ); // Return Values // A numeric representation of the modifiers. The actual meaning of these modifiers are described under predefined constants. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getmodifiers.php // ========== REFLECTIONCLASSCONSTANT_GETMODIFIERS - END // SYNTAX: // int ReflectionClassConstant::getModifiers() return $return_reflectionclassconstant_getmodifiers; // int } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETMODIFIERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETNAME // ============================== OFFLINE // ============================== ABOUT // Get name of the constant. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getName() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getname($reflectionclassconstant) { $return_reflectionclassconstant_getname = null; // ========== REFLECTIONCLASSCONSTANT_GETNAME - BEGIN // ===== ABOUT // Get name of the constant // ===== DESCRIPTION // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getName(): string // ===== CODE $return_reflectionclassconstant_getname = $reflectionclassconstant->getName( // This function has no parameters. ); // Return Values // Returns the constant's name. // // Changelog // Version - Description // 8.1.0 - Throws an Error in case the name property has not been initialized. Previously, the method returned false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getname.php // ========== REFLECTIONCLASSCONSTANT_GETNAME - END // SYNTAX: // string ReflectionClassConstant::getName() return $return_reflectionclassconstant_getname; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETVALUE // ============================== OFFLINE // ============================== ABOUT // Gets value. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::getValue() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_getvalue($reflectionclassconstant) { $return_reflectionclassconstant_getvalue = null; // ========== REFLECTIONCLASSCONSTANT_GETVALUE - BEGIN // ===== ABOUT // Gets value // ===== DESCRIPTION // Gets the class constant's value. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::getValue(): mixed // ===== CODE $return_reflectionclassconstant_getvalue = $reflectionclassconstant->getValue( // This function has no parameters. ); // Return Values // The value of the class constant. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.getvalue.php // ========== REFLECTIONCLASSCONSTANT_GETVALUE - END // SYNTAX: // mixed ReflectionClassConstant::getValue() return $return_reflectionclassconstant_getvalue; // mixed } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_GETVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISENUMCASE // ============================== OFFLINE // ============================== ABOUT // Checks if class constant is an Enum case. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::isEnumCase() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_isenumcase($reflectionclassconstant) { $return_reflectionclassconstant_isenumcase = false; // ========== REFLECTIONCLASSCONSTANT_ISENUMCASE - BEGIN // ===== ABOUT // Checks if class constant is an Enum case // ===== DESCRIPTION // Checks if the class constant is an Enum case. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionClassConstant::isEnumCase(): bool // ===== CODE $return_reflectionclassconstant_isenumcase = $reflectionclassconstant->isEnumCase( // This function has no parameters. ); // Return Values // true if the class constant is an Enum case; false otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionClassConstant::isEnumCase() example // Distinguish between Enum cases and regular class constants. // [php] // enum Status // { // const BORING_CONSTANT = 'test'; // const ENUM_VALUE = Status::PUBLISHED; // // case DRAFT; // case PUBLISHED; // case ARCHIVED; // } // // $reflection = new ReflectionEnum(Status::class); // foreach ($reflection->getReflectionConstants() as $constant) { // echo "{$constant->name} is ", // $constant->isEnumCase() ? "an enum case" : "a regular class constant", // PHP_EOL; // } // [/php] // The above example will output: // [result] // BORING_CONSTANT is a regular class constant // ENUM_VALUE is a regular class constant // DRAFT is an enum case // PUBLISHED is an enum case // ARCHIVED is an enum case // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.isenumcase.php // ========== REFLECTIONCLASSCONSTANT_ISENUMCASE - END // SYNTAX: // bool ReflectionClassConstant::isEnumCase() return $return_reflectionclassconstant_isenumcase; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISENUMCASE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISFINAL // ============================== OFFLINE // ============================== ABOUT // Checks if class constant is final. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::isFinal() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_isfinal($reflectionclassconstant) { $return_reflectionclassconstant_isfinal = false; // ========== REFLECTIONCLASSCONSTANT_ISFINAL - BEGIN // ===== ABOUT // Checks if class constant is final // ===== DESCRIPTION // Checks if the class constant is final. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionClassConstant::isFinal(): bool // ===== CODE $return_reflectionclassconstant_isfinal = $reflectionclassconstant->isFinal( // This function has no parameters. ); // Return Values // true if the class constant is final, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.isfinal.php // ========== REFLECTIONCLASSCONSTANT_ISFINAL - END // SYNTAX: // bool ReflectionClassConstant::isFinal() return $return_reflectionclassconstant_isfinal; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISFINAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPRIVATE // ============================== OFFLINE // ============================== ABOUT // Checks if class constant is private. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::isPrivate() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_isprivate($reflectionclassconstant) { $return_reflectionclassconstant_isprivate = false; // ========== REFLECTIONCLASSCONSTANT_ISPRIVATE - BEGIN // ===== ABOUT // Checks if class constant is private // ===== DESCRIPTION // Checks if the class constant is private. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::isPrivate(): bool // ===== CODE $return_reflectionclassconstant_isprivate = $reflectionclassconstant->isPrivate( // This function has no parameters. ); // Return Values // true if the class constant is private, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.isprivate.php // ========== REFLECTIONCLASSCONSTANT_ISPRIVATE - END // SYNTAX: // bool ReflectionClassConstant::isPrivate() return $return_reflectionclassconstant_isprivate; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPRIVATE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPROTECTED // ============================== OFFLINE // ============================== ABOUT // Checks if class constant is protected. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::isProtected() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_isprotected($reflectionclassconstant) { $return_reflectionclassconstant_isprotected = false; // ========== REFLECTIONCLASSCONSTANT_ISPROTECTED - BEGIN // ===== ABOUT // Checks if class constant is protected // ===== DESCRIPTION // Checks if the class constant is protected. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::isProtected(): bool // ===== CODE $return_reflectionclassconstant_isprotected = $reflectionclassconstant->isProtected( // This function has no parameters. ); // Return Values // true if the class constant is protected, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.isprotected.php // ========== REFLECTIONCLASSCONSTANT_ISPROTECTED - END // SYNTAX: // bool ReflectionClassConstant::isProtected() return $return_reflectionclassconstant_isprotected; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPROTECTED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPUBLIC // ============================== OFFLINE // ============================== ABOUT // Checks if class constant is public. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::isPublic() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_ispublic($reflectionclassconstant) { $return_reflectionclassconstant_ispublic = false; // ========== REFLECTIONCLASSCONSTANT_ISPUBLIC - BEGIN // ===== ABOUT // Checks if class constant is public // ===== DESCRIPTION // Checks if the class constant is public. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::isPublic(): bool // ===== CODE $return_reflectionclassconstant_ispublic = $reflectionclassconstant->isPublic( // This function has no parameters. ); // Return Values // true if the class constant is public, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.ispublic.php // ========== REFLECTIONCLASSCONSTANT_ISPUBLIC - END // SYNTAX: // bool ReflectionClassConstant::isPublic() return $return_reflectionclassconstant_ispublic; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_ISPUBLIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_TOSTRING // ============================== OFFLINE // ============================== ABOUT // Returns the string representation of the ReflectionClassConstant object. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionClassConstant::__toString() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionclassconstant_tostring($reflectionclassconstant) { $return_reflectionclassconstant_tostring = null; // ========== REFLECTIONCLASSCONSTANT_TOSTRING - BEGIN // ===== ABOUT // Returns the string representation of the ReflectionClassConstant object // ===== DESCRIPTION // Returns the string representation of the ReflectionClassConstant object. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionClassConstant::__toString(): string // ===== CODE $return_reflectionclassconstant_tostring = $reflectionclassconstant->__toString( // This function has no parameters. ); // Return Values // A string representation of this ReflectionClassConstant instance. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionclassconstant.tostring.php // ========== REFLECTIONCLASSCONSTANT_TOSTRING - END // SYNTAX: // string ReflectionClassConstant::__toString() return $return_reflectionclassconstant_tostring; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONCLASSCONSTANT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_CONSTRUCT - ReflectionEnum php_variable_reflection_reflectionenum_construct(object|string $objectOrClass) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETBACKINGTYPE - ReflectionNamedType php_variable_reflection_reflectionenum_getbackingtype(ReflectionEnum $reflectionenum) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASE - ReflectionEnumUnitCase php_variable_reflection_reflectionenum_getcase(ReflectionEnum $reflectionenum, string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASES - array php_variable_reflection_reflectionenum_getcases(ReflectionEnum $reflectionenum) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_HASCASE - bool php_variable_reflection_reflectionenum_hascase(ReflectionEnum $reflectionenum, string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUM_ISBACKED - bool php_variable_reflection_reflectionenum_isbacked(ReflectionEnum $reflectionenum) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (6) // OFFLINE | ReflectionEnum::__construct() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnum::getBackingType() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnum::getCase() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnum::getCases() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnum::hasCase() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnum::isBacked() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (7) // OFFLINE | ReflectionEnum - PHP_8 >= PHP_8_1_0 // object // string // OFFLINE | ReflectionNamedType - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionEnumUnitCase - PHP_8 >= PHP_8_1_0 // array // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Instantiates a ReflectionEnum object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::__construct() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_construct($objectOrClass) { $return_reflectionenum_construct = null; // ========== REFLECTIONENUM_CONSTRUCT - BEGIN // ===== ABOUT // Instantiates a ReflectionEnum object // ===== DESCRIPTION // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::__construct(object|string $objectOrClass) // ===== CODE $return_reflectionenum_construct = new ReflectionEnum( $objectOrClass // object|string objectOrClass - An enum instance or a name. ); // Return // ReflectionEnum // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-01) // URL: https://www.php.net/manual/en/reflectionenum.construct.php // ========== REFLECTIONENUM_CONSTRUCT - END // SYNTAX: // ReflectionEnum ReflectionEnum::__construct(object|string $objectOrClass) return $return_reflectionenum_construct; // ReflectionEnum } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETBACKINGTYPE // ============================== OFFLINE // ============================== ABOUT // Gets the backing type of an Enum, if any. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::getBackingType() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_getbackingtype($reflectionenum) { $return_reflectionenum_getbackingtype = null; // ========== REFLECTIONENUM_GETBACKINGTYPE - BEGIN // ===== ABOUT // Gets the backing type of an Enum, if any // ===== DESCRIPTION // If the enumeration is a Backed Enum, this method will return an instance of ReflectionType for the backing type of the Enum. If it is not a Backed Enum, it will return null. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::getBackingType(): ?ReflectionNamedType // ===== CODE $return_reflectionenum_getbackingtype = $reflectionenum->getBackingType( // This function has no parameters. ); // Return Values // An instance of ReflectionNamedType, or null if the Enum has no backing type. // // Changelog // Version - Description // 8.2.0 - The return type is now declared as ?ReflectionNamedType. Previously, ?ReflectionType was declared. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::getBackingType() example // [php] // enum Suit: string // { // case Hearts = 'H'; // case Diamonds = 'D'; // case Clubs = 'C'; // case Spades = 'S'; // } // // $rEnum = new ReflectionEnum(Suit::class); // // $rBackingType = $rEnum->getBackingType(); // // var_dump((string)$rBackingType); // [/php] // The above example will output: // [result] // string(6) "string" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenum.getbackingtype.php // ========== REFLECTIONENUM_GETBACKINGTYPE - END // SYNTAX: // ReflectionNamedType ReflectionEnum::getBackingType() return $return_reflectionenum_getbackingtype; // ReflectionNamedType } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETBACKINGTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASE // ============================== OFFLINE // ============================== ABOUT // Returns a specific case of an Enum. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::getCase() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_getcase($reflectionenum, $name) { $return_reflectionenum_getcase = null; // ========== REFLECTIONENUM_GETCASE - BEGIN // ===== ABOUT // Returns a specific case of an Enum // ===== DESCRIPTION // Returns the reflection object for a specific Enum case by name. If the requested case is not defined, a ReflectionException is thrown. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::getCase(string $name): ReflectionEnumUnitCase // ===== CODE $return_reflectionenum_getcase = $reflectionenum->getCase( $name // string name - The name of the case to retrieve. ); // Return Values // An instance of ReflectionEnumUnitCase or ReflectionEnumBackedCase, as appropriate. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::getCase() example // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // // $rEnum = new ReflectionEnum(Suit::class); // // $rCase = $rEnum->getCase('Clubs'); // // var_dump($rCase->getValue()); // [/php] // The above example will output: // [result] // enum(Suit::Clubs) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenum.getcase.php // ========== REFLECTIONENUM_GETCASE - END // SYNTAX: // ReflectionEnumUnitCase ReflectionEnum::getCase(string $name) return $return_reflectionenum_getcase; // ReflectionEnumUnitCase } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASES // ============================== OFFLINE // ============================== ABOUT // Returns a list of all cases on an Enum. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::getCases() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_getcases($reflectionenum) { $return_reflectionenum_getcases = null; // ========== REFLECTIONENUM_GETCASES - BEGIN // ===== ABOUT // Returns a list of all cases on an Enum // ===== DESCRIPTION // An Enum may contain zero or more cases. This method retrieves all defined cases, in lexical order (that is, the order they appear in the source code). // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::getCases(): array // ===== CODE $return_reflectionenum_getcases = $reflectionenum->getCases( // This function has no parameters. ); // Return Values // An array of Enum reflection objects, one for each case in the Enum. For a Unit Enum, they will all be instances of ReflectionEnumUnitCase. For a Backed Enum, they will all be instances of ReflectionEnumBackedCase. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::getCases() example // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // // $rEnum = new ReflectionEnum(Suit::class); // // $cases = $rEnum->getCases(); // // foreach ($cases as $rCase) { // var_dump($rCase->getValue()); // } // [/php] // The above example will output: // [result] // enum(Suit::Hearts) // enum(Suit::Diamonds) // enum(Suit::Clubs) // enum(Suit::Spades) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenum.getcases.php // ========== REFLECTIONENUM_GETCASES - END // SYNTAX: // array ReflectionEnum::getCases() return $return_reflectionenum_getcases; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_GETCASES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_HASCASE // ============================== OFFLINE // ============================== ABOUT // Checks for a case on an Enum. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::hasCase() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_hascase($reflectionenum, $name) { $return_reflectionenum_hascase = false; // ========== REFLECTIONENUM_HASCASE - BEGIN // ===== ABOUT // Checks for a case on an Enum // ===== DESCRIPTION // Determines if a given case is defined on an Enum. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::hasCase(string $name): bool // ===== CODE $return_reflectionenum_hascase = $reflectionenum->hasCase( $name // string name - The case to check for. ); // Return Values // true if the case is defined, false if not. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::hasCase() example // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // // $rEnum = new ReflectionEnum(Suit::class); // // var_dump($rEnum->hasCase('Hearts')); // var_dump($rEnum->hasCase('Horseshoes')); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenum.hascase.php // ========== REFLECTIONENUM_HASCASE - END // SYNTAX: // bool ReflectionEnum::hasCase(string $name) return $return_reflectionenum_hascase; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_HASCASE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_ISBACKED // ============================== OFFLINE // ============================== ABOUT // Determines if an Enum is a Backed Enum. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnum::isBacked() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenum_isbacked($reflectionenum) { $return_reflectionenum_isbacked = false; // ========== REFLECTIONENUM_ISBACKED - BEGIN // ===== ABOUT // Determines if an Enum is a Backed Enum // ===== DESCRIPTION // A Backed Enum is one that has a native backing scalar equivalent, either a string or an int. Not all Enums are backed. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnum::isBacked(): bool // ===== CODE $return_reflectionenum_isbacked = $reflectionenum->isBacked( // This function has no parameters. ); // Return Values // true if the Enum has a backing scalar, false if not. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::isBacked() example // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // // enum BackedSuit: string // { // case Hearts = 'H'; // case Diamonds = 'D'; // case Clubs = 'C'; // case Spades = 'S'; // } // // var_dump((new ReflectionEnum(Suit::class))->isBacked()); // var_dump((new ReflectionEnum(BackedSuit::class))->isBacked()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenum.isbacked.php // ========== REFLECTIONENUM_ISBACKED - END // SYNTAX: // bool ReflectionEnum::isBacked() return $return_reflectionenum_isbacked; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM_ISBACKED // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUM // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_CONSTRUCT - ReflectionEnumUnitCase php_variable_reflection_reflectionenumunitcase_construct(object|string $class, string $constant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETENUM - ReflectionEnum php_variable_reflection_reflectionenumunitcase_getenum(ReflectionEnumUnitCase $reflectionenumunitcase) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETVALUE - UnitEnum php_variable_reflection_reflectionenumunitcase_getvalue(ReflectionEnumUnitCase $reflectionenumunitcase) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (3) // OFFLINE | ReflectionEnumUnitCase::__construct() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnumUnitCase::getEnum() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnumUnitCase::getValue() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (5) // OFFLINE | ReflectionEnumUnitCase - PHP_8 >= PHP_8_1_0 // object // string // OFFLINE | ReflectionEnum - PHP_8 >= PHP_8_1_0 // UnitEnum // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Instantiates a ReflectionEnumUnitCase object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnumUnitCase::__construct() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenumunitcase_construct($class, $constant) { $return_reflectionenumunitcase_construct = null; // ========== REFLECTIONENUMUNITCASE_CONSTRUCT - BEGIN // ===== ABOUT // Instantiates a ReflectionEnumUnitCase object // ===== DESCRIPTION // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnumUnitCase::__construct(object|string $class, string $constant) // ===== CODE $return_reflectionenumunitcase_construct = new ReflectionEnumUnitCase( $class, // object|string class - An enum instance or a name. $constant // string constant - An enum constant name. ); // Return // ReflectionEnumUnitCase // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenumunitcase.construct.php // ========== REFLECTIONENUMUNITCASE_CONSTRUCT - END // SYNTAX: // ReflectionEnumUnitCase ReflectionEnumUnitCase::__construct(object|string $class, string $constant) return $return_reflectionenumunitcase_construct; // ReflectionEnumUnitCase } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETENUM // ============================== OFFLINE // ============================== ABOUT // Gets the reflection of the enum of this case. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnumUnitCase::getEnum() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenumunitcase_getenum($reflectionenumunitcase) { $return_reflectionenumunitcase_getenum = null; // ========== REFLECTIONENUMUNITCASE_GETENUM - BEGIN // ===== ABOUT // Gets the reflection of the enum of this case // ===== DESCRIPTION // Gets the reflection of the enum of this case. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnumUnitCase::getEnum(): ReflectionEnum // ===== CODE $return_reflectionenumunitcase_getenum = $reflectionenumunitcase->getEnum( // This function has no parameters. ); // Return Values // A ReflectionEnum instance describing the Enum this case belongs to. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenumunitcase.getenum.php // ========== REFLECTIONENUMUNITCASE_GETENUM - END // SYNTAX: // ReflectionEnum ReflectionEnumUnitCase::getEnum() return $return_reflectionenumunitcase_getenum; // ReflectionEnum } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETENUM // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETVALUE // ============================== OFFLINE // ============================== ABOUT // Gets the enum case object described by this reflection object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnumUnitCase::getValue() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenumunitcase_getvalue($reflectionenumunitcase) { $return_reflectionenumunitcase_getvalue = null; // ========== REFLECTIONENUMUNITCASE_GETVALUE - BEGIN // ===== ABOUT // Gets the enum case object described by this reflection object // ===== DESCRIPTION // Returns the enum case object described by this reflection object. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnumUnitCase::getValue(): UnitEnum // ===== CODE $return_reflectionenumunitcase_getvalue = $reflectionenumunitcase->getValue( // This function has no parameters. ); // Return Values // The enum case object described by this reflection object. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::getValue() example // [php] // enum Suit // { // case Hearts; // case Diamonds; // case Clubs; // case Spades; // } // // $rEnum = new ReflectionEnum(Suit::class); // // $rCase = $rEnum->getCase('Diamonds'); // // var_dump($rCase->getValue()); // [/php] // The above example will output: // [result] // enum(Suit::Diamonds) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenumunitcase.getvalue.php // ========== REFLECTIONENUMUNITCASE_GETVALUE - END // SYNTAX: // UnitEnum ReflectionEnumUnitCase::getValue() return $return_reflectionenumunitcase_getvalue; // UnitEnum } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE_GETVALUE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMUNITCASE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_CONSTRUCT - ReflectionEnumBackedCase php_variable_reflection_reflectionenumbackedcase_construct(object|string $class, string $constant) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_GETBACKINGVALUE - int|string php_variable_reflection_reflectionenumbackedcase_getbackingvalue(ReflectionEnumBackedCase $reflectionenumbackedcase) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (2) // OFFLINE | ReflectionEnumBackedCase::__construct() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionEnumBackedCase::getBackingValue() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (4) // OFFLINE | ReflectionEnumBackedCase - PHP_8 >= PHP_8_1_0 // object // string // int // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Instantiates a ReflectionEnumBackedCase object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnumBackedCase::__construct() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenumbackedcase_construct($class, $constant) { $return_reflectionenumbackedcase_construct = null; // ========== REFLECTIONENUMBACKEDCASE_CONSTRUCT - BEGIN // ===== ABOUT // Instantiates a ReflectionEnumBackedCase object // ===== DESCRIPTION // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnumBackedCase::__construct(object|string $class, string $constant) // ===== CODE $return_reflectionenumbackedcase_construct = new ReflectionEnumBackedCase( $class, // object|string class - An enum instance or a name. $constant // string constant - An enum constant name. ); // Return // ReflectionEnumBackedCase // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenumbackedcase.construct.php // ========== REFLECTIONENUMBACKEDCASE_CONSTRUCT - END // SYNTAX: // ReflectionEnumBackedCase ReflectionEnumBackedCase::__construct(object|string $class, string $constant) return $return_reflectionenumbackedcase_construct; // ReflectionEnumBackedCase } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_GETBACKINGVALUE // ============================== OFFLINE // ============================== ABOUT // Gets the scalar value backing this Enum case. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionEnumBackedCase::getBackingValue() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionenumbackedcase_getbackingvalue($reflectionenumbackedcase) { $return_reflectionenumbackedcase_getbackingvalue = 0; // ========== REFLECTIONENUMBACKEDCASE_GETBACKINGVALUE - BEGIN // ===== ABOUT // Gets the scalar value backing this Enum case // ===== DESCRIPTION // Gets the scalar value backing this Enum case. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionEnumBackedCase::getBackingValue(): int|string // ===== CODE $return_reflectionenumbackedcase_getbackingvalue = $reflectionenumbackedcase->getBackingValue( // This function has no parameters. ); // Return Values // The scalar equivalent of this enum case. // // [examples] // Examples // [example] // Example #1 ReflectionEnum::getBackingValue() example // [php] // enum Suit: string // { // case Hearts = 'H'; // case Diamonds = 'D'; // case Clubs = 'C'; // case Spades = 'S'; // } // // $rEnum = new ReflectionEnum(Suit::class); // // $rCase = $rEnum->getCase('Spades'); // // var_dump($rCase->getBackingValue()); // [/php] // The above example will output: // [result] // string(1) "S" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionenumbackedcase.getbackingvalue.php // ========== REFLECTIONENUMBACKEDCASE_GETBACKINGVALUE - END // SYNTAX: // int|string ReflectionEnumBackedCase::getBackingValue() return $return_reflectionenumbackedcase_getbackingvalue; // int|string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE_GETBACKINGVALUE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONENUMBACKEDCASE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CLONE - void php_variable_reflection_reflectionzendextension_clone(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CONSTRUCT - ReflectionZendExtension php_variable_reflection_reflectionzendextension_construct(string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_EXPORT - string php_variable_reflection_reflectionzendextension_export(ReflectionZendExtension $reflectionzendextension, string $name, bool $return) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETAUTHOR - string php_variable_reflection_reflectionzendextension_getauthor(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETCOPYRIGHT - string php_variable_reflection_reflectionzendextension_getcopyright(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETNAME - string php_variable_reflection_reflectionzendextension_getname(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETURL - string php_variable_reflection_reflectionzendextension_geturl(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETVERSION - string php_variable_reflection_reflectionzendextension_getversion(ReflectionZendExtension $reflectionzendextension) // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_TOSTRING - string php_variable_reflection_reflectionzendextension_tostring(ReflectionZendExtension $reflectionzendextension) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (9) // ReflectionZendExtension::__clone() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // OFFLINE | ReflectionZendExtension::export() - PHP_5 >= PHP_5_4_0, PHP_7 // ReflectionZendExtension::getAuthor() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::getCopyright() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::getName() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::getURL() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::getVersion() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionZendExtension::__toString() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (4) // void // ReflectionZendExtension - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // string // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CLONE // ============================== PUBLIC // ============================== ABOUT // Clone handler. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::__clone() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_clone($reflectionzendextension) { // ========== REFLECTIONZENDEXTENSION_CLONE - BEGIN // ===== ABOUT // Clone handler // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // private ReflectionZendExtension::__clone(): void // ===== CODE $reflectionzendextension->__clone( // This function has no parameters. ); // Return Values // void // // Changelog // Version - Description // 8.1.0 - This method is no longer final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.clone.php // ========== REFLECTIONZENDEXTENSION_CLONE - END // SYNTAX: // void ReflectionZendExtension::__clone() // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CLONE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionZendExtension object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_construct($name) { $return_reflectionzendextension_construct = null; // ========== REFLECTIONZENDEXTENSION_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionZendExtension object // ===== DESCRIPTION // Constructs a new ReflectionZendExtension object. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::__construct(string $name) // ===== CODE $return_reflectionzendextension_construct = new ReflectionZendExtension( $name // string name - The extension name. ); // Return // ReflectionZendExtension // // Errors/Exceptions // Throws ReflectionException if the extension to reflect does not exist. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.construct.php // ========== REFLECTIONZENDEXTENSION_CONSTRUCT - END // SYNTAX: // ReflectionZendExtension ReflectionZendExtension::__construct(string $name) return $return_reflectionzendextension_construct; // ReflectionZendExtension } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::export() - PHP_5 >= PHP_5_4_0, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionzendextension_export($reflectionzendextension, $name, $return) { $return_reflectionzendextension_export = null; // ========== REFLECTIONZENDEXTENSION_EXPORT - BEGIN // ===== ABOUT // Export // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7 // ===== SYNTAX // public static ReflectionZendExtension::export(string $name, bool $return = ?): string // ===== CODE $return_reflectionzendextension_export = $reflectionzendextension->export( $name, // string $name $return // bool $return ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.export.php // ========== REFLECTIONZENDEXTENSION_EXPORT - END // SYNTAX: // string ReflectionZendExtension::export(string $name, bool $return) return $return_reflectionzendextension_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETAUTHOR // ============================== PUBLIC // ============================== ABOUT // Gets author. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::getAuthor() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_getauthor($reflectionzendextension) { $return_reflectionzendextension_getauthor = null; // ========== REFLECTIONZENDEXTENSION_GETAUTHOR - BEGIN // ===== ABOUT // Gets author // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::getAuthor(): string // ===== CODE $return_reflectionzendextension_getauthor = $reflectionzendextension->getAuthor( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.getauthor.php // ========== REFLECTIONZENDEXTENSION_GETAUTHOR - END // SYNTAX: // string ReflectionZendExtension::getAuthor() return $return_reflectionzendextension_getauthor; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETAUTHOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETCOPYRIGHT // ============================== PUBLIC // ============================== ABOUT // Gets copyright. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::getCopyright() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_getcopyright($reflectionzendextension) { $return_reflectionzendextension_getcopyright = null; // ========== REFLECTIONZENDEXTENSION_GETCOPYRIGHT - BEGIN // ===== ABOUT // Gets copyright // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::getCopyright(): string // ===== CODE $return_reflectionzendextension_getcopyright = $reflectionzendextension->getCopyright( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.getcopyright.php // ========== REFLECTIONZENDEXTENSION_GETCOPYRIGHT - END // SYNTAX: // string ReflectionZendExtension::getCopyright() return $return_reflectionzendextension_getcopyright; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETCOPYRIGHT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::getName() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_getname($reflectionzendextension) { $return_reflectionzendextension_getname = null; // ========== REFLECTIONZENDEXTENSION_GETNAME - BEGIN // ===== ABOUT // Gets name // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::getName(): string // ===== CODE $return_reflectionzendextension_getname = $reflectionzendextension->getName( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.getname.php // ========== REFLECTIONZENDEXTENSION_GETNAME - END // SYNTAX: // string ReflectionZendExtension::getName() return $return_reflectionzendextension_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETURL // ============================== PUBLIC // ============================== ABOUT // Gets URL. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::getURL() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_geturl($reflectionzendextension) { $return_reflectionzendextension_geturl = null; // ========== REFLECTIONZENDEXTENSION_GETURL - BEGIN // ===== ABOUT // Gets URL // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::getURL(): string // ===== CODE $return_reflectionzendextension_geturl = $reflectionzendextension->getURL( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.geturl.php // ========== REFLECTIONZENDEXTENSION_GETURL - END // SYNTAX: // string ReflectionZendExtension::getURL() return $return_reflectionzendextension_geturl; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETURL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETVERSION // ============================== PUBLIC // ============================== ABOUT // Gets version. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::getVersion() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_getversion($reflectionzendextension) { $return_reflectionzendextension_getversion = null; // ========== REFLECTIONZENDEXTENSION_GETVERSION - BEGIN // ===== ABOUT // Gets version // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::getVersion(): string // ===== CODE $return_reflectionzendextension_getversion = $reflectionzendextension->getVersion( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.getversion.php // ========== REFLECTIONZENDEXTENSION_GETVERSION - END // SYNTAX: // string ReflectionZendExtension::getVersion() return $return_reflectionzendextension_getversion; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_GETVERSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_TOSTRING // ============================== PUBLIC // ============================== ABOUT // To string handler. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionZendExtension::__toString() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionzendextension_tostring($reflectionzendextension) { $return_reflectionzendextension_tostring = null; // ========== REFLECTIONZENDEXTENSION_TOSTRING - BEGIN // ===== ABOUT // To string handler // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionZendExtension::__toString(): string // ===== CODE $return_reflectionzendextension_tostring = $reflectionzendextension->__toString( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionzendextension.tostring.php // ========== REFLECTIONZENDEXTENSION_TOSTRING - END // SYNTAX: // string ReflectionZendExtension::__toString() return $return_reflectionzendextension_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONZENDEXTENSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CLONE - void php_variable_reflection_reflectionextension_clone(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CONSTRUCT - ReflectionExtension php_variable_reflection_reflectionextension_construct(string $name) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_EXPORT - string php_variable_reflection_reflectionextension_export(ReflectionExtension $reflectionextension, string $name, string $return = false) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSES - array php_variable_reflection_reflectionextension_getclasses(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSNAMES - array php_variable_reflection_reflectionextension_getclassnames(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCONSTANTS - array php_variable_reflection_reflectionextension_getconstants(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETDEPENDENCIES - array php_variable_reflection_reflectionextension_getdependencies(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETFUNCTIONS - array php_variable_reflection_reflectionextension_getfunctions(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETINIENTRIES - array php_variable_reflection_reflectionextension_getinientries(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETNAME - string php_variable_reflection_reflectionextension_getname(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETVERSION - string php_variable_reflection_reflectionextension_getversion(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_INFO - void php_variable_reflection_reflectionextension_info(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISPERSISTENT - bool php_variable_reflection_reflectionextension_ispersistent(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISTEMPORARY - bool php_variable_reflection_reflectionextension_istemporary(ReflectionExtension $reflectionextension) // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_TOSTRING - string php_variable_reflection_reflectionextension_tostring(ReflectionExtension $reflectionextension) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (15) // ReflectionExtension::__clone() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionExtension::export() - PHP_5, PHP_7 // ReflectionExtension::getClasses() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getClassNames() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getConstants() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getDependencies() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ReflectionExtension::getFunctions() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getINIEntries() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getName() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::getVersion() - PHP_5, PHP_7, PHP_8 // ReflectionExtension::info() - PHP_5 >= PHP_5_2_4, PHP_7, PHP_8 // ReflectionExtension::isPersistent() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionExtension::isTemporary() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionExtension::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // void // ReflectionExtension - PHP_5, PHP_7, PHP_8 // string // array // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CLONE // ============================== PUBLIC // ============================== ABOUT // Clones. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::__clone() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_clone($reflectionextension) { // ========== REFLECTIONEXTENSION_CLONE - BEGIN // ===== ABOUT // Clones // ===== DESCRIPTION // The clone method prevents an object from being cloned. Reflection objects cannot be cloned. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // private ReflectionExtension::__clone(): void // ===== CODE $reflectionextension->__clone( // This function has no parameters. ); // Return Values // No value is returned, if called a fatal error will occur. // // Changelog // Version - Description // 8.1.0 - This method is no longer final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-02) // URL: https://www.php.net/manual/en/reflectionextension.clone.php // ========== REFLECTIONEXTENSION_CLONE - END // SYNTAX: // void ReflectionExtension::__clone() // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CLONE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionExtension. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_construct($name) { $return_reflectionextension_construct = null; // ========== REFLECTIONEXTENSION_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionExtension // ===== DESCRIPTION // Construct a ReflectionExtension object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::__construct(string $name) // ===== CODE $return_reflectionextension_construct = new ReflectionExtension( $name // string name - Name of the extension. ); // Return // ReflectionExtension // // Errors/Exceptions // Throws ReflectionException if the extension to reflect does not exist. // // [examples] // Examples // [example] // Example #1 ReflectionExtension example // [php] // $ext = new ReflectionExtension('Reflection'); // // printf('Extension: %s (version: %s)', $ext->getName(), $ext->getVersion()); // [/php] // The above example will output something similar to: // [result] // Extension: Reflection (version: $Revision$) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.construct.php // ========== REFLECTIONEXTENSION_CONSTRUCT - END // SYNTAX: // ReflectionExtension ReflectionExtension::__construct(string $name) return $return_reflectionextension_construct; // ReflectionExtension } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionExtension::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionextension_export($reflectionextension, $name, $return = false) { $return_reflectionextension_export = null; // ========== REFLECTIONEXTENSION_EXPORT - BEGIN // ===== ABOUT // Export // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflected extension. The output format of this function is the same as the CLI argument --re [extension]. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionExtension::export(string $name, string $return = false): string // ===== CODE $return_reflectionextension_export = $reflectionextension->export( $name, // string name - The reflection to export. $return // string return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.export.php // ========== REFLECTIONEXTENSION_EXPORT - END // SYNTAX: // string ReflectionExtension::export(string $name, string $return = false) return $return_reflectionextension_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSES // ============================== PUBLIC // ============================== ABOUT // Gets classes. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getClasses() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getclasses($reflectionextension) { $return_reflectionextension_getclasses = null; // ========== REFLECTIONEXTENSION_GETCLASSES - BEGIN // ===== ABOUT // Gets classes // ===== DESCRIPTION // Gets a list of classes from an extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getClasses(): array // ===== CODE $return_reflectionextension_getclasses = $reflectionextension->getClasses( // This function has no parameters. ); // Return Values // An array of ReflectionClass objects, one for each class within the extension. If no classes are defined, an empty array is returned. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getClasses() example // [php] // $ext = new ReflectionExtension('XMLWriter'); // var_dump($ext->getClasses()); // [/php] // The above example will output something similar to: // [result] // array(1) { // ["XMLWriter"]=> // object(ReflectionClass)#2 (1) { // ["name"]=> // string(9) "XMLWriter" // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getclasses.php // ========== REFLECTIONEXTENSION_GETCLASSES - END // SYNTAX: // array ReflectionExtension::getClasses() return $return_reflectionextension_getclasses; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSNAMES // ============================== PUBLIC // ============================== ABOUT // Gets class names. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getClassNames() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getclassnames($reflectionextension) { $return_reflectionextension_getclassnames = null; // ========== REFLECTIONEXTENSION_GETCLASSNAMES - BEGIN // ===== ABOUT // Gets class names // ===== DESCRIPTION // Gets a listing of class names as defined in the extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getClassNames(): array // ===== CODE $return_reflectionextension_getclassnames = $reflectionextension->getClassNames( // This function has no parameters. ); // Return Values // An array of class names, as defined in the extension. If no classes are defined, an empty array is returned. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getClassNames() example // [php] // $ext = new ReflectionExtension('XMLWriter'); // var_dump($ext->getClassNames()); // [/php] // The above example will output something similar to: // [result] // array(1) { // [0]=> // string(9) "XMLWriter" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getclassnames.php // ========== REFLECTIONEXTENSION_GETCLASSNAMES - END // SYNTAX: // array ReflectionExtension::getClassNames() return $return_reflectionextension_getclassnames; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCLASSNAMES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCONSTANTS // ============================== PUBLIC // ============================== ABOUT // Gets constants. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getConstants() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getconstants($reflectionextension) { $return_reflectionextension_getconstants = null; // ========== REFLECTIONEXTENSION_GETCONSTANTS - BEGIN // ===== ABOUT // Gets constants // ===== DESCRIPTION // Get defined constants from an extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getConstants(): array // ===== CODE $return_reflectionextension_getconstants = $reflectionextension->getConstants( // This function has no parameters. ); // Return Values // An associative array with constant names as keys. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getConstants() example // [php] // $ext = new ReflectionExtension('DOM'); // // print_r($ext->getConstants()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [XML_ELEMENT_NODE] => 1 // [XML_ATTRIBUTE_NODE] => 2 // [XML_TEXT_NODE] => 3 // [XML_CDATA_SECTION_NODE] => 4 // [XML_ENTITY_REF_NODE] => 5 // [XML_ENTITY_NODE] => 6 // [XML_PI_NODE] => 7 // [XML_COMMENT_NODE] => 8 // [XML_DOCUMENT_NODE] => 9 // [XML_DOCUMENT_TYPE_NODE] => 10 // [XML_DOCUMENT_FRAG_NODE] => 11 // [XML_NOTATION_NODE] => 12 // [XML_HTML_DOCUMENT_NODE] => 13 // [XML_DTD_NODE] => 14 // [XML_ELEMENT_DECL_NODE] => 15 // [XML_ATTRIBUTE_DECL_NODE] => 16 // [XML_ENTITY_DECL_NODE] => 17 // [XML_NAMESPACE_DECL_NODE] => 18 // [XML_LOCAL_NAMESPACE] => 18 // [XML_ATTRIBUTE_CDATA] => 1 // [XML_ATTRIBUTE_ID] => 2 // [XML_ATTRIBUTE_IDREF] => 3 // [XML_ATTRIBUTE_IDREFS] => 4 // [XML_ATTRIBUTE_ENTITY] => 6 // [XML_ATTRIBUTE_NMTOKEN] => 7 // [XML_ATTRIBUTE_NMTOKENS] => 8 // [XML_ATTRIBUTE_ENUMERATION] => 9 // [XML_ATTRIBUTE_NOTATION] => 10 // [DOM_PHP_ERR] => 0 // [DOM_INDEX_SIZE_ERR] => 1 // [DOMSTRING_SIZE_ERR] => 2 // [DOM_HIERARCHY_REQUEST_ERR] => 3 // [DOM_WRONG_DOCUMENT_ERR] => 4 // [DOM_INVALID_CHARACTER_ERR] => 5 // [DOM_NO_DATA_ALLOWED_ERR] => 6 // [DOM_NO_MODIFICATION_ALLOWED_ERR] => 7 // [DOM_NOT_FOUND_ERR] => 8 // [DOM_NOT_SUPPORTED_ERR] => 9 // [DOM_INUSE_ATTRIBUTE_ERR] => 10 // [DOM_INVALID_STATE_ERR] => 11 // [DOM_SYNTAX_ERR] => 12 // [DOM_INVALID_MODIFICATION_ERR] => 13 // [DOM_NAMESPACE_ERR] => 14 // [DOM_INVALID_ACCESS_ERR] => 15 // [DOM_VALIDATION_ERR] => 16 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getconstants.php // ========== REFLECTIONEXTENSION_GETCONSTANTS - END // SYNTAX: // array ReflectionExtension::getConstants() return $return_reflectionextension_getconstants; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETCONSTANTS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETDEPENDENCIES // ============================== PUBLIC // ============================== ABOUT // Gets dependencies. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getDependencies() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getdependencies($reflectionextension) { $return_reflectionextension_getdependencies = null; // ========== REFLECTIONEXTENSION_GETDEPENDENCIES - BEGIN // ===== ABOUT // Gets dependencies // ===== DESCRIPTION // Gets dependencies, by listing both required and conflicting dependencies. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getDependencies(): array // ===== CODE $return_reflectionextension_getdependencies = $reflectionextension->getDependencies( // This function has no parameters. ); // Return Values // An associative array with dependencies as keys and either Required, Optional or Conflicts as the values. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getDependencies() example // [php] // $dom = new ReflectionExtension('dom'); // // print_r($dom->getDependencies()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [libxml] => Required // [domxml] => Conflicts // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getdependencies.php // ========== REFLECTIONEXTENSION_GETDEPENDENCIES - END // SYNTAX: // array ReflectionExtension::getDependencies() return $return_reflectionextension_getdependencies; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETDEPENDENCIES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETFUNCTIONS // ============================== PUBLIC // ============================== ABOUT // Gets extension functions. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getFunctions() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getfunctions($reflectionextension) { $return_reflectionextension_getfunctions = null; // ========== REFLECTIONEXTENSION_GETFUNCTIONS - BEGIN // ===== ABOUT // Gets extension functions // ===== DESCRIPTION // Get defined functions from an extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getFunctions(): array // ===== CODE $return_reflectionextension_getfunctions = $reflectionextension->getFunctions( // This function has no parameters. ); // Return Values // An associative array of ReflectionFunction objects, for each function defined in the extension with the keys being the function names. If no function are defined, an empty array is returned. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getFunctions() example // [php] // $dom = new ReflectionExtension('SimpleXML'); // // print_r($dom->getFunctions()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [simplexml_load_file] => ReflectionFunction Object // ( // [name] => simplexml_load_file // ) // // [simplexml_load_string] => ReflectionFunction Object // ( // [name] => simplexml_load_string // ) // // [simplexml_import_dom] => ReflectionFunction Object // ( // [name] => simplexml_import_dom // ) // // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getfunctions.php // ========== REFLECTIONEXTENSION_GETFUNCTIONS - END // SYNTAX: // array ReflectionExtension::getFunctions() return $return_reflectionextension_getfunctions; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETFUNCTIONS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETINIENTRIES // ============================== PUBLIC // ============================== ABOUT // Gets extension ini entries. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getINIEntries() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getinientries($reflectionextension) { $return_reflectionextension_getinientries = null; // ========== REFLECTIONEXTENSION_GETINIENTRIES - BEGIN // ===== ABOUT // Gets extension ini entries // ===== DESCRIPTION // Get the ini entries for an extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getINIEntries(): array // ===== CODE $return_reflectionextension_getinientries = $reflectionextension->getINIEntries( // This function has no parameters. ); // Return Values // An associative array with the ini entries as keys, with their defined values as values. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getINIEntries() example // [php] // $ext = new ReflectionExtension('mysql'); // // print_r($ext->getINIEntries()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [mysql.allow_persistent] => 1 // [mysql.max_persistent] => -1 // [mysql.max_links] => -1 // [mysql.default_host] => // [mysql.default_user] => // [mysql.default_password] => // [mysql.default_port] => // [mysql.default_socket] => // [mysql.connect_timeout] => 60 // [mysql.trace_mode] => // [mysql.allow_local_infile] => 1 // [mysql.cache_size] => 2000 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getinientries.php // ========== REFLECTIONEXTENSION_GETINIENTRIES - END // SYNTAX: // array ReflectionExtension::getINIEntries() return $return_reflectionextension_getinientries; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETINIENTRIES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets extension name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getname($reflectionextension) { $return_reflectionextension_getname = null; // ========== REFLECTIONEXTENSION_GETNAME - BEGIN // ===== ABOUT // Gets extension name // ===== DESCRIPTION // Gets the extensions name. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getName(): string // ===== CODE $return_reflectionextension_getname = $reflectionextension->getName( // This function has no parameters. ); // Return Values // The extensions name. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getName() example // [php] // $ext = new ReflectionExtension('mysqli'); // var_dump($ext->getName()); // [/php] // The above example will output something similar to: // [result] // string(6) "mysqli" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getname.php // ========== REFLECTIONEXTENSION_GETNAME - END // SYNTAX: // string ReflectionExtension::getName() return $return_reflectionextension_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETVERSION // ============================== PUBLIC // ============================== ABOUT // Gets extension version. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::getVersion() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_getversion($reflectionextension) { $return_reflectionextension_getversion = null; // ========== REFLECTIONEXTENSION_GETVERSION - BEGIN // ===== ABOUT // Gets extension version // ===== DESCRIPTION // Gets the version of the extension. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::getVersion(): ?string // ===== CODE $return_reflectionextension_getversion = $reflectionextension->getVersion( // This function has no parameters. ); // Return Values // The version of the extension, or null if the extension has no version. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::getVersion() example // [php] // $ext = new ReflectionExtension('mysqli'); // var_dump($ext->getVersion()); // [/php] // The above example will output something similar to: // [result] // string(3) "0.1" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.getversion.php // ========== REFLECTIONEXTENSION_GETVERSION - END // SYNTAX: // string ReflectionExtension::getVersion() return $return_reflectionextension_getversion; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_GETVERSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_INFO // ============================== PUBLIC // ============================== ABOUT // Print extension info. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::info() - PHP_5 >= PHP_5_2_4, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_info($reflectionextension) { // ========== REFLECTIONEXTENSION_INFO - BEGIN // ===== ABOUT // Print extension info // ===== DESCRIPTION // Prints out the "phpinfo()" snippet for the given extension. // ===== SUPPORTED // PHP_5 >= PHP_5_2_4, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::info(): void // ===== CODE $reflectionextension->info( // This function has no parameters. ); // Return Values // Information about the extension. // // [examples] // Examples // [example] // Example #1 ReflectionExtension::info() example // [php] // $ext = new ReflectionExtension('mysqli'); // $ext->info(); // [/php] // The above example will output something similar to: // [result] // mysqli // // MysqlI Support => enabled // Client API library version => mysqlnd 5.0.5-dev - 081106 - $Revision$ // Active Persistent Links => 0 // Inactive Persistent Links => 0 // Active Links => 0 // Persistent cache => enabled // put_hits => 0 // put_misses => 0 // get_hits => 0 // get_misses => 0 // size => 2000 // free_items => 2000 // references => 2 // // Directive => Local Value => Master Value // mysqli.max_links => Unlimited => Unlimited // mysqli.max_persistent => Unlimited => Unlimited // mysqli.allow_persistent => On => On // mysqli.default_host => no value => no value // mysqli.default_user => no value => no value // mysqli.default_pw => no value => no value // mysqli.default_port => 3306 => 3306 // mysqli.default_socket => no value => no value // mysqli.reconnect => Off => Off // mysqli.allow_local_infile => On => On // mysqli.cache_size => 2000 => 2000 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.info.php // ========== REFLECTIONEXTENSION_INFO - END // SYNTAX: // void ReflectionExtension::info() // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_INFO // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISPERSISTENT // ============================== PUBLIC // ============================== ABOUT // Returns whether this extension is persistent. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::isPersistent() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_ispersistent($reflectionextension) { $return_reflectionextension_ispersistent = false; // ========== REFLECTIONEXTENSION_ISPERSISTENT - BEGIN // ===== ABOUT // Returns whether this extension is persistent // ===== DESCRIPTION // Check whether the extension is persistent. // An extension is persistent when it is loaded using php.ini. An extension is temporary, not persistent, when it is loaded with dl(). // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::isPersistent(): bool // ===== CODE $return_reflectionextension_ispersistent = $reflectionextension->isPersistent( // This function has no parameters. ); // Return Values // Returns true for extensions loaded by extension, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.ispersistent.php // ========== REFLECTIONEXTENSION_ISPERSISTENT - END // SYNTAX: // bool ReflectionExtension::isPersistent() return $return_reflectionextension_ispersistent; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISPERSISTENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISTEMPORARY // ============================== PUBLIC // ============================== ABOUT // Returns whether this extension is temporary. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::isTemporary() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_istemporary($reflectionextension) { $return_reflectionextension_istemporary = false; // ========== REFLECTIONEXTENSION_ISTEMPORARY - BEGIN // ===== ABOUT // Returns whether this extension is temporary // ===== DESCRIPTION // Check whether the extension is temporary. // An extension is temporary when it is loaded with dl(). // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::isTemporary(): bool // ===== CODE $return_reflectionextension_istemporary = $reflectionextension->isTemporary( // This function has no parameters. ); // Return Values // Returns true for extensions loaded by dl(), false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.istemporary.php // ========== REFLECTIONEXTENSION_ISTEMPORARY - END // SYNTAX: // bool ReflectionExtension::isTemporary() return $return_reflectionextension_istemporary; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_ISTEMPORARY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_TOSTRING // ============================== PUBLIC // ============================== ABOUT // To string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionExtension::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionextension_tostring($reflectionextension) { $return_reflectionextension_tostring = null; // ========== REFLECTIONEXTENSION_TOSTRING - BEGIN // ===== ABOUT // To string // ===== DESCRIPTION // Exports a reflected extension and returns it as a string. This is the same as the ReflectionExtension::export() with the return set to true. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionExtension::__toString(): string // ===== CODE $return_reflectionextension_tostring = $reflectionextension->__toString( // This function has no parameters. ); // Return Values // Returns the exported extension as a string, in the same way as the ReflectionExtension::export(). // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionextension.tostring.php // ========== REFLECTIONEXTENSION_TOSTRING - END // SYNTAX: // string ReflectionExtension::__toString() return $return_reflectionextension_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONEXTENSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_CONSTRUCT - ReflectionFunction php_variable_reflection_reflectionfunction_construct(Closure|string $function) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_EXPORT - string php_variable_reflection_reflectionfunction_export(ReflectionFunction $reflectionfunction, string $name, string $return) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_GETCLOSURE - Closure php_variable_reflection_reflectionfunction_getclosure(ReflectionFunction $reflectionfunction) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKE - mixed php_variable_reflection_reflectionfunction_invoke(ReflectionFunction $reflectionfunction, mixed $args) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKEARGS - mixed php_variable_reflection_reflectionfunction_invokeargs(ReflectionFunction $reflectionfunction, array $args) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISANONYMOUS - bool php_variable_reflection_reflectionfunction_isanonymous(ReflectionFunction $reflectionfunction) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISDISABLED - bool php_variable_reflection_reflectionfunction_isdisabled(ReflectionFunction $reflectionfunction) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_TOSTRING - string php_variable_reflection_reflectionfunction_tostring(ReflectionFunction $reflectionfunction) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (8) // ReflectionFunction::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionFunction::export() - PHP_5, PHP_7 // ReflectionFunction::getClosure() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionFunction::invoke() - PHP_5, PHP_7, PHP_8 // ReflectionFunction::invokeArgs() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // OFFLINE | ReflectionFunction::isAnonymous() - PHP_8 >= PHP_8_2_0 // OFFLINE | ReflectionFunction::isDisabled() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunction::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // ReflectionFunction - PHP_5, PHP_7, PHP_8 // Closure // string // mixed // array // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionFunction object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunction_construct($function) { $return_reflectionfunction_construct = null; // ========== REFLECTIONFUNCTION_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionFunction object // ===== DESCRIPTION // Constructs a ReflectionFunction object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::__construct(Closure|string $function) // ===== CODE $return_reflectionfunction_construct = new ReflectionFunction( $function // Closure|string function - The name of the function to reflect or a closure. ); // Return // ReflectionFunction // // Errors/Exceptions // A ReflectionException if the function parameter does not contain a valid function. // // [examples] // Examples // [example] // Example #1 ReflectionFunction::__construct() example // [php] // /** // * A simple counter // * // * @return int // */ // function counter1() // { // static $c = 0; // return ++$c; // } // // /** // * Another simple counter // * // * @return int // */ // $counter2 = function() // { // static $d = 0; // return ++$d; // // }; // // function dumpReflectionFunction($func) // { // // Print out basic information // printf( // "\n\n===> The %s function '%s'\n". // " declared in %s\n". // " lines %d to %d\n", // $func->isInternal() ? 'internal' : 'user-defined', // $func->getName(), // $func->getFileName(), // $func->getStartLine(), // $func->getEndline() // ); // // // Print documentation comment // printf("---> Documentation:\n %s\n", var_export($func->getDocComment(), 1)); // // // Print static variables if existant // if ($statics = $func->getStaticVariables()) // { // printf("---> Static variables: %s\n", var_export($statics, 1)); // } // } // // // Create an instance of the ReflectionFunction class // dumpReflectionFunction(new ReflectionFunction('counter1')); // dumpReflectionFunction(new ReflectionFunction($counter2)); // [/php] // The above example will output something similar to: // [result] // ===> The user-defined function 'counter1' // declared in Z:\reflectcounter.php // lines 7 to 11 // ---> Documentation: // '/** // * A simple counter // * // * @return int // */' // ---> Static variables: array ( // 'c' => 0, // ) // // // ===> The user-defined function '{closure}' // declared in Z:\reflectcounter.php // lines 18 to 23 // ---> Documentation: // '/** // * Another simple counter // * // * @return int // */' // ---> Static variables: array ( // 'd' => 0, // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionfunction.construct.php // ========== REFLECTIONFUNCTION_CONSTRUCT - END // SYNTAX: // ReflectionFunction ReflectionFunction::__construct(Closure|string $function) return $return_reflectionfunction_construct; // ReflectionFunction } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_EXPORT // ============================== OFFLINE // ============================== ABOUT // Exports function. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionFunction::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionfunction_export($reflectionfunction, $name, $return) { $return_reflectionfunction_export = null; // ========== REFLECTIONFUNCTION_EXPORT - BEGIN // ===== ABOUT // Exports function // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a Reflected function. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionFunction::export(string $name, string $return = ?): string // ===== CODE $return_reflectionfunction_export = $reflectionfunction->export( $name, // string name - The reflection to export. $return // string return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.export.php // ========== REFLECTIONFUNCTION_EXPORT - END // SYNTAX: // string ReflectionFunction::export(string $name, string $return) return $return_reflectionfunction_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_GETCLOSURE // ============================== PUBLIC // ============================== ABOUT // Returns a dynamically created closure for the function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::getClosure() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunction_getclosure($reflectionfunction) { $return_reflectionfunction_getclosure = null; // ========== REFLECTIONFUNCTION_GETCLOSURE - BEGIN // ===== ABOUT // Returns a dynamically created closure for the function // ===== DESCRIPTION // Get a dynamically created closure for the function. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::getClosure(): Closure // ===== CODE $return_reflectionfunction_getclosure = $reflectionfunction->getClosure( // This function has no parameters. ); // Return Values // Returns the newly created Closure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-03) // URL: https://www.php.net/manual/en/reflectionfunction.getclosure.php // ========== REFLECTIONFUNCTION_GETCLOSURE - END // SYNTAX: // Closure ReflectionFunction::getClosure() return $return_reflectionfunction_getclosure; // Closure } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_GETCLOSURE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKE // ============================== PUBLIC // ============================== ABOUT // Invokes function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::invoke() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunction_invoke($reflectionfunction, $args) { $return_reflectionfunction_invoke = null; // ========== REFLECTIONFUNCTION_INVOKE - BEGIN // ===== ABOUT // Invokes function // ===== DESCRIPTION // Invokes a reflected function. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::invoke(mixed ...$args): mixed // ===== CODE $return_reflectionfunction_invoke = $reflectionfunction->invoke( $args // mixed args - The passed in argument list. It accepts a variable number of arguments which are passed to the function much like call_user_func() is. ); // Return Values // Returns the result of the invoked function call. // // [examples] // Examples // [example] // Example #1 ReflectionFunction::invoke() example // [php] // function title($title, $name) // { // return sprintf("%s. %s\r\n", $title, $name); // } // // $function = new ReflectionFunction('title'); // // echo $function->invoke('Dr', 'Phil'); // [/php] // The above example will output: // [result] // Dr. Phil // [/result] // [/example] // [/examples] // // Notes // Note: ReflectionFunction::invoke() cannot be used when reference parameters are expected. ReflectionFunction::invokeArgs() has to be used instead (passing references in the argument list). // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.invoke.php // ========== REFLECTIONFUNCTION_INVOKE - END // SYNTAX: // mixed ReflectionFunction::invoke(mixed $args) return $return_reflectionfunction_invoke; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKEARGS // ============================== PUBLIC // ============================== ABOUT // Invokes function args. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::invokeArgs() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunction_invokeargs($reflectionfunction, $args) { $return_reflectionfunction_invokeargs = null; // ========== REFLECTIONFUNCTION_INVOKEARGS - BEGIN // ===== ABOUT // Invokes function args // ===== DESCRIPTION // Invokes the function and pass its arguments as array. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::invokeArgs(array $args): mixed // ===== CODE $return_reflectionfunction_invokeargs = $reflectionfunction->invokeArgs( $args // array args - The passed arguments to the function as an array, much like call_user_func_array() works. ); // Return Values // Returns the result of the invoked function // // Changelog // Version - Description // 8.0.0 - args keys will now be interpreted as parameter names, instead of being silently ignored. // // [examples] // Examples // [example] // Example #1 ReflectionFunction::invokeArgs() example // [php] // function title($title, $name) // { // return sprintf("%s. %s\r\n", $title, $name); // } // // $function = new ReflectionFunction('title'); // // echo $function->invokeArgs(array('Dr', 'Phil')); // [/php] // The above example will output: // [result] // Dr. Phil // [/result] // [/example] // [example] // Example #2 ReflectionFunction::invokeArgs() with references example // [php] // function get_false_conditions(array $conditions, array &$false_conditions) // { // foreach ($conditions as $condition) { // if (!$condition) { // $false_conditions[] = $condition; // } // } // } // // $function_ref = new ReflectionFunction('get_false_conditions'); // // $conditions = array(true, false, -1, 0, 1); // $false_conditions = array(); // // $function_ref->invokeArgs(array($conditions, &$false_conditions)); // // var_dump($false_conditions); // [/php] // The above example will output: // [result] // array(2) { // [0]=> // bool(false) // [1]=> // int(0) // } // [/result] // [/example] // [/examples] // // Notes // Note: If the function has arguments that need to be references, then they must be references in the passed argument list. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.invokeargs.php // ========== REFLECTIONFUNCTION_INVOKEARGS - END // SYNTAX: // mixed ReflectionFunction::invokeArgs(array $args) return $return_reflectionfunction_invokeargs; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_INVOKEARGS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISANONYMOUS // ============================== OFFLINE // ============================== ABOUT // Checks if a function is anonymous. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::isAnonymous() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_variable_reflection_reflectionfunction_isanonymous($reflectionfunction) { $return_reflectionfunction_isanonymous = false; // ========== REFLECTIONFUNCTION_ISANONYMOUS - BEGIN // ===== ABOUT // Checks if a function is anonymous // ===== DESCRIPTION // Checks if a function is anonymous. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // public ReflectionFunction::isAnonymous(): bool // ===== CODE $return_reflectionfunction_isanonymous = $reflectionfunction->isAnonymous( // This function has no parameters. ); // Return Values // Returns true if the function is anonymous, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionFunction::isAnonymous() example // [php] // // $rf = new ReflectionFunction(function() {}); // var_dump($rf->isAnonymous()); // // $rf = new ReflectionFunction('strlen'); // var_dump($rf->isAnonymous()); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.isanonymous.php // ========== REFLECTIONFUNCTION_ISANONYMOUS - END // SYNTAX: // bool ReflectionFunction::isAnonymous() return $return_reflectionfunction_isanonymous; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISANONYMOUS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISDISABLED // ============================== OFFLINE // ============================== ABOUT // Checks if function is disabled. // // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::isDisabled() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionfunction_isdisabled($reflectionfunction) { $return_reflectionfunction_isdisabled = false; // ========== REFLECTIONFUNCTION_ISDISABLED - BEGIN // ===== ABOUT // Checks if function is disabled // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Checks if the function is disabled, via the disable_functions directive. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::isDisabled(): bool // ===== CODE $return_reflectionfunction_isdisabled = $reflectionfunction->isDisabled( // This function has no parameters. ); // Return Values // true if it's disable, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.isdisabled.php // ========== REFLECTIONFUNCTION_ISDISABLED - END // SYNTAX: // bool ReflectionFunction::isDisabled() return $return_reflectionfunction_isdisabled; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_ISDISABLED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the string representation of the ReflectionFunction object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunction::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunction_tostring($reflectionfunction) { $return_reflectionfunction_tostring = null; // ========== REFLECTIONFUNCTION_TOSTRING - BEGIN // ===== ABOUT // Returns the string representation of the ReflectionFunction object // ===== DESCRIPTION // Get a human-readable description of the function, its parameters and return values. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunction::__toString(): string // ===== CODE $return_reflectionfunction_tostring = $reflectionfunction->__toString( // This function has no parameters. ); // Return Values // The string. // // [examples] // Examples // [example] // Example #1 ReflectionFunction::__toString() example // [php] // function title($title, $name) // { // return sprintf("%s. %s\r\n", $title, $name); // } // // echo new ReflectionFunction('title'); // [/php] // The above example will output something similar to: // [result] // Function [ function title ] { // @@ Command line code 1 - 1 // // - Parameters [2] { // Parameter #0 [ $title ] // Parameter #1 [ $name ] // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunction.tostring.php // ========== REFLECTIONFUNCTION_TOSTRING - END // SYNTAX: // string ReflectionFunction::__toString() return $return_reflectionfunction_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_CLONE - void php_variable_reflection_reflectionfunctionabstract_clone(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETATTRIBUTES - array php_variable_reflection_reflectionfunctionabstract_getattributes(ReflectionFunctionAbstract $reflectionfunctionabstract, string $name = null, int $flags = 0) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURESCOPECLASS - ReflectionClass php_variable_reflection_reflectionfunctionabstract_getclosurescopeclass(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURETHIS - object php_variable_reflection_reflectionfunctionabstract_getclosurethis(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSUREUSEDVARIABLES - array php_variable_reflection_reflectionfunctionabstract_getclosureusedvariables(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETDOCCOMMENT - string|false php_variable_reflection_reflectionfunctionabstract_getdoccomment(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETENDLINE - int|false php_variable_reflection_reflectionfunctionabstract_getendline(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSION - ReflectionExtension php_variable_reflection_reflectionfunctionabstract_getextension(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSIONNAME - string|false php_variable_reflection_reflectionfunctionabstract_getextensionname(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETFILENAME - string|false php_variable_reflection_reflectionfunctionabstract_getfilename(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAME - string php_variable_reflection_reflectionfunctionabstract_getname(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAMESPACENAME - string php_variable_reflection_reflectionfunctionabstract_getnamespacename(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFPARAMETERS - int php_variable_reflection_reflectionfunctionabstract_getnumberofparameters(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFREQUIREDPARAMETERS - int php_variable_reflection_reflectionfunctionabstract_getnumberofrequiredparameters(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETPARAMETERS - array php_variable_reflection_reflectionfunctionabstract_getparameters(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETRETURNTYPE - ReflectionType php_variable_reflection_reflectionfunctionabstract_getreturntype(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSHORTNAME - string php_variable_reflection_reflectionfunctionabstract_getshortname(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTARTLINE - int|false php_variable_reflection_reflectionfunctionabstract_getstartline(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTATICVARIABLES - array php_variable_reflection_reflectionfunctionabstract_getstaticvariables(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETTENTATIVERETURNTYPE - ReflectionType php_variable_reflection_reflectionfunctionabstract_gettentativereturntype(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASRETURNTYPE - bool php_variable_reflection_reflectionfunctionabstract_hasreturntype(ReflectionFunctionAbstract $reflectionfunctionabstract) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASTENTATIVERETURNTYPE - bool php_variable_reflection_reflectionfunctionabstract_hastentativereturntype(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_INNAMESPACE - bool php_variable_reflection_reflectionfunctionabstract_innamespace(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISCLOSURE - bool php_variable_reflection_reflectionfunctionabstract_isclosure(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISDEPRECATED - bool php_variable_reflection_reflectionfunctionabstract_isdeprecated(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISGENERATOR - bool php_variable_reflection_reflectionfunctionabstract_isgenerator(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISINTERNAL - bool php_variable_reflection_reflectionfunctionabstract_isinternal(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISSTATIC - bool php_variable_reflection_reflectionfunctionabstract_isstatic(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISUSERDEFINED - bool php_variable_reflection_reflectionfunctionabstract_isuserdefined(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISVARIADIC - bool php_variable_reflection_reflectionfunctionabstract_isvariadic(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_RETURNSREFERENCE - bool php_variable_reflection_reflectionfunctionabstract_returnsreference(ReflectionFunctionAbstract $reflectionfunctionabstract) // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_TOSTRING - void php_variable_reflection_reflectionfunctionabstract_tostring(ReflectionFunctionAbstract $reflectionfunctionabstract) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (32) // ReflectionFunctionAbstract::__clone() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // OFFLINE | ReflectionFunctionAbstract::getAttributes() - PHP_8 // ReflectionFunctionAbstract::getClosureScopeClass() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getClosureThis() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // OFFLINE | ReflectionFunctionAbstract::getClosureUsedVariables() - PHP_8 >= PHP_8_1_0 // ReflectionFunctionAbstract::getDocComment() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getEndLine() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getExtension() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getExtensionName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getFileName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getNamespaceName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getNumberOfParameters() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getNumberOfRequiredParameters() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getParameters() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // OFFLINE | ReflectionFunctionAbstract::getReturnType() - PHP_7, PHP_8 // ReflectionFunctionAbstract::getShortName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getStartLine() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::getStaticVariables() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // OFFLINE | ReflectionFunctionAbstract::getTentativeReturnType() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFunctionAbstract::hasReturnType() - PHP_7, PHP_8 // OFFLINE | ReflectionFunctionAbstract::hasTentativeReturnType() - PHP_8 >= PHP_8_1_0 // ReflectionFunctionAbstract::inNamespace() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isClosure() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isDeprecated() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isGenerator() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isInternal() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isStatic() - PHP_5, PHP_7, PHP_8 // ReflectionFunctionAbstract::isUserDefined() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::isVariadic() - PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::returnsReference() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ReflectionFunctionAbstract::__toString() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (11) // void // ReflectionFunctionAbstract - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // array // string // int // ReflectionClass - PHP_5, PHP_7, PHP_8 // object // false // ReflectionExtension - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionType - PHP_7, PHP_8 // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_CLONE // ============================== PUBLIC // ============================== ABOUT // Clones function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::__clone() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_clone($reflectionfunctionabstract) { // ========== REFLECTIONFUNCTIONABSTRACT_CLONE - BEGIN // ===== ABOUT // Clones function // ===== DESCRIPTION // Clones a function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // private ReflectionFunctionAbstract::__clone(): void // ===== CODE $reflectionfunctionabstract->__clone( // This function has no parameters. ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.1.0 - This method is no longer final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.clone.php // ========== REFLECTIONFUNCTIONABSTRACT_CLONE - END // SYNTAX: // void ReflectionFunctionAbstract::__clone() // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_CLONE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETATTRIBUTES // ============================== OFFLINE // ============================== ABOUT // Gets Attributes. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getAttributes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_getattributes($reflectionfunctionabstract, $name = null, $flags = 0) { $return_reflectionfunctionabstract_getattributes = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETATTRIBUTES - BEGIN // ===== ABOUT // Gets Attributes // ===== DESCRIPTION // Returns all attributes declared on this function or method as an array of ReflectionAttribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getAttributes(?string $name = null, int $flags = 0): array // ===== CODE $return_reflectionfunctionabstract_getattributes = $reflectionfunctionabstract->getAttributes( $name, // string name - Filter the results to include only ReflectionAttribute instances for attributes matching this class name. $flags // int flags - Flags for determining how to filter the results, if name is provided. // Default is 0 which will only return results for attributes that are of the class name. // The only other option available, is to use ReflectionAttribute::IS_INSTANCEOF, which will instead use instanceof for filtering. ); // Return Values // Array of attributes, as a ReflectionAttribute object. // // [examples] // Examples // [example] // Example #1 Basic usage with a class method // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // class Factory { // #[Fruit] // #[Red] // public function makeApple(): string // { // return 'apple'; // } // } // // $method = new ReflectionMethod('Factory', 'makeApple'); // $attributes = $method->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #2 Basic usage with a function // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // #[Fruit] // #[Red] // function makeApple(): string // { // return 'apple'; // } // // $function = new ReflectionFunction('makeApple'); // $attributes = $function->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #3 Filtering results by class name // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // #[Fruit] // #[Red] // function makeApple(): string // { // return 'apple'; // } // // $function = new ReflectionFunction('makeApple'); // $attributes = $function->getAttributes('Fruit'); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // ) // [/result] // [/example] // [example] // Example #4 Filtering results by class name, with inheritance // [php] // interface Color { // } // // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red implements Color { // } // // #[Fruit] // #[Red] // function makeApple(): string // { // return 'apple'; // } // // $function = new ReflectionFunction('makeApple'); // $attributes = $function->getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Red // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getattributes.php // ========== REFLECTIONFUNCTIONABSTRACT_GETATTRIBUTES - END // SYNTAX: // array ReflectionFunctionAbstract::getAttributes(string $name = null, int $flags = 0) return $return_reflectionfunctionabstract_getattributes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETATTRIBUTES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURESCOPECLASS // ============================== PUBLIC // ============================== ABOUT // Returns the scope class associated with the closure. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getClosureScopeClass() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getclosurescopeclass($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getclosurescopeclass = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSURESCOPECLASS - BEGIN // ===== ABOUT // Returns the scope class associated with the closure // ===== DESCRIPTION // Get the class enclosing the closure declaration. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getClosureScopeClass(): ?ReflectionClass // ===== CODE $return_reflectionfunctionabstract_getclosurescopeclass = $reflectionfunctionabstract->getClosureScopeClass( // This function has no parameters. ); // Return Values // Returns the class, or null if the function is not a closure or if there was no enclosing class. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getclosurescopeclass.php // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSURESCOPECLASS - END // SYNTAX: // ReflectionClass ReflectionFunctionAbstract::getClosureScopeClass() return $return_reflectionfunctionabstract_getclosurescopeclass; // ReflectionClass } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURESCOPECLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURETHIS // ============================== PUBLIC // ============================== ABOUT // Returns this pointer bound to closure. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getClosureThis() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getclosurethis($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getclosurethis = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSURETHIS - BEGIN // ===== ABOUT // Returns this pointer bound to closure // ===== DESCRIPTION // If the function is a non-static closure, get the object bound to $this inside the closure. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getClosureThis(): ?object // ===== CODE $return_reflectionfunctionabstract_getclosurethis = $reflectionfunctionabstract->getClosureThis( // This function has no parameters. ); // Return Values // Returns $this pointer. Returns null in case of an error. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getclosurethis.php // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSURETHIS - END // SYNTAX: // object ReflectionFunctionAbstract::getClosureThis() return $return_reflectionfunctionabstract_getclosurethis; // object } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSURETHIS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSUREUSEDVARIABLES // ============================== OFFLINE // ============================== ABOUT // Returns an array of the used variables in the Closure. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getClosureUsedVariables() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_getclosureusedvariables($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getclosureusedvariables = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSUREUSEDVARIABLES - BEGIN // ===== ABOUT // Returns an array of the used variables in the Closure // ===== DESCRIPTION // Returns an array of the used variables in the Closure. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFunctionAbstract::getClosureUsedVariables(): array // ===== CODE $return_reflectionfunctionabstract_getclosureusedvariables = $reflectionfunctionabstract->getClosureUsedVariables( // This function has no parameters. ); // Return Values // Returns an array of the used variables in the Closure. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::getClosureUsedVariables() example // [php] // // $one = 1; // $two = 2; // // $function = function() use ($one, $two) { // static $three = 3; // }; // // $reflector = new ReflectionFunction($function); // // var_dump($reflector->getClosureUsedVariables()); // [/php] // The above example will output something similar to: // [result] // array(2) { // ["one"]=> // int(1) // ["two"]=> // int(2) // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getclosureusedvariables.php // ========== REFLECTIONFUNCTIONABSTRACT_GETCLOSUREUSEDVARIABLES - END // SYNTAX: // array ReflectionFunctionAbstract::getClosureUsedVariables() return $return_reflectionfunctionabstract_getclosureusedvariables; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETCLOSUREUSEDVARIABLES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETDOCCOMMENT // ============================== PUBLIC // ============================== ABOUT // Gets doc comment. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getDocComment() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getdoccomment($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getdoccomment = false; // ========== REFLECTIONFUNCTIONABSTRACT_GETDOCCOMMENT - BEGIN // ===== ABOUT // Gets doc comment // ===== DESCRIPTION // Get a Doc comment from a function. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getDocComment(): string|false // ===== CODE $return_reflectionfunctionabstract_getdoccomment = $reflectionfunctionabstract->getDocComment( // This function has no parameters. ); // Return Values // The doc comment if it exists, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getdoccomment.php // ========== REFLECTIONFUNCTIONABSTRACT_GETDOCCOMMENT - END // SYNTAX: // string|false ReflectionFunctionAbstract::getDocComment() return $return_reflectionfunctionabstract_getdoccomment; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETDOCCOMMENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETENDLINE // ============================== PUBLIC // ============================== ABOUT // Gets end line number. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getEndLine() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getendline($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getendline = false; // ========== REFLECTIONFUNCTIONABSTRACT_GETENDLINE - BEGIN // ===== ABOUT // Gets end line number // ===== DESCRIPTION // Get the ending line number. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getEndLine(): int|false // ===== CODE $return_reflectionfunctionabstract_getendline = $reflectionfunctionabstract->getEndLine( // This function has no parameters. ); // Return Values // The ending line number of the user defined function, or false if unknown. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getendline.php // ========== REFLECTIONFUNCTIONABSTRACT_GETENDLINE - END // SYNTAX: // int|false ReflectionFunctionAbstract::getEndLine() return $return_reflectionfunctionabstract_getendline; // int|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETENDLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSION // ============================== PUBLIC // ============================== ABOUT // Gets extension info. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getExtension() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getextension($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getextension = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETEXTENSION - BEGIN // ===== ABOUT // Gets extension info // ===== DESCRIPTION // Get the extension information of a function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getExtension(): ?ReflectionExtension // ===== CODE $return_reflectionfunctionabstract_getextension = $reflectionfunctionabstract->getExtension( // This function has no parameters. ); // Return Values // The extension information, as a ReflectionExtension object, or null for user-defined functions. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getextension.php // ========== REFLECTIONFUNCTIONABSTRACT_GETEXTENSION - END // SYNTAX: // ReflectionExtension ReflectionFunctionAbstract::getExtension() return $return_reflectionfunctionabstract_getextension; // ReflectionExtension } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSIONNAME // ============================== PUBLIC // ============================== ABOUT // Gets extension name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getExtensionName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getextensionname($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getextensionname = false; // ========== REFLECTIONFUNCTIONABSTRACT_GETEXTENSIONNAME - BEGIN // ===== ABOUT // Gets extension name // ===== DESCRIPTION // Get the extensions name. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getExtensionName(): string|false // ===== CODE $return_reflectionfunctionabstract_getextensionname = $reflectionfunctionabstract->getExtensionName( // This function has no parameters. ); // Return Values // The name of the extension which defined the function, or false for user-defined functions. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getextensionname.php // ========== REFLECTIONFUNCTIONABSTRACT_GETEXTENSIONNAME - END // SYNTAX: // string|false ReflectionFunctionAbstract::getExtensionName() return $return_reflectionfunctionabstract_getextensionname; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETEXTENSIONNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETFILENAME // ============================== PUBLIC // ============================== ABOUT // Gets file name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getFileName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getfilename($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getfilename = false; // ========== REFLECTIONFUNCTIONABSTRACT_GETFILENAME - BEGIN // ===== ABOUT // Gets file name // ===== DESCRIPTION // Gets the file name from a user-defined function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getFileName(): string|false // ===== CODE $return_reflectionfunctionabstract_getfilename = $reflectionfunctionabstract->getFileName( // This function has no parameters. ); // Return Values // Returns the filename of the file in which the function has been defined. If the class is defined in the PHP core or in a PHP extension, false is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getfilename.php // ========== REFLECTIONFUNCTIONABSTRACT_GETFILENAME - END // SYNTAX: // string|false ReflectionFunctionAbstract::getFileName() return $return_reflectionfunctionabstract_getfilename; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETFILENAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets function name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getName() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getname($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getname = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETNAME - BEGIN // ===== ABOUT // Gets function name // ===== DESCRIPTION // Get the name of the function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getName(): string // ===== CODE $return_reflectionfunctionabstract_getname = $reflectionfunctionabstract->getName( // This function has no parameters. ); // Return Values // The name of the function. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getname.php // ========== REFLECTIONFUNCTIONABSTRACT_GETNAME - END // SYNTAX: // string ReflectionFunctionAbstract::getName() return $return_reflectionfunctionabstract_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAMESPACENAME // ============================== PUBLIC // ============================== ABOUT // Gets namespace name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getNamespaceName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getnamespacename($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getnamespacename = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETNAMESPACENAME - BEGIN // ===== ABOUT // Gets namespace name // ===== DESCRIPTION // Get the namespace name where the class is defined. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getNamespaceName(): string // ===== CODE $return_reflectionfunctionabstract_getnamespacename = $reflectionfunctionabstract->getNamespaceName( // This function has no parameters. ); // Return Values // The namespace name. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getnamespacename.php // ========== REFLECTIONFUNCTIONABSTRACT_GETNAMESPACENAME - END // SYNTAX: // string ReflectionFunctionAbstract::getNamespaceName() return $return_reflectionfunctionabstract_getnamespacename; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNAMESPACENAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFPARAMETERS // ============================== PUBLIC // ============================== ABOUT // Gets number of parameters. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getNumberOfParameters() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getnumberofparameters($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getnumberofparameters = 0; // ========== REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFPARAMETERS - BEGIN // ===== ABOUT // Gets number of parameters // ===== DESCRIPTION // Get the number of parameters that a function defines, both optional and required. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getNumberOfParameters(): int // ===== CODE $return_reflectionfunctionabstract_getnumberofparameters = $reflectionfunctionabstract->getNumberOfParameters( // This function has no parameters. ); // Return Values // The number of parameters. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getnumberofparameters.php // ========== REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFPARAMETERS - END // SYNTAX: // int ReflectionFunctionAbstract::getNumberOfParameters() return $return_reflectionfunctionabstract_getnumberofparameters; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFPARAMETERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFREQUIREDPARAMETERS // ============================== PUBLIC // ============================== ABOUT // Gets number of required parameters. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getNumberOfRequiredParameters() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getnumberofrequiredparameters($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getnumberofrequiredparameters = 0; // ========== REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFREQUIREDPARAMETERS - BEGIN // ===== ABOUT // Gets number of required parameters // ===== DESCRIPTION // Get the number of required parameters that a function defines. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getNumberOfRequiredParameters(): int // ===== CODE $return_reflectionfunctionabstract_getnumberofrequiredparameters = $reflectionfunctionabstract->getNumberOfRequiredParameters( // This function has no parameters. ); // Return Values // The number of required parameters. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getnumberofrequiredparameters.php // ========== REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFREQUIREDPARAMETERS - END // SYNTAX: // int ReflectionFunctionAbstract::getNumberOfRequiredParameters() return $return_reflectionfunctionabstract_getnumberofrequiredparameters; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETNUMBEROFREQUIREDPARAMETERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETPARAMETERS // ============================== PUBLIC // ============================== ABOUT // Gets parameters. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getParameters() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getparameters($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getparameters = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETPARAMETERS - BEGIN // ===== ABOUT // Gets parameters // ===== DESCRIPTION // Get the parameters as an array of ReflectionParameter, in the order in which they are defined in the source. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getParameters(): array // ===== CODE $return_reflectionfunctionabstract_getparameters = $reflectionfunctionabstract->getParameters( // This function has no parameters. ); // Return Values // The parameters, as a ReflectionParameter object. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getparameters.php // ========== REFLECTIONFUNCTIONABSTRACT_GETPARAMETERS - END // SYNTAX: // array ReflectionFunctionAbstract::getParameters() return $return_reflectionfunctionabstract_getparameters; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETPARAMETERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETRETURNTYPE // ============================== OFFLINE // ============================== ABOUT // Gets the specified return type of a function. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getReturnType() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_getreturntype($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getreturntype = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETRETURNTYPE - BEGIN // ===== ABOUT // Gets the specified return type of a function // ===== DESCRIPTION // Gets the specified return type of a reflected function. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getReturnType(): ?ReflectionType // ===== CODE $return_reflectionfunctionabstract_getreturntype = $reflectionfunctionabstract->getReturnType( // This function has no parameters. ); // Return Values // Returns a ReflectionType object if a return type is specified, null otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::getReturnType() example // [php] // // function to_int($param) : int { // return (int) $param; // } // // $reflection1 = new ReflectionFunction('to_int'); // echo $reflection1->getReturnType(); // [/php] // The above example will output: // [result] // int // [/result] // [/example] // [example] // Example #2 Usage on built-in functions // [php] // // $reflection2 = new ReflectionFunction('array_merge'); // // var_dump($reflection2->getReturnType()); // [/php] // The above example will output: // [result] // null // This is because many internal functions do not have types specified for their parameters or return values. It is therefore best to avoid using this method on built-in functions. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getreturntype.php // ========== REFLECTIONFUNCTIONABSTRACT_GETRETURNTYPE - END // SYNTAX: // ReflectionType ReflectionFunctionAbstract::getReturnType() return $return_reflectionfunctionabstract_getreturntype; // ReflectionType } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETRETURNTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSHORTNAME // ============================== PUBLIC // ============================== ABOUT // Gets function short name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getShortName() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getshortname($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getshortname = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETSHORTNAME - BEGIN // ===== ABOUT // Gets function short name // ===== DESCRIPTION // Get the short name of the function (without the namespace part). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getShortName(): string // ===== CODE $return_reflectionfunctionabstract_getshortname = $reflectionfunctionabstract->getShortName( // This function has no parameters. ); // Return Values // The short name of the function. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getshortname.php // ========== REFLECTIONFUNCTIONABSTRACT_GETSHORTNAME - END // SYNTAX: // string ReflectionFunctionAbstract::getShortName() return $return_reflectionfunctionabstract_getshortname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSHORTNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTARTLINE // ============================== PUBLIC // ============================== ABOUT // Gets starting line number. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getStartLine() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getstartline($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getstartline = false; // ========== REFLECTIONFUNCTIONABSTRACT_GETSTARTLINE - BEGIN // ===== ABOUT // Gets starting line number // ===== DESCRIPTION // Gets the starting line number of the function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getStartLine(): int|false // ===== CODE $return_reflectionfunctionabstract_getstartline = $reflectionfunctionabstract->getStartLine( // This function has no parameters. ); // Return Values // The starting line number, or false if unknown. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getstartline.php // ========== REFLECTIONFUNCTIONABSTRACT_GETSTARTLINE - END // SYNTAX: // int|false ReflectionFunctionAbstract::getStartLine() return $return_reflectionfunctionabstract_getstartline; // int|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTARTLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTATICVARIABLES // ============================== PUBLIC // ============================== ABOUT // Gets static variables. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getStaticVariables() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_getstaticvariables($reflectionfunctionabstract) { $return_reflectionfunctionabstract_getstaticvariables = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETSTATICVARIABLES - BEGIN // ===== ABOUT // Gets static variables // ===== DESCRIPTION // Get the static variables. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::getStaticVariables(): array // ===== CODE $return_reflectionfunctionabstract_getstaticvariables = $reflectionfunctionabstract->getStaticVariables( // This function has no parameters. ); // Return Values // An array of static variables. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.getstaticvariables.php // ========== REFLECTIONFUNCTIONABSTRACT_GETSTATICVARIABLES - END // SYNTAX: // array ReflectionFunctionAbstract::getStaticVariables() return $return_reflectionfunctionabstract_getstaticvariables; // array } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETSTATICVARIABLES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETTENTATIVERETURNTYPE // ============================== OFFLINE // ============================== ABOUT // Returns the tentative return type associated with the function. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::getTentativeReturnType() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_gettentativereturntype($reflectionfunctionabstract) { $return_reflectionfunctionabstract_gettentativereturntype = null; // ========== REFLECTIONFUNCTIONABSTRACT_GETTENTATIVERETURNTYPE - BEGIN // ===== ABOUT // Returns the tentative return type associated with the function // ===== DESCRIPTION // Returns the tentative return type associated with the function. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType // ===== CODE $return_reflectionfunctionabstract_gettentativereturntype = $reflectionfunctionabstract->getTentativeReturnType( // This function has no parameters. ); // Return Values // Returns a ReflectionType object if a tentative return type is specified, null otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::getTentativeReturnType() example // [php] // // $method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet'); // var_dump($method->getTentativeReturnType()); // [/php] // The above example will output something similar to: // [result] // object(ReflectionNamedType)#2 (0) { // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.gettentativereturntype.php // ========== REFLECTIONFUNCTIONABSTRACT_GETTENTATIVERETURNTYPE - END // SYNTAX: // ReflectionType ReflectionFunctionAbstract::getTentativeReturnType() return $return_reflectionfunctionabstract_gettentativereturntype; // ReflectionType } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_GETTENTATIVERETURNTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASRETURNTYPE // ============================== OFFLINE // ============================== ABOUT // Checks if the function has a specified return type. // ============================== SUPPORT // PHP_7, PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::hasReturnType() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_hasreturntype($reflectionfunctionabstract) { $return_reflectionfunctionabstract_hasreturntype = false; // ========== REFLECTIONFUNCTIONABSTRACT_HASRETURNTYPE - BEGIN // ===== ABOUT // Checks if the function has a specified return type // ===== DESCRIPTION // Checks whether the reflected function has a return type specified. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::hasReturnType(): bool // ===== CODE $return_reflectionfunctionabstract_hasreturntype = $reflectionfunctionabstract->hasReturnType( // This function has no parameters. ); // Return Values // Returns true if the function is a specified return type, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::hasReturnType() example // [php] // // function to_int($param) : int { // return (int) $param; // } // // $reflection1 = new ReflectionFunction('to_int'); // var_dump($reflection1->hasReturnType()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [example] // Example #2 Usage on built-in functions // [php] // // $reflection2 = new ReflectionFunction('array_merge'); // // var_dump($reflection2->hasReturnType()); // [/php] // The above example will output: // [result] // bool(false) // This is because many internal functions do not have types specified for their parameters or return values. It is therefore best to avoid using this method on built-in functions. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.hasreturntype.php // ========== REFLECTIONFUNCTIONABSTRACT_HASRETURNTYPE - END // SYNTAX: // bool ReflectionFunctionAbstract::hasReturnType() return $return_reflectionfunctionabstract_hasreturntype; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASRETURNTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASTENTATIVERETURNTYPE // ============================== OFFLINE // ============================== ABOUT // Returns whether the function has a tentative return type. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::hasTentativeReturnType() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfunctionabstract_hastentativereturntype($reflectionfunctionabstract) { $return_reflectionfunctionabstract_hastentativereturntype = false; // ========== REFLECTIONFUNCTIONABSTRACT_HASTENTATIVERETURNTYPE - BEGIN // ===== ABOUT // Returns whether the function has a tentative return type // ===== DESCRIPTION // Returns whether the function has a tentative return type. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFunctionAbstract::hasTentativeReturnType(): bool // ===== CODE $return_reflectionfunctionabstract_hastentativereturntype = $reflectionfunctionabstract->hasTentativeReturnType( // This function has no parameters. ); // Return Values // Returns true if the function has a tentative return type, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::hasTentativeReturnType() example // [php] // // $method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet'); // var_dump($method->hasTentativeReturnType()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-04) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.hastentativereturntype.php // ========== REFLECTIONFUNCTIONABSTRACT_HASTENTATIVERETURNTYPE - END // SYNTAX: // bool ReflectionFunctionAbstract::hasTentativeReturnType() return $return_reflectionfunctionabstract_hastentativereturntype; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_HASTENTATIVERETURNTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_INNAMESPACE // ============================== PUBLIC // ============================== ABOUT // Checks if function in namespace. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::inNamespace() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_innamespace($reflectionfunctionabstract) { $return_reflectionfunctionabstract_innamespace = false; // ========== REFLECTIONFUNCTIONABSTRACT_INNAMESPACE - BEGIN // ===== ABOUT // Checks if function in namespace // ===== DESCRIPTION // Checks whether a function is defined in a namespace. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::inNamespace(): bool // ===== CODE $return_reflectionfunctionabstract_innamespace = $reflectionfunctionabstract->inNamespace( // This function has no parameters. ); // Return Values // true if it's in a namespace, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.innamespace.php // ========== REFLECTIONFUNCTIONABSTRACT_INNAMESPACE - END // SYNTAX: // bool ReflectionFunctionAbstract::inNamespace() return $return_reflectionfunctionabstract_innamespace; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_INNAMESPACE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISCLOSURE // ============================== PUBLIC // ============================== ABOUT // Checks if closure. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isClosure() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isclosure($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isclosure = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISCLOSURE - BEGIN // ===== ABOUT // Checks if closure // ===== DESCRIPTION // Checks whether the reflected function is a Closure. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isClosure(): bool // ===== CODE $return_reflectionfunctionabstract_isclosure = $reflectionfunctionabstract->isClosure( // This function has no parameters. ); // Return Values // Returns true if the function is a Closure, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::isClosure() example // [php] // // Non-closure // $function1 = 'str_replace'; // $reflection1 = new ReflectionFunction($function1); // var_dump($reflection1->isClosure()); // // // Closure // $function2 = function () {}; // $reflection2 = new ReflectionFunction($function2); // var_dump($reflection2->isClosure()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isclosure.php // ========== REFLECTIONFUNCTIONABSTRACT_ISCLOSURE - END // SYNTAX: // bool ReflectionFunctionAbstract::isClosure() return $return_reflectionfunctionabstract_isclosure; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISCLOSURE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISDEPRECATED // ============================== PUBLIC // ============================== ABOUT // Checks if deprecated. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isDeprecated() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isdeprecated($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isdeprecated = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISDEPRECATED - BEGIN // ===== ABOUT // Checks if deprecated // ===== DESCRIPTION // Checks whether the function is deprecated. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isDeprecated(): bool // ===== CODE $return_reflectionfunctionabstract_isdeprecated = $reflectionfunctionabstract->isDeprecated( // This function has no parameters. ); // Return Values // true if it's deprecated, otherwise false // // [examples] // Examples // [example] // Example #1 ReflectionFunctionAbstract::isDeprecated() example // [php] // $rf = new ReflectionFunction('ereg'); // var_dump($rf->isDeprecated()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isdeprecated.php // ========== REFLECTIONFUNCTIONABSTRACT_ISDEPRECATED - END // SYNTAX: // bool ReflectionFunctionAbstract::isDeprecated() return $return_reflectionfunctionabstract_isdeprecated; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISDEPRECATED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISGENERATOR // ============================== PUBLIC // ============================== ABOUT // Returns whether this function is a generator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isGenerator() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isgenerator($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isgenerator = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISGENERATOR - BEGIN // ===== ABOUT // Returns whether this function is a generator // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isGenerator(): bool // ===== CODE $return_reflectionfunctionabstract_isgenerator = $reflectionfunctionabstract->isGenerator( // This function has no parameters. ); // Return Values // Returns true if the function is generator, false if it is not or null on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isgenerator.php // ========== REFLECTIONFUNCTIONABSTRACT_ISGENERATOR - END // SYNTAX: // bool ReflectionFunctionAbstract::isGenerator() return $return_reflectionfunctionabstract_isgenerator; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISGENERATOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISINTERNAL // ============================== PUBLIC // ============================== ABOUT // Checks if is internal. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isInternal() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isinternal($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isinternal = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISINTERNAL - BEGIN // ===== ABOUT // Checks if is internal // ===== DESCRIPTION // Checks whether the function is internal, as opposed to user-defined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isInternal(): bool // ===== CODE $return_reflectionfunctionabstract_isinternal = $reflectionfunctionabstract->isInternal( // This function has no parameters. ); // Return Values // true if it's internal, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isinternal.php // ========== REFLECTIONFUNCTIONABSTRACT_ISINTERNAL - END // SYNTAX: // bool ReflectionFunctionAbstract::isInternal() return $return_reflectionfunctionabstract_isinternal; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISINTERNAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISSTATIC // ============================== PUBLIC // ============================== ABOUT // Checks if the function is static. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isStatic() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isstatic($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isstatic = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISSTATIC - BEGIN // ===== ABOUT // Checks if the function is static // ===== DESCRIPTION // Checks if the function is static. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isStatic(): bool // ===== CODE $return_reflectionfunctionabstract_isstatic = $reflectionfunctionabstract->isStatic( // This function has no parameters. ); // Return Values // true if the function is static, otherwise false // // Changelog // Version - Description // 8.1.0 - This method has been pulled up. Previously, it was only defined in ReflectionMethod. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectiofunctionabstract.isstatic.php // ========== REFLECTIONFUNCTIONABSTRACT_ISSTATIC - END // SYNTAX: // bool ReflectionFunctionAbstract::isStatic() return $return_reflectionfunctionabstract_isstatic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISSTATIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISUSERDEFINED // ============================== PUBLIC // ============================== ABOUT // Checks if user defined. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isUserDefined() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isuserdefined($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isuserdefined = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISUSERDEFINED - BEGIN // ===== ABOUT // Checks if user defined // ===== DESCRIPTION // Checks whether the function is user-defined, as opposed to internal. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isUserDefined(): bool // ===== CODE $return_reflectionfunctionabstract_isuserdefined = $reflectionfunctionabstract->isUserDefined( // This function has no parameters. ); // Return Values // true if it's user-defined, otherwise false; // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isuserdefined.php // ========== REFLECTIONFUNCTIONABSTRACT_ISUSERDEFINED - END // SYNTAX: // bool ReflectionFunctionAbstract::isUserDefined() return $return_reflectionfunctionabstract_isuserdefined; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISUSERDEFINED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISVARIADIC // ============================== PUBLIC // ============================== ABOUT // Checks if the function is variadic. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::isVariadic() - PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_isvariadic($reflectionfunctionabstract) { $return_reflectionfunctionabstract_isvariadic = false; // ========== REFLECTIONFUNCTIONABSTRACT_ISVARIADIC - BEGIN // ===== ABOUT // Checks if the function is variadic // ===== DESCRIPTION // Checks if the function is variadic. // ===== SUPPORTED // PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::isVariadic(): bool // ===== CODE $return_reflectionfunctionabstract_isvariadic = $reflectionfunctionabstract->isVariadic( // This function has no parameters. ); // Return Values // Returns true if the function is variadic, otherwise false. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.isvariadic.php // ========== REFLECTIONFUNCTIONABSTRACT_ISVARIADIC - END // SYNTAX: // bool ReflectionFunctionAbstract::isVariadic() return $return_reflectionfunctionabstract_isvariadic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_ISVARIADIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_RETURNSREFERENCE // ============================== PUBLIC // ============================== ABOUT // Checks if returns reference. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::returnsReference() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_returnsreference($reflectionfunctionabstract) { $return_reflectionfunctionabstract_returnsreference = false; // ========== REFLECTIONFUNCTIONABSTRACT_RETURNSREFERENCE - BEGIN // ===== ABOUT // Checks if returns reference // ===== DESCRIPTION // Checks whether the function returns a reference. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionFunctionAbstract::returnsReference(): bool // ===== CODE $return_reflectionfunctionabstract_returnsreference = $reflectionfunctionabstract->returnsReference( // This function has no parameters. ); // Return Values // true if it returns a reference, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.returnsreference.php // ========== REFLECTIONFUNCTIONABSTRACT_RETURNSREFERENCE - END // SYNTAX: // bool ReflectionFunctionAbstract::returnsReference() return $return_reflectionfunctionabstract_returnsreference; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_RETURNSREFERENCE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the string representation of the ReflectionFunctionAbstract object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFunctionAbstract::__toString() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionfunctionabstract_tostring($reflectionfunctionabstract) { // ========== REFLECTIONFUNCTIONABSTRACT_TOSTRING - BEGIN // ===== ABOUT // Returns the string representation of the ReflectionFunctionAbstract object // ===== DESCRIPTION // Get a human-readable description of the function, its parameters and return values. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // abstract public ReflectionFunctionAbstract::__toString(): void // ===== CODE $reflectionfunctionabstract->__toString( // This function has no parameters. ); // Return Values // The string. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionfunctionabstract.tostring.php // ========== REFLECTIONFUNCTIONABSTRACT_TOSTRING - END // SYNTAX: // void ReflectionFunctionAbstract::__toString() // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFUNCTIONABSTRACT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CONSTRUCT - ReflectionMethod php_variable_reflection_reflectionmethod_construct(object|string $objectOrMethod, string $method) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CREATEFROMMETHODNAME - static php_variable_reflection_reflectionmethod_createfrommethodname(ReflectionMethod $reflectionmethod, string $method) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_EXPORT - string php_variable_reflection_reflectionmethod_export(ReflectionMethod $reflectionmethod, string $class, string $name, bool $return = false) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETCLOSURE - Closure php_variable_reflection_reflectionmethod_getclosure(ReflectionMethod $reflectionmethod, object $object = null) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETDECLARINGCLASS - ReflectionClass php_variable_reflection_reflectionmethod_getdeclaringclass(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETMODIFIERS - int php_variable_reflection_reflectionmethod_getmodifiers(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETPROTOTYPE - ReflectionMethod php_variable_reflection_reflectionmethod_getprototype(ReflectionMethod $reflectionmethod) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_HASPROTOTYPE - bool php_variable_reflection_reflectionmethod_hasprototype(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKE - mixed php_variable_reflection_reflectionmethod_invoke(ReflectionMethod $reflectionmethod, object $object, mixed $args) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKEARGS - mixed php_variable_reflection_reflectionmethod_invokeargs(ReflectionMethod $reflectionmethod, object $object, array $args) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISABSTRACT - bool php_variable_reflection_reflectionmethod_isabstract(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISCONSTRUCTOR - bool php_variable_reflection_reflectionmethod_isconstructor(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISDESTRUCTOR - bool php_variable_reflection_reflectionmethod_isdestructor(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISFINAL - bool php_variable_reflection_reflectionmethod_isfinal(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPRIVATE - bool php_variable_reflection_reflectionmethod_isprivate(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPROTECTED - bool php_variable_reflection_reflectionmethod_isprotected(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPUBLIC - bool php_variable_reflection_reflectionmethod_ispublic(ReflectionMethod $reflectionmethod) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_SETACCESSIBLE - void php_variable_reflection_reflectionmethod_setaccessible(ReflectionMethod $reflectionmethod, bool $accessible) // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_TOSTRING - string php_variable_reflection_reflectionmethod_tostring(ReflectionMethod $reflectionmethod) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (19) // ReflectionMethod::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionMethod::createFromMethodName() - PHP_8 >= PHP_8_3_0 // OFFLINE | ReflectionMethod::export() - PHP_5, PHP_7 // ReflectionMethod::getClosure() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionMethod::getDeclaringClass() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::getModifiers() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::getPrototype() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // OFFLINE | ReflectionMethod::hasPrototype() - PHP_8 >= PHP_8_2_0 // ReflectionMethod::invoke() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::invokeArgs() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ReflectionMethod::isAbstract() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isConstructor() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isDestructor() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isFinal() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isPrivate() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isProtected() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::isPublic() - PHP_5, PHP_7, PHP_8 // ReflectionMethod::setAccessible() - PHP_5 >= PHP_5_3_2, PHP_7, PHP_8 // ReflectionMethod::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (11) // ReflectionMethod - PHP_5, PHP_7, PHP_8 // object // string // static // bool // Closure // ReflectionClass - PHP_5, PHP_7, PHP_8 // int // mixed // array // void // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionMethod. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_construct($objectOrMethod, $method) { $return_reflectionmethod_construct = null; // ========== REFLECTIONMETHOD_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionMethod // ===== DESCRIPTION // Constructs a new ReflectionMethod. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::__construct(object|string $objectOrMethod, string $method) // // Alternative signature (not supported with named arguments): // public ReflectionMethod::__construct(string $classMethod) // ===== CODE $return_reflectionmethod_construct = new ReflectionMethod( $objectOrMethod, // object|string objectOrMethod - Classname or object (instance of the class) that contains the method. $method // string method - Name of the method. // string classMethod - Class name and method name delimited by ::. ); // Return // ReflectionMethod // // Errors/Exceptions // A ReflectionException is thrown if the given method does not exist. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::__construct() example // [php] // class Counter // { // private static $c = 0; // // /** // * Increment counter // * // * @final // * @static // * @access public // * @return int // */ // final public static function increment() // { // return ++self::$c; // } // } // // // Create an instance of the ReflectionMethod class // $method = new ReflectionMethod('Counter', 'increment'); // // // Print out basic information // printf( // "===> The %s%s%s%s%s%s%s method '%s' (which is %s)\n" . // " declared in %s\n" . // " lines %d to %d\n" . // " having the modifiers %d[%s]\n", // $method->isInternal() ? 'internal' : 'user-defined', // $method->isAbstract() ? ' abstract' : '', // $method->isFinal() ? ' final' : '', // $method->isPublic() ? ' public' : '', // $method->isPrivate() ? ' private' : '', // $method->isProtected() ? ' protected' : '', // $method->isStatic() ? ' static' : '', // $method->getName(), // $method->isConstructor() ? 'the constructor' : 'a regular method', // $method->getFileName(), // $method->getStartLine(), // $method->getEndline(), // $method->getModifiers(), // implode(' ', Reflection::getModifierNames($method->getModifiers())) // ); // // // Print documentation comment // printf("---> Documentation:\n %s\n", var_export($method->getDocComment(), true)); // // // Print static variables if existant // if ($statics= $method->getStaticVariables()) { // printf("---> Static variables: %s\n", var_export($statics, true)); // } // // // Invoke the method // printf("---> Invocation results in: "); // var_dump($method->invoke(NULL)); // [/php] // The above example will output something similar to: // [result] // ===> The user-defined final public static method 'increment' (which is a regular method) // declared in /Users/philip/cvs/phpdoc/test.php // lines 14 to 17 // having the modifiers 261[final public static] // ---> Documentation: // '/** // * Increment counter // * // * @final // * @static // * @access public // * @return int // */' // ---> Invocation results in: int(1) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.construct.php // ========== REFLECTIONMETHOD_CONSTRUCT - END // SYNTAX: // ReflectionMethod ReflectionMethod::__construct(object|string $objectOrMethod, string $method) return $return_reflectionmethod_construct; // ReflectionMethod } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CREATEFROMMETHODNAME // ============================== OFFLINE // ============================== ABOUT // Creates a new ReflectionMethod. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::createFromMethodName() - PHP_8 >= PHP_8_3_0 // ============================== CODE /* function php_variable_reflection_reflectionmethod_createfrommethodname($reflectionmethod, $method) { $return_reflectionmethod_createfrommethodname = null; // ========== REFLECTIONMETHOD_CREATEFROMMETHODNAME - BEGIN // ===== ABOUT // Creates a new ReflectionMethod // ===== DESCRIPTION // Creates a new ReflectionMethod. // ===== SUPPORTED // PHP_8 >= PHP_8_3_0 // ===== SYNTAX // public static ReflectionMethod::createFromMethodName(string $method): static // ===== CODE $return_reflectionmethod_createfrommethodname = $reflectionmethod->createFromMethodName( $method // string method - Class name and method name delimited by ::. ); // Return Values // Returns a new ReflectionMethod on success. // // Errors/Exceptions // A ReflectionException is thrown if the given method does not exist. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::createFromMethodName() example // [php] // // class Foo { // public function bar() { // // } // } // // $methodInfo = ReflectionMethod::createFromMethodName("Foo::bar"); // var_dump($methodInfo); // [/php] // The above example will output: // [result] // object(ReflectionMethod)#1 (2) { // ["name"]=> // string(3) "bar" // ["class"]=> // string(3) "Foo" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.createfrommethodname.php // ========== REFLECTIONMETHOD_CREATEFROMMETHODNAME - END // SYNTAX: // static ReflectionMethod::createFromMethodName(string $method) return $return_reflectionmethod_createfrommethodname; // static } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_CREATEFROMMETHODNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export a reflection method. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionMethod::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionmethod_export($reflectionmethod, $class, $name, $return = false) { $return_reflectionmethod_export = null; // ========== REFLECTIONMETHOD_EXPORT - BEGIN // ===== ABOUT // Export a reflection method // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a ReflectionMethod. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionMethod::export(string $class, string $name, bool $return = false): string // ===== CODE $return_reflectionmethod_export = $reflectionmethod->export( $class, // string class - The class name. $name, // string name - The name of the method. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionmethod.export.php // ========== REFLECTIONMETHOD_EXPORT - END // SYNTAX: // string ReflectionMethod::export(string $class, string $name, bool $return = false) return $return_reflectionmethod_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETCLOSURE // ============================== PUBLIC // ============================== ABOUT // Returns a dynamically created closure for the method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::getClosure() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_getclosure($reflectionmethod, $object = null) { $return_reflectionmethod_getclosure = null; // ========== REFLECTIONMETHOD_GETCLOSURE - BEGIN // ===== ABOUT // Returns a dynamically created closure for the method // ===== DESCRIPTION // Create a closure which will call the method. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::getClosure(?object $object = null): Closure // ===== CODE $return_reflectionmethod_getclosure = $reflectionmethod->getClosure( $object // object object - Forbidden for static methods, required for other methods. ); // Return Values // Returns the newly created Closure. // // Errors/Exceptions // Throws a ValueError if object is null but the method is non-static. // Throws a ReflectionException if object is not an instance of the class this method was declared in. // // Changelog // Version - Description // 8.0.0 - object is now nullable. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.getclosure.php // ========== REFLECTIONMETHOD_GETCLOSURE - END // SYNTAX: // Closure ReflectionMethod::getClosure(object $object = null) return $return_reflectionmethod_getclosure; // Closure } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETCLOSURE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETDECLARINGCLASS // ============================== PUBLIC // ============================== ABOUT // Gets declaring class for the reflected method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::getDeclaringClass() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_getdeclaringclass($reflectionmethod) { $return_reflectionmethod_getdeclaringclass = null; // ========== REFLECTIONMETHOD_GETDECLARINGCLASS - BEGIN // ===== ABOUT // Gets declaring class for the reflected method // ===== DESCRIPTION // Gets the declaring class for the reflected method. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::getDeclaringClass(): ReflectionClass // ===== CODE $return_reflectionmethod_getdeclaringclass = $reflectionmethod->getDeclaringClass( // This function has no parameters. ); // Return Values // A ReflectionClass object of the class that the reflected method is part of. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::getDeclaringClass() example // [php] // class HelloWorld { // // protected function sayHelloTo($name) { // return 'Hello ' . $name; // } // // } // // $reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo'); // var_dump($reflectionMethod->getDeclaringClass()); // [/php] // The above example will output: // [result] // object(ReflectionClass)#2 (1) { // ["name"]=> // string(10) "HelloWorld" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.getdeclaringclass.php // ========== REFLECTIONMETHOD_GETDECLARINGCLASS - END // SYNTAX: // ReflectionClass ReflectionMethod::getDeclaringClass() return $return_reflectionmethod_getdeclaringclass; // ReflectionClass } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETDECLARINGCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETMODIFIERS // ============================== PUBLIC // ============================== ABOUT // Gets the method modifiers. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::getModifiers() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_getmodifiers($reflectionmethod) { $return_reflectionmethod_getmodifiers = 0; // ========== REFLECTIONMETHOD_GETMODIFIERS - BEGIN // ===== ABOUT // Gets the method modifiers // ===== DESCRIPTION // Returns a bitfield of the access modifiers for this method. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::getModifiers(): int // ===== CODE $return_reflectionmethod_getmodifiers = $reflectionmethod->getModifiers( // This function has no parameters. ); // Return Values // A numeric representation of the modifiers. The actual meaning of these modifiers are described under predefined constants. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::getModifiers() example // [php] // class Testing // { // final public static function foo() // { // return; // } // public function bar() // { // return; // } // } // // $foo = new ReflectionMethod('Testing', 'foo'); // // echo "Modifiers for method foo():\n"; // echo $foo->getModifiers() . "\n"; // echo implode(' ', Reflection::getModifierNames($foo->getModifiers())) . "\n"; // // $bar = new ReflectionMethod('Testing', 'bar'); // // echo "Modifiers for method bar():\n"; // echo $bar->getModifiers() . "\n"; // echo implode(' ', Reflection::getModifierNames($bar->getModifiers())); // [/php] // The above example will output something similar to: // [result] // Modifiers for method foo(): // 49 // final public static // Modifiers for method bar(): // 1 // public // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.getmodifiers.php // ========== REFLECTIONMETHOD_GETMODIFIERS - END // SYNTAX: // int ReflectionMethod::getModifiers() return $return_reflectionmethod_getmodifiers; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETMODIFIERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETPROTOTYPE // ============================== PUBLIC // ============================== ABOUT // Gets the method prototype (if there is one). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::getPrototype() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_getprototype($reflectionmethod) { $return_reflectionmethod_getprototype = null; // ========== REFLECTIONMETHOD_GETPROTOTYPE - BEGIN // ===== ABOUT // Gets the method prototype (if there is one) // ===== DESCRIPTION // Returns the methods prototype. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::getPrototype(): ReflectionMethod // ===== CODE $return_reflectionmethod_getprototype = $reflectionmethod->getPrototype( // This function has no parameters. ); // Return Values // A ReflectionMethod instance of the method prototype. // // Errors/Exceptions // A ReflectionException exception is thrown if the method does not have a prototype. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::getPrototype() example // [php] // class Hello { // // public function sayHelloTo($name) { // return 'Hello ' . $name; // } // // } // class HelloWorld extends Hello { // // public function sayHelloTo($name) { // return 'Hello world: ' . $name; // } // // } // // $reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo'); // var_dump($reflectionMethod->getPrototype()); // [/php] // The above example will output: // [result] // object(ReflectionMethod)#2 (2) { // ["name"]=> // string(10) "sayHelloTo" // ["class"]=> // string(5) "Hello" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.getprototype.php // ========== REFLECTIONMETHOD_GETPROTOTYPE - END // SYNTAX: // ReflectionMethod ReflectionMethod::getPrototype() return $return_reflectionmethod_getprototype; // ReflectionMethod } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_GETPROTOTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_HASPROTOTYPE // ============================== OFFLINE // ============================== ABOUT // Returns whether a method has a prototype. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::hasPrototype() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_variable_reflection_reflectionmethod_hasprototype($reflectionmethod) { $return_reflectionmethod_hasprototype = false; // ========== REFLECTIONMETHOD_HASPROTOTYPE - BEGIN // ===== ABOUT // Returns whether a method has a prototype // ===== DESCRIPTION // Returns whether a method has a prototype. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // public ReflectionMethod::hasPrototype(): bool // ===== CODE $return_reflectionmethod_hasprototype = $reflectionmethod->hasPrototype( // This function has no parameters. ); // Return Values // Returns true if the method has a prototype, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::hasPrototype() example // [php] // // class Hello // { // public function sayHelloTo($name) // { // return 'Hello '.$name; // } // } // // class HelloWorld extends Hello // { // public function sayHelloTo($name) // { // return 'Hello world: '.$name; // } // } // $reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo'); // var_dump($reflectionMethod->hasPrototype()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.hasprototype.php // ========== REFLECTIONMETHOD_HASPROTOTYPE - END // SYNTAX: // bool ReflectionMethod::hasPrototype() return $return_reflectionmethod_hasprototype; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_HASPROTOTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKE // ============================== PUBLIC // ============================== ABOUT // Invoke. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::invoke() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_invoke($reflectionmethod, $object, $args) { $return_reflectionmethod_invoke = null; // ========== REFLECTIONMETHOD_INVOKE - BEGIN // ===== ABOUT // Invoke // ===== DESCRIPTION // Invokes a reflected method. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::invoke(?object $object, mixed ...$args): mixed // ===== CODE $return_reflectionmethod_invoke = $reflectionmethod->invoke( $object, // object object - The object to invoke the method on. For static methods, pass null to this parameter. $args // mixed args - Zero or more parameters to be passed to the method. It accepts a variable number of parameters which are passed to the method. ); // Return Values // Returns the method result. // // Errors/Exceptions // A ReflectionException if the object parameter does not contain an instance of the class that this method was declared in. // A ReflectionException if the method invocation failed. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::invoke() example // [php] // class HelloWorld { // // public function sayHelloTo($name) { // return 'Hello ' . $name; // } // // } // // $reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo'); // echo $reflectionMethod->invoke(new HelloWorld(), 'Mike'); // [/php] // The above example will output: // [result] // Hello Mike // [/result] // [/example] // [/examples] // // Notes // Note: ReflectionMethod::invoke() cannot be used when reference parameters are expected. ReflectionMethod::invokeArgs() has to be used instead (passing references in the argument list). // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.invoke.php // ========== REFLECTIONMETHOD_INVOKE - END // SYNTAX: // mixed ReflectionMethod::invoke(object $object, mixed $args) return $return_reflectionmethod_invoke; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKEARGS // ============================== PUBLIC // ============================== ABOUT // Invoke args. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::invokeArgs() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_invokeargs($reflectionmethod, $object, $args) { $return_reflectionmethod_invokeargs = null; // ========== REFLECTIONMETHOD_INVOKEARGS - BEGIN // ===== ABOUT // Invoke args // ===== DESCRIPTION // Invokes the reflected method and pass its arguments as array. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::invokeArgs(?object $object, array $args): mixed // ===== CODE $return_reflectionmethod_invokeargs = $reflectionmethod->invokeArgs( $object, // object object - The object to invoke the method on. In case of static methods, you can pass null to this parameter. $args // array args - The parameters to be passed to the function, as an array. ); // Return Values // Returns the method result. // // Errors/Exceptions // A ReflectionException if the object parameter does not contain an instance of the class that this method was declared in. // A ReflectionException if the method invocation failed. // // Changelog // Version - Description // 8.0.0 - args keys will now be interpreted as parameter names, instead of being silently ignored. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::invokeArgs() example // [php] // class HelloWorld { // // public function sayHelloTo($name) { // return 'Hello ' . $name; // } // // } // // $reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo'); // echo $reflectionMethod->invokeArgs(new HelloWorld(), array('Mike')); // [/php] // The above example will output: // [result] // Hello Mike // [/result] // [/example] // [/examples] // // Notes // Note: If the function has arguments that need to be references, then they must be references in the passed argument list. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.invokeargs.php // ========== REFLECTIONMETHOD_INVOKEARGS - END // SYNTAX: // mixed ReflectionMethod::invokeArgs(object $object, array $args) return $return_reflectionmethod_invokeargs; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_INVOKEARGS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISABSTRACT // ============================== PUBLIC // ============================== ABOUT // Checks if method is abstract. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isAbstract() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isabstract($reflectionmethod) { $return_reflectionmethod_isabstract = false; // ========== REFLECTIONMETHOD_ISABSTRACT - BEGIN // ===== ABOUT // Checks if method is abstract // ===== DESCRIPTION // Checks if the method is abstract. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isAbstract(): bool // ===== CODE $return_reflectionmethod_isabstract = $reflectionmethod->isAbstract( // This function has no parameters. ); // Return Values // true if the method is abstract, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isabstract.php // ========== REFLECTIONMETHOD_ISABSTRACT - END // SYNTAX: // bool ReflectionMethod::isAbstract() return $return_reflectionmethod_isabstract; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISABSTRACT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISCONSTRUCTOR // ============================== PUBLIC // ============================== ABOUT // Checks if method is a constructor. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isConstructor() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isconstructor($reflectionmethod) { $return_reflectionmethod_isconstructor = false; // ========== REFLECTIONMETHOD_ISCONSTRUCTOR - BEGIN // ===== ABOUT // Checks if method is a constructor // ===== DESCRIPTION // Checks if the method is a constructor. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isConstructor(): bool // ===== CODE $return_reflectionmethod_isconstructor = $reflectionmethod->isConstructor( // This function has no parameters. ); // Return Values // true if the method is a constructor, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isconstructor.php // ========== REFLECTIONMETHOD_ISCONSTRUCTOR - END // SYNTAX: // bool ReflectionMethod::isConstructor() return $return_reflectionmethod_isconstructor; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISCONSTRUCTOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISDESTRUCTOR // ============================== PUBLIC // ============================== ABOUT // Checks if method is a destructor. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isDestructor() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isdestructor($reflectionmethod) { $return_reflectionmethod_isdestructor = false; // ========== REFLECTIONMETHOD_ISDESTRUCTOR - BEGIN // ===== ABOUT // Checks if method is a destructor // ===== DESCRIPTION // Checks if the method is a destructor. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isDestructor(): bool // ===== CODE $return_reflectionmethod_isdestructor = $reflectionmethod->isDestructor( // This function has no parameters. ); // Return Values // true if the method is a destructor, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isdestructor.php // ========== REFLECTIONMETHOD_ISDESTRUCTOR - END // SYNTAX: // bool ReflectionMethod::isDestructor() return $return_reflectionmethod_isdestructor; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISDESTRUCTOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISFINAL // ============================== PUBLIC // ============================== ABOUT // Checks if method is final. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isFinal() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isfinal($reflectionmethod) { $return_reflectionmethod_isfinal = false; // ========== REFLECTIONMETHOD_ISFINAL - BEGIN // ===== ABOUT // Checks if method is final // ===== DESCRIPTION // Checks if the method is final. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isFinal(): bool // ===== CODE $return_reflectionmethod_isfinal = $reflectionmethod->isFinal( // This function has no parameters. ); // Return Values // true if the method is final, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isfinal.php // ========== REFLECTIONMETHOD_ISFINAL - END // SYNTAX: // bool ReflectionMethod::isFinal() return $return_reflectionmethod_isfinal; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISFINAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPRIVATE // ============================== PUBLIC // ============================== ABOUT // Checks if method is private. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isPrivate() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isprivate($reflectionmethod) { $return_reflectionmethod_isprivate = false; // ========== REFLECTIONMETHOD_ISPRIVATE - BEGIN // ===== ABOUT // Checks if method is private // ===== DESCRIPTION // Checks if the method is private. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isPrivate(): bool // ===== CODE $return_reflectionmethod_isprivate = $reflectionmethod->isPrivate( // This function has no parameters. ); // Return Values // true if the method is private, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isprivate.php // ========== REFLECTIONMETHOD_ISPRIVATE - END // SYNTAX: // bool ReflectionMethod::isPrivate() return $return_reflectionmethod_isprivate; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPRIVATE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPROTECTED // ============================== PUBLIC // ============================== ABOUT // Checks if method is protected. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isProtected() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_isprotected($reflectionmethod) { $return_reflectionmethod_isprotected = false; // ========== REFLECTIONMETHOD_ISPROTECTED - BEGIN // ===== ABOUT // Checks if method is protected // ===== DESCRIPTION // Checks if the method is protected. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isProtected(): bool // ===== CODE $return_reflectionmethod_isprotected = $reflectionmethod->isProtected( // This function has no parameters. ); // Return Values // true if the method is protected, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.isprotected.php // ========== REFLECTIONMETHOD_ISPROTECTED - END // SYNTAX: // bool ReflectionMethod::isProtected() return $return_reflectionmethod_isprotected; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPROTECTED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPUBLIC // ============================== PUBLIC // ============================== ABOUT // Checks if method is public. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::isPublic() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_ispublic($reflectionmethod) { $return_reflectionmethod_ispublic = false; // ========== REFLECTIONMETHOD_ISPUBLIC - BEGIN // ===== ABOUT // Checks if method is public // ===== DESCRIPTION // Checks if the method is public. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::isPublic(): bool // ===== CODE $return_reflectionmethod_ispublic = $reflectionmethod->isPublic( // This function has no parameters. ); // Return Values // true if the method is public, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-05) // URL: https://www.php.net/manual/en/reflectionmethod.ispublic.php // ========== REFLECTIONMETHOD_ISPUBLIC - END // SYNTAX: // bool ReflectionMethod::isPublic() return $return_reflectionmethod_ispublic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_ISPUBLIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_SETACCESSIBLE // ============================== PUBLIC // ============================== ABOUT // Set method accessibility. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::setAccessible() - PHP_5 >= PHP_5_3_2, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_setaccessible($reflectionmethod, $accessible) { // ========== REFLECTIONMETHOD_SETACCESSIBLE - BEGIN // ===== ABOUT // Set method accessibility // ===== DESCRIPTION // Enables invoking of a protected or private method via the ReflectionMethod::invoke() method. // Note: As of PHP 8.1.0, calling this method has no effect; all methods are invokable by default. // ===== SUPPORTED // PHP_5 >= PHP_5_3_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::setAccessible(bool $accessible): void // ===== CODE $reflectionmethod->setAccessible( $accessible // bool accessible - true to allow accessibility, or false. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 Simple Class definition // [php] // class MyClass // { // private function foo() // { // return 'bar'; // } // } // // $method = new ReflectionMethod("MyClass", "foo"); // $method->setAccessible(true); // // $obj = new MyClass(); // echo $method->invoke($obj); // echo $obj->foo(); // [/php] // The above example will output something similar to: // [result] // bar // Fatal error: Uncaught Error: Call to private method MyClass::foo() from global scope in /in/qdaZS:16 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionmethod.setaccessible.php // ========== REFLECTIONMETHOD_SETACCESSIBLE - END // SYNTAX: // void ReflectionMethod::setAccessible(bool $accessible) // Return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_SETACCESSIBLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the string representation of the Reflection method object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionMethod::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionmethod_tostring($reflectionmethod) { $return_reflectionmethod_tostring = null; // ========== REFLECTIONMETHOD_TOSTRING - BEGIN // ===== ABOUT // Returns the string representation of the Reflection method object // ===== DESCRIPTION // Returns the string representation of the Reflection method object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionMethod::__toString(): string // ===== CODE $return_reflectionmethod_tostring = $reflectionmethod->__toString( // This function has no parameters. ); // Return Values // A string representation of this ReflectionMethod instance. // // [examples] // Examples // [example] // Example #1 ReflectionMethod::__toString() example // [php] // class HelloWorld { // // public function sayHelloTo($name) { // return 'Hello ' . $name; // } // // } // // $reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo'); // echo $reflectionMethod; // [/php] // The above example will output: // [result] // Method [ public method sayHelloTo ] { // @@ /var/www/examples/reflection.php 16 - 18 // // - Parameters [1] { // Parameter #0 [ $name ] // } // } // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionmethod.tostring.php // ========== REFLECTIONMETHOD_TOSTRING - END // SYNTAX: // string ReflectionMethod::__toString() return $return_reflectionmethod_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONMETHOD // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_GETNAME - string php_variable_reflection_reflectionnamedtype_getname(ReflectionNamedType $reflectionnamedtype) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_ISBUILTIN - bool php_variable_reflection_reflectionnamedtype_isbuiltin(ReflectionNamedType $reflectionnamedtype) // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (2) // OFFLINE | ReflectionNamedType::getName() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | ReflectionNamedType::isBuiltin() - PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // string // OFFLINE | ReflectionNamedType - PHP_7 >= PHP_7_1_0, PHP_8 // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_GETNAME // ============================== OFFLINE // ============================== ABOUT // Get the name of the type as a string. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionNamedType::getName() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionnamedtype_getname($reflectionnamedtype) { $return_reflectionnamedtype_getname = null; // ========== REFLECTIONNAMEDTYPE_GETNAME - BEGIN // ===== ABOUT // Get the name of the type as a string // ===== DESCRIPTION // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // public ReflectionNamedType::getName(): string // ===== CODE $return_reflectionnamedtype_getname = $reflectionnamedtype->getName( // This function has no parameters. ); // Return Values // Returns the name of the type being reflected. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionnamedtype.getname.php // ========== REFLECTIONNAMEDTYPE_GETNAME - END // SYNTAX: // string ReflectionNamedType::getName() return $return_reflectionnamedtype_getname; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_ISBUILTIN // ============================== OFFLINE // ============================== ABOUT // Checks if it is a built-in type. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionNamedType::isBuiltin() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionnamedtype_isbuiltin($reflectionnamedtype) { $return_reflectionnamedtype_isbuiltin = false; // ========== REFLECTIONNAMEDTYPE_ISBUILTIN - BEGIN // ===== ABOUT // Checks if it is a built-in type // ===== DESCRIPTION // Checks if the type is a built-in type in PHP. A built-in type is any type that is not a class, interface, or trait. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionNamedType::isBuiltin(): bool // ===== CODE $return_reflectionnamedtype_isbuiltin = $reflectionnamedtype->isBuiltin( // This function has no parameters. ); // Return Values // true if it's a built-in type, otherwise false // // [examples] // Examples // [example] // Example #1 ReflectionNamedType::isBuiltin() example // [php] // class SomeClass {} // // function someFunction(string $param, SomeClass $param2, stdClass $param3) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParams = $reflectionFunc->getParameters(); // // var_dump($reflectionParams[0]->getType()->isBuiltin()); // var_dump($reflectionParams[1]->getType()->isBuiltin()); // var_dump($reflectionParams[2]->getType()->isBuiltin()); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // bool(false) // [/result] // Note that the ReflectionNamedType::isBuiltin() method does not distinguish between internal and custom classes. To make this distinction, the ReflectionClass::isInternal() method should be used on the returned class name. // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionnamedtype.isbuiltin.php // ========== REFLECTIONNAMEDTYPE_ISBUILTIN - END // SYNTAX: // bool ReflectionNamedType::isBuiltin() return $return_reflectionnamedtype_isbuiltin; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE_ISBUILTIN // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONNAMEDTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_CONSTRUCT - ReflectionObject php_variable_reflection_reflectionobject_construct(object $object) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_EXPORT - string php_variable_reflection_reflectionobject_export(ReflectionObject $reflectionobject, string $argument, bool $return) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // ReflectionObject::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionObject::export() - PHP_5, PHP_7 // ============================== USING DATA_TYPES (4) // ReflectionObject - PHP_5, PHP_7, PHP_8 // object // string // bool // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ReflectionObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionObject::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionobject_construct($object) { $return_reflectionobject_construct = null; // ========== REFLECTIONOBJECT_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionObject // ===== DESCRIPTION // Constructs a ReflectionObject. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionObject::__construct(object $object) // ===== CODE $return_reflectionobject_construct = new ReflectionObject( $object // object object - An object instance. ); // Return // ReflectionObject // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionobject.construct.php // ========== REFLECTIONOBJECT_CONSTRUCT - END // SYNTAX: // ReflectionObject ReflectionObject::__construct(object $object) return $return_reflectionobject_construct; // ReflectionObject } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5, PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionObject::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionobject_export($reflectionobject, $argument, $return) { $return_reflectionobject_export = null; // ========== REFLECTIONOBJECT_EXPORT - BEGIN // ===== ABOUT // Export // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflection. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionObject::export(string $argument, bool $return = ?): string // ===== CODE $return_reflectionobject_export = $reflectionobject->export( $argument, // string argument - The reflection to export. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // If the return parameter is set to true, then the export is returned as a string, otherwise null is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionobject.export.php // ========== REFLECTIONOBJECT_EXPORT - END // SYNTAX: // string ReflectionObject::export(string $argument, bool $return) return $return_reflectionobject_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT_EXPORT // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONOBJECT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ALLOWSNULL - bool php_variable_reflection_reflectionparameter_allowsnull(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CANBEPASSEDBYVALUE - bool php_variable_reflection_reflectionparameter_canbepassedbyvalue(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CLONE - void php_variable_reflection_reflectionparameter_clone(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CONSTRUCT - ReflectionParameter php_variable_reflection_reflectionparameter_construct(string|array|object $function, int|string $param) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_EXPORT - string php_variable_reflection_reflectionparameter_export(ReflectionParameter $reflectionparameter, string $function, string $parameter, bool $return) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETATTRIBUTES - array php_variable_reflection_reflectionparameter_getattributes(ReflectionParameter $reflectionparameter, string $name = null, int $flags = 0) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETCLASS - ReflectionClass php_variable_reflection_reflectionparameter_getclass(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGCLASS - ReflectionClass php_variable_reflection_reflectionparameter_getdeclaringclass(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGFUNCTION - ReflectionFunctionAbstract php_variable_reflection_reflectionparameter_getdeclaringfunction(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUE - mixed php_variable_reflection_reflectionparameter_getdefaultvalue(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUECONSTANTNAME - string php_variable_reflection_reflectionparameter_getdefaultvalueconstantname(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETNAME - string php_variable_reflection_reflectionparameter_getname(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETPOSITION - int php_variable_reflection_reflectionparameter_getposition(ReflectionParameter $reflectionparameter) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETTYPE - ReflectionType php_variable_reflection_reflectionparameter_gettype(ReflectionParameter $reflectionparameter) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_HASTYPE - bool php_variable_reflection_reflectionparameter_hastype(ReflectionParameter $reflectionparameter) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISARRAY - bool php_variable_reflection_reflectionparameter_isarray(ReflectionParameter $reflectionparameter) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISCALLABLE - bool php_variable_reflection_reflectionparameter_iscallable(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUEAVAILABLE - bool php_variable_reflection_reflectionparameter_isdefaultvalueavailable(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUECONSTANT - bool php_variable_reflection_reflectionparameter_isdefaultvalueconstant(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISOPTIONAL - bool php_variable_reflection_reflectionparameter_isoptional(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISPASSEDBYREFERENCE - bool php_variable_reflection_reflectionparameter_ispassedbyreference(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISVARIADIC - bool php_variable_reflection_reflectionparameter_isvariadic(ReflectionParameter $reflectionparameter) // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_TOSTRING - string php_variable_reflection_reflectionparameter_tostring(ReflectionParameter $reflectionparameter) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (23) // ReflectionParameter::allowsNull() - PHP_5, PHP_7, PHP_8 // ReflectionParameter::canBePassedByValue() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionParameter::__clone() - PHP_5, PHP_7, PHP_8 // ReflectionParameter::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionParameter::export() - PHP_5, PHP_7 // OFFLINE | ReflectionParameter::getAttributes() - PHP_8 // OFFLINE | ReflectionParameter::getClass() - PHP_5, PHP_7, PHP_8 // ReflectionParameter::getDeclaringClass() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ReflectionParameter::getDeclaringFunction() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ReflectionParameter::getDefaultValue() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ReflectionParameter::getDefaultValueConstantName() - PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ReflectionParameter::getName() - PHP_5, PHP_7, PHP_8 // ReflectionParameter::getPosition() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // OFFLINE | ReflectionParameter::getType() - PHP_7, PHP_8 // OFFLINE | ReflectionParameter::hasType() - PHP_7, PHP_8 // OFFLINE | ReflectionParameter::isArray() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // OFFLINE | ReflectionParameter::isCallable() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ReflectionParameter::isDefaultValueAvailable() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ReflectionParameter::isDefaultValueConstant() - PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ReflectionParameter::isOptional() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ReflectionParameter::isPassedByReference() - PHP_5, PHP_7, PHP_8 // ReflectionParameter::isVariadic() - PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ReflectionParameter::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (11) // bool // ReflectionParameter - PHP_5, PHP_7, PHP_8 // void // string // array // object // int // ReflectionClass - PHP_5, PHP_7, PHP_8 // ReflectionFunctionAbstract - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // mixed // OFFLINE | ReflectionType - PHP_7, PHP_8 // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ALLOWSNULL // ============================== PUBLIC // ============================== ABOUT // Checks if null is allowed. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::allowsNull() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_allowsnull($reflectionparameter) { $return_reflectionparameter_allowsnull = false; // ========== REFLECTIONPARAMETER_ALLOWSNULL - BEGIN // ===== ABOUT // Checks if null is allowed // ===== DESCRIPTION // Checks whether the parameter allows null. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::allowsNull(): bool // ===== CODE $return_reflectionparameter_allowsnull = $reflectionparameter->allowsNull( // This function has no parameters. ); // Return Values // true if null is allowed, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.allowsnull.php // ========== REFLECTIONPARAMETER_ALLOWSNULL - END // SYNTAX: // bool ReflectionParameter::allowsNull() return $return_reflectionparameter_allowsnull; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ALLOWSNULL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CANBEPASSEDBYVALUE // ============================== PUBLIC // ============================== ABOUT // Returns whether this parameter can be passed by value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::canBePassedByValue() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_canbepassedbyvalue($reflectionparameter) { $return_reflectionparameter_canbepassedbyvalue = false; // ========== REFLECTIONPARAMETER_CANBEPASSEDBYVALUE - BEGIN // ===== ABOUT // Returns whether this parameter can be passed by value // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::canBePassedByValue(): bool // ===== CODE $return_reflectionparameter_canbepassedbyvalue = $reflectionparameter->canBePassedByValue( // This function has no parameters. ); // Return Values // Returns true if the parameter can be passed by value, false otherwise. Returns null in case of an error. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.canbepassedbyvalue.php // ========== REFLECTIONPARAMETER_CANBEPASSEDBYVALUE - END // SYNTAX: // bool ReflectionParameter::canBePassedByValue() return $return_reflectionparameter_canbepassedbyvalue; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CANBEPASSEDBYVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CLONE // ============================== PUBLIC // ============================== ABOUT // Clone. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::__clone() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_clone($reflectionparameter) { // ========== REFLECTIONPARAMETER_CLONE - BEGIN // ===== ABOUT // Clone // ===== DESCRIPTION // Clones. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // private ReflectionParameter::__clone(): void // ===== CODE $reflectionparameter->__clone( // This function has no parameters. ); // Return Values // void // // Changelog // Version - Description // 8.1.0 - This method is no longer final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.clone.php // ========== REFLECTIONPARAMETER_CLONE - END // SYNTAX: // void ReflectionParameter::__clone() // return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CLONE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_construct($function, $param) { $return_reflectionparameter_construct = null; // ========== REFLECTIONPARAMETER_CONSTRUCT - BEGIN // ===== ABOUT // Construct // ===== DESCRIPTION // Constructs a ReflectionParameter instance. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::__construct(string|array|object $function, int|string $param) // ===== CODE $return_reflectionparameter_construct = new ReflectionParameter( $function, // string|array|object function - The function to reflect parameters from. $param // int|string param - Either an int specifying the position of the parameter (starting with zero), or the parameter name as string. ); // Return // ReflectionParameter // // [examples] // Examples // [example] // Example #1 Using the ReflectionParameter class // [php] // function foo($a, $b, $c) { } // function bar(Exception $a, &$b, $c) { } // function baz(ReflectionFunction $a, $b = 1, $c = null) { } // function abc() { } // // $reflect = new ReflectionFunction('foo'); // // echo $reflect; // // foreach ($reflect->getParameters() as $i => $param) { // printf( // "-- Parameter #%d: %s {\n". // " Class: %s\n". // " Allows NULL: %s\n". // " Passed to by reference: %s\n". // " Is optional?: %s\n". // "}\n", // $i, // $param->getPosition() can be used // $param->getName(), // var_export($param->getClass(), 1), // var_export($param->allowsNull(), 1), // var_export($param->isPassedByReference(), 1), // $param->isOptional() ? 'yes' : 'no' // ); // } // [/php] // The above example will output something similar to: // [result] // Function [ function foo ] { // @@ /Users/philip/cvs/phpdoc/a 2 - 2 // // - Parameters [3] { // Parameter #0 [ $a ] // Parameter #1 [ $b ] // Parameter #2 [ $c ] // } // } // -- Parameter #0: a { // Class: NULL // Allows NULL: true // Passed to by reference: false // Is optional?: no // } // -- Parameter #1: b { // Class: NULL // Allows NULL: true // Passed to by reference: false // Is optional?: no // } // -- Parameter #2: c { // Class: NULL // Allows NULL: true // Passed to by reference: false // Is optional?: no // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.construct.php // ========== REFLECTIONPARAMETER_CONSTRUCT - END // SYNTAX: // ReflectionParameter ReflectionParameter::__construct(string|array|object $function, int|string $param) return $return_reflectionparameter_construct; // ReflectionParameter } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_EXPORT // ============================== OFFLINE // ============================== ABOUT // Exports. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionParameter::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionparameter_export($reflectionparameter, $function, $parameter, $return) { $return_reflectionparameter_export = null; // ========== REFLECTIONPARAMETER_EXPORT - BEGIN // ===== ABOUT // Exports // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionParameter::export(string $function, string $parameter, bool $return = ?): string // ===== CODE $return_reflectionparameter_export = $reflectionparameter->export( $function, // string function - The function name. $parameter, // string parameter - The parameter name. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // The exported reflection. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.export.php // ========== REFLECTIONPARAMETER_EXPORT - END // SYNTAX: // string ReflectionParameter::export(string $function, string $parameter, bool $return) return $return_reflectionparameter_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETATTRIBUTES // ============================== OFFLINE // ============================== ABOUT // Gets Attributes. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getAttributes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_getattributes($reflectionparameter, $name = null, $flags = 0) { $return_reflectionparameter_getattributes = null; // ========== REFLECTIONPARAMETER_GETATTRIBUTES - BEGIN // ===== ABOUT // Gets Attributes // ===== DESCRIPTION // Returns all attributes declared on this parameter as an array of ReflectionAttribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionParameter::getAttributes(?string $name = null, int $flags = 0): array // ===== CODE $return_reflectionparameter_getattributes = $reflectionparameter->getAttributes( $name, // string name - Filter the results to include only ReflectionAttribute instances for attributes matching this class name. $flags // int flags - Flags for determining how to filter the results, if name is provided. // Default is 0 which will only return results for attributes that are of the class name. // The only other option available, is to use ReflectionAttribute::IS_INSTANCEOF, which will instead use instanceof for filtering. ); // Return Values // Array of attributes, as a ReflectionAttribute object. // // [examples] // Examples // [example] // Example #1 Basic usage // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // function fruitBasket( // #[Fruit] // #[Red] // string $apple // ) { } // // $reflection = new ReflectionFunction('fruitBasket'); // $parameter = $reflection->getParameter('apple'); // $attributes = $parameter->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #2 Filtering results by class name // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // function fruitBasket( // #[Fruit] // #[Red] // string $apple // ) { } // // $reflection = new ReflectionFunction('fruitBasket'); // $parameter = $reflection->getParameter('apple'); // $attributes = $parameter->getAttributes('Fruit'); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // ) // [/result] // [/example] // [example] // Example #3 Filtering results by class name, with inheritance // [php] // interface Color { // } // // #[Attribute] // class Fruit { // } // // function fruitBasket( // #[Fruit] // #[Red] // string $apple // ) { } // // $reflection = new ReflectionFunction('fruitBasket'); // $parameter = $reflection->getParameter('apple'); // $attributes = $parameter->getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Red // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getattributes.php // ========== REFLECTIONPARAMETER_GETATTRIBUTES - END // SYNTAX: // array ReflectionParameter::getAttributes(string $name = null, int $flags = 0) return $return_reflectionparameter_getattributes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETATTRIBUTES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETCLASS // ============================== OFFLINE // ============================== ABOUT // Get a ReflectionClass object for the parameter being reflected or null. // // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getClass() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_getclass($reflectionparameter) { $return_reflectionparameter_getclass = null; // ========== REFLECTIONPARAMETER_GETCLASS - BEGIN // ===== ABOUT // Get a ReflectionClass object for the parameter being reflected or null // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Gets a ReflectionClass object for the parameter being reflected or null. // As of PHP 8.0.0 this function is deprecated and not recommended. Instead, use ReflectionParameter::getType() to get the ReflectionType of the parameter, then interrogate that object to determine the parameter type. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getClass(): ?ReflectionClass // ===== CODE $return_reflectionparameter_getclass = $reflectionparameter->getClass( // This function has no parameters. ); // Return Values // A ReflectionClass object, or null if no type is declared, or the declared type is not a class or interface. // // [examples] // Examples // [example] // Example #1 Using the ReflectionParameter class // [php] // function foo(Exception $a) { } // // $functionReflection = new ReflectionFunction('foo'); // $parameters = $functionReflection->getParameters(); // $aParameter = $parameters[0]; // // echo $aParameter->getClass()->name; // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getclass.php // ========== REFLECTIONPARAMETER_GETCLASS - END // SYNTAX: // ReflectionClass ReflectionParameter::getClass() return $return_reflectionparameter_getclass; // ReflectionClass } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGCLASS // ============================== PUBLIC // ============================== ABOUT // Gets declaring class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getDeclaringClass() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getdeclaringclass($reflectionparameter) { $return_reflectionparameter_getdeclaringclass = null; // ========== REFLECTIONPARAMETER_GETDECLARINGCLASS - BEGIN // ===== ABOUT // Gets declaring class // ===== DESCRIPTION // Gets the declaring class. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getDeclaringClass(): ?ReflectionClass // ===== CODE $return_reflectionparameter_getdeclaringclass = $reflectionparameter->getDeclaringClass( // This function has no parameters. ); // Return Values // A ReflectionClass object or null if called on function. // // [examples] // Examples // [example] // Example #1 Getting the class that declared the method // [php] // class Foo // { // public function bar(\DateTime $datetime) // { // } // } // // class Baz extends Foo // { // } // // $param = new \ReflectionParameter(['Baz', 'bar'], 0); // // var_dump($param->getDeclaringClass()); // [/php] // The above example will output: // [result] // object(ReflectionClass)#2 (1) { // ["name"]=> // string(3) "Foo" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getdeclaringclass.php // ========== REFLECTIONPARAMETER_GETDECLARINGCLASS - END // SYNTAX: // ReflectionClass ReflectionParameter::getDeclaringClass() return $return_reflectionparameter_getdeclaringclass; // ReflectionClass } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGFUNCTION // ============================== PUBLIC // ============================== ABOUT // Gets declaring function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getDeclaringFunction() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getdeclaringfunction($reflectionparameter) { $return_reflectionparameter_getdeclaringfunction = null; // ========== REFLECTIONPARAMETER_GETDECLARINGFUNCTION - BEGIN // ===== ABOUT // Gets declaring function // ===== DESCRIPTION // Gets the declaring function. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getDeclaringFunction(): ReflectionFunctionAbstract // ===== CODE $return_reflectionparameter_getdeclaringfunction = $reflectionparameter->getDeclaringFunction( // This function has no parameters. ); // Return Values // A ReflectionFunction object. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getdeclaringfunction.php // ========== REFLECTIONPARAMETER_GETDECLARINGFUNCTION - END // SYNTAX: // ReflectionFunctionAbstract ReflectionParameter::getDeclaringFunction() return $return_reflectionparameter_getdeclaringfunction; // ReflectionFunctionAbstract } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDECLARINGFUNCTION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUE // ============================== PUBLIC // ============================== ABOUT // Gets default parameter value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getDefaultValue() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getdefaultvalue($reflectionparameter) { $return_reflectionparameter_getdefaultvalue = null; // ========== REFLECTIONPARAMETER_GETDEFAULTVALUE - BEGIN // ===== ABOUT // Gets default parameter value // ===== DESCRIPTION // Gets the default value of the parameter for any user-defined or internal function or method. If the parameter is not optional a ReflectionException will be thrown. // ===== SUPPORTED // PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getDefaultValue(): mixed // ===== CODE $return_reflectionparameter_getdefaultvalue = $reflectionparameter->getDefaultValue( // This function has no parameters. ); // Return Values // The parameters default value. // // Changelog // Version - Description // 8.0.0 - This method now allows getting the default value of parameters of built-in functions and built-in class methods. Previously, a ReflectionException was thrown. // // [examples] // Examples // [example] // Example #1 Getting default values of function parameters // [php] // function foo($test, $bar = 'baz') // { // echo $test . $bar; // } // // $function = new ReflectionFunction('foo'); // // foreach ($function->getParameters() as $param) { // echo 'Name: ' . $param->getName() . PHP_EOL; // if ($param->isOptional()) { // echo 'Default value: ' . $param->getDefaultValue() . PHP_EOL; // } // echo PHP_EOL; // } // [/php] // The above example will output: // [result] // Name: test // // Name: bar // Default value: baz // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getdefaultvalue.php // ========== REFLECTIONPARAMETER_GETDEFAULTVALUE - END // SYNTAX: // mixed ReflectionParameter::getDefaultValue() return $return_reflectionparameter_getdefaultvalue; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUECONSTANTNAME // ============================== PUBLIC // ============================== ABOUT // Returns the default value's constant name if default value is constant or null. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getDefaultValueConstantName() - PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getdefaultvalueconstantname($reflectionparameter) { $return_reflectionparameter_getdefaultvalueconstantname = null; // ========== REFLECTIONPARAMETER_GETDEFAULTVALUECONSTANTNAME - BEGIN // ===== ABOUT // Returns the default value's constant name if default value is constant or null // ===== DESCRIPTION // Returns the default value's constant name of the parameter of any user-defined or internal function or method, if default value is constant or null. If the parameter is not optional a ReflectionException will be thrown. // ===== SUPPORTED // PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getDefaultValueConstantName(): ?string // ===== CODE $return_reflectionparameter_getdefaultvalueconstantname = $reflectionparameter->getDefaultValueConstantName( // This function has no parameters. ); // Return Values // Returns string on success or null on failure. // // Changelog // Version - Description // 8.0.0 - This method now allows getting the default values' constant names of built-in functions and built-in class methods. Previously, a ReflectionException was thrown. // // [examples] // Examples // [example] // Example #1 Getting default values' constant names of function parameters // [php] // function foo($test, $bar = PHP_INT_MIN) // { // echo $test . $bar; // } // // $function = new ReflectionFunction('foo'); // // foreach ($function->getParameters() as $param) { // echo 'Name: ' . $param->getName() . PHP_EOL; // if ($param->isOptional()) { // echo 'Default value: ' . $param->getDefaultValueConstantName() . PHP_EOL; // } // echo PHP_EOL; // } // [/php] // The above example will output: // [result] // Name: test // // Name: bar // Default value: PHP_INT_MIN // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getdefaultvalueconstantname.php // ========== REFLECTIONPARAMETER_GETDEFAULTVALUECONSTANTNAME - END // SYNTAX: // string ReflectionParameter::getDefaultValueConstantName() return $return_reflectionparameter_getdefaultvalueconstantname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETDEFAULTVALUECONSTANTNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets parameter name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getname($reflectionparameter) { $return_reflectionparameter_getname = null; // ========== REFLECTIONPARAMETER_GETNAME - BEGIN // ===== ABOUT // Gets parameter name // ===== DESCRIPTION // Gets the name of the parameter. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getName(): string // ===== CODE $return_reflectionparameter_getname = $reflectionparameter->getName( // This function has no parameters. ); // Return Values // The name of the reflected parameter. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getname.php // ========== REFLECTIONPARAMETER_GETNAME - END // SYNTAX: // string ReflectionParameter::getName() return $return_reflectionparameter_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETPOSITION // ============================== PUBLIC // ============================== ABOUT // Gets parameter position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getPosition() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_getposition($reflectionparameter) { $return_reflectionparameter_getposition = 0; // ========== REFLECTIONPARAMETER_GETPOSITION - BEGIN // ===== ABOUT // Gets parameter position // ===== DESCRIPTION // Gets the position of the parameter. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getPosition(): int // ===== CODE $return_reflectionparameter_getposition = $reflectionparameter->getPosition( // This function has no parameters. ); // Return Values // The position of the parameter, left to right, starting at position #0. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.getposition.php // ========== REFLECTIONPARAMETER_GETPOSITION - END // SYNTAX: // int ReflectionParameter::getPosition() return $return_reflectionparameter_getposition; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETPOSITION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETTYPE // ============================== OFFLINE // ============================== ABOUT // Gets a parameter's type. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::getType() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_gettype($reflectionparameter) { $return_reflectionparameter_gettype = null; // ========== REFLECTIONPARAMETER_GETTYPE - BEGIN // ===== ABOUT // Gets a parameter's type // ===== DESCRIPTION // Gets the associated type of a parameter. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::getType(): ?ReflectionType // ===== CODE $return_reflectionparameter_gettype = $reflectionparameter->getType( // This function has no parameters. ); // Return Values // Returns a ReflectionType object if a parameter type is specified, null otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionParameter::getType() Usage as of PHP 7.1.0 // As of PHP 7.1.0, ReflectionType::__toString() is deprecated, and ReflectionParameter::getType() may return an instance of ReflectionNamedType. To get the name of the parameter type, ReflectionNamedType() is available in this case. // [php] // function someFunction(int $param, $param2) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParams = $reflectionFunc->getParameters(); // $reflectionType1 = $reflectionParams[0]->getType(); // $reflectionType2 = $reflectionParams[1]->getType(); // // assert($reflectionType1 instanceof ReflectionNamedType); // echo $reflectionType1->getName(), PHP_EOL; // var_dump($reflectionType2); // [/php] // The above example will output: // [result] // int // NULL // [/result] // [/example] // [example] // Example #2 ReflectionParameter::getType() Usage before PHP 7.1.0 // [php] // function someFunction(int $param, $param2) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParams = $reflectionFunc->getParameters(); // $reflectionType1 = $reflectionParams[0]->getType(); // $reflectionType2 = $reflectionParams[1]->getType(); // // echo $reflectionType1, PHP_EOL; // var_dump($reflectionType2); // [/php] // Output of the above example in PHP 7.0: // [result] // int // NULL // [/result] // [/example] // [example] // Example #3 ReflectionParameter::getType() Usage in PHP 8.0.0 and later // As of PHP 8.0.0, this method may return a ReflectionNamedType instance or a ReflectionUnionType instance. The latter is a collection of the former. To analyze a type, it is often convenient to normalize it to an array of ReflectionNamedType objects. The following function will return an array of 0 or more ReflectionNamedType instances. // [php] // function getAllTypes(ReflectionParameter $reflectionParameter): array // { // $reflectionType = $reflectionParameter->getType(); // // if (!$reflectionType) return []; // // return $reflectionType instanceof ReflectionUnionType // ? $reflectionType->getTypes() // : [$reflectionType]; // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-06) // URL: https://www.php.net/manual/en/reflectionparameter.gettype.php // ========== REFLECTIONPARAMETER_GETTYPE - END // SYNTAX: // ReflectionType ReflectionParameter::getType() return $return_reflectionparameter_gettype; // ReflectionType } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_GETTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_HASTYPE // ============================== OFFLINE // ============================== ABOUT // Checks if parameter has a type. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::hasType() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_hastype($reflectionparameter) { $return_reflectionparameter_hastype = false; // ========== REFLECTIONPARAMETER_HASTYPE - BEGIN // ===== ABOUT // Checks if parameter has a type // ===== DESCRIPTION // Checks if the parameter has a type associated with it. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::hasType(): bool // ===== CODE $return_reflectionparameter_hastype = $reflectionparameter->hasType( // This function has no parameters. ); // Return Values // true if a type is specified, false otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionParameter::hasType() example // [php] // function someFunction(string $param, $param2 = null) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParams = $reflectionFunc->getParameters(); // // var_dump($reflectionParams[0]->hasType()); // var_dump($reflectionParams[1]->hasType()); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.hastype.php // ========== REFLECTIONPARAMETER_HASTYPE - END // SYNTAX: // bool ReflectionParameter::hasType() return $return_reflectionparameter_hastype; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_HASTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISARRAY // ============================== OFFLINE // ============================== ABOUT // Checks if parameter expects an array. // // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // // See the example below for an alternative way to derive this information. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isArray() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_isarray($reflectionparameter) { $return_reflectionparameter_isarray = false; // ========== REFLECTIONPARAMETER_ISARRAY - BEGIN // ===== ABOUT // Checks if parameter expects an array // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // See the example below for an alternative way to derive this information. // ===== DESCRIPTION // Checks if the parameter expects an array. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isArray(): bool // ===== CODE $return_reflectionparameter_isarray = $reflectionparameter->isArray( // This function has no parameters. ); // Return Values // true if an array is expected, false otherwise. // // [examples] // Examples // [example] // Example #1 PHP 8.0.0 equivalent // As of PHP 8.0.0, the following code will report if a type declares arrays, including as part of a union. // [php] // function declaresArray(ReflectionParameter $reflectionParameter): bool // { // $reflectionType = $reflectionParameter->getType(); // // if (!$reflectionType) return false; // // $types = $reflectionType instanceof ReflectionUnionType // ? $reflectionType->getTypes() // : [$reflectionType]; // // return in_array('array', array_map(fn(ReflectionNamedType $t) => $t->getName(), $types)); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.isarray.php // ========== REFLECTIONPARAMETER_ISARRAY - END // SYNTAX: // bool ReflectionParameter::isArray() return $return_reflectionparameter_isarray; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISARRAY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISCALLABLE // ============================== OFFLINE // ============================== ABOUT // Returns whether parameter MUST be callable. // // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // // See the example below for an alternative way to derive this information. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isCallable() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionparameter_iscallable($reflectionparameter) { $return_reflectionparameter_iscallable = false; // ========== REFLECTIONPARAMETER_ISCALLABLE - BEGIN // ===== ABOUT // Returns whether parameter MUST be callable // Warning: This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged. // See the example below for an alternative way to derive this information. // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isCallable(): bool // ===== CODE $return_reflectionparameter_iscallable = $reflectionparameter->isCallable( // This function has no parameters. ); // Return Values // Returns true if the parameter is callable, false if it is not or null on failure. // // [examples] // Examples // [example] // Example #1 PHP 8.0.0 equivalent // As of PHP 8.0.0, the following code will report if a type supports callables, including as part of a union. // [php] // function declaresCallable(ReflectionParameter $reflectionParameter): bool // { // $reflectionType = $reflectionParameter->getType(); // // if (!$reflectionType) return false; // // $types = $reflectionType instanceof ReflectionUnionType // ? $reflectionType->getTypes() // : [$reflectionType]; // // return in_array('callable', array_map(fn(ReflectionNamedType $t) => $t->getName(), $types)); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.iscallable.php // ========== REFLECTIONPARAMETER_ISCALLABLE - END // SYNTAX: // bool ReflectionParameter::isCallable() return $return_reflectionparameter_iscallable; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISCALLABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUEAVAILABLE // ============================== PUBLIC // ============================== ABOUT // Checks if a default value is available. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isDefaultValueAvailable() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_isdefaultvalueavailable($reflectionparameter) { $return_reflectionparameter_isdefaultvalueavailable = false; // ========== REFLECTIONPARAMETER_ISDEFAULTVALUEAVAILABLE - BEGIN // ===== ABOUT // Checks if a default value is available // ===== DESCRIPTION // Checks if a default value for the parameter is available. // ===== SUPPORTED // PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isDefaultValueAvailable(): bool // ===== CODE $return_reflectionparameter_isdefaultvalueavailable = $reflectionparameter->isDefaultValueAvailable( // This function has no parameters. ); // Return Values // true if a default value is available, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.isdefaultvalueavailable.php // ========== REFLECTIONPARAMETER_ISDEFAULTVALUEAVAILABLE - END // SYNTAX: // bool ReflectionParameter::isDefaultValueAvailable() return $return_reflectionparameter_isdefaultvalueavailable; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUEAVAILABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUECONSTANT // ============================== PUBLIC // ============================== ABOUT // Returns whether the default value of this parameter is a constant. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isDefaultValueConstant() - PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_isdefaultvalueconstant($reflectionparameter) { $return_reflectionparameter_isdefaultvalueconstant = false; // ========== REFLECTIONPARAMETER_ISDEFAULTVALUECONSTANT - BEGIN // ===== ABOUT // Returns whether the default value of this parameter is a constant // ===== DESCRIPTION // Returns whether the default value of this parameter is a constant. // ===== SUPPORTED // PHP_5 >= PHP_5_4_6, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isDefaultValueConstant(): bool // ===== CODE $return_reflectionparameter_isdefaultvalueconstant = $reflectionparameter->isDefaultValueConstant( // This function has no parameters. ); // Return Values // Returns true if the default value is constant, and false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.isdefaultvalueconstant.php // ========== REFLECTIONPARAMETER_ISDEFAULTVALUECONSTANT - END // SYNTAX: // bool ReflectionParameter::isDefaultValueConstant() return $return_reflectionparameter_isdefaultvalueconstant; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISDEFAULTVALUECONSTANT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISOPTIONAL // ============================== PUBLIC // ============================== ABOUT // Checks if optional. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isOptional() - PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_isoptional($reflectionparameter) { $return_reflectionparameter_isoptional = false; // ========== REFLECTIONPARAMETER_ISOPTIONAL - BEGIN // ===== ABOUT // Checks if optional // ===== DESCRIPTION // Checks if the parameter is optional. // ===== SUPPORTED // PHP_5 >= PHP_5_0_3, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isOptional(): bool // ===== CODE $return_reflectionparameter_isoptional = $reflectionparameter->isOptional( // This function has no parameters. ); // Return Values // true if the parameter is optional, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.isoptional.php // ========== REFLECTIONPARAMETER_ISOPTIONAL - END // SYNTAX: // bool ReflectionParameter::isOptional() return $return_reflectionparameter_isoptional; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISOPTIONAL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISPASSEDBYREFERENCE // ============================== PUBLIC // ============================== ABOUT // Checks if passed by reference. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isPassedByReference() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_ispassedbyreference($reflectionparameter) { $return_reflectionparameter_ispassedbyreference = false; // ========== REFLECTIONPARAMETER_ISPASSEDBYREFERENCE - BEGIN // ===== ABOUT // Checks if passed by reference // ===== DESCRIPTION // Checks if the parameter is passed in by reference. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isPassedByReference(): bool // ===== CODE $return_reflectionparameter_ispassedbyreference = $reflectionparameter->isPassedByReference( // This function has no parameters. ); // Return Values // true if the parameter is passed in by reference, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.ispassedbyreference.php // ========== REFLECTIONPARAMETER_ISPASSEDBYREFERENCE - END // SYNTAX: // bool ReflectionParameter::isPassedByReference() return $return_reflectionparameter_ispassedbyreference; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISPASSEDBYREFERENCE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISVARIADIC // ============================== PUBLIC // ============================== ABOUT // Checks if the parameter is variadic. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::isVariadic() - PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_isvariadic($reflectionparameter) { $return_reflectionparameter_isvariadic = false; // ========== REFLECTIONPARAMETER_ISVARIADIC - BEGIN // ===== ABOUT // Checks if the parameter is variadic // ===== DESCRIPTION // Checks if the parameter was declared as a variadic parameter. // ===== SUPPORTED // PHP_5 >= PHP_5_6_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::isVariadic(): bool // ===== CODE $return_reflectionparameter_isvariadic = $reflectionparameter->isVariadic( // This function has no parameters. ); // Return Values // Returns true if the parameter is variadic, otherwise false. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.isvariadic.php // ========== REFLECTIONPARAMETER_ISVARIADIC - END // SYNTAX: // bool ReflectionParameter::isVariadic() return $return_reflectionparameter_isvariadic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_ISVARIADIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_TOSTRING // ============================== PUBLIC // ============================== ABOUT // To string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionParameter::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionparameter_tostring($reflectionparameter) { $return_reflectionparameter_tostring = null; // ========== REFLECTIONPARAMETER_TOSTRING - BEGIN // ===== ABOUT // To string // ===== DESCRIPTION // Get a human-readable description of the parameter. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionParameter::__toString(): string // ===== CODE $return_reflectionparameter_tostring = $reflectionparameter->__toString( // This function has no parameters. ); // Return Values // The string. // // [examples] // Examples // [example] // Example #1 ReflectionParameter::__toString() example // [php] // echo new ReflectionParameter('substr', 0); // [/php] // The above example will output something similar to: // [result] // Parameter #0 [ string $string ] // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionparameter.tostring.php // ========== REFLECTIONPARAMETER_TOSTRING - END // SYNTAX: // string ReflectionParameter::__toString() return $return_reflectionparameter_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPARAMETER // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY // ============================== PUBLIC // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CLONE - void php_variable_reflection_reflectionproperty_clone(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CONSTRUCT - ReflectionProperty php_variable_reflection_reflectionproperty_construct(object|string $class, string $property) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_EXPORT - string php_variable_reflection_reflectionproperty_export(ReflectionProperty $reflectionproperty, mixed $class, string $name, bool $return) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETATTRIBUTES - array php_variable_reflection_reflectionproperty_getattributes(ReflectionProperty $reflectionproperty, string $name = null, int $flags = 0) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDECLARINGCLASS - ReflectionClass php_variable_reflection_reflectionproperty_getdeclaringclass(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDEFAULTVALUE - mixed php_variable_reflection_reflectionproperty_getdefaultvalue(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDOCCOMMENT - string|false php_variable_reflection_reflectionproperty_getdoccomment(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETMODIFIERS - int php_variable_reflection_reflectionproperty_getmodifiers(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETNAME - string php_variable_reflection_reflectionproperty_getname(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETTYPE - ReflectionType php_variable_reflection_reflectionproperty_gettype(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETVALUE - mixed php_variable_reflection_reflectionproperty_getvalue(ReflectionProperty $reflectionproperty, object $object = null) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASDEFAULTVALUE - bool php_variable_reflection_reflectionproperty_hasdefaultvalue(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASTYPE - bool php_variable_reflection_reflectionproperty_hastype(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISDEFAULT - bool php_variable_reflection_reflectionproperty_isdefault(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISINITIALIZED - bool php_variable_reflection_reflectionproperty_isinitialized(ReflectionProperty $reflectionproperty, object $object = null) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPRIVATE - bool php_variable_reflection_reflectionproperty_isprivate(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROMOTED - bool php_variable_reflection_reflectionproperty_ispromoted(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROTECTED - bool php_variable_reflection_reflectionproperty_isprotected(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPUBLIC - bool php_variable_reflection_reflectionproperty_ispublic(ReflectionProperty $reflectionproperty) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISREADONLY - bool php_variable_reflection_reflectionproperty_isreadonly(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISSTATIC - bool php_variable_reflection_reflectionproperty_isstatic(ReflectionProperty $reflectionproperty) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETACCESSIBLE - void php_variable_reflection_reflectionproperty_setaccessible(ReflectionProperty $reflectionproperty, bool $accessible) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETVALUE - void php_variable_reflection_reflectionproperty_setvalue(ReflectionProperty $reflectionproperty, object $object, mixed $value) // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_TOSTRING - string php_variable_reflection_reflectionproperty_tostring(ReflectionProperty $reflectionproperty) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (24) // ReflectionProperty::__clone() - PHP_5, PHP_7, PHP_8 // ReflectionProperty::__construct() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::export() - PHP_5, PHP_7 // OFFLINE | ReflectionProperty::getAttributes() - PHP_8 // ReflectionProperty::getDeclaringClass() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::getDefaultValue() - PHP_8 // ReflectionProperty::getDocComment() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ReflectionProperty::getModifiers() - PHP_5, PHP_7, PHP_8 // ReflectionProperty::getName() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::getType() - PHP_7 >= 7_4_0, PHP_8 // ReflectionProperty::getValue() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::hasDefaultValue() - PHP_8 // OFFLINE | ReflectionProperty::hasType() - PHP_7 >= PHP_7_4_0, PHP_8 // ReflectionProperty::isDefault() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::isInitialized() - PHP_7 >= PHP_7_4_0, PHP_8 // ReflectionProperty::isPrivate() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::isPromoted() - PHP_8 // ReflectionProperty::isProtected() - PHP_5, PHP_7, PHP_8 // ReflectionProperty::isPublic() - PHP_5, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::isReadOnly() - PHP_8 >= PHP_8_1_0 // ReflectionProperty::isStatic() - PHP_5, PHP_7, PHP_8 // ReflectionProperty::setAccessible() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | ReflectionProperty::setValue() - PHP_5, PHP_7, PHP_8 // ReflectionProperty::__toString() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (11) // void // ReflectionProperty - PHP_5, PHP_7, PHP_8 // object // string // mixed // bool // array // int // ReflectionClass - PHP_5, PHP_7, PHP_8 // false // OFFLINE | ReflectionType - PHP_7, PHP_8 // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CLONE // ============================== PUBLIC // ============================== ABOUT // Clone. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::__clone() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_clone($reflectionproperty) { // ========== REFLECTIONPROPERTY_CLONE - BEGIN // ===== ABOUT // Clone // ===== DESCRIPTION // Clones. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // private ReflectionProperty::__clone(): void // ===== CODE $reflectionproperty->__clone( // This function has no parameters. ); // Return Values // void // // Changelog // Version - Description // 8.1.0 - This method is no longer final. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.clone.php // ========== REFLECTIONPROPERTY_CLONE - END // SYNTAX: // void ReflectionProperty::__clone() // return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CLONE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a ReflectionProperty object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_construct($class, $property) { $return_reflectionproperty_construct = null; // ========== REFLECTIONPROPERTY_CONSTRUCT - BEGIN // ===== ABOUT // Construct a ReflectionProperty object // ===== DESCRIPTION // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::__construct(object|string $class, string $property) // ===== CODE $return_reflectionproperty_construct = new ReflectionProperty( $class, // object|string class - Either a string containing the name of the class to reflect, or an object. $property // string property - The name of the property being reflected. ); // Return // ReflectionProperty // // Errors/Exceptions // Trying to get or set private or protected class property's values will result in an exception being thrown. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::__construct() example // [php] // class Str // { // public $length = 5; // } // // // Create an instance of the ReflectionProperty class // $prop = new ReflectionProperty('Str', 'length'); // // // Print out basic information // printf( // "===> The%s%s%s%s property '%s' (which was %s)\n" . // " having the modifiers %s\n", // $prop->isPublic() ? ' public' : '', // $prop->isPrivate() ? ' private' : '', // $prop->isProtected() ? ' protected' : '', // $prop->isStatic() ? ' static' : '', // $prop->getName(), // $prop->isDefault() ? 'declared at compile-time' : 'created at run-time', // var_export(Reflection::getModifierNames($prop->getModifiers()), 1) // ); // // // Create an instance of Str // $obj= new Str(); // // // Get current value // printf("---> Value is: "); // var_dump($prop->getValue($obj)); // // // Change value // $prop->setValue($obj, 10); // printf("---> Setting value to 10, new value is: "); // var_dump($prop->getValue($obj)); // // // Dump object // var_dump($obj); // [/php] // The above example will output something similar to: // [result] // ===> The public property 'length' (which was declared at compile-time) // having the modifiers array ( // 0 => 'public', // ) // ---> Value is: int(5) // ---> Setting value to 10, new value is: int(10) // object(Str)#2 (1) { // ["length"]=> // int(10) // } // [/result] // [/example] // [example] // Example #2 Getting value from private and protected properties using ReflectionProperty class // [php] // // class Foo { // public $x = 1; // protected $y = 2; // private $z = 3; // } // // $obj = new Foo; // // $prop = new ReflectionProperty('Foo', 'y'); // $prop->setAccessible(true); // var_dump($prop->getValue($obj)); // int(2) // // $prop = new ReflectionProperty('Foo', 'z'); // $prop->setAccessible(true); // var_dump($prop->getValue($obj)); // int(2) // // [/php] // The above example will output something similar to: // [result] // int(2) // int(3) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.construct.php // ========== REFLECTIONPROPERTY_CONSTRUCT - END // SYNTAX: // ReflectionProperty ReflectionProperty::__construct(object|string $class, string $property) return $return_reflectionproperty_construct; // ReflectionProperty } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_EXPORT // ============================== OFFLINE // ============================== ABOUT // Export. // // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // ReflectionProperty::export() - PHP_5, PHP_7 // ============================== CODE /* function php_variable_reflection_reflectionproperty_export($reflectionproperty, $class, $name, $return) { $return_reflectionproperty_export = null; // ========== REFLECTIONPROPERTY_EXPORT - BEGIN // ===== ABOUT // Export // Warning: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Exports a reflection. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7 // ===== SYNTAX // public static ReflectionProperty::export(mixed $class, string $name, bool $return = ?): string // ===== CODE $return_reflectionproperty_export = $reflectionproperty->export( $class, // mixed argument - The reflection to export. $name, // string name - The property name. $return // bool return - Setting to true will return the export, as opposed to emitting it. Setting to false (the default) will do the opposite. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.export.php // ========== REFLECTIONPROPERTY_EXPORT - END // SYNTAX: // string ReflectionProperty::export(mixed $class, string $name, bool $return) return $return_reflectionproperty_export; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_EXPORT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETATTRIBUTES // ============================== OFFLINE // ============================== ABOUT // Gets Attributes. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getAttributes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_getattributes($reflectionproperty, $name = null, $flags = 0) { $return_reflectionproperty_getattributes = null; // ========== REFLECTIONPROPERTY_GETATTRIBUTES - BEGIN // ===== ABOUT // Gets Attributes // ===== DESCRIPTION // Returns all attributes declared on this class property as an array of ReflectionAttribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionProperty::getAttributes(?string $name = null, int $flags = 0): array // ===== CODE $return_reflectionproperty_getattributes = $reflectionproperty->getAttributes( $name, // string name - Filter the results to include only ReflectionAttribute instances for attributes matching this class name. $flags // int flags - Flags for determining how to filter the results, if name is provided. // Default is 0 which will only return results for attributes that are of the class name. // The only other option available, is to use ReflectionAttribute::IS_INSTANCEOF, which will instead use instanceof for filtering. ); // Return Values // Array of attributes, as a ReflectionAttribute object. // // [examples] // Examples // [example] // Example #1 Basic usage // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // class Basket { // #[Fruit] // #[Red] // public string $apple = 'apple'; // } // // $property = new ReflectionProperty('Basket', 'apple'); // $attributes = $property->getAttributes(); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // [1] => Red // ) // [/result] // [/example] // [example] // Example #2 Filtering results by class name // [php] // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red { // } // // class Basket { // #[Fruit] // #[Red] // public string $apple = 'apple'; // } // // $property = new ReflectionProperty('Basket', 'apple'); // $attributes = $property->getAttributes('Fruit'); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Fruit // ) // [/result] // [/example] // [example] // Example #3 Filtering results by class name, with inheritance // [php] // interface Color { // } // // #[Attribute] // class Fruit { // } // // #[Attribute] // class Red implements Color { // } // // class Basket { // #[Fruit] // #[Red] // public string $apple = 'apple'; // } // // $property = new ReflectionProperty('Basket', 'apple'); // $attributes = $property->getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); // print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); // [/php] // The above example will output: // [result] // Array // ( // [0] => Red // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getattributes.php // ========== REFLECTIONPROPERTY_GETATTRIBUTES - END // SYNTAX: // array ReflectionProperty::getAttributes(string $name = null, int $flags = 0) return $return_reflectionproperty_getattributes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETATTRIBUTES // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDECLARINGCLASS // ============================== PUBLIC // ============================== ABOUT // Gets declaring class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getDeclaringClass() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_getdeclaringclass($reflectionproperty) { $return_reflectionproperty_getdeclaringclass = null; // ========== REFLECTIONPROPERTY_GETDECLARINGCLASS - BEGIN // ===== ABOUT // Gets declaring class // ===== DESCRIPTION // Gets the declaring class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::getDeclaringClass(): ReflectionClass // ===== CODE $return_reflectionproperty_getdeclaringclass = $reflectionproperty->getDeclaringClass( // This function has no parameters. ); // Return Values // A ReflectionClass object. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getdeclaringclass.php // ========== REFLECTIONPROPERTY_GETDECLARINGCLASS - END // SYNTAX: // ReflectionClass ReflectionProperty::getDeclaringClass() return $return_reflectionproperty_getdeclaringclass; // ReflectionClass } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDECLARINGCLASS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDEFAULTVALUE // ============================== OFFLINE // ============================== ABOUT // Returns the default value declared for a property. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getDefaultValue() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_getdefaultvalue($reflectionproperty) { $return_reflectionproperty_getdefaultvalue = null; // ========== REFLECTIONPROPERTY_GETDEFAULTVALUE - BEGIN // ===== ABOUT // Returns the default value declared for a property // ===== DESCRIPTION // Gets the implicit or explicitly declared default value for a property. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionProperty::getDefaultValue(): mixed // ===== CODE $return_reflectionproperty_getdefaultvalue = $reflectionproperty->getDefaultValue( // This function has no parameters. ); // Return Values // The default value if the property has any default value (including null). If there is no default value, then null is returned. It is not possible to differentiate between a null default value and an unitialized typed property. Use ReflectionProperty::hasDefaultValue() to detect the difference. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::getDefaultValue() example // [php] // class Foo { // public $bar = 1; // public ?int $baz; // public int $boing = 0; // public function __construct(public string $bak = "default") { } // } // // $ro = new ReflectionClass(Foo::class); // var_dump($ro->getProperty('bar')->getDefaultValue()); // var_dump($ro->getProperty('baz')->getDefaultValue()); // var_dump($ro->getProperty('boing')->getDefaultValue()); // var_dump($ro->getProperty('bak')->getDefaultValue()); // [/php] // The above example will output: // [result] // int(1) // NULL // int(0) // NULL // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getdefaultvalue.php // ========== REFLECTIONPROPERTY_GETDEFAULTVALUE - END // SYNTAX: // mixed ReflectionProperty::getDefaultValue() return $return_reflectionproperty_getdefaultvalue; // mixed } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDEFAULTVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDOCCOMMENT // ============================== PUBLIC // ============================== ABOUT // Gets the property doc comment. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getDocComment() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_getdoccomment($reflectionproperty) { $return_reflectionproperty_getdoccomment = false; // ========== REFLECTIONPROPERTY_GETDOCCOMMENT - BEGIN // ===== ABOUT // Gets the property doc comment // ===== DESCRIPTION // Gets the doc comment for a property. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::getDocComment(): string|false // ===== CODE $return_reflectionproperty_getdoccomment = $reflectionproperty->getDocComment( // This function has no parameters. ); // Return Values // The doc comment if it exists, otherwise false. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::getDocComment() example // [php] // class Str // { // /** // * @var int The length of the string // */ // public $length = 5; // } // // $prop = new ReflectionProperty('Str', 'length'); // // var_dump($prop->getDocComment()); // // [/php] // The above example will output something similar to: // [result] // string(53) "/** // * @var int The length of the string // */" // [/result] // [/example] // [example] // Example #2 Multiple property declarations // If multiple property declarations are preceeded by a single doc comment, the doc comment refers to the first property only. // [php] // class Foo // { // /** @var string */ // public $a, $b; // } // $class = new \ReflectionClass('Foo'); // foreach ($class->getProperties() as $property) { // echo $property->getName() . ': ' . var_export($property->getDocComment(), true) . PHP_EOL; // } // [/php] // The above example will output: // [result] // a: '/** @var string */' // b: false // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getdoccomment.php // ========== REFLECTIONPROPERTY_GETDOCCOMMENT - END // SYNTAX: // string|false ReflectionProperty::getDocComment() return $return_reflectionproperty_getdoccomment; // string|false } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETDOCCOMMENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETMODIFIERS // ============================== PUBLIC // ============================== ABOUT // Gets the property modifiers. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getModifiers() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_getmodifiers($reflectionproperty) { $return_reflectionproperty_getmodifiers = 0; // ========== REFLECTIONPROPERTY_GETMODIFIERS - BEGIN // ===== ABOUT // Gets the property modifiers // ===== DESCRIPTION // Gets the modifiers. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::getModifiers(): int // ===== CODE $return_reflectionproperty_getmodifiers = $reflectionproperty->getModifiers( // This function has no parameters. ); // Return Values // A numeric representation of the modifiers. The actual meaning of these modifiers are described under predefined constants. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getmodifiers.php // ========== REFLECTIONPROPERTY_GETMODIFIERS - END // SYNTAX: // int ReflectionProperty::getModifiers() return $return_reflectionproperty_getmodifiers; // int } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETMODIFIERS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETNAME // ============================== PUBLIC // ============================== ABOUT // Gets property name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getName() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_getname($reflectionproperty) { $return_reflectionproperty_getname = null; // ========== REFLECTIONPROPERTY_GETNAME - BEGIN // ===== ABOUT // Gets property name // ===== DESCRIPTION // Gets the properties name. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::getName(): string // ===== CODE $return_reflectionproperty_getname = $reflectionproperty->getName( // This function has no parameters. ); // Return Values // The name of the reflected property. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-07) // URL: https://www.php.net/manual/en/reflectionproperty.getname.php // ========== REFLECTIONPROPERTY_GETNAME - END // SYNTAX: // string ReflectionProperty::getName() return $return_reflectionproperty_getname; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETTYPE // ============================== OFFLINE // ============================== ABOUT // Gets a property's type. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getType() - PHP_7 >= 7_4_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_gettype($reflectionproperty) { $return_reflectionproperty_gettype = null; // ========== REFLECTIONPROPERTY_GETTYPE - BEGIN // ===== ABOUT // Gets a property's type // ===== DESCRIPTION // Gets the associated type of a property. // ===== SUPPORTED // PHP_7 >= 7_4_0, PHP_8 // ===== SYNTAX // public ReflectionProperty::getType(): ?ReflectionType // ===== CODE $return_reflectionproperty_gettype = $reflectionproperty->getType( // This function has no parameters. ); // Return Values // Returns a ReflectionType if the property has a type, and null otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::getType() example // [php] // class User // { // public string $name; // } // // $rp = new ReflectionProperty('User', 'name'); // echo $rp->getType()->getName(); // [/php] // The above example will output: // [result] // string // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.gettype.php // ========== REFLECTIONPROPERTY_GETTYPE - END // SYNTAX: // ReflectionType ReflectionProperty::getType() return $return_reflectionproperty_gettype; // ReflectionType } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETVALUE // ============================== PUBLIC // ============================== ABOUT // Gets value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::getValue() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_getvalue($reflectionproperty, $object = null) { $return_reflectionproperty_getvalue = null; // ========== REFLECTIONPROPERTY_GETVALUE - BEGIN // ===== ABOUT // Gets value // ===== DESCRIPTION // Gets the property's value. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::getValue(?object $object = null): mixed // ===== CODE $return_reflectionproperty_getvalue = $reflectionproperty->getValue( $object // object object - If the property is non-static an object must be provided to fetch the property from. If you want to fetch the default property without providing an object use ReflectionClass::getDefaultProperties() instead. ); // Return Values // The current value of the property. // // Changelog // Version - Description // 8.1.0 - Private and protected properties can be accessed by ReflectionProperty::getValue() right away. Previously, they needed to be made accessible by calling ReflectionProperty::setAccessible(); otherwise a ReflectionException was thrown. // 8.0.0 - object is nullable now. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::getValue() example // [php] // class Foo { // public static $staticProperty = 'foobar'; // // public $property = 'barfoo'; // protected $privateProperty = 'foofoo'; // } // // $reflectionClass = new ReflectionClass('Foo'); // // var_dump($reflectionClass->getProperty('staticProperty')->getValue()); // var_dump($reflectionClass->getProperty('property')->getValue(new Foo)); // // $reflectionProperty = $reflectionClass->getProperty('privateProperty'); // $reflectionProperty->setAccessible(true); // only required prior to PHP 8.1.0 // var_dump($reflectionProperty->getValue(new Foo)); // [/php] // The above example will output: // [result] // string(6) "foobar" // string(6) "barfoo" // string(6) "foofoo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.getvalue.php // ========== REFLECTIONPROPERTY_GETVALUE - END // SYNTAX: // mixed ReflectionProperty::getValue(object $object = null) return $return_reflectionproperty_getvalue; // mixed } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_GETVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASDEFAULTVALUE // ============================== OFFLINE // ============================== ABOUT // Checks if property has a default value declared. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::hasDefaultValue() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_hasdefaultvalue($reflectionproperty) { $return_reflectionproperty_hasdefaultvalue = false; // ========== REFLECTIONPROPERTY_HASDEFAULTVALUE - BEGIN // ===== ABOUT // Checks if property has a default value declared // ===== DESCRIPTION // Checks whether the property was declared with a default value, including an implicit null default value. Only returns false for typed properties without default value (or dynamic properties). // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionProperty::hasDefaultValue(): bool // ===== CODE $return_reflectionproperty_hasdefaultvalue = $reflectionproperty->hasDefaultValue( // This function has no parameters. ); // Return Values // If the property has any default value (including null) true is returned; if the property is typed without a default value declared or is a dynamic property, false is returned. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::hasDefaultValue() example // [php] // class Foo { // public $bar; // public ?int $baz; // public ?int $foo = null; // public int $boing; // // public function __construct() // { // $this->ping = ''; // } // } // // $ro = new ReflectionObject(new Foo()); // var_dump($ro->getProperty('bar')->hasDefaultValue()); // var_dump($ro->getProperty('baz')->hasDefaultValue()); // var_dump($ro->getProperty('foo')->hasDefaultValue()); // var_dump($ro->getProperty('boing')->hasDefaultValue()); // var_dump($ro->getProperty('ping')->hasDefaultValue()); // Dynamic property // var_dump($ro->getProperty('pong')->hasDefaultValue()); // Not defined property // [/php] // The above example will output: // [result] // bool(true) // bool(false) // bool(true) // bool(false) // bool(false) // // Fatal error: Uncaught ReflectionException: Property Foo::$pong does not exist in example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.hasdefaultvalue.php // ========== REFLECTIONPROPERTY_HASDEFAULTVALUE - END // SYNTAX: // bool ReflectionProperty::hasDefaultValue() return $return_reflectionproperty_hasdefaultvalue; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASDEFAULTVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASTYPE // ============================== OFFLINE // ============================== ABOUT // Checks if property has a type. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::hasType() - PHP_7 >= PHP_7_4_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_hastype($reflectionproperty) { $return_reflectionproperty_hastype = false; // ========== REFLECTIONPROPERTY_HASTYPE - BEGIN // ===== ABOUT // Checks if property has a type // ===== DESCRIPTION // Checks if the property has a type associated with it. // ===== SUPPORTED // PHP_7 >= PHP_7_4_0, PHP_8 // ===== SYNTAX // public ReflectionProperty::hasType(): bool // ===== CODE $return_reflectionproperty_hastype = $reflectionproperty->hasType( // This function has no parameters. ); // Return Values // true if a type is specified, false otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::hasType() example // [php] // class User // { // public string $name; // } // // $rp = new ReflectionProperty('User', 'name'); // var_dump($rp->hasType()); // [/php] // The above example will output: // [result] // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.hastype.php // ========== REFLECTIONPROPERTY_HASTYPE - END // SYNTAX: // bool ReflectionProperty::hasType() return $return_reflectionproperty_hastype; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_HASTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISDEFAULT // ============================== PUBLIC // ============================== ABOUT // Checks if property is a default property. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isDefault() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_isdefault($reflectionproperty) { $return_reflectionproperty_isdefault = false; // ========== REFLECTIONPROPERTY_ISDEFAULT - BEGIN // ===== ABOUT // Checks if property is a default property // ===== DESCRIPTION // Checks whether the property was declared at compile-time, or whether the property was dynamically declared at run-time. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::isDefault(): bool // ===== CODE $return_reflectionproperty_isdefault = $reflectionproperty->isDefault( // This function has no parameters. ); // Return Values // true if the property was declared at compile-time, or false if it was created at run-time. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::isDefault() example // [php] // class Foo { // public $bar; // } // // $o = new Foo(); // $o->bar = 42; // $o->baz = 42; // // $ro = new ReflectionObject($o); // var_dump($ro->getProperty('bar')->isDefault()); // var_dump($ro->getProperty('baz')->isDefault()); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isdefault.php // ========== REFLECTIONPROPERTY_ISDEFAULT - END // SYNTAX: // bool ReflectionProperty::isDefault() return $return_reflectionproperty_isdefault; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISDEFAULT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISINITIALIZED // ============================== OFFLINE // ============================== ABOUT // Checks whether a property is initialized. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isInitialized() - PHP_7 >= PHP_7_4_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_isinitialized($reflectionproperty, $object = null) { $return_reflectionproperty_isinitialized = false; // ========== REFLECTIONPROPERTY_ISINITIALIZED - BEGIN // ===== ABOUT // Checks whether a property is initialized // ===== DESCRIPTION // Checks whether a property is initialized. // ===== SUPPORTED // PHP_7 >= PHP_7_4_0, PHP_8 // ===== SYNTAX // public ReflectionProperty::isInitialized(?object $object = null): bool // ===== CODE $return_reflectionproperty_isinitialized = $reflectionproperty->isInitialized( $object // object object - If the property is non-static an object must be provided to fetch the property from. ); // Return Values // Returns false for typed properties prior to initialization, and for properties that have been explicitly unset(). For all other properties true will be returned. // // Errors/Exceptions // Throws a ReflectionException if the property is inaccessible. You can make a protected or private property accessible using ReflectionProperty::setAccessible(). // // Changelog // Version - Description // 8.0.0 - object is nullable now. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::isInitialized() example // [php] // class User // { // public string $name; // } // // $rp = new ReflectionProperty('User', 'name'); // $user = new User; // var_dump($rp->isInitialized($user)); // $user->name = 'Nikita'; // var_dump($rp->isInitialized($user)); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isinitialized.php // ========== REFLECTIONPROPERTY_ISINITIALIZED - END // SYNTAX: // bool ReflectionProperty::isInitialized(object $object = null) return $return_reflectionproperty_isinitialized; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISINITIALIZED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPRIVATE // ============================== PUBLIC // ============================== ABOUT // Checks if property is private. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isPrivate() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_isprivate($reflectionproperty) { $return_reflectionproperty_isprivate = false; // ========== REFLECTIONPROPERTY_ISPRIVATE - BEGIN // ===== ABOUT // Checks if property is private // ===== DESCRIPTION // Checks whether the property is private. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::isPrivate(): bool // ===== CODE $return_reflectionproperty_isprivate = $reflectionproperty->isPrivate( // This function has no parameters. ); // Return Values // true if the property is private, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isprivate.php // ========== REFLECTIONPROPERTY_ISPRIVATE - END // SYNTAX: // bool ReflectionProperty::isPrivate() return $return_reflectionproperty_isprivate; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPRIVATE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROMOTED // ============================== OFFLINE // ============================== ABOUT // Checks if property is promoted. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isPromoted() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_ispromoted($reflectionproperty) { $return_reflectionproperty_ispromoted = false; // ========== REFLECTIONPROPERTY_ISPROMOTED - BEGIN // ===== ABOUT // Checks if property is promoted // ===== DESCRIPTION // Checks whether the property is promoted // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionProperty::isPromoted(): bool // ===== CODE $return_reflectionproperty_ispromoted = $reflectionproperty->isPromoted( // This function has no parameters. ); // Return Values // true if the property is promoted, false otherwise. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::isPromoted() example // [php] // class Foo { // public $baz; // // public function __construct(public $bar) {} // } // // $o = new Foo(42); // $o->baz = 42; // // $ro = new ReflectionObject($o); // var_dump($ro->getProperty('bar')->isPromoted()); // var_dump($ro->getProperty('baz')->isPromoted()); // [/php] // The above example will output: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.ispromoted.php // ========== REFLECTIONPROPERTY_ISPROMOTED - END // SYNTAX: // bool ReflectionProperty::isPromoted() return $return_reflectionproperty_ispromoted; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROMOTED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROTECTED // ============================== PUBLIC // ============================== ABOUT // Checks if property is protected. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isProtected() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_isprotected($reflectionproperty) { $return_reflectionproperty_isprotected = false; // ========== REFLECTIONPROPERTY_ISPROTECTED - BEGIN // ===== ABOUT // Checks if property is protected // ===== DESCRIPTION // Checks whether the property is protected. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::isProtected(): bool // ===== CODE $return_reflectionproperty_isprotected = $reflectionproperty->isProtected( // This function has no parameters. ); // Return Values // true if the property is protected, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isprotected.php // ========== REFLECTIONPROPERTY_ISPROTECTED - END // SYNTAX: // bool ReflectionProperty::isProtected() return $return_reflectionproperty_isprotected; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPROTECTED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPUBLIC // ============================== PUBLIC // ============================== ABOUT // Checks if property is public. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isPublic() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_ispublic($reflectionproperty) { $return_reflectionproperty_ispublic = false; // ========== REFLECTIONPROPERTY_ISPUBLIC - BEGIN // ===== ABOUT // Checks if property is public // ===== DESCRIPTION // Checks whether the property is public. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::isPublic(): bool // ===== CODE $return_reflectionproperty_ispublic = $reflectionproperty->isPublic( // This function has no parameters. ); // Return Values // true if the property is public, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.ispublic.php // ========== REFLECTIONPROPERTY_ISPUBLIC - END // SYNTAX: // bool ReflectionProperty::isPublic() return $return_reflectionproperty_ispublic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISPUBLIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISREADONLY // ============================== OFFLINE // ============================== ABOUT // Checks if property is readonly. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isReadOnly() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionproperty_isreadonly($reflectionproperty) { $return_reflectionproperty_isreadonly = false; // ========== REFLECTIONPROPERTY_ISREADONLY - BEGIN // ===== ABOUT // Checks if property is readonly // ===== DESCRIPTION // Checks whether the property is readonly. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionProperty::isReadOnly(): bool // ===== CODE $return_reflectionproperty_isreadonly = $reflectionproperty->isReadOnly( // This function has no parameters. ); // Return Values // true if the property is readonly, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isreadonly.php // ========== REFLECTIONPROPERTY_ISREADONLY - END // SYNTAX: // bool ReflectionProperty::isReadOnly() return $return_reflectionproperty_isreadonly; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISREADONLY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISSTATIC // ============================== PUBLIC // ============================== ABOUT // Checks if property is static. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::isStatic() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_isstatic($reflectionproperty) { $return_reflectionproperty_isstatic = false; // ========== REFLECTIONPROPERTY_ISSTATIC - BEGIN // ===== ABOUT // Checks if property is static // ===== DESCRIPTION // Checks whether the property is static. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::isStatic(): bool // ===== CODE $return_reflectionproperty_isstatic = $reflectionproperty->isStatic( // This function has no parameters. ); // Return Values // true if the property is static, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.isstatic.php // ========== REFLECTIONPROPERTY_ISSTATIC - END // SYNTAX: // bool ReflectionProperty::isStatic() return $return_reflectionproperty_isstatic; // bool } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_ISSTATIC // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETACCESSIBLE // ============================== PUBLIC // ============================== ABOUT // Set property accessibility. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::setAccessible() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_setaccessible($reflectionproperty, $accessible) { // ========== REFLECTIONPROPERTY_SETACCESSIBLE - BEGIN // ===== ABOUT // Set property accessibility // ===== DESCRIPTION // Enables access to a protected or private property via the ReflectionProperty::getValue() and ReflectionProperty::setValue() methods. // Note: As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::setAccessible(bool $accessible): void // ===== CODE $reflectionproperty->setAccessible( $accessible // bool accessible - true to allow accessibility, or false. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 Simple Class definition // [php] // class MyClass // { // private $foo = 'bar'; // } // // $property = new ReflectionProperty("MyClass", "foo"); // $property->setAccessible(true); // // $obj = new MyClass(); // echo $property->getValue($obj); // echo $obj->foo; // [/php] // The above example will output something similar to: // [result] // bar // Fatal error: Uncaught Error: Cannot access private property MyClass::$foo in /in/WJqTv:12 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.setaccessible.php // ========== REFLECTIONPROPERTY_SETACCESSIBLE - END // SYNTAX: // void ReflectionProperty::setAccessible(bool $accessible) // return: void } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETACCESSIBLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETVALUE // ============================== OFFLINE // ============================== ABOUT // Set property value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::setValue() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionproperty_setvalue($reflectionproperty, $object, $value) { // ========== REFLECTIONPROPERTY_SETVALUE - BEGIN // ===== ABOUT // Set property value // ===== DESCRIPTION // Sets (changes) the property's value. // Note: As of PHP 8.3.0, calling this method with a single argument is deprecated, use ReflectionClass::setStaticPropertyValue() instead. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::setValue(object $object, mixed $value): void // // public ReflectionProperty::setValue(mixed $value): void // ===== CODE $reflectionproperty->setValue( $object, // object object - If the property is non-static an object must be provided to change the property on. If the property is static a value of null must be to be provided. $value // mixed value - The new value. ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.3.0 - Calling this method with a single argument is deprecated, ReflectionClass::setStaticPropertyValue() should be used instead to modify static properties. // 8.1.0 - Private and protected properties can be accessed by ReflectionProperty::setValue() right away. Previously, they needed to be made accessible by calling ReflectionProperty::setAccessible(); otherwise a ReflectionException was thrown. // // [examples] // Examples // [example] // Example #1 ReflectionProperty::setValue() example // [php] // class Foo { // public static $staticProperty; // // public $property; // protected $privateProperty; // } // // $reflectionClass = new ReflectionClass('Foo'); // // // As of PHP 8.3, setValue should no longer be used to set static property value, use setStaticPropertyValue() instead // $reflectionClass->setStaticPropertyValue('staticProperty', 'foo'); // var_dump(Foo::$staticProperty); // // $foo = new Foo; // // $reflectionClass->getProperty('property')->setValue($foo, 'bar'); // var_dump($foo->property); // // $reflectionProperty = $reflectionClass->getProperty('privateProperty'); // $reflectionProperty->setAccessible(true); // only required prior to PHP 8.1.0 // $reflectionProperty->setValue($foo, 'foobar'); // var_dump($reflectionProperty->getValue($foo)); // [/php] // The above example will output: // [result] // string(3) "foo" // string(3) "bar" // string(6) "foobar" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.setvalue.php // ========== REFLECTIONPROPERTY_SETVALUE - END // SYNTAX: // void ReflectionProperty::setValue(object $object, mixed $value) // return: void } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_SETVALUE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_TOSTRING // ============================== PUBLIC // ============================== ABOUT // To string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionProperty::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_variable_reflection_reflectionproperty_tostring($reflectionproperty) { $return_reflectionproperty_tostring = null; // ========== REFLECTIONPROPERTY_TOSTRING - BEGIN // ===== ABOUT // To string // ===== DESCRIPTION // Returns the string representation of the property. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ReflectionProperty::__toString(): string // ===== CODE $return_reflectionproperty_tostring = $reflectionproperty->__toString( // This function has no parameters. ); // Return Values // The string. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionproperty.tostring.php // ========== REFLECTIONPROPERTY_TOSTRING - END // SYNTAX: // string ReflectionProperty::__toString() return $return_reflectionproperty_tostring; // string } // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONPROPERTY // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_ALLOWSNULL - bool php_variable_reflection_reflectiontype_allowsnull(ReflectionType $reflectiontype) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_TOSTRING - string php_variable_reflection_reflectiontype_tostring(ReflectionType $reflectiontype) // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (2) // OFFLINE | ReflectionType::allowsNull() - PHP_7, PHP_8 // OFFLINE | ReflectionType::__toString() - PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // bool // OFFLINE | ReflectionType - PHP_7, PHP_8 // string // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_ALLOWSNULL // ============================== OFFLINE // ============================== ABOUT // Checks if null is allowed. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionType::allowsNull() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiontype_allowsnull($reflectiontype) { $return_reflectiontype_allowsnull = false; // ========== REFLECTIONTYPE_ALLOWSNULL - BEGIN // ===== ABOUT // Checks if null is allowed // ===== DESCRIPTION // Checks whether the parameter allows null. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionType::allowsNull(): bool // ===== CODE $return_reflectiontype_allowsnull = $reflectiontype->allowsNull( // This function has no parameters. ); // Return Values // true if null is allowed, otherwise false // // [examples] // Examples // [example] // Example #1 ReflectionType::allowsNull() example // [php] // function someFunction(string $param, stdClass $param2 = null) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParams = $reflectionFunc->getParameters(); // // var_dump($reflectionParams[0]->getType()->allowsNull()); // var_dump($reflectionParams[1]->getType()->allowsNull()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiontype.allowsnull.php // ========== REFLECTIONTYPE_ALLOWSNULL - END // SYNTAX: // bool ReflectionType::allowsNull() return $return_reflectiontype_allowsnull; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_ALLOWSNULL // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_TOSTRING // ============================== OFFLINE // ============================== ABOUT // To string. // // Warning: This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionType::__toString() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiontype_tostring($reflectiontype) { $return_reflectiontype_tostring = null; // ========== REFLECTIONTYPE_TOSTRING - BEGIN // ===== ABOUT // To string // Warning: This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Gets the parameter type name. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionType::__toString(): string // ===== CODE $return_reflectiontype_tostring = $reflectiontype->__toString( // This function has no parameters. ); // Return Values // Returns the type of the parameter. // // Changelog // Version - Description // 7.1.0 - ReflectionType::__toString() has been deprecated. // // [examples] // Examples // [example] // Example #1 ReflectionType::__toString() example // [php] // function someFunction(string $param) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParam = $reflectionFunc->getParameters()[0]; // // echo $reflectionParam->getType(); // [/php] // The above example will output something similar to: // [result] // string // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiontype.tostring.php // ========== REFLECTIONTYPE_TOSTRING - END // SYNTAX: // string ReflectionType::__toString() return $return_reflectiontype_tostring; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE_TOSTRING // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONUNIONTYPE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONUNIONTYPE_GETTYPES - array php_variable_reflection_reflectionuniontype_gettypes(ReflectionUnionType $reflectionuniontype) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // OFFLINE | ReflectionUnionType::getTypes() - PHP_8 // ============================== USING DATA_TYPES (2) // array // OFFLINE | ReflectionUnionType - PHP_8 // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONUNIONTYPE_GETTYPES // ============================== OFFLINE // ============================== ABOUT // Returns the types included in the union type. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionUnionType::getTypes() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionuniontype_gettypes($reflectionuniontype) { $return_reflectionuniontype_gettypes = null; // ========== REFLECTIONUNIONTYPE_GETTYPES - BEGIN // ===== ABOUT // Returns the types included in the union type // ===== DESCRIPTION // Returns the reflections of types included in the union type. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionUnionType::getTypes(): array // ===== CODE $return_reflectionuniontype_gettypes = $reflectionuniontype->getTypes( // This function has no parameters. ); // Return Values // An array of ReflectionType objects. // // [examples] // Examples // [example] // Example #1 ReflectionUnionType::getTypes() example // [php] // function someFunction(int|float $number) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParam = $reflectionFunc->getParameters()[0]; // // var_dump($reflectionParam->getType()->getTypes()); // [/php] // The above example will output something similar to: // [result] // array(2) { // [0] => // class ReflectionNamedType#4(0) { // } // [1] => // class ReflectionNamedType#5(0) { // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectionuniontype.gettypes.php // ========== REFLECTIONUNIONTYPE_GETTYPES - END // SYNTAX: // array ReflectionUnionType::getTypes() return $return_reflectionuniontype_gettypes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONUNIONTYPE_GETTYPES // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONUNIONTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_CONSTRUCT - ReflectionGenerator php_variable_reflection_reflectiongenerator_construct(Generator $generator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGFILE - string php_variable_reflection_reflectiongenerator_getexecutingfile(ReflectionGenerator $reflectiongenerator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGGENERATOR - Generator php_variable_reflection_reflectiongenerator_getexecutinggenerator(ReflectionGenerator $reflectiongenerator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGLINE - int php_variable_reflection_reflectiongenerator_getexecutingline(ReflectionGenerator $reflectiongenerator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETFUNCTION - ReflectionFunctionAbstract php_variable_reflection_reflectiongenerator_getfunction(ReflectionGenerator $reflectiongenerator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTHIS - object php_variable_reflection_reflectiongenerator_getthis(ReflectionGenerator $reflectiongenerator) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTRACE - array php_variable_reflection_reflectiongenerator_gettrace(ReflectionGenerator $reflectiongenerator, int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (7) // OFFLINE | ReflectionGenerator::__construct() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getExecutingFile() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getExecutingGenerator() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getExecutingLine() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getFunction() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getThis() - PHP_7, PHP_8 // OFFLINE | ReflectionGenerator::getTrace() - PHP_7, PHP_8 // ============================== USING DATA_TYPES (7) // OFFLINE | ReflectionGenerator - PHP_7, PHP_8 // Generator // string // int // ReflectionFunctionAbstract - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // object // array // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Constructs a ReflectionGenerator object. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::__construct() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_construct($generator) { $return_reflectiongenerator_construct = null; // ========== REFLECTIONGENERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionGenerator object // ===== DESCRIPTION // Constructs a ReflectionGenerator object. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::__construct(Generator $generator) // ===== CODE $return_reflectiongenerator_construct = new ReflectionGenerator( $generator // Generator generator - A generator object. ); // Return // ReflectionGenerator // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::__construct() example // [php] // // function gen() // { // yield 1; // } // // $gen = gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // echo <<< output // {$reflectionGen->getFunction()->name} // Line: {$reflectionGen->getExecutingLine()} // File: {$reflectionGen->getExecutingFile()} // output; // [/php] // The above example will output something similar to: // [result] // gen // Line: 5 // File: /path/to/file/example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.construct.php // ========== REFLECTIONGENERATOR_CONSTRUCT - END // SYNTAX: // ReflectionGenerator ReflectionGenerator::__construct(Generator $generator) return $return_reflectiongenerator_construct; // ReflectionGenerator } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGFILE // ============================== OFFLINE // ============================== ABOUT // Gets the file name of the currently executing generator. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getExecutingFile() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_getexecutingfile($reflectiongenerator) { $return_reflectiongenerator_getexecutingfile = null; // ========== REFLECTIONGENERATOR_GETEXECUTINGFILE - BEGIN // ===== ABOUT // Gets the file name of the currently executing generator // ===== DESCRIPTION // Get the full path and file name of the currently executing generator. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getExecutingFile(): string // ===== CODE $return_reflectiongenerator_getexecutingfile = $reflectiongenerator->getExecutingFile( // This function has no parameters. ); // Return Values // Returns the full path and file name of the currently executing generator. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getExecutingFile() example // [php] // // class GenExample // { // public function gen() // { // yield 1; // } // } // // $gen = (new GenExample)->gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // echo "File: {$reflectionGen->getExecutingFile()}"; // [/php] // The above example will output something similar to: // [result] // File: /path/to/file/example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.getexecutingfile.php // ========== REFLECTIONGENERATOR_GETEXECUTINGFILE - END // SYNTAX: // string ReflectionGenerator::getExecutingFile() return $return_reflectiongenerator_getexecutingfile; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGFILE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGGENERATOR // ============================== OFFLINE // ============================== ABOUT // Gets the executing Generator object. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getExecutingGenerator() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_getexecutinggenerator($reflectiongenerator) { $return_reflectiongenerator_getexecutinggenerator = null; // ========== REFLECTIONGENERATOR_GETEXECUTINGGENERATOR - BEGIN // ===== ABOUT // Gets the executing Generator object // ===== DESCRIPTION // Get the executing Generator object // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getExecutingGenerator(): Generator // ===== CODE $return_reflectiongenerator_getexecutinggenerator = $reflectiongenerator->getExecutingGenerator( // This function has no parameters. ); // Return Values // Returns the currently executing Generator object. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getExecutingGenerator() example // [php] // // class GenExample // { // public function gen() // { // yield 1; // } // } // // $gen = (new GenExample)->gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // $gen2 = $reflectionGen->getExecutingGenerator(); // // var_dump($gen2 === $gen); // var_dump($gen2->current()); // [/php] // The above example will output something similar to: // [result] // bool(true) // int(1); // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.getexecutinggenerator.php // ========== REFLECTIONGENERATOR_GETEXECUTINGGENERATOR - END // SYNTAX: // Generator ReflectionGenerator::getExecutingGenerator() return $return_reflectiongenerator_getexecutinggenerator; // Generator } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGGENERATOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGLINE // ============================== OFFLINE // ============================== ABOUT // Gets the currently executing line of the generator. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getExecutingLine() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_getexecutingline($reflectiongenerator) { $return_reflectiongenerator_getexecutingline = 0; // ========== REFLECTIONGENERATOR_GETEXECUTINGLINE - BEGIN // ===== ABOUT // Gets the currently executing line of the generator // ===== DESCRIPTION // Get the currently executing line number of the generator. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getExecutingLine(): int // ===== CODE $return_reflectiongenerator_getexecutingline = $reflectiongenerator->getExecutingLine( // This function has no parameters. ); // Return Values // Returns the line number of the currently executing statement in the generator. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getExecutingLine() example // [php] // // class GenExample // { // public function gen() // { // yield 1; // } // } // // $gen = (new GenExample)->gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // echo "Line: {$reflectionGen->getExecutingLine()}"; // [/php] // The above example will output something similar to: // [result] // Line: 7 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.getexecutingline.php // ========== REFLECTIONGENERATOR_GETEXECUTINGLINE - END // SYNTAX: // int ReflectionGenerator::getExecutingLine() return $return_reflectiongenerator_getexecutingline; // int } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETEXECUTINGLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETFUNCTION // ============================== OFFLINE // ============================== ABOUT // Gets the function name of the generator. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getFunction() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_getfunction($reflectiongenerator) { $return_reflectiongenerator_getfunction = null; // ========== REFLECTIONGENERATOR_GETFUNCTION - BEGIN // ===== ABOUT // Gets the function name of the generator // ===== DESCRIPTION // Enables the function name of the generator to be obtained by returning a class derived from ReflectionFunctionAbstract. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getFunction(): ReflectionFunctionAbstract // ===== CODE $return_reflectiongenerator_getfunction = $reflectiongenerator->getFunction( // This function has no parameters. ); // Return Values // Returns a ReflectionFunctionAbstract class. This will be ReflectionFunction for functions, or ReflectionMethod for methods. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getFunction() example // [php] // // function gen() // { // yield 1; // } // // $gen = gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // var_dump($reflectionGen->getFunction()); // [/php] // The above example will output something similar to: // [result] // object(ReflectionFunction)#3 (1) { // ["name"]=> // string(3) "gen" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.getfunction.php // ========== REFLECTIONGENERATOR_GETFUNCTION - END // SYNTAX: // ReflectionFunctionAbstract ReflectionGenerator::getFunction() return $return_reflectiongenerator_getfunction; // ReflectionFunctionAbstract } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETFUNCTION // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTHIS // ============================== OFFLINE // ============================== ABOUT // Gets the $this value of the generator. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getThis() - PHP_7, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectiongenerator_getthis($reflectiongenerator) { $return_reflectiongenerator_getthis = null; // ========== REFLECTIONGENERATOR_GETTHIS - BEGIN // ===== ABOUT // Gets the $this value of the generator // ===== DESCRIPTION // Get the $this value that the generator has access to. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getThis(): ?object // ===== CODE $return_reflectiongenerator_getthis = $reflectiongenerator->getThis( // This function has no parameters. ); // Return Values // Returns the $this value, or null if the generator was not created in a class context. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getThis() example // [php] // // class GenExample // { // public function gen() // { // yield 1; // } // } // // $gen = (new GenExample)->gen(); // // $reflectionGen = new ReflectionGenerator($gen); // // var_dump($reflectionGen->getThis()); // [/php] // The above example will output something similar to: // [result] // object(GenExample)#3 (0) { // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.getthis.php // ========== REFLECTIONGENERATOR_GETTHIS - END // SYNTAX: // object ReflectionGenerator::getThis() return $return_reflectiongenerator_getthis; // object } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTHIS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTRACE // ============================== OFFLINE // ============================== ABOUT // Gets the trace of the executing generator. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionGenerator::getTrace() - PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // DEBUG_BACKTRACE_PROVIDE_OBJECT - ReflectionGenerator::getTrace() // ============================== CODE /* function php_variable_reflection_reflectiongenerator_gettrace($reflectiongenerator, $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) { $return_reflectiongenerator_gettrace = null; // ========== REFLECTIONGENERATOR_GETTRACE - BEGIN // ===== ABOUT // Gets the trace of the executing generator // ===== DESCRIPTION // Get the trace of the currently executing generator. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public ReflectionGenerator::getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array // ===== CODE $return_reflectiongenerator_gettrace = $reflectiongenerator->getTrace( $options // int options - The value of options can be any of the following flags. // Available options // Option - Description // DEBUG_BACKTRACE_PROVIDE_OBJECT - Default. // DEBUG_BACKTRACE_IGNORE_ARGS - Don't include the argument information for functions in the stack trace. ); // Return Values // Returns the trace of the currently executing generator. // // [examples] // Examples // [example] // Example #1 ReflectionGenerator::getTrace() example // [php] // function foo() { // yield 1; // } // // function bar() // { // yield from foo(); // } // // function baz() // { // yield from bar(); // } // // $gen = baz(); // $gen->valid(); // start the generator // // var_dump((new ReflectionGenerator($gen))->getTrace()); // [/php] // The above example will output something similar to: // [result] // array(2) { // [0]=> // array(4) { // ["file"]=> // string(18) "example.php" // ["line"]=> // int(8) // ["function"]=> // string(3) "foo" // ["args"]=> // array(0) { // } // } // [1]=> // array(4) { // ["file"]=> // string(18) "example.php" // ["line"]=> // int(12) // ["function"]=> // string(3) "bar" // ["args"]=> // array(0) { // } // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-08) // URL: https://www.php.net/manual/en/reflectiongenerator.gettrace.php // ========== REFLECTIONGENERATOR_GETTRACE - END // SYNTAX: // array ReflectionGenerator::getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) return $return_reflectiongenerator_gettrace; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR_GETTRACE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONGENERATOR // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_CONSTRUCT - ReflectionFiber php_variable_reflection_reflectionfiber_construct(Fiber $fiber) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETCALLABLE - callable php_variable_reflection_reflectionfiber_getcallable(ReflectionFiber $reflectionfiber) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGFILE - string php_variable_reflection_reflectionfiber_getexecutingfile(ReflectionFiber $reflectionfiber) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGLINE - int php_variable_reflection_reflectionfiber_getexecutingline(ReflectionFiber $reflectionfiber) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETFIBER - Fiber php_variable_reflection_reflectionfiber_getfiber(ReflectionFiber $reflectionfiber) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETTRACE - array php_variable_reflection_reflectionfiber_gettrace(ReflectionFiber $reflectionfiber, int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (6) // OFFLINE | ReflectionFiber::__construct() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFiber::getCallable() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFiber::getExecutingFile() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFiber::getExecutingLine() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFiber::getFiber() - PHP_8 >= PHP_8_1_0 // OFFLINE | ReflectionFiber::getTrace() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (6) // OFFLINE | ReflectionFiber - PHP_8 >= PHP_8_1_0 // Fiber // callable // string // int // array // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Constructs a ReflectionFiber object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::__construct() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfiber_construct($fiber) { $return_reflectionfiber_construct = null; // ========== REFLECTIONFIBER_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ReflectionFiber object // ===== DESCRIPTION // Constructs a ReflectionFiber object. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::__construct(Fiber $fiber) // ===== CODE $return_reflectionfiber_construct = new ReflectionFiber( $fiber // Fiber fiber - The Fiber to reflect. ); // Return // ReflectionFiber // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.construct.php // ========== REFLECTIONFIBER_CONSTRUCT - END // SYNTAX: // ReflectionFiber ReflectionFiber::__construct(Fiber $fiber) return $return_reflectionfiber_construct; // ReflectionFiber } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETCALLABLE // ============================== OFFLINE // ============================== ABOUT // Gets the callable used to create the Fiber. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::getCallable() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfiber_getcallable($reflectionfiber) { $return_reflectionfiber_getcallable = null; // ========== REFLECTIONFIBER_GETCALLABLE - BEGIN // ===== ABOUT // Gets the callable used to create the Fiber // ===== DESCRIPTION // Returns the callable used to construct the Fiber. If the fiber has terminated, an Error is thrown. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::getCallable(): callable // ===== CODE $return_reflectionfiber_getcallable = $reflectionfiber->getCallable( // This function has no parameters. ); // Return Values // The callable used to create the Fiber. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.getcallable.php // ========== REFLECTIONFIBER_GETCALLABLE - END // SYNTAX: // callable ReflectionFiber::getCallable() return $return_reflectionfiber_getcallable; // callable } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETCALLABLE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGFILE // ============================== OFFLINE // ============================== ABOUT // Get the file name of the current execution point. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::getExecutingFile() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfiber_getexecutingfile($reflectionfiber) { $return_reflectionfiber_getexecutingfile = null; // ========== REFLECTIONFIBER_GETEXECUTINGFILE - BEGIN // ===== ABOUT // Get the file name of the current execution point // ===== DESCRIPTION // Returns the full path and file name of the current execution point in the reflected Fiber. If the fiber has not been started or has terminated, an Error is thrown. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::getExecutingFile(): string // ===== CODE $return_reflectionfiber_getexecutingfile = $reflectionfiber->getExecutingFile( // This function has no parameters. ); // Return Values // The full path and file name of the reflected fiber. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.getexecutingfile.php // ========== REFLECTIONFIBER_GETEXECUTINGFILE - END // SYNTAX: // string ReflectionFiber::getExecutingFile() return $return_reflectionfiber_getexecutingfile; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGFILE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGLINE // ============================== OFFLINE // ============================== ABOUT // Get the line number of the current execution point. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::getExecutingLine() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfiber_getexecutingline($reflectionfiber) { $return_reflectionfiber_getexecutingline = 0; // ========== REFLECTIONFIBER_GETEXECUTINGLINE - BEGIN // ===== ABOUT // Get the line number of the current execution point // ===== DESCRIPTION // Returns the line number of the current execution point in the reflected Fiber. If the fiber has not been started or has terminated, an Error is thrown. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::getExecutingLine(): int // ===== CODE $return_reflectionfiber_getexecutingline = $reflectionfiber->getExecutingLine( // This function has no parameters. ); // Return Values // The line number of the current execution point in the fiber. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.getexecutingline.php // ========== REFLECTIONFIBER_GETEXECUTINGLINE - END // SYNTAX: // int ReflectionFiber::getExecutingLine() return $return_reflectionfiber_getexecutingline; // int } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETEXECUTINGLINE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETFIBER // ============================== OFFLINE // ============================== ABOUT // Get the reflected Fiber instance. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::getFiber() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionfiber_getfiber($reflectionfiber) { $return_reflectionfiber_getfiber = null; // ========== REFLECTIONFIBER_GETFIBER - BEGIN // ===== ABOUT // Get the reflected Fiber instance // ===== DESCRIPTION // Returns the Fiber instance being reflected. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::getFiber(): Fiber // ===== CODE $return_reflectionfiber_getfiber = $reflectionfiber->getFiber( // This function has no parameters. ); // Return Values // The Fiber instance being reflected. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.getfiber.php // ========== REFLECTIONFIBER_GETFIBER - END // SYNTAX: // Fiber ReflectionFiber::getFiber() return $return_reflectionfiber_getfiber; // Fiber } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETFIBER // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETTRACE // ============================== OFFLINE // ============================== ABOUT // Get the backtrace of the current execution point. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionFiber::getTrace() - PHP_8 >= PHP_8_1_0 // ============================== USING CONSTANTS (1) // DEBUG_BACKTRACE_PROVIDE_OBJECT - ReflectionFiber::getTrace() // ============================== CODE /* function php_variable_reflection_reflectionfiber_gettrace($reflectionfiber, $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) { $return_reflectionfiber_gettrace = null; // ========== REFLECTIONFIBER_GETTRACE - BEGIN // ===== ABOUT // Get the backtrace of the current execution point // ===== DESCRIPTION // Get the backtrace of the current execution point in the reflected Fiber. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionFiber::getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array // ===== CODE $return_reflectionfiber_gettrace = $reflectionfiber->getTrace( $options // int options - The value of options can be any of the following flags. // Available options // Option - Description // DEBUG_BACKTRACE_PROVIDE_OBJECT - Default. // DEBUG_BACKTRACE_IGNORE_ARGS - Don't include the argument information for functions in the stack trace. ); // Return Values // The backtrace of the current execution point in the fiber. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionfiber.gettrace.php // ========== REFLECTIONFIBER_GETTRACE - END // SYNTAX: // array ReflectionFiber::getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) return $return_reflectionfiber_gettrace; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER_GETTRACE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONFIBER // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONINTERSECTIONTYPE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONINTERSECTIONTYPE_GETTYPES - array php_variable_reflection_reflectionintersectiontype_gettypes(ReflectionIntersectionType $reflectionintersectiontype) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // OFFLINE | ReflectionIntersectionType::getTypes() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (2) // array // OFFLINE | ReflectionIntersectionType - PHP_8 >= PHP_8_1_0 // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONINTERSECTIONTYPE_GETTYPES // ============================== OFFLINE // ============================== ABOUT // Returns the types included in the intersection type. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionIntersectionType::getTypes() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_variable_reflection_reflectionintersectiontype_gettypes($reflectionintersectiontype) { $return_reflectionintersectiontype_gettypes = null; // ========== REFLECTIONINTERSECTIONTYPE_GETTYPES - BEGIN // ===== ABOUT // Returns the types included in the intersection type // ===== DESCRIPTION // Returns the reflections of types included in the intersection type. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public ReflectionIntersectionType::getTypes(): array // ===== CODE $return_reflectionintersectiontype_gettypes = $reflectionintersectiontype->getTypes( // This function has no parameters. ); // Return Values // An array of ReflectionType objects. // // [examples] // Examples // [example] // Example #1 ReflectionIntersectionType::getTypes() example // [php] // // function someFunction(Iterator&Countable $value) {} // // $reflectionFunc = new ReflectionFunction('someFunction'); // $reflectionParam = $reflectionFunc->getParameters()[0]; // // var_dump($reflectionParam->getType()->getTypes()); // [/php] // The above example will output something similar to: // [result] // array(2) { // [0] => // class ReflectionNamedType#4(0) { // } // [1] => // class ReflectionNamedType#5(0) { // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionintersectiontype.gettypes.php // ========== REFLECTIONINTERSECTIONTYPE_GETTYPES - END // SYNTAX: // array ReflectionIntersectionType::getTypes() return $return_reflectionintersectiontype_gettypes; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONINTERSECTIONTYPE_GETTYPES // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONINTERSECTIONTYPE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_CONSTRUCT - ReflectionReference php_variable_reflection_reflectionreference_construct() // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_FROMARRAYELEMENT - ReflectionReference php_variable_reflection_reflectionreference_fromarrayelement(ReflectionReference $reflectionreference, array $array, int|string $key) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_GETID - string php_variable_reflection_reflectionreference_getid(ReflectionReference $reflectionreference) // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (3) // OFFLINE | ReflectionReference::__construct() - UNKNOWN // OFFLINE | ReflectionReference::fromArrayElement() - PHP_7 >= PHP_7_4_0, PHP_8 // OFFLINE | ReflectionReference::getId() - PHP_7 >= PHP_7_4_0, PHP_8 // ============================== USING DATA_TYPES (4) // OFFLINE | ReflectionReference - PHP_7 >= PHP_7_4_0, PHP_8 // array // int // string // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Private constructor to disallow direct instantiation. // ============================== SUPPORT // UNKNOWN // ============================== USING SUBCLASSES (1) // ReflectionReference::__construct() - UNKNOWN // ============================== CODE /* function php_variable_reflection_reflectionreference_construct() { $return_reflectionreference_construct = null; // ========== REFLECTIONREFERENCE_CONSTRUCT - BEGIN // ===== ABOUT // Private constructor to disallow direct instantiation // ===== DESCRIPTION // ===== SUPPORTED // No version information available, might only be in Git // ===== SYNTAX // private ReflectionReference::__construct() // ===== CODE $return_reflectionreference_construct = new ReflectionReference( // This function has no parameters. ); // Return // ReflectionReference // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionreference.construct.php // ========== REFLECTIONREFERENCE_CONSTRUCT - END // SYNTAX: // ReflectionReference ReflectionReference::__construct() return $return_reflectionreference_construct; // ReflectionReference } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_FROMARRAYELEMENT // ============================== OFFLINE // ============================== ABOUT // Create a ReflectionReference from an array element. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionReference::fromArrayElement() - PHP_7 >= PHP_7_4_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionreference_fromarrayelement($reflectionreference, $array, $key) { $return_reflectionreference_fromarrayelement = null; // ========== REFLECTIONREFERENCE_FROMARRAYELEMENT - BEGIN // ===== ABOUT // Create a ReflectionReference from an array element // ===== DESCRIPTION // Creates a ReflectionReference from an array element. // ===== SUPPORTED // PHP_7 >= PHP_7_4_0, PHP_8 // ===== SYNTAX // public static ReflectionReference::fromArrayElement(array $array, int|string $key): ?ReflectionReference // ===== CODE $return_reflectionreference_fromarrayelement = $reflectionreference->fromArrayElement( $array, // array array - The array which contains the potential reference. $key // int|string key - The key; either an int or a string. ); // Return Values // Returns a ReflectionReference instance if $array[$key] is a reference, or null otherwise. // // Errors/Exceptions // If array is not an array, or key is not an int or string, a TypeError is thrown. If $array[$key] does not exist, a ReflectionException is thrown. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionreference.fromarrayelement.php // ========== REFLECTIONREFERENCE_FROMARRAYELEMENT - END // SYNTAX: // ReflectionReference ReflectionReference::fromArrayElement(array $array, int|string $key) return $return_reflectionreference_fromarrayelement; // ReflectionReference } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_FROMARRAYELEMENT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_GETID // ============================== OFFLINE // ============================== ABOUT // Get unique ID of a reference. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionReference::getId() - PHP_7 >= PHP_7_4_0, PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionreference_getid($reflectionreference) { $return_reflectionreference_getid = null; // ========== REFLECTIONREFERENCE_GETID - BEGIN // ===== ABOUT // Get unique ID of a reference // ===== DESCRIPTION // Returns an ID which is unique for the reference for the lifetime of that reference. This ID can be used to compare references for equality, or to maintain a map of known references. // ===== SUPPORTED // PHP_7 >= PHP_7_4_0, PHP_8 // ===== SYNTAX // public ReflectionReference::getId(): string // ===== CODE $return_reflectionreference_getid = $reflectionreference->getId( // This function has no parameters. ); // Return Values // Returns a string of unspecified format. // // [examples] // Examples // [example] // Example #1 Basic ReflectionReference::getId() usage // [php] // $val1 = 'foo'; // $val2 = 'bar'; // $arr = [&$val1, &$val2, &$val1]; // // $rr1 = ReflectionReference::fromArrayElement($arr, 0); // $rr2 = ReflectionReference::fromArrayElement($arr, 1); // $rr3 = ReflectionReference::fromArrayElement($arr, 2); // // var_dump($rr1->getId() === $rr2->getId()); // var_dump($rr1->getId() === $rr3->getId()); // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionreference.getid.php // ========== REFLECTIONREFERENCE_GETID - END // SYNTAX: // string ReflectionReference::getId() return $return_reflectionreference_getid; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE_GETID // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONREFERENCE // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE // ============================== OFFLINE // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_CONSTRUCT - ReflectionAttribute php_variable_reflection_reflectionattribute_construct() // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETARGUMENTS - array php_variable_reflection_reflectionattribute_getarguments(ReflectionAttribute $reflectionattribute) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETNAME - string php_variable_reflection_reflectionattribute_getname(ReflectionAttribute $reflectionattribute) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETTARGET - int php_variable_reflection_reflectionattribute_gettarget(ReflectionAttribute $reflectionattribute) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_ISREPEATED - bool php_variable_reflection_reflectionattribute_isrepeated(ReflectionAttribute $reflectionattribute) // OFFLINE | PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_NEWINSTANCE - object php_variable_reflection_reflectionattribute_newinstance(ReflectionAttribute $reflectionattribute) // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (6) // OFFLINE | ReflectionAttribute::__construct() - PHP_8 // OFFLINE | ReflectionAttribute::getArguments() - PHP_8 // OFFLINE | ReflectionAttribute::getName() - PHP_8 // OFFLINE | ReflectionAttribute::getTarget() - PHP_8 // OFFLINE | ReflectionAttribute::isRepeated() - PHP_8 // OFFLINE | ReflectionAttribute::newInstance() - PHP_8 // ============================== USING DATA_TYPES (6) // OFFLINE | ReflectionAttribute - PHP_8 // array // string // int // bool // object // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Private constructor to disallow direct instantiation. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::__construct() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_construct() { $return_reflectionattribute_construct = null; // ========== REFLECTIONATTRIBUTE_CONSTRUCT - BEGIN // ===== ABOUT // Private constructor to disallow direct instantiation // ===== DESCRIPTION // ===== SUPPORTED // PHP_8 // ===== SYNTAX // private ReflectionAttribute::__construct() // ===== CODE $return_reflectionattribute_construct = new ReflectionAttribute( // This function has no parameters. ); // Return // ReflectionAttribute // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.construct.php // ========== REFLECTIONATTRIBUTE_CONSTRUCT - END // SYNTAX: // ReflectionAttribute ReflectionAttribute::__construct() return $return_reflectionattribute_construct; // ReflectionAttribute } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_CONSTRUCT // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETARGUMENTS // ============================== OFFLINE // ============================== ABOUT // Gets arguments passed to attribute. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::getArguments() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_getarguments($reflectionattribute) { $return_reflectionattribute_getarguments = null; // ========== REFLECTIONATTRIBUTE_GETARGUMENTS - BEGIN // ===== ABOUT // Gets arguments passed to attribute // ===== DESCRIPTION // Gets arguments passed to attribute. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionAttribute::getArguments(): array // ===== CODE $return_reflectionattribute_getarguments = $reflectionattribute->getArguments( // This function has no parameters. ); // Return Values // The arguments passed to attribute. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.getarguments.php // ========== REFLECTIONATTRIBUTE_GETARGUMENTS - END // SYNTAX: // array ReflectionAttribute::getArguments() return $return_reflectionattribute_getarguments; // array } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETARGUMENTS // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETNAME // ============================== OFFLINE // ============================== ABOUT // Gets attribute name. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::getName() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_getname($reflectionattribute) { $return_reflectionattribute_getname = null; // ========== REFLECTIONATTRIBUTE_GETNAME - BEGIN // ===== ABOUT // Gets attribute name // ===== DESCRIPTION // Gets the attributes name. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionAttribute::getName(): string // ===== CODE $return_reflectionattribute_getname = $reflectionattribute->getName( // This function has no parameters. ); // Return Values // The name of the attribute. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.getname.php // ========== REFLECTIONATTRIBUTE_GETNAME - END // SYNTAX: // string ReflectionAttribute::getName() return $return_reflectionattribute_getname; // string } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETNAME // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETTARGET // ============================== OFFLINE // ============================== ABOUT // Returns the target of the attribute as bitmask. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::getTarget() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_gettarget($reflectionattribute) { $return_reflectionattribute_gettarget = 0; // ========== REFLECTIONATTRIBUTE_GETTARGET - BEGIN // ===== ABOUT // Returns the target of the attribute as bitmask // ===== DESCRIPTION // Gets target of the attribute as bitmask. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionAttribute::getTarget(): int // ===== CODE $return_reflectionattribute_gettarget = $reflectionattribute->getTarget( // This function has no parameters. ); // Return Values // Gets target of the attribute as bitmask. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.gettarget.php // ========== REFLECTIONATTRIBUTE_GETTARGET - END // SYNTAX: // int ReflectionAttribute::getTarget() return $return_reflectionattribute_gettarget; // int } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_GETTARGET // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_ISREPEATED // ============================== OFFLINE // ============================== ABOUT // Returns whether the attribute of this name has been repeated on a code element. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::isRepeated() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_isrepeated($reflectionattribute) { $return_reflectionattribute_isrepeated = false; // ========== REFLECTIONATTRIBUTE_ISREPEATED - BEGIN // ===== ABOUT // Returns whether the attribute of this name has been repeated on a code element // ===== DESCRIPTION // Returns whether the attribute of this name has been repeated on a code element. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionAttribute::isRepeated(): bool // ===== CODE $return_reflectionattribute_isrepeated = $reflectionattribute->isRepeated( // This function has no parameters. ); // Return Values // Returns true when attribute is used repeatedly, otherwise false. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.isrepeated.php // ========== REFLECTIONATTRIBUTE_ISREPEATED - END // SYNTAX: // bool ReflectionAttribute::isRepeated() return $return_reflectionattribute_isrepeated; // bool } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_ISREPEATED // ============================== // ============================== BEGIN // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_NEWINSTANCE // ============================== OFFLINE // ============================== ABOUT // Instantiates the attribute class represented by this ReflectionAttribute class and arguments. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // ReflectionAttribute::newInstance() - PHP_8 // ============================== CODE /* function php_variable_reflection_reflectionattribute_newinstance($reflectionattribute) { $return_reflectionattribute_newinstance = null; // ========== REFLECTIONATTRIBUTE_NEWINSTANCE - BEGIN // ===== ABOUT // Instantiates the attribute class represented by this ReflectionAttribute class and arguments // ===== DESCRIPTION // Instantiates the attribute class represented by this ReflectionAttribute class and arguments. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public ReflectionAttribute::newInstance(): object // ===== CODE $return_reflectionattribute_newinstance = $reflectionattribute->newInstance( // This function has no parameters. ); // Return Values // New instance of the attribute. // ===== LITERATURE_SOURCES // * PHP_NET (2024-02-09) // URL: https://www.php.net/manual/en/reflectionattribute.newinstance.php // ========== REFLECTIONATTRIBUTE_NEWINSTANCE - END // SYNTAX: // object ReflectionAttribute::newInstance() return $return_reflectionattribute_newinstance; // object } */ // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE_NEWINSTANCE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION_REFLECTIONATTRIBUTE // ============================== // ============================== END // PHP_VARIABLE_REFLECTION // ============================== ?>