Created
June 8, 2017 09:08
-
-
Save preda-bogdan/e73cca72fc0a5f5a6630c847bf51c08a to your computer and use it in GitHub Desktop.
A greeting Class
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 | |
class Greeter { | |
private $greeting; | |
public function __construct() { | |
$this->greeting = 'Hello'; | |
} | |
public function greet( $subject = '' ) { | |
return $this->greeting . ' ' . $subject . '!' . PHP_EOL; | |
} | |
} | |
$g = new Greeter(); | |
echo $g->greet( 'World' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment