3v4l.org

run code in 300+ 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 = 12
Branch analysis from position: 12
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/sSSJQ
function name:  (null)
number of ops:  13
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        INIT_FCALL                                               'class_exists'
          5        SEND_VAL                                                 'Foo'
          6        DO_ICALL                                                 
          7      > JMP                                                      ->12
   15     8  E > > CATCH                                       last         'RuntimeException'
   16     9    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         10        DO_FCALL                                      0  $4      
         11        ECHO                                                     $4
   17    12    > > 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}
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.0.0


preferences:
137.94 ms | 1000 KiB | 15 Q