PHPackages                             kylekatarnls/carbonite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kylekatarnls/carbonite

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kylekatarnls/carbonite
======================

Freeze, accelerate, slow down time and many more with Carbon.

2.0.0(2y ago)23301.9k↓30%11MITPHPPHP ^8.2CI failing

Since Aug 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/kylekatarnls/carbonite)[ Packagist](https://packagist.org/packages/kylekatarnls/carbonite)[ GitHub Sponsors](https://github.com/kylekatarnls)[ Fund](https://opencollective.com/Carbon)[ RSS](/packages/kylekatarnls-carbonite/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (7)Versions (11)Used By (1)

Carbonite
=========

[](#carbonite)

Freeze, accelerate, slow down time and many more with [Carbon](https://carbon.nesbot.com/).

You can use it with any PSR-compatible clock system and framework or with any time mocking system.

[![Latest Stable Version](https://camo.githubusercontent.com/1fe1e6ec6989c904c788c8e82f7086361fdd2ca9c0bea5f4dee3c753fb382b09/68747470733a2f2f706f7365722e707567782e6f72672f6b796c656b617461726e6c732f636172626f6e6974652f762f737461626c652e706e67)](https://packagist.org/packages/kylekatarnls/carbonite)[![GitHub Actions](https://github.com/kylekatarnls/carbonite/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/kylekatarnls/carbonite/actions)[![Code Climate](https://camo.githubusercontent.com/443ce598e1f842c414d9bb337558dde019d4fc98270978578a6193da17a5f7bc/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b796c656b617461726e6c732f636172626f6e6974652f6261646765732f6770612e737667)](https://codeclimate.com/github/kylekatarnls/carbonite)[![Test Coverage](https://camo.githubusercontent.com/6b8cb6c076e15c0b8c40770916216d3a379b5f9b3b451e25835fe413251f13a1/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b796c656b617461726e6c732f636172626f6e6974652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/kylekatarnls/carbonite/coverage)[![Issue Count](https://camo.githubusercontent.com/bd45e82748c96ba411fb33545d00d7a9bb65e47c81f064115d19834bfaaf6ce1/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b796c656b617461726e6c732f636172626f6e6974652f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/kylekatarnls/carbonite)[![StyleCI](https://camo.githubusercontent.com/8b951ba1c5d5476bc9f4edfa8362635b53ef454b82987d77641e3aa96b5b93de/68747470733a2f2f7374796c6563692e696f2f7265706f732f3230333935313537392f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/203951579)

Carbonite allows you to write unit tests as you would tell a story for times concerns.

[Professionally supported nesbot/carbon is now available](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme)

Install
-------

[](#install)

```
composer require --dev kylekatarnls/carbonite
```

We install Carbonite with `--dev` because it's designed for tests. You watched enough Sci-Fi movies to know time travel paradoxes are too dangerous for production.

If your config matches the requirements:

- PHP &gt;= 8.2
- Carbon &gt;= 3.0.2

It will install the latest version of this package, if you need to support older PHP versions (up to 7.2), Carbon 2, or to use annotations over attributes, then install the version 1.x:

```
composer require --dev kylekatarnls/carbonite:^1
```

Then you can browse the corresponding [Carbonite v1 documentation](https://github.com/kylekatarnls/carbonite/tree/1.x?tab=readme-ov-file#usage).

Usage
-----

[](#usage)

```
