{"id":13616650,"url":"https://github.com/sebastianbergmann/comparator","last_synced_at":"2026-04-06T13:02:51.984Z","repository":{"id":11627804,"uuid":"14127912","full_name":"sebastianbergmann/comparator","owner":"sebastianbergmann","description":"Provides the functionality to compare PHP values for equality.","archived":false,"fork":false,"pushed_at":"2025-04-13T07:25:45.000Z","size":56702,"stargazers_count":7034,"open_issues_count":19,"forks_count":69,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-27T23:56:28.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastianbergmann.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"sebastianbergmann","liberapay":"sebastianbergmann","thanks_dev":"u/gh/sebastianbergmann","tidelift":"packagist/sebastian/comparator"}},"created_at":"2013-11-05T00:36:12.000Z","updated_at":"2025-04-26T00:04:06.000Z","dependencies_parsed_at":"2023-02-18T04:15:50.429Z","dependency_job_id":"f238121e-a3d3-46e2-a5af-008293ac3c3a","html_url":"https://github.com/sebastianbergmann/comparator","commit_stats":{"total_commits":519,"total_committers":29,"mean_commits":"17.896551724137932","dds":0.1425818882466281,"last_synced_commit":"df95a6e827808debe3dbe190022dd0f643d5d909"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fcomparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fcomparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fcomparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fcomparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastianbergmann","download_url":"https://codeload.github.com/sebastianbergmann/comparator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252531842,"owners_count":21763290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T20:01:31.460Z","updated_at":"2026-04-06T13:02:51.942Z","avatar_url":"https://github.com/sebastianbergmann.png","language":"PHP","funding_links":["https://github.com/sponsors/sebastianbergmann","https://liberapay.com/sebastianbergmann","https://thanks.dev/u/gh/sebastianbergmann","https://tidelift.com/funding/github/packagist/sebastian/comparator"],"categories":["PHP","类库"],"sub_categories":["未归类"],"readme":"[![Latest Stable Version](https://poser.pugx.org/sebastian/comparator/v)](https://packagist.org/packages/sebastian/comparator)\n[![CI Status](https://github.com/sebastianbergmann/comparator/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/comparator/actions)\n[![codecov](https://codecov.io/gh/sebastianbergmann/comparator/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/comparator)\n\n# sebastian/comparator\n\nThis component provides the functionality to compare PHP values for equality.\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):\n\n```\ncomposer require sebastian/comparator\n```\n\nIf you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:\n\n```\ncomposer require --dev sebastian/comparator\n```\n\n## Usage\n\n```php\n\u003c?php\nuse SebastianBergmann\\Comparator\\Factory;\nuse SebastianBergmann\\Comparator\\ComparisonFailure;\n\n$date1 = new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York'));\n$date2 = new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/Chicago'));\n\n$factory = new Factory;\n$comparator = $factory-\u003egetComparatorFor($date1, $date2);\n\ntry {\n    $comparator-\u003eassertEquals($date1, $date2);\n    print \"Dates match\";\n} catch (ComparisonFailure $failure) {\n    print \"Dates don't match\";\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fcomparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbergmann%2Fcomparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fcomparator/lists"}