3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getImg ($src) { switch ($src) { case "Sunny": echo "<img src='fakepath/sunny.png'>"; break; case "Sad": echo "<img src='fakepath/sad.png'>"; break; case "Smile": echo "<img src='fakepath/smile.png'>"; break; default: echo "nothing"; break; } } $style = "Sad"; getImg($style); $style = 'Sunny'; getImg($style); $style = 'Smile'; getImg($style);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPsbA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $style
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, 'Sad'
   20     1        INIT_FCALL                                               'getimg'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   22     4        ASSIGN                                                   !0, 'Sunny'
   23     5        INIT_FCALL                                               'getimg'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   25     8        ASSIGN                                                   !0, 'Smile'
   26     9        INIT_FCALL                                               'getimg'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function getimg:
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 9, Position 2 = 11, Position 3 = 13, Position 4 = 15, Position 5 = 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
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 = 11
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 13
Branch analysis from position: 11
Branch analysis from position: 9
filename:       /in/NPsbA
function name:  getImg
number of ops:  18
compiled vars:  !0 = $src
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1      > SWITCH_STRING                                            !0, [ 'Sunny':->9, 'Sad':->11, 'Smile':->13, ], ->15
    6     2    >   IS_EQUAL                                                 !0, 'Sunny'
          3      > JMPNZ                                                    ~1, ->9
    9     4    >   IS_EQUAL                                                 !0, 'Sad'
          5      > JMPNZ                                                    ~1, ->11
   12     6    >   IS_EQUAL                                                 !0, 'Smile'
          7      > JMPNZ                                                    ~1, ->13
          8    > > JMP                                                      ->15
    7     9    >   ECHO                                                     '%3Cimg+src%3D%27fakepath%2Fsunny.png%27%3E'
    8    10      > JMP                                                      ->17
   10    11    >   ECHO                                                     '%3Cimg+src%3D%27fakepath%2Fsad.png%27%3E'
   11    12      > JMP                                                      ->17
   13    13    >   ECHO                                                     '%3Cimg+src%3D%27fakepath%2Fsmile.png%27%3E'
   14    14      > JMP                                                      ->17
   15    15    >   ECHO                                                     'nothing'
         16      > JMP                                                      ->17
   17    17    > > RETURN                                                   null

End of function getimg

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.7 ms | 1403 KiB | 16 Q