3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass {} class OtherClass {} class SubClass extends MyClass {} $reflector = new ReflectionClass(MyClass::class); foreach( [ '$reflector->newLazyGhost(static fn() => null)', '$reflector->newLazyProxy(static fn() => null)', '$reflector->resetAsLazyGhost($m, static fn() => null)', '$reflector->resetAsLazyGhost($s, static fn() => null)', '$reflector->resetAsLazyGhost($o, static fn() => null)', '$reflector->resetAsLazyProxy($m, static fn() => null)', '$reflector->resetAsLazyProxy($s, static fn() => null)', '$reflector->resetAsLazyProxy($o, static fn() => null)', '$reflector->initializeLazyObject($o)', '$reflector->initializeLazyObject($o)', '$reflector->initializeLazyObject($o)', '$reflector->markLazyObjectAsInitialized($o)', '$reflector->markLazyObjectAsInitialized($o)', '$reflector->markLazyObjectAsInitialized($o)', '$reflector->getLazyInitializer($o)', '$reflector->getLazyInitializer($o)', '$reflector->getLazyInitializer($o)', '$reflector->isUninitializedLazyObject($o)', '$reflector->isUninitializedLazyObject($o)', '$reflector->isUninitializedLazyObject($o)', ] as $code ) { echo $code; try { $m = new MyClass(); $s = new SubClass(); $o = new OtherClass(); echo "\n RET: ". get_debug_type(eval("return $code;")); } catch(Throwable $e) { echo "\n ERR: ". get_class($e) . ': ' . $e->getMessage(); } echo "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 36
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 36
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Found catch point at position: 26
Branch analysis from position: 26
2 jumps found. (Code = 107) Position 1 = 27, Position 2 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
filename:       /in/S0Oon
function name:  (null)
number of ops:  38
compiled vars:  !0 = $reflector, !1 = $code, !2 = $m, !3 = $s, !4 = $o, !5 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $6      'ReflectionClass'
          1        SEND_VAL_EX                                                  'MyClass'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $6
   11     4      > FE_RESET_R                                           $9      <array>, ->36
          5    > > FE_FETCH_R                                                   $9, !1, ->36
   33     6    >   ECHO                                                         !1
   35     7        NEW                                                  $10     'MyClass'
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !2, $10
   36    10        NEW                                                  $13     'SubClass'
         11        DO_FCALL                                          0          
         12        ASSIGN                                                       !3, $13
   37    13        NEW                                                  $16     'OtherClass'
         14        DO_FCALL                                          0          
         15        ASSIGN                                                       !4, $16
   38    16        INIT_FCALL                                                   'get_debug_type'
         17        ROPE_INIT                                         3  ~20     'return+'
         18        ROPE_ADD                                          1  ~20     ~20, !1
         19        ROPE_END                                          2  ~19     ~20, '%3B'
         20        INCLUDE_OR_EVAL                                      $22     ~19, EVAL
         21        SEND_VAR                                                     $22
         22        DO_ICALL                                             $23     
         23        CONCAT                                               ~24     '%0A++RET%3A+', $23
         24        ECHO                                                         ~24
         25      > JMP                                                          ->34
   39    26  E > > CATCH                                           last         'Throwable'
   40    27    >   GET_CLASS                                            ~25     !5
         28        CONCAT                                               ~26     '%0A++ERR%3A+', ~25
         29        CONCAT                                               ~27     ~26, '%3A+'
         30        INIT_METHOD_CALL                                             !5, 'getMessage'
         31        DO_FCALL                                          0  $28     
         32        CONCAT                                               ~29     ~27, $28
         33        ECHO                                                         ~29
   42    34    >   ECHO                                                         '%0A%0A'
   11    35      > JMP                                                          ->5
         36    >   FE_FREE                                                      $9
   43    37      > RETURN                                                       1

Class MyClass: [no user functions]
Class OtherClass: [no user functions]
Class SubClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.62 ms | 1214 KiB | 14 Q