PHP code example of dbt / type-checker

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

    

dbt / type-checker example snippets


Type::of('strstr')->is('callable'); // true
Type::of('strstr')->is('string'); // also true

Type::of($myClass)->is(MyClass::class);
Type::of($myClass)->is(MyInterface::class);

Type::of('my string')->mustBe('float'); // Throws WrongType exception