3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class FromVariable { public static function run($filter, bool $variable = true, bool $variable2 = false) { switch ($filter) { case $variable: $result = 'a'; break; case $variable2: $result = 'b'; break; default: throw new \InvalidArgumentException(); } var_dump($result); } } FromVariable::run(false, true, false);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jBE1q
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                      'FromVariable', 'run'
          1        SEND_VAL                                                     <false>
          2        SEND_VAL                                                     <true>
          3        SEND_VAL                                                     <false>
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Class FromVariable:
Function run:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
filename:       /in/jBE1q
function name:  run
number of ops:  19
compiled vars:  !0 = $filter, !1 = $variable, !2 = $variable2, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <true>
          2        RECV_INIT                                            !2      <false>
    8     3        IS_EQUAL                                                     !0, !1
          4      > JMPNZ                                                        ~4, ->8
   11     5    >   IS_EQUAL                                                     !0, !2
          6      > JMPNZ                                                        ~4, ->10
          7    > > JMP                                                          ->12
    9     8    >   ASSIGN                                                       !3, 'a'
   10     9      > JMP                                                          ->15
   12    10    >   ASSIGN                                                       !3, 'b'
   13    11      > JMP                                                          ->15
   15    12    >   NEW                                                  $7      'InvalidArgumentException'
         13        DO_FCALL                                          0          
         14      > THROW                                             0          $7
   18    15    >   INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !3
         17        DO_ICALL                                                     
   19    18      > RETURN                                                       null

End of function run

End of class FromVariable.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.63 ms | 480 KiB | 8 Q