Search Results

Search found 1 results on 1 pages for 'kalaba2003'.

Page 1/1 | 1 

  • Why does this basic class not work?

    - by kalaba2003
    I could not understand why my class does no t work. Returns nothing. Is there any mistake? class User { public $first_name; public $last_name; public function full_name() { if(isset($this->first_name) && isset($this->last_name)) { return $this->first_name . " " . $this->last_name; } else { return "No name!"; } } public function assign () { $this->first_name = "Name"; $this->last_name = "Surname"; } } $user = new User(); $user->assign(); $user->full_name(); ?>

    Read the article

1