php8
// php 8 Union type
class Number {
public function __construct(
private int|float $number
) {}
}
new Number('NaN'); // TypeError
php8
// php 8 Union type
class Number {
public function __construct(
private int|float $number
) {}
}
new Number('NaN'); // TypeError
update to php 7.4
Add the ondrej/php PPA. Ubuntu: ...
Install PHP 7.4 and required extensions. To install PHP 7.4 core. ...
PHP 7.4 for web: ...
Uninstall old PHP versions: ...
Verify PHP 7.4 installation
php8
// php8 class and construct
class Point {
public function __construct(
public float $x = 0.0,
public float $y = 0.0,
public float $z = 0.0,
) {}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us