Skip to content

diffForHumans broken after commit 0f0a245 #2744

@michaelm111

Description

@michaelm111

Hello,

I encountered an issue with the following code:

\Carbon\Carbon::yesterday()->diffForHumans([
  'syntax' => \Carbon\CarbonInterface::DIFF_ABSOLUTE,
  'parts' => 3,
  'skip' => 's',
]);

Carbon version: 2.64.0

PHP version: 7.4.33

I expected to get:

1 day 16 hours 57 minutes

But I actually get:

Uncaught Exception TypeError: "Argument 3 passed to Carbon\Carbon::diffAsCarbonInterval() must be of the type array, string given, called in /vendor/nesbot/carbon/src/Carbon/Traits/Difference.php on line 847" at /vendor/nesbot/carbon/src/Carbon/Traits/Difference.php line 151

Thanks!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions