-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
38 lines (28 loc) · 756 Bytes
/
test.php
File metadata and controls
38 lines (28 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
class Personn
{
public $name;
public $age;
public $gender;
public function __construct($name, $age, $gender)
{
$this->name = $name;
$this->age = $age;
$this->gender = $gender;
}
public function full_detail()
{
return "Name of person is " . $this->name . " and age is " . $this->age . " and gender is " . $this->gender;
}
}
// extend functionality using new class userr
class Userraddress extends Personn{
}
$formdata = $_POST;
$namee = $formdata['name'] = 'akshay';
$agee = $formdata['age'] = 45;
$gender = $formdata['gender'] = 'male';
$person = new Personn($namee, $agee, $gender);
print_r($person->age . "\n");
// print_r($person);
print_r($person->full_detail());