3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($a) { switch ( $a ) { case 1: echo 'one'; break; case 2: default: echo 'two, which is the default'; break; case 3: echo 'three'; break; } } foo(3); echo "\n"; foo(42);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9vC1f
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0          
   23     3        ECHO                                                     '%0A'
   24     4        INIT_FCALL                                               'foo'
          5        SEND_VAL                                                 42
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
filename:       /in/9vC1f
function name:  foo
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    7     1        IS_EQUAL                                                 !0, 1
          2      > JMPNZ                                                    ~1, ->8
   11     3    >   IS_EQUAL                                                 !0, 2
          4      > JMPNZ                                                    ~1, ->10
   16     5    >   IS_EQUAL                                                 !0, 3
          6      > JMPNZ                                                    ~1, ->12
          7    > > JMP                                                      ->10
    8     8    >   ECHO                                                     'one'
    9     9      > JMP                                                      ->14
   13    10    >   ECHO                                                     'two%2C+which+is+the+default'
   14    11      > JMP                                                      ->14
   17    12    >   ECHO                                                     'three'
   18    13      > JMP                                                      ->14
   20    14    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1399 KiB | 15 Q