PHPize Online / SQLize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
Copy
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