1. Go to this page and download the library: Download sanket3dx/phpgo library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sanket3dx / phpgo example snippets
$ch = phpgo\channel();
phpgo\go(function() use ($ch) {
echo "Sending from goroutine...\n";
phpgo\send($ch, "Hello form Go!");
});
$msg = phpgo\receive($ch);
echo "Received: $msg\n";