mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-11-14 16:47:26 +00:00
20 lines
308 B
PHP
20 lines
308 B
PHP
|
<?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();
|