• 0
    Posted by bkrukowski 15 days ago
    <?php
    
    function helloGoodbye()
    {
        defer($_, function () {
            echo "...\n";
        });
    
        defer($_, function () {
            echo "goodbye\n";
        });
    
        echo "hello\n";
    }
    
    echo "before hello\n";
    helloGoodbye();
    echo "after goodbye\n";
    
    // Output:
    //
    // before hello
    // hello
    // ...
    // goodbye
    // after goodbye