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; } } foo(3); echo "\n"; foo(42);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tEcdc
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0          
   20     3        ECHO                                                     '%0A'
   21     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 = 6
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
filename:       /in/tEcdc
function name:  foo
number of ops:  11
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, ->6
   11     3    >   IS_EQUAL                                                 !0, 2
          4      > JMPNZ                                                    ~1, ->8
          5    > > JMP                                                      ->8
    8     6    >   ECHO                                                     'one'
    9     7      > JMP                                                      ->10
   13     8    >   ECHO                                                     'two%2C+which+is+the+default'
   14     9      > JMP                                                      ->10
   17    10    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.42 ms | 1398 KiB | 15 Q