3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace{ Symfony\Component\Debug\ExceptionHandler::register(); throw new Exception('foo msg'); } /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Debug{ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\Debug\Exception\OutOfMemoryException; if (!defined('ENT_SUBSTITUTE')) { define('ENT_SUBSTITUTE', 8); } /** * ExceptionHandler converts an exception to a Response object. * * It is mostly useful in debug mode to replace the default PHP/XDebug * output with something prettier and more useful. * * As this class is mainly used during Kernel boot, where nothing is yet * available, the Response content is always HTML. * * @author Fabien Potencier <fabien@symfony.com> */ class ExceptionHandler { private $debug; private $charset; private $handler; private $caughtOutput = 0; public function __construct($debug = true, $charset = 'UTF-8') { $this->debug = $debug; $this->charset = $charset; } /** * Registers the exception handler. * * @param bool $debug * * @return ExceptionHandler The registered exception handler */ public static function register($debug = true) { $handler = new static($debug); set_exception_handler(array($handler, 'handle')); return $handler; } /** * Sets a user exception handler. * * @param callable $handler An handler that will be called on Exception * * @return callable|null The previous exception handler if any */ public function setHandler($handler) { if (isset($handler) && !is_callable($handler)) { throw new \LogicException('The exception handler must be a valid PHP callable.'); } $old = $this->handler; $this->handler = $handler; return $old; } /** * {@inheritdoc} * * Sends a response for the given Exception. * * If you have the Symfony HttpFoundation component installed, * this method will use it to create and send the response. If not, * it will fallback to plain PHP functions. * * @see sendPhpResponse * @see createResponse */ public function handle(\Exception $exception) { if ($exception instanceof OutOfMemoryException) { $this->sendPhpResponse($exception); return; } // To be as fail-safe as possible, the exception is first handled // by our simple exception handler, then by the user exception handler. // The latter takes precedence and any output from the former is cancelled, // if and only if nothing bad happens in this handling path. $caughtOutput = 0; $this->caughtOutput = false; ob_start(array($this, 'catchOutput')); try { if (class_exists('Symfony\Component\HttpFoundation\Response')) { $response = $this->createResponse($exception); $response->sendHeaders(); $response->sendContent(); } else { $this->sendPhpResponse($exception); } } catch (\Exception $e) { // Ignore this $e exception, we have to deal with $exception } if (false === $this->caughtOutput) { ob_end_clean(); } if (isset($this->caughtOutput[0])) { ob_start(array($this, 'cleanOutput')); echo $this->caughtOutput; $caughtOutput = ob_get_length(); } $this->caughtOutput = 0; if (!empty($this->handler)) { try { call_user_func($this->handler, $exception); if ($caughtOutput) { $this->caughtOutput = $caughtOutput; } } catch (\Exception $e) { if (!$caughtOutput) { // All handlers failed. Let PHP handle that now. throw $exception; } } } } /** * Sends the error associated with the given Exception as a plain PHP response. * * This method uses plain PHP functions like header() and echo to output * the response. * * @param \Exception|FlattenException $exception An \Exception instance */ public function sendPhpResponse($exception) { echo $exception->getMessage(); return; if (!$exception instanceof FlattenException) { $exception = FlattenException::create($exception); } if (!headers_sent()) { header(sprintf('HTTP/1.0 %s', $exception->getStatusCode())); foreach ($exception->getHeaders() as $name => $value) { header($name.': '.$value, false); } } echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception)); } /** * Creates the error Response associated with the given Exception. * * @param \Exception|FlattenException $exception An \Exception instance * * @return Response A Response instance */ public function createResponse($exception) { if (!$exception instanceof FlattenException) { $exception = FlattenException::create($exception); } return new Response($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders()); } /** * Gets the HTML content associated with the given exception. * * @param FlattenException $exception A FlattenException instance * * @return string The content as a string */ public function getContent(FlattenException $exception) { switch ($exception->getStatusCode()) { case 404: $title = 'Sorry, the page you are looking for could not be found.'; break; default: $title = 'Whoops, looks like something went wrong.'; } $content = ''; if ($this->debug) { try { $count = count($exception->getAllPrevious()); $total = $count + 1; foreach ($exception->toArray() as $position => $e) { $ind = $count - $position + 1; $class = $this->abbrClass($e['class']); $message = nl2br($e['message']); $content .= sprintf(<<<EOF <div class="block_exception clear_fix"> <h2><span>%d/%d</span> %s: %s</h2> </div> <div class="block"> <ol class="traces list_exception"> EOF , $ind, $total, $class, $message); foreach ($e['trace'] as $trace) { $content .= ' <li>'; if ($trace['function']) { $content .= sprintf('at %s%s%s(%s)', $this->abbrClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); } if (isset($trace['file']) && isset($trace['line'])) { if ($linkFormat = ini_get('xdebug.file_link_format')) { $link = str_replace(array('%f', '%l'), array($trace['file'], $trace['line']), $linkFormat); $content .= sprintf(' in <a href="%s" title="Go to source">%s line %s</a>', $link, $trace['file'], $trace['line']); } else { $content .= sprintf(' in %s line %s', $trace['file'], $trace['line']); } } $content .= "</li>\n"; } $content .= " </ol>\n</div>\n"; } } catch (\Exception $e) { // something nasty happened and we cannot throw an exception anymore if ($this->debug) { $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage()); } else { $title = 'Whoops, looks like something went wrong.'; } } } return <<<EOF <div id="sf-resetcontent" class="sf-reset"> <h1>$title</h1> $content </div> EOF; } /** * Gets the stylesheet associated with the given exception. * * @param FlattenException $exception A FlattenException instance * * @return string The stylesheet as a string */ public function getStylesheet(FlattenException $exception) { return <<<EOF .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 } .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; } .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; } .sf-reset .clear_fix { display:inline-block; } .sf-reset * html .clear_fix { height:1%; } .sf-reset .clear_fix { display:block; } .sf-reset, .sf-reset .block { margin: auto } .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; } .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px } .sf-reset strong { font-weight:bold; } .sf-reset a { color:#6c6159; } .sf-reset a img { border:none; } .sf-reset a:hover { text-decoration:underline; } .sf-reset em { font-style:italic; } .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif } .sf-reset h2 span { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; } .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; } .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px; -webkit-border-bottom-right-radius: 16px; -webkit-border-bottom-left-radius: 16px; -moz-border-radius-bottomright: 16px; -moz-border-radius-bottomleft: 16px; border-bottom-right-radius: 16px; border-bottom-left-radius: 16px; border-bottom:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; } .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px; -webkit-border-top-left-radius: 16px; -webkit-border-top-right-radius: 16px; -moz-border-radius-topleft: 16px; -moz-border-radius-topright: 16px; border-top-left-radius: 16px; border-top-right-radius: 16px; border-top:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; overflow: hidden; word-wrap: break-word; } .sf-reset li a { background:none; color:#868686; text-decoration:none; } .sf-reset li a:hover { background:none; color:#313131; text-decoration:underline; } .sf-reset ol { padding: 10px 0; } .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: 1px solid #ccc; } EOF; } private function decorate($content, $css) { return <<<EOF <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="robots" content="noindex,nofollow" /> <style> /* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */ html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} html { background: #eee; padding: 10px } img { border: 0; } #sf-resetcontent { width:970px; margin:0 auto; } $css </style> </head> <body> $content </body> </html> EOF; } private function abbrClass($class) { $parts = explode('\\', $class); return sprintf("<abbr title=\"%s\">%s</abbr>", $class, array_pop($parts)); } /** * Formats an array as a string. * * @param array $args The argument array * * @return string */ private function formatArgs(array $args) { $result = array(); foreach ($args as $key => $item) { if ('object' === $item[0]) { $formattedValue = sprintf("<em>object</em>(%s)", $this->abbrClass($item[1])); } elseif ('array' === $item[0]) { $formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset)); } elseif ('null' === $item[0]) { $formattedValue = '<em>null</em>'; } elseif ('boolean' === $item[0]) { $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>'; } elseif ('resource' === $item[0]) { $formattedValue = '<em>resource</em>'; } else { $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), true)); } $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); } /** * @internal */ public function catchOutput($buffer) { $this->caughtOutput = $buffer; return ''; } /** * @internal */ public function cleanOutput($buffer) { if ($this->caughtOutput) { // use substr_replace() instead of substr() for mbstring overloading resistance $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtOutput); if (isset($cleanBuffer[0])) { $buffer = $cleanBuffer; } } return $buffer; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/1Pvtj
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'Symfony%5CComponent%5CDebug%5CExceptionHandler', 'register'
          1        DO_FCALL                                      0          
    7     2        NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'foo+msg'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
   28     6*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cdefined'
          7*       SEND_VAL_EX                                              'ENT_SUBSTITUTE'
          8*       DO_FCALL                                      0  $3      
          9*       BOOL_NOT                                         ~4      $3
         10*       JMPZ                                                     ~4, ->15
   29    11*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cdefine'
         12*       SEND_VAL_EX                                              'ENT_SUBSTITUTE'
         13*       SEND_VAL_EX                                              8
         14*       DO_FCALL                                      0          
  424    15*     > RETURN                                                   1

Class Symfony\Component\Debug\ExceptionHandler:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Pvtj
function name:  __construct
number of ops:  7
compiled vars:  !0 = $debug, !1 = $charset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV_INIT                                        !0      <true>
          1        RECV_INIT                                        !1      'UTF-8'
   52     2        ASSIGN_OBJ                                               'debug'
          3        OP_DATA                                                  !0
   53     4        ASSIGN_OBJ                                               'charset'
          5        OP_DATA                                                  !1
   54     6      > RETURN                                                   null

End of function __construct

Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Pvtj
function name:  register
number of ops:  12
compiled vars:  !0 = $debug, !1 = $handler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV_INIT                                        !0      <true>
   65     1        NEW                          static              $2      
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   67     5        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cset_exception_handler'
          6        INIT_ARRAY                                       ~5      !1
          7        ADD_ARRAY_ELEMENT                                ~5      'handle'
          8        SEND_VAL_EX                                              ~5
          9        DO_FCALL                                      0          
   69    10      > RETURN                                                   !1
   70    11*     > RETURN                                                   null

End of function register

Function sethandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/1Pvtj
function name:  setHandler
number of ops:  19
compiled vars:  !0 = $handler, !1 = $old
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   79     0  E >   RECV                                             !0      
   81     1        ISSET_ISEMPTY_CV                                 ~2      !0
          2      > JMPZ_EX                                          ~2      ~2, ->8
          3    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cis_callable'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
          6        BOOL_NOT                                         ~4      $3
          7        BOOL                                             ~2      ~4
          8    > > JMPZ                                                     ~2, ->13
   82     9    >   NEW                                              $5      'LogicException'
         10        SEND_VAL_EX                                              'The+exception+handler+must+be+a+valid+PHP+callable.'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $5
   84    13    >   FETCH_OBJ_R                                      ~7      'handler'
         14        ASSIGN                                                   !1, ~7
   85    15        ASSIGN_OBJ                                               'handler'
         16        OP_DATA                                                  !0
   87    17      > RETURN                                                   !1
   88    18*     > RETURN                                                   null

End of function sethandler

Function handle:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 53
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 72
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
Branch analysis from position: 72
Branch analysis from position: 53
Branch analysis from position: 39
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Found catch point at position: 33
Branch analysis from position: 33
2 jumps found. (Code = 107) Position 1 = 34, Position 2 = -2
Branch analysis from position: 34
Found catch point at position: 68
Branch analysis from position: 68
2 jumps found. (Code = 107) Position 1 = 69, Position 2 = -2
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 72
Branch analysis from position: 71
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 72
filename:       /in/1Pvtj
function name:  handle
number of ops:  73
compiled vars:  !0 = $exception, !1 = $caughtOutput, !2 = $response, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   RECV                                             !0      
  104     1        INSTANCEOF                                               !0, 'Symfony%5CComponent%5CDebug%5CException%5COutOfMemoryException'
          2      > JMPZ                                                     ~4, ->7
  105     3    >   INIT_METHOD_CALL                                         'sendPhpResponse'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
  107     6      > RETURN                                                   null
  115     7    >   ASSIGN                                                   !1, 0
  117     8        ASSIGN_OBJ                                               'caughtOutput'
          9        OP_DATA                                                  <false>
  118    10        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cob_start'
         11        FETCH_THIS                                       ~8      
         12        INIT_ARRAY                                       ~9      ~8
         13        ADD_ARRAY_ELEMENT                                ~9      'catchOutput'
         14        SEND_VAL_EX                                              ~9
         15        DO_FCALL                                      0          
  120    16        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cclass_exists'
         17        SEND_VAL_EX                                              'Symfony%5CComponent%5CHttpFoundation%5CResponse'
         18        DO_FCALL                                      0  $11     
         19      > JMPZ                                                     $11, ->29
  121    20    >   INIT_METHOD_CALL                                         'createResponse'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0  $12     
         23        ASSIGN                                                   !2, $12
  122    24        INIT_METHOD_CALL                                         !2, 'sendHeaders'
         25        DO_FCALL                                      0          
  123    26        INIT_METHOD_CALL                                         !2, 'sendContent'
         27        DO_FCALL                                      0          
         28      > JMP                                                      ->32
  125    29    >   INIT_METHOD_CALL                                         'sendPhpResponse'
         30        SEND_VAR_EX                                              !0
         31        DO_FCALL                                      0          
         32    > > JMP                                                      ->34
  127    33  E > > CATCH                                       last         'Exception'
  130    34    >   FETCH_OBJ_R                                      ~17     'caughtOutput'
         35        TYPE_CHECK                                    4          ~17
         36      > JMPZ                                                     ~18, ->39
  131    37    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cob_end_clean'
         38        DO_FCALL                                      0          
  133    39    >   FETCH_OBJ_IS                                     ~20     'caughtOutput'
         40        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, 0
         41      > JMPZ                                                     ~21, ->53
  134    42    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cob_start'
         43        FETCH_THIS                                       ~22     
         44        INIT_ARRAY                                       ~23     ~22
         45        ADD_ARRAY_ELEMENT                                ~23     'cleanOutput'
         46        SEND_VAL_EX                                              ~23
         47        DO_FCALL                                      0          
  135    48        FETCH_OBJ_R                                      ~25     'caughtOutput'
         49        ECHO                                                     ~25
  136    50        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cob_get_length'
         51        DO_FCALL                                      0  $26     
         52        ASSIGN                                                   !1, $26
  138    53    >   ASSIGN_OBJ                                               'caughtOutput'
         54        OP_DATA                                                  0
  140    55        ISSET_ISEMPTY_PROP_OBJ                           ~29     'handler'
         56        BOOL_NOT                                         ~30     ~29
         57      > JMPZ                                                     ~30, ->72
  142    58    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Ccall_user_func'
         59        CHECK_FUNC_ARG                                           
         60        FETCH_OBJ_FUNC_ARG                               $31     'handler'
         61        SEND_FUNC_ARG                                            $31
         62        SEND_VAR_EX                                              !0
         63        DO_FCALL                                      0          
  144    64      > JMPZ                                                     !1, ->67
  145    65    >   ASSIGN_OBJ                                               'caughtOutput'
         66        OP_DATA                                                  !1
         67    > > JMP                                                      ->72
  147    68  E > > CATCH                                       last         'Exception'
  148    69    >   BOOL_NOT                                         ~34     !1
         70      > JMPZ                                                     ~34, ->72
  150    71    > > THROW                                         0          !0
  154    72    > > RETURN                                                   null

End of function handle

Function sendphpresponse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Pvtj
function name:  sendPhpResponse
number of ops:  50
compiled vars:  !0 = $exception, !1 = $value, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  164     0  E >   RECV                                             !0      
  166     1        INIT_METHOD_CALL                                         !0, 'getMessage'
          2        DO_FCALL                                      0  $3      
          3        ECHO                                                     $3
  167     4      > RETURN                                                   null
  169     5*       INSTANCEOF                                       ~4      !0, 'Symfony%5CComponent%5CDebug%5CException%5CFlattenException'
          6*       BOOL_NOT                                         ~5      ~4
          7*       JMPZ                                                     ~5, ->12
  170     8*       INIT_STATIC_METHOD_CALL                                  'Symfony%5CComponent%5CDebug%5CException%5CFlattenException', 'create'
          9*       SEND_VAR_EX                                              !0
         10*       DO_FCALL                                      0  $6      
         11*       ASSIGN                                                   !0, $6
  173    12*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cheaders_sent'
         13*       DO_FCALL                                      0  $8      
         14*       BOOL_NOT                                         ~9      $8
         15*       JMPZ                                                     ~9, ->38
  174    16*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cheader'
         17*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Csprintf'
         18*       SEND_VAL_EX                                              'HTTP%2F1.0+%25s'
         19*       INIT_METHOD_CALL                                         !0, 'getStatusCode'
         20*       DO_FCALL                                      0  $10     
         21*       SEND_VAR_NO_REF_EX                                       $10
         22*       DO_FCALL                                      0  $11     
         23*       SEND_VAR_NO_REF_EX                                       $11
         24*       DO_FCALL                                      0          
  175    25*       INIT_METHOD_CALL                                         !0, 'getHeaders'
         26*       DO_FCALL                                      0  $13     
         27*       FE_RESET_R                                       $14     $13, ->37
         28*       FE_FETCH_R                                       ~15     $14, !1, ->37
         29*       ASSIGN                                                   !2, ~15
  176    30*       INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cheader'
         31*       CONCAT                                           ~17     !2, '%3A+'
         32*       CONCAT                                           ~18     ~17, !1
         33*       SEND_VAL_EX                                              ~18
         34*       SEND_VAL_EX                                              <false>
         35*       DO_FCALL                                      0          
  175    36*       JMP                                                      ->28
         37*       FE_FREE                                                  $14
  180    38*       INIT_METHOD_CALL                                         'decorate'
         39*       INIT_METHOD_CALL                                         'getContent'
         40*       SEND_VAR_EX                                              !0
         41*       DO_FCALL                                      0  $20     
         42*       SEND_VAR_NO_REF_EX                                       $20
         43*       INIT_METHOD_CALL                                         'getStylesheet'
         44*       SEND_VAR_EX                                              !0
         45*       DO_FCALL                                      0  $21     
         46*       SEND_VAR_NO_REF_EX                                       $21
         47*       DO_FCALL                                      0  $22     
         48*       ECHO                                                     $22
  181    49*     > RETURN                                                   null

End of function sendphpresponse

Function createresponse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/1Pvtj
function name:  createResponse
number of ops:  29
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  190     0  E >   RECV                                             !0      
  192     1        INSTANCEOF                                       ~1      !0, 'Symfony%5CComponent%5CDebug%5CException%5CFlattenException'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
  193     4    >   INIT_STATIC_METHOD_CALL                                  'Symfony%5CComponent%5CDebug%5CException%5CFlattenException', 'create'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $3      
          7        ASSIGN                                                   !0, $3
  196     8    >   NEW                                              $5      'Symfony%5CComponent%5CHttpFoundation%5CResponse'
          9        INIT_METHOD_CALL                                         'decorate'
         10        INIT_METHOD_CALL                                         'getContent'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR_NO_REF_EX                                       $6
         14        INIT_METHOD_CALL                                         'getStylesheet'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR_NO_REF_EX                                       $7
         18        DO_FCALL                                      0  $8      
         19        SEND_VAR_NO_REF_EX                                       $8
         20        INIT_METHOD_CALL                                         !0, 'getStatusCode'
         21        DO_FCALL                                      0  $9      
         22        SEND_VAR_NO_REF_EX                                       $9
         23        INIT_METHOD_CALL                                         !0, 'getHeaders'
         24        DO_FCALL                                      0  $10     
         25        SEND_VAR_NO_REF_EX                                       $10
         26        DO_FCALL                                      0          
         27      > RETURN                                                   $5
  197    28*     > RETURN                                                   null

End of function createresponse

Function getcontent:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 142
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 124
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 124
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 51, Position 2 = 121
Branch analysis from position: 51
2 jumps found. (Code = 78) Position 1 = 52, Position 2 = 121
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 77
Branch analysis from position: 55
2 jumps found. (Code = 46) Position 1 = 79, Position 2 = 81
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 119
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 109
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 119
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 109
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 119
Branch analysis from position: 81
Branch analysis from position: 77
Branch analysis from position: 121
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 121
Branch analysis from position: 124
1 jumps found. (Code = 42) Position 1 = 142
Branch analysis from position: 142
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 124
Branch analysis from position: 142
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Found catch point at position: 126
Branch analysis from position: 126
2 jumps found. (Code = 107) Position 1 = 127, Position 2 = -2
Branch analysis from position: 127
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 141
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 142
Branch analysis from position: 142
Branch analysis from position: 141
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Pvtj
function name:  getContent
number of ops:  149
compiled vars:  !0 = $exception, !1 = $title, !2 = $content, !3 = $count, !4 = $total, !5 = $e, !6 = $position, !7 = $ind, !8 = $class, !9 = $message, !10 = $trace, !11 = $linkFormat, !12 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  206     0  E >   RECV                                             !0      
  208     1        INIT_METHOD_CALL                                         !0, 'getStatusCode'
          2        DO_FCALL                                      0  $13     
  209     3        CASE                                                     $13, 404
          4      > JMPNZ                                                    ~14, ->6
          5    > > JMP                                                      ->8
  210     6    >   ASSIGN                                                   !1, 'Sorry%2C+the+page+you+are+looking+for+could+not+be+found.'
  211     7      > JMP                                                      ->9
  213     8    >   ASSIGN                                                   !1, 'Whoops%2C+looks+like+something+went+wrong.'
          9    >   FREE                                                     $13
  216    10        ASSIGN                                                   !2, ''
  217    11        FETCH_OBJ_R                                      ~18     'debug'
         12      > JMPZ                                                     ~18, ->142
  219    13    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Ccount'
         14        INIT_METHOD_CALL                                         !0, 'getAllPrevious'
         15        DO_FCALL                                      0  $19     
         16        SEND_VAR_NO_REF_EX                                       $19
         17        DO_FCALL                                      0  $20     
         18        ASSIGN                                                   !3, $20
  220    19        ADD                                              ~22     !3, 1
         20        ASSIGN                                                   !4, ~22
  221    21        INIT_METHOD_CALL                                         !0, 'toArray'
         22        DO_FCALL                                      0  $24     
         23      > FE_RESET_R                                       $25     $24, ->124
         24    > > FE_FETCH_R                                       ~26     $25, !5, ->124
         25    >   ASSIGN                                                   !6, ~26
  222    26        SUB                                              ~28     !3, !6
         27        ADD                                              ~29     ~28, 1
         28        ASSIGN                                                   !7, ~29
  223    29        INIT_METHOD_CALL                                         'abbrClass'
         30        CHECK_FUNC_ARG                                           
         31        FETCH_DIM_FUNC_ARG                               $31     !5, 'class'
         32        SEND_FUNC_ARG                                            $31
         33        DO_FCALL                                      0  $32     
         34        ASSIGN                                                   !8, $32
  224    35        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Cnl2br'
         36        CHECK_FUNC_ARG                                           
         37        FETCH_DIM_FUNC_ARG                               $34     !5, 'message'
         38        SEND_FUNC_ARG                                            $34
         39        DO_FCALL                                      0  $35     
         40        ASSIGN                                                   !9, $35
  225    41        INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Csprintf'
  226    42        SEND_VAL_EX                                              '++++++++++++++++++++++++%3Cdiv+class%3D%22block_exception+clear_fix%22%3E%0A++++++++++++++++++++++++++++%3Ch2%3E%3Cspan%3E%25d%2F%25d%3C%2Fspan%3E+%25s%3A+%25s%3C%2Fh2%3E%0A++++++++++++++++++++++++%3C%2Fdiv%3E%0A++++++++++++++++++++++++%3Cdiv+class%3D%22block%22%3E%0A++++++++++++++++++++++++++++%3Col+class%3D%22traces+list_exception%22%3E%0A'
         43        SEND_VAR_EX                                              !7
         44        SEND_VAR_EX                                              !4
         45        SEND_VAR_EX                                              !8
         46        SEND_VAR_EX                                              !9
         47        DO_FCALL                                      0  $37     
         48        ASSIGN_OP                                     8          !2, $37
  234    49        FETCH_DIM_R                                      ~39     !5, 'trace'
         50      > FE_RESET_R                                       $40     ~39, ->121
         51    > > FE_FETCH_R                                               $40, !10, ->121
  235    52    >   ASSIGN_OP                                     8          !2, '+++++++%3Cli%3E'
  236    53        FETCH_DIM_R                                      ~42     !10, 'function'
         54      > JMPZ                                                     ~42, ->77
  237    55    >   INIT_NS_FCALL_BY_NAME                                    'Symfony%5CComponent%5CDebug%5Csprintf'
         56        SEND_VAL_EX                                              'at+%25s%25s%25s%28%25s%29'
         57        INIT_METHOD_CALL                                         'abbrClass'
         58        CHECK_FUNC_ARG                                           
         59        FETCH_DIM_FUNC_ARG                               $43     !10, 'class'
         60        SEND_FUNC_ARG                                            $43
         61        DO_FCALL                                      0  $44     
         62        SEND_VAR_NO_REF_EX                                       $44
         63        CHECK_FUNC_ARG                                           
         64        FETCH_DIM_FUNC_ARG                               $45     !10, 'type'
         65        SEND_FUNC_ARG                                            $45
         66        CHECK_FUNC_ARG                                           
         67        FETCH_DIM_FUNC_ARG                               $46     !10, 'function'
         68        SEND_FUNC_ARG                                            $46
         69        INIT_METHOD_CALL                                         'formatArgs'
         70        CHECK_FUNC_ARG                                           
         71        FETCH_DIM_FUNC_ARG                               $47     !10, 'args'
         72        SEND_FUNC_ARG                                            $47
         73        DO_FCALL                                      0  $48     
         74        SEND_VAR_NO_REF_EX                                       $48
         75        DO_FCALL                                      0  $49     
         76        ASSIGN_OP                                     8          !2, $49

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.98 ms | 1428 KiB | 41 Q