No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

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,
};
}
}
?>

Static methods may be public, private, or protected, although in practice private and protected are equivalent as inheritance is not allowed.

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph