3v4l.org

run code in 500+ PHP versions simultaneously
<?php spl_autoload_register(function ($class) { echo 'Class: '.$class."\n"; if ($class === 'Foo') { class Foo implements Bar {} } throw new RuntimeException('Class not found'); }); try { class_exists('Foo'); } catch (RuntimeException $e) { echo $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sSSJQ
function name:  (null)
number of ops:  12
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
   11     2        SEND_VAL                                                     ~1
    3     3        DO_ICALL                                                     
   14     4        FRAMELESS_ICALL_1                class_exists        ~3      'Foo'
          5        FREE                                                         ~3
          6      > JMP                                                          ->11
   15     7  E > > CATCH                                           last         'RuntimeException'
   16     8    >   INIT_METHOD_CALL                                             !0, 'getMessage'
          9        DO_FCALL                                          0  $4      
         10        ECHO                                                         $4
   17    11    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
filename:       /in/sSSJQ
function name:  {closure:/in/sSSJQ:3}
number of ops:  12
compiled vars:  !0 = $class
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        CONCAT                                               ~1      'Class%3A+', !0
          2        CONCAT                                               ~2      ~1, '%0A'
          3        ECHO                                                         ~2
    6     4        IS_IDENTICAL                                                 !0, 'Foo'
          5      > JMPZ                                                         ~3, ->7
    7     6    >   DECLARE_CLASS                                                'foo'
   10     7    >   NEW                                                  $4      'RuntimeException'
          8        SEND_VAL_EX                                                  'Class+not+found'
          9        DO_FCALL                                          0          
         10      > THROW                                             0          $4
   11    11*     > RETURN                                                       null

End of Dynamic Function 0

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
147.09 ms | 2759 KiB | 9 Q