Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php multi type parameter union types

#Union types have finally been implemented in PHP 8.0
class Number {
    private int|float $number;

    public function setNumber(int|float $number): void {
        $this->number = $number;
    }

    public function getNumber(): int|float {
        return $this->number;
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel check if field has changed 
Php :: laravel auth namespace 
Php :: laravel display error message 
Php :: php check for empty string 
Php :: how to return with open model popup in laravel 
Php :: php array_reverse keep keys 
Php :: php object(stdclass) to array 
Php :: wpdb-prepare 
Php :: wherein laravel 
Php :: pdo bindparam string 
Php :: php pdo select 
Php :: if else in php html 
Php :: format date in laravel using carbon 
Php :: undefined method JeroenNotenLaravelAdminLteHelpersMenuItemHelper::isSearchBar() 
Php :: get name custom post type wordpress 
Php :: php write to file 
Php :: setcookie 
Php :: get header respnse code php curl 
Php :: laravel old request 
Php :: message mkdir() invalid path filename drivers/session_files_driver.php 
Php :: save post data to file php 
Php :: php get total amount of days in month 
Php :: php get data from prepared select 
Php :: generate random string php 
Php :: php get ip from host 
Php :: wp debug 
Php :: how to add property to an exsisting object in php 
Php :: check value falls between in two range in php 
Php :: laravel blade upper case 
Php :: php jquery plus 1 day 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =