3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCallableName(callable $callable) { if (is_string($callable)) { return trim($callable); } else if (is_array($callable)) { if (is_object($callable[0])) { return sprintf("%s::%s", get_class($callable[0]), trim($callable[1])); } else { return sprintf("%s::%s", trim($callable[0]), trim($callable[1])); } } else if ($callable instanceof Closure) { return 'closure'; } else { return 'unknown'; } } getCallableName('foo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YdlTh
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'getcallablename'
          1        SEND_VAL                                                 'foo'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function getcallablename:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 41
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YdlTh
function name:  getCallableName
number of ops:  47
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                   64          !0
          2      > JMPZ                                                     ~1, ->8
    5     3    >   INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    4     7*       JMP                                                      ->46
    6     8    >   TYPE_CHECK                                  128          !0
          9      > JMPZ                                                     ~3, ->41
    7    10    >   FETCH_DIM_R                                      ~4      !0, 0
         11        TYPE_CHECK                                  256          ~4
         12      > JMPZ                                                     ~5, ->26
    8    13    >   INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '%25s%3A%3A%25s'
         15        FETCH_DIM_R                                      ~6      !0, 0
         16        GET_CLASS                                        ~7      ~6
         17        SEND_VAL                                                 ~7
         18        INIT_FCALL                                               'trim'
         19        FETCH_DIM_R                                      ~8      !0, 1
         20        SEND_VAL                                                 ~8
         21        DO_ICALL                                         $9      
         22        SEND_VAR                                                 $9
         23        DO_ICALL                                         $10     
         24      > RETURN                                                   $10
    7    25*       JMP                                                      ->40
   10    26    >   INIT_FCALL                                               'sprintf'
         27        SEND_VAL                                                 '%25s%3A%3A%25s'
         28        INIT_FCALL                                               'trim'
         29        FETCH_DIM_R                                      ~11     !0, 0
         30        SEND_VAL                                                 ~11
         31        DO_ICALL                                         $12     
         32        SEND_VAR                                                 $12
         33        INIT_FCALL                                               'trim'
         34        FETCH_DIM_R                                      ~13     !0, 1
         35        SEND_VAL                                                 ~13
         36        DO_ICALL                                         $14     
         37        SEND_VAR                                                 $14
         38        DO_ICALL                                         $15     
         39      > RETURN                                                   $15
    6    40*       JMP                                                      ->46
   12    41    >   INSTANCEOF                                               !0, 'Closure'
         42      > JMPZ                                                     ~16, ->45
   13    43    > > RETURN                                                   'closure'
   12    44*       JMP                                                      ->46
   15    45    > > RETURN                                                   'unknown'
   17    46*     > RETURN                                                   null

End of function getcallablename

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
287.56 ms | 1022 KiB | 17 Q