3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ((new ReflectionClass('\DateTime'))->getMethods() as $method) { if ($method->getName() == 'modify') { $returnType = $method->getTentativeReturnType(); if ($returnType instanceof ReflectionUnionType) { foreach ($returnType->getTypes() as $type) { var_dump($type->getName()); } } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 28
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 26
Branch analysis from position: 27
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/IZXbp
function name:  (null)
number of ops:  30
compiled vars:  !0 = $method, !1 = $returnType, !2 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              '%5CDateTime'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $3, 'getMethods'
          4        DO_FCALL                                      0  $5      
          5      > FE_RESET_R                                       $6      $5, ->28
          6    > > FE_FETCH_R                                               $6, !0, ->28
    5     7    >   INIT_METHOD_CALL                                         !0, 'getName'
          8        DO_FCALL                                      0  $7      
          9        IS_EQUAL                                                 $7, 'modify'
         10      > JMPZ                                                     ~8, ->27
    6    11    >   INIT_METHOD_CALL                                         !0, 'getTentativeReturnType'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !1, $9
    7    14        INSTANCEOF                                               !1, 'ReflectionUnionType'
         15      > JMPZ                                                     ~11, ->27
    8    16    >   INIT_METHOD_CALL                                         !1, 'getTypes'
         17        DO_FCALL                                      0  $12     
         18      > FE_RESET_R                                       $13     $12, ->26
         19    > > FE_FETCH_R                                               $13, !2, ->26
    9    20    >   INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !2, 'getName'
         22        DO_FCALL                                      0  $14     
         23        SEND_VAR                                                 $14
         24        DO_ICALL                                                 
    8    25      > JMP                                                      ->19
         26    >   FE_FREE                                                  $13
    4    27    > > JMP                                                      ->6
         28    >   FE_FREE                                                  $6
   13    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.63 ms | 998 KiB | 14 Q