PHP code example of onx / code-spy
1. Go to this page and download the library: Download onx/code-spy 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/ */
onx / code-spy example snippets
spyOn($yourObject, $recursionDepth);
// Debugging a complex array structure with recursion depth set to 2
$arrayToDebug = ['key1' => 'value1', 'key2' => ['subkey1' => 'subvalue1']];
spyOn($arrayToDebug, 2);
// Debugging an object with default recursion depth
$objectToDebug = new MyClass();
spyOn($objectToDebug);