1. Go to this page and download the library: Download sophie-spec/ensure 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/ */
sophie-spec / ensure example snippets
use function Sophie\Ensure\ensure;
$add = function ($a, $b) {
return $a + $b;
};
ensure($add(1, 2), 3);
ensure($add(1, 2), 10);
/*
Both values are not equal.
Provided value:
3
Expected value:
10
*/