Results of 1 - 2 of about 2 for enums (0.002 sec.)
- New Features | PHP 8.3 11228
- New Features PHP Core Default values for readonly properties Readonly properties may now declare default values. <?php class Config { public readonly int $timeout = 30 ; } $config = new Config (); var_dump ( $config -> timeout ); // int(30)
... ss#1 not contained in WeakMap" $map [ $obj ] = & $count ; $count ++; var_dump ( $map [ $obj ]); // int(1) __debugInfo() on enums It is now possible to define the __debugInfo() magic method on enums . Previously, this resulted in a fatal error. <?php e ... d a new polling API , consisting of: The Io\Poll\Context and Io\Poll\Watcher classes The Io\Poll\Backend and Io\Poll\Event enums The Io\Poll\Handle interface The StreamPollHandle class to watch streams JSON Added extra information about the error loca ... , consisting of: The StreamError and StreamException classes The StreamErrorStore , StreamErrorMode , and StreamErrorCode enums The stream_last_errors() and stream_clear_errors() functions It is controlled using the error_mode , error_store and error ...
-
https://man.mtool.work/php/8.3/migration86.new-features.html
- 定数式における列挙型の値 | PHP 8.3 7485
- 定数式における列挙型の値 列挙型の case は、定数として表現されているので、 ほとんどの定数式の中で静的な値として使えます。 つまり、プロパティのデフォルト値や、 static 変数のデフォルト値、パラメータのデフォルト値、 グローバル定数やクラス定数の
... せん。結果の値が決定的でない可能性があるからです。 const UP = Direction :: Up [ 'short' ]; // Fatal error: Cannot use [] on enums in constant expression } // これは、完全に正しいコードです。定数式ではないからです。 $x = Direction :: Up [ 'short' ]; var ...
-
https://man.mtool.work/php/8.3/language.enumerations.expressions.html
PREV
1
NEXT