3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends \ArrayIterator { } $fooReflection = new \ReflectionClass(\Foo::class); $recursiveArrayIteratorReflection = new \ReflectionClass(\RecursiveArrayIterator::class); printf("%d constants in %s, ", count($fooReflection->getConstants()), \Foo::class); if ($fooReflection->getParentClass()) { printf("%s extends %s\n", Foo::class, $fooReflection->getParentClass()->getName()); } printf("%d constants in %s, ", count($recursiveArrayIteratorReflection->getConstants()), \RecursiveArrayIterator::class); if ($recursiveArrayIteratorReflection->getParentClass()) { printf("%s extends %s\n", \RecursiveArrayIterator::class, $recursiveArrayIteratorReflection->getParentClass()->getName()); } printf("%d constants in %s\n", count((new \ReflectionClass(\ArrayIterator::class))->getConstants()), \ArrayIterator::class);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 48
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
Branch analysis from position: 28
filename:       /in/7fVc4
function name:  (null)
number of ops:  60
compiled vars:  !0 = $fooReflection, !1 = $recursiveArrayIteratorReflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    9     4        NEW                                              $5      'ReflectionClass'
          5        SEND_VAL_EX                                              'RecursiveArrayIterator'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   11     8        INIT_FCALL                                               'printf'
          9        SEND_VAL                                                 '%25d+constants+in+%25s%2C+'
         10        INIT_METHOD_CALL                                         !0, 'getConstants'
         11        DO_FCALL                                      0  $8      
         12        COUNT                                            ~9      $8
         13        SEND_VAL                                                 ~9
         14        SEND_VAL                                                 'Foo'
         15        DO_ICALL                                                 
   12    16        INIT_METHOD_CALL                                         !0, 'getParentClass'
         17        DO_FCALL                                      0  $11     
         18      > JMPZ                                                     $11, ->28
   13    19    >   INIT_FCALL                                               'printf'
         20        SEND_VAL                                                 '%25s+extends+%25s%0A'
         21        SEND_VAL                                                 'Foo'
         22        INIT_METHOD_CALL                                         !0, 'getParentClass'
         23        DO_FCALL                                      0  $12     
         24        INIT_METHOD_CALL                                         $12, 'getName'
         25        DO_FCALL                                      0  $13     
         26        SEND_VAR                                                 $13
         27        DO_ICALL                                                 
   15    28    >   INIT_FCALL                                               'printf'
         29        SEND_VAL                                                 '%25d+constants+in+%25s%2C+'
         30        INIT_METHOD_CALL                                         !1, 'getConstants'
         31        DO_FCALL                                      0  $15     
         32        COUNT                                            ~16     $15
         33        SEND_VAL                                                 ~16
         34        SEND_VAL                                                 'RecursiveArrayIterator'
         35        DO_ICALL                                                 
   16    36        INIT_METHOD_CALL                                         !1, 'getParentClass'
         37        DO_FCALL                                      0  $18     
         38      > JMPZ                                                     $18, ->48
   17    39    >   INIT_FCALL                                               'printf'
         40        SEND_VAL                                                 '%25s+extends+%25s%0A'
         41        SEND_VAL                                                 'RecursiveArrayIterator'
         42        INIT_METHOD_CALL                                         !1, 'getParentClass'
         43        DO_FCALL                                      0  $19     
         44        INIT_METHOD_CALL                                         $19, 'getName'
         45        DO_FCALL                                      0  $20     
         46        SEND_VAR                                                 $20
         47        DO_ICALL                                                 
   19    48    >   INIT_FCALL                                               'printf'
         49        SEND_VAL                                                 '%25d+constants+in+%25s%0A'
         50        NEW                                              $22     'ReflectionClass'
         51        SEND_VAL_EX                                              'ArrayIterator'
         52        DO_FCALL                                      0          
         53        INIT_METHOD_CALL                                         $22, 'getConstants'
         54        DO_FCALL                                      0  $24     
         55        COUNT                                            ~25     $24
         56        SEND_VAL                                                 ~25
         57        SEND_VAL                                                 'ArrayIterator'
         58        DO_ICALL                                                 
         59      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.7 ms | 1400 KiB | 15 Q