-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
50 lines (37 loc) · 826 Bytes
/
index.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
<?php
require_once __DIR__ . '/vendor/autoload.php';
class User extends \Jk\Equatable\AbstractEquatable
{
private $id;
private $firstname;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getFirstname()
{
return $this->firstname;
}
public function setFirstname($firstname)
{
$this->firstname = $firstname;
return $this;
}
public function getProperties(): array
{
return ['id', 'firstname'];
}
}
$user1 = (new User())
->setFirstname('khaled')
->setId(111);
$user2 = (new User())
->setFirstname('khaled')
->setId(111);
var_dump($user1 === $user2); // false
var_dump($user1->equalTo($user2)); // false