Results of 1 - 10 of about 120 for Constant (0.001 sec.)
- runkit7_constant_redefine — Redefine an already defined constant | PHP 8.3 11549
- runkit7_constant_redefine (PECL runkit7 >= Unknown) runkit7_constant_redefine — Redefine an already defined constant 説明 function runkit7_constant_redefine ( string $constant_name , mixed $value , int $new_visibility = ? ): bool パラメータ
... constant_name Constant to redefine. Either the name of a global constant, or classname::constname indicating class constant. value ... Value to assign to the constant. new_visibility The new visibility of the constant, for class constants. Unchanged by default. One of the RUNKIT7_ACC_ * c ... onstants. 戻り値 成功した場合に true を、失敗した場合に false を返します。 参考 runkit7_constant_add() - Similar to define(), but allows defining in class definitions as well runkit7_constant_remove() - Remove/Delete an ...
-
https://man.mtool.work/php/8.3/function.runkit7-constant-redefine.html
- runkit7_constant_add — Similar to define(), but allows defining in class defini... 11375
- runkit7_constant_add (PECL runkit7 >= Unknown) runkit7_constant_add — Similar to define(), but allows defining in class definitions as well 説明 function runkit7_constant_add ( string $constant_name , mixed $value , int $newVisibility = ? )
... : bool パラメータ constant_name Name of constant to declare. Either a string to indicate a global constant, or classname::constname to indicate a cla ... ss constant. value NULL, Bool, Long, Double, String, Array, or Resource value to store in the new constant. newVisibility Visibility o ... f the constant, for class constants. Public by default. One of the RUNKIT7_ACC_ * constants. 戻り値 成功した場合に true を、失敗した場合に ...
-
https://man.mtool.work/php/8.3/function.runkit7-constant-add.html
- runkit7_constant_remove — Remove/Delete an already defined constant | PHP 8.3 11288
- runkit7_constant_remove (PECL runkit7 >= Unknown) runkit7_constant_remove — Remove/Delete an already defined constant 説明 function runkit7_constant_remove ( string $constant_name ): bool パラメータ constant_name Name of the constant to rem
... ove. Either the name of a global constant, or classname::constname indicating a class constant. 戻り値 成功した場合に true を、失敗した場合に false を返します。 参考 ... define() - 名前を指定して定数を定義する runkit7_constant_add() - Similar to define(), but allows defining in class definitions as well runkit7_constant_redefine() - Redefine an al ... ready defined constant 他のマニュアルの関連ページ Linux JM remove(3) Docker :ruby:`Volumes ` を見渡す DuckDB Execution Format ...
-
https://man.mtool.work/php/8.3/function.runkit7-constant-remove.html
- constant — 定数の値を返す | PHP 8.3 9872
- constant (PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8) constant — 定数の値を返す 説明 function constant ( string $name ): mixed name で指定した定数の値を返します。 constant() はある定数の値を取得する必要があるが、 その名前が不明な場合に有用です。つ
... 数から返される場合に有用です。 この関数は クラス定数 や 列挙型のcase に対しても動作します。 パラメータ name 定数名。 注意 : constant() は名前を通常の文字列として受け取り、 現在の 名前空間 を基準に 解決することはありません。 名前はグローバル名前空間から探さ ... く、グローバル名前空間にある同名の定数の値が 黙って返されることがあります。 名前空間の中で宣言された定数の値を取得するには、 constant('My\Namespace\MYCONST') や constant(__NAMESPACE__ . '\MYCONST') のように、 名前空間を名前の一部に含める必要があります。 名 ... のバージョンでは、 E_WARNING レベルの警告が発生していました。 変更履歴 バージョン 説明 8.0.0 定数が定義されていない場合は、 constant() は Error をスローするようになりました。 これより前のバージョンでは、 E_WARNING レベルの警告が発生し、 null を返していまし ...
-
https://man.mtool.work/php/8.3/function.constant.html
- ReflectionClassConstant::isEnumCase — クラス定数が、列挙型の case かどうかを調... 9301
- ReflectionClassConstant::isEnumCase (PHP 8 >= 8.1.0) ReflectionClassConstant::isEnumCase — クラス定数が、列挙型の case かどうかを調べる 説明 public function ReflectionClassConstant::isEnumCase (): bool クラス定数が、 列挙型 の case かどうか
... 戻り値 クラス定数が、列挙型の case である場合に true を返します。 そうでない場合、 false を返します。 例 例1 ReflectionClassConstant::isEnumCase() の例 通常のクラス定数と、列挙型の case を区別する例です。 <?php enum Status { const BORING_CONSTANT = 'test' ... se 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 co ... nstant" , PHP_EOL ; } ?> 上の例の出力は以下となります。 BORING_CONSTANT is a regular class constant ENUM_VALUE is a regular class constant DRAFT is an enum case PUBLISHED is an enum case ARCHIVE ...
-
https://man.mtool.work/php/8.3/reflectionclassconstant.isenumcase.html
- 例 | PHP 8.3 8991
- 例 リフレクションのドキュメントの中には多くの例が示されています。 特に、各クラスの __construct のドキュメントを見るといいでしょう。 例1 シェル (ターミナル) からのリフレクションの例 $ php --rf strlen $ php --rc finfo $ php --re json $ php --
... function strlen ] { - Parameters [1] { Parameter #0 [ <required> $str ] } } Class [ <internal:fileinfo> class finfo ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Methods [4] { Method [ <internal:file ... l> $options ] Parameter #2 [ <optional> $context ] } } } } Extension [ <persistent> 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 } C ...
-
https://man.mtool.work/php/8.3/reflection.examples.html
- 構文 | PHP 8.3 8730
- 構文 const キーワードか、 define() 関数を使うことで、定数を宣言することが出来ます。 define() を使えば任意の式を使って定数を定義できますが、 const キーワードを使う場合には、 次の段落で説明する制約があります。 定数が一度定義されると、 変更また
... ることが可能です。 変数とは異なり、その前に $ は 不要 です。 定数の名前を動的に得る必要がある場合、定数の値を読むために関数 constant() を使用することも可能です。 定義済の定数の一覧を得るには、 get_defined_constants() を使用してください。 注意 : 定数と(グロ ... 合、 Error がスローされます。 PHP 8.0.0 より前のバージョンでは、 未定義の定数は、ちょうど string として コールしたかのように(CONSTANT vs "CONSTANT")、 PHPはその定数自体の名前を使用したと解釈していました。 このような振る舞いは、PHP 7.2.0 以降では非推奨となり ... と再定義または未定義とすることはできません。 定数は、スカラー値と配列としてのみ評価可能です。 例1 定数の定義 <?php define ( "CONSTANT" , "Hello world." ); echo CONSTANT ; // "Hello world."を出力 echo Constant ; // エラーが発生: Undefined constant "Constant ...
-
https://man.mtool.work/php/8.3/language.constants.syntax.html
- define — 名前を指定して定数を定義する | PHP 8.3 8693
- define (PHP 4, PHP 5, PHP 7, PHP 8) define — 名前を指定して定数を定義する 説明 function define ( string $constant_name , mixed $value , bool $case_insensitive = false ): bool 実行時に、名前を指定して定数を定義します。 パラメータ constant_na
... me 定数の名前。 注意 : 予約語や無効な名前を使っていても、定数を define() できてしまいます。これらの値を取得するには、 constant() 関数を使うこと(だけ)しかできません。 しかしながら、こういったことをするのは推奨されません。 define() は名前を通常の文字列 ... り文字を付けずに define('My\Namespace\MYCONST', 1) や define(__NAMESPACE__ . '\MYCONST', 1) のように書きます。 defined() や constant() と違い、 define() は先頭の区切り文字を取り除きません。 define('\My\Namespace\MYCONST', 1) は true を返しますが、作られた ... sensitive true を指定すると、定数は大文字小文字を区別しないようになります。 デフォルトでは大文字小文字を区別します。つまり CONSTANT と Constant は別の値を表すわけです。 警告 大文字小文字を区別しない定数を定義するのは、 PHP 7.3.0 以降では推奨されなくなりま ...
-
https://man.mtool.work/php/8.3/function.define.html
- Componere\Definition::addConstant — Add Constant | PHP 8.3 8556
- Componere\Definition::addConstant (Componere 2 >= 2.1.0) Componere\Definition::addConstant — Add Constant 説明 public function Componere\Definition::addConstant ( string $name , Componere\Value $value ): Definition Shall declare a class constant
... stant on the current Definition パラメータ name The case sensitive name for the constant value The Value for the constant, must not be undefined or static 戻り値 The current Definition Exceptions 警告 Shall thro ... w RuntimeException if Definition was registered 警告 Shall throw RuntimeException if name is already declared as a constant 警告 Shall throw RuntimeException if value is static 警告 Shall throw RuntimeException if value is undefined 他のマニュアル ...
-
https://man.mtool.work/php/8.3/componere-definition.addconstant.html
- runkit7 関数 | PHP 8.3 7935
- runkit7 関数 目次 runkit7_constant_add — Similar to define(), but allows defining in class definitions as well runkit7_constant_redefine — Redefine an already defined constant runkit7_constant_remove — Remove/Delete an already defined constant
...
-
https://man.mtool.work/php/8.3/ref.runkit7.html