-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.php
63 lines (44 loc) · 1.16 KB
/
index2.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
<?php
class PC {
private $CPU;
private $RAM;
private $os;
private $typeCase;
const PI = 3.14;
public static $E = 2.7;
public function __construct($argCPU, $argRAM, $argOS, $argTC){
$this->CPU = $argCPU;
$this->RAM = $argRAM;
$this->os = $argOS;
$this->typeCase = $argTC;
echo self::PI ."<br>";
}
public function getPropertyCPU() {
return $this->CPU;
}
/*
public function __destruct() {
echo "Object Deleted";
}
*/
public function __toString() {
return "<hr>".$this->showDescription()."<br>";
}
public function __clone() {
echo "<h1>Object cloned</h1>";
}
public function showInfo() {
echo "1) CPU = ".$this->CPU."<br>";
echo "2) RAM = ".$this->RAM."<br>";
echo "3) TYPE = ".$this->typeCase."<br>";
echo $this->showDescription();
}
public function showDescription() {
return $this->os." Memory;". $this->RAM." CPU;". $this->CPU;
}
}
//$pc = new PC(2.5,2000,"MAC OS", "Desctop");
echo PC::PI;
echo '<br>';
echo PC::$E;
?>