PHP code example of tioncico / logic-assert

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

    

tioncico / logic-assert example snippets


$userId = null;
//常规判断写法
if ($userId===null){
    echo "会员id不存在!";
}


try{
    //断言写法
    \LogicAssert\Assert::assertEquals($userId, null,'会员id不存在!');
}catch (\Throwable $throwable){
    echo $throwable->getMessage();
}