Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Category
- {
- private $id;
- public function __construct($id)
- {
- $this->id = $id;
- }
- public function equals(Category $category): bool
- {
- return $this->id === $category->id;
- }
- }
- $c1 = new Category(1);
- $c2 = new Category(1);
- var_dump($c1->equals($c2));
Add Comment
Please, Sign In to add comment