3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function method($maskName = 'default') { switch ($maskName) { case 'default': return 'somemask'; case 'other': return 'different mask'; default: throw new Exception('Unknown: ' . $maskName); } } } $a = new A(); $a->method('other'); $a->method(); $a->method('undefined');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6UmXb
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'method'
          4        SEND_VAL_EX                                              'other'
          5        DO_FCALL                                      0          
   22     6        INIT_METHOD_CALL                                         !0, 'method'
          7        DO_FCALL                                      0          
   24     8        INIT_METHOD_CALL                                         !0, 'method'
          9        SEND_VAL_EX                                              'undefined'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class A:
Function method:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 7, Position 2 = 8, Position 3 = 9, Position 4 = 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 8
Branch analysis from position: 7
filename:       /in/6UmXb
function name:  method
number of ops:  15
compiled vars:  !0 = $maskName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      'default'
    7     1      > SWITCH_STRING                                            !0, [ 'default':->7, 'other':->8, ], ->9
    8     2    >   IS_EQUAL                                                 !0, 'default'
          3      > JMPNZ                                                    ~1, ->7
   10     4    >   IS_EQUAL                                                 !0, 'other'
          5      > JMPNZ                                                    ~1, ->8
          6    > > JMP                                                      ->9
    9     7    > > RETURN                                                   'somemask'
   11     8    > > RETURN                                                   'different+mask'
   13     9    >   NEW                                              $2      'Exception'
         10        CONCAT                                           ~3      'Unknown%3A+', !0
         11        SEND_VAL_EX                                              ~3
         12        DO_FCALL                                      0          
         13      > THROW                                         0          $2
   15    14*     > RETURN                                                   null

End of function method

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.94 ms | 1399 KiB | 13 Q