Is this correct object oriented programming in php? [closed]

By | March 30, 2018
Questions:

Could this be classified as correct OOP programming?

class Greeting {

    public $greet = array('Hi','Hello', 'Howzit', 'Ola', 'Whats up');

    function __construct($name) {
        $this->name = $name;
        shuffle($this->greet);
    }
}

$hi = new Greeting('INSERTNAMEHERE'); /*NAME OF PERSON GOES HERE*/
echo $hi->greet[1] .' '. $hi->name;
Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *