3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected static function bar($arg) { return $arg * 1; } public static function test() { $foo = 'e'; switch ($foo) { case 'a': $b = 1; break; case 'b': $b = 2; break; case 'c': $b = 3; break; case 'd': $b = 4; break; case 'e': $b = 5; break; } var_dump($b); } } Foo::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zb88o
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zb88o
function name:  bar
number of ops:  4
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        MUL                                              ~1      !0, 1
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function bar

Function test:
Finding entry points
Branch analysis from position: 0
7 jumps found. (Code = 188) Position 1 = 13, Position 2 = 15, Position 3 = 17, Position 4 = 19, Position 5 = 21, Position 6 = 23, Position 7 = 2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 23
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 21
Branch analysis from position: 19
Branch analysis from position: 17
Branch analysis from position: 15
Branch analysis from position: 13
filename:       /in/Zb88o
function name:  test
number of ops:  27
compiled vars:  !0 = $foo, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 'e'
   14     1      > SWITCH_STRING                                            !0, [ 'a':->13, 'b':->15, 'c':->17, 'd':->19, 'e':->21, ], ->23
   15     2    >   IS_EQUAL                                                 !0, 'a'
          3      > JMPNZ                                                    ~3, ->13
   18     4    >   IS_EQUAL                                                 !0, 'b'
          5      > JMPNZ                                                    ~3, ->15
   21     6    >   IS_EQUAL                                                 !0, 'c'
          7      > JMPNZ                                                    ~3, ->17
   24     8    >   IS_EQUAL                                                 !0, 'd'
          9      > JMPNZ                                                    ~3, ->19
   27    10    >   IS_EQUAL                                                 !0, 'e'
         11      > JMPNZ                                                    ~3, ->21
         12    > > JMP                                                      ->23
   16    13    >   ASSIGN                                                   !1, 1
   17    14      > JMP                                                      ->23
   19    15    >   ASSIGN                                                   !1, 2
   20    16      > JMP                                                      ->23
   22    17    >   ASSIGN                                                   !1, 3
   23    18      > JMP                                                      ->23
   25    19    >   ASSIGN                                                   !1, 4
   26    20      > JMP                                                      ->23
   28    21    >   ASSIGN                                                   !1, 5
   29    22      > JMP                                                      ->23
   32    23    >   INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
   33    26      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.86 ms | 1392 KiB | 15 Q