PHP code example of brightnucleus / phpfeature

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

    

brightnucleus / phpfeature example snippets


public function is_supported( $features );

public function get_minimum_

// Array of strings to define what features you need.
$features = array( 'namespaces', 'traits' );

// Instantiate the PHPFeature library.
// When you don't provide a version number as the first argument,
// the version of the currently used PHP interpreter is fetched.
$php = new PHPFeature();

// Check whether all of the features are supported. If not...
if ( ! $php->is_supported( $features ) ) {

    // ... throw exception and let user know the minimum needed.
    throw new RuntimeException( sprintf(
        'Your PHP interpreter does not support some features needed to run this application. Please upgrade to version %1$s or newer.',
        $php->get_minimum_