3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = -2
filename:       /in/KNTjV
function name:  (null)
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  12     1        INIT_FCALL                                               'abreviatetotalcount'
         2        SEND_VAL                                                 10034
         3        DO_FCALL                                      0  $0      
         4        ECHO                                                     $0
         5      > RETURN                                                   1

Function abreviatetotalcount:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
Jump found. Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
Jump found. Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
Jump found. Position 1 = -2
Branch analysis from position: 26
Jump found. Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Jump found. Position 1 = -2
Branch analysis from position: 27
filename:       /in/KNTjV
function name:  abreviateTotalCount
number of ops:  29
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, ->27
         3    > > FE_FETCH_R                                       ~6      $5, !2, ->27
         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                              ~9      $8, !0
        10      > JMPZ                                                     ~9, ->26
   8    11    >   INIT_FCALL                                               'round'
        12        INIT_FCALL                                               'floatval'
        13        INIT_FCALL                                               'pow'
        14        SEND_VAL                                                 10
        15        SEND_VAR                                                 !3
        16        DO_ICALL                                         $10     
        17        DIV                                              ~11     !0, $10
        18        SEND_VAL                                                 ~11
        19        DO_ICALL                                         $12     
        20        SEND_VAR                                                 $12
        21        SEND_VAL                                                 2
        22        DO_ICALL                                         $13     
        23        CONCAT                                           ~14     $13, !2
        24        FE_FREE                                                  $5
        25      > RETURN                                                   ~14
        26    > > JMP                                                      ->3
        27    >   FE_FREE                                                  $5
  11    28      > RETURN                                                   null

End of function abreviatetotalcount

Generated using Vulcan Logic Dumper, using php 7.3.0