> For the complete documentation index, see [llms.txt](https://lara-dumps.gitbook.io/laradumps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lara-dumps.gitbook.io/laradumps/commands/diff.md).

# Diff

Sometimes you may want to quickly compare one variable with another, for that use diff()

```php
ds()->diff('This is an example text', 'This is an example of content');

$array1 = [
    'name'      => 'Luan',
    'last_name' => 'Freitas',
    'is_active' => false,
];

$array2 = [
    'name'      => 'Luan',
    'last_name' => 'Freitas',
    'is_active' => true,
];

ds()->diff($array1, $array2, true);
```

![](https://1925282274-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBDrn5ZBe2jpKcdmPPrl%2Fuploads%2Fgit-blob-9c7d534478dec1e49042c09509f83d53715b4420%2Fdiff.png?alt=media)
