hacktoberfest-2018/code/rahman95.php
2018-10-01 14:32:50 +01:00

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();