3v4l.org

run code in 300+ PHP versions simultaneously
<?php class O { public $string = 'string'; public $int = 0; public $float = 1.0; function method($name) { return $this->$name; } } $o = new O; switch ('string') { case $o->string: case $o->int: case $o->float: echo "accept\n"; break; } switch ('string') { case $o->method('string'): case $o->method('int'): case $o->method('float'): echo "accept\n"; break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 31
Branch analysis from position: 31
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 13
Branch analysis from position: 13
filename:       /in/hGc2o
function name:  (null)
number of ops:  34
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'O'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        FETCH_OBJ_R                                      ~5      !0, 'string'
          4        IS_EQUAL                                                 ~5, 'string'
          5      > JMPNZ                                                    ~4, ->13
   16     6    >   FETCH_OBJ_R                                      ~6      !0, 'int'
          7        IS_EQUAL                                                 ~6, 'string'
          8      > JMPNZ                                                    ~4, ->13
   17     9    >   FETCH_OBJ_R                                      ~7      !0, 'float'
         10        IS_EQUAL                                                 ~7, 'string'
         11      > JMPNZ                                                    ~4, ->13
         12    > > JMP                                                      ->15
   18    13    >   ECHO                                                     'accept%0A'
   19    14      > JMP                                                      ->15
   23    15    >   INIT_METHOD_CALL                                         !0, 'method'
         16        SEND_VAL_EX                                              'string'
         17        DO_FCALL                                      0  $9      
         18        IS_EQUAL                                                 $9, 'string'
         19      > JMPNZ                                                    ~8, ->31
   24    20    >   INIT_METHOD_CALL                                         !0, 'method'
         21        SEND_VAL_EX                                              'int'
         22        DO_FCALL                                      0  $10     
         23        IS_EQUAL                                                 $10, 'string'
         24      > JMPNZ                                                    ~8, ->31
   25    25    >   INIT_METHOD_CALL                                         !0, 'method'
         26        SEND_VAL_EX                                              'float'
         27        DO_FCALL                                      0  $11     
         28        IS_EQUAL                                                 $11, 'string'
         29      > JMPNZ                                                    ~8, ->31
         30    > > JMP                                                      ->33
   26    31    >   ECHO                                                     'accept%0A'
   27    32      > JMP                                                      ->33
   28    33    > > RETURN                                                   1

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

End of function method

End of class O.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.05 ms | 1399 KiB | 13 Q