1. Go to this page and download the library: Download selfphp/php-typecheck 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/ */
selfphp / php-typecheck example snippets
use Selfphp\PhpTypeCheck\TypeChecker;
TypeChecker::assertArrayOfType([1, 2, 3], 'int'); // ✅ OK
TypeChecker::assertArrayOfType(['a', 'b'], 'string'); // ✅ OK
TypeChecker::assertArrayOfType([new User(), new User()], User::class); // ✅ OK