hacktoberfest-2018/code/rahman95.php

20 lines
308 B
PHP
Raw Permalink Normal View History

2018-10-01 13:32:50 +00:00
<?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();