Geri çağırış Lim10Ata\Flatix\xfwidgets::gethtml yanlışdır (error_invalid_class).

Foruma xoş gəldiniz 👋, Qonaq

Forum məzmununa və bütün xidmətlərimizə daxil olmaq üçün qeydiyyatdan keçməli və ya foruma daxil olmalısınız. Foruma üzv olmaq tamamilə pulsuzdur.

Qeydiyyatdan kec

php 8 migration

3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
Bu movzumda php 8 ile gelen kodlari paylasacam.
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
php match() metodu...

PHP:
$paymentStatus = 1;

$paymentStatusDisplay = match($paymentStatus) {
    1 => 'Paid',
    2,3 => 'Payment Declined',
    0 => 'Pending Payment',
    default => 'Unknown Payment Status',
};

echo $paymentStatusDisplay; //output: Paid
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
PHP:
//multiple types for a function

function foo(): int|float|array {
    return [];
}

var_dump(foo());
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
PHP:
//mixed type for a function

function foo(): mixed {
    return [];
}

var_dump(foo());
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
PHP:
//function parameters multiple types
function foo(int|float $x, int|float $y) {
    return $x * $y;
}

echo foo(5.0, 10);
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
PHP:
function foo(int $x, int $y): int {
    if($x % $y === 0) {
        return $x / $y;
    }
    return $x;
}

$x = 6;
$y = 3;

//named arguments
echo foo(y: $y, x: $x);
 
3

GameKing

Kohnelerden
Silver istifadeci
Qoşuldu
10 Sen 2022
Mesajlar
204
Reaksiya hesabı
110
Xallar
43
PHP:
function foo(int $x, int $y): int {
    if($x % $y === 0) {
        return $x / $y;
    }
    return $x;
}

//named argument as array
$arr = ['x' => 6, 'y' => 3];

echo foo(...$arr);
 
Üst