PHP code example of ffi / env

1. Go to this page and download the library: Download ffi/env 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/ */

    

ffi / env example snippets


use FFI\Env\Runtime;

$status = Runtime::getStatus();

use FFI\Env\Runtime;

$isAvailable = Runtime::isAvailable();

use FFI\Env\Runtime;

Runtime::assertAvailable();
// Throws an \FFI\Env\Exception\EnvironmentException in case FFI is not available.

use FFI\Env\Runtime;
use FFI\Env\Exception\EnvironmentException;

assert(Runtime::assertAvailable());

// Or using your own assertion error message:
assert(Runtime::isAvailable(), EnvironmentException::getErrorMessageFromStatus());