-
-
Notifications
You must be signed in to change notification settings - Fork 0
Wiki Constant
final class \FireHub\Core\Support\LowLevel\Constant()
Important
This class is marked as final.
Class allows you to obtain information about constants.
This class was created by Danijel Galić <danijel.galic@outlook.com>
Copyright: 2024 FireHub Web Application Framework
License: <https://opensource.org/licenses/OSL-3.0> OSL Open Source License version 3
Version: GIT: $Id$ Blob checksum.
Fully Qualified Class Name: \FireHub\Core\Support\LowLevel\Constant
Source code: view source code
Blame: view blame
History: view history
Type | Name | Title |
---|---|---|
public static | define | ### Defines a named constant |
public static | defined | ### Checks whether a given named constant exists |
public static | value | ### Returns the value of a constant |
public static Constant::define(string $name, null|array|bool|float|int|string $value):true
Defines a named constant at runtime.
Source code: view source code
Blame: view blame
- string $name -
non-empty-string
The name of the constant. - null or array or bool or float or int or string $value -
null|array<array-key, mixed>|scalar
The value of the constant.
- true - True on success.
public static Constant::defined(string $name):bool
Note
This function works also with class constants and enum cases.
This function works also with class constants and enum cases.
Source code: view source code
Blame: view blame
- string $name -
non-empty-string
The constant name.
- bool - True if the named constant given by name parameter has been defined, false otherwise.
public static Constant::value(string $name):mixed
Note
This function works also with class constants and enum cases.
Method Constant#value() is useful if you need to retrieve the value of a constant, but do not know its name. I.e., it is stored in a variable or returned by a function.
Source code: view source code
Blame: view blame
- string $name -
non-empty-string
The constant name.
- \Error - If the constant is not defined.
- mixed - The value of the constant.
Build with phpDocumentor using template FireHub phpDocumentor Wiki Template.