3v4l.org

run code in 500+ PHP versions simultaneously
<?php // example 1: PHP Predefined Interface $refClass = new ReflectionClass('Throwable'); $parentRef = $refClass->getParentClass(); echo $parentRef ? $parentRef->getName() : 'false'; echo "\n"; var_dump($refClass->getInterfaceNames()); // example 2 : userland interface interface Foo extends Bar { } interface Bar { } $refClass = new ReflectionClass('Foo'); $parentRef = $refClass->getParentClass(); echo $parentRef ? $parentRef->getName() : 'false'; echo "\n"; var_dump($refClass->getInterfaceNames());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
Branch analysis from position: 33
filename:       /in/Hio9E
function name:  (null)
number of ops:  42
compiled vars:  !0 = $refClass, !1 = $parentRef
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   NEW                                                  $2      'ReflectionClass'
          1        SEND_VAL_EX                                                  'Throwable'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
    6     4        INIT_METHOD_CALL                                             !0, 'getParentClass'
          5        DO_FCALL                                          0  $5      
          6        ASSIGN                                                       !1, $5
    7     7      > JMPZ                                                         !1, ->12
    8     8    >   INIT_METHOD_CALL                                             !1, 'getName'
          9        DO_FCALL                                          0  $7      
         10        QM_ASSIGN                                            ~8      $7
         11      > JMP                                                          ->13
    9    12    >   QM_ASSIGN                                            ~8      'false'
         13    >   ECHO                                                         ~8
   10    14        ECHO                                                         '%0A'
   11    15        INIT_FCALL                                                   'var_dump'
         16        INIT_METHOD_CALL                                             !0, 'getInterfaceNames'
         17        DO_FCALL                                          0  $9      
         18        SEND_VAR                                                     $9
         19        DO_ICALL                                                     
   15    20        DECLARE_CLASS                                                'foo'
   23    21        NEW                                                  $11     'ReflectionClass'
         22        SEND_VAL_EX                                                  'Foo'
         23        DO_FCALL                                          0          
         24        ASSIGN                                                       !0, $11
   24    25        INIT_METHOD_CALL                                             !0, 'getParentClass'
         26        DO_FCALL                                          0  $14     
         27        ASSIGN                                                       !1, $14
   25    28      > JMPZ                                                         !1, ->33
   26    29    >   INIT_METHOD_CALL                                             !1, 'getName'
         30        DO_FCALL                                          0  $16     
         31        QM_ASSIGN                                            ~17     $16
         32      > JMP                                                          ->34
   27    33    >   QM_ASSIGN                                            ~17     'false'
         34    >   ECHO                                                         ~17
   28    35        ECHO                                                         '%0A'
   29    36        INIT_FCALL                                                   'var_dump'
         37        INIT_METHOD_CALL                                             !0, 'getInterfaceNames'
         38        DO_FCALL                                          0  $18     
         39        SEND_VAR                                                     $18
         40        DO_ICALL                                                     
         41      > RETURN                                                       1

Class Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.48 ms | 484 KiB | 8 Q