3v4l.org

run code in 500+ PHP versions simultaneously
<?php spl_autoload_register(function($class) { throw new Exception("Could not load $class"); }); spl_autoload_register(function($class) { if ($class == "Widget") { eval('class Widget { }'); } }); spl_autoload_register(function($class) { throw new Exception("Still could not load $class"); }); try { new Foo(); } catch (Exception $e) { for ($i = 1; $e; $e = $e->getPrevious()) printf("#%d Foo: %s\n", $i++, $e->getMessage()); } finally { var_dump(class_exists("Foo", false)); } try { new Widget(); } catch (Exception $e) { for ($i = 1; $e; $e = $e->getPrevious()) printf("#%d Foo: %s\n", $i++, $e->getMessage()); } finally { var_dump(class_exists("Widget", false)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 162) Position 1 = 33, Position 2 = 32
Branch analysis from position: 33
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 162) Position 1 = 59, Position 2 = 58
Branch analysis from position: 59
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 16
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 19
Branch analysis from position: 31
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 19
Branch analysis from position: 31
Branch analysis from position: 19
Found catch point at position: 42
Branch analysis from position: 42
2 jumps found. (Code = 107) Position 1 = 43, Position 2 = -2
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 45
Branch analysis from position: 57
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 45
Branch analysis from position: 57
Branch analysis from position: 45
filename:       /in/IlUiA
function name:  (null)
number of ops:  65
compiled vars:  !0 = $e, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
    5     2        SEND_VAL                                                     ~2
    3     3        DO_ICALL                                                     
    6     4        INIT_FCALL                                                   'spl_autoload_register'
          5        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
   10     6        SEND_VAL                                                     ~4
    6     7        DO_ICALL                                                     
   11     8        INIT_FCALL                                                   'spl_autoload_register'
          9        DECLARE_LAMBDA_FUNCTION                              ~6      [2]
   13    10        SEND_VAL                                                     ~6
   11    11        DO_ICALL                                                     
   16    12        NEW                                                  $9      'Foo'
         13        DO_FCALL                                          0          
         14        FREE                                                         $9
         15      > JMP                                                          ->31
   17    16  E > > CATCH                                           last         'Exception'
   18    17    >   ASSIGN                                                       !1, 1
         18      > JMP                                                          ->30
         19    >   INIT_FCALL                                                   'printf'
         20        SEND_VAL                                                     '%23%25d+Foo%3A+%25s%0A'
         21        POST_INC                                             ~12     !1
         22        SEND_VAL                                                     ~12
         23        INIT_METHOD_CALL                                             !0, 'getMessage'
         24        DO_FCALL                                          0  $13     
         25        SEND_VAR                                                     $13
         26        DO_ICALL                                                     
         27        INIT_METHOD_CALL                                             !0, 'getPrevious'
         28        DO_FCALL                                          0  $15     
         29        ASSIGN                                                       !0, $15
         30    > > JMPNZ                                                        !0, ->19
   19    31    > > FAST_CALL                                                    ->33
         32    > > JMP                                                          ->38
   20    33    >   INIT_FCALL                                                   'var_dump'
         34        FRAMELESS_ICALL_2                class_exists        ~17     'Foo', <false>
         35        SEND_VAL                                                     ~17
         36        DO_ICALL                                                     
         37      > FAST_RET                                                     
   24    38    >   NEW                                                  $20     'Widget'
         39        DO_FCALL                                          0          
         40        FREE                                                         $20
         41      > JMP                                                          ->57
   25    42  E > > CATCH                                           last         'Exception'
   26    43    >   ASSIGN                                                       !1, 1
         44      > JMP                                                          ->56
         45    >   INIT_FCALL                                                   'printf'
         46        SEND_VAL                                                     '%23%25d+Foo%3A+%25s%0A'
         47        POST_INC                                             ~23     !1
         48        SEND_VAL                                                     ~23
         49        INIT_METHOD_CALL                                             !0, 'getMessage'
         50        DO_FCALL                                          0  $24     
         51        SEND_VAR                                                     $24
         52        DO_ICALL                                                     
         53        INIT_METHOD_CALL                                             !0, 'getPrevious'
         54        DO_FCALL                                          0  $26     
         55        ASSIGN                                                       !0, $26
         56    > > JMPNZ                                                        !0, ->45
   27    57    > > FAST_CALL                                                    ->59
         58    > > JMP                                                          ->64
   28    59    >   INIT_FCALL                                                   'var_dump'
         60        FRAMELESS_ICALL_2                class_exists        ~28     'Widget', <false>
         61        SEND_VAL                                                     ~28
         62        DO_ICALL                                                     
         63      > FAST_RET                                                     
   29    64    > > 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/IlUiA
function name:  {closure:/in/IlUiA:3}
number of ops:  8
compiled vars:  !0 = $class
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        NEW                                                  $1      'Exception'
          2        NOP                                                          
          3        FAST_CONCAT                                          ~2      'Could+not+load+', !0
          4        SEND_VAL_EX                                                  ~2
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $1
    5     7*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/IlUiA
function name:  {closure:/in/IlUiA:6}
number of ops:  5
compiled vars:  !0 = $class
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        IS_EQUAL                                                     !0, 'Widget'
          2      > JMPZ                                                         ~1, ->4
    8     3    >   INCLUDE_OR_EVAL                                              'class+Widget+%7B+%7D', EVAL
   10     4    > > RETURN                                                       null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/IlUiA
function name:  {closure:/in/IlUiA:11}
number of ops:  8
compiled vars:  !0 = $class
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   12     1        NEW                                                  $1      'Exception'
          2        NOP                                                          
          3        FAST_CONCAT                                          ~2      'Still+could+not+load+', !0
          4        SEND_VAL_EX                                                  ~2
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $1
   13     7*     > RETURN                                                       null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.65 ms | 2198 KiB | 16 Q