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 =rtrim($val,"8"); switch($last) { case 'k': case 'K': return (int) $val * 1024; break; case 'm': case 'M': return (int) $val * 1048576; 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/kdWER
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 = 24, Position 4 = 24, Position 5 = 28, 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: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 28
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 = 24
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 24
Branch analysis from position: 24
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/kdWER
function name:  return_bytes
number of ops:  30
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                                               'rtrim'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 '8'
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    6    10      > SWITCH_STRING                                            !1, [ 'k':->20, 'K':->20, 'm':->24, 'M':->24, ], ->28
    7    11    >   IS_EQUAL                                                 !1, 'k'
         12      > JMPNZ                                                    ~6, ->20
    8    13    >   IS_EQUAL                                                 !1, 'K'
         14      > JMPNZ                                                    ~6, ->20
   11    15    >   IS_EQUAL                                                 !1, 'm'
         16      > JMPNZ                                                    ~6, ->24
   12    17    >   IS_EQUAL                                                 !1, 'M'
         18      > JMPNZ                                                    ~6, ->24
         19    > > JMP                                                      ->28
    9    20    >   CAST                                          4  ~7      !0
         21        MUL                                              ~8      ~7, 1024
         22      > RETURN                                                   ~8
   10    23*       JMP                                                      ->29
   13    24    >   CAST                                          4  ~9      !0
         25        MUL                                              ~10     ~9, 1048576
         26      > RETURN                                                   ~10
   14    27*       JMP                                                      ->29
   16    28    > > RETURN                                                   !0
   18    29*     > RETURN                                                   null

End of function return_bytes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.44 ms | 945 KiB | 18 Q