3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amounts = array(0.001, 0.005, 5.20, 5.195, 5.204, 5); foreach ($amounts as $amount) { echo $amount , "->" , (int)number_format($amount, 2, '', '')."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ir54s
function name:  (null)
number of ops:  17
compiled vars:  !0 = $amounts, !1 = $amount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > FE_RESET_R                                       $3      !0, ->15
          2    > > FE_FETCH_R                                               $3, !1, ->15
    4     3    >   ECHO                                                     !1
          4        ECHO                                                     '-%3E'
          5        INIT_FCALL                                               'number_format'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 2
          8        SEND_VAL                                                 ''
          9        SEND_VAL                                                 ''
         10        DO_ICALL                                         $4      
         11        CAST                                          4  ~5      $4
         12        CONCAT                                           ~6      ~5, '%0A'
         13        ECHO                                                     ~6
    3    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $3
    5    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.44 ms | 997 KiB | 14 Q