PHP code example of ch / debug

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

    

ch / debug example snippets




use Ch\Debug\Debug;

$object = new stdClass();
$object->a = 1;
$object->b = 'test';
$object->c = true;
Debug::_($object);

// You can use filters
$tag = 'string to filter';
$pos = 1;
Debug::_($pos, $tag);
bash
$ DEBUG=* php anyfile.php
[PATH]/anyfile.php(9): $object = object(stdClass)#21 (3) {
  ["a"] => int(1)
  ["b"] => string(4) "test"
  ["c"] => bool(true)
}
[PATH]/anyfile.php(14): $pos = 1 [string to filter]
bash
$ DEBUG=filter php anyfile.php
[PATH]/anyfile.php(14): $pos = 1 [string to filter]