3v4l.org

run code in 300+ PHP versions simultaneously
<?php function t($t) { switch ($t) { case 'a': return 'a'; case 'b': return 'b'; case 'c': return 'x'; default: return 'xx'; } return null; } var_dump(t('a'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WpM6u
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               't'
          2        SEND_VAL                                                 'a'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function t:
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 9, Position 2 = 10, Position 3 = 11, Position 4 = 12, Position 5 = 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 11
Branch analysis from position: 10
Branch analysis from position: 9
filename:       /in/WpM6u
function name:  t
number of ops:  15
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1      > SWITCH_STRING                                            !0, [ 'a':->9, 'b':->10, 'c':->11, ], ->12
    5     2    >   IS_EQUAL                                                 !0, 'a'
          3      > JMPNZ                                                    ~1, ->9
    7     4    >   IS_EQUAL                                                 !0, 'b'
          5      > JMPNZ                                                    ~1, ->10
    9     6    >   IS_EQUAL                                                 !0, 'c'
          7      > JMPNZ                                                    ~1, ->11
          8    > > JMP                                                      ->12
    6     9    > > RETURN                                                   'a'
    8    10    > > RETURN                                                   'b'
   10    11    > > RETURN                                                   'x'
   13    12    > > RETURN                                                   'xx'
   16    13*       RETURN                                                   null
   17    14*     > RETURN                                                   null

End of function t

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.93 ms | 1399 KiB | 16 Q