3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UberException extends Exception { public function __construct() { $refTrace = new ReflectionProperty('Exception', 'trace'); $refTrace->setAccessible(true); $refTrace->setValue($this, array( array('file' => 'data.php', 'class' => 'Uber', 'line' => 20, 'function' => 'super', 'args' => array()), array('file' => 'data.php', 'class' => 'Uber', 'line' => 20, 'function' => 'super', 'args' => array()) )); $this->file = 'test.php'; $this->line = 5; } } function test() { throw new UberException(); } try { test(); } catch (Exception $e) { var_dump($e->getTrace()); throw $e; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/4eVil
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->10
   25     3  E > > CATCH                                       last         'Exception'
   26     4    >   INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getTrace'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   27     9      > THROW                                         0          !0
   28    10    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/4eVil
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'UberException'
          1        DO_FCALL                                      0          
          2      > THROW                                         0          $0
   21     3*     > RETURN                                                   null

End of function test

Class UberException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4eVil
function name:  __construct
number of ops:  18
compiled vars:  !0 = $refTrace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'ReflectionProperty'
          1        SEND_VAL_EX                                              'Exception'
          2        SEND_VAL_EX                                              'trace'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
    8     5        INIT_METHOD_CALL                                         !0, 'setAccessible'
          6        SEND_VAL_EX                                              <true>
          7        DO_FCALL                                      0          
    9     8        INIT_METHOD_CALL                                         !0, 'setValue'
          9        FETCH_THIS                                       $5      
         10        SEND_VAR_EX                                              $5
   10    11        SEND_VAL_EX                                              <array>
         12        DO_FCALL                                      0          
   14    13        ASSIGN_OBJ                                               'file'
         14        OP_DATA                                                  'test.php'
   15    15        ASSIGN_OBJ                                               'line'
         16        OP_DATA                                                  5
   16    17      > RETURN                                                   null

End of function __construct

End of class UberException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.84 ms | 1403 KiB | 16 Q