3v4l.org

run code in 300+ PHP versions simultaneously
<?php function code($code){ switch ($code) { case 403: return 1; break; case 422: return 2; break; default: 1; break; } } $getcode = code(422); var_dump($getcode);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pUEDb
function name:  (null)
number of ops:  8
compiled vars:  !0 = $getcode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'code'
          1        SEND_VAL                                                 422
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function code:
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 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
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: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pUEDb
function name:  code
number of ops:  12
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, 403
          2      > JMPNZ                                                    ~1, ->6
    7     3    >   IS_EQUAL                                                 !0, 422
          4      > JMPNZ                                                    ~1, ->8
          5    > > JMP                                                      ->10
    5     6    > > RETURN                                                   1
    6     7*       JMP                                                      ->11
    8     8    > > RETURN                                                   2
    9     9*       JMP                                                      ->11
   12    10    > > JMP                                                      ->11
   14    11    > > RETURN                                                   null

End of function code

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.94 ms | 1398 KiB | 16 Q