pfsockopen()
function pfsockopen(string $hostname, int $port, int $error_code = null, string $error_message = null, float $timeout = null): mixed
Open persistent Internet or Unix domain socket connection.
Parameters:
$hostname(string)$port(int)$error_code(int), passed by reference, defaultnull, optional$error_message(string), passed by reference, defaultnull, optional$timeout(float), defaultnull, optional
Returns: mixed
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/filesystem/pfsockopen.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how pfsockopen is implemented in the compiler, see the internals page.