Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Reconstructing the Person Class</title>
- <link type='text/css' rel='stylesheet' href='style.css'/>
- </head>
- <body>
- <p>
- <!-- Your code here -->
- <?php
- class Person {
- public $isAlive = true;
- public $firstname;
- public $lastname;
- public $age;
- // public function _contstruct You can do it!
- public function __construct($firstname, $lastname, $age) {
- $this->firstname = $firstname;
- $this->lastname = $lastname;
- $this->age = $age;
- }
- }
- $teacher = new Person("boring","12345",12345);
- $student = new Person("Stud","Nenti",19);
- echo $teacher->isAlive;
- echo $student->age;
- ?>
- </p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement