<?php
/** * bune */
class bune
{
    private $rand;
    private $degerler = ['x1','x2','x3','x4']; 

   public function __construct() 
   { 
       $this->rand = $this->degerler[rand(0, count($this->degerler) - 1)];
    }

    public function baba()
    {        return $this->rand;
    } 

   public function salak()
    {
        return $this->rand;
    }
}

$saf = new bune();
echo $saf->baba();
echo $saf->salak();