3v4l.org

run code in 300+ PHP versions simultaneously
<?php class cls { public static function meth(int $a, string $b) : void { throw new Exception; } public function meth2(int $a, string $b): void { throw new Exception; } } try { cls::meth(1,'hello'); }catch (\Throwable $t) { var_export($t->getTrace()); echo "\n"; } try { (new cls)->meth2(1,'hello'); }catch (\Throwable $t) { var_export($t->getTrace()); echo "\n"; } function func() { throw new Exception; } try { func(); }catch (\Throwable $t) { var_export($t->getTrace()); echo "\n"; } try{ (function() { throw new Exception;})(); } catch (\Throwable $t) { var_export($t->getTrace()); echo "\n"; } try { throw new Exception; } catch (\Throwable $t) { var_export($t->getTrace()); echo "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Found catch point at position: 29
Branch analysis from position: 29
2 jumps found. (Code = 107) Position 1 = 30, Position 2 = -2
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Found catch point at position: 40
Branch analysis from position: 40
2 jumps found. (Code = 107) Position 1 = 41, Position 2 = -2
Branch analysis from position: 41
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 51
Branch analysis from position: 51
2 jumps found. (Code = 107) Position 1 = 52, Position 2 = -2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iQoni
function name:  (null)
number of ops:  59
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'cls', 'meth'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 'hello'
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->12
   18     5  E > > CATCH                                       last         'Throwable'
   19     6    >   INIT_FCALL                                               'var_export'
          7        INIT_METHOD_CALL                                         !0, 'getTrace'
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
   20    11        ECHO                                                     '%0A'
   24    12    >   NEW                                              $4      'cls'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $4, 'meth2'
         15        SEND_VAL_EX                                              1
         16        SEND_VAL_EX                                              'hello'
         17        DO_FCALL                                      0          
         18      > JMP                                                      ->26
   25    19  E > > CATCH                                       last         'Throwable'
   26    20    >   INIT_FCALL                                               'var_export'
         21        INIT_METHOD_CALL                                         !0, 'getTrace'
         22        DO_FCALL                                      0  $7      
         23        SEND_VAR                                                 $7
         24        DO_ICALL                                                 
   27    25        ECHO                                                     '%0A'
   35    26    >   INIT_FCALL                                               'func'
         27        DO_FCALL                                      0          
         28      > JMP                                                      ->36
   36    29  E > > CATCH                                       last         'Throwable'
   37    30    >   INIT_FCALL                                               'var_export'
         31        INIT_METHOD_CALL                                         !0, 'getTrace'
         32        DO_FCALL                                      0  $10     
         33        SEND_VAR                                                 $10
         34        DO_ICALL                                                 
   38    35        ECHO                                                     '%0A'
   42    36    >   DECLARE_LAMBDA_FUNCTION                          ~12     [0]
         37        INIT_DYNAMIC_CALL                                        ~12
         38        DO_FCALL                                      0          
         39      > JMP                                                      ->47
   44    40  E > > CATCH                                       last         'Throwable'
   45    41    >   INIT_FCALL                                               'var_export'
         42        INIT_METHOD_CALL                                         !0, 'getTrace'
         43        DO_FCALL                                      0  $14     
         44        SEND_VAR                                                 $14
         45        DO_ICALL                                                 
   46    46        ECHO                                                     '%0A'
   50    47    >   NEW                                              $16     'Exception'
         48        DO_FCALL                                      0          
         49      > THROW                                         0          $16
         50*       JMP                                                      ->58
   52    51  E > > CATCH                                       last         'Throwable'
   53    52    >   INIT_FCALL                                               'var_export'
         53        INIT_METHOD_CALL                                         !0, 'getTrace'
         54        DO_FCALL                                      0  $18     
         55        SEND_VAR                                                 $18
         56        DO_ICALL                                                 
   54    57        ECHO                                                     '%0A'
   55    58      > RETURN                                                   1


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

End of Dynamic Function 0

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

End of function func

Class cls:
Function meth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/iQoni
function name:  meth
number of ops:  6
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        NEW                                              $2      'Exception'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $2
    8     5*     > RETURN                                                   null

End of function meth

Function meth2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/iQoni
function name:  meth2
number of ops:  6
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        NEW                                              $2      'Exception'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $2
   13     5*     > RETURN                                                   null

End of function meth2

End of class cls.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.32 ms | 1456 KiB | 15 Q