An open API service indexing awesome lists of open source software.

https://github.com/xtlsoft/gofeature

Enabling Golang Features in PHP.
https://github.com/xtlsoft/gofeature

Last synced: 10 months ago
JSON representation

Enabling Golang Features in PHP.

Awesome Lists containing this project

README

          

# GoFeature
Enabling Golang Features in PHP.

## Installation
```bash
composer require xtlsoft/gofeature
```

## Demos
Defer:
```php
push(function(){
echo 'FromAnother1';
})->push(function(){
echo 'FromAnother2'
});

echo '3'

```
Result:
```text
3FromAnother2FromAnother121
```

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