Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Comparator Laravel Package

sebastian/comparator

Compare PHP values for equality with dedicated comparators for scalars, arrays, objects, dates, and more. Part of PHPUnit, it reports detailed differences via ComparisonFailure exceptions and ships a Factory for selecting the right comparator.

View on GitHub
Deep Wiki
Context7
8.4.0

Added

  • Factory::setExporter() and Factory::exporter() for configuring the SebastianBergmann\Exporter\Exporter instance that is used by comparators registered with the factory

Changed

  • Comparators now use the Exporter instance configured for their Factory instead of creating their own instances (this allows customizing how values are represented in comparison failure messages)
  • When an object exporter provides the representation for the objects that are compared then that representation is used in the comparison failure message instead of the property-by-property representation; this does not apply to objects for which a comparator of their own exists (DateTimeComparator, for instance), as the representation such a comparator provides always has precedence
8.3.0

Added

  • #163: Expose detection of closure comparisons
8.2.1

Changed

  • #136: Cleaner diff output for canonicalized list comparisons
  • #160: Use by-value comparison for closures

Fixed

  • #136: Canonicalized array comparison destroys string keys
7.1.8

Changed

  • #136: Cleaner diff output for canonicalized list comparisons
  • #160: Use by-value comparison for closures

Fixed

  • #136: Canonicalized array comparison destroys string keys
8.2.0

Added

  • #126: DateIntervalComparator for comparing DateInterval objects with a delta tolerance

Fixed

  • #70: Non-ASCII text in XML diffs is rendered as numeric character references, making diffs unreadable
  • #87: DOMNodeComparator crashes or returns false positives when DOMNode::C14N() fails
  • #107: DOMNodeComparator reports XML documents as equal when they differ only in comments
  • #115: DateTimeComparator does not track processed pairs, producing misleading diffs in nested structures
  • #158: ComparisonFailure cannot be serialized when stack trace contains non-serializable objects
7.1.7

Fixed

  • #70: Non-ASCII text in XML diffs is rendered as numeric character references, making diffs unreadable
  • #87: DOMNodeComparator crashes or returns false positives when DOMNode::C14N() fails
  • #107: DOMNodeComparator reports XML documents as equal when they differ only in comments
  • #115: DateTimeComparator does not track processed pairs, producing misleading diffs in nested structures
  • #158: ComparisonFailure cannot be serialized when stack trace contains non-serializable objects
8.1.4

Changed

  • #138: Use StrictUnifiedDiffOutputBuilder instead of UnifiedDiffOutputBuilder
8.1.3

Changed

  • Pass configuration options introduced in sebastian/diff 8.3.0
8.1.2

Fixed

  • #141: ArrayComparator sorts objects by spl_object_id(), breaking canonicalized equality for arrays of equal objects
7.1.6

Fixed

  • #141: ArrayComparator sorts objects by spl_object_id(), breaking canonicalized equality for arrays of equal objects
8.1.1

Fixed

  • #140: sort() in ArrayComparator produces non-deterministic results for arrays with mixed types
7.1.5

Fixed

  • #140: sort() in ArrayComparator produces non-deterministic results for arrays with mixed types
8.1.0

Added

8.0.0

Removed

  • Removed support for PHP 8.3
7.1.4

Changed

  • #134: Suppress warning introduced in PHP 8.5
6.3.3

Changed

  • #134: Suppress warning introduced in PHP 8.5
5.0.5

Changed

  • #134: Suppress warning introduced in PHP 8.5
5.0.4

Changed

  • Do not use SplObjectStorage methods that will be deprecated in PHP 8.5
7.1.3

Changed

  • #130: Provide a diff when ClosureComparator fails
7.1.2

Fixed

  • SebastianBergmann\Comparator\Comparator should not have been marked as private implementation detail of this library
7.1.1

Changed

  • Do not use SplObjectStorage methods that will be deprecated in PHP 8.5
6.3.2

Changed

  • Do not use SplObjectStorage methods that will be deprecated in PHP 8.5
7.1.0

Added

  • #127: Support for comparing Closure objects
7.0.1

Fixed

  • #122: INF is considered equal to -INF
6.3.1

Fixed

  • #122: INF is considered equal to -INF
7.0.0

Removed

  • Removed support for PHP 8.2
6.3.0

Added

  • #121: Support for BcMath\Number objects
6.2.1

Fixed

  • #119: Uninitialized string offset -1 warning
6.2.0

Changed

  • #117: Remove common prefixes and suffixes from actual and expected single-line strings
6.1.1

Fixed

  • Reverted #113 as it broke backward compatibility
5.0.3

Fixed

  • Reverted #113 as it broke backward compatibility
6.1.0

Added

  • Specialized comparator for enumerations
6.0.2

Fixed

  • #112: Arrays with different keys and the same values are considered equal in canonicalize mode
5.0.2

Fixed

  • #112: Arrays with different keys and the same values are considered equal in canonicalize mode
6.0.1

Changed

  • This project now uses PHPStan instead of Psalm for static analysis
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin