3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 37; $classes = []; switch (true) { case ($value >= 100): $classes[] = 'full'; case ($value > 0): $classes[] = 'used'; case ($value == 0): $classes[] = 'empty'; } echo 'class="' . implode(' ', $classes) . '"';
Finding entry points
Branch analysis from position: 0
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
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: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SK3Fm
function name:  (null)
number of ops:  23
compiled vars:  !0 = $value, !1 = $classes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 37
    4     1        ASSIGN                                                   !1, <array>
    8     2        IS_SMALLER_OR_EQUAL                                      100, !0
          3      > JMPNZ                                                    ~5, ->9
   10     4    >   IS_SMALLER                                               0, !0
          5      > JMPNZ                                                    ~6, ->11
   12     6    >   IS_EQUAL                                                 !0, 0
          7      > JMPNZ                                                    ~7, ->13
          8    > > JMP                                                      ->15
    9     9    >   ASSIGN_DIM                                               !1
         10        OP_DATA                                                  'full'
   11    11    >   ASSIGN_DIM                                               !1
         12        OP_DATA                                                  'used'
   13    13    >   ASSIGN_DIM                                               !1
         14        OP_DATA                                                  'empty'
   16    15    >   INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '+'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     'class%3D%22', $11
         20        CONCAT                                           ~13     ~12, '%22'
         21        ECHO                                                     ~13
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.72 ms | 1395 KiB | 15 Q