PHP code example of jessegall / php-types

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

    

jessegall / php-types example snippets


use JesseGall\PhpTypes\T_String;

$prefix = T_String::empty();              // '' with a name
if (T_String::isEmpty($delimiter)) { … }  // reads as intent

// as a first-class callable
$nonEmpty = array_filter($parts, T_String::isNotEmpty(...));

$make = Defaults::array();   // Closure(): array{}
$make();                     // []

// e.g. a resolver factory or a lazy fallback:
IsNull::make()->then(Defaults::array());
bash
composer