Created
April 2, 2021 12:26
-
-
Save vanbrabantf/fb3b45d59ea87d56c60190cb80e86c21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$car = new Car(4, 'Honda'); | |
class Car | |
{ | |
private $wheels; | |
private $engine; | |
public function __construct(int $wheels, string $engine) | |
{ | |
$this->wheels = $wheels; | |
$this->engine = $engine; | |
} | |
public function getWheels(): int | |
{ | |
return $this->wheels; | |
} | |
public function getEngine(): string | |
{ | |
return $this->engine; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment