PHP code example of sonsofphp / assert

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

    

sonsofphp / assert example snippets




use SonsOfPHP\Component\Assert\Assert;

Assert::string('test'); // returns true
Assert::string(false); // throws exception

Assert::disable();
Assert::string(1234); // returns false