mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-11-16 01:07: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();
|