Skip to content

xtlsoft/GoFeature

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoFeature

Enabling Golang Features in PHP.

Installation

composer require xtlsoft/gofeature

Demos

Defer:

<?php

require_once "vendor/autoload.php";

defer(function(){
    echo '1';
});

defer(function(){
    echo '2';
});

$defer = make('GoFeature\Defer')->push(function(){
    echo 'FromAnother1';
})->push(function(){
    echo 'FromAnother2'
});

echo '3'

Result:

3FromAnother2FromAnother121

Go:

$th = go(function($ctx){
    while(1){
        echo $this->recv();
    }
});
$th->send("First test.\r\n");
sleep(2);
$th->send("Twice test.");

About

Enabling Golang Features in PHP.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages