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

Async

The async keyword is used in programming, and especially in languages like JavaScript, Python, and C#, to define a function that runs asynchronously. It means that it can perform operations without blocking the rest of the program.

PHP does not support a notion of async. The closest feature is called fiber or parallel processing, yet it is quite different from asynchronous. Generators also provide a pseudo-asynchronous processing.

<?php

    // Starting another process for parallel processing
    shell_exec('php other.php &');

?>

Documentation

See Also