3v4l.org

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

Function return_bytes:
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 188) Position 1 = 44, Position 2 = 44, Position 3 = 49, Position 4 = 49, Position 5 = 54, Position 6 = 35
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 49
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 44
Branch analysis from position: 44
filename:       /in/guKK7
function name:  return_bytes
number of ops:  56
compiled vars:  !0 = $val, !1 = $lat, !2 = $string, !3 = $strig, !4 = $strg, !5 = $stg, !6 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
    6     5        INIT_FCALL                                               'str_split'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !1, $9
    7     9        INIT_FCALL                                               'strpbrk'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'M'
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !2, $11
    9    14        INIT_FCALL                                               'strpbrk'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 'm'
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !3, $13
   10    19        INIT_FCALL                                               'strpbrk'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 'K'
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !4, $15
   11    24        INIT_FCALL                                               'strpbrk'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 'k'
         27        DO_ICALL                                         $17     
         28        ASSIGN                                                   !5, $17
   12    29        INIT_ARRAY                                       ~19     !3
         30        ADD_ARRAY_ELEMENT                                ~19     !4
         31        ADD_ARRAY_ELEMENT                                ~19     !2
         32        ADD_ARRAY_ELEMENT                                ~19     !5
         33        ASSIGN                                                   !6, ~19
   13    34      > SWITCH_STRING                                            !6, [ 'k':->44, 'K':->44, 'm':->49, 'M':->49, ], ->54
   14    35    >   IS_EQUAL                                                 !6, 'k'
         36      > JMPNZ                                                    ~21, ->44
   15    37    >   IS_EQUAL                                                 !6, 'K'
         38      > JMPNZ                                                    ~21, ->44
   18    39    >   IS_EQUAL                                                 !6, 'm'
         40      > JMPNZ                                                    ~21, ->49
   19    41    >   IS_EQUAL                                                 !6, 'M'
         42      > JMPNZ                                                    ~21, ->49
         43    > > JMP                                                      ->54
   16    44    >   FETCH_DIM_R                                      ~22     !1, 0
         45        CAST                                          4  ~23     ~22
         46        MUL                                              ~24     ~23, 1024
         47      > RETURN                                                   ~24
   17    48*       JMP                                                      ->55
   20    49    >   FETCH_DIM_R                                      ~25     !1, 0
         50        CAST                                          4  ~26     ~25
         51        MUL                                              ~27     ~26, 1048576
         52      > RETURN                                                   ~27
   21    53*       JMP                                                      ->55
   23    54    > > RETURN                                                   !0
   25    55*     > RETURN                                                   null

End of function return_bytes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.69 ms | 1400 KiB | 19 Q