Download the PHP package sanket3dx/phpgo without Composer
On this page you can find all versions of the php package sanket3dx/phpgo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sanket3dx/phpgo
More information about sanket3dx/phpgo
Files in sanket3dx/phpgo
Download sanket3dx/phpgo
More information about sanket3dx/phpgo
Files in sanket3dx/phpgo
Vendor sanket3dx
Package phpgo
Short Description True Go Concurrency for PHP - Native Extension
License MIT
Package phpgo
Short Description True Go Concurrency for PHP - Native Extension
License MIT
Please rate this library. Is it a good library?
Informations about the package phpgo
phpgo - True Go Concurrency for PHP
phpgo is a native PHP extension written in Go that brings Go's concurrency primitives to PHP. It enables parallel execution using Goroutines, Channels, WaitGroups, and Select, backed by the Go runtime.
Features
- Goroutines:
phpgo\go(callable)spawns a lightness Go thread. - Channels: Buffered and unbuffered channels (
phpgo\channel). - Select: Go-style
selectstatement (phpgo\select). - WaitGroup: Synchronization primitive (
phpgo\WaitGroup).
Requirements
- PHP 8.0+
- Go 1.18+
- GCC / Clang
- ZTS (Zend Thread Safety) PHP build is highly recommended for stability.
Architecture
phpgo operates by loading a Go-compiled shared object (libphpgo.so) into a thin C-based PHP extension (phpgo.so). The Go runtime manages the scheduling of goroutines and channel operations.
Installation
Option 1: Using Pre-compiled Binaries (Fastest)
- Download the
phpgo.sofrom thebuild/folder. - Copy to Extensions: Move
phpgo.soto your PHP extensions directory (e.g.,/usr/lib/php/20210902/). - Enable in PHP: Add
extension=phpgo.soto yourphp.ini. - Restart: Restart your web server (e.g.,
sudo systemctl restart php8.1-fpm).
Option 2: Build from Source
- Clone the repository.
-
Build the Go library:
-
Build the PHP extension:
- Load it in PHP:
Usage
Channels & Goroutines
Select
Safety Warnings
- NTS Builds: Running PHP code concurrently (inside
phpgo\go) on Non-Thread-Safe PHP builds is experimental and may cause crashes if global state is accessed. - Resource Management: Channels are Go objects referenced by ID. They are garbage collected by Go when unreachable, but the ID mapping implies they should be closed explicitly or we rely on the map being cleared (TODO).
License
MIT
All versions of phpgo with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package sanket3dx/phpgo contains the following files
Loading the files please wait ...