Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Promise

A promise is a programming construct used in asynchronous programming to handle the results or errors of an asynchronous operation that may not have completed yet. It allows developers to write code that can continue executing while waiting for the completion of a long-running task, such as making an HTTP request or querying a database.

Promises follow the concept from the context of the Promises/A+ specification, which is a widely adopted standard for asynchronous programming in many programming languages.

Promises are commonly used with libraries or frameworks that provide asynchronous functionality, such as Guzzle for making HTTP requests or ReactPHP for building asynchronous applications.

Documentation

See Also