{"id":33963446,"url":"https://github.com/hdimo/php-equtable","last_synced_at":"2026-06-09T09:32:33.849Z","repository":{"id":56999637,"uuid":"454203734","full_name":"hdimo/php-equtable","owner":"hdimo","description":"interface for php object comparaison","archived":false,"fork":false,"pushed_at":"2022-02-06T21:18:51.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-14T11:20:37.889Z","etag":null,"topics":["equatable","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hdimo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-31T23:26:52.000Z","updated_at":"2022-09-24T19:08:55.000Z","dependencies_parsed_at":"2022-08-21T13:20:48.460Z","dependency_job_id":null,"html_url":"https://github.com/hdimo/php-equtable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hdimo/php-equtable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdimo%2Fphp-equtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdimo%2Fphp-equtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdimo%2Fphp-equtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdimo%2Fphp-equtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hdimo","download_url":"https://codeload.github.com/hdimo/php-equtable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdimo%2Fphp-equtable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34101065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["equatable","php"],"created_at":"2025-12-12T22:39:05.808Z","updated_at":"2026-06-09T09:32:33.841Z","avatar_url":"https://github.com/hdimo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PHP UNIT](https://github.com/hdimo/php-equtable/actions/workflows/php.yml/badge.svg)](https://github.com/hdimo/php-equtable/actions/workflows/php.yml)\n\nAn equatable interface for object comparison in PHP.\n\nwhen we want to compare objects in php with == yields incorrect results even if they are equal in all properties.\nthis library provides an interface to compare two objects by returning their properties and checks if they are equal.\n\nInstallation\n\n```shell script\ncomposer require jkhaled/equatable \n```\n\nusage example : \n\n```php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nclass User extends \\Jkhaled\\Equatable\\AbstractEquatable\n{\n    private $id;\n    private $firstname;\n\n    public function getId()\n    {\n        return $this-\u003eid;\n    }\n\n    public function setId($id)\n    {\n        $this-\u003eid = $id;\n        return $this;\n    }\n\n    public function getFirstname()\n    {\n        return $this-\u003efirstname;\n\n    }\n\n    public function setFirstname($firstname)\n    {\n        $this-\u003efirstname = $firstname;\n        return $this;\n    }\n\n    // the properties to be compared to check equality\n    public function getProperties(): array \n    {\n        return ['id', 'firstname'];\n    }\n}\n\n$user1 = (new User())\n    -\u003esetFirstname('khaled')\n    -\u003esetId(111);\n\n$user2 = (new User())\n    -\u003esetFirstname('khaled')\n    -\u003esetId(111);\n\nvar_dump($user1 === $user2); // false\nvar_dump($user1-\u003eequalTo($user2)); // true \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdimo%2Fphp-equtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdimo%2Fphp-equtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdimo%2Fphp-equtable/lists"}