PHP code example of reedsys / leap

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

    

reedsys / leap example snippets




// path to where Leap.php is located
able
{
    public function options() : array {
        // follow getopt() naming convention
        return [
            'h'   => [ $this, "print_hello" ],  // option that do not accept value
            'w::' => [ $this, "print_world" ],  // optional value
            'm:'  => [ $this, "print_my" ]      //  $v . "\n";
    }
}

\leap\Leap::run(
    \leap\Leap::wrap(
        new \leap\cli\Wrapper(),
        new HelloWorld()
    )
);

> php helloworld.php -h

Hello >

> php helloworld.php -h -w

Hello World
>