Download the PHP package fast-forward/defer without Composer

On this page you can find all versions of the php package fast-forward/defer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package defer

FastForward Defer

PHP Version Composer Package Tests Coverage Docs GitHub Sponsors

A minimal utility that brings defer-style execution (similar to Go) to PHP using object scope and destructors. It allows you to register callbacks that will run automatically at the end of a scope, in LIFO order (Last-In, First-Out).


Core Concept

A Defer instance represents a scope-bound execution stack.


Basic Usage

Output


Using Arguments

Deferred callbacks receive exactly the arguments you pass.

Output


⚠️ Execution Order Matters

Deferred callbacks execute in reverse order of registration.

Execution order:

Always register in reverse of the desired execution order.


Exception Safety

Deferred callbacks always run, even if an exception occurs.

Output


Nested Scopes

Each Defer instance is isolated.

Output


Helper Functions

defer()

Creates a new Defer instance.


scope()

Runs a block with an isolated defer scope.


using()

Structured resource management (acquire → use → cleanup).


Error Handling

Deferred callbacks never break execution flow.


Custom Error Reporter


Composite Reporter


PSR Integration

PSR-3 Logger


PSR-14 Event Dispatcher

This allows multiple listeners (logging, metrics, tracing, etc.).


HTTP Middleware (PSR-15)

You can bind a Defer instance to a request lifecycle.

The middleware:


Accessing Defer in Handlers


Execution Model

Within a single scope

Across nested scopes


Design Principles


Notes


When to Use


When NOT to Use


Summary

Defer provides a strict and predictable cleanup model:

It is intentionally small, deterministic, and constrained.

Contributing

See CONTRIBUTING.md for changelog fragments, local checks and the release-review flow.

Consumer agent skill

The package includes fast-forward-defer for application integration. It supports fast-forward/defer:^1.1; inspect the installed version. See skill installation and lifecycle for optional project synchronization with llm/skills ^1.15, guarded manual project/global copies and a pinned Skills CLI alternative. Shipping files does not install tooling or activate the skill in an agent session.


All versions of defer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
psr/http-server-middleware Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fast-forward/defer contains the following files

Loading the files please wait ...