3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'post_max_size in bytes = '.return_byte("8M"); function return_bytes($val) { $val = trim($val); $last =str_split($val); switch($last[1]) { case 'k': case 'K': return (int) $val * 1024; break; case 'm': case 'M': echo 'm'; break; default: return $val; } } echo 'post_max_size in bytes = ' .return_byte('8M'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bRun7
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'return_byte'
          1        SEND_VAL_EX                                              '8M'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      'post_max_size+in+bytes+%3D+', $0
          4        ECHO                                                     ~1
   19     5        INIT_FCALL_BY_NAME                                       'return_byte'
          6        SEND_VAL_EX                                              '8M'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      'post_max_size+in+bytes+%3D+', $2
          9        ECHO                                                     ~3
   21    10      > RETURN                                                   1

Function return_bytes:
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 188) Position 1 = 20, Position 2 = 20, Position 3 = 25, Position 4 = 25, Position 5 = 27, Position 6 = 11
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/bRun7
function name:  return_bytes
number of ops:  31
compiled vars:  !0 = $val, !1 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    5     5        INIT_FCALL                                               'str_split'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    6     9        FETCH_DIM_R                                      ~6      !1, 1
         10      > SWITCH_STRING                                            ~6, [ 'k':->20, 'K':->20, 'm':->25, 'M':->25, ], ->27
    7    11    >   CASE                                                     ~6, 'k'
         12      > JMPNZ                                                    ~7, ->20
    8    13    >   CASE                                                     ~6, 'K'
         14      > JMPNZ                                                    ~7, ->20
   11    15    >   CASE                                                     ~6, 'm'
         16      > JMPNZ                                                    ~7, ->25
   12    17    >   CASE                                                     ~6, 'M'
         18      > JMPNZ                                                    ~7, ->25
         19    > > JMP                                                      ->27
    9    20    >   CAST                                          4  ~8      !0
         21        MUL                                              ~9      ~8, 1024
         22        FREE                                                     ~6
         23      > RETURN                                                   ~9
   10    24*       JMP                                                      ->29
   13    25    >   ECHO                                                     'm'
   14    26      > JMP                                                      ->29
   16    27    >   FREE                                                     ~6
         28      > RETURN                                                   !0
         29    >   FREE                                                     ~6
   18    30      > RETURN                                                   null

End of function return_bytes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.64 ms | 1400 KiB | 17 Q