mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2025-07-30 13:30:16 +00:00
added code sample and updated readme
This commit is contained in:
19
code/rahman95.php
Normal file
19
code/rahman95.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class HelloWorld
|
||||
{
|
||||
protected $name;
|
||||
|
||||
public function __construct(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function sayHelloWorld()
|
||||
{
|
||||
return "Hello World from {$this->name} 👋";
|
||||
}
|
||||
}
|
||||
|
||||
$class = new HelloWorld('rahman95');
|
||||
echo $class->sayHelloWorld();
|
Reference in New Issue
Block a user