3v4l.org

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

End of function sim

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.15 ms | 483 KiB | 11 Q