Skip to content

Instantly share code, notes, and snippets.

@lechidung
Last active November 29, 2020 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lechidung/43d7f4909055c3e7e6b0d6c26ce4476e to your computer and use it in GitHub Desktop.
Save lechidung/43d7f4909055c3e7e6b0d6c26ce4476e to your computer and use it in GitHub Desktop.
PHP 8
/*** PHP 7 ***/
class Point {
public float $x;
public float $y;
public float $z;
public function __construct(
float $x = 0.0,
float $y = 0.0,
float $z = 0.0,
) {
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
}
/*** PHP 8 ***/
class Point {
public function __construct(
public float $x = 0.0,
public float $y = 0.0,
public float $z = 0.0,
) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment