PHP code example of survos / debug-utils

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

    

survos / debug-utils example snippets


use Survos\DebugUtils\Assert;

$row = ['name' => 'Tac', 'email' => '[email protected]'];

Assert::keyExists('email', $row);   // ok
Assert::keyExists('emial', $row);   // throws

Assert::keysExist(['name', 'email', 'phone'], $row);

Assert::inArray($status, ['draft', 'published', 'archived']);

Assert::keyExists('id', $payload, 'check the /api/items response shape');