1. Go to this page and download the library: Download suin/livexample 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/ */
suin / livexample example snippets
function hello(string $name): string {
return 'hello ' . $name;
}
echo hello('alice') . "\n";
echo hello('bob') . "\n";
// Output:
// hello alice
// hello carol
use Livexample\PHPUnit\ExampleTestCase;
class ExampleTest extends ExampleTestCase
{
public function exampleFiles()
{
// specify your example code directory.
return self::exampleDirectory('example');
}
}