{"id":256911,"date":"2015-05-10T17:32:02","date_gmt":"2015-05-10T13:32:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256911"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256911","title":{"rendered":"\u0423\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u0441 PHPixie Debug"},"content":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a9e\/60d\/e1d\/a9e60de1db7f9c18a643766e8aea6f4e.png\" alt=\"image\" align=\"right\"\/> <br \/>  PHPixie Debug \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0447\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u043e\u0439 \u043d\u0435\u0442, \u043d\u043e \u0432\u043e\u0442 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0440\u0435\u0448\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u043a\u0443 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 WordPress, \u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0435\u0442. \u0414\u0430\u0436\u0435 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 PHPixie Debug \u0432 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0442\u0440\u0435\u0439\u0441\u044b<\/b><\/p>\n<p>  Debug \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0442\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0432 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u0439\u0441\u043e\u0432 c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 PHP \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <i>print_r(debug_backtrace())<\/i> \u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u0433\u043e\u0440\u0443 \u0442\u0435\u043a\u0441\u0442\u0430. \u0415\u0441\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e <i>debug_print_backtrace()<\/i>, \u043d\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440. \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0440\u0435\u0439\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f PHPixie Debug:<\/p>\n<pre><code class=\"php\">&lt;?php require_once('vendor\/autoload.php'); $debug = new \\PHPixie\\Debug();  try{     throw new \\Exception(&quot;test&quot;);      }catch(\\Exception $e) {     \/\/\u0412\u044b\u0432\u043e\u0434 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f     $debug-&gt;exceptionMessage($e); }  echo &quot;\\n-------\\n&quot;;  \/\/\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \/\/\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u0432\u0435\u0441\u044c \u043b\u043e\u0433 \/\/(\u043e \u043d\u0435\u043c \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u043e\u0437\u0436\u0435) $debug-&gt;registerHandlers();  class Test {     public function a($string)     {         $array = array(1, 2);         $this-&gt;b($string, $array);     }          public function b($string, $array)     {         $object = (object) array('t' =&gt; 1);         $this-&gt;c($string, $array, $object);     }          public function c()     {         substr();     } }  $test = new Test(); $test-&gt;a(&quot;pixie&quot;); <\/code><\/pre>\n<pre><code class=\"diff\">Exception: test                                                                                                                               5                                   6 try{                                                                  &gt;     throw new \\Exception(&quot;test&quot;);                                     8                                                                       9 }catch(\\Exception $e) {                                                                                                                      #0 D:\\debug\\examples\\exceptions.php:7                                                                                                        -------                                                                                                                                                                                                        ErrorException: substr() expects at least 2 parameters, 0 given                                                                               36     public function c()                                              37     {                                                                &gt;&gt;         substr();                                                    39     }                                                                40 }                                                                                                                                           #0 D:\\debug\\examples\\exceptions.php:38                                #1 D:\\debug\\examples\\exceptions.php:38                                    substr()                                                           #2 D:\\debug\\examples\\exceptions.php:33                                    Test-&gt;c('pixie', array[2], stdClass)                               #3 D:\\debug\\examples\\exceptions.php:27                                    Test-&gt;b('pixie', array[2])                                         #4 D:\\debug\\examples\\exceptions.php:43                                    Test-&gt;a('pixie')                                                                                                                          Logged items:                                                                                                                                 <\/code><\/pre>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0432 \u0442\u0440\u0435\u0439\u0441\u0435 \u043d\u0435 \u0432\u0438\u0434\u043d\u043e \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b PHP \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0437\u0430\u0441\u043e\u0440\u044f\u044f \u0442\u0440\u0435\u0439\u0441. PHPixie \u043f\u0440\u044f\u0447\u0435\u0442 \u0432\u0441\u0435 \u0442\u0430\u043a\u0438\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432 \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>  <b>\u0412\u044b\u0432\u043e\u0434 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/b><\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0441\u0434\u0435\u043b\u0430\u043d \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>\\PHPixie\\Debug::dump()<\/i>, \u044d\u0442\u043e \u043a\u0441\u0442\u0430\u0442\u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 PHPixie. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u043c\u0443 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e \u0437\u0430\u043c\u044b\u0441\u043b\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b \u0438 \u0442\u0430\u043a \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0438\u0445 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 Debug \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u0422\u0443\u0442 \u043a\u0441\u0442\u0430\u0442\u0438 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Debug \u0443\u0436\u0435 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043d\u0438 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u043a\u0441\u0438 \u0438 \u043d\u0438 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432 PHPixie \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<pre><code class=\"php\">&lt;?php require_once('vendor\/autoload.php');  use PHPixie\\Debug; $debug = new Debug();  Debug::dump(&quot;Array dump:&quot;); Debug::dump(array(1));  Debug::dump(&quot;Short array dump:&quot;); \/\/\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0434\u0430\u043c\u043f \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.  \/\/\u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \/\/\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043b\u0438 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Debug::dump(array(1), true);  $object = (object) array('t' =&gt; 1); Debug::dump(&quot;Object dump:&quot;); Debug::dump($object);  Debug::dump(&quot;Short object dump:&quot;); Debug::dump($object, true);  Debug::dump(&quot;Dump trace with parameters&quot;); class Test {     public function a($string)     {         $array = array(1, 2);         $this-&gt;b($string, $array);     }          public function b($string, $array)     {         $object = (object) array('t' =&gt; 1);         $this-&gt;c($string, $array, $object);     }          public function c()     {         Debug::trace();     } }  $t = new Test(); $t-&gt;a(&quot;test&quot;); <\/code><\/pre>\n<pre><code class=\"diff\">'Array dump:'  Array (     [0] =&gt; 1 )   'Short array dump:'  array[1]  'Object dump:'  stdClass Object (     [t] =&gt; 1 )   'Short object dump:'  stdClass  'Dump trace with parameters'  #0 D:\\debug\\examples\\dumping.php:37     PHPixie\\Debug::trace() #1 D:\\debug\\examples\\dumping.php:32     Test-&gt;c('test', array[2], stdClass) #2 D:\\debug\\examples\\dumping.php:26     Test-&gt;b('test', array[2]) #3 D:\\debug\\examples\\dumping.php:42     Test-&gt;a('test') <\/code><\/pre>\n<p>  <b>\u041b\u043e\u0433<\/b><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043e\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <i>exit()<\/i> \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043d\u0435 \u0432\u044b\u0432\u0435\u0434\u0443\u0442\u0441\u044f. PHPixie Debug \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043b\u043e\u0433 \u043f\u0440\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0434\u043b\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u043b\u043e\u0433\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412\u043e\u0442 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"php\">use PHPixie\\Debug; $debug = new Debug();  Debug::log(&quot;test&quot;); Debug::log(array(3));  class Test {     public function a($string, $num)     {         Debug::logTrace();     } } $t = new Test(); $t-&gt;a(&quot;test&quot;, 5);  \/\/\u0420\u0443\u0447\u043d\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 $debug-&gt;dumpLog(); <\/code><\/pre>\n<pre><code class=\"diff\">Logged items:  [0] D:\\debug\\examples\\logging.php:7 'test'  [1] D:\\debug\\examples\\logging.php:8 Array (     [0] =&gt; 3 )   [2] D:\\debug\\examples\\logging.php:16 #0 D:\\debug\\examples\\logging.php:16     PHPixie\\Debug::logTrace() #1 D:\\debug\\examples\\logging.php:20     Test-&gt;a('test', 5) <\/code><\/pre>\n<p>  \u0418 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php  use PHPixie\\Debug; $debug = new Debug();  \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0432 'true' \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u0432 \/\/\u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u043b\u043e\u0433\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \/\/\u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f $debug-&gt;registerHandlers(true);  Debug::log(&quot;test&quot;);  echo(&quot;Logged messages will be printed below&quot;); <\/code><\/pre>\n<pre><code class=\"diff\">Logged messages will be printed now  Logged items:  #0 D:\\debug\\examples\\log_handler.php:13 'test' <\/code><\/pre>\n<p>  <b>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/b><\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c \u0432\u044b\u0432\u043e\u0434 \u0442\u0440\u0435\u0439\u0441\u043e\u0432 \u0438 \u043b\u043e\u0433\u0430, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442 \u0432\u0435\u0431 \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0435\u0431\u0430\u0433\u0430 \u0434\u043b\u044f PHPixie, \u0432\u0435\u0434\u044c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430. \u041d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e Debug \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u0432 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0434\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0432\u0430\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u043a\u0443 \u043f\u0440\u043e \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u0430 \u0438\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 WordPress, \u0432\u044b \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u043e\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0431\u044b \u043d\u0430 <i>debug_backtrace()<\/i>.<\/p>\n<p>  <b>\u0414\u0435\u043c\u043e<\/b><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Debug \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e:<\/p>\n<pre><code class=\"diff\">git clone https:\/\/github.com\/phpixie\/debug cd debug\/examples   #\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435\u0442 \u041a\u043e\u043c\u043f\u043e\u0437\u0435\u0440\u0430 curl -sS https:\/\/getcomposer.org\/installer | php   php composer.phar install php exceptions.php php logging.php php log_handler.php php dumping.php <\/code><\/pre>\n<p>  \u0418 \u043a\u0441\u0442\u0430\u0442\u0438 \u043a\u0430\u043a \u0438 \u0443 \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u043e\u0442 PHPixie \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 100% \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u043f\u043e\u0434 \u043b\u044e\u0431\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 PHP \u0441\u0442\u0430\u0440\u0448\u0435 5.3 ( \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u043e\u0432\u0443\u044e 7 \u0438 HHVM )     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/257625\/\"> http:\/\/habrahabr.ru\/post\/257625\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a9e\/60d\/e1d\/a9e60de1db7f9c18a643766e8aea6f4e.png\" alt=\"image\" align=\"right\"\/> <br \/>  PHPixie Debug \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0447\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u043e\u0439 \u043d\u0435\u0442, \u043d\u043e \u0432\u043e\u0442 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0440\u0435\u0448\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u043a\u0443 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 Wordpress, \u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0435\u0442. \u0414\u0430\u0436\u0435 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 PHPixie Debug \u0432 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256911","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256911"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256911\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}