3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array('a', 'b', 'c'); array_map(function ($test) { switch($test) { case 'a': case 'b': echo 'Match "B" case' . PHP_EOL; break; case 'c'; echo 'Match "C" case' . PHP_EOL; break; } }, $test); echo PHP_EOL . 'Done';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7L7Gd
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7L7Gd%3A6%240'
   16     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   19     6        ECHO                                                     '%0ADone'
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7L7Gd%3A6%240:
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 9, Position 2 = 9, Position 3 = 11, Position 4 = 13, Position 5 = 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 13
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 = 9
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 = 13
Branch analysis from position: 13
Branch analysis from position: 11
Branch analysis from position: 9
Branch analysis from position: 9
filename:       /in/7L7Gd
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1      > SWITCH_STRING                                            !0, [ 'a':->9, 'b':->9, 'c':->11, ], ->13
    8     2    >   IS_EQUAL                                                 !0, 'a'
          3      > JMPNZ                                                    ~1, ->9
    9     4    >   IS_EQUAL                                                 !0, 'b'
          5      > JMPNZ                                                    ~1, ->9
   12     6    >   IS_EQUAL                                                 !0, 'c'
          7      > JMPNZ                                                    ~1, ->11
          8    > > JMP                                                      ->13
   10     9    >   ECHO                                                     'Match+%22B%22+case%0A'
   11    10      > JMP                                                      ->13
   13    11    >   ECHO                                                     'Match+%22C%22+case%0A'
   14    12      > JMP                                                      ->13
   16    13    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7L7Gd%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.17 ms | 1396 KiB | 15 Q