3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sum = '343.26'; function format($sum) { $commaFree = strtr($sum, '.', ''); $curLen = strlen($commaFree); for ($i = 0; $i < $curLen; $i++) { $commaFree = '0' . $commaFree; } return $commaFree; } var_dump(format($sum));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hWhO6
function name:  (null)
number of ops:  8
compiled vars:  !0 = $sum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '343.26'
   14     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'format'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function format:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/hWhO6
function name:  format
number of ops:  18
compiled vars:  !0 = $sum, !1 = $commaFree, !2 = $curLen, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'strtr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.'
          4        SEND_VAL                                                 ''
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    7     7        STRLEN                                           ~6      !1
          8        ASSIGN                                                   !2, ~6
    8     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->14
    9    11    >   CONCAT                                           ~9      '0', !1
         12        ASSIGN                                                   !1, ~9
    8    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !2
         15      > JMPNZ                                                    ~12, ->11
   11    16    > > RETURN                                                   !1
   12    17*     > RETURN                                                   null

End of function format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.53 ms | 1403 KiB | 18 Q