3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 13000000; // Here's the function function formatter ($number) { $bil = floor ($number / 1000000000); $millions = $number % 1000000000; $mil = floor ($millions / 1000000); $thousands = $millions % 1000000; $thou = floor ($thousands / 1000); $str = ''; if ($bil != 0) { $str .= "{$bil} billions "; } if ($mil != 0) { $str .= "{$mil} millions "; } if ($thou != 0) { $str .= "{$thou} thousands "; } echo $str; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HaaTe
function name:  (null)
number of ops:  2
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 13000000
   31     1      > RETURN                                                   1

Function formatter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 31
Branch analysis from position: 26
filename:       /in/HaaTe
function name:  formatter
number of ops:  38
compiled vars:  !0 = $number, !1 = $bil, !2 = $millions, !3 = $mil, !4 = $thousands, !5 = $thou, !6 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'floor'
          2        DIV                                              ~7      !0, 1000000000
          3        SEND_VAL                                                 ~7
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    8     6        MOD                                              ~10     !0, 1000000000
          7        ASSIGN                                                   !2, ~10
   10     8        INIT_FCALL                                               'floor'
          9        DIV                                              ~12     !2, 1000000
         10        SEND_VAL                                                 ~12
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !3, $13
   11    13        MOD                                              ~15     !2, 1000000
         14        ASSIGN                                                   !4, ~15
   13    15        INIT_FCALL                                               'floor'
         16        DIV                                              ~17     !4, 1000
         17        SEND_VAL                                                 ~17
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !5, $18
   15    20        ASSIGN                                                   !6, ''
   17    21        IS_NOT_EQUAL                                             !1, 0
         22      > JMPZ                                                     ~21, ->26
   19    23    >   NOP                                                      
         24        FAST_CONCAT                                      ~22     !1, '+billions+'
         25        ASSIGN_OP                                     8          !6, ~22
   21    26    >   IS_NOT_EQUAL                                             !3, 0
         27      > JMPZ                                                     ~24, ->31
   23    28    >   NOP                                                      
         29        FAST_CONCAT                                      ~25     !3, '+millions+'
         30        ASSIGN_OP                                     8          !6, ~25
   25    31    >   IS_NOT_EQUAL                                             !5, 0
         32      > JMPZ                                                     ~27, ->36
   27    33    >   NOP                                                      
         34        FAST_CONCAT                                      ~28     !5, '+thousands+'
         35        ASSIGN_OP                                     8          !6, ~28
   30    36    >   ECHO                                                     !6
   31    37      > RETURN                                                   null

End of function formatter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.17 ms | 1400 KiB | 15 Q