PHPackages                             divengine/laze - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. divengine/laze

ActiveLibrary[Testing &amp; Quality](/categories/testing)

divengine/laze
==============

Div PHP Laze

1.1.1(1y ago)213GPL-3.0-or-laterPHPPHP &gt;=8.0.0

Since Aug 13Pushed 4mo agoCompare

[ Source](https://github.com/divengine/laze)[ Packagist](https://packagist.org/packages/divengine/laze)[ Docs](https://divengine.org)[ RSS](/packages/divengine-laze/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Div PHP Laze
============

[](#div-php-laze)

[![Latest Stable Version](https://camo.githubusercontent.com/93582e3f8d937802252b26b221ba8b2143fd504ddf5f478dd118f28169e20ec5/68747470733a2f2f706f7365722e707567782e6f72672f646976656e67696e652f6c617a652f76)](https://packagist.org/packages/divengine/laze) [![Total Downloads](https://camo.githubusercontent.com/b68ca2a1a0d5971808108816463f77c3fa04bbd160854dd74e173c2ce234e252/68747470733a2f2f706f7365722e707567782e6f72672f646976656e67696e652f6c617a652f646f776e6c6f616473)](https://packagist.org/packages/divengine/laze) [![Latest Unstable Version](https://camo.githubusercontent.com/f979511ee276c9c9a1e424b4218aaa8a33537d01b97eb9f4d426cb06f118086a/68747470733a2f2f706f7365722e707567782e6f72672f646976656e67696e652f6c617a652f762f756e737461626c65)](https://packagist.org/packages/divengine/laze) [![License](https://camo.githubusercontent.com/ed07ad571b853fba362f7780ab2f5958659180533b36cda53362b16b7a109336/68747470733a2f2f706f7365722e707567782e6f72672f646976656e67696e652f6c617a652f6c6963656e7365)](https://packagist.org/packages/divengine/laze) [![PHP Version Require](https://camo.githubusercontent.com/197a538661b171d48c14fa5557a9cf57316d515a6808c854e617425f63e074ee/68747470733a2f2f706f7365722e707567782e6f72672f646976656e67696e652f6c617a652f726571756972652f706870)](https://packagist.org/packages/divengine/laze)

**laze** is a PHP library designed for defining [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation). Values are set as closures and only materialize upon first access, ensuring efficient and controlled initialization. Once a closure function is evaluated, it becomes immutable and cannot be redefined as a different value. However, it can be redefined as a `closure` until it’s accessed, at which point it transforms into a non-closure value.

Laze provides lazy immutable values for PHP. You define a key with a closure, and the value is computed on first read and then cached.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher

Installation
------------

[](#installation)

```
composer require divengine/laze
```

Quick start
-----------

[](#quick-start)

```
