Last active
August 29, 2015 14:05
-
-
Save TPei/7f3731c72ea2588c5dd0 to your computer and use it in GitHub Desktop.
Proposed extesions to the typo3 documentation
This file contains hidden or 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 Code:: | |
class Ship { | |
public $name; | |
public $coaches; | |
public $engineStatus; | |
public $speed; | |
function __construct($name, $coaches) { | |
$this->name = $name; | |
$this->coaches = $coaches; | |
} | |
... | |
} | |
$ship = new Ship('Fidelio', '100'); | |
This will automatically set the name and number of coaches of the newly created ship. This is useful since these are things that are usually known when a ship is built. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment