-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.php
More file actions
56 lines (46 loc) · 617 Bytes
/
index.php
File metadata and controls
56 lines (46 loc) · 617 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Design pattern "Prototype" (Creational)
* This is demo code
* See for details: http://maxsite.org/page/php-patterns
*/
/**
* Any Class
*/
class MyClass
{
/**
* Any methods
*/
public function method()
{
echo 'MyClass method <br>';
}
}
/**
* demo
*/
/**
* create Class
*/
$my = new MyClass();
/**
* clone class
*/
$clone = clone $my;
$clone->method();
/*
MyClass method
*/
/**
* delete MyClass
*/
unset($my);
/**
* clone lives
*/
$clone->method();
/*
MyClass method
*/
# end of file