PHP code example of simplecomplex / inspect

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

    

simplecomplex / inspect example snippets


// If dependency injection container exists.
$inspect = $container->get('inspect');
// Otherwise use maker.
$inspect = \SimpleComplex\Inspect\Inspect::getInstance();

$var = 'what is this?'; $xcptn = new \Exception('Doh');

// Inspect:
$inspect->inspect($var);
// Trace:
$inspect->inspect($xcptn);

$inspect->variable($var);

// Trace exception:
$inspect->trace($xcptn);
// Do back-trace:
$inspect->trace(null);

$logger->debug('Darned ding' . "\n" . $inspect->variable($var));

$inspect->variable($var)->log('debug', 'darned ding');