3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array( 20/3, 20/3 * 1e6, 6.66, 6.0, 60.0, ); $p = (int) ini_get('precision'); foreach ($numbers as $n) { echo 'RAW: ' . $n . "\n"; echo 'EXP: ' . var_export($n, TRUE) . "\n"; echo 'FIX: ' . rtrim(rtrim(sprintf('%.' . $p . 'F', $n), '0'), '.') . "\n"; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 37
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 37
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/0taV8
function name:  (null)
number of ops:  39
compiled vars:  !0 = $numbers, !1 = $p, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'ini_get'
          2        SEND_VAL                                                 'precision'
          3        DO_ICALL                                         $4      
          4        CAST                                          4  ~5      $4
          5        ASSIGN                                                   !1, ~5
   13     6      > FE_RESET_R                                       $7      !0, ->37
          7    > > FE_FETCH_R                                               $7, !2, ->37
   14     8    >   CONCAT                                           ~8      'RAW%3A+', !2
          9        CONCAT                                           ~9      ~8, '%0A'
         10        ECHO                                                     ~9
   15    11        INIT_FCALL                                               'var_export'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $10     
         15        CONCAT                                           ~11     'EXP%3A+', $10
         16        CONCAT                                           ~12     ~11, '%0A'
         17        ECHO                                                     ~12
   16    18        INIT_FCALL                                               'rtrim'
         19        INIT_FCALL                                               'rtrim'
         20        INIT_FCALL                                               'sprintf'
         21        CONCAT                                           ~13     '%25.', !1
         22        CONCAT                                           ~14     ~13, 'F'
         23        SEND_VAL                                                 ~14
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $15     
         26        SEND_VAR                                                 $15
         27        SEND_VAL                                                 '0'
         28        DO_ICALL                                         $16     
         29        SEND_VAR                                                 $16
         30        SEND_VAL                                                 '.'
         31        DO_ICALL                                         $17     
         32        CONCAT                                           ~18     'FIX%3A+', $17
         33        CONCAT                                           ~19     ~18, '%0A'
         34        ECHO                                                     ~19
   17    35        ECHO                                                     '%0A'
   13    36      > JMP                                                      ->7
         37    >   FE_FREE                                                  $7
   18    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158 ms | 1396 KiB | 21 Q