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('data')); } } try { throw new UberException(); } catch (Exception $e) { var_dump($e->getTrace()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JG4
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'UberException'
          1        DO_FCALL                                      0          
          2      > THROW                                         0          $1
          3*       JMP                                                      ->10
   16     4  E > > CATCH                                       last         'Exception'
   17     5    >   INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getTrace'
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   18    10      > RETURN                                                   1

Class UberException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JG4
function name:  __construct
number of ops:  14
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
         11        SEND_VAL_EX                                              <array>
         12        DO_FCALL                                      0          
   10    13      > RETURN                                                   null

End of function __construct

End of class UberException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.07 ms | 1396 KiB | 15 Q