3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sim() { $controller = NULL; if (strpos($controller, ':') === FALSE) { if (method_exists($controller, '__invoke')) { return [$controller, '__invoke']; } if (function_exists($controller)) { return $controller; } return NULL; } } var_dump(sim());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oYFT
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'sim'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function sim:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oYFT
function name:  sim
number of ops:  22
compiled vars:  !0 = $controller
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%3A'
          4        DO_ICALL                                         $2      
          5        TYPE_CHECK                                    4          $2
          6      > JMPZ                                                     ~3, ->21
    5     7    >   INIT_FCALL                                               'method_exists'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '__invoke'
         10        DO_ICALL                                         $4      
         11      > JMPZ                                                     $4, ->15
    6    12    >   INIT_ARRAY                                       ~5      !0
         13        ADD_ARRAY_ELEMENT                                ~5      '__invoke'
         14      > RETURN                                                   ~5
    8    15    >   INIT_FCALL                                               'function_exists'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $6      
         18      > JMPZ                                                     $6, ->20
    9    19    > > RETURN                                                   !0
   11    20    > > RETURN                                                   null
   13    21    > > RETURN                                                   null

End of function sim

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.48 ms | 1403 KiB | 22 Q