PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php class Person { const AVG_LIFE_SPAN = 77; public $firstName = "Sam"; public $lastName = "Paul"; public $yearBorn = 1899; function getFirstName() { return $this->firstName; } function setFirstName($tempName) { $this->firstName = $tempName; } } $myObject = new Person(); //echo $myObject->firstName; //var_dump($myObject); $myObject->setFirstName("John"); echo $myObject->getFirstName();
Show:  
Copy Clear