3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function ($class) { if ('foo' === $class) { class foo implements foointerface {} } elseif ('foointerface' === $class) { throw new \Exception('boo'); } }); try { class_exists('foo'); } catch (\Exception $e) { var_dump($e->getMessage()); } $a = new foo(); var_dump($a); var_dump($a instanceof foointerface);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1pHqv
function name:  (null)
number of ops:  25
compiled vars:  !0 = $e, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1pHqv%3A3%240'
    9     2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   12     4        INIT_FCALL                                               'class_exists'
          5        SEND_VAL                                                 'foo'
          6        DO_ICALL                                                 
          7      > JMP                                                      ->14
   13     8  E > > CATCH                                       last         'Exception'
   14     9    >   INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'getMessage'
         11        DO_FCALL                                      0  $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
   17    14    >   NEW                                              $7      'foo'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !1, $7
   19    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   21    20        INIT_FCALL                                               'var_dump'
         21        INSTANCEOF                                       ~11     !1, 'foointerface'
         22        SEND_VAL                                                 ~11
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1pHqv%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
filename:       /in/1pHqv
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_IDENTICAL                                             !0, 'foo'
          2      > JMPZ                                                     ~1, ->5
    5     3    >   DECLARE_CLASS                                            'foo'
          4      > JMP                                                      ->11
    6     5    >   IS_IDENTICAL                                             !0, 'foointerface'
          6      > JMPZ                                                     ~2, ->11
    7     7    >   NEW                                              $3      'Exception'
          8        SEND_VAL_EX                                              'boo'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $3
    9    11    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1pHqv%3A3%240

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.25 ms | 1400 KiB | 19 Q