3v4l.org

run code in 300+ PHP versions simultaneously
<?php function abreviateTotalCount($value) { $abbreviations = array(12 => 'T', 9 => 'B', 6 => 'M', 3 => 'K', 0 => ''); foreach($abbreviations as $exponent => $abbreviation) { if($value >= pow(10, $exponent)) { return round(floatval($value / pow(10, $exponent)),2).$abbreviation; } } } echo abreviateTotalCount(10034);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KNTjV
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'abreviatetotalcount'
          1        SEND_VAL                                                 10034
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function abreviatetotalcount:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/KNTjV
function name:  abreviateTotalCount
number of ops:  27
compiled vars:  !0 = $value, !1 = $abbreviations, !2 = $abbreviation, !3 = $exponent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $5      !1, ->25
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->25
          4    >   ASSIGN                                                   !3, ~6
    7     5        INIT_FCALL                                               'pow'
          6        SEND_VAL                                                 10
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $8      
          9        IS_SMALLER_OR_EQUAL                                      $8, !0
         10      > JMPZ                                                     ~9, ->24
    8    11    >   INIT_FCALL                                               'round'
         12        INIT_FCALL                                               'pow'
         13        SEND_VAL                                                 10
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $10     
         16        DIV                                              ~11     !0, $10
         17        CAST                                          5  ~12     ~11
         18        SEND_VAL                                                 ~12
         19        SEND_VAL                                                 2
         20        DO_ICALL                                         $13     
         21        CONCAT                                           ~14     $13, !2
         22        FE_FREE                                                  $5
         23      > RETURN                                                   ~14
    6    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $5
   11    26      > RETURN                                                   null

End of function abreviatetotalcount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.72 ms | 1399 KiB | 18 Q