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'; case false: $classes[] = 'false'; } echo 'class="' . implode(' ', $classes) . '"';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
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: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Pd1L
function name:  (null)
number of ops:  26
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, ->10
   10     4    >   IS_SMALLER                                               0, !0
          5      > JMPNZ                                                    ~6, ->12
   12     6    >   IS_EQUAL                                                 !0, 0
          7      > JMPNZ                                                    ~7, ->14
   14     8    > > JMPNZ                                                    <false>, ->16
          9    > > JMP                                                      ->18
    9    10    >   ASSIGN_DIM                                               !1
         11        OP_DATA                                                  'full'
   11    12    >   ASSIGN_DIM                                               !1
         13        OP_DATA                                                  'used'
   13    14    >   ASSIGN_DIM                                               !1
         15        OP_DATA                                                  'empty'
   15    16    >   ASSIGN_DIM                                               !1
         17        OP_DATA                                                  'false'
   18    18    >   INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '+'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $12     
         22        CONCAT                                           ~13     'class%3D%22', $12
         23        CONCAT                                           ~14     ~13, '%22'
         24        ECHO                                                     ~14
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.36 ms | 1396 KiB | 15 Q