-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopps.php
executable file
·125 lines (99 loc) · 1.86 KB
/
opps.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
// Traits Class
// trait test{
// public function hello()
// {
// echo "Hello World\n";
// }
// public function by()
// {
// echo "Bye World\n";
// }
// }
// trait heloo{
// public function byy()
// {
// echo "TATA BYE bYE\n";
// }
// public function helllo()
// {
// echo "Welcome Avinash\n";
// }
// }
// class a{
// use test, heloo;
// }
// class b{
// use heloo;
// }
// $obj = new a();
// $objj = new b();
// echo $obj->hello();
// echo $obj->byy();
// echo $objj->helllo();
// Traits Overriding
// trait test{
// private function hello()
// {
// echo "Hello World\n";
// }
// }
// class a{
// use test{
// test::hello as public newhelloo; // public newhelloo overriding a hello function. hello function difine in trait test function
// }
// }
// $obj = new a();
// echo $obj->newhelloo();
// Type Hinting
// function test(int $a) //int is a type hinting/type declearation
// {
// echo $a;
// }
// echo test("hii");
//Namespace
// require 'namespcefile1.php';
// require 'namespcefile2.php';
// function good()
// {
// echo 'Hi i am good';
// }
// $obj = new pro\testing();
// $obj2 = new lite\testing();
// pro\good();
// lite\good();
//CHINING METHOD
// class test{
// public function Helloo()
// {
// echo "Welcome Helloo World".'<br>';
// return $this;
// }
// public function Bye()
// {
// echo "Bye Bye World".'<br>';
// return $this;
// }
// public function tata()
// {
// echo "Tata bye bye".'<br>';
// }
// }
// $obj = new test();
// $obj->Helloo()->Bye()->tata();
// $obj->Bye();
// $obj->tata();
//MAGIC METHODS
// PHP provide a some magic method and this megic method auto called in class. so some megic method list
// 1. __construct()
// 2. __destruct()
// 3. __get()
// 4. __set()
// 5. __isset()
// 6. __unset()
// 7. __call()
// 8. __clone()
// 9. __ invoke()
// 10. __toString()
// more..
?>