Skip to content

ottaviano/comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comparator

Build Status

<?php

$a = [
    'a' => 1,
    'c' => 5,
    'd' => [1,2],
    'f' => 10,
];

$b = [
    'f' => 10,
    'a' => 'test',
    'b' => 1,
    'd' => [5, 2 => 7],
    'e' => 'hello',
];

$comparator = new Comparator(new PlusMinusExporter());

dump($comparator->compare($a, $b));
array:6 [
  "[*]a" => "test"
  "[-]c" => 5
  "[*]d" => array:3 [
    "[*]0" => 5
    "[-]1" => 2
    "[+]2" => 7
  ]
  "[=]f" => 10
  "[+]b" => 1
  "[+]e" => "hello"
]

About

Comparator for php array

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages